From 64ea49334eaede7d554b4fc7262ed48971422773 Mon Sep 17 00:00:00 2001 From: He4eT Date: Fri, 18 Dec 2020 14:14:55 +0500 Subject: [PATCH] release: 2020-12-18-1 --- docs/200.html | 2 +- docs/404.html | 2 +- docs/bundle.6319d.js | 2 ++ docs/bundle.6319d.js.map | 1 + docs/bundle.a9a47.js | 2 -- docs/bundle.a9a47.js.map | 1 - docs/bundle.c6d55.esm.js | 2 -- docs/bundle.c6d55.esm.js.map | 1 - docs/bundle.e0447.esm.js | 2 ++ docs/bundle.e0447.esm.js.map | 1 + docs/index.html | 2 +- docs/polyfills.03bf6.js | 2 -- docs/polyfills.7fc88.esm.js | 2 ++ .../{polyfills.e3a06.esm.js.map => polyfills.7fc88.esm.js.map} | 2 +- docs/polyfills.dd476.js | 2 ++ docs/{polyfills.03bf6.js.map => polyfills.dd476.js.map} | 2 +- docs/polyfills.e3a06.esm.js | 2 -- docs/push-manifest.json | 2 +- docs/ssr-build/ssr-bundle.js | 2 +- docs/ssr-build/ssr-bundle.js.map | 2 +- docs/sw-esm.js | 2 +- docs/sw-esm.js.map | 2 +- docs/sw.js | 2 +- docs/sw.js.map | 2 +- preact.config.js | 3 +++ 25 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 docs/bundle.6319d.js create mode 100644 docs/bundle.6319d.js.map delete mode 100644 docs/bundle.a9a47.js delete mode 100644 docs/bundle.a9a47.js.map delete mode 100644 docs/bundle.c6d55.esm.js delete mode 100644 docs/bundle.c6d55.esm.js.map create mode 100644 docs/bundle.e0447.esm.js create mode 100644 docs/bundle.e0447.esm.js.map delete mode 100644 docs/polyfills.03bf6.js create mode 100644 docs/polyfills.7fc88.esm.js rename docs/{polyfills.e3a06.esm.js.map => polyfills.7fc88.esm.js.map} (50%) create mode 100644 docs/polyfills.dd476.js rename docs/{polyfills.03bf6.js.map => polyfills.dd476.js.map} (50%) delete mode 100644 docs/polyfills.e3a06.esm.js create mode 100644 preact.config.js diff --git a/docs/200.html b/docs/200.html index 94e4d78..d19350e 100644 --- a/docs/200.html +++ b/docs/200.html @@ -1 +1 @@ -huge-link \ No newline at end of file +huge-link \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index 5562f35..1da028f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -huge-link

Huge link

A minimalist serverless publishing tool that allows you to create markdown posts and push them to the Web by sharing the link.

\ No newline at end of file +huge-link

Huge link

A minimalist serverless publishing tool that allows you to create markdown posts and push them to the Web by sharing the link.

\ No newline at end of file diff --git a/docs/bundle.6319d.js b/docs/bundle.6319d.js new file mode 100644 index 0000000..a6615e0 --- /dev/null +++ b/docs/bundle.6319d.js @@ -0,0 +1,2 @@ +!function(t){function n(n){for(var e,r,o=n[0],i=n[1],_=0,l=[];_=e.__.length&&e.__.push({}),e.__[t]}function o(t){return x=1,u(g,t)}function u(t,n,e){var o=r(b++,2);return o.t=t,o.__c||(o.__=[e?e(n):g(void 0,n),function(t){var n=o.t(o.__[0],t);o.__[0]!==n&&(o.__=[n,o.__[1]],o.__c.setState({}))}],o.__c=k),o.__}function i(t,n){var e=r(b++,3);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__H.__h.push(e))}function _(t,n){var e=r(b++,4);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__h.push(e))}function l(t){return x=5,a((function(){return{current:t}}),[])}function c(t,n,e){x=6,_((function(){"function"==typeof t?t(n()):t&&(t.current=n())}),null==e?e:e.concat(t))}function a(t,n){var e=r(b++,7);return m(e.__H,n)&&(e.__=t(),e.__H=n,e.__h=t),e.__}function f(t,n){return x=8,a((function(){return t}),n)}function s(t){var n=k.context[t.__c],e=r(b++,9);return e.__c=t,n?(null==e.__&&(e.__=!0,n.sub(k)),n.props.value):t.__}function p(t,n){w.options.useDebugValue&&w.options.useDebugValue(n?n(t):t)}function d(t){var n=r(b++,10),e=o();return n.__=t,k.componentDidCatch||(k.componentDidCatch=function(t){n.__&&n.__(t),e[1](t)}),[e[0],function(){e[1](void 0)}]}function h(){A.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(v),t.__H.__h.forEach(y),t.__H.__h=[]}catch(n){t.__H.__h=[],w.options.__e(n,t.__v)}})),A=[]}function v(t){var n=k;"function"==typeof t.__c&&t.__c(),k=n}function y(t){var n=k;t.__c=t.__(),k=n}function m(t,n){return!t||t.length!==n.length||n.some((function(n,e){return n!==t[e]}))}function g(t,n){return"function"==typeof n?n(t):n}e.d(n,"k",(function(){return o})),e.d(n,"i",(function(){return u})),e.d(n,"d",(function(){return i})),e.d(n,"g",(function(){return _})),e.d(n,"j",(function(){return l})),e.d(n,"f",(function(){return c})),e.d(n,"h",(function(){return a})),e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return s})),e.d(n,"c",(function(){return p})),e.d(n,"e",(function(){return d}));var b,k,C,w=e("hosL"),x=0,A=[],O=w.options.__b,E=w.options.__r,S=w.options.diffed,P=w.options.__c,j=w.options.unmount;w.options.__b=function(t){k=null,O&&O(t)},w.options.__r=function(t){E&&E(t),b=0;var n=(k=t.__c).__H;n&&(n.__h.forEach(v),n.__h.forEach(y),n.__h=[])},w.options.diffed=function(t){S&&S(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==A.push(n)&&C===w.options.requestAnimationFrame||((C=w.options.requestAnimationFrame)||function(t){var n,e=function(){clearTimeout(r),T&&cancelAnimationFrame(n),setTimeout(t)},r=setTimeout(e,100);T&&(n=requestAnimationFrame(e))})(h)),k=void 0},w.options.__c=function(t,n){n.some((function(t){try{t.__h.forEach(v),t.__h=t.__h.filter((function(t){return!t.__||y(t)}))}catch(e){n.some((function(t){t.__h&&(t.__h=[])})),n=[],w.options.__e(e,t.__v)}})),P&&P(t,n)},w.options.unmount=function(t){j&&j(t);var n=t.__c;if(n&&n.__H)try{n.__H.__.forEach(v)}catch(t){w.options.__e(t,n.__v)}};var T="function"==typeof requestAnimationFrame},QfWi:function(t,n,e){"use strict";function r(t){function n(){var n=this;u.Component.call(this),e||(this.componentWillMount=function(){t((function(t){e=t&&t.default||t,n.setState({})}))},this.shouldComponentUpdate=function(){return null!=e}),this.render=function(t){if(e)return Object(u.h)(e,t);var r=function t(n,e){if("string"==typeof n.type)return null;var r=n.__;if(r){var o=r.__k;if(o){Array.isArray(o)||(o=[o]);var u=o.indexOf(n);-1===u&&(u=o.length);for(var i=u;i--;){var _=o[i],l=_&&_.__e||t(_,!0);if(l)return l}}return e?void 0:t(r)}}(n.__v),o=r&&r.nextSibling||(n.__P||n._parentDom).firstChild;return o&&Object(u.h)(o.localName,{dangerouslySetInnerHTML:l})}}var e;return n.preload=t,(n.prototype=new u.Component).constructor=n,n}function o(){return(o=Object.assign||function(t){for(var n=1;nn.rank?-1:t.index-n.index}function i(t,n){return t.index=n,t.rank=function(t){return t.props.default?0:(n=t.props.path,_(n).map(l).join(""));var n}(t),t.props}function _(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function l(t){return":"==t.charAt(0)?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}function c(){var t;return""+((t=m&&m.location?m.location:m&&m.getCurrentLocation?m.getCurrentLocation():"undefined"!=typeof location?location:k).pathname||"")+(t.search||"")}function a(t,n){return void 0===n&&(n=!1),"string"!=typeof t&&t.url&&(n=t.replace,t=t.url),function(t){for(var n=g.length;n--;)if(g[n].canRoute(t))return!0;return!1}(t)&&function(t,n){void 0===n&&(n="push"),m&&m[n]?m[n](t):"undefined"!=typeof history&&history[n+"State"]&&history[n+"State"](null,null,t)}(t,n?"replace":"push"),f(t)}function f(t){for(var n=!1,e=0;e0},n.prototype.routeTo=function(t){this.setState({url:t});var n=this.canRoute(t);return this.updating||this.forceUpdate(),n},n.prototype.componentWillMount=function(){g.push(this),this.updating=!0},n.prototype.componentDidMount=function(){var t=this;m&&(this.unlisten=m.listen((function(n){t.routeTo(""+(n.pathname||"")+(n.search||""))}))),this.updating=!1},n.prototype.componentWillUnmount=function(){"function"==typeof this.unlisten&&this.unlisten(),g.splice(g.indexOf(this),1)},n.prototype.componentWillUpdate=function(){this.updating=!0},n.prototype.componentDidUpdate=function(){this.updating=!1},n.prototype.getMatchingChildren=function(t,n,e){return t.filter(i).sort(u).map((function(t){var u=o(n,t.props.path,t.props);if(u){if(!1!==e){var i={url:n,matches:u};return r(i,u),delete i.ref,delete i.key,Object(v.cloneElement)(t,i)}return t}})).filter(Boolean)},n.prototype.render=function(t,n){var e=t.children,r=t.onChange,o=n.url,u=this.getMatchingChildren(Object(v.toChildArray)(e),o,!0),i=u[0]||null,_=this.previousUrl;return o!==_&&(this.previousUrl=o,"function"==typeof r&&r({router:this,url:o,previous:_,active:u,current:i})),i},n}(v.Component),x=function(t){return Object(v.createElement)("a",r({onClick:p},t))},A=function(t){return Object(v.createElement)(t.component,t)};w.subscribers=b,w.getCurrentUrl=c,w.route=a,w.Router=w,w.Route=A,w.Link=x,w.exec=o,n.default=w},hosL:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t){var n=t.parentNode;n&&n.removeChild(t)}function u(t,n,e){var r,o,u,_=arguments,l={};for(u in n)"key"==u?r=n[u]:"ref"==u?o=n[u]:l[u]=n[u];if(arguments.length>3)for(e=[e],u=3;u1&&k(o,n,e),n=v(e,o,o,t.__k,null,o.__e,n),"function"==typeof t.type&&(t.__d=n)))}function C(t,n,e,o,u,i,_,a,f){var s,p,h,v,y,m,g,b,C,w,A,O=n.type;if(void 0!==n.constructor)return null;null!=e.__h&&(f=e.__h,a=n.__e=e.__e,n.__h=null,i=[a]),(s=L.__b)&&s(n);try{t:if("function"==typeof O){if(b=n.props,C=(s=O.contextType)&&o[s.__c],w=s?C?C.props.value:s.__:o,e.__c?g=(p=n.__c=e.__c).__=p.__E:("prototype"in O&&O.prototype.render?n.__c=p=new O(b,w):(n.__c=p=new c(b,w),p.constructor=O,p.render=E),C&&C.sub(p),p.props=b,p.state||(p.state={}),p.context=w,p.__n=o,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=r({},p.__s)),r(p.__s,O.getDerivedStateFromProps(b,p.__s))),v=p.props,y=p.state,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,w)||n.__v===e.__v){p.props=b,p.state=p.__s,n.__v!==e.__v&&(p.__d=!1),p.__v=n,n.__e=e.__e,n.__k=e.__k,p.__h.length&&_.push(p),k(n,a,t);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}p.context=w,p.props=b,p.state=p.__s,(s=L.__r)&&s(n),p.__d=!1,p.__v=n,p.__P=t,s=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=r(r({},o),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),A=null!=s&&s.type==l&&null==s.key?s.props.children:s,d(t,Array.isArray(A)?A:[A],n,e,o,u,i,_,a,f),p.base=n.__e,n.__h=null,p.__h.length&&_.push(p),g&&(p.__E=p.__=null),p.__e=!1}else null==i&&n.__v===e.__v?(n.__k=e.__k,n.__e=e.__e):n.__e=x(e.__e,n,e,o,u,i,_,f);(s=L.diffed)&&s(n)}catch(t){n.__v=null,(f||null!=i)&&(n.__e=a,n.__h=!!f,i[i.indexOf(a)]=null),L.__e(t,n,e)}return n.__e}function w(t,n){L.__c&&L.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){L.__e(t,n.__v)}}))}function x(t,n,e,r,o,u,i,_){var l,c,a,f,s,p=e.props,h=n.props;if(o="svg"===n.type||o,null!=u)for(l=0;l3)for(e=[e],_=3;_ {\n\t\t\t\trouteTo(getCurrentUrl());\n\t\t\t});\n\t\t}\n\t\taddEventListener('click', delegateLinkHandler);\n\t}\n\teventListenersInitialized = true;\n}\n\n\nclass Router extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (props.history) {\n\t\t\tcustomHistory = props.history;\n\t\t}\n\n\t\tthis.state = {\n\t\t\turl: props.url || getCurrentUrl()\n\t\t};\n\n\t\tinitEventListeners();\n\t}\n\n\tshouldComponentUpdate(props) {\n\t\tif (props.static!==true) return true;\n\t\treturn props.url!==this.props.url || props.onChange!==this.props.onChange;\n\t}\n\n\t/** Check if the given URL can be matched against any children */\n\tcanRoute(url) {\n\t\tconst children = toChildArray(this.props.children);\n\t\treturn this.getMatchingChildren(children, url, false).length > 0;\n\t}\n\n\t/** Re-render children with a new URL to match against. */\n\trouteTo(url) {\n\t\tthis.setState({ url });\n\n\t\tconst didRoute = this.canRoute(url);\n\n\t\t// trigger a manual re-route if we're not in the middle of an update:\n\t\tif (!this.updating) this.forceUpdate();\n\n\t\treturn didRoute;\n\t}\n\n\tcomponentWillMount() {\n\t\tROUTERS.push(this);\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidMount() {\n\t\tif (customHistory) {\n\t\t\tthis.unlisten = customHistory.listen((location) => {\n\t\t\t\tthis.routeTo(`${location.pathname || ''}${location.search || ''}`);\n\t\t\t});\n\t\t}\n\t\tthis.updating = false;\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (typeof this.unlisten==='function') this.unlisten();\n\t\tROUTERS.splice(ROUTERS.indexOf(this), 1);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.updating = false;\n\t}\n\n\tgetMatchingChildren(children, url, invoke) {\n\t\treturn children\n\t\t\t.filter(prepareVNodeForRanking)\n\t\t\t.sort(pathRankSort)\n\t\t\t.map( vnode => {\n\t\t\t\tlet matches = exec(url, vnode.props.path, vnode.props);\n\t\t\t\tif (matches) {\n\t\t\t\t\tif (invoke !== false) {\n\t\t\t\t\t\tlet newProps = { url, matches };\n\t\t\t\t\t\tassign(newProps, matches);\n\t\t\t\t\t\tdelete newProps.ref;\n\t\t\t\t\t\tdelete newProps.key;\n\t\t\t\t\t\treturn cloneElement(vnode, newProps);\n\t\t\t\t\t}\n\t\t\t\t\treturn vnode;\n\t\t\t\t}\n\t\t\t}).filter(Boolean);\n\t}\n\n\trender({ children, onChange }, { url }) {\n\t\tlet active = this.getMatchingChildren(toChildArray(children), url, true);\n\n\t\tlet current = active[0] || null;\n\n\t\tlet previous = this.previousUrl;\n\t\tif (url!==previous) {\n\t\t\tthis.previousUrl = url;\n\t\t\tif (typeof onChange==='function') {\n\t\t\t\tonChange({\n\t\t\t\t\trouter: this,\n\t\t\t\t\turl,\n\t\t\t\t\tprevious,\n\t\t\t\t\tactive,\n\t\t\t\t\tcurrent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nconst Link = (props) => (\n\tcreateElement('a', assign({ onClick: handleLinkClick }, props))\n);\n\nconst Route = props => createElement(props.component, props);\n\nRouter.subscribers = subscribers;\nRouter.getCurrentUrl = getCurrentUrl;\nRouter.route = route;\nRouter.Router = Router;\nRouter.Route = Route;\nRouter.Link = Link;\nRouter.exec = exec;\n\nexport { subscribers, getCurrentUrl, route, Router, Route, Link, exec };\nexport default Router;\n","import { h, Component } from 'preact';\n\nconst PENDING = {};\n\n// Given a VNode, finds its previous element sibling\nfunction getPreviousSibling(vnode, inner) {\n\t// in an element parent with no preceeding siblings means we're the first child\n\tif (typeof vnode.type === 'string') return null;\n\tconst parent = vnode.__;\n\tif (!parent) return;\n\tlet children = parent.__k;\n\tif (children) {\n\t\tif (!Array.isArray(children)) children = [children];\n\t\t// only search previous children\n\t\tlet end = children.indexOf(vnode);\n\t\tif (end === -1) end = children.length;\n\t\tfor (let i=end; i--; ) {\n\t\t\tconst child = children[i];\n\t\t\tconst dom = child && child.__e || getPreviousSibling(child, true);\n\t\t\tif (dom) return dom;\n\t\t}\n\t}\n\tif (!inner) return getPreviousSibling(parent);\n}\n\nexport default function async(load) {\n\tlet component;\n\n\tfunction AsyncComponent() {\n\t\tComponent.call(this);\n\n\t\tif (!component) {\n\t\t\tthis.componentWillMount = () => {\n\t\t\t\tload((mod) => {\n\t\t\t\t\tcomponent = (mod && mod.default) || mod;\n\t\t\t\t\tthis.setState({});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = () => component != null;\n\t\t}\n\n\t\tthis.render = (props) => {\n\t\t\tif (component) {\n\t\t\t\treturn h(component, props);\n\t\t\t}\n\n\t\t\tconst prev = getPreviousSibling(this.__v);\n\t\t\tconst me = prev && prev.nextSibling || (this.__P || this._parentDom).firstChild;\n\n\t\t\treturn (\n\t\t\t\tme &&\n\t\t\t\th(me.localName, {\n\t\t\t\t\tdangerouslySetInnerHTML: PENDING,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\t}\n\n\tAsyncComponent.preload = load;\n\t(AsyncComponent.prototype = new Component()).constructor = AsyncComponent;\n\n\treturn AsyncComponent;\n}\n","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-editor\");\n\t\t}\n\n\t\texport default Async(load);\n\t","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-post\");\n\t\t}\n\n\t\texport default Async(load);\n\t","import {h} from 'preact'\nimport {useState} from 'preact/hooks'\nimport {Router} from 'preact-router'\n\nimport Editor from './routes/editor'\nimport Post from './routes/post'\n\nimport './style/typography.css'\nimport './style'\n\nconst App = () => {\n const [markdown, setMarkdown] = useState('')\n\n return (
\n \n \n \n \n \n
)\n}\n\nexport default App\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\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","import options from './options';\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++options._vnodeId : original\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tlet newDom = diff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (newDom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\nprocess._rerenderCount = 0;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { removeNode } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../index').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Node | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\t// Only in very specific places should this logic be invoked (top level `render` and `diffElementNodes`).\n\t// I'm using `EMPTY_OBJ` to signal when `diffChildren` is invoked in these situations. I can't use `null`\n\t// for this purpose, because `null` is a valid value for `oldDom` which can mean to skip to this logic\n\t// (e.g. if mounting a new tree in which the old DOM should be ignored (usually for Fragments).\n\tif (oldDom == EMPTY_OBJ) {\n\t\tif (excessDomChildren != null) {\n\t\t\toldDom = excessDomChildren[0];\n\t\t} else if (oldChildrenLength) {\n\t\t\toldDom = getDomSibling(oldParentVNode, 0);\n\t\t} else {\n\t\t\toldDom = null;\n\t\t}\n\t}\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (typeof childVNode == 'string' || typeof childVNode == 'number') {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._dom != null || childVNode._component != null) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tnull,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tnewDom = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\toldDom = placeChild(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\toldVNode,\n\t\t\t\toldChildren,\n\t\t\t\texcessDomChildren,\n\t\t\t\tnewDom,\n\t\t\t\toldDom\n\t\t\t);\n\n\t\t\t// Browsers will infer an option's `value` from `textContent` when\n\t\t\t// no value is present. This essentially bypasses our code to set it\n\t\t\t// later in `diff()`. It works fine in all browsers except for IE11\n\t\t\t// where it breaks setting `select.value`. There it will be always set\n\t\t\t// to an empty string. Re-applying an options value will fix that, so\n\t\t\t// there are probably some internal data structures that aren't\n\t\t\t// updated properly.\n\t\t\t//\n\t\t\t// To fix it we make sure to reset the inferred value, so that our own\n\t\t\t// value check in `diff()` won't be skipped.\n\t\t\tif (!isHydrating && newParentVNode.type == 'option') {\n\t\t\t\tparentDom.value = '';\n\t\t\t} else if (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove children that are not part of any vnode.\n\tif (excessDomChildren != null && typeof newParentVNode.type != 'function') {\n\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) unmount(oldChildren[i], oldChildren[i]);\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nexport function placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\texcessDomChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\texcessDomChildren == oldVNode ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\t// NOTE: excessDomChildren==oldVNode above:\n\t\t// This is a compression of excessDomChildren==null && oldVNode==null!\n\t\t// The values only have the same type when `null`.\n\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j 1) {\n\t\t\t\t\treorderChildren(vnode, oldDom, parentDom);\n\t\t\t\t}\n\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tvnode,\n\t\t\t\t\tvnode,\n\t\t\t\t\tnewVNode._children,\n\t\t\t\t\tnull,\n\t\t\t\t\tvnode._dom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\n\t\t\t\tif (typeof newVNode.type == 'function') {\n\t\t\t\t\tnewVNode._nextDom = oldDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Element | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\treorderChildren(newVNode, oldDom, parentDom);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type == Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n\n\treturn newVNode._dom;\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet i;\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvg = newVNode.type === 'svg' || isSvg;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild != null &&\n\t\t\t\t((newVNode.type === null\n\t\t\t\t\t? child.nodeType === 3\n\t\t\t\t\t: child.localName === newVNode.type) ||\n\t\t\t\t\tdom == child)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (newVNode.type === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = isSvg\n\t\t\t? document.createElementNS('http://www.w3.org/2000/svg', newVNode.type)\n\t\t\t: document.createElement(\n\t\t\t\t\tnewVNode.type,\n\t\t\t\t\tnewProps.is && { is: newProps.is }\n\t\t\t );\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (newVNode.type === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\tif (excessDomChildren != null) {\n\t\t\texcessDomChildren = EMPTY_ARR.slice.call(dom.childNodes);\n\t\t}\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (let i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnewVNode.type === 'foreignObject' ? false : isSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tEMPTY_OBJ,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value || (newVNode.type === 'progress' && !i))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tlet dom;\n\tif (!skipRemove && typeof vnode.type != 'function') {\n\t\tskipRemove = (dom = vnode._dom) != null;\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) unmount(r[i], parentVNode, skipRemove);\n\t\t}\n\t}\n\n\tif (dom != null) removeNode(dom);\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 { EMPTY_OBJ, EMPTY_ARR } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\n\nconst IS_HYDRATE = EMPTY_OBJ;\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {Element | Text} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we\n\t// are in hydration mode or not by passing `IS_HYDRATE` instead of a\n\t// DOM element.\n\tlet isHydrating = replaceNode === IS_HYDRATE;\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\tvnode = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\t((isHydrating ? parentDom : replaceNode || parentDom)._children = vnode),\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\treplaceNode && !isHydrating\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.childNodes.length\n\t\t\t? EMPTY_ARR.slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\treplaceNode || EMPTY_OBJ,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, IS_HYDRATE);\n}\n","import { assign } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\tProvider(props, subs, ctx) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tsubs = [];\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(enqueueRender);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError,\n\t_vnodeId: 0\n};\n\nexport default options;\n","// import { enqueueRender } from '../component';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, vnode) {\n\t/** @type {import('../internal').Component} */\n\tlet component, ctor, handled;\n\n\tconst wasHydrating = vnode._hydrating;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error);\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\tvnode._hydrating = wasHydrating;\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/bundle.a9a47.js b/docs/bundle.a9a47.js deleted file mode 100644 index f272c60..0000000 --- a/docs/bundle.a9a47.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){function n(n){for(var e,r,o=n[0],i=n[1],_=0,l=[];_=e.__.length&&e.__.push({}),e.__[t]}function o(t){return x=1,u(g,t)}function u(t,n,e){var o=r(b++,2);return o.t=t,o.__c||(o.__=[e?e(n):g(void 0,n),function(t){var n=o.t(o.__[0],t);o.__[0]!==n&&(o.__=[n,o.__[1]],o.__c.setState({}))}],o.__c=k),o.__}function i(t,n){var e=r(b++,3);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__H.__h.push(e))}function _(t,n){var e=r(b++,4);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__h.push(e))}function l(t){return x=5,a((function(){return{current:t}}),[])}function c(t,n,e){x=6,_((function(){"function"==typeof t?t(n()):t&&(t.current=n())}),null==e?e:e.concat(t))}function a(t,n){var e=r(b++,7);return m(e.__H,n)&&(e.__=t(),e.__H=n,e.__h=t),e.__}function f(t,n){return x=8,a((function(){return t}),n)}function s(t){var n=k.context[t.__c],e=r(b++,9);return e.__c=t,n?(null==e.__&&(e.__=!0,n.sub(k)),n.props.value):t.__}function p(t,n){w.options.useDebugValue&&w.options.useDebugValue(n?n(t):t)}function d(t){var n=r(b++,10),e=o();return n.__=t,k.componentDidCatch||(k.componentDidCatch=function(t){n.__&&n.__(t),e[1](t)}),[e[0],function(){e[1](void 0)}]}function h(){A.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(v),t.__H.__h.forEach(y),t.__H.__h=[]}catch(n){t.__H.__h=[],w.options.__e(n,t.__v)}})),A=[]}function v(t){var n=k;"function"==typeof t.__c&&t.__c(),k=n}function y(t){var n=k;t.__c=t.__(),k=n}function m(t,n){return!t||t.length!==n.length||n.some((function(n,e){return n!==t[e]}))}function g(t,n){return"function"==typeof n?n(t):n}e.d(n,"k",(function(){return o})),e.d(n,"i",(function(){return u})),e.d(n,"d",(function(){return i})),e.d(n,"g",(function(){return _})),e.d(n,"j",(function(){return l})),e.d(n,"f",(function(){return c})),e.d(n,"h",(function(){return a})),e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return s})),e.d(n,"c",(function(){return p})),e.d(n,"e",(function(){return d}));var b,k,C,w=e("hosL"),x=0,A=[],O=w.options.__b,E=w.options.__r,S=w.options.diffed,P=w.options.__c,j=w.options.unmount;w.options.__b=function(t){k=null,O&&O(t)},w.options.__r=function(t){E&&E(t),b=0;var n=(k=t.__c).__H;n&&(n.__h.forEach(v),n.__h.forEach(y),n.__h=[])},w.options.diffed=function(t){S&&S(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==A.push(n)&&C===w.options.requestAnimationFrame||((C=w.options.requestAnimationFrame)||function(t){var n,e=function(){clearTimeout(r),T&&cancelAnimationFrame(n),setTimeout(t)},r=setTimeout(e,100);T&&(n=requestAnimationFrame(e))})(h)),k=void 0},w.options.__c=function(t,n){n.some((function(t){try{t.__h.forEach(v),t.__h=t.__h.filter((function(t){return!t.__||y(t)}))}catch(e){n.some((function(t){t.__h&&(t.__h=[])})),n=[],w.options.__e(e,t.__v)}})),P&&P(t,n)},w.options.unmount=function(t){j&&j(t);var n=t.__c;if(n&&n.__H)try{n.__H.__.forEach(v)}catch(t){w.options.__e(t,n.__v)}};var T="function"==typeof requestAnimationFrame},QfWi:function(t,n,e){"use strict";function r(t){function n(){var n=this;u.Component.call(this),e||(this.componentWillMount=function(){t((function(t){e=t&&t.default||t,n.setState({})}))},this.shouldComponentUpdate=function(){return null!=e}),this.render=function(t){if(e)return Object(u.h)(e,t);var r=function t(n,e){if("string"==typeof n.type)return null;var r=n.__;if(r){var o=r.__k;if(o){Array.isArray(o)||(o=[o]);var u=o.indexOf(n);-1===u&&(u=o.length);for(var i=u;i--;){var _=o[i],l=_&&_.__e||t(_,!0);if(l)return l}}return e?void 0:t(r)}}(n.__v),o=r&&r.nextSibling||(n.__P||n._parentDom).firstChild;return o&&Object(u.h)(o.localName,{dangerouslySetInnerHTML:l})}}var e;return n.preload=t,(n.prototype=new u.Component).constructor=n,n}function o(){return(o=Object.assign||function(t){for(var n=1;nn.rank?-1:t.index-n.index}function i(t,n){return t.index=n,t.rank=function(t){return t.props.default?0:(n=t.props.path,_(n).map(l).join(""));var n}(t),t.props}function _(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function l(t){return":"==t.charAt(0)?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}function c(){var t;return""+((t=m&&m.location?m.location:m&&m.getCurrentLocation?m.getCurrentLocation():"undefined"!=typeof location?location:k).pathname||"")+(t.search||"")}function a(t,n){return void 0===n&&(n=!1),"string"!=typeof t&&t.url&&(n=t.replace,t=t.url),function(t){for(var n=g.length;n--;)if(g[n].canRoute(t))return!0;return!1}(t)&&function(t,n){void 0===n&&(n="push"),m&&m[n]?m[n](t):"undefined"!=typeof history&&history[n+"State"]&&history[n+"State"](null,null,t)}(t,n?"replace":"push"),f(t)}function f(t){for(var n=!1,e=0;e0},n.prototype.routeTo=function(t){this.setState({url:t});var n=this.canRoute(t);return this.updating||this.forceUpdate(),n},n.prototype.componentWillMount=function(){g.push(this),this.updating=!0},n.prototype.componentDidMount=function(){var t=this;m&&(this.unlisten=m.listen((function(n){t.routeTo(""+(n.pathname||"")+(n.search||""))}))),this.updating=!1},n.prototype.componentWillUnmount=function(){"function"==typeof this.unlisten&&this.unlisten(),g.splice(g.indexOf(this),1)},n.prototype.componentWillUpdate=function(){this.updating=!0},n.prototype.componentDidUpdate=function(){this.updating=!1},n.prototype.getMatchingChildren=function(t,n,e){return t.filter(i).sort(u).map((function(t){var u=o(n,t.props.path,t.props);if(u){if(!1!==e){var i={url:n,matches:u};return r(i,u),delete i.ref,delete i.key,Object(v.cloneElement)(t,i)}return t}})).filter(Boolean)},n.prototype.render=function(t,n){var e=t.children,r=t.onChange,o=n.url,u=this.getMatchingChildren(Object(v.toChildArray)(e),o,!0),i=u[0]||null,_=this.previousUrl;return o!==_&&(this.previousUrl=o,"function"==typeof r&&r({router:this,url:o,previous:_,active:u,current:i})),i},n}(v.Component),x=function(t){return Object(v.createElement)("a",r({onClick:p},t))},A=function(t){return Object(v.createElement)(t.component,t)};w.subscribers=b,w.getCurrentUrl=c,w.route=a,w.Router=w,w.Route=A,w.Link=x,w.exec=o,n.default=w},hosL:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t){var n=t.parentNode;n&&n.removeChild(t)}function u(t,n,e){var r,o,u,_=arguments,l={};for(u in n)"key"==u?r=n[u]:"ref"==u?o=n[u]:l[u]=n[u];if(arguments.length>3)for(e=[e],u=3;u1&&k(o,n,e),n=v(e,o,o,t.__k,null,o.__e,n),"function"==typeof t.type&&(t.__d=n)))}function C(t,n,e,o,u,i,_,a,f){var s,p,h,v,y,m,g,b,C,w,A,O=n.type;if(void 0!==n.constructor)return null;null!=e.__h&&(f=e.__h,a=n.__e=e.__e,n.__h=null,i=[a]),(s=L.__b)&&s(n);try{t:if("function"==typeof O){if(b=n.props,C=(s=O.contextType)&&o[s.__c],w=s?C?C.props.value:s.__:o,e.__c?g=(p=n.__c=e.__c).__=p.__E:("prototype"in O&&O.prototype.render?n.__c=p=new O(b,w):(n.__c=p=new c(b,w),p.constructor=O,p.render=E),C&&C.sub(p),p.props=b,p.state||(p.state={}),p.context=w,p.__n=o,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=r({},p.__s)),r(p.__s,O.getDerivedStateFromProps(b,p.__s))),v=p.props,y=p.state,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,w)||n.__v===e.__v){p.props=b,p.state=p.__s,n.__v!==e.__v&&(p.__d=!1),p.__v=n,n.__e=e.__e,n.__k=e.__k,p.__h.length&&_.push(p),k(n,a,t);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}p.context=w,p.props=b,p.state=p.__s,(s=L.__r)&&s(n),p.__d=!1,p.__v=n,p.__P=t,s=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=r(r({},o),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),A=null!=s&&s.type==l&&null==s.key?s.props.children:s,d(t,Array.isArray(A)?A:[A],n,e,o,u,i,_,a,f),p.base=n.__e,n.__h=null,p.__h.length&&_.push(p),g&&(p.__E=p.__=null),p.__e=!1}else null==i&&n.__v===e.__v?(n.__k=e.__k,n.__e=e.__e):n.__e=x(e.__e,n,e,o,u,i,_,f);(s=L.diffed)&&s(n)}catch(t){n.__v=null,(f||null!=i)&&(n.__e=a,n.__h=!!f,i[i.indexOf(a)]=null),L.__e(t,n,e)}return n.__e}function w(t,n){L.__c&&L.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){L.__e(t,n.__v)}}))}function x(t,n,e,r,o,u,i,_){var l,c,a,f,s,p=e.props,h=n.props;if(o="svg"===n.type||o,null!=u)for(l=0;l3)for(e=[e],_=3;_ {\n\t\t\t\trouteTo(getCurrentUrl());\n\t\t\t});\n\t\t}\n\t\taddEventListener('click', delegateLinkHandler);\n\t}\n\teventListenersInitialized = true;\n}\n\n\nclass Router extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (props.history) {\n\t\t\tcustomHistory = props.history;\n\t\t}\n\n\t\tthis.state = {\n\t\t\turl: props.url || getCurrentUrl()\n\t\t};\n\n\t\tinitEventListeners();\n\t}\n\n\tshouldComponentUpdate(props) {\n\t\tif (props.static!==true) return true;\n\t\treturn props.url!==this.props.url || props.onChange!==this.props.onChange;\n\t}\n\n\t/** Check if the given URL can be matched against any children */\n\tcanRoute(url) {\n\t\tconst children = toChildArray(this.props.children);\n\t\treturn this.getMatchingChildren(children, url, false).length > 0;\n\t}\n\n\t/** Re-render children with a new URL to match against. */\n\trouteTo(url) {\n\t\tthis.setState({ url });\n\n\t\tconst didRoute = this.canRoute(url);\n\n\t\t// trigger a manual re-route if we're not in the middle of an update:\n\t\tif (!this.updating) this.forceUpdate();\n\n\t\treturn didRoute;\n\t}\n\n\tcomponentWillMount() {\n\t\tROUTERS.push(this);\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidMount() {\n\t\tif (customHistory) {\n\t\t\tthis.unlisten = customHistory.listen((location) => {\n\t\t\t\tthis.routeTo(`${location.pathname || ''}${location.search || ''}`);\n\t\t\t});\n\t\t}\n\t\tthis.updating = false;\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (typeof this.unlisten==='function') this.unlisten();\n\t\tROUTERS.splice(ROUTERS.indexOf(this), 1);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.updating = false;\n\t}\n\n\tgetMatchingChildren(children, url, invoke) {\n\t\treturn children\n\t\t\t.filter(prepareVNodeForRanking)\n\t\t\t.sort(pathRankSort)\n\t\t\t.map( vnode => {\n\t\t\t\tlet matches = exec(url, vnode.props.path, vnode.props);\n\t\t\t\tif (matches) {\n\t\t\t\t\tif (invoke !== false) {\n\t\t\t\t\t\tlet newProps = { url, matches };\n\t\t\t\t\t\tassign(newProps, matches);\n\t\t\t\t\t\tdelete newProps.ref;\n\t\t\t\t\t\tdelete newProps.key;\n\t\t\t\t\t\treturn cloneElement(vnode, newProps);\n\t\t\t\t\t}\n\t\t\t\t\treturn vnode;\n\t\t\t\t}\n\t\t\t}).filter(Boolean);\n\t}\n\n\trender({ children, onChange }, { url }) {\n\t\tlet active = this.getMatchingChildren(toChildArray(children), url, true);\n\n\t\tlet current = active[0] || null;\n\n\t\tlet previous = this.previousUrl;\n\t\tif (url!==previous) {\n\t\t\tthis.previousUrl = url;\n\t\t\tif (typeof onChange==='function') {\n\t\t\t\tonChange({\n\t\t\t\t\trouter: this,\n\t\t\t\t\turl,\n\t\t\t\t\tprevious,\n\t\t\t\t\tactive,\n\t\t\t\t\tcurrent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nconst Link = (props) => (\n\tcreateElement('a', assign({ onClick: handleLinkClick }, props))\n);\n\nconst Route = props => createElement(props.component, props);\n\nRouter.subscribers = subscribers;\nRouter.getCurrentUrl = getCurrentUrl;\nRouter.route = route;\nRouter.Router = Router;\nRouter.Route = Route;\nRouter.Link = Link;\nRouter.exec = exec;\n\nexport { subscribers, getCurrentUrl, route, Router, Route, Link, exec };\nexport default Router;\n","import { h, Component } from 'preact';\n\nconst PENDING = {};\n\n// Given a VNode, finds its previous element sibling\nfunction getPreviousSibling(vnode, inner) {\n\t// in an element parent with no preceeding siblings means we're the first child\n\tif (typeof vnode.type === 'string') return null;\n\tconst parent = vnode.__;\n\tif (!parent) return;\n\tlet children = parent.__k;\n\tif (children) {\n\t\tif (!Array.isArray(children)) children = [children];\n\t\t// only search previous children\n\t\tlet end = children.indexOf(vnode);\n\t\tif (end === -1) end = children.length;\n\t\tfor (let i=end; i--; ) {\n\t\t\tconst child = children[i];\n\t\t\tconst dom = child && child.__e || getPreviousSibling(child, true);\n\t\t\tif (dom) return dom;\n\t\t}\n\t}\n\tif (!inner) return getPreviousSibling(parent);\n}\n\nexport default function async(load) {\n\tlet component;\n\n\tfunction AsyncComponent() {\n\t\tComponent.call(this);\n\n\t\tif (!component) {\n\t\t\tthis.componentWillMount = () => {\n\t\t\t\tload((mod) => {\n\t\t\t\t\tcomponent = (mod && mod.default) || mod;\n\t\t\t\t\tthis.setState({});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = () => component != null;\n\t\t}\n\n\t\tthis.render = (props) => {\n\t\t\tif (component) {\n\t\t\t\treturn h(component, props);\n\t\t\t}\n\n\t\t\tconst prev = getPreviousSibling(this.__v);\n\t\t\tconst me = prev && prev.nextSibling || (this.__P || this._parentDom).firstChild;\n\n\t\t\treturn (\n\t\t\t\tme &&\n\t\t\t\th(me.localName, {\n\t\t\t\t\tdangerouslySetInnerHTML: PENDING,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\t}\n\n\tAsyncComponent.preload = load;\n\t(AsyncComponent.prototype = new Component()).constructor = AsyncComponent;\n\n\treturn AsyncComponent;\n}\n","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-editor\");\n\t\t}\n\n\t\texport default Async(load);\n\t","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-post\");\n\t\t}\n\n\t\texport default Async(load);\n\t","import {h} from 'preact'\nimport {useState} from 'preact/hooks'\nimport {Router} from 'preact-router'\n\nimport Editor from './routes/editor'\nimport Post from './routes/post'\n\nimport './style/typography.css'\nimport './style'\n\nconst App = () => {\n const [markdown, setMarkdown] = useState('')\n\n return (
\n \n \n \n \n \n
)\n}\n\nexport default App\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\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","import options from './options';\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++options._vnodeId : original\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tlet newDom = diff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (newDom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\nprocess._rerenderCount = 0;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { removeNode } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../index').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Node | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\t// Only in very specific places should this logic be invoked (top level `render` and `diffElementNodes`).\n\t// I'm using `EMPTY_OBJ` to signal when `diffChildren` is invoked in these situations. I can't use `null`\n\t// for this purpose, because `null` is a valid value for `oldDom` which can mean to skip to this logic\n\t// (e.g. if mounting a new tree in which the old DOM should be ignored (usually for Fragments).\n\tif (oldDom == EMPTY_OBJ) {\n\t\tif (excessDomChildren != null) {\n\t\t\toldDom = excessDomChildren[0];\n\t\t} else if (oldChildrenLength) {\n\t\t\toldDom = getDomSibling(oldParentVNode, 0);\n\t\t} else {\n\t\t\toldDom = null;\n\t\t}\n\t}\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (typeof childVNode == 'string' || typeof childVNode == 'number') {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._dom != null || childVNode._component != null) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tnull,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tnewDom = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\toldDom = placeChild(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\toldVNode,\n\t\t\t\toldChildren,\n\t\t\t\texcessDomChildren,\n\t\t\t\tnewDom,\n\t\t\t\toldDom\n\t\t\t);\n\n\t\t\t// Browsers will infer an option's `value` from `textContent` when\n\t\t\t// no value is present. This essentially bypasses our code to set it\n\t\t\t// later in `diff()`. It works fine in all browsers except for IE11\n\t\t\t// where it breaks setting `select.value`. There it will be always set\n\t\t\t// to an empty string. Re-applying an options value will fix that, so\n\t\t\t// there are probably some internal data structures that aren't\n\t\t\t// updated properly.\n\t\t\t//\n\t\t\t// To fix it we make sure to reset the inferred value, so that our own\n\t\t\t// value check in `diff()` won't be skipped.\n\t\t\tif (!isHydrating && newParentVNode.type == 'option') {\n\t\t\t\tparentDom.value = '';\n\t\t\t} else if (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove children that are not part of any vnode.\n\tif (excessDomChildren != null && typeof newParentVNode.type != 'function') {\n\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) unmount(oldChildren[i], oldChildren[i]);\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nexport function placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\texcessDomChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\texcessDomChildren == oldVNode ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\t// NOTE: excessDomChildren==oldVNode above:\n\t\t// This is a compression of excessDomChildren==null && oldVNode==null!\n\t\t// The values only have the same type when `null`.\n\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j 1) {\n\t\t\t\t\treorderChildren(vnode, oldDom, parentDom);\n\t\t\t\t}\n\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tvnode,\n\t\t\t\t\tvnode,\n\t\t\t\t\tnewVNode._children,\n\t\t\t\t\tnull,\n\t\t\t\t\tvnode._dom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\n\t\t\t\tif (typeof newVNode.type == 'function') {\n\t\t\t\t\tnewVNode._nextDom = oldDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Element | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\treorderChildren(newVNode, oldDom, parentDom);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type == Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n\n\treturn newVNode._dom;\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet i;\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvg = newVNode.type === 'svg' || isSvg;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild != null &&\n\t\t\t\t((newVNode.type === null\n\t\t\t\t\t? child.nodeType === 3\n\t\t\t\t\t: child.localName === newVNode.type) ||\n\t\t\t\t\tdom == child)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (newVNode.type === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = isSvg\n\t\t\t? document.createElementNS('http://www.w3.org/2000/svg', newVNode.type)\n\t\t\t: document.createElement(\n\t\t\t\t\tnewVNode.type,\n\t\t\t\t\tnewProps.is && { is: newProps.is }\n\t\t\t );\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (newVNode.type === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\tif (excessDomChildren != null) {\n\t\t\texcessDomChildren = EMPTY_ARR.slice.call(dom.childNodes);\n\t\t}\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (let i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnewVNode.type === 'foreignObject' ? false : isSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tEMPTY_OBJ,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value || (newVNode.type === 'progress' && !i))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tlet dom;\n\tif (!skipRemove && typeof vnode.type != 'function') {\n\t\tskipRemove = (dom = vnode._dom) != null;\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) unmount(r[i], parentVNode, skipRemove);\n\t\t}\n\t}\n\n\tif (dom != null) removeNode(dom);\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 { EMPTY_OBJ, EMPTY_ARR } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\n\nconst IS_HYDRATE = EMPTY_OBJ;\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {Element | Text} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we\n\t// are in hydration mode or not by passing `IS_HYDRATE` instead of a\n\t// DOM element.\n\tlet isHydrating = replaceNode === IS_HYDRATE;\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\tvnode = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\t((isHydrating ? parentDom : replaceNode || parentDom)._children = vnode),\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\treplaceNode && !isHydrating\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.childNodes.length\n\t\t\t? EMPTY_ARR.slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\treplaceNode || EMPTY_OBJ,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, IS_HYDRATE);\n}\n","import { assign } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\tProvider(props, subs, ctx) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tsubs = [];\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(enqueueRender);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError,\n\t_vnodeId: 0\n};\n\nexport default options;\n","// import { enqueueRender } from '../component';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, vnode) {\n\t/** @type {import('../internal').Component} */\n\tlet component, ctor, handled;\n\n\tconst wasHydrating = vnode._hydrating;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error);\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\tvnode._hydrating = wasHydrating;\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/bundle.c6d55.esm.js b/docs/bundle.c6d55.esm.js deleted file mode 100644 index 6fe3feb..0000000 --- a/docs/bundle.c6d55.esm.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){function n(n){for(var e,r,o=n[0],u=n[1],_=0,l=[];_=e.__.length&&e.__.push({}),e.__[t]}function o(t){return x=1,i(g,t)}function i(t,n,e){var o=r(b++,2);return o.t=t,o.__c||(o.__=[e?e(n):g(void 0,n),function(t){var n=o.t(o.__[0],t);o.__[0]!==n&&(o.__=[n,o.__[1]],o.__c.setState({}))}],o.__c=k),o.__}function u(t,n){var e=r(b++,3);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__H.__h.push(e))}function _(t,n){var e=r(b++,4);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__h.push(e))}function l(t){return x=5,a((function(){return{current:t}}),[])}function c(t,n,e){x=6,_((function(){"function"==typeof t?t(n()):t&&(t.current=n())}),null==e?e:e.concat(t))}function a(t,n){var e=r(b++,7);return m(e.__H,n)&&(e.__=t(),e.__H=n,e.__h=t),e.__}function f(t,n){return x=8,a((function(){return t}),n)}function s(t){var n=k.context[t.__c],e=r(b++,9);return e.__c=t,n?(null==e.__&&(e.__=!0,n.sub(k)),n.props.value):t.__}function p(t,n){w.options.useDebugValue&&w.options.useDebugValue(n?n(t):t)}function d(t){var n=r(b++,10),e=o();return n.__=t,k.componentDidCatch||(k.componentDidCatch=function(t){n.__&&n.__(t),e[1](t)}),[e[0],function(){e[1](void 0)}]}function h(){A.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(v),t.__H.__h.forEach(y),t.__H.__h=[]}catch(n){t.__H.__h=[],w.options.__e(n,t.__v)}})),A=[]}function v(t){var n=k;"function"==typeof t.__c&&t.__c(),k=n}function y(t){var n=k;t.__c=t.__(),k=n}function m(t,n){return!t||t.length!==n.length||n.some((function(n,e){return n!==t[e]}))}function g(t,n){return"function"==typeof n?n(t):n}e.d(n,"k",(function(){return o})),e.d(n,"i",(function(){return i})),e.d(n,"d",(function(){return u})),e.d(n,"g",(function(){return _})),e.d(n,"j",(function(){return l})),e.d(n,"f",(function(){return c})),e.d(n,"h",(function(){return a})),e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return s})),e.d(n,"c",(function(){return p})),e.d(n,"e",(function(){return d}));var b,k,C,w=e("hosL"),x=0,A=[],O=w.options.__b,E=w.options.__r,S=w.options.diffed,P=w.options.__c,j=w.options.unmount;w.options.__b=function(t){k=null,O&&O(t)},w.options.__r=function(t){E&&E(t),b=0;var n=(k=t.__c).__H;n&&(n.__h.forEach(v),n.__h.forEach(y),n.__h=[])},w.options.diffed=function(t){S&&S(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==A.push(n)&&C===w.options.requestAnimationFrame||((C=w.options.requestAnimationFrame)||function(t){var n,e=function(){clearTimeout(r),T&&cancelAnimationFrame(n),setTimeout(t)},r=setTimeout(e,100);T&&(n=requestAnimationFrame(e))})(h)),k=void 0},w.options.__c=function(t,n){n.some((function(t){try{t.__h.forEach(v),t.__h=t.__h.filter((function(t){return!t.__||y(t)}))}catch(e){n.some((function(t){t.__h&&(t.__h=[])})),n=[],w.options.__e(e,t.__v)}})),P&&P(t,n)},w.options.unmount=function(t){j&&j(t);var n=t.__c;if(n&&n.__H)try{n.__H.__.forEach(v)}catch(t){w.options.__e(t,n.__v)}};var T="function"==typeof requestAnimationFrame},QfWi:function(t,n,e){"use strict";function r(t){function n(){i.Component.call(this),e||(this.componentWillMount=()=>{t(t=>{e=t&&t.default||t,this.setState({})})},this.shouldComponentUpdate=()=>null!=e),this.render=t=>{if(e)return Object(i.h)(e,t);const n=function t(n,e){if("string"==typeof n.type)return null;const r=n.__;if(!r)return;let o=r.__k;if(o){Array.isArray(o)||(o=[o]);let e=o.indexOf(n);-1===e&&(e=o.length);for(let n=e;n--;){const e=o[n],r=e&&e.__e||t(e,!0);if(r)return r}}return e?void 0:t(r)}(this.__v),r=n&&n.nextSibling||(this.__P||this._parentDom).firstChild;return r&&Object(i.h)(r.localName,{dangerouslySetInnerHTML:l})}}let e;return n.preload=t,(n.prototype=new i.Component).constructor=n,n}function o(){return(o=Object.assign||function(t){for(var n=1;n{const[t,n]=Object(u.k)("");return Object(i.h)("main",null,Object(i.h)(_.Router,null,Object(i.h)(c,o({path:"/",markdown:t},{setMarkdown:n})),Object(i.h)(a,o({path:"/preview/",mode:"preview",payload:t},{setMarkdown:n})),Object(i.h)(a,o({path:"/p/:payload",mode:"post"},{setMarkdown:n}))))}},Y3FI:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t,n,e){var r,o=/(?:\?([^#]*))?(#.*)?$/,i=t.match(o),u={};if(i&&i[1])for(var l=i[1].split("&"),c=0;cn.rank?-1:t.index-n.index}function u(t,n){return t.index=n,t.rank=function(t){return t.props.default?0:(n=t.props.path,_(n).map(l).join(""));var n}(t),t.props}function _(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function l(t){return":"==t.charAt(0)?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}function c(){var t;return""+((t=m&&m.location?m.location:m&&m.getCurrentLocation?m.getCurrentLocation():"undefined"!=typeof location?location:k).pathname||"")+(t.search||"")}function a(t,n){return void 0===n&&(n=!1),"string"!=typeof t&&t.url&&(n=t.replace,t=t.url),function(t){for(var n=g.length;n--;)if(g[n].canRoute(t))return!0;return!1}(t)&&function(t,n){void 0===n&&(n="push"),m&&m[n]?m[n](t):"undefined"!=typeof history&&history[n+"State"]&&history[n+"State"](null,null,t)}(t,n?"replace":"push"),f(t)}function f(t){for(var n=!1,e=0;e0},n.prototype.routeTo=function(t){this.setState({url:t});var n=this.canRoute(t);return this.updating||this.forceUpdate(),n},n.prototype.componentWillMount=function(){g.push(this),this.updating=!0},n.prototype.componentDidMount=function(){var t=this;m&&(this.unlisten=m.listen((function(n){t.routeTo(""+(n.pathname||"")+(n.search||""))}))),this.updating=!1},n.prototype.componentWillUnmount=function(){"function"==typeof this.unlisten&&this.unlisten(),g.splice(g.indexOf(this),1)},n.prototype.componentWillUpdate=function(){this.updating=!0},n.prototype.componentDidUpdate=function(){this.updating=!1},n.prototype.getMatchingChildren=function(t,n,e){return t.filter(u).sort(i).map((function(t){var i=o(n,t.props.path,t.props);if(i){if(!1!==e){var u={url:n,matches:i};return r(u,i),delete u.ref,delete u.key,Object(v.cloneElement)(t,u)}return t}})).filter(Boolean)},n.prototype.render=function(t,n){var e=t.children,r=t.onChange,o=n.url,i=this.getMatchingChildren(Object(v.toChildArray)(e),o,!0),u=i[0]||null,_=this.previousUrl;return o!==_&&(this.previousUrl=o,"function"==typeof r&&r({router:this,url:o,previous:_,active:i,current:u})),u},n}(v.Component),x=function(t){return Object(v.createElement)("a",r({onClick:p},t))},A=function(t){return Object(v.createElement)(t.component,t)};w.subscribers=b,w.getCurrentUrl=c,w.route=a,w.Router=w,w.Route=A,w.Link=x,w.exec=o,n.default=w},hosL:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t){var n=t.parentNode;n&&n.removeChild(t)}function i(t,n,e){var r,o,i,_=arguments,l={};for(i in n)"key"==i?r=n[i]:"ref"==i?o=n[i]:l[i]=n[i];if(arguments.length>3)for(e=[e],i=3;i1&&k(o,n,e),n=v(e,o,o,t.__k,null,o.__e,n),"function"==typeof t.type&&(t.__d=n)))}function C(t,n,e,o,i,u,_,a,f){var s,p,h,v,y,m,g,b,C,w,A,O=n.type;if(void 0!==n.constructor)return null;null!=e.__h&&(f=e.__h,a=n.__e=e.__e,n.__h=null,u=[a]),(s=L.__b)&&s(n);try{t:if("function"==typeof O){if(b=n.props,C=(s=O.contextType)&&o[s.__c],w=s?C?C.props.value:s.__:o,e.__c?g=(p=n.__c=e.__c).__=p.__E:("prototype"in O&&O.prototype.render?n.__c=p=new O(b,w):(n.__c=p=new c(b,w),p.constructor=O,p.render=E),C&&C.sub(p),p.props=b,p.state||(p.state={}),p.context=w,p.__n=o,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=r({},p.__s)),r(p.__s,O.getDerivedStateFromProps(b,p.__s))),v=p.props,y=p.state,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,w)||n.__v===e.__v){p.props=b,p.state=p.__s,n.__v!==e.__v&&(p.__d=!1),p.__v=n,n.__e=e.__e,n.__k=e.__k,p.__h.length&&_.push(p),k(n,a,t);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}p.context=w,p.props=b,p.state=p.__s,(s=L.__r)&&s(n),p.__d=!1,p.__v=n,p.__P=t,s=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=r(r({},o),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),A=null!=s&&s.type==l&&null==s.key?s.props.children:s,d(t,Array.isArray(A)?A:[A],n,e,o,i,u,_,a,f),p.base=n.__e,n.__h=null,p.__h.length&&_.push(p),g&&(p.__E=p.__=null),p.__e=!1}else null==u&&n.__v===e.__v?(n.__k=e.__k,n.__e=e.__e):n.__e=x(e.__e,n,e,o,i,u,_,f);(s=L.diffed)&&s(n)}catch(t){n.__v=null,(f||null!=u)&&(n.__e=a,n.__h=!!f,u[u.indexOf(a)]=null),L.__e(t,n,e)}return n.__e}function w(t,n){L.__c&&L.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){L.__e(t,n.__v)}}))}function x(t,n,e,r,o,i,u,_){var l,c,a,f,s,p=e.props,h=n.props;if(o="svg"===n.type||o,null!=i)for(l=0;l3)for(e=[e],_=3;_t&&t.default?t.default:t,l=t=>"/"===t[t.length-1]?t:t+"/";if("serviceWorker"in navigator&&navigator.serviceWorker.register(e.p+"sw-esm.js"),"function"==typeof _(e("QfWi"))){let t=document.getElementById("preact_root")||document.body.firstElementChild;0,(()=>{let n=_(e("QfWi")),r={};const c=document.querySelector('[type="__PREACT_CLI_DATA__"]');c&&(r=JSON.parse(decodeURI(c.innerHTML)).preRenderData||r);const a={preRenderData:r},f=r.url?l(r.url):"",s=u&&f===l(location.pathname);t=(s?u:i)(o(n,{CLI_DATA:a}),document.body,t)})()}},pRls:function(){}}); -//# sourceMappingURL=bundle.c6d55.esm.js.map \ No newline at end of file diff --git a/docs/bundle.c6d55.esm.js.map b/docs/bundle.c6d55.esm.js.map deleted file mode 100644 index bdeac76..0000000 --- a/docs/bundle.c6d55.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../src/index.js","webpack:///../node_modules/@preact/async-loader/async.js","webpack:///./routes/editor/index.js?5cf4","webpack:///./routes/post/index.js?01a5","webpack:///./index.js","webpack:///../src/util.js","webpack:///../src/create-element.js","webpack:///../src/component.js","webpack:///../src/diff/children.js","webpack:///../src/diff/props.js","webpack:///../src/diff/index.js","webpack:///../src/render.js","webpack:///../src/clone-element.js","webpack:///../src/create-context.js","webpack:///../src/constants.js","webpack:///../src/options.js","webpack:///../src/diff/catch-error.js","webpack:///../node_modules/preact-cli/lib/lib/entry.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","__webpack_require__","installedModules","exports","module","l","installedCssChunks","0","e","promises","Promise","resolve","reject","href","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","s","getHookState","index","options","currentComponent","currentHook","hooks","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","currentIndex","_reducer","nextValue","action","setState","useEffect","callback","args","state","argsChanged","useLayoutEffect","useRef","initialValue","useMemo","current","useImperativeHandle","ref","createHandle","concat","factory","useCallback","useContext","context","provider","sub","props","useDebugValue","formatter","useErrorBoundary","cb","errState","componentDidCatch","flushAfterPaintEffects","afterPaintEffects","forEach","component","invokeCleanup","invokeEffect","hook","comp","oldArgs","newArgs","some","arg","f","prevRaf","oldBeforeDiff","oldBeforeRender","oldAfterDiff","diffed","oldCommit","oldBeforeUnmount","unmount","vnode","requestAnimationFrame","raf","done","HAS_RAF","cancelAnimationFrame","commitQueue","filter","async","load","AsyncComponent","Component","this","componentWillMount","mod","default","shouldComponentUpdate","render","h","prev","getPreviousSibling","inner","parent","__","children","__k","Array","isArray","end","indexOf","child","dom","__e","__v","me","nextSibling","__P","_parentDom","firstChild","localName","dangerouslySetInnerHTML","PENDING","preload","constructor","result","App","markdown","setMarkdown","path","payload","let","EMPTY","getCurrentUrl","url","customHistory","location","getCurrentLocation","pathname","search","route","replace","ROUTERS","canRoute","history","setUrl","routeTo","didRoute","subscribers","routeFromLink","node","match","handleLinkClick","ctrlKey","metaKey","altKey","shiftKey","button","currentTarget","prevent","stopImmediatePropagation","stopPropagation","preventDefault","delegateLinkHandler","String","nodeName","toUpperCase","hasAttribute","eventListenersInitialized","Router","super","addEventListener","static","onChange","const","getMatchingChildren","updating","forceUpdate","componentDidMount","unlisten","listen","componentWillUnmount","splice","componentWillUpdate","componentDidUpdate","invoke","prepareVNodeForRanking","sort","pathRankSort","map","matches","exec","newProps","assign","Boolean","active","previous","previousUrl","router","Link","onClick","Route","obj","removeNode","normalizedProps","arguments","defaultProps","createVNode","original","createRef","Fragment","getDomSibling","childIndex","sibling","updateParentDomPointers","base","enqueueRender","rerenderQueue","process","prevDebounce","debounceRendering","defer","queue","a","b","oldVNode","newDom","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","firstChildDom","refs","oldChildren","EMPTY_ARR","oldChildrenLength","EMPTY_OBJ","placeChild","applyRef","toChildArray","out","nextDom","sibDom","outer","insertBefore","setStyle","style","setProperty","IS_NON_DIMENSIONAL","test","oldValue","useCapture","nameLower","proxy","cssText","toLowerCase","_listeners","eventProxyCapture","eventProxy","removeEventListener","removeAttributeNS","setAttributeNS","removeAttribute","reorderChildren","newVNode","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","componentContext","newType","contextType","doRender","getDerivedStateFromProps","componentWillReceiveProps","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","root","oldHtml","newHtml","nodeType","createTextNode","createElementNS","is","childNodes","attributes","innerHTML","hydrate","diffProps","checked","parentVNode","skipRemove","replaceNode","IS_HYDRATE","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","isValidElement","ctor","handled","wasHydrating","getDerivedStateFromError","update","Preact","interopDefault","normalizeURL","navigator","serviceWorker","register","__webpack_public_path__","require","getElementById","body","firstElementChild","app","preRenderData","inlineDataElement","querySelector","JSON","parse","decodeURI","CLI_DATA","currentURL","canHydrate"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,GA6BF,SAASW,EAAoBhB,GAG5B,GAAGiB,EAAiBjB,GACnB,OAAOiB,EAAiBjB,GAAUkB,QAGnC,IAAIC,EAASF,EAAiBjB,GAAY,CACzCI,EAAGJ,EACHoB,GAAG,EACHF,QAAS,IAUV,OANAL,EAAQb,GAAUU,KAAKS,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOC,GAAI,EAGJD,EAAOD,QA1Cf,IAAID,EAAmB,GAGnBI,EAAqB,CACxBC,EAAG,GAMAX,EAAkB,CACrBW,EAAG,GAoCJN,EAAoBO,EAAI,SAAuBtB,GAC9C,IAAIuB,EAAW,GAKZH,EAAmBpB,GAAUuB,EAASZ,KAAKS,EAAmBpB,IACzB,IAAhCoB,EAAmBpB,IAFX,CAAC,EAAI,GAEkCA,IACtDuB,EAASZ,KAAKS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iBACbO,EAAaP,EAAc3M,IAAMiM,EAAaU,EAAc3M,KAAO,GACnEmN,EAGL5C,GACA2C,IAAejB,EAAa/L,SAASE,UAEtCyJ,GADiBsD,EAAa5C,EAAU3M,GACxBC,EAAE6O,EAAK,CAAEO,aAAahZ,SAASuY,KAAM3C,IAKtDzQ,K","file":"bundle.c6d55.esm.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t0: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + ({\"2\":\"route-editor\",\"3\":\"route-post\"}[chunkId]||chunkId) + \".chunk.\" + {\"2\":\"f6351\",\"3\":\"fd471\"}[chunkId] + \".esm.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"2\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"\" + ({\"2\":\"route-editor\",\"3\":\"route-post\"}[chunkId]||chunkId) + \".chunk.\" + {\"2\":\"e8d99\",\"3\":\"31d6c\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"mdyV\");\n","import { cloneElement, createElement, Component, toChildArray } from 'preact';\nimport { exec, prepareVNodeForRanking, assign, pathRankSort } from './util';\n\nlet customHistory = null;\n\nconst ROUTERS = [];\n\nconst subscribers = [];\n\nconst EMPTY = {};\n\nfunction setUrl(url, type='push') {\n\tif (customHistory && customHistory[type]) {\n\t\tcustomHistory[type](url);\n\t}\n\telse if (typeof history!=='undefined' && history[type+'State']) {\n\t\thistory[type+'State'](null, null, url);\n\t}\n}\n\n\nfunction getCurrentUrl() {\n\tlet url;\n\tif (customHistory && customHistory.location) {\n\t\turl = customHistory.location;\n\t}\n\telse if (customHistory && customHistory.getCurrentLocation) {\n\t\turl = customHistory.getCurrentLocation();\n\t}\n\telse {\n\t\turl = typeof location!=='undefined' ? location : EMPTY;\n\t}\n\treturn `${url.pathname || ''}${url.search || ''}`;\n}\n\n\n\nfunction route(url, replace=false) {\n\tif (typeof url!=='string' && url.url) {\n\t\treplace = url.replace;\n\t\turl = url.url;\n\t}\n\n\t// only push URL into history if we can handle it\n\tif (canRoute(url)) {\n\t\tsetUrl(url, replace ? 'replace' : 'push');\n\t}\n\n\treturn routeTo(url);\n}\n\n\n/** Check if the given URL can be handled by any router instances. */\nfunction canRoute(url) {\n\tfor (let i=ROUTERS.length; i--; ) {\n\t\tif (ROUTERS[i].canRoute(url)) return true;\n\t}\n\treturn false;\n}\n\n\n/** Tell all router instances to handle the given URL. */\nfunction routeTo(url) {\n\tlet didRoute = false;\n\tfor (let i=0; i {\n\t\t\t\trouteTo(getCurrentUrl());\n\t\t\t});\n\t\t}\n\t\taddEventListener('click', delegateLinkHandler);\n\t}\n\teventListenersInitialized = true;\n}\n\n\nclass Router extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (props.history) {\n\t\t\tcustomHistory = props.history;\n\t\t}\n\n\t\tthis.state = {\n\t\t\turl: props.url || getCurrentUrl()\n\t\t};\n\n\t\tinitEventListeners();\n\t}\n\n\tshouldComponentUpdate(props) {\n\t\tif (props.static!==true) return true;\n\t\treturn props.url!==this.props.url || props.onChange!==this.props.onChange;\n\t}\n\n\t/** Check if the given URL can be matched against any children */\n\tcanRoute(url) {\n\t\tconst children = toChildArray(this.props.children);\n\t\treturn this.getMatchingChildren(children, url, false).length > 0;\n\t}\n\n\t/** Re-render children with a new URL to match against. */\n\trouteTo(url) {\n\t\tthis.setState({ url });\n\n\t\tconst didRoute = this.canRoute(url);\n\n\t\t// trigger a manual re-route if we're not in the middle of an update:\n\t\tif (!this.updating) this.forceUpdate();\n\n\t\treturn didRoute;\n\t}\n\n\tcomponentWillMount() {\n\t\tROUTERS.push(this);\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidMount() {\n\t\tif (customHistory) {\n\t\t\tthis.unlisten = customHistory.listen((location) => {\n\t\t\t\tthis.routeTo(`${location.pathname || ''}${location.search || ''}`);\n\t\t\t});\n\t\t}\n\t\tthis.updating = false;\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (typeof this.unlisten==='function') this.unlisten();\n\t\tROUTERS.splice(ROUTERS.indexOf(this), 1);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.updating = false;\n\t}\n\n\tgetMatchingChildren(children, url, invoke) {\n\t\treturn children\n\t\t\t.filter(prepareVNodeForRanking)\n\t\t\t.sort(pathRankSort)\n\t\t\t.map( vnode => {\n\t\t\t\tlet matches = exec(url, vnode.props.path, vnode.props);\n\t\t\t\tif (matches) {\n\t\t\t\t\tif (invoke !== false) {\n\t\t\t\t\t\tlet newProps = { url, matches };\n\t\t\t\t\t\tassign(newProps, matches);\n\t\t\t\t\t\tdelete newProps.ref;\n\t\t\t\t\t\tdelete newProps.key;\n\t\t\t\t\t\treturn cloneElement(vnode, newProps);\n\t\t\t\t\t}\n\t\t\t\t\treturn vnode;\n\t\t\t\t}\n\t\t\t}).filter(Boolean);\n\t}\n\n\trender({ children, onChange }, { url }) {\n\t\tlet active = this.getMatchingChildren(toChildArray(children), url, true);\n\n\t\tlet current = active[0] || null;\n\n\t\tlet previous = this.previousUrl;\n\t\tif (url!==previous) {\n\t\t\tthis.previousUrl = url;\n\t\t\tif (typeof onChange==='function') {\n\t\t\t\tonChange({\n\t\t\t\t\trouter: this,\n\t\t\t\t\turl,\n\t\t\t\t\tprevious,\n\t\t\t\t\tactive,\n\t\t\t\t\tcurrent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nconst Link = (props) => (\n\tcreateElement('a', assign({ onClick: handleLinkClick }, props))\n);\n\nconst Route = props => createElement(props.component, props);\n\nRouter.subscribers = subscribers;\nRouter.getCurrentUrl = getCurrentUrl;\nRouter.route = route;\nRouter.Router = Router;\nRouter.Route = Route;\nRouter.Link = Link;\nRouter.exec = exec;\n\nexport { subscribers, getCurrentUrl, route, Router, Route, Link, exec };\nexport default Router;\n","import { h, Component } from 'preact';\n\nconst PENDING = {};\n\n// Given a VNode, finds its previous element sibling\nfunction getPreviousSibling(vnode, inner) {\n\t// in an element parent with no preceeding siblings means we're the first child\n\tif (typeof vnode.type === 'string') return null;\n\tconst parent = vnode.__;\n\tif (!parent) return;\n\tlet children = parent.__k;\n\tif (children) {\n\t\tif (!Array.isArray(children)) children = [children];\n\t\t// only search previous children\n\t\tlet end = children.indexOf(vnode);\n\t\tif (end === -1) end = children.length;\n\t\tfor (let i=end; i--; ) {\n\t\t\tconst child = children[i];\n\t\t\tconst dom = child && child.__e || getPreviousSibling(child, true);\n\t\t\tif (dom) return dom;\n\t\t}\n\t}\n\tif (!inner) return getPreviousSibling(parent);\n}\n\nexport default function async(load) {\n\tlet component;\n\n\tfunction AsyncComponent() {\n\t\tComponent.call(this);\n\n\t\tif (!component) {\n\t\t\tthis.componentWillMount = () => {\n\t\t\t\tload((mod) => {\n\t\t\t\t\tcomponent = (mod && mod.default) || mod;\n\t\t\t\t\tthis.setState({});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = () => component != null;\n\t\t}\n\n\t\tthis.render = (props) => {\n\t\t\tif (component) {\n\t\t\t\treturn h(component, props);\n\t\t\t}\n\n\t\t\tconst prev = getPreviousSibling(this.__v);\n\t\t\tconst me = prev && prev.nextSibling || (this.__P || this._parentDom).firstChild;\n\n\t\t\treturn (\n\t\t\t\tme &&\n\t\t\t\th(me.localName, {\n\t\t\t\t\tdangerouslySetInnerHTML: PENDING,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\t}\n\n\tAsyncComponent.preload = load;\n\t(AsyncComponent.prototype = new Component()).constructor = AsyncComponent;\n\n\treturn AsyncComponent;\n}\n","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-editor\");\n\t\t}\n\n\t\texport default Async(load);\n\t","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-post\");\n\t\t}\n\n\t\texport default Async(load);\n\t","import {h} from 'preact'\nimport {useState} from 'preact/hooks'\nimport {Router} from 'preact-router'\n\nimport Editor from './routes/editor'\nimport Post from './routes/post'\n\nimport './style/typography.css'\nimport './style'\n\nconst App = () => {\n const [markdown, setMarkdown] = useState('')\n\n return (
\n \n \n \n \n \n
)\n}\n\nexport default App\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\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","import options from './options';\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++options._vnodeId : original\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tlet newDom = diff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (newDom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\nprocess._rerenderCount = 0;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { removeNode } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../index').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Node | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\t// Only in very specific places should this logic be invoked (top level `render` and `diffElementNodes`).\n\t// I'm using `EMPTY_OBJ` to signal when `diffChildren` is invoked in these situations. I can't use `null`\n\t// for this purpose, because `null` is a valid value for `oldDom` which can mean to skip to this logic\n\t// (e.g. if mounting a new tree in which the old DOM should be ignored (usually for Fragments).\n\tif (oldDom == EMPTY_OBJ) {\n\t\tif (excessDomChildren != null) {\n\t\t\toldDom = excessDomChildren[0];\n\t\t} else if (oldChildrenLength) {\n\t\t\toldDom = getDomSibling(oldParentVNode, 0);\n\t\t} else {\n\t\t\toldDom = null;\n\t\t}\n\t}\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (typeof childVNode == 'string' || typeof childVNode == 'number') {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._dom != null || childVNode._component != null) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tnull,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tnewDom = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\toldDom = placeChild(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\toldVNode,\n\t\t\t\toldChildren,\n\t\t\t\texcessDomChildren,\n\t\t\t\tnewDom,\n\t\t\t\toldDom\n\t\t\t);\n\n\t\t\t// Browsers will infer an option's `value` from `textContent` when\n\t\t\t// no value is present. This essentially bypasses our code to set it\n\t\t\t// later in `diff()`. It works fine in all browsers except for IE11\n\t\t\t// where it breaks setting `select.value`. There it will be always set\n\t\t\t// to an empty string. Re-applying an options value will fix that, so\n\t\t\t// there are probably some internal data structures that aren't\n\t\t\t// updated properly.\n\t\t\t//\n\t\t\t// To fix it we make sure to reset the inferred value, so that our own\n\t\t\t// value check in `diff()` won't be skipped.\n\t\t\tif (!isHydrating && newParentVNode.type == 'option') {\n\t\t\t\tparentDom.value = '';\n\t\t\t} else if (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove children that are not part of any vnode.\n\tif (excessDomChildren != null && typeof newParentVNode.type != 'function') {\n\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) unmount(oldChildren[i], oldChildren[i]);\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nexport function placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\texcessDomChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\texcessDomChildren == oldVNode ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\t// NOTE: excessDomChildren==oldVNode above:\n\t\t// This is a compression of excessDomChildren==null && oldVNode==null!\n\t\t// The values only have the same type when `null`.\n\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j 1) {\n\t\t\t\t\treorderChildren(vnode, oldDom, parentDom);\n\t\t\t\t}\n\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tvnode,\n\t\t\t\t\tvnode,\n\t\t\t\t\tnewVNode._children,\n\t\t\t\t\tnull,\n\t\t\t\t\tvnode._dom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\n\t\t\t\tif (typeof newVNode.type == 'function') {\n\t\t\t\t\tnewVNode._nextDom = oldDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Element | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\treorderChildren(newVNode, oldDom, parentDom);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type == Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n\n\treturn newVNode._dom;\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet i;\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvg = newVNode.type === 'svg' || isSvg;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild != null &&\n\t\t\t\t((newVNode.type === null\n\t\t\t\t\t? child.nodeType === 3\n\t\t\t\t\t: child.localName === newVNode.type) ||\n\t\t\t\t\tdom == child)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (newVNode.type === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = isSvg\n\t\t\t? document.createElementNS('http://www.w3.org/2000/svg', newVNode.type)\n\t\t\t: document.createElement(\n\t\t\t\t\tnewVNode.type,\n\t\t\t\t\tnewProps.is && { is: newProps.is }\n\t\t\t );\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (newVNode.type === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\tif (excessDomChildren != null) {\n\t\t\texcessDomChildren = EMPTY_ARR.slice.call(dom.childNodes);\n\t\t}\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (let i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnewVNode.type === 'foreignObject' ? false : isSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tEMPTY_OBJ,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value || (newVNode.type === 'progress' && !i))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tlet dom;\n\tif (!skipRemove && typeof vnode.type != 'function') {\n\t\tskipRemove = (dom = vnode._dom) != null;\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) unmount(r[i], parentVNode, skipRemove);\n\t\t}\n\t}\n\n\tif (dom != null) removeNode(dom);\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 { EMPTY_OBJ, EMPTY_ARR } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\n\nconst IS_HYDRATE = EMPTY_OBJ;\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {Element | Text} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we\n\t// are in hydration mode or not by passing `IS_HYDRATE` instead of a\n\t// DOM element.\n\tlet isHydrating = replaceNode === IS_HYDRATE;\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\tvnode = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\t((isHydrating ? parentDom : replaceNode || parentDom)._children = vnode),\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\treplaceNode && !isHydrating\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.childNodes.length\n\t\t\t? EMPTY_ARR.slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\treplaceNode || EMPTY_OBJ,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, IS_HYDRATE);\n}\n","import { assign } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\tProvider(props, subs, ctx) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tsubs = [];\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(enqueueRender);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError,\n\t_vnodeId: 0\n};\n\nexport default options;\n","// import { enqueueRender } from '../component';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, vnode) {\n\t/** @type {import('../internal').Component} */\n\tlet component, ctor, handled;\n\n\tconst wasHydrating = vnode._hydrating;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error);\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\tvnode._hydrating = wasHydrating;\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/bundle.e0447.esm.js b/docs/bundle.e0447.esm.js new file mode 100644 index 0000000..2cb955b --- /dev/null +++ b/docs/bundle.e0447.esm.js @@ -0,0 +1,2 @@ +!function(t){function n(n){for(var e,r,o=n[0],u=n[1],_=0,l=[];_=e.__.length&&e.__.push({}),e.__[t]}function o(t){return x=1,i(g,t)}function i(t,n,e){var o=r(b++,2);return o.t=t,o.__c||(o.__=[e?e(n):g(void 0,n),function(t){var n=o.t(o.__[0],t);o.__[0]!==n&&(o.__=[n,o.__[1]],o.__c.setState({}))}],o.__c=k),o.__}function u(t,n){var e=r(b++,3);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__H.__h.push(e))}function _(t,n){var e=r(b++,4);!w.options.__s&&m(e.__H,n)&&(e.__=t,e.__H=n,k.__h.push(e))}function l(t){return x=5,a((function(){return{current:t}}),[])}function c(t,n,e){x=6,_((function(){"function"==typeof t?t(n()):t&&(t.current=n())}),null==e?e:e.concat(t))}function a(t,n){var e=r(b++,7);return m(e.__H,n)&&(e.__=t(),e.__H=n,e.__h=t),e.__}function f(t,n){return x=8,a((function(){return t}),n)}function s(t){var n=k.context[t.__c],e=r(b++,9);return e.__c=t,n?(null==e.__&&(e.__=!0,n.sub(k)),n.props.value):t.__}function p(t,n){w.options.useDebugValue&&w.options.useDebugValue(n?n(t):t)}function h(t){var n=r(b++,10),e=o();return n.__=t,k.componentDidCatch||(k.componentDidCatch=function(t){n.__&&n.__(t),e[1](t)}),[e[0],function(){e[1](void 0)}]}function d(){A.forEach((function(t){if(t.__P)try{t.__H.__h.forEach(v),t.__H.__h.forEach(y),t.__H.__h=[]}catch(n){t.__H.__h=[],w.options.__e(n,t.__v)}})),A=[]}function v(t){var n=k;"function"==typeof t.__c&&t.__c(),k=n}function y(t){var n=k;t.__c=t.__(),k=n}function m(t,n){return!t||t.length!==n.length||n.some((function(n,e){return n!==t[e]}))}function g(t,n){return"function"==typeof n?n(t):n}e.d(n,"k",(function(){return o})),e.d(n,"i",(function(){return i})),e.d(n,"d",(function(){return u})),e.d(n,"g",(function(){return _})),e.d(n,"j",(function(){return l})),e.d(n,"f",(function(){return c})),e.d(n,"h",(function(){return a})),e.d(n,"a",(function(){return f})),e.d(n,"b",(function(){return s})),e.d(n,"c",(function(){return p})),e.d(n,"e",(function(){return h}));var b,k,C,w=e("hosL"),x=0,A=[],O=w.options.__b,E=w.options.__r,S=w.options.diffed,P=w.options.__c,j=w.options.unmount;w.options.__b=function(t){k=null,O&&O(t)},w.options.__r=function(t){E&&E(t),b=0;var n=(k=t.__c).__H;n&&(n.__h.forEach(v),n.__h.forEach(y),n.__h=[])},w.options.diffed=function(t){S&&S(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==A.push(n)&&C===w.options.requestAnimationFrame||((C=w.options.requestAnimationFrame)||function(t){var n,e=function(){clearTimeout(r),T&&cancelAnimationFrame(n),setTimeout(t)},r=setTimeout(e,100);T&&(n=requestAnimationFrame(e))})(d)),k=void 0},w.options.__c=function(t,n){n.some((function(t){try{t.__h.forEach(v),t.__h=t.__h.filter((function(t){return!t.__||y(t)}))}catch(e){n.some((function(t){t.__h&&(t.__h=[])})),n=[],w.options.__e(e,t.__v)}})),P&&P(t,n)},w.options.unmount=function(t){j&&j(t);var n=t.__c;if(n&&n.__H)try{n.__H.__.forEach(v)}catch(t){w.options.__e(t,n.__v)}};var T="function"==typeof requestAnimationFrame},QfWi:function(t,n,e){"use strict";function r(t){function n(){i.Component.call(this),e||(this.componentWillMount=()=>{t(t=>{e=t&&t.default||t,this.setState({})})},this.shouldComponentUpdate=()=>null!=e),this.render=t=>{if(e)return Object(i.h)(e,t);const n=function t(n,e){if("string"==typeof n.type)return null;const r=n.__;if(!r)return;let o=r.__k;if(o){Array.isArray(o)||(o=[o]);let e=o.indexOf(n);-1===e&&(e=o.length);for(let n=e;n--;){const e=o[n],r=e&&e.__e||t(e,!0);if(r)return r}}return e?void 0:t(r)}(this.__v),r=n&&n.nextSibling||(this.__P||this._parentDom).firstChild;return r&&Object(i.h)(r.localName,{dangerouslySetInnerHTML:l})}}let e;return n.preload=t,(n.prototype=new i.Component).constructor=n,n}function o(){return(o=Object.assign||function(t){for(var n=1;n{const[t,n]=Object(u.k)("");return Object(i.h)("main",null,Object(i.h)(_.Router,null,Object(i.h)(c,o({path:"/",markdown:t},{setMarkdown:n})),Object(i.h)(a,o({path:"/preview/",mode:"preview",payload:t},{setMarkdown:n})),Object(i.h)(a,o({path:"/p/:payload",mode:"post"},{setMarkdown:n}))))}},Y3FI:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t,n,e){var r,o=/(?:\?([^#]*))?(#.*)?$/,i=t.match(o),u={};if(i&&i[1])for(var l=i[1].split("&"),c=0;cn.rank?-1:t.index-n.index}function u(t,n){return t.index=n,t.rank=function(t){return t.props.default?0:(n=t.props.path,_(n).map(l).join(""));var n}(t),t.props}function _(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function l(t){return":"==t.charAt(0)?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}function c(){var t;return""+((t=m&&m.location?m.location:m&&m.getCurrentLocation?m.getCurrentLocation():"undefined"!=typeof location?location:k).pathname||"")+(t.search||"")}function a(t,n){return void 0===n&&(n=!1),"string"!=typeof t&&t.url&&(n=t.replace,t=t.url),function(t){for(var n=g.length;n--;)if(g[n].canRoute(t))return!0;return!1}(t)&&function(t,n){void 0===n&&(n="push"),m&&m[n]?m[n](t):"undefined"!=typeof history&&history[n+"State"]&&history[n+"State"](null,null,t)}(t,n?"replace":"push"),f(t)}function f(t){for(var n=!1,e=0;e0},n.prototype.routeTo=function(t){this.setState({url:t});var n=this.canRoute(t);return this.updating||this.forceUpdate(),n},n.prototype.componentWillMount=function(){g.push(this),this.updating=!0},n.prototype.componentDidMount=function(){var t=this;m&&(this.unlisten=m.listen((function(n){t.routeTo(""+(n.pathname||"")+(n.search||""))}))),this.updating=!1},n.prototype.componentWillUnmount=function(){"function"==typeof this.unlisten&&this.unlisten(),g.splice(g.indexOf(this),1)},n.prototype.componentWillUpdate=function(){this.updating=!0},n.prototype.componentDidUpdate=function(){this.updating=!1},n.prototype.getMatchingChildren=function(t,n,e){return t.filter(u).sort(i).map((function(t){var i=o(n,t.props.path,t.props);if(i){if(!1!==e){var u={url:n,matches:i};return r(u,i),delete u.ref,delete u.key,Object(v.cloneElement)(t,u)}return t}})).filter(Boolean)},n.prototype.render=function(t,n){var e=t.children,r=t.onChange,o=n.url,i=this.getMatchingChildren(Object(v.toChildArray)(e),o,!0),u=i[0]||null,_=this.previousUrl;return o!==_&&(this.previousUrl=o,"function"==typeof r&&r({router:this,url:o,previous:_,active:i,current:u})),u},n}(v.Component),x=function(t){return Object(v.createElement)("a",r({onClick:p},t))},A=function(t){return Object(v.createElement)(t.component,t)};w.subscribers=b,w.getCurrentUrl=c,w.route=a,w.Router=w,w.Route=A,w.Link=x,w.exec=o,n.default=w},hosL:function(t,n,e){"use strict";function r(t,n){for(var e in n)t[e]=n[e];return t}function o(t){var n=t.parentNode;n&&n.removeChild(t)}function i(t,n,e){var r,o,i,_=arguments,l={};for(i in n)"key"==i?r=n[i]:"ref"==i?o=n[i]:l[i]=n[i];if(arguments.length>3)for(e=[e],i=3;i1&&k(o,n,e),n=v(e,o,o,t.__k,null,o.__e,n),"function"==typeof t.type&&(t.__d=n)))}function C(t,n,e,o,i,u,_,a,f){var s,p,d,v,y,m,g,b,C,w,A,O=n.type;if(void 0!==n.constructor)return null;null!=e.__h&&(f=e.__h,a=n.__e=e.__e,n.__h=null,u=[a]),(s=L.__b)&&s(n);try{t:if("function"==typeof O){if(b=n.props,C=(s=O.contextType)&&o[s.__c],w=s?C?C.props.value:s.__:o,e.__c?g=(p=n.__c=e.__c).__=p.__E:("prototype"in O&&O.prototype.render?n.__c=p=new O(b,w):(n.__c=p=new c(b,w),p.constructor=O,p.render=E),C&&C.sub(p),p.props=b,p.state||(p.state={}),p.context=w,p.__n=o,d=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=r({},p.__s)),r(p.__s,O.getDerivedStateFromProps(b,p.__s))),v=p.props,y=p.state,d)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,w),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,w)||n.__v===e.__v){p.props=b,p.state=p.__s,n.__v!==e.__v&&(p.__d=!1),p.__v=n,n.__e=e.__e,n.__k=e.__k,p.__h.length&&_.push(p),k(n,a,t);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,w),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(v,y,m)}))}p.context=w,p.props=b,p.state=p.__s,(s=L.__r)&&s(n),p.__d=!1,p.__v=n,p.__P=t,s=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=r(r({},o),p.getChildContext())),d||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(v,y)),A=null!=s&&s.type==l&&null==s.key?s.props.children:s,h(t,Array.isArray(A)?A:[A],n,e,o,i,u,_,a,f),p.base=n.__e,n.__h=null,p.__h.length&&_.push(p),g&&(p.__E=p.__=null),p.__e=!1}else null==u&&n.__v===e.__v?(n.__k=e.__k,n.__e=e.__e):n.__e=x(e.__e,n,e,o,i,u,_,f);(s=L.diffed)&&s(n)}catch(t){n.__v=null,(f||null!=u)&&(n.__e=a,n.__h=!!f,u[u.indexOf(a)]=null),L.__e(t,n,e)}return n.__e}function w(t,n){L.__c&&L.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){L.__e(t,n.__v)}}))}function x(t,n,e,r,o,i,u,_){var l,c,a,f,s,p=e.props,d=n.props;if(o="svg"===n.type||o,null!=i)for(l=0;l3)for(e=[e],_=3;_t&&t.default?t.default:t,l=t=>"/"===t[t.length-1]?t:t+"/";if("serviceWorker"in navigator&&navigator.serviceWorker.register(e.p+"sw-esm.js"),"function"==typeof _(e("QfWi"))){let t=document.getElementById("preact_root")||document.body.firstElementChild;0,(()=>{let n=_(e("QfWi")),r={};const c=document.querySelector('[type="__PREACT_CLI_DATA__"]');c&&(r=JSON.parse(decodeURI(c.innerHTML)).preRenderData||r);const a={preRenderData:r},f=r.url?l(r.url):"",s=u&&f===l(location.pathname);t=(s?u:i)(o(n,{CLI_DATA:a}),document.body,t)})()}},pRls:function(){}}); +//# sourceMappingURL=bundle.e0447.esm.js.map \ No newline at end of file diff --git a/docs/bundle.e0447.esm.js.map b/docs/bundle.e0447.esm.js.map new file mode 100644 index 0000000..6e1a408 --- /dev/null +++ b/docs/bundle.e0447.esm.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../src/index.js","webpack:///../node_modules/@preact/async-loader/async.js","webpack:///./routes/editor/index.js?5cf4","webpack:///./routes/post/index.js?01a5","webpack:///./index.js","webpack:///../src/util.js","webpack:///../src/create-element.js","webpack:///../src/component.js","webpack:///../src/diff/children.js","webpack:///../src/diff/props.js","webpack:///../src/diff/index.js","webpack:///../src/render.js","webpack:///../src/clone-element.js","webpack:///../src/create-context.js","webpack:///../src/constants.js","webpack:///../src/options.js","webpack:///../src/diff/catch-error.js","webpack:///../node_modules/preact-cli/lib/lib/entry.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","__webpack_require__","installedModules","exports","module","l","installedCssChunks","0","e","promises","Promise","resolve","reject","href","fullhref","p","existingLinkTags","document","getElementsByTagName","dataHref","tag","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","jsonpScriptSrc","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","head","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","s","getHookState","index","options","currentComponent","currentHook","hooks","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","currentIndex","_reducer","nextValue","action","setState","useEffect","callback","args","state","argsChanged","useLayoutEffect","useRef","initialValue","useMemo","current","useImperativeHandle","ref","createHandle","concat","factory","useCallback","useContext","context","provider","sub","props","useDebugValue","formatter","useErrorBoundary","cb","errState","componentDidCatch","flushAfterPaintEffects","afterPaintEffects","forEach","component","invokeCleanup","invokeEffect","hook","comp","oldArgs","newArgs","some","arg","f","prevRaf","oldBeforeDiff","oldBeforeRender","oldAfterDiff","diffed","oldCommit","oldBeforeUnmount","unmount","vnode","requestAnimationFrame","raf","done","HAS_RAF","cancelAnimationFrame","commitQueue","filter","async","load","AsyncComponent","Component","this","componentWillMount","mod","default","shouldComponentUpdate","render","h","prev","getPreviousSibling","inner","parent","__","children","__k","Array","isArray","end","indexOf","child","dom","__e","__v","me","nextSibling","__P","_parentDom","firstChild","localName","dangerouslySetInnerHTML","PENDING","preload","constructor","result","App","markdown","setMarkdown","path","payload","let","EMPTY","getCurrentUrl","url","customHistory","location","getCurrentLocation","pathname","search","route","replace","ROUTERS","canRoute","history","setUrl","routeTo","didRoute","subscribers","routeFromLink","node","match","handleLinkClick","ctrlKey","metaKey","altKey","shiftKey","button","currentTarget","prevent","stopImmediatePropagation","stopPropagation","preventDefault","delegateLinkHandler","String","nodeName","toUpperCase","hasAttribute","eventListenersInitialized","Router","super","addEventListener","static","onChange","const","getMatchingChildren","updating","forceUpdate","componentDidMount","unlisten","listen","componentWillUnmount","splice","componentWillUpdate","componentDidUpdate","invoke","prepareVNodeForRanking","sort","pathRankSort","map","matches","exec","newProps","assign","Boolean","active","previous","previousUrl","router","Link","onClick","Route","obj","removeNode","normalizedProps","arguments","defaultProps","createVNode","original","createRef","Fragment","getDomSibling","childIndex","sibling","updateParentDomPointers","base","enqueueRender","rerenderQueue","process","prevDebounce","debounceRendering","defer","queue","a","b","oldVNode","newDom","oldDom","parentDom","diff","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","childVNode","firstChildDom","refs","oldChildren","EMPTY_ARR","oldChildrenLength","EMPTY_OBJ","placeChild","applyRef","toChildArray","out","nextDom","sibDom","outer","insertBefore","setStyle","style","setProperty","IS_NON_DIMENSIONAL","test","oldValue","useCapture","nameLower","proxy","cssText","toLowerCase","_listeners","eventProxyCapture","eventProxy","removeEventListener","removeAttributeNS","setAttributeNS","removeAttribute","reorderChildren","newVNode","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","componentContext","newType","contextType","doRender","getDerivedStateFromProps","componentWillReceiveProps","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","root","oldHtml","newHtml","nodeType","createTextNode","createElementNS","is","childNodes","attributes","innerHTML","hydrate","diffProps","checked","parentVNode","skipRemove","replaceNode","IS_HYDRATE","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","isValidElement","ctor","handled","wasHydrating","getDerivedStateFromError","update","Preact","interopDefault","normalizeURL","navigator","serviceWorker","register","__webpack_public_path__","require","getElementById","body","firstElementChild","app","preRenderData","inlineDataElement","querySelector","JSON","parse","decodeURI","CLI_DATA","currentURL","canHydrate"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiB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D,EAAU7K,UAAUmL,OAASgH,EAyFzBO,EAAgB,GAQdI,EACa,mBAAX7R,QACJA,QAAQjB,UAAU8C,KAAKuC,KAAKpE,QAAQC,WACpC8C,WA2CJ2O,MAAyB,EIzNnByF,EAAa5D,EEHR5U,EAAI,G,kCIFf,uBAGA,MAAM,EAAEwL,EAAF,OAAKD,EAAL,QAAa2M,GAAYwB,EAEzBC,EAAiBpV,GAAMA,GAAKA,EAAE8G,QAAU9G,EAAE8G,QAAU9G,EAEpDqV,EAAejM,GAAgC,MAAxBA,EAAIA,EAAIzN,OAAS,GAAayN,EAAMA,EAAM,IAyBvE,GATiC,kBAAmBkM,WAEnDA,UAAUC,cAAcC,SACvBC,IAAkD,aAMjC,mBAFTL,EAAeM,EAAQ,SAEF,CAC9B,IAAIzC,EACH5V,SAASsY,eAAe,gBAAkBtY,SAASuY,KAAKC,kBA4BrDrZ,EA1BO,MACV,IAAIsZ,EAAMV,EAAeM,EAAQ,SAC7BK,EAAgB,GACpB,MAAMC,EAAoB3Y,SAAS4Y,cAClC,gCAEGD,IACHD,EACCG,KAAKC,MAAMC,UAAUJ,EAAkBtC,YAAYqC,eACnDA,GAMF,MAAMM,EAAW,CAAEN,iBACbO,EAAaP,EAAc3M,IAAMiM,EAAaU,EAAc3M,KAAO,GACnEmN,EAGL5C,GACA2C,IAAejB,EAAa/L,SAASE,UAEtCyJ,GADiBsD,EAAa5C,EAAU3M,GACxBC,EAAE6O,EAAK,CAAEO,aAAahZ,SAASuY,KAAM3C,IAKtDzQ,K","file":"bundle.e0447.esm.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t0: 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + ({\"2\":\"route-editor\",\"3\":\"route-post\"}[chunkId]||chunkId) + \".chunk.\" + {\"2\":\"f6351\",\"3\":\"fd471\"}[chunkId] + \".esm.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"2\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"\" + ({\"2\":\"route-editor\",\"3\":\"route-post\"}[chunkId]||chunkId) + \".chunk.\" + {\"2\":\"e8d99\",\"3\":\"31d6c\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/huge-link/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"mdyV\");\n","import { cloneElement, createElement, Component, toChildArray } from 'preact';\nimport { exec, prepareVNodeForRanking, assign, pathRankSort } from './util';\n\nlet customHistory = null;\n\nconst ROUTERS = [];\n\nconst subscribers = [];\n\nconst EMPTY = {};\n\nfunction setUrl(url, type='push') {\n\tif (customHistory && customHistory[type]) {\n\t\tcustomHistory[type](url);\n\t}\n\telse if (typeof history!=='undefined' && history[type+'State']) {\n\t\thistory[type+'State'](null, null, url);\n\t}\n}\n\n\nfunction getCurrentUrl() {\n\tlet url;\n\tif (customHistory && customHistory.location) {\n\t\turl = customHistory.location;\n\t}\n\telse if (customHistory && customHistory.getCurrentLocation) {\n\t\turl = customHistory.getCurrentLocation();\n\t}\n\telse {\n\t\turl = typeof location!=='undefined' ? location : EMPTY;\n\t}\n\treturn `${url.pathname || ''}${url.search || ''}`;\n}\n\n\n\nfunction route(url, replace=false) {\n\tif (typeof url!=='string' && url.url) {\n\t\treplace = url.replace;\n\t\turl = url.url;\n\t}\n\n\t// only push URL into history if we can handle it\n\tif (canRoute(url)) {\n\t\tsetUrl(url, replace ? 'replace' : 'push');\n\t}\n\n\treturn routeTo(url);\n}\n\n\n/** Check if the given URL can be handled by any router instances. */\nfunction canRoute(url) {\n\tfor (let i=ROUTERS.length; i--; ) {\n\t\tif (ROUTERS[i].canRoute(url)) return true;\n\t}\n\treturn false;\n}\n\n\n/** Tell all router instances to handle the given URL. */\nfunction routeTo(url) {\n\tlet didRoute = false;\n\tfor (let i=0; i {\n\t\t\t\trouteTo(getCurrentUrl());\n\t\t\t});\n\t\t}\n\t\taddEventListener('click', delegateLinkHandler);\n\t}\n\teventListenersInitialized = true;\n}\n\n\nclass Router extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (props.history) {\n\t\t\tcustomHistory = props.history;\n\t\t}\n\n\t\tthis.state = {\n\t\t\turl: props.url || getCurrentUrl()\n\t\t};\n\n\t\tinitEventListeners();\n\t}\n\n\tshouldComponentUpdate(props) {\n\t\tif (props.static!==true) return true;\n\t\treturn props.url!==this.props.url || props.onChange!==this.props.onChange;\n\t}\n\n\t/** Check if the given URL can be matched against any children */\n\tcanRoute(url) {\n\t\tconst children = toChildArray(this.props.children);\n\t\treturn this.getMatchingChildren(children, url, false).length > 0;\n\t}\n\n\t/** Re-render children with a new URL to match against. */\n\trouteTo(url) {\n\t\tthis.setState({ url });\n\n\t\tconst didRoute = this.canRoute(url);\n\n\t\t// trigger a manual re-route if we're not in the middle of an update:\n\t\tif (!this.updating) this.forceUpdate();\n\n\t\treturn didRoute;\n\t}\n\n\tcomponentWillMount() {\n\t\tROUTERS.push(this);\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidMount() {\n\t\tif (customHistory) {\n\t\t\tthis.unlisten = customHistory.listen((location) => {\n\t\t\t\tthis.routeTo(`${location.pathname || ''}${location.search || ''}`);\n\t\t\t});\n\t\t}\n\t\tthis.updating = false;\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif (typeof this.unlisten==='function') this.unlisten();\n\t\tROUTERS.splice(ROUTERS.indexOf(this), 1);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.updating = true;\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.updating = false;\n\t}\n\n\tgetMatchingChildren(children, url, invoke) {\n\t\treturn children\n\t\t\t.filter(prepareVNodeForRanking)\n\t\t\t.sort(pathRankSort)\n\t\t\t.map( vnode => {\n\t\t\t\tlet matches = exec(url, vnode.props.path, vnode.props);\n\t\t\t\tif (matches) {\n\t\t\t\t\tif (invoke !== false) {\n\t\t\t\t\t\tlet newProps = { url, matches };\n\t\t\t\t\t\tassign(newProps, matches);\n\t\t\t\t\t\tdelete newProps.ref;\n\t\t\t\t\t\tdelete newProps.key;\n\t\t\t\t\t\treturn cloneElement(vnode, newProps);\n\t\t\t\t\t}\n\t\t\t\t\treturn vnode;\n\t\t\t\t}\n\t\t\t}).filter(Boolean);\n\t}\n\n\trender({ children, onChange }, { url }) {\n\t\tlet active = this.getMatchingChildren(toChildArray(children), url, true);\n\n\t\tlet current = active[0] || null;\n\n\t\tlet previous = this.previousUrl;\n\t\tif (url!==previous) {\n\t\t\tthis.previousUrl = url;\n\t\t\tif (typeof onChange==='function') {\n\t\t\t\tonChange({\n\t\t\t\t\trouter: this,\n\t\t\t\t\turl,\n\t\t\t\t\tprevious,\n\t\t\t\t\tactive,\n\t\t\t\t\tcurrent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nconst Link = (props) => (\n\tcreateElement('a', assign({ onClick: handleLinkClick }, props))\n);\n\nconst Route = props => createElement(props.component, props);\n\nRouter.subscribers = subscribers;\nRouter.getCurrentUrl = getCurrentUrl;\nRouter.route = route;\nRouter.Router = Router;\nRouter.Route = Route;\nRouter.Link = Link;\nRouter.exec = exec;\n\nexport { subscribers, getCurrentUrl, route, Router, Route, Link, exec };\nexport default Router;\n","import { h, Component } from 'preact';\n\nconst PENDING = {};\n\n// Given a VNode, finds its previous element sibling\nfunction getPreviousSibling(vnode, inner) {\n\t// in an element parent with no preceeding siblings means we're the first child\n\tif (typeof vnode.type === 'string') return null;\n\tconst parent = vnode.__;\n\tif (!parent) return;\n\tlet children = parent.__k;\n\tif (children) {\n\t\tif (!Array.isArray(children)) children = [children];\n\t\t// only search previous children\n\t\tlet end = children.indexOf(vnode);\n\t\tif (end === -1) end = children.length;\n\t\tfor (let i=end; i--; ) {\n\t\t\tconst child = children[i];\n\t\t\tconst dom = child && child.__e || getPreviousSibling(child, true);\n\t\t\tif (dom) return dom;\n\t\t}\n\t}\n\tif (!inner) return getPreviousSibling(parent);\n}\n\nexport default function async(load) {\n\tlet component;\n\n\tfunction AsyncComponent() {\n\t\tComponent.call(this);\n\n\t\tif (!component) {\n\t\t\tthis.componentWillMount = () => {\n\t\t\t\tload((mod) => {\n\t\t\t\t\tcomponent = (mod && mod.default) || mod;\n\t\t\t\t\tthis.setState({});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = () => component != null;\n\t\t}\n\n\t\tthis.render = (props) => {\n\t\t\tif (component) {\n\t\t\t\treturn h(component, props);\n\t\t\t}\n\n\t\t\tconst prev = getPreviousSibling(this.__v);\n\t\t\tconst me = prev && prev.nextSibling || (this.__P || this._parentDom).firstChild;\n\n\t\t\treturn (\n\t\t\t\tme &&\n\t\t\t\th(me.localName, {\n\t\t\t\t\tdangerouslySetInnerHTML: PENDING,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\t}\n\n\tAsyncComponent.preload = load;\n\t(AsyncComponent.prototype = new Component()).constructor = AsyncComponent;\n\n\treturn AsyncComponent;\n}\n","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-editor\");\n\t\t}\n\n\t\texport default Async(load);\n\t","\n\t\timport Async from \"../../../node_modules/@preact/async-loader/async.js\";\n\n\t\tfunction load(cb) {\n\t\t\trequire.ensure([], function (require) {\n\t\t\t\tvar result = require(\"!!../../../node_modules/babel-loader/lib/index.js??ref--4!./index.js\");\n\t\t\t\ttypeof cb === 'function' && cb(result);\n\t\t\t}, \"route-post\");\n\t\t}\n\n\t\texport default Async(load);\n\t","import {h} from 'preact'\nimport {useState} from 'preact/hooks'\nimport {Router} from 'preact-router'\n\nimport Editor from './routes/editor'\nimport Post from './routes/post'\n\nimport './style/typography.css'\nimport './style'\n\nconst App = () => {\n const [markdown, setMarkdown] = useState('')\n\n return (
\n \n \n \n \n \n
)\n}\n\nexport default App\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\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","import options from './options';\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++options._vnodeId : original\n\t};\n\n\tif (options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = vnode._original + 1;\n\n\t\tlet newDom = diff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tvnode._hydrating != null ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom,\n\t\t\tvnode._hydrating\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (newDom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((process._rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\nprocess._rerenderCount = 0;\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { removeNode } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../index').ComponentChildren[]} renderResult\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Node | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, childVNode, newDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\t// Only in very specific places should this logic be invoked (top level `render` and `diffElementNodes`).\n\t// I'm using `EMPTY_OBJ` to signal when `diffChildren` is invoked in these situations. I can't use `null`\n\t// for this purpose, because `null` is a valid value for `oldDom` which can mean to skip to this logic\n\t// (e.g. if mounting a new tree in which the old DOM should be ignored (usually for Fragments).\n\tif (oldDom == EMPTY_OBJ) {\n\t\tif (excessDomChildren != null) {\n\t\t\toldDom = excessDomChildren[0];\n\t\t} else if (oldChildrenLength) {\n\t\t\toldDom = getDomSibling(oldParentVNode, 0);\n\t\t} else {\n\t\t\toldDom = null;\n\t\t}\n\t}\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < renderResult.length; i++) {\n\t\tchildVNode = renderResult[i];\n\n\t\tif (childVNode == null || typeof childVNode == 'boolean') {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (typeof childVNode == 'string' || typeof childVNode == 'number') {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (Array.isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode._dom != null || childVNode._component != null) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tnull,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Terser removes the `continue` here and wraps the loop body\n\t\t// in a `if (childVNode) { ... } condition\n\t\tif (childVNode == null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Check if we find a corresponding element in oldChildren.\n\t\t// If found, delete the array item by setting to `undefined`.\n\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t// (holes).\n\t\toldVNode = oldChildren[i];\n\n\t\tif (\n\t\t\toldVNode === null ||\n\t\t\t(oldVNode &&\n\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t) {\n\t\t\toldChildren[i] = undefined;\n\t\t} else {\n\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t// We always match by type (in either case).\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\toldVNode = null;\n\t\t\t}\n\t\t}\n\n\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tnewDom = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating\n\t\t);\n\n\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\tif (!refs) refs = [];\n\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t}\n\n\t\tif (newDom != null) {\n\t\t\tif (firstChildDom == null) {\n\t\t\t\tfirstChildDom = newDom;\n\t\t\t}\n\n\t\t\toldDom = placeChild(\n\t\t\t\tparentDom,\n\t\t\t\tchildVNode,\n\t\t\t\toldVNode,\n\t\t\t\toldChildren,\n\t\t\t\texcessDomChildren,\n\t\t\t\tnewDom,\n\t\t\t\toldDom\n\t\t\t);\n\n\t\t\t// Browsers will infer an option's `value` from `textContent` when\n\t\t\t// no value is present. This essentially bypasses our code to set it\n\t\t\t// later in `diff()`. It works fine in all browsers except for IE11\n\t\t\t// where it breaks setting `select.value`. There it will be always set\n\t\t\t// to an empty string. Re-applying an options value will fix that, so\n\t\t\t// there are probably some internal data structures that aren't\n\t\t\t// updated properly.\n\t\t\t//\n\t\t\t// To fix it we make sure to reset the inferred value, so that our own\n\t\t\t// value check in `diff()` won't be skipped.\n\t\t\tif (!isHydrating && newParentVNode.type == 'option') {\n\t\t\t\tparentDom.value = '';\n\t\t\t} else if (typeof newParentVNode.type == 'function') {\n\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t//\n\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t// node's nextSibling.\n\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t}\n\t\t} else if (\n\t\t\toldDom &&\n\t\t\toldVNode._dom == oldDom &&\n\t\t\toldDom.parentNode != parentDom\n\t\t) {\n\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\toldDom = getDomSibling(oldVNode);\n\t\t}\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove children that are not part of any vnode.\n\tif (excessDomChildren != null && typeof newParentVNode.type != 'function') {\n\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) unmount(oldChildren[i], oldChildren[i]);\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (Array.isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\nexport function placeChild(\n\tparentDom,\n\tchildVNode,\n\toldVNode,\n\toldChildren,\n\texcessDomChildren,\n\tnewDom,\n\toldDom\n) {\n\tlet nextDom;\n\tif (childVNode._nextDom !== undefined) {\n\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t// of last DOM child of this child VNode\n\t\tnextDom = childVNode._nextDom;\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t// can clean up the property\n\t\tchildVNode._nextDom = undefined;\n\t} else if (\n\t\texcessDomChildren == oldVNode ||\n\t\tnewDom != oldDom ||\n\t\tnewDom.parentNode == null\n\t) {\n\t\t// NOTE: excessDomChildren==oldVNode above:\n\t\t// This is a compression of excessDomChildren==null && oldVNode==null!\n\t\t// The values only have the same type when `null`.\n\n\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\tparentDom.appendChild(newDom);\n\t\t\tnextDom = null;\n\t\t} else {\n\t\t\t// `j 1) {\n\t\t\t\t\treorderChildren(vnode, oldDom, parentDom);\n\t\t\t\t}\n\n\t\t\t\toldDom = placeChild(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tvnode,\n\t\t\t\t\tvnode,\n\t\t\t\t\tnewVNode._children,\n\t\t\t\t\tnull,\n\t\t\t\t\tvnode._dom,\n\t\t\t\t\toldDom\n\t\t\t\t);\n\n\t\t\t\tif (typeof newVNode.type == 'function') {\n\t\t\t\t\tnewVNode._nextDom = oldDom;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Element | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._hydrating != null) {\n\t\tisHydrating = oldVNode._hydrating;\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\t// if we resume, we want the tree to be \"unlocked\"\n\t\tnewVNode._hydrating = null;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\tnewVNode._original === oldVNode._original\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\treorderChildren(newVNode, oldDom, parentDom);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type == Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tArray.isArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._hydrating = null;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\tnewVNode._dom = oldDom;\n\t\t\tnewVNode._hydrating = !!isHydrating;\n\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t// ^ could possibly be simplified to:\n\t\t\t// excessDomChildren.length = 0;\n\t\t}\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n\n\treturn newVNode._dom;\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet i;\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvg = newVNode.type === 'svg' || isSvg;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild != null &&\n\t\t\t\t((newVNode.type === null\n\t\t\t\t\t? child.nodeType === 3\n\t\t\t\t\t: child.localName === newVNode.type) ||\n\t\t\t\t\tdom == child)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (newVNode.type === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = isSvg\n\t\t\t? document.createElementNS('http://www.w3.org/2000/svg', newVNode.type)\n\t\t\t: document.createElement(\n\t\t\t\t\tnewVNode.type,\n\t\t\t\t\tnewProps.is && { is: newProps.is }\n\t\t\t );\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (newVNode.type === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\tif (excessDomChildren != null) {\n\t\t\texcessDomChildren = EMPTY_ARR.slice.call(dom.childNodes);\n\t\t}\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\t// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)\n\t\t\t// we should read the existing DOM attributes to diff them\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (let i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (\n\t\t\t\t\t!newHtml ||\n\t\t\t\t\t((!oldHtml || newHtml.__html != oldHtml.__html) &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML)\n\t\t\t\t) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\ti = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tArray.isArray(i) ? i : [i],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnewVNode.type === 'foreignObject' ? false : isSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tEMPTY_OBJ,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(i !== dom.value || (newVNode.type === 'progress' && !i))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tlet dom;\n\tif (!skipRemove && typeof vnode.type != 'function') {\n\t\tskipRemove = (dom = vnode._dom) != null;\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) unmount(r[i], parentVNode, skipRemove);\n\t\t}\n\t}\n\n\tif (dom != null) removeNode(dom);\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 { EMPTY_OBJ, EMPTY_ARR } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\n\nconst IS_HYDRATE = EMPTY_OBJ;\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {Element | Text} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we\n\t// are in hydration mode or not by passing `IS_HYDRATE` instead of a\n\t// DOM element.\n\tlet isHydrating = replaceNode === IS_HYDRATE;\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\tvnode = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\t((isHydrating ? parentDom : replaceNode || parentDom)._children = vnode),\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\treplaceNode && !isHydrating\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.childNodes.length\n\t\t\t? EMPTY_ARR.slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\treplaceNode || EMPTY_OBJ,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, IS_HYDRATE);\n}\n","import { assign } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\tProvider(props, subs, ctx) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tsubs = [];\n\t\t\t\tctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function(_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(enqueueRender);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType = context);\n}\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError,\n\t_vnodeId: 0\n};\n\nexport default options;\n","// import { enqueueRender } from '../component';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, vnode) {\n\t/** @type {import('../internal').Component} */\n\tlet component, ctor, handled;\n\n\tconst wasHydrating = vnode._hydrating;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error);\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\tvnode._hydrating = wasHydrating;\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","/* global __webpack_public_path__ */\n\nimport * as Preact from 'preact';\nconst { h, render, hydrate } = Preact;\n\nconst interopDefault = m => (m && m.default ? m.default : m);\n\nconst normalizeURL = url => (url[url.length - 1] === '/' ? url : url + '/');\n\nif (process.env.NODE_ENV === 'development') {\n\t// enable preact devtools\n\trequire('preact/debug');\n\n\t// only add a debug sw if webpack service worker is not requested.\n\tif (process.env.ADD_SW === undefined && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(__webpack_public_path__ + 'sw-debug.js');\n\t} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t\t// eslint-disable-next-line no-undef\n\t\tnavigator.serviceWorker.register(\n\t\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t\t);\n\t}\n} else if (process.env.ADD_SW && 'serviceWorker' in navigator) {\n\t// eslint-disable-next-line no-undef\n\tnavigator.serviceWorker.register(\n\t\t__webpack_public_path__ + (process.env.ES_BUILD ? 'sw-esm.js' : 'sw.js')\n\t);\n}\n\nlet app = interopDefault(require('preact-cli-entrypoint'));\n\nif (typeof app === 'function') {\n\tlet root =\n\t\tdocument.getElementById('preact_root') || document.body.firstElementChild;\n\n\tlet init = () => {\n\t\tlet app = interopDefault(require('preact-cli-entrypoint'));\n\t\tlet preRenderData = {};\n\t\tconst inlineDataElement = document.querySelector(\n\t\t\t'[type=\"__PREACT_CLI_DATA__\"]'\n\t\t);\n\t\tif (inlineDataElement) {\n\t\t\tpreRenderData =\n\t\t\t\tJSON.parse(decodeURI(inlineDataElement.innerHTML)).preRenderData ||\n\t\t\t\tpreRenderData;\n\t\t}\n\t\t/* An object named CLI_DATA is passed as a prop,\n\t\t * this keeps us future proof if in case we decide,\n\t\t * to send other data like at some point in time.\n\t\t */\n\t\tconst CLI_DATA = { preRenderData };\n\t\tconst currentURL = preRenderData.url ? normalizeURL(preRenderData.url) : '';\n\t\tconst canHydrate =\n\t\t\tprocess.env.PRERENDER &&\n\t\t\tprocess.env.NODE_ENV === 'production' &&\n\t\t\thydrate &&\n\t\t\tcurrentURL === normalizeURL(location.pathname);\n\t\tconst doRender = canHydrate ? hydrate : render;\n\t\troot = doRender(h(app, { CLI_DATA }), document.body, root);\n\t};\n\n\tif (module.hot) module.hot.accept('preact-cli-entrypoint', init);\n\n\tinit();\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5562f35..1da028f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -huge-link

Huge link

A minimalist serverless publishing tool that allows you to create markdown posts and push them to the Web by sharing the link.

\ No newline at end of file +huge-link

Huge link

A minimalist serverless publishing tool that allows you to create markdown posts and push them to the Web by sharing the link.

\ No newline at end of file diff --git a/docs/polyfills.03bf6.js b/docs/polyfills.03bf6.js deleted file mode 100644 index 98f78c3..0000000 --- a/docs/polyfills.03bf6.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="Ve17")}({"+TSP":function(e,t,n){e.exports=self.fetch||(self.fetch=n("Cf1v").default||n("Cf1v"))},"5+HP":function(e,t,n){"use strict";function r(e){return Boolean(e&&void 0!==e.length)}function o(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function u(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}f(t.promise,r)}else(1===e._state?f:c)(t.promise,e._value)}))):e._deferreds.push(t)}function f(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","export default function(url, options) {\n\toptions = options || {};\n\treturn new Promise( (resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst keys = [];\n\t\tconst all = [];\n\t\tconst headers = {};\n\n\t\tconst response = () => ({\n\t\t\tok: (request.status/100|0) == 2,\t\t// 200-299\n\t\t\tstatusText: request.statusText,\n\t\t\tstatus: request.status,\n\t\t\turl: request.responseURL,\n\t\t\ttext: () => Promise.resolve(request.responseText),\n\t\t\tjson: () => Promise.resolve(request.responseText).then(JSON.parse),\n\t\t\tblob: () => Promise.resolve(new Blob([request.response])),\n\t\t\tclone: response,\n\t\t\theaders: {\n\t\t\t\tkeys: () => keys,\n\t\t\t\tentries: () => all,\n\t\t\t\tget: n => headers[n.toLowerCase()],\n\t\t\t\thas: n => n.toLowerCase() in headers\n\t\t\t}\n\t\t});\n\n\t\trequest.open(options.method || 'get', url, true);\n\n\t\trequest.onload = () => {\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm, (m, key, value) => {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theaders[key] = headers[key] ? `${headers[key]},${value}` : value;\n\t\t\t});\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\tfor (const i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.send(options.body || null);\n\t});\n}\n","if (!global.Promise) global.Promise = require('promise-polyfill').default;\nif (!global.fetch) global.fetch = require('isomorphic-unfetch');\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../node_modules/isomorphic-unfetch/browser.js","webpack:///../node_modules/promise-polyfill/src/index.js","webpack:///../node_modules/promise-polyfill/src/finally.js","webpack:///../node_modules/promise-polyfill/src/allSettled.js","webpack:///../src/index.mjs","webpack:///../node_modules/preact-cli/lib/lib/webpack/polyfills.js","webpack:///../node_modules/webpack/buildin/global.js"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","self","fetch","require","default","isArray","x","Boolean","length","noop","Promise","fn","this","TypeError","_state","_handled","_value","undefined","_deferreds","doResolve","handle","deferred","_immediateFn","cb","onFulfilled","onRejected","ret","e","reject","promise","resolve","push","newValue","then","finale","thisArg","apply","arguments","_unhandledRejectionFn","len","Handler","done","reason","ex","finallyConstructor","callback","constructor","allSettled","arr","res","val","args","status","remaining","Array","slice","setTimeoutFunc","setTimeout","prom","promiseFinally","all","race","setImmediate","err","console","warn","url","options","request","XMLHttpRequest","keys","headers","const","open","method","onload","getAllResponseHeaders","replace","toLowerCase","response","ok","statusText","responseURL","text","responseText","json","JSON","parse","blob","Blob","clone","entries","has","onerror","withCredentials","credentials","setRequestHeader","send","body","global","g","Function","window"],"mappings":"aAIE,SAASA,EAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,OAAOC,EAAiBD,GAAUE,QAGnC,IAAIC,EAASF,EAAiBD,GAAY,CACzCI,EAAGJ,EACHK,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQN,GAAUO,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,IAAID,EAAmB,GA4BvBF,EAAoBS,EAAIF,EAGxBP,EAAoBU,EAAIR,EAGxBF,EAAoBW,EAAI,SAASR,EAASS,EAAMC,GAC3Cb,EAAoBc,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEb,EAAoBmB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDtB,EAAoBuB,EAAI,SAASD,EAAOE,GAEvC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EAAQW,aAC9CW,MAAOX,EACPR,QAAS,CACRD,uBAAYA,GACZqB,0BAAe/B,GACf9E,aAAKY,UAAK6E,EAAQ7E,EAAEoF,gBACpBc,aAAKlG,UAAKA,EAAEoF,gBAAiBP,KAYtBQ,KAGTX,EAAQyB,QAAUjE,EAElBwC,EAAQ0B,gBAAuC,WAArB3B,EAAQ4B,YAElB5B,EAAQI,QACvBH,EAAQ4B,iBAAiB/H,EAAGkG,EAAQI,QAAQtG,IAG7CmG,EAAQ6B,KAAK9B,EAAQ+B,MAAQ,W,sBC5C/B,YAAKC,EAAOzF,UAASyF,EAAOzF,QAAUP,EAAQ,QAAoBC,SAC7D+F,EAAOjG,QAAOiG,EAAOjG,MAAQC,EAAQ,W,uCCD1C,IAAIiG,EAGJA,EAAK,WACJ,OAAOxF,KADH,GAIL,IAECwF,EAAIA,GAAK,IAAIC,SAAS,cAAb,GACR,MAAO1E,GAEc,iBAAX2E,SAAqBF,EAAIE,QAOrCtI,EAAOD,QAAUqI","file":"polyfills.7fc88.esm.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/huge-link/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"Ve17\");\n","module.exports = self.fetch || (self.fetch = require('unfetch').default || require('unfetch'));\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","export default function(url, options) {\n\toptions = options || {};\n\treturn new Promise( (resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst keys = [];\n\t\tconst all = [];\n\t\tconst headers = {};\n\n\t\tconst response = () => ({\n\t\t\tok: (request.status/100|0) == 2,\t\t// 200-299\n\t\t\tstatusText: request.statusText,\n\t\t\tstatus: request.status,\n\t\t\turl: request.responseURL,\n\t\t\ttext: () => Promise.resolve(request.responseText),\n\t\t\tjson: () => Promise.resolve(request.responseText).then(JSON.parse),\n\t\t\tblob: () => Promise.resolve(new Blob([request.response])),\n\t\t\tclone: response,\n\t\t\theaders: {\n\t\t\t\tkeys: () => keys,\n\t\t\t\tentries: () => all,\n\t\t\t\tget: n => headers[n.toLowerCase()],\n\t\t\t\thas: n => n.toLowerCase() in headers\n\t\t\t}\n\t\t});\n\n\t\trequest.open(options.method || 'get', url, true);\n\n\t\trequest.onload = () => {\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm, (m, key, value) => {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theaders[key] = headers[key] ? `${headers[key]},${value}` : value;\n\t\t\t});\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\tfor (const i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.send(options.body || null);\n\t});\n}\n","if (!global.Promise) global.Promise = require('promise-polyfill').default;\nif (!global.fetch) global.fetch = require('isomorphic-unfetch');\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/polyfills.dd476.js b/docs/polyfills.dd476.js new file mode 100644 index 0000000..b96b678 --- /dev/null +++ b/docs/polyfills.dd476.js @@ -0,0 +1,2 @@ +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/huge-link/",t(t.s="Ve17")}({"+TSP":function(e,t,n){e.exports=self.fetch||(self.fetch=n("Cf1v").default||n("Cf1v"))},"5+HP":function(e,t,n){"use strict";function r(e){return Boolean(e&&void 0!==e.length)}function o(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function u(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}f(t.promise,r)}else(1===e._state?f:c)(t.promise,e._value)}))):e._deferreds.push(t)}function f(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","export default function(url, options) {\n\toptions = options || {};\n\treturn new Promise( (resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst keys = [];\n\t\tconst all = [];\n\t\tconst headers = {};\n\n\t\tconst response = () => ({\n\t\t\tok: (request.status/100|0) == 2,\t\t// 200-299\n\t\t\tstatusText: request.statusText,\n\t\t\tstatus: request.status,\n\t\t\turl: request.responseURL,\n\t\t\ttext: () => Promise.resolve(request.responseText),\n\t\t\tjson: () => Promise.resolve(request.responseText).then(JSON.parse),\n\t\t\tblob: () => Promise.resolve(new Blob([request.response])),\n\t\t\tclone: response,\n\t\t\theaders: {\n\t\t\t\tkeys: () => keys,\n\t\t\t\tentries: () => all,\n\t\t\t\tget: n => headers[n.toLowerCase()],\n\t\t\t\thas: n => n.toLowerCase() in headers\n\t\t\t}\n\t\t});\n\n\t\trequest.open(options.method || 'get', url, true);\n\n\t\trequest.onload = () => {\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm, (m, key, value) => {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theaders[key] = headers[key] ? `${headers[key]},${value}` : value;\n\t\t\t});\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\tfor (const i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.send(options.body || null);\n\t});\n}\n","if (!global.Promise) global.Promise = require('promise-polyfill').default;\nif (!global.fetch) global.fetch = require('isomorphic-unfetch');\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../node_modules/isomorphic-unfetch/browser.js","webpack:///../node_modules/promise-polyfill/src/index.js","webpack:///../node_modules/promise-polyfill/src/finally.js","webpack:///../node_modules/promise-polyfill/src/allSettled.js","webpack:///../src/index.mjs","webpack:///../node_modules/preact-cli/lib/lib/webpack/polyfills.js","webpack:///../node_modules/webpack/buildin/global.js"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","self","fetch","require","default","isArray","x","Boolean","length","noop","Promise","fn","this","TypeError","_state","_handled","_value","undefined","_deferreds","doResolve","handle","deferred","_immediateFn","cb","onFulfilled","onRejected","ret","e","reject","promise","resolve","push","newValue","then","finale","thisArg","apply","arguments","_unhandledRejectionFn","len","Handler","done","reason","ex","finallyConstructor","callback","constructor","allSettled","arr","res","val","args","status","remaining","Array","slice","setTimeoutFunc","setTimeout","prom","promiseFinally","all","race","setImmediate","err","console","warn","url","options","request","XMLHttpRequest","keys","headers","const","open","method","onload","getAllResponseHeaders","replace","toLowerCase","response","ok","statusText","responseURL","text","responseText","json","JSON","parse","blob","Blob","clone","entries","has","onerror","withCredentials","credentials","setRequestHeader","send","body","global","g","Function","window"],"mappings":"aAIE,SAASA,EAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,OAAOC,EAAiBD,GAAUE,QAGnC,IAAIC,EAASF,EAAiBD,GAAY,CACzCI,EAAGJ,EACHK,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQN,GAAUO,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASH,GAG/DI,EAAOE,GAAI,EAGJF,EAAOD,QAvBf,IAAID,EAAmB,GA4BvBF,EAAoBS,EAAIF,EAGxBP,EAAoBU,EAAIR,EAGxBF,EAAoBW,EAAI,SAASR,EAASS,EAAMC,GAC3Cb,EAAoBc,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAA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AO,IAAI,GACxB6B,WAAYb,EAAQa,WACpB7B,OAAQgB,EAAQhB,OAChBc,IAAKE,EAAQc,YACbC,uBAAYzE,QAAQoB,QAAQsC,EAAQgB,eACpCC,uBAAY3E,QAAQoB,QAAQsC,EAAQgB,cAAcnD,KAAKqD,KAAKC,QAC5DC,uBAAY9E,QAAQoB,QAAQ,IAAI2D,KAAK,CAACrB,EAAQW,aAC9CW,MAAOX,EACPR,QAAS,CACRD,uBAAYA,GACZqB,0BAAe/B,GACf9E,aAAKY,UAAK6E,EAAQ7E,EAAEoF,gBACpBc,aAAKlG,UAAKA,EAAEoF,gBAAiBP,KAYtBQ,KAGTX,EAAQyB,QAAUjE,EAElBwC,EAAQ0B,gBAAuC,WAArB3B,EAAQ4B,YAElB5B,EAAQI,QACvBH,EAAQ4B,iBAAiB/H,EAAGkG,EAAQI,QAAQtG,IAG7CmG,EAAQ6B,KAAK9B,EAAQ+B,MAAQ,W,sBC5C/B,YAAKC,EAAOzF,UAASyF,EAAOzF,QAAUP,EAAQ,QAAoBC,SAC7D+F,EAAOjG,QAAOiG,EAAOjG,MAAQC,EAAQ,W,uCCD1C,IAAIiG,EAGJA,EAAK,WACJ,OAAOxF,KADH,GAIL,IAECwF,EAAIA,GAAK,IAAIC,SAAS,cAAb,GACR,MAAO1E,GAEc,iBAAX2E,SAAqBF,EAAIE,QAOrCtI,EAAOD,QAAUqI","file":"polyfills.dd476.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/huge-link/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"Ve17\");\n","module.exports = self.fetch || (self.fetch = require('unfetch').default || require('unfetch'));\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","export default function(url, options) {\n\toptions = options || {};\n\treturn new Promise( (resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst keys = [];\n\t\tconst all = [];\n\t\tconst headers = {};\n\n\t\tconst response = () => ({\n\t\t\tok: (request.status/100|0) == 2,\t\t// 200-299\n\t\t\tstatusText: request.statusText,\n\t\t\tstatus: request.status,\n\t\t\turl: request.responseURL,\n\t\t\ttext: () => Promise.resolve(request.responseText),\n\t\t\tjson: () => Promise.resolve(request.responseText).then(JSON.parse),\n\t\t\tblob: () => Promise.resolve(new Blob([request.response])),\n\t\t\tclone: response,\n\t\t\theaders: {\n\t\t\t\tkeys: () => keys,\n\t\t\t\tentries: () => all,\n\t\t\t\tget: n => headers[n.toLowerCase()],\n\t\t\t\thas: n => n.toLowerCase() in headers\n\t\t\t}\n\t\t});\n\n\t\trequest.open(options.method || 'get', url, true);\n\n\t\trequest.onload = () => {\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm, (m, key, value) => {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theaders[key] = headers[key] ? `${headers[key]},${value}` : value;\n\t\t\t});\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\tfor (const i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.send(options.body || null);\n\t});\n}\n","if (!global.Promise) global.Promise = require('promise-polyfill').default;\nif (!global.fetch) global.fetch = require('isomorphic-unfetch');\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/polyfills.e3a06.esm.js b/docs/polyfills.e3a06.esm.js deleted file mode 100644 index 53a1420..0000000 --- a/docs/polyfills.e3a06.esm.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="Ve17")}({"+TSP":function(e,t,n){e.exports=self.fetch||(self.fetch=n("Cf1v").default||n("Cf1v"))},"5+HP":function(e,t,n){"use strict";function r(e){return Boolean(e&&void 0!==e.length)}function o(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function u(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}f(t.promise,r)}else(1===e._state?f:c)(t.promise,e._value)}))):e._deferreds.push(t)}function f(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t-1||o(u.events,"linePrefix")<4?e.interrupt(u.parser.constructs.flow,n,t)(i):t(i)}},partial:!0};e.exports=c},"1hwd":function(e,t){e.exports=function(){for(var e={},t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return r(e,"definition",(function(e){var n=e.identifier.toUpperCase();n in t||(t[n]={href:e.url,title:e.title})})),t}},"2sHR":function(e,t,n){"use strict";e.exports=n("i8V1")},"3d/4":function(e,t,n){"use strict";var r=n("1hwd"),i=n("l8WD"),o=parseInt((i.version||"16").slice(0,2),10)>=16,u=i.createElement;function c(e,t){return u(e,a(t),t.children)}function a(e){var t=e["data-sourcepos"];return t?{"data-sourcepos":t}:{}}e.exports={break:"br",paragraph:"p",emphasis:"em",strong:"strong",thematicBreak:"hr",blockquote:"blockquote",delete:"del",link:"a",image:"img",linkReference:"a",imageReference:"img",table:c.bind(null,"table"),tableHead:c.bind(null,"thead"),tableBody:c.bind(null,"tbody"),tableRow:c.bind(null,"tr"),tableCell:function(e){var t=e.align?{textAlign:e.align}:void 0,n=a(e);return u(e.isHeader?"th":"td",t?r({style:t},n):n,e.children)},root:function(e){var t=e.className,n=!t&&i.Fragment||"div";return u(n,t?{className:t}:null,e.children)},text:function(e){var t=e.children||"";return o?t:u("span",null,t)},list:function(e){var t=a(e);null!==e.start&&1!==e.start&&void 0!==e.start&&(t.start=e.start.toString());return u(e.ordered?"ol":"ul",t,e.children)},listItem:function(e){var t=null;if(null!==e.checked&&void 0!==e.checked){var n=e.checked;t=u("input",{type:"checkbox",checked:n,readOnly:!0})}return u("li",a(e),t,e.children)},definition:function(){return null},heading:function(e){return u("h".concat(e.level),a(e),e.children)},inlineCode:function(e){return u("code",a(e),e.children)},code:function(e){var t=e.language&&"language-".concat(e.language),n=u("code",t?{className:t}:null,e.value);return u("pre",a(e),n)},html:function(e){if(e.skipHtml)return null;var t=e.allowDangerousHtml||!1===e.escapeHtml,n=e.isBlock?"div":"span";if(!t)return u(i.Fragment||n,null,e.value);var r={dangerouslySetInnerHTML:{__html:e.value}};return u(n,r)},virtualHtml:function(e){return u(e.tag,a(e),e.children)},parsedHtml:function(e){return e["data-sourcepos"]?i.cloneElement(e.element,{"data-sourcepos":e["data-sourcepos"]}):e.element}}},"3nVo":function(e,t,n){"use strict";var r=n("BcHT"),i=n("isG3"),o=n("pi/J"),u=n("WJEV"),c=n("VNaL"),a=n("l3jb"),s=n("vJla"),l=n("NFok");e.exports=function(e){var t={defined:[],constructs:a([l].concat(r((e||{}).extensions))),content:n(i),document:n(o),flow:n(u),string:n(c.string),text:n(c.text)};return t;function n(e){return function(n){return s(t,e,n)}}}},"4kIE":function(e,t,n){"use strict";e.exports=function(e){return e<-2}},"6zBE":function(e,t,n){"use strict";var r=n("OF0j")(/[\dA-Za-z]/);e.exports=r},"7kD2":function(e,t,n){"use strict";var r=n("BN5T");function i(e){var t=e.children;e.children=[{type:"tableHead",align:e.align,children:[t[0]],position:t[0].position}],t.length>1&&e.children.push({type:"tableBody",align:e.align,children:t.slice(1),position:{start:t[1].position.start,end:t[t.length-1].position.end}})}e.exports=function(e){return r(e,"table",i),e}},"7sXb":function(e,t,n){"use strict";var r=n("pMvH");e.exports=function(e,t,n,i){var o=i?i-1:1/0,u=0;return function(i){if(r(i))return e.enter(n),c(i);return t(i)};function c(i){return r(i)&&u++-1||o(u.events,"linePrefix")<4?e.interrupt(u.parser.constructs.flow,n,t)(i):t(i)}},partial:!0};e.exports=c},"1hwd":function(e,t){e.exports=function(){for(var e={},t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return r(e,"definition",(function(e){var n=e.identifier.toUpperCase();n in t||(t[n]={href:e.url,title:e.title})})),t}},"2sHR":function(e,t,n){"use strict";e.exports=n("i8V1")},"3d/4":function(e,t,n){"use strict";var r=n("1hwd"),i=n("l8WD"),o=parseInt((i.version||"16").slice(0,2),10)>=16,u=i.createElement;function c(e,t){return u(e,a(t),t.children)}function a(e){var t=e["data-sourcepos"];return t?{"data-sourcepos":t}:{}}e.exports={break:"br",paragraph:"p",emphasis:"em",strong:"strong",thematicBreak:"hr",blockquote:"blockquote",delete:"del",link:"a",image:"img",linkReference:"a",imageReference:"img",table:c.bind(null,"table"),tableHead:c.bind(null,"thead"),tableBody:c.bind(null,"tbody"),tableRow:c.bind(null,"tr"),tableCell:function(e){var t=e.align?{textAlign:e.align}:void 0,n=a(e);return u(e.isHeader?"th":"td",t?r({style:t},n):n,e.children)},root:function(e){var t=e.className,n=!t&&i.Fragment||"div";return u(n,t?{className:t}:null,e.children)},text:function(e){var t=e.children||"";return o?t:u("span",null,t)},list:function(e){var t=a(e);null!==e.start&&1!==e.start&&void 0!==e.start&&(t.start=e.start.toString());return u(e.ordered?"ol":"ul",t,e.children)},listItem:function(e){var t=null;if(null!==e.checked&&void 0!==e.checked){var n=e.checked;t=u("input",{type:"checkbox",checked:n,readOnly:!0})}return u("li",a(e),t,e.children)},definition:function(){return null},heading:function(e){return u("h".concat(e.level),a(e),e.children)},inlineCode:function(e){return u("code",a(e),e.children)},code:function(e){var t=e.language&&"language-".concat(e.language),n=u("code",t?{className:t}:null,e.value);return u("pre",a(e),n)},html:function(e){if(e.skipHtml)return null;var t=e.allowDangerousHtml||!1===e.escapeHtml,n=e.isBlock?"div":"span";if(!t)return u(i.Fragment||n,null,e.value);var r={dangerouslySetInnerHTML:{__html:e.value}};return u(n,r)},virtualHtml:function(e){return u(e.tag,a(e),e.children)},parsedHtml:function(e){return e["data-sourcepos"]?i.cloneElement(e.element,{"data-sourcepos":e["data-sourcepos"]}):e.element}}},"3nVo":function(e,t,n){"use strict";var r=n("BcHT"),i=n("isG3"),o=n("pi/J"),u=n("WJEV"),c=n("VNaL"),a=n("l3jb"),s=n("vJla"),l=n("NFok");e.exports=function(e){var t={defined:[],constructs:a([l].concat(r((e||{}).extensions))),content:n(i),document:n(o),flow:n(u),string:n(c.string),text:n(c.text)};return t;function n(e){return function(n){return s(t,e,n)}}}},"4kIE":function(e,t,n){"use strict";e.exports=function(e){return e<-2}},"6zBE":function(e,t,n){"use strict";var r=n("OF0j")(/[\dA-Za-z]/);e.exports=r},"7kD2":function(e,t,n){"use strict";var r=n("BN5T");function i(e){var t=e.children;e.children=[{type:"tableHead",align:e.align,children:[t[0]],position:t[0].position}],t.length>1&&e.children.push({type:"tableBody",align:e.align,children:t.slice(1),position:{start:t[1].position.start,end:t[t.length-1].position.end}})}e.exports=function(e){return r(e,"table",i),e}},"7sXb":function(e,t,n){"use strict";var r=n("pMvH");e.exports=function(e,t,n,i){var o=i?i-1:1/0,u=0;return function(i){if(r(i))return e.enter(n),c(i);return t(i)};function c(i){return r(i)&&u++ -1 ||\n prefixSize(self.events, 'linePrefix') < 4\n ) {\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code)\n }\n\n return ok(code)\n }\n}\n\nmodule.exports = content\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","'use strict';\n\nvar visit = require('unist-util-visit');\n\nmodule.exports = function getDefinitions(tree) {\n var definitions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n visit(tree, 'definition', function (node) {\n var identifier = node.identifier.toUpperCase();\n if (identifier in definitions) return;\n definitions[identifier] = {\n href: node.url,\n title: node.title\n };\n });\n return definitions;\n};","'use strict'\n\nmodule.exports = require('./lib')\n","/* eslint-disable react/prop-types, react/no-multi-comp */\n'use strict';\n\nvar xtend = require('xtend');\n\nvar React = require('react');\n/* istanbul ignore next - Don’t crash on old React. */\n\n\nvar supportsStringRender = parseInt((React.version || '16').slice(0, 2), 10) >= 16;\nvar createElement = React.createElement;\nmodule.exports = {\n break: 'br',\n paragraph: 'p',\n emphasis: 'em',\n strong: 'strong',\n thematicBreak: 'hr',\n blockquote: 'blockquote',\n delete: 'del',\n link: 'a',\n image: 'img',\n linkReference: 'a',\n imageReference: 'img',\n table: SimpleRenderer.bind(null, 'table'),\n tableHead: SimpleRenderer.bind(null, 'thead'),\n tableBody: SimpleRenderer.bind(null, 'tbody'),\n tableRow: SimpleRenderer.bind(null, 'tr'),\n tableCell: TableCell,\n root: Root,\n text: TextRenderer,\n list: List,\n listItem: ListItem,\n definition: NullRenderer,\n heading: Heading,\n inlineCode: InlineCode,\n code: CodeBlock,\n html: Html,\n virtualHtml: VirtualHtml,\n parsedHtml: ParsedHtml\n};\n\nfunction TextRenderer(props) {\n /* istanbul ignore next - a text node w/o a value could be injected by plugins */\n var children = props.children || '';\n /* istanbul ignore next - `span` is a fallback for old React. */\n\n return supportsStringRender ? children : createElement('span', null, children);\n}\n\nfunction Root(props) {\n var className = props.className;\n var root = !className && React.Fragment || 'div';\n return createElement(root, className ? {\n className: className\n } : null, props.children);\n}\n\nfunction SimpleRenderer(tag, props) {\n return createElement(tag, getCoreProps(props), props.children);\n}\n\nfunction TableCell(props) {\n var style = props.align ? {\n textAlign: props.align\n } : undefined;\n var coreProps = getCoreProps(props);\n return createElement(props.isHeader ? 'th' : 'td', style ? xtend({\n style: style\n }, coreProps) : coreProps, props.children);\n}\n\nfunction Heading(props) {\n return createElement(\"h\".concat(props.level), getCoreProps(props), props.children);\n}\n\nfunction List(props) {\n var attrs = getCoreProps(props);\n\n if (props.start !== null && props.start !== 1 && props.start !== undefined) {\n attrs.start = props.start.toString();\n }\n\n return createElement(props.ordered ? 'ol' : 'ul', attrs, props.children);\n}\n\nfunction ListItem(props) {\n var checkbox = null;\n\n if (props.checked !== null && props.checked !== undefined) {\n var checked = props.checked;\n checkbox = createElement('input', {\n type: 'checkbox',\n checked: checked,\n readOnly: true\n });\n }\n\n return createElement('li', getCoreProps(props), checkbox, props.children);\n}\n\nfunction CodeBlock(props) {\n var className = props.language && \"language-\".concat(props.language);\n var code = createElement('code', className ? {\n className: className\n } : null, props.value);\n return createElement('pre', getCoreProps(props), code);\n}\n\nfunction InlineCode(props) {\n return createElement('code', getCoreProps(props), props.children);\n}\n\nfunction Html(props) {\n if (props.skipHtml) {\n return null;\n }\n\n var dangerous = props.allowDangerousHtml || props.escapeHtml === false;\n var tag = props.isBlock ? 'div' : 'span';\n\n if (!dangerous) {\n /* istanbul ignore next - `tag` is a fallback for old React. */\n return createElement(React.Fragment || tag, null, props.value);\n }\n\n var nodeProps = {\n dangerouslySetInnerHTML: {\n __html: props.value\n }\n };\n return createElement(tag, nodeProps);\n}\n\nfunction ParsedHtml(props) {\n /* To do: `React.cloneElement` is slow, is it really needed? */\n return props['data-sourcepos'] ? React.cloneElement(props.element, {\n 'data-sourcepos': props['data-sourcepos']\n }) : props.element;\n}\n\nfunction VirtualHtml(props) {\n return createElement(props.tag, getCoreProps(props), props.children);\n}\n\nfunction NullRenderer() {\n return null;\n}\n\nfunction getCoreProps(props) {\n var source = props['data-sourcepos'];\n /* istanbul ignore next - nodes from plugins w/o position */\n\n return source ? {\n 'data-sourcepos': source\n } : {};\n}","'use strict'\n\nvar miniflat = require('./util/miniflat.js')\nvar content = require('./initialize/content.js')\nvar document = require('./initialize/document.js')\nvar flow = require('./initialize/flow.js')\nvar text = require('./initialize/text.js')\nvar combineExtensions = require('./util/combine-extensions.js')\nvar createTokenizer = require('./util/create-tokenizer.js')\nvar constructs = require('./constructs.js')\n\nfunction parse(options) {\n var settings = options || {}\n var parser = {\n defined: [],\n constructs: combineExtensions(\n [constructs].concat(miniflat(settings.extensions))\n ),\n content: create(content),\n document: create(document),\n flow: create(flow),\n string: create(text.string),\n text: create(text.text)\n }\n return parser\n\n function create(initializer) {\n return creator\n\n function creator(from) {\n return createTokenizer(parser, initializer, from)\n }\n }\n}\n\nmodule.exports = parse\n","'use strict'\n\nfunction markdownLineEnding(code) {\n return code < -2\n}\n\nmodule.exports = markdownLineEnding\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/)\n\nmodule.exports = asciiAlphanumeric\n","'use strict';\n\nvar visit = require('unist-util-visit');\n\nmodule.exports = function (node) {\n visit(node, 'table', wrap);\n return node;\n};\n\nfunction wrap(table) {\n var children = table.children;\n table.children = [{\n type: 'tableHead',\n align: table.align,\n children: [children[0]],\n position: children[0].position\n }];\n\n if (children.length > 1) {\n table.children.push({\n type: 'tableBody',\n align: table.align,\n children: children.slice(1),\n position: {\n start: children[1].position.start,\n end: children[children.length - 1].position.end\n }\n });\n }\n}","'use strict'\n\nvar markdownSpace = require('../character/markdown-space.js')\n\nfunction spaceFactory(effects, ok, type, max) {\n var limit = max ? max - 1 : Infinity\n var size = 0\n return start\n\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type)\n return prefix(code)\n }\n\n return ok(code)\n }\n\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code)\n return prefix\n }\n\n effects.exit(type)\n return ok(code)\n }\n}\n\nmodule.exports = spaceFactory\n","\"use strict\";\n\nvar HtmlParser = '__RMD_HTML_PARSER__';\n/* istanbul ignore next - Fallback for `Symbol`. */\n\nexports.HtmlParser = typeof Symbol === 'undefined' ? HtmlParser : Symbol(HtmlParser);","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiAlpha = regexCheck(/[A-Za-z]/)\n\nmodule.exports = asciiAlpha\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\n\nvar partialBlankLine = {\n tokenize: tokenizePartialBlankLine,\n partial: true\n}\n\nfunction tokenizePartialBlankLine(effects, ok, nok) {\n return factorySpace(effects, afterWhitespace, 'linePrefix')\n\n function afterWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n\nmodule.exports = partialBlankLine\n","'use strict'\n\nvar assign = require('../constant/assign.js')\nvar chunkedSplice = require('./chunked-splice.js')\nvar shallow = require('./shallow.js')\n\nfunction subtokenize(events) {\n var jumps = {}\n var index = -1\n var event\n var lineIndex\n var otherIndex\n var otherEvent\n var parameters\n var subevents\n var more\n\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index]\n }\n\n event = events[index] // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n\n if (\n index &&\n event[1].type === 'chunkFlow' &&\n events[index - 1][1].type === 'listItemPrefix'\n ) {\n subevents = event[1]._tokenizer.events\n otherIndex = 0\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'lineEndingBlank'\n ) {\n otherIndex += 2\n }\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'content'\n ) {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === 'content') {\n break\n }\n\n if (subevents[otherIndex][1].type === 'chunkText') {\n subevents[otherIndex][1].isInFirstContentOfListItem = true\n otherIndex++\n }\n }\n }\n } // Enter.\n\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n assign(jumps, subcontent(events, index))\n index = jumps[index]\n more = true\n }\n } // Exit.\n else if (event[1]._container || event[1]._movePreviousLineEndings) {\n otherIndex = index\n lineIndex = undefined\n\n while (otherIndex--) {\n otherEvent = events[otherIndex]\n\n if (\n otherEvent[1].type === 'lineEnding' ||\n otherEvent[1].type === 'lineEndingBlank'\n ) {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n }\n\n otherEvent[1].type = 'lineEnding'\n lineIndex = otherIndex\n }\n } else {\n break\n }\n }\n\n if (lineIndex) {\n // Fix position.\n event[1].end = shallow(events[lineIndex][1].start) // Switch container exit w/ line endings.\n\n parameters = events.slice(lineIndex, index)\n parameters.unshift(event)\n chunkedSplice(events, lineIndex, index - lineIndex + 1, parameters)\n }\n }\n }\n\n return !more\n}\n\nfunction subcontent(events, eventIndex) {\n var token = events[eventIndex][1]\n var context = events[eventIndex][2]\n var startPosition = eventIndex - 1\n var startPositions = []\n var tokenizer =\n token._tokenizer || context.parser[token.contentType](token.start)\n var childEvents = tokenizer.events\n var jumps = []\n var gaps = {}\n var stream\n var previous\n var index\n var entered\n var end\n var adjust // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n\n while (token) {\n // Find the position of the event for this token.\n while (events[++startPosition][1] !== token) {\n // Empty.\n }\n\n startPositions.push(startPosition)\n\n if (!token._tokenizer) {\n stream = context.sliceStream(token)\n\n if (!token.next) {\n stream.push(null)\n }\n\n if (previous) {\n tokenizer.defineSkip(token.start)\n }\n\n if (token.isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true\n }\n\n tokenizer.write(stream)\n\n if (token.isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined\n }\n } // Unravel the next token.\n\n previous = token\n token = token.next\n } // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n\n token = previous\n index = childEvents.length\n\n while (index--) {\n // Make sure we’ve at least seen something (final eol is part of the last\n // token).\n if (childEvents[index][0] === 'enter') {\n entered = true\n } else if (\n // Find a void token that includes a break.\n entered &&\n childEvents[index][1].type === childEvents[index - 1][1].type &&\n childEvents[index][1].start.line !== childEvents[index][1].end.line\n ) {\n add(childEvents.slice(index + 1, end))\n // Help GC.\n token._tokenizer = token.next = undefined\n token = token.previous\n end = index + 1\n }\n }\n\n // Help GC.\n tokenizer.events = token._tokenizer = token.next = undefined // Do head:\n\n add(childEvents.slice(0, end))\n index = -1\n adjust = 0\n\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]\n adjust += jumps[index][1] - jumps[index][0] - 1\n }\n\n return gaps\n\n function add(slice) {\n var start = startPositions.pop()\n jumps.unshift([start, start + slice.length - 1])\n chunkedSplice(events, start, 2, slice)\n }\n}\n\nmodule.exports = subtokenize\n","'use strict'\n\nvar fromCharCode = require('../constant/from-char-code.js')\n\nfunction safeFromInt(value, base) {\n var code = parseInt(value, base)\n\n if (\n // C0 except for HT, LF, FF, CR, space\n code < 9 ||\n code === 11 ||\n (code > 13 && code < 32) || // Control character (DEL) of the basic block and C1 controls.\n (code > 126 && code < 160) || // Lone high surrogates and low surrogates.\n (code > 55295 && code < 57344) || // Noncharacters.\n (code > 64975 && code < 65008) ||\n (code & 65535) === 65535 ||\n (code & 65535) === 65534 || // Out of range\n code > 1114111\n ) {\n return '\\uFFFD'\n }\n\n return fromCharCode(code)\n}\n\nmodule.exports = safeFromInt\n","'use strict'\n\nmodule.exports = visit\n\nvar visitParents = require('unist-util-visit-parents')\n\nvar CONTINUE = visitParents.CONTINUE\nvar SKIP = visitParents.SKIP\nvar EXIT = visitParents.EXIT\n\nvisit.CONTINUE = CONTINUE\nvisit.SKIP = SKIP\nvisit.EXIT = EXIT\n\nfunction visit(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n function overload(node, parents) {\n var parent = parents[parents.length - 1]\n var index = parent ? parent.children.indexOf(node) : null\n return visitor(node, index, parent)\n }\n}\n","'use strict'\n\nfunction miniflat(value) {\n return value === null || value === undefined\n ? []\n : 'length' in value\n ? value\n : [value]\n}\n\nmodule.exports = miniflat\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\n\nvar codeText = {\n name: 'codeText',\n tokenize: tokenizeCodeText,\n resolve: resolveCodeText,\n previous: previous\n}\n\nfunction resolveCodeText(events) {\n var tailExitIndex = events.length - 4\n var headEnterIndex = 3\n var index\n var enter // If we start and end with an EOL or a space.\n\n if (\n (events[headEnterIndex][1].type === 'lineEnding' ||\n events[headEnterIndex][1].type === 'space') &&\n (events[tailExitIndex][1].type === 'lineEnding' ||\n events[tailExitIndex][1].type === 'space')\n ) {\n index = headEnterIndex // And we have data.\n\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'codeTextData') {\n // Then we have padding.\n events[tailExitIndex][1].type = events[headEnterIndex][1].type =\n 'codeTextPadding'\n headEnterIndex += 2\n tailExitIndex -= 2\n break\n }\n }\n } // Merge adjacent spaces and data.\n\n index = headEnterIndex - 1\n tailExitIndex++\n\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== 'lineEnding') {\n enter = index\n }\n } else if (\n index === tailExitIndex ||\n events[index][1].type === 'lineEnding'\n ) {\n events[enter][1].type = 'codeTextData'\n\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n tailExitIndex -= index - enter - 2\n index = enter + 2\n }\n\n enter = undefined\n }\n }\n\n return events\n}\n\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return (\n code !== 96 ||\n this.events[this.events.length - 1][1].type === 'characterEscape'\n )\n}\n\nfunction tokenizeCodeText(effects, ok, nok) {\n var sizeOpen = 0\n var size\n var token\n return start\n\n function start(code) {\n effects.enter('codeText')\n effects.enter('codeTextSequence')\n return openingSequence(code)\n }\n\n function openingSequence(code) {\n if (code === 96) {\n effects.consume(code)\n sizeOpen++\n return openingSequence\n }\n\n effects.exit('codeTextSequence')\n return gap(code)\n }\n\n function gap(code) {\n // EOF.\n if (code === null) {\n return nok(code)\n } // Closing fence?\n // Could also be data.\n\n if (code === 96) {\n token = effects.enter('codeTextSequence')\n size = 0\n return closingSequence(code)\n } // Tabs don’t work, and virtual spaces don’t make sense.\n\n if (code === 32) {\n effects.enter('space')\n effects.consume(code)\n effects.exit('space')\n return gap\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return gap\n } // Data.\n\n effects.enter('codeTextData')\n return data(code)\n } // In code.\n\n function data(code) {\n if (\n code === null ||\n code === 32 ||\n code === 96 ||\n markdownLineEnding(code)\n ) {\n effects.exit('codeTextData')\n return gap(code)\n }\n\n effects.consume(code)\n return data\n } // Closing fence.\n\n function closingSequence(code) {\n // More.\n if (code === 96) {\n effects.consume(code)\n size++\n return closingSequence\n } // Done!\n\n if (size === sizeOpen) {\n effects.exit('codeTextSequence')\n effects.exit('codeText')\n return ok(code)\n } // More or less accents: mark as data.\n\n token.type = 'codeTextData'\n return data(code)\n }\n}\n\nmodule.exports = codeText\n","// Copyright (c) 2013 Pieroxy \n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.4\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict'\n\nvar assign = require('../constant/assign.js')\n\nfunction shallow(object) {\n return assign({}, object)\n}\n\nmodule.exports = shallow\n","'use strict'\n\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\n\nvar blockQuote = {\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart,\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit: exit\n}\n\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n var self = this\n return start\n\n function start(code) {\n if (code === 62) {\n if (!self.containerState.open) {\n effects.enter('blockQuote', {\n _container: true\n })\n self.containerState.open = true\n }\n\n effects.enter('blockQuotePrefix')\n effects.enter('blockQuoteMarker')\n effects.consume(code)\n effects.exit('blockQuoteMarker')\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter('blockQuotePrefixWhitespace')\n effects.consume(code)\n effects.exit('blockQuotePrefixWhitespace')\n effects.exit('blockQuotePrefix')\n return ok\n }\n\n effects.exit('blockQuotePrefix')\n return ok(code)\n }\n}\n\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n return factorySpace(\n effects,\n effects.attempt(blockQuote, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )\n}\n\nfunction exit(effects) {\n effects.exit('blockQuote')\n}\n\nmodule.exports = blockQuote\n","'use strict'\n\nfunction sliceChunks(chunks, token) {\n var startIndex = token.start._index\n var startBufferIndex = token.start._bufferIndex\n var endIndex = token.end._index\n var endBufferIndex = token.end._bufferIndex\n var view\n\n if (startIndex === endIndex) {\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]\n } else {\n view = chunks.slice(startIndex, endIndex)\n\n if (startBufferIndex > -1) {\n view[0] = view[0].slice(startBufferIndex)\n }\n\n if (endBufferIndex > 0) {\n view.push(chunks[endIndex].slice(0, endBufferIndex))\n }\n }\n\n return view\n}\n\nmodule.exports = sliceChunks\n","\"use strict\";\n\nvar protocols = ['http', 'https', 'mailto', 'tel'];\n\nmodule.exports = function uriTransformer(uri) {\n var url = (uri || '').trim();\n var first = url.charAt(0);\n\n if (first === '#' || first === '/') {\n return url;\n }\n\n var colon = url.indexOf(':');\n\n if (colon === -1) {\n return url;\n }\n\n var length = protocols.length;\n var index = -1;\n\n while (++index < length) {\n var protocol = protocols[index];\n\n if (colon === protocol.length && url.slice(0, protocol.length).toLowerCase() === protocol) {\n return url;\n }\n }\n\n index = url.indexOf('?');\n\n if (index !== -1 && colon > index) {\n return url;\n }\n\n index = url.indexOf('#');\n\n if (index !== -1 && colon > index) {\n return url;\n } // eslint-disable-next-line no-script-url\n\n\n return 'javascript:void(0)';\n};","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/)\n\nmodule.exports = asciiAtext\n","'use strict'\n\nvar sizeChunks = require('./size-chunks.js')\n\nfunction prefixSize(events, type) {\n var tail = events[events.length - 1]\n if (!tail || tail[1].type !== type) return 0\n return sizeChunks(tail[2].sliceStream(tail[1]))\n}\n\nmodule.exports = prefixSize\n","module.exports = require(\"preact\");","'use strict'\n\n// This module is generated by `script/`.\n//\n// CommonMark handles attention (emphasis, strong) markers based on what comes\n// before or after them.\n// One such difference is if those characters are Unicode punctuation.\n// This script is generated from the Unicode data.\nvar unicodePunctuation = /[!-\\/:-@\\[-`\\{-~\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]/\n\nmodule.exports = unicodePunctuation\n","'use strict'\n\nvar slice = [].slice\n\nmodule.exports = wrap\n\n// Wrap `fn`.\n// Can be sync or async; return a promise, receive a completion handler, return\n// new values and errors.\nfunction wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\n\nvar thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n}\n\nfunction tokenizeThematicBreak(effects, ok, nok) {\n var size = 0\n var marker\n return start\n\n function start(code) {\n effects.enter('thematicBreak')\n marker = code\n return atBreak(code)\n }\n\n function atBreak(code) {\n if (code === marker) {\n effects.enter('thematicBreakSequence')\n return sequence(code)\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, 'whitespace')(code)\n }\n\n if (size < 3 || (code !== null && !markdownLineEnding(code))) {\n return nok(code)\n }\n\n effects.exit('thematicBreak')\n return ok(code)\n }\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return sequence\n }\n\n effects.exit('thematicBreakSequence')\n return atBreak(code)\n }\n}\n\nmodule.exports = thematicBreak\n","'use strict'\n\nvar chunkedSplice = require('../util/chunked-splice.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\n\nvar headingAtx = {\n name: 'headingAtx',\n tokenize: tokenizeHeadingAtx,\n resolve: resolveHeadingAtx\n}\n\nfunction resolveHeadingAtx(events, context) {\n var contentEnd = events.length - 2\n var contentStart = 3\n var content\n var text // Prefix whitespace, part of the opening.\n\n if (events[contentStart][1].type === 'whitespace') {\n contentStart += 2\n } // Suffix whitespace, part of the closing.\n\n if (\n contentEnd - 2 > contentStart &&\n events[contentEnd][1].type === 'whitespace'\n ) {\n contentEnd -= 2\n }\n\n if (\n events[contentEnd][1].type === 'atxHeadingSequence' &&\n (contentStart === contentEnd - 1 ||\n (contentEnd - 4 > contentStart &&\n events[contentEnd - 2][1].type === 'whitespace'))\n ) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4\n }\n\n if (contentEnd > contentStart) {\n content = {\n type: 'atxHeadingText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n }\n text = {\n type: 'chunkText',\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: 'text'\n }\n chunkedSplice(events, contentStart, contentEnd - contentStart + 1, [\n ['enter', content, context],\n ['enter', text, context],\n ['exit', text, context],\n ['exit', content, context]\n ])\n }\n\n return events\n}\n\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n var self = this\n var size = 0\n return start\n\n function start(code) {\n effects.enter('atxHeading')\n effects.enter('atxHeadingSequence')\n return fenceOpenInside(code)\n }\n\n function fenceOpenInside(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code)\n return fenceOpenInside\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingSequence')\n return self.interrupt ? ok(code) : headingBreak(code)\n }\n\n return nok(code)\n }\n\n function headingBreak(code) {\n if (code === 35) {\n effects.enter('atxHeadingSequence')\n return sequence(code)\n }\n\n if (code === null || markdownLineEnding(code)) {\n effects.exit('atxHeading')\n return ok(code)\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, headingBreak, 'whitespace')(code)\n }\n\n effects.enter('atxHeadingText')\n return data(code)\n }\n\n function sequence(code) {\n if (code === 35) {\n effects.consume(code)\n return sequence\n }\n\n effects.exit('atxHeadingSequence')\n return headingBreak(code)\n }\n\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit('atxHeadingText')\n return headingBreak(code)\n }\n\n effects.consume(code)\n return data\n }\n}\n\nmodule.exports = headingAtx\n","'use strict'\n\nvar splice = [].splice\n\nmodule.exports = splice\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar unicodeWhitespace = regexCheck(/\\s/)\n\nmodule.exports = unicodeWhitespace\n","'use strict';\n\nvar xtend = require('xtend');\n\nvar unified = require('unified');\n\nvar parse = require('remark-parse');\n\nvar PropTypes = require('prop-types');\n\nvar addListMetadata = require('mdast-add-list-metadata');\n\nvar naiveHtml = require('./plugins/naive-html');\n\nvar disallowNode = require('./plugins/disallow-node');\n\nvar astToReact = require('./ast-to-react');\n\nvar wrapTableRows = require('./wrap-table-rows');\n\nvar getDefinitions = require('./get-definitions');\n\nvar uriTransformer = require('./uri-transformer');\n\nvar defaultRenderers = require('./renderers');\n\nvar symbols = require('./symbols');\n\nvar allTypes = Object.keys(defaultRenderers);\n\nvar ReactMarkdown = function ReactMarkdown(props) {\n // To do in next major: remove `source`.\n var src = props.source || props.children || '';\n\n if (props.allowedTypes && props.disallowedTypes) {\n throw new Error('Only one of `allowedTypes` and `disallowedTypes` should be defined');\n }\n\n var renderers = xtend(defaultRenderers, props.renderers);\n var processor = unified().use(parse).use(props.plugins || []); // eslint-disable-next-line no-sync\n\n var tree = processor.runSync(processor.parse(src));\n var renderProps = xtend(props, {\n renderers: renderers,\n definitions: getDefinitions(tree)\n });\n determineAstToReactTransforms(props).forEach(function (transform) {\n tree = transform(tree, renderProps);\n });\n return tree;\n};\n\nfunction determineAstToReactTransforms(props) {\n var transforms = [wrapTableRows, addListMetadata()];\n var disallowedTypes = props.disallowedTypes;\n\n if (props.allowedTypes) {\n disallowedTypes = allTypes.filter(function (type) {\n return type !== 'root' && props.allowedTypes.indexOf(type) === -1;\n });\n }\n\n var removalMethod = props.unwrapDisallowed ? 'unwrap' : 'remove';\n\n if (disallowedTypes && disallowedTypes.length > 0) {\n transforms.push(disallowNode.ofType(disallowedTypes, removalMethod));\n }\n\n if (props.allowNode) {\n transforms.push(disallowNode.ifNotMatch(props.allowNode, removalMethod));\n } // To do in next major: remove `escapeHtml`.\n\n\n var renderHtml = (props.allowDangerousHtml || props.escapeHtml === false) && !props.skipHtml;\n var hasHtmlParser = (props.astPlugins || []).some(function (transform) {\n return transform.identity === symbols.HtmlParser;\n });\n\n if (renderHtml && !hasHtmlParser) {\n transforms.push(naiveHtml);\n }\n\n if (props.astPlugins) {\n transforms = transforms.concat(props.astPlugins);\n } // Add the final transform to turn everything into React.\n\n\n transforms.push(astToReact);\n return transforms;\n}\n\nReactMarkdown.defaultProps = {\n transformLinkUri: uriTransformer\n};\nReactMarkdown.propTypes = {\n className: PropTypes.string,\n source: PropTypes.string,\n children: PropTypes.string,\n sourcePos: PropTypes.bool,\n rawSourcePos: PropTypes.bool,\n escapeHtml: PropTypes.bool,\n allowDangerousHtml: PropTypes.bool,\n skipHtml: PropTypes.bool,\n allowNode: PropTypes.func,\n allowedTypes: PropTypes.arrayOf(PropTypes.oneOf(allTypes)),\n disallowedTypes: PropTypes.arrayOf(PropTypes.oneOf(allTypes)),\n transformLinkUri: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n linkTarget: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n transformImageUri: PropTypes.func,\n astPlugins: PropTypes.arrayOf(PropTypes.func),\n unwrapDisallowed: PropTypes.bool,\n renderers: PropTypes.object,\n plugins: PropTypes.array\n};\nReactMarkdown.types = allTypes;\nReactMarkdown.renderers = defaultRenderers;\nReactMarkdown.uriTransformer = uriTransformer;\nmodule.exports = ReactMarkdown;","'use strict'\n\nmodule.exports = process\n","\"use strict\";\n\nvar visit = require('unist-util-visit');\n\nvar splice = [].splice;\n\nexports.ofType = function (types, mode) {\n return ifNotMatch(allow, mode);\n\n function allow(node, index, parent) {\n return !types.includes(node.type);\n }\n};\n\nexports.ifNotMatch = ifNotMatch;\n\nfunction ifNotMatch(allow, mode) {\n return transform;\n\n function transform(tree) {\n visit(tree, filter);\n return tree;\n } // eslint-disable-next-line consistent-return\n\n\n function filter(node, index, parent) {\n if (parent && !allow(node, index, parent)) {\n var parameters = [index, 1];\n\n if (mode === 'unwrap' && node.children) {\n parameters = parameters.concat(node.children);\n }\n\n splice.apply(parent.children, parameters);\n return index;\n }\n }\n}","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar text$1 = require('./initialize/text.js')\nvar attention = require('./tokenize/attention.js')\nvar autolink = require('./tokenize/autolink.js')\nvar blockQuote = require('./tokenize/block-quote.js')\nvar characterEscape = require('./tokenize/character-escape.js')\nvar characterReference = require('./tokenize/character-reference.js')\nvar codeFenced = require('./tokenize/code-fenced.js')\nvar codeIndented = require('./tokenize/code-indented.js')\nvar codeText = require('./tokenize/code-text.js')\nvar definition = require('./tokenize/definition.js')\nvar hardBreakEscape = require('./tokenize/hard-break-escape.js')\nvar headingAtx = require('./tokenize/heading-atx.js')\nvar htmlFlow = require('./tokenize/html-flow.js')\nvar htmlText = require('./tokenize/html-text.js')\nvar labelEnd = require('./tokenize/label-end.js')\nvar labelStartImage = require('./tokenize/label-start-image.js')\nvar labelStartLink = require('./tokenize/label-start-link.js')\nvar lineEnding = require('./tokenize/line-ending.js')\nvar thematicBreak = require('./tokenize/thematic-break.js')\nvar list = require('./tokenize/list.js')\nvar setextUnderline = require('./tokenize/setext-underline.js')\n\nvar document = {\n 42: list,\n // Asterisk\n 43: list,\n // Plus sign\n 45: list,\n // Dash\n 48: list,\n // 0\n 49: list,\n // 1\n 50: list,\n // 2\n 51: list,\n // 3\n 52: list,\n // 4\n 53: list,\n // 5\n 54: list,\n // 6\n 55: list,\n // 7\n 56: list,\n // 8\n 57: list,\n // 9\n 62: blockQuote // Greater than\n}\nvar contentInitial = {\n 91: definition // Left square bracket\n}\nvar flowInitial = {\n '-2': codeIndented,\n // Horizontal tab\n '-1': codeIndented,\n // Virtual space\n 32: codeIndented // Space\n}\nvar flow = {\n 35: headingAtx,\n // Number sign\n 42: thematicBreak,\n // Asterisk\n 45: [setextUnderline, thematicBreak],\n // Dash\n 60: htmlFlow,\n // Less than\n 61: setextUnderline,\n // Equals to\n 95: thematicBreak,\n // Underscore\n 96: codeFenced,\n // Grave accent\n 126: codeFenced // Tilde\n}\nvar string = {\n 38: characterReference,\n // Ampersand\n 92: characterEscape // Backslash\n}\nvar text = {\n '-5': lineEnding,\n // Carriage return\n '-4': lineEnding,\n // Line feed\n '-3': lineEnding,\n // Carriage return + line feed\n 33: labelStartImage,\n // Exclamation mark\n 38: characterReference,\n // Ampersand\n 42: attention,\n // Asterisk\n 60: [autolink, htmlText],\n // Less than\n 91: labelStartLink,\n // Left square bracket\n 92: [hardBreakEscape, characterEscape],\n // Backslash\n 93: labelEnd,\n // Right square bracket\n 95: attention,\n // Underscore\n 96: codeText // Grave accent\n}\nvar insideSpan = {\n null: [attention, text$1.resolver]\n}\nvar disable = {\n null: []\n}\n\nexports.contentInitial = contentInitial\nexports.disable = disable\nexports.document = document\nexports.flow = flow\nexports.flowInitial = flowInitial\nexports.insideSpan = insideSpan\nexports.string = string\nexports.text = text\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","'use strict'\n\nvar fromCharCode = require('../constant/from-char-code.js')\n\nfunction regexCheck(regex) {\n return check\n\n function check(code) {\n return regex.test(fromCharCode(code))\n }\n}\n\nmodule.exports = regexCheck\n","'use strict'\n\nmodule.exports = toString\n\n// Get the text content of a node.\n// Prefer the node’s plain-text fields, otherwise serialize its children,\n// and if the given value is an array, serialize the nodes in it.\nfunction toString(node) {\n return (\n (node &&\n (node.value ||\n node.alt ||\n node.title ||\n ('children' in node && all(node.children)) ||\n ('length' in node && all(node)))) ||\n ''\n )\n}\n\nfunction all(values) {\n var result = []\n var index = -1\n\n while (++index < values.length) {\n result[index] = toString(values[index])\n }\n\n return result.join('')\n}\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\n\nfunction whitespaceFactory(effects, ok) {\n var seen\n return start\n\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n seen = true\n return start\n }\n\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n start,\n seen ? 'linePrefix' : 'lineSuffix'\n )(code)\n }\n\n return ok(code)\n }\n}\n\nmodule.exports = whitespaceFactory\n","import {\n\tcreateElement,\n\trender as preactRender,\n\tcloneElement as preactCloneElement,\n\tcreateRef,\n\tComponent,\n\tcreateContext,\n\tFragment\n} from 'preact';\nimport {\n\tuseState,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue\n} from 'preact/hooks';\nimport { PureComponent } from './PureComponent';\nimport { memo } from './memo';\nimport { forwardRef } from './forwardRef';\nimport { Children } from './Children';\nimport { Suspense, lazy } from './suspense';\nimport { SuspenseList } from './suspense-list';\nimport { createPortal } from './portals';\nimport {\n\thydrate,\n\trender,\n\tREACT_ELEMENT_TYPE,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n} from './render';\n\nconst version = '16.8.0'; // trick libraries to think we are react\n\n/**\n * Legacy version of createElement.\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor\n */\nfunction createFactory(type) {\n\treturn createElement.bind(null, type);\n}\n\n/**\n * Check if the passed element is a valid (p)react node.\n * @param {*} element The element to check\n * @returns {boolean}\n */\nfunction isValidElement(element) {\n\treturn !!element && element.$$typeof === REACT_ELEMENT_TYPE;\n}\n\n/**\n * Wrap `cloneElement` to abort if the passed element is not a valid element and apply\n * all vnode normalizations.\n * @param {import('./internal').VNode} element The vnode to clone\n * @param {object} props Props to add when cloning\n * @param {Array} rest Optional component children\n */\nfunction cloneElement(element) {\n\tif (!isValidElement(element)) return element;\n\treturn preactCloneElement.apply(null, arguments);\n}\n\n/**\n * Remove a component tree from the DOM, including state and event handlers.\n * @param {import('./internal').PreactElement} container\n * @returns {boolean}\n */\nfunction unmountComponentAtNode(container) {\n\tif (container._children) {\n\t\tpreactRender(null, container);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Get the matching DOM node for a component\n * @param {import('./internal').Component} component\n * @returns {import('./internal').PreactElement | null}\n */\nfunction findDOMNode(component) {\n\treturn (\n\t\t(component &&\n\t\t\t(component.base || (component.nodeType === 1 && component))) ||\n\t\tnull\n\t);\n}\n\n/**\n * Deprecated way to control batched rendering inside the reconciler, but we\n * already schedule in batches inside our rendering code\n * @template Arg\n * @param {(arg: Arg) => void} callback function that triggers the updated\n * @param {Arg} [arg] Optional argument that can be passed to the callback\n */\n// eslint-disable-next-line camelcase\nconst unstable_batchedUpdates = (callback, arg) => callback(arg);\n\n/**\n * Strict Mode is not implemented in Preact, so we provide a stand-in for it\n * that just renders its children without imposing any restrictions.\n */\nconst StrictMode = Fragment;\n\nexport * from 'preact/hooks';\nexport {\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\t// eslint-disable-next-line camelcase\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n\n// React copies the named exports to the default one.\nexport default {\n\tuseState,\n\tuseReducer,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tversion,\n\tChildren,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\tcreatePortal,\n\tcreateElement,\n\tcreateContext,\n\tcreateFactory,\n\tcloneElement,\n\tcreateRef,\n\tFragment,\n\tisValidElement,\n\tfindDOMNode,\n\tComponent,\n\tPureComponent,\n\tmemo,\n\tforwardRef,\n\tunstable_batchedUpdates,\n\tStrictMode,\n\tSuspense,\n\tSuspenseList,\n\tlazy,\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED\n};\n","import {h} from 'preact'\nimport {Link} from 'preact-router/match'\n\nimport style from './style.css'\n\nconst Editor = ({markdown, setMarkdown}) => (\n
\n

Huge link

\n

\n A minimalist serverless publishing tool\n that allows you to create markdown posts and\n push them to the Web by sharing the link.\n

\n setMarkdown(target.value) }>\n { markdown }\n \n\n \n
)\n\nexport default Editor\n","import {h} from 'preact'\nimport {Link} from 'preact-router/match'\nimport ReactMarkdown from 'react-markdown'\n\nimport {\n compressToEncodedURIComponent as encode,\n decompressFromEncodedURIComponent as decode\n} from 'lz-string'\n\nconst noop = _ => null\nconst ident = _ => _\n\nconst previewContorls = content => (\n
)\n\nconst Post = ({mode, payload, setMarkdown}) => {\n const [controls, decodeFn, encodeFn] = {\n preview: [previewContorls, ident, encode],\n post: [noop, decode, ident]\n }[mode]\n\n const markdown = decodeFn(payload)\n const encoded = encodeFn(payload)\n\n setMarkdown(markdown)\n\n return (
\n { controls(encoded) }\n\n
\n \n { markdown }\n \n
\n\n \n Edit post\n \n
)\n}\n\nexport default Post\n","import {h} from 'preact'\nimport {useState} from 'preact/hooks'\nimport {Router} from 'preact-router'\n\nimport Editor from './routes/editor'\nimport Post from './routes/post'\n\nimport './style/typography.css'\nimport './style'\n\nconst App = () => {\n const [markdown, setMarkdown] = useState('')\n\n return (
\n \n \n \n \n \n
)\n}\n\nexport default App\n","'use strict'\n\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar unicodePunctuation = require('../character/unicode-punctuation.js')\nvar unicodeWhitespace = require('../character/unicode-whitespace.js')\n\n// Classify whether a character is unicode whitespace, unicode punctuation, or\n// anything else.\n// Used for attention (emphasis, strong), whose sequences can open or close\n// based on the class of surrounding characters.\nfunction classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}\n\nmodule.exports = classifyCharacter\n","'use strict'\n\nmodule.exports = require('path')\n","'use strict'\n\nvar asciiAlphanumeric = require('../character/ascii-alphanumeric.js')\nvar asciiAlpha = require('../character/ascii-alpha.js')\nvar asciiAtext = require('../character/ascii-atext.js')\nvar asciiControl = require('../character/ascii-control.js')\n\nvar autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n}\n\nfunction tokenizeAutolink(effects, ok, nok) {\n var size = 1\n return start\n\n function start(code) {\n effects.enter('autolink')\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.enter('autolinkProtocol')\n return open\n }\n\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return schemeOrEmailAtext\n }\n\n return asciiAtext(code) ? emailAtext(code) : nok(code)\n }\n\n function schemeOrEmailAtext(code) {\n return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)\n ? schemeInsideOrEmailAtext(code)\n : emailAtext(code)\n }\n\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code)\n return urlInside\n }\n\n if (\n (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) &&\n size++ < 32\n ) {\n effects.consume(code)\n return schemeInsideOrEmailAtext\n }\n\n return emailAtext(code)\n }\n\n function urlInside(code) {\n if (code === 62) {\n effects.exit('autolinkProtocol')\n return end(code)\n }\n\n if (code === 32 || code === 60 || asciiControl(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return urlInside\n }\n\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n\n if (asciiAtext(code)) {\n effects.consume(code)\n return emailAtext\n }\n\n return nok(code)\n }\n\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)\n }\n\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code)\n size = 0\n return emailAtSignOrDot\n }\n\n if (code === 62) {\n // Exit, then change the type.\n effects.exit('autolinkProtocol').type = 'autolinkEmail'\n return end(code)\n }\n\n return emailValue(code)\n }\n\n function emailValue(code) {\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n effects.consume(code)\n return code === 45 ? emailValue : emailLabel\n }\n\n return nok(code)\n }\n\n function end(code) {\n effects.enter('autolinkMarker')\n effects.consume(code)\n effects.exit('autolinkMarker')\n effects.exit('autolink')\n return ok\n }\n}\n\nmodule.exports = autolink\n","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar assign = require('../constant/assign.js')\nvar shallow = require('../util/shallow.js')\n\nvar text = initializeFactory('text')\nvar string = initializeFactory('string')\nvar resolver = {\n resolveAll: createResolver()\n}\n\nfunction initializeFactory(field) {\n return {\n tokenize: initializeText,\n resolveAll: createResolver(\n field === 'text' ? resolveAllLineSuffixes : undefined\n )\n }\n\n function initializeText(effects) {\n var self = this\n var constructs = this.parser.constructs[field]\n var text = effects.attempt(constructs, start, notText)\n return start\n\n function start(code) {\n return atBreak(code) ? text(code) : notText(code)\n }\n\n function notText(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('data')\n effects.consume(code)\n return data\n }\n\n function data(code) {\n if (atBreak(code)) {\n effects.exit('data')\n return text(code)\n } // Data.\n\n effects.consume(code)\n return data\n }\n\n function atBreak(code) {\n var list = constructs[code]\n var index = -1\n\n if (code === null) {\n return true\n }\n\n if (list) {\n while (++index < list.length) {\n if (\n !list[index].previous ||\n list[index].previous.call(self, self.previous)\n ) {\n return true\n }\n }\n }\n }\n }\n}\n\nfunction createResolver(extraResolver) {\n return resolveAllText\n\n function resolveAllText(events, context) {\n var index = -1\n var enter // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === 'data') {\n enter = index\n index++\n }\n } else if (!events[index] || events[index][1].type !== 'data') {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n index = enter + 2\n }\n\n enter = undefined\n }\n }\n\n return extraResolver ? extraResolver(events, context) : events\n }\n} // A rather ugly set of instructions which again looks at chunks in the input\n// stream.\n// The reason to do this here is that it is *much* faster to parse in reverse.\n// And that we can’t hook into `null` to split the line suffix before an EOF.\n// To do: figure out if we can make this into a clean utility, or even in core.\n// As it will be useful for GFMs literal autolink extension (and maybe even\n// tables?)\n\nfunction resolveAllLineSuffixes(events, context) {\n var eventIndex = -1\n var chunks\n var data\n var chunk\n var index\n var bufferIndex\n var size\n var tabs\n var token\n\n while (++eventIndex <= events.length) {\n if (\n (eventIndex === events.length ||\n events[eventIndex][1].type === 'lineEnding') &&\n events[eventIndex - 1][1].type === 'data'\n ) {\n data = events[eventIndex - 1][1]\n chunks = context.sliceStream(data)\n index = chunks.length\n bufferIndex = -1\n size = 0\n tabs = undefined\n\n while (index--) {\n chunk = chunks[index]\n\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length\n\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++\n bufferIndex--\n }\n\n if (bufferIndex) break\n bufferIndex = -1\n } // Number\n else if (chunk === -2) {\n tabs = true\n size++\n } else if (chunk === -1);\n else {\n // Replacement character, exit.\n index++\n break\n }\n }\n\n if (size) {\n token = {\n type:\n eventIndex === events.length || tabs || size < 2\n ? 'lineSuffix'\n : 'hardBreakTrailing',\n start: {\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size,\n _index: data.start._index + index,\n _bufferIndex: index\n ? bufferIndex\n : data.start._bufferIndex + bufferIndex\n },\n end: shallow(data.end)\n }\n data.end = shallow(token.start)\n\n if (data.start.offset === data.end.offset) {\n assign(data, token)\n } else {\n events.splice(\n eventIndex,\n 0,\n ['enter', token, context],\n ['exit', token, context]\n )\n eventIndex += 2\n }\n }\n\n eventIndex++\n }\n }\n\n return events\n}\n\nexports.resolver = resolver\nexports.string = string\nexports.text = text\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","'use strict'\n\nfunction normalizeIdentifier(value) {\n return (\n value // Collapse Markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, ' ') // Trim.\n .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no object method is uppercase.\n .toLowerCase()\n .toUpperCase()\n )\n}\n\nmodule.exports = normalizeIdentifier\n","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar factorySpace = require('../tokenize/factory-space.js')\nvar partialBlankLine = require('../tokenize/partial-blank-line.js')\nvar content = require('../tokenize/content.js')\n\nvar tokenize = initializeFlow\n\nfunction initializeFlow(effects) {\n var self = this\n var initial = effects.attempt(\n // Try to parse a blank line.\n partialBlankLine,\n atBlankEnding, // Try to parse initial flow (essentially, only code).\n effects.attempt(\n this.parser.constructs.flowInitial,\n afterConstruct,\n factorySpace(\n effects,\n effects.attempt(\n this.parser.constructs.flow,\n afterConstruct,\n effects.attempt(content, afterConstruct)\n ),\n 'linePrefix'\n )\n )\n )\n return initial\n\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEndingBlank')\n effects.consume(code)\n effects.exit('lineEndingBlank')\n self.currentConstruct = undefined\n return initial\n }\n\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n self.currentConstruct = undefined\n return initial\n }\n}\n\nexports.tokenize = tokenize\n","'use strict'\n\nfunction resolveAll(constructs, events, context) {\n var called = []\n var index = -1\n var resolve\n\n while (++index < constructs.length) {\n resolve = constructs[index].resolveAll\n\n if (resolve && called.indexOf(resolve) < 0) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n\nmodule.exports = resolveAll\n","'use strict'\n\nvar labelEnd = require('./label-end.js')\n\nvar labelStartLink = {\n name: 'labelStartLink',\n tokenize: tokenizeLabelStartLink,\n resolveAll: labelEnd.resolveAll\n}\n\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n var self = this\n return start\n\n function start(code) {\n effects.enter('labelLink')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelLink')\n return after\n }\n\n function after(code) {\n /* c8 ignore next */\n return code === 94 &&\n /* c8 ignore next */\n '_hiddenFootnoteSupport' in self.parser.constructs\n ? /* c8 ignore next */\n nok(code)\n : ok(code)\n }\n}\n\nmodule.exports = labelStartLink\n","'use strict';\n\nvar React = require('react');\n\nvar xtend = require('xtend');\n\nvar ReactIs = require('react-is');\n\nfunction astToReact(node, options) {\n var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var renderer = options.renderers[node.type]; // Nodes created by plugins do not have positional info, in which case we set\n // an object that matches the positon interface.\n\n if (!node.position) {\n node.position = {\n start: {\n line: null,\n column: null,\n offset: null\n },\n end: {\n line: null,\n column: null,\n offset: null\n }\n };\n }\n\n var pos = node.position.start;\n var key = [node.type, pos.line, pos.column, index].join('-');\n\n if (!ReactIs.isValidElementType(renderer)) {\n throw new Error(\"Renderer for type `\".concat(node.type, \"` not defined or is not renderable\"));\n }\n\n var nodeProps = getNodeProps(node, key, options, renderer, parent, index);\n return React.createElement(renderer, nodeProps, nodeProps.children || resolveChildren() || undefined);\n\n function resolveChildren() {\n return node.children && node.children.map(function (childNode, i) {\n return astToReact(childNode, options, {\n node: node,\n props: nodeProps\n }, i);\n });\n }\n} // eslint-disable-next-line max-params, complexity\n\n\nfunction getNodeProps(node, key, opts, renderer, parent, index) {\n var props = {\n key: key\n };\n var isSimpleRenderer = typeof renderer === 'string' || renderer === React.Fragment; // `sourcePos` is true if the user wants source information (line/column info from markdown source)\n\n if (opts.sourcePos && node.position) {\n props['data-sourcepos'] = flattenPosition(node.position);\n }\n\n if (opts.rawSourcePos && !isSimpleRenderer) {\n props.sourcePosition = node.position;\n } // If `includeNodeIndex` is true, pass node index info to all non-tag renderers\n\n\n if (opts.includeNodeIndex && parent.node && parent.node.children && !isSimpleRenderer) {\n props.index = parent.node.children.indexOf(node);\n props.parentChildCount = parent.node.children.length;\n }\n\n var ref = node.identifier !== null && node.identifier !== undefined ?\n /* istanbul ignore next - plugins could inject an undefined reference. */\n opts.definitions[node.identifier.toUpperCase()] || {} : null;\n\n switch (node.type) {\n case 'root':\n assignDefined(props, {\n className: opts.className\n });\n break;\n\n case 'text':\n props.nodeKey = key;\n props.children = node.value;\n break;\n\n case 'heading':\n props.level = node.depth;\n break;\n\n case 'list':\n props.start = node.start;\n props.ordered = node.ordered;\n props.spread = node.spread;\n props.depth = node.depth;\n break;\n\n case 'listItem':\n props.checked = node.checked;\n props.spread = node.spread;\n props.ordered = node.ordered;\n props.index = node.index;\n props.children = getListItemChildren(node, parent).map(function (childNode, i) {\n return astToReact(childNode, opts, {\n node: node,\n props: props\n }, i);\n });\n break;\n\n case 'definition':\n assignDefined(props, {\n identifier: node.identifier,\n title: node.title,\n url: node.url\n });\n break;\n\n case 'code':\n assignDefined(props, {\n language: node.lang && node.lang.split(/\\s/, 1)[0]\n });\n break;\n\n case 'inlineCode':\n props.children = node.value;\n props.inline = true;\n break;\n\n case 'link':\n assignDefined(props, {\n title: node.title || undefined,\n target: typeof opts.linkTarget === 'function' ? opts.linkTarget(node.url, node.children, node.title) : opts.linkTarget,\n href: opts.transformLinkUri ? opts.transformLinkUri(node.url, node.children, node.title) : node.url\n });\n break;\n\n case 'image':\n assignDefined(props, {\n src: opts.transformImageUri ? opts.transformImageUri(node.url, node.children, node.title, node.alt) : node.url,\n alt: node.alt || '',\n title: node.title || undefined\n });\n break;\n\n case 'linkReference':\n assignDefined(props, xtend(ref, {\n href: opts.transformLinkUri ? opts.transformLinkUri(ref.href) : ref.href\n }));\n break;\n\n case 'imageReference':\n assignDefined(props, {\n src: opts.transformImageUri && ref.href ? opts.transformImageUri(ref.href, node.children, ref.title, node.alt) : ref.href,\n alt: node.alt || '',\n title: ref.title || undefined\n });\n break;\n\n case 'table':\n case 'tableHead':\n case 'tableBody':\n props.columnAlignment = node.align;\n break;\n\n case 'tableRow':\n props.isHeader = parent.node.type === 'tableHead';\n props.columnAlignment = parent.props.columnAlignment;\n break;\n\n case 'tableCell':\n assignDefined(props, {\n isHeader: parent.props.isHeader,\n align: parent.props.columnAlignment[index]\n });\n break;\n\n case 'virtualHtml':\n props.tag = node.tag;\n break;\n\n case 'html':\n // @todo find a better way than this\n props.isBlock = node.position.start.line !== node.position.end.line;\n props.allowDangerousHtml = opts.allowDangerousHtml;\n props.escapeHtml = opts.escapeHtml;\n props.skipHtml = opts.skipHtml;\n break;\n\n case 'parsedHtml':\n {\n var parsedChildren;\n\n if (node.children) {\n parsedChildren = node.children.map(function (child, i) {\n return astToReact(child, opts, {\n node: node,\n props: props\n }, i);\n });\n }\n\n props.allowDangerousHtml = opts.allowDangerousHtml;\n props.escapeHtml = opts.escapeHtml;\n props.skipHtml = opts.skipHtml;\n props.element = node.element ? mergeNodeChildren(node, parsedChildren) : null;\n break;\n }\n\n default:\n assignDefined(props, xtend(node, {\n type: undefined,\n position: undefined,\n children: undefined\n }));\n }\n\n if (!isSimpleRenderer && node.value) {\n props.value = node.value;\n }\n\n if (!isSimpleRenderer) {\n props.node = node;\n }\n\n return props;\n}\n\nfunction assignDefined(target, attrs) {\n for (var key in attrs) {\n if (typeof attrs[key] !== 'undefined') {\n target[key] = attrs[key];\n }\n }\n}\n\nfunction mergeNodeChildren(node, parsedChildren) {\n var el = node.element;\n\n if (Array.isArray(el)) {\n /* istanbul ignore next - `div` fallback for old React. */\n var Fragment = React.Fragment || 'div';\n return React.createElement(Fragment, null, el);\n }\n\n if (el.props.children || parsedChildren) {\n var children = React.Children.toArray(el.props.children).concat(parsedChildren);\n return React.cloneElement(el, null, children);\n }\n\n return React.cloneElement(el, null);\n}\n\nfunction flattenPosition(pos) {\n return [pos.start.line, ':', pos.start.column, '-', pos.end.line, ':', pos.end.column].map(String).join('');\n}\n\nfunction getListItemChildren(node, parent) {\n /* istanbul ignore next - list items are always in a list, but best to be sure. */\n var loose = parent && parent.node ? listLoose(parent.node) : listItemLoose(node);\n return loose ? node.children : unwrapParagraphs(node);\n}\n\nfunction unwrapParagraphs(node) {\n return node.children.reduce(function (array, child) {\n return array.concat(child.type === 'paragraph' ? child.children : [child]);\n }, []);\n}\n\nfunction listLoose(node) {\n var children = node.children;\n var loose = node.spread;\n var index = -1;\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index]);\n }\n\n return loose;\n}\n\nfunction listItemLoose(node) {\n var spread = node.spread;\n /* istanbul ignore next - spread is present from remark-parse, but maybe plugins don’t set it. */\n\n return spread === undefined || spread === null ? node.children.length > 1 : spread;\n}\n\nmodule.exports = astToReact;","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Check if two objects have a different shape\n * @param {object} a\n * @param {object} b\n * @returns {boolean}\n */\nexport function shallowDiffers(a, b) {\n\tfor (let i in a) if (i !== '__source' && !(i in b)) return true;\n\tfor (let i in b) if (i !== '__source' && a[i] !== b[i]) return true;\n\treturn false;\n}\n","'use strict'\n\nvar splice = require('../constant/splice.js')\n\n// causes a stack overflow in V8 when trying to insert 100k items for instance.\n\nfunction chunkedSplice(list, start, remove, items) {\n var end = list.length\n var chunkStart = 0\n var parameters // Make start between zero and `end` (included).\n\n if (start < 0) {\n start = -start > end ? 0 : end + start\n } else {\n start = start > end ? end : start\n }\n\n remove = remove > 0 ? remove : 0 // No need to chunk the items if there’s only a couple (10k) items.\n\n if (items.length < 10000) {\n parameters = Array.from(items)\n parameters.unshift(start, remove)\n splice.apply(list, parameters)\n } else {\n // Delete `remove` items starting from `start`\n if (remove) splice.apply(list, [start, remove]) // Insert the items in chunks to not cause stack overflows.\n\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000)\n parameters.unshift(start, 0)\n splice.apply(list, parameters)\n chunkStart += 10000\n start += 10000\n }\n }\n}\n\nmodule.exports = chunkedSplice\n","'use strict'\n\nvar search = /[\\0\\t\\n\\r]/g\n\nfunction preprocess() {\n var start = true\n var column = 1\n var buffer = ''\n var atCarriageReturn\n return preprocessor\n\n function preprocessor(value, encoding, end) {\n var chunks = []\n var match\n var next\n var startPosition\n var endPosition\n var code\n value = buffer + value.toString(encoding)\n startPosition = 0\n buffer = ''\n\n if (start) {\n if (value.charCodeAt(0) === 65279) {\n startPosition++\n }\n\n start = undefined\n }\n\n while (startPosition < value.length) {\n search.lastIndex = startPosition\n match = search.exec(value)\n endPosition = match ? match.index : value.length\n code = value.charCodeAt(endPosition)\n\n if (!match) {\n buffer = value.slice(startPosition)\n break\n }\n\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3)\n atCarriageReturn = undefined\n } else {\n if (atCarriageReturn) {\n chunks.push(-5)\n atCarriageReturn = undefined\n }\n\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition))\n column += endPosition - startPosition\n }\n\n if (code === 0) {\n chunks.push(65533)\n column++\n } else if (code === 9) {\n next = Math.ceil(column / 4) * 4\n chunks.push(-2)\n\n while (column++ < next) chunks.push(-1)\n } else if (code === 10) {\n chunks.push(-4)\n column = 1\n } // Must be carriage return.\n else {\n atCarriageReturn = true\n column = 1\n }\n }\n\n startPosition = endPosition + 1\n }\n\n if (end) {\n if (atCarriageReturn) chunks.push(-5)\n if (buffer) chunks.push(buffer)\n chunks.push(null)\n }\n\n return chunks\n }\n}\n\nmodule.exports = preprocess\n","'use strict'\n\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\nvar partialBlankLine = require('./partial-blank-line.js')\nvar sizeChunks = require('../util/size-chunks.js')\nvar prefixSize = require('../util/prefix-size.js')\nvar asciiDigit = require('../character/ascii-digit.js')\nvar thematicBreak = require('./thematic-break.js')\n\nvar list = {\n name: 'list',\n tokenize: tokenizeListStart,\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd\n}\nvar listItemPrefixWhitespaceConstruct = {\n tokenize: tokenizeListItemPrefixWhitespace,\n partial: true\n}\nvar indentConstruct = {\n tokenize: tokenizeIndent,\n partial: true\n}\n\nfunction tokenizeListStart(effects, ok, nok) {\n var self = this\n var initialSize = prefixSize(self.events, 'linePrefix')\n var size = 0\n return start\n\n function start(code) {\n var kind =\n self.containerState.type ||\n (code === 42 || code === 43 || code === 45\n ? 'listUnordered'\n : 'listOrdered')\n\n if (\n kind === 'listUnordered'\n ? !self.containerState.marker || code === self.containerState.marker\n : asciiDigit(code)\n ) {\n if (!self.containerState.type) {\n self.containerState.type = kind\n effects.enter(kind, {\n _container: true\n })\n }\n\n if (kind === 'listUnordered') {\n effects.enter('listItemPrefix')\n return code === 42 || code === 45\n ? effects.check(thematicBreak, nok, atMarker)(code)\n : atMarker(code)\n }\n\n if (!self.interrupt || code === 49) {\n effects.enter('listItemPrefix')\n effects.enter('listItemValue')\n return inside(code)\n }\n }\n\n return nok(code)\n }\n\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code)\n return inside\n }\n\n if (\n (!self.interrupt || size < 2) &&\n (self.containerState.marker\n ? code === self.containerState.marker\n : code === 41 || code === 46)\n ) {\n effects.exit('listItemValue')\n return atMarker(code)\n }\n\n return nok(code)\n }\n\n function atMarker(code) {\n effects.enter('listItemMarker')\n effects.consume(code)\n effects.exit('listItemMarker')\n self.containerState.marker = self.containerState.marker || code\n return effects.check(\n partialBlankLine, // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank,\n effects.attempt(\n listItemPrefixWhitespaceConstruct,\n endOfPrefix,\n otherPrefix\n )\n )\n }\n\n function onBlank(code) {\n self.containerState.initialBlankLine = true\n initialSize++\n return endOfPrefix(code)\n }\n\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter('listItemPrefixWhitespace')\n effects.consume(code)\n effects.exit('listItemPrefixWhitespace')\n return endOfPrefix\n }\n\n return nok(code)\n }\n\n function endOfPrefix(code) {\n self.containerState.size =\n initialSize + sizeChunks(self.sliceStream(effects.exit('listItemPrefix')))\n return ok(code)\n }\n}\n\nfunction tokenizeListContinuation(effects, ok, nok) {\n var self = this\n self.containerState._closeFlow = undefined\n return effects.check(partialBlankLine, onBlank, notBlank)\n\n function onBlank(code) {\n self.containerState.furtherBlankLines =\n self.containerState.furtherBlankLines ||\n self.containerState.initialBlankLine\n return ok(code)\n }\n\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined\n return notInCurrentItem(code)\n }\n\n self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code)\n }\n\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true // As we’re closing flow, we’re no longer interrupting.\n\n self.interrupt = undefined\n return factorySpace(\n effects,\n effects.attempt(list, ok, nok),\n 'linePrefix',\n self.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )(code)\n }\n}\n\nfunction tokenizeIndent(effects, ok, nok) {\n var self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemIndent',\n self.containerState.size + 1\n )\n\n function afterPrefix(code) {\n return prefixSize(self.events, 'listItemIndent') ===\n self.containerState.size\n ? ok(code)\n : nok(code)\n }\n}\n\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type)\n}\n\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n var self = this\n return factorySpace(\n effects,\n afterPrefix,\n 'listItemPrefixWhitespace',\n self.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4 + 1\n )\n\n function afterPrefix(code) {\n return markdownSpace(code) ||\n !prefixSize(self.events, 'listItemPrefixWhitespace')\n ? nok(code)\n : ok(code)\n }\n}\n\nmodule.exports = list\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\n\n// eslint-disable-next-line max-params\nfunction labelFactory(effects, ok, nok, type, markerType, stringType) {\n var self = this\n var size = 0\n var data\n return start\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.enter(stringType)\n return atBreak\n }\n\n function atBreak(code) {\n if (\n code === null ||\n code === 91 ||\n (code === 93 && !data) ||\n /* c8 ignore next */\n (code === 94 &&\n /* c8 ignore next */\n !size &&\n /* c8 ignore next */\n '_hiddenFootnoteSupport' in self.parser.constructs) ||\n size > 999\n ) {\n return nok(code)\n }\n\n if (code === 93) {\n effects.exit(stringType)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return atBreak\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return label(code)\n }\n\n function label(code) {\n if (\n code === null ||\n code === 91 ||\n code === 93 ||\n markdownLineEnding(code) ||\n size++ > 999\n ) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n\n effects.consume(code)\n data = data || !markdownSpace(code)\n return code === 92 ? labelEscape : label\n }\n\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return label\n }\n\n return label(code)\n }\n}\n\nmodule.exports = labelFactory\n","'use strict'\n\nmodule.exports = bail\n\nfunction bail(err) {\n if (err) {\n throw err\n }\n}\n","'use strict'\n\nvar characterEntities = require('character-entities')\n\nmodule.exports = decodeEntity\n\nvar own = {}.hasOwnProperty\n\nfunction decodeEntity(characters) {\n return own.call(characterEntities, characters)\n ? characterEntities[characters]\n : false\n}\n","'use strict'\n\n// chunks (replacement characters, tabs, or line endings).\n\nfunction movePoint(point, offset) {\n point.column += offset\n point.offset += offset\n point._bufferIndex += offset\n return point\n}\n\nmodule.exports = movePoint\n","'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n","'use strict'\n\nvar wrap = require('./wrap.js')\n\nmodule.exports = trough\n\ntrough.wrap = wrap\n\nvar slice = [].slice\n\n// Create new middleware.\nfunction trough() {\n var fns = []\n var middleware = {}\n\n middleware.run = run\n middleware.use = use\n\n return middleware\n\n // Run `fns`. Last argument must be a completion handler.\n function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }\n\n // Add `fn` to the list.\n function use(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Expected `fn` to be a function, not ' + fn)\n }\n\n fns.push(fn)\n\n return middleware\n }\n}\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\n\nfunction titleFactory(effects, ok, nok, type, markerType, stringType) {\n var marker\n return start\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n marker = code === 40 ? 41 : code\n return atFirstTitleBreak\n }\n\n function atFirstTitleBreak(code) {\n if (code === marker) {\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n return atTitleBreak(code)\n }\n\n function atTitleBreak(code) {\n if (code === marker) {\n effects.exit(stringType)\n return atFirstTitleBreak(marker)\n }\n\n if (code === null) {\n return nok(code)\n } // Note: blank lines can’t exist in content.\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, atTitleBreak, 'linePrefix')\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return title(code)\n }\n\n function title(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n return atTitleBreak(code)\n }\n\n effects.consume(code)\n return code === 92 ? titleEscape : title\n }\n\n function titleEscape(code) {\n if (code === marker || code === 92) {\n effects.consume(code)\n return title\n }\n\n return title(code)\n }\n}\n\nmodule.exports = titleFactory\n","'use strict'\n\nvar factorySpace = require('./factory-space.js')\n\nvar lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n}\n\nfunction tokenizeLineEnding(effects, ok) {\n return start\n\n function start(code) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, ok, 'linePrefix')\n }\n}\n\nmodule.exports = lineEnding\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiDigit = regexCheck(/\\d/)\n\nmodule.exports = asciiDigit\n","'use strict'\n\nmodule.exports = require('./dist')\n","\"use strict\";\n\n/**\n * Naive, simple plugin to match inline nodes without attributes\n * This allows say foo, but not foo\n * For proper HTML support, you'll want a different plugin\n **/\nvar visit = require('unist-util-visit');\n\nvar type = 'virtualHtml';\nvar selfClosingRe = /^<(area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)\\s*\\/?>$/i;\nvar simpleTagRe = /^<(\\/?)([a-z]+)\\s*>$/;\n\nmodule.exports = function (tree) {\n var open;\n var currentParent;\n visit(tree, 'html', function (node, index, parent) {\n if (currentParent !== parent) {\n open = [];\n currentParent = parent;\n }\n\n var selfClosing = getSelfClosing(node);\n\n if (selfClosing) {\n parent.children.splice(index, 1, {\n type: type,\n tag: selfClosing,\n position: node.position\n });\n return true;\n }\n\n var current = getSimpleTag(node, parent);\n\n if (!current) {\n return true;\n }\n\n var matching = findAndPull(open, current.tag);\n\n if (matching) {\n parent.children.splice(index, 0, virtual(current, matching, parent));\n } else if (!current.opening) {\n open.push(current);\n }\n\n return true;\n }, true // Iterate in reverse\n );\n return tree;\n};\n\nfunction findAndPull(open, matchingTag) {\n var i = open.length;\n\n while (i--) {\n if (open[i].tag === matchingTag) {\n return open.splice(i, 1)[0];\n }\n }\n\n return false;\n}\n\nfunction getSimpleTag(node, parent) {\n var match = node.value.match(simpleTagRe);\n return match ? {\n tag: match[2],\n opening: !match[1],\n node: node\n } : false;\n}\n\nfunction getSelfClosing(node) {\n var match = node.value.match(selfClosingRe);\n return match ? match[1] : false;\n}\n\nfunction virtual(fromNode, toNode, parent) {\n var fromIndex = parent.children.indexOf(fromNode.node);\n var toIndex = parent.children.indexOf(toNode.node);\n var extracted = parent.children.splice(fromIndex, toIndex - fromIndex + 1);\n var children = extracted.slice(1, -1);\n return {\n type: type,\n children: children,\n tag: fromNode.tag,\n position: {\n start: fromNode.node.position.start,\n end: toNode.node.position.end,\n indent: []\n }\n };\n}","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)\n\nmodule.exports = asciiPunctuation\n","'use strict'\n\nvar fromCharCode = require('../constant/from-char-code.js')\n\nfunction serializeChunks(chunks) {\n var index = -1\n var result = []\n var chunk\n var value\n var atTab\n\n while (++index < chunks.length) {\n chunk = chunks[index]\n\n if (typeof chunk === 'string') {\n value = chunk\n } else if (chunk === -5) {\n value = '\\r'\n } else if (chunk === -4) {\n value = '\\n'\n } else if (chunk === -3) {\n value = '\\r' + '\\n'\n } else if (chunk === -2) {\n value = '\\t'\n } else if (chunk === -1) {\n if (atTab) continue\n value = ' '\n } else {\n // Currently only replacement character.\n value = fromCharCode(chunk)\n }\n\n atTab = chunk === -2\n result.push(value)\n }\n\n return result.join('')\n}\n\nmodule.exports = serializeChunks\n","'use strict'\n\n// Counts tabs based on their expanded size, and CR+LF as one character.\n\nfunction sizeChunks(chunks) {\n var index = -1\n var size = 0\n\n while (++index < chunks.length) {\n size += typeof chunks[index] === 'string' ? chunks[index].length : 1\n }\n\n return size\n}\n\nmodule.exports = sizeChunks\n","'use strict'\n\nvar VMessage = require('vfile-message')\nvar VFile = require('./core.js')\n\nmodule.exports = VFile\n\nVFile.prototype.message = message\nVFile.prototype.info = info\nVFile.prototype.fail = fail\n\n// Create a message with `reason` at `position`.\n// When an error is passed in as `reason`, copies the stack.\nfunction message(reason, position, origin) {\n var message = new VMessage(reason, position, origin)\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}\n\n// Fail: creates a vmessage, associates it with the file, and throws it.\nfunction fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}\n\n// Info: creates a vmessage, associates it with the file, and marks the fatality\n// as null.\nfunction info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\nvar unicodePunctuationRegex = require('../constant/unicode-punctuation-regex.js')\n\n// In fact adds to the bundle size.\n\nvar unicodePunctuation = regexCheck(unicodePunctuationRegex)\n\nmodule.exports = unicodePunctuation\n","'use strict'\n\nmodule.exports = fromMarkdown\n\n// These three are compiled away in the `dist/`\n\nvar toString = require('mdast-util-to-string')\nvar assign = require('micromark/dist/constant/assign')\nvar own = require('micromark/dist/constant/has-own-property')\nvar normalizeIdentifier = require('micromark/dist/util/normalize-identifier')\nvar safeFromInt = require('micromark/dist/util/safe-from-int')\nvar parser = require('micromark/dist/parse')\nvar preprocessor = require('micromark/dist/preprocess')\nvar postprocess = require('micromark/dist/postprocess')\nvar decode = require('parse-entities/decode-entity')\nvar stringifyPosition = require('unist-util-stringify-position')\n\nfunction fromMarkdown(value, encoding, options) {\n if (typeof encoding !== 'string') {\n options = encoding\n encoding = undefined\n }\n\n return compiler(options)(\n postprocess(\n parser(options).document().write(preprocessor()(value, encoding, true))\n )\n )\n}\n\n// Note this compiler only understand complete buffering, not streaming.\nfunction compiler(options) {\n var settings = options || {}\n var config = configure(\n {\n canContainEols: [\n 'emphasis',\n 'fragment',\n 'heading',\n 'paragraph',\n 'strong'\n ],\n\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n },\n\n settings.mdastExtensions || []\n )\n\n var data = {}\n\n return compile\n\n function compile(events) {\n var stack = [{type: 'root', children: []}]\n var tokenStack = []\n var listStack = []\n var index = -1\n var handler\n var listStart\n\n var context = {\n stack: stack,\n tokenStack: tokenStack,\n config: config,\n enter: enter,\n exit: exit,\n buffer: buffer,\n resume: resume,\n setData: setData,\n getData: getData\n }\n\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (\n events[index][1].type === 'listOrdered' ||\n events[index][1].type === 'listUnordered'\n ) {\n if (events[index][0] === 'enter') {\n listStack.push(index)\n } else {\n listStart = listStack.pop(index)\n index = prepareList(events, listStart, index)\n }\n }\n }\n\n index = -1\n\n while (++index < events.length) {\n handler = config[events[index][0]]\n\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(\n assign({sliceSerialize: events[index][2].sliceSerialize}, context),\n events[index][1]\n )\n }\n }\n\n if (tokenStack.length) {\n throw new Error(\n 'Cannot close document, a token (`' +\n tokenStack[tokenStack.length - 1].type +\n '`, ' +\n stringifyPosition({\n start: tokenStack[tokenStack.length - 1].start,\n end: tokenStack[tokenStack.length - 1].end\n }) +\n ') is still open'\n )\n }\n\n // Figure out `root` position.\n stack[0].position = {\n start: point(\n events.length ? events[0][1].start : {line: 1, column: 1, offset: 0}\n ),\n\n end: point(\n events.length\n ? events[events.length - 2][1].end\n : {line: 1, column: 1, offset: 0}\n )\n }\n\n return stack[0]\n }\n\n function prepareList(events, start, length) {\n var index = start - 1\n var containerBalance = -1\n var listSpread = false\n var listItem\n var tailIndex\n var lineIndex\n var tailEvent\n var event\n var firstBlankLineIndex\n var atMarker\n\n while (++index <= length) {\n event = events[index]\n\n if (\n event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered' ||\n event[1].type === 'blockQuote'\n ) {\n if (event[0] === 'enter') {\n containerBalance++\n } else {\n containerBalance--\n }\n\n atMarker = undefined\n } else if (event[1].type === 'lineEndingBlank') {\n if (event[0] === 'enter') {\n if (\n listItem &&\n !atMarker &&\n !containerBalance &&\n !firstBlankLineIndex\n ) {\n firstBlankLineIndex = index\n }\n\n atMarker = undefined\n }\n } else if (\n event[1].type === 'linePrefix' ||\n event[1].type === 'listItemValue' ||\n event[1].type === 'listItemMarker' ||\n event[1].type === 'listItemPrefix' ||\n event[1].type === 'listItemPrefixWhitespace'\n ) {\n // Empty.\n } else {\n atMarker = undefined\n }\n\n if (\n (!containerBalance &&\n event[0] === 'enter' &&\n event[1].type === 'listItemPrefix') ||\n (containerBalance === -1 &&\n event[0] === 'exit' &&\n (event[1].type === 'listUnordered' ||\n event[1].type === 'listOrdered'))\n ) {\n if (listItem) {\n tailIndex = index\n lineIndex = undefined\n\n while (tailIndex--) {\n tailEvent = events[tailIndex]\n\n if (\n tailEvent[1].type === 'lineEnding' ||\n tailEvent[1].type === 'lineEndingBlank'\n ) {\n if (tailEvent[0] === 'exit') continue\n\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n listSpread = true\n }\n\n tailEvent[1].type = 'lineEnding'\n lineIndex = tailIndex\n } else if (\n tailEvent[1].type === 'linePrefix' ||\n tailEvent[1].type === 'blockQuotePrefix' ||\n tailEvent[1].type === 'blockQuotePrefixWhitespace' ||\n tailEvent[1].type === 'blockQuoteMarker' ||\n tailEvent[1].type === 'listItemIndent'\n ) {\n // Empty\n } else {\n break\n }\n }\n\n if (\n firstBlankLineIndex &&\n (!lineIndex || firstBlankLineIndex < lineIndex)\n ) {\n listItem._spread = true\n }\n\n // Fix position.\n listItem.end = point(\n lineIndex ? events[lineIndex][1].start : event[1].end\n )\n\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])\n index++\n length++\n }\n\n // Create a new list item.\n if (event[1].type === 'listItemPrefix') {\n listItem = {\n type: 'listItem',\n _spread: false,\n start: point(event[1].start)\n }\n\n events.splice(index, 0, ['enter', listItem, event[2]])\n index++\n length++\n firstBlankLineIndex = undefined\n atMarker = true\n }\n }\n }\n\n events[start][1]._spread = listSpread\n return length\n }\n\n function setData(key, value) {\n data[key] = value\n }\n\n function getData(key) {\n return data[key]\n }\n\n function point(d) {\n return {line: d.line, column: d.column, offset: d.offset}\n }\n\n function opener(create, and) {\n return open\n\n function open(token) {\n enter.call(this, create(token), token)\n if (and) and.call(this, token)\n }\n }\n\n function buffer() {\n this.stack.push({type: 'fragment', children: []})\n }\n\n function enter(node, token) {\n this.stack[this.stack.length - 1].children.push(node)\n this.stack.push(node)\n this.tokenStack.push(token)\n node.position = {start: point(token.start)}\n return node\n }\n\n function closer(and) {\n return close\n\n function close(token) {\n if (and) and.call(this, token)\n exit.call(this, token)\n }\n }\n\n function exit(token) {\n var node = this.stack.pop()\n var open = this.tokenStack.pop()\n\n if (!open) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({start: token.start, end: token.end}) +\n '): it’s not open'\n )\n } else if (open.type !== token.type) {\n throw new Error(\n 'Cannot close `' +\n token.type +\n '` (' +\n stringifyPosition({start: token.start, end: token.end}) +\n '): a different token (`' +\n open.type +\n '`, ' +\n stringifyPosition({start: open.start, end: open.end}) +\n ') is open'\n )\n }\n\n node.position.end = point(token.end)\n return node\n }\n\n function resume() {\n return toString(this.stack.pop())\n }\n\n //\n // Handlers.\n //\n\n function onenterlistordered() {\n setData('expectingFirstListItemValue', true)\n }\n\n function onenterlistitemvalue(token) {\n if (getData('expectingFirstListItemValue')) {\n this.stack[this.stack.length - 2].start = parseInt(\n this.sliceSerialize(token),\n 10\n )\n\n setData('expectingFirstListItemValue')\n }\n }\n\n function onexitcodefencedfenceinfo() {\n var data = this.resume()\n this.stack[this.stack.length - 1].lang = data\n }\n\n function onexitcodefencedfencemeta() {\n var data = this.resume()\n this.stack[this.stack.length - 1].meta = data\n }\n\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (getData('flowCodeInside')) return\n this.buffer()\n setData('flowCodeInside', true)\n }\n\n function onexitcodefenced() {\n var data = this.resume()\n this.stack[this.stack.length - 1].value = data.replace(\n /^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g,\n ''\n )\n\n setData('flowCodeInside')\n }\n\n function onexitcodeindented() {\n var data = this.resume()\n this.stack[this.stack.length - 1].value = data\n }\n\n function onexitdefinitionlabelstring(token) {\n // Discard label, use the source content instead.\n var label = this.resume()\n this.stack[this.stack.length - 1].label = label\n this.stack[this.stack.length - 1].identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n function onexitdefinitiontitlestring() {\n var data = this.resume()\n this.stack[this.stack.length - 1].title = data\n }\n\n function onexitdefinitiondestinationstring() {\n var data = this.resume()\n this.stack[this.stack.length - 1].url = data\n }\n\n function onexitatxheadingsequence(token) {\n if (!this.stack[this.stack.length - 1].depth) {\n this.stack[this.stack.length - 1].depth = this.sliceSerialize(\n token\n ).length\n }\n }\n\n function onexitsetextheadingtext() {\n setData('setextHeadingSlurpLineEnding', true)\n }\n\n function onexitsetextheadinglinesequence(token) {\n this.stack[this.stack.length - 1].depth =\n this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2\n }\n\n function onexitsetextheading() {\n setData('setextHeadingSlurpLineEnding')\n }\n\n function onenterdata(token) {\n var siblings = this.stack[this.stack.length - 1].children\n var tail = siblings[siblings.length - 1]\n\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text()\n tail.position = {start: point(token.start)}\n this.stack[this.stack.length - 1].children.push(tail)\n }\n\n this.stack.push(tail)\n }\n\n function onexitdata(token) {\n var tail = this.stack.pop()\n tail.value += this.sliceSerialize(token)\n tail.position.end = point(token.end)\n }\n\n function onexitlineending(token) {\n var context = this.stack[this.stack.length - 1]\n\n // If we’re at a hard break, include the line ending in there.\n if (getData('atHardBreak')) {\n context.children[context.children.length - 1].position.end = point(\n token.end\n )\n\n setData('atHardBreak')\n return\n }\n\n if (\n !getData('setextHeadingSlurpLineEnding') &&\n config.canContainEols.indexOf(context.type) > -1\n ) {\n onenterdata.call(this, token)\n onexitdata.call(this, token)\n }\n }\n\n function onexithardbreak() {\n setData('atHardBreak', true)\n }\n\n function onexithtmlflow() {\n var data = this.resume()\n this.stack[this.stack.length - 1].value = data\n }\n\n function onexithtmltext() {\n var data = this.resume()\n this.stack[this.stack.length - 1].value = data\n }\n\n function onexitcodetext() {\n var data = this.resume()\n this.stack[this.stack.length - 1].value = data\n }\n\n function onexitlink() {\n var context = this.stack[this.stack.length - 1]\n\n // To do: clean.\n if (getData('inReference')) {\n context.type += 'Reference'\n context.referenceType = getData('referenceType') || 'shortcut'\n delete context.url\n delete context.title\n } else {\n delete context.identifier\n delete context.label\n delete context.referenceType\n }\n\n setData('referenceType')\n }\n\n function onexitimage() {\n var context = this.stack[this.stack.length - 1]\n\n // To do: clean.\n if (getData('inReference')) {\n context.type += 'Reference'\n context.referenceType = getData('referenceType') || 'shortcut'\n delete context.url\n delete context.title\n } else {\n delete context.identifier\n delete context.label\n delete context.referenceType\n }\n\n setData('referenceType')\n }\n\n function onexitlabeltext(token) {\n this.stack[this.stack.length - 2].identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n }\n\n function onexitlabel() {\n var fragment = this.stack[this.stack.length - 1]\n var value = this.resume()\n\n this.stack[this.stack.length - 1].label = value\n\n // Assume a reference.\n setData('inReference', true)\n\n if (this.stack[this.stack.length - 1].type === 'link') {\n this.stack[this.stack.length - 1].children = fragment.children\n } else {\n this.stack[this.stack.length - 1].alt = value\n }\n }\n\n function onexitresourcedestinationstring() {\n var data = this.resume()\n this.stack[this.stack.length - 1].url = data\n }\n\n function onexitresourcetitlestring() {\n var data = this.resume()\n this.stack[this.stack.length - 1].title = data\n }\n\n function onexitresource() {\n setData('inReference')\n }\n\n function onenterreference() {\n setData('referenceType', 'collapsed')\n }\n\n function onexitreferencestring(token) {\n var label = this.resume()\n this.stack[this.stack.length - 1].label = label\n this.stack[this.stack.length - 1].identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n setData('referenceType', 'full')\n }\n\n function onexitcharacterreferencemarker(token) {\n setData('characterReferenceType', token.type)\n }\n\n function onexitcharacterreferencevalue(token) {\n var data = this.sliceSerialize(token)\n var type = getData('characterReferenceType')\n var value\n var tail\n\n if (type) {\n value = safeFromInt(\n data,\n type === 'characterReferenceMarkerNumeric' ? 10 : 16\n )\n\n setData('characterReferenceType')\n } else {\n value = decode(data)\n }\n\n tail = this.stack.pop()\n tail.value += value\n tail.position.end = point(token.end)\n }\n\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token)\n this.stack[this.stack.length - 1].url = this.sliceSerialize(token)\n }\n\n function onexitautolinkemail(token) {\n onexitdata.call(this, token)\n this.stack[this.stack.length - 1].url =\n 'mailto:' + this.sliceSerialize(token)\n }\n\n //\n // Creaters.\n //\n\n function blockQuote() {\n return {type: 'blockquote', children: []}\n }\n\n function codeFlow() {\n return {type: 'code', lang: null, meta: null, value: ''}\n }\n\n function codeText() {\n return {type: 'inlineCode', value: ''}\n }\n\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n }\n }\n\n function emphasis() {\n return {type: 'emphasis', children: []}\n }\n\n function heading() {\n return {type: 'heading', depth: undefined, children: []}\n }\n\n function hardBreak() {\n return {type: 'break'}\n }\n\n function html() {\n return {type: 'html', value: ''}\n }\n\n function image() {\n return {type: 'image', title: null, url: '', alt: null}\n }\n\n function link() {\n return {type: 'link', title: null, url: '', children: []}\n }\n\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n }\n }\n\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n }\n }\n\n function paragraph() {\n return {type: 'paragraph', children: []}\n }\n\n function strong() {\n return {type: 'strong', children: []}\n }\n\n function text() {\n return {type: 'text', value: ''}\n }\n\n function thematicBreak() {\n return {type: 'thematicBreak'}\n }\n}\n\nfunction configure(config, extensions) {\n var index = -1\n\n while (++index < extensions.length) {\n extension(config, extensions[index])\n }\n\n return config\n}\n\nfunction extension(config, extension) {\n var key\n var left\n\n for (key in extension) {\n left = own.call(config, key) ? config[key] : (config[key] = {})\n\n if (key === 'canContainEols') {\n config[key] = [].concat(left, extension[key])\n } else {\n Object.assign(left, extension[key])\n }\n }\n}\n","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('../tokenize/factory-space.js')\n\nvar tokenize = initializeContent\n\nfunction initializeContent(effects) {\n var contentStart = effects.attempt(\n this.parser.constructs.contentInitial,\n afterContentStartConstruct,\n paragraphInitial\n )\n var previous\n return contentStart\n\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, contentStart, 'linePrefix')\n }\n\n function paragraphInitial(code) {\n effects.enter('paragraph')\n return lineStart(code)\n }\n\n function lineStart(code) {\n var token = effects.enter('chunkText', {\n contentType: 'text',\n previous: previous\n })\n\n if (previous) {\n previous.next = token\n }\n\n previous = token\n return data(code)\n }\n\n function data(code) {\n if (code === null) {\n effects.exit('chunkText')\n effects.exit('paragraph')\n effects.consume(code)\n return\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code)\n effects.exit('chunkText')\n return lineStart\n } // Data.\n\n effects.consume(code)\n return data\n }\n}\n\nexports.tokenize = tokenize\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar asciiControl = require('../character/ascii-control.js')\n\n// eslint-disable-next-line max-params\nfunction destinationFactory(\n effects,\n ok,\n nok,\n type,\n literalType,\n literalMarkerType,\n rawType,\n stringType,\n max\n) {\n var limit = max || Infinity\n var balance = 0\n return start\n\n function start(code) {\n if (code === 60) {\n effects.enter(type)\n effects.enter(literalType)\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n return destinationEnclosedBefore\n }\n\n if (asciiControl(code)) {\n return nok(code)\n }\n\n effects.enter(type)\n effects.enter(rawType)\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationRaw(code)\n }\n\n function destinationEnclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n effects.exit(literalType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationEnclosed(code)\n }\n\n function destinationEnclosed(code) {\n if (code === 62) {\n effects.exit('chunkString')\n effects.exit(stringType)\n return destinationEnclosedBefore(code)\n }\n\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return code === 92 ? destinationEnclosedEscape : destinationEnclosed\n }\n\n function destinationEnclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code)\n return destinationEnclosed\n }\n\n return destinationEnclosed(code)\n }\n\n function destinationRaw(code) {\n if (code === 40) {\n if (++balance > limit) return nok(code)\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === 41) {\n if (!balance--) {\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n if (balance) return nok(code)\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n if (asciiControl(code)) return nok(code)\n effects.consume(code)\n return code === 92 ? destinationRawEscape : destinationRaw\n }\n\n function destinationRawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code)\n return destinationRaw\n }\n\n return destinationRaw(code)\n }\n}\n\nmodule.exports = destinationFactory\n","'use strict'\n\nvar p = require('./minpath')\nvar proc = require('./minproc')\nvar buffer = require('is-buffer')\n\nmodule.exports = VFile\n\nvar own = {}.hasOwnProperty\n\n// Order of setting (least specific to most), we need this because otherwise\n// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n// stem can be set.\nvar order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']\n\nVFile.prototype.toString = toString\n\n// Access full path (`~/index.min.js`).\nObject.defineProperty(VFile.prototype, 'path', {get: getPath, set: setPath})\n\n// Access parent path (`~`).\nObject.defineProperty(VFile.prototype, 'dirname', {\n get: getDirname,\n set: setDirname\n})\n\n// Access basename (`index.min.js`).\nObject.defineProperty(VFile.prototype, 'basename', {\n get: getBasename,\n set: setBasename\n})\n\n// Access extname (`.js`).\nObject.defineProperty(VFile.prototype, 'extname', {\n get: getExtname,\n set: setExtname\n})\n\n// Access stem (`index.min`).\nObject.defineProperty(VFile.prototype, 'stem', {get: getStem, set: setStem})\n\n// Construct a new file.\nfunction VFile(options) {\n var prop\n var index\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = proc.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n\n while (++index < order.length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) < 0) {\n this[prop] = options[prop]\n }\n }\n}\n\nfunction getPath() {\n return this.history[this.history.length - 1]\n}\n\nfunction setPath(path) {\n assertNonEmpty(path, 'path')\n\n if (this.path !== path) {\n this.history.push(path)\n }\n}\n\nfunction getDirname() {\n return typeof this.path === 'string' ? p.dirname(this.path) : undefined\n}\n\nfunction setDirname(dirname) {\n assertPath(this.path, 'dirname')\n this.path = p.join(dirname || '', this.basename)\n}\n\nfunction getBasename() {\n return typeof this.path === 'string' ? p.basename(this.path) : undefined\n}\n\nfunction setBasename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = p.join(this.dirname || '', basename)\n}\n\nfunction getExtname() {\n return typeof this.path === 'string' ? p.extname(this.path) : undefined\n}\n\nfunction setExtname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.path, 'extname')\n\n if (extname) {\n if (extname.charCodeAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.indexOf('.', 1) > -1) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = p.join(this.dirname, this.stem + (extname || ''))\n}\n\nfunction getStem() {\n return typeof this.path === 'string'\n ? p.basename(this.path, this.extname)\n : undefined\n}\n\nfunction setStem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = p.join(this.dirname || '', stem + (this.extname || ''))\n}\n\n// Get the value of the file.\nfunction toString(encoding) {\n return (this.contents || '').toString(encoding)\n}\n\n// Assert that `part` is not a path (i.e., does not contain `p.sep`).\nfunction assertPart(part, name) {\n if (part && part.indexOf(p.sep) > -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + p.sep + '`'\n )\n }\n}\n\n// Assert that `part` is not empty.\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n// Assert `path` exists.\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n","'use strict'\n\nvar normalizeIdentifier = require('../util/normalize-identifier.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar factoryDestination = require('./factory-destination.js')\nvar factoryLabel = require('./factory-label.js')\nvar factoryWhitespace = require('./factory-whitespace.js')\nvar factoryTitle = require('./factory-title.js')\n\nvar definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n}\nvar titleConstruct = {\n tokenize: tokenizeTitle,\n partial: true\n}\n\nfunction tokenizeDefinition(effects, ok, nok) {\n var self = this\n var identifier\n return start\n\n function start(code) {\n effects.enter('definition')\n return factoryLabel.call(\n self,\n effects,\n labelAfter,\n nok,\n 'definitionLabel',\n 'definitionLabelMarker',\n 'definitionLabelString'\n )(code)\n }\n\n function labelAfter(code) {\n identifier = normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n\n if (code === 58) {\n effects.enter('definitionMarker')\n effects.consume(code)\n effects.exit('definitionMarker') // Note: blank lines can’t exist in content.\n\n return factoryWhitespace(\n effects,\n factoryDestination(\n effects,\n effects.attempt(\n titleConstruct,\n factorySpace(effects, after, 'whitespace'),\n factorySpace(effects, after, 'whitespace')\n ),\n nok,\n 'definitionDestination',\n 'definitionDestinationLiteral',\n 'definitionDestinationLiteralMarker',\n 'definitionDestinationRaw',\n 'definitionDestinationString'\n )\n )\n }\n\n return nok(code)\n }\n\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('definition')\n\n if (self.parser.defined.indexOf(identifier) < 0) {\n self.parser.defined.push(identifier)\n }\n\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeTitle(effects, ok, nok) {\n return start\n\n function start(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, before)(code)\n : nok(code)\n }\n\n function before(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n factorySpace(effects, after, 'whitespace'),\n nok,\n 'definitionTitle',\n 'definitionTitleMarker',\n 'definitionTitleString'\n )(code)\n }\n\n return nok(code)\n }\n\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code)\n }\n}\n\nmodule.exports = definition\n","'use strict'\n\n/* Expose. */\nmodule.exports = visitParents\n\n/* Visit. */\nfunction visitParents(tree, type, visitor) {\n var stack = []\n\n if (typeof type === 'function') {\n visitor = type\n type = null\n }\n\n one(tree)\n\n /* Visit a single node. */\n function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }\n\n /* Visit children in `parent`. */\n function all(children, parent) {\n var length = children.length\n var index = -1\n var child\n\n stack.push(parent)\n\n while (++index < length) {\n child = children[index]\n\n if (child && one(child) === false) {\n return false\n }\n }\n\n stack.pop()\n\n return true\n }\n}\n","'use strict'\n\nvar hasOwnProperty = require('../constant/has-own-property.js')\nvar chunkedSplice = require('./chunked-splice.js')\nvar miniflat = require('./miniflat.js')\n\nfunction combineExtensions(extensions) {\n var all = {}\n var index = -1\n\n while (++index < extensions.length) {\n extension(all, extensions[index])\n }\n\n return all\n}\n\nfunction extension(all, extension) {\n var hook\n var left\n var right\n var code\n\n for (hook in extension) {\n left = hasOwnProperty.call(all, hook) ? all[hook] : (all[hook] = {})\n right = extension[hook]\n\n for (code in right) {\n left[code] = constructs(\n miniflat(right[code]),\n hasOwnProperty.call(left, code) ? left[code] : []\n )\n }\n }\n}\n\nfunction constructs(list, existing) {\n var index = -1\n var before = []\n\n while (++index < list.length) {\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n chunkedSplice(existing, 0, 0, before)\n return existing\n}\n\nmodule.exports = combineExtensions\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport function PureComponent(p) {\n\tthis.props = p;\n}\nPureComponent.prototype = new Component();\n// Some third-party libraries check if this property is present\nPureComponent.prototype.isPureReactComponent = true;\nPureComponent.prototype.shouldComponentUpdate = function(props, state) {\n\treturn shallowDiffers(this.props, props) || shallowDiffers(this.state, state);\n};\n","import { createElement } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionalComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionalComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, props);\n\t}\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\nexport const REACT_FORWARD_SYMBOL =\n\t(typeof Symbol != 'undefined' &&\n\t\tSymbol.for &&\n\t\tSymbol.for('react.forward_ref')) ||\n\t0xf47;\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionalComponent}\n */\nexport function forwardRef(fn) {\n\t// We always have ref in props.ref, except for\n\t// mobx-react. It will call this function directly\n\t// and always pass ref as the second argument.\n\tfunction Forwarded(props, ref) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\tref = props.ref || ref;\n\t\treturn fn(\n\t\t\tclone,\n\t\t\t!ref || (typeof ref === 'object' && !('current' in ref)) ? null : ref\n\t\t);\n\t}\n\n\t// mobx-react checks for this being present\n\tForwarded.$$typeof = REACT_FORWARD_SYMBOL;\n\t// mobx-react heavily relies on implementation details.\n\t// It expects an object here with a `render` property,\n\t// and prototype.render will fail. Without this\n\t// mobx-react throws.\n\tForwarded.render = Forwarded;\n\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (children == null) return null;\n\treturn toChildArray(toChildArray(children).map(fn));\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tconst normalized = toChildArray(children);\n\t\tif (normalized.length !== 1) throw 'Children.only';\n\t\treturn normalized[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options, Fragment } from 'preact';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function(error, newVNode, oldVNode) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\tif (newVNode._dom == null) {\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t}\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode);\n};\n\nfunction detachedClone(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component && vnode._component.__hooks) {\n\t\t\tvnode._component.__hooks._list.forEach(effect => {\n\t\t\t\tif (typeof effect._cleanup == 'function') effect._cleanup();\n\t\t\t});\n\n\t\t\tvnode._component.__hooks = null;\n\t\t}\n\n\t\tvnode = assign({}, vnode);\n\t\tvnode._component = null;\n\t\tvnode._children = vnode._children && vnode._children.map(detachedClone);\n\t}\n\n\treturn vnode;\n}\n\nfunction removeOriginal(vnode) {\n\tif (vnode) {\n\t\tvnode._original = null;\n\t\tvnode._children = vnode._children && vnode._children.map(removeOriginal);\n\t}\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @param {Promise} promise The thrown promise\n * @param {import('./internal').VNode} suspendingVNode The suspending component\n */\nSuspense.prototype._childDidSuspend = function(promise, suspendingVNode) {\n\tconst suspendingComponent = suspendingVNode._component;\n\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved) return;\n\n\t\tresolved = true;\n\t\tsuspendingComponent.componentWillUnmount =\n\t\t\tsuspendingComponent._suspendedComponentWillUnmount;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._suspendedComponentWillUnmount =\n\t\tsuspendingComponent.componentWillUnmount;\n\tsuspendingComponent.componentWillUnmount = () => {\n\t\tonResolved();\n\n\t\tif (suspendingComponent._suspendedComponentWillUnmount) {\n\t\t\tsuspendingComponent._suspendedComponentWillUnmount();\n\t\t}\n\t};\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\tc._vnode._children[0] = removeOriginal(c.state._suspended);\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * We do not set `suspended: true` during hydration because we want the actual markup\n\t * to remain on screen and hydrate it when the suspense actually gets resolved.\n\t * While in non-hydration cases the usual fallback -> component flow would occour.\n\t */\n\tconst wasHydrating = suspendingVNode._hydrating === true;\n\tif (!wasHydrating && !c._pendingSuspensionCount++) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.componentWillUnmount = function() {\n\tthis._suspenders = [];\n};\n\nSuspense.prototype.render = function(props, state) {\n\tif (this._detachOnNextRender) {\n\t\t// When the Suspense's _vnode was created by a call to createVNode\n\t\t// (i.e. due to a setState further up in the tree)\n\t\t// it's _children prop is null, in this case we \"forget\" about the parked vnodes to detach\n\t\tif (this._vnode._children)\n\t\t\tthis._vnode._children[0] = detachedClone(this._detachOnNextRender);\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\t// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:\n\t/** @type {import('./internal').VNode} */\n\tconst fallback =\n\t\tstate._suspended && createElement(Fragment, null, props.fallback);\n\tif (fallback) fallback._hydrating = null;\n\n\treturn [\n\t\tcreateElement(Fragment, null, state._suspended ? null : props.children),\n\t\tfallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('./internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\t/** @type {import('./internal').Component} */\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component;\n\tlet error;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn createElement(component, props);\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function(child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function(props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate = SuspenseList.prototype.componentDidMount = function() {\n\t// Iterate through all children after mounting for two reasons:\n\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t// The nodes can now be completely consumed from the linked list.\n\t// 2. Handle nodes that might have gotten resolved between render and\n\t// componentDidMount.\n\tthis._map.forEach((node, child) => {\n\t\tresolve(this, child, node);\n\t});\n};\n","import { createElement, hydrate, render, __u as _unmount } from 'preact';\n\nfunction ContextProvider(props) {\n\tthis.getChildContext = () => props.context;\n\treturn props.children;\n}\n\n/**\n * Portal component\n * @param {object | null | undefined} props\n *\n * TODO: this could use the \"fake root node\" trick from the partial hydration demo\n */\nfunction Portal(props) {\n\tconst _this = this;\n\tlet container = props._container;\n\tlet wrap = createElement(\n\t\tContextProvider,\n\t\t{ context: _this.context },\n\t\tprops._vnode\n\t);\n\n\t_this.componentWillUnmount = function() {\n\t\tlet parent = _this._temp.parentNode;\n\t\tif (parent) parent.removeChild(_this._temp);\n\t\t_unmount(_this._wrap);\n\t};\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\t_this.componentWillUnmount();\n\t\t// if (_this._temp.parentNode) _this._container.removeChild(_this._temp);\n\t\t// _unmount(_this._wrap);\n\t\t_this._hasMounted = false;\n\t}\n\n\t// When props.vnode is undefined/false/null we are dealing with some kind of\n\t// conditional vnode. This should not trigger a render.\n\tif (props._vnode) {\n\t\tif (!_this._hasMounted) {\n\t\t\t// Create a placeholder that we can use to insert into.\n\t\t\t_this._temp = document.createTextNode('');\n\t\t\t// temporarily store the current children of the container to restore them after render\n\t\t\t_this._children = container._children;\n\t\t\t// Hydrate existing nodes to keep the dom intact, when rendering\n\t\t\t// wrap into the container.\n\t\t\thydrate('', container);\n\t\t\t// Append to the container (this matches React's behavior)\n\t\t\tcontainer.appendChild(_this._temp);\n\t\t\t// At this point we have mounted and should set our container.\n\t\t\t_this._hasMounted = true;\n\t\t\t_this._container = container;\n\t\t\t// Render our wrapping element into temp.\n\t\t\trender(wrap, container, _this._temp);\n\t\t\t// restore the previous children of the container\n\t\t\tcontainer._children = _this._children;\n\t\t\t// store the children of the new vnode to be used in subsequent re-renders\n\t\t\t_this._children = _this._temp._children;\n\t\t} else {\n\t\t\t// When we have mounted and the vnode is present it means the\n\t\t\t// props have changed or a parent is triggering a rerender.\n\t\t\t// This implies we only need to call render. But we need to keep\n\t\t\t// the old tree around, otherwise will treat the vnodes as new and\n\t\t\t// will wrongly call `componentDidMount` on them\n\t\t\tcontainer._children = _this._children;\n\t\t\trender(wrap, container);\n\t\t\t_this._children = container._children;\n\t\t}\n\t}\n\t// When we come from a conditional render, on a mounted\n\t// portal we should clear the DOM.\n\telse if (_this._hasMounted) {\n\t\t_this.componentWillUnmount();\n\t\t// if (_this._temp.parentNode) _this._container.removeChild(_this._temp);\n\t\t// _unmount(_this._wrap);\n\t}\n\t// Set the wrapping element for future unmounting.\n\t_this._wrap = wrap;\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\treturn createElement(Portal, { _vnode: vnode, _container: container });\n}\n","import {\n\trender as preactRender,\n\thydrate as preactHydrate,\n\toptions,\n\ttoChildArray,\n\tComponent\n} from 'preact';\n\nexport const REACT_ELEMENT_TYPE =\n\t(typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||\n\t0xeac7;\n\nconst CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;\n\n// Input types for which onchange should not be converted to oninput.\n// type=\"file|checkbox|radio\", plus \"range\" in IE11.\n// (IE11 doesn't support Symbol, which we use here to turn `rad` into `ra` which matches \"range\")\nconst ONCHANGE_INPUT_TYPES =\n\ttypeof Symbol != 'undefined' ? /fil|che|rad/i : /fil|che|ra/i;\n\n// Some libraries like `react-virtualized` explicitly check for this.\nComponent.prototype.isReactComponent = {};\n\n// `UNSAFE_*` lifecycle hooks\n// Preact only ever invokes the unprefixed methods.\n// Here we provide a base \"fallback\" implementation that calls any defined UNSAFE_ prefixed method.\n// - If a component defines its own `componentDidMount()` (including via defineProperty), use that.\n// - If a component defines `UNSAFE_componentDidMount()`, `componentDidMount` is the alias getter/setter.\n// - If anything assigns to an `UNSAFE_*` property, the assignment is forwarded to the unprefixed property.\n// See https://github.com/preactjs/preact/issues/1941\n[\n\t'componentWillMount',\n\t'componentWillReceiveProps',\n\t'componentWillUpdate'\n].forEach(key => {\n\tObject.defineProperty(Component.prototype, key, {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn this['UNSAFE_' + key];\n\t\t},\n\t\tset(v) {\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: v\n\t\t\t});\n\t\t}\n\t});\n});\n\n/**\n * Proxy render() since React returns a Component reference.\n * @param {import('./internal').VNode} vnode VNode tree to render\n * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into\n * @param {() => void} [callback] Optional callback that will be called after rendering\n * @returns {import('./internal').Component | null} The root component reference or null\n */\nexport function render(vnode, parent, callback) {\n\t// React destroys any existing DOM nodes, see #1727\n\t// ...but only on the first render, see #1828\n\tif (parent._children == null) {\n\t\tparent.textContent = '';\n\t}\n\n\tpreactRender(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nexport function hydrate(vnode, parent, callback) {\n\tpreactHydrate(vnode, parent);\n\tif (typeof callback == 'function') callback();\n\n\treturn vnode ? vnode._component : null;\n}\n\nlet oldEventHook = options.event;\noptions.event = e => {\n\tif (oldEventHook) e = oldEventHook(e);\n\te.persist = empty;\n\te.isPropagationStopped = isPropagationStopped;\n\te.isDefaultPrevented = isDefaultPrevented;\n\treturn (e.nativeEvent = e);\n};\n\nfunction empty() {}\n\nfunction isPropagationStopped() {\n\treturn this.cancelBubble;\n}\n\nfunction isDefaultPrevented() {\n\treturn this.defaultPrevented;\n}\n\nlet classNameDescriptor = {\n\tconfigurable: true,\n\tget() {\n\t\treturn this.class;\n\t}\n};\n\nlet oldVNodeHook = options.vnode;\noptions.vnode = vnode => {\n\tlet type = vnode.type;\n\tlet props = vnode.props;\n\tlet normalizedProps = props;\n\n\t// only normalize props on Element nodes\n\tif (typeof type === 'string') {\n\t\tnormalizedProps = {};\n\n\t\tfor (let i in props) {\n\t\t\tlet value = props[i];\n\n\t\t\tif (i === 'defaultValue' && 'value' in props && props.value == null) {\n\t\t\t\t// `defaultValue` is treated as a fallback `value` when a value prop is present but null/undefined.\n\t\t\t\t// `defaultValue` for Elements with no value prop is the same as the DOM defaultValue property.\n\t\t\t\ti = 'value';\n\t\t\t} else if (i === 'download' && value === true) {\n\t\t\t\t// Calling `setAttribute` with a truthy value will lead to it being\n\t\t\t\t// passed as a stringified value, e.g. `download=\"true\"`. React\n\t\t\t\t// converts it to an empty string instead, otherwise the attribute\n\t\t\t\t// value will be used as the file name and the file will be called\n\t\t\t\t// \"true\" upon downloading it.\n\t\t\t\tvalue = '';\n\t\t\t} else if (/ondoubleclick/i.test(i)) {\n\t\t\t\ti = 'ondblclick';\n\t\t\t} else if (\n\t\t\t\t/^onchange(textarea|input)/i.test(i + type) &&\n\t\t\t\t!ONCHANGE_INPUT_TYPES.test(props.type)\n\t\t\t) {\n\t\t\t\ti = 'oninput';\n\t\t\t} else if (/^on(Ani|Tra|Tou|BeforeInp)/.test(i)) {\n\t\t\t\ti = i.toLowerCase();\n\t\t\t} else if (CAMEL_PROPS.test(i)) {\n\t\t\t\ti = i.replace(/[A-Z0-9]/, '-$&').toLowerCase();\n\t\t\t} else if (value === null) {\n\t\t\t\tvalue = undefined;\n\t\t\t}\n\n\t\t\tnormalizedProps[i] = value;\n\t\t}\n\n\t\t// Add support for array select values: \n\t\tif (\n\t\t\ttype == 'select' &&\n\t\t\tnormalizedProps.multiple &&\n\t\t\tArray.isArray(normalizedProps.value)\n\t\t) {\n\t\t\t// forEach() always returns undefined, which we abuse here to unset the value prop.\n\t\t\tnormalizedProps.value = toChildArray(props.children).forEach(child => {\n\t\t\t\tchild.props.selected =\n\t\t\t\t\tnormalizedProps.value.indexOf(child.props.value) != -1;\n\t\t\t});\n\t\t}\n\n\t\tvnode.props = normalizedProps;\n\t}\n\n\tif (type && props.class != props.className) {\n\t\tclassNameDescriptor.enumerable = 'className' in props;\n\t\tif (props.className != null) normalizedProps.class = props.className;\n\t\tObject.defineProperty(normalizedProps, 'className', classNameDescriptor);\n\t}\n\n\tvnode.$$typeof = REACT_ELEMENT_TYPE;\n\n\tif (oldVNodeHook) oldVNodeHook(vnode);\n};\n\n// Only needed for react-relay\nlet currentComponent;\nconst oldBeforeRender = options._render;\noptions._render = function(vnode) {\n\tif (oldBeforeRender) {\n\t\toldBeforeRender(vnode);\n\t}\n\tcurrentComponent = vnode._component;\n};\n\n// This is a very very private internal function for React it\n// is used to sort-of do runtime dependency injection. So far\n// only `react-relay` makes use of it. It uses it to read the\n// context value.\nexport const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {\n\tReactCurrentDispatcher: {\n\t\tcurrent: {\n\t\t\treadContext(context) {\n\t\t\t\treturn currentComponent._globalContext[context._id].props.value;\n\t\t\t}\n\t\t}\n\t}\n};\n","'use strict'\n\nvar asciiPunctuation = require('../character/ascii-punctuation.js')\n\nvar characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n}\n\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('characterEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n effects.exit('escapeMarker')\n return open\n }\n\n function open(code) {\n if (asciiPunctuation(code)) {\n effects.enter('characterEscapeValue')\n effects.consume(code)\n effects.exit('characterEscapeValue')\n effects.exit('characterEscape')\n return ok\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = characterEscape\n","'use strict'\n\nvar assign = Object.assign\n\nmodule.exports = assign\n","'use strict'\n\nfunction markdownLineEndingOrSpace(code) {\n return code < 0 || code === 32\n}\n\nmodule.exports = markdownLineEndingOrSpace\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiHexDigit = regexCheck(/[\\dA-Fa-f]/)\n\nmodule.exports = asciiHexDigit\n","'use strict'\n\n// This module is copied from .\nvar basics = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'section',\n 'source',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\nmodule.exports = basics\n","'use strict'\n\nvar fromCharCode = String.fromCharCode\n\nmodule.exports = fromCharCode\n","'use strict'\n\nvar fromCharCode = require('../constant/from-char-code.js')\nvar asciiAlphanumeric = require('../character/ascii-alphanumeric.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar partialBlankLine = require('./partial-blank-line.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar asciiAlpha = require('../character/ascii-alpha.js')\nvar htmlBlockNames = require('../constant/html-block-names.js')\nvar htmlRawNames = require('../constant/html-raw-names.js')\n\nvar htmlFlow = {\n name: 'htmlFlow',\n tokenize: tokenizeHtmlFlow,\n resolveTo: resolveToHtmlFlow,\n concrete: true\n}\nvar nextBlankConstruct = {\n tokenize: tokenizeNextBlank,\n partial: true\n}\n\nfunction resolveToHtmlFlow(events) {\n var index = events.length\n\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === 'htmlFlow') {\n break\n }\n }\n\n if (index > 1 && events[index - 2][1].type === 'linePrefix') {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start // Add the prefix start to the HTML line token.\n\n events[index + 1][1].start = events[index - 2][1].start // Remove the line prefix.\n\n events.splice(index - 2, 2)\n }\n\n return events\n}\n\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n var self = this\n var kind\n var startTag\n var buffer\n var index\n var marker\n return start\n\n function start(code) {\n effects.enter('htmlFlow')\n effects.enter('htmlFlowData')\n effects.consume(code)\n return open\n }\n\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationStart\n }\n\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n\n if (code === 63) {\n effects.consume(code)\n kind = 3 // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n buffer = fromCharCode(code)\n startTag = true\n return tagName\n }\n\n return nok(code)\n }\n\n function declarationStart(code) {\n if (code === 45) {\n effects.consume(code)\n kind = 2\n return commentOpenInside\n }\n\n if (code === 91) {\n effects.consume(code)\n kind = 5\n buffer = 'CDATA['\n index = 0\n return cdataOpenInside\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n kind = 4\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n return nok(code)\n }\n\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code)\n return self.interrupt ? ok : continuationDeclarationInside\n }\n\n return nok(code)\n }\n\n function cdataOpenInside(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code)\n return index === buffer.length\n ? self.interrupt\n ? ok\n : continuation\n : cdataOpenInside\n }\n\n return nok(code)\n }\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n buffer = fromCharCode(code)\n return tagName\n }\n\n return nok(code)\n }\n\n function tagName(code) {\n if (\n code === null ||\n code === 47 ||\n code === 62 ||\n markdownLineEndingOrSpace(code)\n ) {\n if (\n code !== 47 &&\n startTag &&\n htmlRawNames.indexOf(buffer.toLowerCase()) > -1\n ) {\n kind = 1\n return self.interrupt ? ok(code) : continuation(code)\n }\n\n if (htmlBlockNames.indexOf(buffer.toLowerCase()) > -1) {\n kind = 6\n\n if (code === 47) {\n effects.consume(code)\n return basicSelfClosing\n }\n\n return self.interrupt ? ok(code) : continuation(code)\n }\n\n kind = 7 // Do not support complete HTML when interrupting.\n\n return self.interrupt\n ? nok(code)\n : startTag\n ? completeAttributeNameBefore(code)\n : completeClosingTagAfter(code)\n }\n\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n buffer += fromCharCode(code)\n return tagName\n }\n\n return nok(code)\n }\n\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code)\n return self.interrupt ? ok : continuation\n }\n\n return nok(code)\n }\n\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeClosingTagAfter\n }\n\n return completeEnd(code)\n }\n\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code)\n return completeEnd\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return completeAttributeName\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameBefore\n }\n\n return completeEnd(code)\n }\n\n function completeAttributeName(code) {\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return completeAttributeName\n }\n\n return completeAttributeNameAfter(code)\n }\n\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeNameAfter\n }\n\n return completeAttributeNameBefore(code)\n }\n\n function completeAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return completeAttributeValueQuoted\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAttributeValueBefore\n }\n\n marker = undefined\n return completeAttributeValueUnquoted(code)\n }\n\n function completeAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n return completeAttributeValueQuotedAfter\n }\n\n if (code === null || markdownLineEnding(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return completeAttributeValueQuoted\n }\n\n function completeAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96 ||\n markdownLineEndingOrSpace(code)\n ) {\n return completeAttributeNameAfter(code)\n }\n\n effects.consume(code)\n return completeAttributeValueUnquoted\n }\n\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code)\n }\n\n return nok(code)\n }\n\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code)\n return completeAfter\n }\n\n return nok(code)\n }\n\n function completeAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code)\n return completeAfter\n }\n\n return code === null || markdownLineEnding(code)\n ? continuation(code)\n : nok(code)\n }\n\n function continuation(code) {\n if (code === 45 && kind === 2) {\n effects.consume(code)\n return continuationCommentInside\n }\n\n if (code === 60 && kind === 1) {\n effects.consume(code)\n return continuationRawTagOpen\n }\n\n if (code === 62 && kind === 4) {\n effects.consume(code)\n return continuationClose\n }\n\n if (code === 63 && kind === 3) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n if (code === 93 && kind === 5) {\n effects.consume(code)\n return continuationCharacterDataInside\n }\n\n if (markdownLineEnding(code) && (kind === 6 || kind === 7)) {\n return effects.check(\n nextBlankConstruct,\n continuationClose,\n continuationAtLineEnding\n )(code)\n }\n\n if (code === null || markdownLineEnding(code)) {\n return continuationAtLineEnding(code)\n }\n\n effects.consume(code)\n return continuation\n }\n\n function continuationAtLineEnding(code) {\n effects.exit('htmlFlowData')\n return htmlContinueStart(code)\n }\n\n function htmlContinueStart(code) {\n if (code === null) {\n return done(code)\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return htmlContinueStart\n }\n\n effects.enter('htmlFlowData')\n return continuation(code)\n }\n\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n return continuation(code)\n }\n\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code)\n buffer = ''\n return continuationRawEndTag\n }\n\n return continuation(code)\n }\n\n function continuationRawEndTag(code) {\n if (code === 62 && htmlRawNames.indexOf(buffer.toLowerCase()) > -1) {\n effects.consume(code)\n return continuationClose\n }\n\n if (asciiAlpha(code) && buffer.length < 8) {\n effects.consume(code)\n buffer += fromCharCode(code)\n return continuationRawEndTag\n }\n\n return continuation(code)\n }\n\n function continuationCharacterDataInside(code) {\n if (code === 93) {\n effects.consume(code)\n return continuationDeclarationInside\n }\n\n return continuation(code)\n }\n\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code)\n return continuationClose\n }\n\n return continuation(code)\n }\n\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('htmlFlowData')\n return done(code)\n }\n\n effects.consume(code)\n return continuationClose\n }\n\n function done(code) {\n effects.exit('htmlFlow')\n return ok(code)\n }\n}\n\nfunction tokenizeNextBlank(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.exit('htmlFlowData')\n effects.enter('lineEndingBlank')\n effects.consume(code)\n effects.exit('lineEndingBlank')\n return effects.attempt(partialBlankLine, ok, nok)\n }\n}\n\nmodule.exports = htmlFlow\n","'use strict'\n\nvar asciiAlphanumeric = require('../character/ascii-alphanumeric.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar asciiAlpha = require('../character/ascii-alpha.js')\n\nvar htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n}\n\nfunction tokenizeHtmlText(effects, ok, nok) {\n var self = this\n var marker\n var buffer\n var index\n var returnState\n return start\n\n function start(code) {\n effects.enter('htmlText')\n effects.enter('htmlTextData')\n effects.consume(code)\n return open\n }\n\n function open(code) {\n if (code === 33) {\n effects.consume(code)\n return declarationOpen\n }\n\n if (code === 47) {\n effects.consume(code)\n return tagCloseStart\n }\n\n if (code === 63) {\n effects.consume(code)\n return instruction\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagOpen\n }\n\n return nok(code)\n }\n\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentOpen\n }\n\n if (code === 91) {\n effects.consume(code)\n buffer = 'CDATA['\n index = 0\n return cdataOpen\n }\n\n if (asciiAlpha(code)) {\n effects.consume(code)\n return declaration\n }\n\n return nok(code)\n }\n\n function commentOpen(code) {\n if (code === 45) {\n effects.consume(code)\n return commentStart\n }\n\n return nok(code)\n }\n\n function commentStart(code) {\n if (code === null || code === 62) {\n return nok(code)\n }\n\n if (code === 45) {\n effects.consume(code)\n return commentStartDash\n }\n\n return comment(code)\n }\n\n function commentStartDash(code) {\n if (code === null || code === 62) {\n return nok(code)\n }\n\n return comment(code)\n }\n\n function comment(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 45) {\n effects.consume(code)\n return commentClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = comment\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return comment\n }\n\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code)\n return end\n }\n\n return comment(code)\n }\n\n function cdataOpen(code) {\n if (code === buffer.charCodeAt(index++)) {\n effects.consume(code)\n return index === buffer.length ? cdata : cdataOpen\n }\n\n return nok(code)\n }\n\n function cdata(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 93) {\n effects.consume(code)\n return cdataClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = cdata\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return cdata\n }\n\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n\n return cdata(code)\n }\n\n function cdataEnd(code) {\n if (code === 62) {\n return end(code)\n }\n\n if (code === 93) {\n effects.consume(code)\n return cdataEnd\n }\n\n return cdata(code)\n }\n\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code)\n }\n\n if (markdownLineEnding(code)) {\n returnState = declaration\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return declaration\n }\n\n function instruction(code) {\n if (code === null) {\n return nok(code)\n }\n\n if (code === 63) {\n effects.consume(code)\n return instructionClose\n }\n\n if (markdownLineEnding(code)) {\n returnState = instruction\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return instruction\n }\n\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code)\n }\n\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n effects.consume(code)\n return tagClose\n }\n\n return nok(code)\n }\n\n function tagClose(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagClose\n }\n\n return tagCloseBetween(code)\n }\n\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagCloseBetween\n }\n\n return end(code)\n }\n\n function tagOpen(code) {\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code)\n return tagOpen\n }\n\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n return nok(code)\n }\n\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code)\n return end\n }\n\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenBetween\n }\n\n return end(code)\n }\n\n function tagOpenAttributeName(code) {\n if (\n code === 45 ||\n code === 46 ||\n code === 58 ||\n code === 95 ||\n asciiAlphanumeric(code)\n ) {\n effects.consume(code)\n return tagOpenAttributeName\n }\n\n return tagOpenAttributeNameAfter(code)\n }\n\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeNameAfter\n }\n\n return tagOpenBetween(code)\n }\n\n function tagOpenAttributeValueBefore(code) {\n if (\n code === null ||\n code === 60 ||\n code === 61 ||\n code === 62 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 34 || code === 39) {\n effects.consume(code)\n marker = code\n return tagOpenAttributeValueQuoted\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore\n return atLineEnding(code)\n }\n\n if (markdownSpace(code)) {\n effects.consume(code)\n return tagOpenAttributeValueBefore\n }\n\n effects.consume(code)\n marker = undefined\n return tagOpenAttributeValueUnquoted\n }\n\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code)\n return tagOpenAttributeValueQuotedAfter\n }\n\n if (code === null) {\n return nok(code)\n }\n\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted\n return atLineEnding(code)\n }\n\n effects.consume(code)\n return tagOpenAttributeValueQuoted\n }\n\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 62 || code === 47 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n return nok(code)\n }\n\n function tagOpenAttributeValueUnquoted(code) {\n if (\n code === null ||\n code === 34 ||\n code === 39 ||\n code === 60 ||\n code === 61 ||\n code === 96\n ) {\n return nok(code)\n }\n\n if (code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code)\n }\n\n effects.consume(code)\n return tagOpenAttributeValueUnquoted\n } // We can’t have blank lines in content, so no need to worry about empty\n // tokens.\n\n function atLineEnding(code) {\n effects.exit('htmlTextData')\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(\n effects,\n afterPrefix,\n 'linePrefix',\n self.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )\n }\n\n function afterPrefix(code) {\n effects.enter('htmlTextData')\n return returnState(code)\n }\n\n function end(code) {\n if (code === 62) {\n effects.consume(code)\n effects.exit('htmlTextData')\n effects.exit('htmlText')\n return ok\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = htmlText\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports.Link = exports.Match = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _preact = require('preact');\n\nvar _preactRouter = require('preact-router');\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Match = exports.Match = function (_Component) {\n\t_inherits(Match, _Component);\n\n\tfunction Match() {\n\t\tvar _temp, _this, _ret;\n\n\t\t_classCallCheck(this, Match);\n\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\targs[_key] = arguments[_key];\n\t\t}\n\n\t\treturn _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.update = function (url) {\n\t\t\t_this.nextUrl = url;\n\t\t\t_this.setState({});\n\t\t}, _temp), _possibleConstructorReturn(_this, _ret);\n\t}\n\n\tMatch.prototype.componentDidMount = function componentDidMount() {\n\t\t_preactRouter.subscribers.push(this.update);\n\t};\n\n\tMatch.prototype.componentWillUnmount = function componentWillUnmount() {\n\t\t_preactRouter.subscribers.splice(_preactRouter.subscribers.indexOf(this.update) >>> 0, 1);\n\t};\n\n\tMatch.prototype.render = function render(props) {\n\t\tvar url = this.nextUrl || (0, _preactRouter.getCurrentUrl)(),\n\t\t path = url.replace(/\\?.+$/, '');\n\t\tthis.nextUrl = null;\n\t\treturn props.children({\n\t\t\turl: url,\n\t\t\tpath: path,\n\t\t\tmatches: (0, _preactRouter.exec)(path, props.path, {}) !== false\n\t\t});\n\t};\n\n\treturn Match;\n}(_preact.Component);\n\nvar Link = function Link(_ref) {\n\tvar activeClassName = _ref.activeClassName,\n\t path = _ref.path,\n\t props = _objectWithoutProperties(_ref, ['activeClassName', 'path']);\n\n\treturn (0, _preact.h)(\n\t\tMatch,\n\t\t{ path: path || props.href },\n\t\tfunction (_ref2) {\n\t\t\tvar matches = _ref2.matches;\n\t\t\treturn (0, _preact.h)(_preactRouter.Link, _extends({}, props, { 'class': [props.class || props.className, matches && activeClassName].filter(Boolean).join(' ') }));\n\t\t}\n\t);\n};\n\nexports.Link = Link;\nexports.default = Match;\n\nMatch.Link = Link;\n","module.exports = require(\"path\");","'use strict'\n\nfunction markdownSpace(code) {\n return code === -2 || code === -1 || code === 32\n}\n\nmodule.exports = markdownSpace\n","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('../tokenize/factory-space.js')\nvar partialBlankLine = require('../tokenize/partial-blank-line.js')\n\nvar tokenize = initializeDocument\nvar containerConstruct = {\n tokenize: tokenizeContainer\n}\nvar lazyFlowConstruct = {\n tokenize: tokenizeLazyFlow\n}\n\nfunction initializeDocument(effects) {\n var self = this\n var stack = []\n var continued = 0\n var inspectConstruct = {\n tokenize: tokenizeInspect,\n partial: true\n }\n var inspectResult\n var childFlow\n var childToken\n return start\n\n function start(code) {\n if (continued < stack.length) {\n self.containerState = stack[continued][1]\n return effects.attempt(\n stack[continued][0].continuation,\n documentContinue,\n documentContinued\n )(code)\n }\n\n return documentContinued(code)\n }\n\n function documentContinue(code) {\n continued++\n return start(code)\n }\n\n function documentContinued(code) {\n // If we’re in a concrete construct (such as when expecting another line of\n // HTML, or we resulted in lazy content), we can immediately start flow.\n if (inspectResult && inspectResult.flowContinue) {\n return flowStart(code)\n }\n\n self.interrupt =\n childFlow &&\n childFlow.currentConstruct &&\n childFlow.currentConstruct.interruptible\n self.containerState = {}\n return effects.attempt(\n containerConstruct,\n containerContinue,\n flowStart\n )(code)\n }\n\n function containerContinue(code) {\n stack.push([self.currentConstruct, self.containerState])\n self.containerState = undefined\n return documentContinued(code)\n }\n\n function flowStart(code) {\n if (code === null) {\n exitContainers(0, true)\n effects.consume(code)\n return\n }\n\n childFlow = childFlow || self.parser.flow(self.now())\n effects.enter('chunkFlow', {\n contentType: 'flow',\n previous: childToken,\n _tokenizer: childFlow\n })\n return flowContinue(code)\n }\n\n function flowContinue(code) {\n if (code === null) {\n continueFlow(effects.exit('chunkFlow'))\n return flowStart(code)\n }\n\n if (markdownLineEnding(code)) {\n effects.consume(code)\n continueFlow(effects.exit('chunkFlow'))\n return effects.check(inspectConstruct, documentAfterPeek)\n }\n\n effects.consume(code)\n return flowContinue\n }\n\n function documentAfterPeek(code) {\n exitContainers(\n inspectResult.continued,\n inspectResult && inspectResult.flowEnd\n )\n continued = 0\n return start(code)\n }\n\n function continueFlow(token) {\n if (childToken) childToken.next = token\n childToken = token\n childFlow.lazy = inspectResult && inspectResult.lazy\n childFlow.defineSkip(token.start)\n childFlow.write(self.sliceStream(token))\n }\n\n function exitContainers(size, end) {\n var index = stack.length // Close the flow.\n\n if (childFlow && end) {\n childFlow.write([null])\n childToken = childFlow = undefined\n } // Exit open containers.\n\n while (index-- > size) {\n self.containerState = stack[index][1]\n stack[index][0].exit.call(self, effects)\n }\n\n stack.length = size\n }\n\n function tokenizeInspect(effects, ok) {\n var subcontinued = 0\n inspectResult = {}\n return inspectStart\n\n function inspectStart(code) {\n if (subcontinued < stack.length) {\n self.containerState = stack[subcontinued][1]\n return effects.attempt(\n stack[subcontinued][0].continuation,\n inspectContinue,\n inspectLess\n )(code)\n } // If we’re continued but in a concrete flow, we can’t have more\n // containers.\n\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n inspectResult.flowContinue = true\n return inspectDone(code)\n }\n\n self.interrupt =\n childFlow.currentConstruct && childFlow.currentConstruct.interruptible\n self.containerState = {}\n return effects.attempt(\n containerConstruct,\n inspectFlowEnd,\n inspectDone\n )(code)\n }\n\n function inspectContinue(code) {\n subcontinued++\n return self.containerState._closeFlow\n ? inspectFlowEnd(code)\n : inspectStart(code)\n }\n\n function inspectLess(code) {\n if (childFlow.currentConstruct && childFlow.currentConstruct.lazy) {\n // Maybe another container?\n self.containerState = {}\n return effects.attempt(\n containerConstruct,\n inspectFlowEnd, // Maybe flow, or a blank line?\n effects.attempt(\n lazyFlowConstruct,\n inspectFlowEnd,\n effects.check(partialBlankLine, inspectFlowEnd, inspectLazy)\n )\n )(code)\n } // Otherwise we’re interrupting.\n\n return inspectFlowEnd(code)\n }\n\n function inspectLazy(code) {\n // Act as if all containers are continued.\n subcontinued = stack.length\n inspectResult.lazy = true\n inspectResult.flowContinue = true\n return inspectDone(code)\n } // We’re done with flow if we have more containers, or an interruption.\n\n function inspectFlowEnd(code) {\n inspectResult.flowEnd = true\n return inspectDone(code)\n }\n\n function inspectDone(code) {\n inspectResult.continued = subcontinued\n self.interrupt = self.containerState = undefined\n return ok(code)\n }\n }\n}\n\nfunction tokenizeContainer(effects, ok, nok) {\n return factorySpace(\n effects,\n effects.attempt(this.parser.constructs.document, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )\n}\n\nfunction tokenizeLazyFlow(effects, ok, nok) {\n return factorySpace(\n effects,\n effects.lazy(this.parser.constructs.flow, ok, nok),\n 'linePrefix',\n this.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )\n}\n\nexports.tokenize = tokenize\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\n\nvar hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n}\n\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('hardBreakEscape')\n effects.enter('escapeMarker')\n effects.consume(code)\n return open\n }\n\n function open(code) {\n if (markdownLineEnding(code)) {\n effects.exit('escapeMarker')\n effects.exit('hardBreakEscape')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = hardBreakEscape\n","'use strict'\n\n// This module is copied from .\nvar raws = ['pre', 'script', 'style', 'textarea']\n\nmodule.exports = raws\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\nvar prefixSize = require('../util/prefix-size.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\n\nvar codeFenced = {\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced,\n concrete: true\n}\n\nfunction tokenizeCodeFenced(effects, ok, nok) {\n var self = this\n var closingFenceConstruct = {\n tokenize: tokenizeClosingFence,\n partial: true\n }\n var initialPrefix = prefixSize(this.events, 'linePrefix')\n var sizeOpen = 0\n var marker\n return start\n\n function start(code) {\n effects.enter('codeFenced')\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n marker = code\n return sequenceOpen(code)\n }\n\n function sequenceOpen(code) {\n if (code === marker) {\n effects.consume(code)\n sizeOpen++\n return sequenceOpen\n }\n\n effects.exit('codeFencedFenceSequence')\n return sizeOpen < 3\n ? nok(code)\n : factorySpace(effects, infoOpen, 'whitespace')(code)\n }\n\n function infoOpen(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code)\n }\n\n effects.enter('codeFencedFenceInfo')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return info(code)\n }\n\n function info(code) {\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceInfo')\n return factorySpace(effects, infoAfter, 'whitespace')(code)\n }\n\n if (code === 96 && code === marker) return nok(code)\n effects.consume(code)\n return info\n }\n\n function infoAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n return openAfter(code)\n }\n\n effects.enter('codeFencedFenceMeta')\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return meta(code)\n }\n\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n effects.exit('codeFencedFenceMeta')\n return openAfter(code)\n }\n\n if (code === 96 && code === marker) return nok(code)\n effects.consume(code)\n return meta\n }\n\n function openAfter(code) {\n effects.exit('codeFencedFence')\n return self.interrupt ? ok(code) : content(code)\n }\n\n function content(code) {\n if (code === null) {\n return after(code)\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return effects.attempt(\n closingFenceConstruct,\n after,\n initialPrefix\n ? factorySpace(effects, content, 'linePrefix', initialPrefix + 1)\n : content\n )\n }\n\n effects.enter('codeFlowValue')\n return contentContinue(code)\n }\n\n function contentContinue(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return content(code)\n }\n\n effects.consume(code)\n return contentContinue\n }\n\n function after(code) {\n effects.exit('codeFenced')\n return ok(code)\n }\n\n function tokenizeClosingFence(effects, ok, nok) {\n var size = 0\n return factorySpace(\n effects,\n closingSequenceStart,\n 'linePrefix',\n this.parser.constructs.disable.null.indexOf('codeIndented') > -1\n ? undefined\n : 4\n )\n\n function closingSequenceStart(code) {\n effects.enter('codeFencedFence')\n effects.enter('codeFencedFenceSequence')\n return closingSequence(code)\n }\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return closingSequence\n }\n\n if (size < sizeOpen) return nok(code)\n effects.exit('codeFencedFenceSequence')\n return factorySpace(effects, closingSequenceEnd, 'whitespace')(code)\n }\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFencedFence')\n return ok(code)\n }\n\n return nok(code)\n }\n }\n}\n\nmodule.exports = codeFenced\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"textarea\":\"textarea__1UKFm\"};","'use strict'\n\nvar chunkedSplice = require('../util/chunked-splice.js')\nvar chunkedPush = require('../util/chunked-push.js')\nvar normalizeIdentifier = require('../util/normalize-identifier.js')\nvar shallow = require('../util/shallow.js')\nvar resolveAll = require('../util/resolve-all.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar factoryDestination = require('./factory-destination.js')\nvar factoryLabel = require('./factory-label.js')\nvar factoryWhitespace = require('./factory-whitespace.js')\nvar factoryTitle = require('./factory-title.js')\n\nvar labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\nvar resourceConstruct = {\n tokenize: tokenizeResource\n}\nvar fullReferenceConstruct = {\n tokenize: tokenizeFullReference\n}\nvar collapsedReferenceConstruct = {\n tokenize: tokenizeCollapsedReference\n}\n\nfunction resolveAllLabelEnd(events) {\n var index = -1\n var token\n\n while (++index < events.length) {\n token = events[index][1]\n\n if (\n !token._used &&\n (token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd')\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n\n return events\n}\n\nfunction resolveToLabelEnd(events, context) {\n var index = events.length\n var offset = 0\n var group\n var label\n var text\n var token\n var open\n var close\n var media // Find an opening.\n\n while (index--) {\n token = events[index][1]\n\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n } // Mark other link openings as inactive, as we can’t have links in\n // links.\n\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n\n group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: shallow(events[open][1].start),\n end: shallow(events[events.length - 1][1].end)\n }\n label = {\n type: 'label',\n start: shallow(events[open][1].start),\n end: shallow(events[close][1].end)\n }\n text = {\n type: 'labelText',\n start: shallow(events[open + offset + 2][1].end),\n end: shallow(events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ] // Opening marker.\n\n media = chunkedPush(media, events.slice(open + 1, open + offset + 3)) // Text open.\n\n media = chunkedPush(media, [['enter', text, context]]) // Between.\n\n media = chunkedPush(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n ) // Text close, marker close, label close.\n\n media = chunkedPush(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ]) // Reference, resource, or so.\n\n media = chunkedPush(media, events.slice(close + 1)) // Media close.\n\n media = chunkedPush(media, [['exit', group, context]])\n chunkedSplice(events, open, events.length, media)\n return events\n}\n\nfunction tokenizeLabelEnd(effects, ok, nok) {\n var self = this\n var index = self.events.length\n var labelStart\n var defined // Find an opening.\n\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n\n return start\n\n function start(code) {\n if (!labelStart) {\n return nok(code)\n } // It’s a balanced bracket, but contains a link.\n\n if (labelStart._inactive) return balanced(code)\n defined =\n self.parser.defined.indexOf(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n ) > -1\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return afterLabelEnd\n }\n\n function afterLabelEnd(code) {\n // Resource: `[asd](fgh)`.\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n ok,\n defined ? ok : balanced\n )(code)\n } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?\n\n if (code === 91) {\n return effects.attempt(\n fullReferenceConstruct,\n ok,\n defined\n ? effects.attempt(collapsedReferenceConstruct, ok, balanced)\n : balanced\n )(code)\n } // Shortcut reference: `[asd]`?\n\n return defined ? ok(code) : balanced(code)\n }\n\n function balanced(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\nfunction tokenizeResource(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return factoryWhitespace(effects, open)\n }\n\n function open(code) {\n if (code === 41) {\n return end(code)\n }\n\n return factoryDestination(\n effects,\n destinationAfter,\n nok,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 3\n )(code)\n }\n\n function destinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, between)(code)\n : end(code)\n }\n\n function between(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n factoryWhitespace(effects, end),\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n\n return end(code)\n }\n\n function end(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeFullReference(effects, ok, nok) {\n var self = this\n return start\n\n function start(code) {\n return factoryLabel.call(\n self,\n effects,\n afterLabel,\n nok,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n function afterLabel(code) {\n return self.parser.defined.indexOf(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n ) < 0\n ? nok(code)\n : ok(code)\n }\n}\n\nfunction tokenizeCollapsedReference(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return open\n }\n\n function open(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = labelEnd\n","'use strict'\n\nvar stringify = require('unist-util-stringify-position')\n\nmodule.exports = VMessage\n\n// Inherit from `Error#`.\nfunction VMessagePrototype() {}\nVMessagePrototype.prototype = Error.prototype\nVMessage.prototype = new VMessagePrototype()\n\n// Message properties.\nvar proto = VMessage.prototype\n\nproto.file = ''\nproto.name = ''\nproto.reason = ''\nproto.message = ''\nproto.stack = ''\nproto.fatal = null\nproto.column = null\nproto.line = null\n\n// Construct a new VMessage.\n//\n// Note: We cannot invoke `Error` on the created context, as that adds readonly\n// `line` and `column` attributes on Safari 9, thus throwing and failing the\n// data.\nfunction VMessage(reason, position, origin) {\n var parts\n var range\n var location\n\n if (typeof position === 'string') {\n origin = position\n position = null\n }\n\n parts = parseOrigin(origin)\n range = stringify(position) || '1:1'\n\n location = {\n start: {line: null, column: null},\n end: {line: null, column: null}\n }\n\n // Node.\n if (position && position.position) {\n position = position.position\n }\n\n if (position) {\n // Position.\n if (position.start) {\n location = position\n position = position.start\n } else {\n // Point.\n location.start = position\n }\n }\n\n if (reason.stack) {\n this.stack = reason.stack\n reason = reason.message\n }\n\n this.message = reason\n this.name = range\n this.reason = reason\n this.line = position ? position.line : null\n this.column = position ? position.column : null\n this.location = location\n this.source = parts[0]\n this.ruleId = parts[1]\n}\n\nfunction parseOrigin(origin) {\n var result = [null, null]\n var index\n\n if (typeof origin === 'string') {\n index = origin.indexOf(':')\n\n if (index === -1) {\n result[1] = origin\n } else {\n result[0] = origin.slice(0, index)\n result[1] = origin.slice(index + 1)\n }\n }\n\n return result\n}\n","var visitWithParents = require('unist-util-visit-parents');\n\nfunction addListMetadata() {\n return function (ast) {\n visitWithParents(ast, 'list', function (listNode, parents) {\n var depth = 0, i, n;\n for (i = 0, n = parents.length; i < n; i++) {\n if (parents[i].type === 'list') depth += 1;\n }\n for (i = 0, n = listNode.children.length; i < n; i++) {\n var child = listNode.children[i];\n child.index = i;\n child.ordered = listNode.ordered;\n }\n listNode.depth = depth;\n });\n return ast;\n };\n}\n\nmodule.exports = addListMetadata;\n","'use strict'\n\nvar assign = require('../constant/assign.js')\nvar chunkedSplice = require('./chunked-splice.js')\nvar chunkedPush = require('./chunked-push.js')\nvar miniflat = require('./miniflat.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar shallow = require('./shallow.js')\nvar resolveAll = require('./resolve-all.js')\nvar serializeChunks = require('./serialize-chunks.js')\nvar sliceChunks = require('./slice-chunks.js')\n\n// Create a tokenizer.\n// Tokenizers deal with one type of data (e.g., containers, flow, text).\n// The parser is the object dealing with it all.\n// `initialize` works like other constructs, except that only its `tokenize`\n// function is used, in which case it doesn’t receive an `ok` or `nok`.\n// `from` can be given to set the point before the first character, although\n// when further lines are indented, they must be set with `defineSkip`.\nfunction createTokenizer(parser, initialize, from) {\n var point = from\n ? shallow(from)\n : {\n line: 1,\n column: 1,\n offset: 0\n }\n var columnStart = {}\n var resolveAllConstructs = []\n var chunks = []\n var stack = []\n\n var effects = {\n consume: consume,\n enter: enter,\n exit: exit,\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n }),\n lazy: constructFactory(onsuccessfulcheck, {\n lazy: true\n })\n } // State and tools for resolving and serializing.\n\n var context = {\n previous: null,\n events: [],\n parser: parser,\n sliceStream: sliceStream,\n sliceSerialize: sliceSerialize,\n now: now,\n defineSkip: skip,\n write: write\n } // The state function.\n\n var state = initialize.tokenize.call(context, effects) // Track which character we expect to be consumed, to catch bugs.\n\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize)\n } // Store where we are in the input stream.\n\n point._index = 0\n point._bufferIndex = -1\n return context\n\n function write(slice) {\n chunks = chunkedPush(chunks, slice)\n main() // Exit if we’re not done, resolve might change stuff.\n\n if (chunks[chunks.length - 1] !== null) {\n return []\n }\n\n addResult(initialize, 0) // Otherwise, resolve, and exit.\n\n context.events = resolveAll(resolveAllConstructs, context.events, context)\n return context.events\n } //\n // Tools.\n //\n\n function sliceSerialize(token) {\n return serializeChunks(sliceStream(token))\n }\n\n function sliceStream(token) {\n return sliceChunks(chunks, token)\n }\n\n function now() {\n return shallow(point)\n }\n\n function skip(value) {\n columnStart[value.line] = value.column\n accountForPotentialSkip()\n } //\n // State management.\n //\n // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n // `consume`).\n // Here is where we walk through the chunks, which either include strings of\n // several characters, or numerical character codes.\n // The reason to do this in a loop instead of a call is so the stack can\n // drain.\n\n function main() {\n var chunkIndex\n var chunk\n\n while (point._index < chunks.length) {\n chunk = chunks[point._index] // If we’re in a buffer chunk, loop through it.\n\n if (typeof chunk === 'string') {\n chunkIndex = point._index\n\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0\n }\n\n while (\n point._index === chunkIndex &&\n point._bufferIndex < chunk.length\n ) {\n go(chunk.charCodeAt(point._bufferIndex))\n }\n } else {\n go(chunk)\n }\n }\n } // Deal with one code.\n\n function go(code) {\n state = state(code)\n } // Move a character forward.\n\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++\n point.column = 1\n point.offset += code === -3 ? 2 : 1\n accountForPotentialSkip()\n } else if (code !== -1) {\n point.column++\n point.offset++\n } // Not in a string chunk.\n\n if (point._bufferIndex < 0) {\n point._index++\n } else {\n point._bufferIndex++ // At end of string chunk.\n\n if (point._bufferIndex === chunks[point._index].length) {\n point._bufferIndex = -1\n point._index++\n }\n } // Expose the previous character.\n\n context.previous = code // Mark as consumed.\n } // Start a token.\n\n function enter(type, fields) {\n var token = fields || {}\n token.type = type\n token.start = now()\n context.events.push(['enter', token, context])\n stack.push(token)\n return token\n } // Stop a token.\n\n function exit(type) {\n var token = stack.pop()\n token.end = now()\n context.events.push(['exit', token, context])\n return token\n } // Use results.\n\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from)\n } // Discard results.\n\n function onsuccessfulcheck(construct, info) {\n info.restore()\n } // Factory to attempt/check/interrupt.\n\n function constructFactory(onreturn, fields) {\n return hook // Handle either an object mapping codes to constructs, a list of\n // constructs, or a single construct.\n\n function hook(constructs, returnState, bogusState) {\n var listOfConstructs\n var constructIndex\n var currentConstruct\n var info\n return constructs.tokenize || 'length' in constructs\n ? handleListOfConstructs(miniflat(constructs))\n : handleMapOfConstructs\n\n function handleMapOfConstructs(code) {\n if (code in constructs || null in constructs) {\n return handleListOfConstructs(\n constructs.null\n ? /* c8 ignore next */\n miniflat(constructs[code]).concat(miniflat(constructs.null))\n : constructs[code]\n )(code)\n }\n\n return bogusState(code)\n }\n\n function handleListOfConstructs(list) {\n listOfConstructs = list\n constructIndex = 0\n return handleConstruct(list[constructIndex])\n }\n\n function handleConstruct(construct) {\n return start\n\n function start(code) {\n // To do: not nede to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store()\n currentConstruct = construct\n\n if (!construct.partial) {\n context.currentConstruct = construct\n }\n\n if (\n construct.name &&\n context.parser.constructs.disable.null.indexOf(construct.name) > -1\n ) {\n return nok()\n }\n\n return construct.tokenize.call(\n fields ? assign({}, context, fields) : context,\n effects,\n ok,\n nok\n )(code)\n }\n }\n\n function ok(code) {\n onreturn(currentConstruct, info)\n return returnState\n }\n\n function nok(code) {\n info.restore()\n\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex])\n }\n\n return bogusState\n }\n }\n }\n\n function addResult(construct, from) {\n if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) {\n resolveAllConstructs.push(construct)\n }\n\n if (construct.resolve) {\n chunkedSplice(\n context.events,\n from,\n context.events.length - from,\n construct.resolve(context.events.slice(from), context)\n )\n }\n\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context)\n }\n }\n\n function store() {\n var startPoint = now()\n var startPrevious = context.previous\n var startCurrentConstruct = context.currentConstruct\n var startEventsIndex = context.events.length\n var startStack = Array.from(stack)\n return {\n restore: restore,\n from: startEventsIndex\n }\n\n function restore() {\n point = startPoint\n context.previous = startPrevious\n context.currentConstruct = startCurrentConstruct\n context.events.length = startEventsIndex\n stack = startStack\n accountForPotentialSkip()\n }\n }\n\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line]\n point.offset += columnStart[point.line] - 1\n }\n }\n}\n\nmodule.exports = createTokenizer\n","'use strict'\n\nvar chunkedSplice = require('../util/chunked-splice.js')\nvar chunkedPush = require('../util/chunked-push.js')\nvar shallow = require('../util/shallow.js')\nvar resolveAll = require('../util/resolve-all.js')\nvar classifyCharacter = require('../util/classify-character.js')\nvar movePoint = require('../util/move-point.js')\n\nvar attention = {\n name: 'attention',\n tokenize: tokenizeAttention,\n resolveAll: resolveAllAttention\n}\n\nfunction resolveAllAttention(events, context) {\n var index = -1\n var open\n var group\n var text\n var openingSequence\n var closingSequence\n var use\n var nextEvents\n var offset // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n\n while (++index < events.length) {\n // Find a token that can close.\n if (\n events[index][0] === 'enter' &&\n events[index][1].type === 'attentionSequence' &&\n events[index][1]._close\n ) {\n open = index // Now walk back to find an opener.\n\n while (open--) {\n // Find a token that can open the closer.\n if (\n events[open][0] === 'exit' &&\n events[open][1].type === 'attentionSequence' &&\n events[open][1]._open && // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) ===\n context.sliceSerialize(events[index][1]).charCodeAt(0)\n ) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if (\n (events[open][1]._close || events[index][1]._open) &&\n (events[index][1].end.offset - events[index][1].start.offset) % 3 &&\n !(\n (events[open][1].end.offset -\n events[open][1].start.offset +\n events[index][1].end.offset -\n events[index][1].start.offset) %\n 3\n )\n ) {\n continue\n } // Number of markers to use from the sequence.\n\n use =\n events[open][1].end.offset - events[open][1].start.offset > 1 &&\n events[index][1].end.offset - events[index][1].start.offset > 1\n ? 2\n : 1\n openingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: movePoint(shallow(events[open][1].end), -use),\n end: shallow(events[open][1].end)\n }\n closingSequence = {\n type: use > 1 ? 'strongSequence' : 'emphasisSequence',\n start: shallow(events[index][1].start),\n end: movePoint(shallow(events[index][1].start), use)\n }\n text = {\n type: use > 1 ? 'strongText' : 'emphasisText',\n start: shallow(events[open][1].end),\n end: shallow(events[index][1].start)\n }\n group = {\n type: use > 1 ? 'strong' : 'emphasis',\n start: shallow(openingSequence.start),\n end: shallow(closingSequence.end)\n }\n events[open][1].end = shallow(openingSequence.start)\n events[index][1].start = shallow(closingSequence.end)\n nextEvents = [] // If there are more markers in the opening, add them before.\n\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = chunkedPush(nextEvents, [\n ['enter', events[open][1], context],\n ['exit', events[open][1], context]\n ])\n } // Opening.\n\n nextEvents = chunkedPush(nextEvents, [\n ['enter', group, context],\n ['enter', openingSequence, context],\n ['exit', openingSequence, context],\n ['enter', text, context]\n ]) // Between.\n\n nextEvents = chunkedPush(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n ) // Closing.\n\n nextEvents = chunkedPush(nextEvents, [\n ['exit', text, context],\n ['enter', closingSequence, context],\n ['exit', closingSequence, context],\n ['exit', group, context]\n ]) // If there are more markers in the closing, add them after.\n\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2\n nextEvents = chunkedPush(nextEvents, [\n ['enter', events[index][1], context],\n ['exit', events[index][1], context]\n ])\n } else {\n offset = 0\n }\n\n chunkedSplice(events, open - 1, index - open + 3, nextEvents)\n index = open + nextEvents.length - offset - 2\n break\n }\n }\n }\n } // Remove remaining sequences.\n\n index = -1\n\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data'\n }\n }\n\n return events\n}\n\nfunction tokenizeAttention(effects, ok) {\n var before = classifyCharacter(this.previous)\n var marker\n return start\n\n function start(code) {\n effects.enter('attentionSequence')\n marker = code\n return sequence(code)\n }\n\n function sequence(code) {\n var token\n var after\n var open\n var close\n\n if (code === marker) {\n effects.consume(code)\n return sequence\n }\n\n token = effects.exit('attentionSequence')\n after = classifyCharacter(code)\n open = !after || (after === 2 && before)\n close = !before || (before === 2 && after)\n token._open = marker === 42 ? open : open && (before || !close)\n token._close = marker === 42 ? close : close && (after || !open)\n return ok(code)\n }\n}\n\nmodule.exports = attention\n","'use strict'\n\nvar bail = require('bail')\nvar buffer = require('is-buffer')\nvar extend = require('extend')\nvar plain = require('is-plain-obj')\nvar trough = require('trough')\nvar vfile = require('vfile')\n\n// Expose a frozen processor.\nmodule.exports = unified().freeze()\n\nvar slice = [].slice\nvar own = {}.hasOwnProperty\n\n// Process pipeline.\nvar pipeline = trough()\n .use(pipelineParse)\n .use(pipelineRun)\n .use(pipelineStringify)\n\nfunction pipelineParse(p, ctx) {\n ctx.tree = p.parse(ctx.file)\n}\n\nfunction pipelineRun(p, ctx, next) {\n p.run(ctx.tree, ctx.file, done)\n\n function done(err, tree, file) {\n if (err) {\n next(err)\n } else {\n ctx.tree = tree\n ctx.file = file\n next()\n }\n }\n}\n\nfunction pipelineStringify(p, ctx) {\n var result = p.stringify(ctx.tree, ctx.file)\n var file = ctx.file\n\n if (result === undefined || result === null) {\n // Empty.\n } else if (typeof result === 'string' || buffer(result)) {\n file.contents = result\n } else {\n file.result = result\n }\n}\n\n// Function to create the first processor.\nfunction unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}\n\n// Check if `value` is a constructor.\nfunction newable(value, name) {\n return (\n typeof value === 'function' &&\n value.prototype &&\n // A function with keys in its prototype is probably a constructor.\n // Classes’ prototype methods are not enumerable, so we check if some value\n // exists in the prototype.\n (keys(value.prototype) || name in value.prototype)\n )\n}\n\n// Check if `value` is an object with keys.\nfunction keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}\n\n// Assert a parser is available.\nfunction assertParser(name, Parser) {\n if (typeof Parser !== 'function') {\n throw new Error('Cannot `' + name + '` without `Parser`')\n }\n}\n\n// Assert a compiler is available.\nfunction assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}\n\n// Assert the processor is not frozen.\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n// Assert `node` is a unist node.\nfunction assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}\n\n// Assert that `complete` is `true`.\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n","'use strict'\n\nvar chunkedSplice = require('./chunked-splice.js')\n\nfunction chunkedPush(list, items) {\n if (list.length) {\n chunkedSplice(list, list.length, 0, items)\n return list\n }\n\n return items\n}\n\nmodule.exports = chunkedPush\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict'\n\nvar own = {}.hasOwnProperty\n\nmodule.exports = own\n","'use strict'\n\nvar chunkedSplice = require('../util/chunked-splice.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\nvar prefixSize = require('../util/prefix-size.js')\n\nvar codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented,\n resolve: resolveCodeIndented\n}\nvar indentedContentConstruct = {\n tokenize: tokenizeIndentedContent,\n partial: true\n}\n\nfunction resolveCodeIndented(events, context) {\n var code = {\n type: 'codeIndented',\n start: events[0][1].start,\n end: events[events.length - 1][1].end\n }\n chunkedSplice(events, 0, 0, [['enter', code, context]])\n chunkedSplice(events, events.length, 0, [['exit', code, context]])\n return events\n}\n\nfunction tokenizeCodeIndented(effects, ok, nok) {\n return effects.attempt(indentedContentConstruct, afterPrefix, nok)\n\n function afterPrefix(code) {\n if (code === null) {\n return ok(code)\n }\n\n if (markdownLineEnding(code)) {\n return effects.attempt(indentedContentConstruct, afterPrefix, ok)(code)\n }\n\n effects.enter('codeFlowValue')\n return content(code)\n }\n\n function content(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('codeFlowValue')\n return afterPrefix(code)\n }\n\n effects.consume(code)\n return content\n }\n}\n\nfunction tokenizeIndentedContent(effects, ok, nok) {\n var self = this\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)\n\n function afterPrefix(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)\n }\n\n return prefixSize(self.events, 'linePrefix') < 4 ? nok(code) : ok(code)\n }\n}\n\nmodule.exports = codeIndented\n","'use strict'\n\nmodule.exports = parse\n\nvar fromMarkdown = require('mdast-util-from-markdown')\n\nfunction parse(options) {\n var self = this\n\n this.Parser = parse\n\n function parse(doc) {\n return fromMarkdown(\n doc,\n Object.assign({}, self.data('settings'), options, {\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n )\n }\n}\n","'use strict'\n\n// Note: EOF is seen as ASCII control here, because `null < 32 == true`.\nfunction asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code < 32 || code === 127\n )\n}\n\nmodule.exports = asciiControl\n","'use strict'\n\nvar own = {}.hasOwnProperty\n\nmodule.exports = stringify\n\nfunction stringify(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if (own.call(value, 'position') || own.call(value, 'type')) {\n return position(value.position)\n }\n\n // Position.\n if (own.call(value, 'start') || own.call(value, 'end')) {\n return position(value)\n }\n\n // Point.\n if (own.call(value, 'line') || own.call(value, 'column')) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\nfunction point(point) {\n if (!point || typeof point !== 'object') {\n point = {}\n }\n\n return index(point.line) + ':' + index(point.column)\n}\n\nfunction position(pos) {\n if (!pos || typeof pos !== 'object') {\n pos = {}\n }\n\n return point(pos.start) + '-' + point(pos.end)\n}\n\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\nvar shallow = require('../util/shallow.js')\n\nvar setextUnderline = {\n name: 'setextUnderline',\n tokenize: tokenizeSetextUnderline,\n resolveTo: resolveToSetextUnderline\n}\n\nfunction resolveToSetextUnderline(events, context) {\n var index = events.length\n var content\n var text\n var definition\n var heading // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === 'content') {\n content = index\n break\n }\n\n if (events[index][1].type === 'paragraph') {\n text = index\n }\n } // Exit\n else {\n if (events[index][1].type === 'content') {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1)\n }\n\n if (!definition && events[index][1].type === 'definition') {\n definition = index\n }\n }\n }\n\n heading = {\n type: 'setextHeading',\n start: shallow(events[text][1].start),\n end: shallow(events[events.length - 1][1].end)\n } // Change the paragraph to setext heading text.\n\n events[text][1].type = 'setextHeadingText' // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n\n if (definition) {\n events.splice(text, 0, ['enter', heading, context])\n events.splice(definition + 1, 0, ['exit', events[content][1], context])\n events[content][1].end = shallow(events[definition][1].end)\n } else {\n events[content][1] = heading\n } // Add the heading exit at the end.\n\n events.push(['exit', heading, context])\n return events\n}\n\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n var self = this\n var index = self.events.length\n var marker\n var paragraph // Find an opening.\n\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (\n self.events[index][1].type !== 'lineEnding' &&\n self.events[index][1].type !== 'linePrefix' &&\n self.events[index][1].type !== 'content'\n ) {\n paragraph = self.events[index][1].type === 'paragraph'\n break\n }\n }\n\n return start\n\n function start(code) {\n if (!self.lazy && (self.interrupt || paragraph)) {\n effects.enter('setextHeadingLine')\n effects.enter('setextHeadingLineSequence')\n marker = code\n return closingSequence(code)\n }\n\n return nok(code)\n }\n\n function closingSequence(code) {\n if (code === marker) {\n effects.consume(code)\n return closingSequence\n }\n\n effects.exit('setextHeadingLineSequence')\n return factorySpace(effects, closingSequenceEnd, 'lineSuffix')(code)\n }\n\n function closingSequenceEnd(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('setextHeadingLine')\n return ok(code)\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = setextUnderline\n","'use strict'\n\nvar labelEnd = require('./label-end.js')\n\nvar labelStartImage = {\n name: 'labelStartImage',\n tokenize: tokenizeLabelStartImage,\n resolveAll: labelEnd.resolveAll\n}\n\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n var self = this\n return start\n\n function start(code) {\n effects.enter('labelImage')\n effects.enter('labelImageMarker')\n effects.consume(code)\n effects.exit('labelImageMarker')\n return open\n }\n\n function open(code) {\n if (code === 91) {\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelImage')\n return after\n }\n\n return nok(code)\n }\n\n function after(code) {\n /* c8 ignore next */\n return code === 94 &&\n /* c8 ignore next */\n '_hiddenFootnoteSupport' in self.parser.constructs\n ? /* c8 ignore next */\n nok(code)\n : ok(code)\n }\n}\n\nmodule.exports = labelStartImage\n","'use strict'\n\nvar subtokenize = require('./util/subtokenize.js')\n\nfunction postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n\n return events\n}\n\nmodule.exports = postprocess\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/sw-esm.js b/docs/sw-esm.js index a5c7dd0..c94552d 100644 --- a/docs/sw-esm.js +++ b/docs/sw-esm.js @@ -1,2 +1,2 @@ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(t){return e[t]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="p5Qz")}({"2Gk3":function(){"use strict";try{self["workbox:cacheable-response:5.1.4"]&&_()}catch(e){}},Gpc1:function(){"use strict";try{self["workbox:precaching:5.1.4"]&&_()}catch(e){}},I3Xu:function(){"use strict";try{self["workbox:routing:5.1.4"]&&_()}catch(e){}},myed:function(){"use strict";try{self["workbox:strategies:5.1.4"]&&_()}catch(e){}},p5Qz:function(e,t,r){"use strict";function n(e){var t="function"==typeof Map?new Map:void 0;return(n=function(e){function r(){return o(e,arguments,c(this).constructor)}if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function o(){return(o=i()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&u(o,r.prototype),o}).apply(null,arguments)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(self.addEventListener("install",ae),self.addEventListener("activate",le))}(e),U(t)}function x(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),o=1;o0&&(t+=" :: "+JSON.stringify(n)),t},E=function(e){function t(t,r){var n,o=M(t,r);return(n=e.call(this,o)||this).name=t,n.details=r,n}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(n(Error)),N=(r("I3Xu"),function(e){return e&&"object"==typeof e?e:{handle:e}}),k=function(e,t,r){void 0===r&&(r="GET"),this.handler=N(t),this.match=e,this.method=r},W=function(e){function t(t,r,n){return e.call(this,(function(e){var r=e.url,n=t.exec(r.href);if(n&&(r.origin===location.origin||0===n.index))return n.slice(1)}),r,n)||this}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(k),F=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),"")},H=function(){function e(){this._routes=new Map}var t,r,n,o=e.prototype;return o.addFetchListener=function(){var e=this;self.addEventListener("fetch",(function(t){var r=e.handleRequest({request:t.request,event:t});r&&t.respondWith(r)}))},o.addCacheListener=function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){0;var r=Promise.all(t.data.payload.urlsToCache.map((function(t){"string"==typeof t&&(t=[t]);var r=l(Request,t);return e.handleRequest({request:r})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))},o.handleRequest=function(e){var t=this,r=e.request,n=e.event;var o=new URL(r.url,location.href);if(o.protocol.startsWith("http")){var i=this.findMatchingRoute({url:o,request:r,event:n}),u=i.params,c=i.route,s=c&&c.handler;if(!s&&this._defaultHandler&&(s=this._defaultHandler),s){var a;0;try{a=s.handle({url:o,request:r,event:n,params:u})}catch(e){a=Promise.reject(e)}return a instanceof Promise&&this._catchHandler&&(a=a.catch((function(){return t._catchHandler.handle({url:o,request:r,event:n})}))),a}}},o.findMatchingRoute=function(e){var t=e.url,r=e.request,n=e.event;for(var o,i=s(this._routes.get(r.method)||[]);!(o=i()).done;){var u=o.value,c=void 0,a=u.match({url:t,request:r,event:n});if(a)return c=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(c=void 0),{route:u,params:c}}return{}},o.setDefaultHandler=function(e){this._defaultHandler=N(e)},o.setCatchHandler=function(e){this._catchHandler=N(e)},o.registerRoute=function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)},o.unregisterRoute=function(e){if(!this._routes.has(e.method))throw new E("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new E("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)},t=e,(r=[{key:"routes",get:function(){return this._routes}}])&&d(t.prototype,r),n&&d(t,n),e}(),D=function(){return L||((L=new H).addFetchListener(),L.addCacheListener()),L},B=(r("Gpc1"),[]),$=function(){return B},G={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},X=function(e){return[G.prefix,e,G.suffix].filter((function(e){return e&&e.length>0})).join("-")},Q=function(e){return e||X(G.googleAnalytics)},z=function(e){return e||X(G.precache)},J=function(){return G.prefix},V=function(e){return e||X(G.runtime)},Y=function(){return G.suffix},Z=new Set,ee=function(e,t){return e.filter((function(e){return t in e}))},te=function(e){return new Promise((function(t,r){function n(){return(h=l()).done?[1]:(f=h.value,Promise.resolve(f.cacheKeyWillBeUsed.call(f,{mode:u,request:a})).then((function(e){try{return"string"==typeof(a=e)&&(a=new Request(a)),n}catch(e){return r(e)}}),r))}function o(){return t(a)}var i,u,c,s,a,l,h,f,d;return i=e.request,u=e.mode,s=ee(void 0===(c=e.plugins)?[]:c,"cacheKeyWillBeUsed"),a=i,l=v(s),(d=function(e){for(;e;){if(e.then)return void e.then(d,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n)}))},re=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p;return n=e.cacheName,o=e.request,i=e.event,u=e.matchOptions,s=void 0===(c=e.plugins)?[]:c,Promise.resolve(self.caches.open(n)).then(function(e){try{return a=e,Promise.resolve(te({plugins:s,request:o,mode:"read"})).then(function(e){try{return l=e,Promise.resolve(a.match(l,u)).then(function(e){try{{var o;function c(){if((d=f()).done)return[1];{if("cachedResponseWillBeUsed"in(p=d.value))return Promise.resolve(p.cachedResponseWillBeUsed.call(p,{cacheName:n,event:i,matchOptions:u,cachedResponse:h,request:l})).then(function(t){try{return h=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);function e(){return c}return e.call(this)}}return h=e,f=v(s),(o=function(e){for(;e;){if(e.then)return void e.then(o,r);try{if(e.pop){if(e.length)return e.pop()?a.call(this):e;e=c}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c);function a(){return t(h)}}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}))},ne=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,y,m,g;return n=e.cacheName,o=e.response,i=e.event,c=void 0===(u=e.plugins)?[]:u,s=e.matchOptions,Promise.resolve(te({plugins:c,request:e.request,mode:"write"})).then(function(e){try{return a=e,o?Promise.resolve((u={event:i,plugins:c,response:o,request:a},new Promise((function(e,t){function r(){if((h=l()).done)return[1];{if("cacheWillUpdate"in(f=h.value))return a=!0,Promise.resolve(f.cacheWillUpdate.call(f,{request:o,response:s,event:i})).then(function(r){try{return(s=r)?e.call(this):[1]}catch(e){return t(e)}}.bind(this),t);function e(){return r}return e.call(this)}}function n(){return a||(s=s&&200===s.status?s:void 0),e(s||null)}var o,i,c,s,a,l,h,f,d;return o=u.request,i=u.event,s=u.response,a=!1,l=v(void 0===(c=u.plugins)?[]:c),(d=function(e){for(;e;){if(e.then)return void e.then(d,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)})))).then(function(e){try{return(l=e)?Promise.resolve(self.caches.open(n)).then(function(e){try{return h=e,f=ee(c,"cacheDidUpdate"),Promise.resolve(new Promise((function(e,t){return f.length>0?Promise.resolve(re({cacheName:n,matchOptions:s,request:a})).then(e,t):e(null)}))).then(function(e){try{d=e;var o=function(e){try{if("QuotaExceededError"===e.name)return Promise.resolve(new Promise((function(e,t){function r(){return(i=o()).done?[1]:Promise.resolve((0,i.value)()).then((function(){try{return r}catch(e){return t(e)}}),t)}function n(){return e()}var o,i,u;return o=p(Z),(u=function(e){for(;e;){if(e.then)return void e.then(u,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)}))).then(function(){try{return t.call(this)}catch(e){return r(e)}}.bind(this),r);function t(){throw e}return t.call(this)}catch(e){return r(e)}}.bind(this);try{return Promise.resolve(h.put(a,l)).then((function(){try{return function(){try{var e;function o(){return(m=y()).done?[1]:(g=m.value,Promise.resolve(g.cacheDidUpdate.call(g,{cacheName:n,event:i,oldResponse:d,newResponse:l,request:a})).then((function(){try{return o}catch(e){return r(e)}}),r))}return y=v(f),(e=function(t){for(;t;){if(t.then)return void t.then(e,r);try{if(t.pop){if(t.length)return t.pop()?u.call(this):t;t=o}else t=t.call(this)}catch(e){return r(e)}}}.bind(this))(o);function u(){return t()}}catch(e){return r(e)}}()}catch(e){return o(e)}}),o)}catch(e){o(e)}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r):t()}catch(e){return r(e)}}.bind(this),r):r(new E("cache-put-with-no-response",{url:F(a.url)}))}catch(e){return r(e)}var u}.bind(this),r)}))},oe=re,ie=function(e){return new Promise((function(t,r){function n(){l=ee(s,"fetchDidFail"),h=l.length>0?o.clone():null;var e=function(e){try{throw new E("plugin-error-request-will-fetch",{thrownError:e})}catch(e){return r(e)}};try{var n;function c(){if((d=f()).done)return[1];{if("requestWillFetch"in(p=d.value))return y=p.requestWillFetch,v=o.clone(),Promise.resolve(y.call(p,{request:v,event:u})).then(function(r){try{return o=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return c}return t.call(this)}}return f=g(s),(n=function(t){for(;t;){if(t.then)return void t.then(n,e);try{if(t.pop){if(t.length)return t.pop()?a.call(this):t;t=c}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(c);function a(){return function(){try{m=o.clone();var e=function(e){try{{var t;function n(){return(S=R()).done?[1]:(A=S.value,Promise.resolve(A.fetchDidFail.call(A,{error:e,event:u,originalRequest:h.clone(),request:m.clone()})).then((function(){try{return n}catch(e){return r(e)}}),r))}return R=g(l),(t=function(e){for(;e;){if(e.then)return void e.then(t,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n);function o(){throw e}}}catch(e){return r(e)}}.bind(this);try{return"navigate"===o.mode?Promise.resolve(fetch(o)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e):Promise.resolve(fetch(o,i)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e);function n(){function r(){if((_=w()).done)return[1];{if("fetchDidSucceed"in(P=_.value))return Promise.resolve(P.fetchDidSucceed.call(P,{event:u,request:m,response:b})).then(function(r){try{return b=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return r}return t.call(this)}}function n(){return t(b)}var o;return w=g(s),(o=function(t){for(;t;){if(t.then)return void t.then(o,e);try{if(t.pop){if(t.length)return t.pop()?n.call(this):t;t=r}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(r)}}catch(t){e(t)}}catch(e){return r(e)}}()}}catch(t){e(t)}}var o,i,u,c,s,a,l,h,f,d,p,y,v,m,b,w,_,P,R,S,A;return i=e.fetchOptions,u=e.event,s=void 0===(c=e.plugins)?[]:c,"string"==typeof(o=e.request)&&(o=new Request(o)),u instanceof FetchEvent&&u.preloadResponse?Promise.resolve(u.preloadResponse).then(function(e){try{return(a=e)?t(a):n.call(this)}catch(e){return r(e)}}.bind(this),r):n.call(this)}))},ue=function(){function e(e){this._cacheName=z(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}var t=e.prototype;return t.addToCacheList=function(e){for(var t,r=[],n=P(e);!(t=n()).done;){var o=t.value;"string"==typeof o?r.push(o):o&&void 0===o.revision&&r.push(o.url);var i=_(o),u=i.cacheKey,c=i.url,s="string"!=typeof o&&o.revision?"reload":"default";if(this._urlsToCacheKeys.has(c)&&this._urlsToCacheKeys.get(c)!==u)throw new E("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(c),secondEntry:u});if("string"!=typeof o&&o.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==o.integrity)throw new E("add-to-cache-list-conflicting-integrities",{url:c});this._cacheKeysToIntegrities.set(u,o.integrity)}if(this._urlsToCacheKeys.set(c,u),this._urlsToCacheModes.set(c,s),r.length>0){var a="Workbox is precaching URLs without revision info: "+r.join(", ")+"\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache";console.warn(a)}}},t.install=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p,y,v;return n=this,i=(o=void 0===e?{}:e).event,u=o.plugins,c=[],s=[],Promise.resolve(self.caches.open(this._cacheName)).then(function(e){try{return Promise.resolve(e.keys()).then(function(e){try{for(a=new Set(e.map((function(e){return e.url}))),l=P(this._urlsToCacheKeys);!(h=l()).done;)d=(f=h.value)[0],a.has(p=f[1])?s.push(d):c.push({cacheKey:p,url:d});return y=c.map((function(e){var t=e.cacheKey,r=e.url,o=n._cacheKeysToIntegrities.get(t),c=n._urlsToCacheModes.get(r);return n._addURLToCache({cacheKey:t,cacheMode:c,event:i,integrity:o,plugins:u,url:r})})),Promise.resolve(Promise.all(y)).then((function(){try{return v=c.map((function(e){return e.url})),t({updatedURLs:v,notUpdatedURLs:s})}catch(e){return r(e)}}),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.activate=function(){return new Promise(function(e,t){var r,n,o,i,u,c,s;return Promise.resolve(self.caches.open(this._cacheName)).then(function(a){try{return r=a,Promise.resolve(r.keys()).then(function(a){try{{var l;function h(){if((c=u()).done)return[1];{if(!o.has((s=c.value).url))return Promise.resolve(r.delete(s)).then(function(){try{return i.push(s.url),e.call(this)}catch(e){return t(e)}}.bind(this),t);function e(){return h}return e.call(this)}}return n=a,o=new Set(this._urlsToCacheKeys.values()),i=[],u=P(n),(l=function(e){for(;e;){if(e.then)return void e.then(l,t);try{if(e.pop){if(e.length)return e.pop()?f.call(this):e;e=h}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(h);function f(){return e({deletedURLs:i})}}}catch(e){return t(e)}}.bind(this),t)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},t._addURLToCache=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f;return n=e.cacheKey,o=e.url,i=e.event,u=e.plugins,c=new Request(o,{integrity:e.integrity,cache:e.cacheMode,credentials:"same-origin"}),Promise.resolve(ie({event:i,plugins:u,request:c})).then(function(e){try{for(s=e,l=P(u||[]);!(h=l()).done;)"cacheWillUpdate"in(f=h.value)&&(a=f);return Promise.resolve(new Promise((function(e,t){return a?Promise.resolve(a.cacheWillUpdate({event:i,request:c,response:s})).then(e,t):e(s.status<400)}))).then(function(e){try{if(!e)return r(new E("bad-precaching-response",{url:o,status:s.status}));if(s.redirected)return Promise.resolve(w(s)).then(function(e){try{return s=e,a.call(this)}catch(e){return r(e)}}.bind(this),r);function a(){return Promise.resolve(ne({event:i,plugins:u,response:s,request:n===o?c:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})).then((function(){try{return t()}catch(e){return r(e)}}),r)}return a.call(this)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.getURLsToCacheKeys=function(){return this._urlsToCacheKeys},t.getCachedURLs=function(){return[].concat(this._urlsToCacheKeys.keys())},t.getCacheKeyForURL=function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)},t.matchPrecache=function(e){return new Promise(function(t,r){var n,o;return n=e instanceof Request?e.url:e,(o=this.getCacheKeyForURL(n))?Promise.resolve(self.caches.open(this._cacheName)).then((function(e){try{return t(e.match(o))}catch(e){return r(e)}}),r):t(void 0)}.bind(this))},t.createHandler=function(e){var t=this;return void 0===e&&(e=!0),function(r){return new Promise((function(n,o){var i,u;i=r.request;var c=function(t){try{if(e)return n(fetch(i));throw t}catch(e){return o(e)}};try{return Promise.resolve(t.matchPrecache(i)).then((function(e){try{if(u=e)return n(u);throw new E("missing-precache-entry",{cacheName:t._cacheName,url:i instanceof Request?i.url:i})}catch(e){return c(e)}}),c)}catch(e){c(e)}}))}},t.createHandlerBoundToURL=function(e,t){if(void 0===t&&(t=!0),!this.getCacheKeyForURL(e))throw new E("non-precached-url",{url:e});var r=this.createHandler(t),n=new Request(e);return function(){return r({request:n})}},e}(),ce=function(){return K||(K=new ue),K},se=!1,ae=function(e){var t=ce(),r=$();e.waitUntil(t.install({event:e,plugins:r}).catch((function(e){throw e})))},le=function(e){var t=ce();e.waitUntil(t.activate())},he=function(e){return"navigate"===e.request.mode},fe=(r("myed"),{cacheWillUpdate:function(e){return new Promise((function(t){var r=e.response;return t(200===r.status||0===r.status?r:null)}))}}),de=function(){function e(e){if(void 0===e&&(e={}),this._cacheName=V(e.cacheName),e.plugins){var t=e.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=t?e.plugins:[fe].concat(e.plugins)}else this._plugins=[fe];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}var t=e.prototype;return t.handle=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l;return n=e.event,i=[],"string"==typeof(o=e.request)&&(o=new Request(o)),u=[],this._networkTimeoutSeconds&&(c=(s=this._getTimeoutPromise({request:o,event:n,logs:i})).id,u.push(s.promise)),a=this._getNetworkPromise({timeoutId:c,request:o,event:n,logs:i}),u.push(a),Promise.resolve(Promise.race(u)).then(function(e){try{if(!(l=e))return Promise.resolve(a).then(function(e){try{return l=e,n.call(this)}catch(e){return r(e)}}.bind(this),r);function n(){return l?t(l):r(new E("no-response",{url:o.url}))}return n.call(this)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t._getTimeoutPromise=function(e){var t,r=this,n=e.request,o=e.event;return{promise:new Promise((function(e){t=setTimeout((function(){return new Promise((function(t,i){return Promise.resolve(r._respondFromCache({request:n,event:o})).then((function(r){try{return e(r),t()}catch(e){return i(e)}}),i)}))}),1e3*r._networkTimeoutSeconds)})),id:t}},t._getNetworkPromise=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a;n=e.timeoutId,o=e.request,i=e.event;var l=function(){try{if(n&&clearTimeout(n),u||!c)return Promise.resolve(this._respondFromCache({request:o,event:i})).then(function(t){try{return c=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);if(s=c.clone(),a=ne({cacheName:this._cacheName,request:o,response:s,event:i,plugins:this._plugins}),i)try{i.waitUntil(a)}catch(e){0}return e.call(this);function e(){return t(c)}}catch(e){return r(e)}}.bind(this),h=function(e){try{return u=e,l()}catch(e){return r(e)}};try{return Promise.resolve(ie({request:o,event:i,fetchOptions:this._fetchOptions,plugins:this._plugins})).then((function(e){try{return c=e,l()}catch(e){return h(e)}}),h)}catch(e){h(e)}}.bind(this))},t._respondFromCache=function(e){return oe({cacheName:this._cacheName,request:e.request,event:e.event,matchOptions:this._matchOptions,plugins:this._plugins})},e}(),pe=function(){function e(e,t,r){var n=this,o=void 0===r?{}:r,i=o.onupgradeneeded,u=o.onversionchange;this._db=null,this._name=e,this._version=t,this._onupgradeneeded=i,this._onversionchange=u||function(){return n.close()}}var t,r,n,o=e.prototype;return o.open=function(){return new Promise(function(e,t){var r;return r=this,this._db?e():Promise.resolve(new Promise((function(e,t){var n=!1;setTimeout((function(){n=!0,t(new Error("The open request was blocked and timed out"))}),r.OPEN_TIMEOUT);var o=indexedDB.open(r._name,r._version);o.onerror=function(){return t(o.error)},o.onupgradeneeded=function(e){n?(o.transaction.abort(),o.result.close()):"function"==typeof r._onupgradeneeded&&r._onupgradeneeded(e)},o.onsuccess=function(){var t=o.result;n?t.close():(t.onversionchange=r._onversionchange.bind(r),e(t))}}))).then(function(r){try{return this._db=r,e(this)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},o.getKey=function(e,t){return new Promise(function(r,n){return Promise.resolve(this.getAllKeys(e,t,1)).then((function(e){try{return r(e[0])}catch(e){return n(e)}}),n)}.bind(this))},o.getAll=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r})).then(n,o)}.bind(this))},o.getAllKeys=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r,includeKeys:!0})).then((function(e){try{return n(e.map((function(e){return e.key})))}catch(e){return o(e)}}),o)}.bind(this))},o.getAllMatching=function(e,t){return new Promise(function(r,n){var o,i,u,c,s,a,l,h,f;return i=(o=void 0===t?{}:t).index,c=void 0===(u=o.query)?null:u,a=void 0===(s=o.direction)?"next":s,l=o.count,f=void 0!==(h=o.includeKeys)&&h,Promise.resolve(this.transaction([e],"readonly",(function(t,r){var n=t.objectStore(e),o=i?n.index(i):n,u=[],s=o.openCursor(c,a);s.onsuccess=function(){var e=s.result;e?(u.push(f?e:e.value),l&&u.length>=l?r(u):e.continue()):r(u)}}))).then(r,n)}.bind(this))},o.transaction=function(e,t,r){return new Promise(function(n,o){var i;return i=this,Promise.resolve(this.open()).then((function(){try{return Promise.resolve(new Promise((function(n,o){var u=i._db.transaction(e,t);u.onabort=function(){return o(u.error)},u.oncomplete=function(){return n()},r(u,(function(e){return n(e)}))}))).then(n,o)}catch(e){return o(e)}}),o)}.bind(this))},o._call=function(e,t,r){var n=arguments;return new Promise(function(o,i){var u,c,s;for(u=n.length,c=new Array(u>3?u-3:0),s=3;s1?u-1:0),s=1;s=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(self.addEventListener("install",ae),self.addEventListener("activate",le))}(e),U(t)}function x(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),o=1;o0&&(t+=" :: "+JSON.stringify(n)),t},E=function(e){function t(t,r){var n,o=M(t,r);return(n=e.call(this,o)||this).name=t,n.details=r,n}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(n(Error)),N=(r("I3Xu"),function(e){return e&&"object"==typeof e?e:{handle:e}}),k=function(e,t,r){void 0===r&&(r="GET"),this.handler=N(t),this.match=e,this.method=r},W=function(e){function t(t,r,n){return e.call(this,(function(e){var r=e.url,n=t.exec(r.href);if(n&&(r.origin===location.origin||0===n.index))return n.slice(1)}),r,n)||this}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(k),F=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),"")},H=function(){function e(){this._routes=new Map}var t,r,n,o=e.prototype;return o.addFetchListener=function(){var e=this;self.addEventListener("fetch",(function(t){var r=e.handleRequest({request:t.request,event:t});r&&t.respondWith(r)}))},o.addCacheListener=function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){0;var r=Promise.all(t.data.payload.urlsToCache.map((function(t){"string"==typeof t&&(t=[t]);var r=l(Request,t);return e.handleRequest({request:r})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))},o.handleRequest=function(e){var t=this,r=e.request,n=e.event;var o=new URL(r.url,location.href);if(o.protocol.startsWith("http")){var i=this.findMatchingRoute({url:o,request:r,event:n}),u=i.params,c=i.route,s=c&&c.handler;if(!s&&this._defaultHandler&&(s=this._defaultHandler),s){var a;0;try{a=s.handle({url:o,request:r,event:n,params:u})}catch(e){a=Promise.reject(e)}return a instanceof Promise&&this._catchHandler&&(a=a.catch((function(){return t._catchHandler.handle({url:o,request:r,event:n})}))),a}}},o.findMatchingRoute=function(e){var t=e.url,r=e.request,n=e.event;for(var o,i=s(this._routes.get(r.method)||[]);!(o=i()).done;){var u=o.value,c=void 0,a=u.match({url:t,request:r,event:n});if(a)return c=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(c=void 0),{route:u,params:c}}return{}},o.setDefaultHandler=function(e){this._defaultHandler=N(e)},o.setCatchHandler=function(e){this._catchHandler=N(e)},o.registerRoute=function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)},o.unregisterRoute=function(e){if(!this._routes.has(e.method))throw new E("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new E("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)},t=e,(r=[{key:"routes",get:function(){return this._routes}}])&&d(t.prototype,r),n&&d(t,n),e}(),D=function(){return L||((L=new H).addFetchListener(),L.addCacheListener()),L},B=(r("Gpc1"),[]),$=function(){return B},G={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},X=function(e){return[G.prefix,e,G.suffix].filter((function(e){return e&&e.length>0})).join("-")},Q=function(e){return e||X(G.googleAnalytics)},z=function(e){return e||X(G.precache)},J=function(){return G.prefix},V=function(e){return e||X(G.runtime)},Y=function(){return G.suffix},Z=new Set,ee=function(e,t){return e.filter((function(e){return t in e}))},te=function(e){return new Promise((function(t,r){function n(){return(h=l()).done?[1]:(f=h.value,Promise.resolve(f.cacheKeyWillBeUsed.call(f,{mode:u,request:a})).then((function(e){try{return"string"==typeof(a=e)&&(a=new Request(a)),n}catch(e){return r(e)}}),r))}function o(){return t(a)}var i,u,c,s,a,l,h,f,d;return i=e.request,u=e.mode,s=ee(void 0===(c=e.plugins)?[]:c,"cacheKeyWillBeUsed"),a=i,l=v(s),(d=function(e){for(;e;){if(e.then)return void e.then(d,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n)}))},re=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p;return n=e.cacheName,o=e.request,i=e.event,u=e.matchOptions,s=void 0===(c=e.plugins)?[]:c,Promise.resolve(self.caches.open(n)).then(function(e){try{return a=e,Promise.resolve(te({plugins:s,request:o,mode:"read"})).then(function(e){try{return l=e,Promise.resolve(a.match(l,u)).then(function(e){try{{var o;function c(){if((d=f()).done)return[1];{if("cachedResponseWillBeUsed"in(p=d.value))return Promise.resolve(p.cachedResponseWillBeUsed.call(p,{cacheName:n,event:i,matchOptions:u,cachedResponse:h,request:l})).then(function(t){try{return h=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);function e(){return c}return e.call(this)}}return h=e,f=v(s),(o=function(e){for(;e;){if(e.then)return void e.then(o,r);try{if(e.pop){if(e.length)return e.pop()?a.call(this):e;e=c}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c);function a(){return t(h)}}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}))},ne=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,y,m,g;return n=e.cacheName,o=e.response,i=e.event,c=void 0===(u=e.plugins)?[]:u,s=e.matchOptions,Promise.resolve(te({plugins:c,request:e.request,mode:"write"})).then(function(e){try{return a=e,o?Promise.resolve((u={event:i,plugins:c,response:o,request:a},new Promise((function(e,t){function r(){if((h=l()).done)return[1];{if("cacheWillUpdate"in(f=h.value))return a=!0,Promise.resolve(f.cacheWillUpdate.call(f,{request:o,response:s,event:i})).then(function(r){try{return(s=r)?e.call(this):[1]}catch(e){return t(e)}}.bind(this),t);function e(){return r}return e.call(this)}}function n(){return a||(s=s&&200===s.status?s:void 0),e(s||null)}var o,i,c,s,a,l,h,f,d;return o=u.request,i=u.event,s=u.response,a=!1,l=v(void 0===(c=u.plugins)?[]:c),(d=function(e){for(;e;){if(e.then)return void e.then(d,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)})))).then(function(e){try{return(l=e)?Promise.resolve(self.caches.open(n)).then(function(e){try{return h=e,f=ee(c,"cacheDidUpdate"),Promise.resolve(new Promise((function(e,t){return f.length>0?Promise.resolve(re({cacheName:n,matchOptions:s,request:a})).then(e,t):e(null)}))).then(function(e){try{d=e;var o=function(e){try{if("QuotaExceededError"===e.name)return Promise.resolve(new Promise((function(e,t){function r(){return(i=o()).done?[1]:Promise.resolve((0,i.value)()).then((function(){try{return r}catch(e){return t(e)}}),t)}function n(){return e()}var o,i,u;return o=p(Z),(u=function(e){for(;e;){if(e.then)return void e.then(u,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)}))).then(function(){try{return t.call(this)}catch(e){return r(e)}}.bind(this),r);function t(){throw e}return t.call(this)}catch(e){return r(e)}}.bind(this);try{return Promise.resolve(h.put(a,l)).then((function(){try{return function(){try{var e;function o(){return(m=y()).done?[1]:(g=m.value,Promise.resolve(g.cacheDidUpdate.call(g,{cacheName:n,event:i,oldResponse:d,newResponse:l,request:a})).then((function(){try{return o}catch(e){return r(e)}}),r))}return y=v(f),(e=function(t){for(;t;){if(t.then)return void t.then(e,r);try{if(t.pop){if(t.length)return t.pop()?u.call(this):t;t=o}else t=t.call(this)}catch(e){return r(e)}}}.bind(this))(o);function u(){return t()}}catch(e){return r(e)}}()}catch(e){return o(e)}}),o)}catch(e){o(e)}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r):t()}catch(e){return r(e)}}.bind(this),r):r(new E("cache-put-with-no-response",{url:F(a.url)}))}catch(e){return r(e)}var u}.bind(this),r)}))},oe=re,ie=function(e){return new Promise((function(t,r){function n(){l=ee(s,"fetchDidFail"),h=l.length>0?o.clone():null;var e=function(e){try{throw new E("plugin-error-request-will-fetch",{thrownError:e})}catch(e){return r(e)}};try{var n;function c(){if((d=f()).done)return[1];{if("requestWillFetch"in(p=d.value))return y=p.requestWillFetch,v=o.clone(),Promise.resolve(y.call(p,{request:v,event:u})).then(function(r){try{return o=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return c}return t.call(this)}}return f=g(s),(n=function(t){for(;t;){if(t.then)return void t.then(n,e);try{if(t.pop){if(t.length)return t.pop()?a.call(this):t;t=c}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(c);function a(){return function(){try{m=o.clone();var e=function(e){try{{var t;function n(){return(S=R()).done?[1]:(A=S.value,Promise.resolve(A.fetchDidFail.call(A,{error:e,event:u,originalRequest:h.clone(),request:m.clone()})).then((function(){try{return n}catch(e){return r(e)}}),r))}return R=g(l),(t=function(e){for(;e;){if(e.then)return void e.then(t,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n);function o(){throw e}}}catch(e){return r(e)}}.bind(this);try{return"navigate"===o.mode?Promise.resolve(fetch(o)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e):Promise.resolve(fetch(o,i)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e);function n(){function r(){if((_=w()).done)return[1];{if("fetchDidSucceed"in(P=_.value))return Promise.resolve(P.fetchDidSucceed.call(P,{event:u,request:m,response:b})).then(function(r){try{return b=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return r}return t.call(this)}}function n(){return t(b)}var o;return w=g(s),(o=function(t){for(;t;){if(t.then)return void t.then(o,e);try{if(t.pop){if(t.length)return t.pop()?n.call(this):t;t=r}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(r)}}catch(t){e(t)}}catch(e){return r(e)}}()}}catch(t){e(t)}}var o,i,u,c,s,a,l,h,f,d,p,y,v,m,b,w,_,P,R,S,A;return i=e.fetchOptions,u=e.event,s=void 0===(c=e.plugins)?[]:c,"string"==typeof(o=e.request)&&(o=new Request(o)),u instanceof FetchEvent&&u.preloadResponse?Promise.resolve(u.preloadResponse).then(function(e){try{return(a=e)?t(a):n.call(this)}catch(e){return r(e)}}.bind(this),r):n.call(this)}))},ue=function(){function e(e){this._cacheName=z(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}var t=e.prototype;return t.addToCacheList=function(e){for(var t,r=[],n=P(e);!(t=n()).done;){var o=t.value;"string"==typeof o?r.push(o):o&&void 0===o.revision&&r.push(o.url);var i=_(o),u=i.cacheKey,c=i.url,s="string"!=typeof o&&o.revision?"reload":"default";if(this._urlsToCacheKeys.has(c)&&this._urlsToCacheKeys.get(c)!==u)throw new E("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(c),secondEntry:u});if("string"!=typeof o&&o.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==o.integrity)throw new E("add-to-cache-list-conflicting-integrities",{url:c});this._cacheKeysToIntegrities.set(u,o.integrity)}if(this._urlsToCacheKeys.set(c,u),this._urlsToCacheModes.set(c,s),r.length>0){var a="Workbox is precaching URLs without revision info: "+r.join(", ")+"\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache";console.warn(a)}}},t.install=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p,y,v;return n=this,i=(o=void 0===e?{}:e).event,u=o.plugins,c=[],s=[],Promise.resolve(self.caches.open(this._cacheName)).then(function(e){try{return Promise.resolve(e.keys()).then(function(e){try{for(a=new Set(e.map((function(e){return e.url}))),l=P(this._urlsToCacheKeys);!(h=l()).done;)d=(f=h.value)[0],a.has(p=f[1])?s.push(d):c.push({cacheKey:p,url:d});return y=c.map((function(e){var t=e.cacheKey,r=e.url,o=n._cacheKeysToIntegrities.get(t),c=n._urlsToCacheModes.get(r);return n._addURLToCache({cacheKey:t,cacheMode:c,event:i,integrity:o,plugins:u,url:r})})),Promise.resolve(Promise.all(y)).then((function(){try{return v=c.map((function(e){return e.url})),t({updatedURLs:v,notUpdatedURLs:s})}catch(e){return r(e)}}),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.activate=function(){return new Promise(function(e,t){var r,n,o,i,u,c,s;return Promise.resolve(self.caches.open(this._cacheName)).then(function(a){try{return r=a,Promise.resolve(r.keys()).then(function(a){try{{var l;function h(){if((c=u()).done)return[1];{if(!o.has((s=c.value).url))return Promise.resolve(r.delete(s)).then(function(){try{return i.push(s.url),e.call(this)}catch(e){return t(e)}}.bind(this),t);function e(){return h}return e.call(this)}}return n=a,o=new Set(this._urlsToCacheKeys.values()),i=[],u=P(n),(l=function(e){for(;e;){if(e.then)return void e.then(l,t);try{if(e.pop){if(e.length)return e.pop()?f.call(this):e;e=h}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(h);function f(){return e({deletedURLs:i})}}}catch(e){return t(e)}}.bind(this),t)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},t._addURLToCache=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f;return n=e.cacheKey,o=e.url,i=e.event,u=e.plugins,c=new Request(o,{integrity:e.integrity,cache:e.cacheMode,credentials:"same-origin"}),Promise.resolve(ie({event:i,plugins:u,request:c})).then(function(e){try{for(s=e,l=P(u||[]);!(h=l()).done;)"cacheWillUpdate"in(f=h.value)&&(a=f);return Promise.resolve(new Promise((function(e,t){return a?Promise.resolve(a.cacheWillUpdate({event:i,request:c,response:s})).then(e,t):e(s.status<400)}))).then(function(e){try{if(!e)return r(new E("bad-precaching-response",{url:o,status:s.status}));if(s.redirected)return Promise.resolve(w(s)).then(function(e){try{return s=e,a.call(this)}catch(e){return r(e)}}.bind(this),r);function a(){return Promise.resolve(ne({event:i,plugins:u,response:s,request:n===o?c:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})).then((function(){try{return t()}catch(e){return r(e)}}),r)}return a.call(this)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.getURLsToCacheKeys=function(){return this._urlsToCacheKeys},t.getCachedURLs=function(){return[].concat(this._urlsToCacheKeys.keys())},t.getCacheKeyForURL=function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)},t.matchPrecache=function(e){return new Promise(function(t,r){var n,o;return n=e instanceof Request?e.url:e,(o=this.getCacheKeyForURL(n))?Promise.resolve(self.caches.open(this._cacheName)).then((function(e){try{return t(e.match(o))}catch(e){return r(e)}}),r):t(void 0)}.bind(this))},t.createHandler=function(e){var t=this;return void 0===e&&(e=!0),function(r){return new Promise((function(n,o){var i,u;i=r.request;var c=function(t){try{if(e)return n(fetch(i));throw t}catch(e){return o(e)}};try{return Promise.resolve(t.matchPrecache(i)).then((function(e){try{if(u=e)return n(u);throw new E("missing-precache-entry",{cacheName:t._cacheName,url:i instanceof Request?i.url:i})}catch(e){return c(e)}}),c)}catch(e){c(e)}}))}},t.createHandlerBoundToURL=function(e,t){if(void 0===t&&(t=!0),!this.getCacheKeyForURL(e))throw new E("non-precached-url",{url:e});var r=this.createHandler(t),n=new Request(e);return function(){return r({request:n})}},e}(),ce=function(){return K||(K=new ue),K},se=!1,ae=function(e){var t=ce(),r=$();e.waitUntil(t.install({event:e,plugins:r}).catch((function(e){throw e})))},le=function(e){var t=ce();e.waitUntil(t.activate())},he=function(e){return"navigate"===e.request.mode},fe=(r("myed"),{cacheWillUpdate:function(e){return new Promise((function(t){var r=e.response;return t(200===r.status||0===r.status?r:null)}))}}),de=function(){function e(e){if(void 0===e&&(e={}),this._cacheName=V(e.cacheName),e.plugins){var t=e.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=t?e.plugins:[fe].concat(e.plugins)}else this._plugins=[fe];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}var t=e.prototype;return t.handle=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l;return n=e.event,i=[],"string"==typeof(o=e.request)&&(o=new Request(o)),u=[],this._networkTimeoutSeconds&&(c=(s=this._getTimeoutPromise({request:o,event:n,logs:i})).id,u.push(s.promise)),a=this._getNetworkPromise({timeoutId:c,request:o,event:n,logs:i}),u.push(a),Promise.resolve(Promise.race(u)).then(function(e){try{if(!(l=e))return Promise.resolve(a).then(function(e){try{return l=e,n.call(this)}catch(e){return r(e)}}.bind(this),r);function n(){return l?t(l):r(new E("no-response",{url:o.url}))}return n.call(this)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t._getTimeoutPromise=function(e){var t,r=this,n=e.request,o=e.event;return{promise:new Promise((function(e){t=setTimeout((function(){return new Promise((function(t,i){return Promise.resolve(r._respondFromCache({request:n,event:o})).then((function(r){try{return e(r),t()}catch(e){return i(e)}}),i)}))}),1e3*r._networkTimeoutSeconds)})),id:t}},t._getNetworkPromise=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a;n=e.timeoutId,o=e.request,i=e.event;var l=function(){try{if(n&&clearTimeout(n),u||!c)return Promise.resolve(this._respondFromCache({request:o,event:i})).then(function(t){try{return c=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);if(s=c.clone(),a=ne({cacheName:this._cacheName,request:o,response:s,event:i,plugins:this._plugins}),i)try{i.waitUntil(a)}catch(e){0}return e.call(this);function e(){return t(c)}}catch(e){return r(e)}}.bind(this),h=function(e){try{return u=e,l()}catch(e){return r(e)}};try{return Promise.resolve(ie({request:o,event:i,fetchOptions:this._fetchOptions,plugins:this._plugins})).then((function(e){try{return c=e,l()}catch(e){return h(e)}}),h)}catch(e){h(e)}}.bind(this))},t._respondFromCache=function(e){return oe({cacheName:this._cacheName,request:e.request,event:e.event,matchOptions:this._matchOptions,plugins:this._plugins})},e}(),pe=function(){function e(e,t,r){var n=this,o=void 0===r?{}:r,i=o.onupgradeneeded,u=o.onversionchange;this._db=null,this._name=e,this._version=t,this._onupgradeneeded=i,this._onversionchange=u||function(){return n.close()}}var t,r,n,o=e.prototype;return o.open=function(){return new Promise(function(e,t){var r;return r=this,this._db?e():Promise.resolve(new Promise((function(e,t){var n=!1;setTimeout((function(){n=!0,t(new Error("The open request was blocked and timed out"))}),r.OPEN_TIMEOUT);var o=indexedDB.open(r._name,r._version);o.onerror=function(){return t(o.error)},o.onupgradeneeded=function(e){n?(o.transaction.abort(),o.result.close()):"function"==typeof r._onupgradeneeded&&r._onupgradeneeded(e)},o.onsuccess=function(){var t=o.result;n?t.close():(t.onversionchange=r._onversionchange.bind(r),e(t))}}))).then(function(r){try{return this._db=r,e(this)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},o.getKey=function(e,t){return new Promise(function(r,n){return Promise.resolve(this.getAllKeys(e,t,1)).then((function(e){try{return r(e[0])}catch(e){return n(e)}}),n)}.bind(this))},o.getAll=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r})).then(n,o)}.bind(this))},o.getAllKeys=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r,includeKeys:!0})).then((function(e){try{return n(e.map((function(e){return e.key})))}catch(e){return o(e)}}),o)}.bind(this))},o.getAllMatching=function(e,t){return new Promise(function(r,n){var o,i,u,c,s,a,l,h,f;return i=(o=void 0===t?{}:t).index,c=void 0===(u=o.query)?null:u,a=void 0===(s=o.direction)?"next":s,l=o.count,f=void 0!==(h=o.includeKeys)&&h,Promise.resolve(this.transaction([e],"readonly",(function(t,r){var n=t.objectStore(e),o=i?n.index(i):n,u=[],s=o.openCursor(c,a);s.onsuccess=function(){var e=s.result;e?(u.push(f?e:e.value),l&&u.length>=l?r(u):e.continue()):r(u)}}))).then(r,n)}.bind(this))},o.transaction=function(e,t,r){return new Promise(function(n,o){var i;return i=this,Promise.resolve(this.open()).then((function(){try{return Promise.resolve(new Promise((function(n,o){var u=i._db.transaction(e,t);u.onabort=function(){return o(u.error)},u.oncomplete=function(){return n()},r(u,(function(e){return n(e)}))}))).then(n,o)}catch(e){return o(e)}}),o)}.bind(this))},o._call=function(e,t,r){var n=arguments;return new Promise(function(o,i){var u,c,s;for(u=n.length,c=new Array(u>3?u-3:0),s=3;s1?u-1:0),s=1;s} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof module:workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {module:workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * [Route]{@link module:workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}\n *\n * @memberof module:workbox-routing\n * @extends module:workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * [handler's]{@link module:workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if ((url.origin !== location.origin) && (result.index !== 0)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp}' only partially matched ` +\n `against the cross-origin URL '${url}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * The Router can be used to process a FetchEvent through one or more\n * [Routes]{@link module:workbox-routing.Route} responding with a Request if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof module:workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n if (event.data && event.data.type === 'CACHE_URLS') {\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle (this is usually\n * from a fetch event, but it does not have to be).\n * @param {FetchEvent} [options.event] The event that triggered the request,\n * if applicable.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const { params, route } = this.findMatchingRoute({ url, request, event });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([\n `Found a route to handle this request:`, route,\n ]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`, params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n if (!handler && this._defaultHandler) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler.`);\n }\n handler = this._defaultHandler;\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n if (responsePromise instanceof Promise && this._catchHandler) {\n responsePromise = responsePromise.catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {Request} options.request The request to match.\n * @param {Event} [options.event] The corresponding event (unless N/A).\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(url, URL, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.url',\n });\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.request',\n });\n }\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n const matchResult = route.match({ url, request, event });\n if (matchResult) {\n // See https://github.com/GoogleChrome/workbox/issues/2079\n params = matchResult;\n if (Array.isArray(matchResult) && matchResult.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if ((matchResult.constructor === Object &&\n Object.keys(matchResult).length === 0)) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setDefaultHandler(handler) {\n this._defaultHandler = normalizeHandler(handler);\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","export const isNav = event => event.request.mode === 'navigate';\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n /**\n * Returns a valid response (to allow caching) if the status is 200 (OK) or\n * 0 (opaque).\n *\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: async ({ response }) => {\n if (response.status === 200 || response.status === 0) {\n return response;\n }\n return null;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { messages } from './utils/messages.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @memberof module:workbox-strategies\n */\nclass NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames.getRuntimeName(options.cacheName);\n if (options.plugins) {\n const isUsingCacheWillUpdate = options.plugins.some((plugin) => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ?\n options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n }\n else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n if (process.env.NODE_ENV !== 'production') {\n if (this._networkTimeoutSeconds) {\n assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds',\n });\n }\n }\n this._fetchOptions = options.fetchOptions;\n this._matchOptions = options.matchOptions;\n }\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link module:workbox-routing.Router}.\n *\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {Event} [options.event] The event that triggered the request.\n * @return {Promise}\n */\n async handle({ event, request }) {\n const logs = [];\n if (typeof request === 'string') {\n request = new Request(request);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest',\n });\n }\n const promises = [];\n let timeoutId;\n if (this._networkTimeoutSeconds) {\n const { id, promise } = this._getTimeoutPromise({ request, event, logs });\n timeoutId = id;\n promises.push(promise);\n }\n const networkPromise = this._getNetworkPromise({ timeoutId, request, event, logs });\n promises.push(networkPromise);\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = await Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = await networkPromise;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url });\n }\n return response;\n }\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs array\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _getTimeoutPromise({ request, logs, event }) {\n let timeoutId;\n const timeoutPromise = new Promise((resolve) => {\n const onNetworkTimeout = async () => {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Timing out the network response at ` +\n `${this._networkTimeoutSeconds} seconds.`);\n }\n resolve(await this._respondFromCache({ request, event }));\n };\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n return {\n promise: timeoutPromise,\n id: timeoutId,\n };\n }\n /**\n * @param {Object} options\n * @param {number|undefined} options.timeoutId\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs Array.\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n async _getNetworkPromise({ timeoutId, request, logs, event }) {\n let error;\n let response;\n try {\n response = await fetchWrapper.fetch({\n request,\n event,\n fetchOptions: this._fetchOptions,\n plugins: this._plugins,\n });\n }\n catch (err) {\n error = err;\n }\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network. Will respond ` +\n `with a cached response.`);\n }\n }\n if (error || !response) {\n response = await this._respondFromCache({ request, event });\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Found a cached response in the '${this._cacheName}'` +\n ` cache.`);\n }\n else {\n logs.push(`No response found in the '${this._cacheName}' cache.`);\n }\n }\n }\n else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper.put({\n cacheName: this._cacheName,\n request,\n response: responseClone,\n event,\n plugins: this._plugins,\n });\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n }\n catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to ensure service worker stays alive when ` +\n `updating cache for '${getFriendlyURL(request.url)}'.`);\n }\n }\n }\n }\n return response;\n }\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Object} options\n * @param {Request} request The request to match in the cache\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _respondFromCache({ event, request }) {\n return cacheWrapper.match({\n cacheName: this._cacheName,\n request,\n event,\n matchOptions: this._matchOptions,\n plugins: this._plugins,\n });\n }\n}\nexport { NetworkFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A class that wraps common IndexedDB functionality in a promise-based API.\n * It exposes all the underlying power and functionality of IndexedDB, but\n * wraps the most commonly used features in a way that's much simpler to use.\n *\n * @private\n */\nexport class DBWrapper {\n /**\n * @param {string} name\n * @param {number} version\n * @param {Object=} [callback]\n * @param {!Function} [callbacks.onupgradeneeded]\n * @param {!Function} [callbacks.onversionchange] Defaults to\n * DBWrapper.prototype._onversionchange when not specified.\n * @private\n */\n constructor(name, version, { onupgradeneeded, onversionchange, } = {}) {\n this._db = null;\n this._name = name;\n this._version = version;\n this._onupgradeneeded = onupgradeneeded;\n this._onversionchange = onversionchange || (() => this.close());\n }\n /**\n * Returns the IDBDatabase instance (not normally needed).\n * @return {IDBDatabase|undefined}\n *\n * @private\n */\n get db() {\n return this._db;\n }\n /**\n * Opens a connected to an IDBDatabase, invokes any onupgradedneeded\n * callback, and added an onversionchange callback to the database.\n *\n * @return {IDBDatabase}\n * @private\n */\n async open() {\n if (this._db)\n return;\n this._db = await new Promise((resolve, reject) => {\n // This flag is flipped to true if the timeout callback runs prior\n // to the request failing or succeeding. Note: we use a timeout instead\n // of an onblocked handler since there are cases where onblocked will\n // never never run. A timeout better handles all possible scenarios:\n // https://github.com/w3c/IndexedDB/issues/223\n let openRequestTimedOut = false;\n setTimeout(() => {\n openRequestTimedOut = true;\n reject(new Error('The open request was blocked and timed out'));\n }, this.OPEN_TIMEOUT);\n const openRequest = indexedDB.open(this._name, this._version);\n openRequest.onerror = () => reject(openRequest.error);\n openRequest.onupgradeneeded = (evt) => {\n if (openRequestTimedOut) {\n openRequest.transaction.abort();\n openRequest.result.close();\n }\n else if (typeof this._onupgradeneeded === 'function') {\n this._onupgradeneeded(evt);\n }\n };\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n if (openRequestTimedOut) {\n db.close();\n }\n else {\n db.onversionchange = this._onversionchange.bind(this);\n resolve(db);\n }\n };\n });\n return this;\n }\n /**\n * Polyfills the native `getKey()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @return {Array}\n * @private\n */\n async getKey(storeName, query) {\n return (await this.getAllKeys(storeName, query, 1))[0];\n }\n /**\n * Polyfills the native `getAll()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAll(storeName, query, count) {\n return await this.getAllMatching(storeName, { query, count });\n }\n /**\n * Polyfills the native `getAllKeys()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAllKeys(storeName, query, count) {\n const entries = await this.getAllMatching(storeName, { query, count, includeKeys: true });\n return entries.map((entry) => entry.key);\n }\n /**\n * Supports flexible lookup in an object store by specifying an index,\n * query, direction, and count. This method returns an array of objects\n * with the signature .\n *\n * @param {string} storeName\n * @param {Object} [opts]\n * @param {string} [opts.index] The index to use (if specified).\n * @param {*} [opts.query]\n * @param {IDBCursorDirection} [opts.direction]\n * @param {number} [opts.count] The max number of results to return.\n * @param {boolean} [opts.includeKeys] When true, the structure of the\n * returned objects is changed from an array of values to an array of\n * objects in the form {key, primaryKey, value}.\n * @return {Array}\n * @private\n */\n async getAllMatching(storeName, { index, query = null, // IE/Edge errors if query === `undefined`.\n direction = 'next', count, includeKeys = false, } = {}) {\n return await this.transaction([storeName], 'readonly', (txn, done) => {\n const store = txn.objectStore(storeName);\n const target = index ? store.index(index) : store;\n const results = [];\n const request = target.openCursor(query, direction);\n request.onsuccess = () => {\n const cursor = request.result;\n if (cursor) {\n results.push(includeKeys ? cursor : cursor.value);\n if (count && results.length >= count) {\n done(results);\n }\n else {\n cursor.continue();\n }\n }\n else {\n done(results);\n }\n };\n });\n }\n /**\n * Accepts a list of stores, a transaction type, and a callback and\n * performs a transaction. A promise is returned that resolves to whatever\n * value the callback chooses. The callback holds all the transaction logic\n * and is invoked with two arguments:\n * 1. The IDBTransaction object\n * 2. A `done` function, that's used to resolve the promise when\n * when the transaction is done, if passed a value, the promise is\n * resolved to that value.\n *\n * @param {Array} storeNames An array of object store names\n * involved in the transaction.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {!Function} callback\n * @return {*} The result of the transaction ran by the callback.\n * @private\n */\n async transaction(storeNames, type, callback) {\n await this.open();\n return await new Promise((resolve, reject) => {\n const txn = this._db.transaction(storeNames, type);\n txn.onabort = () => reject(txn.error);\n txn.oncomplete = () => resolve();\n callback(txn, (value) => resolve(value));\n });\n }\n /**\n * Delegates async to a native IDBObjectStore method.\n *\n * @param {string} method The method name.\n * @param {string} storeName The object store name.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {...*} args The list of args to pass to the native method.\n * @return {*} The result of the transaction.\n * @private\n */\n async _call(method, storeName, type, ...args) {\n const callback = (txn, done) => {\n const objStore = txn.objectStore(storeName);\n // TODO(philipwalton): Fix this underlying TS2684 error.\n // @ts-ignore\n const request = objStore[method].apply(objStore, args);\n request.onsuccess = () => done(request.result);\n };\n return await this.transaction([storeName], type, callback);\n }\n /**\n * Closes the connection opened by `DBWrapper.open()`. Generally this method\n * doesn't need to be called since:\n * 1. It's usually better to keep a connection open since opening\n * a new connection is somewhat slow.\n * 2. Connections are automatically closed when the reference is\n * garbage collected.\n * The primary use case for needing to close a connection is when another\n * reference (typically in another tab) needs to upgrade it and would be\n * blocked by the current, open connection.\n *\n * @private\n */\n close() {\n if (this._db) {\n this._db.close();\n this._db = null;\n }\n }\n}\n// Exposed on the prototype to let users modify the default timeout on a\n// per-instance or global basis.\nDBWrapper.prototype.OPEN_TIMEOUT = 2000;\n// Wrap native IDBObjectStore methods according to their mode.\nconst methodsToWrap = {\n readonly: ['get', 'count', 'getKey', 'getAll', 'getAllKeys'],\n readwrite: ['add', 'put', 'clear', 'delete'],\n};\nfor (const [mode, methods] of Object.entries(methodsToWrap)) {\n for (const method of methods) {\n if (method in IDBObjectStore.prototype) {\n // Don't use arrow functions here since we're outside of the class.\n DBWrapper.prototype[method] =\n async function (storeName, ...args) {\n return await this._call(method, storeName, mode, ...args);\n };\n }\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof module:workbox-routing\n */\nfunction setCatchHandler(handler) {\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","import { registerRoute, setCatchHandler } from 'workbox-routing';\nimport { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';\nimport { isNav } from './utils';\nimport { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';\n\nexport function getFiles() {\n\treturn self.__WB_MANIFEST;\n}\n\nexport function setupPrecaching(precacheFiles, precachingOptions) {\n\tprecacheAndRoute(precacheFiles, precachingOptions || PRECACHING_OPTIONS);\n}\n\nexport function setupRouting() {\n\t/**\n\t * Adding this before `precacheAndRoute` lets us handle all\n\t * the navigation requests even if they are in precache.\n\t */\n\tregisterRoute(({ event }) => isNav(event), NETWORK_HANDLER);\n\n\tsetCatchHandler(({ event }) => {\n\t\tif (isNav(event)) {\n\t\t\treturn caches.match(getCacheKeyForURL('/200.html'));\n\t\t}\n\t\treturn Response.error();\n\t});\n}\n\nexport { PRECACHING_OPTIONS };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n * `googleAnalytics` properties.\n *\n * @memberof module:workbox-core\n */\nconst cacheNames = {\n get googleAnalytics() {\n return _cacheNames.getGoogleAnalyticsName();\n },\n get precache() {\n return _cacheNames.getPrecacheName();\n },\n get prefix() {\n return _cacheNames.getPrefix();\n },\n get runtime() {\n return _cacheNames.getRuntimeName();\n },\n get suffix() {\n return _cacheNames.getSuffix();\n },\n};\nexport { cacheNames };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponse {\n /**\n * To construct a new CacheableResponse instance you must provide at least\n * one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(config.statuses || config.headers)) {\n throw new WorkboxError('statuses-or-headers-required', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n });\n }\n if (config.statuses) {\n assert.isArray(config.statuses, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.statuses',\n });\n }\n if (config.headers) {\n assert.isType(config.headers, 'object', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.headers',\n });\n }\n }\n this._statuses = config.statuses;\n this._headers = config.headers;\n }\n /**\n * Checks a response to see whether it's cacheable or not, based on this\n * object's configuration.\n *\n * @param {Response} response The response whose cacheability is being\n * checked.\n * @return {boolean} `true` if the `Response` is cacheable, and `false`\n * otherwise.\n */\n isResponseCacheable(response) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(response, Response, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'isResponseCacheable',\n paramName: 'response',\n });\n }\n let cacheable = true;\n if (this._statuses) {\n cacheable = this._statuses.includes(response.status);\n }\n if (this._headers && cacheable) {\n cacheable = Object.keys(this._headers).some((headerName) => {\n return response.headers.get(headerName) === this._headers[headerName];\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!cacheable) {\n logger.groupCollapsed(`The request for ` +\n `'${getFriendlyURL(response.url)}' returned a response that does ` +\n `not meet the criteria for being cached.`);\n logger.groupCollapsed(`View cacheability criteria here.`);\n logger.log(`Cacheable statuses: ` +\n JSON.stringify(this._statuses));\n logger.log(`Cacheable headers: ` +\n JSON.stringify(this._headers, null, 2));\n logger.groupEnd();\n const logFriendlyHeaders = {};\n response.headers.forEach((value, key) => {\n logFriendlyHeaders[key] = value;\n });\n logger.groupCollapsed(`View response status and headers here.`);\n logger.log(`Response status: ` + response.status);\n logger.log(`Response headers: ` +\n JSON.stringify(logFriendlyHeaders, null, 2));\n logger.groupEnd();\n logger.groupCollapsed(`View full response details here.`);\n logger.log(response.headers);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n }\n return cacheable;\n }\n}\nexport { CacheableResponse };\n","import { NetworkFirst } from 'workbox-strategies';\nimport { cacheNames } from 'workbox-core';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response';\n\nexport const PRECACHING_OPTIONS = {};\n\nexport const NETWORK_HANDLER = new NetworkFirst({\n\t// this cache is plunged with every new service worker deploy so we dont need to care about purging the cache.\n\tcacheName: cacheNames.precache,\n\tnetworkTimeoutSeconds: 5, // if u dont start getting headers within 5 sec fallback to cache.\n\tplugins: [\n\t\tnew CacheableResponsePlugin({\n\t\t\tstatuses: [200], // only cache valid responses, not opaque responses e.g. wifi portal.\n\t\t}),\n\t],\n});\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {module:workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {module:workbox-routing.Route} The generated `Route`(Useful for\n * unregistering).\n *\n * @memberof module:workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http') ?\n captureUrl.pathname : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if ((new RegExp(`${wildcards}`)).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if ((url.pathname === captureUrl.pathname) &&\n (url.origin !== captureUrl.origin)) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n /**\n * To construct a new CacheableResponsePlugin instance you must provide at\n * least one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config) {\n /**\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n * @private\n */\n this.cacheWillUpdate = async ({ response }) => {\n if (this._cacheableResponse.isResponseCacheable(response)) {\n return response;\n }\n return null;\n };\n this._cacheableResponse = new CacheableResponse(config);\n }\n}\nexport { CacheableResponsePlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof module:workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n const precacheController = getOrCreatePrecacheController();\n return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n"]} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../node_modules/workbox-cacheable-response/_version.js","webpack:///../node_modules/workbox-precaching/_version.js","webpack:///../node_modules/workbox-routing/_version.js","webpack:///../node_modules/workbox-strategies/_version.js","webpack:///../node_modules/workbox-core/copyResponse.js","webpack:///../node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","webpack:///../node_modules/workbox-precaching/utils/createCacheKey.js","webpack:///../node_modules/workbox-precaching/addRoute.js","webpack:///../node_modules/workbox-precaching/utils/addFetchListener.js","webpack:///../node_modules/workbox-precaching/utils/getCacheKeyForURL.js","webpack:///../node_modules/workbox-precaching/utils/generateURLVariations.js","webpack:///../node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","webpack:///../node_modules/workbox-precaching/precacheAndRoute.js","webpack:///../node_modules/workbox-precaching/precache.js","webpack:///../node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","webpack:///../node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","webpack:///../node_modules/workbox-core/models/messages/messageGenerator.js","webpack:///../node_modules/workbox-core/_private/WorkboxError.js","webpack:///../node_modules/workbox-routing/utils/normalizeHandler.js","webpack:///../node_modules/workbox-routing/Route.js","webpack:///../node_modules/workbox-routing/utils/constants.js","webpack:///../node_modules/workbox-routing/RegExpRoute.js","webpack:///../node_modules/workbox-core/_private/getFriendlyURL.js","webpack:///../node_modules/workbox-routing/Router.js","webpack:///../node_modules/workbox-precaching/utils/precachePlugins.js","webpack:///../node_modules/workbox-core/_private/cacheNames.js","webpack:///../node_modules/workbox-core/models/quotaErrorCallbacks.js","webpack:///../node_modules/workbox-core/utils/pluginUtils.js","webpack:///../node_modules/workbox-core/_private/cacheWrapper.js","webpack:///../node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","webpack:///../node_modules/workbox-core/_private/fetchWrapper.js","webpack:///../node_modules/workbox-precaching/PrecacheController.js","webpack:///../node_modules/preact-cli/sw/utils.js","webpack:///../node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js","webpack:///../node_modules/workbox-strategies/NetworkFirst.js","webpack:///../node_modules/workbox-core/_private/DBWrapper.js","webpack:///../node_modules/workbox-routing/setCatchHandler.js","webpack:///../node_modules/preact-cli/sw/index.js","webpack:///../node_modules/workbox-core/cacheNames.js","webpack:///../node_modules/workbox-cacheable-response/CacheableResponse.js","webpack:///../node_modules/preact-cli/sw/contants.js","webpack:///../node_modules/workbox-routing/registerRoute.js","webpack:///../node_modules/workbox-cacheable-response/CacheableResponsePlugin.js","webpack:///../node_modules/workbox-precaching/getCacheKeyForURL.js","webpack:///../node_modules/workbox-core/_version.js"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","self","_","e","copyResponse","response","modifier","clonedResponse","responseInit","modifiedResponseInit","clone","headers","Headers","status","statusText","undefined","supportStatus","testResponse","Response","body","error","canConstructResponseFromBodyStream","blob","createCacheKey","entry","WorkboxError","urlObject","URL","location","href","cacheKey","url","revision","cacheKeyURL","originalURL","searchParams","set","addRoute","options","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","cacheName","listenerAdded","cacheNames","addEventListener","event","precachedURL","urlsToCacheKeys","getOrCreatePrecacheController","getURLsToCacheKeys","hash","urlWithoutIgnoredParams","paramName","some","regExp","test","delete","keys","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","urlToAttempt","generateURLVariations","possibleCacheKey","getCacheKeyForURL","request","responsePromise","caches","open","then","cache","match","cachedResponse","fetch","respondWith","precacheAndRoute","entries","addToCacheList","length","installListener","activateListener","precache","defaultRouter","precacheController","messageGenerator","code","msg","args","JSON","stringify","errorCode","details","message","Error","normalizeHandler","handler","handle","Route","method","this","RegExpRoute","result","exec","origin","index","slice","getFriendlyURL","String","replace","RegExp","Router","_routes","Map","addFetchListener","handleRequest","addCacheListener","data","type","process","requestPromises","Promise","all","payload","urlsToCache","map","Request","waitUntil","ports","postMessage","protocol","startsWith","findMatchingRoute","params","route","_defaultHandler","err","reject","_catchHandler","catch","matchResult","Array","isArray","constructor","setDefaultHandler","setCatchHandler","registerRoute","has","push","unregisterRoute","routeIndex","indexOf","splice","getOrCreateDefaultRouter","plugins","precachePlugins","_cacheNameDetails","googleAnalytics","prefix","runtime","suffix","registration","scope","_createCacheName","filter","join","userCacheName","quotaErrorCallbacks","Set","pluginUtils","callbackName","plugin","_getEffectiveRequest","effectiveRequest","cacheKeyWillBeUsedPlugins","matchWrapper","matchOptions","cacheWrapper","responseToCache","updatePlugins","oldResponse","pluginsUsed","callback","put","newResponse","fetchWrapper","failedFetchPlugins","originalRequest","thrownError","pluginMethod","requestClone","pluginFilteredRequest","fetchResponse","fetchOptions","possiblePreloadResponse","FetchEvent","preloadResponse","PrecacheController","_cacheName","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","integrity","warningMessage","console","warn","install","toBePrecached","alreadyPrecached","existingCacheKeys","precacheRequests","updatedURLs","_addURLToCache","item","notUpdatedURLs","activate","currentlyCachedRequests","expectedCacheKeys","deletedURLs","values","cacheWillUpdatePlugin","credentials","cacheWillUpdate","redirected","ignoreSearch","getCachedURLs","matchPrecache","createHandler","fallbackToNetwork","createHandlerBoundToURL","isNav","cacheOkAndOpaquePlugin","NetworkFirst","isUsingCacheWillUpdate","_plugins","_networkTimeoutSeconds","networkTimeoutSeconds","_fetchOptions","_matchOptions","logs","promises","timeoutId","networkPromise","_getTimeoutPromise","id","promise","_getNetworkPromise","race","resolve","setTimeout","_respondFromCache","responseClone","cachePut","clearTimeout","DBWrapper","version","onupgradeneeded","onversionchange","_db","_name","_version","_onupgradeneeded","_onversionchange","close","openRequestTimedOut","OPEN_TIMEOUT","openRequest","indexedDB","onerror","evt","transaction","abort","onsuccess","db","getKey","storeName","query","getAllKeys","getAll","count","getAllMatching","includeKeys","direction","txn","done","store","objectStore","target","results","openCursor","cursor","continue","storeNames","onabort","oncomplete","_call","objStore","apply","IDBObjectStore","readonly","readwrite","precachingOptions","_cacheNames","CacheableResponse","config","_statuses","statuses","_headers","isResponseCacheable","cacheable","includes","headerName","PRECACHING_OPTIONS","capture","captureUrl","moduleName","funcName","_cacheableResponse","__WB_MANIFEST"],"mappings":"aAIE,SAAS,EAAoB,GAG5B,GAAG,EAAiB,GACnB,OAAO,EAAiB,G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EAAS,SAC5B,OAAI,EAAK,mBAAmB,oBAAoB,GAC5C,EAAO,GAEX,EAAO,UAEX,KAAK,mBAAqB,IAAI,GAAkB,GFjCtD,CAA4B,CAC3B,SAAU,CAAC,WJMW,GCER,YAAe,IMQL,ENPzB,OAAI,GAD0B,EAAZ,OAEV,OAAO,OMMU,ENNc,YMOV,KACD,kBAAkB,KNNvC,SAAS,SDLQ,IACR,gBAAgB,ICVjC,EAJO,ymBAAK,cAIoB,IAAqB,kCORtD,IACI,KAAK,uBAAyB,IAElC,MAAO","file":"sw-esm.js","sourceRoot":"","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/huge-link/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"p5Qz\");\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:cacheable-response:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof module:workbox-core\n */\nasync function copyResponse(response, modifier) {\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream() ?\n clonedResponse.body : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addFetchListener } from './utils/addFetchListener.js';\nimport './_version.js';\nlet listenerAdded = false;\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof module:workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {module:workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * [Route]{@link module:workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}\n *\n * @memberof module:workbox-routing\n * @extends module:workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * [handler's]{@link module:workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if ((url.origin !== location.origin) && (result.index !== 0)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp}' only partially matched ` +\n `against the cross-origin URL '${url}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * The Router can be used to process a FetchEvent through one or more\n * [Routes]{@link module:workbox-routing.Route} responding with a Request if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof module:workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n if (event.data && event.data.type === 'CACHE_URLS') {\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle (this is usually\n * from a fetch event, but it does not have to be).\n * @param {FetchEvent} [options.event] The event that triggered the request,\n * if applicable.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const { params, route } = this.findMatchingRoute({ url, request, event });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([\n `Found a route to handle this request:`, route,\n ]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`, params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n if (!handler && this._defaultHandler) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler.`);\n }\n handler = this._defaultHandler;\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n if (responsePromise instanceof Promise && this._catchHandler) {\n responsePromise = responsePromise.catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {Request} options.request The request to match.\n * @param {Event} [options.event] The corresponding event (unless N/A).\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(url, URL, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.url',\n });\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.request',\n });\n }\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n const matchResult = route.match({ url, request, event });\n if (matchResult) {\n // See https://github.com/GoogleChrome/workbox/issues/2079\n params = matchResult;\n if (Array.isArray(matchResult) && matchResult.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if ((matchResult.constructor === Object &&\n Object.keys(matchResult).length === 0)) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setDefaultHandler(handler) {\n this._defaultHandler = normalizeHandler(handler);\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","export const isNav = event => event.request.mode === 'navigate';\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n /**\n * Returns a valid response (to allow caching) if the status is 200 (OK) or\n * 0 (opaque).\n *\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: async ({ response }) => {\n if (response.status === 200 || response.status === 0) {\n return response;\n }\n return null;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { messages } from './utils/messages.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @memberof module:workbox-strategies\n */\nclass NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames.getRuntimeName(options.cacheName);\n if (options.plugins) {\n const isUsingCacheWillUpdate = options.plugins.some((plugin) => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ?\n options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n }\n else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n if (process.env.NODE_ENV !== 'production') {\n if (this._networkTimeoutSeconds) {\n assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds',\n });\n }\n }\n this._fetchOptions = options.fetchOptions;\n this._matchOptions = options.matchOptions;\n }\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link module:workbox-routing.Router}.\n *\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {Event} [options.event] The event that triggered the request.\n * @return {Promise}\n */\n async handle({ event, request }) {\n const logs = [];\n if (typeof request === 'string') {\n request = new Request(request);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest',\n });\n }\n const promises = [];\n let timeoutId;\n if (this._networkTimeoutSeconds) {\n const { id, promise } = this._getTimeoutPromise({ request, event, logs });\n timeoutId = id;\n promises.push(promise);\n }\n const networkPromise = this._getNetworkPromise({ timeoutId, request, event, logs });\n promises.push(networkPromise);\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = await Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = await networkPromise;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url });\n }\n return response;\n }\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs array\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _getTimeoutPromise({ request, logs, event }) {\n let timeoutId;\n const timeoutPromise = new Promise((resolve) => {\n const onNetworkTimeout = async () => {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Timing out the network response at ` +\n `${this._networkTimeoutSeconds} seconds.`);\n }\n resolve(await this._respondFromCache({ request, event }));\n };\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n return {\n promise: timeoutPromise,\n id: timeoutId,\n };\n }\n /**\n * @param {Object} options\n * @param {number|undefined} options.timeoutId\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs Array.\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n async _getNetworkPromise({ timeoutId, request, logs, event }) {\n let error;\n let response;\n try {\n response = await fetchWrapper.fetch({\n request,\n event,\n fetchOptions: this._fetchOptions,\n plugins: this._plugins,\n });\n }\n catch (err) {\n error = err;\n }\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network. Will respond ` +\n `with a cached response.`);\n }\n }\n if (error || !response) {\n response = await this._respondFromCache({ request, event });\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Found a cached response in the '${this._cacheName}'` +\n ` cache.`);\n }\n else {\n logs.push(`No response found in the '${this._cacheName}' cache.`);\n }\n }\n }\n else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper.put({\n cacheName: this._cacheName,\n request,\n response: responseClone,\n event,\n plugins: this._plugins,\n });\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n }\n catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to ensure service worker stays alive when ` +\n `updating cache for '${getFriendlyURL(request.url)}'.`);\n }\n }\n }\n }\n return response;\n }\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Object} options\n * @param {Request} request The request to match in the cache\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _respondFromCache({ event, request }) {\n return cacheWrapper.match({\n cacheName: this._cacheName,\n request,\n event,\n matchOptions: this._matchOptions,\n plugins: this._plugins,\n });\n }\n}\nexport { NetworkFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A class that wraps common IndexedDB functionality in a promise-based API.\n * It exposes all the underlying power and functionality of IndexedDB, but\n * wraps the most commonly used features in a way that's much simpler to use.\n *\n * @private\n */\nexport class DBWrapper {\n /**\n * @param {string} name\n * @param {number} version\n * @param {Object=} [callback]\n * @param {!Function} [callbacks.onupgradeneeded]\n * @param {!Function} [callbacks.onversionchange] Defaults to\n * DBWrapper.prototype._onversionchange when not specified.\n * @private\n */\n constructor(name, version, { onupgradeneeded, onversionchange, } = {}) {\n this._db = null;\n this._name = name;\n this._version = version;\n this._onupgradeneeded = onupgradeneeded;\n this._onversionchange = onversionchange || (() => this.close());\n }\n /**\n * Returns the IDBDatabase instance (not normally needed).\n * @return {IDBDatabase|undefined}\n *\n * @private\n */\n get db() {\n return this._db;\n }\n /**\n * Opens a connected to an IDBDatabase, invokes any onupgradedneeded\n * callback, and added an onversionchange callback to the database.\n *\n * @return {IDBDatabase}\n * @private\n */\n async open() {\n if (this._db)\n return;\n this._db = await new Promise((resolve, reject) => {\n // This flag is flipped to true if the timeout callback runs prior\n // to the request failing or succeeding. Note: we use a timeout instead\n // of an onblocked handler since there are cases where onblocked will\n // never never run. A timeout better handles all possible scenarios:\n // https://github.com/w3c/IndexedDB/issues/223\n let openRequestTimedOut = false;\n setTimeout(() => {\n openRequestTimedOut = true;\n reject(new Error('The open request was blocked and timed out'));\n }, this.OPEN_TIMEOUT);\n const openRequest = indexedDB.open(this._name, this._version);\n openRequest.onerror = () => reject(openRequest.error);\n openRequest.onupgradeneeded = (evt) => {\n if (openRequestTimedOut) {\n openRequest.transaction.abort();\n openRequest.result.close();\n }\n else if (typeof this._onupgradeneeded === 'function') {\n this._onupgradeneeded(evt);\n }\n };\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n if (openRequestTimedOut) {\n db.close();\n }\n else {\n db.onversionchange = this._onversionchange.bind(this);\n resolve(db);\n }\n };\n });\n return this;\n }\n /**\n * Polyfills the native `getKey()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @return {Array}\n * @private\n */\n async getKey(storeName, query) {\n return (await this.getAllKeys(storeName, query, 1))[0];\n }\n /**\n * Polyfills the native `getAll()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAll(storeName, query, count) {\n return await this.getAllMatching(storeName, { query, count });\n }\n /**\n * Polyfills the native `getAllKeys()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAllKeys(storeName, query, count) {\n const entries = await this.getAllMatching(storeName, { query, count, includeKeys: true });\n return entries.map((entry) => entry.key);\n }\n /**\n * Supports flexible lookup in an object store by specifying an index,\n * query, direction, and count. This method returns an array of objects\n * with the signature .\n *\n * @param {string} storeName\n * @param {Object} [opts]\n * @param {string} [opts.index] The index to use (if specified).\n * @param {*} [opts.query]\n * @param {IDBCursorDirection} [opts.direction]\n * @param {number} [opts.count] The max number of results to return.\n * @param {boolean} [opts.includeKeys] When true, the structure of the\n * returned objects is changed from an array of values to an array of\n * objects in the form {key, primaryKey, value}.\n * @return {Array}\n * @private\n */\n async getAllMatching(storeName, { index, query = null, // IE/Edge errors if query === `undefined`.\n direction = 'next', count, includeKeys = false, } = {}) {\n return await this.transaction([storeName], 'readonly', (txn, done) => {\n const store = txn.objectStore(storeName);\n const target = index ? store.index(index) : store;\n const results = [];\n const request = target.openCursor(query, direction);\n request.onsuccess = () => {\n const cursor = request.result;\n if (cursor) {\n results.push(includeKeys ? cursor : cursor.value);\n if (count && results.length >= count) {\n done(results);\n }\n else {\n cursor.continue();\n }\n }\n else {\n done(results);\n }\n };\n });\n }\n /**\n * Accepts a list of stores, a transaction type, and a callback and\n * performs a transaction. A promise is returned that resolves to whatever\n * value the callback chooses. The callback holds all the transaction logic\n * and is invoked with two arguments:\n * 1. The IDBTransaction object\n * 2. A `done` function, that's used to resolve the promise when\n * when the transaction is done, if passed a value, the promise is\n * resolved to that value.\n *\n * @param {Array} storeNames An array of object store names\n * involved in the transaction.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {!Function} callback\n * @return {*} The result of the transaction ran by the callback.\n * @private\n */\n async transaction(storeNames, type, callback) {\n await this.open();\n return await new Promise((resolve, reject) => {\n const txn = this._db.transaction(storeNames, type);\n txn.onabort = () => reject(txn.error);\n txn.oncomplete = () => resolve();\n callback(txn, (value) => resolve(value));\n });\n }\n /**\n * Delegates async to a native IDBObjectStore method.\n *\n * @param {string} method The method name.\n * @param {string} storeName The object store name.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {...*} args The list of args to pass to the native method.\n * @return {*} The result of the transaction.\n * @private\n */\n async _call(method, storeName, type, ...args) {\n const callback = (txn, done) => {\n const objStore = txn.objectStore(storeName);\n // TODO(philipwalton): Fix this underlying TS2684 error.\n // @ts-ignore\n const request = objStore[method].apply(objStore, args);\n request.onsuccess = () => done(request.result);\n };\n return await this.transaction([storeName], type, callback);\n }\n /**\n * Closes the connection opened by `DBWrapper.open()`. Generally this method\n * doesn't need to be called since:\n * 1. It's usually better to keep a connection open since opening\n * a new connection is somewhat slow.\n * 2. Connections are automatically closed when the reference is\n * garbage collected.\n * The primary use case for needing to close a connection is when another\n * reference (typically in another tab) needs to upgrade it and would be\n * blocked by the current, open connection.\n *\n * @private\n */\n close() {\n if (this._db) {\n this._db.close();\n this._db = null;\n }\n }\n}\n// Exposed on the prototype to let users modify the default timeout on a\n// per-instance or global basis.\nDBWrapper.prototype.OPEN_TIMEOUT = 2000;\n// Wrap native IDBObjectStore methods according to their mode.\nconst methodsToWrap = {\n readonly: ['get', 'count', 'getKey', 'getAll', 'getAllKeys'],\n readwrite: ['add', 'put', 'clear', 'delete'],\n};\nfor (const [mode, methods] of Object.entries(methodsToWrap)) {\n for (const method of methods) {\n if (method in IDBObjectStore.prototype) {\n // Don't use arrow functions here since we're outside of the class.\n DBWrapper.prototype[method] =\n async function (storeName, ...args) {\n return await this._call(method, storeName, mode, ...args);\n };\n }\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof module:workbox-routing\n */\nfunction setCatchHandler(handler) {\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","import { registerRoute, setCatchHandler } from 'workbox-routing';\nimport { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';\nimport { isNav } from './utils';\nimport { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';\n\nexport function getFiles() {\n\treturn self.__WB_MANIFEST;\n}\n\nexport function setupPrecaching(precacheFiles, precachingOptions) {\n\tprecacheAndRoute(precacheFiles, precachingOptions || PRECACHING_OPTIONS);\n}\n\nexport function setupRouting() {\n\t/**\n\t * Adding this before `precacheAndRoute` lets us handle all\n\t * the navigation requests even if they are in precache.\n\t */\n\tregisterRoute(({ event }) => isNav(event), NETWORK_HANDLER);\n\n\tsetCatchHandler(({ event }) => {\n\t\tif (isNav(event)) {\n\t\t\treturn caches.match(getCacheKeyForURL('/200.html'));\n\t\t}\n\t\treturn Response.error();\n\t});\n}\n\nexport { PRECACHING_OPTIONS };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n * `googleAnalytics` properties.\n *\n * @memberof module:workbox-core\n */\nconst cacheNames = {\n get googleAnalytics() {\n return _cacheNames.getGoogleAnalyticsName();\n },\n get precache() {\n return _cacheNames.getPrecacheName();\n },\n get prefix() {\n return _cacheNames.getPrefix();\n },\n get runtime() {\n return _cacheNames.getRuntimeName();\n },\n get suffix() {\n return _cacheNames.getSuffix();\n },\n};\nexport { cacheNames };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponse {\n /**\n * To construct a new CacheableResponse instance you must provide at least\n * one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(config.statuses || config.headers)) {\n throw new WorkboxError('statuses-or-headers-required', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n });\n }\n if (config.statuses) {\n assert.isArray(config.statuses, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.statuses',\n });\n }\n if (config.headers) {\n assert.isType(config.headers, 'object', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.headers',\n });\n }\n }\n this._statuses = config.statuses;\n this._headers = config.headers;\n }\n /**\n * Checks a response to see whether it's cacheable or not, based on this\n * object's configuration.\n *\n * @param {Response} response The response whose cacheability is being\n * checked.\n * @return {boolean} `true` if the `Response` is cacheable, and `false`\n * otherwise.\n */\n isResponseCacheable(response) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(response, Response, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'isResponseCacheable',\n paramName: 'response',\n });\n }\n let cacheable = true;\n if (this._statuses) {\n cacheable = this._statuses.includes(response.status);\n }\n if (this._headers && cacheable) {\n cacheable = Object.keys(this._headers).some((headerName) => {\n return response.headers.get(headerName) === this._headers[headerName];\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!cacheable) {\n logger.groupCollapsed(`The request for ` +\n `'${getFriendlyURL(response.url)}' returned a response that does ` +\n `not meet the criteria for being cached.`);\n logger.groupCollapsed(`View cacheability criteria here.`);\n logger.log(`Cacheable statuses: ` +\n JSON.stringify(this._statuses));\n logger.log(`Cacheable headers: ` +\n JSON.stringify(this._headers, null, 2));\n logger.groupEnd();\n const logFriendlyHeaders = {};\n response.headers.forEach((value, key) => {\n logFriendlyHeaders[key] = value;\n });\n logger.groupCollapsed(`View response status and headers here.`);\n logger.log(`Response status: ` + response.status);\n logger.log(`Response headers: ` +\n JSON.stringify(logFriendlyHeaders, null, 2));\n logger.groupEnd();\n logger.groupCollapsed(`View full response details here.`);\n logger.log(response.headers);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n }\n return cacheable;\n }\n}\nexport { CacheableResponse };\n","import { NetworkFirst } from 'workbox-strategies';\nimport { cacheNames } from 'workbox-core';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response';\n\nexport const PRECACHING_OPTIONS = {};\n\nexport const NETWORK_HANDLER = new NetworkFirst({\n\t// this cache is plunged with every new service worker deploy so we dont need to care about purging the cache.\n\tcacheName: cacheNames.precache,\n\tnetworkTimeoutSeconds: 5, // if u dont start getting headers within 5 sec fallback to cache.\n\tplugins: [\n\t\tnew CacheableResponsePlugin({\n\t\t\tstatuses: [200], // only cache valid responses, not opaque responses e.g. wifi portal.\n\t\t}),\n\t],\n});\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {module:workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {module:workbox-routing.Route} The generated `Route`(Useful for\n * unregistering).\n *\n * @memberof module:workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http') ?\n captureUrl.pathname : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if ((new RegExp(`${wildcards}`)).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if ((url.pathname === captureUrl.pathname) &&\n (url.origin !== captureUrl.origin)) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n /**\n * To construct a new CacheableResponsePlugin instance you must provide at\n * least one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config) {\n /**\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n * @private\n */\n this.cacheWillUpdate = async ({ response }) => {\n if (this._cacheableResponse.isResponseCacheable(response)) {\n return response;\n }\n return null;\n };\n this._cacheableResponse = new CacheableResponse(config);\n }\n}\nexport { CacheableResponsePlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof module:workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n const precacheController = getOrCreatePrecacheController();\n return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n"]} \ No newline at end of file diff --git a/docs/sw.js b/docs/sw.js index 9782aa6..c12ea68 100644 --- a/docs/sw.js +++ b/docs/sw.js @@ -1,2 +1,2 @@ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(t){return e[t]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s="p5Qz")}({"2Gk3":function(){"use strict";try{self["workbox:cacheable-response:5.1.4"]&&_()}catch(e){}},Gpc1:function(){"use strict";try{self["workbox:precaching:5.1.4"]&&_()}catch(e){}},I3Xu:function(){"use strict";try{self["workbox:routing:5.1.4"]&&_()}catch(e){}},myed:function(){"use strict";try{self["workbox:strategies:5.1.4"]&&_()}catch(e){}},p5Qz:function(e,t,r){"use strict";function n(e){var t="function"==typeof Map?new Map:void 0;return(n=function(e){function r(){return o(e,arguments,c(this).constructor)}if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function o(){return(o=i()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&u(o,r.prototype),o}).apply(null,arguments)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(self.addEventListener("install",ae),self.addEventListener("activate",le))}(e),U(t)}function x(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),o=1;o0&&(t+=" :: "+JSON.stringify(n)),t},E=function(e){function t(t,r){var n,o=M(t,r);return(n=e.call(this,o)||this).name=t,n.details=r,n}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(n(Error)),N=(r("I3Xu"),function(e){return e&&"object"==typeof e?e:{handle:e}}),k=function(e,t,r){void 0===r&&(r="GET"),this.handler=N(t),this.match=e,this.method=r},W=function(e){function t(t,r,n){return e.call(this,(function(e){var r=e.url,n=t.exec(r.href);if(n&&(r.origin===location.origin||0===n.index))return n.slice(1)}),r,n)||this}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(k),F=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),"")},H=function(){function e(){this._routes=new Map}var t,r,n,o=e.prototype;return o.addFetchListener=function(){var e=this;self.addEventListener("fetch",(function(t){var r=e.handleRequest({request:t.request,event:t});r&&t.respondWith(r)}))},o.addCacheListener=function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){0;var r=Promise.all(t.data.payload.urlsToCache.map((function(t){"string"==typeof t&&(t=[t]);var r=l(Request,t);return e.handleRequest({request:r})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))},o.handleRequest=function(e){var t=this,r=e.request,n=e.event;var o=new URL(r.url,location.href);if(o.protocol.startsWith("http")){var i=this.findMatchingRoute({url:o,request:r,event:n}),u=i.params,c=i.route,s=c&&c.handler;if(!s&&this._defaultHandler&&(s=this._defaultHandler),s){var a;0;try{a=s.handle({url:o,request:r,event:n,params:u})}catch(e){a=Promise.reject(e)}return a instanceof Promise&&this._catchHandler&&(a=a.catch((function(){return t._catchHandler.handle({url:o,request:r,event:n})}))),a}}},o.findMatchingRoute=function(e){var t=e.url,r=e.request,n=e.event;for(var o,i=s(this._routes.get(r.method)||[]);!(o=i()).done;){var u=o.value,c=void 0,a=u.match({url:t,request:r,event:n});if(a)return c=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(c=void 0),{route:u,params:c}}return{}},o.setDefaultHandler=function(e){this._defaultHandler=N(e)},o.setCatchHandler=function(e){this._catchHandler=N(e)},o.registerRoute=function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)},o.unregisterRoute=function(e){if(!this._routes.has(e.method))throw new E("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new E("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)},t=e,(r=[{key:"routes",get:function(){return this._routes}}])&&d(t.prototype,r),n&&d(t,n),e}(),D=function(){return L||((L=new H).addFetchListener(),L.addCacheListener()),L},B=(r("Gpc1"),[]),$=function(){return B},G={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},X=function(e){return[G.prefix,e,G.suffix].filter((function(e){return e&&e.length>0})).join("-")},Q=function(e){return e||X(G.googleAnalytics)},z=function(e){return e||X(G.precache)},J=function(){return G.prefix},V=function(e){return e||X(G.runtime)},Y=function(){return G.suffix},Z=new Set,ee=function(e,t){return e.filter((function(e){return t in e}))},te=function(e){return new Promise((function(t,r){function n(){return(h=l()).done?[1]:(f=h.value,Promise.resolve(f.cacheKeyWillBeUsed.call(f,{mode:u,request:a})).then((function(e){try{return"string"==typeof(a=e)&&(a=new Request(a)),n}catch(e){return r(e)}}),r))}function o(){return t(a)}var i,u,c,s,a,l,h,f,d;return i=e.request,u=e.mode,s=ee(void 0===(c=e.plugins)?[]:c,"cacheKeyWillBeUsed"),a=i,l=v(s),(d=function(e){for(;e;){if(e.then)return void e.then(d,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n)}))},re=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p;return n=e.cacheName,o=e.request,i=e.event,u=e.matchOptions,s=void 0===(c=e.plugins)?[]:c,Promise.resolve(self.caches.open(n)).then(function(e){try{return a=e,Promise.resolve(te({plugins:s,request:o,mode:"read"})).then(function(e){try{return l=e,Promise.resolve(a.match(l,u)).then(function(e){try{{var o;function c(){if((d=f()).done)return[1];{if("cachedResponseWillBeUsed"in(p=d.value))return Promise.resolve(p.cachedResponseWillBeUsed.call(p,{cacheName:n,event:i,matchOptions:u,cachedResponse:h,request:l})).then(function(t){try{return h=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);function e(){return c}return e.call(this)}}return h=e,f=v(s),(o=function(e){for(;e;){if(e.then)return void e.then(o,r);try{if(e.pop){if(e.length)return e.pop()?a.call(this):e;e=c}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c);function a(){return t(h)}}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}))},ne=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,y,m,g;return n=e.cacheName,o=e.response,i=e.event,c=void 0===(u=e.plugins)?[]:u,s=e.matchOptions,Promise.resolve(te({plugins:c,request:e.request,mode:"write"})).then(function(e){try{return a=e,o?Promise.resolve((u={event:i,plugins:c,response:o,request:a},new Promise((function(e,t){function r(){if((h=l()).done)return[1];{if("cacheWillUpdate"in(f=h.value))return a=!0,Promise.resolve(f.cacheWillUpdate.call(f,{request:o,response:s,event:i})).then(function(r){try{return(s=r)?e.call(this):[1]}catch(e){return t(e)}}.bind(this),t);function e(){return r}return e.call(this)}}function n(){return a||(s=s&&200===s.status?s:void 0),e(s||null)}var o,i,c,s,a,l,h,f,d;return o=u.request,i=u.event,s=u.response,a=!1,l=v(void 0===(c=u.plugins)?[]:c),(d=function(e){for(;e;){if(e.then)return void e.then(d,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)})))).then(function(e){try{return(l=e)?Promise.resolve(self.caches.open(n)).then(function(e){try{return h=e,f=ee(c,"cacheDidUpdate"),Promise.resolve(new Promise((function(e,t){return f.length>0?Promise.resolve(re({cacheName:n,matchOptions:s,request:a})).then(e,t):e(null)}))).then(function(e){try{d=e;var o=function(e){try{if("QuotaExceededError"===e.name)return Promise.resolve(new Promise((function(e,t){function r(){return(i=o()).done?[1]:Promise.resolve((0,i.value)()).then((function(){try{return r}catch(e){return t(e)}}),t)}function n(){return e()}var o,i,u;return o=p(Z),(u=function(e){for(;e;){if(e.then)return void e.then(u,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)}))).then(function(){try{return t.call(this)}catch(e){return r(e)}}.bind(this),r);function t(){throw e}return t.call(this)}catch(e){return r(e)}}.bind(this);try{return Promise.resolve(h.put(a,l)).then((function(){try{return function(){try{var e;function o(){return(m=y()).done?[1]:(g=m.value,Promise.resolve(g.cacheDidUpdate.call(g,{cacheName:n,event:i,oldResponse:d,newResponse:l,request:a})).then((function(){try{return o}catch(e){return r(e)}}),r))}return y=v(f),(e=function(t){for(;t;){if(t.then)return void t.then(e,r);try{if(t.pop){if(t.length)return t.pop()?u.call(this):t;t=o}else t=t.call(this)}catch(e){return r(e)}}}.bind(this))(o);function u(){return t()}}catch(e){return r(e)}}()}catch(e){return o(e)}}),o)}catch(e){o(e)}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r):t()}catch(e){return r(e)}}.bind(this),r):r(new E("cache-put-with-no-response",{url:F(a.url)}))}catch(e){return r(e)}var u}.bind(this),r)}))},oe=re,ie=function(e){return new Promise((function(t,r){function n(){l=ee(s,"fetchDidFail"),h=l.length>0?o.clone():null;var e=function(e){try{throw new E("plugin-error-request-will-fetch",{thrownError:e})}catch(e){return r(e)}};try{var n;function c(){if((d=f()).done)return[1];{if("requestWillFetch"in(p=d.value))return y=p.requestWillFetch,v=o.clone(),Promise.resolve(y.call(p,{request:v,event:u})).then(function(r){try{return o=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return c}return t.call(this)}}return f=g(s),(n=function(t){for(;t;){if(t.then)return void t.then(n,e);try{if(t.pop){if(t.length)return t.pop()?a.call(this):t;t=c}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(c);function a(){return function(){try{m=o.clone();var e=function(e){try{{var t;function n(){return(S=R()).done?[1]:(A=S.value,Promise.resolve(A.fetchDidFail.call(A,{error:e,event:u,originalRequest:h.clone(),request:m.clone()})).then((function(){try{return n}catch(e){return r(e)}}),r))}return R=g(l),(t=function(e){for(;e;){if(e.then)return void e.then(t,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n);function o(){throw e}}}catch(e){return r(e)}}.bind(this);try{return"navigate"===o.mode?Promise.resolve(fetch(o)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e):Promise.resolve(fetch(o,i)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e);function n(){function r(){if((_=w()).done)return[1];{if("fetchDidSucceed"in(P=_.value))return Promise.resolve(P.fetchDidSucceed.call(P,{event:u,request:m,response:b})).then(function(r){try{return b=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return r}return t.call(this)}}function n(){return t(b)}var o;return w=g(s),(o=function(t){for(;t;){if(t.then)return void t.then(o,e);try{if(t.pop){if(t.length)return t.pop()?n.call(this):t;t=r}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(r)}}catch(t){e(t)}}catch(e){return r(e)}}()}}catch(t){e(t)}}var o,i,u,c,s,a,l,h,f,d,p,y,v,m,b,w,_,P,R,S,A;return i=e.fetchOptions,u=e.event,s=void 0===(c=e.plugins)?[]:c,"string"==typeof(o=e.request)&&(o=new Request(o)),u instanceof FetchEvent&&u.preloadResponse?Promise.resolve(u.preloadResponse).then(function(e){try{return(a=e)?t(a):n.call(this)}catch(e){return r(e)}}.bind(this),r):n.call(this)}))},ue=function(){function e(e){this._cacheName=z(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}var t=e.prototype;return t.addToCacheList=function(e){for(var t,r=[],n=P(e);!(t=n()).done;){var o=t.value;"string"==typeof o?r.push(o):o&&void 0===o.revision&&r.push(o.url);var i=_(o),u=i.cacheKey,c=i.url,s="string"!=typeof o&&o.revision?"reload":"default";if(this._urlsToCacheKeys.has(c)&&this._urlsToCacheKeys.get(c)!==u)throw new E("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(c),secondEntry:u});if("string"!=typeof o&&o.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==o.integrity)throw new E("add-to-cache-list-conflicting-integrities",{url:c});this._cacheKeysToIntegrities.set(u,o.integrity)}if(this._urlsToCacheKeys.set(c,u),this._urlsToCacheModes.set(c,s),r.length>0){var a="Workbox is precaching URLs without revision info: "+r.join(", ")+"\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache";console.warn(a)}}},t.install=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p,y,v;return n=this,i=(o=void 0===e?{}:e).event,u=o.plugins,c=[],s=[],Promise.resolve(self.caches.open(this._cacheName)).then(function(e){try{return Promise.resolve(e.keys()).then(function(e){try{for(a=new Set(e.map((function(e){return e.url}))),l=P(this._urlsToCacheKeys);!(h=l()).done;)d=(f=h.value)[0],a.has(p=f[1])?s.push(d):c.push({cacheKey:p,url:d});return y=c.map((function(e){var t=e.cacheKey,r=e.url,o=n._cacheKeysToIntegrities.get(t),c=n._urlsToCacheModes.get(r);return n._addURLToCache({cacheKey:t,cacheMode:c,event:i,integrity:o,plugins:u,url:r})})),Promise.resolve(Promise.all(y)).then((function(){try{return v=c.map((function(e){return e.url})),t({updatedURLs:v,notUpdatedURLs:s})}catch(e){return r(e)}}),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.activate=function(){return new Promise(function(e,t){var r,n,o,i,u,c,s;return Promise.resolve(self.caches.open(this._cacheName)).then(function(a){try{return r=a,Promise.resolve(r.keys()).then(function(a){try{{var l;function h(){if((c=u()).done)return[1];{if(!o.has((s=c.value).url))return Promise.resolve(r.delete(s)).then(function(){try{return i.push(s.url),e.call(this)}catch(e){return t(e)}}.bind(this),t);function e(){return h}return e.call(this)}}return n=a,o=new Set(this._urlsToCacheKeys.values()),i=[],u=P(n),(l=function(e){for(;e;){if(e.then)return void e.then(l,t);try{if(e.pop){if(e.length)return e.pop()?f.call(this):e;e=h}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(h);function f(){return e({deletedURLs:i})}}}catch(e){return t(e)}}.bind(this),t)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},t._addURLToCache=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f;return n=e.cacheKey,o=e.url,i=e.event,u=e.plugins,c=new Request(o,{integrity:e.integrity,cache:e.cacheMode,credentials:"same-origin"}),Promise.resolve(ie({event:i,plugins:u,request:c})).then(function(e){try{for(s=e,l=P(u||[]);!(h=l()).done;)"cacheWillUpdate"in(f=h.value)&&(a=f);return Promise.resolve(new Promise((function(e,t){return a?Promise.resolve(a.cacheWillUpdate({event:i,request:c,response:s})).then(e,t):e(s.status<400)}))).then(function(e){try{if(!e)return r(new E("bad-precaching-response",{url:o,status:s.status}));if(s.redirected)return Promise.resolve(w(s)).then(function(e){try{return s=e,a.call(this)}catch(e){return r(e)}}.bind(this),r);function a(){return Promise.resolve(ne({event:i,plugins:u,response:s,request:n===o?c:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})).then((function(){try{return t()}catch(e){return r(e)}}),r)}return a.call(this)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.getURLsToCacheKeys=function(){return this._urlsToCacheKeys},t.getCachedURLs=function(){return[].concat(this._urlsToCacheKeys.keys())},t.getCacheKeyForURL=function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)},t.matchPrecache=function(e){return new Promise(function(t,r){var n,o;return n=e instanceof Request?e.url:e,(o=this.getCacheKeyForURL(n))?Promise.resolve(self.caches.open(this._cacheName)).then((function(e){try{return t(e.match(o))}catch(e){return r(e)}}),r):t(void 0)}.bind(this))},t.createHandler=function(e){var t=this;return void 0===e&&(e=!0),function(r){return new Promise((function(n,o){var i,u;i=r.request;var c=function(t){try{if(e)return n(fetch(i));throw t}catch(e){return o(e)}};try{return Promise.resolve(t.matchPrecache(i)).then((function(e){try{if(u=e)return n(u);throw new E("missing-precache-entry",{cacheName:t._cacheName,url:i instanceof Request?i.url:i})}catch(e){return c(e)}}),c)}catch(e){c(e)}}))}},t.createHandlerBoundToURL=function(e,t){if(void 0===t&&(t=!0),!this.getCacheKeyForURL(e))throw new E("non-precached-url",{url:e});var r=this.createHandler(t),n=new Request(e);return function(){return r({request:n})}},e}(),ce=function(){return K||(K=new ue),K},se=!1,ae=function(e){var t=ce(),r=$();e.waitUntil(t.install({event:e,plugins:r}).catch((function(e){throw e})))},le=function(e){var t=ce();e.waitUntil(t.activate())},he=function(e){return"navigate"===e.request.mode},fe=(r("myed"),{cacheWillUpdate:function(e){return new Promise((function(t){var r=e.response;return t(200===r.status||0===r.status?r:null)}))}}),de=function(){function e(e){if(void 0===e&&(e={}),this._cacheName=V(e.cacheName),e.plugins){var t=e.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=t?e.plugins:[fe].concat(e.plugins)}else this._plugins=[fe];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}var t=e.prototype;return t.handle=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l;return n=e.event,i=[],"string"==typeof(o=e.request)&&(o=new Request(o)),u=[],this._networkTimeoutSeconds&&(c=(s=this._getTimeoutPromise({request:o,event:n,logs:i})).id,u.push(s.promise)),a=this._getNetworkPromise({timeoutId:c,request:o,event:n,logs:i}),u.push(a),Promise.resolve(Promise.race(u)).then(function(e){try{if(!(l=e))return Promise.resolve(a).then(function(e){try{return l=e,n.call(this)}catch(e){return r(e)}}.bind(this),r);function n(){return l?t(l):r(new E("no-response",{url:o.url}))}return n.call(this)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t._getTimeoutPromise=function(e){var t,r=this,n=e.request,o=e.event;return{promise:new Promise((function(e){t=setTimeout((function(){return new Promise((function(t,i){return Promise.resolve(r._respondFromCache({request:n,event:o})).then((function(r){try{return e(r),t()}catch(e){return i(e)}}),i)}))}),1e3*r._networkTimeoutSeconds)})),id:t}},t._getNetworkPromise=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a;n=e.timeoutId,o=e.request,i=e.event;var l=function(){try{if(n&&clearTimeout(n),u||!c)return Promise.resolve(this._respondFromCache({request:o,event:i})).then(function(t){try{return c=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);if(s=c.clone(),a=ne({cacheName:this._cacheName,request:o,response:s,event:i,plugins:this._plugins}),i)try{i.waitUntil(a)}catch(e){0}return e.call(this);function e(){return t(c)}}catch(e){return r(e)}}.bind(this),h=function(e){try{return u=e,l()}catch(e){return r(e)}};try{return Promise.resolve(ie({request:o,event:i,fetchOptions:this._fetchOptions,plugins:this._plugins})).then((function(e){try{return c=e,l()}catch(e){return h(e)}}),h)}catch(e){h(e)}}.bind(this))},t._respondFromCache=function(e){return oe({cacheName:this._cacheName,request:e.request,event:e.event,matchOptions:this._matchOptions,plugins:this._plugins})},e}(),pe=function(){function e(e,t,r){var n=this,o=void 0===r?{}:r,i=o.onupgradeneeded,u=o.onversionchange;this._db=null,this._name=e,this._version=t,this._onupgradeneeded=i,this._onversionchange=u||function(){return n.close()}}var t,r,n,o=e.prototype;return o.open=function(){return new Promise(function(e,t){var r;return r=this,this._db?e():Promise.resolve(new Promise((function(e,t){var n=!1;setTimeout((function(){n=!0,t(new Error("The open request was blocked and timed out"))}),r.OPEN_TIMEOUT);var o=indexedDB.open(r._name,r._version);o.onerror=function(){return t(o.error)},o.onupgradeneeded=function(e){n?(o.transaction.abort(),o.result.close()):"function"==typeof r._onupgradeneeded&&r._onupgradeneeded(e)},o.onsuccess=function(){var t=o.result;n?t.close():(t.onversionchange=r._onversionchange.bind(r),e(t))}}))).then(function(r){try{return this._db=r,e(this)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},o.getKey=function(e,t){return new Promise(function(r,n){return Promise.resolve(this.getAllKeys(e,t,1)).then((function(e){try{return r(e[0])}catch(e){return n(e)}}),n)}.bind(this))},o.getAll=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r})).then(n,o)}.bind(this))},o.getAllKeys=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r,includeKeys:!0})).then((function(e){try{return n(e.map((function(e){return e.key})))}catch(e){return o(e)}}),o)}.bind(this))},o.getAllMatching=function(e,t){return new Promise(function(r,n){var o,i,u,c,s,a,l,h,f;return i=(o=void 0===t?{}:t).index,c=void 0===(u=o.query)?null:u,a=void 0===(s=o.direction)?"next":s,l=o.count,f=void 0!==(h=o.includeKeys)&&h,Promise.resolve(this.transaction([e],"readonly",(function(t,r){var n=t.objectStore(e),o=i?n.index(i):n,u=[],s=o.openCursor(c,a);s.onsuccess=function(){var e=s.result;e?(u.push(f?e:e.value),l&&u.length>=l?r(u):e.continue()):r(u)}}))).then(r,n)}.bind(this))},o.transaction=function(e,t,r){return new Promise(function(n,o){var i;return i=this,Promise.resolve(this.open()).then((function(){try{return Promise.resolve(new Promise((function(n,o){var u=i._db.transaction(e,t);u.onabort=function(){return o(u.error)},u.oncomplete=function(){return n()},r(u,(function(e){return n(e)}))}))).then(n,o)}catch(e){return o(e)}}),o)}.bind(this))},o._call=function(e,t,r){var n=arguments;return new Promise(function(o,i){var u,c,s;for(u=n.length,c=new Array(u>3?u-3:0),s=3;s1?u-1:0),s=1;s=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(self.addEventListener("install",ae),self.addEventListener("activate",le))}(e),U(t)}function x(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),o=1;o0&&(t+=" :: "+JSON.stringify(n)),t},E=function(e){function t(t,r){var n,o=M(t,r);return(n=e.call(this,o)||this).name=t,n.details=r,n}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(n(Error)),N=(r("I3Xu"),function(e){return e&&"object"==typeof e?e:{handle:e}}),k=function(e,t,r){void 0===r&&(r="GET"),this.handler=N(t),this.match=e,this.method=r},W=function(e){function t(t,r,n){return e.call(this,(function(e){var r=e.url,n=t.exec(r.href);if(n&&(r.origin===location.origin||0===n.index))return n.slice(1)}),r,n)||this}var r,n;return n=e,(r=t).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,t}(k),F=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^"+location.origin),"")},H=function(){function e(){this._routes=new Map}var t,r,n,o=e.prototype;return o.addFetchListener=function(){var e=this;self.addEventListener("fetch",(function(t){var r=e.handleRequest({request:t.request,event:t});r&&t.respondWith(r)}))},o.addCacheListener=function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){0;var r=Promise.all(t.data.payload.urlsToCache.map((function(t){"string"==typeof t&&(t=[t]);var r=l(Request,t);return e.handleRequest({request:r})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))},o.handleRequest=function(e){var t=this,r=e.request,n=e.event;var o=new URL(r.url,location.href);if(o.protocol.startsWith("http")){var i=this.findMatchingRoute({url:o,request:r,event:n}),u=i.params,c=i.route,s=c&&c.handler;if(!s&&this._defaultHandler&&(s=this._defaultHandler),s){var a;0;try{a=s.handle({url:o,request:r,event:n,params:u})}catch(e){a=Promise.reject(e)}return a instanceof Promise&&this._catchHandler&&(a=a.catch((function(){return t._catchHandler.handle({url:o,request:r,event:n})}))),a}}},o.findMatchingRoute=function(e){var t=e.url,r=e.request,n=e.event;for(var o,i=s(this._routes.get(r.method)||[]);!(o=i()).done;){var u=o.value,c=void 0,a=u.match({url:t,request:r,event:n});if(a)return c=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(c=void 0),{route:u,params:c}}return{}},o.setDefaultHandler=function(e){this._defaultHandler=N(e)},o.setCatchHandler=function(e){this._catchHandler=N(e)},o.registerRoute=function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)},o.unregisterRoute=function(e){if(!this._routes.has(e.method))throw new E("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new E("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)},t=e,(r=[{key:"routes",get:function(){return this._routes}}])&&d(t.prototype,r),n&&d(t,n),e}(),D=function(){return L||((L=new H).addFetchListener(),L.addCacheListener()),L},B=(r("Gpc1"),[]),$=function(){return B},G={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},X=function(e){return[G.prefix,e,G.suffix].filter((function(e){return e&&e.length>0})).join("-")},Q=function(e){return e||X(G.googleAnalytics)},z=function(e){return e||X(G.precache)},J=function(){return G.prefix},V=function(e){return e||X(G.runtime)},Y=function(){return G.suffix},Z=new Set,ee=function(e,t){return e.filter((function(e){return t in e}))},te=function(e){return new Promise((function(t,r){function n(){return(h=l()).done?[1]:(f=h.value,Promise.resolve(f.cacheKeyWillBeUsed.call(f,{mode:u,request:a})).then((function(e){try{return"string"==typeof(a=e)&&(a=new Request(a)),n}catch(e){return r(e)}}),r))}function o(){return t(a)}var i,u,c,s,a,l,h,f,d;return i=e.request,u=e.mode,s=ee(void 0===(c=e.plugins)?[]:c,"cacheKeyWillBeUsed"),a=i,l=v(s),(d=function(e){for(;e;){if(e.then)return void e.then(d,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n)}))},re=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p;return n=e.cacheName,o=e.request,i=e.event,u=e.matchOptions,s=void 0===(c=e.plugins)?[]:c,Promise.resolve(self.caches.open(n)).then(function(e){try{return a=e,Promise.resolve(te({plugins:s,request:o,mode:"read"})).then(function(e){try{return l=e,Promise.resolve(a.match(l,u)).then(function(e){try{{var o;function c(){if((d=f()).done)return[1];{if("cachedResponseWillBeUsed"in(p=d.value))return Promise.resolve(p.cachedResponseWillBeUsed.call(p,{cacheName:n,event:i,matchOptions:u,cachedResponse:h,request:l})).then(function(t){try{return h=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);function e(){return c}return e.call(this)}}return h=e,f=v(s),(o=function(e){for(;e;){if(e.then)return void e.then(o,r);try{if(e.pop){if(e.length)return e.pop()?a.call(this):e;e=c}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c);function a(){return t(h)}}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}))},ne=function(e){return new Promise((function(t,r){var n,o,i,u,c,s,a,l,h,f,d,y,m,g;return n=e.cacheName,o=e.response,i=e.event,c=void 0===(u=e.plugins)?[]:u,s=e.matchOptions,Promise.resolve(te({plugins:c,request:e.request,mode:"write"})).then(function(e){try{return a=e,o?Promise.resolve((u={event:i,plugins:c,response:o,request:a},new Promise((function(e,t){function r(){if((h=l()).done)return[1];{if("cacheWillUpdate"in(f=h.value))return a=!0,Promise.resolve(f.cacheWillUpdate.call(f,{request:o,response:s,event:i})).then(function(r){try{return(s=r)?e.call(this):[1]}catch(e){return t(e)}}.bind(this),t);function e(){return r}return e.call(this)}}function n(){return a||(s=s&&200===s.status?s:void 0),e(s||null)}var o,i,c,s,a,l,h,f,d;return o=u.request,i=u.event,s=u.response,a=!1,l=v(void 0===(c=u.plugins)?[]:c),(d=function(e){for(;e;){if(e.then)return void e.then(d,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)})))).then(function(e){try{return(l=e)?Promise.resolve(self.caches.open(n)).then(function(e){try{return h=e,f=ee(c,"cacheDidUpdate"),Promise.resolve(new Promise((function(e,t){return f.length>0?Promise.resolve(re({cacheName:n,matchOptions:s,request:a})).then(e,t):e(null)}))).then(function(e){try{d=e;var o=function(e){try{if("QuotaExceededError"===e.name)return Promise.resolve(new Promise((function(e,t){function r(){return(i=o()).done?[1]:Promise.resolve((0,i.value)()).then((function(){try{return r}catch(e){return t(e)}}),t)}function n(){return e()}var o,i,u;return o=p(Z),(u=function(e){for(;e;){if(e.then)return void e.then(u,t);try{if(e.pop){if(e.length)return e.pop()?n.call(this):e;e=r}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(r)}))).then(function(){try{return t.call(this)}catch(e){return r(e)}}.bind(this),r);function t(){throw e}return t.call(this)}catch(e){return r(e)}}.bind(this);try{return Promise.resolve(h.put(a,l)).then((function(){try{return function(){try{var e;function o(){return(m=y()).done?[1]:(g=m.value,Promise.resolve(g.cacheDidUpdate.call(g,{cacheName:n,event:i,oldResponse:d,newResponse:l,request:a})).then((function(){try{return o}catch(e){return r(e)}}),r))}return y=v(f),(e=function(t){for(;t;){if(t.then)return void t.then(e,r);try{if(t.pop){if(t.length)return t.pop()?u.call(this):t;t=o}else t=t.call(this)}catch(e){return r(e)}}}.bind(this))(o);function u(){return t()}}catch(e){return r(e)}}()}catch(e){return o(e)}}),o)}catch(e){o(e)}}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r):t()}catch(e){return r(e)}}.bind(this),r):r(new E("cache-put-with-no-response",{url:F(a.url)}))}catch(e){return r(e)}var u}.bind(this),r)}))},oe=re,ie=function(e){return new Promise((function(t,r){function n(){l=ee(s,"fetchDidFail"),h=l.length>0?o.clone():null;var e=function(e){try{throw new E("plugin-error-request-will-fetch",{thrownError:e})}catch(e){return r(e)}};try{var n;function c(){if((d=f()).done)return[1];{if("requestWillFetch"in(p=d.value))return y=p.requestWillFetch,v=o.clone(),Promise.resolve(y.call(p,{request:v,event:u})).then(function(r){try{return o=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return c}return t.call(this)}}return f=g(s),(n=function(t){for(;t;){if(t.then)return void t.then(n,e);try{if(t.pop){if(t.length)return t.pop()?a.call(this):t;t=c}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(c);function a(){return function(){try{m=o.clone();var e=function(e){try{{var t;function n(){return(S=R()).done?[1]:(A=S.value,Promise.resolve(A.fetchDidFail.call(A,{error:e,event:u,originalRequest:h.clone(),request:m.clone()})).then((function(){try{return n}catch(e){return r(e)}}),r))}return R=g(l),(t=function(e){for(;e;){if(e.then)return void e.then(t,r);try{if(e.pop){if(e.length)return e.pop()?o.call(this):e;e=n}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(n);function o(){throw e}}}catch(e){return r(e)}}.bind(this);try{return"navigate"===o.mode?Promise.resolve(fetch(o)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e):Promise.resolve(fetch(o,i)).then(function(t){try{return b=t,n.call(this)}catch(t){return e(t)}}.bind(this),e);function n(){function r(){if((_=w()).done)return[1];{if("fetchDidSucceed"in(P=_.value))return Promise.resolve(P.fetchDidSucceed.call(P,{event:u,request:m,response:b})).then(function(r){try{return b=r,t.call(this)}catch(t){return e(t)}}.bind(this),e);function t(){return r}return t.call(this)}}function n(){return t(b)}var o;return w=g(s),(o=function(t){for(;t;){if(t.then)return void t.then(o,e);try{if(t.pop){if(t.length)return t.pop()?n.call(this):t;t=r}else t=t.call(this)}catch(t){return e(t)}}}.bind(this))(r)}}catch(t){e(t)}}catch(e){return r(e)}}()}}catch(t){e(t)}}var o,i,u,c,s,a,l,h,f,d,p,y,v,m,b,w,_,P,R,S,A;return i=e.fetchOptions,u=e.event,s=void 0===(c=e.plugins)?[]:c,"string"==typeof(o=e.request)&&(o=new Request(o)),u instanceof FetchEvent&&u.preloadResponse?Promise.resolve(u.preloadResponse).then(function(e){try{return(a=e)?t(a):n.call(this)}catch(e){return r(e)}}.bind(this),r):n.call(this)}))},ue=function(){function e(e){this._cacheName=z(e),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}var t=e.prototype;return t.addToCacheList=function(e){for(var t,r=[],n=P(e);!(t=n()).done;){var o=t.value;"string"==typeof o?r.push(o):o&&void 0===o.revision&&r.push(o.url);var i=_(o),u=i.cacheKey,c=i.url,s="string"!=typeof o&&o.revision?"reload":"default";if(this._urlsToCacheKeys.has(c)&&this._urlsToCacheKeys.get(c)!==u)throw new E("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(c),secondEntry:u});if("string"!=typeof o&&o.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==o.integrity)throw new E("add-to-cache-list-conflicting-integrities",{url:c});this._cacheKeysToIntegrities.set(u,o.integrity)}if(this._urlsToCacheKeys.set(c,u),this._urlsToCacheModes.set(c,s),r.length>0){var a="Workbox is precaching URLs without revision info: "+r.join(", ")+"\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache";console.warn(a)}}},t.install=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f,d,p,y,v;return n=this,i=(o=void 0===e?{}:e).event,u=o.plugins,c=[],s=[],Promise.resolve(self.caches.open(this._cacheName)).then(function(e){try{return Promise.resolve(e.keys()).then(function(e){try{for(a=new Set(e.map((function(e){return e.url}))),l=P(this._urlsToCacheKeys);!(h=l()).done;)d=(f=h.value)[0],a.has(p=f[1])?s.push(d):c.push({cacheKey:p,url:d});return y=c.map((function(e){var t=e.cacheKey,r=e.url,o=n._cacheKeysToIntegrities.get(t),c=n._urlsToCacheModes.get(r);return n._addURLToCache({cacheKey:t,cacheMode:c,event:i,integrity:o,plugins:u,url:r})})),Promise.resolve(Promise.all(y)).then((function(){try{return v=c.map((function(e){return e.url})),t({updatedURLs:v,notUpdatedURLs:s})}catch(e){return r(e)}}),r)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.activate=function(){return new Promise(function(e,t){var r,n,o,i,u,c,s;return Promise.resolve(self.caches.open(this._cacheName)).then(function(a){try{return r=a,Promise.resolve(r.keys()).then(function(a){try{{var l;function h(){if((c=u()).done)return[1];{if(!o.has((s=c.value).url))return Promise.resolve(r.delete(s)).then(function(){try{return i.push(s.url),e.call(this)}catch(e){return t(e)}}.bind(this),t);function e(){return h}return e.call(this)}}return n=a,o=new Set(this._urlsToCacheKeys.values()),i=[],u=P(n),(l=function(e){for(;e;){if(e.then)return void e.then(l,t);try{if(e.pop){if(e.length)return e.pop()?f.call(this):e;e=h}else e=e.call(this)}catch(e){return t(e)}}}.bind(this))(h);function f(){return e({deletedURLs:i})}}}catch(e){return t(e)}}.bind(this),t)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},t._addURLToCache=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l,h,f;return n=e.cacheKey,o=e.url,i=e.event,u=e.plugins,c=new Request(o,{integrity:e.integrity,cache:e.cacheMode,credentials:"same-origin"}),Promise.resolve(ie({event:i,plugins:u,request:c})).then(function(e){try{for(s=e,l=P(u||[]);!(h=l()).done;)"cacheWillUpdate"in(f=h.value)&&(a=f);return Promise.resolve(new Promise((function(e,t){return a?Promise.resolve(a.cacheWillUpdate({event:i,request:c,response:s})).then(e,t):e(s.status<400)}))).then(function(e){try{if(!e)return r(new E("bad-precaching-response",{url:o,status:s.status}));if(s.redirected)return Promise.resolve(w(s)).then(function(e){try{return s=e,a.call(this)}catch(e){return r(e)}}.bind(this),r);function a(){return Promise.resolve(ne({event:i,plugins:u,response:s,request:n===o?c:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}})).then((function(){try{return t()}catch(e){return r(e)}}),r)}return a.call(this)}catch(e){return r(e)}}.bind(this),r)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t.getURLsToCacheKeys=function(){return this._urlsToCacheKeys},t.getCachedURLs=function(){return[].concat(this._urlsToCacheKeys.keys())},t.getCacheKeyForURL=function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)},t.matchPrecache=function(e){return new Promise(function(t,r){var n,o;return n=e instanceof Request?e.url:e,(o=this.getCacheKeyForURL(n))?Promise.resolve(self.caches.open(this._cacheName)).then((function(e){try{return t(e.match(o))}catch(e){return r(e)}}),r):t(void 0)}.bind(this))},t.createHandler=function(e){var t=this;return void 0===e&&(e=!0),function(r){return new Promise((function(n,o){var i,u;i=r.request;var c=function(t){try{if(e)return n(fetch(i));throw t}catch(e){return o(e)}};try{return Promise.resolve(t.matchPrecache(i)).then((function(e){try{if(u=e)return n(u);throw new E("missing-precache-entry",{cacheName:t._cacheName,url:i instanceof Request?i.url:i})}catch(e){return c(e)}}),c)}catch(e){c(e)}}))}},t.createHandlerBoundToURL=function(e,t){if(void 0===t&&(t=!0),!this.getCacheKeyForURL(e))throw new E("non-precached-url",{url:e});var r=this.createHandler(t),n=new Request(e);return function(){return r({request:n})}},e}(),ce=function(){return K||(K=new ue),K},se=!1,ae=function(e){var t=ce(),r=$();e.waitUntil(t.install({event:e,plugins:r}).catch((function(e){throw e})))},le=function(e){var t=ce();e.waitUntil(t.activate())},he=function(e){return"navigate"===e.request.mode},fe=(r("myed"),{cacheWillUpdate:function(e){return new Promise((function(t){var r=e.response;return t(200===r.status||0===r.status?r:null)}))}}),de=function(){function e(e){if(void 0===e&&(e={}),this._cacheName=V(e.cacheName),e.plugins){var t=e.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=t?e.plugins:[fe].concat(e.plugins)}else this._plugins=[fe];this._networkTimeoutSeconds=e.networkTimeoutSeconds||0,this._fetchOptions=e.fetchOptions,this._matchOptions=e.matchOptions}var t=e.prototype;return t.handle=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a,l;return n=e.event,i=[],"string"==typeof(o=e.request)&&(o=new Request(o)),u=[],this._networkTimeoutSeconds&&(c=(s=this._getTimeoutPromise({request:o,event:n,logs:i})).id,u.push(s.promise)),a=this._getNetworkPromise({timeoutId:c,request:o,event:n,logs:i}),u.push(a),Promise.resolve(Promise.race(u)).then(function(e){try{if(!(l=e))return Promise.resolve(a).then(function(e){try{return l=e,n.call(this)}catch(e){return r(e)}}.bind(this),r);function n(){return l?t(l):r(new E("no-response",{url:o.url}))}return n.call(this)}catch(e){return r(e)}}.bind(this),r)}.bind(this))},t._getTimeoutPromise=function(e){var t,r=this,n=e.request,o=e.event;return{promise:new Promise((function(e){t=setTimeout((function(){return new Promise((function(t,i){return Promise.resolve(r._respondFromCache({request:n,event:o})).then((function(r){try{return e(r),t()}catch(e){return i(e)}}),i)}))}),1e3*r._networkTimeoutSeconds)})),id:t}},t._getNetworkPromise=function(e){return new Promise(function(t,r){var n,o,i,u,c,s,a;n=e.timeoutId,o=e.request,i=e.event;var l=function(){try{if(n&&clearTimeout(n),u||!c)return Promise.resolve(this._respondFromCache({request:o,event:i})).then(function(t){try{return c=t,e.call(this)}catch(e){return r(e)}}.bind(this),r);if(s=c.clone(),a=ne({cacheName:this._cacheName,request:o,response:s,event:i,plugins:this._plugins}),i)try{i.waitUntil(a)}catch(e){0}return e.call(this);function e(){return t(c)}}catch(e){return r(e)}}.bind(this),h=function(e){try{return u=e,l()}catch(e){return r(e)}};try{return Promise.resolve(ie({request:o,event:i,fetchOptions:this._fetchOptions,plugins:this._plugins})).then((function(e){try{return c=e,l()}catch(e){return h(e)}}),h)}catch(e){h(e)}}.bind(this))},t._respondFromCache=function(e){return oe({cacheName:this._cacheName,request:e.request,event:e.event,matchOptions:this._matchOptions,plugins:this._plugins})},e}(),pe=function(){function e(e,t,r){var n=this,o=void 0===r?{}:r,i=o.onupgradeneeded,u=o.onversionchange;this._db=null,this._name=e,this._version=t,this._onupgradeneeded=i,this._onversionchange=u||function(){return n.close()}}var t,r,n,o=e.prototype;return o.open=function(){return new Promise(function(e,t){var r;return r=this,this._db?e():Promise.resolve(new Promise((function(e,t){var n=!1;setTimeout((function(){n=!0,t(new Error("The open request was blocked and timed out"))}),r.OPEN_TIMEOUT);var o=indexedDB.open(r._name,r._version);o.onerror=function(){return t(o.error)},o.onupgradeneeded=function(e){n?(o.transaction.abort(),o.result.close()):"function"==typeof r._onupgradeneeded&&r._onupgradeneeded(e)},o.onsuccess=function(){var t=o.result;n?t.close():(t.onversionchange=r._onversionchange.bind(r),e(t))}}))).then(function(r){try{return this._db=r,e(this)}catch(e){return t(e)}}.bind(this),t)}.bind(this))},o.getKey=function(e,t){return new Promise(function(r,n){return Promise.resolve(this.getAllKeys(e,t,1)).then((function(e){try{return r(e[0])}catch(e){return n(e)}}),n)}.bind(this))},o.getAll=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r})).then(n,o)}.bind(this))},o.getAllKeys=function(e,t,r){return new Promise(function(n,o){return Promise.resolve(this.getAllMatching(e,{query:t,count:r,includeKeys:!0})).then((function(e){try{return n(e.map((function(e){return e.key})))}catch(e){return o(e)}}),o)}.bind(this))},o.getAllMatching=function(e,t){return new Promise(function(r,n){var o,i,u,c,s,a,l,h,f;return i=(o=void 0===t?{}:t).index,c=void 0===(u=o.query)?null:u,a=void 0===(s=o.direction)?"next":s,l=o.count,f=void 0!==(h=o.includeKeys)&&h,Promise.resolve(this.transaction([e],"readonly",(function(t,r){var n=t.objectStore(e),o=i?n.index(i):n,u=[],s=o.openCursor(c,a);s.onsuccess=function(){var e=s.result;e?(u.push(f?e:e.value),l&&u.length>=l?r(u):e.continue()):r(u)}}))).then(r,n)}.bind(this))},o.transaction=function(e,t,r){return new Promise(function(n,o){var i;return i=this,Promise.resolve(this.open()).then((function(){try{return Promise.resolve(new Promise((function(n,o){var u=i._db.transaction(e,t);u.onabort=function(){return o(u.error)},u.oncomplete=function(){return n()},r(u,(function(e){return n(e)}))}))).then(n,o)}catch(e){return o(e)}}),o)}.bind(this))},o._call=function(e,t,r){var n=arguments;return new Promise(function(o,i){var u,c,s;for(u=n.length,c=new Array(u>3?u-3:0),s=3;s1?u-1:0),s=1;s} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof module:workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {module:workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * [Route]{@link module:workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}\n *\n * @memberof module:workbox-routing\n * @extends module:workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * [handler's]{@link module:workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if ((url.origin !== location.origin) && (result.index !== 0)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp}' only partially matched ` +\n `against the cross-origin URL '${url}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * The Router can be used to process a FetchEvent through one or more\n * [Routes]{@link module:workbox-routing.Route} responding with a Request if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof module:workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n if (event.data && event.data.type === 'CACHE_URLS') {\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle (this is usually\n * from a fetch event, but it does not have to be).\n * @param {FetchEvent} [options.event] The event that triggered the request,\n * if applicable.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const { params, route } = this.findMatchingRoute({ url, request, event });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([\n `Found a route to handle this request:`, route,\n ]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`, params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n if (!handler && this._defaultHandler) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler.`);\n }\n handler = this._defaultHandler;\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n if (responsePromise instanceof Promise && this._catchHandler) {\n responsePromise = responsePromise.catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {Request} options.request The request to match.\n * @param {Event} [options.event] The corresponding event (unless N/A).\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(url, URL, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.url',\n });\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.request',\n });\n }\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n const matchResult = route.match({ url, request, event });\n if (matchResult) {\n // See https://github.com/GoogleChrome/workbox/issues/2079\n params = matchResult;\n if (Array.isArray(matchResult) && matchResult.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if ((matchResult.constructor === Object &&\n Object.keys(matchResult).length === 0)) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setDefaultHandler(handler) {\n this._defaultHandler = normalizeHandler(handler);\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","export const isNav = event => event.request.mode === 'navigate';\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n /**\n * Returns a valid response (to allow caching) if the status is 200 (OK) or\n * 0 (opaque).\n *\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: async ({ response }) => {\n if (response.status === 200 || response.status === 0) {\n return response;\n }\n return null;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { messages } from './utils/messages.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @memberof module:workbox-strategies\n */\nclass NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames.getRuntimeName(options.cacheName);\n if (options.plugins) {\n const isUsingCacheWillUpdate = options.plugins.some((plugin) => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ?\n options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n }\n else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n if (process.env.NODE_ENV !== 'production') {\n if (this._networkTimeoutSeconds) {\n assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds',\n });\n }\n }\n this._fetchOptions = options.fetchOptions;\n this._matchOptions = options.matchOptions;\n }\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link module:workbox-routing.Router}.\n *\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {Event} [options.event] The event that triggered the request.\n * @return {Promise}\n */\n async handle({ event, request }) {\n const logs = [];\n if (typeof request === 'string') {\n request = new Request(request);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest',\n });\n }\n const promises = [];\n let timeoutId;\n if (this._networkTimeoutSeconds) {\n const { id, promise } = this._getTimeoutPromise({ request, event, logs });\n timeoutId = id;\n promises.push(promise);\n }\n const networkPromise = this._getNetworkPromise({ timeoutId, request, event, logs });\n promises.push(networkPromise);\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = await Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = await networkPromise;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url });\n }\n return response;\n }\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs array\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _getTimeoutPromise({ request, logs, event }) {\n let timeoutId;\n const timeoutPromise = new Promise((resolve) => {\n const onNetworkTimeout = async () => {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Timing out the network response at ` +\n `${this._networkTimeoutSeconds} seconds.`);\n }\n resolve(await this._respondFromCache({ request, event }));\n };\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n return {\n promise: timeoutPromise,\n id: timeoutId,\n };\n }\n /**\n * @param {Object} options\n * @param {number|undefined} options.timeoutId\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs Array.\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n async _getNetworkPromise({ timeoutId, request, logs, event }) {\n let error;\n let response;\n try {\n response = await fetchWrapper.fetch({\n request,\n event,\n fetchOptions: this._fetchOptions,\n plugins: this._plugins,\n });\n }\n catch (err) {\n error = err;\n }\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network. Will respond ` +\n `with a cached response.`);\n }\n }\n if (error || !response) {\n response = await this._respondFromCache({ request, event });\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Found a cached response in the '${this._cacheName}'` +\n ` cache.`);\n }\n else {\n logs.push(`No response found in the '${this._cacheName}' cache.`);\n }\n }\n }\n else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper.put({\n cacheName: this._cacheName,\n request,\n response: responseClone,\n event,\n plugins: this._plugins,\n });\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n }\n catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to ensure service worker stays alive when ` +\n `updating cache for '${getFriendlyURL(request.url)}'.`);\n }\n }\n }\n }\n return response;\n }\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Object} options\n * @param {Request} request The request to match in the cache\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _respondFromCache({ event, request }) {\n return cacheWrapper.match({\n cacheName: this._cacheName,\n request,\n event,\n matchOptions: this._matchOptions,\n plugins: this._plugins,\n });\n }\n}\nexport { NetworkFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A class that wraps common IndexedDB functionality in a promise-based API.\n * It exposes all the underlying power and functionality of IndexedDB, but\n * wraps the most commonly used features in a way that's much simpler to use.\n *\n * @private\n */\nexport class DBWrapper {\n /**\n * @param {string} name\n * @param {number} version\n * @param {Object=} [callback]\n * @param {!Function} [callbacks.onupgradeneeded]\n * @param {!Function} [callbacks.onversionchange] Defaults to\n * DBWrapper.prototype._onversionchange when not specified.\n * @private\n */\n constructor(name, version, { onupgradeneeded, onversionchange, } = {}) {\n this._db = null;\n this._name = name;\n this._version = version;\n this._onupgradeneeded = onupgradeneeded;\n this._onversionchange = onversionchange || (() => this.close());\n }\n /**\n * Returns the IDBDatabase instance (not normally needed).\n * @return {IDBDatabase|undefined}\n *\n * @private\n */\n get db() {\n return this._db;\n }\n /**\n * Opens a connected to an IDBDatabase, invokes any onupgradedneeded\n * callback, and added an onversionchange callback to the database.\n *\n * @return {IDBDatabase}\n * @private\n */\n async open() {\n if (this._db)\n return;\n this._db = await new Promise((resolve, reject) => {\n // This flag is flipped to true if the timeout callback runs prior\n // to the request failing or succeeding. Note: we use a timeout instead\n // of an onblocked handler since there are cases where onblocked will\n // never never run. A timeout better handles all possible scenarios:\n // https://github.com/w3c/IndexedDB/issues/223\n let openRequestTimedOut = false;\n setTimeout(() => {\n openRequestTimedOut = true;\n reject(new Error('The open request was blocked and timed out'));\n }, this.OPEN_TIMEOUT);\n const openRequest = indexedDB.open(this._name, this._version);\n openRequest.onerror = () => reject(openRequest.error);\n openRequest.onupgradeneeded = (evt) => {\n if (openRequestTimedOut) {\n openRequest.transaction.abort();\n openRequest.result.close();\n }\n else if (typeof this._onupgradeneeded === 'function') {\n this._onupgradeneeded(evt);\n }\n };\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n if (openRequestTimedOut) {\n db.close();\n }\n else {\n db.onversionchange = this._onversionchange.bind(this);\n resolve(db);\n }\n };\n });\n return this;\n }\n /**\n * Polyfills the native `getKey()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @return {Array}\n * @private\n */\n async getKey(storeName, query) {\n return (await this.getAllKeys(storeName, query, 1))[0];\n }\n /**\n * Polyfills the native `getAll()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAll(storeName, query, count) {\n return await this.getAllMatching(storeName, { query, count });\n }\n /**\n * Polyfills the native `getAllKeys()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAllKeys(storeName, query, count) {\n const entries = await this.getAllMatching(storeName, { query, count, includeKeys: true });\n return entries.map((entry) => entry.key);\n }\n /**\n * Supports flexible lookup in an object store by specifying an index,\n * query, direction, and count. This method returns an array of objects\n * with the signature .\n *\n * @param {string} storeName\n * @param {Object} [opts]\n * @param {string} [opts.index] The index to use (if specified).\n * @param {*} [opts.query]\n * @param {IDBCursorDirection} [opts.direction]\n * @param {number} [opts.count] The max number of results to return.\n * @param {boolean} [opts.includeKeys] When true, the structure of the\n * returned objects is changed from an array of values to an array of\n * objects in the form {key, primaryKey, value}.\n * @return {Array}\n * @private\n */\n async getAllMatching(storeName, { index, query = null, // IE/Edge errors if query === `undefined`.\n direction = 'next', count, includeKeys = false, } = {}) {\n return await this.transaction([storeName], 'readonly', (txn, done) => {\n const store = txn.objectStore(storeName);\n const target = index ? store.index(index) : store;\n const results = [];\n const request = target.openCursor(query, direction);\n request.onsuccess = () => {\n const cursor = request.result;\n if (cursor) {\n results.push(includeKeys ? cursor : cursor.value);\n if (count && results.length >= count) {\n done(results);\n }\n else {\n cursor.continue();\n }\n }\n else {\n done(results);\n }\n };\n });\n }\n /**\n * Accepts a list of stores, a transaction type, and a callback and\n * performs a transaction. A promise is returned that resolves to whatever\n * value the callback chooses. The callback holds all the transaction logic\n * and is invoked with two arguments:\n * 1. The IDBTransaction object\n * 2. A `done` function, that's used to resolve the promise when\n * when the transaction is done, if passed a value, the promise is\n * resolved to that value.\n *\n * @param {Array} storeNames An array of object store names\n * involved in the transaction.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {!Function} callback\n * @return {*} The result of the transaction ran by the callback.\n * @private\n */\n async transaction(storeNames, type, callback) {\n await this.open();\n return await new Promise((resolve, reject) => {\n const txn = this._db.transaction(storeNames, type);\n txn.onabort = () => reject(txn.error);\n txn.oncomplete = () => resolve();\n callback(txn, (value) => resolve(value));\n });\n }\n /**\n * Delegates async to a native IDBObjectStore method.\n *\n * @param {string} method The method name.\n * @param {string} storeName The object store name.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {...*} args The list of args to pass to the native method.\n * @return {*} The result of the transaction.\n * @private\n */\n async _call(method, storeName, type, ...args) {\n const callback = (txn, done) => {\n const objStore = txn.objectStore(storeName);\n // TODO(philipwalton): Fix this underlying TS2684 error.\n // @ts-ignore\n const request = objStore[method].apply(objStore, args);\n request.onsuccess = () => done(request.result);\n };\n return await this.transaction([storeName], type, callback);\n }\n /**\n * Closes the connection opened by `DBWrapper.open()`. Generally this method\n * doesn't need to be called since:\n * 1. It's usually better to keep a connection open since opening\n * a new connection is somewhat slow.\n * 2. Connections are automatically closed when the reference is\n * garbage collected.\n * The primary use case for needing to close a connection is when another\n * reference (typically in another tab) needs to upgrade it and would be\n * blocked by the current, open connection.\n *\n * @private\n */\n close() {\n if (this._db) {\n this._db.close();\n this._db = null;\n }\n }\n}\n// Exposed on the prototype to let users modify the default timeout on a\n// per-instance or global basis.\nDBWrapper.prototype.OPEN_TIMEOUT = 2000;\n// Wrap native IDBObjectStore methods according to their mode.\nconst methodsToWrap = {\n readonly: ['get', 'count', 'getKey', 'getAll', 'getAllKeys'],\n readwrite: ['add', 'put', 'clear', 'delete'],\n};\nfor (const [mode, methods] of Object.entries(methodsToWrap)) {\n for (const method of methods) {\n if (method in IDBObjectStore.prototype) {\n // Don't use arrow functions here since we're outside of the class.\n DBWrapper.prototype[method] =\n async function (storeName, ...args) {\n return await this._call(method, storeName, mode, ...args);\n };\n }\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof module:workbox-routing\n */\nfunction setCatchHandler(handler) {\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","import { registerRoute, setCatchHandler } from 'workbox-routing';\nimport { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';\nimport { isNav } from './utils';\nimport { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';\n\nexport function getFiles() {\n\treturn self.__WB_MANIFEST;\n}\n\nexport function setupPrecaching(precacheFiles, precachingOptions) {\n\tprecacheAndRoute(precacheFiles, precachingOptions || PRECACHING_OPTIONS);\n}\n\nexport function setupRouting() {\n\t/**\n\t * Adding this before `precacheAndRoute` lets us handle all\n\t * the navigation requests even if they are in precache.\n\t */\n\tregisterRoute(({ event }) => isNav(event), NETWORK_HANDLER);\n\n\tsetCatchHandler(({ event }) => {\n\t\tif (isNav(event)) {\n\t\t\treturn caches.match(getCacheKeyForURL('/200.html'));\n\t\t}\n\t\treturn Response.error();\n\t});\n}\n\nexport { PRECACHING_OPTIONS };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n * `googleAnalytics` properties.\n *\n * @memberof module:workbox-core\n */\nconst cacheNames = {\n get googleAnalytics() {\n return _cacheNames.getGoogleAnalyticsName();\n },\n get precache() {\n return _cacheNames.getPrecacheName();\n },\n get prefix() {\n return _cacheNames.getPrefix();\n },\n get runtime() {\n return _cacheNames.getRuntimeName();\n },\n get suffix() {\n return _cacheNames.getSuffix();\n },\n};\nexport { cacheNames };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponse {\n /**\n * To construct a new CacheableResponse instance you must provide at least\n * one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(config.statuses || config.headers)) {\n throw new WorkboxError('statuses-or-headers-required', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n });\n }\n if (config.statuses) {\n assert.isArray(config.statuses, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.statuses',\n });\n }\n if (config.headers) {\n assert.isType(config.headers, 'object', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.headers',\n });\n }\n }\n this._statuses = config.statuses;\n this._headers = config.headers;\n }\n /**\n * Checks a response to see whether it's cacheable or not, based on this\n * object's configuration.\n *\n * @param {Response} response The response whose cacheability is being\n * checked.\n * @return {boolean} `true` if the `Response` is cacheable, and `false`\n * otherwise.\n */\n isResponseCacheable(response) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(response, Response, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'isResponseCacheable',\n paramName: 'response',\n });\n }\n let cacheable = true;\n if (this._statuses) {\n cacheable = this._statuses.includes(response.status);\n }\n if (this._headers && cacheable) {\n cacheable = Object.keys(this._headers).some((headerName) => {\n return response.headers.get(headerName) === this._headers[headerName];\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!cacheable) {\n logger.groupCollapsed(`The request for ` +\n `'${getFriendlyURL(response.url)}' returned a response that does ` +\n `not meet the criteria for being cached.`);\n logger.groupCollapsed(`View cacheability criteria here.`);\n logger.log(`Cacheable statuses: ` +\n JSON.stringify(this._statuses));\n logger.log(`Cacheable headers: ` +\n JSON.stringify(this._headers, null, 2));\n logger.groupEnd();\n const logFriendlyHeaders = {};\n response.headers.forEach((value, key) => {\n logFriendlyHeaders[key] = value;\n });\n logger.groupCollapsed(`View response status and headers here.`);\n logger.log(`Response status: ` + response.status);\n logger.log(`Response headers: ` +\n JSON.stringify(logFriendlyHeaders, null, 2));\n logger.groupEnd();\n logger.groupCollapsed(`View full response details here.`);\n logger.log(response.headers);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n }\n return cacheable;\n }\n}\nexport { CacheableResponse };\n","import { NetworkFirst } from 'workbox-strategies';\nimport { cacheNames } from 'workbox-core';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response';\n\nexport const PRECACHING_OPTIONS = {};\n\nexport const NETWORK_HANDLER = new NetworkFirst({\n\t// this cache is plunged with every new service worker deploy so we dont need to care about purging the cache.\n\tcacheName: cacheNames.precache,\n\tnetworkTimeoutSeconds: 5, // if u dont start getting headers within 5 sec fallback to cache.\n\tplugins: [\n\t\tnew CacheableResponsePlugin({\n\t\t\tstatuses: [200], // only cache valid responses, not opaque responses e.g. wifi portal.\n\t\t}),\n\t],\n});\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {module:workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {module:workbox-routing.Route} The generated `Route`(Useful for\n * unregistering).\n *\n * @memberof module:workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http') ?\n captureUrl.pathname : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if ((new RegExp(`${wildcards}`)).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if ((url.pathname === captureUrl.pathname) &&\n (url.origin !== captureUrl.origin)) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n /**\n * To construct a new CacheableResponsePlugin instance you must provide at\n * least one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config) {\n /**\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n * @private\n */\n this.cacheWillUpdate = async ({ response }) => {\n if (this._cacheableResponse.isResponseCacheable(response)) {\n return response;\n }\n return null;\n };\n this._cacheableResponse = new CacheableResponse(config);\n }\n}\nexport { CacheableResponsePlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof module:workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n const precacheController = getOrCreatePrecacheController();\n return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n"]} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../node_modules/workbox-cacheable-response/_version.js","webpack:///../node_modules/workbox-precaching/_version.js","webpack:///../node_modules/workbox-routing/_version.js","webpack:///../node_modules/workbox-strategies/_version.js","webpack:///../node_modules/workbox-core/copyResponse.js","webpack:///../node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","webpack:///../node_modules/workbox-precaching/utils/createCacheKey.js","webpack:///../node_modules/workbox-precaching/addRoute.js","webpack:///../node_modules/workbox-precaching/utils/addFetchListener.js","webpack:///../node_modules/workbox-precaching/utils/getCacheKeyForURL.js","webpack:///../node_modules/workbox-precaching/utils/generateURLVariations.js","webpack:///../node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","webpack:///../node_modules/workbox-precaching/precacheAndRoute.js","webpack:///../node_modules/workbox-precaching/precache.js","webpack:///../node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","webpack:///../node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","webpack:///../node_modules/workbox-core/models/messages/messageGenerator.js","webpack:///../node_modules/workbox-core/_private/WorkboxError.js","webpack:///../node_modules/workbox-routing/utils/normalizeHandler.js","webpack:///../node_modules/workbox-routing/Route.js","webpack:///../node_modules/workbox-routing/utils/constants.js","webpack:///../node_modules/workbox-routing/RegExpRoute.js","webpack:///../node_modules/workbox-core/_private/getFriendlyURL.js","webpack:///../node_modules/workbox-routing/Router.js","webpack:///../node_modules/workbox-precaching/utils/precachePlugins.js","webpack:///../node_modules/workbox-core/_private/cacheNames.js","webpack:///../node_modules/workbox-core/models/quotaErrorCallbacks.js","webpack:///../node_modules/workbox-core/utils/pluginUtils.js","webpack:///../node_modules/workbox-core/_private/cacheWrapper.js","webpack:///../node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","webpack:///../node_modules/workbox-core/_private/fetchWrapper.js","webpack:///../node_modules/workbox-precaching/PrecacheController.js","webpack:///../node_modules/preact-cli/sw/utils.js","webpack:///../node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js","webpack:///../node_modules/workbox-strategies/NetworkFirst.js","webpack:///../node_modules/workbox-core/_private/DBWrapper.js","webpack:///../node_modules/workbox-routing/setCatchHandler.js","webpack:///../node_modules/preact-cli/sw/index.js","webpack:///../node_modules/workbox-core/cacheNames.js","webpack:///../node_modules/workbox-cacheable-response/CacheableResponse.js","webpack:///../node_modules/preact-cli/sw/contants.js","webpack:///../node_modules/workbox-routing/registerRoute.js","webpack:///../node_modules/workbox-cacheable-response/CacheableResponsePlugin.js","webpack:///../node_modules/workbox-precaching/getCacheKeyForURL.js","webpack:///../node_modules/workbox-core/_version.js"],"names":["__webpack_require__","moduleId","installedModules","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","self","_","e","copyResponse","response","modifier","clonedResponse","responseInit","modifiedResponseInit","clone","headers","Headers","status","statusText","undefined","supportStatus","testResponse","Response","body","error","canConstructResponseFromBodyStream","blob","createCacheKey","entry","WorkboxError","urlObject","URL","location","href","cacheKey","url","revision","cacheKeyURL","originalURL","searchParams","set","addRoute","options","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","cacheName","listenerAdded","cacheNames","addEventListener","event","precachedURL","urlsToCacheKeys","getOrCreatePrecacheController","getURLsToCacheKeys","hash","urlWithoutIgnoredParams","paramName","some","regExp","test","delete","keys","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","urlToAttempt","generateURLVariations","possibleCacheKey","getCacheKeyForURL","request","responsePromise","caches","open","then","cache","match","cachedResponse","fetch","respondWith","precacheAndRoute","entries","addToCacheList","length","installListener","activateListener","precache","defaultRouter","precacheController","messageGenerator","code","msg","args","JSON","stringify","errorCode","details","message","Error","normalizeHandler","handler","handle","Route","method","this","RegExpRoute","result","exec","origin","index","slice","getFriendlyURL","String","replace","RegExp","Router","_routes","Map","addFetchListener","handleRequest","addCacheListener","data","type","process","requestPromises","Promise","all","payload","urlsToCache","map","Request","waitUntil","ports","postMessage","protocol","startsWith","findMatchingRoute","params","route","_defaultHandler","err","reject","_catchHandler","catch","matchResult","Array","isArray","constructor","setDefaultHandler","setCatchHandler","registerRoute","has","push","unregisterRoute","routeIndex","indexOf","splice","getOrCreateDefaultRouter","plugins","precachePlugins","_cacheNameDetails","googleAnalytics","prefix","runtime","suffix","registration","scope","_createCacheName","filter","join","userCacheName","quotaErrorCallbacks","Set","pluginUtils","callbackName","plugin","_getEffectiveRequest","effectiveRequest","cacheKeyWillBeUsedPlugins","matchWrapper","matchOptions","cacheWrapper","responseToCache","updatePlugins","oldResponse","pluginsUsed","callback","put","newResponse","fetchWrapper","failedFetchPlugins","originalRequest","thrownError","pluginMethod","requestClone","pluginFilteredRequest","fetchResponse","fetchOptions","possiblePreloadResponse","FetchEvent","preloadResponse","PrecacheController","_cacheName","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","integrity","warningMessage","console","warn","install","toBePrecached","alreadyPrecached","existingCacheKeys","precacheRequests","updatedURLs","_addURLToCache","item","notUpdatedURLs","activate","currentlyCachedRequests","expectedCacheKeys","deletedURLs","values","cacheWillUpdatePlugin","credentials","cacheWillUpdate","redirected","ignoreSearch","getCachedURLs","matchPrecache","createHandler","fallbackToNetwork","createHandlerBoundToURL","isNav","cacheOkAndOpaquePlugin","NetworkFirst","isUsingCacheWillUpdate","_plugins","_networkTimeoutSeconds","networkTimeoutSeconds","_fetchOptions","_matchOptions","logs","promises","timeoutId","networkPromise","_getTimeoutPromise","id","promise","_getNetworkPromise","race","resolve","setTimeout","_respondFromCache","responseClone","cachePut","clearTimeout","DBWrapper","version","onupgradeneeded","onversionchange","_db","_name","_version","_onupgradeneeded","_onversionchange","close","openRequestTimedOut","OPEN_TIMEOUT","openRequest","indexedDB","onerror","evt","transaction","abort","onsuccess","db","getKey","storeName","query","getAllKeys","getAll","count","getAllMatching","includeKeys","direction","txn","done","store","objectStore","target","results","openCursor","cursor","continue","storeNames","onabort","oncomplete","_call","objStore","apply","IDBObjectStore","readonly","readwrite","precachingOptions","_cacheNames","CacheableResponse","config","_statuses","statuses","_headers","isResponseCacheable","cacheable","includes","headerName","PRECACHING_OPTIONS","capture","captureUrl","moduleName","funcName","_cacheableResponse","__WB_MANIFEST"],"mappings":"aAIE,SAAS,EAAoB,GAG5B,GAAG,EAAiB,GACnB,OAAO,EAAiB,GAAU,QAGnC,IAAI,EAAS,EAAiB,GAAY,CACzC,EAAG,EACH,GAAG,EACH,QAAS,IAUV,OANA,EAAQ,GAAU,KAAK,EAAO,QAAS,EAAQ,EAAO,QAAS,GAG/D,EAAO,GAAI,EAGJ,EAAO,QAvBf,IAAI,EAAmB,GA4BvB,EAAoB,EAAI,EAGxB,EAAoB,EAAI,EAGxB,EAAoB,EAAI,SAAS,EAAS,EAAM,GAC3C,EAAoB,EAAE,EAAS,IAClC,OAAO,eAAe,EAAS,EAAM,CAAE,YAAY,EAAM,IAAK,KAKhE,EAAoB,EAAI,SAAS,GACX,oBAAX,QAA0B,OAAO,aAC1C,OAAO,eAAe,EAAS,OAAO,YAAa,CAAE,MAAO,WAE7D,OAAO,eAAe,EAAS,aAAc,CAAE,OAAO,KAQvD,EAAoB,EAAI,SAAS,EAAO,GAEvC,GADU,EAAP,IAAU,EAAQ,EAAoB,IAC/B,EAAP,EAAU,OAAO,EACpB,GAAW,EAAP,GAA8B,iBAAV,GAAsB,GAAS,EAAM,WAAY,OAAO,EAChF,IAAI,EAAK,OAAO,OAAO,MAGvB,GAFA,EAAoB,EAAE,GACtB,OAAO,eAAe,EAAI,UAAW,CAAE,YAAY,EAAM,MAAO,IACtD,EAAP,GAA4B,iBAAT,EAAmB,IAAI,IAAI,KAA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OAAS,EAAW,OAGF,EAAS,QAEzC,GAAI,aAAmB,OAExB,EAAQ,IAAI,EAAY,EAAS,EAAS,QAEzC,GAAuB,mBAAZ,EAEZ,EAAQ,IAAI,EAAM,EAAS,EAAS,OAEnC,MAAI,aAAmB,GAIxB,MAAM,IAAI,EAAa,yBAA0B,CAC7C,WAAY,kBACZ,SAAU,gBACV,UAAW,YANf,EAAQ,EASU,IACR,cAAc,GJvE/B,EAAc,mBAAe,GAAf,EAAG,SGZa,IAAI,GAAa,CAE/C,UAAW,GAAW,SACtB,sBAAuB,EACvB,QAAS,CACR,IEoBE,SAAY,GAAQ,WAOhB,KAAK,gBAAkB,gDAAS,EAAT,EAAS,SAC5B,OAAI,EAAK,mBAAmB,oBAAoB,GAC5C,EAAO,GAEX,EAAO,UAEX,KAAK,mBAAqB,IAAI,GAAkB,GFjCtD,CAA4B,CAC3B,SAAU,CAAC,WJMW,GCER,YAAe,IMQL,ENPzB,OAAI,GAD0B,EAAZ,OAEV,OAAO,OMMU,ENNc,YMOV,KACD,kBAAkB,KNNvC,SAAS,SDLQ,IACR,gBAAgB,ICVjC,EAJO,ylBAAK,cAIoB,IAAqB,kCORtD,IACI,KAAK,uBAAyB,IAElC,MAAO","file":"sw.js","sourceRoot":"","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/huge-link/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"p5Qz\");\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:cacheable-response:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:5.1.4'] && _();\n}\ncatch (e) { }\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:5.1.4'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof module:workbox-core\n */\nasync function copyResponse(response, modifier) {\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream() ?\n clonedResponse.body : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addFetchListener } from './utils/addFetchListener.js';\nimport './_version.js';\nlet listenerAdded = false;\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n *\n * @memberof module:workbox-precaching\n */\nfunction addRoute(options) {\n if (!listenerAdded) {\n addFetchListener(options);\n listenerAdded = true;\n }\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getCacheKeyForURL } from './getCacheKeyForURL.js';\nimport '../_version.js';\n/**\n * Adds a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * NOTE: when called more than once this method will replace the previously set\n * configuration options. Calling it more than once is not recommended outside\n * of tests.\n *\n * @private\n * @param {Object} [options]\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox.precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\nexport const addFetchListener = ({ ignoreURLParametersMatching = [/^utm_/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) => {\n const cacheName = cacheNames.getPrecacheName();\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const precachedURL = getCacheKeyForURL(event.request.url, {\n cleanURLs,\n directoryIndex,\n ignoreURLParametersMatching,\n urlManipulation,\n });\n if (!precachedURL) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` +\n getFriendlyURL(event.request.url));\n }\n return;\n }\n let responsePromise = self.caches.open(cacheName).then((cache) => {\n return cache.match(precachedURL);\n }).then((cachedResponse) => {\n if (cachedResponse) {\n return cachedResponse;\n }\n // Fall back to the network if we don't have a cached response\n // (perhaps due to manual cache cleanup).\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(precachedURL)} in ${cacheName} was not found. ` +\n `Falling back to the network instead.`);\n }\n return fetch(precachedURL);\n });\n if (process.env.NODE_ENV !== 'production') {\n responsePromise = responsePromise.then((response) => {\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` +\n getFriendlyURL(event.request.url));\n logger.log(`Serving the precached url: ${precachedURL}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(event.request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n return response;\n });\n }\n event.respondWith(responsePromise);\n }));\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './getOrCreatePrecacheController.js';\nimport { generateURLVariations } from './generateURLVariations.js';\nimport '../_version.js';\n/**\n * This function will take the request URL and manipulate it based on the\n * configuration options.\n *\n * @param {string} url\n * @param {Object} options\n * @return {string} Returns the URL in the cache that matches the request,\n * if possible.\n *\n * @private\n */\nexport const getCacheKeyForURL = (url, options) => {\n const precacheController = getOrCreatePrecacheController();\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(url, options)) {\n const possibleCacheKey = urlsToCacheKeys.get(possibleURL);\n if (possibleCacheKey) {\n return possibleCacheKey;\n }\n }\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching, directoryIndex, cleanURLs, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof module:workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * [precache()]{@link module:workbox-precaching.precache} and\n * [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See\n * [addRoute() options]{@link module:workbox-precaching.addRoute}.\n *\n * @memberof module:workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { precachePlugins } from './utils/precachePlugins.js';\nimport './_version.js';\nconst installListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n const plugins = precachePlugins.get();\n event.waitUntil(precacheController.install({ event, plugins })\n .catch((error) => {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Service worker installation failed. It will ` +\n `be retried automatically during the next navigation.`);\n }\n // Re-throw the error to ensure installation fails.\n throw error;\n }));\n};\nconst activateListener = (event) => {\n const precacheController = getOrCreatePrecacheController();\n event.waitUntil(precacheController.activate());\n};\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * [\"precache cache\"]{@link module:workbox-core.cacheNames} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * [addRoute()]{@link module:workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof module:workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.addToCacheList(entries);\n if (entries.length > 0) {\n // NOTE: these listeners will only be added once (even if the `precache()`\n // method is called multiple times) because event listeners are implemented\n // as a set, where each listener must be unique.\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('install', installListener);\n self.addEventListener('activate', activateListener);\n }\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = (process.env.NODE_ENV === 'production') ?\n fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof module:workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {module:workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * [Route]{@link module:workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}\n *\n * @memberof module:workbox-routing\n * @extends module:workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * [handler's]{@link module:workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if ((url.origin !== location.origin) && (result.index !== 0)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp}' only partially matched ` +\n `against the cross-origin URL '${url}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * The Router can be used to process a FetchEvent through one or more\n * [Routes]{@link module:workbox-routing.Route} responding with a Request if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof module:workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n if (event.data && event.data.type === 'CACHE_URLS') {\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle (this is usually\n * from a fetch event, but it does not have to be).\n * @param {FetchEvent} [options.event] The event that triggered the request,\n * if applicable.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const { params, route } = this.findMatchingRoute({ url, request, event });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([\n `Found a route to handle this request:`, route,\n ]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`, params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n if (!handler && this._defaultHandler) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler.`);\n }\n handler = this._defaultHandler;\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n if (responsePromise instanceof Promise && this._catchHandler) {\n responsePromise = responsePromise.catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {Request} options.request The request to match.\n * @param {Event} [options.event] The corresponding event (unless N/A).\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, request, event }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(url, URL, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.url',\n });\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'findMatchingRoute',\n paramName: 'options.request',\n });\n }\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n const matchResult = route.match({ url, request, event });\n if (matchResult) {\n // See https://github.com/GoogleChrome/workbox/issues/2079\n params = matchResult;\n if (Array.isArray(matchResult) && matchResult.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if ((matchResult.constructor === Object &&\n Object.keys(matchResult).length === 0)) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setDefaultHandler(handler) {\n this._defaultHandler = normalizeHandler(handler);\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {module:workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst plugins = [];\nexport const precachePlugins = {\n /*\n * @return {Array}\n * @private\n */\n get() {\n return plugins;\n },\n /*\n * @param {Array} newPlugins\n * @private\n */\n add(newPlugins) {\n plugins.push(...newPlugins);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const pluginUtils = {\n filter: (plugins, callbackName) => {\n return plugins.filter((plugin) => callbackName in plugin);\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from './assert.js';\nimport { executeQuotaErrorCallbacks } from './executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from './getFriendlyURL.js';\nimport { logger } from './logger.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport { WorkboxError } from './WorkboxError.js';\nimport '../_version.js';\n/**\n * Checks the list of plugins for the cacheKeyWillBeUsed callback, and\n * executes any of those callbacks found in sequence. The final `Request` object\n * returned by the last plugin is treated as the cache key for cache reads\n * and/or writes.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {string} options.mode\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _getEffectiveRequest = async ({ request, mode, plugins = [], }) => {\n const cacheKeyWillBeUsedPlugins = pluginUtils.filter(plugins, \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */);\n let effectiveRequest = request;\n for (const plugin of cacheKeyWillBeUsedPlugins) {\n effectiveRequest = await plugin[\"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */].call(plugin, { mode, request: effectiveRequest });\n if (typeof effectiveRequest === 'string') {\n effectiveRequest = new Request(effectiveRequest);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(effectiveRequest, Request, {\n moduleName: 'Plugin',\n funcName: \"cacheKeyWillBeUsed\" /* CACHE_KEY_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n return effectiveRequest;\n};\n/**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Object} options\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst _isResponseSafeToCache = async ({ request, response, event, plugins = [], }) => {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const plugin of plugins) {\n if (\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */ in plugin) {\n pluginsUsed = true;\n const pluginMethod = plugin[\"cacheWillUpdate\" /* CACHE_WILL_UPDATE */];\n responseToCache = await pluginMethod.call(plugin, {\n request,\n response: responseToCache,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n assert.isInstance(responseToCache, Response, {\n moduleName: 'Plugin',\n funcName: \"cacheWillUpdate\" /* CACHE_WILL_UPDATE */,\n isReturnValueProblem: true,\n });\n }\n }\n if (!responseToCache) {\n break;\n }\n }\n }\n if (!pluginsUsed) {\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${request.url}' is an opaque ` +\n `response. The caching strategy that you're using will not ` +\n `cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${request.url}' returned ` +\n `a status code of '${response.status}' and won't be cached as a ` +\n `result.`);\n }\n }\n }\n }\n responseToCache = responseToCache && responseToCache.status === 200 ?\n responseToCache : undefined;\n }\n return responseToCache ? responseToCache : null;\n};\n/**\n * This is a wrapper around cache.match().\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache to match against.\n * @param {Request} options.request The Request that will be used to look up\n * cache entries.\n * @param {Event} [options.event] The event that prompted the action.\n * @param {Object} [options.matchOptions] Options passed to cache.match().\n * @param {Array} [options.plugins=[]] Array of plugins.\n * @return {Response} A cached response if available.\n *\n * @private\n * @memberof module:workbox-core\n */\nconst matchWrapper = async ({ cacheName, request, event, matchOptions, plugins = [], }) => {\n const cache = await self.caches.open(cacheName);\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'read'\n });\n let cachedResponse = await cache.match(effectiveRequest, matchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const plugin of plugins) {\n if (\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */ in plugin) {\n const pluginMethod = plugin[\"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */];\n cachedResponse = await pluginMethod.call(plugin, {\n cacheName,\n event,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n assert.isInstance(cachedResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return cachedResponse;\n};\n/**\n * Wrapper around cache.put().\n *\n * Will call `cacheDidUpdate` on plugins if the cache was updated, using\n * `matchOptions` when determining what the old entry is.\n *\n * @param {Object} options\n * @param {string} options.cacheName\n * @param {Request} options.request\n * @param {Response} options.response\n * @param {Event} [options.event]\n * @param {Array} [options.plugins=[]]\n * @param {Object} [options.matchOptions]\n *\n * @private\n * @memberof module:workbox-core\n */\nconst putWrapper = async ({ cacheName, request, response, event, plugins = [], matchOptions, }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (request.method && request.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(request.url),\n method: request.method,\n });\n }\n }\n const effectiveRequest = await _getEffectiveRequest({\n plugins, request, mode: 'write'\n });\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await _isResponseSafeToCache({\n event,\n plugins,\n response,\n request: effectiveRequest,\n });\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' will ` +\n `not be cached.`, responseToCache);\n }\n return;\n }\n const cache = await self.caches.open(cacheName);\n const updatePlugins = pluginUtils.filter(plugins, \"cacheDidUpdate\" /* CACHE_DID_UPDATE */);\n const oldResponse = updatePlugins.length > 0 ?\n await matchWrapper({ cacheName, matchOptions, request: effectiveRequest }) :\n null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response for ` +\n `${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, responseToCache);\n }\n catch (error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n for (const plugin of updatePlugins) {\n await plugin[\"cacheDidUpdate\" /* CACHE_DID_UPDATE */].call(plugin, {\n cacheName,\n event,\n oldResponse,\n newResponse: responseToCache,\n request: effectiveRequest,\n });\n }\n};\nexport const cacheWrapper = {\n put: putWrapper,\n match: matchWrapper,\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof module:workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from './WorkboxError.js';\nimport { logger } from './logger.js';\nimport { assert } from './assert.js';\nimport { getFriendlyURL } from '../_private/getFriendlyURL.js';\nimport { pluginUtils } from '../utils/pluginUtils.js';\nimport '../_version.js';\n/**\n * Wrapper around the fetch API.\n *\n * Will call requestWillFetch on available plugins.\n *\n * @param {Object} options\n * @param {Request|string} options.request\n * @param {Object} [options.fetchOptions]\n * @param {ExtendableEvent} [options.event]\n * @param {Array} [options.plugins=[]]\n * @return {Promise}\n *\n * @private\n * @memberof module:workbox-core\n */\nconst wrappedFetch = async ({ request, fetchOptions, event, plugins = [], }) => {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n // We *should* be able to call `await event.preloadResponse` even if it's\n // undefined, but for some reason, doing so leads to errors in our Node unit\n // tests. To work around that, explicitly check preloadResponse's value first.\n if (event instanceof FetchEvent && event.preloadResponse) {\n const possiblePreloadResponse = await event.preloadResponse;\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n paramName: 'request',\n expectedClass: Request,\n moduleName: 'workbox-core',\n className: 'fetchWrapper',\n funcName: 'wrappedFetch',\n });\n }\n const failedFetchPlugins = pluginUtils.filter(plugins, \"fetchDidFail\" /* FETCH_DID_FAIL */);\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = failedFetchPlugins.length > 0 ?\n request.clone() : null;\n try {\n for (const plugin of plugins) {\n if (\"requestWillFetch\" /* REQUEST_WILL_FETCH */ in plugin) {\n const pluginMethod = plugin[\"requestWillFetch\" /* REQUEST_WILL_FETCH */];\n const requestClone = request.clone();\n request = await pluginMethod.call(plugin, {\n request: requestClone,\n event,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (request) {\n assert.isInstance(request, Request, {\n moduleName: 'Plugin',\n funcName: \"cachedResponseWillBeUsed\" /* CACHED_RESPONSE_WILL_BE_USED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n }\n catch (err) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownError: err,\n });\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (Most likely from a `fetch` event) to be different\n // to the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n if (request.mode === 'navigate') {\n fetchResponse = await fetch(request);\n }\n else {\n fetchResponse = await fetch(request, fetchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const plugin of plugins) {\n if (\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */ in plugin) {\n fetchResponse = await plugin[\"fetchDidSucceed\" /* FETCH_DID_SUCCEED */]\n .call(plugin, {\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n if (process.env.NODE_ENV !== 'production') {\n if (fetchResponse) {\n assert.isInstance(fetchResponse, Response, {\n moduleName: 'Plugin',\n funcName: \"fetchDidSucceed\" /* FETCH_DID_SUCCEED */,\n isReturnValueProblem: true,\n });\n }\n }\n }\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n for (const plugin of failedFetchPlugins) {\n await plugin[\"fetchDidFail\" /* FETCH_DID_FAIL */].call(plugin, {\n error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n};\nconst fetchWrapper = {\n fetch: wrappedFetch,\n};\nexport { fetchWrapper };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof module:workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {string} [cacheName] An optional name for the cache, to override\n * the default precache name.\n */\n constructor(cacheName) {\n this._cacheName = cacheNames.getPrecacheName(cacheName);\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {\n * Array\n * } entries Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = (typeof entry !== 'string' && entry.revision) ?\n 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * @param {Object} options\n * @param {Event} [options.event] The install event (if needed).\n * @param {Array} [options.plugins] Plugins to be used for fetching\n * and caching during install.\n * @return {Promise}\n */\n async install({ event, plugins } = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (plugins) {\n assert.isArray(plugins, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'install',\n paramName: 'plugins',\n });\n }\n }\n const toBePrecached = [];\n const alreadyPrecached = [];\n const cache = await self.caches.open(this._cacheName);\n const alreadyCachedRequests = await cache.keys();\n const existingCacheKeys = new Set(alreadyCachedRequests.map((request) => request.url));\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n if (existingCacheKeys.has(cacheKey)) {\n alreadyPrecached.push(url);\n }\n else {\n toBePrecached.push({ cacheKey, url });\n }\n }\n const precacheRequests = toBePrecached.map(({ cacheKey, url }) => {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n return this._addURLToCache({\n cacheKey,\n cacheMode,\n event,\n integrity,\n plugins,\n url,\n });\n });\n await Promise.all(precacheRequests);\n const updatedURLs = toBePrecached.map((item) => item.url);\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, alreadyPrecached);\n }\n return {\n updatedURLs,\n notUpdatedURLs: alreadyPrecached,\n };\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * @return {Promise}\n */\n async activate() {\n const cache = await self.caches.open(this._cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n }\n /**\n * Requests the entry and saves it to the cache if the response is valid.\n * By default, any response with a status code of less than 400 (including\n * opaque responses) is considered valid.\n *\n * If you need to use custom criteria to determine what's valid and what\n * isn't, then pass in an item in `options.plugins` that implements the\n * `cacheWillUpdate()` lifecycle event.\n *\n * @private\n * @param {Object} options\n * @param {string} options.cacheKey The string to use a cache key.\n * @param {string} options.url The URL to fetch and cache.\n * @param {string} [options.cacheMode] The cache mode for the network request.\n * @param {Event} [options.event] The install event (if passed).\n * @param {Array} [options.plugins] An array of plugins to apply to\n * fetch and caching.\n * @param {string} [options.integrity] The value to use for the `integrity`\n * field when making the request.\n */\n async _addURLToCache({ cacheKey, url, cacheMode, event, plugins, integrity }) {\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n let response = await fetchWrapper.fetch({\n event,\n plugins,\n request,\n });\n // Allow developers to override the default logic about what is and isn't\n // valid by passing in a plugin implementing cacheWillUpdate(), e.g.\n // a `CacheableResponsePlugin` instance.\n let cacheWillUpdatePlugin;\n for (const plugin of (plugins || [])) {\n if ('cacheWillUpdate' in plugin) {\n cacheWillUpdatePlugin = plugin;\n }\n }\n const isValidResponse = cacheWillUpdatePlugin ?\n // Use a callback if provided. It returns a truthy value if valid.\n // NOTE: invoke the method on the plugin instance so the `this` context\n // is correct.\n await cacheWillUpdatePlugin.cacheWillUpdate({ event, request, response }) :\n // Otherwise, default to considering any response status under 400 valid.\n // This includes, by default, considering opaque responses valid.\n response.status < 400;\n // Consider this a failure, leading to the `install` handler failing, if\n // we get back an invalid response.\n if (!isValidResponse) {\n throw new WorkboxError('bad-precaching-response', {\n url,\n status: response.status,\n });\n }\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n if (response.redirected) {\n response = await copyResponse(response);\n }\n await cacheWrapper.put({\n event,\n plugins,\n response,\n // `request` already uses `url`. We may be able to reuse it.\n request: cacheKey === url ? request : new Request(cacheKey),\n cacheName: this._cacheName,\n matchOptions: {\n ignoreSearch: true,\n },\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * This acts as a drop-in replacement for [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this._cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that can be used within a\n * {@link module:workbox-routing.Route} that will find a response for the\n * incoming request against the precache.\n *\n * If for an unexpected reason there is a cache miss for the request,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandler(fallbackToNetwork = true) {\n return async ({ request }) => {\n try {\n const response = await this.matchPrecache(request);\n if (response) {\n return response;\n }\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this._cacheName,\n url: request instanceof Request ? request.url : request,\n });\n }\n catch (error) {\n if (fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Unable to respond with precached response. ` +\n `Falling back to network.`, error);\n }\n return fetch(request);\n }\n throw error;\n }\n };\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * If for an unexpected reason there is a cache miss when looking up `url`,\n * this will fall back to retrieving the `Response` via `fetch()` when\n * `fallbackToNetwork` is `true`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the\n * response from the network if there's a precache miss.\n * @return {module:workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url, fallbackToNetwork = true) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n const handler = this.createHandler(fallbackToNetwork);\n const request = new Request(url);\n return () => handler({ request });\n }\n}\nexport { PrecacheController };\n","export const isNav = event => event.request.mode === 'navigate';\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n /**\n * Returns a valid response (to allow caching) if the status is 200 (OK) or\n * 0 (opaque).\n *\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: async ({ response }) => {\n if (response.status === 200 || response.status === 0) {\n return response;\n }\n return null;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { cacheWrapper } from 'workbox-core/_private/cacheWrapper.js';\nimport { fetchWrapper } from 'workbox-core/_private/fetchWrapper.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { messages } from './utils/messages.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @memberof module:workbox-strategies\n */\nclass NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link module:workbox-core.cacheNames}.\n * @param {Array} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames.getRuntimeName(options.cacheName);\n if (options.plugins) {\n const isUsingCacheWillUpdate = options.plugins.some((plugin) => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ?\n options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n }\n else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n if (process.env.NODE_ENV !== 'production') {\n if (this._networkTimeoutSeconds) {\n assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds',\n });\n }\n }\n this._fetchOptions = options.fetchOptions;\n this._matchOptions = options.matchOptions;\n }\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link module:workbox-routing.Router}.\n *\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {Event} [options.event] The event that triggered the request.\n * @return {Promise}\n */\n async handle({ event, request }) {\n const logs = [];\n if (typeof request === 'string') {\n request = new Request(request);\n }\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest',\n });\n }\n const promises = [];\n let timeoutId;\n if (this._networkTimeoutSeconds) {\n const { id, promise } = this._getTimeoutPromise({ request, event, logs });\n timeoutId = id;\n promises.push(promise);\n }\n const networkPromise = this._getNetworkPromise({ timeoutId, request, event, logs });\n promises.push(networkPromise);\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = await Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = await networkPromise;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url });\n }\n return response;\n }\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs array\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _getTimeoutPromise({ request, logs, event }) {\n let timeoutId;\n const timeoutPromise = new Promise((resolve) => {\n const onNetworkTimeout = async () => {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Timing out the network response at ` +\n `${this._networkTimeoutSeconds} seconds.`);\n }\n resolve(await this._respondFromCache({ request, event }));\n };\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n return {\n promise: timeoutPromise,\n id: timeoutId,\n };\n }\n /**\n * @param {Object} options\n * @param {number|undefined} options.timeoutId\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs Array.\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n async _getNetworkPromise({ timeoutId, request, logs, event }) {\n let error;\n let response;\n try {\n response = await fetchWrapper.fetch({\n request,\n event,\n fetchOptions: this._fetchOptions,\n plugins: this._plugins,\n });\n }\n catch (err) {\n error = err;\n }\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network. Will respond ` +\n `with a cached response.`);\n }\n }\n if (error || !response) {\n response = await this._respondFromCache({ request, event });\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Found a cached response in the '${this._cacheName}'` +\n ` cache.`);\n }\n else {\n logs.push(`No response found in the '${this._cacheName}' cache.`);\n }\n }\n }\n else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper.put({\n cacheName: this._cacheName,\n request,\n response: responseClone,\n event,\n plugins: this._plugins,\n });\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n }\n catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to ensure service worker stays alive when ` +\n `updating cache for '${getFriendlyURL(request.url)}'.`);\n }\n }\n }\n }\n return response;\n }\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Object} options\n * @param {Request} request The request to match in the cache\n * @param {Event} [options.event]\n * @return {Promise}\n *\n * @private\n */\n _respondFromCache({ event, request }) {\n return cacheWrapper.match({\n cacheName: this._cacheName,\n request,\n event,\n matchOptions: this._matchOptions,\n plugins: this._plugins,\n });\n }\n}\nexport { NetworkFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A class that wraps common IndexedDB functionality in a promise-based API.\n * It exposes all the underlying power and functionality of IndexedDB, but\n * wraps the most commonly used features in a way that's much simpler to use.\n *\n * @private\n */\nexport class DBWrapper {\n /**\n * @param {string} name\n * @param {number} version\n * @param {Object=} [callback]\n * @param {!Function} [callbacks.onupgradeneeded]\n * @param {!Function} [callbacks.onversionchange] Defaults to\n * DBWrapper.prototype._onversionchange when not specified.\n * @private\n */\n constructor(name, version, { onupgradeneeded, onversionchange, } = {}) {\n this._db = null;\n this._name = name;\n this._version = version;\n this._onupgradeneeded = onupgradeneeded;\n this._onversionchange = onversionchange || (() => this.close());\n }\n /**\n * Returns the IDBDatabase instance (not normally needed).\n * @return {IDBDatabase|undefined}\n *\n * @private\n */\n get db() {\n return this._db;\n }\n /**\n * Opens a connected to an IDBDatabase, invokes any onupgradedneeded\n * callback, and added an onversionchange callback to the database.\n *\n * @return {IDBDatabase}\n * @private\n */\n async open() {\n if (this._db)\n return;\n this._db = await new Promise((resolve, reject) => {\n // This flag is flipped to true if the timeout callback runs prior\n // to the request failing or succeeding. Note: we use a timeout instead\n // of an onblocked handler since there are cases where onblocked will\n // never never run. A timeout better handles all possible scenarios:\n // https://github.com/w3c/IndexedDB/issues/223\n let openRequestTimedOut = false;\n setTimeout(() => {\n openRequestTimedOut = true;\n reject(new Error('The open request was blocked and timed out'));\n }, this.OPEN_TIMEOUT);\n const openRequest = indexedDB.open(this._name, this._version);\n openRequest.onerror = () => reject(openRequest.error);\n openRequest.onupgradeneeded = (evt) => {\n if (openRequestTimedOut) {\n openRequest.transaction.abort();\n openRequest.result.close();\n }\n else if (typeof this._onupgradeneeded === 'function') {\n this._onupgradeneeded(evt);\n }\n };\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n if (openRequestTimedOut) {\n db.close();\n }\n else {\n db.onversionchange = this._onversionchange.bind(this);\n resolve(db);\n }\n };\n });\n return this;\n }\n /**\n * Polyfills the native `getKey()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @return {Array}\n * @private\n */\n async getKey(storeName, query) {\n return (await this.getAllKeys(storeName, query, 1))[0];\n }\n /**\n * Polyfills the native `getAll()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAll(storeName, query, count) {\n return await this.getAllMatching(storeName, { query, count });\n }\n /**\n * Polyfills the native `getAllKeys()` method. Note, this is overridden at\n * runtime if the browser supports the native method.\n *\n * @param {string} storeName\n * @param {*} query\n * @param {number} count\n * @return {Array}\n * @private\n */\n async getAllKeys(storeName, query, count) {\n const entries = await this.getAllMatching(storeName, { query, count, includeKeys: true });\n return entries.map((entry) => entry.key);\n }\n /**\n * Supports flexible lookup in an object store by specifying an index,\n * query, direction, and count. This method returns an array of objects\n * with the signature .\n *\n * @param {string} storeName\n * @param {Object} [opts]\n * @param {string} [opts.index] The index to use (if specified).\n * @param {*} [opts.query]\n * @param {IDBCursorDirection} [opts.direction]\n * @param {number} [opts.count] The max number of results to return.\n * @param {boolean} [opts.includeKeys] When true, the structure of the\n * returned objects is changed from an array of values to an array of\n * objects in the form {key, primaryKey, value}.\n * @return {Array}\n * @private\n */\n async getAllMatching(storeName, { index, query = null, // IE/Edge errors if query === `undefined`.\n direction = 'next', count, includeKeys = false, } = {}) {\n return await this.transaction([storeName], 'readonly', (txn, done) => {\n const store = txn.objectStore(storeName);\n const target = index ? store.index(index) : store;\n const results = [];\n const request = target.openCursor(query, direction);\n request.onsuccess = () => {\n const cursor = request.result;\n if (cursor) {\n results.push(includeKeys ? cursor : cursor.value);\n if (count && results.length >= count) {\n done(results);\n }\n else {\n cursor.continue();\n }\n }\n else {\n done(results);\n }\n };\n });\n }\n /**\n * Accepts a list of stores, a transaction type, and a callback and\n * performs a transaction. A promise is returned that resolves to whatever\n * value the callback chooses. The callback holds all the transaction logic\n * and is invoked with two arguments:\n * 1. The IDBTransaction object\n * 2. A `done` function, that's used to resolve the promise when\n * when the transaction is done, if passed a value, the promise is\n * resolved to that value.\n *\n * @param {Array} storeNames An array of object store names\n * involved in the transaction.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {!Function} callback\n * @return {*} The result of the transaction ran by the callback.\n * @private\n */\n async transaction(storeNames, type, callback) {\n await this.open();\n return await new Promise((resolve, reject) => {\n const txn = this._db.transaction(storeNames, type);\n txn.onabort = () => reject(txn.error);\n txn.oncomplete = () => resolve();\n callback(txn, (value) => resolve(value));\n });\n }\n /**\n * Delegates async to a native IDBObjectStore method.\n *\n * @param {string} method The method name.\n * @param {string} storeName The object store name.\n * @param {string} type Can be `readonly` or `readwrite`.\n * @param {...*} args The list of args to pass to the native method.\n * @return {*} The result of the transaction.\n * @private\n */\n async _call(method, storeName, type, ...args) {\n const callback = (txn, done) => {\n const objStore = txn.objectStore(storeName);\n // TODO(philipwalton): Fix this underlying TS2684 error.\n // @ts-ignore\n const request = objStore[method].apply(objStore, args);\n request.onsuccess = () => done(request.result);\n };\n return await this.transaction([storeName], type, callback);\n }\n /**\n * Closes the connection opened by `DBWrapper.open()`. Generally this method\n * doesn't need to be called since:\n * 1. It's usually better to keep a connection open since opening\n * a new connection is somewhat slow.\n * 2. Connections are automatically closed when the reference is\n * garbage collected.\n * The primary use case for needing to close a connection is when another\n * reference (typically in another tab) needs to upgrade it and would be\n * blocked by the current, open connection.\n *\n * @private\n */\n close() {\n if (this._db) {\n this._db.close();\n this._db = null;\n }\n }\n}\n// Exposed on the prototype to let users modify the default timeout on a\n// per-instance or global basis.\nDBWrapper.prototype.OPEN_TIMEOUT = 2000;\n// Wrap native IDBObjectStore methods according to their mode.\nconst methodsToWrap = {\n readonly: ['get', 'count', 'getKey', 'getAll', 'getAllKeys'],\n readwrite: ['add', 'put', 'clear', 'delete'],\n};\nfor (const [mode, methods] of Object.entries(methodsToWrap)) {\n for (const method of methods) {\n if (method in IDBObjectStore.prototype) {\n // Don't use arrow functions here since we're outside of the class.\n DBWrapper.prototype[method] =\n async function (storeName, ...args) {\n return await this._call(method, storeName, mode, ...args);\n };\n }\n }\n}\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {module:workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n *\n * @memberof module:workbox-routing\n */\nfunction setCatchHandler(handler) {\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.setCatchHandler(handler);\n}\nexport { setCatchHandler };\n","import { registerRoute, setCatchHandler } from 'workbox-routing';\nimport { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';\nimport { isNav } from './utils';\nimport { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';\n\nexport function getFiles() {\n\treturn self.__WB_MANIFEST;\n}\n\nexport function setupPrecaching(precacheFiles, precachingOptions) {\n\tprecacheAndRoute(precacheFiles, precachingOptions || PRECACHING_OPTIONS);\n}\n\nexport function setupRouting() {\n\t/**\n\t * Adding this before `precacheAndRoute` lets us handle all\n\t * the navigation requests even if they are in precache.\n\t */\n\tregisterRoute(({ event }) => isNav(event), NETWORK_HANDLER);\n\n\tsetCatchHandler(({ event }) => {\n\t\tif (isNav(event)) {\n\t\t\treturn caches.match(getCacheKeyForURL('/200.html'));\n\t\t}\n\t\treturn Response.error();\n\t});\n}\n\nexport { PRECACHING_OPTIONS };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames as _cacheNames } from './_private/cacheNames.js';\nimport './_version.js';\n/**\n * Get the current cache names and prefix/suffix used by Workbox.\n *\n * `cacheNames.precache` is used for precached assets,\n * `cacheNames.googleAnalytics` is used by `workbox-google-analytics` to\n * store `analytics.js`, and `cacheNames.runtime` is used for everything else.\n *\n * `cacheNames.prefix` can be used to retrieve just the current prefix value.\n * `cacheNames.suffix` can be used to retrieve just the current suffix value.\n *\n * @return {Object} An object with `precache`, `runtime`, `prefix`, and\n * `googleAnalytics` properties.\n *\n * @memberof module:workbox-core\n */\nconst cacheNames = {\n get googleAnalytics() {\n return _cacheNames.getGoogleAnalyticsName();\n },\n get precache() {\n return _cacheNames.getPrecacheName();\n },\n get prefix() {\n return _cacheNames.getPrefix();\n },\n get runtime() {\n return _cacheNames.getRuntimeName();\n },\n get suffix() {\n return _cacheNames.getSuffix();\n },\n};\nexport { cacheNames };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * This class allows you to set up rules determining what\n * status codes and/or headers need to be present in order for a\n * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * to be considered cacheable.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponse {\n /**\n * To construct a new CacheableResponse instance you must provide at least\n * one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config = {}) {\n if (process.env.NODE_ENV !== 'production') {\n if (!(config.statuses || config.headers)) {\n throw new WorkboxError('statuses-or-headers-required', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n });\n }\n if (config.statuses) {\n assert.isArray(config.statuses, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.statuses',\n });\n }\n if (config.headers) {\n assert.isType(config.headers, 'object', {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'constructor',\n paramName: 'config.headers',\n });\n }\n }\n this._statuses = config.statuses;\n this._headers = config.headers;\n }\n /**\n * Checks a response to see whether it's cacheable or not, based on this\n * object's configuration.\n *\n * @param {Response} response The response whose cacheability is being\n * checked.\n * @return {boolean} `true` if the `Response` is cacheable, and `false`\n * otherwise.\n */\n isResponseCacheable(response) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(response, Response, {\n moduleName: 'workbox-cacheable-response',\n className: 'CacheableResponse',\n funcName: 'isResponseCacheable',\n paramName: 'response',\n });\n }\n let cacheable = true;\n if (this._statuses) {\n cacheable = this._statuses.includes(response.status);\n }\n if (this._headers && cacheable) {\n cacheable = Object.keys(this._headers).some((headerName) => {\n return response.headers.get(headerName) === this._headers[headerName];\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!cacheable) {\n logger.groupCollapsed(`The request for ` +\n `'${getFriendlyURL(response.url)}' returned a response that does ` +\n `not meet the criteria for being cached.`);\n logger.groupCollapsed(`View cacheability criteria here.`);\n logger.log(`Cacheable statuses: ` +\n JSON.stringify(this._statuses));\n logger.log(`Cacheable headers: ` +\n JSON.stringify(this._headers, null, 2));\n logger.groupEnd();\n const logFriendlyHeaders = {};\n response.headers.forEach((value, key) => {\n logFriendlyHeaders[key] = value;\n });\n logger.groupCollapsed(`View response status and headers here.`);\n logger.log(`Response status: ` + response.status);\n logger.log(`Response headers: ` +\n JSON.stringify(logFriendlyHeaders, null, 2));\n logger.groupEnd();\n logger.groupCollapsed(`View full response details here.`);\n logger.log(response.headers);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n }\n return cacheable;\n }\n}\nexport { CacheableResponse };\n","import { NetworkFirst } from 'workbox-strategies';\nimport { cacheNames } from 'workbox-core';\nimport { CacheableResponsePlugin } from 'workbox-cacheable-response';\n\nexport const PRECACHING_OPTIONS = {};\n\nexport const NETWORK_HANDLER = new NetworkFirst({\n\t// this cache is plunged with every new service worker deploy so we dont need to care about purging the cache.\n\tcacheName: cacheNames.precache,\n\tnetworkTimeoutSeconds: 5, // if u dont start getting headers within 5 sec fallback to cache.\n\tplugins: [\n\t\tnew CacheableResponsePlugin({\n\t\t\tstatuses: [200], // only cache valid responses, not opaque responses e.g. wifi portal.\n\t\t}),\n\t],\n});\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {module:workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {module:workbox-routing.Route} The generated `Route`(Useful for\n * unregistering).\n *\n * @memberof module:workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http') ?\n captureUrl.pathname : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if ((new RegExp(`${wildcards}`)).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if ((url.pathname === captureUrl.pathname) &&\n (url.origin !== captureUrl.origin)) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { CacheableResponse } from './CacheableResponse.js';\nimport './_version.js';\n/**\n * A class implementing the `cacheWillUpdate` lifecycle callback. This makes it\n * easier to add in cacheability checks to requests made via Workbox's built-in\n * strategies.\n *\n * @memberof module:workbox-cacheable-response\n */\nclass CacheableResponsePlugin {\n /**\n * To construct a new CacheableResponsePlugin instance you must provide at\n * least one of the `config` properties.\n *\n * If both `statuses` and `headers` are specified, then both conditions must\n * be met for the `Response` to be considered cacheable.\n *\n * @param {Object} config\n * @param {Array} [config.statuses] One or more status codes that a\n * `Response` can have and be considered cacheable.\n * @param {Object} [config.headers] A mapping of header names\n * and expected values that a `Response` can have and be considered cacheable.\n * If multiple headers are provided, only one needs to be present.\n */\n constructor(config) {\n /**\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n * @private\n */\n this.cacheWillUpdate = async ({ response }) => {\n if (this._cacheableResponse.isResponseCacheable(response)) {\n return response;\n }\n return null;\n };\n this._cacheableResponse = new CacheableResponse(config);\n }\n}\nexport { CacheableResponsePlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Takes in a URL, and returns the corresponding URL that could be used to\n * lookup the entry in the precache.\n *\n * If a relative URL is provided, the location of the service worker file will\n * be used as the base.\n *\n * For precached entries without revision information, the cache key will be the\n * same as the original URL.\n *\n * For precached entries with revision information, the cache key will be the\n * original URL with the addition of a query parameter used for keeping track of\n * the revision info.\n *\n * @param {string} url The URL whose cache key to look up.\n * @return {string} The cache key that corresponds to that URL.\n *\n * @memberof module:workbox-precaching\n */\nfunction getCacheKeyForURL(url) {\n const precacheController = getOrCreatePrecacheController();\n return precacheController.getCacheKeyForURL(url);\n}\nexport { getCacheKeyForURL };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:5.1.4'] && _();\n}\ncatch (e) { }\n"]} \ No newline at end of file diff --git a/preact.config.js b/preact.config.js new file mode 100644 index 0000000..3d8132e --- /dev/null +++ b/preact.config.js @@ -0,0 +1,3 @@ +export default (config) => { + config.output.publicPath = '/huge-link/'; +};