Created
May 28, 2018 16:15
-
-
Save staydecent/a894ca528135dd729487cbf6f0c5d910 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("prop-types"),require("preact")):"function"==typeof define&&define.amd?define(["prop-types","preact"],t):e.preactCompat=t(e.PropTypes,e.preact)}(this,function(a,p){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var e="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),t="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",o={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},i=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,c={},l="undefined"==typeof process||!process.env||"production"!==process.env.NODE_ENV;function n(){return null}var s=p.h("a",null).constructor;s.prototype.$$typeof=t,s.prototype.preactCompatUpgraded=!1,s.prototype.preactCompatNormalized=!1,Object.defineProperty(s.prototype,"type",{get:function(){return this.nodeName},set:function(e){this.nodeName=e},configurable:!0}),Object.defineProperty(s.prototype,"props",{get:function(){return this.attributes},set:function(e){this.attributes=e},configurable:!0});var u=p.options.event;p.options.event=function(e){return u&&(e=u(e)),e.persist=Object,e.nativeEvent=e};var d=p.options.vnode;function f(e,t,n){var r=t&&t._preactCompatRendered&&t._preactCompatRendered.base;r&&r.parentNode!==t&&(r=null),!r&&t&&(r=t.firstElementChild);for(var o=t.childNodes.length;o--;)t.childNodes[o]!==r&&t.removeChild(t.childNodes[o]);var i=p.render(e,t,r);return t&&(t._preactCompatRendered=i&&(i._component||{base:i})),"function"==typeof n&&n(),i&&i._component||i}p.options.vnode=function(e){if(!e.preactCompatUpgraded){e.preactCompatUpgraded=!0;var t=e.nodeName,n=e.attributes=null==e.attributes?{}:O({},e.attributes);"function"==typeof t?(!0===t[r]||t.prototype&&"isReactComponent"in t.prototype)&&(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),e.preactCompatNormalized||_(e),function(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&O(e.attributes,t.defaultProps);n&&O(e.attributes,n)}(e)):(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue)),function(e,t){var n,r,o;if(t){for(o in t)if(n=i.test(o))break;if(n)for(o in r=e.attributes={},t)t.hasOwnProperty(o)&&(r[i.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=t[o])}}(e,n))}d&&d(e)};var h=function(){};h.prototype.getChildContext=function(){return this.props.context},h.prototype.render=function(e){return e.children[0]};var m,y=[],b={map:function(e,t,n){return null==e?null:(e=b.toArray(e),n&&n!==e&&(t=t.bind(n)),e.map(t))},forEach:function(e,t,n){if(null==e)return null;e=b.toArray(e),n&&n!==e&&(t=t.bind(n)),e.forEach(t)},count:function(e){return e&&e.length||0},only:function(e){if(1!==(e=b.toArray(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:function(e){return null==e?[]:y.concat(e)}};function v(e){return N.bind(null,e)}for(var g={},C=e.length;C--;)g[e[C]]=v(e[C]);function P(e){var t,n=e[r];return n?!0===n?e:n:(n=R({displayName:(t=e).displayName||t.name,render:function(){return t(this.props,this.context)}}),Object.defineProperty(n,r,{configurable:!0,value:!0}),n.displayName=e.displayName,n.propTypes=e.propTypes,n.defaultProps=e.defaultProps,Object.defineProperty(e,r,{configurable:!0,value:n}),n)}function N(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function e(t,n){for(var r=n||0;r<t.length;r++){var o=t[r];Array.isArray(o)?e(o):o&&"object"==typeof o&&!x(o)&&(o.props&&o.type||o.attributes&&o.nodeName||o.children)&&(t[r]=N(o.type||o.nodeName,o.props||o.attributes,o.children))}}(e,2),_(p.h.apply(void 0,e))}function _(e){var t;e.preactCompatNormalized=!0,function(e){var t=e.attributes||(e.attributes={});w.enumerable="className"in t,t.className&&(t.class=t.className);Object.defineProperty(t,"className",w)}(e),"function"!=typeof(t=e.nodeName)||t.prototype&&t.prototype.render||(e.nodeName=P(e.nodeName));var n,r,o=e.attributes.ref,i=o&&typeof o;return!m||"string"!==i&&"number"!==i||(e.attributes.ref=(n=o,(r=m)._refProxies[n]||(r._refProxies[n]=function(e){r&&r.refs&&null===(r.refs[n]=e)&&(delete r._refProxies[n],r=null)}))),function(e){var t=e.nodeName,n=e.attributes;if(!n||"string"!=typeof t)return;var r={};for(var o in n)r[o.toLowerCase()]=o;r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]);if(r.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var i=r.oninput||"oninput";n[i]||(n[i]=E([n[i],n[r.onchange]]),delete n[r.onchange])}}(e),e}function x(e){return e&&(e instanceof s||e.$$typeof===t)}var w={configurable:!0,get:function(){return this.class},set:function(e){this.class=e}};function O(e,t){for(var n=arguments,r=1,o=void 0;r<arguments.length;r++)if(o=n[r])for(var i in o)o.hasOwnProperty(i)&&(e[i]=o[i]);return e}function k(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function S(){}function R(e){function t(e,t){!function(e){for(var t in e){var n=e[t];"function"!=typeof n||n.__bound||o.hasOwnProperty(t)||((e[t]=n.bind(e)).__bound=!0)}}(this),W.call(this,e,t,c),j.call(this,e,t)}return(e=O({constructor:t},e)).mixins&&function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=E(t[n].concat(e[n]||y),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}(e,function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var o in r)r.hasOwnProperty(o)&&"function"==typeof r[o]&&(t[o]||(t[o]=[])).push(r[o])}return t}(e.mixins)),e.statics&&O(t,e.statics),e.propTypes&&(t.propTypes=e.propTypes),e.defaultProps&&(t.defaultProps=e.defaultProps),e.getDefaultProps&&(t.defaultProps=e.getDefaultProps.call(t)),S.prototype=W.prototype,t.prototype=O(new S,e),t.displayName=e.displayName||"Component",t}function A(e,t,n){if("string"==typeof t&&(t=e.constructor.prototype[t]),"function"==typeof t)return t.apply(e,n)}function E(i,a){return function(){for(var e,t=arguments,n=0;n<i.length;n++){var r=A(this,i[n],t);if(a&&null!=r)for(var o in e||(e={}),r)r.hasOwnProperty(o)&&(e[o]=r[o]);else void 0!==r&&(e=r)}return e}}function j(e,t){D.call(this,e,t),this.componentWillReceiveProps=E([D,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=E([D,T,this.render||"render",U])}function D(e,t){if(e){var n=e.children;if(n&&Array.isArray(n)&&1===n.length&&("string"==typeof n[0]||"function"==typeof n[0]||n[0]instanceof s)&&(e.children=n[0],e.children&&"object"==typeof e.children&&(e.children.length=1,e.children[0]=e.children)),l){var r="function"==typeof this?this:this.constructor,o=this.propTypes||r.propTypes,i=this.displayName||r.name;o&&a.checkPropTypes(o,e,"prop",i)}}}function T(e){m=this}function U(){m===this&&(m=null)}function W(e,t,n){p.Component.call(this,e,t),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},n!==c&&j.call(this,e,t)}function M(e,t){W.call(this,e,t)}return O(W.prototype=new p.Component,{constructor:W,isReactComponent:{},replaceState:function(e,t){for(var n in this.setState(e,t),this.state)n in e||delete this.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),S.prototype=W.prototype,(M.prototype=new S).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(e,t){return k(this.props,e)||k(this.state,t)},{version:"15.1.0",DOM:g,PropTypes:a,Children:b,render:f,createClass:R,createFactory:v,createElement:N,cloneElement:function(e,t){for(var n=[],r=arguments.length-2;0<r--;)n[r]=arguments[r+2];if(!x(e))return e;var o=e.attributes||e.props,i=[p.h(e.nodeName||e.type,O({},o),e.children||o&&o.children),t];return n&&n.length?i.push(n):t&&t.children&&i.push(t.children),_(p.cloneElement.apply(void 0,i))},isValidElement:x,findDOMNode:function(e){return e&&e.base||null},unmountComponentAtNode:function(e){var t=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!t||t.parentNode!==e||(p.render(p.h(n),e,t),0))},Component:W,PureComponent:M,unstable_renderSubtreeIntoContainer:function(e,t,n,r){var o=f(p.h(h,{context:e.context},t),n),i=o._component||o.base;return r&&r.call(i,o),i},unstable_batchedUpdates:function(e){e()},__spread:O}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment