diff --git a/example/dist/index.js b/example/dist/index.js index e9eaa45..908fd8a 100644 --- a/example/dist/index.js +++ b/example/dist/index.js @@ -1,4 +1,4 @@ -!function(e){function t(e){delete installedChunks[e]}function a(e){var t=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.src=p.p+""+e+"."+b+".hot-update.js",t.appendChild(a)}function o(e){return e=e||1e4,new Promise(function(t,a){if("undefined"==typeof XMLHttpRequest)return a(new Error("No browser support"));try{var o=new XMLHttpRequest,n=p.p+""+b+".hot-update.json";o.open("GET",n,!0),o.timeout=e,o.send(null)}catch(e){return a(e)}o.onreadystatechange=function(){if(4===o.readyState)if(0===o.status)a(new Error("Manifest request to "+n+" timed out."));else if(404===o.status)t();else if(200!==o.status&&304!==o.status)a(new Error("Manifest request to "+n+" failed."));else{try{var e=JSON.parse(o.responseText)}catch(e){return void a(e)}t(e)}}})}function n(e){var t=P[e];if(!t)return p;var a=function(a){return t.hot.active?(P[a]?P[a].parents.indexOf(e)<0&&P[a].parents.push(e):(L=[e],m=a),t.children.indexOf(a)<0&&t.children.push(a)):(console.warn("[HMR] unexpected require("+a+") from disposed module "+e),L=[]),p(a)};for(var o in p)Object.prototype.hasOwnProperty.call(p,o)&&"e"!==o&&Object.defineProperty(a,o,function(e){return{configurable:!0,enumerable:!0,get:function(){return p[e]},set:function(t){p[e]=t}}}(o));return a.e=function(e){function t(){A--,"prepare"===C&&(j[e]||c(e),0===A&&0===U&&l())}return"ready"===C&&s("prepare"),A++,p.e(e).then(t,function(e){throw t(),e})},a}function r(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:m!==e,active:!0,accept:function(e,a){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var o=0;o=0&&t._disposeHandlers.splice(a,1)},check:i,apply:f,status:function(e){if(!e)return C;B.push(e)},addStatusHandler:function(e){B.push(e)},removeStatusHandler:function(e){var t=B.indexOf(e);t>=0&&B.splice(t,1)},data:R[e]};return m=void 0,t}function s(e){C=e;for(var t=0;t0;){var r=n.pop(),s=r.id,d=r.chain;if((u=P[s])&&!u.hot._selfAccepted){if(u.hot._selfDeclined)return{type:"self-declined",chain:d,moduleId:s};if(u.hot._main)return{type:"unaccepted",chain:d,moduleId:s};for(var i=0;i=0||(l.hot._acceptedDependencies[s]?(a[c]||(a[c]=[]),o(a[c],[s])):(delete a[c],t.push(c),n.push({chain:d.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:a}}(c):{type:"disposed",moduleId:w};var k=!1,v=!1,B=!1,U="";switch(y.chain&&(U="\nUpdate propagation: "+y.chain.join(" -> ")),y.type){case"self-declined":a.onDeclined&&a.onDeclined(y),a.ignoreDeclined||(k=new Error("Aborted because of self decline: "+y.moduleId+U));break;case"declined":a.onDeclined&&a.onDeclined(y),a.ignoreDeclined||(k=new Error("Aborted because of declined dependency: "+y.moduleId+" in "+y.parentId+U));break;case"unaccepted":a.onUnaccepted&&a.onUnaccepted(y),a.ignoreUnaccepted||(k=new Error("Aborted because "+c+" is not accepted"+U));break;case"accepted":a.onAccepted&&a.onAccepted(y),v=!0;break;case"disposed":a.onDisposed&&a.onDisposed(y),B=!0;break;default:throw new Error("Unexception type "+y.type)}if(k)return s("abort"),Promise.reject(k);if(v){h[c]=_[c],o(f,y.outdatedModules);for(c in y.outdatedDependencies)Object.prototype.hasOwnProperty.call(y.outdatedDependencies,c)&&(l[c]||(l[c]=[]),o(l[c],y.outdatedDependencies[c]))}B&&(o(f,[y.moduleId]),h[c]=m)}var A=[];for(r=0;r0;)if(c=S.pop(),u=P[c]){var E={},T=u.hot._disposeHandlers;for(i=0;i=0&&x.parents.splice(j,1))}}var N,H;for(c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&(u=P[c]))for(H=l[c],i=0;i=0&&u.children.splice(j,1);s("apply"),b=g;for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&(e[c]=h[c]);var D=null;for(c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&(u=P[c])){H=l[c];var W=[];for(r=0;r=0)continue;W.push(n)}for(r=0;r=0&&t._disposeHandlers.splice(a,1)},check:i,apply:f,status:function(e){if(!e)return C;B.push(e)},addStatusHandler:function(e){B.push(e)},removeStatusHandler:function(e){var t=B.indexOf(e);t>=0&&B.splice(t,1)},data:R[e]};return m=void 0,t}function s(e){C=e;for(var t=0;t0;){var r=n.pop(),s=r.id,d=r.chain;if((u=P[s])&&!u.hot._selfAccepted){if(u.hot._selfDeclined)return{type:"self-declined",chain:d,moduleId:s};if(u.hot._main)return{type:"unaccepted",chain:d,moduleId:s};for(var i=0;i=0||(l.hot._acceptedDependencies[s]?(a[c]||(a[c]=[]),o(a[c],[s])):(delete a[c],t.push(c),n.push({chain:d.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:a}}(c):{type:"disposed",moduleId:w};var k=!1,v=!1,B=!1,U="";switch(y.chain&&(U="\nUpdate propagation: "+y.chain.join(" -> ")),y.type){case"self-declined":a.onDeclined&&a.onDeclined(y),a.ignoreDeclined||(k=new Error("Aborted because of self decline: "+y.moduleId+U));break;case"declined":a.onDeclined&&a.onDeclined(y),a.ignoreDeclined||(k=new Error("Aborted because of declined dependency: "+y.moduleId+" in "+y.parentId+U));break;case"unaccepted":a.onUnaccepted&&a.onUnaccepted(y),a.ignoreUnaccepted||(k=new Error("Aborted because "+c+" is not accepted"+U));break;case"accepted":a.onAccepted&&a.onAccepted(y),v=!0;break;case"disposed":a.onDisposed&&a.onDisposed(y),B=!0;break;default:throw new Error("Unexception type "+y.type)}if(k)return s("abort"),Promise.reject(k);if(v){h[c]=_[c],o(f,y.outdatedModules);for(c in y.outdatedDependencies)Object.prototype.hasOwnProperty.call(y.outdatedDependencies,c)&&(l[c]||(l[c]=[]),o(l[c],y.outdatedDependencies[c]))}B&&(o(f,[y.moduleId]),h[c]=m)}var A=[];for(r=0;r0;)if(c=S.pop(),u=P[c]){var E={},T=u.hot._disposeHandlers;for(i=0;i=0&&x.parents.splice(j,1))}}var N,H;for(c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&(u=P[c]))for(H=l[c],i=0;i=0&&u.children.splice(j,1);s("apply"),b=g;for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&(e[c]=h[c]);var D=null;for(c in l)if(Object.prototype.hasOwnProperty.call(l,c)&&(u=P[c])){H=l[c];var W=[];for(r=0;r=0)continue;W.push(n)}for(r=0;r2&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1]))}function Oe(e,t,a,o){if(null!==a&&a.type===np)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":if(o)return!1;if(null!==a)return!a.acceptsBooleans;var n=e.toLowerCase().slice(0,5);return"data-"!==n&&"aria-"!==n;default:return!1}}function Ie(e,t,a,o){if(null===t||void 0===t)return!0;if(Oe(e,t,a,o))return!0;if(o)return!1;if(null!==a)switch(a.type){case sp:return!t;case dp:return!1===t;case ip:return isNaN(t);case up:return isNaN(t)||t<1}return!1}function Ge(e){return _p.hasOwnProperty(e)?_p[e]:null}function Ke(e,t,a,o,n){this.acceptsBooleans=t===rp||t===sp||t===dp,this.attributeName=o,this.attributeNamespace=n,this.mustUseProperty=a,this.propertyName=e,this.type=t}function Qe(e,t,a,o){if(o.mustUseProperty){return e[o.propertyName]}var n=o.attributeName,r=null;if(o.type===dp){if(e.hasAttribute(n)){var s=e.getAttribute(n);return""===s||(Ie(t,a,o,!1)?s:s===""+a?a:s)}}else if(e.hasAttribute(n)){if(Ie(t,a,o,!1))return e.getAttribute(n);if(o.type===sp)return a;r=e.getAttribute(n)}return Ie(t,a,o,!1)?null===r?a:r:r===""+a?a:r}function Je(e,t,a){if(Me(t)){if(!e.hasAttribute(t))return void 0===a?void 0:null;var o=e.getAttribute(t);return o===""+a?a:o}}function Ye(e,t,a,o){var n=Ge(t);if(!Fe(t,n,o))if(Ie(t,a,n,o)&&(a=null),o||null===n){if(Me(t)){var r=t;null===a?e.removeAttribute(r):e.setAttribute(r,""+a)}}else{var s=n.mustUseProperty;if(s){var d=n.propertyName;if(null===a){var i=n.type;e[d]=i!==sp&&""}else e[d]=a}else{var u=n.attributeName,c=n.attributeNamespace;if(null===a)e.removeAttribute(u);else{var l=n.type,f=void 0;f=l===sp||l===dp&&!0===a?"":""+a,c?e.setAttributeNS(c,u,f):e.setAttribute(u,f)}}}}function Xe(e){return""+e}function qe(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Ve(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function Ze(e,t){var a=e,o=t.checked;return Bu({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=o?o:a._wrapperState.initialChecked})}function $e(e,t){kp.checkPropTypes("input",t),void 0===t.checked||void 0===t.defaultChecked||xp||(op(!1,"%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",xe()||"A component",t.type),xp=!0),void 0===t.value||void 0===t.defaultValue||Tp||(op(!1,"%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://fb.me/react-controlled-components",xe()||"A component",t.type),Tp=!0);var a=e,o=null==t.defaultValue?"":t.defaultValue;a._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:qe(null!=t.value?t.value:o),controlled:Ve(t)}}function et(e,t){var a=e,o=t.checked;null!=o&&Ye(a,"checked",o,!1)}function tt(e,t){var a=e,o=Ve(t);a._wrapperState.controlled||!o||Hp||(op(!1,"A component is changing an uncontrolled input of type %s to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",t.type),Hp=!0),!a._wrapperState.controlled||o||Np||(op(!1,"A component is changing a controlled input of type %s to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components",t.type),Np=!0),et(e,t);var n=qe(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===a.value||a.value!=n)&&(a.value=Xe(n)):a.value!==Xe(n)&&(a.value=Xe(n));else if("submit"===r||"reset"===r)return void a.removeAttribute("value");Pp?t.hasOwnProperty("defaultValue")&&rt(a,t.type,qe(t.defaultValue)):t.hasOwnProperty("value")?rt(a,t.type,n):t.hasOwnProperty("defaultValue")&&rt(a,t.type,qe(t.defaultValue)),Pp?null==t.defaultChecked?a.removeAttribute("checked"):a.defaultChecked=!!t.defaultChecked:null==t.checked&&null!=t.defaultChecked&&(a.defaultChecked=!!t.defaultChecked)}function at(e,t,a){var o=e;if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type,r="submit"===n||"reset"===n;if(r&&(void 0===t.value||null===t.value))return;var s=Xe(o._wrapperState.initialValue);if(!a)if(Pp){var d=qe(t.value);null!=d&&(r||d!==o.value)&&(o.value=Xe(d))}else s!==o.value&&(o.value=s);if(Pp){var i=qe(t.defaultValue);null!=i&&(o.defaultValue=Xe(i))}else o.defaultValue=s}var u=o.name;""!==u&&(o.name=""),Pp?(a||et(e,t),t.hasOwnProperty("defaultChecked")&&(o.defaultChecked=!o.defaultChecked,o.defaultChecked=!!t.defaultChecked)):(o.defaultChecked=!o.defaultChecked,o.defaultChecked=!!o._wrapperState.initialChecked),""!==u&&(o.name=u)}function ot(e,t){var a=e;tt(a,t),nt(a,t)}function nt(e,a){var o=a.name;if("radio"===a.type&&null!=o){for(var n=e;n.parentNode;)n=n.parentNode;for(var r=n.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),s=0;s=32||13===t?t:0}function Dt(e){if(e.key){var t=vh[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var a=Ht(e);return 13===a?"Enter":String.fromCharCode(a)}return"keydown"===e.type||"keyup"===e.type?Bh[e.keyCode]||"Unidentified":""}function Wt(e,t){var a=e[0],o=e[1],n=o[0].toUpperCase()+o.slice(1),r="on"+n,s={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[a],isInteractive:t};Eh[o]=s,Th[a]=s}function Mt(e){for(;e.return;)e=e.return;return e.tag!==nc?null:e.stateNode.containerInfo}function Ft(e,t,a){if(Wh.length){var o=Wh.pop();return o.topLevelType=e,o.nativeEvent=t,o.targetInst=a,o}return{topLevelType:e,nativeEvent:t,targetInst:a,ancestors:[]}}function Ot(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,Wh.length=t)return{node:a,offset:t-o};o=n}a=ea(ta(a))}}function oa(e){var t=e.ownerDocument,a=t&&t.defaultView||window,o=a.getSelection&&a.getSelection();if(!o||0===o.rangeCount)return null;var n=o.anchorNode,r=o.anchorOffset,s=o.focusNode,d=o.focusOffset;try{n.nodeType,s.nodeType}catch(e){return null}return na(e,n,r,s,d)}function na(e,t,a,o,n){var r=0,s=-1,d=-1,i=0,u=0,c=e,l=null;e:for(;;){for(var f=null;;){if(c!==t||0!==a&&c.nodeType!==Af||(s=r+a),c!==o||0!==n&&c.nodeType!==Af||(d=r+n),c.nodeType===Af&&(r+=c.nodeValue.length),null===(f=c.firstChild))break;l=c,c=f}for(;;){if(c===e)break e;if(l===t&&++i===a&&(s=r),l===o&&++u===n&&(d=r),null!==(f=c.nextSibling))break;c=l,l=c.parentNode}c=f}return-1===s||-1===d?null:{start:s,end:d}}function ra(e,t){var a=e.ownerDocument||document,o=a&&a.defaultView||window;if(o.getSelection){var n=o.getSelection(),r=e.textContent.length,s=Math.min(t.start,r),d=void 0===t.end?s:Math.min(t.end,r);if(!n.extend&&s>d){var i=d;d=s,s=i}var u=aa(e,s),c=aa(e,d);if(u&&c){if(1===n.rangeCount&&n.anchorNode===u.node&&n.anchorOffset===u.offset&&n.focusNode===c.node&&n.focusOffset===c.offset)return;var l=a.createRange();l.setStart(u.node,u.offset),n.removeAllRanges(),s>d?(n.addRange(l),n.extend(c.node,c.offset)):(l.setEnd(c.node,c.offset),n.addRange(l))}}}function sa(e){return e&&e.nodeType===Af}function da(e,t){return!(!e||!t)&&(e===t||!sa(e)&&(sa(t)?da(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ia(e){return e&&e.ownerDocument&&da(e.ownerDocument.documentElement,e)}function ua(){for(var e=window,t=$t();t instanceof e.HTMLIFrameElement;){try{e=t.contentDocument.defaultView}catch(e){return t}t=$t(e.document)}return t}function ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function la(){var e=ua();return{focusedElem:e,selectionRange:ca(e)?pa(e):null}}function fa(e){var t=ua(),a=e.focusedElem,o=e.selectionRange;if(t!==a&&ia(a)){null!==o&&ca(a)&&ha(a,o);for(var n=[],r=a;r=r.parentNode;)r.nodeType===Uf&&n.push({element:r,left:r.scrollLeft,top:r.scrollTop});"function"==typeof a.focus&&a.focus();for(var s=0;s children.")))}),null==t.selected||Vh||(op(!1,"Use the `defaultValue` or `value` props on must be a scalar value if `multiple` is false.%s",a,Ra())}}}function va(e,t,a,o){var n=e.options;if(t){for(var r=a,s={},d=0;d."),Bu({},a,{value:void 0,defaultValue:void 0,children:Xe(o._wrapperState.initialValue)})}function za(e,a){var o=e;kp.checkPropTypes("textarea",a),void 0===a.value||void 0===a.defaultValue||tm||(op(!1,"%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://fb.me/react-controlled-components",xe()||"A component"),tm=!0);var n=a.value;if(null==n){var r=a.defaultValue,s=a.children;null!=s&&(op(!1,"Use the `defaultValue` or `value` props instead of setting children on