wed
Version:
Wed is a schema-aware editor for XML documents.
34 lines (32 loc) • 452 kB
JavaScript
define("wed",["jquery","bootstrap","salve-dom","merge-options","ajv","salve","bootbox","interactjs","rangy","typeahead","bootstrap-notify","log4javascript","dexie","bluejax"],function(t,e,n,r,i,o,s,a,u,c,l,d,h,f){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=91)}([function(t,e,n){"use strict";n.d(e,"a",function(){return i});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.assign},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(32),o=n(55),s=n(5),a=n(39),u=n(19),c=n(38),l=function(t){function e(e,n,r){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=o.a;break;case 1:if(!e){i.destination=o.a;break}if("object"==typeof e){if(h(e)){var s=e[a.a]();i.syncErrorThrowable=s.syncErrorThrowable,i.destination=s,s.add(i)}else i.syncErrorThrowable=!0,i.destination=new d(i,e);break}default:i.syncErrorThrowable=!0,i.destination=new d(i,e,n,r)}return i}return r.a(e,t),e.prototype[a.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(s.a),d=function(t){function e(e,n,r,s){var a,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return Object(i.a)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==o.a&&(c=Object.create(n),Object(i.a)(c.unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=r,u._complete=s,u}return r.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=u.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),u.a.useDeprecatedSynchronousErrorHandling)throw n;Object(c.a)(n)}},e.prototype.__tryOrSetError=function(t,e,n){if(!u.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return u.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(Object(c.a)(r),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l);function h(t){return t instanceof l||"syncErrorThrowable"in t&&t[a.a]}},function(t,e,n){"use strict";var r=n(1),i=n(39),o=n(55);var s=n(25),a=n(42),u=n(19);n.d(e,"a",function(){return c});var c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var s=this.operator,a=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(s?s.call(a,this.source):a.add(this.source||!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))(function(e,r){var i;i=n.subscribe(function(e){try{t(e)}catch(n){r(n),i&&i.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[s.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:Object(a.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=u.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";var r=n(0),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(1).a),o=n(78);function s(t,e,n,r){var s=new i(t,n,r);return Object(o.a)(e)(s)}n.d(e,"a",function(){return s})},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n(1).a)},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(10),i=n(75),o=n(32),s=n(14),a=n(6),u=n(43),c=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,c=this._parents,d=this._unsubscribe,h=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var f=-1,p=c?c.length:0;n;)n.remove(this),n=++f<p&&c[f]||null;if(Object(o.a)(d))Object(s.a)(d).call(this)===a.a&&(e=!0,t=t||(a.a.e instanceof u.a?l(a.a.e.errors):[a.a.e]));if(Object(r.a)(h))for(f=-1,p=h.length;++f<p;){var v=h[f];if(Object(i.a)(v))if(Object(s.a)(v.unsubscribe).call(v)===a.a){e=!0,t=t||[];var m=a.a.e;m instanceof u.a?t=t.concat(l(m.errors)):t.push(m)}}if(e)throw new u.a(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function l(t){return t.reduce(function(t,e){return t.concat(e instanceof u.a?e.errors:e)},[])}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={e:{}}},function(t,e,n){"use strict";n.d(e,"b",function(){return l}),n.d(e,"a",function(){return d});var r=n(0),i=n(2),o=n(1),s=n(5),a=n(26),u=n(76),c=n(39),l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(o.a),d=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.a(e,t),e.prototype[c.a]=function(){return new l(this)},e.prototype.lift=function(t){var e=new h(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.a;return this.hasError?(t.error(this.thrownError),s.a.EMPTY):this.isStopped?(t.complete(),s.a.EMPTY):(this.observers.push(t),new u.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new h(t,e)},e}(i.a),h=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.a(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.a.EMPTY},e}(d)},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o});var r=n(2),i=new r.a(function(t){return t.complete()});function o(t){return t?function(t){return new r.a(function(e){return t.schedule(function(){return e.complete()})})}(t):i}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(36),i=new(n(34).a)(r.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=Array.isArray||function(t){return t&&"number"==typeof t.length}},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",function(){return r})},function(t,e,n){var r,i,o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};
/**
* Utilities that manipulate or query the DOM tree.
* @author Louis-Dominique Dubeau
* @license MPL 2.0
* @copyright Mangalam Research Center for Buddhist Languages
*/r=[n,e,n(16),n(15),n(28)],void 0===(i=function(t,e,n,r,i){"use strict";function a(t,e){const n=t.length;for(let r=0;r<n;++r)if(t[r]===e)return r;return-1}function u(t,e,n){let r=t.firstChild,i=0;for(;null!==r&&!r.contains(n);)i++,r=r.nextSibling;return e-i<=0?-1:1}function c(t,e,n,r){if(t===n){const t=e-r;return 0===t?0:t<0?-1:1}const i=t.compareDocumentPosition(n);if(0!=(i&Node.DOCUMENT_POSITION_DISCONNECTED))throw new Error("cannot compare disconnected nodes");if(0!=(i&Node.DOCUMENT_POSITION_CONTAINED_BY))return u(t,e,n);if(0!=(i&Node.DOCUMENT_POSITION_CONTAINS))return u(n,r,t)<0?1:-1;if(0!=(i&Node.DOCUMENT_POSITION_PRECEDING))return 1;if(0!=(i&Node.DOCUMENT_POSITION_FOLLOWING))return-1;throw new Error("neither preceding nor following: this should not happen")}function l(t){const e=t.getSelection();if(!(void 0===e||e.rangeCount<1))return e.getRangeAt(0)}function d(t,e,n,i=!0){if(!r.isText(t))throw new Error("insertIntoText called on non-text");let o,s,u,c;void 0===i&&(i=!0),e<0?e=0:e>t.length&&(e=t.length);const l=r.isDocumentFragment(n),d=t.parentNode;if(null==d)throw new Error("detached node");let h=a(d.childNodes,t);if(i&&(null==n||l&&0===n.childNodes.length))o=s=[t,e];else{const r=document.createDocumentFragment();u=document.createTextNode(t.data.slice(0,e)),r.appendChild(u),null!=n&&r.appendChild(n);const a=(c=document.createTextNode(t.data.slice(e))).length;if(r.appendChild(c),i&&r.normalize(),o=i&&0===e?[d,h]:[r.firstChild,e],s=i&&e===t.length?[d,h+r.childNodes.length]:[r.lastChild,r.lastChild.length-a],this.deleteNode(t),void 0!==this.insertFragAt)this.insertFragAt(d,h,r);else for(;null!=r.firstChild;)this.insertNodeAt(d,h++,r.firstChild)}return[o,s]}function h(t,e,n){if(null==n)throw new Error("must pass an actual node to insert");return d.call(this,t,e,n)}function f(t,e,n,i=!0){if(""===n)return{node:void 0,isNew:!1,caret:[t,e]};let o,s,a=!1;t:for(;;)switch(t.nodeType){case Node.ELEMENT_NODE:const u=t.childNodes[e];if(r.isText(u)){t=u,e=0;continue t}const c=t.childNodes[e-1];if(r.isText(c)){t=c,e=c.length;continue t}o=document.createTextNode(n),a=!0,this.insertNodeAt(t,e,o),s=[o,i?n.length:0];break t;case Node.TEXT_NODE:const l=(o=t).data.slice(0,e),d=o.data.slice(e);this.setTextNodeValue(o,l+n+d),s=[o,i?e+n.length:e];break t;default:throw new Error(`unexpected node type: ${t.nodeType}`)}return{node:o,isNew:a,caret:s}}function p(t){if(null==t.parentNode)throw new Error("detached node");t.parentNode.removeChild(t)}function v(t,e,n){const r=t.childNodes[e];t.insertBefore(n,null!=r?r:null)}Object.defineProperty(e,"__esModule",{value:!0}),n=o(n),i=s(i),e.isAttr=r.isAttr,e.indexOf=a,e.comparePositions=c,e.getSelectionRange=l,e.rangeFromPoints=function(t,e,n,r){const i=t.ownerDocument.createRange();let o=!1;return c(t,e,n,r)<=0?(i.setStart(t,e),i.setEnd(n,r)):(i.setStart(n,r),i.setEnd(t,e),o=!0),{range:i,reversed:o}},e.focusNode=function(t){switch(null!=t?t.nodeType:void 0){case Node.TEXT_NODE:if(null==t.parentNode)throw new Error("detached node");t.parentNode.focus();break;case Node.ELEMENT_NODE:t.focus();break;default:throw new Error("tried to focus something other than a text node or an element.")}},e.nextCaretPosition=function(t,e,n){let[i,o]=t,s=!1;if(!e.contains(i))return null;const u=(r.isDocument(i)?i:i.ownerDocument).defaultView;let c;t:for(;!s;)switch(c=i.parentNode,i.nodeType){case Node.TEXT_NODE:if(o>=i.length||null!=c&&c.lastChild===i&&"normal"===u.getComputedStyle(c,void 0).whiteSpace&&/^\s+$/.test(i.data.slice(o))){if(null==c||i===e)break t;o=a(c.childNodes,i)+1,i=c}else o++,s=!0;break;case Node.ELEMENT_NODE:if(o>=i.childNodes.length){if(null==c||i===e)break t;o=a(c.childNodes,i)+1,i=c,s=!0}else i=i.childNodes[o],o=0,s=!(i.childNodes.length>0&&r.isText(i.childNodes[o]))}if(!s)return null;if(n&&r.isText(i)){if(null==(c=i.parentNode))throw new Error("detached node");o=a(c.childNodes,i),i=c}return!e.contains(i)||i===e&&o>=i.childNodes.length?null:[i,o]},e.prevCaretPosition=function(t,e,n){let[i,o]=t,s=!1;if(!e.contains(i))return null;const u=(r.isDocument(i)?i:i.ownerDocument).defaultView;let c;t:for(;!s;){if(o--,i===e&&o<0)return null;switch(c=i.parentNode,i.nodeType){case Node.TEXT_NODE:if(o<0||null!=c&&c.firstChild===i&&"normal"===u.getComputedStyle(c,void 0).whiteSpace&&/^\s+$/.test(i.data.slice(0,o))){if(null===c||i===e)break t;o=a(c.childNodes,i),i=c}else s=!0;break;case Node.ELEMENT_NODE:if(o<0||0===i.childNodes.length){if(null==c||i===e)break t;o=a(c.childNodes,i),i=c,s=!0}else i=i.childNodes[o],r.isElement(i)?(o=i.childNodes.length,s=!(i.childNodes.length>0&&r.isText(i.childNodes[o-1]))):o=i.length+1}}if(!s)return null;if(n&&r.isText(i)){if(null==(c=i.parentNode))throw new Error("detached node");o=a(c.childNodes,i),i=c}return!e.contains(i)||i===e&&o<0?null:[i,o]},e.correspondingNode=function(t,e,n){const r=[];let i=n;for(;i!==t;){const t=i.parentNode;if(null==t)throw new Error("nodeInA is not treeA or a child of treeA");r.unshift(a(t.childNodes,i)),i=t}let o=e;for(;0!==r.length;)o=o.childNodes[r.shift()];return o},e.makePlaceholder=function(t){const e=document.createElement("span");return e.className="_placeholder",e.textContent=void 0!==t?t:" ",e},e.genericInsertIntoText=h,e.genericInsertText=f,e.deleteText=function(t,e,n){if(!r.isText(t))throw new Error("deleteText called on non-text");if(t.deleteData(e,n),0===t.length){if(null==t.parentNode)throw new Error("detached node");t.parentNode.removeChild(t)}},e.linkTrees=function t(e,r){n.default.data(e,"wed_mirror_node",r),n.default.data(r,"wed_mirror_node",e);for(let n=0;n<e.children.length;++n)t(e.children[n],r.children[n])},e.unlinkTree=function t(e){n.default.removeData(e,"wed_mirror_node");for(let n=0;n<e.children.length;++n)t(e.children[n])},e.firstDescendantOrSelf=function(t){for(void 0===t&&(t=null);null!==t&&null!==t.firstChild;)t=t.firstChild;return t},e.lastDescendantOrSelf=function(t){for(void 0===t&&(t=null);null!==t&&null!==t.lastChild;)t=t.lastChild;return t},e.deleteNode=p,e.insertText=function(t,e,n,r){return f.call({insertNodeAt:v,setTextNodeValue:(t,e)=>{t.data=e}},t,e,n,r)};const m={insertNodeAt:v,insertFragAt:v,deleteNode:p};function b(t){const e=function(t){let e,n;switch(t.startContainer.nodeType){case Node.TEXT_NODE:if(null==(e=t.startContainer.parentNode))throw new Error("detached node");break;case Node.ELEMENT_NODE:e=t.startContainer;break;default:throw new Error(`unexpected node type: ${t.startContainer.nodeType}`)}switch(t.endContainer.nodeType){case Node.TEXT_NODE:if(null==(n=t.endContainer.parentNode))throw new Error("detached node");break;case Node.ELEMENT_NODE:n=t.endContainer;break;default:throw new Error(`unexpected node type: ${t.endContainer.nodeType}`)}return[e,n]}(t);return e[0]===e[1]}function g(t,e){null==e?console.log(t,"no range"):console.log(t,e.startContainer,e.startOffset,e.endContainer,e.endOffset)}let y;e.insertIntoText=function(t,e,n){return h.call(m,t,e,n)},e.splitTextNode=function(t,e){const n=function(t,e,n,r=!0){return d.call(m,t,e,n,r)}(t,e,void 0,!1);return[n[0][0],n[1][0]]},e.mergeTextNodes=function(t){const e=t.nextSibling;if(r.isText(t)&&r.isText(e)){const n=t.length;return t.appendData(e.data),e.parentNode.removeChild(e),[t,n]}const n=t.parentNode;if(null==n)throw new Error("detached node");return[n,a(n.childNodes,t)+1]},e.isWellFormedRange=b,e.genericCutFunction=function(t,e){let[n,i]=t,[o,s]=e;if(!b({startContainer:n,startOffset:i,endContainer:o,endOffset:s}))throw new Error("range is not well-formed");let u,c,l,d=n.parentNode;if(null==d)throw new Error("detached node");if(r.isText(n)&&0===i&&(i=a(d.childNodes,n),null==(d=(n=d).parentNode)))throw new Error("detached node");if(r.isText(n)){const t=n===o,e=a(d.childNodes,n),r=t?s:n.length;c=d.ownerDocument.createTextNode(n.data.slice(i,r)),this.deleteText(n,i,c.length);const l=null!==n.parentNode;if(u=l?[n,i]:[d,e],t)return[u,[c]];i=l?e+1:e,n=d}else u=[n,i];if(r.isText(o)){if(null==(d=o.parentNode))throw new Error("detached node");const t=a(d.childNodes,o);l=d.ownerDocument.createTextNode(o.data.slice(0,s)),this.deleteText(o,0,s),s=t,o=d}if(n!==o)throw new Error("internal error in cut: containers unequal");if(!r.isElement(n))throw new Error("internal error in cut: not an element");const h=void 0===c?[]:[c];for(let r=--s-i;r>=0;r--)h.push(o.childNodes[i]),this.deleteNode(o.childNodes[i]);return null!=l&&h.push(l),null!=o.childNodes[i-1]&&this.mergeTextNodes(o.childNodes[i-1]),[u,h]},e.copy=function(t,e){let[n,i]=t,[o,s]=e;if(!b({startContainer:n,startOffset:i,endContainer:o,endOffset:s}))throw new Error("range is not well-formed");let u,c,l=n.parentNode;if(null==l)throw new Error("detached node");if(r.isText(n)&&0===i&&(i=a(l.childNodes,n),null==(l=(n=l).parentNode)))throw new Error("detached node");if(r.isText(n)){const t=n===o,e=a(l.childNodes,n),r=t?s:n.length;if(u=l.ownerDocument.createTextNode(n.data.slice(i,r)),t)return[u];i=e+1,n=l}if(r.isText(o)){if(null==(l=o.parentNode))throw new Error("detached node");const t=a(l.childNodes,o);c=l.ownerDocument.createTextNode(o.data.slice(0,s)),s=t,o=l}if(n!==o)throw new Error("internal error in cut: containers unequal");if(!r.isElement(n))throw new Error("internal error in cut: not an element");const d=void 0===u?[]:[u];for(s--;i<=s;)d.push(o.childNodes[i++].cloneNode(!0));return null!=c&&d.push(c),d},e.dumpRange=g,e.dumpCurrentSelection=function(t,e){g(t,l(e))},e.dumpRangeToString=function(t,e){let n;return(n=null==e?[t,"no range"]:[t,e.startContainer.outerHTML,e.startOffset,e.endContainer.outerHTML,e.endOffset]).join(", ")},e.pointInContents=function(t,e,n){const r=t.ownerDocument.body,i=t.getBoundingClientRect();return e-=i.left+r.scrollLeft,n-=i.top+r.scrollTop,e>=0&&n>=0&&e<t.clientWidth&&n<t.clientHeight},e.closest=function(t,e,n){if(null==t)return null;for(r.isText(t)&&(t=t.parentNode);null!=t;){if(!r.isElement(t))return null;if(t.matches(e))break;if(t===n){t=null;break}t=t.parentNode}return t},e.closestByClass=function(t,e,n){if(null==t)return null;for(r.isText(t)&&(t=t.parentNode);null!=t;){if(!r.isElement(t))return null;if(t.classList.contains(e))break;if(t===n){t=null;break}t=t.parentNode}return t},e.siblingByClass=function(t,e){if(!r.isElement(t))return null;const n=t.parentNode;if(null==n)return null;let i=n.firstElementChild;for(;null!=i&&!i.classList.contains(e);)i=i.nextElementSibling;return i},e.childrenByClass=function(t,e){if(!r.isElement(t))return[];const n=[];let i=t.firstElementChild;for(;null!=i;)i.classList.contains(e)&&n.push(i),i=i.nextElementSibling;return n},e.childByClass=function(t,e){if(!r.isElement(t))return null;let n=t.firstElementChild;for(;null!=n&&!n.classList.contains(e);)n=n.nextElementSibling;return n},e.textToHTML=function(t){return null==y&&(y=document.createElement("span")),y.textContent=t,y.innerHTML};const w=",>+~ ",_=new RegExp(`([${w}]+)`);function x(t,e){if(/[\]['"()]/.test(t))throw new Error("selector is too complex");if(/\\:/.test(t))throw new Error("we do not accept escaped colons for now");const n=t.split(_);let r=[];for(let o of n)if(0!==o.length)if(w.indexOf(o)>-1)r.push(o);else if(/[a-zA-Z]/.test(o[0])){const t=(o=o.trim()).split(/(.#)/);r.push(i.classFromOriginalName(t[0],e)),r=r.concat(t.slice(1))}else r.push(o);return r.join("")}e.toGUISelector=x,e.dataFind=function(t,e,r){const i=x(e,r),o=n.default.data(t,"wed_mirror_node").querySelector(i);if(null==o)return null;const s=n.default.data(o,"wed_mirror_node");return null!=s?s:null},e.dataFindAll=function(t,e,r){const i=x(e,r),o=n.default.data(t,"wed_mirror_node").querySelectorAll(i),s=[];for(let a=0;a<o.length;++a)s.push(n.default.data(o[a],"wed_mirror_node"));return s},e.htmlToElements=function(t,e){const n=null!=e?e:window.document,r=n.createDocumentFragment(),i=n.createElement("div");r.appendChild(i),i.innerHTML=t;const o=Array.prototype.slice.call(i.childNodes);for(;null!==i.firstChild;)i.removeChild(i.firstChild);return o},e.getCharacterImmediatelyBefore=function(t){const[e,n]=t;switch(e.nodeType){case Node.TEXT_NODE:return e.data[n-1];case Node.ELEMENT_NODE:const t=e.childNodes[n-1];if(r.isText(t))return t.data[t.data.length-1];break;default:throw new Error(`unexpected node type: ${e.nodeType}`)}},e.getCharacterImmediatelyAt=function(t){const[e,n]=t;switch(e.nodeType){case Node.TEXT_NODE:return e.data[n];case Node.ELEMENT_NODE:const t=e.childNodes[n];if(r.isText(t))return t.data[0];break;default:throw new Error(`unexpected node type: ${e.nodeType}`)}},e.isNotDisplayed=function(t,e){const n=t.ownerDocument.defaultView;for(;null!=t&&t!==e;){if("none"===t.style.display)return!0;if("none"===n.getComputedStyle(t).getPropertyValue("display"))return!0;t=t.parentNode}return!1},e.contains=function(t,e){return r.isAttr(e)&&(e=e.ownerElement),t.contains(e)}}.apply(e,r))||(t.exports=i)},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),i=n(1);function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}}var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r,i=n(6);function o(){try{return r.apply(this,arguments)}catch(t){return i.a.e=t,i.a}}function s(t){return r=t,o}},function(t,e,n){var r;
/**
* Typeguards to facilitate working with TypeScript and the DOM.
* @author Louis-Dominique Dubeau
* @license MPL 2.0
* @copyright Mangalam Research Center for Buddhist Languages
*/void 0===(r=function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNode=function(t){return null!=t&&"number"==typeof t.nodeType},e.isElement=function(t){return null!=t&&t.nodeType===Node.ELEMENT_NODE},e.isText=function(t){return null!=t&&t.nodeType===Node.TEXT_NODE};const n=Node.ATTRIBUTE_NODE;const r=void 0===n?function(t){return t instanceof Attr}:function(t){return t instanceof Attr||null!=t&&t.nodeType===n};e.isAttr=r,e.isDocumentFragment=function(t){return null!=t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE},e.isDocument=function(t){return null!=t&&t.nodeType===Node.DOCUMENT_NODE}}.apply(e,[n,e]))||(t.exports=r)},function(e,n){e.exports=t},function(t,e,n){"use strict";var r=n(2),i=n(80),o=n(79),s=n(25);var a=n(24);var u=n(18),c=n(5),l=n(81);var d=n(82);var h=n(83);var f=n(78);function p(t,e){if(!e)return t instanceof r.a?t:new r.a(Object(f.a)(t));if(null!=t){if(function(t){return t&&"function"==typeof t[s.a]}(t))return function(t,e){return e?new r.a(function(n){var r=new c.a;return r.add(e.schedule(function(){var i=t[s.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r}):new r.a(Object(h.a)(t))}(t,e);if(Object(i.a)(t))return function(t,e){return e?new r.a(function(n){var r=new c.a;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r}):new r.a(Object(l.a)(t))}(t,e);if(Object(o.a)(t))return Object(u.a)(t,e);if(function(t){return t&&"function"==typeof t[a.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return e?new r.a(function(n){var r,i=new c.a;return i.add(function(){r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(function(){r=t[a.a](),i.add(e.schedule(function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(o){return void n.error(o)}e?n.complete():(n.next(t),this.schedule())}}))})),i}):new r.a(Object(d.a)(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}n.d(e,"a",function(){return p})},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(5),o=n(77);function s(t,e){return e?new r.a(function(n){var r=new i.a,o=0;return r.add(e.schedule(function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()})),r}):new r.a(Object(o.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,e,n){"use strict";function r(){}n.d(e,"a",function(){return r})},function(t,e,n){var r,i,o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};r=[n,e,n(16),n(15),n(12)],void 0===(i=function(t,e,n,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n=o(n);class s{constructor(t){if(this.node=t,null!=n.default.data(t,"wed-dloc-root"))throw new Error("node already marked as root");n.default.data(t,"wed-dloc-root",this)}nodeToPath(t){if(null==t)throw new Error("invalid node parameter");const e=this.node;if(e===t)return"";if(!i.contains(e,t))throw new Error("node is not a descendant of root");const n=[];for(;t!==e;){let e;if(r.isAttr(t))e=t.ownerElement,n.unshift(`@${t.name}`);else{let r=0;e=t.parentNode;let i=t.previousSibling;for(;null!==i;){const t=i.nodeType;t!==Node.TEXT_NODE&&t!==Node.ELEMENT_NODE||r++,i=i.previousSibling}n.unshift(String(r))}t=e}return n.join("/")}pathToNode(t){const e=this.node;if(""===t)return e;const n=t.split(/\//);let i,o=e;"@"===n[n.length-1][0]&&(i=n.pop());for(const r of n){if(!/^(\d+)$/.test(r))throw new Error("malformed path expression");{let t=parseInt(r),e=null,n=o.firstChild;for(;null!==n&&null===e;){const r=n.nodeType;(r===Node.TEXT_NODE||r===Node.ELEMENT_NODE)&&--t<0&&(e=n),n=n.nextSibling}if(null===e)return null;o=e}}if(void 0===i)return o;if(!r.isElement(o))throw new Error("parent must be an element since we are looking for an attribute");return o.getAttributeNode(i.slice(1))}}function a(t){let e;if(r.isAttr(t))e=t.value.length;else switch(t.nodeType){case Node.TEXT_NODE:e=t.data.length;break;case Node.DOCUMENT_NODE:case Node.ELEMENT_NODE:e=t.childNodes.length;break;default:throw new Error("unexpected node type")}return e}e.DLocRoot=s;class u{constructor(t,e,n){this.root=t,this.node=e,this.offset=n}get pointedNode(){return r.isElement(this.node)?this.node.childNodes[this.offset]:this.node}clone(){return new u(this.root,this.node,this.offset)}static makeDLoc(t,e,r,o){if(e instanceof Array&&(o=r,[e,r]=e),void 0===o&&(o=!1),null==e)return;if(void 0===r){const t=e.parentNode;if(null===t)throw new Error("trying to get parent of a detached node");r=i.indexOf(t.childNodes,e),e=t}else{if("number"!=typeof r)throw new Error("offset is not a number, somehow");if(r<0){if(!o)throw new Error("negative offsets are not allowed");r=0}}if(t instanceof s)t=t.node;else if(null==n.default.data(t,"wed-dloc-root"))throw new Error("root has not been marked as a root");if(!i.contains(t,e))throw new Error("node not in root");const c=a(e);if(r>c){if(!o)throw new Error("offset greater than allowable value");r=c}return new u(t,e,r)}static mustMakeDLoc(t,e,n,r){let i=e;if(i instanceof Array&&(i=i[0]),null==i)throw new Error("called mustMakeDLoc with an absent node");return this.makeDLoc.apply(this,arguments)}make(t,e){if(t instanceof Array)return u.mustMakeDLoc(this.root,t);if(void 0!==e&&"number"!=typeof e)throw new Error("if the 1st argument is a node, the 2nd must be a number or undefined");return u.mustMakeDLoc(this.root,t,e)}makeWithOffset(t){return t===this.offset?this:this.make(this.node,t)}getLocationInParent(){const t=this.node,e=t.parentNode;if(null===e)throw new Error("trying to get parent of a detached node");return this.make(e,i.indexOf(e.childNodes,t))}getLocationAfterInParent(){const t=this.node,e=t.parentNode;if(null===e)throw new Error("trying to get parent of a detached node");return this.make(e,i.indexOf(e.childNodes,t)+1)}toArray(){return[this.node,this.offset]}makeRange(t){if(r.isAttr(this.node))throw new Error("cannot make range from attribute node");if(this.isValid()){if(void 0===t){const t=this.node.ownerDocument.createRange();return t.setStart(this.node,this.offset),t}if(r.isAttr(t.node))throw new Error("cannot make range from attribute node");if(t.isValid())return i.rangeFromPoints(this.node,this.offset,t.node,t.offset)}}makeDLocRange(t){if(this.isValid()){if(void 0===t)return new l(this,this);if(t.isValid())return new l(this,t)}}mustMakeDLocRange(t){const e=void 0!==t?this.makeDLocRange(t):this.makeDLocRange();if(void 0===e)throw new Error("cannot make a range");return e}isValid(){const t=this.node;return this.root.contains(r.isAttr(t)?t.ownerElement:t)&&this.offset<=a(t)}normalizeOffset(){const t=this.node,e=a(t);return this.offset>e?this.make(t,e):this}equals(t){return null!=t&&(this===t||this.node===t.node&&this.offset===t.offset)}compare(t){if(this.equals(t))return 0;let{node:e,offset:n}=this,{node:o,offset:s}=t;if(r.isAttr(e)){if(r.isAttr(o)&&e.ownerElement===o.ownerElement){return[e.name,o.name].sort()[0]===e.name?-1:1}const s=e.ownerElement;if(s===t.pointedNode)return 1;e=s.parentNode,n=i.indexOf(e.childNodes,s)}if(r.isAttr(o)){const t=o.ownerElement;if(t===this.pointedNode)return-1;o=t.parentNode,s=i.indexOf(o.childNodes,t)}return i.comparePositions(e,n,o,s)}}function c(t){for(;null!=t;){if(r.isElement(t)||r.isDocument(t)){const e=n.default.data(t,"wed-dloc-root");if(null!=e)return e}t=t.parentNode}}e.DLoc=u,e.findRoot=c,e.getRoot=function(t){const e=c(t);if(null==e)throw new Error("no root found");return e};class l{constructor(t,e){if(this.start=t,this.end=e,t.root!==e.root)throw new Error("the start and end must be in the same document")}get collapsed(){return this.start.equals(this.end)}makeDOMRange(){if(r.isAttr(this.start.node))throw new Error("cannot make range from attribute node");if(this.start.isValid()){if(r.isAttr(this.end.node))throw new Error("cannot make range from attribute node");if(this.end.isValid())return i.rangeFromPoints(this.start.node,this.start.offset,this.end.node,this.end.offset).range}}mustMakeDOMRange(){const t=this.makeDOMRange();if(void 0===t)throw new Error("cannot make a range");return t}equals(t){return null!=t&&(this===t||this.start.equals(t.start)&&this.end.equals(t.end))}isValid(){return this.start.isValid()&&this.end.isValid()}contains(t){return this.start.compare(t)*this.end.compare(t)<=0}}e.DLocRange=l}.apply(e,r))||(t.exports=i)},function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",function(){return r})},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(8),i=n(47),o=n(48),s=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Object(i.a)(this.value);case"E":return Object(o.a)(this.error);case"C":return Object(r.b)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",function(){return i});var i=r()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i=function(t){function e(){var n=t.call(this,"object unsubscribed")||this;return n.name="ObjectUnsubscribedError",Object.setPrototypeOf(n,e.prototype),n}return r.a(e,t),e}(Error)},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(11),i=n(47),o=n(17),s=n(70);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length||2===t.length&&Object(r.a)(t[1])?Object(o.a)(t[0]):Object(s.a)()(i.a.apply(void 0,t))}},function(t,e,n){var r,i;
/**
* Various utilities for wed.
* @author Louis-Dominique Dubeau
* @license MPL 2.0
* @copyright Mangalam Research Center for Buddhist Languages
*/r=[n,e,n(111)],void 0===(i=function(t,e,n){"use strict";function r(t,e){return Math.sqrt(t*t+e*e)}function i(t){return t.replace(/([\][\\\/!"#$%&'()*+,.:;<=>?@^`{|}~])/g,"\\$1")}function o(t){let e="";for(const n of t)e+=`x${n.charCodeAt(0).toString(16)}`;return e}Object.defineProperty(e,"__esModule",{value:!0}),e.distFromDeltas=r,e.distFromRect=function(t,e,n,i,o,s){const a=e-i,u=t-n,c=e-s,l=t-o;return r(u<0?u:l>0?l:0,a<0?a:c>0?c:0)},e.distsFromRect=function(t,e,n,r,i,o){const s=e-r,a=t-n,u=e-o,c=t-i,l=a<0?a:c>0?c:0,d=s<0?s:u>0?u:0;return{x:Math.abs(l),y:Math.abs(d)}},e.escapeCSSClass=i,e.getOriginalName=function(t){return t.classList[0]},e.classFromOriginalName=function(t,e){if("*"===t)return"._real";let[n,r]=t.split(":");void 0===r&&(r=n,n="");const o=e[n];if(void 0===o)throw new Error(`prefix ${n} is not defined in namespaces`);return`._local_${i(r)}._xmlns_${i(o)}._real`},e.stringToCodeSequence=o;const s=/^(?:x[a-f0-9]+)+$/;function a(t){if(!s.test(t))throw new Error("badly encoded string");let e="";for(const n of t.slice(1).split("x"))e+=String.fromCharCode(parseInt(n,16));return e}function u(t,e){let r="";if(t!==e){const i=n.diffChars(e,t),s=i[i.length-1];for(let t=0;t<i.length;++t){const e=i[t];if(!0===e.added)r+=`p${o(e.value)}`;else if(!0===e.removed){const n=i[t+1];void 0!==n&&!0===n.added&&e.value.toUpperCase()===n.value?(r+=`u${e.value.length}`,t++):r+=`m${e.value.length}`}else e!==s&&(r+=`g${e.value.length}`)}}return r}e.codeSequenceToString=a,e.encodeDiff=u;const c=/^(?:p([xa-f0-9]+))|(?:[gmu](\d+))/;function l(t,e){if(""===e)return t;let n=0,r="";for(;e.length>0;){const i=e.match(c);if(null!==i){e=e.slice(i[0].length);const o=i[0][0];switch(o){case"g":case"m":case"u":const e=parseInt(i[2]);switch(o){case"g":r+=t.slice(n,n+e);break;case"u":r+=t.slice(n,n+e).toUpperCase();break;case"m":break;default:throw new Error(`internal error: unexpected op ${o}`)}n+=e;break;case"p":r+=a(i[1]);break;default:throw new Error(`unexpected operator ${o}`)}}if(null===i)throw new Error(`cannot parse diff: ${e}`)}return r+=t.slice(n)}function d(t){const e=/^data-wed-(.+)-([^-]*?)$/.exec(t);if(null===e)throw new Error("malformed name");let n,[,r,i]=e;if("-"===r[0]){const t=/^-(.+?)-(.+)$/.exec(r);if(null===t)throw new Error("malformed name");[,n,r]=t}return r=r.replace(/---/,":").replace(/---(-+)/g,"--$1"),""!==i&&(r=l(r,i)),{name:r,qualifier:n}}function h(t){return/^data-wed-(?!-)/.test(t)}e.decodeDiff=l,e.decodeAttrName=d,e.encodeAttrName=function(t,e){const n=document.createElement("div");n.setAttribute(`data-${t}`,"");const r=n.attributes[0].name.slice(5);return`data-wed-${e=void 0===e?"":`-${e}-`}${r.replace(/--(-+)/g,"---$1").replace(/:/,"---")}-${u(t,r)}`},e.isXMLAttrName=h,e.getOriginalAttributes=function(t){const e=Object.create(null),n=t.attributes;for(let r=0;r<n.length;++r){const t=n[r],i=t.localName;h(i)&&(e[d(i).name]=t.value)}return e};let f=0;e.newGenericID=function(){return`WED-ID-${++f}`},e.anySpecialKeyHeld=function(t){const e=t;return e.altKey||e.ctrlKey||e.metaKey},e.seleniumLog=function(...t){const e=window;void 0===e.selenium_log&&(e.selenium_log=[]),e.selenium_log.push.apply(e.selenium_log,t)},e.stackTrace=function(){const t=new Error;return null!=t.stack?t.stack:function(t){try{throw t}catch(e){return e.stack}}(t)},e.convertPatternObj=function t(e,n){if(null!=e.a&&null!=e.b)return`(${t(e.a,n)}) or (${t(e.b,n)})`;let r;if("AnyName"===e.pattern)r="*:*";else{if(void 0===e.ns)throw new Error("unexpected undefined obj.ns");if(void 0!==e.name)void 0===(r=n.unresolveName(e.ns,e.name))&&(r=`{${e.ns}}${e.name}`);else{const t=n.prefixFromURI(e.ns);r=void 0===t?`{${e.ns}}`:""!==t?`${t}:`:t,r+="*"}}return null!=e.except&&(r+=` except (${t(e.except,n)})`),r},e.readFile=function(t){const e=new FileReader;return new Promise((n,r)=>{e.onload=(()=>{n(e.result)}),e.onerror=r,e.readAsText(t)})},e.fixPrototype=function(t,e){(void 0!==Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__)!==e&&(void 0!==Object.setPrototypeOf?Object.setPrototypeOf(t,e.prototype):t.__proto__=e.prototype)},e.suppressUnhandledRejections=function(t){const e=t;return e.suppressUnhandledRejections&&e.suppressUnhandledRejections(),t}}.apply(e,r))||(t.exports=i)},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n(66),o=n(60),s=n(25),a=n(7),u=n(67),c=n(46),l=n(35),d=n(54),h=n(9),f=n(74),p=n(0),v=n(36),m=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return p.a(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(function(){return e.flush(null)})))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(v.a),b=n(34),g=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p.a(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(b.a))(m),y=function(t){function e(e,n){void 0===e&&(e=w),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,function(){return r.frame})||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return p.a(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n.shift())&&(this.frame=e.delay)<=r&&!(t=e.execute(e.state,e.delay)););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(b.a),w=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return p.a(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(v.a),_=n(59),x=n(5),E=n(1),T=n(23),C=n(42),N=n(20),S=n(22);function O(t){return!!t&&(t instanceof r.a||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var k=n(31),A=n(33),M=n(26),D=n(43),R=n(69),L=n(13),j=n(10),I=n(11);function P(t,e,n){if(e){if(!Object(I.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return P(t,n).apply(void 0,r).pipe(Object(L.a)(function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)}))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o,s=this,a={context:s,subject:o,callbackFunc:t,scheduler:n};return new r.a(function(r){if(n){var i={args:e,subscriber:r,params:a};return n.schedule(B,0,i)}if(!o){o=new l.a;try{t.apply(s,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o.next(t.length<=1?t[0]:t),o.complete()}]))}catch(u){o.error(u)}}return o.subscribe(r)})}}function B(t){var e=this,n=t.args,r=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new l.a;try{o.apply(s,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(a.schedule($,0,{value:r,subject:u}))}]))}catch(c){u.error(c)}}this.add(u.subscribe(r))}function $(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function H(t,e,n){if(e){if(!Object(I.a)(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return H(t,n).apply(void 0,r).pipe(Object(L.a)(function(t){return Object(j.a)(t)?e.apply(void 0,t):e(t)}))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o={subject:void 0,args:e,callbackFunc:t,scheduler:n,context:this};return new r.a(function(r){var i=o.context,s=o.subject;if(n)return n.schedule(U,0,{params:o,subscriber:r,context:i});if(!s){s=o.subject=new l.a;try{t.apply(i,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?s.error(n):(s.next(t.length<=1?t[0]:t),s.complete())}]))}catch(a){s.error(a)}}return s.subscribe(r)})}}function U(t){var e=this,n=t.params,r=t.subscriber,i=t.context,o=n.callbackFunc,s=n.args,a=n.scheduler,u=n.subject;if(!u){u=n.subject=new l.a;try{o.apply(i,s.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(a.schedule(V,0,{err:r,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(F,0,{value:i,subject:u}))}}]))}catch(c){this.add(a.schedule(V,0,{err:c,subject:u}))}}this.add(u.subscribe(r))}function F(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function V(t){var e=t.err;t.subject.error(e)}var W=n(49),K=n(27),z=n(51),q=n(8),G=n(3);function Y(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Object(j.a)(e[0])&&(e=e[0]),0===e.length?q.a:t?Y(e).pipe(Object(L.a)(function(e){return t.apply(void 0,e)})):new r.a(function(t){return new X(t,e)})}var X=function(t){function e(e,n){var r=t.call(this,e)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;o<i;o++){var s=n[o],a=Object(G.a)(r,s,null,o);a&&r.add(a)}return r}return p.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this.haveValues,r=this.values,i=r.length;t._hasValue?(this.completed++,this.completed===i&&(n===i&&e.next(r),e.complete())):e.complete()},e}(n(4).a),Z=n(17),Q=n(32);Object.prototype.toString;function J(t,e,n,i){return Object(Q.a)(n)&&(i=n,n=void 0),i?J(t,e,n).pipe(Object(L.a)(function(t){return Object(j.a)(t)?i.apply(void 0,t):i(t)})):new r.a(function(r){!function t(e,n,r,i,o){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var a=e;e.addEventListener(n,r,o),s=function(){return a.removeEventListener(n,r,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var u=e;e.on(n,r),s=function(){return u.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var c=e;e.addListener(n,r),s=function(){return c.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,d=e.length;l<d;l++)t(e[l],n,r,i,o)}i.add(s)}(t,e,function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)},r,n)})}function tt(t,e,n){return n?tt(t,e).pipe(Object(L.a)(function(t){return Object(j.a)(t)?n.apply(void 0,t):n(t)})):new r.a(function(n){var r,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.next(1===t.length?t[0]:t)};try{r=t(i)}catch(o){return void n.error(o)}if(Object(Q.a)(e))return function(){return e(i,r)}})}function et(t,e,n,i,o){var s,a;if(1==arguments.length){var u=t;a=u.initialState,e=u.condition,n=u.iterate,s=u.resultSelector||S.a,o=u.scheduler}else void 0===i||Object(I.a)(i)?(a=t,s=S.a,o=i):(a=t,s=i);return new r.a(function(t){var r=a;if(o)return o.schedule(nt,0,{subscriber:t,iterate:n,condition:e,resultSelector:s,state:r});for(;;){if(e){var i=void 0;try{i=e(r)}catch(c){return void t.error(c)}if(!i){t.complete();break}}var u=void 0;try{u=s(r)}catch(c){return void t.error(c)}if(t.next(u),t.closed)break;tr