@foreverrbum/ethsign
Version:
This package will allow you to electronically sign documents within your application
99 lines • 216 kB
JavaScript
/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/
(function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[2],{304:function(ha,da,h){(function(h){(function(h,ca){ha.exports=ca()})("undefined"!==typeof self?self:this,function(){return function(h){function aa(z){if(ca[z])return ca[z].exports;var x=ca[z]={i:z,l:!1,exports:{}};h[z].call(x.exports,x,x.exports,aa);x.l=!0;return x.exports}var ca={};aa.m=h;aa.c=ca;aa.d=function(h,x,e){aa.o(h,x)||Object.defineProperty(h,x,{configurable:!1,enumerable:!0,get:e})};aa.n=function(h){var x=h&&h.__esModule?
function(){return h["default"]}:function(){return h};aa.d(x,"a",x);return x};aa.o=function(h,x){return Object.prototype.hasOwnProperty.call(h,x)};aa.p="";return aa(aa.s=109)}([function(h,ca,ea){Object.defineProperty(ca,"__esModule",{value:!0});h=ea(17);var z=ea(18),x=ea(19),e=ea(45),f=ea(46),y=ea(47),r=ea(48),n=ea(49),w=ea(12),ba=ea(32),aa=ea(33),fa=ea(31);ea=ea(1);ca.default={Scope:ea.Scope,create:ea.create,find:ea.find,query:ea.query,register:ea.register,Container:h.default,Format:z.default,Leaf:x.default,
Embed:r.default,Scroll:e.default,Block:y.default,Inline:f.default,Text:n.default,Attributor:{Attribute:w.default,Class:ba.default,Style:aa.default,Store:fa.default}}},function(h,ca){function aa(e,f){void 0===f&&(f=!1);return null==e?null:null!=e[ca.DATA_KEY]?e[ca.DATA_KEY].blot:f?aa(e.parentNode,f):null}function z(e,f){void 0===f&&(f=ba.ANY);if("string"===typeof e)var h=w[e]||y[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)h=w.text;else if("number"===typeof e)e&ba.LEVEL&ba.BLOCK?h=w.block:
e&ba.LEVEL&ba.INLINE&&(h=w.inline);else if(e instanceof HTMLElement){var x=(e.getAttribute("class")||"").split(/\s+/),z;for(z in x)if(h=r[x[z]])break;h=h||n[e.tagName]}return null==h?null:f&ba.LEVEL&h.scope&&f&ba.TYPE&h.scope?h:null}function x(){for(var e=[],h=0;h<arguments.length;h++)e[h]=arguments[h];if(1<e.length)return e.map(function(e){return x(e)});var ba=e[0];if("string"!==typeof ba.blotName&&"string"!==typeof ba.attrName)throw new f("Invalid definition");if("abstract"===ba.blotName)throw new f("Cannot register abstract class");
w[ba.blotName||ba.attrName]=ba;"string"===typeof ba.keyName?y[ba.keyName]=ba:(null!=ba.className&&(r[ba.className]=ba),null!=ba.tagName&&(Array.isArray(ba.tagName)?ba.tagName=ba.tagName.map(function(e){return e.toUpperCase()}):ba.tagName=ba.tagName.toUpperCase(),(Array.isArray(ba.tagName)?ba.tagName:[ba.tagName]).forEach(function(e){if(null==n[e]||null==ba.className)n[e]=ba})));return ba}var e=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,
f){e.__proto__=f}||function(e,f){for(var h in f)f.hasOwnProperty(h)&&(e[h]=f[h])};return function(f,h){function n(){this.constructor=f}e(f,h);f.prototype=null===h?Object.create(h):(n.prototype=h.prototype,new n)}}();Object.defineProperty(ca,"__esModule",{value:!0});var f=function(f){function h(e){e="[Parchment] "+e;var h=f.call(this,e)||this;h.message=e;h.name=h.constructor.name;return h}e(h,f);return h}(Error);ca.ParchmentError=f;var y={},r={},n={},w={};ca.DATA_KEY="__blot";var ba;(function(e){e[e.TYPE=
3]="TYPE";e[e.LEVEL=12]="LEVEL";e[e.ATTRIBUTE=13]="ATTRIBUTE";e[e.BLOT=14]="BLOT";e[e.INLINE=7]="INLINE";e[e.BLOCK=11]="BLOCK";e[e.BLOCK_BLOT=10]="BLOCK_BLOT";e[e.INLINE_BLOT=6]="INLINE_BLOT";e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE";e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE";e[e.ANY=15]="ANY"})(ba=ca.Scope||(ca.Scope={}));ca.create=function(e,h){var n=z(e);if(null==n)throw new f("Unable to create "+e+" blot");e=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:n.create(h);return new n(e,h)};ca.find=
aa;ca.query=z;ca.register=x},function(h,ca,ea){function z(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}var x=ea(51),e=ea(11),f=ea(3),y=ea(20),r=String.fromCharCode(0);z.prototype.insert=function(e,f){var h={};if(0===e.length)return this;h.insert=e;null!=f&&"object"===typeof f&&0<Object.keys(f).length&&(h.attributes=f);return this.push(h)};z.prototype["delete"]=function(e){return 0>=e?this:this.push({"delete":e})};z.prototype.retain=function(e,f){if(0>=e)return this;
e={retain:e};null!=f&&"object"===typeof f&&0<Object.keys(f).length&&(e.attributes=f);return this.push(e)};z.prototype.push=function(h){var n=this.ops.length,r=this.ops[n-1];h=f(!0,{},h);if("object"===typeof r){if("number"===typeof h["delete"]&&"number"===typeof r["delete"])return this.ops[n-1]={"delete":r["delete"]+h["delete"]},this;if("number"===typeof r["delete"]&&null!=h.insert&&(--n,r=this.ops[n-1],"object"!==typeof r))return this.ops.unshift(h),this;if(e(h.attributes,r.attributes)){if("string"===
typeof h.insert&&"string"===typeof r.insert)return this.ops[n-1]={insert:r.insert+h.insert},"object"===typeof h.attributes&&(this.ops[n-1].attributes=h.attributes),this;if("number"===typeof h.retain&&"number"===typeof r.retain)return this.ops[n-1]={retain:r.retain+h.retain},"object"===typeof h.attributes&&(this.ops[n-1].attributes=h.attributes),this}}n===this.ops.length?this.ops.push(h):this.ops.splice(n,0,h);return this};z.prototype.chop=function(){var e=this.ops[this.ops.length-1];e&&e.retain&&
!e.attributes&&this.ops.pop();return this};z.prototype.filter=function(e){return this.ops.filter(e)};z.prototype.forEach=function(e){this.ops.forEach(e)};z.prototype.map=function(e){return this.ops.map(e)};z.prototype.partition=function(e){var f=[],h=[];this.forEach(function(n){(e(n)?f:h).push(n)});return[f,h]};z.prototype.reduce=function(e,f){return this.ops.reduce(e,f)};z.prototype.changeLength=function(){return this.reduce(function(e,f){return f.insert?e+y.length(f):f.delete?e-f.delete:e},0)};
z.prototype.length=function(){return this.reduce(function(e,f){return e+y.length(f)},0)};z.prototype.slice=function(e,f){e=e||0;"number"!==typeof f&&(f=Infinity);for(var h=[],n=y.iterator(this.ops),r=0;r<f&&n.hasNext();){if(r<e)var w=n.next(e-r);else w=n.next(f-r),h.push(w);r+=y.length(w)}return new z(h)};z.prototype.compose=function(f){var h=y.iterator(this.ops);f=y.iterator(f.ops);var n=[],r=f.peek();if(null!=r&&"number"===typeof r.retain&&null==r.attributes){for(var x=r.retain;"insert"===h.peekType()&&
h.peekLength()<=x;)x-=h.peekLength(),n.push(h.next());0<r.retain-x&&f.next(r.retain-x)}for(n=new z(n);h.hasNext()||f.hasNext();)if("insert"===f.peekType())n.push(f.next());else if("delete"===h.peekType())n.push(h.next());else{x=Math.min(h.peekLength(),f.peekLength());var aa=h.next(x),ca=f.next(x);if("number"===typeof ca.retain){r={};"number"===typeof aa.retain?r.retain=x:r.insert=aa.insert;if(x=y.attributes.compose(aa.attributes,ca.attributes,"number"===typeof aa.retain))r.attributes=x;n.push(r);
if(!f.hasNext()&&e(n.ops[n.ops.length-1],r))return h=new z(h.rest()),n.concat(h).chop()}else"number"===typeof ca["delete"]&&"number"===typeof aa.retain&&n.push(ca)}return n.chop()};z.prototype.concat=function(e){var f=new z(this.ops.slice());0<e.ops.length&&(f.push(e.ops[0]),f.ops=f.ops.concat(e.ops.slice(1)));return f};z.prototype.diff=function(f,h){if(this.ops===f.ops)return new z;var n=[this,f].map(function(e){return e.map(function(h){if(null!=h.insert)return"string"===typeof h.insert?h.insert:
r;throw Error("diff() called "+(e===f?"on":"with")+" non-document");}).join("")}),w=new z;h=x(n[0],n[1],h);var aa=y.iterator(this.ops),ca=y.iterator(f.ops);h.forEach(function(f){for(var h=f[1].length;0<h;){var n=0;switch(f[0]){case x.INSERT:n=Math.min(ca.peekLength(),h);w.push(ca.next(n));break;case x.DELETE:n=Math.min(h,aa.peekLength());aa.next(n);w["delete"](n);break;case x.EQUAL:n=Math.min(aa.peekLength(),ca.peekLength(),h);var r=aa.next(n),ba=ca.next(n);if(e(r.insert,ba.insert))w.retain(n,y.attributes.diff(r.attributes,
ba.attributes));else w.push(ba)["delete"](n)}h-=n}});return w.chop()};z.prototype.eachLine=function(e,f){f=f||"\n";for(var h=y.iterator(this.ops),n=new z,r=0;h.hasNext();){if("insert"!==h.peekType())return;var w=h.peek(),x=y.length(w)-h.peekLength();w="string"===typeof w.insert?w.insert.indexOf(f,x)-x:-1;if(0>w)n.push(h.next());else if(0<w)n.push(h.next(w));else{if(!1===e(n,h.next(1).attributes||{},r))return;r+=1;n=new z}}0<n.length()&&e(n,{},r)};z.prototype.transform=function(e,f){f=!!f;if("number"===
typeof e)return this.transformPosition(e,f);var h=y.iterator(this.ops);e=y.iterator(e.ops);for(var n=new z;h.hasNext()||e.hasNext();)if("insert"!==h.peekType()||!f&&"insert"===e.peekType())if("insert"===e.peekType())n.push(e.next());else{var r=Math.min(h.peekLength(),e.peekLength()),w=h.next(r),x=e.next(r);w["delete"]||(x["delete"]?n.push(x):n.retain(r,y.attributes.transform(w.attributes,x.attributes,f)))}else n.retain(y.length(h.next()));return n.chop()};z.prototype.transformPosition=function(e,
f){f=!!f;for(var h=y.iterator(this.ops),n=0;h.hasNext()&&n<=e;){var r=h.peekLength(),w=h.peekType();h.next();"delete"===w?e-=Math.min(r,e-n):("insert"===w&&(n<e||!f)&&(e+=r),n+=r)}return e};h.exports=z},function(h){function aa(f,h){if("__proto__"===h){if(!e.call(f,h))return;if(r)return r(f,h).value}return f[h]}function ca(e,f){y&&"__proto__"===f.name?y(e,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):e[f.name]=f.newValue}function z(h){if(!h||"[object Object]"!==f.call(h))return!1;
var n=e.call(h,"constructor"),r=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!n&&!r)return!1;for(var y in h);return"undefined"===typeof y||e.call(h,y)}function x(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===f.call(e)}var e=Object.prototype.hasOwnProperty,f=Object.prototype.toString,y=Object.defineProperty,r=Object.getOwnPropertyDescriptor;h.exports=function w(){var e,f,h=arguments[0],r=1,y=arguments.length,
ea=!1;"boolean"===typeof h&&(ea=h,h=arguments[1]||{},r=2);if(null==h||"object"!==typeof h&&"function"!==typeof h)h={};for(;r<y;++r){var fa=arguments[r];if(null!=fa)for(e in fa){var da=aa(h,e);var ha=aa(fa,e);h!==ha&&(ea&&ha&&(z(ha)||(f=x(ha)))?(f?(f=!1,da=da&&x(da)?da:[]):da=da&&z(da)?da:{},ca(h,{name:e,newValue:w(ea,da,ha)})):"undefined"!==typeof ha&&ca(h,{name:e,newValue:ha}))}}return h}},function(h,ca,ea){function z(e){return e&&e.__esModule?e:{default:e}}function x(e,f){if(!(e instanceof f))throw new TypeError("Cannot call a class as a function");
}function e(e,f){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||"object"!==typeof f&&"function"!==typeof f?e:f}function f(e,f){if("function"!==typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+typeof f);e.prototype=Object.create(f&&f.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});f&&(Object.setPrototypeOf?Object.setPrototypeOf(e,f):e.__proto__=f)}function y(e){var f=
1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return f;"function"===typeof e.formats&&(f=(0,w.default)(f,e.formats()));return null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope?f:y(e.parent,f)}Object.defineProperty(ca,"__esModule",{value:!0});ca.default=ca.BlockEmbed=ca.bubbleFormats=void 0;var r=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,
n.key,n)}}return function(f,h,n){h&&e(f.prototype,h);n&&e(f,n);return f}}(),n=function sa(e,f,h){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,f);if(void 0===n){if(e=Object.getPrototypeOf(e),null!==e)return sa(e,f,h)}else{if("value"in n)return n.value;f=n.get;return void 0===f?void 0:f.call(h)}};h=ea(3);var w=z(h);h=ea(2);var ba=z(h);h=ea(0);var aa=z(h);h=ea(16);var fa=z(h);h=ea(6);h=z(h);ea=ea(7);ea=z(ea);var da=function(h){function y(){x(this,y);return e(this,(y.__proto__||
Object.getPrototypeOf(y)).apply(this,arguments))}f(y,h);r(y,[{key:"attach",value:function(){n(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"attach",this).call(this);this.attributes=new aa.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return(new ba.default).insert(this.value(),(0,w.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(e,f){e=aa.default.query(e,aa.default.Scope.BLOCK_ATTRIBUTE);null!=e&&this.attributes.attribute(e,f)}},
{key:"formatAt",value:function(e,f,h,n){this.format(h,n)}},{key:"insertAt",value:function(e,f,h){"string"===typeof f&&f.endsWith("\n")?(h=aa.default.create(ha.blotName),this.parent.insertBefore(h,0===e?this:this.next),h.insertAt(0,f.slice(0,-1))):n(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertAt",this).call(this,e,f,h)}}]);return y}(aa.default.Embed);da.scope=aa.default.Scope.BLOCK_BLOT;var ha=function(h){function w(f){x(this,w);f=e(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,
f));f.cache={};return f}f(w,h);r(w,[{key:"delta",value:function(){null==this.cache.delta&&(this.cache.delta=this.descendants(aa.default.Leaf).reduce(function(e,f){return 0===f.length()?e:e.insert(f.value(),y(f))},new ba.default).insert("\n",y(this)));return this.cache.delta}},{key:"deleteAt",value:function(e,f){n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"deleteAt",this).call(this,e,f);this.cache={}}},{key:"formatAt",value:function(e,f,h,r){0>=f||(aa.default.query(h,aa.default.Scope.BLOCK)?
e+f===this.length()&&this.format(h,r):n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"formatAt",this).call(this,e,Math.min(f,this.length()-e-1),h,r),this.cache={})}},{key:"insertAt",value:function(e,f,h){if(null!=h)return n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertAt",this).call(this,e,f,h);if(0!==f.length){f=f.split("\n");h=f.shift();0<h.length&&(e<this.length()-1||null==this.children.tail?n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertAt",
this).call(this,Math.min(e,this.length()-1),h):this.children.tail.insertAt(this.children.tail.length(),h),this.cache={});var r=this;f.reduce(function(e,f){r=r.split(e,!0);r.insertAt(0,f);return f.length},e+h.length)}}},{key:"insertBefore",value:function(e,f){var h=this.children.head;n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,e,f);h instanceof fa.default&&h.remove();this.cache={}}},{key:"length",value:function(){null==this.cache.length&&(this.cache.length=
n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"length",this).call(this)+1);return this.cache.length}},{key:"moveChildren",value:function(e,f){n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"moveChildren",this).call(this,e,f);this.cache={}}},{key:"optimize",value:function(e){n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,e);this.cache={}}},{key:"path",value:function(e){return n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),
"path",this).call(this,e,!0)}},{key:"removeChild",value:function(e){n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"removeChild",this).call(this,e);this.cache={}}},{key:"split",value:function(e){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!1;if(f&&(0===e||e>=this.length()-1)){f=this.clone();if(0===e)return this.parent.insertBefore(f,this),this;this.parent.insertBefore(f,this.next);return f}f=n(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"split",this).call(this,
e,f);this.cache={};return f}}]);return w}(aa.default.Block);ha.blotName="block";ha.tagName="P";ha.defaultChild="break";ha.allowedChildren=[h.default,aa.default.Embed,ea.default];ca.bubbleFormats=y;ca.BlockEmbed=da;ca.default=ha},function(h,ca,ea){function z(e){return e&&e.__esModule?e:{default:e}}function x(e,f,h){f in e?Object.defineProperty(e,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):e[f]=h;return e}function e(e,f){f=(0,ma.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,
history:!0}},f);if(f.theme&&f.theme!==qa.DEFAULTS.theme){if(f.theme=qa.import("themes/"+f.theme),null==f.theme)throw Error("Invalid theme "+f.theme+". Did you register it?");}else f.theme=Ba.default;e=(0,ma.default)(!0,{},f.theme.DEFAULTS);[e,f].forEach(function(e){e.modules=e.modules||{};Object.keys(e.modules).forEach(function(f){!0===e.modules[f]&&(e.modules[f]={})})});var h=Object.keys(e.modules).concat(Object.keys(f.modules)).reduce(function(e,f){var h=qa.import("modules/"+f);null==h?va.error("Cannot load "+
f+" module. Are you sure you registered it?"):e[f]=h.DEFAULTS||{};return e},{});null!=f.modules&&f.modules.toolbar&&f.modules.toolbar.constructor!==Object&&(f.modules.toolbar={container:f.modules.toolbar});f=(0,ma.default)(!0,{},qa.DEFAULTS,{modules:h},e,f);["bounds","container","scrollingContainer"].forEach(function(e){"string"===typeof f[e]&&(f[e]=document.querySelector(f[e]))});f.modules=Object.keys(f.modules).reduce(function(e,h){f.modules[h]&&(e[h]=f.modules[h]);return e},{});return f}function f(e,
f,h,n){if(this.options.strict&&!this.isEnabled()&&f===da.default.sources.USER)return new aa.default;var w=null==h?null:this.getSelection(),y=this.editor.delta;e=e();null!=w&&(!0===h&&(h=w.index),null==n?w=r(w,e,f):0!==n&&(w=r(w,h,n,f)),this.setSelection(w,da.default.sources.SILENT));if(0<e.length()){var x;h=[da.default.events.TEXT_CHANGE,e,y,f];(x=this.emitter).emit.apply(x,[da.default.events.EDITOR_CHANGE].concat(h));if(f!==da.default.sources.SILENT){var ba;(ba=this.emitter).emit.apply(ba,h)}}return e}
function y(e,f,h,r,w){var y={};"number"===typeof e.index&&"number"===typeof e.length?("number"!==typeof f?(w=r,r=h,h=f,f=e.length):f=e.length,e=e.index):"number"!==typeof f&&(w=r,r=h,h=f,f=0);"object"===("undefined"===typeof h?"undefined":n(h))?(y=h,w=r):"string"===typeof h&&(null!=r?y[h]=r:w=h);w=w||da.default.sources.API;return[e,f,y,w]}function r(e,f,h,n){if(null==e)return null;var r=void 0,y=void 0;f instanceof aa.default?(r=[e.index,e.index+e.length].map(function(e){return f.transformPosition(e,
n!==da.default.sources.USER)}),e=w(r,2),r=e[0],y=e[1]):(r=[e.index,e.index+e.length].map(function(e){return e<f||e===f&&n===da.default.sources.USER?e:0<=h?e+h:Math.max(f,e+h)}),e=w(r,2),r=e[0],y=e[1]);return new ja.Range(r,y-r)}Object.defineProperty(ca,"__esModule",{value:!0});ca.default=ca.overload=ca.expandConfig=void 0;var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?
"symbol":typeof e},w=function(){return function(e,f){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var h=[],n=!0,r=!1,w=void 0;try{for(var y=e[Symbol.iterator](),x;!(n=(x=y.next()).done)&&(h.push(x.value),!f||h.length!==f);n=!0);}catch(Da){r=!0,w=Da}finally{try{if(!n&&y["return"])y["return"]()}finally{if(r)throw w;}}return h}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),ba=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=
n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,n){h&&e(f.prototype,h);n&&e(f,n);return f}}();ea(50);h=ea(2);var aa=z(h);h=ea(14);var fa=z(h);h=ea(8);var da=z(h);h=ea(9);h=z(h);var ha=ea(0),ka=z(ha),ja=ea(15),ya=z(ja);ha=ea(3);var ma=z(ha);ha=ea(10);var sa=z(ha);ea=ea(34);var Ba=z(ea),va=(0,sa.default)("quill"),qa=function(){function h(n){var r=this,w=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!(this instanceof
h))throw new TypeError("Cannot call a class as a function");this.options=e(n,w);this.container=this.options.container;if(null==this.container)return va.error("Invalid Quill container",n);this.options.debug&&h.debug(this.options.debug);w=this.container.innerHTML.trim();this.container.classList.add("ql-container");this.container.innerHTML="";this.container.__quill=this;this.root=this.addContainer("ql-editor");this.root.classList.add("ql-blank");this.root.setAttribute("data-gramm",!1);this.scrollingContainer=
this.options.scrollingContainer||this.root;this.emitter=new da.default;this.scroll=ka.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats});this.editor=new fa.default(this.scroll);this.selection=new ya.default(this.scroll,this.emitter);this.theme=new this.options.theme(this,this.options);this.keyboard=this.theme.addModule("keyboard");this.clipboard=this.theme.addModule("clipboard");this.history=this.theme.addModule("history");this.theme.init();this.emitter.on(da.default.events.EDITOR_CHANGE,
function(e){e===da.default.events.TEXT_CHANGE&&r.root.classList.toggle("ql-blank",r.editor.isBlank())});this.emitter.on(da.default.events.SCROLL_UPDATE,function(e,h){var n=r.selection.lastRange,w=n&&0===n.length?n.index:void 0;f.call(r,function(){return r.editor.update(null,h,w)},e)});w=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+w+"<p><br></p></div>");this.setContents(w);this.history.clear();this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder);
this.options.readOnly&&this.disable()}ba(h,null,[{key:"debug",value:function(e){!0===e&&(e="log");sa.default.level(e)}},{key:"find",value:function(e){return e.__quill||ka.default.find(e)}},{key:"import",value:function(e){null==this.imports[e]&&va.error("Cannot import "+e+". Are you sure it was registered?");return this.imports[e]}},{key:"register",value:function(e,f){var h=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!1;"string"!==typeof e?(n=e.attrName||e.blotName,"string"===typeof n?
this.register("formats/"+n,e,f):Object.keys(e).forEach(function(n){h.register(n,e[n],f)})):(null==this.imports[e]||n||va.warn("Overwriting "+e+" with",f),this.imports[e]=f,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==f.blotName?ka.default.register(f):e.startsWith("modules")&&"function"===typeof f.register&&f.register())}}]);ba(h,[{key:"addContainer",value:function(e){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if("string"===typeof e){var h=e;e=document.createElement("div");
e.classList.add(h)}this.container.insertBefore(e,f);return e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,h,n){var r=this;n=y(e,h,n);n=w(n,4);e=n[0];h=n[1];n=n[3];return f.call(this,function(){return r.editor.deleteText(e,h)},n,e,-1*h)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;this.scroll.enable(e);this.container.classList.toggle("ql-disabled",
!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus();this.scrollingContainer.scrollTop=e;this.scrollIntoView()}},{key:"format",value:function(e,h){var n=this;return f.call(this,function(){var f=n.getSelection(!0),r=new aa.default;if(null==f)return r;if(ka.default.query(e,ka.default.Scope.BLOCK))r=n.editor.formatLine(f.index,f.length,x({},e,h));else{if(0===f.length)return n.selection.format(e,h),r;r=n.editor.formatText(f.index,f.length,x({},e,h))}n.setSelection(f,
da.default.sources.SILENT);return r},2<arguments.length&&void 0!==arguments[2]?arguments[2]:da.default.sources.API)}},{key:"formatLine",value:function(e,h,n,r,x){var ba=this,z=void 0;n=y(e,h,n,r,x);n=w(n,4);e=n[0];h=n[1];z=n[2];x=n[3];return f.call(this,function(){return ba.editor.formatLine(e,h,z)},x,e,0)}},{key:"formatText",value:function(e,h,n,r,x){var ba=this,z=void 0;n=y(e,h,n,r,x);n=w(n,4);e=n[0];h=n[1];z=n[2];x=n[3];return f.call(this,function(){return ba.editor.formatText(e,h,z)},x,e,0)}},
{key:"getBounds",value:function(e){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;f="number"===typeof e?this.selection.getBounds(e,f):this.selection.getBounds(e.index,e.length);var h=this.container.getBoundingClientRect();return{bottom:f.bottom-h.top,height:f.height,left:f.left-h.left,right:f.right-h.left,top:f.top-h.top,width:f.width}}},{key:"getContents",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
this.getLength()-e;e=y(e,f);f=w(e,2);e=f[0];f=f[1];return this.editor.getContents(e,f)}},{key:"getFormat",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return"number"===typeof e?this.editor.getFormat(e,f):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",
value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!==typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,f)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){0<arguments.length&&void 0!==arguments[0]&&
arguments[0]&&this.focus();this.update();return this.selection.getRange()[0]}},{key:"getText",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;e=y(e,f);f=w(e,2);e=f[0];f=f[1];return this.editor.getText(e,f)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var w=this;return f.call(this,function(){return w.editor.insertEmbed(e,n,r)},
3<arguments.length&&void 0!==arguments[3]?arguments[3]:h.sources.API,e)}},{key:"insertText",value:function(e,h,n,r,x){var ba=this,z=void 0;n=y(e,0,n,r,x);n=w(n,4);e=n[0];z=n[2];x=n[3];return f.call(this,function(){return ba.editor.insertText(e,h,z)},x,e,h.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,
arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(e,f,h){this.clipboard.dangerouslyPasteHTML(e,f,h)}},{key:"removeFormat",value:function(e,h,n){var r=this;n=y(e,h,n);n=w(n,4);e=n[0];h=n[1];n=n[3];return f.call(this,function(){return r.editor.removeFormat(e,h)},n,e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var h=this;return f.call(this,
function(){e=new aa.default(e);var f=h.getLength();f=h.editor.deleteText(0,f);var n=h.editor.applyDelta(e),r=n.ops[n.ops.length-1];null!=r&&"string"===typeof r.insert&&"\n"===r.insert[r.insert.length-1]&&(h.editor.deleteText(h.getLength()-1,1),n.delete(1));return f.compose(n)},1<arguments.length&&void 0!==arguments[1]?arguments[1]:da.default.sources.API)}},{key:"setSelection",value:function(e,f,n){null==e?this.selection.setRange(null,f||h.sources.API):(e=y(e,f,n),n=w(e,4),e=n[0],f=n[1],n=n[3],this.selection.setRange(new ja.Range(e,
f),n),n!==da.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer))}},{key:"setText",value:function(e){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:da.default.sources.API,h=(new aa.default).insert(e);return this.setContents(h,f)}},{key:"update",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:da.default.sources.USER,f=this.scroll.update(e);this.selection.update(e);return f}},{key:"updateContents",value:function(e){var h=this,n=
1<arguments.length&&void 0!==arguments[1]?arguments[1]:da.default.sources.API;return f.call(this,function(){e=new aa.default(e);return h.editor.applyDelta(e,n)},n,!0)}}]);return h}();qa.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"};qa.events=da.default.events;qa.sources=da.default.sources;qa.version="1.3.7";qa.imports={delta:aa.default,parchment:ka.default,"core/module":h.default,"core/theme":Ba.default};ca.expandConfig=
e;ca.overload=y;ca.default=qa},function(h,ca,ea){function z(e,f){if("function"!==typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+typeof f);e.prototype=Object.create(f&&f.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});f&&(Object.setPrototypeOf?Object.setPrototypeOf(e,f):e.__proto__=f)}Object.defineProperty(ca,"__esModule",{value:!0});var x=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=n.enumerable||
!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,w){h&&e(f.prototype,h);w&&e(f,w);return f}}(),e=function ba(e,f,h){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,f);if(void 0===n){if(e=Object.getPrototypeOf(e),null!==e)return ba(e,f,h)}else{if("value"in n)return n.value;f=n.get;return void 0===f?void 0:f.call(h)}};h=(h=ea(7))&&h.__esModule?h:{default:h};var f=(ea=ea(0))&&ea.__esModule?ea:{default:ea};ea=function(h){function n(){if(!(this instanceof
n))throw new TypeError("Cannot call a class as a function");var e=(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==typeof e&&"function"!==typeof e?this:e}z(n,h);x(n,[{key:"formatAt",value:function(h,r,x,z){0>n.compare(this.statics.blotName,x)&&f.default.query(x,f.default.Scope.BLOT)?(h=this.isolate(h,r),z&&h.wrap(x,z)):e(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),
"formatAt",this).call(this,h,r,x,z)}},{key:"optimize",value:function(f){e(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"optimize",this).call(this,f);this.parent instanceof n&&0<n.compare(this.statics.blotName,this.parent.statics.blotName)&&(f=this.parent.isolate(this.offset(),this.length()),this.moveChildren(f),f.wrap(this))}}],[{key:"compare",value:function(e,f){var h=n.order.indexOf(e),r=n.order.indexOf(f);return 0<=h||0<=r?h-r:e===f?0:e<f?-1:1}}]);return n}(f.default.Inline);ea.allowedChildren=
[ea,f.default.Embed,h.default];ea.order="cursor inline underline strike italic bold script link code".split(" ");ca.default=ea},function(h,ca,ea){function z(h,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);h.prototype=Object.create(e&&e.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(h,e):h.__proto__=e)}Object.defineProperty(ca,"__esModule",{value:!0});
h=function(h){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var f=(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||"object"!==typeof f&&"function"!==typeof f?this:f}z(e,h);return e}(function(h){return h&&h.__esModule?h:{default:h}}(ea(0)).default.Text);ca.default=h},function(h,ca,ea){function z(e,f){if("function"!==typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+
typeof f);e.prototype=Object.create(f&&f.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});f&&(Object.setPrototypeOf?Object.setPrototypeOf(e,f):e.__proto__=f)}Object.defineProperty(ca,"__esModule",{value:!0});var x=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,w){h&&e(f.prototype,h);w&&e(f,w);return f}}(),e=function ba(e,
f,h){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,f);if(void 0===n){if(e=Object.getPrototypeOf(e),null!==e)return ba(e,f,h)}else{if("value"in n)return n.value;f=n.get;return void 0===f?void 0:f.call(h)}};h=(h=ea(54))&&h.__esModule?h:{default:h};ea=(ea=ea(10))&&ea.__esModule?ea:{default:ea};var f=(0,ea.default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,function(){for(var e=arguments.length,f=Array(e),
h=0;h<e;h++)f[h]=arguments[h];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(e){if(e.__quill&&e.__quill.emitter){var h;(h=e.__quill.emitter).handleDOM.apply(h,f)}})})});ea=function(h){function n(){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");var e=(n.__proto__||Object.getPrototypeOf(n)).call(this);if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");e=!e||"object"!==typeof e&&"function"!==typeof e?
this:e;e.listeners={};e.on("error",f.error);return e}z(n,h);x(n,[{key:"emit",value:function(){f.log.apply(f,arguments);e(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(e){for(var f=arguments.length,h=Array(1<f?f-1:0),n=1;n<f;n++)h[n-1]=arguments[n];(this.listeners[e.type]||[]).forEach(function(f){var n=f.node;f=f.handler;(e.target===n||n.contains(e.target))&&f.apply(void 0,[e].concat(h))})}},{key:"listenDOM",value:function(e,
f,h){this.listeners[e]||(this.listeners[e]=[]);this.listeners[e].push({node:f,handler:h})}}]);return n}(h.default);ea.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"};ea.sources={API:"api",SILENT:"silent",USER:"user"};ca.default=ea},function(h,ca){Object.defineProperty(ca,"__esModule",{value:!0});h=function x(h){var e=1<arguments.length&&void 0!==
arguments[1]?arguments[1]:{};if(!(this instanceof x))throw new TypeError("Cannot call a class as a function");this.quill=h;this.options=e};h.DEFAULTS={};ca.default=h},function(h,ca){function aa(f){if(x.indexOf(f)<=x.indexOf(e)){for(var h,r=arguments.length,n=Array(1<r?r-1:0),w=1;w<r;w++)n[w-1]=arguments[w];(h=console)[f].apply(h,n)}}function z(e){return x.reduce(function(f,h){f[h]=aa.bind(console,h,e);return f},{})}Object.defineProperty(ca,"__esModule",{value:!0});var x=["error","warn","log","info"],
e="warn";aa.level=z.level=function(f){e=f};ca.default=z},function(h,ca,ea){function z(e){return!e||"object"!==typeof e||"number"!==typeof e.length||"function"!==typeof e.copy||"function"!==typeof e.slice||0<e.length&&"number"!==typeof e[0]?!1:!0}function x(h,w,x){var n;if(null===h||void 0===h||null===w||void 0===w||h.prototype!==w.prototype)return!1;if(y(h)){if(!y(w))return!1;h=e.call(h);w=e.call(w);return r(h,w,x)}if(z(h)){if(!z(w)||h.length!==w.length)return!1;for(n=0;n<h.length;n++)if(h[n]!==w[n])return!1;
return!0}try{var ba=f(h);var aa=f(w)}catch(na){return!1}if(ba.length!=aa.length)return!1;ba.sort();aa.sort();for(n=ba.length-1;0<=n;n--)if(ba[n]!=aa[n])return!1;for(n=ba.length-1;0<=n;n--)if(aa=ba[n],!r(h[aa],w[aa],x))return!1;return typeof h===typeof w}var e=Array.prototype.slice,f=ea(52),y=ea(53),r=h.exports=function(e,f,h){h||(h={});return e===f?!0:e instanceof Date&&f instanceof Date?e.getTime()===f.getTime():!e||!f||"object"!=typeof e&&"object"!=typeof f?h.strict?e===f:e==f:x(e,f,h)}},function(h,
ca,ea){Object.defineProperty(ca,"__esModule",{value:!0});var z=ea(1);h=function(){function h(e,f,h){void 0===h&&(h={});this.attrName=e;this.keyName=f;e=z.Scope.TYPE&z.Scope.ATTRIBUTE;this.scope=null!=h.scope?h.scope&z.Scope.LEVEL|e:z.Scope.ATTRIBUTE;null!=h.whitelist&&(this.whitelist=h.whitelist)}h.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})};h.prototype.add=function(e,f){if(!this.canAdd(e,f))return!1;e.setAttribute(this.keyName,f);return!0};h.prototype.canAdd=function(e,
f){return null==z.query(e,z.Scope.BLOT&(this.scope|z.Scope.TYPE))?!1:null==this.whitelist?!0:"string"===typeof f?-1<this.whitelist.indexOf(f.replace(/["']/g,"")):-1<this.whitelist.indexOf(f)};h.prototype.remove=function(e){e.removeAttribute(this.keyName)};h.prototype.value=function(e){var f=e.getAttribute(this.keyName);return this.canAdd(e,f)&&f?f:""};return h}();ca.default=h},function(h,ca,ea){function z(e){return e&&e.__esModule?e:{default:e}}function x(e,f){if(!(e instanceof f))throw new TypeError("Cannot call a class as a function");
}function e(e,f){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!f||"object"!==typeof f&&"function"!==typeof f?e:f}function f(e,f){if("function"!==typeof f&&null!==f)throw new TypeError("Super expression must either be null or a function, not "+typeof f);e.prototype=Object.create(f&&f.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});f&&(Object.setPrototypeOf?Object.setPrototypeOf(e,f):e.__proto__=f)}Object.defineProperty(ca,
"__esModule",{value:!0});ca.default=ca.Code=void 0;var y=function(){return function(e,f){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var h=[],n=!0,r=!1,w=void 0;try{for(var y=e[Symbol.iterator](),x;!(n=(x=y.next()).done)&&(h.push(x.value),!f||h.length!==f);n=!0);}catch(va){r=!0,w=va}finally{try{if(!n&&y["return"])y["return"]()}finally{if(r)throw w;}}return h}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),r=function(){function e(e,f){for(var h=0;h<
f.length;h++){var n=f[h];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,n){h&&e(f.prototype,h);n&&e(f,n);return f}}(),n=function ya(e,f,h){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,f);if(void 0===n){if(e=Object.getPrototypeOf(e),null!==e)return ya(e,f,h)}else{if("value"in n)return n.value;f=n.get;return void 0===f?void 0:f.call(h)}};h=ea(2);var w=z(h);h=ea(0);var ba=z(h);h=ea(4);h=z(h);
var aa=ea(6);aa=z(aa);ea=ea(7);var fa=z(ea);ea=function(h){function n(){x(this,n);return e(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}f(n,h);return n}(aa.default);ea.blotName="code";ea.tagName="CODE";h=function(h){function z(){x(this,z);return e(this,(z.__proto__||Object.getPrototypeOf(z)).apply(this,arguments))}f(z,h);r(z,[{key:"delta",value:function(){var e=this,f=this.domNode.textContent;f.endsWith("\n")&&(f=f.slice(0,-1));return f.split("\n").reduce(function(f,h){return f.insert(h).insert("\n",
e.formats())},new w.default)}},{key:"format",value:function(e,f){if(e!==this.statics.blotName||!f){var h=this.descendant(fa.default,this.length()-1);h=y(h,1)[0];null!=h&&h.deleteAt(h.length()-1,1);n(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"format",this).call(this,e,f)}}},{key:"formatAt",value:function(e,f,h,n){if(0!==f&&null!=ba.default.query(h,ba.default.Scope.BLOCK)&&(h!==this.statics.blotName||n!==this.statics.formats(this.domNode))){var r=this.newlineIndex(e);if(!(0>r||r>=e+
f)){var w=this.newlineIndex(e,!0)+1;r=r-w+1;var y=this.isolate(w,r),x=y.next;y.format(h,n);x instanceof z&&x.formatAt(0,e-w+f-r,h,n)}}}},{key:"insertAt",value:function(e,f,h){null==h&&(e=this.descendant(fa.default,e),e=y(e,2),e[0].insertAt(e[1],f))}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){if(1<arguments.length&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,
e).lastIndexOf("\n");var f=this.domNode.textContent.slice(e).indexOf("\n");return-1<f?e+f:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(ba.default.create("text","\n"));n(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"optimize",this).call(this,e);var f=this.next;null!=f&&f.prev===this&&f.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===f.statics.formats(f.domNode)&&(f.optimize(e),f.moveChildren(this),f.remove())}},
{key:"replace",value:function(e){n(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"replace",this).call(this,e);[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var f=ba.default.find(e);null==f?e.parentNode.removeChild(e):f instanceof ba.default.Embed?f.remove():f.unwrap()})}}],[{key:"create",value:function(e){e=n(z.__proto__||Object.getPrototypeOf(z),"create",this).call(this,e);e.setAttribute("spellcheck",!1);return e}},{key:"formats",value:function(){return!0}}]);
return z}(h.default);h.blotName="code-block";h.tagName="PRE";h.TAB=" ";ca.Code=ea;ca.default=h},function(h,ca,ea){function z(e){return e&&e.__esModule?e:{default:e}}function x(e,f,h){f in e?Object.defineProperty(e,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):e[f]=h;return e}function e(e,f){return Object.keys(f).reduce(function(h,n){if(null==e[n])return h;f[n]===e[n]?h[n]=f[n]:Array.isArray(f[n])?0>f[n].indexOf(e[n])&&(h[n]=f[n].concat([e[n]])):h[n]=[f[n],e[n]];return h},{})}function f(e){return e.reduce(function(e,
f){if(1===f.insert){var h=(0,ya.default)(f.attributes);delete h.image;return e.insert({image:f.attributes.image},h)}null==f.attributes||!0!==f.attributes.list&&!0!==f.attributes.bullet||(f=(0,ya.default)(f),f.attributes.list?f.attributes.list="ordered":(f.attributes.list="bullet",delete f.attributes.bullet));return"string"===typeof f.insert?(h=f.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e.insert(h,f.attributes)):e.push(f)},new w.default)}Object.defineProperty(ca,"__esModule",{value:!0});var y=
"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){return function(e,f){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var h=[],n=!0,r=!1,w=void 0;try{for(var y=e[Symbol.iterator](),x;!(n=(x=y.next()).done)&&(h.push(x.value),!f||h.length!==f);n=!0);}catch(Aa){r=!0,w=Aa}finally{try{if(!n&&y["return"])y["return"]()}finally{if(r)throw w;
}}return h}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),n=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,n){h&&e(f.prototype,h);n&&e(f,n);return f}}();h=ea(2);var w=z(h);h=ea(20);var ba=z(h);h=ea(0);var aa=z(h);h=ea(13);var fa=z(h);h=ea(24);var da=z(h),ha=ea(4),ka=z(ha);h=ea(16);var ja=z(h);h=ea(21);var ya=z(h);h=
ea(11);var ma=z(h);ea=ea(3);var sa=z(ea),Ba=/^[ -~]*$/;ea=function(){function h(e){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");this.scroll=e;this.delta=this.getDelta()}n(h,[{key:"applyDelta",value:function(e){var h=this,n=!1;this.scroll.update();var w=this.scroll.length();this.scroll.batchStart();e=f(e);e.reduce(function(e,f){var x=f.retain||f.delete||f.insert.length||1,z=f.attributes||{};if(null!=f.insert){if("string"===typeof f.insert){f=f.insert;f.endsWith("\n")&&
n&&(n=!1,f=f.slice(0,-1));e>=w&&!f.endsWith("\n")&&(n=!0);h.scroll.insertAt(e,f);f=h.scroll.line(e);f=r(f,2);var ca=f[0],ea=f[1];f=(0,sa.default)({},(0,ha.bubbleFormats)(ca));ca instanceof ka.default&&(ca=ca.descendant(aa.default.Leaf,ea),ca=r(ca,1)[0],f=(0,sa.default)(f,(0,ha.bubbleFormats)(ca)));z=ba.default.attributes.diff(f,z)||{}}else if("object"===y(f.insert)){ca=Object.keys(f.insert)[0];if(null==ca)return e;h.scroll.insertAt(e,ca,f.insert[ca])}w+=x}Object.keys(z).forEach(function(f){h.scroll.formatAt(e,
x,f,z[f])});return e+x},0);e.reduce(function(e,f){return"number"===typeof f.delete?(h.scroll.deleteAt(e,f.delete),e):e+(f.retain||f.insert.length||1)},0);this.scroll.batchEnd();return this.update(e)}},{key:"deleteText",value:function(e,f){this.scroll.deleteAt(e,f);return this.update((new w.default).retain(e).delete(f))}},{key:"formatLine",value:function(e,f){var h=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update();Object.keys(n).forEach(function(r){if(null==h.scroll.whitelist||
h.scroll.whitelist[r]){var w=h.scroll.lines(e,Math.max(f,1)),y=f;w.forEach(function(f){var w=f.length();if(f instanceof fa.default){var x=e-f.offset(h.scroll),ba=f.newlineIndex(x+y)-x+1;f.formatAt(x,ba,r,n[r])}else f.format(r,n[r]);y-=w})}});this.scroll.optimize();return this.update((new w.default).retain(e).retain(f,(0,ya.default)(n)))}},{key:"formatText",value:function(e,f){var h=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach(function(r){h.scroll.formatAt(e,
f,r,n[r])});return this.update((new w.default).retain(e).retain(f,(0,ya.default)(n)))}},{key:"getContents",value:function(e,f){return this.delta.slice(e,e+f)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,f){return e.concat(f.delta())},new w.default)}},{key:"getFormat",value:function(f){var h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=[],w=[];0===h?this.scroll.path(f).forEach(function(e){e=r(e,1)[0];e instanceof ka.default?n.push(e):e instanceof aa.default.Leaf&&
w.push(e)}):(n=this.scroll.lines(f,h),w=this.scroll.descendants(aa.default.Leaf,f,h));h=[n,w].map(function(f){if(0===f.length)return{};for(var h=(0,ha.bubbleFormats)(f.shift());0<Object.keys(h).length;){var n=f.shift();if(null==n)break;h=e((0,ha.bubbleFormats)(n),h)}return h});return sa.default.apply(sa.default,h)}},{key:"getText",value:function(e,f){return this.getContents(e,f).filter(function(e){return"string"===typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,
f,h){this.scroll.insertAt(e,f,h);return this.update((new w.default).retain(e).insert(x({},f,h)))}},{key:"insertText",value:function(e,f){var h=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};f=f.replace(/\r\n/g,"\n").replace(/\r/g,"\n");this.scroll.insertAt(e,f);Object.keys(n).forEach(function(r){h.scroll.formatAt(e,f.length,r,n[r])});return this.update((new w.default).retain(e).insert(f,(0,ya.default)(n)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;
if(1<this.scroll.children.length)return!1;var e=this.scroll.children.head;return e.statics.blotName!==ka.default.blotName||1<e.children.length?!1:e.children.head instanceof ja.default}},{key:"removeFormat",value:function(e,f){var h=this.getText(e,f),n=this.scroll.line(e+f),y=r(n,2);n=y[0];y=y[1];var x=0,ba=new w.default;null!=n&&(x=n instanceof fa.default?n.newlineIndex(y)-y+1:n.length()-y,ba=n.delta().slice(y,y+x-1).insert("\n"));f=this.getContents(e,f+x).diff((new w.default).insert(h).concat(ba));
e=(new w.default).retain(e).concat(f);return this.applyDelta(e)}},{key:"update",value:function(e){var f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],h=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0,n=this.delta;if(1===f.length&&"characterData"===f[0].type&&f[0].target.data.match(Ba)&&aa.default.find(f[0].target)){var r=aa.default.find(f[0].target),y=(0,ha.bubbleFormats)(r),x=r.offset(this.scroll);f=f[0].oldValue.replace(da.default.CONTENTS,"");f=(new w.default).insert(f);
r=(new w.default).insert(r.value());e=(new w.default).retain(x).concat(f.diff(r,h)).reduce(function(e,f){return f.insert?e.insert(f.insert,y):e.push(f)},new w.default);this.delta=n.compose(e)}else this.delta=this.getDelta(),e&&(0,ma.default)(n.compose(e),this.delta)||(e=n.diff(this.delta,h));return e}}]);return h}();ca.default=ea},function(h,ca,ea){function z(e){return e&&e.__esModule?e:{default:e}}function x(e){if(Array.isArray(e)){for(var f=0,h=Array(e.length);f<e.length;f++)h[f]=e[f];return h}return Array.from(e)}
function e(e,f){if(!(e instanceof f))throw new TypeError("Cannot call a class as a function");}function f(e,f){try{f.parentNode}catch(ja){return!1}f instanceof Text&&(f=f.parentNode);return e.contains(f)}Object.defineProperty(ca,"__esModule",{value:!0});ca.default=ca.Range=void 0;var y=function(){return function(e,f){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var h=[],n=!0,r=!1,w=void 0;try{for(var y=e[Symbol.iterator](),x;!(n=(x=y.next()).done)&&(h.push(x.value),!f||h.length!==
f);n=!0);}catch(qa){r=!0,w=qa}finally{try{if(!n&&y["return"])y["return"]()}finally{if(r)throw w;}}return h}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),r=function(){function e(e,f){for(var h=0;h<f.length;h++){var n=f[h];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(e,n.key,n)}}return function(f,h,n){h&&e(f.prototype,h);n&&e(f,n);return f}}();h=ea(0);var n=z(h);h=ea(21);var w=z(h);h=ea(11);var ba=z(h);h=ea(8);
var aa=z(h);ea=ea(10);ea=z(ea);var fa=(0,ea.default)("quill:selection"),da=function ja(f){var h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;e(this,ja);this.index=f;this.length=h};ea=function(){function h(f,r){var w=this;e(this,h);this.emitter=r;this.scroll=f;this.mouseDown=this.composing=!1;this.root=this.scroll.domNode;this.cursor=n.default.create("cursor",this);this.lastRange=this.savedRange=new da(0,0);this.handleComposition();this.handleDragging();this.emitter.listenDOM("selectionchange",
document,function(){w.mouseDown||setTimeout(w.update.bind(w,aa.default.sources.USER),1)});this.emitter.on(aa.default.events.EDITOR_CHANGE,function(e,f){e===aa.default.events.TEXT_CHANGE&&0<f.length()&&w.update(aa.default.sources.SILENT)});this.emitter.on(aa.default.events.SCROLL_BEFORE_UPDATE,function(){if(w.hasFocus()){var e=w.getNativeRange();if(null!=e&&e.start.node!==w.cursor.textNode)w.emitter.once(aa.default.events.SCROLL_UPDATE,function(){try{w.setNativeRange(e.start.node,e.start.offset,e.end.node,
e.end.offset)}catch(Ba){}})}});this.emitter.on(aa.default.events.SCROLL_OPTIMIZE,function(e,f){f.range&&(e=f.range,w.setNativeRange(e.startNode,e.startOff