You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
4.5 KiB
2 lines
4.5 KiB
7 years ago
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("preact")):"function"==typeof define&&define.amd?define(["preact"],t):e.preactMarkup=t(e.preact)}(this,function(e){"use strict";function t(e,t){var n=void 0,o="html"===t?"text/html":"application/xml",i=void 0,a=void 0,p=void 0;"html"===t?(p="body",a="<!DOCTYPE html>\n<html><body>"+e+"</body></html>"):(p="xml",a='<?xml version="1.0" encoding="UTF-8"?>\n<xml>'+e+"</xml>");try{n=(new DOMParser).parseFromString(a,o)}catch(e){i=e}if(n||"html"!==t||(n=s||(s=r()),n.open(),n.write(a),n.close()),n){var l=n.getElementsByTagName(p)[0],u=l.firstChild;return e&&!u&&(l.error="Document parse failed."),u&&"parsererror"===String(u.nodeName).toLowerCase()&&(u.removeChild(u.firstChild),u.removeChild(u.lastChild),l.error=u.textContent||u.nodeValue||i||"Unknown error",l.removeChild(u)),l}}function r(){if(document.implementation&&document.implementation.createHTMLDocument)return document.implementation.createHTMLDocument("");var e=document.createElement("iframe");return e.style.cssText="position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;",e.setAttribute("sandbox","allow-forms"),document.body.appendChild(e),e.contentWindow.document}function n(e,t,r,n){return o.visitor=t,o.h=r,o.options=n||c,o(e)}function o(e,t,r){if(3===e.nodeType){var n="textContent"in e?e.textContent:e.nodeValue||"";if(o.options.trim!==!1){var p=0===t||t===r.length-1;if(n=n.match(/^[\s\n]+$/g)&&"all"!==o.options.trim?" ":n.replace(/(^[\s\n]+|[\s\n]+$)/g,"all"===o.options.trim||p?"":" "),(!n||" "===n)&&r.length>1&&p)return null}return n}if(1!==e.nodeType)return null;var l=String(e.nodeName).toLowerCase();if("script"===l&&!o.options.allowScripts)return null;var u=o.h(l,i(e.attributes),a(e.childNodes));return o.visitor&&o.visitor(u),u}function i(e){var t=e&&e.length;if(!t)return null;for(var r={},n=0;n<t;n++){var i=e[n],a=i.name,p=i.value;""===p&&(p=!0),"on"===a.substring(0,2)&&o.options.allowEvents&&(p=new Function(p)),r[a]=p}return r}function a(e){var t=e&&Array.prototype.map.call(e,o).filter(m);return t&&t.length?t:null}function p(e,r,o,i,a){var p=t(e,r);if(p&&p.error)throw new Error(p.error);var l=p&&p.body||p;u.map=i||f;var s=l&&n(l,u,o,a);return u.map=null,s&&s.children||null}function l(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function u(e){var t=e.nodeName.toLowerCase(),r=u.map;r&&r.hasOwnProperty(t)?(e.nodeName=r[t],e.attributes=Object.keys(e.attributes||{}).reduce(function(t,r){return t[l(r)]=e.attributes[r],t},{})):e.nodeName=t.replace(/[^a-z0-9-]/i,"")}var s=void 0,c={},m=function(e){return e},f={},d=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},v=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},h=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},y=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},w=void 0,b=function(t){function r(){return d(this,r),y(this,t.apply(this,arguments))}return v(r,t),r.setReviver=function(e){w=e},r.prototype.shouldComponentUpdate=function(e){var t=e.wrap,r=e.type,n=e.markup,o=this.props;return t!==o.wrap||r!==o.type||n!==o.markup},r.prototype.setComponents=function(e){if(this.map={},e)for(var t in e)if(e.hasOwnProperty(t)){var r=t.replace(/([A-Z]+)([A-Z][a-z0-9])|([a-z0-9]+)([A-Z])/g,"$1$3-$2$4").toLowerCase();this.map[r]=e[t]}},r.prototype.render=function(t){var r=t.wrap,n=void 0===r||r,o=t.type,i=t.markup,a=t.components,l=t.reviver,u=t.onError,s=t["allow-scripts"],c=t["allow-events"],m=t.trim,f=h(t,["wrap","type","markup","components","reviver","onError","allow-scripts","allow-events","trim"]),d=l||this.reviv
|
||
|
//# sourceMappingURL=preact-markup.min.js.map
|