/*! For license information please see decidim_decidim_awesome_custom_fields-36af8a90fba5e7fd85ca.js.LICENSE.txt */
!function(){var e={35877:function(){function e(){return e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.apply(null,arguments)}function t(e,t,o){return t=r(t),function(e,t){if(t&&("object"==m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,n()?Reflect.construct(t,o||[],r(e).constructor):t.apply(e,o))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(n=function(){return!!e})()}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e){return m="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},m(e)}!function(n){"use strict";!function(){var i={962:function(e,t,n){n.r(t);var r=n(645),o=n.n(r),i=n(278),a=n.n(i)()(o());a.push([e.id,'.rendered-form *{box-sizing:border-box}.rendered-form.formbuilder-embedded-bootstrap button,.rendered-form.formbuilder-embedded-bootstrap input,.rendered-form.formbuilder-embedded-bootstrap select,.rendered-form.formbuilder-embedded-bootstrap textarea{font-family:inherit;font-size:inherit;line-height:inherit}.rendered-form.formbuilder-embedded-bootstrap input{line-height:normal}.rendered-form.formbuilder-embedded-bootstrap textarea{overflow:auto}.rendered-form.formbuilder-embedded-bootstrap button,.rendered-form.formbuilder-embedded-bootstrap input,.rendered-form.formbuilder-embedded-bootstrap select,.rendered-form.formbuilder-embedded-bootstrap textarea{font-family:inherit;font-size:inherit;line-height:inherit}.rendered-form.formbuilder-embedded-bootstrap .btn-group{position:relative;display:inline-block;vertical-align:middle}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn{position:relative;float:left}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn-group,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn-group{margin-left:-1px}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:last-child:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group>.dropdown-toggle:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:focus,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:hover{z-index:2}.rendered-form.formbuilder-embedded-bootstrap .btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-image:none;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn.btn-active,.rendered-form.formbuilder-embedded-bootstrap .btn:active{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn{display:table-cell}.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333}.rendered-form.formbuilder-embedded-bootstrap .input-group{position:relative;display:table;border-collapse:separate}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.rendered-form.formbuilder-embedded-bootstrap .form-control,.rendered-form.formbuilder-embedded-bootstrap output{font-size:14px;line-height:1.42857143;display:block}.rendered-form.formbuilder-embedded-bootstrap textarea.form-control{height:auto}.rendered-form.formbuilder-embedded-bootstrap .form-control{height:34px;display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .form-control:focus{outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.rendered-form.formbuilder-embedded-bootstrap .form-group{margin-left:0px;margin-bottom:15px}.rendered-form.formbuilder-embedded-bootstrap .btn,.rendered-form.formbuilder-embedded-bootstrap .form-control{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .pull-right{float:right}.rendered-form.formbuilder-embedded-bootstrap .pull-left{float:left}.rendered-form .formbuilder-required,.rendered-form .required-asterisk{color:#c10000}.rendered-form .formbuilder-checkbox-group input[type=checkbox],.rendered-form .formbuilder-checkbox-group input[type=radio],.rendered-form .formbuilder-radio-group input[type=checkbox],.rendered-form .formbuilder-radio-group input[type=radio]{margin:0 4px 0 0}.rendered-form .formbuilder-checkbox-inline,.rendered-form .formbuilder-radio-inline{margin-right:8px;display:inline-block;vertical-align:middle;padding-left:0}.rendered-form .formbuilder-checkbox-inline label input[type=text],.rendered-form .formbuilder-radio-inline label input[type=text]{margin-top:0}.rendered-form .formbuilder-checkbox-inline:first-child,.rendered-form .formbuilder-radio-inline:first-child{padding-left:0}.rendered-form .formbuilder-autocomplete-list{background-color:#fff;display:none;list-style:none;padding:0;border:1px solid #ccc;border-width:0 1px 1px;position:absolute;z-index:20;max-height:200px;overflow-y:auto}.rendered-form .formbuilder-autocomplete-list li{display:none;cursor:default;padding:5px;margin:0;transition:background-color 200ms ease-in-out}.rendered-form .formbuilder-autocomplete-list li:hover,.rendered-form .formbuilder-autocomplete-list li.active-option{background-color:rgba(0,0,0,.075)}.rendered-form *[tooltip]{position:relative}.rendered-form *[tooltip]:hover::after{background:rgba(0,0,0,.9);border-radius:5px 5px 5px 0;bottom:23px;color:#fff;content:attr(tooltip);padding:10px 5px;position:absolute;z-index:98;left:2px;width:230px;text-shadow:none;font-size:12px;line-height:1.5em;cursor:default}.rendered-form *[tooltip]:hover::before{border:solid;border-color:#222 rgba(0,0,0,0);border-width:6px 6px 0;bottom:17px;content:"";left:2px;position:absolute;z-index:99;cursor:default}.rendered-form .tooltip-element{visibility:visible;color:#fff;background:#000;width:16px;height:16px;border-radius:8px;display:inline-block;text-align:center;line-height:16px;margin:0 5px;font-size:12px;cursor:default}.rendered-form .kc-toggle{padding-left:0 !important}.rendered-form .kc-toggle span{position:relative;width:48px;height:24px;background:#e6e6e6;display:inline-block;border-radius:4px;border:1px solid #ccc;padding:2px;overflow:hidden;float:left;margin-right:5px;will-change:transform}.rendered-form .kc-toggle span::after,.rendered-form .kc-toggle span::before{position:absolute;display:inline-block;top:0}.rendered-form .kc-toggle span::after{position:relative;content:"";width:50%;height:100%;left:0;border-radius:3px;background:linear-gradient(to bottom, white 0%, #ccc 100%);border:1px solid #999;transition:transform 100ms;transform:translateX(0)}.rendered-form .kc-toggle span::before{border-radius:4px;top:2px;left:2px;content:"";width:calc(100% - 4px);height:18px;box-shadow:0 0 1px 1px #b3b3b3 inset;background-color:rgba(0,0,0,0)}.rendered-form .kc-toggle input{height:0;overflow:hidden;width:0;opacity:0;pointer-events:none;margin:0}.rendered-form .kc-toggle input:checked+span::after{transform:translateX(100%)}.rendered-form .kc-toggle input:checked+span::before{background-color:#6fc665}.rendered-form label{font-weight:normal}.rendered-form .form-group .formbuilder-required{color:#c10000}.rendered-form .other-option:checked+label input{display:inline-block}.rendered-form .other-val{margin-left:5px;display:none}.rendered-form .form-control.number{width:auto}.rendered-form .form-control[type=color]{width:60px;padding:2px;display:inline-block}.rendered-form .form-control[multiple]{height:auto}',""]),t.default=a},278:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var u=this[s][0];null!=u&&(a[u]=!0)}for(var c=0;c<e.length;c++){var l=[].concat(e[c]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},645:function(e){e.exports=function(e){return e[1]}},252:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==m(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){var r="function"==typeof Symbol&&"symbol"==m(Symbol.iterator)?function(e){return m(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":m(e)},o=n(2),i=n(10),a=Object.prototype.toString;function s(e){return"[object Array]"===a.call(e)}function u(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))}function c(e){return"[object Function]"===a.call(e)}function l(e,t){if(null!=e)if("object"!==(void 0===e?"undefined":r(e))&&(e=[e]),s(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:i,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:l,merge:function e(){var t={};function n(n,o){"object"===r(t[o])&&"object"===(void 0===n?"undefined":r(n))?t[o]=e(t[o],n):t[o]=n}for(var o=0,i=arguments.length;o<i;o++)l(arguments[o],n);return t},extend:function(e,t,n){return l(t,(function(t,r){e[r]=n&&"function"==typeof t?o(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){(function(t){var r=n(0),o=n(13),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s={adapter:function(){var e;return("undefined"!=typeof XMLHttpRequest||void 0!==t)&&(e=n(3)),e}(),transformRequest:[function(e,t){return o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(i)})),e.exports=s}).call(this,n(12))},function(e,t,n){e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){var r=n(0),o=n(14),i=n(16),a=n(17),s=n(18),u=n(4),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(19);e.exports=function(e){return new Promise((function(t,l){var f=e.data,d=e.headers;r.isFormData(f)&&delete d["Content-Type"];var h=new XMLHttpRequest,p="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(e.url)||(h=new window.XDomainRequest,p="onload",m=!0,h.onprogress=function(){},h.ontimeout=function(){}),e.auth){var v=e.auth.username||"",y=e.auth.password||"";d.Authorization="Basic "+c(v+":"+y)}if(h.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h[p]=function(){if(h&&(4===h.readyState||m)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?a(h.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:e,request:h};o(t,l,r),h=null}},h.onerror=function(){l(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){l(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var g=n(20),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}if("setRequestHeader"in h&&r.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)})),e.withCredentials&&(h.withCredentials=!0),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),l(e),h=null)})),void 0===f&&(f=null),h.send(f)}))}},function(e,t,n){var r=n(15);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},function(e,t,n){e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){t.__esModule=!0,t.I18N=void 0;var r="function"==typeof Symbol&&"symbol"==m(Symbol.iterator)?function(e){return m(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":m(e)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(8),a={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}},s=t.I18N=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}return e.prototype.processConfig=function(e){var t=this,n=Object.assign({},a,e),r=n.location,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["location"]),i=r.replace(/\/?$/,"/");this.config=Object.assign({},{location:i},o);var s=this.config,u=s.override,c=s.preloaded,l=void 0===c?{}:c,f=Object.entries(this.langs).concat(Object.entries(u||l));this.langs=f.reduce((function(e,n){var r=n[0],o=n[1];return e[r]=t.applyLanguage.call(t,r,o),e}),{}),this.locale=this.config.locale||this.config.langs[0]},e.prototype.init=function(e){return this.processConfig.call(this,Object.assign({},this.config,e)),this.setCurrent(this.locale)},e.prototype.addLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t="string"==typeof t?this.processFile.call(this,t):t,this.applyLanguage.call(this,e,t),this.config.langs.push("locale")},e.prototype.getValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.locale;return this.langs[t]&&this.langs[t][e]||this.getFallbackValue(e)},e.prototype.getFallbackValue=function(e){var t=Object.values(this.langs).find((function(t){return t[e]}));return t&&t[e]},e.prototype.makeSafe=function(e){var t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/\{|\}|\|/g,(function(e){return t[e]})),new RegExp(e,"g")},e.prototype.put=function(e,t){return this.current[e]=t},e.prototype.get=function(e,t){var n=this.getValue(e);if(n){var o=n.match(/\{[^}]+?\}/g),i=void 0;if(t&&o)if("object"===(void 0===t?"undefined":r(t)))for(var a=0;a<o.length;a++)i=o[a].substring(1,o[a].length-1),n=n.replace(this.makeSafe(o[a]),t[i]||"");else n=n.replace(/\{[^}]+?\}/g,t);return n}},e.prototype.fromFile=function(e){for(var t,n=e.split("\n"),r={},o=0;o<n.length;o++)(t=n[o].match(/^(.+?) *?= *?([^\n]+)/))&&(r[t[1]]=t[2].replace(/^\s+|\s+$/,""));return r},e.prototype.processFile=function(e){return this.fromFile(e.replace(/\n\n/g,"\n"))},e.prototype.loadLang=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this;return new Promise((function(r,o){if(-1!==n.loaded.indexOf(e)&&t)return n.applyLanguage.call(n,n.langs[e]),r(n.langs[e]);var a=[n.config.location,e,n.config.extension].join("");return(0,i.get)(a).then((function(t){var o=t.data,i=n.processFile(o);return n.applyLanguage.call(n,e,i),n.loaded.push(e),r(n.langs[e])})).catch((function(){var t=n.applyLanguage.call(n,e);r(t)}))}))},e.prototype.applyLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.override[e]||{},r=this.langs[e]||{};return this.langs[e]=Object.assign({},r,t,n),this.langs[e]},e.prototype.setCurrent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return this.loadLang(t).then((function(){return e.locale=t,e.current=e.langs[t],e.current}))},o(e,[{key:"getLangs",get:function(){return this.config.langs}}]),e}();t.default=new s},function(e,t,n){e.exports=n(9)},function(e,t,n){var r=n(0),o=n(2),i=n(11),a=n(1);function s(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var u=s(a);u.Axios=i,u.create=function(e){return s(r.merge(a,e))},u.Cancel=n(6),u.CancelToken=n(26),u.isCancel=n(5),u.all=function(e){return Promise.all(e)},u.spread=n(27),e.exports=u,e.exports.default=u},function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){var r=n(1),o=n(0),i=n(21),a=n(22);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.merge(r,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},o.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(o.merge(n||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(o.merge(r||{},{method:e,url:t,data:n}))}})),e.exports=s},function(e,t,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}}();var c,l=[],f=!1,d=-1;function h(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var e=u(h);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||f||u(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){var r=n(0);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){var r=n(4);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e}},function(e,t,n){var r=n(0);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,n){var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){function r(){this.message="String contains an invalid character"}r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,n,o=String(e),i="",a=0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.charAt(0|a)||(s="=",a%1);i+=s.charAt(63&t>>8-a%1*8)){if((n=o.charCodeAt(a+=.75))>255)throw new r;t=t<<8|n}return i}},function(e,t,n){var r=n(0);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){var r=n(0),o=n(23),i=n(5),a=n(1),s=n(24),u=n(25);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!s(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return c(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){var r=n(0);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){var r=n(6);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){e.exports=function(e){return function(t){return e.apply(null,t)}}}])},700:function(e,t,n){var r=n(292),o=n(962);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{attributes:{class:"formBuilder-injected-style"},insert:"head",singleton:!1}),e.exports=o.locals||{}},292:function(e,t,n){var r,o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function s(e,t){for(var n={},r=[],o=0;o<e.length;o++){var s=e[o],u=t.base?s[0]+t.base:s[0],c=n[u]||0,l="".concat(u," ").concat(c);n[u]=c+1;var f=a(l),d={css:s[1],media:s[2],sourceMap:s[3]};-1!==f?(i[f].references++,i[f].updater(d)):i.push({identifier:l,updater:m(d,t),references:1}),r.push(l)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var c,l=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function d(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,p=0;function m(e,t){var n,r,o;if(t.singleton){var i=p++;n=h||(h=u(t)),r=f.bind(null,n,i,!1),o=f.bind(null,n,i,!0)}else n=u(t),r=d.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var u=s(e,t),c=0;c<n.length;c++){var l=a(n[c]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}n=u}}}}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={id:e,exports:{}};return i[e](n,n.exports,l),n.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nc=void 0,function(){var i,u=l(252),h=l.n(u),p={clobberingProtection:{document:!0,form:!0,namespaceAttributes:!1},backendOrder:["dompurify","sanitizer","fallback"],backends:{sanitizer:"function"==typeof window.Sanitizer&&new window.Sanitizer,dompurify:!!window.DOMPurify&&(i=window.DOMPurify,i.setConfig({SANITIZE_DOM:!1,ADD_ATTR:["contenteditable"]}),i),fallback:function(e){return e}}},v=function(e,t){if(0===p.backendOrder.length)return!1;var n=e.toLowerCase();return t=t?t+"":"",n.startsWith("on")||["form","formaction"].includes(n)||t.trim().toLowerCase().startsWith("javascript:")};p.backends.fallback=function(e){var t=document.implementation.createHTMLDocument(""),r=t.createElement("base");r.href=document.location.href,t.head.appendChild(r);var o=["applet","comment","embed","iframe","link","listing","meta","noscript","object","plaintext","script","style","xmp"],i=n.parseHTML(e,t,!1);n(i).find("*").addBack().each((function(e,t){"#text"!==t.nodeName&&(t.tagName&&o.includes(t.tagName.toLowerCase())?t.parentElement?t.parentElement.removeChild(t):i.includes(t)&&i.splice(i.indexOf(t),1):t.attributes&&Array.from(t.attributes).forEach((function(e){v(e.name,e.value)&&n(t).removeAttr(e.name)})))}));var a=t.createElement("div");return n(a).html(i),a.innerHTML};var y=function(e){var t=!!p.clobberingProtection.document&&document,n=!!p.clobberingProtection.form&&document.createElement("form");return t&&e in t||n&&e in n?p.clobberingProtection.namespaceAttributes?"user-content-"+e:void 0:e},g={fallback:function(e,t){var n=p.backends.fallback,r="function"==typeof n;return r&&(t=n(t)),e.innerHTML=t,r},dompurify:function(e,t){var n=p.backends.dompurify;return!(!1===n||!n.isSupported||(e.innerHTML=n.sanitize(t),0))},sanitizer:function(e,t){var n=p.backends.sanitizer;return!!n&&(e.setHTML(t,{sanitizer:n}),!0)}},b=["events"],w=["tag","content"];function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n){return(t=function(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var D=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e||"object"!=m(e))return e;var n="function"==typeof window.structuredClone?window.structuredClone(e):Object.assign({},e),r=[null,void 0,""];for(var o in t&&r.push(!1),n)r.includes(n[o])?delete n[o]:Array.isArray(n[o])&&(n[o].length||delete n[o]);return n},S=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},O=function(e,t){var n;return e=A(e),t&&(Array.isArray(t)?n=I(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),n=I(t.trim()))),{name:e,value:t=t?'="'.concat(n,'"'):""}},A=function(e){return{className:"class"}[e]||j(e)},j=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))).replace(/\s/g,"-").replace(/^-+/g,"")},T=function(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))},M=function(){var e,t=0;return function(n){var r=Date.now();return r===e?++t:(t=0,e=r),(n.type||j(n.label))+"-"+r+"-"+t}}(),L=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[m(e),function(){return!0}]].find((function(t){return t[1](e)}))[0]},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=L(t),i=r.events,a=C(r,b),s=document.createElement(e),u={string:function(e){!function(e,t){if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])){var r=document.createElement(e.tagName);return void 0!==p.backendOrder.find((function(e){return g[e](r,t)}))?(function(e){n(e).find("*").each((function(e,t){["embed","form","iframe","image","img","object"].includes(t.tagName.toLowerCase())&&t.removeAttribute("name"),["id","name"].forEach((function(e){if(t.hasAttribute(e)){var n=y(t.getAttribute(e));void 0===n?t.removeAttribute(e):t.setAttribute(e,n)}}))}))}(r),e.innerHTML=r.innerHTML,e):(e.innerHTML=t,e)}e.textContent=t}(s,s.innerHTML+e)},object:function(e){var t=e.tag,n=e.content,r=C(e,w);return s.appendChild(P(t,n,r))},node:function(e){return s.appendChild(e)},array:function(e){for(var t=0;t<e.length;t++)o=L(e[t]),u[o](e[t])},function:function(e){e=e(),o=L(e),u[o](e)},undefined:function(){}};for(var c in a)if(a.hasOwnProperty(c)){var l=A(c),f=Array.isArray(a[c])?H(a[c].join(" ").split(" ")).join(" "):a[c];if(v(l,f))continue;if("boolean"==typeof f){if(!0===f){var d="contenteditable"===l||l;s.setAttribute(l,d)}}else"id"!==l&&"name"!==l||(f=y(f)),void 0!==f&&s.setAttribute(l,f)}return t&&u[o](t),function(e,t){if(t){var n=function(n){t.hasOwnProperty(n)&&e.addEventListener(n,(function(e){return t[n](e)}))};for(var r in t)n(r)}}(s,i),s},F=function(e){var t=e.attributes,n={};return z(t,(function(e){var r=t[e].value||"";r.match(/false|true/g)?r="true"===r:r.match(/undefined/g)&&(r=void 0),r&&(n[T(t[e].name)]=r)})),n},N=function(e){for(var t=[],n=0;n<e.length;n++){var r=x(x({},F(e[n])),{},{label:e[n].textContent});t.push(r)}return t},_=function(e){var t=[];if(e.length)for(var n=e[0].getElementsByTagName("value"),r=0;r<n.length;r++)t.push(n[r].textContent);return t},R=function(e){var t=(new window.DOMParser).parseFromString(e,"text/xml"),n=[];if(t)for(var r=t.getElementsByTagName("field"),o=0;o<r.length;o++){var i=F(r[o]),a=r[o].getElementsByTagName("option"),s=r[o].getElementsByTagName("userData");a&&a.length&&(i.values=N(a)),s&&s.length&&(i.userData=_(s)),n.push(i)}return n},B=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},I=function(e){var t={'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"};return"string"==typeof e?e.replace(/["&<>]/g,(function(e){return t[e]||e})):e},z=function(e,t,n){for(var r=0;r<e.length;r++)t.call(n,r,e[r])},H=function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},V=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=jQuery,o=[];return Array.isArray(e)||(e=[e]),$(e)||(o=jQuery.map(e,(function(e){var t={dataType:"script",cache:!0,url:(n||"")+e};return jQuery.ajax(t).done((function(){return window.fbLoaded.js.push(e)}))}))),o.push(jQuery.Deferred((function(e){return r(e.resolve)}))),(t=jQuery).when.apply(t,d(o))},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",n=window.fbLoaded[t];return Array.isArray(e)?e.every((function(e){return n.includes(e)})):n.includes(e)},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Array.isArray(e)||(e=[e]),e.forEach((function(e){var r="href",o=e,i="";if("object"==m(e)&&(r=e.type||(e.style?"inline":"href"),o=(i=e.id)||e.href||e.style,e="inline"===r?e.style:e.href),!$(o,"css")){if("href"===r){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=(t||"")+e,document.head.appendChild(a)}else n('<style type="text/css">'.concat(e,"</style>")).attr("id",i).appendTo(n(document.head));window.fbLoaded.css.push(o)}}))},U=function(e,t){var n=Object.assign({},e,t);for(var r in t)n.hasOwnProperty(r)&&(Array.isArray(t[r])?n[r]=Array.isArray(e[r])?H(e[r].concat(t[r])):t[r]:"object"==m(t[r])?n[r]=U(e[r],t[r]):n[r]=t[r]);return n},W=/^col-(xs|sm|md|lg)-([^\s]+)/,K={addEventListeners:function(e,t,n){return t.split(" ").forEach((function(t){return e.addEventListener(t,n,!1)}))},attrString:function(e){return Object.entries(e).map((function(e){var t=f(e,2),n=t[0],r=t[1];return S(n)&&Object.values(O(n,r)).join("")})).filter(Boolean).join(" ")},camelCase:T,capitalize:function(e){return e.replace(/\b\w/g,(function(e){return e.toUpperCase()}))},closest:function(e,t){for(var n=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(n););return e},getContentType:L,escapeAttr:I,escapeAttrs:function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=I(e[t]));return e},escapeHtml:function(e){var t=document.createElement("textarea");return t.textContent=e,t.innerHTML},forceNumber:function(e){return e.replace(/[^0-9]/g,"")},forEach:z,getScripts:V,getStyles:q,hyphenCase:j,isCached:$,markup:P,merge:U,mobileClass:function(){var e,t="";return e=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)&&(t="formbuilder-mobile"),t},nameAttr:M,parsedHtml:B,parseXML:R,removeFromArray:function(e,t){var n=t.indexOf(e);n>-1&&t.splice(n,1)},safeAttr:O,safeAttrName:A,safename:function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"")},subtract:function(e,t){return t.filter((function(e){return!~this.indexOf(e)}),e)},trimObj:D,unique:H,validAttr:S,titleCase:function(e){var t=["a","an","and","as","at","but","by","for","for","from","in","into","near","nor","of","on","onto","or","the","to","with"].map((function(e){return"\\s".concat(e,"\\s")})),n=new RegExp("(?!".concat(t.join("|"),")\\w\\S*"),"g");return"".concat(e).replace(n,(function(e){return e.charAt(0).toUpperCase()+e.slice(1).replace(/[A-Z]/g,(function(e){return" ".concat(e)}))}))},firstNumberOrUndefined:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find((function(e){return"number"==typeof e}))},splitObject:function(e,t){var n=function(e){return function(t,n){return t[n]=e[n],t}};return[Object.keys(e).filter((function(e){return t.includes(e)})).reduce(n(e),{}),Object.keys(e).filter((function(e){return!t.includes(e)})).reduce(n(e),{})]}};n.fn.swapWith=function(e){var t=this,r=n(e),o=n("<div>");return t.before(o),r.before(t),o.before(r).remove(),t};var G=K,J=function(e,t){var n=[],r=["none","block"];(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&(r=r.reverse());for(var o=e.length-1;o>=0;o--)-1!==e[o].textContent.toLowerCase().indexOf(t.toLowerCase())?(e[o].style.display=r[0],n.push(e[o])):e[o].style.display=r[1];return n};function Y(e){var t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t}new RegExp("(".concat(["select","checkbox-group","checkbox","radio-group","autocomplete"].join("|"),")"));var Q={loaded:Y("loaded"),viewData:Y("viewData"),userDeclined:Y("userDeclined"),modalClosed:Y("modalClosed"),modalOpened:Y("modalOpened"),formSaved:Y("formSaved"),fieldAdded:Y("fieldAdded"),fieldRemoved:Y("fieldRemoved"),fieldRendered:Y("fieldRendered"),fieldEditOpened:Y("fieldEditOpened"),fieldEditClosed:Y("fieldEditClosed"),stageEmptied:Y("stageEmptied")},X=["label","type"],Z=function(){function e(t,n){s(this,e),this.rawConfig=jQuery.extend({},t),t=jQuery.extend({},t),this.preview=n,delete t.isPreview,this.preview&&delete t.required;for(var r=0,o=["label","description","subtype","required","disabled"];r<o.length;r++){var i=o[r];this[i]=t[i],delete t[i]}t.id||(t.name?t.id=t.name:t.id="control-"+Math.floor(1e7*Math.random()+1)),this.id=t.id,this.type=t.type,this.description&&(t.title=this.description),e.controlConfig||(e.controlConfig={});var a=this.subtype?this.type+"."+this.subtype:this.type;this.classConfig=jQuery.extend({},e.controlConfig[this.type]||{},e.controlConfig[a]||{}),this.subtype&&(t.type=this.subtype),this.required&&(t.required="required",t["aria-required"]="true"),this.disabled&&(t.disabled="disabled"),this.config=t,this.configure()}return c(e,[{key:"configure",value:function(){}},{key:"build",value:function(){var e=this.config,t=e.label,n=e.type,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,X);return this.markup(n,B(t),r)}},{key:"on",value:function(e){var t=this,n={prerender:function(e){return e},render:function(e){var n=function(){t.onRender&&t.onRender(e)};t.css&&q(t.css),t.js&&!$(t.js)?V(t.js).done(n):n()}};return e?n[e]:n}},{key:"markup",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.element=P(e,t,n),this.element}},{key:"parsedHtml",value:function(e){return B(e)}}],[{key:"definition",get:function(){return{}}},{key:"register",value:function(t,n,r){var o=r?r+".":"";e.classRegister||(e.classRegister={}),Array.isArray(t)||(t=[t]);var i,s=a(t);try{for(s.s();!(i=s.n()).done;){var u=i.value;-1===u.indexOf(".")?e.classRegister[o+u]=n:e.error("Ignoring type ".concat(u,". Cannot use the character '.' in a type name."))}}catch(c){s.e(c)}finally{s.f()}}},{key:"getRegistered",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object.keys(e.classRegister);return n.length?n.filter((function(e){return t?e.indexOf(t+".")>-1:-1===e.indexOf(".")})):n}},{key:"getRegisteredSubtypes",value:function(){var t={};for(var n in e.classRegister)if(e.classRegister.hasOwnProperty(n)){var r=f(n.split("."),2),o=r[0],i=r[1];if(!i)continue;t[o]||(t[o]=[]),t[o].push(i)}return t}},{key:"getClass",value:function(t,n){var r=n?t+"."+n:t;return e.classRegister[r]||e.classRegister[t]||e.error("Invalid control type. (Type: "+t+", Subtype: "+n+"). Please ensure you have registered it, and imported it correctly.")}},{key:"loadCustom",value:function(t){var n=[];if(t&&(n=n.concat(t)),window.fbControls&&(n=n.concat(window.fbControls)),!this.fbControlsLoaded){var r,o=a(n);try{for(o.s();!(r=o.n()).done;){(0,r.value)(e,e.classRegister)}}catch(i){o.e(i)}finally{o.f()}this.fbControlsLoaded=!0}}},{key:"mi18n",value:function(e,t){var n=this.definition,r=n.i18n||{};r=r[h().locale]||r.default||r;var o=this.camelCase(e),i="object"==m(r)?r[o]||r[e]:r;if(i)return i;var a=n.mi18n;return"object"==m(a)&&(a=a[o]||a[e]),a||(a=o),h().get(a,t)}},{key:"active",value:function(e){return!Array.isArray(this.definition.inactive)||-1===this.definition.inactive.indexOf(e)}},{key:"label",value:function(e){return this.mi18n(e)}},{key:"icon",value:function(e){var t=this.definition;return t&&"object"==m(t.icon)?t.icon[e]:t.icon}},{key:"error",value:function(e){throw new Error(e)}},{key:"camelCase",value:function(e){return T(e)}}])}(),ee=function(e,t){var n=e.id?"formbuilder-".concat(e.type," form-group field-").concat(e.id):"";if(e.className){var r=function(e){return"string"==typeof e?e.split(" ").filter((function(e){return W.test(e)||e.startsWith("row-")})):[]}(e.className);r&&r.length>0&&(n+=" ".concat(r.join(" ")),Array.isArray(t)||(t=[t]),t.forEach((function(e){var t;e.classList&&(t=e.classList).remove.apply(t,d(r)),e.querySelectorAll("[class*=row-],[class*=col-]").forEach((function(e){var t;e.classList&&(t=e.classList).remove.apply(t,d(r))}))})))}return n},te=function(){return c((function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,e),this.preview=null!=r&&r,this.disableHTMLLabels=null!=o&&o,this.controlConfig=null!=i?i:{},this.templates={label:null,help:null,default:function(e,t,r,o){return r&&t.appendChild(r),n.markup("div",[t,e],{className:ee(o,e)})},noLabel:function(e,t,r,o){return n.markup("div",e,{className:ee(o,e)})},hidden:function(e){return e}},t&&(this.templates=jQuery.extend(this.templates,t)),this.configure()}),[{key:"configure",value:function(){}},{key:"build",value:function(e,t,n){this.preview&&(t.name?t.name=t.name+"-preview":t.name=G.nameAttr(t)+"-preview"),t.id=t.name,this.data=jQuery.extend({},t),Z.controlConfig=this.controlConfig;var r=new e(t,this.preview),o=r.build();if("object"==m(o)&&o.field||(o={field:o}),"string"==typeof o.field){var i=this.markup("div",o.field,{});1===i.childElementCount?o.field=i.children.item(0):o.field=Array.from(i.children)}var a,s=this.label(),u=this.help();a=n&&this.isTemplate(n)?n:this.isTemplate(o.layout)?o.layout:"default";var c=this.processTemplate(a,o.field,s,u);return r.on("prerender")(c),c.addEventListener("fieldRendered",r.on("render")),c}},{key:"label",value:function(){var e=this.data.label||"",t=[this.disableHTMLLabels?document.createTextNode(e):G.parsedHtml(e)];return this.data.required&&t.push(this.markup("span","*",{className:"formbuilder-required"})),this.isTemplate("label")?this.processTemplate("label",t):this.markup("label",t,{for:this.data.id,className:"formbuilder-".concat(this.data.type,"-label")})}},{key:"help",value:function(){return this.data.description?this.isTemplate("help")?this.processTemplate("help",this.data.description):this.markup("span","?",{className:"tooltip-element",tooltip:this.data.description}):null}},{key:"isTemplate",value:function(e){return"function"==typeof this.templates[e]}},{key:"processTemplate",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=(t=this.templates)[e].apply(t,r.concat([this.data]));return i.jquery&&(i=i[0]),i}},{key:"markup",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return G.markup(e,t,n)}}])}(),ne=["values","type"];Z.register("autocomplete",function(e){function r(){return s(this,r),t(this,r,arguments)}return o(r,e),c(r,[{key:"build",value:function(){var e=this,t=this.config,n=t.values,r=t.type,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,ne),i=function(t){var n=t.target.nextSibling.nextSibling,r=t.target.nextSibling,o=e.getActiveOption(n),i=new Map([[38,function(){var t=e.getPreviousOption(o);t&&e.selectOption(n,t)}],[40,function(){var t=e.getNextOption(o);t&&e.selectOption(n,t)}],[13,function(){o?(t.target.value=o.innerHTML,r.value=o.getAttribute("value"),"none"===n.style.display?e.showList(n,o):e.hideList(n)):e.config.requireValidOption&&(e.isOptionValid(n,t.target.value)||(t.target.value="",t.target.nextSibling.value="")),t.preventDefault()}],[27,function(){e.hideList(n)}]]).get(t.keyCode);return i||(i=function(){return!1}),i()},a={focus:function(t){var n=t.target.nextSibling.nextSibling,r=J(n.querySelectorAll("li"),t.target.value);if(t.target.addEventListener("keydown",i),t.target.value.length>0){var o=r.length>0?r[r.length-1]:null;e.showList(n,o)}},blur:function(t){t.target.removeEventListener("keydown",i);var n=setTimeout((function(){t.target.nextSibling.nextSibling.style.display="none",clearTimeout(n)}),200);if(e.config.requireValidOption){var r=t.target.nextSibling.nextSibling;e.isOptionValid(r,t.target.value)||(t.target.value="",t.target.nextSibling.value="")}},input:function(t){var n=t.target.nextSibling.nextSibling;t.target.nextSibling.value=t.target.value;var r=J(n.querySelectorAll("li"),t.target.value);if(0==r.length)e.hideList(n);else{var o=e.getActiveOption(n);o||(o=r[r.length-1]),e.showList(n,o)}}},s=Object.assign({},o,{id:"".concat(o.id,"-input"),autocomplete:"off",events:a}),u=Object.assign({},o,{type:"hidden"});delete s.name;var c=[this.markup("input",null,s),this.markup("input",null,u)],l=n.map((function(t){var n=t.label,r={events:{click:function(n){var r=n.target.parentElement,o=r.previousSibling.previousSibling;o.value=t.label,o.nextSibling.value=t.value,e.hideList(r)}},value:t.value};return e.markup("li",n,r)}));return c.push(this.markup("ul",l,{id:"".concat(o.id,"-list"),className:"formbuilder-".concat(r,"-list")})),c}},{key:"hideList",value:function(e){this.selectOption(e,null),e.style.display="none"}},{key:"showList",value:function(e,t){this.selectOption(e,t),e.style.display="block",e.style.width=e.parentElement.offsetWidth+"px"}},{key:"getActiveOption",value:function(e){var t=e.getElementsByClassName("active-option")[0];return t&&"none"!==t.style.display?t:null}},{key:"getPreviousOption",value:function(e){var t=e;do{t=t?t.previousSibling:null}while(null!=t&&"none"===t.style.display);return t}},{key:"getNextOption",value:function(e){var t=e;do{t=t?t.nextSibling:null}while(null!=t&&"none"===t.style.display);return t}},{key:"selectOption",value:function(e,t){for(var n=e.querySelectorAll("li"),r=0;r<n.length;r++)n[r].classList.remove("active-option");t&&t.classList.add("active-option")}},{key:"isOptionValid",value:function(e,t){for(var n=e.querySelectorAll("li"),r=!1,o=0;o<n.length;o++)if(n[o].innerHTML===t){r=!0;break}return r}},{key:"onRender",value:function(e){if(this.config.userData){var t=n("#"+this.config.name),r=t.next(),o=this.config.userData[0],i=null;if(r.find("li").each((function(){n(this).attr("value")===o&&(i=n(this).get(0))})),null===i)return this.config.requireValidOption?void 0:void t.prev().val(this.config.userData[0]);t.prev().val(i.innerHTML),t.val(i.getAttribute("value"));var a=t.next().get(0);"none"===a.style.display?this.showList(a,i):this.hideList(a)}return e}}],[{key:"definition",get:function(){return{mi18n:{requireValidOption:"requireValidOption"}}}}])}(Z));var re=function(e){function n(){return s(this,n),t(this,n,arguments)}return o(n,e),c(n,[{key:"build",value:function(){return{field:this.markup("button",this.label,this.config),layout:"noLabel"}}}])}(Z);Z.register("button",re),Z.register(["button","submit","reset"],re,"button");var oe=function(e){function n(e,r,o){var i;return s(this,n),(i=t(this,n,[e,r])).template=o,i}return o(n,e),c(n,[{key:"build",value:function(){var e=this.template;if(!e)return Z.error("Invalid custom control type '".concat(this.type,"'. Please ensure you have registered it correctly as a template option."));for(var t=Object.assign(this.config),n=0,r=["label","description","subtype","id","preview","required","title","aria-required","type"];n<r.length;n++){var o=r[n];t[o]=this.config[o]||this[o]}return(e=(e=e.bind(this))(t)).js&&(this.js=e.js),e.css&&(this.css=e.css),this.onRender=e.onRender,{field:e.field,layout:e.layout}}}])}(Z);Z.register("hidden",function(e){function r(){return s(this,r),t(this,r,arguments)}return o(r,e),c(r,[{key:"build",value:function(){return this.field=this.markup("input",null,this.config),{field:this.field,layout:"hidden"}}},{key:"onRender",value:function(){this.config.userData&&n(this.field).val(this.config.userData[0])}}])}(Z));var ie=["type"],ae=function(e){function n(){return s(this,n),t(this,n,arguments)}return o(n,e),c(n,[{key:"build",value:function(){var e=this.config,t=e.type,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ie),r=t,o={paragraph:"p",header:this.subtype};return o[t]&&(r=o[t]),{field:this.markup(r,G.parsedHtml(this.label),n),layout:"noLabel"}}}])}(Z);Z.register(["paragraph","header"],ae),Z.register(["p","address","blockquote","canvas","output"],ae,"paragraph"),Z.register(["h1","h2","h3","h4","h5","h6"],ae,"header");var se=["values","value","placeholder","type","inline","other","toggle"],ue=["label"];function ce(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}Z.register(["select","checkbox-group","radio-group","checkbox"],function(e){function r(){return s(this,r),t(this,r,arguments)}return o(r,e),c(r,[{key:"build",value:function(){var e=[],t=this.config,n=t.values,r=t.value,o=t.placeholder,i=t.type,a=t.inline,s=t.other,u=t.toggle,c=ce(t,se),l=i.replace("-group",""),f="select"===i;if((c.multiple||"checkbox-group"===i)&&(c.name=c.name+"[]"),("checkbox-group"===i||"radio-group"===i)&&c.required){var d=this,h=this.onRender.bind(this);this.onRender=function(){h(),d.groupRequired()}}if(delete c.title,n){o&&f&&e.push(this.markup("option",o,{disabled:!0,selected:!0,value:""}));for(var p=0;p<n.length;p++){var m=n[p];"string"==typeof m&&(m={label:m,value:m});var v=m.label,y=void 0===v?"":v,g=ce(m,ue);if(g.id="".concat(c.id,"-").concat(p),g.selected&&!o||delete g.selected,void 0!==r&&g.value===r&&(g.selected=!0),f){var b=this.markup("option",document.createTextNode(y),g);e.push(b)}else{var w=[y],k="formbuilder-".concat(l);a&&(k+="-inline"),g.type=l,g.selected&&(g.checked="checked",delete g.selected);var x=this.markup("input",null,Object.assign({},c,g)),E={for:g.id},C=[x,this.markup("label",w,E)];u&&(delete E.for,E.className="kc-toggle",w.unshift(x,this.markup("span")),C=this.markup("label",w,E));var S=this.markup("div",C,{className:k});e.push(S)}}if(!f&&s){var O,A={id:"".concat(c.id,"-other"),className:"".concat(null!==(O=c.className)&&void 0!==O?O:""," other-option"),value:""},j="formbuilder-".concat(l);a&&(j+="-inline");var T=Object.assign({},c,A);T.type=l;var M={type:"text",events:{input:function(e){var t=e.target;t.parentElement.previousElementSibling.value=t.value}},id:"".concat(A.id,"-value"),className:"other-val"},L=this.markup("input",null,T),P=[document.createTextNode(Z.mi18n("other")),this.markup("input",null,M)],F=this.markup("label",P,{for:T.id}),N=this.markup("div",[L,F],{className:j});e.push(N)}}return this.dom="select"==i?this.markup(l,e,D(c,!0)):this.markup("div",e,{className:i}),this.dom}},{key:"groupRequired",value:function(){for(var e=this.element.getElementsByTagName("input"),t=this.element.querySelectorAll("input:not([type=text])"),n=this.element.querySelector(".other-option"),r=this.element.querySelector(".other-val"),o=function(){var e=[].some.call(t,(function(e){return e.checked}));!function(e,t,n,r){[].forEach.call(e,(function(e){r?e.removeAttribute("required"):e.setAttribute("required","required"),function(e,t){var n=Z.mi18n("minSelectionRequired",1);t?e.setCustomValidity(""):e.setCustomValidity(n)}(e,r)})),t&&(t.checked?n.setAttribute("required","required"):n.removeAttribute("required"))}(t,n,r,e)},i=e.length-1;i>=0;i--)e[i].addEventListener("change",o);o()}},{key:"onRender",value:function(){var e=this;if(this.config.userData){var t=this.config.userData.slice();"select"===this.config.type?n(this.dom).val(t).prop("selected",!0):this.config.type.endsWith("-group")&&("checkbox-group"===this.config.type&&this.dom.querySelectorAll("input[type=checkbox]").forEach((function(e){e.removeAttribute("checked")})),this.dom.querySelectorAll("input").forEach((function(n){if(!n.classList.contains("other-val")){for(var r=0;r<t.length;r++)if(n.value===t[r]){n.setAttribute("checked","checked"),t.splice(r,1);break}if(n.id.endsWith("-other")&&t.length>0){var o=e.dom.querySelector("#".concat(n.id,"-value"));n.setAttribute("checked","checked"),o.value=n.value=t[0],o.style.display="inline-block"}}})))}}}],[{key:"definition",get:function(){return{inactive:["checkbox"],mi18n:{minSelectionRequired:"minSelectionRequired"}}}}])}(Z));var le=function(e){function r(){return s(this,r),t(this,r,arguments)}return o(r,e),c(r,[{key:"build",value:function(){var e=this.config.name;e=this.config.multiple?"".concat(e,"[]"):e;var t=Object.assign({},this.config,{name:e});return this.dom=this.markup("input",null,t),this.dom}},{key:"onRender",value:function(){this.config.userData&&n(this.dom).val(this.config.userData[0])}}],[{key:"definition",get:function(){return{mi18n:{date:"dateField",file:"fileUpload"}}}}])}(Z);Z.register(["text","file","date","number"],le),Z.register(["text","password","email","color","tel"],le,"text"),Z.register(["date","time","datetime-local"],le,"date"),Z.register(["number","range"],le,"number");var fe=["value"],de=function(i){function a(){return s(this,a),t(this,a,arguments)}return o(a,i),c(a,[{key:"build",value:function(){var e=this.config,t=e.value,n=void 0===t?"":t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,fe);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(n),r),this.field}},{key:"onRender",value:function(){this.config.userData&&n(this.field).val(this.config.userData[0])}},{key:"on",value:function(t){var o=this;return"prerender"==t&&this.preview?function(e){o.field&&(e=o.field),n(e).on("mousedown",(function(e){e.stopPropagation()}))}:function(t,n,o,i){var a=e(r(1&i?t.prototype:t),n,o);return 2&i&&"function"==typeof a?function(e){return a.apply(o,e)}:a}(a,"on",this,3)([t])}}],[{key:"definition",get:function(){return{mi18n:{textarea:"textArea"}}}}])}(Z);Z.register("textarea",de),Z.register("textarea",de,"textarea");var he=["value"];de.register("tinymce",function(e){function n(){return s(this,n),t(this,n,arguments)}return o(n,e),c(n,[{key:"configure",value:function(){if(this.js=[],window.tinymce||this.js.push("https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"),this.classConfig.js){var e=this.classConfig.js;Array.isArray(e)||(e=new Array(e)),this.js=this.js.concat(e),delete this.classConfig.js}this.classConfig.css&&(this.css=this.classConfig.css),this.editorOptions={height:250,paste_data_images:!0,plugins:["advlist","autolink","lists","link","image","charmap","print","preview","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","contextmenu","paste","code"],toolbar:"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | table"}}},{key:"build",value:function(){var e=this.config,t=e.value,n=void 0===t?"":t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,he);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(n),r),r.disabled&&(this.editorOptions.readonly=!0),this.field}},{key:"onRender",value:function(){var e=window.tinymce.get(this.id);e&&window.tinymce.remove(e);var t=jQuery.extend(this.editorOptions,this.classConfig);t.target=this.field;var n=[];Number(window.tinymce.majorVersion)>=5&&n.push("contextmenu"),Number(window.tinymce.majorVersion)>=6&&n.push("paste","print"),t.plugins=t.plugins.filter((function(e){return-1===n.indexOf(e)}));var r=this.config.userData?this.parsedHtml(this.config.userData[0]):void 0,o=window.lastFormBuilderCopiedTinyMCE?this.parsedHtml(window.lastFormBuilderCopiedTinyMCE):void 0;window.lastFormBuilderCopiedTinyMCE=null;var i=function(e){o?e[0].setContent(o):r&&e[0].setContent(r)};setTimeout((function(){window.tinymce.init(t).then(i)}),0)}}])}(de),"textarea");var pe=["value"];function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e,t,n){return(t=function(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}de.register("quill",function(e){function n(){return s(this,n),t(this,n,arguments)}return o(n,e),c(n,[{key:"configure",value:function(){var e={modules:{toolbar:[[{header:[1,2,!1]}],["bold","italic","underline"],["code-block"]]},placeholder:this.config.placeholder||"",theme:"snow"},t=f(G.splitObject(this.classConfig,["css","js"]),2),n=t[0],r=t[1];Object.assign(this,ve(ve({},{js:"https://cdn.quilljs.com/1.2.4/quill.js",css:"https://cdn.quilljs.com/1.2.4/quill.snow.css"}),n)),this.editorConfig=ve(ve({},e),r)}},{key:"build",value:function(){var e=this.config,t=(e.value,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,pe));return delete t.type,this.field=this.markup("div",null,t),this.field.classList.contains("form-control")&&this.field.classList.remove("form-control"),this.field}},{key:"onRender",value:function(e){var t=this.config.value||"",n=window.Quill.import("delta");window.fbEditors.quill[this.id]={};var r=window.fbEditors.quill[this.id];return r.instance=new window.Quill(this.field,this.editorConfig),r.data=new n,t&&r.instance.setContents(window.JSON.parse(this.parsedHtml(t))),r.instance.on("text-change",(function(e){r.data=r.data.compose(e)})),e}}])}(de),"textarea"),h().addLanguage("en-US",{NATIVE_NAME:"English (US)",ENGLISH_NAME:"English",addOption:"Add Option +",allFieldsRemoved:"All fields were removed.",allowMultipleFiles:"Allow users to upload multiple files",allowSelect:"Allow selection",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",checkboxGroup:"Checkbox Group",checkbox:"Checkbox",checkboxes:"Checkboxes",className:"Class",clearAllMessage:"Are you sure you want to clear all fields?",clear:"Clear",close:"Close",content:"Content",copy:"Copy To Clipboard",copyButton:"&#43;",copyButtonTooltip:"Copy",dateField:"Date Field",description:"Help Text",descriptionField:"Description",devMode:"Developer Mode",editNames:"Edit Names",editorTitle:"Form Elements",editXML:"Edit XML",enableOther:"Enable &quot;Other&quot;",enableOtherMsg:"Let users enter an unlisted option",fieldDeleteWarning:"false",fieldVars:"Field Variables",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to this area",header:"Header",hide:"Edit",hidden:"Hidden Input",inline:"Inline",inlineDesc:"Display {type} inline",label:"Label",labelEmpty:"Field Label cannot be empty",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length",minOptionMessage:"This field requires a minimum of 2 options",minSelectionRequired:"Minimum {min} selections required",multipleFiles:"Multiple Files",name:"Name",no:"No",noFieldsToClear:"There are no fields to clear",number:"Number",off:"Off",on:"On",option:"Option",optionCount:"Option {count}",options:"Options",optional:"optional",optionLabelPlaceholder:"Label",optionValuePlaceholder:"Value",optionEmpty:"Option value required",other:"Other",paragraph:"Paragraph",placeholder:"Placeholder","placeholders.value":"Value","placeholders.label":"Label","placeholders.email":"Enter your email","placeholders.className":"space separated classes","placeholders.password":"Enter your password",preview:"Preview",radioGroup:"Radio Group",radio:"Radio",removeMessage:"Remove Element",removeOption:"Remove Option",remove:"&#215;",required:"Required",reset:"Reset",requireValidOption:"Only accept a pre-defined Option",richText:"Rich Text Editor",roles:"Access",rows:"Rows",save:"Save",selectOptions:"Options",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",size:"Size",sizes:"Sizes","size.xs":"Extra Small","size.sm":"Small","size.m":"Default","size.lg":"Large",step:"Step",style:"Style",styles:"Styles","styles.btn":"Button Styles","styles.btn.default":"Default","styles.btn.danger":"Danger","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",submit:"Submit",subtype:"Type",text:"Text Field",textArea:"Text Area",toggle:"Toggle",warning:"Warning!",value:"Value",viewJSON:"[{&hellip;}]",viewXML:"&lt;/&gt;",yes:"Yes"});var ge={location:"assets/lang/"};l(700);var be=function(){return c((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(this,e),this.customRegister={},this.templateControlRegister={},this.def={icon:{},i18n:{}},this.register(t,n)}),[{key:"register",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=h().locale;this.def.i18n[r]||(this.def.i18n[r]={});var o=this;Object.keys(t).forEach((function(n){var r=function(e,r){this.customControl=new oe(e,r,t[n]),this.build=function(){return this.customControl.build()},this.on=function(e){return this.customControl.on(e)}};r.definition={},r.label=function(e){return o.label(e)},r.icon=function(e){return o.icon(e)},e.templateControlRegister[n]=r}));var i,s=a(n);try{for(s.s();!(i=s.n()).done;){var u,c=i.value,l=c.type;if(c.attrs=c.attrs||{},!l){if(!c.attrs.type){Z.error("Ignoring invalid custom field definition. Please specify a type property.");continue}l=c.attrs.type}var f=c.subtype||l;if(t[l]){var p=this.templateControlRegister[l];p.definition=c,this.customRegister[f]=jQuery.extend(c,{type:l,class:p})}else try{var m=Z.getClass(l,c.subtype);f=c.datatype?c.datatype:"".concat(l,"-").concat(Math.floor(9e3*Math.random()+1e3)),this.customRegister[f]=jQuery.extend(c,{type:l,class:m})}catch(t){Z.error("Error while registering custom field: "+l+(c.subtype?":"+c.subtype:"")+". Unable to find any existing defined control or template for rendering.")}this.def.i18n[r][f]=Array.isArray(c.label)?(u=h()).get.apply(u,d(c.label))||c.label[0]:c.label,this.def.icon[f]=c.icon}}catch(v){s.e(v)}finally{s.f()}}},{key:"label",value:function(e){var t=this.def,n=t.i18n||{};n=n[h().locale]||n.default||n;var r=Z.camelCase(e),o="object"==m(n)?n[r]||n[e]:n;if(o)return o;var i=t.mi18n;return"object"==m(i)&&(i=i[r]||i[e]),i||(i=r),h().get(i)}},{key:"definition",get:function(){return{}}},{key:"icon",value:function(e){var t=this.def;return t&&"object"==m(t.icon)?t.icon[e]:t.icon}},{key:"getRegistered",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?null!==(e=this.templateControlRegister[t])&&void 0!==e?e:void 0:Object.keys(this.customRegister)}},{key:"getClass",value:function(e){var t;return null!==(t=this.templateControlRegister[e])&&void 0!==t?t:void 0}},{key:"lookup",value:function(e){return this.customRegister[e]}}])}(),we=function(){return c((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e);var n={layout:te,layoutTemplates:{},controls:{},controlConfig:{},container:!1,dataType:"json",disableHTMLLabels:!1,formData:[],i18n:Object.assign({},ge),messages:{formRendered:"Form Rendered",noFormData:"No form data.",other:"Other",selectColor:"Select Color",invalidControl:"Invalid control"},onRender:function(){},render:!0,sanitizerOptions:{clobberingProtection:{document:!0,form:!1,namespaceAttributes:!0},backendOrder:["dompurify","sanitizer","fallback"]},templates:{},notify:{error:function(e){console.log(e)},success:function(e){console.log(e)},warning:function(e){console.warn(e)}}};this.options=jQuery.extend(!0,n,t),this.instanceContainers=[],function(e){if("object"!=m(e))throw"Invalid value given to setSanitizerConfig, expected config object";if(e.hasOwnProperty("clobberingProtection")&&["document","form","namespaceAttributes"].forEach((function(t){e.clobberingProtection.hasOwnProperty(t)&&"boolean"==typeof e.clobberingProtection[t]&&(p.clobberingProtection[t]=e.clobberingProtection[t])})),e.hasOwnProperty("backends")){if("object"!=m(e.backends))throw"backends config expected to be an Object";Object.keys(e.backends).forEach((function(t){return p.backends[t]=e.backends[t]}))}if(e.hasOwnProperty("backendOrder")){if(p.backendOrder=[],!Array.isArray(e.backendOrder))throw"backendOrder config expected to be an Array of backend keys as strings";e.backendOrder.forEach((function(e){if(!p.backends.hasOwnProperty(e))throw"unknown sanitizer backend "+e;p.backendOrder.push(e)}))}}(this.options.sanitizerOptions),h().current||h().init(this.options.i18n),this.options.formData?this.options.formData=this.parseFormData(this.options.formData):this.options.formData=[],Z.controlConfig=t.controlConfig||{},Z.loadCustom(t.controls),this.templatedControls=new be(this.options.templates),"function"!=typeof Element.prototype.appendFormFields&&(Element.prototype.appendFormFields=function(e){var t=this;Array.isArray(e)||(e=[e]);var n=G.markup("div",e,{className:"rendered-form formbuilder-embedded-bootstrap"});this.appendChild(n),e.forEach((function(e){var r=f(e.className.match(/row-([^\s]+)/)||[],1)[0];if(r){var o=t.id?"".concat(t.id,"-row-").concat(r):"row-".concat(r),i=document.getElementById(o);i||(i=G.markup("div",null,{id:o,className:"row"}),n.appendChild(i)),i.appendChild(e)}else n.appendChild(e);e.dispatchEvent(Q.fieldRendered)}))}),"function"!=typeof Element.prototype.emptyContainer&&(Element.prototype.emptyContainer=function(){for(var e=this;e.lastChild;)e.removeChild(e.lastChild)})}),[{key:"sanitizeField",value:function(e,t){var n=Object.assign({},e);return t&&(n.id=e.id&&"".concat(e.id,"-").concat(t),n.name=e.name&&"".concat(e.name,"-").concat(t)),n.className=Array.isArray(e.className)?G.unique(e.className.join(" ").split(" ")).join(" "):e.className||e.class||null,delete n.class,e.values&&(n.values=e.values.map((function(e){return G.trimObj(e)}))),n=G.trimObj(n),Array.isArray(e.userData)&&0===e.userData.length&&(n.userData=[]),n}},{key:"getElement",value:function(e){return(e=this.options.container||e)instanceof jQuery?e=e[0]:"string"==typeof e&&(e=document.querySelector(e)),e}},{key:"render",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.options;t=this.getElement(t);var o=[],i=new r.layout(r.layoutTemplates,!1,r.disableHTMLLabels,r.controlConfig);if(r.formData.length)for(var a=0;a<r.formData.length;a++){var s=r.formData[a],u=this.sanitizeField(s,n),c=this.templatedControls.getClass(s.type)||Z.getClass(s.type,s.subtype),l=i.build(c,u);o.push(l)}else r.notify.warning(r.messages.noFormData);if(t&&(this.instanceContainers[n]=t),r.render&&t)t.emptyContainer(),t.appendFormFields(o),r.onRender&&r.onRender(),r.notify.success(r.messages.formRendered);else{this.markup=function(e){return e.map((function(e){return e.innerHTML})).join("")}(o)}if(!0===r.disableInjectedStyle){var f=document.getElementsByClassName("formBuilder-injected-style");z(f,(function(e){return function(e){e.parentNode&&e.parentNode.removeChild(e)}(f[e])}))}else"bootstrap"===r.disableInjectedStyle&&r.render&&t&&(null===(e=t.getElementsByClassName("formbuilder-embedded-bootstrap").item(0))||void 0===e||e.classList.remove("formbuilder-embedded-bootstrap"));return this}},{key:"renderControl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.options,n=t.formData;if(!n||Array.isArray(n))throw new Error("To render a single element, please specify a single object of formData for the field in question");var r=this.sanitizeField(n),o=new t.layout,i=this.templatedControls.getClass(n.type)||Z.getClass(n.type,n.subtype),a=t.forceTemplate||"hidden",s=o.build(i,r,a);return e.appendFormFields(s),t.notify.success(t.messages.formRendered),this}},{key:"userData",get:function(){var e=this.options.formData.slice();return e.filter((function(e){return"tinymce"===e.subtype})).forEach((function(e){return window.tinymce.get(e.name).save()})),this.instanceContainers.forEach((function(t){for(var r=n("select, input, textarea",t).serializeArray().reduce((function(e,t){var n=t.name,r=t.value;return e[n=n.replace("[]","")]?e[n].push(r):e[n]=[r],e}),{}),o=e.length,i=0;i<o;i++){var a,s=e[i];void 0!==s.name&&(s.disabled||(s.userData=null!==(a=r[s.name])&&void 0!==a?a:[]))}})),e}},{key:"clear",value:function(){var e=this;this.instanceContainers.forEach((function(t){e.options.formData.slice().filter((function(e){return"tinymce"===e.subtype})).forEach((function(e){return window.tinymce.get(e.name).setContent("")})),t.querySelectorAll("input, select, textarea").forEach((function(e){["checkbox","radio"].includes(e.type)?e.checked=!1:e.value=""}))}))}},{key:"parseFormData",value:function(e){var t={xml:function(e){return R(e)},json:function(e){return window.JSON.parse(e)}};return"object"!=m(e)&&(e=t[this.options.dataType](e)||!1),e}}])}();!function(e){var t,n={init:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=e,n.instance=new we(r),e.each((function(t){return n.instance.render(e[t],t)})),n.instance},userData:function(){return n.instance&&n.instance.userData},clear:function(){return n.instance&&n.instance.clear()},setData:function(e){if(n.instance){var t=n.instance;t.options.formData=t.parseFormData(e)}},render:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n.instance){var o=n.instance;e||(e=o.options.formData),o.options=Object.assign({},o.options,r,{formData:o.parseFormData(e)}),t.each((function(e){return n.instance.render(t[e],e)}))}},html:function(){return t.map((function(e){return t[e]})).html()}};e.fn.formRender=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(n[e])return n[e].apply(this,r);var i=n.init(this,e);return Object.assign(n,i),i},e.fn.controlRender=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.formData=e,t.dataType="string"==typeof e?"json":"xml";var n=new we(t),r=this;return r.each((function(e){return n.renderControl(r[e])})),r}}(jQuery)}()}()}(jQuery)},43925:function(e,t,n){var r=n(2204);e.exports=(r.__esModule?r:{default:r}).default},2204:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});var r=n(24683),o=i(n(68280));function i(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.cloneDeep)(o.default.theme)},24683:function(e,t){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){return o="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},o(e)}function i(e){return Array.isArray(e)?e.map((function(e){return i(e)})):"object"===o(e)&&null!==e?Object.fromEntries(Object.entries(e).map((function(e){var t=n(e,2);return[t[0],i(t[1])]}))):e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"cloneDeep",{enumerable:!0,get:function(){return i}})},68280:function(e){function t(e){return t="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},t(e)}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}e.exports={content:[],presets:[],darkMode:"media",theme:{accentColor:function(e){return r(r({},(0,e.theme)("colors")),{},{auto:"auto"})},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:function(e){return(0,e.theme)("blur")},backdropBrightness:function(e){return(0,e.theme)("brightness")},backdropContrast:function(e){return(0,e.theme)("contrast")},backdropGrayscale:function(e){return(0,e.theme)("grayscale")},backdropHueRotate:function(e){return(0,e.theme)("hueRotate")},backdropInvert:function(e){return(0,e.theme)("invert")},backdropOpacity:function(e){return(0,e.theme)("opacity")},backdropSaturate:function(e){return(0,e.theme)("saturate")},backdropSepia:function(e){return(0,e.theme)("sepia")},backgroundColor:function(e){return(0,e.theme)("colors")},backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:function(e){return(0,e.theme)("opacity")},backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:function(e){var t=e.theme;return r(r({},t("colors")),{},{DEFAULT:t("colors.gray.200","currentColor")})},borderOpacity:function(e){return(0,e.theme)("opacity")},borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:function(e){return r({},(0,e.theme)("spacing"))},borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:function(e){return(0,e.theme)("colors")},brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:function(e){return(0,e.theme)("colors")},colors:function(e){var t=e.colors;return{inherit:t.inherit,current:t.current,transparent:t.transparent,black:t.black,white:t.white,slate:t.slate,gray:t.gray,zinc:t.zinc,neutral:t.neutral,stone:t.stone,red:t.red,orange:t.orange,amber:t.amber,yellow:t.yellow,lime:t.lime,green:t.green,emerald:t.emerald,teal:t.teal,cyan:t.cyan,sky:t.sky,blue:t.blue,indigo:t.indigo,violet:t.violet,purple:t.purple,fuchsia:t.fuchsia,pink:t.pink,rose:t.rose}},columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:function(e){return(0,e.theme)("borderColor")},divideOpacity:function(e){return(0,e.theme)("borderOpacity")},divideWidth:function(e){return(0,e.theme)("borderWidth")},dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:function(e){return r({none:"none"},(0,e.theme)("colors"))},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:function(e){return r(r({auto:"auto"},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"})},flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:function(e){return(0,e.theme)("spacing")},gradientColorStops:function(e){return(0,e.theme)("colors")},gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},height:function(e){return r(r({auto:"auto"},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"})},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:function(e){return r(r({auto:"auto"},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"})},invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:function(e){return r({auto:"auto"},(0,e.theme)("spacing"))},lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:function(e){return r(r({},(0,e.theme)("spacing")),{},{none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"})},maxWidth:function(e){var t=e.theme,n=e.breakpoints;return r(r({},t("spacing")),{},{none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"},n(t("screens")))},minHeight:function(e){return r(r({},(0,e.theme)("spacing")),{},{full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"})},minWidth:function(e){return r(r({},(0,e.theme)("spacing")),{},{full:"100%",min:"min-content",max:"max-content",fit:"fit-content"})},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:function(e){return(0,e.theme)("colors")},outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:function(e){return(0,e.theme)("spacing")},placeholderColor:function(e){return(0,e.theme)("colors")},placeholderOpacity:function(e){return(0,e.theme)("opacity")},ringColor:function(e){var t=e.theme;return r({DEFAULT:t("colors.blue.500","#3b82f6")},t("colors"))},ringOffsetColor:function(e){return(0,e.theme)("colors")},ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:function(e){return r({DEFAULT:"0.5"},(0,e.theme)("opacity"))},ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:function(e){return r({},(0,e.theme)("spacing"))},scrollPadding:function(e){return(0,e.theme)("spacing")},sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:function(e){return r({},(0,e.theme)("spacing"))},spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:function(e){return r({none:"none"},(0,e.theme)("colors"))},strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:function(e){return(0,e.theme)("colors")},textDecorationColor:function(e){return(0,e.theme)("colors")},textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:function(e){return r({},(0,e.theme)("spacing"))},textOpacity:function(e){return(0,e.theme)("opacity")},textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:function(e){return r(r({},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"})},size:function(e){return r(r({auto:"auto"},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"})},width:function(e){return r(r({auto:"auto"},(0,e.theme)("spacing")),{},{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content"})},willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.p="/decidim-packs/",function(){"use strict";n(35877);function e(e){this.content=e}e.prototype={constructor:e,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(t,n,r){var o=r&&r!=t?this.remove(r):this,i=o.find(t),a=o.content.slice();return-1==i?a.push(r||t,n):(a[i+1]=n,r&&(a[i]=r)),new e(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var o=this.remove(n),i=o.content.slice(),a=o.find(t);return i.splice(-1==a?i.length:a,0,n,r),new e(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(t){return(t=e.from(t)).size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=e.from(t)).size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};var t=e;function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},i.apply(null,arguments)}function a(e,t,n){return t=f(t),function(e,t){if(t&&("object"==d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&l(o,n.prototype),o}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)},u(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e){return d="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},d(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function m(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}function y(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=y(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function g(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var c=0,l=Math.min(a.text.length,s.text.length);c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var f=g(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var b=function(){function e(t,n){if(h(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return m(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;a<t;i++){var s=this.content[i],u=a+s.nodeSize;if(u>e&&!1!==n(s,r+a,o||null,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,e-c),Math.min(s.content.size,t-c),n,r+c)}a=u}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){var u=a.isText?a.text.slice(Math.max(e,s)-s,t-s):a.isLeaf?r?"function"===typeof r?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&n&&(i?i=!1:o+=n),o+=u}),0),o}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new e(o,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],o=0;if(n>t)for(var i=0,a=0;a<n;i++){var s=this.content[i],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=u}return new e(r,o)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){return y(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function(e){return g(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return k(0,e);if(e==this.size)return k(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?k(n+1,o):k(n,r);r=o}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,o=0;o<t.length;o++){var i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}])}();b.empty=new b([],0);var w={index:0,offset:0};function k(e,t){return w.index=e,w.offset=t,w}function x(e,t){if(e===t)return!0;if(!e||"object"!=d(e)||!t||"object"!=d(t))return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!x(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!x(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}var E=function(){function e(t,n){h(this,e),this.type=t,this.attrs=n}return m(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&x(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));var r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}])}();E.none=[];var C=function(e){function t(){return h(this,t),a(this,t,arguments)}return s(t,e),m(t)}(u(Error)),D=function(){function e(t,n,r){h(this,e),this.content=t,this.openStart=n,this.openEnd=r}return m(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=O(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(S(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(b.fromJSON(t,n.content),r,o)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new e(t,r,o)}}])}();function S(e,t,n){var r=e.findIndex(t),o=r.index,i=r.offset,a=e.maybeChild(o),s=e.findIndex(n),u=s.index,c=s.offset;if(i==t||a.isText){if(c!=n&&!e.child(u).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=u)throw new RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(S(a.content,t-i-1,n-i-1)))}function O(e,t,n,r){var o=e.findIndex(t),i=o.index,a=o.offset,s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));var u=O(s.content,t-a-1,n);return u&&e.replaceChild(i,s.copy(u))}function A(e,t,n){if(n.openStart>e.depth)throw new C("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new C("Inconsistent open depths");return j(e,t,n,0)}function j(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){var a=j(e,t,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var s=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(b.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return F(i,N(e,s.start,s.end,t,r))}var u=e.parent,c=u.content;return F(u,c.cut(0,e.parentOffset).append(n.content).append(c.cut(t.parentOffset)))}return F(i,_(e,t,r))}function T(e,t){if(!t.type.compatibleContent(e.type))throw new C("Cannot join "+t.type.name+" onto "+e.type.name)}function M(e,t,n){var r=e.node(n);return T(r,t.node(n)),r}function L(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function P(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(L(e.nodeAfter,r),i++));for(var s=i;s<a;s++)L(o.child(s),r);t&&t.depth==n&&t.textOffset&&L(t.nodeBefore,r)}function F(e,t){return e.type.checkContent(t),e.copy(t)}function N(e,t,n,r,o){var i=e.depth>o&&M(e,t,o+1),a=r.depth>o&&M(n,r,o+1),s=[];return P(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(T(i,a),L(F(i,N(e,t,n,r,o+1)),s)):(i&&L(F(i,_(e,t,o+1)),s),P(t,n,o,s),a&&L(F(a,_(n,r,o+1)),s)),P(r,null,o,s),new b(s)}function _(e,t,n){var r=[];(P(null,e,n,r),e.depth>n)&&L(F(M(e,t,n+1),_(e,t,n+1)),r);return P(t,null,n,r),new b(r)}D.empty=new D(b.empty,0,0);var R=function(){function e(t,n,r){h(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return m(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o<e;o++)r+=n.child(o).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return E.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new H(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=t;;){var s=a.content.findIndex(i),u=s.index,c=s.offset,l=i-c;if(r.push(a,u,o+c),!l)break;if((a=a.child(u)).isText)break;i=l-1,o+=c+1}return new e(n,r,i)}},{key:"resolveCached",value:function(t,n){var r=z.get(t);if(r)for(var o=0;o<r.elts.length;o++){var i=r.elts[o];if(i.pos==n)return i}else z.set(t,r=new B);var a=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%I,a}}])}(),B=m((function e(){h(this,e),this.elts=[],this.i=0})),I=12,z=new WeakMap,H=function(){return m((function e(t,n,r){h(this,e),this.$from=t,this.$to=n,this.depth=r}),[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}])}(),V=Object.create(null),q=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:E.none;h(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||b.empty}return m(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&x(this.attrs,t||e.defaultAttrs||V)&&E.sameSet(this.marks,n||E.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return D.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i).content.cut(r.pos-a,o.pos-a);return new D(s,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return A(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}},{key:"resolve",value:function(e){return R.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return R.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),W(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s<o;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var e=E.none,t=0;t<this.marks.length;t++){var n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!E.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=void 0;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=b.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}])}();q.prototype.text=void 0;var U=function(e){function t(e,n,r,o){var i;if(h(this,t),i=a(this,t,[e,n,null,o]),!r)throw new RangeError("Empty text nodes are not allowed");return i.text=r,i}return s(t,e),m(t,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):W(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=function(e,t,n,r){var o=i(f(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}(t,"toJSON",this,3)([]);return e.text=this.text,e}}])}(q);function W(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var K=function(){function e(t){h(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return m(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function o(i,a){var s=i.matchFragment(e,n);if(s&&(!t||s.validEnd))return b.from(a.map((function(e){return e.createAndFill()})));for(var u=0;u<i.next.length;u++){var c=i.next[u],l=c.type,f=c.next;if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var d=o(f,a.concat(l));if(d)return d}}return null}(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s++){var u=o.next[s],c=u.type,l=u.next;c.isLeaf||c.hasRequiredAttrs()||c.name in t||r.type&&!l.validEnd||(n.push({match:c.contentMatch,type:c,via:r}),t[c.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new G(t,n);if(null==r.next)return e.empty;var o=J(r);r.next&&r.err("Unexpected trailing text");var i=ne(function(e){var t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}function i(e,t){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(i(n,t))}),[]);if("seq"!=e.type){if("star"==e.type){var a=n();return r(t,a),o(i(e.expr,a),a),[r(a)]}if("plus"==e.type){var s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){for(var u=t,c=0;c<e.min;c++){var l=n();o(i(e.expr,u),l),u=l}if(-1==e.max)o(i(e.expr,u),u);else for(var f=e.min;f<e.max;f++){var d=n();r(u,d),o(i(e.expr,u),d),u=d}return[r(u)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(var h=0;;h++){var p=i(e.exprs[h],t);if(h==e.exprs.length-1)return p;o(p,t=n())}}}(o));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s++){var u=o.next[s],c=u.type,l=u.next;a.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}}])}();K.empty=new K(!0);var G=function(){return m((function e(t,n){h(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}),[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}])}();function J(e){var t=[];do{t.push(Y(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Y(e){var t=[];do{t.push(Q(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Q(e){for(var t=function(e){if(e.eat("(")){var t=J(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Z(e,t)}return t}function X(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Z(e,t){var n=X(e),r=n;return e.eat(",")&&(r="}"!=e.next?X(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function ee(e,t){return t-e}function te(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,u=a.to;s||-1!=n.indexOf(u)||t(u)}}(t),n.sort(ee)}function ne(e){var t=Object.create(null);return function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var i,a=0;a<o.length;a++)o[a][0]==n&&(i=o[a][1]);te(e,r).forEach((function(e){i||o.push([n,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}}))}));for(var i=t[r.join(",")]=new K(r.indexOf(e.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(ee);i.next.push({type:o[a][0],next:t[s.join(",")]||n(s)})}return i}(te(e,0))}function re(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function oe(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function ie(e,t,n,r){for(var o in t)if(!(o in e))throw new RangeError("Unsupported attribute ".concat(o," for ").concat(n," of type ").concat(o));for(var i in e){var a=e[i];a.validate&&a.validate(t[i])}}function ae(e,t){var n=Object.create(null);if(t)for(var r in t)n[r]=new ue(e,r,t[r]);return n}var se=function(){function e(t,n,r){h(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ae(t,r.attrs),this.defaultAttrs=re(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return m(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==K.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:oe(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new q(this,this.computeAttrs(e),b.from(t),E.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return t=b.from(t),this.checkContent(t),new q(this,this.computeAttrs(e),t,E.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=b.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(b.empty,!0);return i?new q(this,e,t.append(i),E.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(e){if(!this.validContent(e))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(e.toString().slice(0,50)))}},{key:"checkAttrs",value:function(e){ie(this.attrs,e,"node",this.name)}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:E.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach((function(t,o){return r[t]=new e(t,n,o)}));var o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}])}();var ue=function(){return m((function e(t,n,r){h(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?function(e,t,n){var r=n.split("|");return function(n){var o=null===n?"null":d(n);if(r.indexOf(o)<0)throw new RangeError("Expected value of type ".concat(r," for attribute ").concat(t," on type ").concat(e,", got ").concat(o))}}(t,n,r.validate):r.validate}),[{key:"isRequired",get:function(){return!this.hasDefault}}])}(),ce=function(){function e(t,n,r,o){h(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=ae(t,o.attrs),this.excluded=null;var i=re(this.attrs);this.instance=i?new E(this,i):null}return m(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new E(this,oe(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"checkAttrs",value:function(e){ie(this.attrs,e,"mark",this.name)}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),o=0;return t.forEach((function(t,i){return r[t]=new e(t,o++,n,i)})),r}}])}(),le=function(){return m((function e(n){h(this,e),this.linebreakReplacement=null,this.cached=Object.create(null);var r=this.spec={};for(var o in n)r[o]=n[o];r.nodes=t.from(n.nodes),r.marks=t.from(n.marks||{}),this.nodes=se.compile(this.spec.nodes,this),this.marks=ce.compile(this.spec.marks,this);var i=Object.create(null);for(var a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");var s=this.nodes[a],u=s.spec.content||"",c=s.spec.marks;if(s.contentMatch=i[u]||(i[u]=K.parse(u,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet="_"==c?null:c?fe(this,c.split(" ")):""!=c&&s.inlineContent?null:[]}for(var l in this.marks){var f=this.marks[l],d=f.spec.excludes;f.excluded=null==d?[f]:""==d?[]:fe(this,d.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}),[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof se))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new U(n,n.defaultAttrs,e,E.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return q.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return E.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}])}();function fe(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var u=e.marks[s];("_"==o||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var de=function(){function e(t,n){var r=this;h(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[];var o=this.matchedStyles=[];n.forEach((function(e){if(function(e){return null!=e.tag}(e))r.tags.push(e);else if(function(e){return null!=e.style}(e)){var t=/[^=]*/.exec(e.style)[0];o.indexOf(t)<0&&o.push(t),r.styles.push(e)}})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return m(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ge(this,t,!1);return n.addAll(e,E.none,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ge(this,t,!0);return n.addAll(e,E.none,t.from,t.to),D.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(be(e,o.tag)&&(void 0===o.namespace||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i||void 0}return o}}}},{key:"matchStyle",value:function(e,t,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o],a=i.style;if(!(0!=a.indexOf(e)||i.context&&!n.matchesContext(i.context)||a.length>e.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(i.getAttrs){var s=i.getAttrs(t);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=we(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))};for(var o in e.marks)r(o);var i=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach((function(e){n(e=we(e)),e.node||e.ignore||e.mark||(e.node=t)}))};for(var a in e.nodes)i(a);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}])}(),he={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},me={ol:!0,ul:!0};function ve(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var ye=function(){return m((function e(t,n,r,o,i,a){h(this,e),this.type=t,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=E.none,this.match=i||(4&a?null:t.contentMatch)}),[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(b.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var o=b.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(b.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!he.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}])}(),ge=function(){return m((function e(t,n,r){h(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var o,i=n.topNode,a=ve(null,n.preserveWhitespace,0)|(r?4:0);o=i?new ye(i.type,i.attrs,E.none,!0,n.topMatch||i.type.contentMatch,a):new ye(r?null:t.schema.topNodeType,null,E.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}),[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}},{key:"addTextNode",value:function(e,t){var n=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,"\n"):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){var o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&"BR"==i.nodeName||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t,n){var r,o=e.nodeName.toLowerCase();me.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&me.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,n));if(i?i.ignore:pe.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);var a,s=this.top,u=this.needsBlock;if(he.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e,t);var c=i&&i.skip?t:this.readStyles(e,t);c&&this.addAll(e,c),a&&this.sync(s),this.needsBlock=u}else{var l=this.readStyles(e,t);l&&this.addElementByRule(e,i,l,!1===i.consuming?r:void 0)}}},{key:"leafFallback",value:function(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}},{key:"ignoreFallback",value:function(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t)}},{key:"readStyles",value:function(e,t){var n=this,r=e.style;if(r&&r.length)for(var o=0;o<this.parser.matchedStyles.length;o++){var i=this.parser.matchedStyles[o],a=r.getPropertyValue(i);if(a)for(var s,u=function(e){var r=n.parser.matchStyle(i,a,n,e);return r?r.ignore?{v:null}:(t=r.clearMark?t.filter((function(e){return!r.clearMark(e)})):t.concat(n.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming?(c=e,0):void(c=e=r)):(c=e,0)},c=void 0;0!==(s=u(c));)if(s)return s.v}return t}},{key:"addElementByRule",value:function(e,t,n,r){var o,i,a=this;if(t.node)if((i=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(i.create(t.attrs),n)||this.leafFallback(e,n);else{var s=this.enter(i,t.attrs||null,n,t.preserveWhitespace);s&&(o=!0,n=s)}else{var u=this.parser.schema.marks[t.mark];n=n.concat(u.create(t.attrs))}var c=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return a.insertNode(e,n)}));else{var l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n)}o&&this.sync(c)&&this.open--}},{key:"addAll",value:function(e,t,n,r){for(var o=n||0,i=n?e.childNodes[n]:e.firstChild,a=null==r?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}},{key:"findPlace",value:function(e,t){for(var n,r,o=this.open;o>=0;o--){var i=this.nodes[o],a=i.findWrapping(e);if(a&&(!n||n.length>a.length)&&(n=a,r=i,!a.length))break;if(i.solid)break}if(!n)return null;this.sync(r);for(var s=0;s<n.length;s++)t=this.enterInner(n[s],null,t,!1);return t}},{key:"insertNode",value:function(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){var n=this.textblockFromContext();n&&(t=this.enterInner(n,null,t))}var o=this.findPlace(e,t);if(o){this.closeExtra();var i=this.top;i.match&&(i.match=i.match.matchType(e.type));var a,s=E.none,u=r(o.concat(e.marks));try{for(u.s();!(a=u.n()).done;){var c=a.value;(i.type?i.type.allowsMarkType(c.type):ke(c.type,e.type))&&(s=c.addToSet(s))}}catch(l){u.e(l)}finally{u.f()}return i.content.push(e.mark(s)),!0}return!1}},{key:"enter",value:function(e,t,n,r){var o=this.findPlace(e.create(t),n);return o&&(o=this.enterInner(e,t,n,!0,r)),o}},{key:"enterInner",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;this.closeExtra();var i=this.top;i.match=i.match&&i.match.matchType(e);var a=ve(e,o,i.options);4&i.options&&0==i.content.length&&(a|=4);var s=E.none;return n=n.filter((function(t){return!(i.type?i.type.allowsMarkType(t.type):ke(t.type,e))||(s=t.addToSet(s),!1)})),this.nodes.push(new ye(e,t,s,r,null,a)),this.open++,n}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var u=n[e];if(""==u){if(e==n.length-1||0==e)continue;for(;s>=i;s--)if(a(e-1,s))return!0;return!1}var c=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!c||c.name!=u&&-1==c.groups.indexOf(u))return!1;s--}return!0};return a(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}}])}();function be(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function we(e){var t={};for(var n in e)t[n]=e[n];return t}function ke(e,t){var n,r=t.schema.nodes,o=function(){var n=r[i];if(!n.allowsMarkType(e))return 0;var o=[],a=function(e){o.push(e);for(var n=0;n<e.edgeCount;n++){var r=e.edge(n),i=r.type,s=r.next;if(i==t)return!0;if(o.indexOf(s)<0&&a(s))return!0}};return a(n.contentMatch)?{v:!0}:void 0};for(var i in r)if(0!==(n=o())&&n)return n.v}var xe=function(){function e(t,n){h(this,e),this.nodes=t,this.marks=n}return m(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=Ce(n).createDocumentFragment());var o=r,i=[];return e.forEach((function(e){if(i.length||e.marks.length){for(var r=0,a=0;r<i.length&&a<e.marks.length;){var s=e.marks[a];if(t.marks[s.type.name]){if(!s.eq(i[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<i.length;)o=i.pop()[1];for(;a<e.marks.length;){var u=e.marks[a++],c=t.serializeMark(u,e.isInline,n);c&&(i.push([u,o]),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(t.serializeNodeInner(e,n))})),r}},{key:"serializeNodeInner",value:function(e,t){var n=Oe(Ce(t),this.nodes[e.type.name](e),null,e.attrs),r=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,o)}return r}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.marks[e.type.name];return r&&Oe(Ce(n),r(e,t),null,e.attrs)}}],[{key:"renderSpec",value:function(e,t){return Oe(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0)}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=Ee(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return Ee(e.marks)}}])}();function Ee(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ce(e){return e.document||window.document}var De=new WeakMap;function Se(e){var t=De.get(e);return void 0===t&&De.set(e,t=function(e){var t=null;function n(e){if(e&&"object"==d(e))if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(var r=0;r<e.length;r++)n(e[r]);else for(var o in e)n(e[o])}return n(e),t}(e)),t}function Oe(e,t,n,r){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;var o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Se(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");var a,s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));var u=n?e.createElementNS(n,i):e.createElement(i),c=t[1],l=1;if(c&&"object"==d(c)&&null==c.nodeType&&!Array.isArray(c))for(var f in l=2,c)if(null!=c[f]){var h=f.indexOf(" ");h>0?u.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):u.setAttribute(f,c[f])}for(var p=l;p<t.length;p++){var m=t[p];if(0===m){if(p<t.length-1||p>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}var v=Oe(e,m,n,r),y=v.dom,g=v.contentDOM;if(u.appendChild(y),g){if(a)throw new RangeError("Multiple content holes");a=g}}return{dom:u,contentDOM:a}}function Ae(e){var t="function"==typeof Map?new Map:void 0;return Ae(e)}function je(e,t,n){return t=Me(t),function(e,t){if(t&&("object"==Fe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Te()?Reflect.construct(t,n||[],Me(e).constructor):t.apply(e,n))}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Te=function(){return!!e})()}function Me(e){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Me(e)}function Le(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pe(e,t)}function Pe(e,t){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pe(e,t)}function Fe(e){return Fe="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},Fe(e)}function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Be(r.key),r)}}function Re(e,t,n){return t&&_e(e.prototype,t),n&&_e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(e){var t=function(e,t){if("object"!=Fe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fe(t)?t:t+""}var Ie=Math.pow(2,16);function ze(e){return 65535&e}var He=function(){return Re((function e(t,n,r){Ne(this,e),this.pos=t,this.delInfo=n,this.recover=r}),[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}])}(),Ve=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ne(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return Re(e,[{key:"recover",value:function(e){var t=0,n=ze(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ie}(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>e)break;var u=this.ranges[a+o],c=this.ranges[a+i],l=s+u;if(e<=l){var f=s+r+((u?e==s?-1:e==l?1:t:t)<0?0:c);if(n)return f;var d=e==(t<0?s:l)?null:a/3+(e-s)*Ie,h=e==s?2:e==l?1:4;return(t<0?e!=s:e!=l)&&(h|=8),new He(f,h,d)}r+=c-u}return n?e+r:new He(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=ze(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var u=this.ranges[a+o];if(e<=s+u&&a==3*r)return!0;n+=this.ranges[a+i]-u}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),u=this.ranges[r+t],c=this.ranges[r+n];e(a,a+u,s,s+c),o+=c-u}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}])}();Ve.empty=new Ve([]);var $e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;Ne(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=o}return Re(e,[{key:"slice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}},{key:"getMirror",value:function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}},{key:"setMirror",value:function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}},{key:"appendMappingInverted",value:function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(e,t);if(null!=i.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,e=this.maps[a].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new He(e,r,null)}}])}(),qe=Object.create(null),Ue=function(){return Re((function e(){Ne(this,e)}),[{key:"getMap",value:function(){return Ve.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=qe[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in qe)throw new RangeError("Duplicate use of step JSON ID "+e);return qe[e]=t,t.prototype.jsonID=e,t}}])}(),We=function(){function e(t,n){Ne(this,e),this.doc=t,this.failed=n}return Re(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(i){if(i instanceof C)return e.fail(i.message);throw i}}}])}();function Ke(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(Ke(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return b.fromArray(r)}var Ge=function(e){function t(e,n,r){var o;return Ne(this,t),(o=je(this,t)).from=e,o.to=n,o.mark=r,o}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new D(Ke(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Je(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(Ue);Ue.jsonID("addMark",Ge);var Je=function(e){function t(e,n,r){var o;return Ne(this,t),(o=je(this,t)).from=e,o.to=n,o.mark=r,o}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new D(Ke(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new Ge(this.from,this.to,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}}])}(Ue);Ue.jsonID("removeMark",Je);var Ye=function(e){function t(e,n){var r;return Ne(this,t),(r=je(this,t)).pos=e,r.mark=n,r}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return We.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return We.fromReplace(e,this.pos,this.pos+1,new D(b.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var n=e.nodeAt(this.pos);if(n){var r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(var o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new t(this.pos,n.marks[o]);return new t(this.pos,this.mark)}}return new Qe(this.pos,this.mark)}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(Ue);Ue.jsonID("addNodeMark",Ye);var Qe=function(e){function t(e,n){var r;return Ne(this,t),(r=je(this,t)).pos=e,r.mark=n,r}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return We.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return We.fromReplace(e,this.pos,this.pos+1,new D(b.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Ye(this.pos,this.mark):this}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new t(n.pos,e.markFromJSON(n.mark))}}])}(Ue);Ue.jsonID("removeNodeMark",Qe);var Xe=function(e){function t(e,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Ne(this,t),(o=je(this,t)).from=e,o.to=n,o.slice=r,o.structure=i,o}return Le(t,e),Re(t,[{key:"apply",value:function(e){return this.structure&&et(e,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Ve([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?D.empty:new D(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var r=this.slice.size+e.slice.size==0?D.empty:new D(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,D.fromJSON(e,n.slice),!!n.structure)}}])}(Ue);Ue.jsonID("replace",Xe);var Ze=function(e){function t(e,n,r,o,i,a){var s,u=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return Ne(this,t),(s=je(this,t)).from=e,s.to=n,s.gapFrom=r,s.gapTo=o,s.slice=i,s.insert=a,s.structure=u,s}return Le(t,e),Re(t,[{key:"apply",value:function(e){if(this.structure&&(et(e,this.from,this.gapFrom)||et(e,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return We.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?We.fromReplace(e,this.from,this.to,n):We.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Ve([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(e,n.slice),n.insert,!!n.structure)}}])}(Ue);function et(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function tt(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e.doc.nodeAt(t),a=[],s=t+1,u=0;u<i.childCount;u++){var c=i.child(u),l=s+c.nodeSize,f=r.matchType(c.type);if(f){r=f;for(var d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||e.step(new Je(s,l,c.marks[d]));if(o&&c.isText&&"pre"!=n.whitespace)for(var h=void 0,p=/\r?\n|\r/g,m=void 0;h=p.exec(c.text);)m||(m=new D(b.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new Xe(s+h.index,s+h.index+h[0].length,m))}else a.push(new Xe(s,l,D.empty));s=l}if(!r.validEnd){var v=r.fillBefore(b.empty,!0);e.replace(s,s,new D(v,0,0))}for(var y=a.length-1;y>=0;y--)e.step(a[y])}function nt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function rt(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!nt(r,o,i))break}return null}function ot(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}(e,t),i=o&&function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,u=r;s&&u<o;u++)s=s.matchType(n.child(u).type);return s&&s.validEnd?a:null}(r,t);return i?o.map(it).concat({type:t,attrs:n}).concat(i.map(it)):null}function it(e){return{type:e,attrs:null}}function at(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,u=n-2;s>i;s--,u--){var c=o.node(s),l=o.index(s);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(l,c.childCount),d=r&&r[u+1];d&&(f=f.replaceChild(0,d.type.create(d.attrs)));var h=r&&r[u]||c;if(!c.canReplace(l+1,c.childCount)||!h.type.validContent(f))return!1}var p=o.indexAfter(i),m=r&&r[0];return o.node(i).canReplaceWith(p,p,m?m.type:o.node(i+1).type)}function st(e,t){var n=e.resolve(t),r=n.index();return ut(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ut(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function ct(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&ut(i,a)&&r.node(o).canReplace(s,s+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function lt(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(u>0?1:0),l=r.node(s),f=!1;if(1==a)f=l.canReplace(c,c,o);else{var d=l.contentMatchAt(c).findWrapping(o.firstChild.type);f=d&&l.canReplaceWith(c,c,d[0])}if(f)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function ft(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:D.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return dt(o,i,r)?new Xe(t,n,r):new ht(o,i,r).fit()}function dt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ue.jsonID("replaceAround",Ze);var ht=function(){return Re((function e(t,n,r){Ne(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=b.empty;for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(var a=t.depth;a>0;a--)this.placed=b.from(t.node(a).copy(this.placed))}),[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var u=new D(i,a,s);return t>-1?new Ze(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Xe(r.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=this.unplaced.openStart,t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){var o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(var i=1;i<=2;i++)for(var a=1==i?e:this.unplaced.openStart;a>=0;a--)for(var s=null,u=(a?(s=vt(this.unplaced.content,a-1).firstChild).content:this.unplaced.content).firstChild,c=this.depth;c>=0;c--){var l=this.frontier[c],f=l.type,d=l.match,h=void 0,p=null;if(1==i&&(u?d.matchType(u.type)||(p=d.fillBefore(b.from(u),!1)):s&&f.compatibleContent(s.type)))return{sliceDepth:a,frontierDepth:c,parent:s,inject:p};if(2==i&&u&&(h=d.findWrapping(u.type)))return{sliceDepth:a,frontierDepth:c,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=vt(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new D(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=vt(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new D(pt(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new D(pt(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a<i.length;a++)this.openFrontierNode(i[a]);var s=this.unplaced,u=r?r.content:s.content,c=s.openStart-t,l=0,f=[],d=this.frontier[n],h=d.match,p=d.type;if(o){for(var m=0;m<o.childCount;m++)f.push(o.child(m));h=h.matchFragment(o)}for(var v=u.size+t-(s.content.size-s.openEnd);l<u.childCount;){var y=u.child(l),g=h.matchType(y.type);if(!g)break;(++l>1||0==c||y.content.size)&&(h=g,f.push(yt(y.mark(p.allowedMarks(y.marks)),1==l?c:0,l==u.childCount?v:-1)))}var w=l==u.childCount;w||(v=-1),this.placed=mt(this.placed,n,b.from(f)),this.frontier[n].match=h,w&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var k=0,x=u;k<v;k++){var E=x.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),x=E.content}this.unplaced=w?0==t?D.empty:new D(pt(s.content,t-1,1),t-1,v<0?s.openEnd:t-1):new D(pt(s.content,t,l),s.openStart,s.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!gt(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=gt(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],c=u.match,l=gt(e,s,u.type,c,!0);if(!l||l.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=mt(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}},{key:"openFrontierNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=mt(this.placed,this.depth,b.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(b.empty,!0);e.childCount&&(this.placed=mt(this.placed,this.frontier.length,e))}}])}();function pt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(pt(e.firstChild.content,t-1,n)))}function mt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(mt(e.lastChild.content,t-1,n)))}function vt(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function yt(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,yt(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(b.empty,!0)))),e.copy(r)}function gt(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,a)?s:null}function bt(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(bt(i.content,t+1,n,r,i)))}if(t>r){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(b.empty,!0))}return e}function wt(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var kt=function(e){function t(e,n,r){var o;return Ne(this,t),(o=je(this,t)).pos=e,o.attr=n,o.value=r,o}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return We.fail("No node at attribute step's position");var n=Object.create(null);for(var r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;var o=t.type.create(n,null,t.marks);return We.fromReplace(e,this.pos,this.pos+1,new D(b.from(o),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return Ve.empty}},{key:"invert",value:function(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}}])}(Ue);Ue.jsonID("attr",kt);var xt=function(e){function t(e,n){var r;return Ne(this,t),(r=je(this,t)).attr=e,r.value=n,r}return Le(t,e),Re(t,[{key:"apply",value:function(e){var t=Object.create(null);for(var n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;var r=e.type.create(t,e.content,e.marks);return We.ok(r)}},{key:"getMap",value:function(){return Ve.empty}},{key:"invert",value:function(e){return new t(this.attr,e.attrs[this.attr])}},{key:"map",value:function(e){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}}])}(Ue);Ue.jsonID("docAttr",xt);var Et=Error;((Et=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Et,Et.prototype.name="TransformError";var Ct=function(){return Re((function e(t){Ne(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new $e}),[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new Et(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D.empty,r=ft(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new D(b.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,D.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),i=e.doc.resolve(n);if(dt(o,i,r))return e.step(new Xe(t,n,r));var a=wt(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var u=o.depth,c=o.pos-1;u>0;u--,c--){var l=o.node(u).type.spec;if(l.defining||l.definingAsContext||l.isolating)break;a.indexOf(u)>-1?s=u:o.before(u)==c&&a.splice(1,0,-u)}for(var f,d=a.indexOf(s),h=[],p=r.openStart,m=r.content,v=0;;v++){var y=m.firstChild;if(h.push(y),v==r.openStart)break;m=y.content}for(var g=p-1;g>=0;g--){var b=h[g],w=(f=b.type).spec.defining||f.spec.definingForContent;if(w&&!b.sameMarkup(o.node(Math.abs(s)-1)))p=g;else if(w||!b.type.isTextblock)break}for(var k=r.openStart;k>=0;k--){var x=(k+p+1)%(r.openStart+1),E=h[x];if(E)for(var C=0;C<a.length;C++){var S=a[(C+d)%a.length],O=!0;S<0&&(O=!1,S=-S);var A=o.node(S-1),j=o.index(S-1);if(A.canReplaceWith(j,j,E.type,E.marks))return e.replace(o.before(S),O?i.after(S):n,new D(bt(r.content,0,r.openStart,x),x,r.openEnd))}}for(var T=e.steps.length,M=a.length-1;M>=0&&(e.replace(t,n,r),!(e.steps.length>T));M--){var L=a[M];L<0||(t=o.before(L),n=i.after(L))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new D(b.from(r),0,0))}(this,e,t,n),this}},{key:"deleteRange",value:function(e,t){return function(e,t,n){for(var r=e.doc.resolve(t),o=e.doc.resolve(n),i=wt(r,o),a=0;a<i.length;a++){var s=i[a],u=a==i.length-1;if(u&&0==s||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),o.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(var c=1;c<=r.depth&&c<=o.depth;c++)if(t-r.start(c)==r.depth-c&&n>r.end(c)&&o.end(c)-n!=o.depth-c)return e.delete(r.before(c),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,o=t.$to,i=t.depth,a=r.before(i+1),s=o.after(i+1),u=a,c=s,l=b.empty,f=0,d=i,h=!1;d>n;d--)h||r.index(d)>0?(h=!0,l=b.from(r.node(d).copy(l)),f++):u--;for(var p=b.empty,m=0,v=i,y=!1;v>n;v--)y||o.after(v+1)<o.end(v)?(y=!0,p=b.from(o.node(v).copy(p)),m++):c++;e.step(new Ze(u,c,a,s,new D(l.append(p),f,m),l.size-f,!0))}(this,e,t),this}},{key:"join",value:function(e){return function(e,t,n){var r=new Xe(t-n,t+n,D.empty,!0);e.step(r)}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=b.empty,o=n.length-1;o>=0;o--){if(r.size){var i=n[o].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=b.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new Ze(a,s,a,s,new D(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=e.steps.length;e.doc.nodesBetween(t,n,(function(t,n){var a="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,a)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){var s=null;if(r.schema.linebreakReplacement){var u="pre"==r.whitespace,c=!!r.contentMatch.matchType(r.schema.linebreakReplacement);u&&!c?s=!1:!u&&c&&(s=!0)}!1===s&&function(e,t,n,r){t.forEach((function(o,i){if(o.type==o.type.schema.linebreakReplacement){var a=e.mapping.slice(r).map(n+1+i);e.replaceWith(a,a+1,t.type.schema.text("\n"))}}))}(e,t,n,i),tt(e,e.mapping.slice(i).map(n,1),r,void 0,null===s);var l=e.mapping.slice(i),f=l.map(n,1),d=l.map(n+t.nodeSize,1);return e.step(new Ze(f,d,f+1,d-1,new D(b.from(r.create(a,null,t.marks)),0,0),1,!0)),!0===s&&function(e,t,n,r){t.forEach((function(o,i){if(o.isText)for(var a,s=/\r?\n|\r/g;a=s.exec(o.text);){var u=e.mapping.slice(r).map(n+1+i+a.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}))}(e,t,n,i),!1}}))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function(e,t){return function(e,t,n,r,o){var i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);var a=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ze(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new D(b.from(a),0,0),1,!0))}(this,e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}},{key:"setNodeAttribute",value:function(e,t,n){return this.step(new kt(e,t,n)),this}},{key:"setDocAttribute",value:function(e,t){return this.step(new xt(e,t)),this}},{key:"addNodeMark",value:function(e,t){return this.step(new Ye(e,t)),this}},{key:"removeNodeMark",value:function(e,t){if(!(t instanceof E)){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Qe(e,t)),this}},{key:"split",value:function(e){return function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),i=b.empty,a=b.empty,s=o.depth,u=o.depth-n,c=n-1;s>u;s--,c--){i=b.from(o.node(s).copy(i));var l=r&&r[c];a=b.from(l?l.type.create(l.attrs,a):o.node(s).copy(a))}e.step(new Xe(t,t,new D(i.append(a),n,n),!0))}(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var o,i,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,u,c){if(e.isInline){var l=e.marks;if(!r.isInSet(l)&&c.type.allowsMarkType(r.type)){for(var f=Math.max(u,t),d=Math.min(u+e.nodeSize,n),h=r.addToSet(l),p=0;p<l.length;p++)l[p].isInSet(h)||(o&&o.to==f&&o.mark.eq(l[p])?o.to=d:a.push(o=new Je(f,d,l[p])));i&&i.to==f?i.to=d:s.push(i=new Ge(f,d,r))}}})),a.forEach((function(t){return e.step(t)})),s.forEach((function(t){return e.step(t)}))}(this,e,t,n),this}},{key:"removeMark",value:function(e,t,n){return function(e,t,n,r){var o=[],i=0;e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){i++;var s=null;if(r instanceof ce)for(var u,c=e.marks;u=r.isInSet(c);)(s||(s=[])).push(u),c=u.removeFromSet(c);else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length)for(var l=Math.min(a+e.nodeSize,n),f=0;f<s.length;f++){for(var d=s[f],h=void 0,p=0;p<o.length;p++){var m=o[p];m.step==i-1&&d.eq(o[p].style)&&(h=m)}h?(h.to=l,h.step=i):o.push({style:d,from:Math.max(a,t),to:l,step:i})}}})),o.forEach((function(t){return e.step(new Je(t.from,t.to,t.style))}))}(this,e,t,n),this}},{key:"clearIncompatible",value:function(e,t,n){return tt(this,e,t,n),this}}])}();function Dt(e,t,n){return t=jt(t),function(e,t){if(t&&("object"==Lt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,St()?Reflect.construct(t,n||[],jt(e).constructor):t.apply(e,n))}function St(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(St=function(){return!!e})()}function Ot(e,t,n,r){var o=At(jt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function At(){return At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=jt(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},At.apply(null,arguments)}function jt(e){return jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jt(e)}function Tt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mt(e,t)}function Mt(e,t){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mt(e,t)}function Lt(e){return Lt="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},Lt(e)}function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_t(r.key),r)}}function Nt(e,t,n){return t&&Ft(e.prototype,t),n&&Ft(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _t(e){var t=function(e,t){if("object"!=Lt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Lt(t)?t:t+""}var Rt=Object.create(null),Bt=function(){return Nt((function e(t,n,r){Pt(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new It(t.min(n),t.max(n))]}),[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.empty,n=t.content.lastChild,r=null,o=0;o<t.openEnd;o++)r=n,n=n.lastChild;for(var i=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var u=a[s],c=u.$from,l=u.$to,f=e.mapping.slice(i);e.replaceRange(f.map(c.pos),f.map(l.pos),s?D.empty:t),0==s&&Jt(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,u=e.mapping.slice(n),c=u.map(a.pos),l=u.map(s.pos);o?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Jt(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return Vt.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new Vt(e):Gt(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?Gt(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):Gt(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new Wt(e.node(0))}},{key:"atStart",value:function(e){return Gt(e,e,0,0,1)||new Wt(e)}},{key:"atEnd",value:function(e){return Gt(e,e,e.content.size,e.childCount,-1)||new Wt(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Rt[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in Rt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rt[e]=t,t.prototype.jsonID=e,t}}])}();Bt.prototype.visible=!0;var It=Nt((function e(t,n){Pt(this,e),this.$from=t,this.$to=n})),zt=!1;function Ht(e){zt||e.parent.inlineContent||(zt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Vt=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Pt(this,t),Ht(e),Ht(n),Dt(this,t,[e,n])}return Tt(t,e),Nt(t,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,n){var r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Bt.near(r);var o=e.resolve(n.map(this.anchor));return new t(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.empty;if(Ot(t,"replace",this,3)([e,n]),n==D.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new $t(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,n,r){var o=e.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){var i=Bt.findFrom(n,r,!0)||Bt.findFrom(n,-r,!0);if(!i)return Bt.near(n,r);n=i.$head}return e.parent.inlineContent||(0==o||(e=(Bt.findFrom(e,-r,!0)||Bt.findFrom(e,r,!0)).$anchor).pos<n.pos!=o<0)&&(e=n),new t(e,n)}}])}(Bt);Bt.jsonID("text",Vt);var $t=function(){function e(t,n){Pt(this,e),this.anchor=t,this.head=n}return Nt(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return Vt.between(e.resolve(this.anchor),e.resolve(this.head))}}])}(),qt=function(e){function t(e){var n;Pt(this,t);var r=e.nodeAfter,o=e.node(0).resolve(e.pos+r.nodeSize);return(n=Dt(this,t,[e,o])).node=r,n}return Tt(t,e),Nt(t,[{key:"map",value:function(e,n){var r=n.mapResult(this.anchor),o=r.deleted,i=r.pos,a=e.resolve(i);return o?Bt.near(a):new t(a)}},{key:"content",value:function(){return new D(b.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof t&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new Ut(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))}},{key:"create",value:function(e,n){return new t(e.resolve(n))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}])}(Bt);qt.prototype.visible=!1,Bt.jsonID("node",qt);var Ut=function(){function e(t){Pt(this,e),this.anchor=t}return Nt(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,o=n.pos;return r?new $t(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&qt.isSelectable(n)?new qt(t):Bt.near(t)}}])}(),Wt=function(e){function t(e){return Pt(this,t),Dt(this,t,[e.resolve(0),e.resolve(e.content.size)])}return Tt(t,e),Nt(t,[{key:"replace",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.empty;if(n==D.empty){e.delete(0,e.doc.content.size);var r=Bt.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else Ot(t,"replace",this,3)([e,n])}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new t(e)}},{key:"eq",value:function(e){return e instanceof t}},{key:"getBookmark",value:function(){return Kt}}],[{key:"fromJSON",value:function(e){return new t(e)}}])}(Bt);Bt.jsonID("all",Wt);var Kt={map:function(){return this},resolve:function(e){return new Wt(e)}};function Gt(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return Vt.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&qt.isSelectable(s))return qt.create(e,n-(o<0?s.nodeSize:0))}else{var u=Gt(e,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function Jt(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,i=e.steps[r];if(i instanceof Xe||i instanceof Ze)e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(Bt.near(e.doc.resolve(o),n))}}var Yt=function(e){function t(e){var n;return Pt(this,t),(n=Dt(this,t,[e.doc])).curSelectionFor=0,n.updated=0,n.meta=Object.create(null),n.time=Date.now(),n.curSelection=e.selection,n.storedMarks=e.storedMarks,n}return Tt(t,e),Nt(t,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return E.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,n){Ot(t,"addStep",this,3)([e,n]),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||E.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(Bt.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}])}(Ct);function Qt(e,t){return t&&e?e.bind(t):e}var Xt=Nt((function e(t,n,r){Pt(this,e),this.name=t,this.init=Qt(n.init,r),this.apply=Qt(n.apply,r)})),Zt=[new Xt("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Xt("selection",{init:function(e,t){return e.selection||Bt.atStart(t.doc)},apply:function(e){return e.selection}}),new Xt("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Xt("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],en=Nt((function e(t,n){var r=this;Pt(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Zt.slice(),n&&n.forEach((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new Xt(e.key,e.spec.state,e))}))})),tn=function(){function e(t){Pt(this,e),this.config=t}return Nt(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,u=r?r[i].state:this,c=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,u,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}},{key:"tr",get:function(){return new Yt(this)}},{key:"reconfigure",value:function(t){for(var n=new en(this.schema,t.plugins),r=n.fields,o=new e(n),i=0;i<r.length;i++){var a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(t,o)}return o}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==Lt(e))for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new en(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}},{key:"fromJSON",value:function(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new en(t.schema,t.plugins),i=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)i.doc=q.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=Bt.fromJSON(i.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var o in r){var a=r[o],s=a.spec.state;if(a.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(i[e.name]=s.fromJSON.call(a,t,n[o],i))}i[e.name]=e.init(t,i)}})),i}}])}();function nn(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=nn(o,t,{})),n[r]=o}return n}var rn=function(){return Nt((function e(t){Pt(this,e),this.spec=t,this.props={},t.props&&nn(t.props,this,this.props),this.key=t.key?t.key.key:an("plugin")}),[{key:"getState",value:function(e){return e[this.key]}}])}(),on=Object.create(null);function an(e){return e in on?e+"$"+ ++on[e]:(on[e]=0,e+"$")}var sn=function(){return Nt((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";Pt(this,e),this.key=an(t)}),[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}])}();function un(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||ln(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ln(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ln(e,t){if(e){if("string"==typeof e)return fn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fn(e,t):void 0}}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dn(e,t,n){return t=vn(t),function(e,t){if(t&&("object"==bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hn()?Reflect.construct(t,n||[],vn(e).constructor):t.apply(e,n))}function hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hn=function(){return!!e})()}function pn(e,t,n,r){var o=mn(vn(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function mn(){return mn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=vn(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},mn.apply(null,arguments)}function vn(e){return vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vn(e)}function yn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gn(e,t)}function bn(e){return bn="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},bn(e)}function wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,En(r.key),r)}}function xn(e,t,n){return t&&kn(e.prototype,t),n&&kn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function En(e){var t=function(e,t){if("object"!=bn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bn(t)?t:t+""}var Cn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Dn=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Sn=null,On=function(e,t,n){var r=Sn||(Sn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},An=function(e,t,n,r){return n&&(Tn(e,t,n,r,-1)||Tn(e,t,n,r,1))},jn=/^(img|br|input|textarea|hr)$/i;function Tn(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Mn(e))){var i=e.parentNode;if(!i||1!=i.nodeType||Ln(e)||jn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Cn(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Mn(e):0}}}function Mn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ln(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Pn=function(e){return e.focusNode&&An(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Fn(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var Nn="undefined"!=typeof navigator?navigator:null,_n="undefined"!=typeof document?document:null,Rn=Nn&&Nn.userAgent||"",Bn=/Edge\/(\d+)/.exec(Rn),In=/MSIE \d/.exec(Rn),zn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),Hn=!!(In||zn||Bn),Vn=In?document.documentMode:zn?+zn[1]:Bn?+Bn[1]:0,$n=!Hn&&/gecko\/(\d+)/i.test(Rn);$n&&(/Firefox\/(\d+)/.exec(Rn)||[0,0])[1];var qn=!Hn&&/Chrome\/(\d+)/.exec(Rn),Un=!!qn,Wn=qn?+qn[1]:0,Kn=!Hn&&!!Nn&&/Apple Computer/.test(Nn.vendor),Gn=Kn&&(/Mobile\/\w+/.test(Rn)||!!Nn&&Nn.maxTouchPoints>2),Jn=Gn||!!Nn&&/Mac/.test(Nn.platform),Yn=!!Nn&&/Win/.test(Nn.platform),Qn=/Android \d/.test(Rn),Xn=!!_n&&"webkitFontSmoothing"in _n.documentElement.style,Zn=Xn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function er(e){var t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function tr(e,t){return"number"==typeof e?e:e[t]}function nr(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function rr(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=Dn(a))if(1==a.nodeType){var s=a,u=s==i.body,c=u?er(i):nr(s),l=0,f=0;if(t.top<c.top+tr(r,"top")?f=-(c.top-t.top+tr(o,"top")):t.bottom>c.bottom-tr(r,"bottom")&&(f=t.bottom-t.top>c.bottom-c.top?t.top+tr(o,"top")-c.top:t.bottom-c.bottom+tr(o,"bottom")),t.left<c.left+tr(r,"left")?l=-(c.left-t.left+tr(o,"left")):t.right>c.right-tr(r,"right")&&(l=t.right-c.right+tr(o,"right")),l||f)if(u)i.defaultView.scrollBy(l,f);else{var d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),l&&(s.scrollLeft+=l);var p=s.scrollLeft-d,m=s.scrollTop-h;t={left:t.left-p,top:t.top-m,right:t.right-p,bottom:t.bottom-m}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function or(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Dn(r));return t}function ir(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,a=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=a&&(o.scrollLeft=a)}}var ar=null;function sr(e,t){for(var n,r,o,i,a=2e8,s=0,u=t.top,c=t.top,l=e.firstChild,f=0;l;l=l.nextSibling,f++){var d=void 0;if(1==l.nodeType)d=l.getClientRects();else{if(3!=l.nodeType)continue;d=On(l).getClientRects()}for(var h=0;h<d.length;h++){var p=d[h];if(p.top<=u&&p.bottom>=c){u=Math.max(p.bottom,u),c=Math.min(p.top,c);var m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<a){n=l,a=m,r=m&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==l.nodeType&&m&&(s=f+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!o&&p.left<=t.left&&p.right>=t.left&&(o=l,i={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(s=f+1)}}return!n&&o&&(n=o,r=i,a=0),n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=dr(r,1);if(i.top!=i.bottom&&ur(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||a&&1==n.nodeType?{node:e,offset:s}:sr(n,r)}function ur(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function cr(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var a=e.childNodes[i];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var c=s[u];if(ur(t,c))return cr(a,t,c)}if((i=(i+1)%r)==o)break}return e}function lr(e,t){var n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{var r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Mn(r.offsetNode),r.offset)}}catch(vg){}if(e.caretRangeFromPoint){var o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min(Mn(o.startContainer),o.startOffset)}}}(r,t.left,t.top);i&&(n=i.node,o=i.offset);var a,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){var u=e.dom.getBoundingClientRect();if(!ur(t,u))return null;if(!(s=cr(e.dom,t,u)))return null}if(Kn)for(var c=s;n&&c;c=Dn(c))c.draggable&&(n=void 0);if(s=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if($n&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length))<n.childNodes.length){var l,f=n.childNodes[o];"IMG"==f.nodeName&&(l=f.getBoundingClientRect()).right<=t.left&&l.bottom>t.top&&o++}var d;Xn&&o&&1==n.nodeType&&1==(d=n.childNodes[o-1]).nodeType&&"false"==d.contentEditable&&d.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(a=function(e,t,n,r){for(var o=-1,i=t,a=!1;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)){var u=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&(!a&&u.left>r.left||u.top>r.top?o=s.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(o=s.posAfter),a=!0),!s.contentDOM&&o<0&&!s.node.isText)return(s.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?s.posBefore:s.posAfter}i=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==a&&(a=function(e,t,n){var r=sr(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,s,t));var h=e.docView.nearestDesc(s,!0);return{pos:a,inside:h?h.posAtStart-h.border:-1}}function fr(e){return e.top<e.bottom||e.left<e.right}function dr(e,t){var n=e.getClientRects();if(n.length){var r=n[t<0?0:n.length-1];if(fr(r))return r}return Array.prototype.find.call(n,fr)||e.getBoundingClientRect()}var hr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function pr(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=r.atom,s=Xn||$n;if(3==o.nodeType){if(!s||!hr.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var u=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==o.nodeValue.length?(u--,l=1):n<0?u--:c++,mr(dr(On(o,u,c),l),l<0)}var f=dr(On(o,i,i),n);if($n&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var d=dr(On(o,i-1,i-1),-1);if(d.top==f.top){var h=dr(On(o,i,i+1),-1);if(h.top!=f.top)return mr(h,h.left<d.left)}}return f}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(null==a&&i&&(n<0||i==Mn(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return vr(p.getBoundingClientRect(),!1)}if(null==a&&i<Mn(o)){var m=o.childNodes[i];if(1==m.nodeType)return vr(m.getBoundingClientRect(),!0)}return vr(o.getBoundingClientRect(),n>=0)}if(null==a&&i&&(n<0||i==Mn(o))){var v=o.childNodes[i-1],y=3==v.nodeType?On(v,Mn(v)-(s?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(y)return mr(dr(y,1),!1)}if(null==a&&i<Mn(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var b=g?3==g.nodeType?On(g,0,s?0:1):1==g.nodeType?g:null:null;if(b)return mr(dr(b,-1),!0)}return mr(dr(3==o.nodeType?On(o):o,-n),n>=0)}function mr(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function vr(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function yr(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var gr=/[\u0590-\u08ac]/;var br=null,wr=null,kr=!1;function xr(e,t,n){return br==t&&wr==n?kr:(br=t,wr=n,kr="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return yr(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.contentDOM||r.dom;break}t=r.dom.parentNode}for(var i=pr(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=On(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var c=s[u];if(c.bottom>c.top+1&&("up"==n?i.top-c.top>2*(c.bottom-i.top):c.bottom-i.bottom>2*(i.bottom-c.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return s?gr.test(r.parent.textContent)&&s.modify?yr(e,t,(function(){var t=e.domSelectionRange(),o=t.focusNode,i=t.focusOffset,a=t.anchorNode,u=t.anchorOffset,c=s.caretBidiLevel;s.modify("move",n,"character");var l=r.depth?e.docView.domAfterPos(r.before()):e.dom,f=e.domSelectionRange(),d=f.focusNode,h=f.focusOffset,p=d&&!l.contains(1==d.nodeType?d:d.parentNode)||o==d&&i==h;try{s.collapse(a,u),o&&(o!=a||i!=u)&&s.extend&&s.extend(o,i)}catch(vg){}return null!=c&&(s.caretBidiLevel=c),p})):"left"==n||"backward"==n?i:a:r.pos==r.start()||r.pos==r.end()}(e,t,n))}var Er=function(){return xn((function e(t,n,r,o){wn(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}),[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,a;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(e==this.dom&&this.contentDOM)s=t>Cn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!1;break}if(u.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var c=e;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};for(var n,r=0,o=0,i=0;r<this.children.length;r++){var a=this.children[r],s=i+a.size;if(s>e||a instanceof Tr){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Cr&&n.side>=0;r--);if(t<=0){for(var u,c=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,c=!1);return u&&t&&c&&!u.border&&!u.domAtom?u.domFromPos(u.size,t):{node:this.contentDOM,offset:u?Cn(u.dom)+1:0}}for(var l,f=!0;(l=r<this.children.length?this.children[r]:null)&&l.dom.parentNode!=this.contentDOM;r++,f=!1);return l&&f&&!l.border&&!l.domAtom?l.domFromPos(0,t):{node:this.contentDOM,offset:l?Cn(l.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],u=i+s.size;if(-1==r&&e<=u){var c=i+s.border;if(e>=c&&t<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,c);e=i;for(var l=a;l>0;l--){var f=this.children[l-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=Cn(f.dom)+1;break}e-=f.size}-1==r&&(r=0)}if(r>-1&&(u>t||a==this.children.length-1)){t=u;for(var d=a+1;d<this.children.length;d++){var h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Cn(h.dom);break}t+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}},{key:"emptyChildAt",value:function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var u=this.children[a],c=s+u.size;if(o>s&&i<c)return u.setSelection(e-s-u.border,t-s-u.border,n,r);s=c}var l=this.domFromPos(e,e?-1:1),f=t==e?l:this.domFromPos(t,t?-1:1),d=n.getSelection(),h=!1;if(($n||Kn)&&e==t){var p=l,m=p.node,v=p.offset;if(3==m.nodeType){if((h=!(!v||"\n"!=m.nodeValue[v-1]))&&v==m.nodeValue.length)for(var y,g=m;g;g=g.parentNode){if(y=g.nextSibling){"BR"==y.nodeName&&(l=f={node:y.parentNode,offset:Cn(y)+1});break}var b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{var w=m.childNodes[v-1];h=w&&("BR"==w.nodeName||"false"==w.contentEditable)}}if($n&&d.focusNode&&d.focusNode!=f.node&&1==d.focusNode.nodeType){var k=d.focusNode.childNodes[d.focusOffset];k&&"false"==k.contentEditable&&(r=!0)}if(r||h&&Kn||!An(l.node,l.offset,d.anchorNode,d.anchorOffset)||!An(f.node,f.offset,d.focusNode,d.focusOffset)){var x=!1;if((d.extend||e==t)&&!h){d.collapse(l.node,l.offset);try{e!=t&&d.extend(f.node,f.offset),x=!0}catch(vg){}}if(!x){if(e>t){var E=l;l=f,f=E}var C=document.createRange();C.setEnd(f.node,f.offset),C.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(C)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}},{key:"isText",value:function(e){return!1}}])}(),Cr=function(e){function t(e,n,r,o){var i;wn(this,t);var a,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return a?a.parent?a.parent.posBeforeChild(a):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var u=document.createElement("span");u.appendChild(s),s=u}s.contentEditable="false",s.classList.add("ProseMirror-widget")}return(i=dn(this,t,[e,[],s,null])).widget=n,i.widget=n,a=i,i}return yn(t,e),xn(t,[{key:"matchesWidget",value:function(e){return 0==this.dirty&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),pn(t,"destroy",this,3)([])}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}])}(Er),Dr=function(e){function t(e,n,r,o){var i;return wn(this,t),(i=dn(this,t,[e,[],n,null])).textDOM=r,i.text=o,i}return yn(t,e),xn(t,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}])}(Er),Sr=function(e){function t(e,n,r,o){var i;return wn(this,t),(i=dn(this,t,[e,[],r,o])).mark=n,i}return yn(t,e),xn(t,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function(e){return 3!=this.dirty&&this.mark.eq(e)}},{key:"markDirty",value:function(e,n){if(pn(t,"markDirty",this,3)([e,n]),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=$r(i,n,a,r)),e>0&&(i=$r(i,0,e,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}}],[{key:"create",value:function(e,n,r,o){var i=o.nodeViews[n.type.name],a=i&&i(n,o,r);return a&&a.dom||(a=xe.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,a.dom,a.contentDOM||a.dom)}}])}(Er),Or=function(e){function t(e,n,r,o,i,a,s,u,c){var l;return wn(this,t),(l=dn(this,t,[e,[],i,a])).node=n,l.outerDeco=r,l.innerDeco=o,l.nodeDOM=s,l}return yn(t,e),xn(t,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return b.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Ir(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,u=new Hr(this,a&&a.node,e);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,o,t.forChild(i,s),a),i+=s.nodeSize}return}for(var u=0,c=[],l=null,f=0;;){for(var d=void 0,h=void 0;u<o.length&&o[u].to==i;){var p=o[u++];p.widget&&(d?(h||(h=[d])).push(p):d=p)}if(d)if(h){h.sort(Vr);for(var m=0;m<h.length;m++)n(h[m],f,!!l)}else n(d,f,!!l);var v=void 0,y=void 0;if(l)y=-1,v=l,l=null;else{if(!(f<e.childCount))break;y=f,v=e.child(f++)}for(var g=0;g<c.length;g++)c[g].to<=i&&c.splice(g--,1);for(;u<o.length&&o[u].from<=i&&o[u].to>i;)c.push(o[u++]);var b=i+v.nodeSize;if(v.isText){var w=b;u<o.length&&o[u].from<w&&(w=o[u].from);for(var k=0;k<c.length;k++)c[k].to<w&&(w=c[k].to);w<b&&(l=v.cut(w-i),v=v.cut(0,w-i),b=w,y=-1)}else for(;u<o.length&&o[u].to<b;)u++;r(v,v.isInline&&!v.isLeaf?c.filter((function(e){return!e.inline})):c.slice(),t.forChild(i,v),y),i=b}}(this.node,this.innerDeco,(function(t,i,a){t.spec.marks?u.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&u.syncToMarks(i==n.node.childCount?E.none:n.node.child(i).marks,r,e),u.placeWidget(t,e,o)}),(function(t,n,a,c){var l;u.syncToMarks(t.marks,r,e),u.findNodeMatch(t,n,a,c)||s&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(l=u.findIndexWithChild(i.node))>-1&&u.updateNodeAt(t,n,a,l,e)||u.updateNextNode(t,n,a,e,c,o)||u.addNode(t,n,a,e,o),o+=t.nodeSize})),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Lr(this.contentDOM,this.children,e),Gn&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof Vt)||r<t||o>t+this.node.content.size)return null;var i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){var a=i.nodeValue,s=function(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var a=e.child(o++),s=i;if(i+=a.nodeSize,a.isText){for(var u=a.text;o<e.childCount;){var c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;u+=c.text}if(i>=n){if(i>=r&&u.slice(r-t.length-s,r-s)==t)return r-t.length;var l=s<r?u.lastIndexOf(t,r-s-1):-1;if(l>=0&&l+t.length+s>=n)return s+l;if(n==r&&u.length>=r+t.length-s&&u.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,a,r-t,o-t);return s<0?null:{node:i,pos:s,text:a}}return{node:i,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new Dr(this,i,n,o);e.input.compositionNodes.push(a),this.children=$r(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Ir(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=_r(this.dom,this.nodeDOM,Nr(this.outerDeco,this.node,t),Nr(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,n,r,o,i,a){var s,u=i.nodeViews[n.type.name],c=u&&u(n,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text);else if(!l){var d=xe.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);l=d.dom,f=d.contentDOM}f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));var h=l;return l=Br(l,r,n),c?s=new Mr(e,n,r,o,l,f||null,h,c,i,a+1):n.isText?new jr(e,n,r,o,l,h,i):new t(e,n,r,o,l,f||null,h,i,a+1)}}])}(Er);function Ar(e,t,n,r,o){Br(r,t,e);var i=new Or(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}var jr=function(e){function t(e,n,r,o,i,a,s){return wn(this,t),dn(this,t,[e,n,r,o,i,null,a,s,0])}return yn(t,e),xn(t,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):pn(t,"localPosFromDOM",this,3)([e,n,r])}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,n){pn(t,"markDirty",this,3)([e,n]),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}},{key:"isText",value:function(e){return this.node.text==e}}])}(Or),Tr=function(e){function t(){return wn(this,t),dn(this,t,arguments)}return yn(t,e),xn(t,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}])}(Er),Mr=function(e){function t(e,n,r,o,i,a,s,u,c,l){var f;return wn(this,t),(f=dn(this,t,[e,n,r,o,i,a,s,c,l])).spec=u,f}return yn(t,e),xn(t,[{key:"update",value:function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&pn(t,"update",this,3)([e,n,r,o])}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():pn(t,"selectNode",this,3)([])}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():pn(t,"deselectNode",this,3)([])}},{key:"setSelection",value:function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):pn(t,"setSelection",this,3)([e,n,r,o])}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),pn(t,"destroy",this,3)([])}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):pn(t,"ignoreMutation",this,3)([e])}}])}(Or);function Lr(e,t,n){for(var r=e.firstChild,o=!1,i=0;i<t.length;i++){var a=t[i],s=a.dom;if(s.parentNode==e){for(;s!=r;)r=zr(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof Sr){var u=r?r.previousSibling:e.lastChild;Lr(a.contentDOM,a.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=zr(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Pr=function(e){e&&(this.nodeName=e)};Pr.prototype=Object.create(null);var Fr=[new Pr];function Nr(e,t,n){if(0==e.length)return Fr;for(var r=n?Fr[0]:new Pr,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs;if(a)for(var s in a.nodeName&&o.push(r=new Pr(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new Pr(t.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return o}function _r(e,t,n,r){if(n==Fr&&r==Fr)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var u=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(u=o.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(o),s=Fr[0]),o=u}Rr(o,s||Fr[0],a)}return o}function Rr(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<i.length;s++)-1==a.indexOf(i[s])&&e.classList.remove(i[s]);for(var u=0;u<a.length;u++)-1==i.indexOf(a[u])&&e.classList.add(a[u]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var c,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=l.exec(t.style);)e.style.removeProperty(c[1]);n.style&&(e.style.cssText+=n.style)}}function Br(e,t,n){return _r(e,e,Fr,Nr(t,n,1!=e.nodeType))}function Ir(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function zr(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Hr=function(){return xn((function e(t,n,r){wn(this,e),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(e,t){var n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:for(;o>0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof Sr)){s=u,r--;break}n=u,r=u.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}),[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){var u=this.top.children[s];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=s;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=Sr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var u=this.top.children[a];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}},{key:"updateNodeAt",value:function(e,t,n,r,o){var i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,o,i){for(var a=this.index;a<this.top.children.length;a++){var s=this.top.children[a];if(s instanceof Or){var u=this.preMatch.matched.get(s);if(null!=u&&u!=o)return!1;var c=s.dom,l=void 0,f=this.isLocked(c)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&Ir(t,s.outerDeco));if(!f&&s.update(e,t,n,r))return this.destroyBetween(this.index,a),s.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(l=this.recreateWrapper(s,e,t,n,r,i)))return this.top.children[this.index]=l,l.contentDOM&&(l.dirty=2,l.updateChildren(r,i+1),l.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;var a=Or.create(this.top,t,n,r,o,i);if(a.contentDOM){a.children=e.children,e.children=[];var s,u=cn(a.children);try{for(u.s();!(s=u.n()).done;){s.value.parent=a}}catch(c){u.e(c)}finally{u.f()}}return e.destroy(),a}},{key:"addNode",value:function(e,t,n,r,o){var i=Or.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Cr(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof Sr;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof jr)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Kn||Un)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");var r=new Tr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}},{key:"isLocked",value:function(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}])}();function Vr(e,t){return e.type.side-t.type.side}function $r(e,t,n,r,o){for(var i=[],a=0,s=0;a<e.length;a++){var u=e[a],c=s,l=s+=u.size;c>=n||l<=t?i.push(u):(c<t&&i.push(u.slice(0,t-c,r)),o&&(i.push(o),o=void 0),l>n&&i.push(u.slice(n-c,u.size,r)))}return i}function qr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,u,c=r.resolve(a);if(Pn(n)){for(s=c;o&&!o.node;)o=o.parent;var l=o.node;if(o&&l.isAtom&&qt.isSelectable(l)&&o.parent&&(!l.isInline||!function(e,t,n){for(var r=0==t,o=t==Mn(e);r||o;){if(e==n)return!0;var i=Cn(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==Mn(e)}}(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new qt(a==f?c:r.resolve(f))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;s=r.resolve(d)}u||(u=Zr(e,s,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1));return u}function Ur(e){return e.editable?e.hasFocus():to(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Wr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(Qr(e,n),Ur(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Un){var r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&An(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.domSelection(),n=document.createRange();if(!t)return;var r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setStart(r.parentNode,Cn(r)+1):n.setStart(r,0);n.collapse(!0),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Hn&&Vn<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var i,a,s=n.anchor,u=n.head;!Kr||n instanceof Vt||(n.$from.parent.inlineContent||(i=Gr(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Gr(e,n.to))),e.docView.setSelection(s,u,e.root,t),Kr&&(i&&Yr(i),a&&Yr(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((function(){Ur(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Kr=Kn||Un&&Wn<63;function Gr(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(Kn&&i&&"false"==i.contentEditable)return Jr(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return Jr(i);if(a)return Jr(a)}}function Jr(e){return e.contentEditable="true",Kn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Yr(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Qr(e,t){if(t instanceof qt){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Xr(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Xr(e)}function Xr(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Zr(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||Vt.between(t,n,r)}function eo(e){return!(e.editable&&!e.hasFocus())&&to(e)}function to(e){var t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(vg){return!1}}function no(e,t){var n=e.selection,r=n.$anchor,o=n.$head,i=t>0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Bt.findFrom(a,t)}function ro(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function oo(e,t,n){var r=e.state.selection;if(!(r instanceof Vt)){if(r instanceof qt&&r.node.isInline)return ro(e,new Vt(t>0?r.$to:r.$from));var o=no(e.state,t);return!!o&&ro(e,o)}if(n.indexOf("s")>-1){var i=r.$head,a=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;var s=e.state.doc.resolve(i.pos+a.nodeSize*(t<0?-1:1));return ro(e,new Vt(r.$anchor,s))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){var u=no(e.state,t);return!!(u&&u instanceof qt)&&ro(e,u)}if(!(Jn&&n.indexOf("m")>-1)){var c,l=r.$head,f=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!f||f.isText)return!1;var d=t<0?l.pos-f.nodeSize:l.pos;return!!(f.isAtom||(c=e.docView.descAt(d))&&!c.contentDOM)&&(qt.isSelectable(f)?ro(e,new qt(t<0?e.state.doc.resolve(l.pos-f.nodeSize):l)):!!Xn&&ro(e,new Vt(e.state.doc.resolve(t<0?d:d+f.nodeSize))))}}function io(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ao(e,t){var n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function so(e,t){return t<0?function(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;var o,i,a=!1;$n&&1==n.nodeType&&r<io(n)&&ao(n.childNodes[r],-1)&&(a=!0);for(;;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(ao(s,-1))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(uo(n))break;for(var u=n.previousSibling;u&&ao(u,-1);)o=n.parentNode,i=Cn(u),u=u.previousSibling;if(u)r=io(n=u);else{if((n=n.parentNode)==e.dom)break;r=0}}a?co(e,n,r):o&&co(e,o,i)}(e):function(e){var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;for(var o,i,a=io(n);;)if(r<a){if(1!=n.nodeType)break;if(!ao(n.childNodes[r],1))break;o=n,i=++r}else{if(uo(n))break;for(var s=n.nextSibling;s&&ao(s,1);)o=s.parentNode,i=Cn(s)+1,s=s.nextSibling;if(s)r=0,a=io(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&co(e,o,i)}(e)}function uo(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function co(e,t,n){var r,o;3!=t.nodeType&&((o=function(e,t){for(;e&&t==e.childNodes.length&&!Ln(e);)t=Cn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){var n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=o,n=0):(r=function(e,t){for(;e&&!t&&!Ln(e);)t=Cn(e),e=e.parentNode;for(;e&&t;){var n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=r,n=r.nodeValue.length));var i=e.domSelection();if(i){if(Pn(i)){var a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();var s=e.state;setTimeout((function(){e.state==s&&Wr(e)}),50)}}function lo(e,t){var n=e.state.doc.resolve(t);if(!Un&&!Yn&&n.parent.inlineContent){var r=e.coordsAtPos(t);if(t>n.start()){var o=e.coordsAtPos(t-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(t<n.end()){var a=e.coordsAtPos(t+1),s=(a.top+a.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function fo(e,t,n){var r=e.state.selection;if(r instanceof Vt&&!r.empty||n.indexOf("s")>-1)return!1;if(Jn&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=no(e.state,t);if(a&&a instanceof qt)return ro(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,u=r instanceof Wt?Bt.near(s,t):Bt.findFrom(s,t);return!!u&&ro(e,u)}return!1}function ho(e,t){if(!(e.state.selection instanceof Vt))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function po(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function mo(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Jn&&72==n&&"c"==r)return ho(e,-1)||so(e,-1);if(46==n&&!t.shiftKey||Jn&&68==n&&"c"==r)return ho(e,1)||so(e,1);if(13==n||27==n)return!0;if(37==n||Jn&&66==n&&"c"==r){var o=37==n?"ltr"==lo(e,e.state.selection.from)?-1:1:-1;return oo(e,o,r)||so(e,o)}if(39==n||Jn&&70==n&&"c"==r){var i=39==n?"ltr"==lo(e,e.state.selection.from)?1:-1:1;return oo(e,i,r)||so(e,i)}return 38==n||Jn&&80==n&&"c"==r?fo(e,-1,r)||so(e,-1):40==n||Jn&&78==n&&"c"==r?function(e){if(!Kn||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;po(e,o,"true"),setTimeout((function(){return po(e,o,"false")}),20)}return!1}(e)||fo(e,1,r)||so(e,1):r==(Jn?"m":"c")&&(66==n||73==n||89==n||90==n)}function vo(e,t){e.someProp("transformCopied",(function(n){t=n(t,e)}));for(var n=[],r=t,o=r.content,i=r.openStart,a=r.openEnd;i>1&&a>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,a--;var s=o.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),o=s.content}var u=e.someProp("clipboardSerializer")||xe.fromSchema(e.state.schema),c=So(),l=c.createElement("div");l.appendChild(u.serializeFragment(o,{document:c}));for(var f,d=l.firstChild,h=0;d&&1==d.nodeType&&(f=Co[d.nodeName.toLowerCase()]);){for(var p=f.length-1;p>=0;p--){for(var m=c.createElement(f[p]);l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),h++}d=l.firstChild}d&&1==d.nodeType&&d.setAttribute("data-pm-slice","".concat(i," ").concat(a).concat(h?" -".concat(h):""," ").concat(JSON.stringify(n)));var v=e.someProp("clipboardTextSerializer",(function(n){return n(t,e)}))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:v,slice:t}}function yo(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var u=t&&(r||s||!n);if(u){if(e.someProp("transformPastedText",(function(n){t=n(t,s||r,e)})),s)return t?new D(b.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):D.empty;var c=e.someProp("clipboardTextParser",(function(n){return n(t,o,r,e)}));if(c)a=c;else{var l=o.marks(),f=e.state.schema,d=xe.fromSchema(f);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(f.text(e,l)))}))}}else e.someProp("transformPastedHTML",(function(t){n=t(n,e)})),i=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=So().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Co[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""));if(r.innerHTML=function(e){var t=window.trustedTypes;return t?t.createPolicy("detachedDocument",{createHTML:function(e){return e}}).createHTML(e):e}(e),n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),Xn&&function(e){for(var t=e.querySelectorAll(Un?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);var h=i&&i.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(var m=+p[3];m>0;m--){for(var v=i.firstChild;v&&1!=v.nodeType;)v=v.nextSibling;if(!v)break;i=v}if(!a){var y=e.someProp("clipboardParser")||e.someProp("domParser")||de.fromSchema(e.state.schema);a=y.parseSlice(i,{preserveWhitespace:!(!u&&!p),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||go.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(p)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(c){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;o=b.from(u.create(n[s+1],o)),i++,a++}return new D(o,i,a)}(Eo(a,+p[1],+p[2]),p[4]);else if(a=D.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n,r=function(){var n,r=t.node(o).contentMatchAt(t.index(o)),i=[];if(e.forEach((function(e){if(i){var t,o=r.findWrapping(e.type);if(!o)return i=null;if(t=i.length&&n.length&&wo(o,n,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=ko(i[i.length-1],n.length));var a=bo(e,o);i.push(a),r=r.matchType(a.type),n=o}}})),i)return{v:b.from(i)}},o=t.depth;o>=0;o--)if(n=r())return n.v;return e}(a.content,o),!0),a.openStart||a.openEnd){for(var g=0,w=0,k=a.content.firstChild;g<a.openStart&&!k.type.spec.isolating;g++,k=k.firstChild);for(var x=a.content.lastChild;w<a.openEnd&&!x.type.spec.isolating;w++,x=x.lastChild);a=Eo(a,g,w)}return e.someProp("transformPasted",(function(t){a=t(a,e)})),a}var go=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function bo(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,b.from(e));return e}function wo(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=wo(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(b.from(bo(n,e,o+1))))}}function ko(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,ko(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(b.empty,!0);return e.copy(n.append(r))}function xo(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(i=0),o<r-1&&(s=xo(s,t,n,r,o+1,i)),o>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(b.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Eo(e,t,n){return t<e.openStart&&(e=new D(xo(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new D(xo(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Co={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Do=null;function So(){return Do||(Do=document.implementation.createHTMLDocument("title"))}var Oo={},Ao={},jo={touchstart:!0,touchmove:!0},To=xn((function e(){wn(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Mo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Lo(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return Po(e,t)})}))}function Po(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fo(e){return{left:e.clientX,top:e.clientY}}function No(e,t,n,r,o){if(-1==r)return!1;for(var i,a=e.state.doc.resolve(r),s=function(r){if(e.someProp(t,(function(t){return r>a.depth?t(e,n,a.nodeAfter,a.before(r),o,!0):t(e,n,a.node(r),a.before(r),o,!1)})))return{v:!0}},u=a.depth+1;u>0;u--)if(i=s(u))return i.v;return!1}function _o(e,t,n){if(e.focused||e.focus(),!e.state.selection.eq(t)){var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}}function Ro(e,t,n,r,o){return No(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof qt&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(qt.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(_o(e,qt.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&qt.isSelectable(r))&&(_o(e,new qt(n),"pointer"),!0)}(e,n))}function Bo(e,t,n,r){return No(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Io(e,t,n,r){return No(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(_o(e,Vt.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)_o(e,Vt.create(r,s+1,s+1+a.content.size),"pointer");else{if(!qt.isSelectable(a))continue;_o(e,qt.create(r,s),"pointer")}return!0}}(e,n,r)}function zo(e){return Go(e)}Ao.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!$o(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Qn||!Un||13!=n.keyCode))if(e.domObserver.selectionChanged(e.domSelectionRange())?e.domObserver.flush():229!=n.keyCode&&e.domObserver.forceFlush(),!Gn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||mo(e,n)?n.preventDefault():Mo(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,Fn(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},Ao.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},Ao.keypress=function(e,t){var n=t;if(!($o(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Jn&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof Vt)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);/[\r\n]/.test(o)||e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var Ho=Jn?"metaKey":"ctrlKey";Oo.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=zo(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Ho]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(Fo(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Vo(e,a,n,!!r)):("doubleClick"==i?Bo:Io)(e,a.pos,a.inside,n)?n.preventDefault():Mo(e,"pointer"))};var Vo=function(){return xn((function e(t,n,r,o){var i,a,s=this;if(wn(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Ho],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var u=t.state.doc.resolve(n.pos);i=u.parent,a=u.depth?u.before():0}var c=o?null:r.target,l=c?t.docView.nearestDesc(c,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof qt&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!$n||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Mo(t,"pointer")}),[{key:"done",value:function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return Wr(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Fo(e))),this.updateAllowDefault(e),this.allowDefault||!t?Mo(this.view,"pointer"):Ro(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Kn&&this.mightDrag&&!this.mightDrag.node.isAtom||Un&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(_o(this.view,Bt.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Mo(this.view,"pointer")}}},{key:"move",value:function(e){this.updateAllowDefault(e),Mo(this.view,"pointer"),0==e.buttons&&this.done()}},{key:"updateAllowDefault",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}])}();function $o(e,t){return!!e.composing||!!(Kn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Oo.touchstart=function(e){e.input.lastTouch=Date.now(),zo(e),Mo(e,"pointer")},Oo.touchmove=function(e){e.input.lastTouch=Date.now(),Mo(e,"pointer")},Oo.contextmenu=function(e){return zo(e)};var qo=Qn?5e3:-1;function Uo(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return Go(e)}),t))}function Wo(e){var t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ko(e){var t=e.domSelectionRange();if(!t.focusNode)return null;var n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Mn(e=e.childNodes[t-1])}else{if(!e.parentNode||Ln(e))return null;t=Cn(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Ln(e))return null;t=Cn(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){var o=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(e.input.compositionNode==r){var a=n.pmViewDesc;if(a&&a.isText(n.nodeValue))return r}}return n||r}function Go(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Qn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Wo(e),t||e.docView&&e.docView.dirty){var n=qr(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||e.state.selection.empty?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Ao.compositionstart=Ao.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$to;if(t.selection instanceof Vt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Go(e,!0),e.markCursor=null;else if(Go(e,!t.selection.empty),$n&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelectionRange(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){var s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}Uo(e,qo)},Ao.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then((function(){return e.domObserver.flush()})),e.input.compositionID++,Uo(e,20))};var Jo=Hn&&Vn<15||Gn&&Zn<604;function Yo(e,t,n,r,o){var i=yo(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,o,i||D.empty)})))return!0;if(!i)return!1;var a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Qo(e){var t=e.getData("text/plain")||e.getData("Text");if(t)return t;var n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Oo.copy=Ao.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=Jo?null:n.clipboardData,a=vo(e,r.content()),s=a.dom,u=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",u)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ao.paste=function(e,t){var n=t;if(!e.composing||Qn){var r=Jo?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Yo(e,Qo(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Yo(e,r.value,null,o,t):Yo(e,r.textContent,r.innerHTML,o,t)}),50)}}(e,n)}};var Xo=xn((function e(t,n,r){wn(this,e),this.slice=t,this.move=n,this.node=r})),Zo=Jn?"altKey":"ctrlKey";for(var ei in Oo.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o,i=e.state.selection,a=i.empty?null:e.posAtCoords(Fo(n));if(a&&a.pos>=i.from&&a.pos<=(i instanceof qt?i.to-1:i.to));else if(r&&r.mightDrag)o=qt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){var s=e.docView.nearestDesc(n.target,!0);s&&s.node.type.spec.draggable&&s!=e.docView&&(o=qt.create(e.state.doc,s.posBefore))}var u=vo(e,(o||e.state.selection).content()),c=u.dom,l=u.text,f=u.slice;(!n.dataTransfer.files.length||!Un||Wn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Jo?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jo||n.dataTransfer.setData("text/plain",l),e.dragging=new Xo(f,!n[Zo],o)}},Oo.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},Ao.dragover=Ao.dragenter=function(e,t){return t.preventDefault()},Ao.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(Fo(n));if(o){var i=e.state.doc.resolve(o.pos),a=r&&r.slice;a?e.someProp("transformPasted",(function(t){a=t(a,e)})):a=yo(e,Qo(n.dataTransfer),Jo?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[Zo]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||D.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var u=a?lt(e.state.doc,i.pos,a):i.pos;null==u&&(u=i.pos);var c=e.state.tr;if(s){var l=r.node;l?l.replace(c):c.deleteSelection()}var f=c.mapping.map(u),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,h=c.doc;if(d?c.replaceRangeWith(f,f,a.content.firstChild):c.replaceRange(f,f,a),!c.doc.eq(h)){var p=c.doc.resolve(f);if(d&&qt.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new qt(p));else{var m=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((function(e,t,n,r){return m=r})),c.setSelection(Zr(e,p,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}},Oo.focus=function(e){e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Wr(e)}),20))},Oo.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Oo.beforeinput=function(e,t){if(Un&&Qn&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,Fn(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},Ao)Oo[ei]=Ao[ei];function ti(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var ni=function(){function e(t,n){wn(this,e),this.toDOM=t,this.spec=n||si,this.side=this.spec.side||0}return xn(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new ii(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ti(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}])}(),ri=function(){function e(t,n){wn(this,e),this.attrs=t,this.spec=n||si}return xn(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ii(o,i,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&ti(this.attrs,t.attrs)&&ti(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}])}(),oi=function(){function e(t,n){wn(this,e),this.attrs=t,this.spec=n||si}return xn(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ii(o.pos-n,i.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),o=r.index,i=r.offset;return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&ti(this.attrs,t.attrs)&&ti(this.spec,t.spec)}},{key:"destroy",value:function(){}}])}(),ii=function(){function e(t,n,r){wn(this,e),this.from=t,this.to=n,this.type=r}return xn(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof ri}},{key:"widget",get:function(){return this.type instanceof ni}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new ni(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new ri(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new oi(r,o))}}])}(),ai=[],si={},ui=function(){function e(t,n){wn(this,e),this.local=t.length?t:ai,this.children=n.length?n:ai}return xn(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var u=this.children[s]+1;this.children[s+2].findInner(e-u,t-u,n,r+u,o)}}},{key:"map",value:function(e,t,n){return this==ci||0==e.maps.length?this:this.mapInner(e,t,0,0,n||si)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;s<this.local.length;s++){var u=this.local[s].map(t,r,o);u&&u.type.valid(n,u)?(a||(a=[])).push(u):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?fi(this.children,a||[],t,n,r,o,i):a?new e(a.sort(vi),ai):ci}},{key:"add",value:function(t,n){return n.length?this==ci?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var o,i=this,a=0;t.forEach((function(e,t){var s,u=t+r;if(s=hi(n,e,u)){for(o||(o=i.children.slice());a<o.length&&o[a]<t;)a+=3;o[a]==t?o[a+2]=o[a+2].addInner(e,s,u+1):o.splice(a,0,t,t+e.nodeSize,mi(s,e,u+1,si)),a+=3}}));for(var s=di(a?pi(n):n,-r),u=0;u<s.length;u++)s[u].type.valid(t,s[u])||s.splice(u--,1);return new e(s.length?this.local.concat(s).sort(vi):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==ci?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var a,s=void 0,u=r[i]+n,c=r[i+1]+n,l=0;l<t.length;l++)(a=t[l])&&a.from>u&&a.to<c&&(t[l]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var f=r[i+2].removeInner(s,u+1);f!=ci?r[i+2]=f:(r.splice(i,3),i-=3)}}if(o.length)for(var d,h=0;h<t.length;h++)if(d=t[h])for(var p=0;p<o.length;p++)o[p].eq(d,n)&&(o==this.local&&(o=this.local.slice()),o.splice(p--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):ci}},{key:"forChild",value:function(t,n){if(this==ci)return this;if(n.isLeaf)return e.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,u=0;u<this.local.length;u++){var c=this.local[u];if(c.from<s&&c.to>a&&c.type instanceof ri){var l=Math.max(a,c.from)-a,f=Math.min(s,c.to)-a;l<f&&(o||(o=[])).push(c.copy(l,f))}}if(o){var d=new e(o.sort(vi),ai);return r?new li([d,r]):d}return r||ci}},{key:"eq",value:function(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return yi(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==ci)return ai;if(e.inlineContent||!this.local.some(ri.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof ri||t.push(this.local[n]);return t}},{key:"forEachSet",value:function(e){e(this)}}],[{key:"create",value:function(e,t){return t.length?mi(t,e,0,si):ci}}])}();ui.empty=new ui([],[]),ui.removeOverlap=yi;var ci=ui.empty,li=function(){function e(t){wn(this,e),this.members=t}return xn(e,[{key:"map",value:function(t,n){var r=this.members.map((function(e){return e.map(t,n,si)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return ui.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=ci&&(i instanceof e?r=r.concat(i.members):r.push(i))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?yi(n?t:t.sort(vi)):ai}},{key:"forEachSet",value:function(e){for(var t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}],[{key:"from",value:function(t){switch(t.length){case 0:return ci;case 1:return t[0];default:return new e(t.every((function(e){return e instanceof ui}))?t:t.reduce((function(e,t){return e.concat(t instanceof ui?t:t.members)}),[]))}}}])}();function fi(e,t,n,r,o,i,a){for(var s=e.slice(),u=function(e){var t=0;n.maps[c].forEach((function(n,r,o,i){for(var a=i-o-(r-n),u=0;u<s.length;u+=3){var c=s[u+1];if(!(c<0||n>c+e-t)){var l=s[u]+e-t;r>=l?s[u+1]=n<=l?-2:-1:n>=e&&a&&(s[u]+=a,s[u+1]+=a)}}t+=a})),e=n.maps[c].map(e,-1),l=e},c=0,l=i;c<n.maps.length;c++)u(l);for(var f=!1,d=0;d<s.length;d+=3)if(s[d+1]<0){if(-2==s[d+1]){f=!0,s[d+1]=-1;continue}var h=n.map(e[d]+i),p=h-o;if(p<0||p>=r.content.size){f=!0;continue}var m=n.map(e[d+1]+i,-1)-o,v=r.content.findIndex(p),y=v.index,g=v.offset,b=r.maybeChild(y);if(b&&g==p&&g+b.nodeSize==m){var w=s[d+2].mapInner(n,b,h+1,e[d]+i+1,a);w!=ci?(s[d]=p,s[d+1]=m,s[d+2]=w):(s[d+1]=-2,f=!0)}else f=!0}if(f){var k=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;i<e.local.length;i++){var u=e.local[i].map(r,o,t);u?n.push(u):a.onRemove&&a.onRemove(e.local[i].spec)}for(var c=0;c<e.children.length;c+=3)s(e.children[c+2],e.children[c]+t+1)}for(var u=0;u<e.length;u+=3)-1==e[u+1]&&s(e[u+2],t[u]+i+1);return n}(s,e,t,n,o,i,a),x=mi(k,r,0,a);t=x.local;for(var E=0;E<s.length;E+=3)s[E+1]<0&&(s.splice(E,3),E-=3);for(var C=0,D=0;C<x.children.length;C+=3){for(var S=x.children[C];D<s.length&&s[D]<S;)D+=3;s.splice(D,0,x.children[C],x.children[C+1],x.children[C+2])}}return new ui(t.sort(vi),s)}function di(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new ii(o.from+t,o.to+t,o.type))}return n}function hi(e,t,n){if(t.isLeaf)return null;for(var r,o=n+t.nodeSize,i=null,a=0;a<e.length;a++)(r=e[a])&&r.from>n&&r.to<o&&((i||(i=[])).push(r),e[a]=null);return i}function pi(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function mi(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=hi(e,t,a+n);if(s){i=!0;var u=mi(s,t,n+a+1,r);u!=ci&&o.push(a,a+t.nodeSize,u)}}));for(var a=di(i?pi(e):e,-n).sort(vi),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new ui(a,o):ci}function vi(e,t){return e.from-t.from||e.to-t.to}function yi(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),gi(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),gi(t,o+1,i.copy(r.to,i.to)))}}return t}function gi(e,t,n){for(;t<e.length&&vi(n,e[t])>0;)t++;e.splice(t,0,n)}function bi(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=ci&&t.push(r)})),e.cursorWrapper&&t.push(ui.create(e.state.doc,[e.cursorWrapper.deco])),li.from(t)}var wi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ki=Hn&&Vn<=11,xi=function(){return xn((function e(){wn(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}),[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}])}(),Ei=function(){return xn((function e(t,n){var r=this;wn(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xi,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)r.queue.push(e[t]);Hn&&Vn<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?r.flushSoon():r.flush()})),ki&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}),[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,wi)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(eo(this.view)){if(this.suppressingSelectionUpdates)return Wr(this.view);if(Hn&&Vn<=11&&!this.view.state.selection.empty){var e=this.view.domSelectionRange();if(e.focusNode&&An(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function(e){if(!e.focusNode)return!0;for(var t,n=new Set,r=e.focusNode;r;r=Dn(r))n.add(r);for(var o=e.anchorNode;o;o=Dn(o))if(n.has(o)){t=o;break}var i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function(){if(this.observer){var e,t=cn(this.observer.takeRecords());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.queue.push(n)}}catch(r){t.e(r)}finally{t.f()}}return this.queue}},{key:"selectionChanged",value:function(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&eo(this.view)&&!this.ignoreSelectionChange(e)}},{key:"flush",value:function(){var e=this.view;if(e.docView&&!(this.flushingSoon>-1)){var t=this.pendingRecords();t.length&&(this.queue=[]);var n=e.domSelectionRange(),r=this.selectionChanged(n),o=-1,i=-1,a=!1,s=[];if(e.editable)for(var u=0;u<t.length;u++){var c=this.registerMutation(t[u],s);c&&(o=o<0?c.from:Math.min(c.from,o),i=i<0?c.to:Math.max(c.to,i),c.typeOver&&(a=!0))}if($n&&s.length){var l=s.filter((function(e){return"BR"==e.nodeName}));if(2==l.length){var f=un(l,2),d=f[0],h=f[1];d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{var p,m=this.currentSelection.focusNode,v=cn(l);try{for(v.s();!(p=v.n()).done;){var y=p.value,g=y.parentNode;!g||"LI"!=g.nodeName||m&&Oi(e,m)==g||y.remove()}}catch(w){v.e(w)}finally{v.f()}}}var b=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Pn(n)&&(b=qr(e))&&b.eq(Bt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Wr(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(Ci.has(e))return;if(Ci.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=$n,Di)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Di=!0}}(e)),this.handleDOMChange(o,i,a,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Wr(e),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++){var o=e.addedNodes[r];t.push(o),3==o.nodeType&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var i=e.previousSibling,a=e.nextSibling;if(Hn&&Vn<=11&&e.addedNodes.length)for(var s=0;s<e.addedNodes.length;s++){var u=e.addedNodes[s],c=u.previousSibling,l=u.nextSibling;(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c),(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(a=l)}var f=i&&i.parentNode==e.target?Cn(i)+1:0,d=n.localPosFromDOM(e.target,f,-1),h=a&&a.parentNode==e.target?Cn(a):e.target.childNodes.length;return{from:d,to:n.localPosFromDOM(e.target,h,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}])}(),Ci=new WeakMap,Di=!1;function Si(e,t){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.domAtPos(e.state.selection.anchor);if(An(a.node,a.offset,o,i)){var s=[o,i,n,r];n=s[0],r=s[1],o=s[2],i=s[3]}return{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function Oi(e,t){for(var n=t.parentNode;n&&n!=e.dom;n=n.parentNode){var r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Ai(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Kn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||Kn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var ji=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ti(e,t,n,r,o){var i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){var a=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,s=qr(e,a);if(s&&!e.state.selection.eq(s)){if(Un&&Qn&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(function(t){return t(e,Fn(13,"Enter"))})))return;var u=e.state.tr.setSelection(s);"pointer"==a?u.setMeta("pointer",!0):"key"==a&&u.scrollIntoView(),i&&u.setMeta("composition",i),e.dispatch(u)}}else{var c=e.state.doc.resolve(t),l=c.sharedDepth(n);t=c.before(l+1),n=e.state.doc.resolve(n).after(l+1);var f,d,h=e.state.selection,p=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,u=o.from,c=o.to,l=e.domSelectionRange(),f=l.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(r=[{node:f,offset:l.anchorOffset}],Pn(l)||r.push({node:l.focusNode,offset:l.focusOffset})),Un&&8===e.input.lastKeyCode)for(var d=s;d>a;d--){var h=i.childNodes[d-1],p=h.pmViewDesc;if("BR"==h.nodeName&&!p){s=d;break}if(!p||p.size)break}var m=e.state.doc,v=e.someProp("domParser")||de.fromSchema(e.state.schema),y=m.resolve(u),g=null,b=v.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Ai,context:y});if(r&&null!=r[0].pos){var w=r[0].pos,k=r[1]&&r[1].pos;null==k&&(k=w),g={anchor:w+u,head:k+u}}return{doc:b,sel:g,from:u,to:c}}(e,t,n),m=e.state.doc,v=m.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;var y=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,u=a.b;if("end"==o){r-=s+Math.max(0,i-Math.min(s,u))-i}if(s<i&&e.size<t.size){var c=r<=i&&r>=s?i-r:0;(i-=c)&&i<t.size&&Pi(t.textBetween(i-1,i+1))&&(i+=c?1:-1),u=i+(u-s),s=i}else if(u<i){var l=r<=i&&r>=u?i-r:0;(i-=l)&&i<e.size&&Pi(e.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-u),u=i}return{start:i,endA:s,endB:u}}(v.content,p.doc.content,p.from,f,d);if(y&&e.input.domChangeCount++,(Gn&&e.input.lastIOSEnter>Date.now()-225||Qn)&&o.some((function(e){return 1==e.nodeType&&!ji.test(e.nodeName)}))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,Fn(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!y){if(!(r&&h instanceof Vt&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){var g=Mi(e,e.state.doc,p.sel);if(g&&!g.eq(e.state.selection)){var w=e.state.tr.setSelection(g);i&&w.setMeta("composition",i),e.dispatch(w)}}return}y={start:h.from,endA:h.to,endB:h.to}}e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof Vt&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),Hn&&Vn<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>p.from&&" \xa0"==p.doc.textBetween(y.start-p.from-1,y.start-p.from+1)&&(y.start--,y.endA--,y.endB--);var k,x=p.doc.resolveNoCache(y.start-p.from),E=p.doc.resolveNoCache(y.endB-p.from),C=m.resolve(y.start),D=x.sameParent(E)&&x.parent.inlineContent&&C.end()>=y.endA;if((Gn&&e.input.lastIOSEnter>Date.now()-225&&(!D||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!D&&x.pos<p.doc.content.size&&!x.sameParent(E)&&(k=Bt.findFrom(p.doc.resolve(x.pos+1),1,!0))&&k.head==E.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,Fn(13,"Enter"))})))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Li(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(!r.parent.isTextblock){var a=i.nodeAfter;return null!=a&&n==t+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=e.resolve(Li(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Li(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(m,y.start,y.endA,x,E)&&e.someProp("handleKeyDown",(function(t){return t(e,Fn(8,"Backspace"))})))Qn&&Un&&e.domObserver.suppressSelectionUpdates();else{Un&&Qn&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),Qn&&!D&&x.start()!=E.start()&&0==E.parentOffset&&x.depth==E.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==y.endA&&(y.endB-=2,E=p.doc.resolveNoCache(y.endB-p.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,Fn(13,"Enter"))}))}),20));var S,O,A,j=y.start,T=y.endA;if(D)if(x.pos==E.pos)Hn&&Vn<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return Wr(e)}),20)),S=e.state.tr.delete(j,T),O=m.resolve(y.start).marksAcross(m.resolve(y.endA));else if(y.endA==y.endB&&(A=function(e,t){for(var n,r,o,i=e.firstChild.marks,a=t.firstChild.marks,s=i,u=a,c=0;c<a.length;c++)s=a[c].removeFromSet(s);for(var l=0;l<i.length;l++)u=i[l].removeFromSet(u);if(1==s.length&&0==u.length)r=s[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=s.length||1!=u.length)return null;r=u[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var f=[],d=0;d<t.childCount;d++)f.push(o(t.child(d)));if(b.from(f).eq(e))return{mark:r,type:n}}(x.parent.content.cut(x.parentOffset,E.parentOffset),C.parent.content.cut(C.parentOffset,y.endA-C.start()))))S=e.state.tr,"add"==A.type?S.addMark(j,T,A.mark):S.removeMark(j,T,A.mark);else if(x.parent.child(x.index()).isText&&x.index()==E.index()-(E.textOffset?0:1)){var M=x.parent.textBetween(x.parentOffset,E.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,j,T,M)})))return;S=e.state.tr.insertText(M,j,T)}if(S||(S=e.state.tr.replace(j,T,p.doc.slice(y.start-p.from,y.endB-p.from))),p.sel){var L=Mi(e,S.doc,p.sel);L&&!(Un&&Qn&&e.composing&&L.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(L.head==j||L.head==S.mapping.map(T)-1)||Hn&&L.empty&&L.head==j)&&S.setSelection(L)}O&&S.ensureMarks(O),i&&S.setMeta("composition",i),e.dispatch(S.scrollIntoView())}}}}function Mi(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Zr(e,t.resolve(n.anchor),t.resolve(n.head))}function Li(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Pi(e){if(2!=e.length)return!1;var t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Fi=function(){return xn((function e(t,n){var r=this;wn(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new To,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Ii),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ri(this),_i(this),this.nodeViews=Bi(this),this.docView=Ar(this.state.doc,Ni(this),bi(this),this.dom,this),this.domObserver=new Ei(this,(function(e,t,n,o){return Ti(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(){var t=Oo[n];e.dom.addEventListener(n,e.input.eventHandlers[n]=function(n){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,n)||Po(e,n)||!e.editable&&n.type in Ao||t(e,n)},jo[n]?{passive:!0}:void 0)};for(var n in Oo)t();Kn&&e.dom.addEventListener("input",(function(){return null})),Lo(e)}(this),this.updatePluginViews()}),[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Lo(this);var t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ii),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this._props)}},{key:"updateStateInner",value:function(e,t){var n,r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(Wo(this),i=!0),this.state=e;var a=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){var s=Bi(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Lo(this),this.editable=Ri(this),_i(this);var u=bi(this),c=Ni(this),l=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=o||!this.docView.matchesNode(e.doc,c,u);!f&&e.selection.eq(r.selection)||(i=!0);var d,h,p,m,v,y,g,b,w,k,x,E="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=e.root.elementFromPoint(i,a);if(s&&s!=e.dom&&e.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=o-20){t=s,n=u.top;break}}}return{refDOM:t,refTop:n,stack:or(e.dom)}}(this);if(i){this.domObserver.stop();var C=f&&(Hn||Un)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&(m=r.selection,v=e.selection,y=Math.min(m.$anchor.sharedDepth(m.head),v.$anchor.sharedDepth(v.head)),m.$anchor.start(y)!=v.$anchor.start(y));if(f){var D=Un?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ko(this)),!o&&this.docView.update(e.doc,c,u,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Ar(e.doc,c,u,this.dom,this)),D&&!this.trackWrites&&(C=!0)}C||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(d=this,h=d.docView.domFromPos(d.state.selection.anchor,0),p=d.domSelectionRange(),An(h.node,h.offset,p.anchorNode,p.anchorOffset)))?Wr(this,C):(Qr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():E&&(b=(g=E).refDOM,w=g.refTop,k=g.stack,x=b?b.getBoundingClientRect().top:0,ir(k,0==x?0:x-w))}},{key:"scrollToSelection",value:function(){var e=this,t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(function(t){return t(e)})));else if(this.state.selection instanceof qt){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&rr(this,n.getBoundingClientRect(),t)}else rr(this,this.coordsAtPos(this.state.selection.head,1),t)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"updateDraggedNode",value:function(e,t){var n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{var o=n.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(r=o)}this.dragging=new Xo(e.slice,e.move,r<0?void 0:qt.create(this.state.doc,r))}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[e];if(null!=i&&(n=t?t(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var u=a[s].props[e];if(null!=u&&(n=t?t(u):u))return n}}},{key:"hasFocus",value:function(){if(Hn){var e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ar)return e.focus(ar);var t=or(e);e.focus(null==ar?{get preventScroll(){return ar={preventScroll:!0},!0}}:void 0),ar||(ar=!1,ir(t,0))}(this.dom),Wr(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n,r=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},o=this.dom.parentNode;o;o=o.parentNode)if(n=r(o))return n.v;return t||document}},{key:"updateRoot",value:function(){this._root=null}},{key:"posAtCoords",value:function(e){return lr(this,e)}},{key:"coordsAtPos",value:function(e){return pr(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return xr(this,t||this.state,e)}},{key:"pasteHTML",value:function(e,t){return Yo(this,"",e,!1,t||new ClipboardEvent("paste"))}},{key:"pasteText",value:function(e,t){return Yo(this,e,null,!0,t||new ClipboardEvent("paste"))}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Sn=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){Po(e,t)||!Oo[t.type]||!e.editable&&t.type in Ao||Oo[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelectionRange",value:function(){var e=this.domSelection();return e?Kn&&11===this.root.nodeType&&function(e){for(var t=e.activeElement;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){var n=t.getComposedRanges(e.root)[0];if(n)return Si(e,n)}var r;function o(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),r?Si(e,r):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}},{key:"domSelection",value:function(){return this.root.getSelection()}}])}();function Ni(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),t.translate||(t.translate="no"),[ii.node(0,e.state.doc.content.size,t)]}function _i(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ii.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ri(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Bi(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Ii(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var zi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Hi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Vi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),$i="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),qi=0;qi<10;qi++)zi[48+qi]=zi[96+qi]=String(qi);for(qi=1;qi<=24;qi++)zi[qi+111]="F"+qi;for(qi=65;qi<=90;qi++)zi[qi]=String.fromCharCode(qi+32),Hi[qi]=String.fromCharCode(qi);for(var Ui in zi)Hi.hasOwnProperty(Ui)||(Hi[Ui]=zi[Ui]);var Wi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Ki(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);Wi?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function Gi(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Ji(e){var t=function(e){var t=Object.create(null);for(var n in e)t[Ki(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(Vi&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||$i&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Hi:zi)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[Gi(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){var a=t[Gi(o,n,!1)];if(a&&a(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=zi[n.keyCode])&&r!=o){var s=t[Gi(r,n)];if(s&&s(e.state,e.dispatch,e))return!0}}return!1}}var Yi=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)};function Qi(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Xi=function(e,t,n){var r=Qi(e,n);if(!r)return!1;var o=ta(r);if(!o){var i=r.blockRange(),a=i&&rt(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(ha(e,o,t,-1))return!0;if(0==r.parent.content.size&&(Zi(s,"end")||qt.isSelectable(s)))for(var u=r.depth;;u--){var c=ft(e.doc,r.before(u),r.after(u),D.empty);if(c&&c.slice.size<c.to-c.from){if(t){var l=e.tr.step(c);l.setSelection(Zi(s,"end")?Bt.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):qt.create(l.doc,o.pos-s.nodeSize)),t(l.scrollIntoView())}return!0}if(1==u||r.node(u-1).childCount>1)break}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function Zi(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var ea=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=ta(o)}var a=i&&i.nodeBefore;return!(!a||!qt.isSelectable(a))&&(t&&t(e.tr.setSelection(qt.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function ta(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function na(e,t){var n=e.selection.$cursor;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var ra=function(e,t,n){var r=na(e,n);if(!r)return!1;var o=ia(r);if(!o)return!1;var i=o.nodeAfter;if(ha(e,o,t,1))return!0;if(0==r.parent.content.size&&(Zi(i,"start")||qt.isSelectable(i))){var a=ft(e.doc,r.before(),r.after(),D.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(Zi(i,"start")?Bt.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):qt.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},oa=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;i=ia(o)}var a=i&&i.nodeAfter;return!(!a||!qt.isSelectable(a))&&(t&&t(e.tr.setSelection(qt.create(e.doc,i.pos)).scrollIntoView()),!0)};function ia(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var aa=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function sa(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ua=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),a=r.indexAfter(-1),s=sa(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(t){var u=r.after(),c=e.tr.replaceWith(u,u,s.createAndFill());c.setSelection(Bt.near(c.doc.resolve(u),1)),t(c.scrollIntoView())}return!0},ca=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof Wt||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=sa(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(a,i.createAndFill());s.setSelection(Vt.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},la=function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(at(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&rt(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)};var fa,da=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof qt&&e.selection.node.isBlock)return!(!r.parentOffset||!at(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof Vt||e.selection instanceof Wt)&&a.deleteSelection();var s=0==r.depth?null:sa(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=fa&&fa(o.parent,i,r),c=u?[u]:i&&s?[{type:s}]:void 0,l=at(a.doc,a.mapping.map(r.pos),1,c);if(c||l||!at(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(c=[{type:s}]),l=!0),l&&(a.split(a.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=s)){var f=a.mapping.map(r.before()),d=a.doc.resolve(f);s&&r.node(-1).canReplaceWith(d.index(),d.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0};function ha(e,t,n,r){var o,i,a=t.nodeBefore,s=t.nodeAfter,u=a.type.spec.isolating||s.type.spec.isolating;if(!u&&function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!st(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var c=!u&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&i.matchType(o[0]||s.type).validEnd){if(n){for(var l=t.pos+s.nodeSize,f=b.empty,d=o.length-1;d>=0;d--)f=b.from(o[d].create(null,f));f=b.from(a.copy(f));var h=e.tr.step(new Ze(t.pos-1,l,t.pos,l,new D(f,1,0),o.length,!0)),p=l+2*o.length;st(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}var m=s.type.spec.isolating||r>0&&u?null:Bt.findFrom(t,1),v=m&&m.$from.blockRange(m.$to),y=v&&rt(v);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(v,y).scrollIntoView()),!0;if(c&&Zi(s,"start",!0)&&Zi(a,"end")){for(var g=a,w=[];w.push(g),!g.isTextblock;)g=g.lastChild;for(var k=s,x=1;!k.isTextblock;k=k.firstChild)x++;if(g.canReplace(g.childCount,g.childCount,k.content)){if(n){for(var E=b.empty,C=w.length-1;C>=0;C--)E=b.from(w[C].copy(E));n(e.tr.step(new Ze(t.pos-w.length,t.pos+s.nodeSize,t.pos+x,t.pos+s.nodeSize-x,new D(E,w.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pa(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Vt.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var ma=pa(-1),va=pa(1);function ya(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){for(var o=!1,i=0;i<n.selection.ranges.length&&!o;i++){var a=n.selection.ranges[i],s=a.$from.pos,u=a.$to.pos;n.doc.nodesBetween(s,u,(function(r,i){if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{var a=n.doc.resolve(i),s=a.index();o=a.parent.canReplaceWith(s,s+1,e)}}))}if(!o)return!1;if(r){for(var c=n.tr,l=0;l<n.selection.ranges.length;l++){var f=n.selection.ranges[l],d=f.$from.pos,h=f.$to.pos;c.setBlockType(d,h,e,t)}r(c.scrollIntoView())}return!0}}function ga(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var ba=ga(Yi,Xi,ea),wa=ga(Yi,ra,oa),ka={Enter:ga(aa,ca,la,da),"Mod-Enter":ua,Backspace:ba,"Mod-Backspace":ba,"Shift-Backspace":ba,Delete:wa,"Mod-Delete":wa,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new Wt(e.doc))),!0}},xa={"Ctrl-h":ka.Backspace,"Alt-Backspace":ka["Mod-Backspace"],"Ctrl-d":ka.Delete,"Ctrl-Alt-Backspace":ka["Mod-Delete"],"Alt-Delete":ka["Mod-Delete"],"Alt-d":ka["Mod-Delete"],"Ctrl-a":ma,"Ctrl-e":va};for(var Ea in ka)xa[Ea]=ka[Ea];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function Ca(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=!1,c=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;var l=n.doc.resolve(s.start-2);c=new H(l,l,s.depth),s.endIndex<s.parent.childCount&&(s=new H(i,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var f=ot(c,e,t,s);return!!f&&(r&&r(function(e,t,n,r,o){for(var i=b.empty,a=n.length-1;a>=0;a--)i=b.from(n[a].type.create(n[a].attrs,i));e.step(new Ze(t.start-(r?2:0),t.end,t.start,t.end,new D(i,0,0),n.length,!0));for(var s=0,u=0;u<n.length;u++)n[u].type==o&&(s=u+1);for(var c=n.length-s,l=t.start+n.length-(r?2:0),f=t.parent,d=t.startIndex,h=t.endIndex,p=!0;d<h;d++,p=!1)!p&&at(e.doc,l,c)&&(e.split(l,c),l+=2*c),l+=f.child(d).nodeSize;return e}(n.tr,s,f,u,e).scrollIntoView()),!0)}}function Da(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(t){return t.childCount>0&&t.firstChild.type==e}));return!!a&&(!n||(o.node(a.depth-1).type==e?function(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new Ze(i-1,a,i,a,new D(b.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new H(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));var s=rt(r);if(null==s)return!1;o.lift(r,s);var u=o.mapping.map(i,-1)-1;st(o.doc,u)&&o.join(u);return t(o.scrollIntoView()),!0}(t,n,e,a):function(e,t,n){for(var r=e.tr,o=n.parent,i=n.end,a=n.endIndex-1,s=n.startIndex;a>s;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var u=r.doc.resolve(n.start),c=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var l=0==n.startIndex,f=n.endIndex==o.childCount,d=u.node(-1),h=u.index(-1);if(!d.canReplace(h+(l?0:1),h+1,c.content.append(f?b.empty:b.from(o))))return!1;var p=u.pos,m=p+c.nodeSize;return r.step(new Ze(p-(l?1:0),m+(f?1:0),p+1,m-1,new D((l?b.empty:b.from(o.copy(b.empty))).append(f?b.empty:b.from(o.copy(b.empty))),l?0:1,f?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function Sa(e,t,n){return t=Aa(t),function(e,t){if(t&&("object"==Ta(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Oa()?Reflect.construct(t,n||[],Aa(e).constructor):t.apply(e,n))}function Oa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oa=function(){return!!e})()}function Aa(e){return Aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Aa(e)}function ja(e,t){return ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ja(e,t)}function Ta(e){return Ta="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},Ta(e)}function Ma(e){return function(e){if(Array.isArray(e))return Fa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Pa(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function La(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Pa(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pa(e,t){if(e){if("string"==typeof e)return Fa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fa(e,t):void 0}}function Fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Na(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ha(r.key),r)}}function Ra(e,t,n){return t&&_a(e.prototype,t),n&&_a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(n),!0).forEach((function(t){za(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function za(e,t,n){return(t=Ha(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ha(e){var t=function(e,t){if("object"!=Ta(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ta(t)?t:t+""}function Va(e){var t=e.state,n=e.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return Ia(Ia({},t),{},{apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}})}var $a=function(){return Ra((function e(t){Na(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}),[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((function(t){var n=La(t,2),r=n[0],s=n[1];return[r,function(){var t=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t}]})))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s=[],u=!!e,c=e||i.tr,l=Ia(Ia({},Object.fromEntries(Object.entries(r).map((function(e){var r=La(e,2),o=r[0],i=r[1];return[o,function(){var e=t.buildProps(c,n),r=i.apply(void 0,arguments)(e);return s.push(r),l}]})))),{},{run:function(){return u||!n||c.getMeta("preventDispatch")||t.hasCustomState||a.dispatch(c),s.every((function(e){return!0===e}))}});return l}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,o=!1,i=e||r.tr,a=this.buildProps(i,o),s=Object.fromEntries(Object.entries(n).map((function(e){var t=La(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(Ia(Ia({},a),{},{dispatch:void 0}))}]})));return Ia(Ia({},s),{},{chain:function(){return t.createChain(i,o)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s={tr:e,editor:o,view:a,state:Va({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e,n)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map((function(e){var t=La(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}])}(),qa=function(){return Ra((function e(){Na(this,e),this.callbacks={}}),[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this.callbacks[e];return i&&i.forEach((function(e){return e.apply(t,r)})),this}},{key:"off",value:function(e,t){var n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((function(e){return e!==t})):delete this.callbacks[e]),this}},{key:"removeAllListeners",value:function(){this.callbacks={}}}])}();function Ua(e,t,n){return void 0===e.config[t]&&e.parent?Ua(e.parent,t,n):"function"===typeof e.config[t]?e.config[t].bind(Ia(Ia({},n),{},{parent:e.parent?Ua(e.parent,t,n):null})):e.config[t]}function Wa(e){return{baseExtensions:e.filter((function(e){return"extension"===e.type})),nodeExtensions:e.filter((function(e){return"node"===e.type})),markExtensions:e.filter((function(e){return"mark"===e.type}))}}function Ka(e){var t=[],n=Wa(e),r=n.nodeExtensions,o=n.markExtensions,i=[].concat(Ma(r),Ma(o)),a={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((function(e){var n=Ua(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});n&&n().forEach((function(e){e.types.forEach((function(n){Object.entries(e.attributes).forEach((function(e){var r=La(e,2),o=r[0],i=r[1];t.push({type:n,name:o,attribute:Ia(Ia({},a),i)})}))}))}))})),i.forEach((function(e){var n={name:e.name,options:e.options,storage:e.storage},r=Ua(e,"addAttributes",n);if(r){var o=r();Object.entries(o).forEach((function(n){var r=La(n,2),o=r[0],i=r[1],s=Ia(Ia({},a),i);"function"===typeof(null===s||void 0===s?void 0:s.default)&&(s.default=s.default()),(null===s||void 0===s?void 0:s.isRequired)&&void 0===(null===s||void 0===s?void 0:s.default)&&delete s.default,t.push({type:e.name,name:o,attribute:s})}))}})),t}function Ga(e,t){if("string"===typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}function Ja(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return!!e})).reduce((function(e,t){var n=Ia({},e);return Object.entries(t).forEach((function(e){var t=La(e,2),r=t[0],o=t[1];if(n[r])if("class"===r){var i=o?o.split(" "):[],a=n[r]?n[r].split(" "):[],s=i.filter((function(e){return!a.includes(e)}));n[r]=[].concat(Ma(a),Ma(s)).join(" ")}else n[r]="style"===r?[n[r],o].join("; "):o;else n[r]=o})),n}),{})}function Ya(e,t){return t.filter((function(e){return e.attribute.rendered})).map((function(t){return t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:za({},t.name,e.attrs[t.name])})).reduce((function(e,t){return Ja(e,t)}),{})}function Qa(e){return"function"===typeof e}function Xa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Qa(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t?e.bind(t).apply(void 0,r):e.apply(void 0,r)}return e}function Za(e,t){return e.style?e:Ia(Ia({},e),{},{getAttrs:function(n){var r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;var o=t.reduce((function(e,t){var r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!==typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null===r||void 0===r?e:Ia(Ia({},e),{},za({},t.name,r))}),{});return Ia(Ia({},r),o)}})}function es(e){return Object.fromEntries(Object.entries(e).filter((function(e){var t=La(e,2),n=t[0],r=t[1];return("attrs"!==n||!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(r))&&(null!==r&&void 0!==r)})))}function ts(e,t){var n,r=Ka(e),o=Wa(e),i=o.nodeExtensions,a=o.markExtensions,s=null===(n=i.find((function(e){return Ua(e,"topNode")})))||void 0===n?void 0:n.name,u=Object.fromEntries(i.map((function(n){var o=r.filter((function(e){return e.type===n.name})),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=e.reduce((function(e,t){var r=Ua(t,"extendNodeSchema",i);return Ia(Ia({},e),r?r(n):{})}),{}),s=es(Ia(Ia({},a),{},{content:Xa(Ua(n,"content",i)),marks:Xa(Ua(n,"marks",i)),group:Xa(Ua(n,"group",i)),inline:Xa(Ua(n,"inline",i)),atom:Xa(Ua(n,"atom",i)),selectable:Xa(Ua(n,"selectable",i)),draggable:Xa(Ua(n,"draggable",i)),code:Xa(Ua(n,"code",i)),defining:Xa(Ua(n,"defining",i)),isolating:Xa(Ua(n,"isolating",i)),attrs:Object.fromEntries(o.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=Xa(Ua(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(e){return Za(e,o)})));var c=Ua(n,"renderHTML",i);c&&(s.toDOM=function(e){return c({node:e,HTMLAttributes:Ya(e,o)})});var l=Ua(n,"renderText",i);return l&&(s.toText=l),[n.name,s]}))),c=Object.fromEntries(a.map((function(n){var o=r.filter((function(e){return e.type===n.name})),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=e.reduce((function(e,t){var r=Ua(t,"extendMarkSchema",i);return Ia(Ia({},e),r?r(n):{})}),{}),s=es(Ia(Ia({},a),{},{inclusive:Xa(Ua(n,"inclusive",i)),excludes:Xa(Ua(n,"excludes",i)),group:Xa(Ua(n,"group",i)),spanning:Xa(Ua(n,"spanning",i)),code:Xa(Ua(n,"code",i)),attrs:Object.fromEntries(o.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=Xa(Ua(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(e){return Za(e,o)})));var c=Ua(n,"renderHTML",i);return c&&(s.toDOM=function(e){return c({mark:e,HTMLAttributes:Ya(e,o)})}),[n.name,s]})));return new le({topNode:s,nodes:u,marks:c})}function ns(e,t){return t.nodes[e]||t.marks[e]||null}function rs(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}var is=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(function(e,t,o,i){var a,s,u=(null===(s=(a=e.type.spec).toText)||void 0===s?void 0:s.call(a,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-t))})),n};function as(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var ss=Ra((function e(t){Na(this,e),this.find=t.find,this.handler=t.handler})),us=function(e,t){if(as(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function cs(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,s=e.plugin,u=n.view;if(u.composing)return!1;var c=u.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((function(e){return e.type.spec.code}))))return!1;var l=!1,f=is(c)+i;return a.forEach((function(e){if(!l){var t=us(f,e.find);if(t){var a=u.state.tr,c=Va({state:u.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},h=new $a({editor:n,state:c}),p=h.commands,m=h.chain,v=h.can;null!==e.handler({state:c,range:d,match:t,commands:p,chain:m,can:v})&&a.steps.length&&(a.setMeta(s,{transform:a,from:r,to:o,text:i}),u.dispatch(a),l=!0)}}})),l}function ls(e){var t=e.editor,n=e.rules,r=new rn({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,o,i,a){return cs({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout((function(){var o=e.state.selection.$cursor;o&&cs({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&cs({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var fs=Ra((function e(t){Na(this,e),this.find=t.find,this.handler=t.handler})),ds=function(e,t){if(as(t))return Ma(e.matchAll(t));var n=t(e);return n?n.map((function(t){var n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]};function hs(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1,a=new ClipboardEvent("paste"),s=new DragEvent("drop"),u=n.map((function(e){return new rn({view:function(e){var t=function(t){var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy:function(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:function(e,t){return i=r===e.dom.parentElement,s=t,!1},paste:function(e,t){var n,r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=t,o=!!(null===r||void 0===r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(n,r,u){var c=n[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!i;if(l||f){var d=r.doc.content.findDiffStart(u.doc.content),h=r.doc.content.findDiffEnd(u.doc.content);if("number"===typeof d&&h&&d!==h.b){var p=u.tr,m=Va({state:u,transaction:p}),v=function(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=e.pasteEvent,s=e.dropEvent,u=new $a({editor:t,state:n}),c=u.commands,l=u.chain,f=u.can,d=[];return n.doc.nodesBetween(r,o,(function(e,t){if(e.isTextblock&&!e.type.spec.code){var u=Math.max(r,t),h=Math.min(o,t+e.content.size),p=e.textBetween(u-t,h-t,void 0,"\ufffc");ds(p,i.find).forEach((function(e){if(void 0!==e.index){var t=u+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:e,commands:c,chain:l,can:f,pasteEvent:a,dropEvent:s});d.push(h)}}))}})),d.every((function(e){return null!==e}))}({editor:t,state:m,from:Math.max(d-1,0),to:h.b-1,rule:e,pasteEvent:a,dropEvent:s});if(v&&p.steps.length)return s=new DragEvent("drop"),a=new ClipboardEvent("paste"),p}}}})}));return u}var ps=function(){function e(t,n){var r=this;Na(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=ts(this.extensions,n),this.extensions.forEach((function(e){var t;r.editor.extensionStorage[e.name]=e.storage;var n={name:e.name,options:e.options,storage:e.storage,editor:r.editor,type:ns(e.name,r.schema)};"mark"===e.type&&((null===(t=Xa(Ua(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=Ua(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=Ua(e,"onCreate",n);i&&r.editor.on("create",i);var a=Ua(e,"onUpdate",n);a&&r.editor.on("update",a);var s=Ua(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var u=Ua(e,"onTransaction",n);u&&r.editor.on("transaction",u);var c=Ua(e,"onFocus",n);c&&r.editor.on("focus",c);var l=Ua(e,"onBlur",n);l&&r.editor.on("blur",l);var f=Ua(e,"onDestroy",n);f&&r.editor.on("destroy",f)}))}return Ra(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce((function(t,n){var r=Ua(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:ns(n.name,e.schema)});return r?Ia(Ia({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(Ma(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:ns(e.name,t.schema)},a=[],s=Ua(e,"addKeyboardShortcuts",r),u={};if("mark"===e.type&&e.config.exitable&&(u.ArrowRight=function(){return uu.handleExit({editor:n,mark:e})}),s){var c=Object.fromEntries(Object.entries(s()).map((function(e){var t=La(e,2),r=t[0],o=t[1];return[r,function(){return o({editor:n})}]})));u=Ia(Ia({},u),c)}var l=function(e){return new rn({props:{handleKeyDown:Ji(e)}})}(u);a.push(l);var f=Ua(e,"addInputRules",r);rs(e,n.options.enableInputRules)&&f&&o.push.apply(o,Ma(f()));var d=Ua(e,"addPasteRules",r);rs(e,n.options.enablePasteRules)&&d&&i.push.apply(i,Ma(d()));var h=Ua(e,"addProseMirrorPlugins",r);if(h){var p=h();a.push.apply(a,Ma(p))}return a})).flat();return[ls({editor:n,rules:o})].concat(Ma(hs({editor:n,rules:i})),Ma(a))}},{key:"attributes",get:function(){return Ka(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=Wa(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!Ua(e,"addNodeView")})).map((function(n){var r=e.attributes.filter((function(e){return e.type===n.name})),o={name:n.name,options:n.options,storage:n.storage,editor:t,type:Ga(n.name,e.schema)},i=Ua(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var u=Ya(e,r);return i()({editor:t,node:e,getPos:a,decorations:s,HTMLAttributes:u,extension:n})}]})))}}],[{key:"resolve",value:function(t){var n,r,o=e.sort(e.flatten(t)),i=(n=o.map((function(e){return e.name})),r=n.filter((function(e,t){return n.indexOf(e)!==t})),Ma(new Set(r)));return i.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(i.map((function(e){return"'".concat(e,"'")})).join(", "),"]. This can lead to issues.")),o}},{key:"flatten",value:function(e){var t=this;return e.map((function(e){var n=Ua(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(Ma(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=Ua(e,"priority")||100,r=Ua(t,"priority")||100;return n>r?-1:n<r?1:0}))}}])}();function ms(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function vs(e,t){var n=Ia({},e);return ms(e)&&ms(t)&&Object.keys(t).forEach((function(r){ms(t[r])&&r in e?n[r]=vs(e[r],t[r]):Object.assign(n,za({},r,t[r]))})),n}var ys=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Na(this,e),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Ia(Ia({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Xa(Ua(this,"addOptions",{name:this.name}))),this.storage=Xa(Ua(this,"addStorage",{name:this.name,options:this.options}))||{}}return Ra(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=vs(this.options,e),t.storage=Xa(Ua(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Xa(Ua(n,"addOptions",{name:n.name})),n.storage=Xa(Ua(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}])}();function gs(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,s=void 0===a?"\n\n":a,u=i.textSerializers,c=void 0===u?{}:u,l="",f=!0;return e.nodesBetween(r,o,(function(e,n,i,a){var u,d=null===c||void 0===c?void 0:c[e.type.name];d?(e.isBlock&&!f&&(l+=s,f=!0),i&&(l+=d({node:e,pos:n,parent:i,index:a,range:t}))):e.isText?(l+=null===(u=null===e||void 0===e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(r,n)-n,o-n),f=!1):e.isBlock&&!f&&(l+=s,f=!0)})),l}function bs(e){return Object.fromEntries(Object.entries(e.nodes).filter((function(e){return La(e,2)[1].spec.toText})).map((function(e){var t=La(e,2);return[t[0],t[1].spec.toText]})))}var ws=ys.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,Ma(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,Ma(i.map((function(e){return e.$to.pos}))));return gs(o,{from:a,to:s},{textSerializers:bs(r)})}}})]}});function ks(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every((function(r){return n.strict?t[r]===e[r]:as(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function xs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&ks(e.attrs,n)}))}function Es(e,t){return!!xs(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function Cs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),r.node){var o=xs(Ma(r.node.marks),t,n);if(o){var i=r.index,a=e.start()+r.offset,s=i+1,u=a+r.node.nodeSize;for(xs(Ma(r.node.marks),t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&Es(Ma(e.parent.child(s).marks),t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function Ds(e,t){if("string"===typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}function Ss(e){return e instanceof Vt}function Os(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function As(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=Bt.atStart(e),r=Bt.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?Vt.create(e,Os(0,o,i),Os(e.content.size,o,i)):Vt.create(e,Os(t,o,i),Os(t,o,i))}function js(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ts(e){var t="<body>".concat(e,"</body>");return(new window.DOMParser).parseFromString(t,"text/html").body}function Ms(e,t,n){if(n=Ia({slice:!0,parseOptions:{}},n),"object"===Ta(e)&&null!==e)try{return Array.isArray(e)&&e.length>0?b.fromArray(e.map((function(e){return t.nodeFromJSON(e)}))):t.nodeFromJSON(e)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Ms("",t,n)}if("string"===typeof e){var r=de.fromSchema(t);return n.slice?r.parseSlice(Ts(e),n.parseOptions).content:r.parse(Ts(e),n.parseOptions)}return Ms("",t,n)}function Ls(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function Ps(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,s=t?Ga(t,e.schema):null,u=[];e.doc.nodesBetween(o,i,(function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);u.push({node:e,from:n,to:r})}}));var c=i-o,l=u.filter((function(e){return!s||s.name===e.node.type.name})).filter((function(e){return ks(e.node.attrs,n,{strict:!1})}));return a?!!l.length:l.reduce((function(e,t){return e+t.to-t.from}),0)>=c}function Fs(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ns(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce((function(t,r){return n.includes(r)||(t[r]=e[r]),t}),{})}function _s(e,t){return Ms(e,t,{slice:!1,parseOptions:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}})}function Rs(e,t){var n=Ds(t,e.schema),r=e.selection,o=r.from,i=r.to,a=r.empty,s=[];a?(e.storedMarks&&s.push.apply(s,Ma(e.storedMarks)),s.push.apply(s,Ma(e.selection.$head.marks()))):e.doc.nodesBetween(o,i,(function(e){s.push.apply(s,Ma(e.marks))}));var u=s.find((function(e){return e.type.name===n.name}));return u?Ia({},u.attrs):{}}function Bs(e){return function(t){return function(e,t){for(var n=e.depth;n>0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}}function Is(e,t){var n=xe.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function zs(e,t){return gs(e,{from:0,to:e.content.size},t)}function Hs(e,t){var n=Fs("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Ga(t,e.schema),r=e.selection,o=r.from,i=r.to,a=[];e.doc.nodesBetween(o,i,(function(e){a.push(e)}));var s=a.reverse().find((function(e){return e.type.name===n.name}));return s?Ia({},s.attrs):{}}(e,t):"mark"===n?Rs(e,t):{}}function Vs(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter((function(e,n){var r=t.filter((function(e,t){return t!==n}));return!r.some((function(t){return e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to}))}))}function $s(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=Cs(n.resolve(e-1),t.type);o&&r.push(Ia({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,Ma(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function qs(e,t,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=La(n,1)[0],o=e.find((function(e){return e.type===t&&e.name===r}));return!!o&&o.attribute.keepOnSplit})))}function Us(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?Ds(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter((function(e){return!a||a.name===e.type.name})).find((function(e){return ks(e.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(function(e,t){if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,u.push.apply(u,Ma(e.marks.map((function(e){return{mark:e,from:n,to:r}}))))}}))})),0===s)return!1;var c=u.filter((function(e){return!a||a.name===e.mark.type.name})).filter((function(e){return ks(e.mark.attrs,n,{strict:!1})})).reduce((function(e,t){return e+t.to-t.from}),0),l=u.filter((function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)})).reduce((function(e,t){return e+t.to-t.from}),0);return(c>0?c+l:c)>=s}function Ws(e,t){var n=Wa(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=Xa(Ua(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}function Ks(e,t){var n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){var r=n.filter((function(e){return null===t||void 0===t?void 0:t.includes(e.type.name)}));e.tr.ensureMarks(r)}}var Gs=function(e,t){var n=Bs((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!st(e.doc,n.pos)||(e.join(n.pos),!0)},Js=function(e,t){var n=Bs((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!st(e.doc,r)||(e.join(r),!0)},Ys=Object.freeze({__proto__:null,blur:function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame((function(){var e;t.isDestroyed||(n.dom.blur(),null===(e=null===window||void 0===window?void 0:window.getSelection())||void 0===e||e.removeAllRanges())})),!0}},clearContent:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){return t.commands.setContent("",e)}},clearNodes:function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection.ranges;return!r||(o.forEach((function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,(function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),s=i.blockRange(a);if(s){var u=rt(s);if(e.type.isTextblock){var c=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,c)}(u||0===u)&&n.lift(s,u)}}}))})),!0)}},command:function(e){return function(t){return e(t)}},createParagraphNear:function(){return function(e){var t=e.state,n=e.dispatch;return ca(t,n)}},cut:function(e,t){return function(n){var r=n.editor,o=n.tr,i=r.state.doc.slice(e.from,e.to);o.deleteRange(e.from,e.to);var a=o.mapping.map(t);return o.insert(a,i.content),o.setSelection(new Vt(o.doc.resolve(a-1))),!0}},deleteCurrentNode:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection.$anchor.node();if(r.content.size>0)return!1;for(var o=t.selection.$anchor,i=o.depth;i>0;i-=1){if(o.node(i).type===r.type){if(n){var a=o.before(i),s=o.after(i);t.delete(a,s).scrollIntoView()}return!0}}return!1}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Ga(e,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var u=a.before(s),c=a.after(s);n.delete(u,c).scrollIntoView()}return!0}}return!1}},deleteRange:function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},deleteSelection:function(){return function(e){var t=e.state,n=e.dispatch;return Yi(t,n)}},enter:function(){return function(e){return e.commands.keyboardShortcut("Enter")}},exitCode:function(){return function(e){var t=e.state,n=e.dispatch;return ua(t,n)}},extendMarkRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=Ds(e,o.schema),s=r.doc,u=r.selection,c=u.$from,l=u.from,f=u.to;if(i){var d=Cs(c,a,t);if(d&&d.from<=l&&d.to>=f){var h=Vt.create(s,d.from,d.to);r.setSelection(h)}}return!0}},first:function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1}},focus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,i=n.tr,a=n.dispatch;t=Ia({scrollIntoView:!0},t);var s=function(){js()&&o.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null===t||void 0===t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())}))};if(o.hasFocus()&&null===e||!1===e)return!0;if(a&&null===e&&!Ss(r.state.selection))return s(),!0;var u=As(i.doc,e)||r.state.selection,c=r.state.selection.eq(u);return a&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0}},forEach:function(e,t){return function(n){return e.every((function(e,r){return t(e,Ia(Ia({},n),{},{index:r}))}))}},insertContent:function(e,t){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},insertContentAt:function(e,t,n){return function(r){var o=r.tr,i=r.dispatch,a=r.editor;if(i){n=Ia({parseOptions:{},updateSelection:!0},n);var s=Ms(t,a.schema,{parseOptions:Ia({preserveWhitespace:"full"},n.parseOptions)});if("<>"===s.toString())return!0;var u="number"===typeof e?{from:e,to:e}:{from:e.from,to:e.to},c=u.from,l=u.to,f=!0,d=!0;if((s.toString().startsWith("<")?s:[s]).forEach((function(e){e.check(),f=!!f&&(e.isText&&0===e.marks.length),d=!!d&&e.isBlock})),c===l&&d){var h=o.doc.resolve(c).parent;h.isTextblock&&!h.type.spec.code&&!h.childCount&&(c-=1,l+=1)}f?Array.isArray(t)?o.insertText(t.map((function(e){return e.text||""})).join(""),c,l):"object"===Ta(t)&&t&&t.text?o.insertText(t.text,c,l):o.insertText(t,c,l):o.replaceWith(c,l,s),n.updateSelection&&function(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o=e.steps[r];if(o instanceof Xe||o instanceof Ze){var i=e.mapping.maps[r],a=0;i.forEach((function(e,t,n,r){0===a&&(a=r)})),e.setSelection(Bt.near(e.doc.resolve(a),n))}}}(o,o.steps.length-1,-1)}return!0}},joinUp:function(){return function(e){return function(e,t){var n,r=e.selection,o=r instanceof qt;if(o){if(r.node.isTextblock||!st(e.doc,r.from))return!1;n=r.from}else if(null==(n=ct(e.doc,r.from,-1)))return!1;if(t){var i=e.tr.join(n);o&&i.setSelection(qt.create(i.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0}(e.state,e.dispatch)}},joinDown:function(){return function(e){return function(e,t){var n,r=e.selection;if(r instanceof qt){if(r.node.isTextblock||!st(e.doc,r.to))return!1;n=r.to}else if(null==(n=ct(e.doc,r.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0}(e.state,e.dispatch)}},joinBackward:function(){return function(e){var t=e.state,n=e.dispatch;return Xi(t,n)}},joinForward:function(){return function(e){var t=e.state,n=e.dispatch;return ra(t,n)}},joinItemBackward:function(){return function(e){var t=e.tr,n=e.state,r=e.dispatch;try{var o=ct(n.doc,n.selection.$from.pos,-1);return null!==o&&void 0!==o&&(t.join(o,2),r&&r(t),!0)}catch(i){return!1}}},joinItemForward:function(){return function(e){var t=e.state,n=e.dispatch,r=e.tr;try{var o=ct(t.doc,t.selection.$from.pos,1);return null!==o&&void 0!==o&&(r.join(o,2),n&&n(r),!0)}catch(i){return!1}}},keyboardShortcut:function(e){return function(t){var n=t.editor,r=t.view,o=t.tr,i=t.dispatch,a=function(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var s=0;s<i.length-1;s+=1){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: ".concat(u));js()||Ls()?o=!0:n=!0}}return t&&(a="Alt-".concat(a)),n&&(a="Ctrl-".concat(a)),o&&(a="Meta-".concat(a)),r&&(a="Shift-".concat(a)),a}(e).split(/-(?!$)/),s=a.find((function(e){return!["Alt","Ctrl","Meta","Shift"].includes(e)})),u=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction((function(){r.someProp("handleKeyDown",(function(e){return e(r,u)}))}));return null===c||void 0===c||c.steps.forEach((function(e){var t=e.map(o.mapping);t&&i&&o.maybeStep(t)})),!0}},lift:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!Ps(r,Ga(e,r.schema),t)&&function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&rt(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return la(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return Da(Ga(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return aa(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=Fs("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=Ga(e,o.schema)),"mark"===u&&(s=Ds(e,o.schema)),i&&r.selection.ranges.forEach((function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,(function(e,n){a&&a===e.type&&r.setNodeMarkup(n,void 0,Ns(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(Ns(o.attrs,t)))}))}))})),!0)}},scrollIntoView:function(){return function(e){var t=e.tr;return e.dispatch&&t.scrollIntoView(),!0}},selectAll:function(){return function(e){var t=e.tr;return e.commands.setTextSelection({from:0,to:t.doc.content.size})}},selectNodeBackward:function(){return function(e){var t=e.state,n=e.dispatch;return ea(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return oa(t,n)}},selectParentNode:function(){return function(e){return function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(qt.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return va(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return ma(t,n)}},setContent:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.tr,i=r.editor,a=r.dispatch,s=o.doc,u=_s(e,i.schema,n);return a&&o.replaceWith(0,s.content.size,u).setMeta("preventUpdate",!t),!0}},setMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=r.selection,s=a.empty,u=a.ranges,c=Ds(e,o.schema);if(i)if(s){var l=Rs(o,c);r.addStoredMark(c.create(Ia(Ia({},l),t)))}else u.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){var a=Math.max(o,n),s=Math.min(o+e.nodeSize,i);e.marks.find((function(e){return e.type===c}))?e.marks.forEach((function(e){c===e.type&&r.addMark(a,s,c.create(Ia(Ia({},e.attrs),t)))})):r.addMark(a,s,c.create(t))}))}));return function(e,t,n){var r,o=t.selection,i=null;if(Ss(o)&&(i=o.$cursor),i){var a=null!==(r=e.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(a)||!a.some((function(e){return e.type.excludes(n)}))}return o.ranges.some((function(t){var r=t.$from,o=t.$to,i=0===r.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(r.pos,o.pos,(function(e,t,r){if(i)return!1;if(e.isInline){var o=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some((function(e){return e.type.excludes(n)}));i=o&&a}return!i})),i}))}(o,r,c)}},setMeta:function(e,t){return function(n){return n.tr.setMeta(e,t),!0}},setNode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=n.chain,a=Ga(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!ya(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return ya(a,t)(n,o)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o=Os(e,0,r.content.size),i=qt.create(r,o);n.setSelection(i)}return!0}},setTextSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o="number"===typeof e?{from:e,to:e}:e,i=o.from,a=o.to,s=Vt.atStart(r).from,u=Vt.atEnd(r).to,c=Os(i,s,u),l=Os(a,s,u),f=Vt.create(r,c,l);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Ga(e,r.schema);return(n=i,function(e,t){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount>0&&e.firstChild.type==n}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var u=a.parent,c=u.child(s-1);if(c.type!=n)return!1;if(t){var l=c.lastChild&&c.lastChild.type==u.type,f=b.from(l?n.create():null),d=new D(b.from(n.create(null,b.from(u.type.create(null,f)))),l?3:1,0),h=a.start,p=a.end;t(e.tr.step(new Ze(h-(l?3:1),p,h,p,d,1,!0)).scrollIntoView())}return!0})(r,o)}},splitBlock:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).keepMarks,t=void 0===e||e;return function(e){var n=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=n.selection,s=n.doc,u=a.$from,c=a.$to,l=qs(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof qt&&a.node.isBlock)return!(!u.parentOffset||!at(s,u.pos))&&(o&&(t&&Ks(r,i.extensionManager.splittableMarks),n.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(o){var f=c.parentOffset===c.parent.content.size;a instanceof Vt&&n.deleteSelection();var d=0===u.depth?void 0:function(e){for(var t=0;t<e.edgeCount;t+=1){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(u.node(-1).contentMatchAt(u.indexAfter(-1))),h=f&&d?[{type:d,attrs:l}]:void 0,p=at(n.doc,n.mapping.map(u.pos),1,h);if(h||p||!at(n.doc,n.mapping.map(u.pos),1,d?[{type:d}]:void 0)||(p=!0,h=d?[{type:d,attrs:l}]:void 0),p&&(n.split(n.mapping.map(u.pos),1,h),d&&!f&&!u.parentOffset&&u.parent.type!==d)){var m=n.mapping.map(u.before()),v=n.doc.resolve(m);u.node(-1).canReplaceWith(v.index(),v.index()+1,d)&&n.setNodeMarkup(n.mapping.map(u.before()),d)}t&&Ks(r,i.extensionManager.splittableMarks),n.scrollIntoView()}return!0}},splitListItem:function(e){return function(t){var n,r=t.tr,o=t.state,i=t.dispatch,a=t.editor,s=Ga(e,o.schema),u=o.selection,c=u.$from,l=u.$to,f=o.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(l))return!1;var d=c.node(-1);if(d.type!==s)return!1;var h=a.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==s||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){for(var p=b.empty,m=c.index(-1)?1:c.index(-2)?2:3,v=c.depth-m;v>=c.depth-3;v-=1)p=b.from(c.node(v).copy(p));var y=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,g=qs(h,c.node().type.name,c.node().attrs),w=(null===(n=s.contentMatch.defaultType)||void 0===n?void 0:n.createAndFill(g))||void 0;p=p.append(b.from(s.createAndFill(null,w)||void 0));var k=c.before(c.depth-(m-1));r.replace(k,c.after(-y),new D(p,4-m,0));var x=-1;r.doc.nodesBetween(k,r.doc.content.size,(function(e,t){if(x>-1)return!1;e.isTextblock&&0===e.content.size&&(x=t+1)})),x>-1&&r.setSelection(Vt.near(r.doc.resolve(x))),r.scrollIntoView()}return!0}var E=l.pos===c.end()?d.contentMatchAt(0).defaultType:null,C=qs(h,d.type.name,d.attrs),S=qs(h,c.node().type.name,c.node().attrs);r.delete(c.pos,l.pos);var O=E?[{type:s,attrs:C},{type:E,attrs:S}]:[{type:s,attrs:C}];if(!at(r.doc,c.pos,2))return!1;if(i){var A=o.selection,j=o.storedMarks,T=a.extensionManager.splittableMarks,M=j||A.$to.parentOffset&&A.$from.marks();if(r.split(c.pos,2,O).scrollIntoView(),!M||!i)return!0;var L=M.filter((function(e){return T.includes(e.type.name)}));r.ensureMarks(L)}return!0}},toggleList:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(o){var i=o.editor,a=o.tr,s=o.state,u=o.dispatch,c=o.chain,l=o.commands,f=o.can,d=i.extensionManager,h=d.extensions,p=d.splittableMarks,m=Ga(e,s.schema),v=Ga(t,s.schema),y=s.selection,g=s.storedMarks,b=y.$from,w=y.$to,k=b.blockRange(w),x=g||y.$to.parentOffset&&y.$from.marks();if(!k)return!1;var E=Bs((function(e){return Ws(e.type.name,h)}))(y);if(k.depth>=1&&E&&k.depth-E.depth<=1){if(E.node.type===m)return l.liftListItem(v);if(Ws(E.node.type.name,h)&&m.validContent(E.node.content)&&u)return c().command((function(){return a.setNodeMarkup(E.pos,m),!0})).command((function(){return Gs(a,m)})).command((function(){return Js(a,m)})).run()}return n&&x&&u?c().command((function(){var e=f().wrapInList(m,r),t=x.filter((function(e){return p.includes(e.type.name)}));return a.ensureMarks(t),!!e||l.clearNodes()})).wrapInList(m,r).command((function(){return Gs(a,m)})).command((function(){return Js(a,m)})).run():c().command((function(){return!!f().wrapInList(m,r)||l.clearNodes()})).wrapInList(m,r).command((function(){return Gs(a,m)})).command((function(){return Js(a,m)})).run()}},toggleMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,u=Ds(e,o.schema);return Us(o,u,t)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,t)}},toggleNode:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=Ga(e,o.schema),s=Ga(t,o.schema);return Ps(o,a,n)?i.setNode(s):i.setNode(a,n)}},toggleWrap:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=Ga(e,r.schema);return Ps(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o<r.length;o+=1){var i=r[o],a=void 0;if(i.spec.isInputRules&&(a=i.getState(t))){if(n){for(var s=t.tr,u=a.transform,c=u.steps.length-1;c>=0;c-=1)s.step(u.steps[c].invert(u.docs[c]));if(a.text){var l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1}},unsetAllMarks:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(e){t.removeMark(e.$from.pos,e.$to.pos)})),!0}},unsetMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=t.extendEmptyMarkRange,u=void 0!==s&&s,c=o.selection,l=Ds(e,i.schema),f=c.$from,d=c.empty,h=c.ranges;if(!a)return!0;if(d&&u){var p=c.from,m=c.to,v=null===(r=f.marks().find((function(e){return e.type===l})))||void 0===r?void 0:r.attrs,y=Cs(f,l,v);y&&(p=y.from,m=y.to),o.removeMark(p,m,l)}else h.forEach((function(e){o.removeMark(e.$from.pos,e.$to.pos,l)}));return o.removeStoredMark(l),!0}},updateAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=Fs("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=Ga(e,o.schema)),"mark"===u&&(s=Ds(e,o.schema)),i&&r.selection.ranges.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){a&&a===e.type&&r.setNodeMarkup(o,void 0,Ia(Ia({},e.attrs),t)),s&&e.marks.length&&e.marks.forEach((function(a){if(s===a.type){var u=Math.max(o,n),c=Math.min(o+e.nodeSize,i);r.addMark(u,c,s.create(Ia(Ia({},a.attrs),t)))}}))}))})),!0)}},wrapIn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=s&&ot(s,e,t);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}(Ga(e,r.schema),t)(r,o)}},wrapInList:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return Ca(Ga(e,r.schema),t)(r,o)}}}),Qs=ys.create({name:"commands",addCommands:function(){return Ia({},Ys)}}),Xs=ys.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Zs=ys.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new rn({key:new sn("focusEvents"),props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),eu=ys.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command((function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,s=a.pos,u=a.parent,c=a.parent.isTextblock?n.doc.resolve(s-1):a,l=c.parent.type.spec.isolating,f=a.pos-a.parentOffset,d=l&&1===c.parent.childCount?f===a.pos:Bt.atStart(o).from===s;return!(!(i&&d&&u.type.isTextblock)||u.textContent.length)&&t.clearNodes()}))},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]}))},n=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.deleteCurrentNode()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]}))},r={Enter:function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]}))},"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},o=Ia({},r),i=Ia(Ia({},r),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return js()||Ls()?i:o},addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("clearDocument"),appendTransaction:function(t,n,r){if(t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc)){var o=n.selection,i=o.empty,a=o.from,s=o.to,u=Bt.atStart(n.doc).from,c=Bt.atEnd(n.doc).to;if(!i&&(a===u&&s===c))if(0===r.doc.textBetween(0,r.doc.content.size," "," ").length){var l=r.tr,f=Va({state:r,transaction:l});if(new $a({editor:e.editor,state:f}).commands.clearNodes(),l.steps.length)return l}}}})]}}),tu=ys.create({name:"tabindex",addProseMirrorPlugins:function(){return[new rn({key:new sn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),nu=Object.freeze({__proto__:null,ClipboardTextSerializer:ws,Commands:Qs,Editable:Xs,FocusEvents:Zs,Keymap:eu,Tabindex:tu});var ru=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Na(this,t),(e=Sa(this,t)).isFocused=!1,e.extensionStorage={},e.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.setOptions(n),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:e}),e.createView(),e.injectCSS(),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),window.setTimeout((function(){e.isDestroyed||(e.commands.focus(e.options.autofocus),e.emit("create",{editor:e}))}),0),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ja(e,t)}(t,e),Ra(t,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=function(e,t,n){var r=document.querySelector("style[data-tiptap-style".concat(n?"-".concat(n):"","]"));if(null!==r)return r;var o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style".concat(n?"-".concat(n):""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n  position: relative;\n}\n\n.ProseMirror {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  white-space: break-spaces;\n  -webkit-font-variant-ligatures: none;\n  font-variant-ligatures: none;\n  font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n  white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n  white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n  white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n  display: inline !important;\n  border: none !important;\n  margin: 0 !important;\n  width: 1px !important;\n  height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n  margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n  content: "";\n  display: block;\n  position: absolute;\n  top: -2px;\n  width: 20px;\n  border-top: 1px solid black;\n  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n  to {\n    visibility: hidden;\n  }\n}\n\n.ProseMirror-hideselection *::selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection * {\n  caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n  display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n  opacity: 0\n}',this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Ia(Ia({},this.options),e),this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(e,t){var n=Qa(t)?t(e,Ma(this.state.plugins)):[].concat(Ma(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});this.view.updateState(r)}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t="string"===typeof e?"".concat(e,"$"):e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith(t)}))});this.view.updateState(n)}}},{key:"createExtensionManager",value:function(){var e=this.options.enableCoreExtensions?Object.values(nu):[],t=[].concat(Ma(e),Ma(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new ps(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new $a({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=_s(this.options.content,this.schema,this.options.parseOptions),t=As(e,this.options.autofocus);this.view=new Fi(this.options.element,Ia(Ia({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:tn.create({doc:e,selection:t||void 0})}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"prependClass",value:function(){this.view.dom.className="tiptap ".concat(this.view.dom.className)}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(!this.view.isDestroyed){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((function(e){var n;return null===(n=t.capturedTransaction)||void 0===n?void 0:n.step(e)})):void(this.capturedTransaction=e);var n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});var o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}}},{key:"getAttributes",value:function(e){return Hs(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return Ps(e,null,n)||Us(e,null,n);var r=Fs(t,e.schema);return"node"===r?Ps(e,t,n):"mark"===r&&Us(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Is(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,o=t.textSerializers,i=void 0===o?{}:o;return zs(this.state.doc,{blockSeparator:r,textSerializers:Ia(Ia({},bs(this.schema)),i)})}},{key:"isEmpty",get:function(){return e=this.state.doc,n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON(),JSON.stringify(n)===JSON.stringify(r);var e,t,n,r}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}])}(qa);function ou(e){return new ss({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Xa(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],u=o[0];if(s){var c=u.search(/\S/),l=r.from+u.indexOf(s),f=l+s.length;if($s(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>l})).length)return null;f<r.to&&a.delete(f,r.to),l>r.from&&a.delete(r.from+c,l);var d=r.from+c+s.length;a.addMark(r.from+c,d,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}function iu(e){return new ss({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Xa(e.getAttributes,void 0,o)||{},a=n.tr,s=r.from,u=r.to,c=e.type.create(i);if(o[1]){var l=s+o[0].lastIndexOf(o[1]);l>u?l=u:u=l+o[1].length;var f=o[0][o[0].length-1];a.insertText(f,s+o[0].length-1),a.replaceWith(l,u,c)}else o[0]&&a.insert(s-1,e.type.create(i)).delete(a.mapping.map(s),a.mapping.map(u));a.scrollIntoView()}})}function au(e){return new ss({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=n.doc.resolve(r.from),a=Xa(e.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,a)}})}function su(e){return new ss({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=t.chain,a=Xa(e.getAttributes,void 0,o)||{},s=n.tr.delete(r.from,r.to),u=s.doc.resolve(r.from).blockRange(),c=u&&ot(u,e.type,a);if(!c)return null;if(s.wrap(u,c),e.keepMarks&&e.editor){var l=n.selection,f=n.storedMarks,d=e.editor.extensionManager.splittableMarks,h=f||l.$to.parentOffset&&l.$from.marks();if(h){var p=h.filter((function(e){return d.includes(e.type.name)}));s.ensureMarks(p)}}if(e.keepAttributes){var m="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(m,a).run()}var v=s.doc.resolve(r.from-1).nodeBefore;v&&v.type===e.type&&st(s.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,v))&&s.join(r.from-1)}})}var uu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Na(this,e),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Ia(Ia({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Xa(Ua(this,"addOptions",{name:this.name}))),this.storage=Xa(Ua(this,"addStorage",{name:this.name,options:this.options}))||{}}return Ra(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=vs(this.options,e),t.storage=Xa(Ua(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Xa(Ua(n,"addOptions",{name:n.name})),n.storage=Xa(Ua(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"handleExit",value:function(e){var t=e.editor,n=e.mark,r=t.state.tr,o=t.state.selection.$from;if(o.pos===o.end()){var i=o.marks();if(!!!i.find((function(e){return(null===e||void 0===e?void 0:e.type.name)===n.name})))return!1;var a=i.find((function(e){return(null===e||void 0===e?void 0:e.type.name)===n.name}));return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}}])}(),cu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Na(this,e),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Ia(Ia({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Xa(Ua(this,"addOptions",{name:this.name}))),this.storage=Xa(Ua(this,"addStorage",{name:this.name,options:this.options}))||{}}return Ra(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=vs(this.options,e),t.storage=Xa(Ua(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Xa(Ua(n,"addOptions",{name:n.name})),n.storage=Xa(Ua(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}])}();function lu(e){return new fs({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=t.pasteEvent,a=Xa(e.getAttributes,void 0,o,i);if(!1===a||null===a)return null;var s=n.tr,u=o[o.length-1],c=o[0],l=r.to;if(u){var f=c.search(/\S/),d=r.from+c.indexOf(u),h=d+u.length;if($s(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>d})).length)return null;h<r.to&&s.delete(h,r.to),d>r.from&&s.delete(r.from+f,d),l=r.from+f+u.length,s.addMark(r.from+f,l,e.type.create(a||{})),s.removeStoredMark(e.type)}}})}function fu(e){return new fs({find:e.find,handler:function(t){var n=t.match,r=t.chain,o=t.range,i=t.pasteEvent,a=Xa(e.getAttributes,void 0,n,i);if(!1===a||null===a)return null;n.input&&r().deleteRange(o).insertContentAt(o.from,{type:e.type.name,attrs:a})}})}var du=/^\s*>\s$/,hu=cu.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){return t.commands.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){return t.commands.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){return t.commands.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[su({find:du,type:this.type})]}}),pu=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,mu=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,vu=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,yu=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,gu=uu.create({name:"bold",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!==e.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["strong",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBold:function(){return function(t){return t.commands.setMark(e.name)}},toggleBold:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetBold:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-b":function(){return e.editor.commands.toggleBold()},"Mod-B":function(){return e.editor.commands.toggleBold()}}},addInputRules:function(){return[ou({find:pu,type:this.type}),ou({find:vu,type:this.type})]},addPasteRules:function(){return[lu({find:mu,type:this.type}),lu({find:yu,type:this.type})]}});function bu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wu(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ku=cu.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Ja(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}}),xu=uu.create({name:"textStyle",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"span",getAttrs:function(e){return!!e.hasAttribute("style")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{removeEmptyTextStyle:function(){return function(t){var n=t.state,r=t.commands,o=Rs(n,e.type);return!!Object.entries(o).some((function(e){return!!bu(e,2)[1]}))||r.unsetMark(e.name)}}}}}),Eu=/^\s*([-+*])\s$/,Cu=cu.create({name:"bulletList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:"ul"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleBulletList:function(){return function(t){var n=t.commands,r=t.chain;return e.options.keepAttributes?r().toggleList(e.name,e.options.itemTypeName,e.options.keepMarks).updateAttributes(ku.name,e.editor.getAttributes(xu.name)).run():n.toggleList(e.name,e.options.itemTypeName,e.options.keepMarks)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-8":function(){return e.editor.commands.toggleBulletList()}}},addInputRules:function(){var e=this,t=su({find:Eu,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=su({find:Eu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(){return e.editor.getAttributes(xu.name)},editor:this.editor})),[t]}}),Du=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Su=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Ou=uu.create({name:"code",addOptions:function(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML:function(){return[{tag:"code"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["code",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setCode:function(){return function(t){return t.commands.setMark(e.name)}},toggleCode:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetCode:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-e":function(){return e.editor.commands.toggleCode()}}},addInputRules:function(){return[ou({find:Du,type:this.type})]},addPasteRules:function(){return[lu({find:Su,type:this.type})]}});function Au(e){return function(e){if(Array.isArray(e))return ju(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ju(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ju(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ju(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Tu=/^```([a-z]+)?[\s\n]$/,Mu=/^~~~([a-z]+)?[\s\n]$/,Lu=cu.create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{language:{default:null,parseHTML:function(t){var n,r=e.options.languageClassPrefix,o=Au((null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]).filter((function(e){return e.startsWith(r)})).map((function(e){return e.replace(r,"")}))[0];return o||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["pre",Ja(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){return n.commands.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==e.name)&&(!(!o&&r.parent.textContent.length)&&e.editor.commands.clearNodes())},Enter:function(t){var n=t.editor;if(!e.options.exitOnTripleEnter)return!1;var r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==e.type)return!1;var i=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith("\n\n");return!(!i||!a)&&n.chain().command((function(e){return e.tr.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(!i.nodeAt(s)&&n.commands.exitCode())}}},addInputRules:function(){return[au({find:Tu,type:this.type,getAttributes:function(e){return{language:e[1]}}}),au({find:Mu,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;if(e.editor.isActive(e.type.name))return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null===i||void 0===i?void 0:i.mode;if(!r||!a)return!1;var s=t.state.tr;return s.replaceSelectionWith(e.type.create({language:a})),s.setSelection(Vt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(r.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Pu=cu.create({name:"doc",topNode:!0,content:"block+"});function Fu(e){return Fu="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},Fu(e)}function Nu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_u(r.key),r)}}function _u(e){var t=function(e,t){if("object"!=Fu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Fu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fu(t)?t:t+""}function Ru(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new rn({view:function(t){return new Bu(t,e)}})}var Bu=function(){return e=function e(t,n){var r,o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){o[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))},(t=[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent;if(n){var r=t.nodeBefore,o=t.nodeAfter;if(r||o){var i=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0));if(i){var a=i.getBoundingClientRect(),s=r?a.bottom:a.top;r&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:a.left,right:a.right,top:s-this.width/2,bottom:s+this.width/2}}}}if(!e){var u=this.editorView.coordsAtPos(this.cursorPos);e={left:u.left-this.width/2,right:u.left+this.width/2,top:u.top,bottom:u.bottom}}var c,l,f=this.editorView.dom.offsetParent;if(this.element||(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!f||f==document.body&&"static"==getComputedStyle(f).position)c=-pageXOffset,l=-pageYOffset;else{var d=f.getBoundingClientRect();c=d.left-f.scrollLeft,l=d.top-f.scrollTop}this.element.style.left=e.left-c+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=lt(this.editorView.state.doc,i,this.editorView.dragging.slice);null!=a&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}])&&Nu(e.prototype,t),n&&Nu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),Iu=ys.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins:function(){return[Ru(this.options)]}});function zu(e){return zu="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},zu(e)}function Hu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qu(r.key),r)}}function $u(e,t,n){return t&&Vu(e.prototype,t),n&&Vu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qu(e){var t=function(e,t){if("object"!=zu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zu(t)?t:t+""}function Uu(e,t,n){return t=Ku(t),function(e,t){if(t&&("object"==zu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Wu()?Reflect.construct(t,n||[],Ku(e).constructor):t.apply(e,n))}function Wu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wu=function(){return!!e})()}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ku(e)}function Gu(e,t){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gu(e,t)}var Ju=function(e){function t(e){return Hu(this,t),Uu(this,t,[e,e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gu(e,t)}(t,e),$u(t,[{key:"map",value:function(e,n){var r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):Bt.near(r)}},{key:"content",value:function(){return D.empty}},{key:"eq",value:function(e){return e instanceof t&&e.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new Yu(this.anchor)}}],[{key:"fromJSON",value:function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}},{key:"valid",value:function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e:for(;;){if(!r&&t.valid(e))return e;for(var o=e.pos,i=null,a=e.depth;;a--){var s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){i=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=n;var u=e.doc.resolve(o);if(t.valid(u))return u}for(;;){var c=n>0?i.firstChild:i.lastChild;if(!c){if(i.isAtom&&!i.isText&&!qt.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=c,o+=n;var l=e.doc.resolve(o);if(t.valid(l))return l}return null}}}])}(Bt);Ju.prototype.visible=!1,Ju.findFrom=Ju.findGapCursorFrom,Bt.jsonID("gapcursor",Ju);var Yu=function(){function e(t){Hu(this,e),this.pos=t}return $u(e,[{key:"map",value:function(t){return new e(t.map(this.pos))}},{key:"resolve",value:function(e){var t=e.resolve(this.pos);return Ju.valid(t)?new Ju(t):Bt.near(t)}}])}();var Qu=Ji({ArrowLeft:Xu("horiz",-1),ArrowRight:Xu("horiz",1),ArrowUp:Xu("vert",-1),ArrowDown:Xu("vert",1)});function Xu(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){var i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof Vt){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var u=Ju.findGapCursorFrom(a,t,s);return!!u&&(r&&r(e.tr.setSelection(new Ju(u))),!0)}}function Zu(e,t,n){if(!e||!e.editable)return!1;var r=e.state.doc.resolve(t);if(!Ju.valid(r))return!1;var o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&qt.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new Ju(r))),!0)}function ec(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Ju))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var o=b.empty,i=r.length-1;i>=0;i--)o=b.from(r[i].createAndFill(null,o));var a=e.state.tr.replace(n.pos,n.pos,new D(o,0,0));return a.setSelection(Vt.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function tc(e){if(!(e.selection instanceof Ju))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",ui.create(e.doc,[ii.widget(e.selection.head,t,{key:"gapcursor"})])}var nc=ys.create({name:"gapCursor",addProseMirrorPlugins:function(){return[new rn({props:{decorations:tc,createSelectionBetween:function(e,t,n){return t.pos==n.pos&&Ju.valid(n)?new Ju(n):null},handleClick:Zu,handleKeyDown:Qu,handleDOMEvents:{beforeinput:ec}}})]},extendNodeSchema:function(e){var t;return{allowGapCursor:null!==(t=Xa(Ua(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),rc=cu.create({name:"hardBreak",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",Ja(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,s=i.extensionManager.splittableMarks,u=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command((function(e){var t=e.tr;if(e.dispatch&&u&&a){var n=u.filter((function(e){return s.includes(e.type.name)}));t.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}});function oc(e){return oc="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},oc(e)}function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(n),!0).forEach((function(t){sc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=oc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=oc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var uc=cu.create({name:"heading",addOptions:function(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return this.options.levels.map((function(e){return{tag:"h".concat(e),attrs:{level:e}}}))},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes,r=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return["h".concat(r),Ja(this.options.HTMLAttributes,n),0]},addCommands:function(){var e=this;return{setHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.setNode(e.name,t)}},toggleHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return this.options.levels.reduce((function(t,n){return ac(ac({},t),sc({},"Mod-Alt-".concat(n),(function(){return e.editor.commands.toggleHeading({level:n})})))}),{})},addInputRules:function(){var e=this;return this.options.levels.map((function(t){return au({find:new RegExp("^(#{1,".concat(t,"})\\s$")),type:e.type,getAttributes:{level:t}})}))}}),cc=200,lc=function(){};lc.prototype.append=function(e){return e.length?(e=lc.from(e),!this.length&&e||e.length<cc&&this.leafAppend(e)||this.length<cc&&e.leafPrepend(this)||this.appendInner(e)):this},lc.prototype.prepend=function(e){return e.length?lc.from(e).append(this):this},lc.prototype.appendInner=function(e){return new dc(this,e)},lc.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?lc.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},lc.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},lc.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},lc.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},lc.from=function(e){return e instanceof lc?e:e&&e.length?new fc(e):lc.empty};var fc=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=cc)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=cc)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(lc);lc.empty=new fc([]);var dc=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(lc),hc=lc;function pc(e){return pc="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},pc(e)}function mc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gc(r.key),r)}}function yc(e,t,n){return t&&vc(e.prototype,t),n&&vc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gc(e){var t=function(e,t){if("object"!=pc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=pc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pc(t)?t:t+""}var bc=function(){function e(t,n){mc(this,e),this.items=t,this.eventCount=n}return yc(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var o,i,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}n&&(o=this.remapping(a,this.items.length),i=o.maps.length);var s,u,c=t.tr,l=[],f=[];return this.items.forEach((function(t,n){if(!t.step)return o||(o=r.remapping(a,n+1),i=o.maps.length),i--,void f.push(t);if(o){f.push(new wc(t.map));var d,h=t.step.map(o.slice(i));h&&c.maybeStep(h).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],l.push(new wc(d,void 0,void 0,l.length+f.length))),i--,d&&o.appendMap(d,i)}else c.maybeStep(t.step);return t.selection?(s=o?t.selection.map(o.slice(i)):t.selection,u=new e(r.items.slice(0,a).append(f.reverse().concat(l)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:u,transform:c,selection:s}}},{key:"addTransform",value:function(t,n,r,o){for(var i=[],a=this.eventCount,s=this.items,u=!o&&s.length?s.get(s.length-1):null,c=0;c<t.steps.length;c++){var l,f=t.steps[c].invert(t.docs[c]),d=new wc(t.mapping.maps[c],f,n);(l=u&&u.merge(d))&&(d=l,c?i.pop():s=s.slice(0,s.length-1)),i.push(d),n&&(a++,n=void 0),o||(u=d)}var h,p,m,v=a-r.depth;return v>xc&&(p=v,(h=s).forEach((function(e,t){if(e.selection&&0==p--)return m=t,!1})),s=h.slice(m),a-=v),new e(s.append(i),a)}},{key:"remapping",value:function(e,t){var n=new $e;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map((function(e){return new wc(e)}))),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-n),i=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),o);var u=n;this.items.forEach((function(e){var n=i.getMirror(--u);if(null!=n){a=Math.min(a,n);var o=i.maps[n];if(e.step){var c=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(i.slice(u+1,n));l&&s++,r.push(new wc(o,c,l))}else r.push(new wc(o))}}),o);for(var c=[],l=n;l<a;l++)c.push(new wc(i.maps[l]));var f=new e(this.items.slice(0,o).append(c).append(r),s);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-r.length)),f}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((function(e,a){if(a>=t)o.push(e),e.selection&&i++;else if(e.step){var s=e.step.map(n.slice(r)),u=s&&s.getMap();if(r--,u&&n.appendMap(u,r),s){var c=e.selection&&e.selection.map(n.slice(r));c&&i++;var l,f=new wc(u.invert(),s,c),d=o.length-1;(l=o.length&&o[d].merge(f))?o[d]=l:o.push(f)}}else e.map&&r--}),this.items.length,0),new e(hc.from(o.reverse()),i)}}])}();bc.empty=new bc(hc.empty,0);var wc=function(){function e(t,n,r,o){mc(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}return yc(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}])}(),kc=yc((function e(t,n,r,o,i){mc(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i})),xc=20;function Ec(e){for(var t=[],n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((function(e,n,r,o){return t.push(r,o)}));return t}function Cc(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}var Dc=!1,Sc=null;function Oc(e){var t=e.plugins;if(Sc!=t){Dc=!1,Sc=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Dc=!0;break}}return Dc}var Ac=new sn("history"),jc=new sn("closeHistory");function Tc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new rn({key:Ac,state:{init:function(){return new kc(bc.empty,bc.empty,null,0,-1)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(Ac);if(i)return i.historyState;n.getMeta(jc)&&(e=new kc(e.done,e.undone,null,0,-1));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Ac))return a.getMeta(Ac).redo?new kc(e.done.addTransform(n,void 0,r,Oc(t)),e.undone,Ec(n.mapping.maps),e.prevTime,e.prevComposition):new kc(e.done,e.undone.addTransform(n,void 0,r,Oc(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new kc(e.done.rebased(n,o),e.undone.rebased(n,o),Cc(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new kc(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Cc(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);var s=n.getMeta("composition"),u=0==e.prevTime||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),c=a?Cc(e.prevRanges,n.mapping):Ec(n.mapping.maps);return new kc(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Oc(t)),bc.empty,c,n.time,null==s?e.prevComposition:s)}(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?Lc:"historyRedo"==n?Pc:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Mc(e,t){return function(n,r){var o=Ac.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){var i=function(e,t,n){var r=Oc(t),o=Ac.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;var a=i.selection.resolve(i.transform.doc),s=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),u=new kc(n?s:i.remaining,n?i.remaining:s,null,0,-1);return i.transform.setSelection(a).setMeta(Ac,{redo:n,historyState:u})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}var Lc=Mc(!1,!0),Pc=Mc(!0,!0);Mc(!1,!1),Mc(!0,!1);var Fc=ys.create({name:"history",addOptions:function(){return{depth:100,newGroupDelay:500}},addCommands:function(){return{undo:function(){return function(e){var t=e.state,n=e.dispatch;return Lc(t,n)}},redo:function(){return function(e){var t=e.state,n=e.dispatch;return Pc(t,n)}}}},addProseMirrorPlugins:function(){return[Tc(this.options)]},addKeyboardShortcuts:function(){var e=this;return{"Mod-z":function(){return e.editor.commands.undo()},"Mod-Z":function(){return e.editor.commands.undo()},"Mod-y":function(){return e.editor.commands.redo()},"Mod-Y":function(){return e.editor.commands.redo()},"Shift-Mod-z":function(){return e.editor.commands.redo()},"Shift-Mod-Z":function(){return e.editor.commands.redo()},"Mod-\u044f":function(){return e.editor.commands.undo()},"Shift-Mod-\u044f":function(){return e.editor.commands.redo()}}}}),Nc=cu.create({name:"horizontalRule",addOptions:function(){return{HTMLAttributes:{}}},group:"block",parseHTML:function(){return[{tag:"hr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["hr",Ja(this.options.HTMLAttributes,t)]},addCommands:function(){var e=this;return{setHorizontalRule:function(){return function(t){var n=t.chain,r=t.state.selection.$to,o=n();return 0===r.parentOffset?o.insertContentAt(Math.max(r.pos-2,0),{type:e.name}):o.insertContent({type:e.name}),o.command((function(e){var t,n=e.tr;if(e.dispatch){var r=n.selection.$to,o=r.end();if(r.nodeAfter)r.nodeAfter.isTextblock?n.setSelection(Vt.create(n.doc,r.pos+1)):r.nodeAfter.isBlock?n.setSelection(qt.create(n.doc,r.pos)):n.setSelection(Vt.create(n.doc,r.pos));else{var i=null===(t=r.parent.type.contentMatch.defaultType)||void 0===t?void 0:t.create();i&&(n.insert(o,i),n.setSelection(Vt.create(n.doc,o+1)))}n.scrollIntoView()}return!0})).run()}}}},addInputRules:function(){return[iu({find:/^(?:---|\u2014-|___\s|\*\*\*\s)$/,type:this.type})]}}),_c=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Rc=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Bc=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Ic=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,zc=uu.create({name:"italic",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"em"},{tag:"i",getAttrs:function(e){return"normal"!==e.style.fontStyle&&null}},{style:"font-style=italic"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["em",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setItalic:function(){return function(t){return t.commands.setMark(e.name)}},toggleItalic:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetItalic:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-i":function(){return e.editor.commands.toggleItalic()},"Mod-I":function(){return e.editor.commands.toggleItalic()}}},addInputRules:function(){return[ou({find:_c,type:this.type}),ou({find:Bc,type:this.type})]},addPasteRules:function(){return[lu({find:Rc,type:this.type}),lu({find:Ic,type:this.type})]}}),Hc=cu.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Ja(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}});function Vc(e){return Vc="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},Vc(e)}var $c=["start"];function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uc(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Vc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Vc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Kc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kc(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Gc=cu.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Ja(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}}),Jc=uu.create({name:"textStyle",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"span",getAttrs:function(e){return!!e.hasAttribute("style")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{removeEmptyTextStyle:function(){return function(t){var n=t.state,r=t.commands,o=Rs(n,e.type);return!!Object.entries(o).some((function(e){return!!Wc(e,2)[1]}))||r.unsetMark(e.name)}}}}}),Yc=/^(\d+)\.\s$/,Qc=cu.create({name:"orderedList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},addAttributes:function(){return{start:{default:1,parseHTML:function(e){return e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}}},parseHTML:function(){return[{tag:"ol"}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.start,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,$c);return 1===n?["ol",Ja(this.options.HTMLAttributes,r),0]:["ol",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleOrderedList:function(){return function(t){var n=t.commands,r=t.chain;return e.options.keepAttributes?r().toggleList(e.name,e.options.itemTypeName,e.options.keepMarks).updateAttributes(Gc.name,e.editor.getAttributes(Jc.name)).run():n.toggleList(e.name,e.options.itemTypeName,e.options.keepMarks)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-7":function(){return e.editor.commands.toggleOrderedList()}}},addInputRules:function(){var e=this,t=su({find:Yc,type:this.type,getAttributes:function(e){return{start:+e[1]}},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]}});return(this.options.keepMarks||this.options.keepAttributes)&&(t=su({find:Yc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Uc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({start:+t[1]},e.editor.getAttributes(Jc.name))},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]},editor:this.editor})),[t]}}),Xc=cu.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){return t.commands.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),Zc=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,el=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,tl=uu.create({name:"strike",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("line-through")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["s",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setStrike:function(){return function(t){return t.commands.setMark(e.name)}},toggleStrike:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetStrike:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this,t={};return Ls()?t["Mod-Shift-s"]=function(){return e.editor.commands.toggleStrike()}:t["Ctrl-Shift-s"]=function(){return e.editor.commands.toggleStrike()},t},addInputRules:function(){return[ou({find:Zc,type:this.type})]},addPasteRules:function(){return[lu({find:el,type:this.type})]}}),nl=cu.create({name:"text",group:"inline"}),rl=ys.create({name:"starterKit",addExtensions:function(){var e,t,n,r,o,i,a,s,u,c,l,f,d,h,p,m,v,y,g=[];return!1!==this.options.blockquote&&g.push(hu.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&g.push(gu.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&g.push(Cu.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&g.push(Ou.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&g.push(Lu.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&g.push(Pu.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&g.push(Iu.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&g.push(nc.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&g.push(rc.configure(null===(u=this.options)||void 0===u?void 0:u.hardBreak)),!1!==this.options.heading&&g.push(uc.configure(null===(c=this.options)||void 0===c?void 0:c.heading)),!1!==this.options.history&&g.push(Fc.configure(null===(l=this.options)||void 0===l?void 0:l.history)),!1!==this.options.horizontalRule&&g.push(Nc.configure(null===(f=this.options)||void 0===f?void 0:f.horizontalRule)),!1!==this.options.italic&&g.push(zc.configure(null===(d=this.options)||void 0===d?void 0:d.italic)),!1!==this.options.listItem&&g.push(Hc.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&g.push(Qc.configure(null===(p=this.options)||void 0===p?void 0:p.orderedList)),!1!==this.options.paragraph&&g.push(Xc.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&g.push(tl.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&g.push(nl.configure(null===(y=this.options)||void 0===y?void 0:y.text)),g}}),ol=uu.create({name:"underline",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("underline")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["u",Ja(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setUnderline:function(){return function(t){return t.commands.setMark(e.name)}},toggleUnderline:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetUnderline:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-u":function(){return e.editor.commands.toggleUnderline()},"Mod-U":function(){return e.editor.commands.toggleUnderline()}}}}),il=ys.create({name:"characterCount",addOptions:function(){return{limit:null,mode:"textSize"}},addStorage:function(){return{characters:function(){return 0},words:function(){return 0}}},onBeforeCreate:function(){var e=this;this.storage.characters=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return"textSize"===((null===t||void 0===t?void 0:t.mode)||e.options.mode)?n.textBetween(0,n.content.size,void 0," ").length:n.nodeSize},this.storage.words=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return n.textBetween(0,n.content.size," "," ").split(" ").filter((function(e){return""!==e})).length}},addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("characterCount"),filterTransaction:function(t,n){var r=e.options.limit;if(!t.docChanged||0===r||null===r||void 0===r)return!0;var o=e.storage.characters({node:n.doc}),i=e.storage.characters({node:t.doc});if(i<=r)return!0;if(o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o)return!1;if(!t.getMeta("paste"))return!1;var a=t.selection.$head.pos,s=a-(i-r),u=a;return t.deleteRange(s,u),!(e.storage.characters({node:t.doc})>r)}})]}});function al(e){return function(e){if(Array.isArray(e))return sl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return sl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sl(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ul=il.extend({addProseMirrorPlugins:function(){var e,t=this.options.limit,n=null===(e=this.parent)||void 0===e?void 0:e.call(this);if(0===t||null===t||!t)return n;var r=this.editor.storage;return[].concat(al(n),[new rn({props:{handleKeyDown:function(e,n){return"Enter"===n.key&&r.characterCount.characters()>=t}}})])}}),cl=gu.extend({parseHTML:function(){return[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!==e.style.fontWeight&&"400"!==e.style.fontWeight&&null}},{tag:"span",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e.style.fontWeight)&&null}}]}}),ll=ys.create({name:"dialog",addStorage:function(){return{open:!1}},addCommands:function(){var e=this;return{isDialogOpen:function(){return function(){return e.storage.open}},toggleDialog:function(t){return function(){return e.storage.open=t}}}},addProseMirrorPlugins:function(){var e=this;return[new rn({key:new sn("editable"),props:{attributes:function(){return e.storage.open?{class:"dialog-open"}:{}}}})]}});function fl(e){return fl="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},fl(e)}function dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=fl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pl(){pl=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==fl(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(fl(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function ml(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var vl=new sn("suggestion");function yl(e){var t,n=e.pluginKey,r=void 0===n?vl:n,o=e.editor,i=e.char,a=void 0===i?"@":i,s=e.allowSpaces,u=void 0!==s&&s,c=e.allowedPrefixes,l=void 0===c?[" "]:c,f=e.startOfLine,d=void 0!==f&&f,h=e.decorationTag,p=void 0===h?"span":h,m=e.decorationClass,v=void 0===m?"suggestion":m,y=e.command,g=void 0===y?function(){return null}:y,b=e.items,w=void 0===b?function(){return[]}:b,k=e.render,x=void 0===k?function(){return{}}:k,E=e.allow,C=void 0===E?function(){return!0}:E,D=null===x||void 0===x?void 0:x(),S=new rn({key:r,view:function(){var e,n,r=this;return{update:(e=pl().mark((function e(n,i){var a,s,u,c,l,f,d,h,p,m,v,y,b,k,x,E,C,S;return pl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=null===(a=r.key)||void 0===a?void 0:a.getState(i),p=null===(s=r.key)||void 0===s?void 0:s.getState(n.state),m=h.active&&p.active&&h.range.from!==p.range.from,v=!h.active&&p.active,y=h.active&&!p.active,b=!v&&!y&&h.query!==p.query,x=b&&!m,E=y||m,(k=v||m)||x||E){e.next=11;break}return e.abrupt("return");case 11:if(C=E&&!k?h:p,S=n.dom.querySelector('[data-decoration-id="'.concat(C.decorationId,'"]')),t={editor:o,range:C.range,query:C.query,text:C.text,items:[],command:function(e){g({editor:o,range:C.range,props:e})},decorationNode:S,clientRect:S?function(){var e,t=(null===(e=r.key)||void 0===e?void 0:e.getState(o.state)).decorationId,i=n.dom.querySelector('[data-decoration-id="'.concat(t,'"]'));return(null===i||void 0===i?void 0:i.getBoundingClientRect())||null}:null},k&&(null===(u=null===D||void 0===D?void 0:D.onBeforeStart)||void 0===u||u.call(D,t)),x&&(null===(c=null===D||void 0===D?void 0:D.onBeforeUpdate)||void 0===c||c.call(D,t)),!x&&!k){e.next=20;break}return e.next=19,w({editor:o,query:C.query});case 19:t.items=e.sent;case 20:E&&(null===(l=null===D||void 0===D?void 0:D.onExit)||void 0===l||l.call(D,t)),x&&(null===(f=null===D||void 0===D?void 0:D.onUpdate)||void 0===f||f.call(D,t)),k&&(null===(d=null===D||void 0===D?void 0:D.onStart)||void 0===d||d.call(D,t));case 23:case"end":return e.stop()}}),e)})),n=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ml(i,r,o,a,s,"next",e)}function s(e){ml(i,r,o,a,s,"throw",e)}a(void 0)}))},function(e,t){return n.apply(this,arguments)}),destroy:function(){var e;t&&(null===(e=null===D||void 0===D?void 0:D.onExit)||void 0===e||e.call(D,t))}}},state:{init:function(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply:function(e,t,n,r){var i=o.isEditable,s=o.view.composing,c=e.selection,f=c.empty,h=c.from,p=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dl(Object(n),!0).forEach((function(t){hl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t);if(p.composing=s,i&&(f||o.view.composing)){!(h<t.range.from||h>t.range.to)||s||t.composing||(p.active=!1);var m=function(e){var t,n=e.char,r=e.allowSpaces,o=e.allowedPrefixes,i=e.startOfLine,a=e.$position,s=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),u=new RegExp("\\s".concat(s,"$")),c=i?"^":"",l=r?new RegExp("".concat(c).concat(s,".*?(?=\\s").concat(s,"|$)"),"gm"):new RegExp("".concat(c,"(?:^)?").concat(s,"[^\\s").concat(s,"]*"),"gm"),f=(null===(t=a.nodeBefore)||void 0===t?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;var d=a.pos-f.length,h=Array.from(f.matchAll(l)).pop();if(!h||void 0===h.input||void 0===h.index)return null;var p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp("^[".concat(null===o||void 0===o?void 0:o.join(""),"\0]?$")).test(p);if(null!==o&&!m)return null;var v=d+h.index,y=v+h[0].length;return r&&u.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),v<a.pos&&y>=a.pos?{range:{from:v,to:y},query:h[0].slice(n.length),text:h[0]}:null}({char:a,allowSpaces:u,allowedPrefixes:l,startOfLine:d,$position:c.$from}),v="id_".concat(Math.floor(4294967295*Math.random()));m&&C({editor:o,state:r,range:m.range})?(p.active=!0,p.decorationId=t.decorationId?t.decorationId:v,p.range=m.range,p.query=m.query,p.text=m.text):p.active=!1}else p.active=!1;return p.active||(p.decorationId=null,p.range={from:0,to:0},p.query=null,p.text=null),p}},props:{handleKeyDown:function(e,t){var n,r=S.getState(e.state),o=r.active,i=r.range;return o&&(null===(n=null===D||void 0===D?void 0:D.onKeyDown)||void 0===n?void 0:n.call(D,{view:e,event:t,range:i}))||!1},decorations:function(e){var t=S.getState(e),n=t.active,r=t.range,o=t.decorationId;return n?ui.create(e.doc,[ii.inline(r.from,r.to,{nodeName:p,class:v,"data-decoration-id":o})]):null}}});return S}function gl(e){return gl="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},gl(e)}function bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bl(Object(n),!0).forEach((function(t){kl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=gl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xl=new sn("mention"),El=cu.create({name:"mention",addOptions:function(){var e=this;return{HTMLAttributes:{},renderLabel:function(e){var t,n=e.options,r=e.node;return"".concat(n.suggestion.char).concat(null!==(t=r.attrs.label)&&void 0!==t?t:r.attrs.id)},suggestion:{char:"@",pluginKey:xl,command:function(t){var n,r,o=t.editor,i=t.range,a=t.props,s=o.view.state.selection.$to.nodeAfter;(null===(n=null===s||void 0===s?void 0:s.text)||void 0===n?void 0:n.startsWith(" "))&&(i.to+=1),o.chain().focus().insertContentAt(i,[{type:e.name,attrs:a},{type:"text",text:" "}]).run(),null===(r=window.getSelection())||void 0===r||r.collapseToEnd()},allow:function(t){var n=t.state,r=t.range,o=n.doc.resolve(r.from),i=n.schema.nodes[e.name],a=!!o.parent.type.contentMatch.matchType(i);return a}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:function(e){return e.getAttribute("data-id")},renderHTML:function(e){return e.id?{"data-id":e.id}:{}}},label:{default:null,parseHTML:function(e){return e.getAttribute("data-label")},renderHTML:function(e){return e.label?{"data-label":e.label}:{}}}}},parseHTML:function(){return[{tag:'span[data-type="'.concat(this.name,'"]')}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["span",Ja({"data-type":this.name},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText:function(e){var t=e.node;return this.options.renderLabel({options:this.options,node:t})},addKeyboardShortcuts:function(){var e=this;return{Backspace:function(){return e.editor.commands.command((function(t){var n=t.tr,r=t.state,o=!1,i=r.selection,a=i.empty,s=i.anchor;return!!a&&(r.doc.nodesBetween(s-1,s,(function(t,r){if(t.type.name===e.name)return o=!0,n.insertText(e.options.suggestion.char||"",r,r+t.nodeSize),!1})),o)}))}}},addProseMirrorPlugins:function(){return[yl(wl({editor:this.editor},this.options.suggestion))]}}),Cl=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).itemConverter;return function(){var e=null,n=null,r=null,o=-1,i=null,a=null,s=function(e){var n=e;return t&&(n=t(e)),n instanceof Object?n:{label:n}},u=function(t){var n=0;if(e.querySelectorAll(".editor-suggestions-item").forEach((function(e,t){"true"===e.dataset.selected&&(o=t),e.removeAttribute("data-selected"),n+=1})),"up"===t?o-=1:o+=1,o<0?o=0:o===n&&(o-=1),o>-1){var r=e.querySelector('.editor-suggestions-item[data-index="'.concat(o,'"]'));r&&(r.dataset.selected="true")}},c=function(e){var t=n,o=r;a&&"undefined"===typeof jest&&i.chain().focus().setTextSelection(a).command((function(e){var t=e.tr;return e.dispatch&&t.replaceSelectionWith(i.schema.text("  ")),!0})).setTextSelection({from:a.from,to:a.from}).run(),o(s(t[e]))},l=function(t){var n=t.items,r=(0,t.clientRect)();Object.assign(e.style,{position:"absolute",top:"".concat(document.documentElement.scrollTop+r.top+r.height,"px"),left:"".concat(r.left,"px")}),e.classList.remove("hidden","hide"),e.innerHTML="",n.forEach((function(t,n){var r=s(t),i=r.label,a=r.id,u=document.createElement("button");u.type="button",u.classList.add("editor-suggestions-item"),a&&(u.dataset.id=a),u.dataset.index=n,u.dataset.value=i,0===n&&(o=n,u.dataset.selected="true"),u.textContent=i,e.append(u),u.addEventListener("click",(function(){return c(n)}))}))};return{onStart:function(t){var o=t.editor,a=t.items,s=t.clientRect,u=t.command;i=o,n=a,r=u,e=document.createElement("div"),document.body.append(e),e.classList.add("editor-suggestions","hidden","hide"),a.length>0&&l({clientRect:s,items:a})},onUpdate:function(t){var r=t.clientRect,o=t.items;r&&e&&(n=o,o.length>0?l({clientRect:r,items:o}):e.classList.add("editor-suggestions","hidden","hide"))},onKeyDown:function(t){var n=t.event,r=t.range;return a=r,"Escape"===n.key?(e.classList.add("hidden","hide"),!0):"ArrowUp"===n.key?(u("up"),!0):"ArrowDown"===n.key?(u("down"),!0):"Enter"===n.key&&(o>-1&&c(o),o=-1,!0)},onExit:function(){e.remove(),e=n=r=i=a=null,o=-1}}}},Dl=function(e){return function(t){var n=t.node,r=document.createElement("span");r.textContent=e.options.renderLabel({options:e.options,node:n});var o=n.attrs,i=o.id,a=o.label;return r.dataset.suggestion=n.type.name,i&&(r.dataset.id=i),r.dataset.label=a,{dom:r}}};function Sl(e){return Sl="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},Sl(e)}function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(n),!0).forEach((function(t){jl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Sl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Sl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tl(){Tl=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Sl(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Sl(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Ml(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Ll(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ml(i,r,o,a,s,"next",e)}function s(e){Ml(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Pl=new sn("hashtag"),Fl=function(){var e=Ll(Tl().mark((function e(t){return Tl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch(window.Decidim.config.get("api_path"),{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:'{ hashtags(name:"'.concat(t,'") {name} }')})}).then((function(e){if(e.ok)return e.json();throw new Error("Could not retrieve data")})).then((function(e){return e.data.hashtags||[]})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Nl=El.extend({name:"hashtag",addOptions:function(){var e,t,n=null===(e=this.parent)||void 0===e?void 0:e.call(this),r=null===n||void 0===n?void 0:n.suggestion;return Al(Al({},n),{},{renderLabel:function(e){var t,n=e.node;return"".concat(null!==(t=n.attrs.label)&&void 0!==t?t:n.attrs.id)},suggestion:Al(Al({},r),{},{char:"#",pluginKey:Pl,items:(t=Ll(Tl().mark((function e(t){var n,r,o;return Tl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=t.query).length<2)){e.next=3;break}return e.abrupt("return",[]);case 3:return e.next=5,Fl(n);case 5:return r=e.sent,o=r.sort((function(e){return e.name})),e.abrupt("return",o.slice(0,5));case 8:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),render:Cl(this,{itemConverter:function(e){return{label:"#".concat(e.name)}}})})})},addNodeView:function(){return Dl(this)}}),_l=uc.extend({addInputRules:function(){var e=this;return this.options.levels.map((function(t){return au({find:new RegExp("^(#{2,".concat(t,"})\\s$")),type:e.type,getAttributes:{level:t}})}))}});function Rl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Il(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bl(e){return function(e){if(Array.isArray(e))return zl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Il(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Il(e,t){if(e){if("string"==typeof e)return zl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zl(e,t):void 0}}function zl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Hl=[function(e){var t,n=document.createElement("div");n.innerHTML=function(e){return e.replace(/<!\[if\s+[^\]]+\]>((?!<!\[endif\])[\s\S])+<!\[endif\]>/g,"")}(e);var r=n.querySelectorAll([".MsoListParagraph",".MsoListParagraphCxSpFirst",".MsoListParagraphCxSpMiddle",".MsoListParagraphCxSpLast"].join(", "));if(r.length<1)return e;var o=function(e){var t,n=null===(t=e.querySelector("style"))||void 0===t?void 0:t.textContent;if(!n)return{};var r={};return Bl(n.matchAll(/@list\s+(l\d+:level\d+)[\s]+\{([^}]+)\}/g)).forEach((function(e){var t={};e[2].replace(/[\s]+/g,"").split(";").forEach((function(e){var n=Rl(e.split(":"),2),r=n[0],o=n[1];t[r]=o})),r[e[1]]=t})),r}(n);null===(t=n.querySelector("style"))||void 0===t||t.remove();var i=1,a=null;return r.forEach((function(e){var t=function(e){var t=e.getAttribute("style");if(!t)return{type:null,level:1};var n=t.match(/mso-list:(l\d+)\s(level\d+)/);if(n){var r=Rl(n,3),o=r[1],i=r[2];return{type:o,level:parseInt(i.match(/\d/),10)}}return{type:null,level:1}}(e),n=t.type,r=t.level,s=function(e,t,n){if(null===e)return{};var r=n[e]||{},o=n["".concat(e,":level").concat(t)]||{};return Object.assign(r,o)}(n,r,o),u=function(e){var t="ol",n=null;switch(e["mso-level-number-format"]){case"bullet":t="ul";break;case"alpha-lower":case"lower-alpha":n="a";break;case"alpha-upper":case"upper-alpha":n="A";break;case"roman-lower":case"lower-roman":n="i";break;case"roman-upper":case"upper-roman":n="I";break;default:n="1"}return{tag:t,type:n}}(s),c=u.tag,l=u.type,f=document.createElement("li"),d=document.createElement("p");if(d.innerHTML=e.innerHTML,f.append(d),e.classList.contains("MsoListParagraph")||e.classList.contains("MsoListParagraphCxSpFirst"))i=1,a=document.createElement(c),"ol"===c&&l&&a.setAttribute("type",l),a.append(f),e.replaceWith(a);else{if(r>i){i+=1;var h=document.createElement(c);if("ol"===c&&l&&h.setAttribute("type",l),r===i)h.append(f);else{var p=document.createElement("li"),m=document.createElement("p");p.append(m),h.append(p)}a.lastElementChild.append(h),a=h}else{for(;r<i;){i-=1;var v=a.parentNode.closest("ol, ul");if(!v){i=r;break}a=v}a.append(f)}e.classList.contains("MsoListParagraphCxSpLast")&&(i=1,a=null),e.remove()}})),n.innerHTML},function(e){var t=document.createElement("div");t.innerHTML=e;var n={};return t.querySelectorAll(".ListContainerWrapper").forEach((function(e){var t,r,o=e.querySelector("li[data-listid]");null!==(r=n[t=o.dataset.listid])&&void 0!==r||(n[t]=[]),n[o.dataset.listid].push({wrapper:e,level:parseInt(o.dataset.ariaLevel,10)})})),Object.keys(n).length<1?e:(Object.values(n).forEach((function(e){var t=e.shift().wrapper,n=t.querySelector("ol, ul");t.replaceWith(n);var r=1,o=1;e.forEach((function(e){var t=e.wrapper,i=e.level,a=t.querySelector("ol, ul");if(i>o){for(var s=null;i>o;)o+=1,n.lastElementChild&&(r+=1,s=n.lastElementChild);s.append(a),n=a}else{for(var u;i<r;){r-=1;var c=n.parentNode.closest("ol, ul");if(!c){r=i;break}n=c}o=i,(u=n).append.apply(u,Bl(a.querySelectorAll("li"))),a.remove()}t.remove()}))})),t.innerHTML)}],Vl=["start"];function $l(e){return $l="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},$l(e)}function ql(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ul(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ql(Object(n),!0).forEach((function(t){Wl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ql(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=$l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=$l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$l(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kl=["a","A","i","I"],Gl=function(e){switch(e){case"lower-alpha":case"lower-latin":return"a";case"upper-alpha":case"upper-latin":return"A";case"lower-roman":return"i";case"upper-roman":return"I";default:return"1"}},Jl=Qc.extend({addAttributes:function(){var e;return Ul(Ul({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{type:{default:null,parseHTML:function(e){var t=e.getAttribute("type");if(Kl.includes(t))return t;var n=e.querySelector("li");return n&&(t=Gl(n.style.listStyleType),Kl.includes(t))?t:(t=Gl(e.style.listStyleType),Kl.includes(t)?t:null)}}})},renderHTML:function(e){var t,n,r=e.HTMLAttributes,o=r.start,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,Vl),a=null;(a=Ja(this.options.HTMLAttributes,1===o?i:r)).type&&(null!==(n=(t=a)["data-type"])&&void 0!==n||(t["data-type"]=a.type));return["ol",a,0]},addCommands:function(){var e,t=this;return Ul(Ul({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{setOrderedListType:function(e){return function(n){var r=n.commands,o=n.dispatch,i=t.editor.isActive("orderedList");return o&&i?r.updateAttributes("orderedList",{type:e}):i}}})},addKeyboardShortcuts:function(){var e,t=this,n=function(e){if(!t.editor.isActive("orderedList"))return!1;var n=function(e,t){var n=Kl.indexOf(e)+t;if(-2===n)n=Kl.length-1;else if(n<0||n>=Kl.length)return null;return Kl[n]}(t.editor.getAttributes("orderedList").type,e);return!!t.editor.can().setOrderedListType(n)&&t.editor.commands.setOrderedListType(n)};return Ul(Ul({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{"Alt-Shift-ArrowUp":function(){return n(-1)},"Alt-Shift-ArrowDown":function(){return n(1)}})},addProseMirrorPlugins:function(){return[new rn({props:{transformPastedHTML:function(e){return function(e){var t=e;return Hl.forEach((function(e){return t=e(t)})),t}(e)}}})]}});function Yl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ql(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ql(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Xl=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Zl=cu.create({name:"image",addOptions:function(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML:function(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["img",Ja(this.options.HTMLAttributes,t)]},addCommands:function(){var e=this;return{setImage:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}}}},addInputRules:function(){return[iu({find:Xl,type:this.type,getAttributes:function(e){var t=Yl(e,5),n=t[2];return{src:t[3],alt:n,title:t[4]}}})]}});function ef(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(n),!0).forEach((function(t){nf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nf(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=rf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=rf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rf(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rf(e){return rf="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},rf(e)}var of=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=window.Decidim.config.get("messages");if(null===e)return t;var n=t;return e.split(".").forEach((function(e){return n=n[e]||{}})),n},af=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={};return Object.keys(e).forEach((function(r){"object"===rf(e[r])?n=tf(tf({},n),af(e[r],"".concat(t).concat(r,"."))):""===r?n[(null===t||void 0===t?void 0:t.replace(/\.$/,""))||""]=e[r]:n["".concat(t).concat(r)]=e[r]})),n},sf=function(e){return af(of(e))},uf=function(e){return e.split(".").slice(0,-1).join(".")};function cf(e){return cf="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},cf(e)}function lf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ff(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lf(Object(n),!0).forEach((function(t){df(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function df(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=cf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=cf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==cf(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hf=function(e){var t=sf("editor.extensions.image.nodeView.resizer"),n=function(e){var n=t["control.resize"],r=t["position.".concat(e.replace(/-(\w)/,(function(e,t){return t.toUpperCase()})))];return function(e,t){var n=document.createElement("button");return n.type="button",n.ariaLabel=t,n.dataset.imageResizerControl=e,n}(e,n.replace("%position%",r))};return function(t){var r=t.editor,o=t.node,i=t.getPos,a=document.createElement("div");a.dataset.imageResizerWrapper="",a.append(n("top-left")),a.append(n("top-right")),a.append(n("bottom-left")),a.append(n("bottom-right"));var s=function(){var e=document.createElement("div");e.dataset.imageResizerDimensions="";var t=document.createElement("span");t.dataset.imageResizerDimension="width",t.dataset.imageResizerDimensionValue="";var n=document.createElement("span");return n.dataset.imageResizerDimension="height",n.dataset.imageResizerDimensionValue="",e.append(t),e.append("\xd7"),e.append(n),{wrapper:e,width:t,height:n}}();a.append(s.wrapper);var u=xe.fromSchema(o.type.schema).serializeNode(o);a.append(u);var c=u.querySelector("img"),l=null,f=null,d=o.attrs.src,h=null,p=c.naturalHeight,m=c.naturalWidth,v=null,y=null,g=document.createElement("img"),b=o.attrs.width;g.onload=function(){m=g.naturalWidth,p=g.naturalHeight,null===b?(h=m,f=p):(h=b,f=Math.round(p*(h/m))),[ff(ff({},o.attrs),{},{width:1}),o.attrs].forEach((function(t){setTimeout((function(){r.view.dispatch(r.view.state.tr.setNodeMarkup(i(),e.type,t))}),0)}))},g.src=c.src;var w=function(e,t){if("touch"===t){var n=e.originalEvent,r=e.touches||e.changedTouches||n.touches||n.changedTouches;if(!r)return{xPos:null,yPos:null};var o=r[0];return{xPos:o.pageX,yPos:o.pageY}}return{xPos:e.clientX,yPos:e.clientY}},k=function(e,t){var n=w(e,t).xPos,o=y-n;l.match(/-left$/)&&(o*=-1),(h=Math.round(v*(1-o/v)))<100?h=100:h>=m&&(h=m),f=Math.round(p*(h/m));var i=h;i>=m&&(i=null),r.commands.updateAttributes("image",{width:i})},x=function(e){return k(e,"mouse")},E=function(e){return k(e,"touch")},C=function(){l=y=null,document.removeEventListener("mousemove",x),document.removeEventListener("touchmove",E),document.removeEventListener("mouseup",C),document.removeEventListener("touchend",C)};a.querySelectorAll("[data-image-resizer-control]").forEach((function(e){var t=function(t,n){"mouse"===n&&0!==t.button||r.isEditable&&!l&&(document.addEventListener("mousemove",x),document.addEventListener("touchmove",E),document.addEventListener("mouseup",C),document.addEventListener("touchend",C),t.preventDefault(),l=e.dataset.imageResizerControl,v=r.getAttributes("image").width||m,y=w(t,n).xPos)};e.addEventListener("mousedown",(function(e){return t(e,"mouse")})),e.addEventListener("touchstart",(function(e){return t(e,"touch")}))}));var D=document.createElement("div");return D.dataset.imageResizer="",D.append(a),{dom:D,contentDOM:u,update:function(t){if(t.type!==e.type)return!1;var n=t.attrs,r=n.alt,o=n.src,i=n.title,a=n.width;return s.width.dataset.imageResizerDimensionValue=h,s.height.dataset.imageResizerDimensionValue=f,c.alt=r,d!==o&&(c.src=o,d=o),i?c.title=i:c.removeAttribute("title"),a?c.width=a:c.removeAttribute("width"),!0}}}};function pf(e){return pf="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},pf(e)}function mf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vf(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yf(Object(n),!0).forEach((function(t){bf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bf(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=pf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=pf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pf(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wf={role:"img","aria-hidden":"true"};function kf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=gf(gf({},wf),t),r={width:"0.75em",height:"0.75em"};Object.keys(n).forEach((function(e){var t=e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}));"undefined"===typeof r[e]?r[t]=n[e]:r[t]="".concat(r[t]," ").concat(n[e])}));var o=document.createElement("svg"),i=document.createElement("use"),a=document.createElement("title");return a.innerHTML=n.title||n.ariaLabel||e,i.setAttribute("href","".concat(window.Decidim.config.get("icons_path"),"#ri-").concat(e)),Object.entries(r).forEach((function(e){var t=mf(e,2),n=t[0],r=t[1];return o.setAttribute(n,r)})),o.appendChild(a),o.appendChild(i),o.outerHTML}function xf(e){return xf="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},xf(e)}function Ef(){Ef=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==xf(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(xf(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Cf(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sf(r.key),r)}}function Sf(e){var t=function(e,t){if("object"!=xf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=xf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xf(t)?t:t+""}var Of=function(){return e=function e(t,n){var r=this,o=n.i18n,i=n.onOpen,a=n.onClose;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.i18n=o,this.onOpen=i,this.onClose=a,this.values={src:null,alt:null},this.dropZoneEnabled=!0,this.exitMode="cancel";var s=null;this.messageSection=document.createElement("div"),this.currentFileSection=document.createElement("div"),this.inputSection=document.createElement("div"),this.saveButton=this.element.querySelector("button[data-dropzone-save]"),this.cancelButton=this.element.querySelector("button[data-dropzone-cancel]"),this.dropZone=this.element.querySelector("[data-dropzone]"),s=document.createElement("div"),this.dropZone.parentNode.insertBefore(s,this.dropZone.nextSibling),s.append(this.messageSection),s.append(this.currentFileSection),this.dropZone.parentNode.querySelector(".upload-modal__text").classList.add("mb-0"),this.dropZone.parentNode.append(this.inputSection),this.saveButton.addEventListener("click",(function(){r.exitMode="save"})),this.cancelButton.addEventListener("click",(function(){r.exitMode="cancel"})),this.dropZone.addEventListener("change",(function(e){e.preventDefault();var t=e.target.files;t.length<1||r.uploadFile(t[0])}));var u=function(e){e?(r.dropZone.classList.add("is-dragover"),r.dropZone.querySelectorAll(".upload-modal__dropzone").forEach((function(e){return e.classList.add("is-dragover")}))):(r.dropZone.classList.remove("is-dragover"),r.dropZone.querySelectorAll(".upload-modal__dropzone").forEach((function(e){return e.classList.remove("is-dragover")})))},c={dragenter:function(e){return e.preventDefault()},dragleave:function(){return u(!1)},dragover:function(e){e.preventDefault(),u(!0)},drop:function(e){e.preventDefault(),u(!1),r.messageSection.innerHTML="";var t=e.dataTransfer.files;t.length<1||r.uploadFile(t[0])}};Object.keys(c).forEach((function(e){r.dropZone.addEventListener(e,c[e])}));var l=function(){var e=r.inputSection.querySelector(".attachment-title");e&&(r.values.alt=e.value),r.onClose&&r.onClose(r),r.callback&&(r.callback(r.exitMode),r.callback=null)};this.element.addEventListener("close.dialog",(function(){return setTimeout(l,0)}))},t=[{key:"getValue",value:function(e){return this.values[e]}},{key:"toggle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.exitMode="cancel",new Promise((function(r){e.saveButton.disabled=!0,e.values={src:t.src,alt:t.alt},e.updateCurrentFile();var o=e.element.querySelector("[data-dialog-title]");t.src&&t.src.length>0?o.textContent=o.dataset.editlabel:o.textContent=o.dataset.addlabel;var i,a,s='\n        <form class="form-defaults form">\n          <label>\n            '.concat(n.inputLabel,'\n            <input class="attachment-title" type="text" name="alt">\n          </label>\n        </form>\n      '),u=null;i='<div class="form__wrapper">'.concat(s,"</div>"),(a=document.createElement("div")).innerHTML=i,(u=a.firstElementChild).querySelector(".attachment-title").value=t.alt||"",e.inputSection.innerHTML="",e.inputSection.append(u),e.uploadHandler=n.uploadHandler;var c=e.element.dataset.dialog,l=window.Decidim.currentDialogs[c];l?l.open():console.error("Upload dialog not initialized for: ".concat(c)),e.callback=r,e.onOpen&&e.onOpen(e)}))}},{key:"updateCurrentFile",value:function(e){var t=this.dropZone.querySelector("[data-dropzone-items]");if(!this.values.src||this.values.src.length<1)return t.setAttribute("hidden","hidden"),void(t.innerHTML="");this.saveButton.disabled=!1,e&&(t.removeAttribute("hidden"),t.innerHTML='\n        <li data-filename="'.concat(e.name,'" data-state="validated">\n          <div data-template="ok">\n            <div><img src="').concat(this.values.src,'" alt="').concat(this.i18n.uploadedFile,'"></div>\n            <span>').concat(e.name,"</span>\n          </div>\n        </li>\n      "))}},{key:"uploadFile",value:(r=Ef().mark((function e(t){var n,r,o,i;return Ef().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uploadHandler){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.uploadHandler(t);case 4:if((n=e.sent).url){e.next=11;break}return r=this.dropZone.querySelector("[data-dropzone-items]"),o=JSON.parse(r.dataset.locales),r.removeAttribute("hidden"),r.innerHTML='\n        <li data-filename="'.concat(t.name,'" data-state="validated">\n          <div data-template="error">\n            <div>').concat(kf("error-warning-line"),"</div>\n            <div>\n              <span>").concat(t.name,"</span>\n              <span>").concat(o.validation_error,"</span>\n              <ul><li>").concat(n.message,"</li></ul>\n            </div>\n          </div>\n        </li>\n      "),e.abrupt("return");case 11:this.values.src=n.url,(i=this.inputSection.querySelector(".attachment-title"))&&(!i.value||i.value.length<1)&&(i.value=uf(t.name)),this.updateCurrentFile(t);case 15:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function a(e){Cf(i,n,o,a,s,"next",e)}function s(e){Cf(i,n,o,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})}],t&&Df(e.prototype,t),n&&Df(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();function Af(e){return Af="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},Af(e)}function jf(){jf=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Af(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Af(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Tf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tf(Object(n),!0).forEach((function(t){Lf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lf(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Af(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Af(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Af(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pf(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Ff(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pf(i,r,o,a,s,"next",e)}function s(e){Pf(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Nf=function(){var e=Ff(jf().mark((function e(t,n){var r,o,i;return jf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=document.querySelector("meta[name='csrf-token']").getAttribute("content"),(o=new FormData).append("image",t),i=sf("editor.extensions.image"),e.abrupt("return",new Promise((function(e,a){fetch(n,{method:"POST",mode:"cors",cache:"no-cache",headers:{"X-CSRF-Token":r},body:o}).then((function(e){return e.ok?e.json():new Promise((function(e){return e({message:i.uploadError})}))})).then((function(n){return e(Mf({title:uf(t.name)},n))})).catch(a)})));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),_f=function(e,t){return Array.from(e).filter((function(e){return t instanceof RegExp?t.test(e.type):t instanceof Array?t.includes(e.type):t===e.type}))},Rf=Zl.extend({addOptions:function(){var e;return Mf(Mf({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{contentTypes:/^image\/(jpe?g|png|svg|webp)$/i,uploadImagesPath:null,uploadDialogSelector:null})},addAttributes:function(){var e;return Mf(Mf({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{width:{default:null}})},addCommands:function(){var e,t,n,r,o,i=this,a=sf("editor.extensions.image"),s=(t=this.editor,n=this.options,r=n.uploadDialogSelector,o=sf("editor.upload"),new Of(document.querySelector(r),{i18n:o,onOpen:function(){return t.commands.toggleDialog(!0)},onClose:function(){return t.chain().toggleDialog(!1).focus(null,{scrollIntoView:!1}).run()}}));return Mf(Mf({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{imageDialog:function(){return function(){var e=Ff(jf().mark((function e(t){var n,r,o,u,c;return jf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.dispatch){e.next=15;break}return n=i.editor.getAttributes("image"),r=n.src,o=n.alt,u=n.width,i.editor.commands.toggleDialog(!0),e.next=6,s.toggle({src:r,alt:o},{inputLabel:a.altLabel,uploadHandler:function(){var e=Ff(jf().mark((function e(t){return jf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Nf(t,i.options.uploadImagesPath));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 6:if(c=e.sent,i.editor.commands.toggleDialog(!1),"save"===c){e.next=11;break}return i.editor.commands.focus(null,{scrollIntoView:!1}),e.abrupt("return",!1);case 11:return s.getValue("src")!==r&&(u=null),r=s.getValue("src"),o=s.getValue("alt"),e.abrupt("return",i.editor.chain().setImage({src:r,alt:o,width:u}).focus(null,{scrollIntoView:!1}).run());case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}})},addNodeView:function(){return hf(this)},parseHTML:function(){return[{tag:"div[data-image] img[src]:not([src^='data:'])"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["div",{class:"editor-content-image","data-image":""},["img",Ja(this.options.HTMLAttributes,t)]]},addProseMirrorPlugins:function(){var e=this.editor,t=this.options,n=t.uploadImagesPath,r=t.contentTypes,o=function(t){t.forEach((function(t){t.url&&e.commands.setImage({src:t.url,alt:t.title})}))};return[new rn({props:{handlePaste:function(e,t){var i=(t.clipboardData||t.originalEvent.clipboardData).items,a=_f(i,r);return!(a.length<1)&&(Promise.all(a.map((function(e){return Nf(e.getAsFile(),n)}))).then((function(e){o(e)})),!0)},handleDoubleClick:function(){return!!e.isActive("image")&&(e.chain().focus().imageDialog().run(),!0)},handleDOMEvents:{drop:function(t,i){var a,s=t.posAtCoords({left:i.clientX,top:i.clientY}),u=null===i||void 0===i||null===(a=i.dataTransfer)||void 0===a?void 0:a.files;if(u&&!(u.length<1)){var c=_f(u,r);c.length<1||(i.preventDefault(),e.chain().focus().setTextSelection(s.pos).run(),Promise.all(c.map((function(e){return Nf(e,n)}))).then((function(e){o(e)})))}}}}})]}}),Bf=["heading","paragraph"],If=ys.create({name:"indent",addOptions:function(){return{minIndentLevel:0,maxIndentLevel:10,HTMLAttributes:{}}},addGlobalAttributes:function(){return[{types:Bf,attributes:{indent:{default:0,renderHTML:function(e){return e.indent<1?{}:{class:"editor-indent-".concat(e.indent)}},parseHTML:function(e){var t=/^(editor|ql)-indent-([0-9]+)/,n=Array.from(e.classList).find((function(e){return t.test(e)}));return n?parseInt(n.match(t)[2],10):0}}}}]},addCommands:function(){var e=this,t=function(t,n){var r=n.editor,o=n.state,i=n.dispatch,a=n.commands;if(!function(e){return Bf.some((function(t){return e.isActive(t)}))}(r))return!1;var s=function(e){for(var t,n=e.depth,r=function(){var t=e.node(n);if(Bf.some((function(e){return t.type.name===e})))return{v:t};n-=1};n>0;)if(t=r())return t.v;return null}(o.selection.$head);if(null===s)return!1;var u=s.attrs.indent+t;return!(u<e.options.minIndentLevel||u>e.options.maxIndentLevel)&&(!i||a.updateAttributes(s.type.name,{indent:u}))};return{indent:function(){return function(e){var n=e.editor,r=e.state,o=e.commands,i=e.dispatch;return n.isActive("listItem")?!i||o.sinkListItem("listItem"):t(1,{editor:n,state:r,dispatch:i,commands:o})}},outdent:function(){return function(e){var n=e.editor,r=e.state,o=e.commands,i=e.dispatch;return n.isActive("listItem")?3!==r.selection.$head.depth&&(!i||o.liftListItem("listItem")):t(-1,{editor:n,state:r,dispatch:i,commands:o})}}}},addKeyboardShortcuts:function(){var e=this,t=function(){return!!e.editor.can().indent()&&e.editor.commands.indent()},n=function(){return!!e.editor.can().outdent()&&e.editor.commands.outdent()};return{Tab:t,"Shift-Tab":n,Backspace:function(){return!e.editor.isActive("listItem")&&(!(e.editor.state.selection.$head.parentOffset>0)&&n())},"Mod-]":t,"Mod-[":n}}});function zf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Hf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hf(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jf(r.key),r)}}function $f(e,t,n){return t=Uf(t),function(e,t){if(t&&("object"==Kf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qf()?Reflect.construct(t,n||[],Uf(e).constructor):t.apply(e,n))}function qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qf=function(){return!!e})()}function Uf(e){return Uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uf(e)}function Wf(e,t){return Wf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wf(e,t)}function Kf(e){return Kf="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},Kf(e)}function Gf(e,t,n){return(t=Jf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jf(e){var t=function(e,t){if("object"!=Kf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Kf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kf(t)?t:t+""}var Yf="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Qf="\u03b5\u03bb1\u03c52\u0431\u04331\u0435\u043b3\u0434\u0435\u0442\u04384\u0435\u044e2\u043a\u0430\u0442\u043e\u043b\u0438\u043a6\u043e\u043c3\u043c\u043a\u04342\u043e\u043d1\u0441\u043a\u0432\u04306\u043e\u043d\u043b\u0430\u0439\u043d5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043a\u04403\u049b\u0430\u04373\u0570\u0561\u05753\u05d9\u05e9\u05e8\u05d0\u05dc5\u05e7\u05d5\u05dd3\u0627\u0628\u0648\u0638\u0628\u064a5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062f\u06464\u0628\u062d\u0631\u064a\u06465\u062c\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062f\u064a\u06296\u0639\u0644\u064a\u0627\u06465\u0645\u063a\u0631\u06285\u0645\u0627\u0631\u0627\u062a5\u06cc\u0631\u0627\u06465\u0628\u0627\u0631\u062a2\u0632\u0627\u06314\u064a\u062a\u06433\u06be\u0627\u0631\u062a5\u062a\u0648\u0646\u06334\u0633\u0648\u062f\u0627\u06463\u0631\u064a\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064a\u06466\u0642\u0637\u06313\u0643\u0627\u062b\u0648\u0644\u064a\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064a\u0633\u064a\u06275\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067e\u0627\u06a9\u0633\u062a\u0627\u06467\u0680\u0627\u0631\u062a4\u0915\u0949\u092e3\u0928\u0947\u091f3\u092d\u093e\u0930\u09240\u092e\u094d3\u094b\u09245\u0938\u0902\u0917\u0920\u09285\u09ac\u09be\u0982\u09b2\u09be5\u09ad\u09be\u09b0\u09a42\u09f0\u09a44\u0a2d\u0a3e\u0a30\u0a244\u0aad\u0abe\u0ab0\u0aa44\u0b2d\u0b3e\u0b30\u0b244\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe6\u0bb2\u0b99\u0bcd\u0b95\u0bc86\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd11\u0c2d\u0c3e\u0c30\u0c24\u0c4d5\u0cad\u0cbe\u0cb0\u0ca44\u0d2d\u0d3e\u0d30\u0d24\u0d025\u0dbd\u0d82\u0d9a\u0dcf4\u0e04\u0e2d\u0e213\u0e44\u0e17\u0e223\u0ea5\u0eb2\u0ea73\u10d2\u10d42\u307f\u3093\u306a3\u30a2\u30de\u30be\u30f34\u30af\u30e9\u30a6\u30c94\u30b0\u30fc\u30b0\u30eb4\u30b3\u30e02\u30b9\u30c8\u30a23\u30bb\u30fc\u30eb3\u30d5\u30a1\u30c3\u30b7\u30e7\u30f36\u30dd\u30a4\u30f3\u30c84\u4e16\u754c2\u4e2d\u4fe11\u56fd1\u570b1\u6587\u7f513\u4e9a\u9a6c\u900a3\u4f01\u4e1a2\u4f5b\u5c712\u4fe1\u606f2\u5065\u5eb72\u516b\u53662\u516c\u53f81\u76ca2\u53f0\u6e7e1\u70632\u5546\u57ce1\u5e971\u68072\u5609\u91cc0\u5927\u9152\u5e975\u5728\u7ebf2\u5927\u62ff2\u5929\u4e3b\u65593\u5a31\u4e502\u5bb6\u96fb2\u5e7f\u4e1c2\u5fae\u535a2\u6148\u55842\u6211\u7231\u4f603\u624b\u673a2\u62db\u80582\u653f\u52a11\u5e9c2\u65b0\u52a0\u57612\u95fb2\u65f6\u5c1a2\u66f8\u7c4d2\u673a\u67842\u6de1\u9a6c\u95213\u6e38\u620f2\u6fb3\u95802\u70b9\u770b2\u79fb\u52a82\u7ec4\u7ec7\u673a\u67844\u7f51\u57401\u5e971\u7ad91\u7edc2\u8054\u901a2\u8c37\u6b4c2\u8d2d\u72692\u901a\u8ca92\u96c6\u56e22\u96fb\u8a0a\u76c8\u79d14\u98de\u5229\u6d663\u98df\u54c12\u9910\u53852\u9999\u683c\u91cc\u62c93\u6e2f2\ub2f7\ub1371\ucef42\uc0bc\uc1312\ud55c\uad6d2",Xf=function(e,t){for(var n in t)e[n]=t[n];return e},Zf="numeric",ed="ascii",td="alpha",nd="asciinumeric",rd="alphanumeric",od="domain",id="emoji",ad="scheme",sd="slashscheme",ud="whitespace";function cd(e,t){return e in t||(t[e]=[]),t[e]}function ld(e,t,n){for(var r in t[Zf]&&(t[nd]=!0,t[rd]=!0),t[ed]&&(t[nd]=!0,t[td]=!0),t[nd]&&(t[rd]=!0),t[td]&&(t[rd]=!0),t[rd]&&(t[od]=!0),t[id]&&(t[od]=!0),t){var o=cd(r,n);o.indexOf(e)<0&&o.push(e)}}function fd(e){void 0===e&&(e=null),this.j={},this.jr=[],this.jd=null,this.t=e}fd.groups={},fd.prototype={accepts:function(){return!!this.t},go:function(e){var t=this,n=t.j[e];if(n)return n;for(var r=0;r<t.jr.length;r++){var o=t.jr[r][0],i=t.jr[r][1];if(i&&o.test(e))return i}return t.jd},has:function(e,t){return void 0===t&&(t=!1),t?e in this.j:!!this.go(e)},ta:function(e,t,n,r){for(var o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr:function(e,t,n,r){var o;return r=r||fd.groups,t&&t.j?o=t:(o=new fd(t),n&&r&&ld(t,n,r)),this.jr.push([e,o]),o},ts:function(e,t,n,r){var o=this,i=e.length;if(!i)return o;for(var a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt:function(e,t,n,r){r=r||fd.groups;var o=this;if(t&&t.j)return o.j[e]=t,t;var i,a=t,s=o.go(e);if(s?(i=new fd,Xf(i.j,s.j),i.jr.push.apply(i.jr,s.jr),i.jd=s.jd,i.t=s.t):i=new fd,a){if(r)if(i.t&&"string"===typeof i.t){var u=Xf(function(e,t){var n={};for(var r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n);ld(a,u,r)}else n&&ld(a,n,r);i.t=a}return o.j[e]=i,i}};var dd=function(e,t,n,r,o){return e.ta(t,n,r,o)},hd=function(e,t,n,r,o){return e.tr(t,n,r,o)},pd=function(e,t,n,r,o){return e.ts(t,n,r,o)},md=function(e,t,n,r,o){return e.tt(t,n,r,o)},vd="WORD",yd="UWORD",gd="LOCALHOST",bd="TLD",wd="UTLD",kd="SCHEME",xd="SLASH_SCHEME",Ed="NUM",Cd="WS",Dd="NL",Sd="OPENBRACE",Od="CLOSEBRACE",Ad="OPENBRACKET",jd="CLOSEBRACKET",Td="OPENPAREN",Md="CLOSEPAREN",Ld="OPENANGLEBRACKET",Pd="CLOSEANGLEBRACKET",Fd="FULLWIDTHLEFTPAREN",Nd="FULLWIDTHRIGHTPAREN",_d="LEFTCORNERBRACKET",Rd="RIGHTCORNERBRACKET",Bd="LEFTWHITECORNERBRACKET",Id="RIGHTWHITECORNERBRACKET",zd="FULLWIDTHLESSTHAN",Hd="FULLWIDTHGREATERTHAN",Vd="AMPERSAND",$d="APOSTROPHE",qd="ASTERISK",Ud="AT",Wd="BACKSLASH",Kd="BACKTICK",Gd="CARET",Jd="COLON",Yd="COMMA",Qd="DOLLAR",Xd="DOT",Zd="EQUALS",eh="EXCLAMATION",th="HYPHEN",nh="PERCENT",rh="PIPE",oh="PLUS",ih="POUND",ah="QUERY",sh="QUOTE",uh="SEMI",ch="SLASH",lh="TILDE",fh="UNDERSCORE",dh="EMOJI",hh="SYM",ph=Object.freeze({__proto__:null,WORD:vd,UWORD:yd,LOCALHOST:gd,TLD:bd,UTLD:wd,SCHEME:kd,SLASH_SCHEME:xd,NUM:Ed,WS:Cd,NL:Dd,OPENBRACE:Sd,CLOSEBRACE:Od,OPENBRACKET:Ad,CLOSEBRACKET:jd,OPENPAREN:Td,CLOSEPAREN:Md,OPENANGLEBRACKET:Ld,CLOSEANGLEBRACKET:Pd,FULLWIDTHLEFTPAREN:Fd,FULLWIDTHRIGHTPAREN:Nd,LEFTCORNERBRACKET:_d,RIGHTCORNERBRACKET:Rd,LEFTWHITECORNERBRACKET:Bd,RIGHTWHITECORNERBRACKET:Id,FULLWIDTHLESSTHAN:zd,FULLWIDTHGREATERTHAN:Hd,AMPERSAND:Vd,APOSTROPHE:$d,ASTERISK:qd,AT:Ud,BACKSLASH:Wd,BACKTICK:Kd,CARET:Gd,COLON:Jd,COMMA:Yd,DOLLAR:Qd,DOT:Xd,EQUALS:Zd,EXCLAMATION:eh,HYPHEN:th,PERCENT:nh,PIPE:rh,PLUS:oh,POUND:ih,QUERY:ah,QUOTE:sh,SEMI:uh,SLASH:ch,TILDE:lh,UNDERSCORE:fh,EMOJI:dh,SYM:hh}),mh=/[a-z]/,vh=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/,yh=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDC-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9\uDEF0-\uDEF8])/,gh=/\d/,bh=/\s/,wh="\n",kh="\ufe0f",xh="\u200d",Eh=null,Ch=null;function Dh(e,t,n,r,o){for(var i,a=t.length,s=0;s<a-1;s++){var u=t[s];e.j[u]?i=e.j[u]:((i=new fd(r)).jr=o.slice(),e.j[u]=i),e=i}return(i=new fd(n)).jr=o.slice(),e.j[t[a-1]]=i,i}function Sh(e){for(var t=[],n=[],r=0;r<e.length;){for(var o=0;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(var i=parseInt(e.substring(r,r+o),10);i>0;i--)n.pop();r+=o}else n.push(e[r]),r++}return t}var Oh={defaultProtocol:"http",events:null,format:jh,formatHref:jh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ah(e,t){void 0===t&&(t=null);var n=Xf({},Oh);e&&(n=Xf(n,e instanceof Ah?e.o:e));for(var r=n.ignoreTags,o=[],i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function jh(e){return e}Ah.prototype={o:Oh,ignoreTags:[],defaultRender:function(e){return e},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var r=null!=t,o=this.o[e];return o?("object"===Kf(o)?"function"===typeof(o=n.t in o?o[n.t]:Oh[e])&&r&&(o=o(t,n)):"function"===typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj:function(e,t,n){var r=this.o[e];return"function"===typeof r&&null!=t&&(r=r(t,n.t,n)),r},render:function(e){var t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function Th(e,t){this.t="token",this.v=e,this.tk=t}function Mh(e,t){var n=function(t){function n(t,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(o=$f(this,n,[t,r])).t=e,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wf(e,t)}(n,t),r=n,o&&Vf(r.prototype,o),i&&Vf(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o,i}(Th);for(var r in t)n.prototype[r]=t[r];return n.t=e,n}Th.prototype={isLink:!1,toString:function(){return this.v},toHref:function(e){return this.toString()},toFormattedString:function(e){var t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref:function(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(e){return void 0===e&&(e=Oh.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject:function(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate:function(e){return e.get("validate",this.toString(),this)},render:function(e){var t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),a={},s=e.get("className",n,t),u=e.get("target",n,t),c=e.get("rel",n,t),l=e.getObj("attributes",n,t),f=e.getObj("events",n,t);return a.href=r,s&&(a.class=s),u&&(a.target=u),c&&(a.rel=c),l&&Xf(a,l),{tagName:o,attributes:a,content:i,eventListeners:f}}};var Lh=Mh("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Ph=Mh("text"),Fh=Mh("nl"),Nh=Mh("url",{isLink:!0,toHref:function(e){return void 0===e&&(e=Oh.defaultProtocol),this.hasProtocol()?this.v:"".concat(e,"://").concat(this.v)},hasProtocol:function(){var e=this.tk;return e.length>=2&&e[0].t!==gd&&e[1].t===Jd}}),_h=function(e){return new fd(e)};function Rh(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}var Bh="undefined"!==typeof console&&console&&console.warn||function(){},Ih="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",zh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Hh(e,t){if(void 0===t&&(t=!1),zh.initialized&&Bh('linkifyjs: already initialized - will not register custom scheme "'.concat(e,'" ').concat(Ih)),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');zh.customSchemes.push([e,t])}function Vh(){zh.scanner=function(e){void 0===e&&(e=[]);var t={};fd.groups=t;var n=new fd;null==Eh&&(Eh=Sh(Yf)),null==Ch&&(Ch=Sh(Qf)),md(n,"'",$d),md(n,"{",Sd),md(n,"}",Od),md(n,"[",Ad),md(n,"]",jd),md(n,"(",Td),md(n,")",Md),md(n,"<",Ld),md(n,">",Pd),md(n,"\uff08",Fd),md(n,"\uff09",Nd),md(n,"\u300c",_d),md(n,"\u300d",Rd),md(n,"\u300e",Bd),md(n,"\u300f",Id),md(n,"\uff1c",zd),md(n,"\uff1e",Hd),md(n,"&",Vd),md(n,"*",qd),md(n,"@",Ud),md(n,"`",Kd),md(n,"^",Gd),md(n,":",Jd),md(n,",",Yd),md(n,"$",Qd),md(n,".",Xd),md(n,"=",Zd),md(n,"!",eh),md(n,"-",th),md(n,"%",nh),md(n,"|",rh),md(n,"+",oh),md(n,"#",ih),md(n,"?",ah),md(n,'"',sh),md(n,"/",ch),md(n,";",uh),md(n,"~",lh),md(n,"_",fh),md(n,"\\",Wd);var r=hd(n,gh,Ed,Gf({},Zf,!0));hd(r,gh,r);var o=hd(n,mh,vd,Gf({},ed,!0));hd(o,mh,o);var i=hd(n,vh,yd,Gf({},td,!0));hd(i,mh),hd(i,vh,i);var a=hd(n,bh,Cd,Gf({},ud,!0));md(n,wh,Dd,Gf({},ud,!0)),md(a,wh),hd(a,bh,a);var s=hd(n,yh,dh,Gf({},id,!0));hd(s,yh,s),md(s,kh,s);var u=md(s,xh);hd(u,yh,s);for(var c=[[mh,o]],l=[[mh,null],[vh,i]],f=0;f<Eh.length;f++)Dh(n,Eh[f],bd,vd,c);for(var d=0;d<Ch.length;d++)Dh(n,Ch[d],wd,yd,l);ld(bd,{tld:!0,ascii:!0},t),ld(wd,{utld:!0,alpha:!0},t),Dh(n,"file",kd,vd,c),Dh(n,"mailto",kd,vd,c),Dh(n,"http",xd,vd,c),Dh(n,"https",xd,vd,c),Dh(n,"ftp",xd,vd,c),Dh(n,"ftps",xd,vd,c),ld(kd,{scheme:!0,ascii:!0},t),ld(xd,{slashscheme:!0,ascii:!0},t),e=e.sort((function(e,t){return e[0]>t[0]?1:-1}));for(var h=0;h<e.length;h++){var p=e[h][0],m=Gf({},e[h][1]?ad:sd,!0);p.indexOf("-")>=0?m[od]=!0:mh.test(p)?gh.test(p)?m[nd]=!0:m[ed]=!0:m[Zf]=!0,pd(n,p,p,m)}return pd(n,"localhost",gd,{ascii:!0}),n.jd=new fd(hh),{start:n,tokens:Xf({groups:t},ph)}}(zh.customSchemes);for(var e=0;e<zh.tokenQueue.length;e++)zh.tokenQueue[e][1]({scanner:zh.scanner});zh.parser=function(e){var t=e.groups,n=t.domain.concat([Vd,qd,Ud,Wd,Kd,Gd,Qd,Zd,th,Ed,nh,rh,oh,ih,ch,hh,lh,fh]),r=[$d,Jd,Yd,Xd,eh,ah,sh,uh,Ld,Pd,Sd,Od,jd,Ad,Td,Md,Fd,Nd,_d,Rd,Bd,Id,zd,Hd],o=[Vd,$d,qd,Wd,Kd,Gd,Qd,Zd,th,Sd,Od,nh,rh,oh,ih,ah,ch,hh,lh,fh],i=_h(),a=md(i,lh);dd(a,o,a),dd(a,t.domain,a);var s=_h(),u=_h(),c=_h();dd(i,t.domain,s),dd(i,t.scheme,u),dd(i,t.slashscheme,c),dd(s,o,a),dd(s,t.domain,s);var l=md(s,Ud);md(a,Ud,l),md(u,Ud,l),md(c,Ud,l);var f=md(a,Xd);dd(f,o,a),dd(f,t.domain,a);var d=_h();dd(l,t.domain,d),dd(d,t.domain,d);var h=md(d,Xd);dd(h,t.domain,d);var p=_h(Lh);dd(h,t.tld,p),dd(h,t.utld,p),md(l,gd,p);var m=md(d,th);dd(m,t.domain,d),dd(p,t.domain,d),md(p,Xd,h),md(p,th,m);var v=md(p,Jd);dd(v,t.numeric,Lh);var y=md(s,th),g=md(s,Xd);dd(y,t.domain,s),dd(g,o,a),dd(g,t.domain,s);var b=_h(Nh);dd(g,t.tld,b),dd(g,t.utld,b),dd(b,t.domain,s),dd(b,o,a),md(b,Xd,g),md(b,th,y),md(b,Ud,l);var w=md(b,Jd),k=_h(Nh);dd(w,t.numeric,k);var x=_h(Nh),E=_h();dd(x,n,x),dd(x,r,E),dd(E,n,x),dd(E,r,E),md(b,ch,x),md(k,ch,x);var C=md(u,Jd),D=md(c,Jd),S=md(D,ch),O=md(S,ch);dd(u,t.domain,s),md(u,Xd,g),md(u,th,y),dd(c,t.domain,s),md(c,Xd,g),md(c,th,y),dd(C,t.domain,x),md(C,ch,x),dd(O,t.domain,x),dd(O,n,x),md(O,ch,x);for(var A=[[Sd,Od],[Ad,jd],[Td,Md],[Ld,Pd],[Fd,Nd],[_d,Rd],[Bd,Id],[zd,Hd]],j=0;j<A.length;j++){var T=zf(A[j],2),M=T[0],L=T[1],P=md(x,M);md(E,M,P),md(P,L,x);var F=_h(Nh);dd(P,n,F);var N=_h();dd(P,r),dd(F,n,F),dd(F,r,N),dd(N,n,F),dd(N,r,N),md(F,L,x),md(N,L,x)}return md(i,gd,b),md(i,Dd,Fh),{start:i,tokens:ph}}(zh.scanner.tokens);for(var t=0;t<zh.pluginQueue.length;t++)zh.pluginQueue[t][1]({scanner:zh.scanner,parser:zh.parser});zh.initialized=!0}function $h(e){return zh.initialized||Vh(),function(e,t,n){for(var r=n.length,o=0,i=[],a=[];o<r;){for(var s=e,u=null,c=null,l=0,f=null,d=-1;o<r&&!(u=s.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=u||s.go(n[o].t));)u=null,(s=c).accepts()?(d=0,f=s):d>=0&&d++,o++,l++;if(d<0)(o-=l)<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(Rh(Ph,t,a)),a=[]),o-=d,l-=d;var h=f.t,p=n.slice(o-l,o);i.push(Rh(h,t,p))}}return a.length>0&&i.push(Rh(Ph,t,a)),i}(zh.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var o=e.charCodeAt(r),i=void 0,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a<r;){for(var s=e,u=null,c=0,l=null,f=-1,d=-1;a<r&&(u=s.go(n[a]));)(s=u).accepts()?(f=0,d=0,l=s):f>=0&&(f+=n[a].length,d++),c+=n[a].length,i+=n[a].length,a++;i-=f,a-=d,c-=f,o.push({t:l.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}(zh.scanner.start,e))}function qh(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n=null),t&&"object"===Kf(t)){if(n)throw Error("linkifyjs: Invalid link type ".concat(t,"; must be a string"));n=t,t=null}for(var r=new Ah(n),o=$h(e),i=[],a=0;a<o.length;a++){var s=o[a];!s.isLink||t&&s.t!==t||!r.check(s)||i.push(s.toFormattedObject(r))}return i}function Uh(e){return Uh="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},Uh(e)}function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(n),!0).forEach((function(t){Gh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Uh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Uh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uh(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jh(e){return function(e){if(Array.isArray(e))return Yh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Yh(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yh(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qh(e){return new rn({key:new sn("autolink"),appendTransaction:function(t,n,r){var o=t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc),i=t.some((function(e){return e.getMeta("preventAutolink")}));if(o&&!i){var a=r.tr,s=function(e,t){var n=new Ct(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,Jh(t)),u=function(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach((function(e,o){var i=[];if(e.ranges.length)e.forEach((function(e,t){i.push({from:e,to:t})}));else{var a=n[o],s=a.from,u=a.to;if(void 0===s||void 0===u)return;i.push({from:s,to:u})}i.forEach((function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),s=t.slice(o).map(i),u=t.invert().map(a,-1),c=t.invert().map(s);r.push({oldRange:{from:u,to:c},newRange:{from:a,to:s}})}))})),Vs(r)}(s);if(u.forEach((function(t){var n,o,i,s,u,c,l=t.newRange,f=(n=r.doc,o=l,i=function(e){return e.isTextblock},s=[],n.nodesBetween(o.from,o.to,(function(e,t){i(e)&&s.push({node:e,pos:t})})),s);if(f.length>1?(u=f[0],c=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(l.from,l.to," "," ").endsWith(" ")&&(u=f[0],c=r.doc.textBetween(u.pos,l.to,void 0," ")),u&&c){var d=c.split(" ").filter((function(e){return""!==e}));if(d.length<=0)return!1;var h=d[d.length-1],p=u.pos+c.lastIndexOf(h);if(!h)return!1;qh(h).filter((function(e){return e.isLink})).map((function(e){return Kh(Kh({},e),{},{from:p+e.start+1,to:p+e.end+1})})).filter((function(e){return!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)})).filter((function(t){return!e.validate||e.validate(t.value)})).forEach((function(t){$s(t.from,t.to,r.doc).some((function(t){return t.mark.type===e.type}))||a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),a.steps.length)return a}}})}var Xh=uu.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach((function(e){"string"!==typeof e?Hh(e.scheme,e.optionalSlashes):Hh(e)}))},onDestroy:function(){fd.groups={},zh.scanner=null,zh.parser=null,zh.tokenQueue=[],zh.pluginQueue=[],zh.customSchemes=[],zh.initialized=!1},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML:function(e){var t,n=e.HTMLAttributes;return(null===(t=n.href)||void 0===t?void 0:t.startsWith("javascript:"))?["a",Ja(this.options.HTMLAttributes,Kh(Kh({},n),{},{href:""})),0]:["a",Ja(this.options.HTMLAttributes,n),0]},addCommands:function(){var e=this;return{setLink:function(t){return function(n){return(0,n.chain)().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){return(0,n.chain)().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){return(0,t.chain)().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e=this;return[lu({find:function(t){return qh(t).filter((function(t){return!e.options.validate||e.options.validate(t.value)})).filter((function(e){return e.isLink})).map((function(e){return{text:e.value,index:e.start,data:e}}))},type:this.type,getAttributes:function(e,t){var n,r,o=null===(n=null===t||void 0===t?void 0:t.clipboardData)||void 0===n?void 0:n.getData("text/html"),i=null===o||void 0===o?void 0:o.match(/href="([^"]*)"/);return i?{href:i[1]}:{href:null===(r=e.data)||void 0===r?void 0:r.href}}})]},addProseMirrorPlugins:function(){var e=[];return this.options.autolink&&e.push(Qh({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push(function(e){return new rn({key:new sn("handleClickLink"),props:{handleClick:function(t,n,r){var o,i;if(0!==r.button)return!1;if("A"!==r.target.nodeName)return!1;var a=Hs(t.state,e.type.name),s=r.target,u=null!==(o=null===s||void 0===s?void 0:s.href)&&void 0!==o?o:a.href,c=null!==(i=null===s||void 0===s?void 0:s.target)&&void 0!==i?i:a.target;return!(!s||!u)&&(t.editable&&window.open(u,c),!0)}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new rn({key:new sn("handlePasteLink"),props:{handlePaste:function(t,n,r){var o;if(t.state.selection.empty)return!1;var i="";r.content.forEach((function(e){i+=e.textContent}));var a=qh(i).find((function(e){return e.isLink&&e.value===i}));if(!i||!a)return!1;var s=null===(o=n.clipboardData)||void 0===o?void 0:o.getData("text/html"),u=null===s||void 0===s?void 0:s.match(/href="([^"]*)"/),c=u?u[1]:a.href;return e.editor.commands.setMark(e.type,{href:c}),!0}}})}({editor:this.editor,type:this.type})),e}});function Zh(e){return Zh="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},Zh(e)}function ep(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tp(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function np(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rp(r.key),r)}}function rp(e){var t=function(e,t){if("object"!=Zh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Zh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zh(t)?t:t+""}var op={documentSelector:".js-document",documentDisabledClass:"is-disabled",openingTriggerActiveClass:"is-active",delay:200},ip=['[href]:not([tabindex^="-"])','input:not([disabled]):not([type="hidden"]):not([tabindex^="-"]):not([type="radio"])','input[type="radio"]:checked','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])','[contenteditable="true"]:not([tabindex^="-"])'],ap="Escape",sp="Tab",up="F6";function cp(e,t){for(var n=e;n!==t&&n;)n=n.parentNode;return!!n}var lp=Symbol("onClick"),fp=Symbol("onKeydown"),dp=Symbol("addEventDelegation"),hp=Symbol("addEventListeners"),pp=Symbol("removeEventListeners"),mp=Symbol("addAttributes"),vp=Symbol("removeAttributes"),yp=Symbol("setAttributes"),gp=Symbol("setFocusableElements"),bp=Symbol("setFocus"),wp=Symbol("restoreFocus"),kp=Symbol("switchFocus"),xp=Symbol("maintainFocus"),Ep=Symbol("addObserver"),Cp=Symbol("removeObserver"),Dp=op;var Sp=function(){return e=function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.onOpen,i=void 0===o?function(){}:o,a=r.onClose,s=void 0===a?function(){}:a,u=r.openingSelector,c=r.closingSelector,l=r.backdropSelector,f=r.helperSelector,d=r.labelledby,h=r.describedby,p=r.isModal,m=void 0===p||p,v=r.isTooltip,y=void 0!==v&&v,g=r.isOpen,b=void 0!==g&&g,w=r.isCreated,k=void 0===w||w,x=r.disableScroll,E=void 0===x||x,C=r.enableAutoFocus,D=void 0===C||C,S=r.openingTriggerActiveClass,O=void 0===S?Dp.openingTriggerActiveClass:S,A=r.delay,j=void 0===A?Dp.delay:A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),document.querySelector(t)?(this.config={dialogSelector:t,onOpen:i,onClose:s,openingSelector:u,closingSelector:c,backdropSelector:l,helperSelector:f,labelledby:d,describedby:h,isModal:m,isTooltip:y,isCreated:k,isOpen:b,disableScroll:E,enableAutoFocus:D,documentSelector:Dp.documentSelector,documentDisabledClass:Dp.documentDisabledClass,openingTriggerActiveClass:O,delay:j},this.dialog=document.querySelector(t),this.dialogArea="".concat(t,", ").concat(u),this.openingTriggers=document.querySelectorAll(u),this.backdropTrigger=document.querySelector(l),this.helpers=document.querySelectorAll(f),this.document=document.querySelector(this.config.documentSelector)||document.querySelector("html"),this.documentIsAlreadyDisabled=!1,this.focusableElements=[],this.firstFocusableElement=null,this.lastFocusableElement=null,this.openingTrigger=null,this.closingTrigger=null,this.isCreated=!1,this.isOpen=!1,this.close=this.close.bind(this),this.toggle=this.toggle.bind(this),this[lp]=this[lp].bind(this),this[fp]=this[fp].bind(this),this[dp]=this[dp].bind(this),this[kp]=this[kp].bind(this),this.observer=new MutationObserver((function(e){return e.forEach((function(){return n[gp]()}))})),this.isInitialized=!0,k&&this.create()):this.isInitialized=!1},(t=[{key:lp,value:function(e){this.config.isTooltip&&!e.target.closest(this.dialogArea)&&this.close(e),e.target===this.backdropTrigger&&this.close(e)}},{key:fp,value:function(e){switch(e.key){case ap:e.stopPropagation(),this.close(e);break;case up:this.config.isModal||(this.config.isTooltip?this.close(e):this[wp]());break;case sp:this[xp](e)}}},{key:dp,value:function(e){var t=this;document.querySelectorAll(this.config.openingSelector).forEach((function(n){cp(e.target,n)&&(t.openingTrigger=n,t.toggle(e))})),document.querySelectorAll(this.config.closingSelector).forEach((function(n){cp(e.target,n)&&(t.closingTrigger=n,t.close())}))}},{key:hp,value:function(){document.addEventListener("click",this[lp],{capture:!0}),this.dialog.addEventListener("keydown",this[fp])}},{key:pp,value:function(){document.removeEventListener("click",this[lp],{capture:!0}),this.dialog.removeEventListener("keydown",this[fp]),this.openingTrigger&&this.openingTrigger.removeEventListener("keydown",this[kp])}},{key:mp,value:function(){this.dialog.setAttribute("role","dialog"),this.dialog.setAttribute("tabindex",-1),this.dialog.setAttribute("aria-hidden",!0),this.config.labelledby&&this.dialog.setAttribute("aria-labelledby",this.config.labelledby),this.config.describedby&&this.dialog.setAttribute("aria-describedby",this.config.describedby),this.config.isModal&&this.dialog.setAttribute("aria-modal",!0),this.openingTriggers.forEach((function(e){return e.setAttribute("aria-haspopup","dialog")}))}},{key:vp,value:function(){var e=this;this.dialog.removeAttribute("role"),this.dialog.removeAttribute("tabindex"),this.dialog.removeAttribute("aria-hidden"),this.dialog.removeAttribute("aria-labelledby"),this.dialog.removeAttribute("aria-describedby"),this.dialog.removeAttribute("aria-modal"),this.config.disableScroll&&this.isOpen&&!this.documentIsAlreadyDisabled&&this.document.classList.remove(this.config.documentDisabledClass),this.openingTriggers.forEach((function(e){return e.removeAttribute("aria-haspopup")})),this.openingTrigger&&this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass),this.helpers.forEach((function(t){return t.classList.remove(e.config.openingTriggerActiveClass)}))}},{key:yp,value:function(){var e=this;this.dialog.setAttribute("aria-hidden",!this.isOpen),this.config.disableScroll&&!this.documentIsAlreadyDisabled&&(this.isOpen?this.document.classList.add(this.config.documentDisabledClass):this.document.classList.remove(this.config.documentDisabledClass)),this.openingTrigger&&(this.isOpen?this.openingTrigger.classList.add(this.config.openingTriggerActiveClass):this.openingTrigger.classList.remove(this.config.openingTriggerActiveClass)),this.helpers.forEach((function(t){e.isOpen?t.classList.add(e.config.openingTriggerActiveClass):t.classList.remove(e.config.openingTriggerActiveClass)}))}},{key:gp,value:function(){var e,t,n=(e=this.dialog.querySelectorAll(ip),t=[],e.forEach((function(e){var n=e.getBoundingClientRect();(n.width>0||n.height>0)&&t.push(e)})),t),r=function(e,t,n){var r=e.querySelectorAll(t),o=[],i=!1;return 0===r.length?n:(n.forEach((function(e){r.forEach((function(t){t.contains(e)&&(i=!0)})),i||o.push(e),i=!1})),o)}(this.dialog,'[role="dialog"]',n);this.focusableElements=r.length>0?r:[this.dialog];var o=ep(this.focusableElements,1);this.firstFocusableElement=o[0],this.lastFocusableElement=this.focusableElements[this.focusableElements.length-1]}},{key:bp,value:function(){var e=this;this.config.enableAutoFocus&&window.setTimeout((function(){return e.firstFocusableElement.focus()}),this.config.delay)}},{key:wp,value:function(){var e=this;this.config.enableAutoFocus&&window.setTimeout((function(){return e.openingTrigger.focus()}),this.config.delay),this.isOpen&&this.openingTrigger.addEventListener("keydown",this[kp])}},{key:kp,value:function(e){e.key===up&&(this.openingTrigger.removeEventListener("keydown",this[kp]),this[bp]())}},{key:xp,value:function(e){e.shiftKey&&e.target===this.firstFocusableElement&&(e.preventDefault(),this.lastFocusableElement.focus()),e.shiftKey||e.target!==this.lastFocusableElement||(e.preventDefault(),this.firstFocusableElement.focus())}},{key:Ep,value:function(){this.observer.observe(this.dialog,{childList:!0,attributes:!0,subtree:!0})}},{key:Cp,value:function(){this.observer.disconnect()}},{key:"open",value:function(){this.isInitialized&&this.isCreated&&!this.isOpen&&(this.isOpen=!0,this.documentIsAlreadyDisabled=this.document.classList.contains(this.config.documentDisabledClass),this[yp](),this[hp](),this[bp](),this.config.onOpen(this.dialog,this.openingTrigger))}},{key:"close",value:function(e){this.isInitialized&&this.isCreated&&this.isOpen&&(this.isOpen=!1,e&&e.preventDefault(),this[yp](),this[pp](),this.openingTrigger&&(!this.config.isTooltip||this.config.isTooltip&&e&&"click"!==e.type)&&this[wp](),this.config.onClose(this.dialog,this.closingTrigger))}},{key:"toggle",value:function(e){this.isInitialized&&this.isCreated&&(e&&e.preventDefault(),this.isOpen?this.close():this.open())}},{key:"create",value:function(){this.isInitialized&&!this.isCreated&&(this.isCreated=!0,this[mp](),this[gp](),this[Ep](),this.config.isOpen&&this.open(),document.addEventListener("click",this[dp],{capture:!0}))}},{key:"destroy",value:function(){this.isInitialized&&this.isCreated&&(this.close(),this.isCreated=!1,this[vp](),this[pp](),this[Cp](),document.removeEventListener("click",this[dp],{capture:!0}))}}])&&np(e.prototype,t),n&&np(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),Op=Sp,Ap=function(e){return"".concat(e,"-").concat((new Date).getTime(),"-").concat(Math.random().toString(16).slice(2))};function jp(e){return jp="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},jp(e)}function Tp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mp(r.key),r)}}function Mp(e){var t=function(e,t){if("object"!=jp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=jp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jp(t)?t:t+""}var Lp=function(){return e=function e(t,n){var r=this,o=n.inputs;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editor=t;var i=Ap("inputdialog");this.element=document.createElement("div"),this.element.dataset.dialog="".concat(Math.random().toString(36).slice(2));var a="";Object.keys(o).forEach((function(e){var t=o[e],n="";if("select"===t.type){var r=t.options.map((function(e){return'<option value="'.concat(e.value,'">').concat(e.label,"</option>")}));n='<select id="'.concat(i,"-").concat(e,'">').concat(r,"</select>")}else n='<input id="'.concat(i,"-").concat(e,'" type="').concat(t.type||"text",'">');a+='\n        <div data-input="'.concat(e,'">\n          <label>\n            ').concat(t.label,"\n            ").concat(n,"\n          </label>\n        </div>\n      ")}));var s=sf("editor.inputDialog"),u=this.element.dataset.dialog;this.element.innerHTML='\n      <div id="'.concat(u,'-content">\n        <button type="button" data-dialog-close="').concat(u,'" data-dialog-closable="" aria-label="').concat(s.close,'">&times</button>\n        <div data-dialog-container>\n          <form class="form-defaults form">\n            <div class="form__wrapper">\n              ').concat(a,'\n            </div>\n            <input type="submit" hidden>\n          </form>\n        </div>\n        <div data-dialog-actions>\n          <button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-action="cancel">').concat(s["buttons.cancel"],'</button>\n          <button type="button" class="button button__sm md:button__lg button__secondary" data-action="save">').concat(s["buttons.save"],"</button>\n        </div>\n      </div>\n    "),document.body.appendChild(this.element),this.dialog=new Op('[data-dialog="'.concat(u,'"]'),{closingSelector:'[data-dialog-close="'.concat(u,'"]'),backdropSelector:'[data-dialog="'.concat(u,'"]'),enableAutoFocus:!1,onOpen:function(){setTimeout((function(){return r.focusFirstInput()}),0)},onClose:function(){setTimeout((function(){return r.handleClose()}),0)}}),this.element.querySelector("form").addEventListener("submit",(function(e){e.preventDefault(),r.element.querySelector("button[data-action='save']").dispatchEvent(new Event("click"))})),this.element.querySelectorAll("button[data-action]").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r.action=e.dataset.action,r.close()}))}))},t=[{key:"toggle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(n){e.element.querySelectorAll("[data-input]").forEach((function(e){var n=e.querySelector("input, select"),r=t[e.dataset.input];n.value=r||""})),e.callback=n,e.action=null,e.editor.commands.toggleDialog(!0),e.dialog.open()}))}},{key:"close",value:function(){this.dialog.close()}},{key:"destroy",value:function(){this.dialog.destroy(),this.element.remove(),Reflect.deleteProperty(this,"dialog")}},{key:"handleClose",value:function(){this.editor.chain().toggleDialog(!1).focus(null,{scrollIntoView:!1}).run(),this.callback&&(this.callback(this.action),this.callback=null),this.action&&(this.action=null),this.destroy()}},{key:"focusFirstInput",value:function(){var e=this.element.querySelector("input, select");e&&e.focus()}},{key:"getValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=this.element.querySelector('[data-input="'.concat(e,'"]'));if(!t)return null;var n=t.querySelector("input, select");return n?n.value:null}}],t&&Tp(e.prototype,t),n&&Tp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Pp(e){return Pp="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},Pp(e)}function Fp(e){return function(e){if(Array.isArray(e))return Np(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Np(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Np(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Np(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rp(r.key),r)}}function Rp(e){var t=function(e,t){if("object"!=Pp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Pp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pp(t)?t:t+""}function Bp(e){return Bp="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},Bp(e)}function Ip(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zp(r.key),r)}}function zp(e){var t=function(e,t){if("object"!=Bp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bp(t)?t:t+""}function Hp(e,t,n){return t=$p(t),function(e,t){if(t&&("object"==Bp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vp()?Reflect.construct(t,n||[],$p(e).constructor):t.apply(e,n))}function Vp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vp=function(){return!!e})()}function $p(e){return $p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$p(e)}function qp(e,t){return qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qp(e,t)}var Up=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hp(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qp(e,t)}(t,e),n=t,(r=[{key:"shouldDisplay",value:function(){return this.editor.isActive("link")}},{key:"display",value:function(){var e=this.editor.getAttributes("link").href;this.element.querySelector("[data-linkbubble-value]").textContent=e}},{key:"handleAction",value:function(e){"remove"===e?this.editor.chain().focus(null,{scrollIntoView:!1}).unsetLink().run():this.editor.commands.linkDialog()}}])&&Ip(n.prototype,r),o&&Ip(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(function(){return e=function e(t){var n,r,o=this,i=t.editor,a=t.element,s=t.pluginKey;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editor=i,this.element=a,this.element.querySelectorAll("button").forEach((function(e){var t=e.dataset.action;e.addEventListener("click",(function(e){e.preventDefault(),o.handleAction(t)}))})),this.bubble=(n=this.element,(r=document.createElement("div")).style.cssText="\n    z-index: 9999;\n    position: absolute;\n    visibility: hidden;\n    inset: 0 auto auto 0;\n    margin: 0;\n  ",r.dataset.bubbleMenu="",r.append(n),r),this.bubbleShown=!1,this.plugin=function(e,t){return new rn({key:e,view:function(){return{update:function(e,n){var r=e.state;n&&n.doc.eq(r.doc)&&n.selection.eq(r.selection)||t.handleSelectionChange(e)}}}})}(s,this),this.editor.registerPlugin(this.plugin)},(t=[{key:"show",value:function(){this.bubbleShown||(this.editor.view.dom.parentElement.append(this.bubble),this.bubble.style.visibility="visible",this.bubbleShown=!0)}},{key:"hide",value:function(){this.bubbleShown&&(this.bubble.style.visibility="hidden",this.bubble.remove(),this.bubbleShown=!1)}},{key:"destroy",value:function(){this.hide(),this.bubble=null,this.editor.unregisterPlugin(this.plugin.key)}},{key:"handleSelectionChange",value:function(e){if(!this.editor.commands.isDialogOpen())return this.shouldDisplay(e)?(this.display(e),this.show(),void this.updatePosition(e)):void this.hide();this.hide()}},{key:"getReferenceRect",value:function(e){var t=e.state,n=t.selection.ranges,r=Math.min.apply(Math,Fp(n.map((function(e){return e.$from.pos})))),o=Math.max.apply(Math,Fp(n.map((function(e){return e.$to.pos}))));if(t.selection instanceof qt){var i=e.nodeDOM(r);if(i)return i.getBoundingClientRect()}return function(e,t,n){var r=e.state.doc.content.size,o=Os(t,0,r),i=Os(n,0,r),a=e.coordsAtPos(o),s=e.coordsAtPos(i,-1),u=Math.min(a.top,s.top),c=Math.max(a.bottom,s.bottom),l=Math.min(a.left,s.left),f=Math.max(a.right,s.right),d={top:u,bottom:c,left:l,right:f,width:f-l,height:c-u,x:l,y:u};return Ia(Ia({},d),{},{toJSON:function(){return d}})}(e,r,o)}},{key:"updatePosition",value:function(e){var t=e.dom.getBoundingClientRect(),n=this.getReferenceRect(e),r=n.left-t.left,o=n.top-t.top,i=this.bubble.clientWidth,a=this.bubble.clientHeight,s=Math.round(r-i/2);s<5&&(s=5);var u=Math.round(o+a-5);u<5&&(u=5),this.bubble.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}},{key:"shouldDisplay",value:function(){return!1}},{key:"display",value:function(){}},{key:"handleAction",value:function(){}}])&&_p(e.prototype,t),n&&_p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());function Wp(e){return Wp="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},Wp(e)}function Kp(e){return function(e){if(Array.isArray(e))return Gp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Gp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gp(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jp(){Jp=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Wp(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Wp(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Yp(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qp(Object(n),!0).forEach((function(t){Zp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Wp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wp(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var em=Xh.extend({addStorage:function(){return{bubbleMenu:null}},onCreate:function(){var e,t,n,r;null===(e=this.parent)||void 0===e||e.call(this),this.storage.bubbleMenu=(t=this.editor,new Up({editor:t,element:(n=sf("editor.extensions.link.bubbleMenu"),r=document.createElement("div"),r.dataset.linkbubble="",r.innerHTML="\n    <span data-linkbubble-content>\n      ".concat(n.url,':\n      <span data-linkbubble-value></span>\n    </span>\n    <span data-linkbubble-actions>\n      <button type="button" data-action="edit">').concat(n.edit,'</button>\n      <button type="button" data-action="remove">').concat(n.remove,"</button>\n    </span>\n  "),r),pluginKey:new sn("LinkBubble")}))},onDestroy:function(){var e;null===(e=this.parent)||void 0===e||e.call(this),this.storage.bubbleMenu.destroy(),this.storage.bubbleMenu=null},addOptions:function(){var e;return Xp(Xp({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{allowTargetControl:!1,HTMLAttributes:{target:"_blank",class:null}})},addCommands:function(){var e,t=this,n=sf("editor.extensions.link");return Xp(Xp({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{toggleLinkBubble:function(){return function(e){return e.dispatch?t.editor.isActive("link")?(t.storage.bubbleMenu.show(),!0):(t.storage.bubbleMenu.hide(),!1):t.editor.isActive("link")}},linkDialog:function(){return function(){var e,r=(e=Jp().mark((function e(r){var o,i,a,s,u,c,l,f,d;return Jp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.dispatch,i=r.commands,!o){e.next=21;break}return i.extendMarkRange("link"),t.storage.bubbleMenu.hide(),a=t.options.allowTargetControl,s=t.editor.getAttributes("link"),u=s.href,c=s.target,l={href:{type:"text",label:n.hrefLabel}},a&&(l.target={type:"select",label:n.targetLabel,options:[{value:"",label:n["targets.default"]},{value:"_blank",label:n["targets.blank"]}]}),f=new Lp(t.editor,{inputs:l}),e.next=11,f.toggle({href:u,target:c});case 11:if(d=e.sent,u=f.getValue("href"),c=f.getValue("target"),a?(!c||c.length<1)&&(c=null):c="_blank","save"===d){e.next=18;break}return t.editor.chain().focus(null,{scrollIntoView:!1}).toggleLinkBubble().run(),e.abrupt("return",!1);case 18:if(u&&!(u.trim().length<1)){e.next=20;break}return e.abrupt("return",t.editor.chain().focus(null,{scrollIntoView:!1}).unsetLink().run());case 20:return e.abrupt("return",t.editor.chain().focus(null,{scrollIntoView:!1}).setLink({href:u,target:c}).toggleLinkBubble().run());case 21:return e.abrupt("return",!0);case 22:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yp(i,r,o,a,s,"next",e)}function s(e){Yp(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return r.apply(this,arguments)}}()}})},addProseMirrorPlugins:function(){var e,t=this.editor;return[].concat(Kp((null===(e=this.parent)||void 0===e?void 0:e.call(this))||{}),[new rn({props:{handleDoubleClick:function(){return!!t.isActive("link")&&(t.chain().focus().linkDialog().run(),!0)}}})])}});function tm(e){return tm="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},tm(e)}function nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nm(Object(n),!0).forEach((function(t){om(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function om(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=tm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=tm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tm(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(){im=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==tm(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(tm(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function am(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function sm(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){am(i,r,o,a,s,"next",e)}function s(e){am(i,r,o,a,s,"throw",e)}a(void 0)}))}}var um=function(){var e=sm(im().mark((function e(t){var n;return im().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n='{\n    users(filter: { wildcard: "'.concat(t,'" }) {\n      nickname,\n      name,\n      avatarUrl,\n      __typename,\n      ...on UserGroup { membersCount }\n    }\n  }'),e.abrupt("return",fetch(window.Decidim.config.get("api_path"),{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n})}).then((function(e){if(e.ok)return e.json();throw new Error("Could not retrieve data")})).then((function(e){return e.data.users||[]})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),cm=El.extend({addOptions:function(){var e,t,n=null===(e=this.parent)||void 0===e?void 0:e.call(this);return rm(rm({},n),{},{renderLabel:function(e){var t,n=e.node;return"".concat(null!==(t=n.attrs.label)&&void 0!==t?t:n.attrs.id)},suggestion:rm(rm({},null===n||void 0===n?void 0:n.suggestion),{},{allowSpaces:!0,items:(t=sm(im().mark((function e(t){var n,r,o;return im().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=t.query).length<2)){e.next=3;break}return e.abrupt("return",[]);case 3:return e.next=5,um(n);case 5:return r=e.sent,o=r.sort((function(e){return e.nickname.slice(1)})),e.abrupt("return",o.slice(0,5));case 8:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),render:Cl(this,{itemConverter:function(e){return{id:e.nickname,label:"".concat(e.nickname," (").concat(e.name,")")}}})})})},addNodeView:function(){return Dl(this)}});function lm(e){return lm="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},lm(e)}function fm(){fm=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==lm(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(lm(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function dm(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}var hm=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(.+)?$/,pm=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(.+)?$/g,mm=/^(https?:\/\/)?(www\.|player\.)?(vimeo\.com)(.+)?$/,vm=/^(https?:\/\/)?(www\.|player\.)?(vimeo\.com)(.+)?$/g,ym=function(e){var t=e.url;return function(e){return e.match(hm)}(t)?function(e){var t="https://www.youtube-nocookie.com/embed/",n=e.url;if(n.includes("/embed/"))return n;if(n.includes("youtu.be")){var r=n.split("/").pop();return r?"".concat(t).concat(r):null}var o=/v=([-\w]+)/gm.exec(n);if(!o||!o[1])return null;var i="".concat(t).concat(o[1]),a={ccLoadPolicy:1,modestbranding:1},s={};return Object.keys(a).forEach((function(e){var t=e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}));s[t]=a[e]})),"".concat(i,"?").concat(new URLSearchParams(s))}(e):function(e){return e.match(mm)}(t)?function(e){var t=e.url.split("?").shift().split("/").pop();return"".concat("https://player.vimeo.com/video/").concat(t)}(e):t},gm=cu.create({name:"videoEmbed",draggable:!0,addOptions:function(){return{height:null,width:null,inline:!1}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},addAttributes:function(){return{src:{default:null,parseHTML:function(e){var t,n,r=null===e||void 0===e||null===(t=e.parentElement)||void 0===t?void 0:t.parentElement,o=null===r||void 0===r||null===(n=r.dataset)||void 0===n?void 0:n.videoEmbed;return o&&o.length>0?o:e.src}},title:{default:null},width:{default:this.options.width},height:{default:this.options.height},frameborder:{default:0},allowfullscreen:{default:!0}}},parseHTML:function(){return[{tag:"div[data-video-embed] div iframe"}]},addCommands:function(){var e=this,t=sf("editor.extensions.videoEmbed");return{setVideo:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},videoEmbedDialog:function(){return function(){var n,r=(n=fm().mark((function n(r){var o,i,a,s;return fm().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!r.dispatch){n.next=16;break}return o=new Lp(e.editor,{inputs:{src:{type:"text",label:t.urlLabel},title:{type:"text",label:t.titleLabel}}}),i=e.editor.getAttributes("videoEmbed"),a=i.src,s=i.title,n.next=6,o.toggle({src:a,title:s});case 6:if("save"===n.sent){n.next=9;break}return n.abrupt("return",!1);case 9:if(a=o.getValue("src"),(s=o.getValue("title"))&&s.trim().length<1&&(s=null),a&&!(a.length<1)){n.next=15;break}return e.editor.commands.focus(null,{scrollIntoView:!1}),n.abrupt("return",!1);case 15:return n.abrupt("return",e.editor.chain().setVideo({src:a,title:s}).focus(null,{scrollIntoView:!1}).run());case 16:return n.abrupt("return",!0);case 17:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var i=n.apply(e,t);function a(e){dm(i,r,o,a,s,"next",e)}function s(e){dm(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(e){return r.apply(this,arguments)}}()}}},addPasteRules:function(){return[fu({find:pm,type:this.type,getAttributes:function(e){return{src:e.input,title:""}}}),fu({find:vm,type:this.type,getAttributes:function(e){return{src:e.input,title:""}}})]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.src;return t.src=ym({url:n}),["div",{class:"editor-content-videoEmbed","data-video-embed":n},["div",{},["iframe",Ja({width:this.options.width,height:this.options.height},t)]]]},addProseMirrorPlugins:function(){var e=this.editor;return[new rn({props:{handleDoubleClick:function(){return!!e.isActive("videoEmbed")&&(e.chain().focus().videoEmbedDialog().run(),!0)}}})]}}),bm=["skins"],wm=["local","version","cdnUrl"],km=["compact","flat","shortcodes"];function xm(e){return xm="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},xm(e)}function Em(e,t,n,r){var o=Cm(Tm(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function Cm(){return Cm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Tm(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Cm.apply(null,arguments)}function Dm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$m(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Sm(){Sm=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==xm(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(xm(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Om(e,t,n){return t=Tm(t),function(e,t){if(t&&("object"==xm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Am(e)}(e,jm()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function Am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jm=function(){return!!e})()}function Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tm(e)}function Mm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lm(e,t)}function Lm(e,t){return Lm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lm(e,t)}function Pm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zm(r.key),r)}}function Fm(e,t,n){return t&&Pm(e.prototype,t),n&&Pm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||$m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rm(Object(n),!0).forEach((function(t){Im(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Im(e,t,n){return(t=zm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zm(e){var t=function(e,t){if("object"!=xm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=xm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xm(t)?t:t+""}function Hm(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Vm(e){return function(e){if(Array.isArray(e))return qm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $m(e,t){if(e){if("string"==typeof e)return qm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qm(e,t):void 0}}function qm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Um(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function Wm(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Um(i,r,o,a,s,"next",e)}function s(e){Um(i,r,o,a,s,"throw",e)}a(void 0)}))}}var Km=function(e,t,n){if(!t.has(e))throw TypeError("Cannot "+n)},Gm=function(e,t,n){return Km(e,t,"read from private field"),n?n.call(e):t.get(e)},Jm=function(e,t,n){if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ym=function(e,t,n,r){return Km(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n},Qm=function(e,t,n){return Km(e,t,"access private method"),n};function Xm(e,t,n){var r="https://cdn.jsdelivr.net/npm/emojibase-data@".concat(t,"/").concat(e);return"function"==typeof n?r=n(e,t):"string"==typeof n&&(r="".concat(n,"/").concat(e)),r}function Zm(e){return ev.apply(this,arguments)}function ev(){return ev=Wm(Sm().mark((function e(t){var n,r,o,i,a,s,u,c,l,f,d,h,p,m=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(n=m.length>1&&void 0!==m[1]?m[1]:{}).local,o=void 0!==r&&r,i=n.version,a=void 0===i?"latest":i,s=n.cdnUrl,u=Hm(n,wm),c=Xm(t,a,s),l=o?localStorage:sessionStorage,f="emojibase/".concat(a,"/").concat(t),!(d=l.getItem(f))){e.next=4;break}return e.abrupt("return",Promise.resolve(JSON.parse(d)));case 4:return e.next=6,fetch(c,Bm({credentials:"omit",mode:"cors",redirect:"error"},u));case 6:if((h=e.sent).ok){e.next=9;break}throw new Error("Failed to load Emojibase dataset.");case 9:return e.next=11,h.json();case 11:p=e.sent;try{l.setItem(f,JSON.stringify(p))}catch(v){}return e.abrupt("return",p);case 14:case"end":return e.stop()}}),e)}))),ev.apply(this,arguments)}var tv={discord:"joypixels",slack:"iamcal"};function nv(e,t,n){return rv.apply(this,arguments)}function rv(){return(rv=Wm(Sm().mark((function e(t,n,r){var o;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zm("".concat(t,"/shortcodes/").concat(null!==(o=tv[n])&&void 0!==o?o:n,".json"),r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ov(e,t){if(0===t.length)return e;var n=new Set(e.shortcodes);return t.forEach((function(t){var r=t[e.hexcode];Array.isArray(r)?r.forEach((function(e){return n.add(e)})):r&&n.add(r)})),e.shortcodes=Vm(n),e.skins&&e.skins.forEach((function(e){ov(e,t)})),e}function iv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return e.forEach((function(e){if(e.skins){var r=e.skins,o=Hm(e,bm);n.push(ov(o,t)),r.forEach((function(e){var r=Bm({},e);o.tags&&(r.tags=Vm(o.tags)),n.push(ov(r,t))}))}else n.push(ov(e,t))})),n}function av(e,t){return 0===t.length||e.forEach((function(e){ov(e,t)})),e}function sv(e){return uv.apply(this,arguments)}function uv(){return uv=Wm(Sm().mark((function e(t){var n,r,o,i,a,s,u,c,l,f,d=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=d.length>1&&void 0!==d[1]?d[1]:{}).compact,o=void 0!==r&&r,i=n.flat,a=void 0!==i&&i,s=n.shortcodes,u=void 0===s?[]:s,c=Hm(n,km),e.next=10,Zm("".concat(t,"/").concat(o?"compact":"data",".json"),c);case 10:if(l=e.sent,f=[],e.t0=u.length>0,!e.t0){e.next=17;break}return e.next=16,Promise.all(u.map((function(e){var n;if(e.includes("/")){var r=_m(e.split("/"),2);n=nv(r[0],r[1],c)}else n=nv(t,e,c);return n.catch((function(){return{}}))})));case 16:f=e.sent;case 17:return e.abrupt("return",a?iv(l,f):av(l,f));case 18:case"end":return e.stop()}}),e)}))),uv.apply(this,arguments)}function cv(e,t){return lv.apply(this,arguments)}function lv(){return(lv=Wm(Sm().mark((function e(t,n){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zm("".concat(t,"/messages.json"),n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fv(e,t){var n=e.target.closest("[data-emoji]");if(n){var r=t.find((function(e){return e.emoji===n.dataset.emoji}));if(r)return r}return null}function dv(e){var t,n=null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return e.animate&&!(null!=n&&n.matches)}function hv(e,t){return e.toLowerCase().includes(t.toLowerCase())}function pv(e,t,n,r){if(dv(r)&&e.animate)return e.animate(t,n).finished;var o="normal"===n.direction?1:0,i=Object.entries(t).reduce((function(e,t){var n=_m(t,2),r=n[0],i=n[1];return Bm(Bm({},e),{},Im({},r,i[o]))}),{});return Object.assign(e.style,i),Promise.resolve()}function mv(e){var t,n=document.createElement("template");return n.innerHTML=e,null==(t=n.content)?void 0:t.firstElementChild}function vv(e){return yv.apply(this,arguments)}function yv(){return yv=Wm(Sm().mark((function e(t){var n,r;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new TextEncoder).encode(t),e.next=3,crypto.subtle.digest("SHA-256",n);case 3:return r=e.sent,e.abrupt("return",Array.from(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 5:case"end":return e.stop()}}),e)}))),yv.apply(this,arguments)}function gv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return Bm(Bm({},e),{},Im({},t,bv(t)))}),{})}function bv(e){return"picmo__".concat(e)}function wv(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function kv(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=wv(e)).append.apply(t,r)}function xv(e){try{return window[e].length,!0}catch(t){return!1}}function Ev(){return xv("sessionStorage")}function Cv(e){var t;return{emoji:e.emoji,label:e.label,tags:e.tags,skins:null==(t=e.skins)?void 0:t.map((function(e){return Cv(e)})),order:e.order,custom:!1,hexcode:e.hexcode,version:e.version}}function Dv(e,t,n){var r;return!(n&&!n.some((function(t){return t.order===e.group})))&&(hv(e.label,t)||(null==(r=e.tags)?void 0:r.some((function(e){return hv(e,t)}))))}var Sv=Fm((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";Nm(this,e),this.locale=t})),Ov=[function(e,t){return"1F91D"===e.hexcode&&t<14&&(e.skins=[]),e},function(e,t){return e.skins&&(e.skins=e.skins.filter((function(e){return!e.version||e.version<=t}))),e}];function Av(e,t){return e.filter((function(e){return null!==function(e,t){return Ov.some((function(n){return null===n(e,t)}))?null:e}(e,t)}))}var jv={};function Tv(e){return jv[e]||(jv[e]=new Mv(e)),jv[e]}Tv.deleteDatabase=function(e){};var Mv=function(e){function t(){return Nm(this,t),Om(this,t,arguments)}return Mm(t,e),Fm(t,[{key:"open",value:function(){return Promise.resolve()}},{key:"delete",value:function(){return Promise.resolve()}},{key:"close",value:function(){}},{key:"isPopulated",value:function(){return Promise.resolve(!1)}},{key:"getEmojiCount",value:function(){return Promise.resolve(this.emojis.length)}},{key:"getEtags",value:function(){return Promise.resolve({foo:"bar"})}},{key:"getHash",value:function(){return Promise.resolve("")}},{key:"populate",value:function(e){return this.categories=e.groups,this.emojis=e.emojis,Promise.resolve()}},{key:"getCategories",value:function(e){var t,n=this.categories.filter((function(e){return"component"!==e.key}));if(e.showRecents&&n.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&n.push({key:"custom",order:10}),e.categories){var r=e.categories;(n=n.filter((function(e){return r.includes(e.key)}))).sort((function(e,t){return r.indexOf(e.key)-r.indexOf(t.key)}))}else n.sort((function(e,t){return e.order-t.order}));return Promise.resolve(n)}},{key:"getEmojis",value:function(e,t){var n=this.emojis.filter((function(t){return t.group===e.order})).filter((function(e){return e.version<=t})).sort((function(e,t){return null!=e.order&&null!=t.order?e.order-t.order:0})).map(Cv);return Promise.resolve(Av(n,t))}},{key:"searchEmojis",value:function(e,t,n,r){var o=this.emojis.filter((function(t){return Dv(t,e,r)&&t.version<=n})).map(Cv),i=t.filter((function(t){return Dv(t,e,r)})),a=[].concat(Vm(Av(o,n)),Vm(i));return Promise.resolve(a)}},{key:"setMeta",value:function(e){this.meta=e}}])}(Sv);function Lv(e){return Pv.apply(this,arguments)}function Pv(){return(Pv=Wm(Sm().mark((function e(t){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t,{method:"HEAD"});case 3:return e.abrupt("return",e.sent.headers.get("etag"));case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function Fv(e){var t=function(e,t){var n="https://cdn.jsdelivr.net/npm/emojibase-data@".concat(e,"/").concat(t);return{emojisUrl:"".concat(n,"/data.json"),messagesUrl:"".concat(n,"/messages.json")}}("latest",e),n=t.emojisUrl,r=t.messagesUrl;try{return Promise.all([Lv(n),Lv(r)])}catch(o){return Promise.all([null,null])}}function Nv(e,t,n){return _v.apply(this,arguments)}function _v(){return _v=Wm(Sm().mark((function e(t,n,r){var o,i,a,s,u,c,l,f;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.getEtags();case 3:o=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),o={};case 9:if(a=(i=o).storedEmojisEtag,s=i.storedMessagesEtag,r===s&&n===a){e.next=19;break}return e.next=13,Promise.all([cv(t.locale),sv(t.locale)]);case 13:return u=e.sent,c=_m(u,2),l=c[0],f=c[1],e.next=19,t.populate({groups:l.groups,emojis:f,emojisEtag:n,messagesEtag:r});case 19:case"end":return e.stop()}}),e,null,[[0,6]])}))),_v.apply(this,arguments)}function Rv(e,t){return Bv.apply(this,arguments)}function Bv(){return(Bv=Wm(Sm().mark((function e(t,n){var r;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getHash();case 2:return r=e.sent,e.abrupt("return",n!==r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iv(e,t,n){return zv.apply(this,arguments)}function zv(){return(zv=Wm(Sm().mark((function e(t,n,r){var o;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r||n(t),e.prev=1,e.next=4,o.open();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),console.warn("[picmo] IndexedDB not available, falling back to InMemoryStoreFactory"),o=Tv(t);case 9:return e.abrupt("return",o);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}function Hv(e,t,n){return Vv.apply(this,arguments)}function Vv(){return Vv=Wm(Sm().mark((function e(t,n,r){var o,i,a,s,u,c,l,f,d;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ev()||!(("undefined"===typeof window?"undefined":xm(window))<"u")){e.next=2;break}throw new Error("Session storage is required to use CDN emoji data.");case 2:return e.next=4,Iv(t,n,r);case 4:return o=e.sent,e.next=7,Fv(t);case 7:return i=e.sent,a=_m(i,2),s=a[0],u=a[1],e.next=13,o.isPopulated();case 13:if(!e.sent){e.next=20;break}if(e.t0=s&&u,!e.t0){e.next=18;break}return e.next=18,Nv(o,s,u);case 18:e.next=28;break;case 20:return e.next=22,Promise.all([cv(t),sv(t)]);case 22:return c=e.sent,l=_m(c,2),f=l[0],d=l[1],e.next=28,o.populate({groups:f.groups,emojis:d,emojisEtag:s,messagesEtag:u});case 28:return e.abrupt("return",o);case 29:case"end":return e.stop()}}),e)}))),Vv.apply(this,arguments)}function $v(e,t,n,r,o){return qv.apply(this,arguments)}function qv(){return qv=Wm(Sm().mark((function e(t,n,r,o,i){var a,s;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Iv(t,n,i);case 2:return a=e.sent,e.next=5,vv(o);case 5:return s=e.sent,e.next=8,a.isPopulated();case 8:if(e.t0=!e.sent,e.t0){e.next=13;break}return e.next=12,Rv(a,s);case 12:e.t0=e.sent;case 13:if(e.t1=e.t0,!e.t1){e.next=17;break}return e.next=17,a.populate({groups:r.groups,emojis:o,hash:s});case 17:return e.abrupt("return",a);case 18:case"end":return e.stop()}}),e)}))),qv.apply(this,arguments)}function Uv(e,t,n,r,o){return Wv.apply(this,arguments)}function Wv(){return Wv=Wm(Sm().mark((function e(t,n,r,o,i){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r&&o?$v(t,n,r,o,i):Hv(t,n,i));case 1:case"end":return e.stop()}}),e)}))),Wv.apply(this,arguments)}var Kv=function(){return Fm((function e(){Nm(this,e),this.handleKeyDown=this.handleKeyDown.bind(this)}),[{key:"activate",value:function(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}},{key:"deactivate",value:function(){var e;null==(e=this.rootElement)||e.removeEventListener("keydown",this.handleKeyDown)}},{key:"focusableElements",get:function(){return this.rootElement.querySelectorAll('input, [tabindex="0"]')}},{key:"lastFocusableElement",get:function(){return this.focusableElements[this.focusableElements.length-1]}},{key:"firstFocusableElement",get:function(){return this.focusableElements[0]}},{key:"checkFocus",value:function(e,t,n){e.target===t&&(n.focus(),e.preventDefault())}},{key:"handleKeyDown",value:function(e){"Tab"===e.key&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}])}(),Gv=gv("light","dark","auto"),Jv=Gv.light,Yv=(Gv.dark,Gv.auto,function(){return Fm((function e(t){var n=t.template,r=t.classes,o=t.parent;Nm(this,e),this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=n,this.classes=r,this.parent=o,this.keyBindingHandler=this.keyBindingHandler.bind(this)}),[{key:"initialize",value:function(){this.bindAppEvents()}},{key:"setCustomEmojis",value:function(e){this.customEmojis=e}},{key:"setEvents",value:function(e){this.events=e}},{key:"setPickerId",value:function(e){this.pickerId=e}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=this.events).emit.apply(t,[e].concat(r))}},{key:"setI18n",value:function(e){this.i18n=e}},{key:"setRenderer",value:function(e){this.renderer=e}},{key:"setEmojiData",value:function(e){var t=this;this.emojiDataPromise=e,e.then((function(e){t.emojiData=e}))}},{key:"updateEmojiData",value:function(e){this.emojiData=e,this.emojiDataPromise=Promise.resolve(e)}},{key:"setOptions",value:function(e){this.options=e}},{key:"renderSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.el=this.template.renderSync(Bm({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId},e)),this.postRender(),this.el}},{key:"render",value:(e=Wm(Sm().mark((function e(){var t,n=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.next=3,this.emojiDataPromise;case 3:return e.next=5,this.template.renderAsync(Bm({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId},t));case 5:return this.el=e.sent,this.postRender(),e.abrupt("return",this.el);case 8:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"postRender",value:function(){this.bindUIElements(),this.bindKeyBindings(),this.bindUIEvents(),this.scheduleShowAnimation()}},{key:"bindAppEvents",value:function(){var e=this;Object.keys(this.appEvents).forEach((function(t){e.events.on(t,e.appEvents[t],e)})),this.events.on("data:ready",this.updateEmojiData,this)}},{key:"unbindAppEvents",value:function(){var e=this;Object.keys(this.appEvents).forEach((function(t){e.events.off(t,e.appEvents[t])})),this.events.off("data:ready",this.updateEmojiData)}},{key:"keyBindingHandler",value:function(e){var t=this.keyBindings[e.key];t&&t.call(this,e)}},{key:"bindKeyBindings",value:function(){this.keyBindings&&this.el.addEventListener("keydown",this.keyBindingHandler)}},{key:"unbindKeyBindings",value:function(){this.keyBindings&&this.el.removeEventListener("keydown",this.keyBindingHandler)}},{key:"bindUIElements",value:function(){var e=this;this.ui=Object.keys(this.uiElements).reduce((function(t,n){return Bm(Bm({},t),{},Im({},n,e.el.querySelector(e.uiElements[n])))}),{})}},{key:"bindUIEvents",value:function(){var e=this;this.uiEvents.forEach((function(t){t.handler=t.handler.bind(e),(t.target?e.ui[t.target]:e.el).addEventListener(t.event,t.handler,t.options)}))}},{key:"unbindUIEvents",value:function(){var e=this;this.uiEvents.forEach((function(t){(t.target?e.ui[t.target]:e.el).removeEventListener(t.event,t.handler)}))}},{key:"destroy",value:function(){this.unbindAppEvents(),this.unbindUIEvents(),this.unbindKeyBindings(),this.el.remove(),this.isDestroyed=!0}},{key:"scheduleShowAnimation",value:function(){var e=this;if(this.parent){var t=new MutationObserver((function(n){var r=_m(n,1)[0];"childList"===r.type&&r.addedNodes[0]===e.el&&(dv(e.options)&&e.animateShow&&e.animateShow(),t.disconnect)}));t.observe(this.parent,{childList:!0})}}}],[{key:"childEvent",value:function(e,t,n){return{target:e,event:t,handler:n,options:arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}}}},{key:"uiEvent",value:function(e,t){return{event:e,handler:t,options:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}}},{key:"byClass",value:function(e){return".".concat(e)}}]);var e}());var Qv={clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"/></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"/></svg>',frown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240zM336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240C354 240 368.4 225.7 368.4 208C368.4 190.3 354 176 336.4 176zM259.9 369.4C288.8 369.4 316.2 375.2 340.6 385.5C352.9 390.7 366.7 381.3 361.4 369.1C344.8 330.9 305.6 303.1 259.9 303.1C214.3 303.1 175.1 330.8 158.4 369.1C153.1 381.3 166.1 390.6 179.3 385.4C203.7 375.1 231 369.4 259.9 369.4L259.9 369.4z"/></svg>',gamepad:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M448 64H192C85.96 64 0 149.1 0 256s85.96 192 192 192h256c106 0 192-85.96 192-192S554 64 448 64zM247.1 280h-32v32c0 13.2-10.78 24-23.98 24c-13.2 0-24.02-10.8-24.02-24v-32L136 279.1C122.8 279.1 111.1 269.2 111.1 256c0-13.2 10.85-24.01 24.05-24.01L167.1 232v-32c0-13.2 10.82-24 24.02-24c13.2 0 23.98 10.8 23.98 24v32h32c13.2 0 24.02 10.8 24.02 24C271.1 269.2 261.2 280 247.1 280zM431.1 344c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40s39.1 17.88 39.1 40S454.1 344 431.1 344zM495.1 248c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40c22.12 0 39.1 17.88 39.1 40S518.1 248 495.1 248z"/></svg>',lightbulb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"/></svg>',mug:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M512 32H120c-13.25 0-24 10.75-24 24L96.01 288c0 53 43 96 96 96h192C437 384 480 341 480 288h32c70.63 0 128-57.38 128-128S582.6 32 512 32zM512 224h-32V96h32c35.25 0 64 28.75 64 64S547.3 224 512 224zM560 416h-544C7.164 416 0 423.2 0 432C0 458.5 21.49 480 48 480h480c26.51 0 48-21.49 48-48C576 423.2 568.8 416 560 416z"/></svg>',plane:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M482.3 192C516.5 192 576 221 576 256C576 292 516.5 320 482.3 320H365.7L265.2 495.9C259.5 505.8 248.9 512 237.4 512H181.2C170.6 512 162.9 501.8 165.8 491.6L214.9 320H112L68.8 377.6C65.78 381.6 61.04 384 56 384H14.03C6.284 384 0 377.7 0 369.1C0 368.7 .1818 367.4 .5398 366.1L32 256L.5398 145.9C.1818 144.6 0 143.3 0 142C0 134.3 6.284 128 14.03 128H56C61.04 128 65.78 130.4 68.8 134.4L112 192H214.9L165.8 20.4C162.9 10.17 170.6 0 181.2 0H237.4C248.9 0 259.5 6.153 265.2 16.12L365.7 192H482.3z"/></svg>',robot:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M9.375 233.4C3.375 239.4 0 247.5 0 256v128c0 8.5 3.375 16.62 9.375 22.62S23.5 416 32 416h32V224H32C23.5 224 15.38 227.4 9.375 233.4zM464 96H352V32c0-17.62-14.38-32-32-32S288 14.38 288 32v64H176C131.8 96 96 131.8 96 176V448c0 35.38 28.62 64 64 64h320c35.38 0 64-28.62 64-64V176C544 131.8 508.3 96 464 96zM256 416H192v-32h64V416zM224 296C201.9 296 184 278.1 184 256S201.9 216 224 216S264 233.9 264 256S246.1 296 224 296zM352 416H288v-32h64V416zM448 416h-64v-32h64V416zM416 296c-22.12 0-40-17.88-40-40S393.9 216 416 216S456 233.9 456 256S438.1 296 416 296zM630.6 233.4C624.6 227.4 616.5 224 608 224h-32v192h32c8.5 0 16.62-3.375 22.62-9.375S640 392.5 640 384V256C640 247.5 636.6 239.4 630.6 233.4z"/></svg>',sad:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\n  <defs>\n    <radialGradient gradientUnits="userSpaceOnUse" cy="10%" id="gradient-0">\n      <stop offset="0" stop-color="hsl(50, 100%, 50%)" />\n      <stop offset="1" stop-color="hsl(50, 100%, 60%)" />\n    </radialGradient>\n  </defs>\n  \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="172.586" cy="207.006" rx="39.974" ry="39.974"/>\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="334.523" cy="207.481" rx="39.974" ry="39.974"/>\n  <ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="313.325" cy="356.208" rx="91.497" ry="59.893"/>\n  <path fill="#55a7ff" d="M 159.427 274.06 L 102.158 363.286 L 124.366 417.011 L 160.476 423.338 L 196.937 414.736 L 218.502 375.214"></path>\n  <path fill="url(#gradient-0)" d="M256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0zM256 352C290.9 352 323.2 367.8 348.3 394.9C354.3 401.4 364.4 401.7 370.9 395.7C377.4 389.7 377.7 379.6 371.7 373.1C341.6 340.5 301 320 256 320C247.2 320 240 327.2 240 336C240 344.8 247.2 352 256 352H256zM208 369C208 349 179.6 308.6 166.4 291.3C163.2 286.9 156.8 286.9 153.6 291.3C140.6 308.6 112 349 112 369C112 395 133.5 416 160 416C186.5 416 208 395 208 369H208zM303.6 208C303.6 225.7 317.1 240 335.6 240C353.3 240 367.6 225.7 367.6 208C367.6 190.3 353.3 176 335.6 176C317.1 176 303.6 190.3 303.6 208zM207.6 208C207.6 190.3 193.3 176 175.6 176C157.1 176 143.6 190.3 143.6 208C143.6 225.7 157.1 240 175.6 240C193.3 240 207.6 225.7 207.6 208z" />\n</svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>',smiley:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256.3 331.8C208.9 331.8 164.1 324.9 124.5 312.8C112.2 309 100.2 319.7 105.2 331.5C130.1 390.6 188.4 432 256.3 432C324.2 432 382.4 390.6 407.4 331.5C412.4 319.7 400.4 309 388.1 312.8C348.4 324.9 303.7 331.8 256.3 331.8H256.3zM176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176zM336.4 240C354 240 368.4 225.7 368.4 208C368.4 190.3 354 176 336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240z"/></svg>',symbols:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"/></svg>',tree:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M413.8 447.1L256 448l0 31.99C256 497.7 241.8 512 224.1 512c-17.67 0-32.1-14.32-32.1-31.99l0-31.99l-158.9-.0099c-28.5 0-43.69-34.49-24.69-56.4l68.98-79.59H62.22c-25.41 0-39.15-29.8-22.67-49.13l60.41-70.85H89.21c-21.28 0-32.87-22.5-19.28-37.31l134.8-146.5c10.4-11.3 28.22-11.3 38.62-.0033l134.9 146.5c13.62 14.81 2.001 37.31-19.28 37.31h-10.77l60.35 70.86c16.46 19.34 2.716 49.12-22.68 49.12h-15.2l68.98 79.59C458.7 413.7 443.1 447.1 413.8 447.1z"/></svg>',users:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M224 256c70.7 0 128-57.31 128-128S294.7 0 224 0C153.3 0 96 57.31 96 128S153.3 256 224 256zM274.7 304H173.3c-95.73 0-173.3 77.6-173.3 173.3C0 496.5 15.52 512 34.66 512H413.3C432.5 512 448 496.5 448 477.3C448 381.6 370.4 304 274.7 304zM479.1 320h-73.85C451.2 357.7 480 414.1 480 477.3C480 490.1 476.2 501.9 470 512h138C625.7 512 640 497.6 640 479.1C640 391.6 568.4 320 479.1 320zM432 256C493.9 256 544 205.9 544 144S493.9 32 432 32c-25.11 0-48.04 8.555-66.72 22.51C376.8 76.63 384 101.4 384 128c0 35.52-11.93 68.14-31.59 94.71C372.7 243.2 400.8 256 432 256z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\n  <defs>\n    <radialGradient id="radial" cy="85%">\n      <stop offset="20%" stop-color="var(--color-secondary)" />\n      <stop offset="100%" stop-color="var(--color-primary)" />\n    </radialGradient>\n  </defs>\n  \x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e\n  <path fill="url(\'#radial\')" d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z" />\n</svg>',xmark:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>'},Xv={recents:"clock","smileys-emotion":"smiley","people-body":"users","animals-nature":"tree","food-drink":"mug",activities:"gamepad","travel-places":"plane",objects:"lightbulb",symbols:"symbols",flags:"flag",custom:"robot"};function Zv(e,t){if(!(e in Qv))return console.warn('Unknown icon: "'.concat(e,'"')),document.createElement("div");var n=function(e,t){var n=mv(t);return n.dataset.icon=e,n.classList.add(bv("icon")),n}(e,Qv[e]);return t&&n.classList.add(bv("icon-".concat(t))),n}var ey,ty,ny,ry,oy,iy,ay,sy,uy="sync",cy=function(){return Fm((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Nm(this,e),Jm(this,ny),Jm(this,oy),Jm(this,ay),Jm(this,ey,void 0),Jm(this,ty,void 0),Ym(this,ey,t),Ym(this,ty,n.mode||uy)}),[{key:"renderSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=mv(Gm(this,ey).call(this,e));return Qm(this,ay,sy).call(this,t,e),Qm(this,oy,iy).call(this,t),Qm(this,ny,ry).call(this,t,e),t}},{key:"renderAsync",value:(e=Wm(Sm().mark((function e(){var t,n,r=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},n=mv(Gm(this,ey).call(this,t)),Qm(this,ay,sy).call(this,n,t),Qm(this,oy,iy).call(this,n),e.next=6,Qm(this,ny,ry).call(this,n,t);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"render",value:function(e){return"sync"===Gm(this,ty)?this.renderSync(e):this.renderAsync(e)}}]);var e}();ey=new WeakMap,ty=new WeakMap,ny=new WeakSet,ry=function(){var e=Wm(Sm().mark((function e(t,n){var r,o,i,a,s;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.querySelectorAll("[data-view]"),o=[],i=Dm(r),e.prev=2,s=Sm().mark((function e(){var t,r;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=a.value,(r=n[t.dataset.view])?"sync"!==t.dataset.render?o.push(r.render().then((function(e){return t.replaceWith(e),e}))):t.replaceWith(r.renderSync()):t.remove();case 3:case"end":return e.stop()}}),e)})),i.s();case 5:if((a=i.n()).done){e.next=9;break}return e.delegateYield(s(),"t0",7);case 7:e.next=5;break;case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(2),i.e(e.t1);case 14:return e.prev=14,i.f(),e.finish(14);case 17:return e.abrupt("return",Promise.all(o));case 18:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),oy=new WeakSet,iy=function(e){e.querySelectorAll("i[data-icon]").forEach((function(e){var t=e.dataset,n=t.icon,r=t.size;e.replaceWith(Zv(n,r))}))},ay=new WeakSet,sy=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach((function(e){var n=e.dataset.placeholder;if(n&&t[n]){var r=t[n];e.replaceWith.apply(e,Vm([r].flat()))}else console.warn('Missing placeholder element for key "'.concat(n,'"'))})),e};var ly=gv("imagePlaceholder","placeholder"),fy=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.placeholder," ").concat(t.imagePlaceholder,'"></div>\n')})),dy=function(e){function t(){var e,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).classNames;return Nm(this,t),(e=Om(this,t,[{template:fy,classes:ly}])).classNames=n,e}return Mm(t,e),Fm(t,[{key:"load",value:function(e){var t=this,n=document.createElement("img");this.classNames&&(n.className=this.classNames),n.addEventListener("load",(function(){t.el.replaceWith(n)}),{once:!0}),Promise.resolve(e).then((function(e){return n.src=e}))}},{key:"renderSync",value:function(){var e=this;return Em(t,"renderSync",this,3)([]),this.classNames&&this.classNames.split(" ").forEach((function(t){return e.el.classList.add(t)})),this.el}}])}(Yv),hy=gv("customEmoji"),py=function(){return Fm((function e(){Nm(this,e)}),[{key:"renderElement",value:function(e){return{content:e}}},{key:"renderImage",value:function(){var e=arguments.length>1?arguments[1]:void 0,t=new dy({classNames:arguments.length>0&&void 0!==arguments[0]?arguments[0]:""});return t.renderSync(),{content:t,resolver:function(){return t.load(e()),t.el}}}},{key:"doRender",value:function(e,t,n){if(e.custom)return this.renderCustom(e,t,n);var r=this.render(e,n),o=r.content,i=r.resolver,a=o instanceof Element?o:o.el;return i&&i(),a}},{key:"doEmit",value:function(e){return e.custom?this.emitCustom(e):this.emit(e)}},{key:"emitCustom",value:function(e){return{url:e.url,label:e.label,emoji:e.emoji,data:e.data}}},{key:"renderCustom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=[hy.customEmoji,n].join(" ").trim(),o=this.renderImage(r,(function(){return e.url})),i=o.content,a=o.resolver,s=i instanceof Element?i:i.el;return a&&a(),s}}])}(),my=new cy((function(e){var t=e.emoji;return"<span>".concat(t,"</span>")})),vy=function(e){function t(){return Nm(this,t),Om(this,t,arguments)}return Mm(t,e),Fm(t,[{key:"render",value:function(e){return this.renderElement(my.renderSync({emoji:e.emoji}))}},{key:"emit",value:function(e){return{emoji:e.emoji,hexcode:e.hexcode,label:e.label}}}])}(py),yy={"categories.activities":"Activities","categories.animals-nature":"Animals & Nature","categories.custom":"Custom","categories.flags":"Flags","categories.food-drink":"Food & Drink","categories.objects":"Objects","categories.people-body":"People & Body","categories.recents":"Recently Used","categories.smileys-emotion":"Smileys & Emotion","categories.symbols":"Symbols","categories.travel-places":"Travel & Places","error.load":"Failed to load emojis","recents.clear":"Clear recent emojis","recents.none":"You haven't selected any emojis yet.",retry:"Try again","search.clear":"Clear search","search.error":"Failed to search emojis","search.notFound":"No results found",search:"Search emojis..."},gy="PicMo";function by(e){return new wy(e)}by.deleteDatabase=function(e){return new Promise((function(t,n){var r=indexedDB.deleteDatabase("".concat(gy,"-").concat(e));r.addEventListener("success",t),r.addEventListener("error",n)}))};var wy=function(e){function t(){return Nm(this,t),Om(this,t,arguments)}return Mm(t,e),Fm(t,[{key:"open",value:(m=Wm(Sm().mark((function e(){var t,n=this;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=indexedDB.open("".concat(gy,"-").concat(this.locale)),e.abrupt("return",new Promise((function(e,r){t.addEventListener("success",(function(t){var r;n.db=null==(r=t.target)?void 0:r.result,e()})),t.addEventListener("error",r),t.addEventListener("upgradeneeded",function(){var e=Wm(Sm().mark((function e(t){var r,o;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.db=null==(r=t.target)?void 0:r.result,n.db.createObjectStore("category",{keyPath:"order"}),(o=n.db.createObjectStore("emoji",{keyPath:"emoji"})).createIndex("category","group"),o.createIndex("version","version"),n.db.createObjectStore("meta");case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"delete",value:(p=Wm(Sm().mark((function e(){var t;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.close(),t=indexedDB.deleteDatabase("".concat(gy,"-").concat(this.locale)),e.next=4,this.waitForRequest(t);case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"close",value:function(){this.db.close()}},{key:"getEmojiCount",value:(h=Wm(Sm().mark((function e(){var t;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.db.transaction("emoji","readonly").objectStore("emoji"),e.next=3,this.waitForRequest(t.count());case 3:return e.abrupt("return",e.sent.target.result);case 4:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getEtags",value:(d=Wm(Sm().mark((function e(){var t,n,r,o,i;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.db.transaction("meta","readonly").objectStore("meta"),e.next=3,Promise.all([this.waitForRequest(t.get("emojisEtag")),this.waitForRequest(t.get("messagesEtag"))]);case 3:return n=e.sent,r=_m(n,2),o=r[0],i=r[1],e.abrupt("return",{storedEmojisEtag:o.target.result,storedMessagesEtag:i.target.result});case 8:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"setMeta",value:(f=Wm(Sm().mark((function e(t){var n,r;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.db.transaction("meta","readwrite"),r=n.objectStore("meta"),e.abrupt("return",new Promise((function(e){n.oncomplete=e,Object.keys(t).filter(Boolean).forEach((function(e){r.put(t[e],e)}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"getHash",value:(l=Wm(Sm().mark((function e(){var t;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.db.transaction("meta","readonly").objectStore("meta"),e.next=3,this.waitForRequest(t.get("hash"));case 3:return e.abrupt("return",e.sent.target.result);case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"isPopulated",value:(c=Wm(Sm().mark((function e(){var t;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.db.transaction("category","readonly").objectStore("category"),e.next=3,this.waitForRequest(t.count());case 3:return e.t0=e.sent.target.result,e.abrupt("return",e.t0>0);case 5:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"populate",value:(u=Wm(Sm().mark((function e(t){var n,r,o,i,a,s;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.groups,r=t.emojis,o=t.emojisEtag,i=t.messagesEtag,a=t.hash,e.next=3,this.removeAllObjects("category","emoji");case 3:return s=[this.addObjects("category",n),this.addObjects("emoji",r),this.setMeta({emojisEtag:o,messagesEtag:i,hash:a})],e.next=6,Promise.all(s);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"getCategories",value:(s=Wm(Sm().mark((function e(t){var n,r,o,i;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.db.transaction("category","readonly").objectStore("category"),e.next=3,this.waitForRequest(r.getAll());case 3:return o=e.sent.target.result.filter((function(e){return"component"!==e.key})),t.showRecents&&o.unshift({key:"recents",order:-1}),null!=(n=t.custom)&&n.length&&o.push({key:"custom",order:10}),t.categories?(i=t.categories,(o=o.filter((function(e){return i.includes(e.key)}))).sort((function(e,t){return i.indexOf(e.key)-i.indexOf(t.key)}))):o.sort((function(e,t){return e.order-t.order})),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getEmojis",value:(a=Wm(Sm().mark((function e(t,n){var r,o;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.db.transaction("emoji","readonly").objectStore("emoji").index("category"),e.next=3,this.waitForRequest(r.getAll(t.order));case 3:return o=e.sent.target.result.filter((function(e){return e.version<=n})).sort((function(e,t){return null!=e.order&&null!=t.order?e.order-t.order:0})).map(Cv),e.abrupt("return",Av(o,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"searchEmojis",value:(i=Wm(Sm().mark((function e(t,n,r,o){var i,a=this;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[],e.abrupt("return",new Promise((function(e,s){var u=a.db.transaction("emoji","readonly").objectStore("emoji").openCursor();u.addEventListener("success",(function(a){var s,u=null==(s=a.target)?void 0:s.result;if(!u)return e([].concat(Vm(Av(i,r)),Vm(n.filter((function(e){return Dv(e,t)})))));var c=u.value;Dv(c,t,o)&&c.version<=r&&i.push(Cv(c)),u.continue()})),u.addEventListener("error",(function(e){s(e)}))})));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return i.apply(this,arguments)})},{key:"waitForRequest",value:(o=Wm(Sm().mark((function e(t){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.onsuccess=e,t.onerror=n})));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"withTransaction",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"readwrite",r=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=t.db.transaction(e,n);a.oncomplete=o,a.onerror=i,r(a)}))}},{key:"removeAllObjects",value:(r=Wm(Sm().mark((function e(){var t,n,r,o,i,a=this,s=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,n=new Array(t),r=0;r<t;r++)n[r]=s[r];return o=this.db.transaction(n,"readwrite"),i=n.map((function(e){return o.objectStore(e)})),e.next=4,Promise.all(i.map((function(e){return a.waitForRequest(e.clear())})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"addObjects",value:(n=Wm(Sm().mark((function e(t,n){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction(t,"readwrite",(function(e){var r=e.objectStore(t);n.forEach((function(e){r.add(e)}))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}]);var n,r,o,i,a,s,u,c,l,f,d,h,p,m}(Sv);function ky(){var e={};return{getItem:function(t){return e[t]},setItem:function(t,n){return e[t]=n},length:Object.keys(e).length,clear:function(){return e={}},key:function(t){return Object.keys(e)[t]},removeItem:function(t){return delete e[t]}}}var xy,Ey,Cy,Dy,Sy,Oy=Fm((function e(){Nm(this,e)})),Ay="PicMo:recents",jy=function(e){function t(e){var n;return Nm(this,t),(n=Om(this,t)).storage=e,n}return Mm(t,e),Fm(t,[{key:"clear",value:function(){this.storage.removeItem(Ay)}},{key:"getRecents",value:function(e){var t;try{return JSON.parse(null!=(t=this.storage.getItem(Ay))?t:"[]").slice(0,e)}catch(n){return[]}}},{key:"addOrUpdateRecent",value:function(e,t){var n=[e].concat(Vm(this.getRecents(t).filter((function(t){return t.hexcode!==e.hexcode})))).slice(0,t);try{this.storage.setItem(Ay,JSON.stringify(n))}catch(r){console.warn("storage is not available, recent emojis will not be saved")}}}])}(Oy),Ty=function(e){function t(){return Nm(this,t),Om(this,t,[xv("localStorage")?localStorage:ky()])}return Mm(t,e),Fm(t)}(jy),My={dataStore:by,theme:Jv,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:yy,locale:"en",maxRecents:50,custom:[]};function Ly(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Bm(Bm(Bm({},My),e),{},{renderer:e.renderer||new vy,recentsProvider:e.recentsProvider||new Ty})}var Py=function(){return Fm((function e(){Nm(this,e),Jm(this,Ey),Jm(this,Dy),Jm(this,xy,new Map)}),[{key:"on",value:function(e,t,n){Qm(this,Dy,Sy).call(this,e,t,n)}},{key:"once",value:function(e,t,n){Qm(this,Dy,Sy).call(this,e,t,n,!0)}},{key:"off",value:function(e,t){var n=Qm(this,Ey,Cy).call(this,e);Gm(this,xy).set(e,n.filter((function(e){return e.handler!==t})))}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];Qm(this,Ey,Cy).call(this,e).forEach((function(n){n.handler.apply(n.context,r),n.once&&t.off(e,n.handler)}))}},{key:"removeAll",value:function(){Gm(this,xy).clear()}}])}();xy=new WeakMap,Ey=new WeakSet,Cy=function(e){return Gm(this,xy).has(e)||Gm(this,xy).set(e,[]),Gm(this,xy).get(e)},Dy=new WeakSet,Sy=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Qm(this,Ey,Cy).call(this,e).push({context:n,handler:t,once:r})};var Fy=!0,Ny=function(e){function t(){return Nm(this,t),Om(this,t,arguments)}return Mm(t,e),Fm(t)}(Py),_y=function(e){function t(){return Nm(this,t),Om(this,t,arguments)}return Mm(t,e),Fm(t)}(Py),Ry=gv("emojiCategory","categoryName","noRecents","recentEmojis"),By=function(e){function t(e){var n,r=e.template,o=e.category,i=e.showVariants,a=e.lazyLoader;return Nm(this,t),(n=Om(this,t,[{template:r,classes:Ry}])).baseUIElements={categoryName:Yv.byClass(Ry.categoryName)},n.category=o,n.showVariants=i,n.lazyLoader=a,n}return Mm(t,e),Fm(t,[{key:"setActive",value:function(e,t,n){this.emojiContainer.setActive(e,t,n)}}])}(Yv),Iy=new cy((function(e){var t=e.classes,n=e.emoji;return'\n  <button\n    type="button"\n    class="'.concat(t.emojiButton,'"\n    title="').concat(n.label,'"\n    data-emoji="').concat(n.emoji,'"\n    tabindex="-1">\n    <div data-placeholder="emojiContent"></div>\n  </button>\n')})),zy=gv("emojiButton"),Hy=function(e){function t(e){var n,r=e.emoji,o=e.lazyLoader,i=e.category;return Nm(this,t),(n=Om(this,t,[{template:Iy,classes:zy}])).emoji=r,n.lazyLoader=o,n.category=i,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiEvents=[Yv.uiEvent("focus",this.handleFocus)],Em(t,"initialize",this,3)([])}},{key:"handleFocus",value:function(){this.category&&this.events.emit("focus:change",this.category)}},{key:"activateFocus",value:function(e){this.el.tabIndex=0,e&&this.el.focus()}},{key:"deactivateFocus",value:function(){this.el.tabIndex=-1}},{key:"renderSync",value:function(){return Em(t,"renderSync",this,3)([{emoji:this.emoji,emojiContent:this.renderer.doRender(this.emoji,this.lazyLoader)}])}}])}(Yv),Vy=function(){return Fm((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Nm(this,e),this.events=new Py,this.keyHandlers={ArrowLeft:this.focusPrevious.bind(this),ArrowRight:this.focusNext.bind(this),ArrowUp:this.focusUp.bind(this),ArrowDown:this.focusDown.bind(this)},this.rowCount=Math.ceil(n/t),this.columnCount=t,this.focusedRow=r,this.focusedColumn=o,this.emojiCount=n,this.wrap=i,this.handleKeyDown=this.handleKeyDown.bind(this)}),[{key:"destroy",value:function(){this.events.removeAll()}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"handleKeyDown",value:function(e){e.key in this.keyHandlers&&(e.preventDefault(),this.keyHandlers[e.key]())}},{key:"setCell",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.getIndex();this.focusedRow=e,void 0!==t&&(this.focusedColumn=Math.min(this.columnCount,t)),(this.focusedRow>=this.rowCount||this.getIndex()>=this.emojiCount)&&(this.focusedRow=this.rowCount-1,this.focusedColumn=this.emojiCount%this.columnCount-1),this.events.emit("focus:change",{from:r,to:this.getIndex(),performFocus:n})}},{key:"setFocusedIndex",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Math.floor(e/this.columnCount),r=e%this.columnCount;this.setCell(n,r,t)}},{key:"focusNext",value:function(){this.focusedColumn<this.columnCount-1&&this.getIndex()<this.emojiCount-1?this.setCell(this.focusedRow,this.focusedColumn+1):this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,0):this.wrap?this.setCell(0,0):this.events.emit("focus:overflow",0)}},{key:"focusPrevious",value:function(){this.focusedColumn>0?this.setCell(this.focusedRow,this.focusedColumn-1):this.focusedRow>0?this.setCell(this.focusedRow-1,this.columnCount-1):this.wrap?this.setCell(this.rowCount-1,this.columnCount-1):this.events.emit("focus:underflow",this.columnCount-1)}},{key:"focusUp",value:function(){this.focusedRow>0?this.setCell(this.focusedRow-1,this.focusedColumn):this.events.emit("focus:underflow",this.focusedColumn)}},{key:"focusDown",value:function(){this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,this.focusedColumn):this.events.emit("focus:overflow",this.focusedColumn)}},{key:"focusToIndex",value:function(e){this.setCell(Math.floor(e/this.columnCount),e%this.columnCount)}},{key:"getIndex",value:function(){return this.focusedRow*this.columnCount+this.focusedColumn}},{key:"getCell",value:function(){return{row:this.focusedRow,column:this.focusedColumn}}},{key:"getRowCount",value:function(){return this.rowCount}}])}(),$y=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.emojiContainer,'">\n    <div data-placeholder="emojis"></div>\n  </div>\n')})),qy=gv("emojiContainer"),Uy=function(e){function t(e){var n,r=e.emojis,o=e.showVariants,i=e.preview,a=void 0===i||i,s=e.lazyLoader,u=e.category,c=e.fullHeight,l=void 0!==c&&c;return Nm(this,t),(n=Om(this,t,[{template:$y,classes:qy}])).fullHeight=!1,n.showVariants=o,n.lazyLoader=s,n.preview=a,n.emojis=r,n.category=u,n.fullHeight=l,n.setFocus=n.setFocus.bind(Am(n)),n.triggerNextCategory=n.triggerNextCategory.bind(Am(n)),n.triggerPreviousCategory=n.triggerPreviousCategory.bind(Am(n)),n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.grid=new Vy(this.options.emojisPerRow,this.emojiCount,0,0,!this.category),this.grid.on("focus:change",this.setFocus),this.grid.on("focus:overflow",this.triggerNextCategory),this.grid.on("focus:underflow",this.triggerPreviousCategory),this.uiEvents=[Yv.uiEvent("click",this.selectEmoji),Yv.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(Yv.uiEvent("mouseover",this.showPreview),Yv.uiEvent("mouseout",this.hidePreview),Yv.uiEvent("focus",this.showPreview,{capture:!0}),Yv.uiEvent("blur",this.hidePreview,{capture:!0})),Em(t,"initialize",this,3)([])}},{key:"setFocusedView",value:function(e,t){var n=this;if(e)if("string"==typeof e){var r=this.emojis.findIndex((function(t){return t.emoji===e}));this.grid.setFocusedIndex(r,!1),setTimeout((function(){var e,t,o,i,a=n.emojiViews[r].el;a.scrollIntoView();var s=null==(e=a.parentElement)?void 0:e.previousElementSibling;(null==(o=null==(t=a.parentElement)?void 0:t.parentElement)?void 0:o.parentElement).scrollTop-=null!=(i=null==s?void 0:s.offsetHeight)?i:0}))}else"first"===e.row||0===e.row?this.grid.setCell(0,e.offset,t):"last"===e.row&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}},{key:"setActive",value:function(e,t,n){var r;e?this.setFocusedView(t,n):null==(r=this.emojiViews[this.grid.getIndex()])||r.deactivateFocus()}},{key:"renderSync",value:function(){var e=this;return this.emojiViews=this.emojis.map((function(t){return e.viewFactory.create(Hy,{emoji:t,category:e.category,lazyLoader:e.lazyLoader,renderer:e.renderer})})),this.emojiElements=this.emojiViews.map((function(e){return e.renderSync()})),Em(t,"renderSync",this,3)([{emojis:this.emojiElements,i18n:this.i18n}])}},{key:"destroy",value:function(){Em(t,"destroy",this,3)([]),this.emojiViews.forEach((function(e){return e.destroy()})),this.grid.destroy()}},{key:"triggerPreviousCategory",value:function(e){this.events.emit("category:previous",e)}},{key:"triggerNextCategory",value:function(e){this.category&&this.events.emit("category:next",e)}},{key:"setFocus",value:function(e){var t,n,r=e.from,o=e.to,i=e.performFocus;null==(t=this.emojiViews[r])||t.deactivateFocus(),null==(n=this.emojiViews[o])||n.activateFocus(i)}},{key:"selectEmoji",value:function(e){e.stopPropagation();var t=fv(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}},{key:"showPreview",value:function(e){var t=e.target.closest("button"),n=null==t?void 0:t.firstElementChild,r=fv(e,this.emojis);r&&this.events.emit("preview:show",r,null==n?void 0:n.cloneNode(!0))}},{key:"hidePreview",value:function(e){fv(e,this.emojis)&&this.events.emit("preview:hide")}},{key:"emojiCount",get:function(){return this.emojis.length}}])}(Yv),Wy=new cy((function(e){var t=e.classes,n=e.category,r=e.pickerId,o=e.icon,i=e.i18n;return'\n  <section class="'.concat(t.emojiCategory,'" role="tabpanel" aria-labelledby="').concat(r,"-category-").concat(n.key,'">\n    <h3 data-category="').concat(n.key,'" class="').concat(t.categoryName,'">\n      <i data-icon="').concat(o,'"></i>\n      ').concat(i.get("categories.".concat(n.key),n.message||n.key),'\n    </h3>\n    <div data-view="emojis" data-render="sync"></div>\n  </section>\n')})),Ky=function(e){function t(e){var n,r=e.category,o=e.showVariants,i=e.lazyLoader,a=e.emojiVersion;return Nm(this,t),(n=Om(this,t,[{category:r,showVariants:o,lazyLoader:i,template:Wy}])).showVariants=o,n.lazyLoader=i,n.emojiVersion=a,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements=Bm({},this.baseUIElements),Em(t,"initialize",this,3)([])}},{key:"render",value:(n=Wm(Sm().mark((function e(){var n;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.emojiDataPromise;case 2:return e.next=4,this.emojiData.getEmojis(this.category,this.emojiVersion);case 4:return n=e.sent,e.abrupt("return",(this.emojiContainer=this.viewFactory.create(Uy,{emojis:n,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),Em(t,"render",this,3)([{category:this.category,emojis:this.emojiContainer,emojiCount:n.length,icon:Xv[this.category.key]}])));case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n}(By),Gy=function(e){function t(e){var n=e.category,r=e.emojis,o=e.preview,i=void 0===o||o,a=e.lazyLoader;return Nm(this,t),Om(this,t,[{category:n,emojis:r,showVariants:!1,preview:i,lazyLoader:a}])}return Mm(t,e),Fm(t,[{key:"addOrUpdate",value:(n=Wm(Sm().mark((function e(t){var n,r,o,i;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=this.el.querySelector('[data-emoji="'.concat(t.emoji,'"]')))&&(this.el.removeChild(n),this.emojis=this.emojis.filter((function(e){return e!==t}))),r=this.viewFactory.create(Hy,{emoji:t}),this.el.insertBefore(r.renderSync(),this.el.firstChild),this.emojis=[t].concat(Vm(this.emojis.filter((function(e){return e!==t})))),this.emojis.length>this.options.maxRecents)for(this.emojis=this.emojis.slice(0,this.options.maxRecents),o=this.el.childElementCount-this.options.maxRecents,i=0;i<o;i++)this.el.lastElementChild&&this.el.removeChild(this.el.lastElementChild);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}]);var n}(Uy),Jy=new cy((function(e){var t=e.emojiCount,n=e.classes,r=e.category,o=e.pickerId,i=e.icon,a=e.i18n;return'\n  <section class="'.concat(n.emojiCategory,'" role="tabpanel" aria-labelledby="').concat(o,"-category-").concat(r.key,'">\n    <h3 data-category="').concat(r.key,'" class="').concat(n.categoryName,'">\n      <i data-icon="').concat(i,'"></i>\n      ').concat(a.get("categories.".concat(r.key),r.message||r.key),'\n    </h3>\n    <div data-empty="').concat(0===t,'" class="').concat(n.recentEmojis,'">\n      <div data-view="emojis" data-render="sync"></div>\n    </div>\n    <div class="').concat(n.noRecents,'">\n      ').concat(a.get("recents.none"),"\n    </div>\n  </section>\n")}),{mode:"async"}),Yy=function(e){function t(e){var n,r=e.category,o=e.lazyLoader,i=e.provider;return Nm(this,t),(n=Om(this,t,[{category:r,showVariants:!1,lazyLoader:o,template:Jy}])).provider=i,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements=Bm(Bm({},this.baseUIElements),{},{recents:Yv.byClass(Ry.recentEmojis)}),this.appEvents={"recent:add":this.addRecent},Em(t,"initialize",this,3)([])}},{key:"addRecent",value:(r=Wm(Sm().mark((function e(t){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.emojiContainer.addOrUpdate(t);case 2:this.ui.recents.dataset.empty="false";case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:(n=Wm(Sm().mark((function e(){var n,r;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null==(n=this.provider)?void 0:n.getRecents(this.options.maxRecents),this.emojiContainer=this.viewFactory.create(Gy,{emojis:r,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),e.next=4,Em(t,"render",this,3)([{category:this.category,emojis:this.emojiContainer,emojiCount:r.length,icon:Xv[this.category.key]}]);case 4:return e.abrupt("return",this.el);case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n,r}(By),Qy=new cy((function(e){var t=e.classes,n=e.category,r=e.pickerId,o=e.icon,i=e.i18n;return'\n  <section class="'.concat(t.emojiCategory,'" role="tabpanel" aria-labelledby="').concat(r,"-category-").concat(n.key,'">\n    <h3 data-category="').concat(n.key,'" class="').concat(t.categoryName,'">\n      <i data-icon="').concat(o,'"></i>\n      ').concat(i.get("categories.".concat(n.key),n.message||n.key),'\n    </h3>\n    <div data-view="emojis" data-render="sync"></div>\n  </section>\n')})),Xy=function(e){function t(e){var n=e.category,r=e.lazyLoader;return Nm(this,t),Om(this,t,[{template:Qy,showVariants:!1,lazyLoader:r,category:n}])}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements=Bm({},this.baseUIElements),Em(t,"initialize",this,3)([])}},{key:"render",value:(n=Wm(Sm().mark((function e(){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.emojiContainer=this.viewFactory.create(Uy,{emojis:this.customEmojis,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),Em(t,"render",this,3)([{category:this.category,emojis:this.emojiContainer,emojiCount:this.customEmojis.length,icon:Xv[this.category.key]}])));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n}(By),Zy=function(){return Fm((function e(){Nm(this,e),this.elements=new Map}),[{key:"lazyLoad",value:function(e,t){return this.elements.set(e,t),e}},{key:"observe",value:function(e){var t=this;if(window.IntersectionObserver){var n=new IntersectionObserver((function(e){e.filter((function(e){return e.intersectionRatio>0})).map((function(e){return e.target})).forEach((function(e){var r=t.elements.get(e);null==r||r(),n.unobserve(e)}))}),{root:e});this.elements.forEach((function(e,t){n.observe(t)}))}else this.elements.forEach((function(e){e()}))}}])}(),eg=gv("emojiArea"),tg=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.emojiArea,'">\n    <div data-placeholder="emojis"></div>\n  </div>\n')}),{mode:"async"}),ng={recents:Yy,custom:Xy};var rg=function(e){function t(e){var n,r=e.categoryTabs,o=e.categories,i=e.emojiVersion;return Nm(this,t),(n=Om(this,t,[{template:tg,classes:eg}])).selectedCategory=0,n.scrollListenerState="active",n.lazyLoader=new Zy,n.categoryTabs=r,n.categories=o,n.emojiVersion=i,n.handleScroll=function(e,t){var n=null;return function(){n||(n=window.setTimeout((function(){e(),n=null}),t))}}(n.handleScroll.bind(Am(n)),100),n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.appEvents={"category:select":this.handleCategorySelect,"category:previous":this.focusPreviousCategory,"category:next":this.focusNextCategory,"focus:change":this.updateFocusedCategory},this.uiElements={emojis:Yv.byClass(eg.emojiArea)},this.uiEvents=[Yv.uiEvent("scroll",this.handleScroll)],Em(t,"initialize",this,3)([])}},{key:"focusableEmoji",get:function(){return this.el.querySelector('[tabindex="0"]')}},{key:"render",value:(r=Wm(Sm().mark((function e(){var n,r=this;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.emojiCategories=this.categories.map(this.createCategory,this),n={},this.categories.forEach((function(e,t){n["emojis-".concat(e.key)]=r.emojiCategories[t]})),e.t0=Em(t,"render",this,3),e.next=6,Promise.all(this.emojiCategories.map((function(e){return e.render()})));case 6:return e.t1=e.sent,e.t2={emojis:e.t1},e.t3=[e.t2],e.next=11,(0,e.t0)(e.t3);case 11:return this.lazyLoader.observe(this.el),e.abrupt("return",this.el);case 13:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var e=this;Em(t,"destroy",this,3)([]),this.emojiCategories.forEach((function(t){var n;null==(n=e.observer)||n.unobserve(t.el),t.destroy()}))}},{key:"handleCategorySelect",value:function(e,t){this.el.style.overflow="hidden",this.selectCategory(e,t),this.el.style.overflow="auto"}},{key:"createCategory",value:function(e){var t=ng[e.key]||Ky;return this.viewFactory.create(t,{category:e,showVariants:!0,lazyLoader:this.lazyLoader,emojiVersion:this.emojiVersion,provider:this.options.recentsProvider})}},{key:"determineInitialCategory",value:function(){var e,t=this;return this.options.initialCategory&&this.categories.find((function(e){return e.key===t.options.initialCategory}))?this.options.initialCategory:null==(e=this.categories.find((function(e){return"recents"!==e.key})))?void 0:e.key}},{key:"determineFocusTarget",value:function(e){var t=this.emojiCategories.find((function(t){return t.category.key===e}));return this.options.initialEmoji&&(null==t?void 0:t.el.querySelector('[data-emoji="'.concat(this.options.initialEmoji,'"]')))?this.options.initialEmoji:"button"}},{key:"reset",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.emit("preview:hide");var t=this.determineInitialCategory();t&&(this.selectCategory(t,{focus:this.determineFocusTarget(t),performFocus:e,scroll:"jump"}),this.selectedCategory=this.getCategoryIndex(t))}},{key:"getCategoryIndex",value:function(e){return this.categories.findIndex((function(t){return t.key===e}))}},{key:"focusPreviousCategory",value:function(e){this.selectedCategory>0&&this.focusCategory(this.selectedCategory-1,{row:"last",offset:null!=e?e:this.options.emojisPerRow})}},{key:"focusNextCategory",value:function(e){this.selectedCategory<this.categories.length-1&&this.focusCategory(this.selectedCategory+1,{row:"first",offset:null!=e?e:0})}},{key:"focusCategory",value:function(e,t){this.selectCategory(e,{focus:t,performFocus:!0})}},{key:"selectCategory",value:(n=Wm(Sm().mark((function e(t){var n,r,o,i,a,s,u,c,l=arguments;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=l.length>1&&void 0!==l[1]?l[1]:{},this.scrollListenerState="suspend",o=Bm({performFocus:!1},n),i=o.focus,a=o.performFocus,s=o.scroll,this.emojiCategories[this.selectedCategory].setActive(!1),u=this.selectedCategory="number"==typeof t?t:this.getCategoryIndex(t),null==(r=this.categoryTabs)||r.setActiveTab(this.selectedCategory,{performFocus:a,scroll:"button"===i}),c=this.emojiCategories[u].el.offsetTop,this.emojiCategories[u].setActive(!0,(f=i)&&"button"!==f?f:{row:"first",offset:0},"button"!==i&&a),s&&(this.el.scrollTop=c),this.scrollListenerState="resume";case 8:case"end":return e.stop()}var f}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updateFocusedCategory",value:function(e){var t;this.categories[this.selectedCategory].key!==e&&(this.scrollListenerState="suspend",this.selectedCategory=this.getCategoryIndex(e),null==(t=this.categoryTabs)||t.setActiveTab(this.selectedCategory,{changeFocusable:!1,performFocus:!1}),this.scrollListenerState="resume")}},{key:"handleScroll",value:function(){var e=this;if("suspend"!==this.scrollListenerState&&this.categoryTabs)if("resume"!==this.scrollListenerState){var t=this.el.scrollTop,n=this.el.scrollHeight-this.el.offsetHeight,r=this.emojiCategories.findIndex((function(n,r){var o;return t<(null==(o=e.emojiCategories[r+1])?void 0:o.el.offsetTop)})),o={changeFocusable:!1,performFocus:!1,scroll:!1};0===t?this.categoryTabs.setActiveTab(0,o):Math.floor(t)===Math.floor(n)||r<0?this.categoryTabs.setActiveTab(this.categories.length-1,o):this.categoryTabs.setActiveTab(r,o)}else this.scrollListenerState="active"}}]);var n,r}(Yv),og=new cy((function(e){var t=e.classList,n=e.classes,r=e.icon,o=e.message;return'\n<div class="'.concat(t,'" role="alert">\n  <div class="').concat(n.iconContainer,'"><i data-size="10x" data-icon="').concat(r,'"></i></div>\n  <h3 class="').concat(n.title,'">').concat(o,"</h3>\n</div>\n")})),ig=gv("error","iconContainer","title"),ag=function(e){function t(e){var n,r=e.message,o=e.icon,i=void 0===o?"warning":o,a=e.template,s=void 0===a?og:a,u=e.className;return Nm(this,t),(n=Om(this,t,[{template:s,classes:ig}])).message=r,n.icon=i,n.className=u,n}return Mm(t,e),Fm(t,[{key:"renderSync",value:function(){var e=[ig.error,this.className].join(" ").trim();return Em(t,"renderSync",this,3)([{message:this.message,icon:this.icon,classList:e}])}}])}(Yv),sg=new cy((function(e){var t=e.classList,n=e.classes,r=e.icon,o=e.i18n,i=e.message;return'\n  <div class="'.concat(t,'" role="alert">\n    <div class="').concat(n.icon,'"><i data-size="10x" data-icon="').concat(r,'"></i></div>\n    <h3 class="').concat(n.title,'">').concat(i,'</h3>\n    <button type="button">').concat(o.get("retry"),"</button>\n  </div>\n")})),ug=gv("dataError"),cg=function(e){function t(e){var n=e.message;return Nm(this,t),Om(this,t,[{message:n,template:sg,className:ug.dataError}])}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={retryButton:"button"},this.uiEvents=[Yv.childEvent("retryButton","click",this.onRetry)],Em(t,"initialize",this,3)([])}},{key:"onRetry",value:(n=Wm(Sm().mark((function e(){var t;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.emojiData){e.next=5;break}return e.next=3,this.emojiData.delete();case 3:e.next=7;break;case 5:return e.next=7,this.options.dataStore.deleteDatabase(this.options.locale);case 7:return this.events.emit("reinitialize"),e.next=10,Uv(this.options.locale,this.options.dataStore,this.options.messages,this.options.emojiData,this.emojiData);case 10:t=e.sent,this.viewFactory.setEmojiData(t),this.events.emit("data:ready",t);case 12:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]);var n}(ag),lg=gv("preview","previewEmoji","previewName","tagList","tag"),fg=new cy((function(e){var t=e.classes,n=e.tag;return'\n  <li class="'.concat(t.tag,'">').concat(n,"</li>\n")})),dg=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.preview,'">\n    <div class="').concat(t.previewEmoji,'"></div>\n    <div class="').concat(t.previewName,'"></div>\n    <ul class="').concat(t.tagList,'"></ul>\n  </div>\n')})),hg=function(e){function t(){return Nm(this,t),Om(this,t,[{template:dg,classes:lg}])}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={emoji:Yv.byClass(lg.previewEmoji),name:Yv.byClass(lg.previewName),tagList:Yv.byClass(lg.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},Em(t,"initialize",this,3)([])}},{key:"showPreview",value:function(e,t){if(kv(this.ui.emoji,t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";var n=e.tags.map((function(e){return fg.renderSync({tag:e,classes:lg})}));kv.apply(void 0,[this.ui.tagList].concat(Vm(n)))}}},{key:"hidePreview",value:function(){wv(this.ui.emoji),wv(this.ui.name),wv(this.ui.tagList)}}])}(Yv),pg=new cy((function(e){var t=e.classes,n=e.i18n;return'\n  <button title="'.concat(n.get("search.clear"),'" class="').concat(t.clearSearchButton,'">\n    <i data-icon="xmark"></i>\n  </button>\n')})),mg=new cy((function(e){var t=e.classes,n=e.i18n;return'\n<div class="'.concat(t.searchContainer,'">\n  <input class="').concat(t.searchField,'" placeholder="').concat(n.get("search"),'">\n  <span class="').concat(t.searchAccessory,'"></span>\n</div>\n')}),{mode:"async"}),vg=gv("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound"),yg=function(e){function t(e){var n,r=e.categories,o=e.emojiVersion;return Nm(this,t),(n=Om(this,t,[{template:mg,classes:vg}])).categories=r.filter((function(e){return"recents"!==e.key})),n.emojiVersion=o,n.search=function(e,t){var n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&window.clearTimeout(n),n=window.setTimeout((function(){e.apply(void 0,o),n=null}),t)}}(n.search.bind(Am(n)),100),n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={searchField:Yv.byClass(vg.searchField),searchAccessory:Yv.byClass(vg.searchAccessory)},this.uiEvents=[Yv.childEvent("searchField","keydown",this.onKeyDown),Yv.childEvent("searchField","input",this.onSearchInput)],Em(t,"initialize",this,3)([])}},{key:"render",value:(r=Wm(Sm().mark((function e(){var n=this;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Em(t,"render",this,3)([]);case 2:return this.searchIcon=Zv("search"),this.notFoundMessage=this.viewFactory.create(ag,{message:this.i18n.get("search.notFound"),className:vg.notFound,icon:"sad"}),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(ag,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=pg.render({classes:vg,i18n:this.i18n}),this.clearSearchButton.addEventListener("click",(function(e){return n.onClearSearch(e)})),this.searchField=this.ui.searchField,this.showSearchIcon(),e.abrupt("return",this.el);case 12:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"showSearchIcon",value:function(){this.showSearchAccessory(this.searchIcon)}},{key:"showClearSearchButton",value:function(){this.showSearchAccessory(this.clearSearchButton)}},{key:"showSearchAccessory",value:function(e){kv(this.ui.searchAccessory,e)}},{key:"clear",value:function(){this.searchField.value="",this.showSearchIcon()}},{key:"focus",value:function(){this.searchField.focus()}},{key:"onClearSearch",value:function(e){var t;e.stopPropagation(),this.searchField.value="",null==(t=this.resultsContainer)||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}},{key:"handleResultsKeydown",value:function(e){this.resultsContainer&&"Escape"===e.key&&this.onClearSearch(e)}},{key:"onKeyDown",value:function(e){var t;"Escape"===e.key&&this.searchField.value?this.onClearSearch(e):("Enter"===e.key||"ArrowDown"===e.key)&&this.resultsContainer&&(e.preventDefault(),null==(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))||t.focus())}},{key:"onSearchInput",value:function(e){this.searchField.value?(this.showClearSearchButton(),this.search()):this.onClearSearch(e)}},{key:"search",value:(n=Wm(Sm().mark((function e(){var t,n,r,o=this;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.searchField.value){e.next=11;break}return e.prev=1,e.next=4,this.emojiData.searchEmojis(this.searchField.value,this.customEmojis,this.emojiVersion,this.categories);case 4:n=e.sent,this.events.emit("preview:hide"),n.length?(r=new Zy,this.resultsContainer=this.viewFactory.create(Uy,{emojis:n,fullHeight:!0,showVariants:!0,lazyLoader:r}),this.resultsContainer.renderSync(),null!=(t=this.resultsContainer)&&t.el&&(r.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",(function(e){return o.handleResultsKeydown(e)})),this.events.emit("content:show",this.resultsContainer))):this.events.emit("content:show",this.notFoundMessage),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),this.events.emit("content:show",this.errorMessage);case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return n.apply(this,arguments)})}]);var n,r}(Yv),gg=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.variantOverlay,'">\n    <div class="').concat(t.variantPopup,'">\n      <div data-view="emojis" data-render="sync"></div>\n    </div>\n  </div>\n')})),bg=gv("variantOverlay","variantPopup"),wg={easing:"ease-in-out",duration:250,fill:"both"},kg={opacity:[0,1]},xg={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]},Eg=function(e){function t(e){var n,r=e.emoji,o=e.parent;return Nm(this,t),(n=Om(this,t,[{template:gg,classes:bg,parent:o}])).focusedEmojiIndex=0,n.focusTrap=new Kv,n.animateShow=function(){return Promise.all([pv(n.el,kg,wg,n.options),pv(n.ui.popup,xg,wg,n.options)])},n.emoji=r,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={popup:Yv.byClass(bg.variantPopup)},this.uiEvents=[Yv.uiEvent("click",this.handleClick),Yv.uiEvent("keydown",this.handleKeydown)],Em(t,"initialize",this,3)([])}},{key:"animateHide",value:function(){var e=Bm(Bm({},wg),{},{direction:"reverse"});return Promise.all([pv(this.el,kg,e,this.options),pv(this.ui.popup,xg,e,this.options)])}},{key:"hide",value:(n=Wm(Sm().mark((function e(){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.animateHide();case 2:this.events.emit("variantPopup:hide");case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleKeydown",value:function(e){"Escape"===e.key&&(this.hide(),e.stopPropagation())}},{key:"handleClick",value:function(e){this.ui.popup.contains(e.target)||this.hide()}},{key:"getEmoji",value:function(e){return this.renderedEmojis[e]}},{key:"setFocusedEmoji",value:function(e){this.getEmoji(this.focusedEmojiIndex).tabIndex=-1,this.focusedEmojiIndex=e;var t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=0,t.focus()}},{key:"destroy",value:function(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),Em(t,"destroy",this,3)([])}},{key:"renderSync",value:function(){var e=this,n=Bm(Bm({},this.emoji),{},{skins:null}),r=(this.emoji.skins||[]).map((function(t){return Bm(Bm({},t),{},{label:e.emoji.label,tags:e.emoji.tags})})),o=[n].concat(Vm(r));return this.emojiContainer=this.viewFactory.create(Uy,{emojis:o,preview:!1}),Em(t,"renderSync",this,3)([{emojis:this.emojiContainer}]),o.length<this.options.emojisPerRow&&this.el.style.setProperty("--emojis-per-row",o.length.toString()),this.el}},{key:"activate",value:function(){this.emojiContainer.setActive(!0,{row:0,offset:0},!0),this.focusTrap.activate(this.el)}}]);var n}(Yv),Cg=new cy((function(e){var t=e.classes,n=e.i18n,r=e.category,o=e.pickerId,i=e.icon;return'\n<li class="'.concat(t.categoryTab,'">\n  <button\n    aria-selected="false"\n    role="tab"\n    class="').concat(t.categoryButton,'"\n    tabindex="-1"\n    title="').concat(n.get("categories.".concat(r.key),r.message||r.key),'"\n    type="button"\n    data-category="').concat(r.key,'"\n    id="').concat(o,"-category-").concat(r.key,'"\n  >\n    <i data-icon="').concat(i,'"></i>\n</li>\n')})),Dg=gv("categoryTab","categoryTabActive","categoryButton"),Sg=function(e){function t(e){var n,r=e.category,o=e.icon;return Nm(this,t),(n=Om(this,t,[{template:Cg,classes:Dg}])).isActive=!1,n.category=r,n.icon=o,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={button:Yv.byClass(Dg.categoryButton)},this.uiEvents=[Yv.childEvent("button","click",this.selectCategory),Yv.childEvent("button","focus",this.selectCategory)],Em(t,"initialize",this,3)([])}},{key:"renderSync",value:function(){return Em(t,"renderSync",this,3)([{category:this.category,icon:this.icon}]),this.ui.button.ariaSelected="false",this.el}},{key:"setActive",value:function(e){var t=Bm({changeFocusable:!0,performFocus:!0,scroll:!0},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),n=t.changeFocusable,r=t.performFocus,o=t.scroll;this.el.classList.toggle(Dg.categoryTabActive,e),n&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&r&&(this.ui.button.focus(),o&&this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!1})),this.isActive=e}},{key:"selectCategory",value:function(){this.isActive||this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!0})}}])}(Yv),Og=new cy((function(e){var t=e.classes;return'\n  <div class="'.concat(t.categoryButtonsContainer,'">\n    <ul role="tablist" class="').concat(t.categoryButtons,'">\n      <div data-placeholder="tabs"></div>\n    </ul>\n  </div>\n')})),Ag=gv("categoryButtons","categoryButtonsContainer"),jg=function(e){function t(e){var n,r=e.categories;return Nm(this,t),(n=Om(this,t,[{template:Og,classes:Ag}])).activeCategoryIndex=0,n.categories=r,n}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},this.uiEvents=[Yv.uiEvent("scroll",this.checkOverflow)],Em(t,"initialize",this,3)([])}},{key:"checkOverflow",value:function(){var e=Math.abs(this.el.scrollLeft-(this.el.scrollWidth-this.el.offsetWidth))>1,t=this.el.scrollLeft>0;this.el.className="categoryButtonsContainer",t&&e?this.el.classList.add("has-overflow-both"):t?this.el.classList.add("has-overflow-left"):e&&this.el.classList.add("has-overflow-right")}},{key:"renderSync",value:function(){var e=this;return this.tabViews=this.categories.map((function(t){return e.viewFactory.create(Sg,{category:t,icon:Xv[t.key]})})),Em(t,"renderSync",this,3)([{tabs:this.tabViews.map((function(e){return e.renderSync()}))}]),this.el}},{key:"currentCategory",get:function(){return this.categories[this.activeCategoryIndex]}},{key:"currentTabView",get:function(){return this.tabViews[this.activeCategoryIndex]}},{key:"setActiveTab",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.checkOverflow();var n=this.currentTabView,r=this.tabViews[e];n.setActive(!1,t),r.setActive(!0,t),this.activeCategoryIndex=e}},{key:"getTargetCategory",value:function(e){return e<0?this.categories.length-1:e>=this.categories.length?0:e}},{key:"stepSelectedTab",value:function(e){var t=this;return function(){var n=t.activeCategoryIndex+e;t.setActiveTab(t.getTargetCategory(n),{changeFocusable:!0,performFocus:!0})}}}])}(Yv),Tg=[{version:15,emoji:String.fromCodePoint(129768)},{version:14,emoji:String.fromCodePoint(128733)},{version:13,emoji:String.fromCodePoint(129729)},{version:12,emoji:String.fromCodePoint(129449)},{version:11,emoji:String.fromCodePoint(129463)},{version:5,emoji:String.fromCodePoint(129322)},{version:4,emoji:String.fromCodePoint(9877)},{version:3,emoji:String.fromCodePoint(129314)},{version:2,emoji:String.fromCodePoint(128488)},{version:1,emoji:String.fromCodePoint(128512)}];function Mg(){var e,t=Tg.find((function(e){return function(e){var t=document.createElement("canvas").getContext("2d");if(t)return t.textBaseline="top",t.font="32px Arial",t.fillText(e,0,0),0!==t.getImageData(16,16,1,1).data[0]}(e.emoji)}));return null!=(e=null==t?void 0:t.version)?e:1}function Lg(e,t){return Array.from({length:e},(function(){return t})).join("")}function Pg(e){var t,n,r,o=e.emojiCount,i=e.classes,a=e.theme,s=e.className,u=e.categoryCount;return'\n    <div class="picmo__picker '.concat(i.skeleton," ").concat(i.picker," ").concat(a," ").concat(s,'">\n      ').concat((t=e,n=t.showHeader,r=t.classes,n?'\n    <header class="'.concat(r.headerSkeleton,'">\n      ').concat(function(e){var t=e.showSearch,n=e.classes;return t?'\n    <div class="'.concat(n.searchSkeleton,'">\n      <div class="').concat(n.searchInput," ").concat(n.placeholder,'"></div>\n    </div>\n  '):""}(e),"\n      ").concat(function(e){var t=e.showCategoryTabs,n=e.classes;return t?'\n    <div class="'.concat(n.categoryTabsSkeleton,'">\n      ').concat(Lg(u,'<div class="'.concat(n.placeholder," ").concat(n.categoryTab,'"></div>')),"\n    </div>\n  "):""}(e),"\n    </header>\n  "):""),'\n      <div class="').concat(i.contentSkeleton,'">\n        <div class="').concat(i.placeholder," ").concat(i.categoryName,'"></div>\n        <div class="').concat(i.emojiGrid,'">\n          ').concat(Lg(o,'<div class="'.concat(i.placeholder," ").concat(i.emoji,'"></div>')),"\n        </div>\n      </div>\n      ").concat(function(e){var t=e.showPreview,n=e.classes;return t?'\n    <div class="'.concat(n.previewSkeleton,'">\n      <div class="').concat(n.placeholder," ").concat(n.previewEmoji,'"></div>\n      <div class="').concat(n.placeholder," ").concat(n.previewName,'"></div>\n      <ul class="').concat(n.tagList,'">\n        ').concat(Lg(3,'<li class="'.concat(n.placeholder," ").concat(n.tag,'"></li>')),"\n      </ul>\n    </div>\n  "):""}(e),"\n    </div>\n  ")}var Fg,Ng=new cy((function(e){return e.isLoaded?function(e){var t=e.classes,n=e.theme,r=e.className,o=void 0===r?"":r;return'\n    <div class="picmo__picker '.concat(t.picker," ").concat(n," ").concat(o,'">\n      ').concat(function(e){var t=e.showHeader,n=e.classes;return t?'\n    <header class="'.concat(n.header,'">\n      <div data-view="search"></div>\n      <div data-view="categoryTabs" data-render="sync"></div>\n    </header>\n  '):""}(e),'\n      <div class="').concat(t.content,'">\n        <div data-view="emojiArea"></div>\n      </div>\n      <div data-view="preview"></div>\n    </div>\n  ')}(e):Pg(e)})),_g=gv("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","headerSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),Rg={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"},Bg=function(e){function t(){var e;return Nm(this,t),(e=Om(this,t,[{template:Ng,classes:_g}])).pickerReady=!1,e.externalEvents=new _y,e.updaters={styleProperty:function(t){return function(n){return e.el.style.setProperty(Rg[t],n.toString())}},theme:function(t){var n=e.options.theme,r=e.el.closest(".".concat(n));e.el.classList.remove(n),null==r||r.classList.remove(n),e.el.classList.add(t),null==r||r.classList.add(t)},className:function(t){e.options.className&&e.el.classList.remove(e.options.className),e.el.classList.add(t)},emojisPerRow:e.updateStyleProperty.bind(Am(e),"emojisPerRow"),emojiSize:e.updateStyleProperty.bind(Am(e),"emojiSize"),visibleRows:e.updateStyleProperty.bind(Am(e),"visibleRows")},e}return Mm(t,e),Fm(t,[{key:"initialize",value:function(){this.uiElements={pickerContent:Yv.byClass(_g.content),header:Yv.byClass(_g.header)},this.uiEvents=[Yv.uiEvent("keydown",this.handleKeyDown)],this.appEvents={error:this.onError,reinitialize:this.reinitialize,"data:ready":this.onDataReady,"content:show":this.showContent,"variantPopup:hide":this.hideVariantPopup,"emoji:select":this.selectEmoji},Em(t,"initialize",this,3)([]),this.options.recentsProvider}},{key:"destroy",value:function(){var e,n;Em(t,"destroy",this,3)([]),null==(e=this.search)||e.destroy(),this.emojiArea.destroy(),null==(n=this.categoryTabs)||n.destroy(),this.events.removeAll(),this.externalEvents.removeAll()}},{key:"clearRecents",value:function(){this.options.recentsProvider.clear()}},{key:"addEventListener",value:function(e,t){this.externalEvents.on(e,t)}},{key:"removeEventListener",value:function(e,t){this.externalEvents.off(e,t)}},{key:"initializePickerView",value:function(){this.pickerReady&&(this.showContent(),this.emojiArea.reset(!1))}},{key:"handleKeyDown",value:function(e){var t=e.ctrlKey||e.metaKey;"s"===e.key&&t&&this.search&&(e.preventDefault(),this.search.focus())}},{key:"buildChildViews",value:function(){return this.options.showPreview&&(this.preview=this.viewFactory.create(hg)),this.options.showSearch&&(this.search=this.viewFactory.create(yg,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(jg,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(rg,{categoryTabs:this.categoryTabs,categories:this.categories,emojiVersion:this.emojiVersion}),[this.preview,this.search,this.emojiArea,this.categoryTabs]}},{key:"setStyleProperties",value:function(){var e=this;this.options.showSearch||this.el.style.setProperty("--search-height-full","0px"),this.options.showCategoryTabs||(this.el.style.setProperty("--category-tabs-height","0px"),this.el.style.setProperty("--category-tabs-offset","0px")),this.options.showPreview||this.el.style.setProperty("--emoji-preview-height-full","0px"),Object.keys(Rg).forEach((function(t){e.options[t]&&e.el.style.setProperty(Rg[t],e.options[t].toString())}))}},{key:"updateStyleProperty",value:function(e,t){this.el.style.setProperty(Rg[e],t.toString())}},{key:"reinitialize",value:function(){this.renderSync()}},{key:"onError",value:function(e){var t=this.viewFactory.createWithOptions({data:!1},cg,{message:this.i18n.get("error.load")}),n=this.el.offsetHeight||375;throw this.el.style.height="".concat(n,"px"),kv(this.el,t.renderSync()),e}},{key:"onDataReady",value:(i=Wm(Sm().mark((function e(n){var r,o,i,a,s,u,c;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.el,e.prev=1,!n){e.next=6;break}this.emojiData=n,e.next=8;break;case 6:return e.next=8,this.emojiDataPromise;case 8:return"auto"===this.options.emojiVersion?this.emojiVersion=Mg()||parseFloat("14.0"):this.emojiVersion=this.options.emojiVersion,e.next=11,this.emojiData.getCategories(this.options);case 11:return this.categories=e.sent,o=this.buildChildViews(),i=_m(o,4),a=i[0],s=i[1],u=i[2],c=i[3],e.next=15,Em(t,"render",this,3)([{isLoaded:!0,search:s,categoryTabs:c,emojiArea:u,preview:a,showHeader:Boolean(this.search||this.categoryTabs),theme:this.options.theme,className:this.options.className}]);case 15:this.el.style.setProperty("--category-count",this.categories.length.toString()),this.pickerReady=!0,r.replaceWith(this.el),this.setStyleProperties(),this.initializePickerView(),this.setInitialFocus(),this.externalEvents.emit("data:ready"),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(1),this.events.emit("error",e.t0);case 27:case"end":return e.stop()}}),e,this,[[1,24]])}))),function(e){return i.apply(this,arguments)})},{key:"renderSync",value:function(){var e,n=(null==(e=this.options.categories)?void 0:e.length)||10;if(this.options.showRecents&&(n+=1),Em(t,"renderSync",this,3)([{isLoaded:!1,theme:this.options.theme,className:this.options.className,showSearch:this.options.showSearch,showPreview:this.options.showPreview,showCategoryTabs:this.options.showCategoryTabs,showHeader:this.options.showSearch||this.options.showCategoryTabs,emojiCount:this.options.emojisPerRow*this.options.visibleRows,categoryCount:n}]),this.el.style.setProperty("--category-count",n.toString()),!this.options.rootElement)throw new Error("Picker must be given a root element via the rootElement option");return kv(this.options.rootElement,this.el),this.setStyleProperties(),this.pickerReady&&this.initializePickerView(),this.el}},{key:"getInitialFocusTarget",value:function(){if(xm(this.options.autoFocus)<"u")switch(this.options.autoFocus){case"emojis":return this.emojiArea.focusableEmoji;case"search":return this.search;case"auto":return this.search||this.emojiArea.focusableEmoji;default:return null}if(!0===this.options.autoFocusSearch)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}},{key:"setInitialFocus",value:function(){var e;!this.pickerReady||null==(e=this.getInitialFocusTarget())||e.focus()}},{key:"reset",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.pickerReady&&(this.emojiArea.reset(t),this.showContent(this.emojiArea)),null==(e=this.search)||e.clear(),this.hideVariantPopup()}},{key:"showContent",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.emojiArea;n!==this.currentView&&(this.currentView!==this.emojiArea&&(null==(e=this.currentView)||e.destroy()),this.ui.pickerContent.classList.toggle(_g.fullHeight,n!==this.emojiArea),kv(this.ui.pickerContent,n.el),this.currentView=n,n===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):null==(t=this.categoryTabs)||t.el.remove())}},{key:"hideVariantPopup",value:function(){var e;null==(e=this.variantPopup)||e.destroy()}},{key:"isPickerClick",value:function(e){var t,n,r=e.target,o=this.el.contains(r),i=null==(n=null==(t=this.variantPopup)?void 0:t.el)?void 0:n.contains(r);return o||i}},{key:"selectEmoji",value:(o=Wm(Sm().mark((function e(t){var n,r,o;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.emoji,!(null==(r=n.skins)?void 0:r.length)||!this.options.showVariants||this.isVariantPopupOpen){e.next=5;break}this.showVariantPopup(n),e.next=10;break;case 5:return e.next=7,null==(o=this.variantPopup)?void 0:o.animateHide();case 7:return this.events.emit("variantPopup:hide"),e.next=10,this.emitEmoji(n);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"isVariantPopupOpen",get:function(){return this.variantPopup&&!this.variantPopup.isDestroyed}},{key:"showVariantPopup",value:(r=Wm(Sm().mark((function e(t){var n;return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=document.activeElement,this.events.once("variantPopup:hide",(function(){null==n||n.focus()})),this.variantPopup=this.viewFactory.create(Eg,{emoji:t,parent:this.el}),this.el.appendChild(this.variantPopup.renderSync()),this.variantPopup.activate();case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"emitEmoji",value:(n=Wm(Sm().mark((function e(t){return Sm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this.externalEvents,e.next=3,this.renderer.doEmit(t);case 3:e.t1=e.sent,e.t0.emit.call(e.t0,"emoji:select",e.t1),this.options.recentsProvider.addOrUpdateRecent(t,this.options.maxRecents),this.events.emit("recent:add",t);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updateOptions",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.updaters[n](e[n])})),Object.assign(this.options,e)}}]);var n,r,o,i}(Yv),Ig=function(){return Fm((function e(t){var n=t.events,r=t.i18n,o=t.renderer,i=t.emojiData,a=t.options,s=t.customEmojis,u=void 0===s?[]:s,c=t.pickerId;Nm(this,e),this.events=n,this.i18n=r,this.renderer=o,this.emojiData=i,this.options=a,this.customEmojis=u,this.pickerId=c}),[{key:"setEmojiData",value:function(e){this.emojiData=Promise.resolve(e)}},{key:"createWithOptions",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=function(e,t,n){if(jm())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Lm(o,n.prototype),o}(t,r);return i.setPickerId(this.pickerId),i.setEvents(this.events),i.setI18n(this.i18n),i.setRenderer(this.renderer),!1!==e.data&&i.setEmojiData(this.emojiData),i.setOptions(this.options),i.setCustomEmojis(this.customEmojis),i.viewFactory=this,i.initialize(),i}},{key:"create",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.createWithOptions.apply(this,[{},e].concat(n))}}])}(),zg=function(){return Fm((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Nm(this,e),Jm(this,Fg,void 0),Ym(this,Fg,new Map(Object.entries(t)))}),[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Gm(this,Fg).get(e)||t}}])}();function Hg(){var e=!1;return function(t){Fy&&!e&&(function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&!(("undefined"===typeof document?"undefined":xm(document))>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(t),e=!0)}}Fg=new WeakMap;var Vg,$g=0;var qg=Hg();function Ug(e){qg('.picmo__picker .picmo__icon{width:1.25em;height:1em;fill:currentColor}.picmo__icon-small{font-size:.8em}.picmo__icon-medium{font-size:1em}.picmo__icon-large{font-size:1.25em}.picmo__icon-2x{font-size:2em}.picmo__icon-3x{font-size:3em}.picmo__icon-4x{font-size:4em}.picmo__icon-5x{font-size:5em}.picmo__icon-8x{font-size:8em}.picmo__icon-10x{font-size:10em}.picmo__light,.picmo__auto{color-scheme:light;--accent-color: #4f46e5;--background-color: #f9fafb;--border-color: #cccccc;--category-name-background-color: #f9fafb;--category-name-button-color: #999999;--category-name-text-color: hsl(214, 30%, 50%);--category-tab-active-background-color: rgba(255, 255, 255, .6);--category-tab-active-color: var(--accent-color);--category-tab-color: #666;--category-tab-highlight-background-color: rgba(0, 0, 0, .15);--error-color-dark: hsl(0, 100%, 45%);--error-color: hsl(0, 100%, 40%);--focus-indicator-background-color: hsl(198, 65%, 85%);--focus-indicator-color: #333333;--hover-background-color: #c7d2fe;--placeholder-background-color: #cccccc;--search-background-color: #f9fafb;--search-focus-background-color: #ffffff;--search-icon-color: #999999;--search-placeholder-color: #71717a;--secondary-background-color: #e2e8f0;--secondary-text-color: #666666;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #000000;--variant-popup-background-color: #ffffff}.picmo__dark{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}@media (prefers-color-scheme: dark){.picmo__auto{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}}.picmo__picker .picmo__categoryButtonsContainer{overflow:auto;padding:2px 0}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-right{mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-left{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-both{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%)}.picmo__picker .picmo__categoryButtons{display:flex;flex-direction:row;gap:var(--tab-gap);margin:0;padding:0 .5em;align-items:center;height:var(--category-tabs-height);box-sizing:border-box;width:100%;justify-content:space-between;position:relative;list-style-type:none;justify-self:center;max-width:min(23.55rem,calc(var(--category-count, 1) * 2.5rem))}.picmo__picker .picmo__categoryButtons .picmo__categoryTab{display:flex;align-items:center;transition:all .1s;width:2em}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton{color:var(--category-tab-active-color);background:linear-gradient(rgba(255,255,255,.75) 0%,rgba(255,255,255,.75) 100%),linear-gradient(var(--category-tab-active-color) 0%,var(--category-tab-active-color) 100%);border:2px solid var(--category-tab-active-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton:hover{background-color:var(--category-tab-active-background-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton{border-radius:5px;background:transparent;border:2px solid transparent;color:var(--category-tab-color);cursor:pointer;padding:2px;vertical-align:middle;display:flex;align-items:center;justify-content:center;font-size:1.2rem;width:1.6em;height:1.6em;transition:all .1s}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:is(img){width:var(--category-tab-size);height:var(--category-tab-size)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:hover{background:var(--category-tab-highlight-background-color)}.picmo__dataError [data-icon]{opacity:.8}@keyframes appear{0%{opacity:0}to{opacity:.8}}@keyframes appear-grow{0%{opacity:0;transform:scale(.8)}to{opacity:.8;transform:scale(1)}}.picmo__picker .picmo__error{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--secondary-text-color)}.picmo__picker .picmo__error .picmo__iconContainer{opacity:.8;animation:appear-grow .25s cubic-bezier(.175,.885,.32,1.275);--color-primary: var(--error-color);--color-secondary: var(--error-color-dark)}.picmo__picker .picmo__error .picmo__title{animation:appear .25s;animation-delay:50ms;animation-fill-mode:both}.picmo__picker .picmo__error button{padding:8px 16px;cursor:pointer;background:var(--background-color);border:1px solid var(--text-color);border-radius:5px;color:var(--text-color)}.picmo__picker .picmo__error button:hover{background:var(--text-color);color:var(--background-color)}.picmo__emojiButton{background:transparent;border:none;border-radius:15px;cursor:pointer;display:flex;font-family:var(--emoji-font);font-size:var(--emoji-size);height:100%;justify-content:center;align-items:center;margin:0;overflow:hidden;padding:0;width:100%}.picmo__emojiButton:hover{background:var(--hover-background-color)}.picmo__emojiButton:focus{border-radius:0;background:var(--focus-indicator-background-color);outline:1px solid var(--focus-indicator-color)}.picmo__picker .picmo__emojiArea{height:var(--emoji-area-height);overflow-y:auto;position:relative}.picmo__picker .picmo__emojiCategory{position:relative}.picmo__picker .picmo__emojiCategory .picmo__categoryName{font-size:.9em;padding:.5rem;margin:0;background:var(--category-name-background-color);color:var(--category-name-text-color);top:0;z-index:1;display:grid;gap:4px;grid-template-columns:auto 1fr auto;align-items:center;line-height:1;box-sizing:border-box;height:var(--category-name-height);justify-content:flex-start;text-transform:uppercase}.picmo__picker .picmo__emojiCategory .picmo__categoryName button{background:transparent;border:none;display:flex;align-items:center;cursor:pointer;color:var(--category-name-button-color)}.picmo__picker .picmo__emojiCategory .picmo__categoryName button:hover{opacity:1}.picmo__picker .picmo__emojiCategory .picmo__noRecents{color:var(--secondary-text-color);grid-column:1 / span var(--emojis-per-row);font-size:.9em;text-align:center;display:flex;align-items:center;justify-content:center;min-height:calc(var(--emoji-size) * var(--emoji-size-multiplier))}.picmo__picker .picmo__emojiCategory .picmo__recentEmojis[data-empty=true]{display:none}:is(.picmo__picker .picmo__emojiCategory) .picmo__recentEmojis[data-empty=false]+div{display:none}.picmo__picker .picmo__emojiContainer{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center}.picmo__picker.picmo__picker{--border-radius: 5px;--emoji-area-height: calc( (var(--row-count) * var(--emoji-size) * var(--emoji-size-multiplier)) + var(--category-name-height) );--content-height: var(--emoji-area-height);--emojis-per-row: 8;--row-count: 6;--emoji-preview-margin: 4px;--emoji-preview-height: calc(var(--emoji-preview-size) + 1em + 1px);--emoji-preview-height-full: calc(var(--emoji-preview-height) + var(--emoji-preview-margin));--emoji-preview-size: 2.75em;--emoji-size: 2rem;--emoji-size-multiplier: 1.3;--content-margin: 8px;--category-tabs-height:calc(1.5em + 9px);--category-tabs-offset: 8px;--category-tab-size: 1.2rem;--category-name-height: 2rem;--category-name-padding-y: 6px;--search-height: 2em;--search-margin: .5em;--search-margin-bottom: 4px;--search-height-full: calc(var(--search-height) + var(--search-margin) + var(--search-margin-bottom));--overlay-background-color: rgba(0, 0, 0, .8);--emoji-font: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji";--ui-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;--ui-font-size: 16px;--picker-width: calc(var(--emojis-per-row) * var(--emoji-size) * var(--emoji-size-multiplier) + 2.75rem);--preview-background-color: var(--secondary-background-color);background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);font-size:var(--ui-font-size);overflow:hidden;position:relative;width:var(--picker-width);display:grid;gap:8px}.picmo__picker.picmo__picker>*{font-family:var(--ui-font)}.picmo__picker.picmo__skeleton{background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);width:var(--picker-width);color:var(--secondary-text-color)}.picmo__picker.picmo__skeleton *{box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__picker.picmo__skeleton .picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}.picmo__picker.picmo__skeleton .picmo__headerSkeleton{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:flex;flex-direction:column;overflow:hidden;gap:8px;border-bottom:1px solid var(--border-color);width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton{padding:0 8px;height:var(--search-height)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton .picmo__searchInput{width:100%;height:28px;border-radius:3px}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton{height:var(--category-tabs-height);display:flex;flex-direction:row;align-items:center;justify-self:center;width:calc(2rem * var(--category-count, 1))}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton .picmo__categoryTab{width:25px;height:25px;padding:2px;border-radius:5px;margin:.25em}.picmo__picker.picmo__skeleton .picmo__contentSkeleton{height:var(--content-height);padding-right:8px;opacity:.7}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__categoryName{width:50%;height:1rem;margin:.5rem;box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center;width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid .picmo__emoji{width:var(--emoji-size);height:var(--emoji-size);border-radius:50%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton{height:var(--emoji-preview-height);border-top:1px solid var(--border-color);display:grid;align-items:center;padding:.5em;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags"}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewEmoji{grid-area:emoji;border-radius:50%;width:var(--emoji-preview-size);height:var(--emoji-preview-size)}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewName{grid-area:name;height:.8em;width:80%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList .picmo__tag{border-radius:3px;padding:2px 8px;margin-right:.25em;height:1em;width:20%}.picmo__overlay{background:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.picmo__content{position:relative;overflow:hidden;height:var(--content-height)}.picmo__content.picmo__fullHeight{height:calc(var(--content-height) + var(--category-tabs-height) + var(--category-tabs-offset));overflow-y:auto}.picmo__pluginContainer{margin:.5em;display:flex;flex-direction:row}.picmo__header{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:grid;gap:8px;border-bottom:1px solid var(--border-color)}@media (prefers-reduced-motion: reduce){.picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__placeholder:after{display:none}}.picmo__picker .picmo__preview{border-top:1px solid var(--border-color);display:grid;align-items:center;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags";height:var(--emoji-preview-height);box-sizing:border-box;padding:.5em;position:relative;background:var(--preview-background-color)}.picmo__picker .picmo__preview .picmo__previewEmoji{grid-area:emoji;font-size:var(--emoji-preview-size);font-family:var(--emoji-font);width:1.25em;display:flex;align-items:center;justify-content:center}.picmo__picker .picmo__preview .picmo__previewName{grid-area:name;color:var(--text-color);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.picmo__picker .picmo__preview .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0;font-size:.75em;overflow:hidden}.picmo__picker .picmo__preview .picmo__tag{border-radius:3px;background:var(--tag-background-color);color:var(--text-color);padding:2px 8px;margin-right:.25em;white-space:nowrap}.picmo__picker .picmo__preview .picmo__tag:last-child{margin-right:0}.picmo__picker .picmo__searchContainer{display:flex;height:var(--search-height);box-sizing:border-box;padding:0 8px;position:relative}.picmo__picker .picmo__searchContainer .picmo__searchField{background:var(--search-background-color);border-radius:3px;border:none;box-sizing:border-box;color:var(--text-color);font-size:.9em;outline:none;padding:.5em 2.25em .5em .5em;width:100%}.picmo__picker .picmo__searchContainer .picmo__searchField:focus{background:var(--search-focus-background-color)}.picmo__picker .picmo__searchContainer .picmo__searchField::placeholder{color:var(--search-placeholder-color)}.picmo__picker .picmo__searchContainer .picmo__searchAccessory{color:var(--search-icon-color);height:100%;position:absolute;right:1em;top:0;width:1.25rem;display:flex;align-items:center}.picmo__picker .picmo__searchContainer .picmo__searchAccessory svg{fill:var(--search-icon-color)}.picmo__picker .picmo__searchContainer .picmo__clearButton{border:0;color:var(--search-icon-color);background:transparent;cursor:pointer}.picmo__picker .picmo__searchContainer .picmo__clearSearchButton{cursor:pointer;border:none;background:transparent;color:var(--search-icon-color);font-size:1em;width:100%;height:100%;display:flex;align-items:center;padding:0}.picmo__picker .picmo__searchContainer .picmo__notFound [data-icon]{fill:#f3e265}.picmo__picker .picmo__variantOverlay{background:var(--overlay-background-color);border-radius:5px;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.picmo__picker .picmo__variantOverlay .picmo__variantPopup{background:var(--variant-popup-background-color);border-radius:5px;margin:.5em;padding:.5em;text-align:center;user-select:none;display:flex;align-items:center;justify-content:center}.picmo__customEmoji{width:1em;height:1em}@keyframes shine{to{transform:translate(100%)}}.picmo__picker .picmo__imagePlaceholder{width:2rem;height:2rem;border-radius:50%}.picmo__placeholder{background:#DDDBDD;position:relative}.picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}\n');var t=Ly(e),n=((null==t?void 0:t.custom)||[]).map((function(e){return Bm(Bm({},e),{},{custom:!0,tags:["custom"].concat(Vm(e.tags||[]))})})),r=new Ny;Vg||(Vg=function(e){return Uv(e.locale,e.dataStore,e.messages,e.emojiData)}(t));var o=new zg(t.i18n);Vg.then((function(e){r.emit("data:ready",e)})).catch((function(e){r.emit("error",e)}));var i=new Ig({events:r,i18n:o,customEmojis:n,renderer:t.renderer,options:t,emojiData:Vg,pickerId:"picmo-".concat(Date.now(),"-").concat($g++)}).create(Bg);return i.renderSync(),i}Symbol.toStringTag;var Wg=["alignment","allowedPlacements","autoAlignment"],Kg=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],Gg=["mainAxis","crossAxis","limiter"];function Jg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ab(r.key),r)}}function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Zg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qg(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Xg(e){return function(e){if(Array.isArray(e))return eb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Zg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zg(e,t){if(e){if("string"==typeof e)return eb(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eb(e,t):void 0}}function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tb(){tb=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),s=new T(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var E=b.prototype=y.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==nb(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=O(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?m:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function O(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(nb(t)+" is not iterable")}return g.prototype=b,o(E,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=c(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,u,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},C(D.prototype),c(D.prototype,s,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new D(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function nb(e){return nb="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},nb(e)}function rb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ob(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rb(Object(n),!0).forEach((function(t){ib(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ib(e,t,n){return(t=ab(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ab(e){var t=function(e,t){if("object"!=nb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=nb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==nb(t)?t:t+""}function sb(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function ub(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){sb(i,r,o,a,s,"next",e)}function s(e){sb(i,r,o,a,s,"throw",e)}a(void 0)}))}}function cb(e){return e.split("-")[0]}function lb(e){return e.split("-")[1]}function fb(e){return["top","bottom"].includes(cb(e))?"x":"y"}function db(e){return"y"===e?"height":"width"}function hb(e,t,n){var r,o=e.reference,i=e.floating,a=o.x+o.width/2-i.width/2,s=o.y+o.height/2-i.height/2,u=fb(t),c=db(u),l=o[c]/2-i[c]/2,f="x"===u;switch(cb(t)){case"top":r={x:a,y:o.y-i.height};break;case"bottom":r={x:a,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:s};break;case"left":r={x:o.x-i.width,y:s};break;default:r={x:o.x,y:o.y}}switch(lb(t)){case"start":r[u]-=l*(n&&f?-1:1);break;case"end":r[u]+=l*(n&&f?-1:1)}return r}var pb=function(){var e=ub(tb().mark((function e(t,n,r){var o,i,a,s,u,c,l,f,d,h,p,m,v,y,g,b,w,k,x,E,C,D,S,O,A;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.placement,i=void 0===o?"bottom":o,a=r.strategy,s=void 0===a?"absolute":a,u=r.middleware,c=void 0===u?[]:u,l=r.platform,e.next=9,null==l.isRTL?void 0:l.isRTL(n);case 9:return f=e.sent,e.next=12,l.getElementRects({reference:t,floating:n,strategy:s});case 12:d=e.sent,h=hb(d,i,f),p=h.x,m=h.y,v=i,y={},g=0,b=0;case 20:if(!(b<c.length)){e.next=52;break}return w=c[b],k=w.name,x=w.fn,e.next=26,x({x:p,y:m,initialPlacement:i,placement:v,strategy:s,middlewareData:y,rects:d,platform:l,elements:{reference:t,floating:n}});case 26:if(E=e.sent,C=E.x,D=E.y,S=E.data,O=E.reset,p=null!=C?C:p,m=null!=D?D:m,y=ob(ob({},y),{},ib({},k,ob(ob({},y[k]),S))),!(O&&g<=50)){e.next=49;break}if(g++,e.t0="object"==nb(O),!e.t0){e.next=47;break}if(O.placement&&(v=O.placement),e.t1=O.rects,!e.t1){e.next=46;break}if(!0!==O.rects){e.next=44;break}return e.next=41,l.getElementRects({reference:t,floating:n,strategy:s});case 41:e.t2=e.sent,e.next=45;break;case 44:e.t2=O.rects;case 45:d=e.t2;case 46:A=hb(d,v,f),p=A.x,m=A.y;case 47:return b=-1,e.abrupt("continue",49);case 49:b++,e.next=20;break;case 52:return e.abrupt("return",{x:p,y:m,placement:v,strategy:s,middlewareData:y});case 53:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();function mb(e){return"number"!=typeof e?function(e){return ob({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function vb(e){return ob(ob({},e),{},{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function yb(e,t){return gb.apply(this,arguments)}function gb(){return gb=ub(tb().mark((function e(t,n){var r,o,i,a,s,u,c,l,f,d,h,p,m,v,y,g,b,w,k,x,E;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n={}),o=t.x,i=t.y,a=t.platform,s=t.rects,u=t.elements,c=t.strategy,f=(l=n).boundary,d=void 0===f?"clippingAncestors":f,h=l.rootBoundary,p=void 0===h?"viewport":h,m=l.elementContext,v=void 0===m?"floating":m,y=l.altBoundary,g=void 0!==y&&y,b=l.padding,w=mb(void 0===b?0:b),k=u[g?"floating"===v?"reference":"floating":v],e.t0=vb,e.t1=a,e.next=24,null==a.isElement?void 0:a.isElement(k);case 24:if(e.t3=r=e.sent,e.t2=null==e.t3,e.t2){e.next=28;break}e.t2=r;case 28:if(!e.t2){e.next=32;break}e.t4=k,e.next=38;break;case 32:if(e.t5=k.contextElement,e.t5){e.next=37;break}return e.next=36,null==a.getDocumentElement?void 0:a.getDocumentElement(u.floating);case 36:e.t5=e.sent;case 37:e.t4=e.t5;case 38:return e.t6=e.t4,e.t7=d,e.t8=p,e.t9=c,e.t10={element:e.t6,boundary:e.t7,rootBoundary:e.t8,strategy:e.t9},e.next=45,e.t1.getClippingRect.call(e.t1,e.t10);case 45:if(e.t11=e.sent,x=(0,e.t0)(e.t11),e.t12=vb,!a.convertOffsetParentRelativeRectToViewportRelativeRect){e.next=61;break}return e.t14=a,e.t15="floating"===v?ob(ob({},s.floating),{},{x:o,y:i}):s.reference,e.next=53,null==a.getOffsetParent?void 0:a.getOffsetParent(u.floating);case 53:return e.t16=e.sent,e.t17=c,e.t18={rect:e.t15,offsetParent:e.t16,strategy:e.t17},e.next=58,e.t14.convertOffsetParentRelativeRectToViewportRelativeRect.call(e.t14,e.t18);case 58:e.t13=e.sent,e.next=62;break;case 61:e.t13=s[v];case 62:return e.t19=e.t13,E=(0,e.t12)(e.t19),e.abrupt("return",{top:x.top-E.top+w.top,bottom:E.bottom-x.bottom+w.bottom,left:x.left-E.left+w.left,right:E.right-x.right+w.right});case 65:case"end":return e.stop()}}),e)}))),gb.apply(this,arguments)}var bb=Math.min,wb=Math.max;function kb(e,t,n){return wb(e,bb(t,n))}var xb={left:"right",right:"left",bottom:"top",top:"bottom"};function Eb(e){return e.replace(/left|right|bottom|top/g,(function(e){return xb[e]}))}function Cb(e,t,n){void 0===n&&(n=!1);var r=lb(e),o=fb(e),i=db(o),a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Eb(a)),{main:a,cross:Eb(a)}}var Db={start:"end",end:"start"};function Sb(e){return e.replace(/start|end/g,(function(e){return Db[e]}))}var Ob=["top","right","bottom","left"].reduce((function(e,t){return e.concat(t,t+"-start",t+"-end")}),[]);function Ab(e,t,n){return(e?[].concat(Xg(n.filter((function(t){return lb(t)===e}))),Xg(n.filter((function(t){return lb(t)!==e})))):n.filter((function(e){return cb(e)===e}))).filter((function(n){return!e||(lb(n)===e||!!t&&Sb(n)!==n)}))}var jb=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,fn:function(t){return ub(tb().mark((function n(){var r,o,i,a,s,u,c,l,f,d,h,p,m,v,y,g,b,w,k,x,E,C,D,S,O,A,j,T,M,L,P,F,N;return tb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=t.x,c=t.y,l=t.rects,f=t.middlewareData,d=t.placement,h=t.platform,p=t.elements,v=(m=e).alignment,y=void 0===v?null:v,g=m.allowedPlacements,b=void 0===g?Ob:g,w=m.autoAlignment,k=void 0===w||w,x=Qg(m,Wg),E=Ab(y,k,b),n.next=18,yb(t,x);case 18:if(C=n.sent,D=null!=(r=null==(o=f.autoPlacement)?void 0:o.index)?r:0,null!=(S=E[D])){n.next=23;break}return n.abrupt("return",{});case 23:return n.t0=Cb,n.t1=S,n.t2=l,n.next=28,null==h.isRTL?void 0:h.isRTL(p.floating);case 28:if(n.t3=n.sent,O=(0,n.t0)(n.t1,n.t2,n.t3),A=O.main,j=O.cross,d===S){n.next=34;break}return n.abrupt("return",{x:u,y:c,reset:{placement:E[0]}});case 34:if(T=[C[cb(S)],C[A],C[j]],M=[].concat(Xg(null!=(i=null==(a=f.autoPlacement)?void 0:a.overflows)?i:[]),[{placement:S,overflows:T}]),!(L=E[D+1])){n.next=37;break}return n.abrupt("return",{data:{index:D+1,overflows:M},reset:{placement:L}});case 37:return P=M.slice().sort((function(e,t){return e.overflows[0]-t.overflows[0]})),F=null==(s=P.find((function(e){return e.overflows.every((function(e){return e<=0}))})))?void 0:s.placement,N=null!=F?F:P[0].placement,n.abrupt("return",N!==d?{data:{index:D+1,overflows:M},reset:{placement:N}}:{});case 39:case"end":return n.stop()}}),n)})))()}}};function Tb(e){var t=Eb(e);return[Sb(e),t,Sb(t)]}var Mb=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn:function(t){return ub(tb().mark((function n(){var r,o,i,a,s,u,c,l,f,d,h,p,m,v,y,g,b,w,k,x,E,C,D,S,O,A,j,T,M,L,P,F,N,_;return tb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.placement,i=t.middlewareData,a=t.rects,s=t.initialPlacement,u=t.platform,c=t.elements,f=(l=e).mainAxis,d=void 0===f||f,h=l.crossAxis,p=void 0===h||h,m=l.fallbackPlacements,v=l.fallbackStrategy,y=void 0===v?"bestFit":v,g=l.flipAlignment,b=void 0===g||g,w=Qg(l,Kg),k=cb(o),x=m||(k!==s&&b?Tb(s):[Eb(s)]),E=[s].concat(Xg(x)),n.next=22,yb(t,w);case 22:if(C=n.sent,D=[],S=(null==(r=i.flip)?void 0:r.overflows)||[],d&&D.push(C[k]),!p){n.next=36;break}return n.t0=Cb,n.t1=o,n.t2=a,n.next=31,null==u.isRTL?void 0:u.isRTL(c.floating);case 31:n.t3=n.sent,O=(0,n.t0)(n.t1,n.t2,n.t3),A=O.main,j=O.cross,D.push(C[A],C[j]);case 36:if(S=[].concat(Xg(S),[{placement:o,overflows:D}]),D.every((function(e){return e<=0}))){n.next=51;break}if(L=(null!=(T=null==(M=i.flip)?void 0:M.index)?T:0)+1,!(P=E[L])){n.next=40;break}return n.abrupt("return",{data:{index:L,overflows:S},reset:{placement:P}});case 40:F="bottom",n.t4=y,n.next="bestFit"===n.t4?44:"initialPlacement"===n.t4?47:49;break;case 44:return _=null==(N=S.map((function(e){return[e,e.overflows.filter((function(e){return e>0})).reduce((function(e,t){return e+t}),0)]})).sort((function(e,t){return e[1]-t[1]}))[0])?void 0:N[0].placement,_&&(F=_),n.abrupt("break",49);case 47:return F=s,n.abrupt("break",49);case 49:if(o===F){n.next=51;break}return n.abrupt("return",{reset:{placement:F}});case 51:return n.abrupt("return",{});case 52:case"end":return n.stop()}}),n)})))()}}};function Lb(e,t){return Pb.apply(this,arguments)}function Pb(){return Pb=ub(tb().mark((function e(t,n){var r,o,i,a,s,u,c,l,f,d,h,p,m,v;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.placement,o=t.platform,i=t.elements,e.next=5,null==o.isRTL?void 0:o.isRTL(i.floating);case 5:return a=e.sent,s=cb(r),u=lb(r),c="x"===fb(r),l=["left","top"].includes(s)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,h="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:ob({mainAxis:0,crossAxis:0,alignmentAxis:null},d),p=h.mainAxis,m=h.crossAxis,v=h.alignmentAxis,e.abrupt("return",(u&&"number"==typeof v&&(m="end"===u?-1*v:v),c?{x:m*f,y:p*l}:{x:p*l,y:m*f}));case 14:case"end":return e.stop()}}),e)}))),Pb.apply(this,arguments)}var Fb=function(e){return void 0===e&&(e=0),{name:"offset",options:e,fn:function(t){return ub(tb().mark((function n(){var r,o,i;return tb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.x,o=t.y,n.next=4,Lb(t,e);case 4:return i=n.sent,n.abrupt("return",{x:r+i.x,y:o+i.y,data:i});case 6:case"end":return n.stop()}}),n)})))()}}};function Nb(e){return"x"===e?"y":"x"}var _b=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn:function(t){return ub(tb().mark((function n(){var r,o,i,a,s,u,c,l,f,d,h,p,m,v,y,g,b,w,k,x,E,C,D,S;return tb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.x,o=t.y,i=t.placement,s=(a=e).mainAxis,u=void 0===s||s,c=a.crossAxis,l=void 0!==c&&c,f=a.limiter,d=void 0===f?{fn:function(e){return{x:e.x,y:e.y}}}:f,h=Qg(a,Gg),p={x:r,y:o},n.next=14,yb(t,h);case 14:return m=n.sent,v=fb(cb(i)),y=Nb(v),g=p[v],b=p[y],u&&(w="y"===v?"bottom":"right",k=g+m["y"===v?"top":"left"],x=g-m[w],g=kb(k,g,x)),l&&(E="y"===y?"bottom":"right",C=b+m["y"===y?"top":"left"],D=b-m[E],b=kb(C,b,D)),S=d.fn(ob(ob({},t),{},ib(ib({},v,g),y,b))),n.abrupt("return",ob(ob({},S),{},{data:{x:S.x-r,y:S.y-o}}));case 22:case"end":return n.stop()}}),n)})))()}}};function Rb(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Bb(e){if(null==e)return window;if(!Rb(e)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ib(e){return Bb(e).getComputedStyle(e)}function zb(e){return Rb(e)?"":e?(e.nodeName||"").toLowerCase():""}function Hb(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Vb(e){return e instanceof Bb(e).HTMLElement}function $b(e){return e instanceof Bb(e).Element}function qb(e){return!(("undefined"===typeof ShadowRoot?"undefined":nb(ShadowRoot))>"u")&&(e instanceof Bb(e).ShadowRoot||e instanceof ShadowRoot)}function Ub(e){var t=Ib(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Wb(e){return["table","td","th"].includes(zb(e))}function Kb(e){var t=/firefox/i.test(Hb()),n=Ib(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function Gb(){return!/^((?!chrome|android).)*safari/i.test(Hb())}var Jb=Math.min,Yb=Math.max,Qb=Math.round;function Xb(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);var s=e.getBoundingClientRect(),u=1,c=1;t&&Vb(e)&&(u=e.offsetWidth>0&&Qb(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Qb(s.height)/e.offsetHeight||1);var l=$b(e)?Bb(e):window,f=!Gb()&&n,d=(s.left+(f&&null!=(r=null==(o=l.visualViewport)?void 0:o.offsetLeft)?r:0))/u,h=(s.top+(f&&null!=(i=null==(a=l.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/u,m=s.height/c;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function Zb(e){return((function(e){return e instanceof Bb(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function ew(e){return $b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function tw(e){return Xb(Zb(e)).left+ew(e).scrollLeft}function nw(e,t,n){var r=Vb(t),o=Zb(t),i=Xb(e,r&&function(e){var t=Xb(e);return Qb(t.width)!==e.offsetWidth||Qb(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==zb(t)||Ub(o))&&(a=ew(t)),Vb(t)){var u=Xb(t,!0);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else o&&(s.x=tw(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function rw(e){return"html"===zb(e)?e:e.assignedSlot||e.parentNode||(qb(e)?e.host:null)||Zb(e)}function ow(e){return Vb(e)&&"fixed"!==Ib(e).position?function(e){for(var t=e.offsetParent,n=e,r=!1;n&&n!==t;){var o=n.assignedSlot;if(o){var i=o.offsetParent;if("contents"===Ib(o).display){var a=o.hasAttribute("style"),s=o.style.display;o.style.display=Ib(n).display,i=o.offsetParent,o.style.display=s,a||o.removeAttribute("style")}n=o,t!==i&&(t=i,r=!0)}else if(qb(n)&&n.host&&r)break;n=qb(n)&&n.host||n.parentNode}return t}(e):null}function iw(e){for(var t=Bb(e),n=ow(e);n&&Wb(n)&&"static"===Ib(n).position;)n=ow(n);return n&&("html"===zb(n)||"body"===zb(n)&&"static"===Ib(n).position&&!Kb(n))?t:n||function(e){var t=rw(e);for(qb(t)&&(t=t.host);Vb(t)&&!["html","body"].includes(zb(t));){if(Kb(t))return t;var n=t.parentNode;t=qb(n)?n.host:n}return null}(e)||t}function aw(e){if(Vb(e))return{width:e.offsetWidth,height:e.offsetHeight};var t=Xb(e);return{width:t.width,height:t.height}}function sw(e){var t=rw(e);return["html","body","#document"].includes(zb(t))?e.ownerDocument.body:Vb(t)&&Ub(t)?t:sw(t)}function uw(e,t){var n;void 0===t&&(t=[]);var r=sw(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Bb(r),a=o?[i].concat(i.visualViewport||[],Ub(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(uw(a))}function cw(e,t,n){return"viewport"===t?vb(function(e,t){var n=Bb(e),r=Zb(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;var c=Gb();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}(e,n)):$b(t)?function(e,t){var n=Xb(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):vb(function(e){var t,n=Zb(e),r=ew(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Yb(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Yb(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+tw(e),u=-r.scrollTop;return"rtl"===Ib(o||n).direction&&(s+=Yb(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(Zb(e)))}function lw(e){var t=uw(e),n=["absolute","fixed"].includes(Ib(e).position)&&Vb(e)?iw(e):e;return $b(n)?t.filter((function(e){return $b(e)&&function(e,t){var n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&qb(n)){var r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(e,n)&&"body"!==zb(e)})):[]}var fw={getClippingRect:function(e){var t=e.element,n=e.boundary,r=e.rootBoundary,o=e.strategy,i=[].concat(Xg("clippingAncestors"===n?lw(t):[].concat(n)),[r]),a=i[0],s=i.reduce((function(e,n){var r=cw(t,n,o);return e.top=Yb(r.top,e.top),e.right=Jb(r.right,e.right),e.bottom=Jb(r.bottom,e.bottom),e.left=Yb(r.left,e.left),e}),cw(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var t=e.rect,n=e.offsetParent,r=e.strategy,o=Vb(n),i=Zb(n);if(n===i)return t;var a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==zb(n)||Ub(i))&&(a=ew(n)),Vb(n))){var u=Xb(n,!0);s.x=u.x+n.clientLeft,s.y=u.y+n.clientTop}return ob(ob({},t),{},{x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y})},isElement:$b,getDimensions:aw,getOffsetParent:iw,getDocumentElement:Zb,getElementRects:function(e){var t=e.reference,n=e.floating,r=e.strategy;return{reference:nw(t,iw(n),r),floating:ob(ob({},aw(n)),{},{x:0,y:0})}},getClientRects:function(e){return Array.from(e.getClientRects())},isRTL:function(e){return"rtl"===Ib(e).direction}};function dw(e,t,n,r){void 0===r&&(r={});var o=r,i=o.ancestorScroll,a=void 0===i||i,s=o.ancestorResize,u=void 0===s||s,c=o.elementResize,l=void 0===c||c,f=o.animationFrame,d=void 0!==f&&f,h=a&&!d,p=u&&!d,m=h||p?[].concat(Xg($b(e)?uw(e):[]),Xg(uw(t))):[];m.forEach((function(e){h&&e.addEventListener("scroll",n,{passive:!0}),p&&e.addEventListener("resize",n)}));var v=null;if(l){var y=!0;v=new ResizeObserver((function(){y||n(),y=!1})),$b(e)&&!d&&v.observe(e),v.observe(t)}var g,b=d?Xb(e):null;return d&&function t(){var r=Xb(e);b&&(r.x!==b.x||r.y!==b.y||r.width!==b.width||r.height!==b.height)&&n(),b=r,g=requestAnimationFrame(t)}(),n(),function(){var e;m.forEach((function(e){h&&e.removeEventListener("scroll",n),p&&e.removeEventListener("resize",n)})),null==(e=v)||e.disconnect(),v=null,d&&cancelAnimationFrame(g)}}var hw=function(e,t,n){return pb(e,t,ob({platform:fw},n))};function pw(e,t,n,r){return mw.apply(this,arguments)}function mw(){return mw=ub(tb().mark((function e(t,n,r,o){return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}throw new Error("Must provide a positioning option");case 2:return e.next=4,"string"==typeof o?vw(t,n,r,o):gw(n,o);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)}))),mw.apply(this,arguments)}function vw(e,t,n,r){return yw.apply(this,arguments)}function yw(){return yw=ub(tb().mark((function e(t,n,r,o){var i;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}throw new Error("Reference element is required for relative positioning");case 2:return e.abrupt("return",(i="auto"===o?{middleware:[jb(),_b(),Fb({mainAxis:5,crossAxis:12})]}:{placement:o,middleware:[Mb(),_b(),Fb(5)]},dw(r,n,ub(tb().mark((function e(){var o,a,s;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.isConnected&&r.offsetParent||!bw(t)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,hw(r,n,i);case 4:o=e.sent,a=o.x,s=o.y,Object.assign(n.style,{position:"absolute",left:"".concat(a,"px"),top:"".concat(s,"px")});case 8:case"end":return e.stop()}}),e)}))))));case 3:case"end":return e.stop()}}),e)}))),yw.apply(this,arguments)}function gw(e,t){return e.style.position="fixed",Object.entries(t).forEach((function(t){var n=Yg(t,2),r=n[0],o=n[1];e.style[r]=o})),function(){}}function bw(e){switch(e.options.onPositionLost){case"close":return e.close(),!0;case"destroy":return e.destroy(),!0;case"hold":return!0}}var ww={hideOnClickOutside:!0,hideOnEmojiSelect:!0,hideOnEscape:!0,position:"auto",showCloseButton:!0,onPositionLost:"none"};var kw=gv("popupContainer","closeButton"),xw=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isOpen=!1,this.externalEvents=new Py,this.options=ob(ob({},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ob(ob({},ww),{},{rootElement:document.body},e)}(n)),Ly(t)),this.popupEl=document.createElement("div"),this.popupEl.classList.add(kw.popupContainer),this.popupEl.classList.add(this.options.theme),n.className&&this.popupEl.classList.add(n.className),this.options.showCloseButton&&(this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.classList.add(kw.closeButton),this.closeButton.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e<path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>',this.closeButton.addEventListener("click",(function(){r.close()})),this.popupEl.appendChild(this.closeButton));var o=document.createElement("div");this.popupEl.appendChild(o),this.picker=Ug(ob(ob({},this.options),{},{rootElement:o})),this.focusTrap=new Kv,this.picker.addEventListener("data:ready",(function(){r.focusTrap.activate(r.picker.el),r.picker.setInitialFocus()})),this.options.hideOnEmojiSelect&&this.picker.addEventListener("emoji:select",(function(){var e;r.close(),null==(e=r.triggerElement)||e.focus()})),this.options.hideOnClickOutside&&(this.onDocumentClick=this.onDocumentClick.bind(this),document.addEventListener("click",this.onDocumentClick)),this.options.hideOnEscape&&(this.handleKeydown=this.handleKeydown.bind(this),this.popupEl.addEventListener("keydown",this.handleKeydown)),this.referenceElement=this.options.referenceElement,this.triggerElement=this.options.triggerElement},t=[{key:"addEventListener",value:function(e,t){this.externalEvents.on(e,t),this.picker.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.externalEvents.off(e,t),this.picker.removeEventListener(e,t)}},{key:"handleKeydown",value:function(e){var t;"Escape"===e.key&&(this.close(),null==(t=this.triggerElement)||t.focus())}},{key:"destroy",value:(s=ub(tb().mark((function e(){return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.isOpen,!e.t0){e.next=4;break}return e.next=4,this.close();case 4:document.removeEventListener("click",this.onDocumentClick),this.picker.destroy(),this.externalEvents.removeAll();case 7:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"toggle",value:function(e){return this.isOpen?this.close():this.open(e)}},{key:"open",value:(a=ub(tb().mark((function e(){var t,n,r,o=arguments;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=o.length>0&&void 0!==o[0]?o[0]:{}).triggerElement,r=t.referenceElement,e.t0=this.isOpen,e.t0){e.next=18;break}return n&&(this.triggerElement=n),r&&(this.referenceElement=r),e.next=7,this.initiateOpenStateChange(!0);case 7:return this.popupEl.style.opacity="0",this.options.rootElement.appendChild(this.popupEl),e.next=11,this.setPosition();case 11:return this.picker.reset(!1),e.next=14,this.animatePopup(!0);case 14:return e.next=16,this.animateCloseButton(!0);case 16:this.picker.setInitialFocus(),this.externalEvents.emit("picker:open");case 18:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"close",value:(i=ub(tb().mark((function e(){var t;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!this.isOpen,e.t0){e.next=13;break}return e.next=4,this.initiateOpenStateChange(!1);case 4:return e.next=6,this.animateCloseButton(!1);case 6:return e.next=8,this.animatePopup(!1);case 8:this.popupEl.remove(),this.picker.reset(),null==(t=this.positionCleanup)||t.call(this),this.focusTrap.deactivate(),this.externalEvents.emit("picker:close");case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getRunningAnimations",value:function(){return this.picker.el.getAnimations().filter((function(e){return"running"===e.playState}))}},{key:"setPosition",value:(o=ub(tb().mark((function e(){var t;return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=this.positionCleanup)||t.call(this),e.next=3,pw(this,this.popupEl,this.referenceElement,this.options.position);case 3:this.positionCleanup=e.sent;case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"awaitPendingAnimations",value:function(){return Promise.all(this.getRunningAnimations().map((function(e){return e.finished})))}},{key:"onDocumentClick",value:function(e){var t,n=e.target,r=null==(t=this.triggerElement)?void 0:t.contains(n);this.isOpen&&!this.picker.isPickerClick(e)&&!r&&this.close()}},{key:"animatePopup",value:function(e){return pv(this.popupEl,{opacity:[0,1],transform:["scale(0.9)","scale(1)"]},{duration:150,id:e?"show-picker":"hide-picker",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}},{key:"animateCloseButton",value:function(e){if(this.closeButton)return pv(this.closeButton,{opacity:[0,1]},{duration:25,id:e?"show-close":"hide-close",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}},{key:"initiateOpenStateChange",value:(r=ub(tb().mark((function e(t){return tb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isOpen=t,e.next=3,this.awaitPendingAnimations();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}],t&&Jg(e.prototype,t),n&&Jg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i,a,s}(),Ew=Hg();var Cw=n(43925);var Dw=/200D|FE0E|FE0F/g,Sw=["da","de","en","en-gb","es","es-mx","et","fi","fr","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","zh","zh-hant"];new RegExp("(-| )?(".concat(Dw.source,")"),"g");function Ow(e){return Ow="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},Ow(e)}function Aw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jw(e,t,n){return(t=Mw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mw(r.key),r)}}function Mw(e){var t=function(e,t){if("object"!=Ow(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ow(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ow(t)?t:t+""}var Lw=null,Pw=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=e.i18n(),r=n.dictionary,o=n.messages.buttonText,i=document.createElement("span");i.className="emoji__container";var a=document.createElement("span");a.className="emoji__trigger";var s=document.createElement("button");s.className="emoji__button",s.type="button",s.setAttribute("aria-label",o),s.innerHTML='<svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="smile" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"></path></svg>';var u=document.createElement("span");u.className="emoji__reference";var c=t.parentNode;c.insertBefore(i,t),i.appendChild(t),i.appendChild(a),i.appendChild(u),a.appendChild(s),c.querySelectorAll(".form-error").forEach((function(e){return i.appendChild(e)}));var l,f,d=(l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aw(Object(n),!0).forEach((function(t){jw(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({autoFocus:"search",locale:e.locale(),i18n:r},window.matchMedia("(max-width: ".concat(Cw.screens.sm,")")).matches&&{emojiSize:"1.5rem"}),f={position:"bottom-end",triggerElement:s,className:"emoji__decidim",referenceElement:u},Ew(".picmo__popupContainer{display:flex;flex-direction:column;position:absolute}.picmo__popupContainer .picmo__closeButton{position:absolute;opacity:0;background:transparent;border:none;z-index:1;right:0;top:0;cursor:pointer;padding:4px;align-self:flex-end;transform:translate(50%,-50%);background:#999999;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%}.picmo__popupContainer .picmo__closeButton:hover{background:var(--accent-color)}.picmo__popupContainer .picmo__closeButton svg{fill:#fff;width:1.25rem;height:1.25rem}\n"),new xw(ob({autoFocus:"auto"},l),f));d.closeButton.type="button";var h=function(){d.toggle()};s.addEventListener("click",h),t.addEventListener("characterCounter",(function(e){e.detail.remaining>=4?(s.addEventListener("click",h),s.removeAttribute("style")):(s.removeEventListener("click",h),s.setAttribute("style","color:lightgrey"))})),d.addEventListener("emoji:select",(function(e){var n=e.emoji;"true"===t.contentEditable?t.editor?t.editor.chain().insertContent(" ".concat(n," ")).focus().run():t.innerHTML+=" ".concat(n," "):t.value+=" ".concat(n," "),"TEXTAREA"!==t.tagName&&"INPUT"!==t.tagName||t.dispatchEvent(new Event("input"));var r=new Event("emoji.added");t.dispatchEvent(r)}))},n=[{key:"i18n",value:function(){if(Lw)return Lw;var e=of("emojis")||null,t=e.button;return e&&(Reflect.deleteProperty(e,"button"),e=af(e)),Lw={dictionary:e,messages:{buttonText:t}}}},{key:"locale",value:function(){var e=document.documentElement.getAttribute("lang");if(!Sw.includes(e)){var t,n=null===(t=e)||void 0===t?void 0:t.split("-")[0];e=Sw.includes(n)?n:"en"}return e}}],(t=null)&&Tw(e.prototype,t),n&&Tw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();var Fw=ys.create({name:"emoji",onCreate:function(e){!function(e){var t=e.view.dom;new Pw(t)}(e.editor)}});function Nw(e){return Nw="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},Nw(e)}function _w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_w(Object(n),!0).forEach((function(t){Bw(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bw(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Nw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Nw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Nw(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Iw=ys.create({name:"decidimKit",addOptions:function(){return{characterCount:{limit:null},heading:{levels:[2,3,4,5,6]},link:{allowTargetControl:!1},videoEmbed:!1,image:{uploadDialogSelector:null,uploadImagesPath:null,contentTypes:/^image\/(jpe?g|png|svg|webp)$/i},hashtag:!1,mention:!1,emoji:!1}},addExtensions:function(){var e=[rl.configure({heading:!1,bold:!1,orderedList:!1,codeBlock:!1}),ul.configure(this.options.characterCount),em.configure(Rw({openOnClick:!1},this.options.link)),cl,ll,If,Jl,Lu,ol];return!1!==this.options.heading&&e.push(_l.configure(this.options.heading)),!1!==this.options.videoEmbed&&e.push(gm.configure(this.options.videoEmbed)),!1!==this.options.image&&this.options.image.uploadDialogSelector&&e.push(Rf.configure(this.options.image)),!1!==this.options.hashtag&&e.push(Nl.configure(this.options.hashtag)),!1!==this.options.mention&&e.push(cm.configure(this.options.mention)),!1!==this.options.emoji&&e.push(Fw.configure(this.options.emoji)),e}}),zw=function(e,t){return function(){return t.apply(void 0,arguments),e}},Hw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=document.createElement(e),n={};return n.dom=zw(n,(function(e){return e(t)})),n.append=zw(n,(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(o.length>0)return n.append(e),void o.forEach((function(e){return n.append(e)}));e&&(e instanceof Function?n.append(e()):(null===e||void 0===e?void 0:e.render)instanceof Function?n.append(e.render()):e instanceof Node&&e.childNodes.length>0&&t.appendChild(e))})),n.render=function(e){return e instanceof Function&&!e(t)||!1===e?null:t},n},Vw=n.p+"media/images/remixicon.symbol-e643e553623ffcd49f94.svg",$w=function(){return Hw("div").dom((function(e){return e.classList.add("editor-toolbar-group")}))},qw=function(e,t){var n=t.type,r=t.label,o=t.icon,i=t.action,a=t.activatable,s=void 0===a||a;return Hw("button").dom((function(t){var a;t.classList.add("editor-toolbar-control"),t.dataset.editorType=n,s&&(t.dataset.editorSelectionType=n),t.type="button",t.ariaLabel=r,t.title=r,t.innerHTML=(a=o,'<svg class="editor-toolbar-icon" role="img" aria-hidden="true">\n    <use href="'.concat(Vw,"#ri-").concat(a,'" />\n  </svg>')),t.addEventListener("click",(function(t){t.preventDefault(),e.commands.focus(),i()}))}))},Uw=function(e,t){var n=t.type,r=t.label,o=t.options,i=t.action,a=t.activatable,s=void 0===a||a;return Hw("select").dom((function(t){t.classList.add("editor-toolbar-control","!pr-8"),t.dataset.editorType=n,s&&(t.dataset.editorSelectionType=n),t.ariaLabel=r,t.title=r,o.forEach((function(e){var n=e.label,r=e.value,o=document.createElement("option");o.setAttribute("value",r),o.textContent=n,t.appendChild(o)})),t.addEventListener("change",(function(){e.commands.focus(),i(t.value)}))}))};function Ww(e){var t,n=window.DecidimAwesome||{};console.log("Using DecidimAwesome createEditor");var r=e.parentElement.querySelector("input[type=hidden]"),o=e.parentElement.querySelector("label"),i=e.querySelector(".editor-input"),a={role:"textbox","aria-multiline":!0};if(o){var s=Ap("editorlabel");o.setAttribute("id",s),a["aria-labelledby"]=s}var u=(null===(t=e.dataset)||void 0===t?void 0:t.toolbar)||"basic",c=JSON.parse(e.dataset.options),l=c.context,f=c.contentTypes,d={};if("participant"!==l&&(d.link={allowTargetControl:!0}),r.hasAttribute("maxlength")&&(d.characterCount={limit:parseInt(r.getAttribute("maxlength"),10)}),"basic"===u&&(d.heading=!1),("full"===u||n.allow_videos_in_editors)&&(d.videoEmbed=!0),"full"===u||n.allow_images_in_editors){var h=c.uploadImagesPath,p=c.uploadDialogSelector;d.image={uploadDialogSelector:p,contentTypes:f.image,uploadImagesPath:h}}e.classList.contains("js-hashtags")&&(d.hashtag=!0),e.classList.contains("js-mentions")&&(d.mention=!0),e.classList.contains("js-emojis")&&(d.emoji=!0);var m=new ru({element:i,editorProps:{attributes:a},content:r.value,editable:!r.disabled,extensions:[Iw.configure(d)]}),v=function(e){var t=sf("editor.toolbar"),n={nodes:[],marks:[],extensions:[]};e.extensionManager.extensions.forEach((function(e){"node"===e.type?n.nodes.push(e.name):"mark"===e.type?n.marks.push(e.name):"extension"===e.type&&n.extensions.push(e.name)}));var r=Hw("div").dom((function(e){return e.classList.add("editor-toolbar")})).append($w(e).append(Uw(e,{type:"heading",label:t["control.heading"],options:[{value:"normal",label:t["textStyle.normal"]},{value:2,label:t["textStyle.heading"].replace("%level%",2)},{value:3,label:t["textStyle.heading"].replace("%level%",3)},{value:4,label:t["textStyle.heading"].replace("%level%",4)},{value:5,label:t["textStyle.heading"].replace("%level%",5)},{value:6,label:t["textStyle.heading"].replace("%level%",6)}],action:function(t){"normal"===t?e.commands.setParagraph():e.commands.toggleHeading({level:parseInt(t,10)})}}).render(n.nodes.includes("heading")))).append($w(e).append(qw(e,{type:"bold",icon:"bold",label:t["control.bold"],action:function(){return e.commands.toggleBold()}}).render(n.marks.includes("bold")),qw(e,{type:"italic",icon:"italic",label:t["control.italic"],action:function(){return e.commands.toggleItalic()}}).render(n.marks.includes("italic")),qw(e,{type:"underline",icon:"underline",label:t["control.underline"],action:function(){return e.commands.toggleUnderline()}}).render(n.marks.includes("underline")),qw(e,{type:"hardBreak",icon:"text-wrap",label:t["control.hardBreak"],activatable:!1,action:function(){return e.commands.setHardBreak()}}).render(n.nodes.includes("hardBreak")))).append($w(e).append(qw(e,{type:"orderedList",icon:"list-ordered",label:t["control.orderedList"],action:function(){return e.commands.toggleOrderedList()}}).render(n.nodes.includes("orderedList")),qw(e,{type:"bulletList",icon:"list-unordered",label:t["control.bulletList"],action:function(){return e.commands.toggleBulletList()}}).render(n.nodes.includes("bulletList")))).append($w(e).append(qw(e,{type:"link",icon:"link",label:t["control.link"],action:function(){return e.commands.linkDialog()}}).render(n.marks.includes("link")),qw(e,{type:"common:eraseStyles",icon:"eraser-line",label:t["control.common.eraseStyles"],activatable:!1,action:function(){if(e.isActive("link")&&e.view.state.selection.empty){var t=e.view.state.selection.anchor;e.chain().focus().extendMarkRange("link").unsetLink().setTextSelection(t).run()}else e.chain().focus().clearNodes().unsetAllMarks().run()}}).render(n.nodes.includes("heading")||n.marks.includes("bold")||n.marks.includes("italic")||n.marks.includes("underline")||n.nodes.includes("hardBreak")||n.nodes.includes("orderedList")||n.nodes.includes("bulletList")||n.marks.includes("link")))).append($w(e).append(qw(e,{type:"codeBlock",icon:"code-line",label:t["control.codeBlock"],action:function(){return e.commands.toggleCodeBlock()}}).render(n.nodes.includes("codeBlock")),qw(e,{type:"blockquote",icon:"double-quotes-l",label:t["control.blockquote"],action:function(){return e.commands.toggleBlockquote()}}).render(n.nodes.includes("blockquote")))).append($w(e).append(qw(e,{type:"indent:indent",icon:"indent-increase",label:t["control.indent.indent"],activatable:!1,action:function(){return e.commands.indent()}}).render(n.extensions.includes("indent")),qw(e,{type:"indent:outdent",icon:"indent-decrease",label:t["control.indent.outdent"],activatable:!1,action:function(){return e.commands.outdent()}}).render(n.extensions.includes("indent")))).append($w(e).append(qw(e,{type:"videoEmbed",icon:"video-line",label:t["control.videoEmbed"],action:function(){return e.commands.videoEmbedDialog()}}).render(n.nodes.includes("videoEmbed")),qw(e,{type:"image",icon:"image-line",label:t["control.image"],action:function(){return e.commands.imageDialog()}}).render(n.nodes.includes("image")))).render(),o=r.querySelectorAll(".editor-toolbar-control[data-editor-selection-type]"),i=r.querySelector(".editor-toolbar-control[data-editor-type='heading']"),a=function(){if(e.isActive("heading")){var t=e.getAttributes("heading").level;i.value="".concat(t)}else i&&(i.value="normal");o.forEach((function(t){e.isActive(t.dataset.editorSelectionType)?t.classList.add("active"):t.classList.remove("active")}))};return e.on("update",a),e.on("selectionUpdate",a),r}(m);return e.insertBefore(v,i),m.on("update",(function(){return r.value=m.getHTML()})),m}function Kw(e){return Kw="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},Kw(e)}var Gw=["value","userData"];function Jw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Yw(r.key),r)}}function Yw(e){var t=function(e,t){if("object"!=Kw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Kw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kw(t)?t:t+""}function Qw(e,t,n){return t=Zw(t),function(e,t){if(t&&("object"==Kw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xw()?Reflect.construct(t,n||[],Zw(e).constructor):t.apply(e,n))}function Xw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xw=function(){return!!e})()}function Zw(e){return Zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zw(e)}function ek(e,t){return ek=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ek(e,t)}function tk(e){return tk="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},tk(e)}function nk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rk(r.key),r)}}function rk(e){var t=function(e,t){if("object"!=tk(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=tk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tk(t)?t:t+""}window.fbControls||(window.fbControls=[]),window.fbControls.push((function(e,t){var n=t.textarea,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qw(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ek(e,t)}(t,e),n=t,r=[{key:"configure",value:function(){window.fbEditors.tiptap={}}},{key:"build",value:function(){var e=this.config,t=e.value,n=e.userData,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gw);this.inputId="".concat(this.id,"-input"),this.input=this.markup("input",null,{name:name,id:this.inputId,type:"hidden",value:n&&n[0]||t||""}),this.editorInput=this.markup("div",null,{style:"height: 25rem",class:"editor-input"});var o=this.classConfig&&this.classConfig.editorOptions||{contentTypes:{image:["image/jpeg","image/png"]}},i={id:r.id,name:r.name,type:r.type,className:"editor-container","data-toolbar":"basic","data-disabled":"false","data-options":JSON.stringify(o)};return this.wrapper=this.markup("div",this.editorInput,i),this.markup("div",[this.input,this.wrapper],{style:"margin-top: 1rem"})}},{key:"onRender",value:function(e){return window.fbEditors.tiptap[this.id]&&(console.log("destroying editor",window.fbEditors.tiptap[this.id]),window.fbEditors.tiptap[this.id].instance.destroy()),window.fbEditors.tiptap[this.id]={},window.fbEditors.tiptap[this.id].instance=Ww(this.wrapper),e}}],o=[{key:"definition",get:function(){return{icon:"\ud83d\udcdd",i18n:{default:"Rich Text Editor"}}}}],r&&Jw(n.prototype,r),o&&Jw(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(n);n.register("richtext",r,"textarea")}));var ok=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lang=this.getLang(window.DecidimAwesome.currentLocale)},t=[{key:"getLang",value:function(e){var t={ar:"ar-TN",ca:"ca-ES",cs:"cs-CZ",da:"da-DK",de:"de-DE",el:"el-GR",en:"en-US",es:"es-ES",fa:"fa-IR",fi:"fi-FI",fr:"fr-FR",he:"he-IL",hu:"hu-HU",it:"it-IT",ja:"ja-JP",my:"my-MM",nb:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-BR",qz:"qz-MM",ro:"ro-RO",ru:"ru-RU",sl:"sl-SI",th:"th-TH",tr:"tr-TR",uk:"uk-UA",vi:"vi-VN","zh-TW":"zh-TW",zh:"zh-CN"};return t[e]?t[e]:t[e.substr(0,2)]?t[e.substr(0,2)]:"en-US"}},{key:"dataToXML",value:function(e){var t=$("<dl/>"),n=null,r=null,o=null,i=null,a=null,s=null,u=null,c=null;for(a in t.attr("class","decidim_awesome-custom_fields"),t.attr("data-generator","decidim_awesome"),t.attr("data-version",window.DecidimAwesome.version),e)if("textarea"===e[a].type&&"richtext"===e[a].subtype&&(e[a].userData=[$("#".concat(e[a].name,"-input")).val()]),e[a].userData&&e[a].userData.length){for(c in(o=$("<dt/>")).text(e[a].label),o.attr("name",e[a].name),n=$("<dd/>"),e[a].userData)r=$("<div/>"),s=e[a].userData[c],u=null,e[a].values?(i=e[a].values.find((function(e){return e.value===s})))&&(u=s,s=i.label):"date"===e[a].type&&s&&(i=new Date(s).toLocaleDateString())&&(u=s,s=i),"textarea"===e[a].type&&"richtext"===e[a].subtype?r.html(s):r.text(s),u&&r.attr("alt",u),n.append(r);n.attr("id",e[a].name),n.attr("name",e[a].type),t.append(o),t.append(n)}return"<xml>".concat(t[0].outerHTML,"</xml>")}},{key:"fixBuggyFields",value:function(){var e=this;return!!this.$element&&(this.$element.find(".formbuilder-checkbox-group").each((function(t,n){var r=$(".formbuilder-checkbox input",n),o=$(n).find("label"),i=e.spec.find((function(e){return"checkbox-group"===e.type&&e.name===o.attr("for")})),a=i.userData;if(r.length&&i&&a){r.each((function(e,t){var n=a.indexOf(t.value);n>=0?(a.splice(n,1),t.checked||$(t).click()):t.checked&&$(t).click()}));var s=$(".other-option",r.parent())[0],u=$(".other-val",r.parent())[0],c=a.join(" ");s&&(c?(s.checked=!0,s.value=c,u.value=c):(s.checked=!1,s.value="",u.value=""))}})),this.$element.find(".formbuilder-radio input.other-val").on("input",(function(e){$(e.currentTarget).closest(".formbuilder-radio-group").find("input").each((function(e,t){var n=$(t).attr("name");n&&n.endsWith("[]")&&$(t).attr("name",n.slice(0,-2))}))})),this)}},{key:"storeData",value:function(){if(!this.$element)return!1;var e=this.$element.closest("form").find('input[name="'.concat(this.$element.data("name"),'"]'));return e.length&&this.instance&&(this.spec=this.instance.userData,e.val(this.dataToXML(this.spec)),this.$element.data("spec",this.spec)),this}},{key:"init",value:function(e){this.$element=e,this.spec=e.data("spec"),this.instance=e.formRender({i18n:{locale:this.lang,location:window.DecidimAwesome.formBuilderLangsLocation},formData:this.spec,render:!0,disableInjectedStyle:!0,controlConfig:{"textarea.richtext":{editorOptions:e.data("editorOptions")}}}),this.fixBuggyFields()}}],t&&nk(e.prototype,t),n&&nk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();$((function(){window.DecidimAwesome.CustomFieldsRenderer=window.DecidimAwesome.CustomFieldsRenderer||new ok,window.DecidimAwesome.PrivateCustomFieldsRenderer=window.DecidimAwesome.PrivateCustomFieldsRenderer||new ok;var e=$(".proposal_custom_field:first"),t=$(".proposal_custom_field.proposal_custom_field--private_body:first"),n=null;e.length&&(window.DecidimAwesome.CustomFieldsRenderer.init(e),n=window.DecidimAwesome.CustomFieldsRenderer.$element.closest("form")),t.length&&(window.DecidimAwesome.PrivateCustomFieldsRenderer.init(t),n||(n=window.DecidimAwesome.PrivateCustomFieldsRenderer.$element.closest("form"))),n&&n.on("submit",(function(n){n.target.checkValidity()?(e.length&&window.DecidimAwesome.CustomFieldsRenderer.storeData(),t.length&&window.DecidimAwesome.PrivateCustomFieldsRenderer.storeData()):(n.preventDefault(),n.target.reportValidity())}))}))}()}();
//# sourceMappingURL=decidim_decidim_awesome_custom_fields-36af8a90fba5e7fd85ca.js.map