require=function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=t.p+t.d.length){append(e,{d:n.d,p:n.p-t.d.length})}else if(n.p+n.d.length<=t.p){append(e,n)}else{var i={d:"",p:n.p};n.pt.p+t.d.length&&(i.d+=n.d.slice(t.p+t.d.length-n.p));var o=Math.max(n.p,t.p),l=Math.min(n.p+n.d.length,t.p+t.d.length);if(n.d.slice(o-n.p,l-n.p)!==t.d.slice(o-t.p,l-t.p)){throw new Error("Delete ops delete different text in the same region of the document")}""!==i.d&&(i.p=transformPosition(i.p,t),append(e,i))}return e},invertComponent=function(e){return null!=e.i?{d:e.i,p:e.p}:{i:e.d,p:e.p}};text.invert=function(e){e=e.slice().reverse();for(var n=0;n=i||t!==n.p[l]){return null}}return e},json.canOpAffectPath=function(o,n){return null!=json.commonLengthForOps({p:n},o)},json.transformComponent=function(o,n,e,i){n=clone(n);var l=json.commonLengthForOps(e,n),t=json.commonLengthForOps(n,e),r=n.p.length,s=e.p.length;if((null!=n.na||n.t)&&r++,(null!=e.na||e.t)&&s++,null!=t&&s>r&&n.p[t]==e.p[t]){if(void 0!==n.ld){(d=clone(e)).p=d.p.slice(r),n.ld=json.apply(clone(n.ld),[d])}else if(void 0!==n.od){(d=clone(e)).p=d.p.slice(r),n.od=json.apply(clone(n.od),[d])}}if(null!=l){var p=r==s,d=e;if(null==n.si&&null==n.sd||null==e.si&&null==e.sd||(convertFromText(n),convertFromText(d=clone(e))),d.t&&subtypes[d.t]){if(n.t&&n.t===d.t){var u=subtypes[n.t].transform(n.o,d.o,i);if(null!=n.si||null!=n.sd){for(var c=n.p,f=0;f0)&&(n.o=u,json.append(o,n))}return o}}else if(void 0!==e.na){}else if(void 0!==e.li&&void 0!==e.ld){if(e.p[l]===n.p[l]){if(!p){return o}if(void 0!==n.ld){if(void 0===n.li||"left"!==i){return o}n.ld=clone(e.li)}}}else if(void 0!==e.li){void 0!==n.li&&void 0===n.ld&&p&&n.p[l]===e.p[l]?"right"===i&&n.p[l]++:e.p[l]<=n.p[l]&&n.p[l]++,void 0!==n.lm&&p&&e.p[l]<=n.lm&&n.lm++}else if(void 0!==e.ld){if(void 0!==n.lm&&p){if(e.p[l]===n.p[l]){return o}c=e.p[l];var a=n.p[l];(c<(v=n.lm)||c===v&&ah&&n.p[l]--,a>m?n.p[l]++:a===m&&h>m&&(n.p[l]++,a===v&&n.lm++),v>h?n.lm--:v===h&&v>a&&n.lm--,v>m?n.lm++:v===m&&(m>h&&v>a||ma?n.lm++:v===h&&n.lm--)}}}else if(void 0!==n.li&&void 0===n.ld&&p){a=e.p[l],v=e.lm;(c=n.p[l])>a&&n.p[l]--,c>v&&n.p[l]++}else{a=e.p[l],v=e.lm;(c=n.p[l])===a?n.p[l]=v:(c>a&&n.p[l]--,c>v?n.p[l]++:c===v&&a>v&&n.p[l]++)}}else if(void 0!==e.oi&&void 0!==e.od){if(n.p[l]===e.p[l]){if(void 0===n.oi||!p){return o}if("right"===i){return o}n.od=e.oi}}else if(void 0!==e.oi){if(void 0!==n.oi&&n.p[l]===e.p[l]){if("left"!==i){return o}json.append(o,{p:n.p,od:e.oi})}}else if(void 0!==e.od&&n.p[l]==e.p[l]){if(!p){return o}if(void 0===n.oi){return o}delete n.od}}return json.append(o,n),o},_$bootstrapTransform_1(json,json.transformComponent,json.checkValidOp,json.append);json.registerSubtype(_$text0_3),_$json0_2=json;var _$otJson0_otJson0={type:_$json0_2};exposedRequire.m["ot-json0"]=_$otJson0_otJson0;return exposedRequire}(typeof require==="function"?require:void 0); require=function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=0;i--){if(u[i]!=c[i]){return!1}}for(i=u.length-1;i>=0;i--){if(f=u[i],!a(t[f],e[f],n)){return!1}}return typeof t==typeof e}(t,e,n))};function s(t){return null==t}function y(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}var h=function(t,e,r,n){if(r===void 0)r=[];var o="string"==typeof r[r.length-1];if(c(t,e)){return[]}if(void 0===e){return(i={p:r})[o?"od":"ld"]=t,[i]}if(void 0===t){return(i={p:r})[o?"oi":"li"]=e,[i]}if(n&&"string"==typeof t&&"string"==typeof e){return p||(p=new n),function(t,e,r,n,o){var i=[];var f=o.patch_make(e,r);return Object.keys(f).forEach(function(e){var r=f[e],o=r.start1;r.diffs.forEach(function(ref){var e=ref[0];var r=ref[1];switch(e){case n.DIFF_DELETE:i.push({sd:r,p:t.concat([o])});break;case n.DIFF_INSERT:i.push({si:r,p:t.concat([o])});case n.DIFF_EQUAL:o+=r.length;break;default:throw Error("Unsupported operation type: "+e)}})}),i}(r,t,e,n,p)}var i,f=["string","number","boolean"];if(f.includes(typeof e)||f.includes(typeof t)){return(i={p:r})[o?"od":"ld"]=t,i[o?"oi":"li"]=e,[i]}if(Array.isArray(e)){for(var u=[],l=Math.max(t.length,e.length),a=(u=[],0),s=0;s1})}(h(t,e,[],r))},e}("function"==typeof require?require:void 0); require=function(t){var n=function n(e,i){return n.m.hasOwnProperty(e)?n.m[e]:"function"!=typeof t||i?"function"==typeof n.r?n.r(e,1):void 0:t(e,1)};n.m={},n.r=t;var e={},i=function(){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};return i.Diff=function(t,n){return[t,n]},i.prototype.diff_main=function(t,n,e,r){void 0===r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var h=r;if(null==t||null==n){throw new Error("Null input. (diff_main)")}if(t==n){return t?[new i.Diff(0,t)]:[]}void 0===e&&(e=!0);var f=e,s=this.diff_commonPrefix(t,n),a=t.substring(0,s);t=t.substring(s),n=n.substring(s),s=this.diff_commonSuffix(t,n);var l=t.substring(t.length-s);t=t.substring(0,t.length-s),n=n.substring(0,n.length-s);var g=this.diff_compute_(t,n,f,h);return a&&g.unshift(new i.Diff(0,a)),l&&g.push(new i.Diff(0,l)),this.diff_cleanupMerge(g),g},i.prototype.diff_compute_=function(t,n,e,r){var h;if(!t){return[new i.Diff(1,n)]}if(!n){return[new i.Diff(-1,t)]}var f=t.length>n.length?t:n,s=t.length>n.length?n:t,a=f.indexOf(s);if(-1!=a){return h=[new i.Diff(1,f.substring(0,a)),new i.Diff(0,s),new i.Diff(1,f.substring(a+s.length))],t.length>n.length&&(h[0][0]=h[2][0]=-1),h}if(1==s.length){return[new i.Diff(-1,t),new i.Diff(1,n)]}var l=this.diff_halfMatch_(t,n);if(l){var g=l[0],o=l[1],c=l[2],u=l[3],p=l[4],d=this.diff_main(g,c,e,r),_=this.diff_main(o,u,e,r);return d.concat([new i.Diff(0,p)],_)}return e&&t.length>100&&n.length>100?this.diff_lineMode_(t,n,r):this.diff_bisect_(t,n,r)},i.prototype.diff_lineMode_=function(t,n,e){var r=this.diff_linesToChars_(t,n);t=r.chars1,n=r.chars2;var h=r.lineArray,f=this.diff_main(t,n,!1,e);this.diff_charsToLines_(f,h),this.diff_cleanupSemantic(f),f.push(new i.Diff(0,""));for(var s=0,a=0,l=0,g="",o="";s=1&&l>=1){f.splice(s-a-l,a+l),s=s-a-l;for(var c=this.diff_main(g,o,!1,e),u=c.length-1;u>=0;u--){f.splice(s,0,c[u])}s+=c.length}l=0,a=0,g="",o=""}s++}return f.pop(),f},i.prototype.diff_bisect_=function(t,n,e){for(var r=t.length,h=n.length,f=Math.ceil((r+h)/2),s=f,a=2*f,l=new Array(a),g=new Array(a),o=0;oe);v++){for(var m=-v+p;m<=v-d;m+=2){for(var w=s+m,M=(k=m==-v||m!=v&&l[w-1]r){d+=2}else if(M>h){p+=2}else if(u&&(D=s+c-m)>=0&&D=(y=r-g[D])){return this.diff_bisectSplit_(t,n,k,M,e)}}for(var x=-v+_;x<=v-b;x+=2){for(var y,D=s+x,A=(y=x==-v||x!=v&&g[D-1]r){b+=2}else if(A>h){_+=2}else if(!u){var k;if((w=s+c-x)>=0&&w=(y=r-y)){return this.diff_bisectSplit_(t,n,k,M,e)}}}}}return[new i.Diff(-1,t),new i.Diff(1,n)]},i.prototype.diff_bisectSplit_=function(t,n,e,i,r){var h=t.substring(0,e),f=n.substring(0,i),s=t.substring(e),a=n.substring(i),l=this.diff_main(h,f,!1,r),g=this.diff_main(s,a,!1,r);return l.concat(g)},i.prototype.diff_linesToChars_=function(t,n){var e=[],i={};function r(t){for(var n="",r=0,f=-1,s=e.length;fi?t=t.substring(e-i):en.length?t:n,i=t.length>n.length?n:t;if(e.length<4||2*i.length=t.length?[i,h,f,s,g]:null}var f,s,a,l,g,o=h(e,i,Math.ceil(e.length/4)),c=h(e,i,Math.ceil(e.length/2));return o||c?(f=c?o&&o[4].length>c[4].length?o:c:o,t.length>n.length?(s=f[0],a=f[1],l=f[2],g=f[3]):(l=f[0],g=f[1],s=f[2],a=f[3]),[s,a,l,g,f[4]]):null},i.prototype.diff_cleanupSemantic=function(t){for(var n=!1,e=[],r=0,h=null,f=0,s=0,a=0,l=0,g=0;f0?e[r-1]:-1,s=0,a=0,l=0,g=0,h=null,n=!0)),f++}for(n&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),f=1;f=p?(u>=o.length/2||u>=c.length/2)&&(t.splice(f,0,new i.Diff(0,c.substring(0,u))),t[f-1][1]=o.substring(0,o.length-u),t[f+1][1]=c.substring(u),f++):(p>=o.length/2||p>=c.length/2)&&(t.splice(f,0,new i.Diff(0,o.substring(0,p))),t[f-1][0]=1,t[f-1][1]=c.substring(0,c.length-p),t[f+1][0]=-1,t[f+1][1]=o.substring(p),f++),f++}f++}},i.prototype.diff_cleanupSemanticLossless=function(t){function n(t,n){if(!t||!n){return 6}var e=t.charAt(t.length-1),r=n.charAt(0),h=e.match(i.nonAlphaNumericRegex_),f=r.match(i.nonAlphaNumericRegex_),s=h&&e.match(i.whitespaceRegex_),a=f&&r.match(i.whitespaceRegex_),l=s&&e.match(i.linebreakRegex_),g=a&&r.match(i.linebreakRegex_),o=l&&t.match(i.blanklineEndRegex_),c=g&&n.match(i.blanklineStartRegex_);return o||c?5:l||g?4:h&&!s&&a?3:s||a?2:h||f?1:0}for(var e=1;e=c&&(c=u,l=r,g=h,o=f)}t[e-1][1]!=l&&(l?t[e-1][1]=l:(t.splice(e-1,1),e--),t[e][1]=g,o?t[e+1][1]=o:(t.splice(e+1,1),e--))}e++}},i.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,i.whitespaceRegex_=/\s/,i.linebreakRegex_=/[\r\n]/,i.blanklineEndRegex_=/\n\r?\n$/,i.blanklineStartRegex_=/^\r?\n\r?\n/,i.prototype.diff_cleanupEfficiency=function(t){for(var n=!1,e=[],r=0,h=null,f=0,s=!1,a=!1,l=!1,g=!1;f0?e[r-1]:-1,l=g=!1),n=!0)),f++}n&&this.diff_cleanupMerge(t)},i.prototype.diff_cleanupMerge=function(t){t.push(new i.Diff(0,""));for(var n,e=0,r=0,h=0,f="",s="";e1?(0!==r&&0!==h&&(0!==(n=this.diff_commonPrefix(s,f))&&(e-r-h>0&&0==t[e-r-h-1][0]?t[e-r-h-1][1]+=s.substring(0,n):(t.splice(0,0,new i.Diff(0,s.substring(0,n))),e++),s=s.substring(n),f=f.substring(n)),0!==(n=this.diff_commonSuffix(s,f))&&(t[e][1]=s.substring(s.length-n)+t[e][1],s=s.substring(0,s.length-n),f=f.substring(0,f.length-n))),e-=r+h,t.splice(e,r+h),f.length&&(t.splice(e,0,new i.Diff(-1,f)),e++),s.length&&(t.splice(e,0,new i.Diff(1,s)),e++),e++):0!==e&&0==t[e-1][0]?(t[e-1][1]+=t[e][1],t.splice(e,1)):e++,h=0,r=0,f="",s=""}}""===t[t.length-1][1]&&t.pop();var a=!1;for(e=1;en));e++){h=i,f=r}return t.length!=e&&-1===t[e][0]?f:f+(n-h)},i.prototype.diff_prettyHtml=function(t){for(var n=[],e=/&/g,i=//g,h=/\n/g,f=0;f");switch(s){case 1:n[f]=''+a+"";break;case-1:n[f]=''+a+"";break;case 0:n[f]=""+a+""}}return n.join("")},i.prototype.diff_text1=function(t){for(var n=[],e=0;ethis.Match_MaxBits){throw new Error("Pattern too long for this browser.")}var i=this.match_alphabet_(n),r=this;function h(t,i){var h=t/n.length,f=Math.abs(e-i);return r.Match_Distance?h+f/r.Match_Distance:f?1:h}var f=this.Match_Threshold,s=t.indexOf(n,e);-1!=s&&(f=Math.min(h(0,s),f),-1!=(s=t.lastIndexOf(n,e+n.length))&&(f=Math.min(h(0,s),f)));var a,l,g=1<=p;b--){var v=i[t.charAt(b-1)];if(_[b]=0===u?(_[b+1]<<1|1)&v:(_[b+1]<<1|1)&v|(o[b+1]|o[b])<<1|1|o[b+1],_[b]&g){var m=h(u,b-1);if(m<=f){if(f=m,!((s=b-1)>e)){break}p=Math.max(1,2*e-s)}}}if(h(u+1,e)>f){break}o=_}return s},i.prototype.match_alphabet_=function(t){for(var n={},e=0;e2&&(this.diff_cleanupSemantic(h),this.diff_cleanupEfficiency(h))}else if(t&&"object"==typeof t&&void 0===n&&void 0===e){h=t,r=this.diff_text1(h)}else if("string"==typeof t&&n&&"object"==typeof n&&void 0===e){r=t,h=n}else{if("string"!=typeof t||"string"!=typeof n||!e||"object"!=typeof e){throw new Error("Unknown call format to patch_make.")}r=t,h=e}if(0===h.length){return[]}for(var f=[],s=new i.patch_obj,a=0,l=0,g=0,o=r,c=r,u=0;u=2*this.Patch_Margin&&a&&(this.patch_addContext_(s,o),f.push(s),s=new i.patch_obj,a=0,o=c,l=g)}1!==p&&(l+=d.length),-1!==p&&(g+=d.length)}return a&&(this.patch_addContext_(s,o),f.push(s)),f},i.prototype.patch_deepCopy=function(t){for(var n=[],e=0;ethis.Match_MaxBits?-1!=(f=this.match_main(n,l.substring(0,this.Match_MaxBits),a))&&(-1==(g=this.match_main(n,l.substring(l.length-this.Match_MaxBits),a+l.length-this.Match_MaxBits))||f>=g)&&(f=-1):f=this.match_main(n,l,a),-1==f){r[h]=!1,i-=t[h].length2-t[h].length1}else if(r[h]=!0,i=f-a,l==(s=-1==g?n.substring(f,f+l.length):n.substring(f,g+this.Match_MaxBits))){n=n.substring(0,f)+this.diff_text2(t[h].diffs)+n.substring(f+l.length)}else{var o=this.diff_main(l,s,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(o)/l.length>this.Patch_DeleteThreshold){r[h]=!1}else{this.diff_cleanupSemanticLossless(o);for(var c,u=0,p=0;pf[0][1].length){var s=n-f[0][1].length;f[0][1]=e.substring(f[0][1].length)+f[0][1],h.start1-=s,h.start2-=s,h.length1+=s,h.length2+=s}return 0==(f=(h=t[t.length-1]).diffs).length||0!=f[f.length-1][0]?(f.push(new i.Diff(0,e)),h.length1+=n,h.length2+=n):n>f[f.length-1][1].length&&(s=n-f[f.length-1][1].length,f[f.length-1][1]+=e.substring(0,s),h.length1+=s,h.length2+=s),e},i.prototype.patch_splitMax=function(t){for(var n=this.Match_MaxBits,e=0;e2*n?(a.length1+=o.length,h+=o.length,l=!1,a.diffs.push(new i.Diff(g,o)),r.diffs.shift()):(o=o.substring(0,n-a.length1-this.Patch_Margin),a.length1+=o.length,h+=o.length,0===g?(a.length2+=o.length,f+=o.length):l=!1,a.diffs.push(new i.Diff(g,o)),o==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(o.length))}s=(s=this.diff_text2(a.diffs)).substring(s.length-this.Patch_Margin);var c=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);""!==c&&(a.length1+=c.length,a.length2+=c.length,0!==a.diffs.length&&0===a.diffs[a.diffs.length-1][0]?a.diffs[a.diffs.length-1][1]+=c:a.diffs.push(new i.Diff(0,c))),l||t.splice(++e,0,a)}}}},i.prototype.patch_toText=function(t){for(var n=[],e=0;e{var r,n={}.hasOwnProperty;for(r in s)n.call(s,r)&&(t[r]=s[r]);return t})(Object.create(Object.prototype),{get:function(){return JSON.parse(JSON.stringify(this.cur||{}))},clear:function(){var s=this;return["all","undo","redo"].map(function(t){return s.stack[t].splice(0)})},reset:function(t){t=t.obj;return this.cur=JSON.parse(JSON.stringify(t||{})),this.clear()},update:function(t,s){return this.apply({obj:t,src:s=null==s?!0:s})},apply:function(t){var s=t.obj,r=t.op,t=t.src;return t=null==t||t,(r=!r&&s?e.diff(this.cur,s):r).length?(this.stack.all.push(s={op:r,src:t}),t&&(this.stack.redo.splice(0),this.stack.undo.push(s)),this.cur=e.type.apply(this.cur,r),{obj:this.cur,op:r}):{obj:this.cur,op:null}},undo:function(){var t,s,r,n,o,i=this.stack.undo.pop();if(!i)return{obj:this.cur,op:null};for(t=this.stack.all.indexOf(i),s=e.type.invert(i.op),r=t+1,n=this.stack.all.length;r