From 0884c6112392453fd83b1e6647f183fff0e460ca Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Wed, 16 May 2018 17:35:27 +0200 Subject: [PATCH] refactoring, fix reverse breadcrumb --- assets/dist/main.js | 12108 +++++++++++++++++++++++++++- assets/dist/main.js.map | 2 +- assets/main.js | 2 +- assets/modules/ModeConnections.js | 13 +- assets/modules/ModeText.js | 42 +- assets/modules/dbs.js | 61 +- webpack.config.js | 80 +- 7 files changed, 12228 insertions(+), 80 deletions(-) diff --git a/assets/dist/main.js b/assets/dist/main.js index 9b7bb14..f4cd6a7 100644 --- a/assets/dist/main.js +++ b/assets/dist/main.js @@ -1,2 +1,12108 @@ -(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.l=true;return i.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t))Object.defineProperty(e,t,{configurable:false,enumerable:true,get:n})};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=21)})([function(e,t,r){"use strict";function n(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===n(e)}var s=Object.prototype.hasOwnProperty;function o(e,t){return s.call(e,t)}function a(e){var t=Array.prototype.slice.call(arguments,1);t.forEach(function(t){if(!t)return;if("object"!==typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})});return e}function l(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function u(e){if(e>=55296&&e<=57343)return false;if(e>=64976&&e<=65007)return false;if(65535===(65535&e)||65534===(65535&e))return false;if(e>=0&&e<=8)return false;if(11===e)return false;if(e>=14&&e<=31)return false;if(e>=127&&e<=159)return false;if(e>1114111)return false;return true}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}var f=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;var p=/&([a-z#][a-z0-9]{1,31});/gi;var h=new RegExp(f.source+"|"+p.source,"gi");var d=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;var m=r(11);function g(e,t){var r=0;if(o(m,t))return m[t];if(35===t.charCodeAt(0)&&d.test(t)){r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);if(u(r))return c(r)}return e}function v(e){if(e.indexOf("\\")<0)return e;return e.replace(f,"$1")}function _(e){if(e.indexOf("\\")<0&&e.indexOf("&")<0)return e;return e.replace(h,function(e,t,r){if(t)return t;return g(e,r)})}var b=/[&<>"]/;var k=/[&<>"]/g;var y={"&":"&","<":"<",">":">",'"':"""};function x(e){return y[e]}function w(e){if(b.test(e))return e.replace(k,x);return e}var C=/[.?*+^$[\]\\(){}|-]/g;function A(e){return e.replace(C,"\\$&")}function D(e){switch(e){case 9:case 32:return true}return false}function E(e){if(e>=8192&&e<=8202)return true;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return true}return false}var S=r(5);function q(e){return S.test(e)}function T(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return true;default:return false}}function L(e){return e.trim().replace(/\s+/g," ").toUpperCase()}t.lib={};t.lib.mdurl=r(12);t.lib.ucmicro=r(36);t.assign=a;t.isString=i;t.has=o;t.unescapeMd=v;t.unescapeAll=_;t.isValidEntityCode=u;t.fromCodePoint=c;t.escapeHtml=w;t.arrayReplaceAt=l;t.isSpace=D;t.isWhiteSpace=E;t.isMdAsciiPunct=T;t.isPunctChar=q;t.escapeRE=A;t.normalizeReference=L},function(e,t,r){(function(t,r){(function(){"use strict";function n(e,t,r,n,i,s){return{tag:e,key:t,attrs:r,children:n,text:i,dom:s,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:false}}n.normalize=function(e){if(Array.isArray(e))return n("[",void 0,void 0,n.normalizeChildren(e),void 0,void 0);if(null!=e&&"object"!==typeof e)return n("#",void 0,void 0,false===e?"":e,void 0,void 0);return e};n.normalizeChildren=function e(t){for(var r=0;r0)o.className=n.join(" ");return s[e]={tag:r,attrs:o}}function u(e,t,r){var i=false,s,l;var u=t.className||t.class;if(!a(e.attrs)&&!a(t)){var c={};for(var f in t)if(o.call(t,f))c[f]=t[f];t=c}for(var f in e.attrs)if(o.call(e.attrs,f))t[f]=e.attrs[f];if(void 0!==u){if(void 0!==t.class){t.class=void 0;t.className=u}if(null!=e.attrs.className)t.className=e.attrs.className+" "+u}for(var f in t)if(o.call(t,f)&&"key"!==f){i=true;break}if(Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag)l=r[0].children;else s=r;return n(e.tag,t.key,i?t:void 0,s,l)}function c(e){var t=arguments[1],r=2,i;if(null==e||"string"!==typeof e&&"function"!==typeof e&&"function"!==typeof e.view)throw Error("The selector must be either a string or a component.");if("string"===typeof e)var o=s[e]||l(e);if(null==t)t={};else if("object"!==typeof t||null!=t.tag||Array.isArray(t)){t={};r=1}if(arguments.length===r+1){i=arguments[r];if(!Array.isArray(i))i=[i]}else{i=[];while(r0)return;e(r)}}var n=r(o);try{e(r(s),n)}catch(e){n(e)}}c(e)};p.prototype.then=function(e,t){var r=this,n=r._instance;function i(e,t,r,i){t.push(function(t){if("function"!==typeof e)r(t);else try{s(e(t))}catch(e){if(o)o(e)}});if("function"===typeof n.retry&&i===n.state)n.retry()}var s,o;var a=new p(function(e,t){s=e,o=t});i(e,n.resolvers,s,true),i(t,n.rejectors,o,false);return a};p.prototype.catch=function(e){return this.then(null,e)};p.resolve=function(e){if(e instanceof p)return e;return new p(function(t){t(e)})};p.reject=function(e){return new p(function(t,r){r(e)})};p.all=function(e){return new p(function(t,r){var n=e.length,i=0,s=[];if(0===e.length)t([]);else for(var o=0;o=200&&s.status<300||304===s.status||d.test(r.url))t(m(r.type,e));else{var i=new Error(s.responseText);for(var a in e)i[a]=e[a];n(i)}}catch(e){n(e)}};if(i&&null!=r.data)s.send(r.data);else s.send()});return true===r.background?a:i(a)}function l(n,i){var a=s();n=o(n,i);var l=new t(function(t,i){var s=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+r++;var o=e.document.createElement("script");e[s]=function(r){o.parentNode.removeChild(o);t(m(n.type,r));delete e[s]};o.onerror=function(){o.parentNode.removeChild(o);i(new Error("JSONP request failed"));delete e[s]};if(null==n.data)n.data={};n.url=u(n.url,n.data);n.data[n.callbackKey||"callback"]=s;o.src=c(n.url,n.data);e.document.documentElement.appendChild(o)});return true===n.background?l:a(l)}function u(e,t){if(null==t)return e;var r=e.match(/:[^\/]+/gi)||[];for(var n=0;n=p&&m>=h){var _=t[p],b=r[h];if(_===b&&!n)p++,h++;else if(null==_)p++;else if(null==b)h++;else if(_.key===b.key){var k=null!=f&&p>=t.length-f.length||null==f&&n;p++,h++;v(e,_,b,i,D(t,p,s),k,o);if(n&&_.tag===b.tag)E(e,A(_),s)}else{var _=t[d];if(_===b&&!n)d--,h++;else if(null==_)d--;else if(null==b)h++;else if(_.key===b.key){var k=null!=f&&d>=t.length-f.length||null==f&&n;v(e,_,b,i,D(t,d+1,s),k,o);if(n||h=p&&m>=h){var _=t[d],b=r[m];if(_===b&&!n)d--,m--;else if(null==_)d--;else if(null==b)m--;else if(_.key===b.key){var k=null!=f&&d>=t.length-f.length||null==f&&n;v(e,_,b,i,D(t,d+1,s),k,o);if(n&&_.tag===b.tag)E(e,A(_),s);if(null!=_.dom)s=_.dom;d--,m--}else{if(!g)g=C(t,d);if(null!=b){var y=g[b.key];if(null!=y){var x=t[y];var k=null!=f&&y>=t.length-f.length||null==f&&n;v(e,x,b,i,D(t,d+1,s),n,o);E(e,A(x),s);t[y].skip=true;if(null!=x.dom)s=x.dom}else{var S=u(e,b,i,o,s);s=S}}m--}if(m0){var i=e.dom;while(--r)n.appendChild(i.nextSibling);n.insertBefore(i,n.firstChild)}return n}else return e.dom}function D(e,t,r){for(;t1){var s=e.dom;while(--i)L(s.nextSibling)}L(e.dom);if(null!=t&&null==e.domSize&&!B(e.attrs)&&"string"===typeof e.tag)if(!t.pool)t.pool=[e];else t.pool.push(e)}}}}function L(e){var t=e.parentNode;if(null!=t)t.removeChild(e)}function z(e){if(e.attrs&&"function"===typeof e.attrs.onremove)e.attrs.onremove.call(e.state,e);if("string"!==typeof e.tag){if("function"===typeof e._state.onremove)e._state.onremove.call(e.state,e);if(null!=e.instance)z(e.instance)}else{var t=e.children;if(Array.isArray(t))for(var r=0;r-1&&"xlink"===r.substr(0,a))o.setAttributeNS("http://www.w3.org/1999/xlink",r.slice(a+1),i);else if("o"===r[0]&&"n"===r[1]&&"function"===typeof i)U(e,r,i);else if("style"===r)j(o,n,i);else if(r in o&&!O(r)&&void 0===s&&!P(e)){if("value"===r){var l=""+i;if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===l&&e.dom===t.activeElement)return;if("select"===e.tag)if(null===i){if(-1===e.dom.selectedIndex&&e.dom===t.activeElement)return}else if(null!==n&&e.dom.value===l&&e.dom===t.activeElement)return;if("option"===e.tag&&null!=n&&e.dom.value===l)return}if("input"===e.tag&&"type"===r){o.setAttribute(r,i);return}o[r]=i}else if("boolean"===typeof i)if(i)o.setAttribute(r,"");else o.removeAttribute(r);else o.setAttribute("className"===r?"class":r,i)}function M(e){var t=e.attrs;if("select"===e.tag&&null!=t){if("value"in t)I(e,"value",null,t.value,void 0);if("selectedIndex"in t)I(e,"selectedIndex",null,t.selectedIndex,void 0)}}function R(e,t,r,n){if(null!=r)for(var i in r)I(e,i,t&&t[i],r[i],n);if(null!=t)for(var i in t)if(null==r||!(i in r)){if("className"===i)i="class";if("o"===i[0]&&"n"===i[1]&&!N(i))U(e,i,void 0);else if("key"!==i)e.dom.removeAttribute(i)}}function $(e,r){return"value"===r||"checked"===r||"selectedIndex"===r||"selected"===r&&e.dom===t.activeElement}function N(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function O(e){return"href"===e||"list"===e||"form"===e||"width"===e||"height"===e}function P(e){return e.attrs.is||e.tag.indexOf("-")>-1}function B(e){return null!=e&&(e.oncreate||e.onupdate||e.onbeforeremove||e.onremove)}function j(e,t,r){if(t===r)e.style.cssText="",t=null;if(null==r)e.style.cssText="";else if("string"===typeof r)e.style.cssText=r;else{if("string"===typeof t)e.style.cssText="";for(var n in r)e.style[n]=r[n];if(null!=t&&"string"!==typeof t)for(var n in t)if(!(n in r))e.style[n]=""}}function U(e,t,r){var n=e.dom;var i="function"!==typeof s?r:function(e){var t=r.call(n,e);s.call(n,e);return t};if(t in n)n[t]="function"===typeof r?i:null;else{var o=t.slice(2);if(void 0===e.events)e.events={};if(e.events[t]===i)return;if(null!=e.events[t])n.removeEventListener(o,e.events[t],false);if("function"===typeof r){e.events[t]=i;n.addEventListener(o,e.events[t],false)}}}function V(e,t,r){if("function"===typeof e.oninit)e.oninit.call(t.state,t);if("function"===typeof e.oncreate)r.push(e.oncreate.bind(t.state,t))}function H(e,t,r){if("function"===typeof e.onupdate)r.push(e.onupdate.bind(t.state,t))}function Z(e,t){var r,n;if(null!=e.attrs&&"function"===typeof e.attrs.onbeforeupdate)r=e.attrs.onbeforeupdate.call(e.state,e,t);if("string"!==typeof e.tag&&"function"===typeof e._state.onbeforeupdate)n=e._state.onbeforeupdate.call(e.state,e,t);if(!(void 0===r&&void 0===n)&&!r&&!n){e.dom=t.dom;e.domSize=t.domSize;e.instance=t.instance;return true}return false}function G(e,r){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var i=[];var s=t.activeElement;var o=e.namespaceURI;if(null==e.vnodes)e.textContent="";if(!Array.isArray(r))r=[r];g(e,e.vnodes,n.normalizeChildren(r),false,i,null,"http://www.w3.org/1999/xhtml"===o?void 0:o);e.vnodes=r;if(null!=s&&t.activeElement!==s)s.focus();for(var a=0;a=t){r=s;e()}else if(null===n)n=i(function(){n=null;e();r=Date.now()},t-(s-r))}}var b=function(e){var t=v(e);t.setEventCallback(function(e){if(false===e.redraw)e.redraw=void 0;else s()});var r=[];function n(e,t){i(e);r.push(e,_(t))}function i(e){var t=r.indexOf(e);if(t>-1)r.splice(t,2)}function s(){for(var e=1;e-1)l.pop();for(var c=0;c-1?n:i>-1?i:e.length;if(n>-1){var o=i>-1?i:e.length;var a=w(e.slice(n+1,o));for(var l in a)t[l]=a[l]}if(i>-1){var u=w(e.slice(i+1));for(var l in u)r[l]=u[l]}return e.slice(0,s)}var l={prefix:"#!"};l.getPath=function(){var e=l.prefix.charAt(0);switch(e){case"#":return i("hash").slice(l.prefix.length);case"?":return i("search").slice(l.prefix.length)+i("hash");default:return i("pathname").slice(l.prefix.length)+i("search")+i("hash")}};l.setPath=function(t,n,i){var s={},o={};t=a(t,s,o);if(null!=n){for(var u in n)s[u]=n[u];t=t.replace(/:([^\/]+)/g,function(e,t){delete s[t];return n[t]})}var c=h(s);if(c)t+="?"+c;var f=h(o);if(f)t+="#"+f;if(r){var p=i?i.state:null;var d=i?i.title:null;e.onpopstate();if(i&&i.replace)e.history.replaceState(p,d,l.prefix+t);else e.history.pushState(p,d,l.prefix+t)}else e.location.href=l.prefix+t};l.defineRoutes=function(t,n,i){function s(){var r=l.getPath();var s={};var o=a(r,s,s);var u=e.history.state;if(null!=u)for(var c in u)s[c]=u[c];for(var f in t){var p=new RegExp("^"+f.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(p.test(o)){o.replace(p,function(){var e=f.match(/:[^\/]+/g)||[];var i=[].slice.call(arguments,1,-2);for(var o=0;o=0;e--)if(0==e)t+=` ${this.id_strct[e]["dim"]} ${m_clean[e]}`;else{n=e!==m_clean.length-1?"dim":"full";if(isNaN(m_clean[e]))t+=` ${this.id_strct[e][m_clean[e]][n]}`;else if(1==e)t+=` ${this.id_strct[e]["prop"][n]} ${m_clean[e]}`;else t+=` ${m_clean[e]}`}}return t},setupType(e){var t=e.match(this.rx_id);if(t)switch(true){case/^\d{2}$/.test(t[2]):switch(true){case/^cd$/.test(t[3]):return"corollaire-demo";case/^sc$/.test(t[3]):return"scolie";case/^d$/.test(t[3]):return"demonstration";case/^c$/.test(t[3]):switch(true){case/^sc$/.test(t[4]):return"scolie";case/^d$/.test(t[4]):return"demonstration";case/^sc$/.test(t[5]):return"scolie";case/^\d$/.test(t[4]):return"corollaire";case!t[4]:return"corollaire"}case/^a$/.test(t[3]):return"prop-axiom";case/^l$/.test(t[3]):switch(true){case/^d$/.test(t[5]):return"lemme-demonstration";case/^sc$/.test(t[5]):return"lemme-scolie";case/^c$/.test(t[5]):return"lemme-corrollaire";case!t[5]:return"lemme"}case/^p$/.test(t[3]):return"postulat";case/^\d$/.test(t[3]):return"??";case/^\d{2}$/.test(t[3]):return"??";case!t[3]:return"proposition"}case/^app|ap$/.test(t[2]):return"appendice";case/^agd$/.test(t[2]):return"def-gen-affect";case/^pr$/.test(t[2]):return"preface";case/^ad$/.test(t[2]):switch(true){case/^e$/.test(t[4]):return"explication";case!t[4]:return"def-affect"}case/^c$/.test(t[2]):return"chapitre";case/^p$/.test(t[2]):return"postulat";case/^d$/.test(t[2]):switch(true){case/^e$/.test(t[4]):return"explication";case!t[4]:return"definition"}case/^a$/.test(t[2]):return"axiom"}},parseStrct(e){var t,r,n,i,s,o;for(t in this.data_byid[this.langs[0].lc]){r=this.data_byid[this.langs[0].lc][t];if("title"==r.type)continue;n={to:[],from:[]};i=r.text.match(/\[[^\]]+\]\([^\)]+\)/g);if(i)for(s of i){o=s.match(/\((.+)\)/)[1];if(-1==n.to.indexOf(o))n.to.push(o);if("undefined"!==typeof this.data_strct[o])if(-1==this.data_strct[o].from.indexOf(o))this.data_strct[o].from.push(t)}this.data_strct[t]=n}e()}}},function(e,t,r){"use strict";e.exports=r(30)},function(e,t){e.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\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\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\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-\u2E49\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]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(e,t,r){"use strict";function n(){this.__rules__=[];this.__cache__=null}n.prototype.__find__=function(e){for(var t=0;t=0)n=this.attrs[r][1];return n};n.prototype.attrJoin=function e(t,r){var n=this.attrIndex(t);if(n<0)this.attrPush([t,r]);else this.attrs[n][1]=this.attrs[n][1]+" "+r};e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n){var i=Number(e[t].meta.id+1).toString();var s="";if("string"===typeof n.docId)s="-"+n.docId+"-";return s+i}function i(e,t){var r=Number(e[t].meta.id+1).toString();if(e[t].meta.subId>0)r+=":"+e[t].meta.subId;return"["+r+"]"}function s(e,t,r,n,i){var s=i.rules.footnote_anchor_name(e,t,r,n,i);var o=i.rules.footnote_caption(e,t,r,n,i);var a=s;if(e[t].meta.subId>0)a+=":"+e[t].meta.subId;return''+o+""}function o(e,t,r){return(r.xhtmlOut?'
\n':'
\n')+'
\n'+'
    \n'}function a(){return"
\n
\n"}function l(e,t,r,n,i){var s=i.rules.footnote_anchor_name(e,t,r,n,i);if(e[t].meta.subId>0)s+=":"+e[t].meta.subId;return'
  • '}function u(){return"
  • \n"}function c(e,t,r,n,i){var s=i.rules.footnote_anchor_name(e,t,r,n,i);if(e[t].meta.subId>0)s+=":"+e[t].meta.subId;return' ↩︎'}e.exports=function e(t){var r=t.helpers.parseLinkLabel,f=t.utils.isSpace;t.renderer.rules.footnote_ref=s;t.renderer.rules.footnote_block_open=o;t.renderer.rules.footnote_block_close=a;t.renderer.rules.footnote_open=l;t.renderer.rules.footnote_close=u;t.renderer.rules.footnote_anchor=c;t.renderer.rules.footnote_caption=i;t.renderer.rules.footnote_anchor_name=n;function p(e,t,r,n){var i,s,o,a,l,u,c,p,h,d,m,g=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(g+4>v)return false;if(91!==e.src.charCodeAt(g))return false;if(94!==e.src.charCodeAt(g+1))return false;for(l=g+2;l=v||58!==e.src.charCodeAt(++l))return false;if(n)return true;l++;if(!e.env.footnotes)e.env.footnotes={};if(!e.env.footnotes.refs)e.env.footnotes.refs={};u=e.src.slice(g+2,l-2);e.env.footnotes.refs[":"+u]=-1;c=new e.Token("footnote_reference_open","",1);c.meta={label:u};c.level=e.level++;e.tokens.push(c);i=e.bMarks[t];s=e.tShift[t];o=e.sCount[t];a=e.parentType;m=l;p=h=e.sCount[t]+l-(e.bMarks[t]+e.tShift[t]);while(l=l)return false;if(94!==e.src.charCodeAt(u))return false;if(91!==e.src.charCodeAt(u+1))return false;n=u+2;i=r(e,u+1);if(i<0)return false;if(!t){if(!e.env.footnotes)e.env.footnotes={};if(!e.env.footnotes.list)e.env.footnotes.list=[];s=e.env.footnotes.list.length;e.md.inline.parse(e.src.slice(n,i),e.md,e.env,a=[]);o=e.push("footnote_ref","",0);o.meta={id:s};e.env.footnotes.list[s]={tokens:a}}e.pos=i+1;e.posMax=l;return true}function d(e,t){var r,n,i,s,o,a=e.posMax,l=e.pos;if(l+3>a)return false;if(!e.env.footnotes||!e.env.footnotes.refs)return false;if(91!==e.src.charCodeAt(l))return false;if(94!==e.src.charCodeAt(l+1))return false;for(n=l+2;n=a)return false;n++;r=e.src.slice(l+2,n-1);if("undefined"===typeof e.env.footnotes.refs[":"+r])return false;if(!t){if(!e.env.footnotes.list)e.env.footnotes.list=[];if(e.env.footnotes.refs[":"+r]<0){i=e.env.footnotes.list.length;e.env.footnotes.list[i]={label:r,count:0};e.env.footnotes.refs[":"+r]=i}else i=e.env.footnotes.refs[":"+r];s=e.env.footnotes.list[i].count;e.env.footnotes.list[i].count++;o=e.push("footnote_ref","",0);o.meta={id:i,subId:s,label:r}}e.pos=n;e.posMax=a;return true}function m(e){var t,r,n,i,s,o,a,l,u,c,f=false,p={};if(!e.env.footnotes)return;e.tokens=e.tokens.filter(function(e){if("footnote_reference_open"===e.type){f=true;u=[];c=e.meta.label;return false}if("footnote_reference_close"===e.type){f=false;p[":"+c]=u;return false}if(f)u.push(e);return!f});if(!e.env.footnotes.list)return;o=e.env.footnotes.list;a=new e.Token("footnote_block_open","",1);e.tokens.push(a);for(t=0,r=o.length;t0?o[t].count:1;for(n=0;n{return n("li",n("a",{lang:t.lc,href:`/${t.lc}${e[1]}`,oncreate:n.route.link,onupdate:n.route.link},t.label))}))])}}},function(e,t,r){"use strict";e.exports=r(31)},function(e,t,r){"use strict";e.exports.encode=r(32);e.exports.decode=r(33);e.exports.format=r(34);e.exports.parse=r(35)},function(e,t){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(e,t){e.exports=/[\0-\x1F\x7F-\x9F]/},function(e,t){e.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/},function(e,t,r){"use strict";var n="[a-zA-Z_:][a-zA-Z0-9:._-]*";var i="[^\"'=<>`\\x00-\\x20]+";var s="'[^']*'";var o='"[^"]*"';var a="(?:"+i+"|"+s+"|"+o+")";var l="(?:\\s+"+n+"(?:\\s*=\\s*"+a+")?)";var u="<[A-Za-z][A-Za-z0-9\\-]*"+l+"*\\s*\\/?>";var c="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";var f="\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e";var p="<[?].*?[?]>";var h="]*>";var d="";var m=new RegExp("^(?:"+u+"|"+c+"|"+f+"|"+p+"|"+h+"|"+d+")");var g=new RegExp("^(?:"+u+"|"+c+")");e.exports.HTML_TAG_RE=m;e.exports.HTML_OPEN_CLOSE_TAG_RE=g},function(e,t,r){"use strict";e.exports.tokenize=function e(t,r){var n,i,s,o,a,l=t.pos,u=t.src.charCodeAt(l);if(r)return false;if(126!==u)return false;i=t.scanDelims(t.pos,true);o=i.length;a=String.fromCharCode(u);if(o<2)return false;if(o%2){s=t.push("text","",0);s.content=a;o--}for(n=0;n=0;r--){n=l[r];if(95!==n.marker&&42!==n.marker)continue;if(-1===n.end)continue;i=l[n.end];a=r>0&&l[r-1].end===n.end+1&&l[r-1].token===n.token-1&&l[n.end+1].token===i.token+1&&l[r-1].marker===n.marker;o=String.fromCharCode(n.marker);s=t.tokens[n.token];s.type=a?"strong_open":"em_open";s.tag=a?"strong":"em";s.nesting=1;s.markup=a?o+o:o;s.content="";s=t.tokens[i.token];s.type=a?"strong_close":"em_close";s.tag=a?"strong":"em";s.nesting=-1;s.markup=a?o+o:o;s.content="";if(a){t.tokens[l[r-1].token].content="";t.tokens[l[n.end+1].token].content="";r--}}}},function(e,t,r){var n=r(1);e.exports={view(e){return n("footer",[n("p",n.trust('© 2017 Ethica Spinoza'))])}}},function(e,t){e.exports={init(){this.initStickyTitles()},initStickyTitles(){let e=document.getElementsByTagName("header")[0].clientHeight;var t=document.querySelector(".sticky-clone-wrapper");if(!t){var t=document.createElement("div");t.classList.add("sticky-clone-wrapper");document.body.append(t)}var r=new Array;Array.from(document.querySelectorAll("h1.part-title")).forEach(function(e){e._part=e.getAttribute("part");r.push(e)});var n,i=false,s,o,a=false,l;let u=function(s){n=false;for(let t=r.length-1;t>=0;t--)if(r[t].getBoundingClientRect().top=0)e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)};r(28);t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate;t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(t,r(2))},function(e,t,r){(function(e,t){(function(e,r){"use strict";if(e.setImmediate)return;var n=1;var i={};var s=false;var o=e.document;var a;function l(e){if("function"!==typeof e)e=new Function(""+e);var t=new Array(arguments.length-1);for(var r=0;r1)for(var r=1;r=0)try{t.hostname=f.toASCII(t.hostname)}catch(e){}return c.encode(c.format(t))}function _(e){var t=c.parse(e,true);if(t.hostname)if(!t.protocol||g.indexOf(t.protocol)>=0)try{t.hostname=f.toUnicode(t.hostname)}catch(e){}return c.decode(c.format(t))}function b(e,t){if(!(this instanceof b))return new b(e,t);if(!t)if(!n.isString(e)){t=e||{};e="default"}this.inline=new l;this.block=new a;this.core=new o;this.renderer=new s;this.linkify=new u;this.validateLink=m;this.normalizeLink=v;this.normalizeLinkText=_;this.utils=n;this.helpers=n.assign({},i);this.options={};this.configure(e);if(t)this.set(t)}b.prototype.set=function(e){n.assign(this.options,e);return this};b.prototype.configure=function(e){var t=this,r;if(n.isString(e)){r=e;e=p[r];if(!e)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");if(e.options)t.set(e.options);if(e.components)Object.keys(e.components).forEach(function(r){if(e.components[r].rules)t[r].ruler.enableOnly(e.components[r].rules);if(e.components[r].rules2)t[r].ruler2.enableOnly(e.components[r].rules2)});return this};b.prototype.enable=function(e,t){var r=[];if(!Array.isArray(e))e=[e];["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.enable(e,true))},this);r=r.concat(this.inline.ruler2.enable(e,true));var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};b.prototype.disable=function(e,t){var r=[];if(!Array.isArray(e))e=[e];["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.disable(e,true))},this);r=r.concat(this.inline.ruler2.disable(e,true));var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};b.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));e.apply(e,t);return this};b.prototype.parse=function(e,t){if("string"!==typeof e)throw new Error("Input data should be a String");var r=new this.core.State(e,this,t);this.core.process(r);return r.tokens};b.prototype.render=function(e,t){t=t||{};return this.renderer.render(this.parse(e,t),this.options,t)};b.prototype.parseInline=function(e,t){var r=new this.core.State(e,this,t);r.inlineMode=true;this.core.process(r);return r.tokens};b.prototype.renderInline=function(e,t){t=t||{};return this.renderer.render(this.parseInline(e,t),this.options,t)};e.exports=b},function(e,t){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,r){"use strict";var n={};function i(e){var t,r,i=n[e];if(i)return i;i=n[e]=[];for(t=0;t<128;t++){r=String.fromCharCode(t);if(/^[0-9a-z]$/i.test(r))i.push(r);else i.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(t=0;t=55296&&a<=57343){if(a>=55296&&a<=56319&&n+1=56320&&l<=57343){c+=encodeURIComponent(e[n]+e[n+1]);n++;continue}}c+="%EF%BF%BD";continue}c+=encodeURIComponent(e[n])}return c}s.defaultChars=";/?:@&=+$,-_.!~*'()#";s.componentChars="-_.!~*'()";e.exports=s},function(e,t,r){"use strict";var n={};function i(e){var t,r,i=n[e];if(i)return i;i=n[e]=[];for(t=0;t<128;t++){r=String.fromCharCode(t);i.push(r)}for(t=0;t=55296&&l<=57343)u+="���";else u+=String.fromCharCode(l);t+=6;continue}}if(240===(248&i)&&t+91114111)u+="����";else{l-=65536;u+=String.fromCharCode(55296+(l>>10),56320+(1023&l))}t+=9;continue}}u+="�"}return u})}s.defaultChars=";/?:@&=+$,#";s.componentChars="";e.exports=s},function(e,t,r){"use strict";e.exports=function e(t){var r="";r+=t.protocol||"";r+=t.slashes?"//":"";r+=t.auth?t.auth+"@":"";if(t.hostname&&-1!==t.hostname.indexOf(":"))r+="["+t.hostname+"]";else r+=t.hostname||"";r+=t.port?":"+t.port:"";r+=t.pathname||"";r+=t.search||"";r+=t.hash||"";return r}},function(e,t,r){"use strict";function n(){this.protocol=null;this.slashes=null;this.auth=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.pathname=null}var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(a),u=["'"].concat(l),c=["%","/","?",";","#"].concat(u),f=["/","?","#"],p=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true};function v(e,t){if(e&&e instanceof n)return e;var r=new n;r.parse(e,t);return r}n.prototype.parse=function(e,t){var r,n,s,a,l,u=e;u=u.trim();if(!t&&1===e.split("#").length){var v=o.exec(u);if(v){this.pathname=v[1];if(v[2])this.search=v[2];return this}}var _=i.exec(u);if(_){_=_[0];s=_.toLowerCase();this.protocol=_;u=u.substr(_.length)}if(t||_||u.match(/^\/\/[^@\/]+@[^@\/]+/)){l="//"===u.substr(0,2);if(l&&!(_&&m[_])){u=u.substr(2);this.slashes=true}}if(!m[_]&&(l||_&&!g[_])){var b=-1;for(r=0;r127)D+="x";else D+=A[E];if(!D.match(h)){var q=C.slice(0,r);var T=C.slice(r+1);var L=A.match(d);if(L){q.push(L[1]);T.unshift(L[2])}if(T.length)u=T.join(".")+u;this.hostname=q.join(".");break}}}}if(this.hostname.length>p)this.hostname="";if(w)this.hostname=this.hostname.substr(1,this.hostname.length-2)}var z=u.indexOf("#");if(-1!==z){this.hash=u.substr(z);u=u.slice(0,z)}var F=u.indexOf("?");if(-1!==F){this.search=u.substr(F);u=u.slice(0,F)}if(u)this.pathname=u;if(g[s]&&this.hostname&&!this.pathname)this.pathname="";return this};n.prototype.parseHost=function(e){var t=s.exec(e);if(t){t=t[0];if(":"!==t)this.port=t.substr(1);e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};e.exports=v},function(e,t,r){"use strict";t.Any=r(13);t.Cc=r(14);t.Cf=r(37);t.P=r(5);t.Z=r(15)},function(e,t){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(e,t,r){"use strict";t.parseLinkLabel=r(39);t.parseLinkDestination=r(40);t.parseLinkTitle=r(41)},function(e,t,r){"use strict";e.exports=function e(t,r,n){var i,s,o,a,l=-1,u=t.posMax,c=t.pos;t.pos=r+1;i=1;while(t.pos=i)return u;o=t.charCodeAt(r);if(34!==o&&39!==o&&40!==o)return u;r++;if(40===o)o=41;while(r"+s(e[t].content)+""};o.code_block=function(e,t,r,n,i){var o=e[t];return""+s(e[t].content)+"\n"};o.fence=function(e,t,r,n,o){var a=e[t],l=a.info?i(a.info).trim():"",u="",c,f,p,h;if(l)u=l.split(/\s+/g)[0];if(r.highlight)c=r.highlight(a.content,u)||s(a.content);else c=s(a.content);if(0===c.indexOf(""+c+"\n"}return"
    "+c+"
    \n"};o.image=function(e,t,r,n,i){var s=e[t];s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,r,n);return i.renderToken(e,t,r)};o.hardbreak=function(e,t,r){return r.xhtmlOut?"
    \n":"
    \n"};o.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"
    \n":"
    \n":"\n"};o.text=function(e,t){return s(e[t].content)};o.html_block=function(e,t){return e[t].content};o.html_inline=function(e,t){return e[t].content};function a(){this.rules=n({},o)}a.prototype.renderAttrs=function e(t){var r,n,i;if(!t.attrs)return"";i="";for(r=0,n=t.attrs.length;r\n":">";return s};a.prototype.renderInline=function(e,t,r){var n,i="",s=this.rules;for(var o=0,a=e.length;o\s]/i.test(e)}function s(e){return/^<\/a\s*>/i.test(e)}e.exports=function e(t){var r,o,a,l,u,c,f,p,h,d,m,g,v,_,b,k,y=t.tokens,x;if(!t.md.options.linkify)return;for(o=0,a=y.length;o=0;r--){c=l[r];if("link_close"===c.type){r--;while(l[r].level!==c.level&&"link_open"!==l[r].type)r--;continue}if("html_inline"===c.type){if(i(c.content)&&v>0)v--;if(s(c.content))v++}if(v>0)continue;if("text"===c.type&&t.md.linkify.test(c.content)){h=c.content;x=t.md.linkify.match(h);f=[];g=c.level;m=0;for(p=0;pm){u=new t.Token("text","",0);u.content=h.slice(m,d);u.level=g;f.push(u)}u=new t.Token("link_open","a",1);u.attrs=[["href",b]];u.level=g++;u.markup="linkify";u.info="auto";f.push(u);u=new t.Token("text","",0);u.content=k;u.level=g;f.push(u);u=new t.Token("link_close","a",-1);u.level=--g;u.markup="linkify";u.info="auto";f.push(u);m=x[p].lastIndex}if(m=0;t--){r=e[t];if("text"===r.type&&!n)r.content=r.content.replace(s,a);if("link_open"===r.type&&"auto"===r.info)n--;if("link_close"===r.type&&"auto"===r.info)n++}}function u(e){var t,r,i=0;for(t=e.length-1;t>=0;t--){r=e[t];if("text"===r.type&&!i)if(n.test(r.content))r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2");if("link_open"===r.type&&"auto"===r.info)i--;if("link_close"===r.type&&"auto"===r.info)i++}}e.exports=function e(t){var r;if(!t.md.options.typographer)return;for(r=t.tokens.length-1;r>=0;r--){if("inline"!==t.tokens[r].type)continue;if(i.test(t.tokens[r].content))l(t.tokens[r].children);if(n.test(t.tokens[r].content))u(t.tokens[r].children)}}},function(e,t,r){"use strict";var n=r(0).isWhiteSpace;var i=r(0).isPunctChar;var s=r(0).isMdAsciiPunct;var o=/['"]/;var a=/['"]/g;var l="’";function u(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}function c(e,t){var r,o,c,f,p,h,d,m,g,v,_,b,k,y,x,w,C,A,D,E,S;D=[];for(r=0;r=0;C--)if(D[C].level<=d)break;D.length=C+1;if("text"!==o.type)continue;c=o.content;p=0;h=c.length;e:while(p=0)g=c.charCodeAt(f.index-1);else for(C=r-1;C>=0;C--){if("text"!==e[C].type)continue;g=e[C].content.charCodeAt(e[C].content.length-1);break}v=32;if(p=48&&g<=57)w=x=false;if(x&&w){x=false;w=b}if(!x&&!w){if(A)o.content=u(o.content,f.index,l);continue}if(w)for(C=D.length-1;C>=0;C--){m=D[C];if(D[C].level=0;r--){if("inline"!==t.tokens[r].type||!o.test(t.tokens[r].content))continue;c(t.tokens[r].children,t)}}},function(e,t,r){"use strict";var n=r(7);function i(e,t,r){this.src=e;this.env=r;this.tokens=[];this.inlineMode=false;this.md=t}i.prototype.Token=n;e.exports=i},function(e,t,r){"use strict";var n=r(6);var i=[["table",r(52),["paragraph","reference"]],["code",r(53)],["fence",r(54),["paragraph","reference","blockquote","list"]],["blockquote",r(55),["paragraph","reference","blockquote","list"]],["hr",r(56),["paragraph","reference","blockquote","list"]],["list",r(57),["paragraph","reference","blockquote"]],["reference",r(58)],["heading",r(59),["paragraph","reference","blockquote"]],["lheading",r(60)],["html_block",r(61),["paragraph","reference","blockquote"]],["paragraph",r(63)]];function s(){this.ruler=new n;for(var e=0;e=r)break;if(e.sCount[a]=u){e.line=r;break}for(i=0;io)return false;p=r+1;if(t.sCount[p]=4)return false;c=t.bMarks[p]+t.tShift[p];if(c>=t.eMarks[p])return false;l=t.src.charCodeAt(c++);if(124!==l&&45!==l&&58!==l)return false;while(c=4)return false;h=s(u.replace(/^\||\|$/g,""));d=h.length;if(d>g.length)return false;if(a)return true;m=t.push("table_open","table",1);m.map=_=[r,0];m=t.push("thead_open","thead",1);m.map=[r,r+1];m=t.push("tr_open","tr",1);m.map=[r,r+1];for(f=0;f=4)break;h=s(u.replace(/^\||\|$/g,""));m=t.push("tr_open","tr",1);for(f=0;f=4){i++;s=i;continue}break}t.line=s;o=t.push("code_block","code",0);o.content=t.getLines(r,s,4+t.blkIndent,true);o.map=[r,t.line];return true}},function(e,t,r){"use strict";e.exports=function e(t,r,n,i){var s,o,a,l,u,c,f,p=false,h=t.bMarks[r]+t.tShift[r],d=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4)return false;if(h+3>d)return false;s=t.src.charCodeAt(h);if(126!==s&&96!==s)return false;u=h;h=t.skipChars(h,s);o=h-u;if(o<3)return false;f=t.src.slice(u,h);a=t.src.slice(h,d);if(a.indexOf(String.fromCharCode(s))>=0)return false;if(i)return true;l=r;for(;;){l++;if(l>=n)break;h=u=t.bMarks[l]+t.tShift[l];d=t.eMarks[l];if(h=4)continue;h=t.skipChars(h,s);if(h-u=4)return false;if(62!==t.src.charCodeAt(E++))return false;if(s)return true;u=d=t.sCount[r]+E-(t.bMarks[r]+t.tShift[r]);if(32===t.src.charCodeAt(E)){E++;u++;d++;o=false;y=true}else if(9===t.src.charCodeAt(E)){y=true;if((t.bsCount[r]+d)%4===3){E++;u++;d++;o=false}else o=true}else y=false;m=[t.bMarks[r]];t.bMarks[r]=E;while(E=S;b=[t.sCount[r]];t.sCount[r]=d-u;k=[t.tShift[r]];t.tShift[r]=E-t.bMarks[r];w=t.md.block.ruler.getRules("blockquote");_=t.parentType;t.parentType="blockquote";A=false;for(h=r+1;h=S)break;if(62===t.src.charCodeAt(E++)&&!A){u=d=t.sCount[h]+E-(t.bMarks[h]+t.tShift[h]);if(32===t.src.charCodeAt(E)){E++;u++;d++;o=false;y=true}else if(9===t.src.charCodeAt(E)){y=true;if((t.bsCount[h]+d)%4===3){E++;u++;d++;o=false}else o=true}else y=false;m.push(t.bMarks[h]);t.bMarks[h]=E;while(E=S;g.push(t.bsCount[h]);t.bsCount[h]=t.sCount[h]+1+(y?1:0);b.push(t.sCount[h]);t.sCount[h]=d-u;k.push(t.tShift[h]);t.tShift[h]=E-t.bMarks[h];continue}if(f)break;x=false;for(l=0,c=w.length;l";C.map=p=[r,0];t.md.block.tokenize(t,r,h);C=t.push("blockquote_close","blockquote",-1);C.markup=">";t.lineMax=D;t.parentType=_;p[1]=t.line;for(l=0;l=4)return false;o=t.src.charCodeAt(c++);if(42!==o&&45!==o&&95!==o)return false;a=1;while(c=o)return-1;r=e.src.charCodeAt(s++);if(r<48||r>57)return-1;for(;;){if(s>=o)return-1;r=e.src.charCodeAt(s++);if(r>=48&&r<=57){if(s-i>=10)return-1;continue}if(41===r||46===r)break;return-1}if(s=4)return false;if(a&&"paragraph"===t.parentType)if(t.tShift[r]>=t.blkIndent)R=true;if((T=s(t,r))>=0){d=true;z=t.bMarks[r]+t.tShift[r];k=Number(t.src.substr(z,T-z-1));if(R&&1!==k)return false}else if((T=i(t,r))>=0)d=false;else return false;if(R)if(t.skipSpaces(T)>=t.eMarks[r])return false;b=t.src.charCodeAt(T-1);if(a)return true;_=t.tokens.length;if(d){M=t.push("ordered_list_open","ol",1);if(1!==k)M.attrs=[["start",k]]}else M=t.push("bullet_list_open","ul",1);M.map=v=[r,0];M.markup=String.fromCharCode(b);x=r;L=false;I=t.md.block.ruler.getRules("list");D=t.parentType;t.parentType="list";while(x=y)p=1;else p=w-h;if(p>4)p=1;f=h+p;M=t.push("list_item_open","li",1);M.markup=String.fromCharCode(b);M.map=m=[r,0];C=t.blkIndent;S=t.tight;E=t.tShift[r];A=t.sCount[r];t.blkIndent=f;t.tight=true;t.tShift[r]=u-t.bMarks[r];t.sCount[r]=w;if(u>=y&&t.isEmpty(r+1))t.line=Math.min(t.line+2,n);else t.md.block.tokenize(t,r,n,true);if(!t.tight||L)$=false;L=t.line-r>1&&t.isEmpty(t.line-1);t.blkIndent=C;t.tShift[r]=E;t.sCount[r]=A;t.tight=S;M=t.push("list_item_close","li",-1);M.markup=String.fromCharCode(b);x=r=t.line;m[1]=x;u=t.bMarks[r];if(x>=n)break;if(t.sCount[x]=4)return false;if(91!==t.src.charCodeAt(C))return false;while(++C3)continue;if(t.sCount[D]<0)continue;k=false;for(p=0,h=y.length;p=4)return false;o=t.src.charCodeAt(c);if(35!==o||c>=f)return false;a=1;o=t.src.charCodeAt(++c);while(35===o&&c6||cc&&n(t.src.charCodeAt(l-1)))f=l;t.line=r+1;u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a);u.map=[r,t.line];u=t.push("inline","",0);u.content=t.src.slice(c,f).trim();u.map=[r,t.line];u.children=[];u=t.push("heading_close","h"+String(a),-1);u.markup="########".slice(0,a);return true}},function(e,t,r){"use strict";e.exports=function e(t,r,n){var i,s,o,a,l,u,c,f,p,h=r+1,d,m=t.md.block.ruler.getRules("paragraph");if(t.sCount[r]-t.blkIndent>=4)return false;d=t.parentType;t.parentType="paragraph";for(;h3)continue;if(t.sCount[h]>=t.blkIndent){u=t.bMarks[h]+t.tShift[h];c=t.eMarks[h];if(u=c){f=61===p?1:2;break}}}}if(t.sCount[h]<0)continue;s=false;for(o=0,a=m.length;o|$))/i,/<\/(script|pre|style)>/i,true],[/^/,true],[/^<\?/,/\?>/,true],[/^/,true],[/^/,true],[new RegExp("^|$))","i"),/^$/,true],[new RegExp(i.source+"\\s*$"),/^$/,false]];e.exports=function e(t,r,n,i){var o,a,l,u,c=t.bMarks[r]+t.tShift[r],f=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4)return false;if(!t.md.options.html)return false;if(60!==t.src.charCodeAt(c))return false;u=t.src.slice(c,f);for(o=0;o3)continue;if(t.sCount[u]<0)continue;i=false;for(s=0,o=c.length;s0)this.level++;this.tokens.push(i);return i};s.prototype.isEmpty=function e(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};s.prototype.skipEmptyLines=function e(t){for(var r=this.lineMax;tr)if(!i(this.src.charCodeAt(--t)))return t+1;return t};s.prototype.skipChars=function e(t,r){for(var n=this.src.length;tn)if(r!==this.src.charCodeAt(--t))return t+1;return t};s.prototype.getLines=function e(t,r,n,s){var o,a,l,u,c,f,p,h=t;if(t>=r)return"";f=new Array(r-t);for(o=0;hn)f[o]=new Array(a-n+1).join(" ")+this.src.slice(u,c);else f[o]=this.src.slice(u,c)}return f.join("")};s.prototype.Token=n;e.exports=s},function(e,t,r){"use strict";var n=r(6);var i=[["text",r(66)],["newline",r(67)],["escape",r(68)],["backticks",r(69)],["strikethrough",r(17).tokenize],["emphasis",r(18).tokenize],["link",r(70)],["image",r(71)],["autolink",r(72)],["html_inline",r(73)],["entity",r(74)]];var s=[["balance_pairs",r(75)],["strikethrough",r(17).postProcess],["emphasis",r(18).postProcess],["text_collapse",r(76)]];function o(){var e;this.ruler=new n;for(e=0;e=s)break;continue}e.pending+=e.src[e.pos++]}if(e.pending)e.pushPending()};o.prototype.parse=function(e,t,r,n){var i,s,o;var a=new this.State(e,t,r,n);this.tokenize(a);s=this.ruler2.getRules("");o=s.length;for(i=0;i=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){t.pending=t.pending.replace(/ +$/,"");t.push("hardbreak","br",0)}else{t.pending=t.pending.slice(0,-1);t.push("softbreak","br",0)}else t.push("softbreak","br",0);o++;while(o?@[]^_`{|}~-".split("").forEach(function(e){i[e.charCodeAt(0)]=1});e.exports=function e(t,r){var s,o=t.pos,a=t.posMax;if(92!==t.src.charCodeAt(o))return false;o++;if(o=v)return false;_=c;f=t.md.helpers.parseLinkDestination(t.src,c,t.posMax);if(f.ok){m=t.md.normalizeLink(f.str);if(t.md.validateLink(m))c=f.pos;else m=""}_=c;for(;c=v||41!==t.src.charCodeAt(c))b=true;c++}if(b){if("undefined"===typeof t.env.references)return false;if(c=0)a=t.src.slice(_,c++);else c=l+1}else c=l+1;if(!a)a=t.src.slice(u,l);p=t.env.references[n(a)];if(!p){t.pos=g;return false}m=p.href;h=p.title}if(!r){t.pos=u;t.posMax=l;d=t.push("link_open","a",1);d.attrs=s=[["href",m]];if(h)s.push(["title",h]);t.md.inline.tokenize(t);d=t.push("link_close","a",-1)}t.pos=c;t.posMax=v;return true}},function(e,t,r){"use strict";var n=r(0).normalizeReference;var i=r(0).isSpace;e.exports=function e(t,r){var s,o,a,l,u,c,f,p,h,d,m,g,v,_="",b=t.pos,k=t.posMax;if(33!==t.src.charCodeAt(t.pos))return false;if(91!==t.src.charCodeAt(t.pos+1))return false;c=t.pos+2;u=t.md.helpers.parseLinkLabel(t,t.pos+1,false);if(u<0)return false;f=u+1;if(f=k)return false;v=f;h=t.md.helpers.parseLinkDestination(t.src,f,t.posMax);if(h.ok){_=t.md.normalizeLink(h.str);if(t.md.validateLink(_))f=h.pos;else _=""}v=f;for(;f=k||41!==t.src.charCodeAt(f)){t.pos=b;return false}f++}else{if("undefined"===typeof t.env.references)return false;if(f=0)l=t.src.slice(v,f++);else f=u+1}else f=u+1;if(!l)l=t.src.slice(c,u);p=t.env.references[n(l)];if(!p){t.pos=b;return false}_=p.href;d=p.title}if(!r){a=t.src.slice(c,u);t.md.inline.parse(a,t.md,t.env,g=[]);m=t.push("image","img",0);m.attrs=s=[["src",_],["alt",""]];m.children=g;m.content=a;if(d)s.push(["title",d])}t.pos=f;t.posMax=k;return true}},function(e,t,r){"use strict";var n=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;var i=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;e.exports=function e(t,r){var s,o,a,l,u,c,f=t.pos;if(60!==t.src.charCodeAt(f))return false;s=t.src.slice(f);if(s.indexOf(">")<0)return false;if(i.test(s)){o=s.match(i);l=o[0].slice(1,-1);u=t.md.normalizeLink(l);if(!t.md.validateLink(u))return false;if(!r){c=t.push("link_open","a",1);c.attrs=[["href",u]];c.markup="autolink";c.info="auto";c=t.push("text","",0);c.content=t.md.normalizeLinkText(l);c=t.push("link_close","a",-1);c.markup="autolink";c.info="auto"}t.pos+=o[0].length;return true}if(n.test(s)){a=s.match(n);l=a[0].slice(1,-1);u=t.md.normalizeLink("mailto:"+l);if(!t.md.validateLink(u))return false;if(!r){c=t.push("link_open","a",1);c.attrs=[["href",u]];c.markup="autolink";c.info="auto";c=t.push("text","",0);c.content=t.md.normalizeLinkText(l);c=t.push("link_close","a",-1);c.markup="autolink";c.info="auto"}t.pos+=a[0].length;return true}return false}},function(e,t,r){"use strict";var n=r(16).HTML_TAG_RE;function i(e){var t=32|e;return t>=97&&t<=122}e.exports=function e(t,r){var s,o,a,l,u=t.pos;if(!t.md.options.html)return false;a=t.posMax;if(60!==t.src.charCodeAt(u)||u+2>=a)return false;s=t.src.charCodeAt(u+1);if(33!==s&&63!==s&&47!==s&&!i(s))return false;o=t.src.slice(u).match(n);if(!o)return false;if(!r){l=t.push("html_inline","",0);l.content=t.src.slice(u,u+o[0].length)}t.pos+=o[0].length;return true}},function(e,t,r){"use strict";var n=r(11);var i=r(0).has;var s=r(0).isValidEntityCode;var o=r(0).fromCodePoint;var a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;var l=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function e(t,r){var u,c,f,p=t.pos,h=t.posMax;if(38!==t.src.charCodeAt(p))return false;if(p+1=0){s=o[n];if(s.open&&s.marker===i.marker&&s.end<0&&s.level===i.level){var l=(s.close||i.open)&&"undefined"!==typeof s.length&&"undefined"!==typeof i.length&&(s.length+i.length)%3===0;if(!l){i.jump=r-n;i.open=false;s.end=r;s.jump=0;break}}n-=s.jump+1}}}},function(e,t,r){"use strict";e.exports=function e(t){var r,n,i=0,s=t.tokens,o=t.tokens.length;for(r=n=0;r0)this.level++;this.pendingLevel=this.level;this.tokens.push(i);return i};a.prototype.scanDelims=function(e,t){var r=e,n,a,l,u,c,f,p,h,d,m=true,g=true,v=this.posMax,_=this.src.charCodeAt(e);n=e>0?this.src.charCodeAt(e-1):32;while(r=3&&":"===e[t-3])return 0;if(t>=3&&"/"===e[t-3])return 0;return n.match(r.re.no_http)[0].length}return 0}},"mailto:":{validate:function(e,t,r){var n=e.slice(t);if(!r.re.mailto)r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i");if(r.re.mailto.test(n))return n.match(r.re.mailto)[0].length;return 0}}};var h="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";var d="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(e){e.__index__=-1;e.__text_cache__=""}function g(e){return function(t,r){var n=t.slice(r);if(e.test(n))return n.match(e)[0].length;return 0}}function v(){return function(e,t){t.normalize(e)}}function _(e){var t=e.re=r(79)(e.__opts__);var n=e.__tlds__.slice();e.onCompile();if(!e.__tlds_replaced__)n.push(h);n.push(t.src_xn);t.src_tlds=n.join("|");function i(e){return e.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i");t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i");t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i");t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");var c=[];e.__compiled__={};function f(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}Object.keys(e.__schemas__).forEach(function(t){var r=e.__schemas__[t];if(null===r)return;var n={validate:null,link:null};e.__compiled__[t]=n;if(o(r)){if(a(r.validate))n.validate=g(r.validate);else if(l(r.validate))n.validate=r.validate;else f(t,r);if(l(r.normalize))n.normalize=r.normalize;else if(!r.normalize)n.normalize=v();else f(t,r);return}if(s(r)){c.push(t);return}f(t,r)});c.forEach(function(t){if(!e.__compiled__[e.__schemas__[t]])return;e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate;e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize});e.__compiled__[""]={validate:null,normalize:v()};var p=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(u).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+p+")","i");e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+p+")","ig");e.re.pretest=RegExp("("+e.re.schema_test.source+")|"+"("+e.re.host_fuzzy_test.source+")|"+"@","i");m(e)}function b(e,t){var r=e.__index__,n=e.__last_index__,i=e.__text_cache__.slice(r,n);this.schema=e.__schema__.toLowerCase();this.index=r+t;this.lastIndex=n+t;this.raw=i;this.text=i;this.url=i}function k(e,t){var r=new b(e,t);e.__compiled__[r.schema].normalize(r,e);return r}function y(e,t){if(!(this instanceof y))return new y(e,t);if(!t)if(f(e)){t=e;e={}}this.__opts__=n({},c,t);this.__index__=-1;this.__last_index__=-1;this.__schema__="";this.__text_cache__="";this.__schemas__=n({},p,e);this.__compiled__={};this.__tlds__=d;this.__tlds_replaced__=false;this.re={};_(this)}y.prototype.add=function e(t,r){this.__schemas__[t]=r;_(this);return this};y.prototype.set=function e(t){this.__opts__=n(this.__opts__,t);return this};y.prototype.test=function e(t){this.__text_cache__=t;this.__index__=-1;if(!t.length)return false;var r,n,i,s,o,a,l,u,c;if(this.re.schema_test.test(t)){l=this.re.schema_search;l.lastIndex=0;while(null!==(r=l.exec(t))){s=this.testSchemaAt(t,r[2],l.lastIndex);if(s){this.__schema__=r[2];this.__index__=r.index+r[1].length;this.__last_index__=r.index+r[0].length+s;break}}}if(this.__opts__.fuzzyLink&&this.__compiled__["http:"]){u=t.search(this.re.host_fuzzy_test);if(u>=0)if(this.__index__<0||u=0)if(null!==(i=t.match(this.re.email_fuzzy))){o=i.index+i[1].length;a=i.index+i[0].length;if(this.__index__<0||othis.__last_index__){this.__schema__="mailto:";this.__index__=o;this.__last_index__=a}}}return this.__index__>=0};y.prototype.pretest=function e(t){return this.re.pretest.test(t)};y.prototype.testSchemaAt=function e(t,r,n){if(!this.__compiled__[r.toLowerCase()])return 0;return this.__compiled__[r.toLowerCase()].validate(t,n,this)};y.prototype.match=function e(t){var r=0,n=[];if(this.__index__>=0&&this.__text_cache__===t){n.push(k(this,r));r=this.__last_index__}var i=r?t.slice(r):t;while(this.test(i)){n.push(k(this,r));i=i.slice(this.__last_index__);r+=this.__last_index__}if(n.length)return n;return null};y.prototype.tlds=function e(t,r){t=Array.isArray(t)?t:[t];if(!r){this.__tlds__=t.slice();this.__tlds_replaced__=true;_(this);return this}this.__tlds__=this.__tlds__.concat(t).sort().filter(function(e,t,r){return e!==r[t-1]}).reverse();_(this);return this};y.prototype.normalize=function e(t){if(!t.schema)t.url="http://"+t.url;if("mailto:"===t.schema&&!/^mailto:/i.test(t.url))t.url="mailto:"+t.url};y.prototype.onCompile=function e(){};e.exports=y},function(e,t,r){"use strict";e.exports=function(e){var t={};t.src_Any=r(13).source;t.src_Cc=r(14).source;t.src_Z=r(15).source;t.src_P=r(5).source;t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|");t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var n="[><|]";t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")";t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?";t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))";t.src_path="(?:"+"[/?#]"+"(?:"+"(?!"+t.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-]).|"+"\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|"+"\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|"+"\\{(?:(?!"+t.src_ZCc+"|[}]).)*\\}|"+'\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|'+"\\'(?:(?!"+t.src_ZCc+"|[']).)+\\'|"+"\\'(?="+t.src_pseudo_letter+"|[-]).|"+"\\.{2,3}[a-zA-Z0-9%/]|"+"\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|"+"\\!(?!"+t.src_ZCc+"|[!]).|"+"\\?(?!"+t.src_ZCc+"|[?])."+")+"+"|\\/"+")?";t.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';t.src_xn="xn--[a-z0-9\\-]{1,59}";t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63}"+")";t.src_domain="(?:"+t.src_xn+"|"+"(?:"+t.src_pseudo_letter+")"+"|"+"(?:"+t.src_pseudo_letter+"(?:-(?!-)|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+")"+")";t.src_host="(?:"+"(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+")"+")";t.tpl_host_fuzzy="(?:"+t.src_ip4+"|"+"(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))"+")";t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))";t.src_host_strict=t.src_host+t.src_host_terminator;t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator;t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator;t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator;t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator;t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))";t.tpl_email_fuzzy="(^|"+n+"|\\(|"+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")";t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))"+"((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")";t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))"+"((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")";return t}},function(e,t,r){(function(e,n){var i;(function(s){var o="object"==typeof t&&t&&!t.nodeType&&t;var a="object"==typeof e&&e&&!e.nodeType&&e;var l="object"==typeof n&&n;if(l.global===l||l.window===l||l.self===l)s=l;var u,c=2147483647,f=36,p=1,h=26,d=38,m=700,g=72,v=128,_="-",b=/^xn--/,k=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=f-p,C=Math.floor,A=String.fromCharCode,D;function E(e){throw new RangeError(x[e])}function S(e,t){var r=e.length;var n=[];while(r--)n[r]=t(e[r]);return n}function q(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(y,".");var i=e.split(".");var s=S(i,t).join(".");return n+s}function T(e){var t=[],r=0,n=e.length,i,s;while(r=55296&&i<=56319&&r65535){e-=65536;t+=A(e>>>10&1023|55296);e=56320|1023&e}t+=A(e);return t}).join("")}function z(e){if(e-48<10)return e-22;if(e-65<26)return e-65;if(e-97<26)return e-97;return f}function F(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function I(e,t,r){var n=0;e=r?C(e/m):e>>1;e+=C(e/t);for(;e>w*h>>1;n+=f)e=C(e/w);return C(n+(w+1)*e/(e+d))}function M(e){var t=[],r=e.length,n,i=0,s=v,o=g,a,l,u,d,m,b,k,y,x;a=e.lastIndexOf(_);if(a<0)a=0;for(l=0;l=128)E("not-basic");t.push(e.charCodeAt(l))}for(u=a>0?a+1:0;u=r)E("invalid-input");k=z(e.charCodeAt(u++));if(k>=f||k>C((c-i)/m))E("overflow");i+=k*m;y=b<=o?p:b>=o+h?h:b-o;if(kC(c/x))E("overflow");m*=x}n=t.length+1;o=I(i-d,n,0==d);if(C(i/n)>c-s)E("overflow");s+=C(i/n);i%=n;t.splice(i++,0,s)}return L(t)}function R(e){var t,r,n,i,s,o,a,l,u,d,m,b=[],k,y,x,w;e=T(e);k=e.length;t=v;r=0;s=g;for(o=0;o=t&&mC((c-r)/y))E("overflow");r+=(a-t)*y;t=a;for(o=0;oc)E("overflow");if(m==t){for(l=r,u=f;;u+=f){d=u<=s?p:u>=s+h?h:u-s;if(l0){n.tag="#text";n.text=e[r].textContent}if("undefined"!=typeof n.tag)t.push(n)}return t}function u(e,t){return"#text"==e.tag?n.trust(e.text):n("a"!=e.tag?e.tag:a,"undefined"!=typeof e.attrs?e.attrs:{},"undefined"!=typeof e.childs?e.childs.map(u):"undefined"!=typeof e.text?n.trust(e.text):null)}var c={id:null,text:"",texthtml:"",textdom:null,textchilds:[],parsetext(){this.texthtml=i.render(this.text);this.textdom=(new DOMParser).parseFromString(this.texthtml,"text/html");this.textchilds=l(this.textdom.getElementsByTagName("body")[0].childNodes)},oninit(e){this.id=e.attrs.id;this.text=e.attrs.text||"";this.parsetext()},onbeforeupdate(e,t){this.text=e.attrs.text;this.parsetext()},view(e){return n("div",{class:"text"},this.textchilds.map(u))}};var f={id:null,part:null,type:null,nested:false,oninit(e){this.id=e.attrs.id;this.type=e.attrs.type;this.text=e.attrs.text;this.nested=e.attrs.nested||false;this.dottype=e.attrs.dottype||null},onbeforeupdate(e,t){this.nested=e.attrs.nested||false;this.type=e.attrs.type;this.text=e.attrs.text},view(e){return n("section",{id:this.id,class:`item${this.nested?" nested":""} ${this.dottype}`},[!this.nested?n("h3",{},n.trust(i.renderInline(this.type))):null,n(c,{text:this.text,id:this.id})])}};var p={partid:null,id:null,title:null,text:null,nested:false,childs:[],oninit(e){this.partid=e.attrs.partid;this.id=e.attrs.id;this.title=e.attrs.title||"";this.text=e.attrs.text;this.childs=e.attrs.childs||[];this.nested=e.attrs.nested||false;this.dottype=e.attrs.dottype||"no-dottype"},onbeforeupdate(e,t){this.title=e.attrs.title||"";this.text=e.attrs.text;this.childs=e.attrs.childs||[];this.nested=e.attrs.nested||false},view(e){return n("section",{id:this.id,class:`enonce${this.nested?" nested":""} ${this.dottype}`},[!this.nested?n("h2",{},n.trust(i.renderInline(this.title))):null,n(c,{text:this.text,id:this.id}),!this.nested?this.childs.map(e=>{return n(f,e)}):null])}};var h={oninit(e){this.id=e.attrs.id;this.title=e.attrs.title||"";this.enonces=e.attrs.enonces},onbeforeupdate(e,t){this.title=e.attrs.title||"";this.enonces=e.attrs.enonces},view(e){return n("section",{id:this.id,class:"part"},[n("h1",{class:"part-title",part:this.id},n.trust(i.renderInline(this.title))),this.enonces.map(e=>{switch(e.type){case"title":return n("h2",{class:"title"},n.trust(i.renderInline(e.title)));case"filet":return n("h4",{class:"filet"},n.trust(i.renderInline(e.title)));default:return n(p,Object.assign({partid:this.id},e))}})])}};var d={oninit(e){this.id=e.attrs.id;this.text=e.attrs.text||""},onbeforeupdate(e,t){this.id=e.attrs.id;this.text=e.attrs.text||""},view(e){return n("section",{class:"intro"},n("p",n.trust(i.renderInline(this.text))))}};e.exports={oncreate(e){document.body.classList.add("mode-text");o.init()},view(e){return n("main",{id:"content",class:"mode-text"},s.data[e.attrs.lang].map(e=>{if("intro"==e.id)return n(d,e);else return n(h,e)}))}}},function(e,t,r){var n=r(1);var i=r(4)().use(r(8));var s=r(3);var o=r(10);var a=r(19);var l=r(20);var u={id:null,dottype:null,type:"",title:"",breadcrumb:"",text:"",summary:"",active:true,opened:0,nested:false,links:null,parents:[],lang:s.lang,setupTitle(e){this.title=e.attrs.title;if(!this.title)this.title=this.type;if(this.title)this.title=i.renderInline(this.title)},setuptext(e){this.text=e.attrs.text||"";this.rendered_text=i.render(this.text);if("preface"==this.dottype)this.summary=this.rendered_text;else{this.summary=this.text.replace(/!\[[^\]]+\]\([^\)]+\)/g,"");this.summary=this.summary.match("([^ ]*[ ]{0,1}){1,6}")[0];this.summary=this.summary.trim().replace(/_([^_]+)$/g,"_$1_");this.summary=this.summary.replace(/\[([^\]]+)$/g,"$1");this.summary=i.renderInline(this.summary)+" …"}},oninit(e){this.id=e.attrs.id;this.type=e.attrs.type;this.dottype=e.attrs.dottype;this.breadcrumb=e.attrs.breadcrumb;if("undefined"!==typeof e.attrs.active)this.active=e.attrs.active;this.links=s.data_strct[this.id];if(e.attrs.parents)this.parents=this.parents.concat(e.attrs.parents);this.nested=this.parents.length?true:false;this.setupTitle(e);this.setuptext(e)},oncreate(e){if(this.active)e.dom.classList.remove("disabled");else e.dom.classList.add("disabled")},onbeforeupdate(e){if(this.lang!=s.lang){this.lang=s.lang;this.breadcrumb=e.attrs.breadcrumb;this.setuptext(e);this.setupTitle(e)}},onupdate(e){if(this.active)if(this.opened){e.dom.classList.add("opened");if(this.links.to.length)e.dom.classList.add("to-links");if(this.links.from.length)e.dom.classList.add("from-links")}else e.dom.classList.remove("opened")},setupLinks(e,t,r){return n("nav",{class:`links ${t}`},r.map(t=>{if("undefined"!==typeof s.data_byid[s.lang][t]){var r=s.data_byid[s.lang][t];return n(u,{id:t,title:r.title,breadcrumb:r.breadcrumb,text:r.text,dottype:r.dottype,type:r.type,parents:e.state.parents.concat([e.state.id]),active:-1==e.state.parents.indexOf(t)?true:false})}}))},viewOpenedContent(e){return n("div",{uid:this.id,class:`dot ${this.dottype}${this.nested?" nested":""}`},[this.links.to.length?this.setupLinks(e,"to",this.links.to):null,n("div",{class:"close-link-btn",onclick(t){e.state.opened=0}},n("span",n.trust("🗙"))),n("span",{class:"title"},n.trust(this.nested?this.breadcrumb:this.title)),n("section",{class:"text",onmouseover(t){t.preventDefault();if("A"==t.target.nodeName){let r=t.target.getAttribute("href");e.dom.querySelector(`nav.links>div[uid="${r}"]`).classList.add("highlight")}else for(link of e.dom.querySelectorAll("nav.links>div.dot"))link.classList.remove("highlight")},onclick(t){t.preventDefault();if("A"==t.target.nodeName){let r=t.target.getAttribute("href");e.dom.querySelector(`nav.links>div[uid="${r}"]>.title`).click()}}},n.trust(this.rendered_text)),this.links.from.length?this.setupLinks(e,"from",this.links.from):null])},viewPreviewContent(e){return n("div",{uid:this.id,class:`dot ${this.dottype}${this.nested?" nested":""}`},[n("div",{class:"bullet"},n("span",n.trust("⚫"))),n("span",{class:"title",onclick(t){if(!e.state.opened)e.state.opened=1}},n.trust(this.nested?this.breadcrumb:this.title)),n("p",{class:"summary"},n.trust(this.summary))])},view(e){return this.active&&e.state.opened?this.viewOpenedContent(e):this.viewPreviewContent(e)}};var c={oninit(e){},onbeforeupdate(e,t){},view(e){return n(u,e.attrs)}};var f={partid:null,id:null,title:null,text:null,dottype:null,childs:[],oninit(e){},onbeforeupdate(e,t){},view(e){return[n(u,e.attrs),e.attrs.childs.map(e=>{return n(c,e)})]}};var p={oninit(e){this.id=e.attrs.id;this.title=e.attrs.title||"";this.enonces=e.attrs.enonces},onbeforeupdate(e,t){this.title=e.attrs.title||"";this.enonces=e.attrs.enonces},view(e){return n("section",{id:this.id,class:"part"},[n("h1",{class:"part-title",part:this.id},n.trust(i.renderInline(this.title))),this.enonces.map(e=>{switch(e.type){case"title":return n("h2",{class:"title"},n.trust(i.renderInline(e.title)));case"filet":return n("h4",{class:"filet"},n.trust(i.renderInline(e.title)));default:return n(f,Object.assign({partid:this.id},e))}})])}};var h={oninit(e){console.log("_Intro : oninit : vn",e);this.id=e.attrs.id;this.text=e.attrs.text||""},onbeforeupdate(e,t){this.id=e.attrs.id;this.text=e.attrs.text||""},view(e){return n("section",{class:"intro"},n("p",n.trust(i.renderInline(this.text))))}};e.exports={oncreate(e){document.body.classList.add("mode-connections");l.init()},view(e){return n("main",{id:"content",class:"mode-connections"},s.data[e.attrs.lang].map(e=>{if("intro"==e.id)return n(h,e);else return n(p,e)}))}}},function(e,t){}]); +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 21); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Utilities +// + + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function isString(obj) { return _class(obj) === '[object String]'; } + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function has(object, key) { + return _hasOwnProperty.call(object, key); +} + +// Merge objects +// +function assign(obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + + sources.forEach(function (source) { + if (!source) { return; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be object'); + } + + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + + return obj; +} + +// Remove element from array and put another array at those position. +// Useful for some operations with tokens +function arrayReplaceAt(src, pos, newElements) { + return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); +} + +//////////////////////////////////////////////////////////////////////////////// + +function isValidEntityCode(c) { + /*eslint no-bitwise:0*/ + // broken sequence + if (c >= 0xD800 && c <= 0xDFFF) { return false; } + // never used + if (c >= 0xFDD0 && c <= 0xFDEF) { return false; } + if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; } + // control codes + if (c >= 0x00 && c <= 0x08) { return false; } + if (c === 0x0B) { return false; } + if (c >= 0x0E && c <= 0x1F) { return false; } + if (c >= 0x7F && c <= 0x9F) { return false; } + // out of range + if (c > 0x10FFFF) { return false; } + return true; +} + +function fromCodePoint(c) { + /*eslint no-bitwise:0*/ + if (c > 0xffff) { + c -= 0x10000; + var surrogate1 = 0xd800 + (c >> 10), + surrogate2 = 0xdc00 + (c & 0x3ff); + + return String.fromCharCode(surrogate1, surrogate2); + } + return String.fromCharCode(c); +} + + +var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; +var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; +var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); + +var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; + +var entities = __webpack_require__(11); + +function replaceEntityPattern(match, name) { + var code = 0; + + if (has(entities, name)) { + return entities[name]; + } + + if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { + code = name[1].toLowerCase() === 'x' ? + parseInt(name.slice(2), 16) + : + parseInt(name.slice(1), 10); + if (isValidEntityCode(code)) { + return fromCodePoint(code); + } + } + + return match; +} + +/*function replaceEntities(str) { + if (str.indexOf('&') < 0) { return str; } + + return str.replace(ENTITY_RE, replaceEntityPattern); +}*/ + +function unescapeMd(str) { + if (str.indexOf('\\') < 0) { return str; } + return str.replace(UNESCAPE_MD_RE, '$1'); +} + +function unescapeAll(str) { + if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; } + + return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { + if (escaped) { return escaped; } + return replaceEntityPattern(match, entity); + }); +} + +//////////////////////////////////////////////////////////////////////////////// + +var HTML_ESCAPE_TEST_RE = /[&<>"]/; +var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; +var HTML_REPLACEMENTS = { + '&': '&', + '<': '<', + '>': '>', + '"': '"' +}; + +function replaceUnsafeChar(ch) { + return HTML_REPLACEMENTS[ch]; +} + +function escapeHtml(str) { + if (HTML_ESCAPE_TEST_RE.test(str)) { + return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); + } + return str; +} + +//////////////////////////////////////////////////////////////////////////////// + +var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; + +function escapeRE(str) { + return str.replace(REGEXP_ESCAPE_RE, '\\$&'); +} + +//////////////////////////////////////////////////////////////////////////////// + +function isSpace(code) { + switch (code) { + case 0x09: + case 0x20: + return true; + } + return false; +} + +// Zs (unicode class) || [\t\f\v\r\n] +function isWhiteSpace(code) { + if (code >= 0x2000 && code <= 0x200A) { return true; } + switch (code) { + case 0x09: // \t + case 0x0A: // \n + case 0x0B: // \v + case 0x0C: // \f + case 0x0D: // \r + case 0x20: + case 0xA0: + case 0x1680: + case 0x202F: + case 0x205F: + case 0x3000: + return true; + } + return false; +} + +//////////////////////////////////////////////////////////////////////////////// + +/*eslint-disable max-len*/ +var UNICODE_PUNCT_RE = __webpack_require__(5); + +// Currently without astral characters support. +function isPunctChar(ch) { + return UNICODE_PUNCT_RE.test(ch); +} + + +// Markdown ASCII punctuation characters. +// +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +// +// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. +// +function isMdAsciiPunct(ch) { + switch (ch) { + case 0x21/* ! */: + case 0x22/* " */: + case 0x23/* # */: + case 0x24/* $ */: + case 0x25/* % */: + case 0x26/* & */: + case 0x27/* ' */: + case 0x28/* ( */: + case 0x29/* ) */: + case 0x2A/* * */: + case 0x2B/* + */: + case 0x2C/* , */: + case 0x2D/* - */: + case 0x2E/* . */: + case 0x2F/* / */: + case 0x3A/* : */: + case 0x3B/* ; */: + case 0x3C/* < */: + case 0x3D/* = */: + case 0x3E/* > */: + case 0x3F/* ? */: + case 0x40/* @ */: + case 0x5B/* [ */: + case 0x5C/* \ */: + case 0x5D/* ] */: + case 0x5E/* ^ */: + case 0x5F/* _ */: + case 0x60/* ` */: + case 0x7B/* { */: + case 0x7C/* | */: + case 0x7D/* } */: + case 0x7E/* ~ */: + return true; + default: + return false; + } +} + +// Hepler to unify [reference labels]. +// +function normalizeReference(str) { + // use .toUpperCase() instead of .toLowerCase() + // here to avoid a conflict with Object.prototype + // members (most notably, `__proto__`) + return str.trim().replace(/\s+/g, ' ').toUpperCase(); +} + +//////////////////////////////////////////////////////////////////////////////// + +// Re-export libraries commonly used in both markdown-it and its plugins, +// so plugins won't have to depend on them explicitly, which reduces their +// bundled size (e.g. a browser build). +// +exports.lib = {}; +exports.lib.mdurl = __webpack_require__(12); +exports.lib.ucmicro = __webpack_require__(36); + +exports.assign = assign; +exports.isString = isString; +exports.has = has; +exports.unescapeMd = unescapeMd; +exports.unescapeAll = unescapeAll; +exports.isValidEntityCode = isValidEntityCode; +exports.fromCodePoint = fromCodePoint; +// exports.replaceEntities = replaceEntities; +exports.escapeHtml = escapeHtml; +exports.arrayReplaceAt = arrayReplaceAt; +exports.isSpace = isSpace; +exports.isWhiteSpace = isWhiteSpace; +exports.isMdAsciiPunct = isMdAsciiPunct; +exports.isPunctChar = isPunctChar; +exports.escapeRE = escapeRE; +exports.normalizeReference = normalizeReference; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(setImmediate, global) {;(function() { +"use strict" +function Vnode(tag, key, attrs0, children, text, dom) { + return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false} +} +Vnode.normalize = function(node) { + if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined) + if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined) + return node +} +Vnode.normalizeChildren = function normalizeChildren(children) { + for (var i = 0; i < children.length; i++) { + children[i] = Vnode.normalize(children[i]) + } + return children +} +var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g +var selectorCache = {} +var hasOwn = {}.hasOwnProperty +function isEmpty(object) { + for (var key in object) if (hasOwn.call(object, key)) return false + return true +} +function compileSelector(selector) { + var match, tag = "div", classes = [], attrs = {} + while (match = selectorParser.exec(selector)) { + var type = match[1], value = match[2] + if (type === "" && value !== "") tag = value + else if (type === "#") attrs.id = value + else if (type === ".") classes.push(value) + else if (match[3][0] === "[") { + var attrValue = match[6] + if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\") + if (match[4] === "class") classes.push(attrValue) + else attrs[match[4]] = attrValue === "" ? attrValue : attrValue || true + } + } + if (classes.length > 0) attrs.className = classes.join(" ") + return selectorCache[selector] = {tag: tag, attrs: attrs} +} +function execSelector(state, attrs, children) { + var hasAttrs = false, childList, text + var className = attrs.className || attrs.class + if (!isEmpty(state.attrs) && !isEmpty(attrs)) { + var newAttrs = {} + for(var key in attrs) { + if (hasOwn.call(attrs, key)) { + newAttrs[key] = attrs[key] + } + } + attrs = newAttrs + } + for (var key in state.attrs) { + if (hasOwn.call(state.attrs, key)) { + attrs[key] = state.attrs[key] + } + } + if (className !== undefined) { + if (attrs.class !== undefined) { + attrs.class = undefined + attrs.className = className + } + if (state.attrs.className != null) { + attrs.className = state.attrs.className + " " + className + } + } + for (var key in attrs) { + if (hasOwn.call(attrs, key) && key !== "key") { + hasAttrs = true + break + } + } + if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === "#") { + text = children[0].children + } else { + childList = children + } + return Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text) +} +function hyperscript(selector) { + // Because sloppy mode sucks + var attrs = arguments[1], start = 2, children + if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") { + throw Error("The selector must be either a string or a component."); + } + if (typeof selector === "string") { + var cached = selectorCache[selector] || compileSelector(selector) + } + if (attrs == null) { + attrs = {} + } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) { + attrs = {} + start = 1 + } + if (arguments.length === start + 1) { + children = arguments[start] + if (!Array.isArray(children)) children = [children] + } else { + children = [] + while (start < arguments.length) children.push(arguments[start++]) + } + var normalized = Vnode.normalizeChildren(children) + if (typeof selector === "string") { + return execSelector(cached, attrs, normalized) + } else { + return Vnode(selector, attrs.key, attrs, normalized) + } +} +hyperscript.trust = function(html) { + if (html == null) html = "" + return Vnode("<", undefined, undefined, html, undefined, undefined) +} +hyperscript.fragment = function(attrs1, children) { + return Vnode("[", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined) +} +var m = hyperscript +/** @constructor */ +var PromisePolyfill = function(executor) { + if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with `new`") + if (typeof executor !== "function") throw new TypeError("executor must be a function") + var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false) + var instance = self._instance = {resolvers: resolvers, rejectors: rejectors} + var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout + function handler(list, shouldAbsorb) { + return function execute(value) { + var then + try { + if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") { + if (value === self) throw new TypeError("Promise can't be resolved w/ itself") + executeOnce(then.bind(value)) + } + else { + callAsync(function() { + if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value) + for (var i = 0; i < list.length; i++) list[i](value) + resolvers.length = 0, rejectors.length = 0 + instance.state = shouldAbsorb + instance.retry = function() {execute(value)} + }) + } + } + catch (e) { + rejectCurrent(e) + } + } + } + function executeOnce(then) { + var runs = 0 + function run(fn) { + return function(value) { + if (runs++ > 0) return + fn(value) + } + } + var onerror = run(rejectCurrent) + try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)} + } + executeOnce(executor) +} +PromisePolyfill.prototype.then = function(onFulfilled, onRejection) { + var self = this, instance = self._instance + function handle(callback, list, next, state) { + list.push(function(value) { + if (typeof callback !== "function") next(value) + else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)} + }) + if (typeof instance.retry === "function" && state === instance.state) instance.retry() + } + var resolveNext, rejectNext + var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject}) + handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false) + return promise +} +PromisePolyfill.prototype.catch = function(onRejection) { + return this.then(null, onRejection) +} +PromisePolyfill.resolve = function(value) { + if (value instanceof PromisePolyfill) return value + return new PromisePolyfill(function(resolve) {resolve(value)}) +} +PromisePolyfill.reject = function(value) { + return new PromisePolyfill(function(resolve, reject) {reject(value)}) +} +PromisePolyfill.all = function(list) { + return new PromisePolyfill(function(resolve, reject) { + var total = list.length, count = 0, values = [] + if (list.length === 0) resolve([]) + else for (var i = 0; i < list.length; i++) { + (function(i) { + function consume(value) { + count++ + values[i] = value + if (count === total) resolve(values) + } + if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") { + list[i].then(consume, reject) + } + else consume(list[i]) + })(i) + } + }) +} +PromisePolyfill.race = function(list) { + return new PromisePolyfill(function(resolve, reject) { + for (var i = 0; i < list.length; i++) { + list[i].then(resolve, reject) + } + }) +} +if (typeof window !== "undefined") { + if (typeof window.Promise === "undefined") window.Promise = PromisePolyfill + var PromisePolyfill = window.Promise +} else if (typeof global !== "undefined") { + if (typeof global.Promise === "undefined") global.Promise = PromisePolyfill + var PromisePolyfill = global.Promise +} else { +} +var buildQueryString = function(object) { + if (Object.prototype.toString.call(object) !== "[object Object]") return "" + var args = [] + for (var key0 in object) { + destructure(key0, object[key0]) + } + return args.join("&") + function destructure(key0, value) { + if (Array.isArray(value)) { + for (var i = 0; i < value.length; i++) { + destructure(key0 + "[" + i + "]", value[i]) + } + } + else if (Object.prototype.toString.call(value) === "[object Object]") { + for (var i in value) { + destructure(key0 + "[" + i + "]", value[i]) + } + } + else args.push(encodeURIComponent(key0) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : "")) + } +} +var FILE_PROTOCOL_REGEX = new RegExp("^file://", "i") +var _8 = function($window, Promise) { + var callbackCount = 0 + var oncompletion + function setCompletionCallback(callback) {oncompletion = callback} + function finalizer() { + var count = 0 + function complete() {if (--count === 0 && typeof oncompletion === "function") oncompletion()} + return function finalize(promise0) { + var then0 = promise0.then + promise0.then = function() { + count++ + var next = then0.apply(promise0, arguments) + next.then(complete, function(e) { + complete() + if (count === 0) throw e + }) + return finalize(next) + } + return promise0 + } + } + function normalize(args, extra) { + if (typeof args === "string") { + var url = args + args = extra || {} + if (args.url == null) args.url = url + } + return args + } + function request(args, extra) { + var finalize = finalizer() + args = normalize(args, extra) + var promise0 = new Promise(function(resolve, reject) { + if (args.method == null) args.method = "GET" + args.method = args.method.toUpperCase() + var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true) + if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify + if (typeof args.deserialize !== "function") args.deserialize = deserialize + if (typeof args.extract !== "function") args.extract = extract + args.url = interpolate(args.url, args.data) + if (useBody) args.data = args.serialize(args.data) + else args.url = assemble(args.url, args.data) + var xhr = new $window.XMLHttpRequest(), + aborted = false, + _abort = xhr.abort + xhr.abort = function abort() { + aborted = true + _abort.call(xhr) + } + xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined) + if (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty("Content-Type"))) { + xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8") + } + if (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty("Accept"))) { + xhr.setRequestHeader("Accept", "application/json, text/*") + } + if (args.withCredentials) xhr.withCredentials = args.withCredentials + for (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) { + xhr.setRequestHeader(key, args.headers[key]) + } + if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr + xhr.onreadystatechange = function() { + // Don't throw errors on xhr.abort(). + if(aborted) return + if (xhr.readyState === 4) { + try { + var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args)) + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) { + resolve(cast(args.type, response)) + } + else { + var error = new Error(xhr.responseText) + for (var key in response) error[key] = response[key] + reject(error) + } + } + catch (e) { + reject(e) + } + } + } + if (useBody && (args.data != null)) xhr.send(args.data) + else xhr.send() + }) + return args.background === true ? promise0 : finalize(promise0) + } + function jsonp(args, extra) { + var finalize = finalizer() + args = normalize(args, extra) + var promise0 = new Promise(function(resolve, reject) { + var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++ + var script = $window.document.createElement("script") + $window[callbackName] = function(data) { + script.parentNode.removeChild(script) + resolve(cast(args.type, data)) + delete $window[callbackName] + } + script.onerror = function() { + script.parentNode.removeChild(script) + reject(new Error("JSONP request failed")) + delete $window[callbackName] + } + if (args.data == null) args.data = {} + args.url = interpolate(args.url, args.data) + args.data[args.callbackKey || "callback"] = callbackName + script.src = assemble(args.url, args.data) + $window.document.documentElement.appendChild(script) + }) + return args.background === true? promise0 : finalize(promise0) + } + function interpolate(url, data) { + if (data == null) return url + var tokens = url.match(/:[^\/]+/gi) || [] + for (var i = 0; i < tokens.length; i++) { + var key = tokens[i].slice(1) + if (data[key] != null) { + url = url.replace(tokens[i], data[key]) + } + } + return url + } + function assemble(url, data) { + var querystring = buildQueryString(data) + if (querystring !== "") { + var prefix = url.indexOf("?") < 0 ? "?" : "&" + url += prefix + querystring + } + return url + } + function deserialize(data) { + try {return data !== "" ? JSON.parse(data) : null} + catch (e) {throw new Error(data)} + } + function extract(xhr) {return xhr.responseText} + function cast(type0, data) { + if (typeof type0 === "function") { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + data[i] = new type0(data[i]) + } + } + else return new type0(data) + } + return data + } + return {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback} +} +var requestService = _8(window, PromisePolyfill) +var coreRenderer = function($window) { + var $doc = $window.document + var $emptyFragment = $doc.createDocumentFragment() + var nameSpace = { + svg: "http://www.w3.org/2000/svg", + math: "http://www.w3.org/1998/Math/MathML" + } + var onevent + function setEventCallback(callback) {return onevent = callback} + function getNameSpace(vnode) { + return vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag] + } + //create + function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) { + for (var i = start; i < end; i++) { + var vnode = vnodes[i] + if (vnode != null) { + createNode(parent, vnode, hooks, ns, nextSibling) + } + } + } + function createNode(parent, vnode, hooks, ns, nextSibling) { + var tag = vnode.tag + if (typeof tag === "string") { + vnode.state = {} + if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks) + switch (tag) { + case "#": return createText(parent, vnode, nextSibling) + case "<": return createHTML(parent, vnode, nextSibling) + case "[": return createFragment(parent, vnode, hooks, ns, nextSibling) + default: return createElement(parent, vnode, hooks, ns, nextSibling) + } + } + else return createComponent(parent, vnode, hooks, ns, nextSibling) + } + function createText(parent, vnode, nextSibling) { + vnode.dom = $doc.createTextNode(vnode.children) + insertNode(parent, vnode.dom, nextSibling) + return vnode.dom + } + function createHTML(parent, vnode, nextSibling) { + var match1 = vnode.children.match(/^\s*?<(\w+)/im) || [] + var parent1 = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}[match1[1]] || "div" + var temp = $doc.createElement(parent1) + temp.innerHTML = vnode.children + vnode.dom = temp.firstChild + vnode.domSize = temp.childNodes.length + var fragment = $doc.createDocumentFragment() + var child + while (child = temp.firstChild) { + fragment.appendChild(child) + } + insertNode(parent, fragment, nextSibling) + return fragment + } + function createFragment(parent, vnode, hooks, ns, nextSibling) { + var fragment = $doc.createDocumentFragment() + if (vnode.children != null) { + var children = vnode.children + createNodes(fragment, children, 0, children.length, hooks, null, ns) + } + vnode.dom = fragment.firstChild + vnode.domSize = fragment.childNodes.length + insertNode(parent, fragment, nextSibling) + return fragment + } + function createElement(parent, vnode, hooks, ns, nextSibling) { + var tag = vnode.tag + var attrs2 = vnode.attrs + var is = attrs2 && attrs2.is + ns = getNameSpace(vnode) || ns + var element = ns ? + is ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) : + is ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag) + vnode.dom = element + if (attrs2 != null) { + setAttrs(vnode, attrs2, ns) + } + insertNode(parent, element, nextSibling) + if (vnode.attrs != null && vnode.attrs.contenteditable != null) { + setContentEditable(vnode) + } + else { + if (vnode.text != null) { + if (vnode.text !== "") element.textContent = vnode.text + else vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)] + } + if (vnode.children != null) { + var children = vnode.children + createNodes(element, children, 0, children.length, hooks, null, ns) + setLateAttrs(vnode) + } + } + return element + } + function initComponent(vnode, hooks) { + var sentinel + if (typeof vnode.tag.view === "function") { + vnode.state = Object.create(vnode.tag) + sentinel = vnode.state.view + if (sentinel.$$reentrantLock$$ != null) return $emptyFragment + sentinel.$$reentrantLock$$ = true + } else { + vnode.state = void 0 + sentinel = vnode.tag + if (sentinel.$$reentrantLock$$ != null) return $emptyFragment + sentinel.$$reentrantLock$$ = true + vnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function") ? new vnode.tag(vnode) : vnode.tag(vnode) + } + vnode._state = vnode.state + if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks) + initLifecycle(vnode._state, vnode, hooks) + vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode)) + if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument") + sentinel.$$reentrantLock$$ = null + } + function createComponent(parent, vnode, hooks, ns, nextSibling) { + initComponent(vnode, hooks) + if (vnode.instance != null) { + var element = createNode(parent, vnode.instance, hooks, ns, nextSibling) + vnode.dom = vnode.instance.dom + vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0 + insertNode(parent, element, nextSibling) + return element + } + else { + vnode.domSize = 0 + return $emptyFragment + } + } + //update + function updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) { + if (old === vnodes || old == null && vnodes == null) return + else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns) + else if (vnodes == null) removeNodes(old, 0, old.length, vnodes) + else { + if (old.length === vnodes.length) { + var isUnkeyed = false + for (var i = 0; i < vnodes.length; i++) { + if (vnodes[i] != null && old[i] != null) { + isUnkeyed = vnodes[i].key == null && old[i].key == null + break + } + } + if (isUnkeyed) { + for (var i = 0; i < old.length; i++) { + if (old[i] === vnodes[i]) continue + else if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling)) + else if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes) + else updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns) + } + return + } + } + recycling = recycling || isRecyclable(old, vnodes) + if (recycling) { + var pool = old.pool + old = old.concat(old.pool) + } + var oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map + while (oldEnd >= oldStart && end >= start) { + var o = old[oldStart], v = vnodes[start] + if (o === v && !recycling) oldStart++, start++ + else if (o == null) oldStart++ + else if (v == null) start++ + else if (o.key === v.key) { + var shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling) + oldStart++, start++ + updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns) + if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling) + } + else { + var o = old[oldEnd] + if (o === v && !recycling) oldEnd--, start++ + else if (o == null) oldEnd-- + else if (v == null) start++ + else if (o.key === v.key) { + var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling) + updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns) + if (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling)) + oldEnd--, start++ + } + else break + } + } + while (oldEnd >= oldStart && end >= start) { + var o = old[oldEnd], v = vnodes[end] + if (o === v && !recycling) oldEnd--, end-- + else if (o == null) oldEnd-- + else if (v == null) end-- + else if (o.key === v.key) { + var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling) + updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns) + if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling) + if (o.dom != null) nextSibling = o.dom + oldEnd--, end-- + } + else { + if (!map) map = getKeyMap(old, oldEnd) + if (v != null) { + var oldIndex = map[v.key] + if (oldIndex != null) { + var movable = old[oldIndex] + var shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling) + updateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns) + insertNode(parent, toFragment(movable), nextSibling) + old[oldIndex].skip = true + if (movable.dom != null) nextSibling = movable.dom + } + else { + var dom = createNode(parent, v, hooks, ns, nextSibling) + nextSibling = dom + } + } + end-- + } + if (end < start) break + } + createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns) + removeNodes(old, oldStart, oldEnd + 1, vnodes) + } + } + function updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) { + var oldTag = old.tag, tag = vnode.tag + if (oldTag === tag) { + vnode.state = old.state + vnode._state = old._state + vnode.events = old.events + if (!recycling && shouldNotUpdate(vnode, old)) return + if (typeof oldTag === "string") { + if (vnode.attrs != null) { + if (recycling) { + vnode.state = {} + initLifecycle(vnode.attrs, vnode, hooks) + } + else updateLifecycle(vnode.attrs, vnode, hooks) + } + switch (oldTag) { + case "#": updateText(old, vnode); break + case "<": updateHTML(parent, old, vnode, nextSibling); break + case "[": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break + default: updateElement(old, vnode, recycling, hooks, ns) + } + } + else updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) + } + else { + removeNode(old, null) + createNode(parent, vnode, hooks, ns, nextSibling) + } + } + function updateText(old, vnode) { + if (old.children.toString() !== vnode.children.toString()) { + old.dom.nodeValue = vnode.children + } + vnode.dom = old.dom + } + function updateHTML(parent, old, vnode, nextSibling) { + if (old.children !== vnode.children) { + toFragment(old) + createHTML(parent, vnode, nextSibling) + } + else vnode.dom = old.dom, vnode.domSize = old.domSize + } + function updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) { + updateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns) + var domSize = 0, children = vnode.children + vnode.dom = null + if (children != null) { + for (var i = 0; i < children.length; i++) { + var child = children[i] + if (child != null && child.dom != null) { + if (vnode.dom == null) vnode.dom = child.dom + domSize += child.domSize || 1 + } + } + if (domSize !== 1) vnode.domSize = domSize + } + } + function updateElement(old, vnode, recycling, hooks, ns) { + var element = vnode.dom = old.dom + ns = getNameSpace(vnode) || ns + if (vnode.tag === "textarea") { + if (vnode.attrs == null) vnode.attrs = {} + if (vnode.text != null) { + vnode.attrs.value = vnode.text //FIXME handle0 multiple children + vnode.text = undefined + } + } + updateAttrs(vnode, old.attrs, vnode.attrs, ns) + if (vnode.attrs != null && vnode.attrs.contenteditable != null) { + setContentEditable(vnode) + } + else if (old.text != null && vnode.text != null && vnode.text !== "") { + if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text + } + else { + if (old.text != null) old.children = [Vnode("#", undefined, undefined, old.text, undefined, old.dom.firstChild)] + if (vnode.text != null) vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)] + updateNodes(element, old.children, vnode.children, recycling, hooks, null, ns) + } + } + function updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) { + if (recycling) { + initComponent(vnode, hooks) + } else { + vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode)) + if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument") + if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks) + updateLifecycle(vnode._state, vnode, hooks) + } + if (vnode.instance != null) { + if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling) + else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns) + vnode.dom = vnode.instance.dom + vnode.domSize = vnode.instance.domSize + } + else if (old.instance != null) { + removeNode(old.instance, null) + vnode.dom = undefined + vnode.domSize = 0 + } + else { + vnode.dom = old.dom + vnode.domSize = old.domSize + } + } + function isRecyclable(old, vnodes) { + if (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) { + var oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0 + var poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0 + var vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0 + if (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) { + return true + } + } + return false + } + function getKeyMap(vnodes, end) { + var map = {}, i = 0 + for (var i = 0; i < end; i++) { + var vnode = vnodes[i] + if (vnode != null) { + var key2 = vnode.key + if (key2 != null) map[key2] = i + } + } + return map + } + function toFragment(vnode) { + var count0 = vnode.domSize + if (count0 != null || vnode.dom == null) { + var fragment = $doc.createDocumentFragment() + if (count0 > 0) { + var dom = vnode.dom + while (--count0) fragment.appendChild(dom.nextSibling) + fragment.insertBefore(dom, fragment.firstChild) + } + return fragment + } + else return vnode.dom + } + function getNextSibling(vnodes, i, nextSibling) { + for (; i < vnodes.length; i++) { + if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom + } + return nextSibling + } + function insertNode(parent, dom, nextSibling) { + if (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling) + else parent.appendChild(dom) + } + function setContentEditable(vnode) { + var children = vnode.children + if (children != null && children.length === 1 && children[0].tag === "<") { + var content = children[0].children + if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content + } + else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted") + } + //remove + function removeNodes(vnodes, start, end, context) { + for (var i = start; i < end; i++) { + var vnode = vnodes[i] + if (vnode != null) { + if (vnode.skip) vnode.skip = false + else removeNode(vnode, context) + } + } + } + function removeNode(vnode, context) { + var expected = 1, called = 0 + if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") { + var result = vnode.attrs.onbeforeremove.call(vnode.state, vnode) + if (result != null && typeof result.then === "function") { + expected++ + result.then(continuation, continuation) + } + } + if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeremove === "function") { + var result = vnode._state.onbeforeremove.call(vnode.state, vnode) + if (result != null && typeof result.then === "function") { + expected++ + result.then(continuation, continuation) + } + } + continuation() + function continuation() { + if (++called === expected) { + onremove(vnode) + if (vnode.dom) { + var count0 = vnode.domSize || 1 + if (count0 > 1) { + var dom = vnode.dom + while (--count0) { + removeNodeFromDOM(dom.nextSibling) + } + } + removeNodeFromDOM(vnode.dom) + if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === "string") { //TODO test custom elements + if (!context.pool) context.pool = [vnode] + else context.pool.push(vnode) + } + } + } + } + } + function removeNodeFromDOM(node) { + var parent = node.parentNode + if (parent != null) parent.removeChild(node) + } + function onremove(vnode) { + if (vnode.attrs && typeof vnode.attrs.onremove === "function") vnode.attrs.onremove.call(vnode.state, vnode) + if (typeof vnode.tag !== "string") { + if (typeof vnode._state.onremove === "function") vnode._state.onremove.call(vnode.state, vnode) + if (vnode.instance != null) onremove(vnode.instance) + } else { + var children = vnode.children + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + var child = children[i] + if (child != null) onremove(child) + } + } + } + } + //attrs2 + function setAttrs(vnode, attrs2, ns) { + for (var key2 in attrs2) { + setAttr(vnode, key2, null, attrs2[key2], ns) + } + } + function setAttr(vnode, key2, old, value, ns) { + var element = vnode.dom + if (key2 === "key" || key2 === "is" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== "object" || typeof value === "undefined" || isLifecycleMethod(key2)) return + var nsLastIndex = key2.indexOf(":") + if (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === "xlink") { + element.setAttributeNS("http://www.w3.org/1999/xlink", key2.slice(nsLastIndex + 1), value) + } + else if (key2[0] === "o" && key2[1] === "n" && typeof value === "function") updateEvent(vnode, key2, value) + else if (key2 === "style") updateStyle(element, old, value) + else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) { + if (key2 === "value") { + var normalized0 = "" + value // eslint-disable-line no-implicit-coercion + //setting input[value] to same value by typing on focused element moves cursor to end in Chrome + if ((vnode.tag === "input" || vnode.tag === "textarea") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return + //setting select[value] to same value while having select open blinks select dropdown in Chrome + if (vnode.tag === "select") { + if (value === null) { + if (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return + } else { + if (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return + } + } + //setting option[value] to same value while having select open blinks select dropdown in Chrome + if (vnode.tag === "option" && old != null && vnode.dom.value === normalized0) return + } + // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur. + if (vnode.tag === "input" && key2 === "type") { + element.setAttribute(key2, value) + return + } + element[key2] = value + } + else { + if (typeof value === "boolean") { + if (value) element.setAttribute(key2, "") + else element.removeAttribute(key2) + } + else element.setAttribute(key2 === "className" ? "class" : key2, value) + } + } + function setLateAttrs(vnode) { + var attrs2 = vnode.attrs + if (vnode.tag === "select" && attrs2 != null) { + if ("value" in attrs2) setAttr(vnode, "value", null, attrs2.value, undefined) + if ("selectedIndex" in attrs2) setAttr(vnode, "selectedIndex", null, attrs2.selectedIndex, undefined) + } + } + function updateAttrs(vnode, old, attrs2, ns) { + if (attrs2 != null) { + for (var key2 in attrs2) { + setAttr(vnode, key2, old && old[key2], attrs2[key2], ns) + } + } + if (old != null) { + for (var key2 in old) { + if (attrs2 == null || !(key2 in attrs2)) { + if (key2 === "className") key2 = "class" + if (key2[0] === "o" && key2[1] === "n" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined) + else if (key2 !== "key") vnode.dom.removeAttribute(key2) + } + } + } + } + function isFormAttribute(vnode, attr) { + return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement + } + function isLifecycleMethod(attr) { + return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate" + } + function isAttribute(attr) { + return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type" + } + function isCustomElement(vnode){ + return vnode.attrs.is || vnode.tag.indexOf("-") > -1 + } + function hasIntegrationMethods(source) { + return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove) + } + //style + function updateStyle(element, old, style) { + if (old === style) element.style.cssText = "", old = null + if (style == null) element.style.cssText = "" + else if (typeof style === "string") element.style.cssText = style + else { + if (typeof old === "string") element.style.cssText = "" + for (var key2 in style) { + element.style[key2] = style[key2] + } + if (old != null && typeof old !== "string") { + for (var key2 in old) { + if (!(key2 in style)) element.style[key2] = "" + } + } + } + } + //event + function updateEvent(vnode, key2, value) { + var element = vnode.dom + var callback = typeof onevent !== "function" ? value : function(e) { + var result = value.call(element, e) + onevent.call(element, e) + return result + } + if (key2 in element) element[key2] = typeof value === "function" ? callback : null + else { + var eventName = key2.slice(2) + if (vnode.events === undefined) vnode.events = {} + if (vnode.events[key2] === callback) return + if (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false) + if (typeof value === "function") { + vnode.events[key2] = callback + element.addEventListener(eventName, vnode.events[key2], false) + } + } + } + //lifecycle + function initLifecycle(source, vnode, hooks) { + if (typeof source.oninit === "function") source.oninit.call(vnode.state, vnode) + if (typeof source.oncreate === "function") hooks.push(source.oncreate.bind(vnode.state, vnode)) + } + function updateLifecycle(source, vnode, hooks) { + if (typeof source.onupdate === "function") hooks.push(source.onupdate.bind(vnode.state, vnode)) + } + function shouldNotUpdate(vnode, old) { + var forceVnodeUpdate, forceComponentUpdate + if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old) + if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeupdate === "function") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old) + if (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) { + vnode.dom = old.dom + vnode.domSize = old.domSize + vnode.instance = old.instance + return true + } + return false + } + function render(dom, vnodes) { + if (!dom) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.") + var hooks = [] + var active = $doc.activeElement + var namespace = dom.namespaceURI + // First time0 rendering into a node clears it out + if (dom.vnodes == null) dom.textContent = "" + if (!Array.isArray(vnodes)) vnodes = [vnodes] + updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? undefined : namespace) + dom.vnodes = vnodes + // document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement + if (active != null && $doc.activeElement !== active) active.focus() + for (var i = 0; i < hooks.length; i++) hooks[i]() + } + return {render: render, setEventCallback: setEventCallback} +} +function throttle(callback) { + //60fps translates to 16.6ms, round it down since setTimeout requires int + var time = 16 + var last = 0, pending = null + var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout + return function() { + var now = Date.now() + if (last === 0 || now - last >= time) { + last = now + callback() + } + else if (pending === null) { + pending = timeout(function() { + pending = null + callback() + last = Date.now() + }, time - (now - last)) + } + } +} +var _11 = function($window) { + var renderService = coreRenderer($window) + renderService.setEventCallback(function(e) { + if (e.redraw === false) e.redraw = undefined + else redraw() + }) + var callbacks = [] + function subscribe(key1, callback) { + unsubscribe(key1) + callbacks.push(key1, throttle(callback)) + } + function unsubscribe(key1) { + var index = callbacks.indexOf(key1) + if (index > -1) callbacks.splice(index, 2) + } + function redraw() { + for (var i = 1; i < callbacks.length; i += 2) { + callbacks[i]() + } + } + return {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render} +} +var redrawService = _11(window) +requestService.setCompletionCallback(redrawService.redraw) +var _16 = function(redrawService0) { + return function(root, component) { + if (component === null) { + redrawService0.render(root, []) + redrawService0.unsubscribe(root) + return + } + + if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode") + + var run0 = function() { + redrawService0.render(root, Vnode(component)) + } + redrawService0.subscribe(root, run0) + redrawService0.redraw() + } +} +m.mount = _16(redrawService) +var Promise = PromisePolyfill +var parseQueryString = function(string) { + if (string === "" || string == null) return {} + if (string.charAt(0) === "?") string = string.slice(1) + var entries = string.split("&"), data0 = {}, counters = {} + for (var i = 0; i < entries.length; i++) { + var entry = entries[i].split("=") + var key5 = decodeURIComponent(entry[0]) + var value = entry.length === 2 ? decodeURIComponent(entry[1]) : "" + if (value === "true") value = true + else if (value === "false") value = false + var levels = key5.split(/\]\[?|\[/) + var cursor = data0 + if (key5.indexOf("[") > -1) levels.pop() + for (var j = 0; j < levels.length; j++) { + var level = levels[j], nextLevel = levels[j + 1] + var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10)) + var isValue = j === levels.length - 1 + if (level === "") { + var key5 = levels.slice(0, j).join() + if (counters[key5] == null) counters[key5] = 0 + level = counters[key5]++ + } + if (cursor[level] == null) { + cursor[level] = isValue ? value : isNumber ? [] : {} + } + cursor = cursor[level] + } + } + return data0 +} +var coreRouter = function($window) { + var supportsPushState = typeof $window.history.pushState === "function" + var callAsync0 = typeof setImmediate === "function" ? setImmediate : setTimeout + function normalize1(fragment0) { + var data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent) + if (fragment0 === "pathname" && data[0] !== "/") data = "/" + data + return data + } + var asyncId + function debounceAsync(callback0) { + return function() { + if (asyncId != null) return + asyncId = callAsync0(function() { + asyncId = null + callback0() + }) + } + } + function parsePath(path, queryData, hashData) { + var queryIndex = path.indexOf("?") + var hashIndex = path.indexOf("#") + var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length + if (queryIndex > -1) { + var queryEnd = hashIndex > -1 ? hashIndex : path.length + var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd)) + for (var key4 in queryParams) queryData[key4] = queryParams[key4] + } + if (hashIndex > -1) { + var hashParams = parseQueryString(path.slice(hashIndex + 1)) + for (var key4 in hashParams) hashData[key4] = hashParams[key4] + } + return path.slice(0, pathEnd) + } + var router = {prefix: "#!"} + router.getPath = function() { + var type2 = router.prefix.charAt(0) + switch (type2) { + case "#": return normalize1("hash").slice(router.prefix.length) + case "?": return normalize1("search").slice(router.prefix.length) + normalize1("hash") + default: return normalize1("pathname").slice(router.prefix.length) + normalize1("search") + normalize1("hash") + } + } + router.setPath = function(path, data, options) { + var queryData = {}, hashData = {} + path = parsePath(path, queryData, hashData) + if (data != null) { + for (var key4 in data) queryData[key4] = data[key4] + path = path.replace(/:([^\/]+)/g, function(match2, token) { + delete queryData[token] + return data[token] + }) + } + var query = buildQueryString(queryData) + if (query) path += "?" + query + var hash = buildQueryString(hashData) + if (hash) path += "#" + hash + if (supportsPushState) { + var state = options ? options.state : null + var title = options ? options.title : null + $window.onpopstate() + if (options && options.replace) $window.history.replaceState(state, title, router.prefix + path) + else $window.history.pushState(state, title, router.prefix + path) + } + else $window.location.href = router.prefix + path + } + router.defineRoutes = function(routes, resolve, reject) { + function resolveRoute() { + var path = router.getPath() + var params = {} + var pathname = parsePath(path, params, params) + var state = $window.history.state + if (state != null) { + for (var k in state) params[k] = state[k] + } + for (var route0 in routes) { + var matcher = new RegExp("^" + route0.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$") + if (matcher.test(pathname)) { + pathname.replace(matcher, function() { + var keys = route0.match(/:[^\/]+/g) || [] + var values = [].slice.call(arguments, 1, -2) + for (var i = 0; i < keys.length; i++) { + params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i]) + } + resolve(routes[route0], params, path, route0) + }) + return + } + } + reject(path, params) + } + if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute) + else if (router.prefix.charAt(0) === "#") $window.onhashchange = resolveRoute + resolveRoute() + } + return router +} +var _20 = function($window, redrawService0) { + var routeService = coreRouter($window) + var identity = function(v) {return v} + var render1, component, attrs3, currentPath, lastUpdate + var route = function(root, defaultRoute, routes) { + if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined") + var run1 = function() { + if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3))) + } + var bail = function(path) { + if (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true}) + else throw new Error("Could not resolve default route " + defaultRoute) + } + routeService.defineRoutes(routes, function(payload, params, path) { + var update = lastUpdate = function(routeResolver, comp) { + if (update !== lastUpdate) return + component = comp != null && (typeof comp.view === "function" || typeof comp === "function")? comp : "div" + attrs3 = params, currentPath = path, lastUpdate = null + render1 = (routeResolver.render || identity).bind(routeResolver) + run1() + } + if (payload.view || typeof payload === "function") update({}, payload) + else { + if (payload.onmatch) { + Promise.resolve(payload.onmatch(params, path)).then(function(resolved) { + update(payload, resolved) + }, bail) + } + else update(payload, "div") + } + }, bail) + redrawService0.subscribe(root, run1) + } + route.set = function(path, data, options) { + if (lastUpdate != null) { + options = options || {} + options.replace = true + } + lastUpdate = null + routeService.setPath(path, data, options) + } + route.get = function() {return currentPath} + route.prefix = function(prefix0) {routeService.prefix = prefix0} + route.link = function(vnode1) { + vnode1.dom.setAttribute("href", routeService.prefix + vnode1.attrs.href) + vnode1.dom.onclick = function(e) { + if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return + e.preventDefault() + e.redraw = false + var href = this.getAttribute("href") + if (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length) + route.set(href, undefined, undefined) + } + } + route.param = function(key3) { + if(typeof attrs3 !== "undefined" && typeof key3 !== "undefined") return attrs3[key3] + return attrs3 + } + return route +} +m.route = _20(window, redrawService) +m.withAttr = function(attrName, callback1, context) { + return function(e) { + callback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName)) + } +} +var _28 = coreRenderer(window) +m.render = _28.render +m.redraw = redrawService.redraw +m.request = requestService.request +m.jsonp = requestService.jsonp +m.parseQueryString = parseQueryString +m.buildQueryString = buildQueryString +m.version = "1.1.6" +m.vnode = Vnode +if (true) module["exports"] = m +else window.m = m +}()); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27).setImmediate, __webpack_require__(2))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + +// _ +// (_)________ ____ +// / / ___/ __ \/ __ \ +// / (__ ) /_/ / / / / +// __/ /____/\____/_/ /_/ +// /___/ + +module.exports = { + lang:'fr', + langs:[ + { + 'lc':'lat', + 'label':'Latin (Carl Gebhardt)', + 'db':'spinoza-ethica-lat-gebhardt.json' + }, + { + 'lc':'fr', + 'label':'Français (Traduction par Charles Appuhn)', + 'db':'spinoza-ethica-fr-appuhn.json' + }, + { + 'lc':'bra', + 'label':'Brazilian (Tradução Roberto Brandão)', + 'db':'spinoza-ethica-bra-brandao.json' + }, + { + 'lc':'en', + 'label':'English (Translated by R. H. M. Elwes)', + 'db':'spinoza-ethica-en-elwes.json' + } + ], + data:[], + loaded_dbs:0, + data_byid:[], + data_strct:{}, + rx_id:/^(\d)(app|agd|\d\d|pr|ad|ap|c|p|d|a)(cd|sc|\d\d|d|c|a|l|p|\d)?(e|\d|sc)?(d|c|a|sc)?$/, + id_strct:[ + {full:'Partie',dim:'Part.'}, + { + 'prop':{full:'Proposition', dim:'Prop.'}, // \d\d + 'app' :{full:'Appendice', dim:'App.'}, + 'agd' :{full:'Definition generale des affections'}, + 'pr' :{full:'Preface', dim:'Pref.'}, + 'ad' :{full:'Definiton des affections'}, + 'ap' :{full:'Appendice', dim:'App.'}, + 'c' :{full:'Corollaire', dim:'Cor.'}, + 'p' :{full:'Postulat', dim:'Post.'}, + 'd' :{full:'Definition', dim:'Def.'}, + 'a' :{full:'Axiome', dim:'Ax.'}, + }, + { + // \d\d + // \d + 'cd' :{full:'Corollaire Demonstration'}, + 'sc' :{full:'Scolie', dim:'Scol.'}, + 'd' :{full:'Demonstration', dim:'Demo.'}, + 'c' :{full:'Corollaire', dim:'Cor.'}, + 'a' :{full:'Axiome', dim:'Ax.'}, + 'l' :{full:'Lemme', dim:'Lem.'}, + 'p' :{full:'Postulat', dim:'Post.'}, + 'e' :{full:'Explication', dim:'Exp.'}, + }, + { + // \d + 'e' :{full:'Explication', dim:'Exp.'}, + 'sc' :{full:'Scolie', dim:'Scol.'}, + 'c' :{full:'Corollaire', dim:'Cor.'}, + }, + { + 'd' :{full:'Demonstration', dim:'Demo.'}, + 'c' :{full:'Corollaire', dim:'Cor.'}, + 'a' :{full:'Axiome', dim:'Ax.'}, + 'sc' :{full:'Scolie', dim:'Scol.'}, + } + ], + + load(callback) { + // load all dbs, when all loaded call main app callback function + for (var i = 0; i < this.langs.length; i++) { + this.loadJSON(this.langs[i].lc, '/assets/jsondb/'+this.langs[i].db, callback) + } + }, + loadJSON(lc, file, callback){ + + var xobj = new XMLHttpRequest(); + xobj.overrideMimeType("application/json"); + // TODO: load and unzip gziped json + // xobj.setRequestHeader('Accept-Encoding', 'gzip'); + xobj.onreadystatechange = function () { + // console.log('onreadystatechange', xobj.readyState); + switch(xobj.readyState){ + case 3: + // console.log('loading'); + break; + break; + case 4: + if (xobj.status === 200) { + this.onJSONLoaded(lc, xobj.responseText, callback); + } else { + console.log("Status de la réponse: %d (%s)", xobj.status, xobj.statusText); + } + break; + } + }.bind(this); + + xobj.open('GET', file, true); + xobj.send(null); + }, + onJSONLoaded(lc, json, callback){ + // console.log('onDBLoaded '+lc); + this.data[lc] = JSON.parse(json); + this.loaded_dbs ++; + // + if (this.loaded_dbs == this.langs.length) { + // console.log('All db loaded : data', this.data); + this.parseByID(callback); + } + + }, + parseByID(callback){ + // create a id keyed array of contents + var e_id, c_id, cc_id; + // loop through laguages + for(let l in this.data){ + // console.log('l', l); + this.data_byid[l] = {}; + // loop through parts + for (let p in this.data[l]) { + if(this.data[l][p].type !== "intro"){ + // console.log(this.data[l][p]); + // loop through enonces + for (let e in this.data[l][p].enonces) { + // console.log('e',e); + if(this.data[l][p].enonces[e].id){ + e_id = this.data[l][p].enonces[e].id; + // guess the type from the id + // console.log(this.data[l][p].enonces[e].id); + this.data[l][p].enonces[e].dottype = this.setupType(e_id); + // breadcrumb (full tree title) + this.data[l][p].enonces[e].breadcrumb = this.setupBreadcrumb(e_id); + // records childs in array keyed by ids + this.data_byid[l][e_id] = this.data[l][p].enonces[e]; + } + // loop through childs + for (let c in this.data[l][p].enonces[e].childs){ + // console.log(_db[p][e][c]); + if(this.data[l][p].enonces[e].childs[c].id){ + c_id = this.data[l][p].enonces[e].childs[c].id; + // guess the type from the id + this.data[l][p].enonces[e].childs[c].dottype = this.setupType(c_id); + // breadcrumb (full tree title) + this.data[l][p].enonces[e].childs[c].breadcrumb = this.setupBreadcrumb(c_id); + // records childs in array keyed by ids + this.data_byid[l][c_id] = this.data[l][p].enonces[e].childs[c]; + } + // loop through childs of childs + for (let cc in this.data[l][p].enonces[e].childs[c].childs){ + // console.log(_db[p][e][c]); + if(this.data[l][p].enonces[e].childs[c].childs[cc].id){ + cc_id = this.data[l][p].enonces[e].childs[c].childs[cc].id; + console.log('cc_id', cc_id); + // guess the type from the id + this.data[l][p].enonces[e].childs[c].childs[cc].dottype = this.setupType(cc_id); + // breadcrumb (full tree title) + this.data[l][p].enonces[e].childs[c].childs[cc].breadcrumb = this.setupBreadcrumb(cc_id); + // records childs in array keyed by ids + this.data_byid[l][cc_id] = this.data[l][p].enonces[e].childs[c].childs[cc]; + } + + } + } + } + } + } + } + // console.log('this.data_byid', this.data_byid); + this.parseStrct(callback); + }, + setupBreadcrumb(id){ + // /^(\d)(app|agd|\d\d|pr|ad|ap|c|p|d|a)(cd|sc|\d\d|d|c|a|l|p|\d)?(e|\d|sc)?(d|c|a|sc)?$/ + var breadcrumb_array = []; + var m = id.match(this.rx_id); + var mode = 'full'; + if(m){ + m.shift(); + // removing undefined + m_clean = []; + for (let i = 0; i < m.length; i++) { + if(typeof m[i] !== 'undefined'){ + m_clean.push(m[i]); + } + } + // console.log('m_clean', m_clean); + + for (let i = 0; i < m_clean.length; i++) { // we loop through match result variables + // for (let i = m_clean.length-1; i >= 0; i--) { // we loop through match result variables in reverse order + // console.log('m_clean['+i+']', m_clean[i]); + if(i == 0){ // first digit is part number + breadcrumb_array.unshift(`${this.id_strct[i]['dim']} ${m_clean[i]}`); + }else{ + // display mode + mode = i !== m_clean.length-1 ? 'dim' : 'full'; + if(isNaN(m_clean[i])){ // if not a number we get the label + breadcrumb_array.unshift(`${this.id_strct[i][m_clean[i]][mode]}`); + // breadcrumb_array.splice(1, 0, `${m_clean[i]}`); + }else{ // if its a number + if(i == 1){ // we just add the number to the breadcrumb preceded by 'Proposition' + breadcrumb_array.unshift(`${this.id_strct[i]['prop'][mode]} ${m_clean[i]}`); + }else{ // we just add the number to the breadcrumb behind the last added item + // breadcrumb_array.unshift(`${m_clean[i]}`); + // debugger; + breadcrumb_array.splice(1, 0, `${m_clean[i]}`); + + } + } + } + } + } + + // console.log('breadcrumb_array', breadcrumb_array); + return breadcrumb_array.join(' '); + }, + setupType(id){ + // console.log('setupType',id); + // /^(\d)(app|agd|\d\d|pr|ad|ap|c|p|d|a)(cd|sc|\d\d|d|c|a|l|p|\d)?(e|\d|sc)?(d|c|a|sc)?$/ + var m = id.match(this.rx_id); + if(m){ + switch(true){ + case /^\d{2}$/.test(m[2]): // proposition + switch(true){ + case /^cd$/.test(m[3]) : return 'corollaire-demo'; + case /^sc$/.test(m[3]) : return 'scolie'; + case /^d$/.test(m[3]) : return 'demonstration'; + case /^c$/.test(m[3]) : + switch(true){ + case /^sc$/.test(m[4]): return 'scolie'; + case /^d$/.test(m[4]) : return 'demonstration'; + case /^sc$/.test(m[5]): return 'scolie'; + case /^\d$/.test(m[4]): return 'corollaire'; + case !m[4] : return 'corollaire'; + } + case /^a$/.test(m[3]) : return 'prop-axiom'; + case /^l$/.test(m[3]) : + switch(true){ + case /^d$/.test(m[5]) : return 'lemme-demonstration'; + case /^sc$/.test(m[5]): return 'lemme-scolie'; + case /^c$/.test(m[5]) : return 'lemme-corrollaire'; + case !m[5] : return 'lemme'; + } + case /^p$/.test(m[3]) : return 'postulat'; + case /^\d$/.test(m[3]) : return '??'; + case /^\d{2}$/.test(m[3]) : return '??'; + case !m[3] : return 'proposition'; + } + case /^app|ap$/.test(m[2]) : return 'appendice'; + case /^agd$/.test(m[2]) : return 'def-gen-affect'; + case /^pr$/.test(m[2]) : return 'preface'; + case /^ad$/.test(m[2]) : + switch(true){ + case /^e$/.test(m[4]) :return 'explication'; + case !m[4] :return 'def-affect'; + } + case /^c$/.test(m[2]) : return 'chapitre'; + case /^p$/.test(m[2]) : return 'postulat'; + case /^d$/.test(m[2]) : + switch(true){ + case /^e$/.test(m[4]) : return 'explication'; + case !m[4] : return 'definition'; + } + case /^a$/.test(m[2]) : return 'axiom'; + } + // } + } + // console.log(`${this.id} -> ${this.dottype}`,m); + + // TODO: fix false ids + // we have app and ap for appendice (1app | 4ap) + // 213def ?? + // 209cd demo ou corollaire-demo ?? + // 210csc scolie ou corollaire-scolie ?? + // 213l1d demo ?? + }, + parseStrct(callback){ + + var id, item, obj, links_match, link, tid; + for (id in this.data_byid[this.langs[0].lc]) { + item = this.data_byid[this.langs[0].lc][id]; + // console.log(item); + // skeep titles as they don't have structure data + if(item.type == "title") continue; + + obj = { + 'to':[], + 'from':[], + }; + // get links + links_match = item.text.match(/\[[^\]]+\]\([^\)]+\)/g); + // console.log(links_match); + // if links exist on text + if(links_match){ + for(link of links_match){ + // for(i in links_match){ + // link = links_match[i]; + // console.log(link); + // get the target id + tid = link.match(/\((.+)\)/)[1]; + // avoid duplicates + if (obj.to.indexOf(tid) == -1) + obj.to.push(tid); + + // add id to "from" links in target + // if target exists + if(typeof this.data_strct[tid] !== 'undefined'){ + // avoid duplicates + if (this.data_strct[tid].from.indexOf(tid) == -1) + this.data_strct[tid].from.push(id); + }else{ + // if targets does not exists, the db has an issue, warn about that + // console.log(`!! warning : ${tid} target id does not exists`); + } + } + } + // add the item links to the main links listings + this.data_strct[id] = obj; + } + // console.log('data_strct',this.data_strct); + + callback(); + } +} + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +module.exports = __webpack_require__(30); + + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\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\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\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-\u2E49\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]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/ + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * class Ruler + * + * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and + * [[MarkdownIt#inline]] to manage sequences of functions (rules): + * + * - keep rules in defined order + * - assign the name to each rule + * - enable/disable rules + * - add/replace rules + * - allow assign rules to additional named chains (in the same) + * - cacheing lists of active rules + * + * You will not need use this class directly until write plugins. For simple + * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and + * [[MarkdownIt.use]]. + **/ + + + +/** + * new Ruler() + **/ +function Ruler() { + // List of added rules. Each element is: + // + // { + // name: XXX, + // enabled: Boolean, + // fn: Function(), + // alt: [ name2, name3 ] + // } + // + this.__rules__ = []; + + // Cached rule chains. + // + // First level - chain name, '' for default. + // Second level - diginal anchor for fast filtering by charcodes. + // + this.__cache__ = null; +} + +//////////////////////////////////////////////////////////////////////////////// +// Helper methods, should not be used directly + + +// Find rule index by name +// +Ruler.prototype.__find__ = function (name) { + for (var i = 0; i < this.__rules__.length; i++) { + if (this.__rules__[i].name === name) { + return i; + } + } + return -1; +}; + + +// Build rules lookup cache +// +Ruler.prototype.__compile__ = function () { + var self = this; + var chains = [ '' ]; + + // collect unique names + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { return; } + + rule.alt.forEach(function (altName) { + if (chains.indexOf(altName) < 0) { + chains.push(altName); + } + }); + }); + + self.__cache__ = {}; + + chains.forEach(function (chain) { + self.__cache__[chain] = []; + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { return; } + + if (chain && rule.alt.indexOf(chain) < 0) { return; } + + self.__cache__[chain].push(rule.fn); + }); + }); +}; + + +/** + * Ruler.at(name, fn [, options]) + * - name (String): rule name to replace. + * - fn (Function): new rule function. + * - options (Object): new rule options (not mandatory). + * + * Replace rule by name with new function & options. Throws error if name not + * found. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * Replace existing typorgapher replacement rule with new one: + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.at('replacements', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.at = function (name, fn, options) { + var index = this.__find__(name); + var opt = options || {}; + + if (index === -1) { throw new Error('Parser rule not found: ' + name); } + + this.__rules__[index].fn = fn; + this.__rules__[index].alt = opt.alt || []; + this.__cache__ = null; +}; + + +/** + * Ruler.before(beforeName, ruleName, fn [, options]) + * - beforeName (String): new rule will be added before this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain before one with given name. See also + * [[Ruler.after]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.before = function (beforeName, ruleName, fn, options) { + var index = this.__find__(beforeName); + var opt = options || {}; + + if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); } + + this.__rules__.splice(index, 0, { + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + + this.__cache__ = null; +}; + + +/** + * Ruler.after(afterName, ruleName, fn [, options]) + * - afterName (String): new rule will be added after this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain after one with given name. See also + * [[Ruler.before]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.inline.ruler.after('text', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.after = function (afterName, ruleName, fn, options) { + var index = this.__find__(afterName); + var opt = options || {}; + + if (index === -1) { throw new Error('Parser rule not found: ' + afterName); } + + this.__rules__.splice(index + 1, 0, { + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + + this.__cache__ = null; +}; + +/** + * Ruler.push(ruleName, fn [, options]) + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Push new rule to the end of chain. See also + * [[Ruler.before]], [[Ruler.after]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.push('my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.push = function (ruleName, fn, options) { + var opt = options || {}; + + this.__rules__.push({ + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + + this.__cache__ = null; +}; + + +/** + * Ruler.enable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to enable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.disable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.enable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { list = [ list ]; } + + var result = []; + + // Search by name and enable + list.forEach(function (name) { + var idx = this.__find__(name); + + if (idx < 0) { + if (ignoreInvalid) { return; } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = true; + result.push(name); + }, this); + + this.__cache__ = null; + return result; +}; + + +/** + * Ruler.enableOnly(list [, ignoreInvalid]) + * - list (String|Array): list of rule names to enable (whitelist). + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names, and disable everything else. If any rule name + * not found - throw Error. Errors can be disabled by second param. + * + * See also [[Ruler.disable]], [[Ruler.enable]]. + **/ +Ruler.prototype.enableOnly = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { list = [ list ]; } + + this.__rules__.forEach(function (rule) { rule.enabled = false; }); + + this.enable(list, ignoreInvalid); +}; + + +/** + * Ruler.disable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Disable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.enable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.disable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { list = [ list ]; } + + var result = []; + + // Search by name and disable + list.forEach(function (name) { + var idx = this.__find__(name); + + if (idx < 0) { + if (ignoreInvalid) { return; } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = false; + result.push(name); + }, this); + + this.__cache__ = null; + return result; +}; + + +/** + * Ruler.getRules(chainName) -> Array + * + * Return array of active functions (rules) for given chain name. It analyzes + * rules configuration, compiles caches if not exists and returns result. + * + * Default chain name is `''` (empty string). It can't be skipped. That's + * done intentionally, to keep signature monomorphic for high speed. + **/ +Ruler.prototype.getRules = function (chainName) { + if (this.__cache__ === null) { + this.__compile__(); + } + + // Chain can be empty, if rules disabled. But we still have to return Array. + return this.__cache__[chainName] || []; +}; + +module.exports = Ruler; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Token class + + + + +/** + * class Token + **/ + +/** + * new Token(type, tag, nesting) + * + * Create new token and fill passed properties. + **/ +function Token(type, tag, nesting) { + /** + * Token#type -> String + * + * Type of the token (string, e.g. "paragraph_open") + **/ + this.type = type; + + /** + * Token#tag -> String + * + * html tag name, e.g. "p" + **/ + this.tag = tag; + + /** + * Token#attrs -> Array + * + * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` + **/ + this.attrs = null; + + /** + * Token#map -> Array + * + * Source map info. Format: `[ line_begin, line_end ]` + **/ + this.map = null; + + /** + * Token#nesting -> Number + * + * Level change (number in {-1, 0, 1} set), where: + * + * - `1` means the tag is opening + * - `0` means the tag is self-closing + * - `-1` means the tag is closing + **/ + this.nesting = nesting; + + /** + * Token#level -> Number + * + * nesting level, the same as `state.level` + **/ + this.level = 0; + + /** + * Token#children -> Array + * + * An array of child nodes (inline and img tokens) + **/ + this.children = null; + + /** + * Token#content -> String + * + * In a case of self-closing tag (code, html, fence, etc.), + * it has contents of this tag. + **/ + this.content = ''; + + /** + * Token#markup -> String + * + * '*' or '_' for emphasis, fence string for fence, etc. + **/ + this.markup = ''; + + /** + * Token#info -> String + * + * fence infostring + **/ + this.info = ''; + + /** + * Token#meta -> Object + * + * A place for plugins to store an arbitrary data + **/ + this.meta = null; + + /** + * Token#block -> Boolean + * + * True for block-level tokens, false for inline tokens. + * Used in renderer to calculate line breaks + **/ + this.block = false; + + /** + * Token#hidden -> Boolean + * + * If it's true, ignore this element when rendering. Used for tight lists + * to hide paragraphs. + **/ + this.hidden = false; +} + + +/** + * Token.attrIndex(name) -> Number + * + * Search attribute index by name. + **/ +Token.prototype.attrIndex = function attrIndex(name) { + var attrs, i, len; + + if (!this.attrs) { return -1; } + + attrs = this.attrs; + + for (i = 0, len = attrs.length; i < len; i++) { + if (attrs[i][0] === name) { return i; } + } + return -1; +}; + + +/** + * Token.attrPush(attrData) + * + * Add `[ name, value ]` attribute to list. Init attrs if necessary + **/ +Token.prototype.attrPush = function attrPush(attrData) { + if (this.attrs) { + this.attrs.push(attrData); + } else { + this.attrs = [ attrData ]; + } +}; + + +/** + * Token.attrSet(name, value) + * + * Set `name` attribute to `value`. Override old value if exists. + **/ +Token.prototype.attrSet = function attrSet(name, value) { + var idx = this.attrIndex(name), + attrData = [ name, value ]; + + if (idx < 0) { + this.attrPush(attrData); + } else { + this.attrs[idx] = attrData; + } +}; + + +/** + * Token.attrGet(name) + * + * Get the value of attribute `name`, or null if it does not exist. + **/ +Token.prototype.attrGet = function attrGet(name) { + var idx = this.attrIndex(name), value = null; + if (idx >= 0) { + value = this.attrs[idx][1]; + } + return value; +}; + + +/** + * Token.attrJoin(name, value) + * + * Join value to existing attribute via space. Or create new attribute if not + * exists. Useful to operate with token classes. + **/ +Token.prototype.attrJoin = function attrJoin(name, value) { + var idx = this.attrIndex(name); + + if (idx < 0) { + this.attrPush([ name, value ]); + } else { + this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; + } +}; + + +module.exports = Token; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Process footnotes +// + + +//////////////////////////////////////////////////////////////////////////////// +// Renderer partials + +function render_footnote_anchor_name(tokens, idx, options, env/*, slf*/) { + var n = Number(tokens[idx].meta.id + 1).toString(); + var prefix = ''; + + if (typeof env.docId === 'string') { + prefix = '-' + env.docId + '-'; + } + + return prefix + n; +} + +function render_footnote_caption(tokens, idx/*, options, env, slf*/) { + var n = Number(tokens[idx].meta.id + 1).toString(); + + if (tokens[idx].meta.subId > 0) { + n += ':' + tokens[idx].meta.subId; + } + + return '[' + n + ']'; +} + +function render_footnote_ref(tokens, idx, options, env, slf) { + var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf); + var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf); + var refid = id; + + if (tokens[idx].meta.subId > 0) { + refid += ':' + tokens[idx].meta.subId; + } + + return '' + caption + ''; +} + +function render_footnote_block_open(tokens, idx, options) { + return (options.xhtmlOut ? '
    \n' : '
    \n') + + '
    \n' + + '
      \n'; +} + +function render_footnote_block_close() { + return '
    \n
    \n'; +} + +function render_footnote_open(tokens, idx, options, env, slf) { + var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf); + + if (tokens[idx].meta.subId > 0) { + id += ':' + tokens[idx].meta.subId; + } + + return '
  • '; +} + +function render_footnote_close() { + return '
  • \n'; +} + +function render_footnote_anchor(tokens, idx, options, env, slf) { + var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf); + + if (tokens[idx].meta.subId > 0) { + id += ':' + tokens[idx].meta.subId; + } + + /* ↩ with escape code to prevent display as Apple Emoji on iOS */ + return ' \u21a9\uFE0E'; +} + + +module.exports = function footnote_plugin(md) { + var parseLinkLabel = md.helpers.parseLinkLabel, + isSpace = md.utils.isSpace; + + md.renderer.rules.footnote_ref = render_footnote_ref; + md.renderer.rules.footnote_block_open = render_footnote_block_open; + md.renderer.rules.footnote_block_close = render_footnote_block_close; + md.renderer.rules.footnote_open = render_footnote_open; + md.renderer.rules.footnote_close = render_footnote_close; + md.renderer.rules.footnote_anchor = render_footnote_anchor; + + // helpers (only used in other rules, no tokens are attached to those) + md.renderer.rules.footnote_caption = render_footnote_caption; + md.renderer.rules.footnote_anchor_name = render_footnote_anchor_name; + + // Process footnote block definition + function footnote_def(state, startLine, endLine, silent) { + var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token, + initial, offset, ch, posAfterColon, + start = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // line should be at least 5 chars - "[^x]:" + if (start + 4 > max) { return false; } + + if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; } + if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; } + + for (pos = start + 2; pos < max; pos++) { + if (state.src.charCodeAt(pos) === 0x20) { return false; } + if (state.src.charCodeAt(pos) === 0x5D /* ] */) { + break; + } + } + + if (pos === start + 2) { return false; } // no empty footnote labels + if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; } + if (silent) { return true; } + pos++; + + if (!state.env.footnotes) { state.env.footnotes = {}; } + if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; } + label = state.src.slice(start + 2, pos - 2); + state.env.footnotes.refs[':' + label] = -1; + + token = new state.Token('footnote_reference_open', '', 1); + token.meta = { label: label }; + token.level = state.level++; + state.tokens.push(token); + + oldBMark = state.bMarks[startLine]; + oldTShift = state.tShift[startLine]; + oldSCount = state.sCount[startLine]; + oldParentType = state.parentType; + + posAfterColon = pos; + initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]); + + while (pos < max) { + ch = state.src.charCodeAt(pos); + + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - offset % 4; + } else { + offset++; + } + } else { + break; + } + + pos++; + } + + state.tShift[startLine] = pos - posAfterColon; + state.sCount[startLine] = offset - initial; + + state.bMarks[startLine] = posAfterColon; + state.blkIndent += 4; + state.parentType = 'footnote'; + + if (state.sCount[startLine] < state.blkIndent) { + state.sCount[startLine] += state.blkIndent; + } + + state.md.block.tokenize(state, startLine, endLine, true); + + state.parentType = oldParentType; + state.blkIndent -= 4; + state.tShift[startLine] = oldTShift; + state.sCount[startLine] = oldSCount; + state.bMarks[startLine] = oldBMark; + + token = new state.Token('footnote_reference_close', '', -1); + token.level = --state.level; + state.tokens.push(token); + + return true; + } + + // Process inline footnotes (^[...]) + function footnote_inline(state, silent) { + var labelStart, + labelEnd, + footnoteId, + token, + tokens, + max = state.posMax, + start = state.pos; + + if (start + 2 >= max) { return false; } + if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; } + if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; } + + labelStart = start + 2; + labelEnd = parseLinkLabel(state, start + 1); + + // parser failed to find ']', so it's not a valid note + if (labelEnd < 0) { return false; } + + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + if (!state.env.footnotes) { state.env.footnotes = {}; } + if (!state.env.footnotes.list) { state.env.footnotes.list = []; } + footnoteId = state.env.footnotes.list.length; + + state.md.inline.parse( + state.src.slice(labelStart, labelEnd), + state.md, + state.env, + tokens = [] + ); + + token = state.push('footnote_ref', '', 0); + token.meta = { id: footnoteId }; + + state.env.footnotes.list[footnoteId] = { tokens: tokens }; + } + + state.pos = labelEnd + 1; + state.posMax = max; + return true; + } + + // Process footnote references ([^...]) + function footnote_ref(state, silent) { + var label, + pos, + footnoteId, + footnoteSubId, + token, + max = state.posMax, + start = state.pos; + + // should be at least 4 chars - "[^x]" + if (start + 3 > max) { return false; } + + if (!state.env.footnotes || !state.env.footnotes.refs) { return false; } + if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; } + if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; } + + for (pos = start + 2; pos < max; pos++) { + if (state.src.charCodeAt(pos) === 0x20) { return false; } + if (state.src.charCodeAt(pos) === 0x0A) { return false; } + if (state.src.charCodeAt(pos) === 0x5D /* ] */) { + break; + } + } + + if (pos === start + 2) { return false; } // no empty footnote labels + if (pos >= max) { return false; } + pos++; + + label = state.src.slice(start + 2, pos - 1); + if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; } + + if (!silent) { + if (!state.env.footnotes.list) { state.env.footnotes.list = []; } + + if (state.env.footnotes.refs[':' + label] < 0) { + footnoteId = state.env.footnotes.list.length; + state.env.footnotes.list[footnoteId] = { label: label, count: 0 }; + state.env.footnotes.refs[':' + label] = footnoteId; + } else { + footnoteId = state.env.footnotes.refs[':' + label]; + } + + footnoteSubId = state.env.footnotes.list[footnoteId].count; + state.env.footnotes.list[footnoteId].count++; + + token = state.push('footnote_ref', '', 0); + token.meta = { id: footnoteId, subId: footnoteSubId, label: label }; + } + + state.pos = pos; + state.posMax = max; + return true; + } + + // Glue footnote tokens to end of token stream + function footnote_tail(state) { + var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel, + insideRef = false, + refTokens = {}; + + if (!state.env.footnotes) { return; } + + state.tokens = state.tokens.filter(function (tok) { + if (tok.type === 'footnote_reference_open') { + insideRef = true; + current = []; + currentLabel = tok.meta.label; + return false; + } + if (tok.type === 'footnote_reference_close') { + insideRef = false; + // prepend ':' to avoid conflict with Object.prototype members + refTokens[':' + currentLabel] = current; + return false; + } + if (insideRef) { current.push(tok); } + return !insideRef; + }); + + if (!state.env.footnotes.list) { return; } + list = state.env.footnotes.list; + + token = new state.Token('footnote_block_open', '', 1); + state.tokens.push(token); + + for (i = 0, l = list.length; i < l; i++) { + token = new state.Token('footnote_open', '', 1); + token.meta = { id: i, label: list[i].label }; + state.tokens.push(token); + + if (list[i].tokens) { + tokens = []; + + token = new state.Token('paragraph_open', 'p', 1); + token.block = true; + tokens.push(token); + + token = new state.Token('inline', '', 0); + token.children = list[i].tokens; + token.content = ''; + tokens.push(token); + + token = new state.Token('paragraph_close', 'p', -1); + token.block = true; + tokens.push(token); + + } else if (list[i].label) { + tokens = refTokens[':' + list[i].label]; + } + + state.tokens = state.tokens.concat(tokens); + if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') { + lastParagraph = state.tokens.pop(); + } else { + lastParagraph = null; + } + + t = list[i].count > 0 ? list[i].count : 1; + for (j = 0; j < t; j++) { + token = new state.Token('footnote_anchor', '', 0); + token.meta = { id: i, subId: j, label: list[i].label }; + state.tokens.push(token); + } + + if (lastParagraph) { + state.tokens.push(lastParagraph); + } + + token = new state.Token('footnote_close', '', -1); + state.tokens.push(token); + } + + token = new state.Token('footnote_block_close', '', -1); + state.tokens.push(token); + } + + md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] }); + md.inline.ruler.after('image', 'footnote_inline', footnote_inline); + md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref); + md.core.ruler.after('inline', 'footnote_tail', footnote_tail); +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + +module.exports = { + t(key){ + if(this.locales[key]){ + if(this.lang){ + if(this.locales[key][this.lang]){ + return this.locales[key][this.lang];// key for current language + }else{this.log(`Key "${key}" does not exists for language ${this.lang}`);} + }else if(this.locales[key][this.fallback]){ + return this.locales[key][this.fallback];// key for fallback language + }else{this.log(`Key "${key}" does not exists for fallback language ${this.fallback}`);} + }else{this.log(`Key "${key}" does not exists.`);} + return key;// if nothing else retrn key it self + }, + setLang(l){ + this.lang = l + }, + log(msg){ + console.log(`i18n : ${msg}`); + }, + fallback:'en', + lang: null, + locales:{ + 'Parts':{ + 'en':'Parts', + 'fr':'Parties', + 'bra':'Peças', + 'lat':'Pars' + }, + 'Mode':{ + 'en':'Mode', + 'fr':'Mode', + 'bra':'Modo', + 'lat':'Modus' + }, + 'Language':{ + 'en':'Language', + 'fr':'Langue', + 'bra':'Língua', + 'lat':'Lingua' + }, + 'Text':{ + 'en':'Text', + 'fr':'Texte', + 'bra':'Texto', + 'lat':'Illud' + }, + 'Connections':{ + 'en':'Connections', + 'fr':'Connections', + 'bra':'Conexões', + 'lat':'Hospites' + }, + } +} + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + +var m = __webpack_require__(1); +var _dbs = __webpack_require__(3); +var _i18n = __webpack_require__(9); +var markdown = __webpack_require__(4)() + .use(__webpack_require__(8)); + +// import * as i18next from 'i18next'; + +// __ __ __ +// / / / /__ ____ _____/ /__ _____ +// / /_/ / _ \/ __ `/ __ / _ \/ ___/ +// / __ / __/ /_/ / /_/ / __/ / +// /_/ /_/\___/\__,_/\__,_/\___/_/ +module.exports = { + // onupdate(vn){ + // // console.log("Header onupdate : vn", vn); + // }, + view(vn){ + // console.log("Header view : vn", vn); + return m('header', [ + m('hgroup', [ + m('h1', 'Ethica'), + m('h2', 'Spinoza (1632-1677)') + ]), + m('div', {'id':"menus"}, [ + m(_PartsNav), + m(_RouteMenu), + m(_LangMenu) + ]) + ]); + } +} + +// ____ __ +// / __ \____ ______/ /______ ____ ___ ___ ____ __ __ +// / /_/ / __ `/ ___/ __/ ___/ / __ `__ \/ _ \/ __ \/ / / / +// / ____/ /_/ / / / /_(__ ) / / / / / / __/ / / / /_/ / +// /_/ \__,_/_/ \__/____/ /_/ /_/ /_/\___/_/ /_/\__,_/ +var _PartsNav = { + view(vn){ + var lang = m.route.param('lang'); + // console.log('partsmenu', lang); + return m('nav', {id:'parts-nav'}, [ + // TODO: replaced labels with localized content + m('h3', _i18n.t('Parts')), + m('ul', _dbs.data[lang].map(function(p){ + // console.log("anchors, part", p); + if(p.id !== "intro"){ + return m('li', [ + m('a', {'href':'#'+p.id}, m.trust(markdown.renderInline(p.title))) + ]); + } + }) + ) + ]); + } +}; + +// ____ __ +// / __ \____ __ __/ /____ ____ ___ ___ ____ __ __ +// / /_/ / __ \/ / / / __/ _ \ / __ `__ \/ _ \/ __ \/ / / / +// / _, _/ /_/ / /_/ / /_/ __/ / / / / / / __/ / / / /_/ / +// /_/ |_|\____/\__,_/\__/\___/ /_/ /_/ /_/\___/_/ /_/\__,_/ +var _RouteMenu = { + view(){ + var lang = m.route.param('lang'); + var path = m.route.get().match(/^(\/[^\/]+)(\/[^\/|#]+)(.*)$/); + // console.log('Route menu Path', path); + return m('nav', {id:'routes'}, [ + // TODO: replaced labels with localized content + m('h3', _i18n.t('Mode')), + m('ul', [ + m('li', m('a', { + 'href':`/${lang}/text${path[3]}`, + oncreate : m.route.link, + onupdate : m.route.link + }, _i18n.t("Text"))), + m('li', m('a', { + 'href':`/${lang}/connections${path[3]}`, + oncreate : m.route.link, + onupdate : m.route.link + }, _i18n.t("Connections"))), + ]) + ]); + } +} + +// __ __ ___ +// / / ____ _____ ____ _/ |/ /__ ____ __ __ +// / / / __ `/ __ \/ __ `/ /|_/ / _ \/ __ \/ / / / +// / /___/ /_/ / / / / /_/ / / / / __/ / / / /_/ / +// /_____/\__,_/_/ /_/\__, /_/ /_/\___/_/ /_/\__,_/ +// /____/ +var _LangMenu = { + view(){ + var path = m.route.get().match(/^\/[^\/]+(.+)$/); + // console.log('Lang menu Path', path); + // create ul dom + // console.log("Header _LangMenu view : i18next", i18next); + return m('nav', {id:'languages'}, [ + // TODO: replaced labels with localized content + m('h3', _i18n.t('Language')), + m('ul', _dbs.langs.map(lang => { + // create li dom for each lang link + return m('li', m('a', { + 'lang':lang.lc, + 'href':`/${lang.lc}${path[1]}`, + oncreate : m.route.link, + onupdate : m.route.link + }, lang.label) + ); + })) + ]); + } +} + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// HTML5 entities map: { name -> utf16string } +// + + +/*eslint quotes:0*/ +module.exports = __webpack_require__(31); + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +module.exports.encode = __webpack_require__(32); +module.exports.decode = __webpack_require__(33); +module.exports.format = __webpack_require__(34); +module.exports.parse = __webpack_require__(35); + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/ + +/***/ }), +/* 14 */ +/***/ (function(module, exports) { + +module.exports=/[\0-\x1F\x7F-\x9F]/ + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/ + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Regexps to match html elements + + + +var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; + +var unquoted = '[^"\'=<>`\\x00-\\x20]+'; +var single_quoted = "'[^']*'"; +var double_quoted = '"[^"]*"'; + +var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; + +var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; + +var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; + +var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; +var comment = '|'; +var processing = '<[?].*?[?]>'; +var declaration = ']*>'; +var cdata = ''; + +var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + + '|' + processing + '|' + declaration + '|' + cdata + ')'); +var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); + +module.exports.HTML_TAG_RE = HTML_TAG_RE; +module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// ~~strike through~~ +// + + + +// Insert each marker as a separate text token, and add it to delimiter list +// +module.exports.tokenize = function strikethrough(state, silent) { + var i, scanned, token, len, ch, + start = state.pos, + marker = state.src.charCodeAt(start); + + if (silent) { return false; } + + if (marker !== 0x7E/* ~ */) { return false; } + + scanned = state.scanDelims(state.pos, true); + len = scanned.length; + ch = String.fromCharCode(marker); + + if (len < 2) { return false; } + + if (len % 2) { + token = state.push('text', '', 0); + token.content = ch; + len--; + } + + for (i = 0; i < len; i += 2) { + token = state.push('text', '', 0); + token.content = ch + ch; + + state.delimiters.push({ + marker: marker, + jump: i, + token: state.tokens.length - 1, + level: state.level, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + + state.pos += scanned.length; + + return true; +}; + + +// Walk through delimiter list and replace text tokens with tags +// +module.exports.postProcess = function strikethrough(state) { + var i, j, + startDelim, + endDelim, + token, + loneMarkers = [], + delimiters = state.delimiters, + max = state.delimiters.length; + + for (i = 0; i < max; i++) { + startDelim = delimiters[i]; + + if (startDelim.marker !== 0x7E/* ~ */) { + continue; + } + + if (startDelim.end === -1) { + continue; + } + + endDelim = delimiters[startDelim.end]; + + token = state.tokens[startDelim.token]; + token.type = 's_open'; + token.tag = 's'; + token.nesting = 1; + token.markup = '~~'; + token.content = ''; + + token = state.tokens[endDelim.token]; + token.type = 's_close'; + token.tag = 's'; + token.nesting = -1; + token.markup = '~~'; + token.content = ''; + + if (state.tokens[endDelim.token - 1].type === 'text' && + state.tokens[endDelim.token - 1].content === '~') { + + loneMarkers.push(endDelim.token - 1); + } + } + + // If a marker sequence has an odd number of characters, it's splitted + // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the + // start of the sequence. + // + // So, we have to move all those markers after subsequent s_close tags. + // + while (loneMarkers.length) { + i = loneMarkers.pop(); + j = i + 1; + + while (j < state.tokens.length && state.tokens[j].type === 's_close') { + j++; + } + + j--; + + if (i !== j) { + token = state.tokens[j]; + state.tokens[j] = state.tokens[i]; + state.tokens[i] = token; + } + } +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Process *this* and _that_ +// + + + +// Insert each marker as a separate text token, and add it to delimiter list +// +module.exports.tokenize = function emphasis(state, silent) { + var i, scanned, token, + start = state.pos, + marker = state.src.charCodeAt(start); + + if (silent) { return false; } + + if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; } + + scanned = state.scanDelims(state.pos, marker === 0x2A); + + for (i = 0; i < scanned.length; i++) { + token = state.push('text', '', 0); + token.content = String.fromCharCode(marker); + + state.delimiters.push({ + // Char code of the starting marker (number). + // + marker: marker, + + // Total length of these series of delimiters. + // + length: scanned.length, + + // An amount of characters before this one that's equivalent to + // current one. In plain English: if this delimiter does not open + // an emphasis, neither do previous `jump` characters. + // + // Used to skip sequences like "*****" in one step, for 1st asterisk + // value will be 0, for 2nd it's 1 and so on. + // + jump: i, + + // A position of the token this delimiter corresponds to. + // + token: state.tokens.length - 1, + + // Token level. + // + level: state.level, + + // If this delimiter is matched as a valid opener, `end` will be + // equal to its position, otherwise it's `-1`. + // + end: -1, + + // Boolean flags that determine if this delimiter could open or close + // an emphasis. + // + open: scanned.can_open, + close: scanned.can_close + }); + } + + state.pos += scanned.length; + + return true; +}; + + +// Walk through delimiter list and replace text tokens with tags +// +module.exports.postProcess = function emphasis(state) { + var i, + startDelim, + endDelim, + token, + ch, + isStrong, + delimiters = state.delimiters, + max = state.delimiters.length; + + for (i = max - 1; i >= 0; i--) { + startDelim = delimiters[i]; + + if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) { + continue; + } + + // Process only opening markers + if (startDelim.end === -1) { + continue; + } + + endDelim = delimiters[startDelim.end]; + + // If the previous delimiter has the same marker and is adjacent to this one, + // merge those into one strong delimiter. + // + // `whatever` -> `whatever` + // + isStrong = i > 0 && + delimiters[i - 1].end === startDelim.end + 1 && + delimiters[i - 1].token === startDelim.token - 1 && + delimiters[startDelim.end + 1].token === endDelim.token + 1 && + delimiters[i - 1].marker === startDelim.marker; + + ch = String.fromCharCode(startDelim.marker); + + token = state.tokens[startDelim.token]; + token.type = isStrong ? 'strong_open' : 'em_open'; + token.tag = isStrong ? 'strong' : 'em'; + token.nesting = 1; + token.markup = isStrong ? ch + ch : ch; + token.content = ''; + + token = state.tokens[endDelim.token]; + token.type = isStrong ? 'strong_close' : 'em_close'; + token.tag = isStrong ? 'strong' : 'em'; + token.nesting = -1; + token.markup = isStrong ? ch + ch : ch; + token.content = ''; + + if (isStrong) { + state.tokens[delimiters[i - 1].token].content = ''; + state.tokens[delimiters[startDelim.end + 1].token].content = ''; + i--; + } + } +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + +var m = __webpack_require__(1); + + +// ____ __ +// / __/___ ____ / /____ _____ +// / /_/ __ \/ __ \/ __/ _ \/ ___/ +// / __/ /_/ / /_/ / /_/ __/ / +// /_/ \____/\____/\__/\___/_/ +module.exports = { + view(vn){ + return m('footer', [ + m('p', m.trust('© 2017 Ethica Spinoza')) + ]); + } +} + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +/** + * @Author: Bachir Soussi Chiadmi + * @Date: 12-09-2017 + * @Email: bachir@figureslibres.io + * @Last modified by: bach + * @Last modified time: 12-09-2017 + * @License: GPL-V3 + */ + +// https://plainjs.com + +module.exports = { + init(){ + // console.log('UI init'); + this.initStickyTitles(); + }, + initStickyTitles(){ + // _____ __ _ __ __ _ __ __ + // / ___// /_(_)____/ /____ __ / /_(_) /_/ /__ + // \__ \/ __/ / ___/ //_/ / / / / __/ / __/ / _ \ + // ___/ / /_/ / /__/ ,< / /_/ / / /_/ / /_/ / __/ + // /____/\__/_/\___/_/|_|\__, / \__/_/\__/_/\___/ + // /____/ + // https://codepen.io/chrissp26/pen/gBrdo?editors=0010 + + // let header_height = $('header').height(); + let header_height = document.getElementsByTagName('header')[0].clientHeight; + // console.log(header_height); + + // create the stkd titles wrapper block + var stkd_wrapper = document.querySelector('.sticky-clone-wrapper'); + if(!stkd_wrapper){ + var stkd_wrapper = document.createElement('div'); + stkd_wrapper.classList.add('sticky-clone-wrapper'); + document.body.append(stkd_wrapper); + } + + // get all part title + var part_titles = new Array(); + Array.from(document.querySelectorAll('h1.part-title')).forEach(function(e){ + e._part = e.getAttribute('part'); + part_titles.push(e) + }); + // console.log('part_titles', part_titles); + + var stkd_part, + last_stkd_part = false, + subparts, + stkd_subpart, + last_stkd_subpart = false, + clone; + + let OnScroll = function(event){ + // console.log('on scrool', event); + stkd_part = false; + for (let i = part_titles.length-1; i >= 0; i--) { + if(part_titles[i].getBoundingClientRect().top < header_height){ + stkd_part = part_titles[i]; + // console.log("stkd_part"); + break; + } + } + + if (stkd_part) { + // console.log('got stkd_part', stkd_part._part); + if(stkd_part._part !== last_stkd_part._part){ + // console.log('new sticky', stkd_part.innerHTML); + // clone only once + clone = stkd_part.cloneNode(true); + stkd_wrapper.innerHTML = ''; + // fill stkd_wrapper + stkd_wrapper.appendChild(clone); + last_stkd_part = stkd_part; + + // // get all subpart title only once + // let part_wrapper = stkd_part.parentNode; + // subparts = new Array(); + // Array.from(part_wrapper.querySelectorAll('h2.title')).forEach(function(e){ + // subparts.push(e) + // }); + // // console.log('subparts', subparts); + } + + // // subtitle + // stkd_subpart = false; + // for (let i = subparts.length-1; i >= 0; i--) { + // if(subparts[i].getBoundingClientRect().top < header_height + stkd_part.clientHeight){ + // stkd_subpart = subparts[i]; + // break; + // } + // } + // + // if (stkd_subpart){ + // if( stkd_subpart.innerHTML !== last_stkd_subpart.innerHTML ){ + // console.log("new stkd_subpart "+stkd_subpart.innerHTML); + // clone = stkd_subpart.cloneNode(true); + // // stkd_wrapper.lastChild.remove(); + // stkd_wrapper.appendChild(clone); + // last_stkd_subpart = stkd_subpart; + // } + // }else{ + // // stkd_wrapper.lastChild.remove(); + // stkd_subpart = last_stkd_subpart = false; + // } + }else{ + // empty stkd_wrapper + stkd_wrapper.innerHTML = ''; + stkd_part = last_stkd_part = false; + } + }; + + // + // $window.on('scroll', OnScroll); + // console.log('window', window); + window.onscroll = OnScroll; + } +} + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(22); +module.exports = __webpack_require__(87); + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @Author: Bachir Soussi Chiadmi + * @Date: 16-04-2017 + * @Email: bachir@figureslibres.io + * @Last modified by: bach + * @Last modified time: 18-04-2017 + * @License: GPL-V3 + */ + +__webpack_require__(23); +__webpack_require__(24); +__webpack_require__(25); +__webpack_require__(26); + +const m = __webpack_require__(1); +// var marked = require('marked'); + +// var _helpers = require('modules/helpers'); +const _dbs = __webpack_require__(3); +const _i18n = __webpack_require__(9); +const _Header = __webpack_require__(10); +const _Footer = __webpack_require__(19); +const _ModeText = __webpack_require__(85); +const _ModeConnections = __webpack_require__(86); + +var Layout = { + view(vn){ + // console.log('Layout view : lang', vn.attrs.lang); + _i18n.setLang(vn.attrs.lang); + return [ + m(_Header, vn.attrs), + vn.children, + m(_Footer, vn.attrs) + ] + } +} + +function init(){ + _dbs.load(function(){ + console.log('init dbs callback'); + console.log("Init _dbs.data", _dbs.data); + console.log("Init _dbs.data_byid", _dbs.data_byid); + console.log("Init _dbs.data_strct", _dbs.data_strct); + m.route.prefix(""); + m.route(document.body, "/fr/connections", { + "/:lang/text": { + render(vn){ + // console.log('Routing render : vn', vn); + return m(Layout, vn.attrs, m(_ModeText, vn.attrs)); + } + }, + "/:lang/connections": { + render(vn){ + return m(Layout, vn.attrs, m(_ModeConnections, vn.attrs)); + } + } + }); + }); +}; + + + +// ___ +// / | ____ ____ +// / /| | / __ \/ __ \ +// / ___ |/ /_/ / /_/ / +// /_/ |_/ .___/ .___/ +// /_/ /_/ +// var _App = { +// view(){ +// console.log('_App view', _lang); +// return [ +// m('header', [ +// m('h1', 'Ethica'), +// m('aside', {'id':"menus"}, m(_LangMenu) ) +// ]), +// m(_Tree), +// m('footer', [ +// m('p', m.trust('© 2017 Ethica Spinoza')) +// ]) +// ] +// } +// } + + +// _ _ __ +// (_)___ (_) /_ +// / / __ \/ / __/ +// / / / / / / /_ +// /_/_/ /_/_/\__/ +init() + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var apply = Function.prototype.apply; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { + if (timeout) { + timeout.close(); + } +}; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// setimmediate attaches itself to the global object +__webpack_require__(28); +// On some exotic environments, it's not clear which object `setimmeidate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a