Files
leanote/public/js/markdown.min.js

14 lines
432 KiB
JavaScript
Raw Normal View History

2015-09-05 23:42:10 +08:00
var requirejs,require,define;!function(ba){function G(e){return"[object Function]"===K.call(e)}function H(e){return"[object Array]"===K.call(e)}function v(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function T(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function t(e,t){return fa.call(e,t)}function m(e,i){return t(e,i)&&e[i]}function B(e,i){for(var n in e)if(t(e,n)&&i(e[n],n))break}function U(e,i,n,r){return i&&B(i,function(i,o){(n||!t(e,o))&&(!r||"object"!=typeof i||!i||H(i)||G(i)||i instanceof RegExp?e[o]=i:(e[o]||(e[o]={}),U(e[o],i,n,r)))}),e}function u(e,t){return function(){return t.apply(e,arguments)}}function ca(e){throw e}function da(e){if(!e)return e;var t=ba;return v(e.split("."),function(e){t=t[e]}),t}function C(e,t,i,n){return t=Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e),t.requireType=e,t.requireModules=n,i&&(t.originalError=i),t}function ga(e){function i(e,t,i){var n,r,o,a,s,u,d,c,t=t&&t.split("/"),f=D.map,p=f&&f["*"];if(e){for(e=e.split("/"),r=e.length-1,D.nodeIdCompat&&Q.test(e[r])&&(e[r]=e[r].replace(Q,"")),"."===e[0].charAt(0)&&t&&(r=t.slice(0,t.length-1),e=r.concat(e)),r=e,o=0;o<r.length;o++)a=r[o],"."===a?(r.splice(o,1),o-=1):".."===a&&0!==o&&(1!=o||".."!==r[2])&&".."!==r[o-1]&&o>0&&(r.splice(o-1,2),o-=2);e=e.join("/")}if(i&&f&&(t||p)){r=e.split("/"),o=r.length;e:for(;o>0;o-=1){if(s=r.slice(0,o).join("/"),t)for(a=t.length;a>0;a-=1)if((i=m(f,t.slice(0,a).join("/")))&&(i=m(i,s))){n=i,u=o;break e}!d&&p&&m(p,s)&&(d=m(p,s),c=o)}!n&&d&&(n=d,u=c),n&&(r.splice(0,u,n),e=r.join("/"))}return(n=m(D.pkgs,e))?n:e}function n(e){z&&v(document.getElementsByTagName("script"),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===k.contextName?(t.parentNode.removeChild(t),!0):void 0})}function r(e){var t=m(D.paths,e);return t&&H(t)&&1<t.length?(t.shift(),k.require.undef(e),k.makeRequire(null,{skipMap:!0})([e]),!0):void 0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,n,r){var a,s,u=null,d=t?t.name:null,c=e,f=!0,p="";return e||(f=!1,e="_@r"+(J+=1)),e=o(e),u=e[0],e=e[1],u&&(u=i(u,d,r),s=m(F,u)),e&&(u?p=s&&s.normalize?s.normalize(e,function(e){return i(e,d,r)}):-1===e.indexOf("!")?i(e,d,r):e:(p=i(e,d,r),e=o(p),u=e[0],p=e[1],n=!0,a=k.nameToUrl(p))),n=!u||s||n?"":"_unnormalized"+(P+=1),{prefix:u,name:p,parentMap:t,unnormalized:!!n,url:a,originalName:c,isDefine:f,id:(u?u+"!"+p:p)+n}}function s(e){var t=e.id,i=m(w,t);return i||(i=w[t]=new k.Module(e)),i}function d(e,i,n){var r=e.id,o=m(w,r);!t(F,r)||o&&!o.defineEmitComplete?(o=s(e),o.error&&"error"===i?n(o.error):o.on(i,n)):"defined"===i&&n(F[r])}function c(e,t){var i=e.requireModules,n=!1;t?t(e):(v(i,function(t){(t=m(w,t))&&(t.error=e,t.events.error&&(n=!0,t.emit("error",e)))}),n||g.onError(e))}function f(){R.length&&(ha.apply(O,[O.length,0].concat(R)),R=[])}function p(e){delete w[e],delete A[e]}function l(e,t,i){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,v(e.depMaps,function(n,r){var o=n.id,a=m(w,o);a&&!e.depMatched[r]&&!i[o]&&(m(t,o)?(e.defineDep(r,F[o]),e.check()):l(a,t,i))}),i[n]=!0)}function h(){var e,t,i=(e=1e3*D.waitSeconds)&&k.startTime+e<(new Date).getTime(),o=[],a=[],s=!1,u=!0;if(!y){if(y=!0,B(A,function(e){var d=e.map,c=d.id;if(e.enabled&&(d.isDefine||a.push(e),!e.error))if(!e.inited&&i)r(c)?s=t=!0:(o.push(c),n(c));else if(!e.inited&&e.fetched&&d.isDefine&&(s=!0,!d.prefix))return u=!1}),i&&o.length)return e=C("timeout","Load timeout for modules: "+o,null,o),e.contextName=k.contextName,c(e);u&&v(a,function(e){l(e,{},{})}),i&&!t||!s||!z&&!ea||S||(S=setTimeout(function(){S=0,h()},50)),y=!1}}function x(e){t(F,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function b(e){var e=e.currentTarget||e.srcElement,t=k.onScriptLoad;return e.detachEvent&&!Y?e.detachEvent("onreadystatechange",t):e.removeEventListener("load",t,!1),t=k.onScriptError,(!e.detachEvent||Y)&&e.removeEventListener("error",t,!1),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function q(){var e;for(f();O.length;){if
2015-10-30 14:41:01 +08:00
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&x(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),b.initialized=!0,b.supported=!1}function o(t){var e="Rangy warning: "+t;b.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!b.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&x(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),b.initialized=!0,b.features={implementsDomRange:r,implementsTextRange:o};for(var l=w.concat(_),c=0,u=l.length;u>c;++c)try{l[c](b)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=C.length;n>e;++e)C[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),x=r(n),b={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:x,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};b.fail=a,b.warn=o,{}.hasOwnProperty?b.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var _=[],w=[];b.init=s,b.addInitListener=function(t){b.initialized?t(b):_.push(t)};var C=[];b.addCreateMissingNativeApiListener=function(t){C.push(t)},b.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){b.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},b.createModule=function(t,e){var n=new c(t);b.modules[t]=n,w.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},b.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=b.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var E=!1,S=function(){E||(E=!0,b.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",S,!1),t(window,"addEventListener")?window.addEventListener("load",S,!1):t(window,"attachEvent")?window.attachEvent("onload",S):a("Window does not have required addEventListener or attachEvent method"),b)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==S||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}funct
if(e._ranges.length=0,"None"==e.docSelection.type)o(e);else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=w.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=w.getDocument(n.item(0)),a=w.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=w.getDocument(e[0].startContainer),i=w.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&w.getDocument(t.anchorNode)!==w.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=E.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,x,b="boolean",_="_rangySelection",w=t.dom,C=t.util,E=t.DomRange,S=t.WrappedRange,k=t.DOMException,T=w.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),M=R&&(!N||t.config.preferTextRange);M?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||w.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var A=y(),D=t.createNativeRange(document),O=w.getBody(document),L=C.areHostObjects(A,["anchorNode","focusNode"]&&C.areHostProperties(A,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=L;var B=C.isHostMethod(A,"extend");t.features.selectionHasExtend=B;var F="number"==typeof A.rangeCount;t.features.selectionHasRangeCount=F;var P=!1,$=!0;C.areHostMethods(A,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof A.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=w.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=w.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),$=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),P=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=P,t.features.collapsedNonEditableSelectionsSupported=$;var j,H=!1;O&&C.isHostMethod(O,"createControlRange")&&(j=O.createControlRange(),C.areHostProperties(j,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,x=L?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var z;C.isHostMethod(A,"getRangeAt")?z=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:L&&(z=function(e){var n=w.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[_],n=y(t),
var e;if(m.isRegExp(t)){if(t.global)return e=b.match.apply(this,arguments),t.lastIndex=0,e}else t=new RegExp(t);return _.exec.call(t,g(this))},_.replace=function(e,n){var r,i,a,l=m.isRegExp(e);return l?(e[y]&&(i=e[y].captureNames),r=e.lastIndex):e+="",a=s(n,"Function")?b.replace.call(String(this),e,function(){var r,a=arguments;if(i)for(a[0]=new String(a[0]),r=0;r<i.length;++r)i[r]&&(a[0][i[r]]=a[r+1]);return l&&e.global&&(e.lastIndex=a[a.length-2]+a[0].length),n.apply(t,a)}):b.replace.call(null==this?this:String(this),e,function(){var t=arguments;return b.replace.call(String(n),I,function(e,n,r){var a;if(n){if(a=+n,a<=t.length-3)return t[a]||"";if(a=i?o(i,n):-1,0>a)throw new SyntaxError("Backreference to undefined group "+e);return t[a+1]||""}if("$"===r)return"$";if("&"===r||0===+r)return t[0];if("`"===r)return t[t.length-1].slice(0,t[t.length-2]);if("'"===r)return t[t.length-1].slice(t[t.length-2]+t[0].length);if(r=+r,!isNaN(r)){if(r>t.length-3)throw new SyntaxError("Backreference to undefined group "+e);return t[r]||""}throw new SyntaxError("Invalid token "+e)})}),l&&(e.lastIndex=e.global?0:r),a},_.split=function(e,n){if(!m.isRegExp(e))return b.split.apply(this,arguments);var r,i=String(this),a=[],o=e.lastIndex,s=0;return n=(n===t?-1:n)>>>0,m.forEach(i,e,function(t){t.index+t[0].length>s&&(a.push(i.slice(s,t.index)),t.length>1&&t.index<i.length&&Array.prototype.push.apply(a,t.slice(1)),r=t[0].length,s=t.index+r)}),s===i.length?(!b.test.call(e,"")||r)&&a.push(""):a.push(i.slice(s)),e.lastIndex=o,a.length>n?a.slice(0,n):a},v=m.addToken,v(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(t,e){if("B"===t[1]&&e===S)return t[0];throw new SyntaxError("Invalid escape "+t[0])},{scope:"all"}),v(/\[(\^?)]/,function(t){return t[1]?"[\\s\\S]":"\\b\\B"}),v(/\(\?#[^)]*\)/,function(t,e,n){return l(t.input,t.index+t[0].length,n)?"":"(?:)"}),v(/\s+|#.*/,function(t,e,n){return l(t.input,t.index+t[0].length,n)?"":"(?:)"},{flag:"x"}),v(/\./,function(){return"[\\s\\S]"},{flag:"s"}),v(/\\k<([\w$]+)>/,function(t){var e=isNaN(t[1])?o(this.captureNames,t[1])+1:+t[1],n=t.index+t[0].length;if(!e||e>this.captureNames.length)throw new SyntaxError("Backreference to undefined group "+t[0]);return"\\"+e+(n===t.input.length||isNaN(t.input.charAt(n))?"":"(?:)")}),v(/\\(\d+)/,function(t,e){if(!(e===S&&/^[1-9]/.test(t[1])&&+t[1]<=this.captureNames.length)&&"0"!==t[1])throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+t[0]);return t[0]},{scope:"all"}),v(/\(\?P?<([\w$]+)>/,function(t){if(!isNaN(t[1]))throw new SyntaxError("Cannot use integer as capture name "+t[0]);if("length"===t[1]||"__proto__"===t[1])throw new SyntaxError("Cannot use reserved word as capture name "+t[0]);if(o(this.captureNames,t[1])>-1)throw new SyntaxError("Cannot use same name for multiple groups "+t[0]);return this.captureNames.push(t[1]),this.hasNamedCapture=!0,"("}),v(/\((?!\?)/,function(t,e,n){return n.indexOf("n")>-1?"(?:":(this.captureNames.push(null),"(")},{optionalFlags:"n"}),m}();return function(t){function e(t){var e=/^\^/,n=/\$$/;return e.test(t)&&n.test(t.replace(/\\[\s\S]/g,""))?t.replace(e,"").replace(n,""):t}function n(e){return t.isRegExp(e)?e[r]&&e[r].captureNames?e:t(e.source):t(e)}var r="xregexp",i=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,a=t.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,i],"g");t.build=function(o,s,l){var c,u,h,f,d=/^\(\?([\w$]+)\)/.exec(o),p={},g=0,m=0,v=[0];d&&(l=l||"",d[1].replace(/./g,function(t){l+=l.indexOf(t)>-1?"":t}));for(f in s)s.hasOwnProperty(f)&&(h=n(s[f]),p[f]={pattern:e(h.source),names:h[r].captureNames||[]});return o=n(o),u=o[r].captureNames||[],o=o.source.replace(a,function(t,e,n,r,a){var o,s,l=e||n;if(l){if(!p.hasOwnProperty(l))throw new ReferenceError("Undefined property "+t);return e?(o=u[m],v[++m]=++g,s="(?<"+(o||l)+">"):s="(?:",c=g,s+p[l].pattern.replace(i,function(t,e,n){if(e){if(o=p[l].names[g-c],++g,o)return"(?<"+o+">"}else if(n)return"\\"+(+n+c);return t})+")"}if(r){if(o=u[m],v[++m]=++g,o)return"(?<"+o+">"}else if(a)return"\\"+v[+a];re
bmp:" -\r …  -\u2028\u2029 "}])}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts");t.addUnicodeData([{name:"Arabic",bmp:"؀-؄؆-؋؍-ؚ؞ؠ-ؿف-يٖ-ٟ٪-ٯٱ-ۜ۞-ۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-﯁ﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼ﹰ-ﹴﹶ-ﻼ",astral:"<22>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>]"},{name:"Armenian",bmp:"Ա-Ֆՙ-՟ա-և֊֏ﬓ-ﬗ"},{name:"Avestan",astral:"<22>[<5B>-<2D><>-<2D>]"},{name:"Balinese",bmp:"ᬀ-ᭋ᭐-᭼"},{name:"Bamum",bmp:"ꚠ-꛷",astral:"<22>[<5B>-<2D>]"},{name:"Batak",bmp:"ᯀ-᯳᯼-᯿"},{name:"Bengali",bmp:"ঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-৻"},{name:"Bopomofo",bmp:"˪˫ㄅ-ㄭㆠ-ㆺ"},{name:"Brahmi",astral:"<22>[<5B>-<2D><>-<2D>]"},{name:"Braille",bmp:"-⣿"},{name:"Buginese",bmp:"ᨀ-ᨛ᨞᨟"},{name:"Buhid",bmp:"ᝀ-ᝓ"},{name:"Canadian_Aboriginal",bmp:"-ᙿᢰ-ᣵ"},{name:"Carian",astral:"<22>[<5B>-<2D>]"},{name:"Chakma",astral:"<22>[<5B>-<2D><>-<2D>]"},{name:"Cham",bmp:"ꨀ-ꨶꩀ-ꩍ꩐-꩙꩜-꩟"},{name:"Cherokee",bmp:"-"},{name:"Common",bmp:"\x00-@\\x5B-`\\x7B-©«-¹»-¿×÷ʹ-˟˥-˩ˬ-˿ʹ;΅·։،؛؟ـ٠-٩۝।॥฿࿕-࿘჻᛫-᛭᜵᜶᠂᠃᠅᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶ ---⁰⁴-⁾₀-₎₠-₺℀-℥℧-℩ℬ--⅍⅏-⅟↉←-⏳␀-␦⑀-⑊①-⛿✁-⟿⤀-⭌⭐-⭙⸀-⸻⿰-⿻ -〄〆〈-〠〰-〷〼-〿゛゜゠・ー㆐-㆟㇀-㇣㈠-㉟㉿-㋏㍘-㏿䷀-䷿꜀-꜡ꞈ-꞊꠰-꠹﴾﴿﷽︐-︙︰-﹒﹔-﹦﹨-﹫\ufeff---・ー゙゚¢-₩│-○-<2D>",astral:"<22>[<5B>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B><>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]"},{name:"Coptic",bmp:"Ϣ-ϯⲀ-ⳳ⳹-⳿"},{name:"Cuneiform",astral:"<22>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Cypriot",astral:"<22>[<5B>-<2D><><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>]"},{name:"Cyrillic",bmp:"Ѐ-҄҇-ԧᴫᵸⷠ-ⷿꙀ-ꚗꚟ"},{name:"Deseret",astral:"<22>[<5B>-<2D>]"},{name:"Devanagari",bmp:"ऀ-ॐ॓-ॣ०-ॷॹ-ॿ꣠-ꣻ"},{name:"Egyptian_Hieroglyphs",astral:"<22>[<5B>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Ethiopic",bmp:"-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፼ᎀ-᎙ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮ"},{name:"Georgian",bmp:"Ⴀ-ჅჇჍა-ჺჼ-ჿⴀ-ⴥⴧⴭ"},{name:"Glagolitic",bmp:"Ⰰ-Ⱞⰰ-ⱞ"},{name:"Gothic",astral:"<22>[<5B>-<2D>]"},{name:"Greek",bmp:"Ͱ-ͳ͵-ͷͺ-ͽ΄ΆΈ-ΊΌΎ-ΡΣ-ϡϰ-Ͽᴦ-ᴪᵝ-ᵡᵦ-ᵪᶿἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ῄῆ-ΐῖ-Ί῝-`ῲ-ῴῶ-῾Ω",astral:"<22>[<5B>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Gujarati",bmp:"ઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૱"},{name:"Gurmukhi",bmp:"ਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵ"},{name:"Han",bmp:"⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〻㐀-䶵一-鿌豈-舘並-龎",astral:"[<5B>-<2D><>-<2D>][<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Hangul",bmp:"ᄀ-ᇿ〮〯ㄱ-ㆎ㈀-㈞㉠-㉾ꥠ-ꥼ가-힣ힰ-ퟆퟋ-ퟻᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"},{name:"Hanunoo",bmp:"ᜠ-᜴"},{name:"Hebrew",bmp:"֑-ׇא-תװ-״יִ-זּטּ-לּמּנּסּףּפּצּ-ﭏ"},{name:"Hiragana",bmp:"ぁ-ゖゝ-ゟ",astral:"𛀁|🈀"},{name:"Imperial_Aramaic",astral:"<22>[<5B>-<2D><>-<2D>]"},{name:"Inherited",bmp:"̀-ًͯ҅҆-ٰٕ--<EFBFBD>
}var d=window,p=["break,continue,do,else,for,if,return,while"],g=[p,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[g,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[m,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],y=[m,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],x=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],b="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",_=[m,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],w="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",C=[p,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],E=[p,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],S=[p,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],k=[p,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[v,x,_,w,C,E,k],I=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,N="str",R="kwd",M="com",A="typ",D="lit",O="pun",L="pln",B="tag",F="dec",P="src",$="atn",j="atv",H="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",U=/\S/,q=a({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),W={};l(q,["default-code"]),l(i([],[[L,/^[^<?]+/],[F,/^<!\w[^>]*(?:>|$)/],[M,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[O,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(i([[L,/^[\s]+/,null," \r\n"],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[B,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[$,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[O,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),l(i([],[[j,/^[\s\S]+/]]),["uq.val"]),l(a({keywords:v,hashComments:!0,cStyleComments:!0,types:I}),["c","cc","cpp","cxx","cyc","m"]),l(a({keywords:"null,true,false"}),["json"]),l(a({keywords:x,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:I}),["cs"]),l(a({keywords:y,cStyleComments:!0}),["java"]),l(a({keywords:k,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(a({keywords:C,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(a({keywords:w,hashComments:!0,
""):t})),r=r.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(t,e){return e?(n+=t.replace(/^\s*\n/gm,"")+"\n",""):t}),e.push({id:t.id,text:r+"\n"})}),y=[],v=[],c=void 0,x===!0||l!=n)return x=!1,l=n,v=m,m=e,void(y=e);var r=m.length;t.some(m,function(t,n){return n>=e.length||t.text!=e[n].text?(r=n,!0):void 0});var i=-m.length;t.some(m.slice().reverse(),function(t,n){return n>=e.length||t.text!=e[e.length-n-1].text?(i=-n,!0):void 0}),r-i>m.length&&(i=r-m.length);var a=m.slice(0,r);y=e.slice(r,e.length+i);var o=m.slice(m.length+i,m.length);c=t.first(o),v=m.slice(r,m.length+i),m=a.concat(y).concat(o)}function a(t){var e=t.id.substring(3),n=b[e];n&&_.removeChild(n),b[e]=t,_.appendChild(t)}function o(){function n(n){for(var r=e("div",{id:"wmd-preview-section-"+n.id,"class":"wmd-preview-section preview-content"}),o=!1;i;){var s=i.nextSibling,l="se-preview-section-delimiter"==i.className;if(o===!0&&"DIV"==i.tagName&&l)break;o=!0,"DIV"==i.tagName&&"footnotes"==i.className?t.each(i.querySelectorAll("ol > li"),a):l||r.appendChild(i),i=s}return r}t.each(v,function(t){var e=document.getElementById("wmd-preview-section-"+t.id);h.removeChild(e)});var r=document.getElementById("wmd-preview"),i=r.firstChild,o=document.createDocumentFragment();t.each(y,function(t){o.appendChild(n(t))}),r.innerHTML="";var s=u;void 0!==c&&(s=document.getElementById("wmd-preview-section-"+c.id)),h.insertBefore(o,s),u.innerHTML="";var l=[];if(p===!0){var f=e("ol");t.each(h.querySelectorAll("a.footnote"),function(t,e){t.textContent=e+1;var n=t.id.substring(6);l.push(n);var r=b[n];r&&f.appendChild(r.cloneNode(!0))}),l.length>0&&u.appendChild(e("div",{"class":"footnotes"},e("hr"),f)),Object.keys(b).forEach(function(t){-1===l.indexOf(t)&&(_.removeChild(b[t]),delete b[t])})}}var s,l,c,u,h,f=new r("partialRendering","Partial Rendering",!0),d=!1,p=!1,g=[],m=[],v=[],y=[],x=!1,b={},_=document.createDocumentFragment();return f.onSectionsCreated=function(t){g=t},f.onPagedownConfigure=function(e){s=e.getConverter(),s.hooks.chain("preConversion",function(){i();var e=t.map(y,function(t){return t.text});return e.push(l+"\n\n"),e.join("")}),e.hooks.chain("onPreviewRefresh",function(){o()})},f.onInit=function(){n.enabled&&t.some(n.config.extensions,function(t){return"footnotes"==t})&&(d=!0)},f.onReady=function(){u=e("div",{id:"wmd-preview-section-footnotes","class":"preview-content"}),h=document.getElementById("preview-contents"),h.appendChild(u)},f.onFileSelected=function(){x=!0},f}),define("extensions/markdownSectionParser",["underscore","extensions/markdownExtra","extensions/mathJax","extensions/partialRendering","classes/Extension","crel"],function(t,e,n,r,i,a){function o(t,e){function n(t,e){var n=a.substring(o,e);u.push({id:++d,text:n,textWithFrontMatter:r+n}),r=""}if(t===f){var r=(f.frontMatter||{})._frontMatter||"",i=e.substring(r.length),a=i+"\n\n";u=[];var o=0;a.replace(h,function(t,e){n(o,e),o=e}),n(o,i.length),s.onSectionsCreated(u)}}var s,l=new i("markdownSectionParser","Markdown section parser");l.onEventMgrCreated=function(t){s=t};var c,u=[],h="^.+[ \\t]*\\n=+[ \\t]*\\n+|^.+[ \\t]*\\n-+[ \\t]*\\n+|^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*\\n+";l.onPagedownConfigure=function(i){e.enabled&&t.some(e.config.extensions,function(t){return"fenced_code_gfm"==t})&&(h="^```[^`\\n]*\\n[\\s\\S]*?\\n```|"+h),n.enabled&&(h="^[ \\t]*\\n\\$\\$[\\s\\S]*?\\$\\$|"+h,h="^[ \\t]*\\n\\\\\\\\[[\\s\\S]*?\\\\\\\\]|"+h,h="^[ \\t]*\\n\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|"+h),h=new RegExp(h,"gm");var o=i.getConverter();r.enabled||(o.hooks.chain("preConversion",function(){return t.reduce(u,function(t,e){return t+'\n<div class="se-preview-section-delimiter"></div>\n\n'+e.text+"\n\n"},"")}),i.hooks.chain("onPreviewRefresh",function(){function t(){for(var t=a("div",{"class":"wmd-preview-section preview-content"}),e=!1;n;){var r=n.nextSibling,i="se-preview-section-delimiter"==n.className;if(e===!0&&"DIV"==n.tagName&&i)break;e=!0,i||t.appendChild(n),n=r}return t}var e=document.getEleme
y:H[N](0,p)},max:{x:j[N](0,g),y:j[N](0,p)}}}),Bt=n._path2curve=a(function(t,e){var n=!e&&kt(t);if(!e&&n.curve)return It(n.curve);for(var r=Rt(t),i=e&&Rt(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=(function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][R](Dt[N](0,[e.x,e.y][R](t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i][R](t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][R](At(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][R](At(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][R](Mt(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][R](Mt(e.x,e.y,t[1],e.y));break;case"V":t=["C"][R](Mt(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][R](Mt(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)t.splice(e++,0,["C"][R](n.splice(0,6)));t.splice(e,1),h=j(r.length,i&&i.length||0)}},c=function(t,e,n,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=t[o][1],n.y=t[o][2],h=j(r.length,i&&i.length||0))},u=0,h=j(r.length,i&&i.length||0);h>u;u++){r[u]=s(r[u],a),l(r,u),i&&(i[u]=s(i[u],o)),i&&l(i,u),c(r,i,a,o,u),c(i,r,o,a,u);var f=r[u],d=i&&i[u],p=f.length,g=i&&d.length;a.x=f[p-2],a.y=f[p-1],a.bx=Z(f[p-4])||a.x,a.by=Z(f[p-3])||a.y,o.bx=i&&(Z(d[g-4])||o.x),o.by=i&&(Z(d[g-3])||o.y),o.x=i&&d[g-2],o.y=i&&d[g-1]}return i||(n.curve=It(r)),i?[r,i]:r},null,It),Ft=(n._parseDots=a(function(t){for(var e=[],r=0,i=t.length;i>r;r++){var a={},o=t[r].match(/^([^:]*):?([\d\.]*)/);if(a.color=n.getRGB(o[1]),a.color.error)return null;a.color=a.color.hex,o[2]&&(a.offset=o[2]+"%"),e.push(a)}for(r=1,i=e.length-1;i>r;r++)if(!e[r].offset){for(var s=Z(e[r-1].offset||0),l=0,c=r+1;i>c;c++)if(e[c].offset){l=e[c].offset;break}l||(l=100,c=i),l=Z(l);for(var u=(l-s)/(c-r+1);c>r;r++)s+=u,e[r].offset=s+"%"}return e}),n._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),Pt=(n._tofront=function(t,e){e.top!==t&&(Ft(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},n._toback=function(t,e){e.bottom!==t&&(Ft(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Ft(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Ft(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Tt(t),r={_:{transform:A},getBBox:function(){return n}};return $t(r,e),r.matrix}),$t=(n.transformPath=function(t,e){return vt(t,Pt(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||A);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,x=r[h],b=x.length,_=O(x[0]).toLowerCase(),w=x[0]!=_,C=w?u.invert():0;"t"==_&&3==b?w?(d=C.x(0,0),g=C.y(0,0),m=C.x(x[1],x[2]),v=C.y(x[1],x[2]),u.translate(m-d,v-g)):u.translate(x[1],x[2]):"r"==_?2==b?(y=y||t.getBBox(1),u.rotate(x[1],y.x+y.width/2,y.y+y.height/2),i+=x[1]):4==b&&(w?(m=C.x(x[2],x[3]),v=C.y(x[2],x[3]),u.rotate(x[1],m,v)):u.rotate(x[1],x[2],x[3]),i+=x[1]):"s"==_?2==b||3==b?(y=y||t.getBBox(1),u.scale(x[1],x[b-1],y.x+y.width/2,y.y+y.height/2),s*=x[1],l*=x[b-1]):5==b&&(w?(m=C.x(x[3],x[4]),v=C.y(x[3],x[4]),u.scale(x[1],x[2],m,v)):u.scale(x[1],x[2],x[3],x[4]),s*=x[1],l*=x[2]):"m"==_&&7==b&&u.add(x[1],x[2],x[3],x[4],x[5],x[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),jt=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},Ht=n._equaliseTransform=function(t,e){
m(t.node,{"stroke-dasharray":o.join(",")})}},w=function(r,a){var l=r.node,u=r.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var p in a)if(a[t](p)){if(!n._availableAttrs[t](p))continue;var g=a[p];switch(u[p]=g,p){case"blur":r.blur(g);break;case"href":case"title":var b=m("title"),w=n._g.doc.createTextNode(g);b.appendChild(w),l.appendChild(b);break;case"target":var C=l.parentNode;if("a"!=C.tagName.toLowerCase()){var b=m("a");C.insertBefore(b,l),b.appendChild(l),C=b}"target"==p?C.setAttributeNS(d,"show","blank"==g?"new":g):C.setAttributeNS(d,p,g);break;case"cursor":l.style.cursor=g;break;case"transform":r.transform(g);break;case"arrow-start":x(r,g);break;case"arrow-end":x(r,g,1);break;case"clip-rect":var S=e(g).split(c);if(4==S.length){r.clip&&r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);var k=m("clipPath"),T=m("rect");k.id=n.createUUID(),m(T,{x:S[0],y:S[1],width:S[2],height:S[3]}),k.appendChild(T),r.paper.defs.appendChild(k),m(l,{"clip-path":"url(#"+k.id+")"}),r.clip=T}if(!g){var I=l.getAttribute("clip-path");if(I){var N=n._g.doc.getElementById(I.replace(/(^url\(#|\)$)/g,h));N&&N.parentNode.removeChild(N),m(l,{"clip-path":h}),delete r.clip}}break;case"path":"path"==r.type&&(m(l,{d:g?u.path=n._pathToAbsolute(g):"M0,0"}),r._.dirty=1,r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1)));break;case"width":if(l.setAttribute(p,g),r._.dirty=1,!u.fx)break;p="x",g=u.x;case"x":u.fx&&(g=-u.x-(u.width||0));case"rx":if("rx"==p&&"rect"==r.type)break;case"cx":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"height":if(l.setAttribute(p,g),r._.dirty=1,!u.fy)break;p="y",g=u.y;case"y":u.fy&&(g=-u.y-(u.height||0));case"ry":if("ry"==p&&"rect"==r.type)break;case"cy":l.setAttribute(p,g),r.pattern&&y(r),r._.dirty=1;break;case"r":"rect"==r.type?m(l,{rx:g,ry:g}):l.setAttribute(p,g),r._.dirty=1;break;case"src":"image"==r.type&&l.setAttributeNS(d,"href",g);break;case"stroke-width":(1!=r._.sx||1!=r._.sy)&&(g/=o(s(r._.sx),s(r._.sy))||1),r.paper._vbSize&&(g*=r.paper._vbSize),l.setAttribute(p,g),u["stroke-dasharray"]&&_(r,u["stroke-dasharray"],a),r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"stroke-dasharray":_(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var M=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(M,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(M),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(M,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var A=n.getRGB(g);if(A.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var D=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(D){var O=D.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});A[t]("opacity")&&m(l,{"fill-opacity":A.opacity>1?A.opacity/100:A.opacity});case"stroke":A=n.getRGB(g),l.setAttribute(p,A.hex),"stroke"==p&&A[t]("opacity")&&m(l,{"stroke-opacity":A.opacity>1?A.opacity/100:A.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){D=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),D&&(O=D.getElementsByTagName("stop")
LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(e,n,r,i,a,o){var s=o.length-1;switch(a){case 1:return i;case 4:break;case 6:o[s];break;case 7:i.addSignal(o[s]);break;case 8:i.addSignal(o[s]);break;case 9:i.setTitle(o[s]);break;case 10:this.$=new t.Note(o[s-1],o[s-2],o[s]);break;case 11:this.$=new t.Note(o[s-1],t.PLACEMENT.OVER,o[s]);break;case 12:this.$=o[s];break;case 13:this.$=[o[s-2],o[s]];break;case 14:this.$=t.PLACEMENT.LEFTOF;break;case 15:this.$=t.PLACEMENT.RIGHTOF;break;case 16:this.$=new t.Signal(o[s-3],o[s-2],o[s-1],o[s]);break;case 17:this.$=i.getActor(o[s]);break;case 18:this.$=o[s-1]|o[s]<<2;break;case 19:this.$=o[s];break;case 20:this.$=t.LINETYPE.SOLID;break;case 21:this.$=t.LINETYPE.DOTTED;break;case 22:this.$=t.ARROWTYPE.FILLED;break;case 23:this.$=t.ARROWTYPE.OPEN;break;case 24:this.$=o[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,x,b,_,w,C,E={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var S="";C=[];for(b in o[v])this.terminals_[b]&&b>h&&C.push("'"+this.terminals_[b]+"'");S=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:C})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexe
return{x:e,y:t}},o.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX();return{x:e,y:t}},o.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width;return{x:e,y:t}},o.prototype.render=function(){if(this.next){var t=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();if(this.next.getLeft(),!this.next.isPositioned){this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+t);var n=this;!function i(){for(var e,r=!1,a=0,o=n.chart.symbols.length;o>a;a++){e=n.chart.symbols[a];var s=Math.abs(e.getCenter().x-n.next.getCenter().x);if(e.getCenter().y>n.next.getCenter().y&&s<=n.next.width/2){r=!0;break}}r&&(n.next.setX(e.getX()+e.width+t),i())}(),this.next.isPositioned=!0,this.next.render()}}else{var r=this.getBottom();this.next.getTop(),this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+t),this.next.setX(r.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},o.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,"",this.next_direction):this.drawLineTo(this.next))},o.prototype.drawLineTo=function(t,e,n){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var a,o=this.getCenter().x,s=this.getCenter().y,l=(this.getTop(),this.getRight()),c=this.getBottom(),u=this.getLeft(),h=t.getCenter().x,f=t.getCenter().y,d=t.getTop(),p=t.getRight(),g=(t.getBottom(),t.getLeft()),m=o===h,v=s===f,y=f>s,x=s>f,b=o>h,_=h>o,w=0,C=this.getAttr("line-length"),E=this.getAttr("line-width");if(n&&"bottom"!==n||!m||!y)if(n&&"right"!==n||!v||!_)if(n&&"left"!==n||!v||!b)if(n&&"right"!==n||!m||!x)if(n&&"right"!==n||!m||!y)if(n&&"bottom"!==n||!b)if(n&&"bottom"!==n||!_)if(n&&"right"===n&&b)a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,w=l.x+C/2;else if(n&&"right"===n&&_)a=r(this.chart,l,[{x:d.x,y:l.y},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,w=l.x+C/2;else if(n&&"bottom"===n&&m&&x)a=r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:l.x+C/2,y:c.y+C/2},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,w=c.x+C/2;else if("left"===n&&m&&x){var S=u.x-C/2;g.x<u.x&&(S=g.x-C/2),a=r(this.chart,u,[{x:S,y:u.y},{x:S,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.leftStart=!0,t.topEnd=!0,w=u.x}else"left"===n&&(a=r(this.chart,u,[{x:d.x+(u.x-d.x)/2,y:u.y},{x:d.x+(u.x-d.x)/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.leftStart=!0,t.topEnd=!0,w=u.x);else a=r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,w=c.x+(c.x-d.x)/2;else a=this.leftEnd&&x?r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,w=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,w=l.x+C/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,w=l.x+C/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,w=p.x;else a=r(this.chart,l,g,e),this.rightStart=!0,t.leftEnd=!0,w=g.x;else a=r(this.chart,c,d,e),this.bottomStart=!0,t.topEnd=!0,w=c.x;if(a){for(var k=0,T=this.chart.lines.length;T>k;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),M=a.attr("path"),A=0,D=R.length-1;D>A;A++){var O=[];O.push(["M",R[A][1],R[A][2]]),O.push(["L",R[A+1][1],R[A+1][2]]);for(var L=O[0][1],B=O[0][2],F=O[1][1],P=O[1][2],$=0,j=M.length-1;j>$;$++){var H=[];H.push(["M",M[$][1],M[$][2]]),H.push(["L",M[$+1][1],M[$+1][2]]);var z=H[0][1],U=H[0][2],q=H[1][1],W=H[1][2],V=i(L,B,F,P,z,U,q,W);if(V.onLine1&&V.onLine2){var G;U===W?z>q?(G=["L",V.x+2*E,U],M.splice($+1,0,G),G=["C",V.x+2*E,U,V.x,U-4*E,V.x-2*E,U],M.splice($+2,0,G),a.at
t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o<a.length;){switch(a[o][0]){case DIFF_INSERT:l++,u+=a[o][1];break;case DIFF_DELETE:s++,c+=a[o][1];break;case DIFF_EQUAL:if(s>=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),o=a,s=2*a,l=new Array(s),c=new Array(s),u=0;s>u;u++)l[u]=-1,c[u]=-1;l[o+1]=0,c[o+1]=0;for(var h=r-i,f=h%2!=0,d=0,p=0,g=0,m=0,v=0;a>v&&!((new Date).getTime()>n);v++){for(var y=-v+d;v-p>=y;y+=2){var x,b=o+y;x=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1;for(var _=x-y;r>x&&i>_&&t.charAt(x)==e.charAt(_);)x++,_++;if(l[b]=x,x>r)p+=2;else if(_>i)d+=2;else if(f){var w=o+h-y;if(w>=0&&s>w&&-1!=c[w]){var C=r-c[w];if(x>=C)return this.diff_bisectSplit_(t,e,x,_,n)}}}for(var E=-v+g;v-m>=E;E+=2){var C,w=o+E;C=E==-v||E!=v&&c[w-1]<c[w+1]?c[w+1]:c[w-1]+1;for(var S=C-E;r>C&&i>S&&t.charAt(r-C-1)==e.charAt(i-S-1);)C++,S++;if(c[w]=C,C>r)m+=2;else if(S>i)g+=2;else if(!f){var b=o+h-E;if(b>=0&&s>b&&-1!=l[b]){var x=l[b],_=o+x-b;if(C=r-C,x>=C)return this.diff_bisectSplit_(t,e,x,_,n)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,e]]},diff_match_patch.prototype.diff_bisectSplit_=function(t,e,n,r,i){var a=t.substring(0,n),o=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=this.diff_main(a,o,!1,i),u=this.diff_main(s,l,!1,i);return c.concat(u)},diff_match_patch.prototype.diff_linesToChars_=function(t,e){function n(t){for(var e="",n=0,a=-1,o=r.length;a<t.length-1;){a=t.indexOf("\n",n),-1==a&&(a=t.length-1);var s=t.substring(n,a+1);n=a+1,(i.hasOwnProperty?i.hasOwnProperty(s):void 0!==i[s])?e+=String.fromCharCode(i[s]):(e+=String.fromCharCode(o),i[s]=o,r[o++]=s)}return e}var r=[],i={};r[0]="";var a=n(t),o=n(e);return{chars1:a,chars2:o,lineArray:r}},diff_match_patch.prototype.diff_charsToLines_=function(t,e){for(var n=0;n<t.length;n++){for(var r=t[n][1],i=[],a=0;a<r.length;a++)i[a]=e[r.charCodeAt(a)];t[n][1]=i.join("")}},diff_match_patch.prototype.diff_commonPrefix=function(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;i>n;)t.substring(a,i)==e.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},diff_match_patch.prototype.diff_commonSuffix=function(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,a=0;i>n;)t.substring(t.length-i,t.length-a)==e.substring(e.length-i,e.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},diff_match_patch.prototype.diff_commonOverlap_=function(t,e){var n=t.length,r=e.length;if(0==n||0==r)return 0;n>r?t=t.substring(n-r):r>n&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;for(var a=0,o=1;;){var s=t.substring(i-o),l=e.indexOf(s);if(-1==l)return a;o+=l,(0==l||t.substring(i-o)==e.substring(0,o))&&(a=o,o++)}},diff_match_patch.prototype.diff_halfMatch_=function(t,e){function n(t,e,n){for(var r,i,a,s,l=t.substring(n,n+Math.floor(t.length/4)),c=-1,u="";-1!=(c=e.indexOf(l,c+1));){var h=o.diff_commonPrefix(t.substring(n),e.substring(c)),f=o.diff_commonSuffix(t.substring(0,n),e.substring(0,c));u.length<f+h&&(u=e.substring(c-f,c)+e.substring(c,c+h),r=t.substring(0,n-f),i=t.substring(n+h),a=e.substring(0,c-f),s=e.substring(c+h))}return 2*u.length>=t.length?[r,i,a,s,u]:null}if(this.Diff_Timeout<=0)return null;var r=t.length>e.length?t:e,i=t.length>e.length?e:t;if(r.length<4||2*i.length<r.lengt
try{var t=this.getCoordinates(this.selectionEnd,this.selectionEndContainer,this.selectionEndOffset)}catch(e){return void console.error(e)}if(this.cursorY!==t.y&&(this.cursorY=t.y,r.onCursorCoordinates(t.x,t.y)),l){var i,a;if(i=a=S.offsetHeight/2*n.cursorFocusRatio,i=this.adjustTop||i,a=this.adjustBottom||i,i&&a){var o=S.scrollTop+i,s=S.scrollTop+S.offsetHeight-a;U.cursorY<o?S.scrollTop+=U.cursorY-o:U.cursorY>s&&(S.scrollTop+=U.cursorY-s)}}l=!1},this);this.updateCursorCoordinates=function(t){l=l||t,c()},this.updateSelectionRange=function(){var t=Math.min(this.selectionStart,this.selectionEnd),e=Math.max(this.selectionStart,this.selectionEnd),n=this.createRange(t,e),r=s.getSelection();r.removeAllRanges(),r.addRange(n,this.selectionStart>this.selectionEnd)};var u=t.debounce(function(){a=i.selectionStart,o=i.selectionEnd},50);this.setSelectionStartEnd=function(t,e){void 0===t&&(t=this.selectionStart),0>t&&(t=0),void 0===e&&(e=this.selectionEnd),0>e&&(e=0),this.selectionStart=t,this.selectionEnd=e,P.editorStart=t,P.editorEnd=e,u()},this.saveSelectionState=function(){function t(){if(j===!1){var t=i.selectionStart,e=i.selectionEnd,n=s.getSelection();if(n.rangeCount>0){var r=n.getRangeAt(0),a=r.startContainer;if(T.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY||T===a){var o=r.startOffset;a.hasChildNodes()&&o>0&&(a=a.childNodes[o-1],o=a.textContent.length);for(var l=a;a!=T;){for(;a=a.previousSibling;)a.textContent&&(o+=a.textContent.length);a=l=l.parentNode}n.isBackwards()?(t=o+r.toString().length,e=o):(t=o,e=o+r.toString().length),t===e&&"\n"==r.startContainer.textContent&&1==r.startOffset&&(t=--e,i.setSelectionStartEnd(t,e),i.updateSelectionRange())}}i.setSelectionStartEnd(t,e)}V.saveSelectionState()}var n=!1,r=e.debounce(function(){t(),i.updateCursorCoordinates(n),l()}),l=e.debounce(function(){t(),a===i.selectionStart&&o===i.selectionEnd&&(n=!1),i.updateCursorCoordinates(n),n=!1},10);return function(e,i,s){return s&&(a=void 0,o=void 0),e?(n=n||i,r()):void t()}}(),this.getSelectedText=function(){var t=Math.min(this.selectionStart,this.selectionEnd),e=Math.max(this.selectionStart,this.selectionEnd);return q.substring(t,e)},this.getCoordinates=function(t,e,n){if(!e){var r=this.findOffsets([t])[0];e=r.container,n=r.offsetInContainer}var i=0,a=0;if("\n"==e.textContent)a=e.parentNode.offsetTop+e.parentNode.offsetHeight/2;else{var o=q[t],s={container:e,offsetInContainer:n,offset:t},l={container:e,offsetInContainer:n,offset:t};t>0&&(void 0===o||"\n"==o)?0===s.offset?s=t-1:s.offsetInContainer-=1:l.offset===e.textContent.length?l=t+1:l.offsetInContainer+=1;var c=this.createRange(s,l),u=c.getBoundingClientRect();a=u.top+u.height/2-S.getBoundingClientRect().top+S.scrollTop}return{x:i,y:a}},this.getClosestWordOffset=function(t){var e=0,n=0,r=0;return q.split(/\s/).some(function(i){return i&&(e=r,n=r+i.length,n>t)?!0:void(r+=i.length+1)}),{start:e,end:n}}}function u(t){void 0!==S&&U.saveSelectionState(!0,!0,t)}function h(t){var e=z.diff_commonPrefix(q,t);e===q.length&&e--;var n=Math.min(z.diff_commonSuffix(q,t),q.length-e,t.length-e),r=t.substring(e,t.length-n),i=U.createRange(e,q.length-n);return i.deleteContents(),i.insertNode(document.createTextNode(r)),{start:e,end:t.length-n}}function f(t,e,n){V.currentMode=V.currentMode||"replace";var r=U.createRange(Math.min(t,e),Math.max(t,e));""+r!=n&&(r.deleteContents(),r.insertNode(document.createTextNode(n)));var i=t+n.length;U.setSelectionStartEnd(i,i),U.updateSelectionRange(),U.updateCursorCoordinates(!0)}function d(t,e){V.currentMode=V.currentMode||"replace";var n=q.replace(t,e);if(n!=q){var r=O.setValue(n);U.setSelectionStartEnd(r.end,r.end),U.updateSelectionRange(),U.updateCursorCoordinates(!0)}}function p(t,e){var n=U.selectionStart;if(n!==U.selectionEnd)return!1;var r=U.createRange(n-t.length,n);return""+r!=t?!1:(r.deleteContents(),r.insertNode(document.createTextNode(e)),n=n-t.length+e.length,U.setSelectionStartEnd(n,n),U.updateSelectionRange(),U.updateCursorCoordinates(!0),!0)}function g(t){h(t),q=t}function m(){return q}function v(){I.focus(),U.updateSelectionRange(),S
t.selection=t.selection||this.getString("quoteexample");var e,n="",r="";if(t.before){for(var i=t.before.replace(/\n$/,"").split("\n"),a=!1,o=0;o<i.length;o++){var s=!1;e=i[o],a=a&&e.length>0,/^>/.test(e)?(s=!0,!a&&e.length>1&&(a=!0)):s=/^[ \t]*$/.test(e)?!0:a,s?n+=e+"\n":(r+=n+e,n="\n")}/(^|\n)>/.test(n)||(r+=n,n="")}t.startTag=n,t.before=r,t.after&&(t.after=t.after.replace(/^\n?/,"\n")),t.after=t.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(e){return t.endTag=e,""});var l=function(e){var n=e?"> ":"";t.startTag&&(t.startTag=t.startTag.replace(/\n((>|\s)*)\n$/,function(t,e){return"\n"+e.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),t.endTag&&(t.endTag=t.endTag.replace(/^\n((>|\s)*)\n/,function(t,e){return"\n"+e.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(t.selection)?(this.wrap(t,p.lineLength-2),t.selection=t.selection.replace(/^/gm,"> "),l(!0),t.skipLines()):(t.selection=t.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(t),l(!1),!/^(\n|^)[ ]{0,3}>/.test(t.selection)&&t.startTag&&(t.startTag=t.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(t.selection)&&t.endTag&&(t.endTag=t.endTag.replace(/^\n{0,2}/,"\n\n"))),t.selection=this.hooks.postBlockquoteCreation(t.selection),/\n/.test(t.selection)||(t.selection=t.selection.replace(/^(> *)/,function(e,n){return t.startTag+=n,""}))},x.doCode=function(t){var e=/\S[ ]*$/.test(t.before),n=/^[ ]*\S/.test(t.after);if(!n&&!e||/\n/.test(t.selection)){t.before=t.before.replace(/[ ]{4}$/,function(e){return t.selection=e+t.selection,""});var r=1,i=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(t.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(t.after)&&(i=0),t.skipLines(r,i),t.selection?/^[ ]{0,3}\S/m.test(t.selection)?/\n/.test(t.selection)?t.selection=t.selection.replace(/^/gm," "):t.before+=" ":t.selection=t.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(t.startTag=" ",t.selection=this.getString("codeexample"))}else t.trimWhitespace(),t.findTags(/`/,/`/),t.startTag||t.endTag?t.endTag&&!t.startTag?(t.before+=t.endTag,t.endTag=""):t.startTag=t.endTag="":(t.startTag=t.endTag="`",t.selection||(t.selection=this.getString("codeexample")))},x.doList=function(t,e,n){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,i=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,a="-",o=1,s=function(){var t;return n?(t=" "+o+". ",o++):t=" "+a+" ",t},l=function(t){return void 0===n&&(n=/^\s*\d/.test(t)),t=t.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(t.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!t.before||/\n$/.test(t.before)||/^\n/.test(t.startTag)||(t.before+=t.startTag,t.startTag=""),t.startTag){var c=/\d+[.]/.test(t.startTag);if(t.startTag="",t.selection=t.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(t),t.skipLines(),c&&(t.after=t.after.replace(i,l)),n==c)return}var u=1;t.before=t.before.replace(r,function(t){return/^\s*([*+-])/.test(t)&&(a=f.$1),u=/[^\n]\n\n[^\n]/.test(t)?1:0,l(t)}),t.selection||(t.selection=this.getString("litem"));var h=s(),d=1;t.after=t.after.replace(i,function(t){return d=/[^\n]\n\n[^\n]/.test(t)?1:0,l(t)}),t.trimWhitespace(!0),t.skipLines(u,d,!0),t.startTag=h;var g=h.replace(/./g," ");this.wrap(t,p.lineLength-g.length),t.selection=t.selection.replace(/\n/g,"\n"+g)},x.doHeading=function(t){if(t.selection=t.selection.replace(/\s+/g," "),t.selection=t.selection.replace(/(^\s+|\s+$)/g,""),!t.selection)return t.before&&"\n"!=t.before[t.before.length-1]&&t.skipLines(1,1),t.startTag="# ",t.selection=this.getString("headingexample"),void(t.endTag="");t.findTags(/#+[ ]*/,/[ ]*#+/),t.before&&"\n"!=t.before[t.before.length-1]&&t.skipLines(1,1);var e=0,n=t.startTag;/^#+[ ]*$/.test(n)&&(n=n.replace(/ /g,""),e=n.length);var r=0;if(e>=0&&3>=e&&(r=e+1),e>=4&&(r=0,t.startTag=""),r>0){for(var i="";r--;)i+="#";i+=" ",t.startTag=i}},x.doHorizontalRule=function(t){t.startTag="----------\n",t.selection="",t.skipLines(1,1,!0)}}(),define("pagedown",function(){}),define("core",["underscore","crel","editor","utils","sett