diff --git a/dist/js/field.js b/dist/js/field.js index c4cd019..d0833c9 100644 --- a/dist/js/field.js +++ b/dist/js/field.js @@ -1,2 +1,2 @@ /*! For license information please see field.js.LICENSE.txt */ -(()=>{var e,t={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),o=n(4372),s=n(5327),a=n(4097),l=n(4109),u=n(7985),c=n(5061);e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers,h=e.responseType;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(m+":"+g)}var _=a(e.baseURL,e.url);function v(){if(p){var r="getAllResponseHeaders"in p?l(p.getAllResponseHeaders()):null,o={data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,o),p=null}}if(p.open(e.method.toUpperCase(),s(_,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(v)},p.onabort=function(){p&&(n(c("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||u(_))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(f[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),o=n(321),s=n(7185);function a(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var l=a(n(5655));l.Axios=o,l.create=function(e){return a(s(l.defaults,e))},l.Cancel=n(5263),l.CancelToken=n(4972),l.isCancel=n(6502),l.all=function(e){return Promise.all(e)},l.spread=n(8713),l.isAxiosError=n(6268),e.exports=l,e.exports.default=l},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(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))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),o=n(782),s=n(3572),a=n(7185),l=n(4875),u=l.validators;function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&l.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!r){var c=[s,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(o),i=Promise.resolve(e);c.length;)i=i.then(c.shift(),c.shift());return i}for(var d=e;n.length;){var f=n.shift(),h=n.shift();try{d=f(d)}catch(e){h(e);break}}try{i=s(d)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},c.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=c},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(7303);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),o=n(6502),s=n(5655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i.call(e,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||s.adapter)(e).then((function(t){return a(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function l(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=l(void 0,e[i])):n[i]=l(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=l(void 0,t[e]))})),r.forEach(o,u),r.forEach(s,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=l(void 0,e[i])):n[i]=l(void 0,t[i])})),r.forEach(a,(function(r){r in t?n[r]=l(e[r],t[r]):r in e&&(n[r]=l(void 0,e[r]))}));var c=i.concat(o).concat(s).concat(a),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return r.forEach(d,u),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5655);e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4155),i=n(4867),o=n(6016),s=n(481),a={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(5448)),u),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(l(t,"application/json"),function(e,t,n){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){c.headers[e]=i.merge(a)})),e.exports=c},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).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 o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var s=[];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)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.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(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(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=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["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,o,s={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(8593),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=r.version.split(".");function a(e,t){for(var n=t?t.split("."):s,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0;){var o=r[i],s=t[o];if(s){var a=e[o],l=void 0===a||s(a,o,e);if(!0!==l)throw new TypeError("option "+o+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n{"use strict";const r=Vue;const i={props:["index","resource","resourceName","resourceId","field"]};var o=n(3744);const s=(0,o.Z)(i,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("Excerpt"),l=(0,r.resolveComponent)("PanelItem");return(0,r.openBlock)(),(0,r.createBlock)(l,{index:n.index,field:n.field},{value:(0,r.withCtx)((function(){return[(0,r.createVNode)(a,{content:n.field.value,"should-show":n.field.shouldShow},null,8,["content","should-show"])]})),_:1},8,["index","field"])}]]);var a={style:{position:"relative",top:"0",left:"0"}},l={class:"w-full overflow-break z-10 bg-gray-100 rounded",style:{position:"sticky",top:"0",left:"0"}},u={class:"p-1"},c={key:0,class:"w-[1px] h-6 relative top-2 mx-1 bg-gray-400"},d={key:0,class:"flex items-center z-10"},f={class:"mt-4 w-full px-0"};function h(e){this.content=e}h.prototype={constructor:h,find:function(e){for(var t=0;t>1}},h.from=function(e){if(e instanceof h)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new h(t)};const p=h;function m(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=m(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function g(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;ee&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new v(n,r)}cutByIndex(e,t){return e==t?v.empty:0==e&&t==this.content.length?this:new v(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new v(r,i)}addToStart(e){return new v([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new v(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?y(n+1,i):y(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return v.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return v.empty;let t,n=0;for(let r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank)),t}}x.none=[];class k extends Error{}class C{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=S(this.content,e+this.openStart,t);return n&&new C(n,this.openStart,this.openEnd)}removeBetween(e,t){return new C(E(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return C.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new C(v.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new C(e,n,r)}}function E(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(E(o.content,t-i-1,n-i-1)))}function S(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=S(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function M(e,t,n){if(n.openStart>e.depth)throw new k("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new k("Inconsistent open depths");return A(e,t,n,0)}function A(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0;e--)r=t.node(e).copy(v.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return L(o,R(e,i,s,t,r))}{let r=e.parent,i=r.content;return L(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return L(o,B(e,t,r))}function D(e,t){if(!t.type.compatibleContent(e.type))throw new k("Cannot join "+t.type.name+" onto "+e.type.name)}function O(e,t,n){let r=e.node(n);return D(r,t.node(n)),r}function N(e,t){let 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 T(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(N(e.nodeAfter,r),o++));for(let e=o;ei&&O(e,t,i+1),s=r.depth>i&&O(n,r,i+1),a=[];return T(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(D(o,s),N(L(o,R(e,t,n,r,i+1)),a)):(o&&N(L(o,B(e,t,i+1)),a),T(t,n,i,a),s&&N(L(s,B(n,r,i+1)),a)),T(r,null,i,a),new v(a)}function B(e,t,n){let r=[];if(T(null,e,n,r),e.depth>n){N(L(O(e,t,n+1),B(e,t,n+1)),r)}return T(t,null,n,r),new v(r)}C.empty=new C(v.empty,0,0);class I{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(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]}after(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}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let 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)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new j(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new I(t,n,i)}static resolveCached(e,t){for(let n=0;ne&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),W(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=v.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;ee.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let 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((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;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)}let r=v.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}$.prototype.text=void 0;class H extends ${constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):W(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new H(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new H(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function W(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class U{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new K(e,t);if(null==n.next)return U.empty;let r=q(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(Q(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new U(r.indexOf(e.length-1)>-1);for(let e=0;ee.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;te.createAndFill())));for(let e=0;e=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n"+e.indexOf(t.next[n].next);return r})).join("\n")}}U.empty=new U(!0);class K{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function q(e){let t=[];do{t.push(G(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function G(e){let t=[];do{t.push(Z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Z(e){let t=function(e){if(e.eat("(")){let t=q(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(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==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)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=J(e,t)}return t}function X(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function J(e,t){let 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 Y(e,t){return t-e}function Q(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tn[e]=new re(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class ie{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class oe{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ne(r.attrs),this.excluded=null;let i=ee(this.attrs);this.instance=i?new x(this,i):null}create(e=null){return!e&&this.instance?this.instance:new x(this,te(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new oe(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t-1}}class se{constructor(e){this.cached=Object.create(null),this.spec={nodes:p.from(e.nodes),marks:p.from(e.marks||{}),topNode:e.topNode},this.nodes=re.compile(this.spec.nodes,this),this.marks=oe.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=U.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?ae(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:ae(this,n.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)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof re))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)}text(e,t){let n=this.nodes.text;return new H(n,n.defaultAttrs,e,x.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return $.fromJSON(this,e)}markFromJSON(e){return x.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ae(e,t){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class le{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new pe(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new pe(this,t,!0);return n.addAll(e,t.from,t.to),C.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r{n(e=ge(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ge(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new le(e,le.schemaRules(e)))}}const ue={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},ce={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},de={ol:!0,ul:!0};function fe(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class he{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=x.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(v.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=v.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(v.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;tthis.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;ethis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function me(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ge(e){let t={};for(let n in e)t[n]=e[n];return t}function _e(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ve.renderSpec(ye(n),r(e,t))}static renderSpec(e,t,n=null){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;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;il)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=ve.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ve(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=be(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return be(e.marks)}}function be(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ye(e){return e.document||window.document}const we=Math.pow(2,16);function xe(e,t){return e+t*we}function ke(e){return 65535&e}class Ce{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Ee{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ee.empty)return Ee.empty}recover(e){let t=0,n=ke(e);if(!this.inverted)for(let e=0;ee)break;let l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){let i=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return i;let o=e==(t<0?a:c)?null:xe(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new Ce(i,d,o)}r+=u-l}return n?e+r:new Ce(e+r,0,null)}touches(e,t){let n=0,r=ke(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;te)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new Se;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,i)}invert(){return new Te(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ne(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ne&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ne(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ne(t.from,t.to,e.markFromJSON(t.mark))}}Ae.jsonID("addMark",Ne);class Te extends Ae{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new C(Oe(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,n)}invert(){return new Ne(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Te(t.pos,n.pos,this.mark)}merge(e){return e instanceof Te&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Te(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Te(t.from,t.to,e.markFromJSON(t.mark))}}Ae.jsonID("removeMark",Te);class Le extends Ae{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Be(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ee([this.from,this.to-this.from,this.slice.size])}invert(e){return new Le(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Le(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Le)||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;{let t=this.slice.size+e.slice.size==0?C.empty:new C(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Le(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?C.empty:new C(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Le(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Le(t.from,t.to,C.fromJSON(e,t.slice),!!t.structure)}}Ae.jsonID("replace",Le);class Re extends Ae{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Be(e,this.from,this.gapFrom)||Be(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?De.fromReplace(e,this.from,this.to,n):De.fail("Content does not fit in gap")}getMap(){return new Ee([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||rn.pos?null:new Re(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let 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}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Re(t.from,t.to,t.gapFrom,t.gapTo,C.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Be(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Ie(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Pe(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(no;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Ve(e,t){let n=e.resolve(t),r=n.index();return $e(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $e(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function He(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function We(e,t,n=t,r=C.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Ue(i,o,r)?new Le(t,n,r):new Ke(i,o,r).fit()}function Ue(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ae.jsonID("replaceAround",Re);class Ke{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=v.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=v.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new C(i,o,s);return e>-1?new Re(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Le(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=Ze(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(v.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ze(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new C(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ze(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new C(qe(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new C(qe(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e1||0==a||e.content.size)&&(c=t,u.push(Xe(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?f:-1)))}let h=l==s.childCount;h||(f=-1),this.placed=Ge(this.placed,t,v.from(u)),this.frontier[t].match=c,h&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=Je(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ge(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ge(this.placed,this.depth,v.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(v.empty,!0);e.childCount&&(this.placed=Ge(this.placed,this.frontier.length,e))}}function qe(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(qe(e.firstChild.content,t-1,n)))}function Ge(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ge(e.lastChild.content,t-1,n)))}function Ze(e,t){for(let n=0;n1&&(r=r.replaceChild(0,Xe(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(v.empty,!0)))),e.copy(r)}function Je(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;rr){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(v.empty,!0))}return e}function et(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(it.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let tt=class extends Error{};tt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(tt.prototype=Object.create(Error.prototype)).constructor=tt,tt.prototype.name="TransformError";class nt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Se}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new tt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=C.empty){let r=We(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new C(v.from(n),0,0))}delete(e,t){return this.replace(e,t,C.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Ue(i,o,r))return e.step(new Le(t,n,r));let s=et(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],c=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==r.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){let t=u[e].type,n=Ye(t);if(n&&i.node(l).type!=t)c=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+c+1)%(r.openStart+1),d=u[a];if(d)for(let t=0;t=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=v.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,c=v.from(r.node(e).copy(c)),d++):l--;let f=v.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=v.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new Re(i,o,i,o,new C(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Re(a,l,a+1,l-1,new C(v.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Re(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new C(v.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=v.empty,s=v.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=v.from(i.node(e).copy(o));let t=r&&r[a];s=v.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Le(t,t,new C(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,u)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,t),d=Math.min(l+e.nodeSize,n),f=r.addToSet(c);for(let e=0;ee.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof oe){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new Te(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t=0;t--)e.step(o[t])}(this,e,t,n),this}}const rt=Object.create(null);class it{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ot(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let i=t<0?pt(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):pt(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ft(e.node(0))}static atStart(e){return pt(e,e,0,0,1)||new ft(e)}static atEnd(e){return pt(e,e,e.content.size,e.childCount,-1)||new ft(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=rt[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(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}getBookmark(){return lt.between(this.$anchor,this.$head).getBookmark()}}it.prototype.visible=!0;class ot{constructor(e,t){this.$from=e,this.$to=t}}let st=!1;function at(e){st||e.parent.inlineContent||(st=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class lt extends it{constructor(e,t=e){at(e),at(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return it.near(n);let r=e.resolve(t.map(this.anchor));return new lt(r.parent.inlineContent?r:n,n)}replace(e,t=C.empty){if(super.replace(e,t),t==C.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof lt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ut(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new lt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=it.findFrom(t,n,!0)||it.findFrom(t,-n,!0);if(!e)return it.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(it.findFrom(e,-n,!0)||it.findFrom(e,n,!0)).$anchor).posnew ft(e)};function pt(e,t,n,r,i,o=!1){if(t.inlineContent)return lt.create(e,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ct.isSelectable(r))return ct.create(e,n-(i<0?r.nodeSize:0))}else{let t=pt(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function mt(e,t,n){let r=e.steps.length-1;if(r{null==i&&(i=r)})),e.setSelection(it.near(e.doc.resolve(i),n)))}class gt extends nt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return x.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||x.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let 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);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(it.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function _t(e,t){return t&&e?e.bind(t):e}class vt{constructor(e,t,n){this.name=e,this.init=_t(t.init,n),this.apply=_t(t.apply,n)}}const bt=[new vt("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new vt("selection",{init:(e,t)=>e.selection||it.atStart(t.doc),apply:e=>e.selection}),new vt("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new vt("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class yt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=bt.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vt(e.key,e.spec.state,e))}))}}class wt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new yt(e.schema,e.plugins),i=new wt(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=$.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=it.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function xt(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=xt(i,t,{})),n[r]=i}return n}class kt{constructor(e){this.spec=e,this.props={},e.props&&xt(e.props,this,this.props),this.key=e.key?e.key.key:Et("plugin")}getState(e){return e[this.key]}}const Ct=Object.create(null);function Et(e){return e in Ct?e+"$"+ ++Ct[e]:(Ct[e]=0,e+"$")}class St{constructor(e="key"){this.key=Et(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Mt="undefined"!=typeof navigator?navigator:null,At="undefined"!=typeof document?document:null,Dt=Mt&&Mt.userAgent||"",Ot=/Edge\/(\d+)/.exec(Dt),Nt=/MSIE \d/.exec(Dt),Tt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Dt),Lt=!!(Nt||Tt||Ot),Rt=Nt?document.documentMode:Tt?+Tt[1]:Ot?+Ot[1]:0,Bt=!Lt&&/gecko\/(\d+)/i.test(Dt);Bt&&(/Firefox\/(\d+)/.exec(Dt)||[0,0])[1];const It=!Lt&&/Chrome\/(\d+)/.exec(Dt),Pt=!!It,Ft=It?+It[1]:0,zt=!Lt&&!!Mt&&/Apple Computer/.test(Mt.vendor),jt=zt&&(/Mobile\/\w+/.test(Dt)||!!Mt&&Mt.maxTouchPoints>2),Vt=jt||!!Mt&&/Mac/.test(Mt.platform),$t=/Android \d/.test(Dt),Ht=!!At&&"webkitFontSmoothing"in At.documentElement.style,Wt=Ht?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Ut=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Kt=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let qt=null;const Gt=function(e,t,n){let r=qt||(qt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Zt=function(e,t,n,r){return n&&(Jt(e,t,n,r,-1)||Jt(e,t,n,r,1))},Xt=/^(img|br|input|textarea|hr)$/i;function Jt(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Yt(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Qt(e)||Xt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Ut(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Yt(e):0}}}function Yt(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Qt(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const en=function(e){let t=e.isCollapsed;return t&&Pt&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function tn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function nn(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rn(e,t){return"number"==typeof e?e:e[t]}function on(e){let 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 sn(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Kt(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?nn(o):on(e),l=0,u=0;if(t.topa.bottom-rn(r,"bottom")&&(u=t.bottom-a.bottom+rn(i,"bottom")),t.lefta.right-rn(r,"right")&&(l=t.right-a.right+rn(i,"right")),l||u)if(n)o.defaultView.scrollBy(l,u);else{let n=e.scrollLeft,r=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function an(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Kt(r));return t}function ln(e,t){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cn(n,r)}function dn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function fn(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cn(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function pn(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const mn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gn(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Ht||Bt;if(3==r.nodeType){if(!o||!mn.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,_n(pn(Gt(r,e,t),o),o<0)}{let e=pn(Gt(r,i,i),n);if(Bt&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==Yt(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Gt(e,Yt(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return _n(pn(t,1),!1)}if(i=0)}function _n(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function vn(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function bn(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const yn=/[\u0590-\u08ac]/;let wn=null,xn=null,kn=!1;function Cn(e,t,n){return wn==t&&xn==n?kn:(wn=t,xn=n,kn="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return bn(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=gn(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Gt(e,0,e.nodeValue.length).getClientRects()}for(let e=0;ei.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return yn.test(r.parent.textContent)&&a.modify?bn(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}class En{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tUt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);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}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||n instanceof Tn){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Sn&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Ut(e.dom)+1:0}}{let e,n=!0;for(;e=r=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Ut(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;ea&&ot){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Mn extends En{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class An extends En{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=ve.renderSpec(document,t.type.spec.toDOM(t,n))),new An(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(i=Un(i,0,e,n));for(let e=0;es?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),u=l&&l.dom,c=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:c}=ve.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=jn(u,n,t),l?s=new Ln(e,t,n,r,u,c||null,d,l,i,o+1):t.isText?new Nn(e,t,n,r,u,d,i):new Dn(e,t,n,r,u,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>v.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Vn(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Hn(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;no;)a.push(i[s++]);let f=o+c.nodeSize;if(c.isText){let e=f;s!e.inline)):a.slice();r(c,h,t.forChild(o,c),d),o=f}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?x.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,u)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>r&&e.state.selection.to-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,u)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Rn(this.contentDOM,this.children,e),jt&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof lt)||nt+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Yt(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){let e=a=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;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)}let o=new Mn(this,i,t,r);e.input.compositionNodes.push(o),this.children=Un(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Vn(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Fn(this.dom,this.nodeDOM,Pn(this.outerDeco,this.node,t),Pn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function On(e,t,n,r,i){return jn(r,t,e),new Dn(void 0,e,t,n,r,r,r,i,0)}class Nn extends Dn{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(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)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Nn(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Tn extends En{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Ln extends Dn{constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r,i,o,s,l,u),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Rn(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof An)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,o=Math.min(i,e.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=An.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r=n||c<=t?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function Kn(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(en(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ct.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Yt(e);r||i;){if(e==n)return!0;let t=Ut(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Yt(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ct(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=tr(e,a,u,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{qn(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zn=zt||Pt&&Ft<63;function Xn(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||lt.between(t,n,r)}function nr(e){return(!e.editable||e.root.activeElement==e.dom)&&rr(e)}function rr(e){let t=e.domSelection();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(e){return!1}}function ir(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&it.findFrom(o,t)}function or(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function sr(e,t,n){let r=e.state.selection;if(!(r instanceof lt)){if(r instanceof ct&&r.node.isInline)return or(e,new lt(t>0?r.$to:r.$from));{let n=ir(e.state,t);return!!n&&or(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=ir(e.state,t);return!!(n&&n instanceof ct)&&or(e,n)}if(!(Vt&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ct.isSelectable(o)?or(e,new ct(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Ht&&or(e,new lt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function ar(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lr(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function ur(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Bt&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(lr(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(dr(n))break;{let t=n.previousSibling;for(;t&&lr(t);)i=n.parentNode,o=Ut(t),t=t.previousSibling;if(t)n=t,r=ar(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?fr(e,t,n,r):i&&fr(e,t,i,o)}function cr(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=ar(n);for(;;)if(r{e.state==i&&Gn(e)}),50)}function hr(e,t,n){let r=e.state.selection;if(r instanceof lt&&!r.empty||n.indexOf("s")>-1)return!1;if(Vt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ir(e.state,t);if(n&&n instanceof ct)return or(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof ft?it.near(n,t):it.findFrom(n,t);return!!s&&or(e,s)}return!1}function pr(e,t){if(!(e.state.selection instanceof lt))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function mr(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function gr(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Vt&&72==n&&"c"==r?pr(e,-1)||ur(e):46==n||Vt&&68==n&&"c"==r?pr(e,1)||cr(e):13==n||27==n||(37==n||Vt&&66==n&&"c"==r?sr(e,-1,r)||ur(e):39==n||Vt&&70==n&&"c"==r?sr(e,1,r)||cr(e):38==n||Vt&&80==n&&"c"==r?hr(e,-1,r)||ur(e):40==n||Vt&&78==n&&"c"==r?function(e){if(!zt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;mr(e,n,"true"),setTimeout((()=>mr(e,n,"false")),20)}return!1}(e)||hr(e,1,r)||cr(e):r==(Vt?"m":"c")&&(66==n||73==n||89==n||90==n))}function _r(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||ve.fromSchema(e.state.schema),a=Mr(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Er[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function vr(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new C(v.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):C.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=ve.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Mr().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Er[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||le.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||br.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=v.from(t.create(n[e+1],i)),o++,s++}return new C(i,o,s)}(Cr(s,+c[1],+c[2]),c[4]);else if(s=C.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&wr(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=xr(o[o.length-1],r.length));let t=yr(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return v.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e{s=e(s)})),s}const br=/^(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 yr(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,v.from(e));return e}function wr(e,t,n,r,i){if(i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Cr(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Lr(e,t))}))}function Lr(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Rr(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Br(e){return{left:e.clientX,top:e.clientY}}function Ir(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Pr(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Fr(e,t,n,r,i){return Ir(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ct&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ct.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Pr(e,ct.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ct.isSelectable(r))&&(Pr(e,new ct(n),"pointer"),!0)}(e,n))}function zr(e,t,n,r){return Ir(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function jr(e,t,n,r){return Ir(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Pr(e,lt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Pr(e,lt.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ct.isSelectable(n))continue;Pr(e,ct.create(r,o),"pointer")}return!0}}(e,n,r)}function Vr(e){return Gr(e)}Dr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Wr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$t||!Pt||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!jt||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||gr(e,n)?n.preventDefault():Nr(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,tn(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Dr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Dr.keypress=(e,t)=>{let n=t;if(Wr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vt&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof lt&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const $r=Vt?"metaKey":"ctrlKey";Ar.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Vr(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[$r]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Br(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Hr(e,s,n,!!r)):("doubleClick"==o?zr:jr)(e,s.pos,s.inside,n)?n.preventDefault():Nr(e,"pointer"))};class Hr{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[$r],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ct&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Bt||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((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Nr(e,"pointer")}done(){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((()=>Gn(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Br(e))),this.allowDefault||!t?Nr(this.view,"pointer"):Fr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||zt&&this.mightDrag&&!this.mightDrag.node.isAtom||Pt&&!(this.view.state.selection instanceof lt)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Pr(this.view,it.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Nr(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Nr(this.view,"pointer"),0==e.buttons&&this.done()}}function Wr(e,t){return!!e.composing||!!(zt&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ar.touchdown=e=>{Vr(e),Nr(e,"pointer")},Ar.contextmenu=e=>Vr(e);const Ur=$t?5e3:-1;function Kr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Gr(e)),t))}function qr(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Gr(e,t=!1){if(!($t&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),qr(e),t||e.docView&&e.docView.dirty){let t=Kn(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Dr.compositionstart=Dr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Gr(e,!0),e.markCursor=null;else if(Gr(e),Bt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Kr(e,Ur)},Dr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Kr(e,20))};const Zr=Lt&&Rt<15||jt&&Wt<604;function Xr(e,t,n,r){let i=vr(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||C.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ar.copy=Dr.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Zr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=_r(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Dr.paste=(e,t)=>{let n=t;if(e.composing&&!$t)return;let r=Zr?null:n.clipboardData;r&&Xr(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let 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(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xr(e,r.value,null,t):Xr(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class Jr{constructor(e,t){this.slice=e,this.move=t}}const Yr=Vt?"altKey":"ctrlKey";Ar.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Br(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ct?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=_r(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zr||n.dataTransfer.setData("text/plain",l),e.dragging=new Jr(s,!n[Yr])},Ar.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Dr.dragover=Dr.dragenter=(e,t)=>t.preventDefault(),Dr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Br(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=vr(e,n.dataTransfer.getData(Zr?"Text":"text/plain"),Zr?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[Yr]);if(e.someProp("handleDrop",(t=>t(e,n,s||C.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?He(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(f))return;let h=u.doc.resolve(c);if(d&&ct.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ct(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(tr(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},Ar.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Gn(e)}),20))},Ar.blur=(e,t)=>{let 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)},Ar.beforeinput=(e,t)=>{if(Pt&&$t&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,tn(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Dr)Ar[e]=Dr[e];function Qr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class ei{constructor(e,t){this.toDOM=e,this.spec=t||oi,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ri(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof ei&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Qr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ti{constructor(e,t){this.attrs=e,this.spec=t||oi}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ri(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==ai||0==e.maps.length?this:this.mapInner(e,t,0,0,n||oi)}mapInner(e,t,n,r,i){let o;for(let s=0;s{for(let s=0;su+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:f,offset:h}=r.content.findIndex(c),p=r.maybeChild(f);if(p&&h==c&&h+p.nodeSize==d){let r=a[t+2].mapInner(n,p,l+1,e[t]+o+1,s);r!=ai?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o{let s,a=o+n;if(s=ci(t,e,a)){for(r||(r=this.children.slice());io&&t.to=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;ei&&t.type instanceof ti){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(e,t,oi)));return li.from(n)}forChild(e,t){if(t.isLeaf)return si.empty;let n=[];for(let r=0;rn&&t.to{let a=ci(e,t,s+n);if(a){o=!0;let e=fi(a,t,n+s+1,r);e!=ai&&i.push(s,s+t.nodeSize,e)}}));let s=ui(o?di(e):e,-n).sort(hi);for(let e=0;e0;)t++;e.splice(t,0,n)}function gi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=ai&&t.push(r)})),e.cursorWrapper&&t.push(si.create(e.state.doc,[e.cursorWrapper.deco])),li.from(t)}const _i={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vi=Lt&&Rt<=11;class bi{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class yi{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bi,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),vi&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,_i),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(nr(this.view)){if(this.suppressingSelectionUpdates)return Gn(this.view);if(Lt&&Rt<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Zt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&nr(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let t=0;t1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(wi)return;wi=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Gn(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let 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(let n=0;nDate.now()-50?e.input.lastSelectionOrigin:null,n=Kn(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelection(),c=u.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],en(u)||r.push({node:u.focusNode,offset:u.focusOffset})),Pt&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp("domParser")||le.fromSchema(e.state.schema),h=d.resolve(a),p=null,m=f.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:xi,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),p={anchor:e+a,head:t+a}}return{doc:m,sel:p,from:a,to:l}}(e,t,n);if(Pt&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,c,d=e.state.doc,f=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100=s?o-r:0,a=o+(a-s),s=o}else if(a=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(f.content,l.doc.content,l.from,u,c);if((jt&&e.input.lastIOSEnter>Date.now()-225||$t)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,tn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof lt&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=Ci(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=l.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Lt&&Rt<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&"  "==l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)&&(h.start--,h.endA--,h.endB--);let p,m=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),_=d.resolve(h.start),b=m.sameParent(g)&&m.parent.inlineContent&&_.end()>=h.endA;if((jt&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.post(e,tn(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ei(r,!0,!1)n||Ei(s,!0,!1)t(e,tn(8,"Backspace")))))return void($t&&Pt&&e.domObserver.suppressSelectionUpdates());Pt&&$t&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),$t&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,tn(13,"Enter"))}))}),20));let y,w,x,k=h.start,C=h.endA;if(b)if(m.pos==g.pos)Lt&&Rt<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Gn(e)),20)),y=e.state.tr.delete(k,C),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;ee.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;en(e,k,C,t))))return;y=e.state.tr.insertText(t,k,C)}if(y||(y=e.state.tr.replace(k,C,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let t=Ci(e,y.doc,l.sel);t&&!(Pt&&$t&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:tr(e,t.resolve(n.anchor),t.resolve(n.head))}function Ei(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Si{constructor(e,t){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 Or,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ni),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Di(this),Ai(this),this.nodeViews=Oi(this),this.docView=On(this.state.doc,Mi(this),gi(this),this.dom,this),this.domObserver=new yi(this,((e,t,n,r)=>ki(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Ar){let n=Ar[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Rr(e,t)||Lr(e,t)||!e.editable&&t.type in Dr||n(e,t)})}zt&&e.dom.addEventListener("input",(()=>null)),Tr(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Tr(this),this._props=e,e.plugins&&(e.plugins.forEach(Ni),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(qr(this),i=!0),this.state=e,t){let e=Oi(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),Tr(this)}this.editable=Di(this),Ai(this);let o=gi(this),s=Mi(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:an(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(Lt||Pt)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Pt?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=On(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Zt(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Gn(this,t):(Qn(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof ct){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&sn(this,n.getBoundingClientRect(),t)}else sn(this,this.coordsAtPos(e.selection.head,1),t)}else u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ln(n,0==r?0:r-t)}(u)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;te.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return hn(this,e)}coordsAtPos(e,t=1){return gn(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Cn(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in 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,[],gi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Lr(e,t)||!Ar[t.type]||!e.editable&&t.type in Dr||Ar[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Mi(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ri.node(0,e.state.doc.content.size,t)]}function Ai(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ri.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Di(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Oi(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Ni(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 Ti={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:"'",229:"q"},Li={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Ri="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Bi="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Ii="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Pi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Fi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),zi=Ri&&(Pi||+Ri[1]<57)||Ii&&Pi,ji=0;ji<10;ji++)Ti[48+ji]=Ti[96+ji]=String(ji);for(ji=1;ji<=24;ji++)Ti[ji+111]="F"+ji;for(ji=65;ji<=90;ji++)Ti[ji]=String.fromCharCode(ji+32),Li[ji]=String.fromCharCode(ji);for(var Vi in Ti)Li.hasOwnProperty(Vi)||(Li[Vi]=Ti[Vi]);const $i="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Hi(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e127)&&(r=Ti[n.keyCode])&&r!=i){let i=t[Wi(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Wi(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}const Ki=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),qi=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Xi(r);if(!i){let n=r.blockRange(),i=n&&Pe(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&so(e,i,t))return!0;if(0==r.parent.content.size&&(Gi(o,"end")||ct.isSelectable(o))){let n=We(e.doc,r.before(),r.after(),C.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Xi(r)}let s=o&&o.nodeBefore;return!(!s||!ct.isSelectable(s))&&(t&&t(e.tr.setSelection(ct.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Xi(e){if(!e.parent.type.spec.isolating)for(let 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}const Ji=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function to(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=to(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(it.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ro=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ft||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=to(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(je(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Pe(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},oo=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof ct&&e.selection.node.isBlock)return!(!n.parentOffset||!je(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let i=r.parentOffset==r.parent.content.size,o=e.tr;(e.selection instanceof lt||e.selection instanceof ft)&&o.deleteSelection();let s=0==n.depth?null:to(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=je(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!je(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let e=o.mapping.map(n.before()),t=o.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0};function so(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Ve(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;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=v.empty;for(let e=r.length-1;e>=0;e--)a=v.from(r[e].create(null,a));a=v.from(o.copy(a));let l=e.tr.step(new Re(t.pos-1,i,t.pos,i,new C(a,1,0),r.length,!0)),u=i+2*r.length;Ve(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=it.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),c=u&&Pe(u);if(null!=c&&c>=t.depth)return n&&n(e.tr.lift(u,c).scrollIntoView()),!0;if(a&&Gi(s,"start",!0)&&Gi(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=v.empty;for(let e=i.length-1;e>=0;e--)r=v.from(i[e].copy(r));n(e.tr.step(new Re(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new C(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ao(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(lt.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const lo=ao(-1),uo=ao(1);function co(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function fo(...e){return function(t,n,r){for(let i=0;i(t&&t(e.tr.setSelection(new ft(e.doc))),!0)},go={"Ctrl-h":mo.Backspace,"Alt-Backspace":mo["Mod-Backspace"],"Ctrl-d":mo.Delete,"Ctrl-Alt-Backspace":mo["Mod-Delete"],"Alt-Delete":mo["Mod-Delete"],"Alt-d":mo["Mod-Delete"],"Ctrl-a":lo,"Ctrl-e":uo};for(let e in mo)go[e]=mo[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function _o(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=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;let e=n.doc.resolve(s.start-2);l=new j(e,e,s.depth),s.endIndex=0;e--)o=v.from(n[e].type.create(n[e].attrs,o));e.step(new Re(t.start-(r?2:0),t.end,t.start,t.end,new C(o,0,0),n.length,!0));let s=0;for(let e=0;et.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);oo;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?v.empty:v.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Re(d-(a?1:0),f+(l?1:0),d+1,f-1,new C((a?v.empty:v.from(i.copy(v.empty))).append(l?v.empty:v.from(i.copy(v.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function bo(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...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 o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class yo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),u}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return u}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:r})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:bo({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function wo(e,t,n){if(void 0===e.config[t]&&e.parent)return wo(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?wo(e.parent,t,n):null})}return e.config[t]}function xo(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function ko(e){const t=[],{nodeExtensions:n,markExtensions:r}=xo(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=wo(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=wo(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};r.isRequired&&void 0===r.default&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function Co(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Eo(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function So(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>Eo(e,t)),{})}function Mo(e){return"function"==typeof e}function Ao(e,t,...n){return Mo(e)?t?e.bind(t)(...n):e(...n):e}function Do(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const 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?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function Oo(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function No(e){var t;const n=ko(e),{nodeExtensions:r,markExtensions:i}=xo(e),o=null===(t=r.find((e=>wo(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=Oo({...e.reduce(((e,n)=>{const r=wo(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),content:Ao(wo(t,"content",i)),marks:Ao(wo(t,"marks",i)),group:Ao(wo(t,"group",i)),inline:Ao(wo(t,"inline",i)),atom:Ao(wo(t,"atom",i)),selectable:Ao(wo(t,"selectable",i)),draggable:Ao(wo(t,"draggable",i)),code:Ao(wo(t,"code",i)),defining:Ao(wo(t,"defining",i)),isolating:Ao(wo(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),s=Ao(wo(t,"parseHTML",i));s&&(o.parseDOM=s.map((e=>Do(e,r))));const a=wo(t,"renderHTML",i);a&&(o.toDOM=e=>a({node:e,HTMLAttributes:So(e,r)}));const l=wo(t,"renderText",i);return l&&(o.toText=l),[t.name,o]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=Oo({...e.reduce(((e,n)=>{const r=wo(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),inclusive:Ao(wo(t,"inclusive",i)),excludes:Ao(wo(t,"excludes",i)),group:Ao(wo(t,"group",i)),spanning:Ao(wo(t,"spanning",i)),code:Ao(wo(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),s=Ao(wo(t,"parseHTML",i));s&&(o.parseDOM=s.map((e=>Do(e,r))));const a=wo(t,"renderHTML",i);return a&&(o.toDOM=e=>a({mark:e,HTMLAttributes:So(e,r)})),[t.name,o]})));return new se({topNode:o,nodes:s,marks:a})}function To(e,t){return t.nodes[e]||t.marks[e]||null}function Lo(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ro(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Bo{constructor(e){this.find=e.find,this.handler=e.handler}}function Io(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let c=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((e,t,r,i)=>{var o,s;n+=(null===(s=(o=e.type.spec).toText)||void 0===s?void 0:s.call(o,{node:e,pos:t,parent:r,index:i}))||e.textContent||"%leaf%"})),n})(u)+o;return s.forEach((e=>{if(c)return;const t=((e,t)=>{if(Ro(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),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})(d,e.find);if(!t)return;const s=l.state.tr,u=bo({state:l.state,transaction:s}),f={from:r-(t[0].length-o.length),to:i},{commands:h,chain:p,can:m}=new yo({editor:n,state:u});null!==e.handler({state:u,range:f,match:t,commands:h,chain:p,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),c=!0)})),c}function Po(e){const{editor:t,rules:n}=e,r=new kt({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>Io({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Io({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Io({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Fo{constructor(e){this.find=e.find,this.handler=e.handler}}function zo(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new yo({editor:t,state:n}),u=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const c=Math.max(r,t),d=Math.min(i,t+e.content.size),f=((e,t)=>{if(Ro(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),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})):[]})(e.textBetween(c-t,d-t,void 0,""),o.find);f.forEach((e=>{if(void 0===e.index)return;const t=c+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});u.push(d)}))}));return u.every((e=>null!==e))}function jo(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map((e=>new kt({view(e){const t=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(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,u="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!u)return;const c=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!d||c===d.b)return;const f=s.tr,h=bo({state:s,transaction:f});return zo({editor:t,state:h,from:Math.max(c-1,0),to:d.b,rule:e})&&f.steps.length?f:void 0}})))}class Vo{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Vo.resolve(e),this.schema=No(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:To(e.name,this.schema)};if("mark"===e.type){(null===(t=Ao(wo(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=wo(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=wo(e,"onCreate",n);i&&this.editor.on("create",i);const o=wo(e,"onUpdate",n);o&&this.editor.on("update",o);const s=wo(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=wo(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=wo(e,"onFocus",n);l&&this.editor.on("focus",l);const u=wo(e,"onBlur",n);u&&this.editor.on("blur",u);const c=wo(e,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(e){const t=Vo.sort(Vo.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=wo(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((e,t)=>{const n=wo(e,"priority")||100,r=wo(t,"priority")||100;return n>r?-1:n{const n=wo(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:To(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Vo.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:To(t.name,this.schema)},o=[],s=wo(t,"addKeyboardShortcuts",i);if(s){const t=function(e){return new kt({props:{handleKeyDown:Ui(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));o.push(t)}const a=wo(t,"addInputRules",i);Lo(t,e.options.enableInputRules)&&a&&n.push(...a());const l=wo(t,"addPasteRules",i);Lo(t,e.options.enablePasteRules)&&l&&r.push(...l());const u=wo(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Po({editor:e,rules:n}),...jo({editor:e,rules:r}),...i]}get attributes(){return ko(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=xo(this.extensions);return Object.fromEntries(t.filter((e=>!!wo(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:Co(t.name,this.schema)},i=wo(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=So(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function $o(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Ho(e,t){const n={...e};return $o(e)&&$o(t)&&Object.keys(t).forEach((r=>{$o(t[r])?r in e?n[r]=Ho(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class Wo{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ao(wo(this,"addOptions",{name:this.name}))),this.storage=Ao(wo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Wo(e)}configure(e={}){const t=this.extend();return t.options=Ho(this.options,e),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Wo(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Ao(wo(t,"addOptions",{name:t.name})),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}}function Uo(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,u,c)=>{var d;const f=null==s?void 0:s[e.type.name];f?(e.isBlock&&!l&&(a+=o,l=!0),u&&(a+=f({node:e,pos:n,parent:u,index:c,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Ko(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const qo=Wo.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new kt({key:new St("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Uo(r,{from:s,to:a},{textSerializers:Ko(n)})}}})]}});function Go(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ro(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Zo(e,t,n={}){return e.find((e=>e.type===t&&Go(e.attrs,n)))}function Xo(e,t,n={}){return!!Zo(e,t,n)}function Jo(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Zo([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Zo([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a${e}`;return(new window.DOMParser).parseFromString(t,"text/html").body}function ss(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?v.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),ss("",t,n)}if("string"==typeof e){const r=le.fromSchema(t);return n.slice?r.parseSlice(is(e),n.parseOptions).content:r.parse(is(e),n.parseOptions)}return ss("",t,n)}function as(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function ls(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?Co(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,u=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Go(e.node.attrs,n,{strict:!1})));if(o)return!!u.length;return u.reduce(((e,t)=>e+t.to-t.from),0)>=l}function us(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function cs(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function ds(e,t,n={}){return ss(e,t,{slice:!1,parseOptions:n})}function fs(e,t){const n=Yo(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function hs(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function ps(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function ms(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function gs(e){return t=>ms(t.$from,e)}function _s(e,t){const{nodeExtensions:n}=xo(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=Ao(wo(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}const vs=(e,t)=>{const n=gs((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Ve(e.doc,n.pos)||(e.join(n.pos),!0)},bs=(e,t)=>{const n=gs((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Ve(e.doc,r)||(e.join(r),!0)};function ys(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Yo(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Go(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Go(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),u=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+u:l)>=s}var ws=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Pe(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>ro(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=Co(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>Ki(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>no(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Yo(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const e=Jo(l,o,t);if(e&&e.from<=u&&e.to>=c){const t=lt.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{rs()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!es(n.state.selection))return s(),!0;const a=ns(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=ss(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),s===a&&u){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r{0===s&&(s=r)})),e.setSelection(it.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>qi(e,t),joinForward:()=>({state:e,dispatch:t})=>Ji(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!ls(n,Co(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Pe(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>io(e,t),liftListItem:e=>({state:t,dispatch:n})=>vo(Co(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>eo(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=us("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=Co(e,r.schema)),"mark"===a&&(s=Yo(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,cs(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(cs(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>Zi(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>Yi(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(ct.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>uo(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>lo(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=ds(e,i.schema,n),l=lt.create(s,0,s.content.size);return o&&r.setSelection(l).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Yo(e,r.schema);if(i)if(s){const e=fs(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Co(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!co(o,t)(n)||e.clearNodes())).command((({state:e})=>co(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=it.atStart(n).from,i=it.atEnd(n).to,o=ts(e,r,i),s=ct.create(n,o);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=lt.atStart(n).from,s=lt.atEnd(n).to,a=ts(r,o,s),l=ts(i,o,s),u=lt.create(n,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=Co(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=v.from(n?i.create():null),s=new C(v.from(i.create(null,v.from(a.type.create(null,r)))),n?3:1,0),u=o.start,c=o.end;t(e.tr.step(new Re(u-(n?3:1),c,u,c,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=hs(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ct&&o.node.isBlock)return!(!a.parentOffset||!je(s,a.pos))&&(r&&(e&&ps(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof lt&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=Co(e,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=v.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=v.from(a.node(t).copy(e));const r=a.indexAfter(-1){if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)})),c>-1&&t.setSelection(lt.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}const f=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=hs(d,c.type.name,c.attrs),p=hs(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=f?[{type:s,attrs:h},{type:f,attrs:p}]:[{type:s,attrs:h}];return!!je(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:u}=n.extensionManager,c=Co(e,i.schema),d=Co(t,i.schema),{selection:f}=i,{$from:h,$to:p}=f,m=h.blockRange(p);if(!m)return!1;const g=gs((e=>_s(e.type.name,u)))(f);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(d);if(_s(g.node.type.name,u)&&c.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>vs(r,c))).command((()=>bs(r,c))).run()}return s().command((()=>!!l().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>vs(r,c))).command((()=>bs(r,c))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Yo(e,r.schema);return ys(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Co(e,r.schema),s=Co(t,r.schema);return ls(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Co(e,n.schema);return ls(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Yo(e,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a;const r=null===(o=u.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=Jo(u,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=us("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=Co(e,r.schema)),"mark"===a&&(s=Yo(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),u=Math.min(r+e.nodeSize,a);n.addMark(l,u,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Fe(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Co(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>_o(Co(e,n.schema),t)(n,r)});const xs=Wo.create({name:"commands",addCommands:()=>({...ws})}),ks=Wo.create({name:"editable",addProseMirrorPlugins(){return[new kt({key:new St("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Cs=Wo.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new kt({key:new St("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Es=Wo.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=it.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return rs()||as()?i:r},addProseMirrorPlugins(){return[new kt({key:new St("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=it.atStart(t.doc).from,a=it.atEnd(t.doc).to,l=i===s&&o===a,u=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!u)return;const c=n.tr,d=bo({state:n,transaction:c}),{commands:f}=new yo({editor:this.editor,state:d});return f.clearNodes(),c.steps.length?c:void 0}})]}}),Ss=Wo.create({name:"tabindex",addProseMirrorPlugins(){return[new kt({key:new St("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Ms=Object.freeze({__proto__:null,ClipboardTextSerializer:qo,Commands:xs,Editable:ks,FocusEvents:Cs,Keymap:Es,Tabindex:Ss});function As(e,t){const n=us("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Co(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?fs(e,t):{}}function Ds(e,t){const n=ve.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Os(e,t){return Uo(e,{from:0,to:e.content.size},t)}function Ns(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function Ts(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>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 Ls(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=Jo(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function Rs(e,t,n){const r=e.state.doc.content.size,i=ts(t,0,r),o=ts(n,0,r),s=e.coordsAtPos(i),a=e.coordsAtPos(o,-1),l=Math.min(s.top,a.top),u=Math.max(s.bottom,a.bottom),c=Math.min(s.left,a.left),d=Math.max(s.right,a.right),f={top:l,bottom:u,left:c,right:d,width:d-c,height:u-l,x:c,y:l};return{...f,toJSON:()=>f}}function Bs(e){return new Bo({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ao(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(Ls(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u)).length)return null;cn.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Is(e){return new Bo({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ao(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}})}function Ps(e){return new Bo({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ao(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function Fs(e){return new Bo({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ao(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&Fe(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Ve(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class zs{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ao(wo(this,"addOptions",{name:this.name}))),this.storage=Ao(wo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new zs(e)}configure(e={}){const t=this.extend();return t.options=Ho(this.options,e),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new zs(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Ao(wo(t,"addOptions",{name:t.name})),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}}class js{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ao(wo(this,"addOptions",{name:this.name}))),this.storage=Ao(wo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new js(e)}configure(e={}){const t=this.extend();return t.options=Ho(this.options,e),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new js(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Ao(wo(t,"addOptions",{name:t.name})),t.storage=Ao(wo(t,"addStorage",{name:t.name,options:t.options})),t}}function Vs(e){return new Fo({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ao(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(Ls(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u)).length)return null;cn.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function $s(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Hs(e){return e instanceof $s(e).Element||e instanceof Element}function Ws(e){return e instanceof $s(e).HTMLElement||e instanceof HTMLElement}function Us(e){return"undefined"!=typeof ShadowRoot&&(e instanceof $s(e).ShadowRoot||e instanceof ShadowRoot)}var Ks=Math.max,qs=Math.min,Gs=Math.round;function Zs(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Ws(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Gs(n.width)/s||1),o>0&&(i=Gs(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function Xs(e){var t=$s(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Js(e){return e?(e.nodeName||"").toLowerCase():null}function Ys(e){return((Hs(e)?e.ownerDocument:e.document)||window.document).documentElement}function Qs(e){return Zs(Ys(e)).left+Xs(e).scrollLeft}function ea(e){return $s(e).getComputedStyle(e)}function ta(e){var t=ea(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function na(e,t,n){void 0===n&&(n=!1);var r,i,o=Ws(t),s=Ws(t)&&function(e){var t=e.getBoundingClientRect(),n=Gs(t.width)/e.offsetWidth||1,r=Gs(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=Ys(t),l=Zs(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==Js(t)||ta(a))&&(u=(r=t)!==$s(r)&&Ws(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Xs(r)),Ws(t)?((c=Zs(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Qs(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function ra(e){var t=Zs(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ia(e){return"html"===Js(e)?e:e.assignedSlot||e.parentNode||(Us(e)?e.host:null)||Ys(e)}function oa(e){return["html","body","#document"].indexOf(Js(e))>=0?e.ownerDocument.body:Ws(e)&&ta(e)?e:oa(ia(e))}function sa(e,t){var n;void 0===t&&(t=[]);var r=oa(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=$s(r),s=i?[o].concat(o.visualViewport||[],ta(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(sa(ia(s)))}function aa(e){return["table","td","th"].indexOf(Js(e))>=0}function la(e){return Ws(e)&&"fixed"!==ea(e).position?e.offsetParent:null}function ua(e){for(var t=$s(e),n=la(e);n&&aa(n)&&"static"===ea(n).position;)n=la(n);return n&&("html"===Js(n)||"body"===Js(n)&&"static"===ea(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ws(e)&&"fixed"===ea(e).position)return null;var n=ia(e);for(Us(n)&&(n=n.host);Ws(n)&&["html","body"].indexOf(Js(n))<0;){var r=ea(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var ca="top",da="bottom",fa="right",ha="left",pa="auto",ma=[ca,da,fa,ha],ga="start",_a="end",va="viewport",ba="popper",ya=ma.reduce((function(e,t){return e.concat([t+"-"+ga,t+"-"+_a])}),[]),wa=[].concat(ma,[pa]).reduce((function(e,t){return e.concat([t,t+"-"+ga,t+"-"+_a])}),[]),xa=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ka(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Ca={placement:"bottom",modifiers:[],strategy:"absolute"};function Ea(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function Ta(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Da(i):null,s=i?Oa(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case ca:t={x:a,y:n.y-r.height};break;case da:t={x:a,y:n.y+n.height};break;case fa:t={x:n.x+n.width,y:l};break;case ha:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?Na(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case ga:t[u]=t[u]-(n[c]/2-r[c]/2);break;case _a:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}const La={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ta({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var Ra={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ba(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,h=void 0===f?0:f,p=s.y,m=void 0===p?0:p,g="function"==typeof c?c({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var _=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),b=ha,y=ca,w=window;if(u){var x=ua(n),k="clientHeight",C="clientWidth";if(x===$s(n)&&"static"!==ea(x=Ys(n)).position&&"absolute"===a&&(k="scrollHeight",C="scrollWidth"),i===ca||(i===ha||i===fa)&&o===_a)y=da,m-=(d&&x===w&&w.visualViewport?w.visualViewport.height:x[k])-r.height,m*=l?1:-1;if(i===ha||(i===ca||i===da)&&o===_a)b=fa,h-=(d&&x===w&&w.visualViewport?w.visualViewport.width:x[C])-r.width,h*=l?1:-1}var E,S=Object.assign({position:a},u&&Ra),M=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Gs(t*r)/r||0,y:Gs(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=M.x,m=M.y,l?Object.assign({},S,((E={})[y]=v?"0":"",E[b]=_?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},S,((t={})[y]=v?m+"px":"",t[b]=_?h+"px":"",t.transform="",t))}const Ia={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:Da(t.placement),variation:Oa(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ba(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ba(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};const Pa={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Ws(i)&&Js(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ws(r)&&Js(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};const Fa={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=wa.reduce((function(e,n){return e[n]=function(e,t,n){var r=Da(e),i=[ha,ca].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[ha,fa].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}};var za={left:"right",right:"left",bottom:"top",top:"bottom"};function ja(e){return e.replace(/left|right|bottom|top/g,(function(e){return za[e]}))}var Va={start:"end",end:"start"};function $a(e){return e.replace(/start|end/g,(function(e){return Va[e]}))}function Ha(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Us(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wa(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ua(e,t){return t===va?Wa(function(e){var t=$s(e),n=Ys(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Qs(e),y:a}}(e)):Hs(t)?function(e){var t=Zs(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Wa(function(e){var t,n=Ys(e),r=Xs(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ks(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ks(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Qs(e),l=-r.scrollTop;return"rtl"===ea(i||n).direction&&(a+=Ks(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Ys(e)))}function Ka(e,t,n){var r="clippingParents"===t?function(e){var t=sa(ia(e)),n=["absolute","fixed"].indexOf(ea(e).position)>=0&&Ws(e)?ua(e):e;return Hs(n)?t.filter((function(e){return Hs(e)&&Ha(e,n)&&"body"!==Js(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce((function(t,n){var r=Ua(e,n);return t.top=Ks(r.top,t.top),t.right=qs(r.right,t.right),t.bottom=qs(r.bottom,t.bottom),t.left=Ks(r.left,t.left),t}),Ua(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qa(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ga(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Za(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,s=void 0===o?"clippingParents":o,a=n.rootBoundary,l=void 0===a?va:a,u=n.elementContext,c=void 0===u?ba:u,d=n.altBoundary,f=void 0!==d&&d,h=n.padding,p=void 0===h?0:h,m=qa("number"!=typeof p?p:Ga(p,ma)),g=c===ba?"reference":ba,_=e.rects.popper,v=e.elements[f?g:c],b=Ka(Hs(v)?v:v.contextElement||Ys(e.elements.popper),s,l),y=Zs(e.elements.reference),w=Ta({reference:y,element:_,strategy:"absolute",placement:i}),x=Wa(Object.assign({},_,w)),k=c===ba?x:y,C={top:b.top-k.top+m.top,bottom:k.bottom-b.bottom+m.bottom,left:b.left-k.left+m.left,right:k.right-b.right+m.right},E=e.modifiersData.offset;if(c===ba&&E){var S=E[i];Object.keys(C).forEach((function(e){var t=[fa,da].indexOf(e)>=0?1:-1,n=[ca,da].indexOf(e)>=0?"y":"x";C[e]+=S[n]*t}))}return C}const Xa={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,_=Da(g),v=l||(_===g||!p?[ja(g)]:function(e){if(Da(e)===pa)return[];var t=ja(e);return[$a(e),t,$a(t)]}(g)),b=[g].concat(v).reduce((function(e,n){return e.concat(Da(n)===pa?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?wa:l,c=Oa(r),d=c?a?ya:ya.filter((function(e){return Oa(e)===c})):ma,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=Za(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Da(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),y=t.rects.reference,w=t.rects.popper,x=new Map,k=!0,C=b[0],E=0;E=0,O=D?"width":"height",N=Za(t,{placement:S,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),T=D?A?fa:ha:A?da:ca;y[O]>w[O]&&(T=ja(T));var L=ja(T),R=[];if(o&&R.push(N[M]<=0),a&&R.push(N[T]<=0,N[L]<=0),R.every((function(e){return e}))){C=S,k=!1;break}x.set(S,R)}if(k)for(var B=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},I=p?3:1;I>0;I--){if("break"===B(I))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ja(e,t,n){return Ks(e,qs(t,n))}const Ya={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=void 0===f||f,p=n.tetherOffset,m=void 0===p?0:p,g=Za(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),_=Da(t.placement),v=Oa(t.placement),b=!v,y=Na(_),w="x"===y?"y":"x",x=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,S="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(x){if(o){var D,O="y"===y?ca:ha,N="y"===y?da:fa,T="y"===y?"height":"width",L=x[y],R=L+g[O],B=L-g[N],I=h?-C[T]/2:0,P=v===ga?k[T]:C[T],F=v===ga?-C[T]:-k[T],z=t.elements.arrow,j=h&&z?ra(z):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[O],H=V[N],W=Ja(0,k[T],j[T]),U=b?k[T]/2-I-W-$-S.mainAxis:P-W-$-S.mainAxis,K=b?-k[T]/2+I+W+H+S.mainAxis:F+W+H+S.mainAxis,q=t.elements.arrow&&ua(t.elements.arrow),G=q?"y"===y?q.clientTop||0:q.clientLeft||0:0,Z=null!=(D=null==M?void 0:M[y])?D:0,X=L+K-Z,J=Ja(h?qs(R,L+U-Z-G):R,L,h?Ks(B,X):B);x[y]=J,A[y]=J-L}if(a){var Y,Q="x"===y?ca:ha,ee="x"===y?da:fa,te=x[w],ne="y"===w?"height":"width",re=te+g[Q],ie=te-g[ee],oe=-1!==[ca,ha].indexOf(_),se=null!=(Y=null==M?void 0:M[w])?Y:0,ae=oe?re:te-k[ne]-C[ne]-se+S.altAxis,le=oe?te+k[ne]+C[ne]-se-S.altAxis:ie,ue=h&&oe?function(e,t,n){var r=Ja(e,t,n);return r>n?n:r}(ae,te,le):Ja(h?ae:re,te,h?le:ie);x[w]=ue,A[w]=ue-te}t.modifiersData[r]=A}},requiresIfExists:["offset"]};const Qa={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Da(n.placement),l=Na(a),u=[ha,fa].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(e,t){return qa("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ga(e,ma))}(i.padding,n),d=ra(o),f="y"===l?ca:ha,h="y"===l?da:fa,p=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],g=ua(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=p/2-m/2,b=c[f],y=_-d[u]-c[h],w=_/2-d[u]/2+v,x=Ja(b,w,y),k=l;n.modifiersData[r]=((t={})[k]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Ha(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function el(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function tl(e){return[ca,fa,da,ha].some((function(t){return e[t]>=0}))}const nl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Za(t,{elementContext:"reference"}),a=Za(t,{altBoundary:!0}),l=el(s,r),u=el(a,i,o),c=tl(l),d=tl(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var rl=Sa({defaultModifiers:[Aa,La,Ia,Pa,Fa,Xa,Ya,Qa,nl]}),il="tippy-content",ol="tippy-backdrop",sl="tippy-arrow",al="tippy-svg-arrow",ll={passive:!0,capture:!0},ul=function(){return document.body};function cl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function dl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function fl(e,t){return"function"==typeof e?e.apply(void 0,t):e}function hl(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function pl(e){return[].concat(e)}function ml(e,t){-1===e.indexOf(t)&&e.push(t)}function gl(e){return e.split("-")[0]}function _l(e){return[].slice.call(e)}function vl(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function bl(){return document.createElement("div")}function yl(e){return["Element","Fragment"].some((function(t){return dl(e,t)}))}function wl(e){return dl(e,"MouseEvent")}function xl(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function kl(e){return yl(e)?[e]:function(e){return dl(e,"NodeList")}(e)?_l(e):Array.isArray(e)?e:_l(document.querySelectorAll(e))}function Cl(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function El(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Sl(e){var t,n=pl(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Ml(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Al(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Dl={isTouch:!1},Ol=0;function Nl(){Dl.isTouch||(Dl.isTouch=!0,window.performance&&document.addEventListener("mousemove",Tl))}function Tl(){var e=performance.now();e-Ol<20&&(Dl.isTouch=!1,document.removeEventListener("mousemove",Tl)),Ol=e}function Ll(){var e=document.activeElement;if(xl(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Rl=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Bl={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Il=Object.assign({appendTo:ul,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Bl,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Pl=Object.keys(Il);function Fl(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=Il[i])?r:o);return t}),{});return Object.assign({},e,t)}function zl(e,t){var n=Object.assign({},t,{content:fl(t.content,[e])},t.ignoreAttributes?{}:function(e,t){var n=(t?Object.keys(Fl(Object.assign({},Il,{plugins:t}))):Pl).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{});return n}(e,t.plugins));return n.aria=Object.assign({},Il.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function jl(e,t){e.innerHTML=t}function Vl(e){var t=bl();return!0===e?t.className=sl:(t.className=al,yl(e)?t.appendChild(e):jl(t,e)),t}function $l(e,t){yl(t.content)?(jl(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?jl(e,t.content):e.textContent=t.content)}function Hl(e){var t=e.firstElementChild,n=_l(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(il)})),arrow:n.find((function(e){return e.classList.contains(sl)||e.classList.contains(al)})),backdrop:n.find((function(e){return e.classList.contains(ol)}))}}function Wl(e){var t=bl(),n=bl();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=bl();function i(n,r){var i=Hl(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||$l(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Vl(r.arrow))):o.appendChild(Vl(r.arrow)):a&&o.removeChild(a)}return r.className=il,r.setAttribute("data-state","hidden"),$l(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Wl.$$tippy=!0;var Ul=1,Kl=[],ql=[];function Gl(e,t){var n,r,i,o,s,a,l,u,c=zl(e,Object.assign({},Il,Fl(vl(t)))),d=!1,f=!1,h=!1,p=!1,m=[],g=hl(q,c.interactiveDebounce),_=Ul++,v=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:_,reference:e,popper:bl(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){0;if(b.state.isDestroyed)return;L("onBeforeUpdate",[b,t]),U();var n=b.props,r=zl(e,Object.assign({},n,vl(t),{ignoreAttributes:!0}));b.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(I(),g=hl(q,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?pl(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");B(),T(),x&&x(n,r);b.popperInstance&&(J(),Q().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));L("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Dl.isTouch&&!b.props.touch,i=cl(b.props.duration,0,Il.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(L("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,M()&&(w.style.visibility="visible");T(),j(),b.state.isMounted||(w.style.transition="none");if(M()){var o=O(),s=o.box,l=o.content;Cl([s,l],0)}a=function(){var e;if(b.state.isVisible&&!p){if(p=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,M()&&b.props.animation){var t=O(),n=t.box,r=t.content;Cl([n,r],i),El([n,r],"visible")}R(),B(),ml(ql,b),null==(e=b.popperInstance)||e.forceUpdate(),L("onMount",[b]),b.props.animation&&M()&&function(e,t){$(e,t)}(i,(function(){b.state.isShown=!0,L("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=A();e=b.props.interactive&&t===ul||"parent"===t?n.parentNode:fl(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,J(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=cl(b.props.duration,1,Il.duration);if(e||t||n)return;if(L("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,p=!1,d=!1,M()&&(w.style.visibility="hidden");if(I(),V(),T(!0),M()){var i=O(),o=i.box,s=i.content;b.props.animation&&(Cl([o,s],r),El([o,s],"hidden"))}R(),B(),b.props.animation?M()&&function(e,t){$(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;D().addEventListener("mousemove",g),ml(Kl,g),g(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;Y(),Q().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);ql=ql.filter((function(e){return e!==b})),b.state.isMounted=!1,L("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,L("onDestroy",[b])}};if(!c.render)return b;var y=c.render(b),w=y.popper,x=y.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var k=v.map((function(e){return e.fn(b)})),C=e.hasAttribute("aria-expanded");return W(),B(),T(),L("onCreate",[b]),c.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",g)})),b;function E(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function S(){return"hold"===E()[0]}function M(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function A(){return l||e}function D(){var e=A().parentNode;return e?Sl(e):document}function O(){return Hl(w)}function N(e){return b.state.isMounted&&!b.state.isVisible||Dl.isTouch||o&&"focus"===o.type?0:cl(b.props.delay,e?0:1,Il.delay)}function T(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function L(e,t,n){var r;(void 0===n&&(n=!0),k.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function R(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;pl(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function B(){!C&&b.props.aria.expanded&&pl(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function I(){D().removeEventListener("mousemove",g),Kl=Kl.filter((function(e){return e!==g}))}function P(t){if(!Dl.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Al(w,n)){if(pl(b.props.triggerTarget||e).some((function(e){return Al(e,n)}))){if(Dl.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else L("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),f=!0,setTimeout((function(){f=!1})),b.state.isMounted||V())}}}function F(){h=!0}function z(){h=!1}function j(){var e=D();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,ll),e.addEventListener("touchstart",z,ll),e.addEventListener("touchmove",F,ll)}function V(){var e=D();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,ll),e.removeEventListener("touchstart",z,ll),e.removeEventListener("touchmove",F,ll)}function $(e,t){var n=O().box;function r(e){e.target===n&&(Ml(n,"remove",r),t())}if(0===e)return t();Ml(n,"remove",s),Ml(n,"add",r),s=r}function H(t,n,r){void 0===r&&(r=!1),pl(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;S()&&(H("touchstart",K,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,K),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Rl?"focusout":"blur",Z);break;case"focusin":H("focusout",Z)}}))}function U(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function K(e){var t,n=!1;if(b.state.isEnabled&&!X(e)&&!f){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,B(),!b.state.isVisible&&wl(e)&&Kl.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||d)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function q(e){var t=e.target,n=A().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Q().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=gl(i.placement),a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,c="right"===s?a.left.x:0,d="left"===s?a.right.x:0,f=t.top-r+l>o,h=r-t.bottom-u>o,p=t.left-n+c>o,m=n-t.right-d>o;return f||h||p||m}))})(r,e)&&(I(),te(e))}}function G(e){X(e)||b.props.trigger.indexOf("click")>=0&&d||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function Z(e){b.props.trigger.indexOf("focusin")<0&&e.target!==A()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function X(e){return!!Dl.isTouch&&S()!==e.type.indexOf("touch")>=0}function J(){Y();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=M()?Hl(w).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(M()){var n=O().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},c];M()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),b.popperInstance=rl(u,w,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function Y(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return _l(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&L("onTrigger",[b,e]),j();var t=N(!0),r=E(),i=r[0],o=r[1];Dl.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),L("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=N(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else V()}}function Zl(e,t){void 0===t&&(t={});var n=Il.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Nl,ll),window.addEventListener("blur",Ll);var r=Object.assign({},t,{plugins:n}),i=kl(e).reduce((function(e,t){var n=t&&Gl(t,r);return n&&e.push(n),e}),[]);return yl(e)?i[0]:i}Zl.defaultProps=Il,Zl.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Il[t]=e[t]}))},Zl.currentInput=Dl;Object.assign({},Pa,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Zl.setDefaultProps({render:Wl});const Xl=Zl;class Jl{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&es(t.selection);return!(!e.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Xl(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,u=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||u)return;this.createTooltip();const{ranges:c}=l,d=Math.min(...c.map((e=>e.$from.pos))),f=Math.max(...c.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:f}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(Qo(t=o.selection)&&t instanceof ct){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return Rs(e,d,f)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Yl=e=>new kt({key:"string"==typeof e.pluginKey?new St(e.pluginKey):e.pluginKey,view:t=>new Jl({view:t,...e})});Wo.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Yl({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Ql{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Xl(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>Rs(e,l,u))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const eu=e=>new kt({key:"string"==typeof e.pluginKey?new St(e.pluginKey):e.pluginKey,view:t=>new Ql({view:t,...e})});Wo.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),(0,r.defineComponent)({name:"BubbleMenu",props:{pluginKey:{type:null,default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const n=(0,r.ref)(null);return(0,r.onMounted)((()=>{const{pluginKey:t,editor:r,tippyOptions:i,shouldShow:o}=e;r.registerPlugin(Yl({pluginKey:t,editor:r,element:n.value,tippyOptions:i,shouldShow:o}))})),(0,r.onBeforeUnmount)((()=>{const{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)})),()=>{var e;return(0,r.h)("div",{ref:n},null===(e=t.default)||void 0===e?void 0:e.call(t))}}});function tu(e){return(0,r.customRef)(((t,n)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame((()=>{requestAnimationFrame((()=>{n()}))}))}})))}class nu extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.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:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.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))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=Mo(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(Ms):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Vo(e,this)}createCommandManager(){this.commandManager=new yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=ds(this.options.content,this.schema,this.options.parseOptions),t=ns(e,this.options.autofocus);this.view=new Si(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:wt.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.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})}getAttributes(e){return As(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return ls(e,null,n)||ys(e,null,n);const r=us(t,e.schema);return"node"===r?ls(e,t,n):"mark"===r&&ys(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ds(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return Os(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Ko(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(e={}){return super(e),this.vueRenderers=(0,r.reactive)(new Map),this.contentComponent=null,this.reactiveState=tu(this.view.state),this.reactiveExtensionStorage=tu(this.extensionStorage),this.on("transaction",(()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage})),(0,r.markRaw)(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const ru=(0,r.defineComponent)({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=(0,r.ref)(),n=(0,r.getCurrentInstance)();return(0,r.watchEffect)((()=>{const i=e.editor;i&&i.options.element&&t.value&&(0,r.nextTick)((()=>{if(!t.value||!i.options.element.firstChild)return;const e=(0,r.unref)(t.value);t.value.append(...i.options.element.childNodes),i.contentComponent=n.ctx._,i.setOptions({element:e}),i.createNodeViews()}))})),(0,r.onBeforeUnmount)((()=>{const t=e.editor;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})})),{rootEl:t}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach((t=>{const n=(0,r.h)(r.Teleport,{to:t.teleportElement,key:t.id},(0,r.h)(t.component,{ref:t.id,...t.props}));e.push(n)})),(0,r.h)("div",{ref:e=>{this.rootEl=e}},...e)}}),iu=((0,r.defineComponent)({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const n=(0,r.ref)(null);return(0,r.onMounted)((()=>{const{pluginKey:t,editor:r,tippyOptions:i,shouldShow:o}=e;r.registerPlugin(eu({pluginKey:t,editor:r,element:n.value,tippyOptions:i,shouldShow:o}))})),(0,r.onBeforeUnmount)((()=>{const{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)})),()=>{var e;return(0,r.h)("div",{ref:n},null===(e=t.default)||void 0===e?void 0:e.call(t))}}}),(0,r.defineComponent)({props:{as:{type:String,default:"div"}},render(){return(0,r.h)(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}})),ou=(0,r.defineComponent)({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return(0,r.h)(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))}});class su{constructor(e,{props:t={},editor:n}){if(this.id=Math.floor(4294967295*Math.random()).toString(),this.editor=n,this.component=(0,r.markRaw)(e),this.teleportElement=document.createElement("div"),this.element=this.teleportElement,this.props=(0,r.reactive)(t),this.editor.vueRenderers.set(this.id,this),this.editor.contentComponent){if(this.editor.contentComponent.update(),1!==this.teleportElement.children.length)throw Error("VueRenderer doesn’t support multiple child elements.");this.element=this.teleportElement.firstElementChild}}get ref(){var e;return null===(e=this.editor.contentComponent)||void 0===e?void 0:e.refs[this.id]}updateProps(e={}){Object.entries(e).forEach((([e,t])=>{this.props[e]=t}))}destroy(){this.editor.vueRenderers.delete(this.id)}}const au={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}};class lu extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))||!c)return;let d=0,f=0;if(this.dom!==c){const t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,f=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,f);const h=ct.create(l.state.doc,this.getPos()),p=l.state.tr.setSelection(h);l.dispatch(p)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=ct.isSelectable(this.node),l="copy"===e.type,u="paste"===e.type,c="cut"===e.type,d="mousedown"===e.type,f=e.type.startsWith("drag");if(!s&&a&&f&&e.preventDefault(),s&&f&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||u||c||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&rs()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},t=this.onDragStart.bind(this);this.decorationClasses=(0,r.ref)(this.getDecorationClasses());const n=(0,r.defineComponent)({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var n,i;return(0,r.provide)("onDragStart",t),(0,r.provide)("decorationClasses",this.decorationClasses),null===(i=(n=this.component).setup)||void 0===i?void 0:i.call(n,e,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules});this.renderer=new su(n,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){if(this.node.isLeaf)return null;return this.dom.querySelector("[data-node-view-content]")||this.dom}update(e,t){const n=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}getDecorationClasses(){return this.decorations.map((e=>e.type.attrs.class)).flat().join(" ")}destroy(){this.renderer.destroy()}}function uu(e,t){return n=>n.editor.contentComponent?new lu(e,n,t):{}}const cu=js.create({name:"text",group:"inline"}),du=/^\s*>\s$/,fu=js.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Fs({find:du,type:this.type})]}}),hu=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,pu=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,mu=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,gu=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,_u=zs.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Bs({find:hu,type:this.type}),Bs({find:mu,type:this.type})]},addPasteRules(){return[Vs({find:pu,type:this.type}),Vs({find:gu,type:this.type})]}}),vu=/^\s*([-+*])\s$/,bu=js.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Fs({find:vu,type:this.type})]}}),yu=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,wu=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,xu=zs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Bs({find:yu,type:this.type})]},addPasteRules(){return[Vs({find:wu,type:this.type})]}}),ku=/^```([a-z]+)?[\s\n]$/,Cu=/^~~~([a-z]+)?[\s\n]$/,Eu=js.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Eo(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return!r.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[Ps({find:ku,type:this.type,getAttributes:e=>({language:e[1]})}),Ps({find:Cu,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new kt({key:new St("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(lt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function Su(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?Su(e.children,n):{text:e.value,classes:n}})).flat()}function Mu(e){return e.value||e.children||[]}function Au({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return Ns(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const o=e.node.attrs.language||r,s=n.listLanguages();Su(o&&s.includes(o)?Mu(n.highlight(o,e.node.textContent)):Mu(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const r=ri.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n}))})),si.create(e,i)}function Du({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new kt({key:new St("lowlight"),state:{init:(r,{doc:i})=>Au({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,u=Ns(o.doc,(t=>t.type.name===e)),c=Ns(s.doc,(t=>t.type.name===e));return r.docChanged&&([a,l].includes(e)||c.length!==u.length||r.steps.some((e=>void 0!==e.from&&void 0!==e.to&&u.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?Au({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const Ou=Eu.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],Du({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Nu=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,Tu=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Lu=zs.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Bs({find:Nu,type:this.type})]},addPasteRules(){return[Vs({find:Tu,type:this.type})]}}),Ru=js.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Eo(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)e.setSelection(lt.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(lt.create(e.doc,r)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[Is({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Bu=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Iu=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Pu=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Fu=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,zu=zs.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Bs({find:Bu,type:this.type}),Bs({find:Pu,type:this.type})]},addPasteRules(){return[Vs({find:Iu,type:this.type}),Vs({find:Fu,type:this.type})]}});function ju(e){this.j={},this.jr=[],this.jd=null,this.t=e}ju.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=Vu();var i=Uu(this,e);return i?(Object.assign(r.j,i.j),r.jr.append(i.jr),r.jr=i.jd,r.t=n||i.t):r.t=n,this.j[e]=r,r}};var Vu=function(){return new ju},$u=function(e){return new ju(e)},Hu=function(e,t,n){e.j[t]||(e.j[t]=n)},Wu=function(e,t,n){e.jr.push([t,n])},Uu=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r=s)return[];for(;o0&&void 0!==arguments[0]?arguments[0]:[],t=Vu(),n=$u(Yu),r=$u(Zu),i=Vu(),o=$u(tc),s=[[Vc,r],[Fc,r],[zc,r],[jc,r]],a=function(){var e=$u(Zu);return e.j={"-":i},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};qu(t,[["'",$u(fc)],["{",$u(rc)],["[",$u(ic)],["<",$u(oc)],["(",$u(sc)],["}",$u(ac)],["]",$u(lc)],[">",$u(uc)],[")",$u(cc)],["&",$u(dc)],["*",$u(hc)],["@",$u(pc)],["`",$u(gc)],["^",$u(_c)],[":",$u(vc)],[",",$u(bc)],["$",$u(yc)],[".",$u(wc)],["=",$u(xc)],["!",$u(kc)],["-",$u(Cc)],["%",$u(Ec)],["|",$u(Sc)],["+",$u(Mc)],["#",$u(Ac)],["?",$u(Dc)],['"',$u(Oc)],["/",$u(Tc)],[";",$u(Nc)],["~",$u(Lc)],["_",$u(Rc)],["\\",$u(mc)]]),Hu(t,"\n",$u(nc)),Wu(t,$c,o),Hu(o,"\n",Vu()),Wu(o,$c,o);for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var i in n)r[i]=n[i];r.constructor=t,t.prototype=r}(Gc,n,t),n}Gc.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Uc.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var Xc=Zc("email",{isLink:!0}),Jc=Zc("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Yc=Zc("text"),Qc=Zc("nl"),ed=Zc("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Uc.defaultProtocol,t=this.tk,n=!1,r=!1,i=[],o=0;t[o].t===Qu;)n=!0,i.push(t[o].v),o++;for(;t[o].t===Tc;)r=!0,i.push(t[o].v),o++;for(;o=0&&f++,i++,c++;if(f<0)for(var h=i-c;h0&&(o.push(rd(Yc,t,s)),s=[]),i-=f,c-=f;var p=d.t,m=n.slice(i-c,i);o.push(rd(p,t,m))}}return s.length>0&&o.push(rd(Yc,t,s)),o}(od.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,i=[],o=0,s=0;s=0&&(d+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,u-=d,i.push({t:c.t,v:t.substr(o-u,u),s:o-u,e:o})}return i}(od.scanner.start,e))}function ld(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=ad(e),r=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:null,n=ad(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function cd(e){return new kt({key:new St("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),o=t.some((e=>e.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=function(e,t){const n=new nt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,u=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const o=[];if(e.ranges.length)e.forEach(((e,t)=>{o.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach((({from:e,to:n})=>{const o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})}))})),Ts(r)}(a);return u.forEach((({oldRange:t,newRange:i})=>{Ls(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const i=Ls(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!i.length)return;const o=i[0],a=n.doc.textBetween(t.from,t.to,void 0," "),u=r.doc.textBetween(o.from,o.to,void 0," "),c=ud(a),d=ud(u);c&&!d&&s.removeMark(o.from,o.to,e.type)})),function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(e=>e.isTextblock)).forEach((t=>{ld(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:t.pos+e.start+1,to:t.pos+e.end+1}))).filter((e=>{const t=i.from>=e.from&&i.from<=e.to,n=i.to>=e.from&&i.to<=e.to;return t||n})).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length?s:void 0}})}const dd=zs.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(sd)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Vs({find:e=>ld(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];return this.options.autolink&&e.push(cd({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push(function(e){return new kt({key:new St("handleClickLink"),props:{handleClick:(t,n,r)=>{var i;const o=As(t.state,e.type.name);return!(!(null===(i=r.target)||void 0===i?void 0:i.closest("a"))||!o.href||(window.open(o.href,o.target),0))}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new kt({key:new St("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=ld(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),fd=js.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Eo(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),hd=/^(\d+)\.\s$/,pd=js.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Eo(this.options.HTMLAttributes,n),0]:["ol",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Fs({find:hd,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),md=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,gd=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,_d=zs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Bs({find:md,type:this.type})]},addPasteRules(){return[Vs({find:gd,type:this.type})]}}),vd=zs.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),bd=zs.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),yd=zs.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=fs(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),wd=zs.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),xd=js.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Eo(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>Ps({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),kd=Wo.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.every((n=>t.updateAttributes(n,{textAlign:e}))),unsetTextAlign:()=>({commands:e})=>this.options.types.every((t=>e.resetAttributes(t,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var Cd=200,Ed=function(){};Ed.prototype.append=function(e){return e.length?(e=Ed.from(e),!this.length&&e||e.length=t?Ed.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ed.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ed.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)},Ed.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},Ed.from=function(e){return e instanceof Ed?e:e&&e.length?new Sd(e):Ed.empty};var Sd=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 i=t;i=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Cd)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Cd)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}(Ed);Ed.empty=new Sd([]);var Md=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 ei&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n=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}(Ed);const Ad=Ed;class Dd{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],u=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void u.push(e);if(n){u.push(new Od(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Od(t,void 0,void 0,l.length+u.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Dd(this.items.slice(0,i).append(u.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;nTd&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new Dd(s.append(i),o)}remapping(e,t){let n=new Se;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Dd(this.items.append(e.map((e=>new Od(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(i.slice(a+1,r));u&&s++,n.push(new Od(l,o,u))}else n.push(new Od(l))}),r);let l=[];for(let e=t;e500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,u=new Od(s.invert(),e,a),c=r.length-1;(l=r.length&&r[c].merge(u))?r[c]=l:r.push(u)}}else o.map&&n--}),this.items.length,0),new Dd(Ad.from(r.reverse()),i)}}Dd.empty=new Dd(Ad.empty,0);class Od{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Od(t.getMap().invert(),t,this.selection)}}}class Nd{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const Td=20;function Ld(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function Rd(e,t){if(!e)return null;let n=[];for(let r=0;rnew Nd(Dd.empty,Dd.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(zd);if(o)return o.historyState;n.getMeta(jd)&&(e=new Nd(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(zd))return s.getMeta(zd).redo?new Nd(e.done.addTransform(n,void 0,r,Fd(t)),e.undone,Ld(n.mapping.maps[n.steps.length-1]),e.prevTime):new Nd(e.done,e.undone.addTransform(n,void 0,r,Fd(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Nd(e.done.rebased(n,i),e.undone.rebased(n,i),Rd(e.prevRanges,n.mapping),e.prevTime):new Nd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Rd(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?Rd(e.prevRanges,n.mapping):Ld(n.mapping.maps[n.steps.length-1]);return new Nd(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Fd(t)),Dd.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?$d:"historyRedo"==n?Hd:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const $d=(e,t)=>{let n=zd.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Bd(n,e,t,!1),!0)},Hd=(e,t)=>{let n=zd.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Bd(n,e,t,!0),!0)};const Wd=Wo.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>$d(e,t),redo:()=>({state:e,dispatch:t})=>Hd(e,t)}),addProseMirrorPlugins(){return[Vd(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ud=js.create({name:"doc",topNode:!0,content:"block+"}),Kd="undefined"!=typeof navigator?navigator:null,qd="undefined"!=typeof document?document:null,Gd=Kd&&Kd.userAgent||"",Zd=/Edge\/(\d+)/.exec(Gd),Xd=/MSIE \d/.exec(Gd),Jd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gd),Yd=!!(Xd||Jd||Zd),Qd=Xd?document.documentMode:Jd?+Jd[1]:Zd?+Zd[1]:0,ef=!Yd&&/gecko\/(\d+)/i.test(Gd);ef&&(/Firefox\/(\d+)/.exec(Gd)||[0,0])[1];const tf=!Yd&&/Chrome\/(\d+)/.exec(Gd),nf=!!tf,rf=tf?+tf[1]:0,of=!Yd&&!!Kd&&/Apple Computer/.test(Kd.vendor),sf=of&&(/Mobile\/\w+/.test(Gd)||!!Kd&&Kd.maxTouchPoints>2),af=sf||!!Kd&&/Mac/.test(Kd.platform),lf=/Android \d/.test(Gd),uf=!!qd&&"webkitFontSmoothing"in qd.documentElement.style,cf=uf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,df=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t};const ff=function(e,t,n,r){return n&&(pf(e,t,n,r,-1)||pf(e,t,n,r,1))},hf=/^(img|br|input|textarea|hr)$/i;function pf(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mf(e))){let n=e.parentNode;if(!n||1!=n.nodeType||gf(e)||hf.test(e.nodeName)||"false"==e.contentEditable)return!1;t=df(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?mf(e):0}}}function mf(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function gf(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const _f=function(e){let t=e.isCollapsed;return t&&nf&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function vf(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const bf=function(e){e&&(this.nodeName=e)};bf.prototype=Object.create(null);new bf;function yf(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(_f(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ct.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==mf(e);r||i;){if(e==n)return!0;let t=df(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==mf(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ct(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=Df(e,a,u,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{wf(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const kf=of||nf&&rf<63;function Cf(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||lt.between(t,n,r)}function Of(e){let t=e.domSelection();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(e){return!1}}function Nf(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&it.findFrom(o,t)}function Tf(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Lf(e,t,n){let r=e.state.selection;if(!(r instanceof lt)){if(r instanceof ct&&r.node.isInline)return Tf(e,new lt(t>0?r.$to:r.$from));{let n=Nf(e.state,t);return!!n&&Tf(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Nf(e.state,t);return!!(n&&n instanceof ct)&&Tf(e,n)}if(!(af&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ct.isSelectable(o)?Tf(e,new ct(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!uf&&Tf(e,new lt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Rf(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Bf(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function If(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(ef&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Bf(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ff(n))break;{let t=n.previousSibling;for(;t&&Bf(t);)i=n.parentNode,o=df(t),t=t.previousSibling;if(t)n=t,r=Rf(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?zf(e,t,n,r):i&&zf(e,t,i,o)}function Pf(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Rf(n);for(;;)if(r{e.state==i&&xf(e)}),50)}function jf(e,t,n){let r=e.state.selection;if(r instanceof lt&&!r.empty||n.indexOf("s")>-1)return!1;if(af&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Nf(e.state,t);if(n&&n instanceof ct)return Tf(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof ft?it.near(n,t):it.findFrom(n,t);return!!s&&Tf(e,s)}return!1}function Vf(e,t){if(!(e.state.selection instanceof lt))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function $f(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Hf(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||af&&72==n&&"c"==r?Vf(e,-1)||If(e):46==n||af&&68==n&&"c"==r?Vf(e,1)||Pf(e):13==n||27==n||(37==n||af&&66==n&&"c"==r?Lf(e,-1,r)||If(e):39==n||af&&70==n&&"c"==r?Lf(e,1,r)||Pf(e):38==n||af&&80==n&&"c"==r?jf(e,-1,r)||If(e):40==n||af&&78==n&&"c"==r?function(e){if(!of||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;$f(e,n,"true"),setTimeout((()=>$f(e,n,"false")),20)}return!1}(e)||jf(e,1,r)||Pf(e):r==(af?"m":"c")&&(66==n||73==n||89==n||90==n))}function Wf(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||ve.fromSchema(e.state.schema),a=eh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Yf[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Uf(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new C(v.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):C.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=ve.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=eh().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Yf[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||le.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Kf.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=v.from(t.create(n[e+1],i)),o++,s++}return new C(i,o,s)}(Jf(s,+c[1],+c[2]),c[4]);else if(s=C.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Gf(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Zf(o[o.length-1],r.length));let t=qf(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return v.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e{s=e(s)})),s}const Kf=/^(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 qf(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,v.from(e));return e}function Gf(e,t,n,r,i){if(i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Jf(e,t,n){return t0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function sh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function ah(e,t,n,r,i){return oh(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ct&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ct.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(sh(e,ct.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ct.isSelectable(r))&&(sh(e,new ct(n),"pointer"),!0)}(e,n))}function lh(e,t,n,r){return oh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function uh(e,t,n,r){return oh(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(sh(e,lt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)sh(e,lt.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ct.isSelectable(n))continue;sh(e,ct.create(r,o),"pointer")}return!0}}(e,n,r)}function ch(e){return _h(e)}nh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!hh(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!lf||!nf||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!sf||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Hf(e,n)?n.preventDefault():rh(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,vf(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},nh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},nh.keypress=(e,t)=>{let n=t;if(hh(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||af&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof lt&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const dh=af?"metaKey":"ctrlKey";th.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ch(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[dh]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(ih(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new fh(e,s,n,!!r)):("doubleClick"==o?lh:uh)(e,s.pos,s.inside,n)?n.preventDefault():rh(e,"pointer"))};class fh{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[dh],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ct&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ef||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((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rh(e,"pointer")}done(){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((()=>xf(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ih(e))),this.allowDefault||!t?rh(this.view,"pointer"):ah(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||of&&this.mightDrag&&!this.mightDrag.node.isAtom||nf&&!(this.view.state.selection instanceof lt)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(sh(this.view,it.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):rh(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),rh(this.view,"pointer"),0==e.buttons&&this.done()}}function hh(e,t){return!!e.composing||!!(of&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}th.touchdown=e=>{ch(e),rh(e,"pointer")},th.contextmenu=e=>ch(e);const ph=lf?5e3:-1;function mh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>_h(e)),t))}function gh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function _h(e,t=!1){if(!(lf&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),gh(e),t||e.docView&&e.docView.dirty){let t=yf(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}nh.compositionstart=nh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),_h(e,!0),e.markCursor=null;else if(_h(e),ef&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}mh(e,ph)},nh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,mh(e,20))};const vh=Yd&&Qd<15||sf&&cf<604;function bh(e,t,n,r){let i=Uf(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||C.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}th.copy=nh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=vh?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Wf(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},nh.paste=(e,t)=>{let n=t;if(e.composing&&!lf)return;let r=vh?null:n.clipboardData;r&&bh(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let 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(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?bh(e,r.value,null,t):bh(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class yh{constructor(e,t){this.slice=e,this.move=t}}const wh=af?"altKey":"ctrlKey";th.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(ih(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ct?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Wf(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(vh?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",vh||n.dataTransfer.setData("text/plain",l),e.dragging=new yh(s,!n[wh])},th.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},nh.dragover=nh.dragenter=(e,t)=>t.preventDefault(),nh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(ih(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Uf(e,n.dataTransfer.getData(vh?"Text":"text/plain"),vh?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[wh]);if(e.someProp("handleDrop",(t=>t(e,n,s||C.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?He(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(f))return;let h=u.doc.resolve(c);if(d&&ct.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ct(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(Df(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},th.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&xf(e)}),20))},th.blur=(e,t)=>{let 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)},th.beforeinput=(e,t)=>{if(nf&&lf&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,vf(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in nh)th[e]=nh[e];function xh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class kh{constructor(e,t){this.toDOM=e,this.spec=t||Ah,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new Sh(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof kh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&xh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ch{constructor(e,t){this.attrs=e,this.spec=t||Ah}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Sh(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==Oh||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Ah)}mapInner(e,t,n,r,i){let o;for(let s=0;s{for(let s=0;su+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:f,offset:h}=r.content.findIndex(c),p=r.maybeChild(f);if(p&&h==c&&h+p.nodeSize==d){let r=a[t+2].mapInner(n,p,l+1,e[t]+o+1,s);r!=Oh?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o{let s,a=o+n;if(s=Lh(t,e,a)){for(r||(r=this.children.slice());io&&t.to=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;ei&&t.type instanceof Ch){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(e,t,Ah)));return Nh.from(n)}forChild(e,t){if(t.isLeaf)return Dh.empty;let n=[];for(let r=0;rn&&t.to{let a=Lh(e,t,s+n);if(a){o=!0;let e=Bh(a,t,n+s+1,r);e!=Oh&&i.push(s,s+t.nodeSize,e)}}));let s=Th(o?Rh(e):e,-n).sort(Ih);for(let e=0;e0;)t++;e.splice(t,0,n)}let zh,jh;if("undefined"!=typeof WeakMap){let e=new WeakMap;zh=t=>e.get(t),jh=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;zh=t=>{for(let n=0;n(n==t&&(n=0),e[n++]=r,e[n++]=i)}class Vh{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class $h{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;tr&&(o+=i.attrs.colspan)}}for(let e=0;e1&&(n=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),n=e.childCount,r=[],i=0,o=null,s=[];for(let e=0,i=t*n;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:f-e});break}let u=i+e*t;for(let e=0;e0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function qh(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function Gh(e){let t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:Kh(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function Zh(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function Xh(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Jh(e,t,n){let r=e.start(-1),i=$h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==i?null:e.node(0).resolve(r+i)}function Yh(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}function Qh(e,t,n=1){let r=Yh(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}function ep(e,t,n=1){let r=Yh(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;ee!=t.pos-i));a.unshift(t.pos-i);let l=a.map((e=>{let t=n.nodeAt(e),r=e+i+1;return new ot(s.resolve(r),s.resolve(r+t.content.size))}));super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(Zh(n)&&Zh(r)&&Xh(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?tp.rowSelection(n,r):e&&this.isColSelection()?tp.colSelection(n,r):new tp(n,r)}return lt.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=$h.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n0||u>0){let e=a.attrs;l>0&&(e=Qh(e,0,l)),u>0&&(e=Qh(e,e.colspan-u,u)),a=o.leftr.bottom){let e=Yh(a.attrs,"rowspan",Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top));a=o.top0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=$h.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),o=n.findCell(t.pos-r),s=e.node(0);return i.top<=o.top?(i.top>0&&(e=s.resolve(r+n.map[i.left])),o.bottom0&&(t=s.resolve(r+n.map[o.left])),i.bottom0)return!1;let i=n+this.$anchorCell.nodeAfter.attrs.colspan,o=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,o)==e.width}eq(e){return e instanceof tp&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=$h.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),o=n.findCell(t.pos-r),s=e.node(0);return i.left<=o.left?(i.left>0&&(e=s.resolve(r+n.map[i.top*n.width])),o.right0&&(t=s.resolve(r+n.map[o.top*n.width])),i.right{t.push(Sh.node(n,n+e.nodeSize,{class:"selectedCell"}))})),Dh.create(e.doc,t)}function ip(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;let i=t.firstChild,o=i.type.spec.tableRole,s=i.type.schema,a=[];if("row"==o)for(let e=0;e=0;t--){let{rowspan:i,colspan:o}=r.child(t).attrs;for(let t=e;t=t.length&&t.push(v.empty),n[i]t.width)for(let o=0,c=0;ot.height){let c=[];for(let e=0,r=(t.height-1)*t.width;e=t.width)&&n.nodeAt(t.map[r+e]).type==u.header_cell;c.push(i?l||(l=u.header_cell.createAndFill()):a||(a=u.cell.createAndFill()))}let d=u.row.create(null,v.from(c)),f=[];for(let e=t.height;e{let o=n.selection;if(o instanceof tp)return cp(n,r,it.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let s=_p(i,e,t);if(null==s)return!1;if("horiz"==e)return cp(n,r,it.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(s),a=Jh(o,e,t);return i=a?it.near(a,1):t<0?it.near(n.doc.resolve(o.before(-1)),-1):it.near(n.doc.resolve(o.after(-1)),1),cp(n,r,i)}}}function fp(e,t){return(n,r,i)=>{let o=n.selection;if(!(o instanceof tp)){let r=_p(i,e,t);if(null==r)return!1;o=new tp(n.doc.resolve(r))}let s=Jh(o.$headCell,e,t);return!!s&&cp(n,r,new tp(o.$anchorCell,s))}}function hp(e,t){let n=e.selection;if(!(n instanceof tp))return!1;if(t){let r=e.tr,i=Wh(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new C(i,0,0))})),r.docChanged&&t(r)}return!0}function pp(e,t){let n=Kh(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new tp(n))),!0)}function mp(e,t,n){if(!qh(e.state))return!1;let r=ip(n),i=e.state.selection;if(i instanceof tp){r||(r={width:1,height:1,rows:[v.from(op(Wh(e.state.schema).cell,n))]});let t=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=$h.get(t).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=function({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;er&&(a=a.type.create(Qh(a.attrs,a.attrs.colspan,n+a.attrs.colspan-r),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;ni&&(t=t.type.create(Yh(t.attrs,"rowspan",Math.max(1,i-t.attrs.rowspan)),t.content)),s.push(t)}e.push(v.from(s))}n=e,t=i}return{width:e,height:t,rows:n}}(r,s.right-s.left,s.bottom-s.top),lp(e.state,e.dispatch,o,s,r),!0}if(r){let t=Gh(e.state),n=t.start(-1);return lp(e.state,e.dispatch,n,$h.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function gp(e,t){if(t.ctrlKey||t.metaKey)return;let n,r=vp(e,t.target);if(t.shiftKey&&e.state.selection instanceof tp)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=Kh(e.state.selection.$anchor))&&bp(e,t).pos!=n.pos)i(n,t),t.preventDefault();else if(!r)return;function i(t,n){let r=bp(e,n),i=null==Uh.getState(e.state);if(!r||!Xh(t,r)){if(!i)return;r=t}let o=new tp(t,r);if(i||!e.state.selection.eq(o)){let n=e.state.tr.setSelection(o);i&&n.setMeta(Uh,t.pos),e.dispatch(n)}}function o(){e.root.removeEventListener("mouseup",o),e.root.removeEventListener("dragstart",o),e.root.removeEventListener("mousemove",s),null!=Uh.getState(e.state)&&e.dispatch(e.state.tr.setMeta(Uh,-1))}function s(n){let s,a=Uh.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(vp(e,n.target)!=r&&(s=bp(e,t),!s))return o();s&&i(s,n)}e.root.addEventListener("mouseup",o),e.root.addEventListener("dragstart",o),e.root.addEventListener("mousemove",s)}function _p(e,t,n){if(!(e.state.selection instanceof lt))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?o:null}}return null}function vp(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function bp(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?Kh(e.state.doc.resolve(n.pos)):null}const yp=new St("fix-tables");function wp(e,t,n,r){let i=e.childCount,o=t.childCount;e:for(let s=0,a=0;s{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){let i=$h.get(t);if(!i.problems)return r;r||(r=e.tr);let o,s,a=[];for(let e=0;e0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n0?-1:0;(function(e,t,n){let r=Wh(t.type.schema).header_cell;for(let i=0;i0&&i0&&t.map[a-1]==l||i0?-1:0;(function(e,t,n){let r=Wh(t.type.schema).header_cell;for(let i=0;i0&&i0&&l==t.map[s-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(a).map(l+r),null,Yh(t,"rowspan",t.rowspan-1)),o+=t.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-e]||r.bottomn[e.type.spec.tableRole],(e,t)=>{let n,i,o=e.selection;if(o instanceof tp){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(n=function(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(o.$from),!n)return!1;i=Kh(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let s=n.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=Yh(s,"rowspan",1)),s.colspan>1&&(s=Yh(s,"colspan",1));let u,c=kp(e),d=e.tr;for(let e=0;ei.table.nodeAt(e)));for(let e=0;e{const t=e+i.tableStart,n=o.doc.nodeAt(t);n&&o.setNodeMarkup(t,c,n.attrs)})),n(o)}return!0}}Tp("row",{useDeprecatedLogic:!0}),Tp("column",{useDeprecatedLogic:!0});let Lp=Tp("cell",{useDeprecatedLogic:!0});function Rp(e){return function(t,n){if(!qh(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(e.index()new n(e,t,r),new zp(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>Pp.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,i){let o=Pp.getState(e.state);if(!o.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(r){let{left:i,right:o}=r.getBoundingClientRect();t.clientX-i<=n?s=jp(e,t,"left"):o-t.clientX<=n&&(s=jp(e,t,"right"))}if(s!=o.activeHandle){if(!i&&-1!==s){let t=e.state.doc.resolve(s),n=t.node(-1),r=$h.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}$p(e,s)}}}(t,n,e,0,r)},mouseleave(e){!function(e){let t=Pp.getState(e.state);t.activeHandle>-1&&!t.dragging&&$p(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=Pp.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let i=e.state.doc.nodeAt(r.activeHandle),o=function(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=e.domAtPos(t),s=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let e=0;e-1)return function(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1),o=$h.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);Zh(e.doc.resolve(n))||(n=null),t=new zp(n,t.dragging)}return t}}function jp(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:i}=r,o=Kh(e.state.doc.resolve(i));if(!o)return-1;if("right"==n)return o.pos;let s=$h.get(o.node(-1)),a=o.start(-1),l=s.map.indexOf(o.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function Vp(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function $p(e,t){e.dispatch(e.state.tr.setMeta(Pp,{setHandle:t}))}function Hp(e){let t=[];for(let n=0;nnull,apply(e,t){let n=e.getMeta(Uh);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:rp,handleDOMEvents:{mousedown:gp},createSelectionBetween(e){if(null!=Uh.getState(e.state))return e.state.selection},handleTripleClick:pp,handleKeyDown:up,handlePaste:mp},appendTransaction:(t,n,r)=>function(e,t,n){let r,i,o=(t||e).selection,s=(t||e).doc;if(o instanceof ct&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=tp.create(s,o.from);else if("row"==i){let e=s.resolve(o.from+1);r=tp.rowSelection(e,e)}else if(!n){let e=$h.get(o.node),t=o.from+1,n=t+e.map[e.width*e.height-1];r=tp.create(s,t+1,n)}}else o instanceof lt&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(i+1)=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}(o)?r=lt.create(s,o.from):o instanceof lt&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(o)&&(r=lt.create(s,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,xp(r,n),e)})}function Up(e,t,n,r,i,o){let s=0,a=!0,l=t.firstChild;const u=e.firstChild;for(let e=0,n=0;e{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)})),e.cached.tableNodeTypes=t,t}(e),s=[],a=[];for(let e=0;e{const{selection:t}=e.state;if(!(t instanceof tp))return!1;let n=0;const r=ms(t.ranges[0].$from,(e=>"table"===e.type.name));null==r||r.node.descendants((e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}));return n===t.ranges.length&&(e.commands.deleteTable(),!0)},Xp=js.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Kp,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({HTMLAttributes:e}){return["table",Eo(this.options.HTMLAttributes,e),["tbody",0]]},addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=Gp(o.schema,e,t,n);if(i){const e=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(lt.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e);t(Cp(e.tr,n,n.left))}return!0}(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e);t(Cp(e.tr,n,n.right))}return!0}(e,t),deleteColumn:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;Ep(r,n,e),e!=n.left;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=$h.get(n.table);t(r)}return!0}(e,t),addRowBefore:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e);t(Sp(e.tr,n,n.top))}return!0}(e,t),addRowAfter:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e);t(Sp(e.tr,n,n.bottom))}return!0}(e,t),deleteRow:()=>({state:e,dispatch:t})=>function(e,t){if(!qh(e))return!1;if(t){let n=kp(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Mp(r,n,e),e!=n.top;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=$h.get(n.table);t(r)}return!0}(e,t),deleteTable:()=>({state:e,dispatch:t})=>function(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,t),mergeCells:()=>({state:e,dispatch:t})=>Dp(e,t),splitCell:()=>({state:e,dispatch:t})=>Op(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Tp("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Tp("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>Lp(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!Dp(e,t)||Op(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>function(e,t){return function(n,r){if(!qh(n))return!1;let i=Gh(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let o=n.tr;n.selection instanceof tp?n.selection.forEachCell(((n,r)=>{n.attrs[e]!==t&&o.setNodeMarkup(r,null,Yh(n.attrs,e,t))})):o.setNodeMarkup(i.pos,null,Yh(i.nodeAfter.attrs,e,t)),r(o)}return!0}}(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>Rp(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Rp(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&xp(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const n=tp.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Zp,"Mod-Backspace":Zp,Delete:Zp,"Mod-Delete":Zp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Fp({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Wp({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema:e=>({tableRole:Ao(wo(e,"tableRole",{name:e.name,options:e.options,storage:e.storage}))})}),Jp=js.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",Eo(this.options.HTMLAttributes,e),0]}}),Yp=js.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",Eo(this.options.HTMLAttributes,e),0]}}),Qp=js.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",Eo(this.options.HTMLAttributes,e),0]}}),em=js.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Eo(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tm=js.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Eo(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),nm=Wo.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new kt({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];return n?(e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,o=!e.isLeaf&&!e.childCount;if((n||!this.options.showOnlyCurrent)&&o){const r=[this.options.emptyNodeClass];this.editor.isEmpty&&r.push(this.options.emptyEditorClass);const o=ri.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren})),si.create(e,i)):null}}})]}}),rm=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,im=js.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Eo(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Is({find:rm,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});function om(e={}){return new kt({view:t=>new sm(t,e)})}class sm{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let 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,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=He(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const am=Wo.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[om(this.options)]}});var lm={class:"px-8 py-8 bg-white"},um=["textContent"],cm=["textContent"],dm={class:"px-8 bg-white",style:{"padding-bottom":"32px"}},fm={class:"flex flex-col"},hm=["textContent"],pm=["textContent"],mm={class:"flex items-center mt-4"},gm=["id"],_m=["for","textContent"],vm={key:0},bm={class:"relative bg-primary-500 text-white rounded font-bold shadow py-1 px-4 cursor-pointer"},ym=["textContent"],wm={class:"h-16 flex items-center",style:{"margin-left":"16px"}},xm=["textContent"],km=["textContent"],Cm={class:"mt-8"},Em=["textContent"],Sm=["textContent"],Mm={class:"mt-4",style:{display:"grid","grid-template-columns":"1fr 1fr 1fr"}},Am={class:"flex items-center"},Dm=["id"],Om=["for"],Nm={class:"flex items-center"},Tm=["id"],Lm=["for"],Rm={class:"flex items-center"},Bm=["id"],Im=["for"],Pm={class:"bg-gray-200 px-8 py-3"},Fm={class:"flex items-center justify-end"},zm=["textContent"],jm=["disabled","textContent"],Vm={class:"whitespace-nowrap"};const $m={methods:{buttonHover:function(e,t){}}};function Hm(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 Wm(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function $g(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Hg(e){return e.classList?$g(e.classList):(e.getAttribute("class")||"").split(" ").filter((function(e){return e}))}function Wg(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Ug(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")}),"")}function Kg(e){return e.size!==jg.size||e.x!==jg.x||e.y!==jg.y||e.rotate!==jg.rotate||e.flipX||e.flipY}function qg(){var e="fa",t=dg,n=Pg.familyPrefix,r=Pg.replacementClass,i=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0);\n animation-delay: var(--fa-animation-delay, 0);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';if(n!==e||r!==t){var o=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),a=new RegExp("\\.".concat(t),"g");i=i.replace(o,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(a,".".concat(r))}return i}var Gg=!1;function Zg(){Pg.autoAddCss&&!Gg&&(!function(e){if(e&&ug){var t=sg.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=sg.head.childNodes,r=null,i=n.length-1;i>-1;i--){var o=n[i],s=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=o)}sg.head.insertBefore(t,r)}}(qg()),Gg=!0)}var Xg={mixout:function(){return{dom:{css:qg,insertCss:Zg}}},hooks:function(){return{beforeDOMElementCreation:function(){Zg()},beforeI2svg:function(){Zg()}}}},Jg=og||{};Jg.___FONT_AWESOME___||(Jg.___FONT_AWESOME___={}),Jg.___FONT_AWESOME___.styles||(Jg.___FONT_AWESOME___.styles={}),Jg.___FONT_AWESOME___.hooks||(Jg.___FONT_AWESOME___.hooks={}),Jg.___FONT_AWESOME___.shims||(Jg.___FONT_AWESOME___.shims=[]);var Yg=Jg.___FONT_AWESOME___,Qg=[],e_=!1;function t_(e){ug&&(e_?setTimeout(e,0):Qg.push(e))}function n_(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,i=e.children,o=void 0===i?[]:i;return"string"==typeof e?Wg(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(Wg(e[n]),'" ')}),"").trim()}(r),">").concat(o.map(n_).join(""),"")}function r_(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}ug&&((e_=(sg.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(sg.readyState))||sg.addEventListener("DOMContentLoaded",(function e(){sg.removeEventListener("DOMContentLoaded",e),e_=1,Qg.map((function(e){return e()}))})));var i_=function(e,t,n,r){var i,o,s,a=Object.keys(e),l=a.length,u=void 0!==r?function(e,t){return function(n,r,i,o){return e.call(t,n,r,i,o)}}(t,r):t;for(void 0===n?(i=1,s=e[a[0]]):(i=0,s=n);i=55296&&i<=56319&&n2&&void 0!==arguments[2]?arguments[2]:{},r=n.skipHooks,i=void 0!==r&&r,o=s_(t);"function"!=typeof Yg.hooks.addPack||i?Yg.styles[e]=Wm(Wm({},Yg.styles[e]||{}),o):Yg.hooks.addPack(e,s_(t)),"fas"===e&&a_("fa",t)}var l_=Yg.styles,u_=Yg.shims,c_=Object.values(wg),d_=null,f_={},h_={},p_={},m_={},g_={},__=Object.keys(bg);function v_(e,t){var n,r=t.split("-"),i=r[0],o=r.slice(1).join("-");return i!==e||""===o||(n=o,~Rg.indexOf(n))?null:o}var b_,y_=function(){var e=function(e){return i_(l_,(function(t,n,r){return t[r]=i_(n,e,{}),t}),{})};f_=e((function(e,t,n){(t[3]&&(e[t[3]]=n),t[2])&&t[2].filter((function(e){return"number"==typeof e})).forEach((function(t){e[t.toString(16)]=n}));return e})),h_=e((function(e,t,n){(e[n]=n,t[2])&&t[2].filter((function(e){return"string"==typeof e})).forEach((function(t){e[t]=n}));return e})),g_=e((function(e,t,n){var r=t[2];return e[n]=n,r.forEach((function(t){e[t]=n})),e}));var t="far"in l_||Pg.autoFetchSvg,n=i_(u_,(function(e,n){var r=n[0],i=n[1],o=n[2];return"far"!==i||t||(i="fas"),"string"==typeof r&&(e.names[r]={prefix:i,iconName:o}),"number"==typeof r&&(e.unicodes[r.toString(16)]={prefix:i,iconName:o}),e}),{names:{},unicodes:{}});p_=n.names,m_=n.unicodes,d_=E_(Pg.styleDefault)};function w_(e,t){return(f_[e]||{})[t]}function x_(e,t){return(g_[e]||{})[t]}function k_(e){return p_[e]||{prefix:null,iconName:null}}function C_(){return d_}b_=function(e){d_=E_(e.styleDefault)},Fg.push(b_),y_();function E_(e){var t=yg[e]||yg[bg[e]],n=e in Yg.styles?e:null;return t||n||null}function S_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.skipLookups,r=void 0!==n&&n,i=null,o=e.reduce((function(e,t){var n=v_(Pg.familyPrefix,t);if(l_[t]?(t=c_.includes(t)?xg[t]:t,i=t,e.prefix=t):__.indexOf(t)>-1?(i=t,e.prefix=E_(t)):n?e.iconName=n:t!==Pg.replacementClass&&e.rest.push(t),!r&&e.prefix&&e.iconName){var o="fa"===i?k_(e.iconName):{},s=x_(e.prefix,e.iconName);o.prefix&&(i=null),e.iconName=o.iconName||s||e.iconName,e.prefix=o.prefix||e.prefix,"far"!==e.prefix||l_.far||!l_.fas||Pg.autoFetchSvg||(e.prefix="fas")}return e}),{prefix:null,iconName:null,rest:[]});return"fa"!==o.prefix&&"fa"!==i||(o.prefix=C_()||"fas"),o}var M_=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var t,n,r;return t=e,n=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&a.forEach((function(t){"string"==typeof t&&(e[i][t]=s)})),e[i][o]=s})),e}}],n&&Km(t.prototype,n),r&&Km(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),A_=[],D_={},O_={},N_=Object.keys(O_);function T_(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{};return ug?(L_("beforeI2svg",e),R_("pseudoElements2svg",e),R_("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoReplaceSvgRoot;!1===Pg.autoReplaceSvg&&(Pg.autoReplaceSvg=!0),Pg.observeMutations=!0,t_((function(){j_({autoReplaceSvgRoot:t}),L_("watch",e)}))}},F_={icon:function(e){if(null===e)return null;if("object"===Um(e)&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:x_(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){var t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],n=E_(e[0]);return{prefix:n,iconName:x_(n,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(Pg.familyPrefix,"-"))>-1||e.match(kg))){var r=S_(e.split(" "),{skipLookups:!0});return{prefix:r.prefix||C_(),iconName:x_(r.prefix,r.iconName)||r.iconName}}if("string"==typeof e){var i=C_();return{prefix:i,iconName:x_(i,e)||e}}}},z_={noAuto:function(){Pg.autoReplaceSvg=!1,Pg.observeMutations=!1,L_("noAuto")},config:Pg,dom:P_,parse:F_,library:I_,findIconDefinition:B_,toHtml:n_},j_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoReplaceSvgRoot,n=void 0===t?sg:t;(Object.keys(Yg.styles).length>0||Pg.autoFetchSvg)&&ug&&Pg.autoReplaceSvg&&z_.dom.i2svg({node:n})};function V_(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((function(e){return n_(e)}))}}),Object.defineProperty(e,"node",{get:function(){if(ug){var t=sg.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function $_(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,o=e.iconName,s=e.transform,a=e.symbol,l=e.title,u=e.maskId,c=e.titleId,d=e.extra,f=e.watchable,h=void 0!==f&&f,p=r.found?r:n,m=p.width,g=p.height,_="fak"===i,v=[Pg.replacementClass,o?"".concat(Pg.familyPrefix,"-").concat(o):""].filter((function(e){return-1===d.classes.indexOf(e)})).filter((function(e){return""!==e||!!e})).concat(d.classes).join(" "),b={children:[],attributes:Wm(Wm({},d.attributes),{},{"data-prefix":i,"data-icon":o,class:v,role:d.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(g)})},y=_&&!~d.classes.indexOf("fa-fw")?{width:"".concat(m/g*16*.0625,"em")}:{};h&&(b.attributes[fg]=""),l&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(c||Vg())},children:[l]}),delete b.attributes.title);var w=Wm(Wm({},b),{},{prefix:i,iconName:o,main:n,mask:r,maskId:u,transform:s,symbol:a,styles:Wm(Wm({},y),d.styles)}),x=r.found&&n.found?R_("generateAbstractMask",w)||{children:[],attributes:{}}:R_("generateAbstractIcon",w)||{children:[],attributes:{}},k=x.children,C=x.attributes;return w.children=k,w.attributes=C,a?function(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,s=!0===o?"".concat(t,"-").concat(Pg.familyPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Wm(Wm({},i),{},{id:s}),children:r}]}]}(w):function(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,s=e.transform;if(Kg(s)&&n.found&&!r.found){var a={x:n.width/n.height/2,y:.5};i.style=Ug(Wm(Wm({},o),{},{"transform-origin":"".concat(a.x+s.x/16,"em ").concat(a.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}(w)}function H_(e){var t=e.content,n=e.width,r=e.height,i=e.transform,o=e.title,s=e.extra,a=e.watchable,l=void 0!==a&&a,u=Wm(Wm(Wm({},s.attributes),o?{title:o}:{}),{},{class:s.classes.join(" ")});l&&(u[fg]="");var c=Wm({},s.styles);Kg(i)&&(c.transform=function(e){var t=e.transform,n=e.width,r=void 0===n?16:n,i=e.height,o=void 0===i?16:i,s=e.startCentered,a=void 0!==s&&s,l="";return l+=a&&cg?"translate(".concat(t.x/zg-r/2,"em, ").concat(t.y/zg-o/2,"em) "):a?"translate(calc(-50% + ".concat(t.x/zg,"em), calc(-50% + ").concat(t.y/zg,"em)) "):"translate(".concat(t.x/zg,"em, ").concat(t.y/zg,"em) "),l+="scale(".concat(t.size/zg*(t.flipX?-1:1),", ").concat(t.size/zg*(t.flipY?-1:1),") "),l+"rotate(".concat(t.rotate,"deg) ")}({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);var d=Ug(c);d.length>0&&(u.style=d);var f=[];return f.push({tag:"span",attributes:u,children:[t]}),o&&f.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),f}function W_(e){var t=e.content,n=e.title,r=e.extra,i=Wm(Wm(Wm({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=Ug(r.styles);o.length>0&&(i.style=o);var s=[];return s.push({tag:"span",attributes:i,children:[t]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}var U_=Yg.styles;function K_(e){var t=e[0],n=e[1],r=Gm(e.slice(4),1)[0];return{found:!0,width:t,height:n,icon:Array.isArray(r)?{tag:"g",attributes:{class:"".concat(Pg.familyPrefix,"-").concat(Og)},children:[{tag:"path",attributes:{class:"".concat(Pg.familyPrefix,"-").concat(Lg),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(Pg.familyPrefix,"-").concat(Tg),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}}}}var q_={found:!1,width:512,height:512};function G_(e,t){var n=t;return"fa"===t&&null!==Pg.styleDefault&&(t=C_()),new Promise((function(r,i){R_("missingIconAbstract");if("fa"===n){var o=k_(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&U_[t]&&U_[t][e])return r(K_(U_[t][e]));!function(e,t){vg||Pg.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),r(Wm(Wm({},q_),{},{icon:Pg.showMissingIcons&&e&&R_("missingIconAbstract")||{}}))}))}var Z_=function(){},X_=Pg.measurePerformance&&lg&&lg.mark&&lg.measure?lg:{mark:Z_,measure:Z_},J_='FA "6.1.1"',Y_=function(e){X_.mark("".concat(J_," ").concat(e," ends")),X_.measure("".concat(J_," ").concat(e),"".concat(J_," ").concat(e," begins"),"".concat(J_," ").concat(e," ends"))},Q_=function(e){return X_.mark("".concat(J_," ").concat(e," begins")),function(){return Y_(e)}},ev=function(){};function tv(e){return"string"==typeof(e.getAttribute?e.getAttribute(fg):null)}function nv(e){return sg.createElementNS("http://www.w3.org/2000/svg",e)}function rv(e){return sg.createElement(e)}function iv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.ceFn,r=void 0===n?"svg"===e.tag?nv:rv:n;if("string"==typeof e)return sg.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach((function(t){i.setAttribute(t,e.attributes[t])}));var o=e.children||[];return o.forEach((function(e){i.appendChild(iv(e,{ceFn:r}))})),i}var ov={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach((function(e){t.parentNode.insertBefore(iv(e),t)})),null===t.getAttribute(fg)&&Pg.keepOriginalSource){var n=sg.createComment(function(e){var t=" ".concat(e.outerHTML," ");return"".concat(t,"Font Awesome fontawesome.com ")}(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){var t=e[0],n=e[1];if(~Hg(t).indexOf(Pg.replacementClass))return ov.replace(e);var r=new RegExp("".concat(Pg.familyPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){var i=n[0].attributes.class.split(" ").reduce((function(e,t){return t===Pg.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e}),{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(" "),0===i.toNode.length?t.removeAttribute("class"):t.setAttribute("class",i.toNode.join(" "))}var o=n.map((function(e){return n_(e)})).join("\n");t.setAttribute(fg,""),t.innerHTML=o}};function sv(e){e()}function av(e,t){var n="function"==typeof t?t:ev;if(0===e.length)n();else{var r=sv;"async"===Pg.mutateApproach&&(r=og.requestAnimationFrame||sv),r((function(){var t=!0===Pg.autoReplaceSvg?ov.replace:ov[Pg.autoReplaceSvg]||ov.replace,r=Q_("mutate");e.map(t),r(),n()}))}}var lv=!1;function uv(){lv=!0}function cv(){lv=!1}var dv=null;function fv(e){if(ag&&Pg.observeMutations){var t=e.treeCallback,n=void 0===t?ev:t,r=e.nodeCallback,i=void 0===r?ev:r,o=e.pseudoElementsCallback,s=void 0===o?ev:o,a=e.observeMutationsRoot,l=void 0===a?sg:a;dv=new ag((function(e){if(!lv){var t=C_();$g(e).forEach((function(e){if("childList"===e.type&&e.addedNodes.length>0&&!tv(e.addedNodes[0])&&(Pg.searchPseudoElements&&s(e.target),n(e.target)),"attributes"===e.type&&e.target.parentNode&&Pg.searchPseudoElements&&s(e.target.parentNode),"attributes"===e.type&&tv(e.target)&&~Dg.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){var t=e.getAttribute?e.getAttribute(pg):null,n=e.getAttribute?e.getAttribute(mg):null;return t&&n}(e.target)){var r=S_(Hg(e.target)),o=r.prefix,a=r.iconName;e.target.setAttribute(pg,o||t),a&&e.target.setAttribute(mg,a)}else(l=e.target)&&l.classList&&l.classList.contains&&l.classList.contains(Pg.replacementClass)&&i(e.target);var l}))}})),ug&&dv.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function hv(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce((function(e,t){var n=t.split(":"),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(":").trim()),e}),{})),n}function pv(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=void 0!==e.innerText?e.innerText.trim():"",i=S_(Hg(e));return i.prefix||(i.prefix=C_()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||i.prefix&&r.length>0&&(i.iconName=function(e,t){return(h_[e]||{})[t]}(i.prefix,e.innerText)||w_(i.prefix,o_(e.innerText))),i}function mv(e){var t=$g(e.attributes).reduce((function(e,t){return"class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e}),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return Pg.autoA11y&&(n?t["aria-labelledby"]="".concat(Pg.replacementClass,"-title-").concat(r||Vg()):(t["aria-hidden"]="true",t.focusable="false")),t}function gv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},n=pv(e),r=n.iconName,i=n.prefix,o=n.rest,s=mv(e),a=T_("parseNodeAttributes",{},e),l=t.styleParser?hv(e):[];return Wm({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:jg,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:l,attributes:s}},a)}var _v=Yg.styles;function vv(e){var t="nest"===Pg.autoReplaceSvg?gv(e,{styleParser:!1}):gv(e);return~t.extra.classes.indexOf(Cg)?R_("generateLayersText",e,t):R_("generateSvgReplacementMutation",e,t)}function bv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!ug)return Promise.resolve();var n=sg.documentElement.classList,r=function(e){return n.add("".concat(gg,"-").concat(e))},i=function(e){return n.remove("".concat(gg,"-").concat(e))},o=Pg.autoFetchSvg?Object.keys(bg):Object.keys(_v),s=[".".concat(Cg,":not([").concat(fg,"])")].concat(o.map((function(e){return".".concat(e,":not([").concat(fg,"])")}))).join(", ");if(0===s.length)return Promise.resolve();var a=[];try{a=$g(e.querySelectorAll(s))}catch(e){}if(!(a.length>0))return Promise.resolve();r("pending"),i("complete");var l=Q_("onTree"),u=a.reduce((function(e,t){try{var n=vv(t);n&&e.push(n)}catch(e){vg||"MissingIcon"===e.name&&console.error(e)}return e}),[]);return new Promise((function(e,n){Promise.all(u).then((function(n){av(n,(function(){r("active"),r("complete"),i("pending"),"function"==typeof t&&t(),l(),e()}))})).catch((function(e){l(),n(e)}))}))}function yv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;vv(e).then((function(e){e&&av([e],t)}))}var wv=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?jg:n,i=t.symbol,o=void 0!==i&&i,s=t.mask,a=void 0===s?null:s,l=t.maskId,u=void 0===l?null:l,c=t.title,d=void 0===c?null:c,f=t.titleId,h=void 0===f?null:f,p=t.classes,m=void 0===p?[]:p,g=t.attributes,_=void 0===g?{}:g,v=t.styles,b=void 0===v?{}:v;if(e){var y=e.prefix,w=e.iconName,x=e.icon;return V_(Wm({type:"icon"},e),(function(){return L_("beforeDOMElementCreation",{iconDefinition:e,params:t}),Pg.autoA11y&&(d?_["aria-labelledby"]="".concat(Pg.replacementClass,"-title-").concat(h||Vg()):(_["aria-hidden"]="true",_.focusable="false")),$_({icons:{main:K_(x),mask:a?K_(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:y,iconName:w,transform:Wm(Wm({},jg),r),symbol:o,title:d,maskId:u,titleId:h,extra:{attributes:_,styles:b,classes:m}})}))}},xv={mixout:function(){return{icon:(e=wv,function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(t||{}).icon?t:B_(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:B_(i||{})),e(r,Wm(Wm({},n),{},{mask:i}))})};var e},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=bv,e.nodeCallback=yv,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=void 0===t?sg:t,r=e.callback;return bv(n,void 0===r?function(){}:r)},e.generateSvgReplacementMutation=function(e,t){var n=t.iconName,r=t.title,i=t.titleId,o=t.prefix,s=t.transform,a=t.symbol,l=t.mask,u=t.maskId,c=t.extra;return new Promise((function(t,d){Promise.all([G_(n,o),l.iconName?G_(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((function(l){var d=Gm(l,2),f=d[0],h=d[1];t([e,$_({icons:{main:f,mask:h},prefix:o,iconName:n,transform:s,symbol:a,maskId:u,title:r,titleId:i,extra:c,watchable:!0})])})).catch(d)}))},e.generateAbstractIcon=function(e){var t,n=e.children,r=e.attributes,i=e.main,o=e.transform,s=Ug(e.styles);return s.length>0&&(r.style=s),Kg(o)&&(t=R_("generateAbstractTransformGrouping",{main:i,transform:o,containerWidth:i.width,iconWidth:i.width})),n.push(t||i.icon),{children:n,attributes:r}}}},kv={mixout:function(){return{layer:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.classes,r=void 0===n?[]:n;return V_({type:"layer"},(function(){L_("beforeDOMElementCreation",{assembler:e,params:t});var n=[];return e((function(e){Array.isArray(e)?e.map((function(e){n=n.concat(e.abstract)})):n=n.concat(e.abstract)})),[{tag:"span",attributes:{class:["".concat(Pg.familyPrefix,"-layers")].concat(Zm(r)).join(" ")},children:n}]}))}}}},Cv={mixout:function(){return{counter:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.title,r=void 0===n?null:n,i=t.classes,o=void 0===i?[]:i,s=t.attributes,a=void 0===s?{}:s,l=t.styles,u=void 0===l?{}:l;return V_({type:"counter",content:e},(function(){return L_("beforeDOMElementCreation",{content:e,params:t}),W_({content:e.toString(),title:r,extra:{attributes:a,styles:u,classes:["".concat(Pg.familyPrefix,"-layers-counter")].concat(Zm(o))}})}))}}}},Ev={mixout:function(){return{text:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?jg:n,i=t.title,o=void 0===i?null:i,s=t.classes,a=void 0===s?[]:s,l=t.attributes,u=void 0===l?{}:l,c=t.styles,d=void 0===c?{}:c;return V_({type:"text",content:e},(function(){return L_("beforeDOMElementCreation",{content:e,params:t}),H_({content:e,transform:Wm(Wm({},jg),r),title:o,extra:{attributes:u,styles:d,classes:["".concat(Pg.familyPrefix,"-layers-text")].concat(Zm(a))}})}))}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.title,r=t.transform,i=t.extra,o=null,s=null;if(cg){var a=parseInt(getComputedStyle(e).fontSize,10),l=e.getBoundingClientRect();o=l.width/a,s=l.height/a}return Pg.autoA11y&&!n&&(i.attributes["aria-hidden"]="true"),Promise.resolve([e,H_({content:e.innerHTML,width:o,height:s,transform:r,title:n,extra:i,watchable:!0})])}}},Sv=new RegExp('"',"ug"),Mv=[1105920,1112319];function Av(e,t){var n="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise((function(r,i){if(null!==e.getAttribute(n))return r();var o,s,a,l=$g(e.children).filter((function(e){return e.getAttribute(hg)===t}))[0],u=og.getComputedStyle(e,t),c=u.getPropertyValue("font-family").match(Eg),d=u.getPropertyValue("font-weight"),f=u.getPropertyValue("content");if(l&&!c)return e.removeChild(l),r();if(c&&"none"!==f&&""!==f){var h=u.getPropertyValue("content"),p=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(c[2])?yg[c[2].toLowerCase()]:Sg[d],m=function(e){var t=e.replace(Sv,""),n=function(e,t){var n,r=e.length,i=e.charCodeAt(t);return i>=55296&&i<=56319&&r>t+1&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}(t,0),r=n>=Mv[0]&&n<=Mv[1],i=2===t.length&&t[0]===t[1];return{value:o_(i?t[0]:t),isSecondary:r||i}}(h),g=m.value,_=m.isSecondary,v=c[0].startsWith("FontAwesome"),b=w_(p,g),y=b;if(v){var w=(s=m_[o=g],a=w_("fas",o),s||(a?{prefix:"fas",iconName:a}:null)||{prefix:null,iconName:null});w.iconName&&w.prefix&&(b=w.iconName,p=w.prefix)}if(!b||_||l&&l.getAttribute(pg)===p&&l.getAttribute(mg)===y)r();else{e.setAttribute(n,y),l&&e.removeChild(l);var x={iconName:null,title:null,titleId:null,prefix:null,transform:jg,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},k=x.extra;k.attributes[hg]=t,G_(b,p).then((function(i){var o=$_(Wm(Wm({},x),{},{icons:{main:i,mask:{prefix:null,iconName:null,rest:[]}},prefix:p,iconName:y,extra:k,watchable:!0})),s=sg.createElement("svg");"::before"===t?e.insertBefore(s,e.firstChild):e.appendChild(s),s.outerHTML=o.map((function(e){return n_(e)})).join("\n"),e.removeAttribute(n),r()})).catch(i)}}else r()}))}function Dv(e){return Promise.all([Av(e,"::before"),Av(e,"::after")])}function Ov(e){return!(e.parentNode===document.head||~_g.indexOf(e.tagName.toUpperCase())||e.getAttribute(hg)||e.parentNode&&"svg"===e.parentNode.tagName)}function Nv(e){if(ug)return new Promise((function(t,n){var r=$g(e.querySelectorAll("*")).filter(Ov).map(Dv),i=Q_("searchPseudoElements");uv(),Promise.all(r).then((function(){i(),cv(),t()})).catch((function(){i(),cv(),n()}))}))}var Tv=!1,Lv=function(e){return e.toLowerCase().split(" ").reduce((function(e,t){var n=t.toLowerCase().split("-"),r=n[0],i=n.slice(1).join("-");if(r&&"h"===i)return e.flipX=!0,e;if(r&&"v"===i)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case"grow":e.size=e.size+i;break;case"shrink":e.size=e.size-i;break;case"left":e.x=e.x-i;break;case"right":e.x=e.x+i;break;case"up":e.y=e.y-i;break;case"down":e.y=e.y+i;break;case"rotate":e.rotate=e.rotate+i}return e}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},Rv={mixout:function(){return{parse:{transform:function(e){return Lv(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-transform");return n&&(e.transform=Lv(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,o={transform:"translate(".concat(r/2," 256)")},s="translate(".concat(32*n.x,", ").concat(32*n.y,") "),a="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),l="rotate(".concat(n.rotate," 0 0)"),u={outer:o,inner:{transform:"".concat(s," ").concat(a," ").concat(l)},path:{transform:"translate(".concat(i/2*-1," -256)")}};return{tag:"g",attributes:Wm({},u.outer),children:[{tag:"g",attributes:Wm({},u.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Wm(Wm({},t.icon.attributes),u.path)}]}]}}}},Bv={x:0,y:0,width:"100%",height:"100%"};function Iv(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var Pv={hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-mask"),r=n?S_(n.split(" ").map((function(e){return e.trim()}))):{prefix:null,iconName:null,rest:[]};return r.prefix||(r.prefix=C_()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides:function(e){e.generateAbstractMask=function(e){var t,n=e.children,r=e.attributes,i=e.main,o=e.mask,s=e.maskId,a=e.transform,l=i.width,u=i.icon,c=o.width,d=o.icon,f=function(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(32*t.x,", ").concat(32*t.y,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),a="rotate(".concat(t.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(o," ").concat(s," ").concat(a)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}({transform:a,containerWidth:c,iconWidth:l}),h={tag:"rect",attributes:Wm(Wm({},Bv),{},{fill:"white"})},p=u.children?{children:u.children.map(Iv)}:{},m={tag:"g",attributes:Wm({},f.inner),children:[Iv(Wm({tag:u.tag,attributes:Wm(Wm({},u.attributes),f.path)},p))]},g={tag:"g",attributes:Wm({},f.outer),children:[m]},_="mask-".concat(s||Vg()),v="clip-".concat(s||Vg()),b={tag:"mask",attributes:Wm(Wm({},Bv),{},{id:_,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,g]},y={tag:"defs",children:[{tag:"clipPath",attributes:{id:v},children:(t=d,"g"===t.tag?t.children:[t])},b]};return n.push(y,{tag:"rect",attributes:Wm({fill:"currentColor","clip-path":"url(#".concat(v,")"),mask:"url(#".concat(_,")")},Bv)}),{children:n,attributes:r}}}},Fv={provides:function(e){var t=!1;og.matchMedia&&(t=og.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var e=[],n={fill:"currentColor"},r={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:Wm(Wm({},n),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var i=Wm(Wm({},r),{},{attributeName:"opacity"}),o={tag:"circle",attributes:Wm(Wm({},n),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||o.children.push({tag:"animate",attributes:Wm(Wm({},r),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Wm(Wm({},i),{},{values:"1;0;1;1;0;1;"})}),e.push(o),e.push({tag:"path",attributes:Wm(Wm({},n),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:Wm(Wm({},i),{},{values:"1;0;0;0;0;1;"})}]}),t||e.push({tag:"path",attributes:Wm(Wm({},n),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Wm(Wm({},i),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:e}}}};!function(e,t){var n=t.mixoutsTo;A_=e,D_={},Object.keys(O_).forEach((function(e){-1===N_.indexOf(e)&&delete O_[e]})),A_.forEach((function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach((function(e){"function"==typeof t[e]&&(n[e]=t[e]),"object"===Um(t[e])&&Object.keys(t[e]).forEach((function(r){n[e]||(n[e]={}),n[e][r]=t[e][r]}))})),e.hooks){var r=e.hooks();Object.keys(r).forEach((function(e){D_[e]||(D_[e]=[]),D_[e].push(r[e])}))}e.provides&&e.provides(O_)}))}([Xg,xv,kv,Cv,Ev,{hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=Nv,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=void 0===t?sg:t;Pg.searchPseudoElements&&Nv(n)}}},{mixout:function(){return{dom:{unwatch:function(){uv(),Tv=!0}}}},hooks:function(){return{bootstrap:function(){fv(T_("mutationObserverCallbacks",{}))},noAuto:function(){dv&&dv.disconnect()},watch:function(e){var t=e.observeMutationsRoot;Tv?cv():fv(T_("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}},Rv,Pv,Fv,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-symbol"),r=null!==n&&(""===n||n);return e.symbol=r,e}}}}],{mixoutsTo:z_});var zv=z_.config,jv=z_.library,Vv=z_.parse,$v=z_.icon,Hv=z_.text,Wv={prefix:"fas",iconName:"align-center",icon:[448,512,[],"f037","M320 96H128C110.3 96 96 81.67 96 64C96 46.33 110.3 32 128 32H320C337.7 32 352 46.33 352 64C352 81.67 337.7 96 320 96zM416 224H32C14.33 224 0 209.7 0 192C0 174.3 14.33 160 32 160H416C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224zM0 448C0 430.3 14.33 416 32 416H416C433.7 416 448 430.3 448 448C448 465.7 433.7 480 416 480H32C14.33 480 0 465.7 0 448zM320 352H128C110.3 352 96 337.7 96 320C96 302.3 110.3 288 128 288H320C337.7 288 352 302.3 352 320C352 337.7 337.7 352 320 352z"]},Uv={prefix:"fas",iconName:"align-justify",icon:[448,512,[],"f039","M416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96zM416 352H32C14.33 352 0 337.7 0 320C0 302.3 14.33 288 32 288H416C433.7 288 448 302.3 448 320C448 337.7 433.7 352 416 352zM0 192C0 174.3 14.33 160 32 160H416C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192zM416 480H32C14.33 480 0 465.7 0 448C0 430.3 14.33 416 32 416H416C433.7 416 448 430.3 448 448C448 465.7 433.7 480 416 480z"]},Kv={prefix:"fas",iconName:"align-left",icon:[448,512,[],"f036","M256 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H256C273.7 32 288 46.33 288 64C288 81.67 273.7 96 256 96zM256 352H32C14.33 352 0 337.7 0 320C0 302.3 14.33 288 32 288H256C273.7 288 288 302.3 288 320C288 337.7 273.7 352 256 352zM0 192C0 174.3 14.33 160 32 160H416C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192zM416 480H32C14.33 480 0 465.7 0 448C0 430.3 14.33 416 32 416H416C433.7 416 448 430.3 448 448C448 465.7 433.7 480 416 480z"]},qv={prefix:"fas",iconName:"align-right",icon:[448,512,[],"f038","M416 96H192C174.3 96 160 81.67 160 64C160 46.33 174.3 32 192 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96zM416 352H192C174.3 352 160 337.7 160 320C160 302.3 174.3 288 192 288H416C433.7 288 448 302.3 448 320C448 337.7 433.7 352 416 352zM0 192C0 174.3 14.33 160 32 160H416C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192zM416 480H32C14.33 480 0 465.7 0 448C0 430.3 14.33 416 32 416H416C433.7 416 448 430.3 448 448C448 465.7 433.7 480 416 480z"]},Gv={prefix:"fas",iconName:"angle-down",icon:[384,512,[8964],"f107","M192 384c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L192 306.8l137.4-137.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-160 160C208.4 380.9 200.2 384 192 384z"]},Zv={prefix:"fas",iconName:"angle-up",icon:[384,512,[8963],"f106","M352 352c-8.188 0-16.38-3.125-22.62-9.375L192 205.3l-137.4 137.4c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25C368.4 348.9 360.2 352 352 352z"]},Xv={prefix:"fas",iconName:"bold",icon:[384,512,[],"f032","M321.1 242.4C340.1 220.1 352 191.6 352 160c0-70.59-57.42-128-128-128L32 32.01c-17.67 0-32 14.31-32 32s14.33 32 32 32h16v320H32c-17.67 0-32 14.31-32 32s14.33 32 32 32h224c70.58 0 128-57.41 128-128C384 305.3 358.6 264.8 321.1 242.4zM112 96.01H224c35.3 0 64 28.72 64 64s-28.7 64-64 64H112V96.01zM256 416H112v-128H256c35.3 0 64 28.71 64 63.1S291.3 416 256 416z"]},Jv={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","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 256zM175 208.1L222.1 255.1L175 303C165.7 312.4 165.7 327.6 175 336.1C184.4 346.3 199.6 346.3 208.1 336.1L255.1 289.9L303 336.1C312.4 346.3 327.6 346.3 336.1 336.1C346.3 327.6 346.3 312.4 336.1 303L289.9 255.1L336.1 208.1C346.3 199.6 346.3 184.4 336.1 175C327.6 165.7 312.4 165.7 303 175L255.1 222.1L208.1 175C199.6 165.7 184.4 165.7 175 175C165.7 184.4 165.7 199.6 175 208.1V208.1z"]},Yv=Jv,Qv={prefix:"fas",iconName:"code",icon:[640,512,[],"f121","M414.8 40.79L286.8 488.8C281.9 505.8 264.2 515.6 247.2 510.8C230.2 505.9 220.4 488.2 225.2 471.2L353.2 23.21C358.1 6.216 375.8-3.624 392.8 1.232C409.8 6.087 419.6 23.8 414.8 40.79H414.8zM518.6 121.4L630.6 233.4C643.1 245.9 643.1 266.1 630.6 278.6L518.6 390.6C506.1 403.1 485.9 403.1 473.4 390.6C460.9 378.1 460.9 357.9 473.4 345.4L562.7 256L473.4 166.6C460.9 154.1 460.9 133.9 473.4 121.4C485.9 108.9 506.1 108.9 518.6 121.4V121.4zM166.6 166.6L77.25 256L166.6 345.4C179.1 357.9 179.1 378.1 166.6 390.6C154.1 403.1 133.9 403.1 121.4 390.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4L121.4 121.4C133.9 108.9 154.1 108.9 166.6 121.4C179.1 133.9 179.1 154.1 166.6 166.6V166.6z"]},eb={prefix:"fas",iconName:"cubes",icon:[576,512,[],"f1b3","M172.1 40.16L268.1 3.76C280.9-1.089 295.1-1.089 307.9 3.76L403.9 40.16C425.6 48.41 440 69.25 440 92.52V204.7C441.3 205.1 442.6 205.5 443.9 205.1L539.9 242.4C561.6 250.6 576 271.5 576 294.7V413.9C576 436.1 562.9 456.2 542.5 465.1L446.5 507.3C432.2 513.7 415.8 513.7 401.5 507.3L288 457.5L174.5 507.3C160.2 513.7 143.8 513.7 129.5 507.3L33.46 465.1C13.13 456.2 0 436.1 0 413.9V294.7C0 271.5 14.39 250.6 36.15 242.4L132.1 205.1C133.4 205.5 134.7 205.1 136 204.7V92.52C136 69.25 150.4 48.41 172.1 40.16V40.16zM290.8 48.64C289 47.95 286.1 47.95 285.2 48.64L206.8 78.35L287.1 109.5L369.2 78.35L290.8 48.64zM392 210.6V121L309.6 152.6V241.8L392 210.6zM154.8 250.9C153 250.2 150.1 250.2 149.2 250.9L70.81 280.6L152 311.7L233.2 280.6L154.8 250.9zM173.6 455.3L256 419.1V323.2L173.6 354.8V455.3zM342.8 280.6L424 311.7L505.2 280.6L426.8 250.9C425 250.2 422.1 250.2 421.2 250.9L342.8 280.6zM528 413.9V323.2L445.6 354.8V455.3L523.2 421.2C526.1 419.9 528 417.1 528 413.9V413.9z"]},tb={prefix:"fas",iconName:"file-code",icon:[384,512,[],"f1c9","M224 128L224 0H48C21.49 0 0 21.49 0 48v416C0 490.5 21.49 512 48 512h288c26.51 0 48-21.49 48-48V160h-127.1C238.3 160 224 145.7 224 128zM154.1 353.8c7.812 7.812 7.812 20.5 0 28.31C150.2 386.1 145.1 388 140 388s-10.23-1.938-14.14-5.844l-48-48c-7.812-7.812-7.812-20.5 0-28.31l48-48c7.812-7.812 20.47-7.812 28.28 0s7.812 20.5 0 28.31L120.3 320L154.1 353.8zM306.1 305.8c7.812 7.812 7.812 20.5 0 28.31l-48 48C254.2 386.1 249.1 388 244 388s-10.23-1.938-14.14-5.844c-7.812-7.812-7.812-20.5 0-28.31L263.7 320l-33.86-33.84c-7.812-7.812-7.812-20.5 0-28.31s20.47-7.812 28.28 0L306.1 305.8zM256 0v128h128L256 0z"]},nb={prefix:"fas",iconName:"grip",icon:[448,512,["grip-horizontal"],"f58d","M128 184C128 206.1 110.1 224 88 224H40C17.91 224 0 206.1 0 184V136C0 113.9 17.91 96 40 96H88C110.1 96 128 113.9 128 136V184zM128 376C128 398.1 110.1 416 88 416H40C17.91 416 0 398.1 0 376V328C0 305.9 17.91 288 40 288H88C110.1 288 128 305.9 128 328V376zM160 136C160 113.9 177.9 96 200 96H248C270.1 96 288 113.9 288 136V184C288 206.1 270.1 224 248 224H200C177.9 224 160 206.1 160 184V136zM288 376C288 398.1 270.1 416 248 416H200C177.9 416 160 398.1 160 376V328C160 305.9 177.9 288 200 288H248C270.1 288 288 305.9 288 328V376zM320 136C320 113.9 337.9 96 360 96H408C430.1 96 448 113.9 448 136V184C448 206.1 430.1 224 408 224H360C337.9 224 320 206.1 320 184V136zM448 376C448 398.1 430.1 416 408 416H360C337.9 416 320 398.1 320 376V328C320 305.9 337.9 288 360 288H408C430.1 288 448 305.9 448 328V376z"]},rb=nb,ib={prefix:"fas",iconName:"highlighter",icon:[576,512,[],"f591","M143.1 320V248.3C143.1 233 151.2 218.7 163.5 209.6L436.6 8.398C444 2.943 452.1 0 462.2 0C473.6 0 484.5 4.539 492.6 12.62L547.4 67.38C555.5 75.46 559.1 86.42 559.1 97.84C559.1 107 557.1 115.1 551.6 123.4L350.4 396.5C341.3 408.8 326.1 416 311.7 416H239.1L214.6 441.4C202.1 453.9 181.9 453.9 169.4 441.4L118.6 390.6C106.1 378.1 106.1 357.9 118.6 345.4L143.1 320zM489.4 99.92L460.1 70.59L245 229L330.1 314.1L489.4 99.92zM23.03 466.3L86.06 403.3L156.7 473.9L125.7 504.1C121.2 509.5 115.1 512 108.7 512H40C26.75 512 16 501.3 16 488V483.3C16 476.1 18.53 470.8 23.03 466.3V466.3z"]},ob={prefix:"fas",iconName:"image",icon:[512,512,[],"f03e","M447.1 32h-384C28.64 32-.0091 60.65-.0091 96v320c0 35.35 28.65 64 63.1 64h384c35.35 0 64-28.65 64-64V96C511.1 60.65 483.3 32 447.1 32zM111.1 96c26.51 0 48 21.49 48 48S138.5 192 111.1 192s-48-21.49-48-48S85.48 96 111.1 96zM446.1 407.6C443.3 412.8 437.9 416 432 416H82.01c-6.021 0-11.53-3.379-14.26-8.75c-2.73-5.367-2.215-11.81 1.334-16.68l70-96C142.1 290.4 146.9 288 152 288s9.916 2.441 12.93 6.574l32.46 44.51l93.3-139.1C293.7 194.7 298.7 192 304 192s10.35 2.672 13.31 7.125l128 192C448.6 396 448.9 402.3 446.1 407.6z"]},sb={prefix:"fas",iconName:"italic",icon:[384,512,[],"f033","M384 64.01c0 17.69-14.31 32-32 32h-58.67l-133.3 320H224c17.69 0 32 14.31 32 32s-14.31 32-32 32H32c-17.69 0-32-14.31-32-32s14.31-32 32-32h58.67l133.3-320H160c-17.69 0-32-14.31-32-32s14.31-32 32-32h192C369.7 32.01 384 46.33 384 64.01z"]},ab={prefix:"fas",iconName:"link",icon:[640,512,[128279,"chain"],"f0c1","M172.5 131.1C228.1 75.51 320.5 75.51 376.1 131.1C426.1 181.1 433.5 260.8 392.4 318.3L391.3 319.9C381 334.2 361 337.6 346.7 327.3C332.3 317 328.9 297 339.2 282.7L340.3 281.1C363.2 249 359.6 205.1 331.7 177.2C300.3 145.8 249.2 145.8 217.7 177.2L105.5 289.5C73.99 320.1 73.99 372 105.5 403.5C133.3 431.4 177.3 435 209.3 412.1L210.9 410.1C225.3 400.7 245.3 404 255.5 418.4C265.8 432.8 262.5 452.8 248.1 463.1L246.5 464.2C188.1 505.3 110.2 498.7 60.21 448.8C3.741 392.3 3.741 300.7 60.21 244.3L172.5 131.1zM467.5 380C411 436.5 319.5 436.5 263 380C213 330 206.5 251.2 247.6 193.7L248.7 192.1C258.1 177.8 278.1 174.4 293.3 184.7C307.7 194.1 311.1 214.1 300.8 229.3L299.7 230.9C276.8 262.1 280.4 306.9 308.3 334.8C339.7 366.2 390.8 366.2 422.3 334.8L534.5 222.5C566 191 566 139.1 534.5 108.5C506.7 80.63 462.7 76.99 430.7 99.9L429.1 101C414.7 111.3 394.7 107.1 384.5 93.58C374.2 79.2 377.5 59.21 391.9 48.94L393.5 47.82C451 6.731 529.8 13.25 579.8 63.24C636.3 119.7 636.3 211.3 579.8 267.7L467.5 380z"]},lb={prefix:"fas",iconName:"link-slash",icon:[640,512,["chain-broken","chain-slash","unlink"],"f127","M185.7 120.3C242.5 75.82 324.7 79.73 376.1 131.1C420.1 175.1 430.9 239.6 406.7 293.5L438.6 318.4L534.5 222.5C566 191 566 139.1 534.5 108.5C506.7 80.63 462.7 76.1 430.7 99.9L429.1 101C414.7 111.3 394.7 107.1 384.5 93.58C374.2 79.2 377.5 59.21 391.9 48.94L393.5 47.82C451 6.732 529.8 13.25 579.8 63.24C636.3 119.7 636.3 211.3 579.8 267.7L489.3 358.2L630.8 469.1C641.2 477.3 643.1 492.4 634.9 502.8C626.7 513.2 611.6 515.1 601.2 506.9L9.196 42.89C-1.236 34.71-3.065 19.63 5.112 9.196C13.29-1.236 28.37-3.065 38.81 5.112L185.7 120.3zM238.1 161.1L353.4 251.7C359.3 225.5 351.7 197.2 331.7 177.2C306.6 152.1 269.1 147 238.1 161.1V161.1zM263 380C233.1 350.1 218.7 309.8 220.9 270L406.6 416.4C357.4 431 301.9 418.9 263 380V380zM116.6 187.9L167.2 227.8L105.5 289.5C73.99 320.1 73.99 372 105.5 403.5C133.3 431.4 177.3 435 209.3 412.1L210.9 410.1C225.3 400.7 245.3 404 255.5 418.4C265.8 432.8 262.5 452.8 248.1 463.1L246.5 464.2C188.1 505.3 110.2 498.7 60.21 448.8C3.741 392.3 3.741 300.7 60.21 244.3L116.6 187.9z"]},ub=lb,cb={prefix:"fas",iconName:"list-ol",icon:[576,512,["list-1-2","list-numeric"],"f0cb","M55.1 56.04C55.1 42.78 66.74 32.04 79.1 32.04H111.1C125.3 32.04 135.1 42.78 135.1 56.04V176H151.1C165.3 176 175.1 186.8 175.1 200C175.1 213.3 165.3 224 151.1 224H71.1C58.74 224 47.1 213.3 47.1 200C47.1 186.8 58.74 176 71.1 176H87.1V80.04H79.1C66.74 80.04 55.1 69.29 55.1 56.04V56.04zM118.7 341.2C112.1 333.8 100.4 334.3 94.65 342.4L83.53 357.9C75.83 368.7 60.84 371.2 50.05 363.5C39.26 355.8 36.77 340.8 44.47 330.1L55.59 314.5C79.33 281.2 127.9 278.8 154.8 309.6C176.1 333.1 175.6 370.5 153.7 394.3L118.8 432H152C165.3 432 176 442.7 176 456C176 469.3 165.3 480 152 480H64C54.47 480 45.84 474.4 42.02 465.6C38.19 456.9 39.9 446.7 46.36 439.7L118.4 361.7C123.7 355.9 123.8 347.1 118.7 341.2L118.7 341.2zM512 64C529.7 64 544 78.33 544 96C544 113.7 529.7 128 512 128H256C238.3 128 224 113.7 224 96C224 78.33 238.3 64 256 64H512zM512 224C529.7 224 544 238.3 544 256C544 273.7 529.7 288 512 288H256C238.3 288 224 273.7 224 256C224 238.3 238.3 224 256 224H512zM512 384C529.7 384 544 398.3 544 416C544 433.7 529.7 448 512 448H256C238.3 448 224 433.7 224 416C224 398.3 238.3 384 256 384H512z"]},db={prefix:"fas",iconName:"list-ul",icon:[512,512,["list-dots"],"f0ca","M16 96C16 69.49 37.49 48 64 48C90.51 48 112 69.49 112 96C112 122.5 90.51 144 64 144C37.49 144 16 122.5 16 96zM480 64C497.7 64 512 78.33 512 96C512 113.7 497.7 128 480 128H192C174.3 128 160 113.7 160 96C160 78.33 174.3 64 192 64H480zM480 224C497.7 224 512 238.3 512 256C512 273.7 497.7 288 480 288H192C174.3 288 160 273.7 160 256C160 238.3 174.3 224 192 224H480zM480 384C497.7 384 512 398.3 512 416C512 433.7 497.7 448 480 448H192C174.3 448 160 433.7 160 416C160 398.3 174.3 384 192 384H480zM16 416C16 389.5 37.49 368 64 368C90.51 368 112 389.5 112 416C112 442.5 90.51 464 64 464C37.49 464 16 442.5 16 416zM112 256C112 282.5 90.51 304 64 304C37.49 304 16 282.5 16 256C16 229.5 37.49 208 64 208C90.51 208 112 229.5 112 256z"]},fb={prefix:"fas",iconName:"paragraph",icon:[448,512,[182],"f1dd","M448 63.1C448 81.67 433.7 96 416 96H384v352c0 17.67-14.33 32-31.1 32S320 465.7 320 448V96h-32v352c0 17.67-14.33 32-31.1 32S224 465.7 224 448v-96H198.9c-83.57 0-158.2-61.11-166.1-144.3C23.66 112.3 98.44 32 191.1 32h224C433.7 32 448 46.33 448 63.1z"]},hb={prefix:"fas",iconName:"quote-right",icon:[448,512,[8221,"quote-right-alt"],"f10e","M96 96C42.98 96 0 138.1 0 192s42.98 96 96 96c11.28 0 21.95-2.305 32-5.879V288c0 35.3-28.7 64-64 64c-17.67 0-32 14.33-32 32s14.33 32 32 32c70.58 0 128-57.42 128-128V192C192 138.1 149 96 96 96zM448 192c0-53.02-42.98-96-96-96s-96 42.98-96 96s42.98 96 96 96c11.28 0 21.95-2.305 32-5.879V288c0 35.3-28.7 64-64 64c-17.67 0-32 14.33-32 32s14.33 32 32 32c70.58 0 128-57.42 128-128V192z"]},pb={prefix:"fas",iconName:"rotate-left",icon:[512,512,["rotate-back","rotate-backward","undo-alt"],"f2ea","M480 256c0 123.4-100.5 223.9-223.9 223.9c-48.84 0-95.17-15.58-134.2-44.86c-14.12-10.59-16.97-30.66-6.375-44.81c10.59-14.12 30.62-16.94 44.81-6.375c27.84 20.91 61 31.94 95.88 31.94C344.3 415.8 416 344.1 416 256s-71.69-159.8-159.8-159.8c-37.46 0-73.09 13.49-101.3 36.64l45.12 45.14c17.01 17.02 4.955 46.1-19.1 46.1H35.17C24.58 224.1 16 215.5 16 204.9V59.04c0-24.04 29.07-36.08 46.07-19.07l47.6 47.63C149.9 52.71 201.5 32.11 256.1 32.11C379.5 32.11 480 132.6 480 256z"]},mb=pb,gb={prefix:"fas",iconName:"rotate-right",icon:[512,512,["redo-alt","rotate-forward"],"f2f9","M468.9 32.11c13.87 0 27.18 10.77 27.18 27.04v145.9c0 10.59-8.584 19.17-19.17 19.17h-145.7c-16.28 0-27.06-13.32-27.06-27.2c0-6.634 2.461-13.4 7.96-18.9l45.12-45.14c-28.22-23.14-63.85-36.64-101.3-36.64c-88.09 0-159.8 71.69-159.8 159.8S167.8 415.9 255.9 415.9c73.14 0 89.44-38.31 115.1-38.31c18.48 0 31.97 15.04 31.97 31.96c0 35.04-81.59 70.41-147 70.41c-123.4 0-223.9-100.5-223.9-223.9S132.6 32.44 256 32.44c54.6 0 106.2 20.39 146.4 55.26l47.6-47.63C455.5 34.57 462.3 32.11 468.9 32.11z"]},_b=gb,vb={prefix:"fas",iconName:"strikethrough",icon:[512,512,[],"f0cc","M332.2 319.9c17.22 12.17 22.33 26.51 18.61 48.21c-3.031 17.59-10.88 29.34-24.72 36.99c-35.44 19.75-108.5 11.96-186-19.68c-16.34-6.686-35.03 1.156-41.72 17.53s1.188 35.05 17.53 41.71c31.75 12.93 95.69 35.37 157.6 35.37c29.62 0 58.81-5.156 83.72-18.96c30.81-17.09 50.44-45.46 56.72-82.11c3.998-23.27 2.168-42.58-3.488-59.05H332.2zM488 239.9l-176.5-.0309c-15.85-5.613-31.83-10.34-46.7-14.62c-85.47-24.62-110.9-39.05-103.7-81.33c2.5-14.53 10.16-25.96 22.72-34.03c20.47-13.15 64.06-23.84 155.4 .3438c17.09 4.531 34.59-5.654 39.13-22.74c4.531-17.09-5.656-34.59-22.75-39.12c-91.31-24.18-160.7-21.62-206.3 7.654C121.8 73.72 103.6 101.1 98.09 133.1C89.26 184.5 107.9 217.3 137.2 239.9L24 239.9c-13.25 0-24 10.75-24 23.1c0 13.25 10.75 23.1 24 23.1h464c13.25 0 24-10.75 24-23.1C512 250.7 501.3 239.9 488 239.9z"]},bb={prefix:"fas",iconName:"subscript",icon:[512,512,[],"f12c","M480 448v-128c0-11.09-5.75-21.38-15.17-27.22c-9.422-5.875-21.25-6.344-31.14-1.406l-32 16c-15.81 7.906-22.22 27.12-14.31 42.94c5.609 11.22 16.89 17.69 28.62 17.69v80c-17.67 0-32 14.31-32 32s14.33 32 32 32h64c17.67 0 32-14.31 32-32S497.7 448 480 448zM320 128c17.67 0 32-14.31 32-32s-14.33-32-32-32l-32-.0024c-10.44 0-20.23 5.101-26.22 13.66L176 200.2L90.22 77.67C84.23 69.11 74.44 64.01 64 64.01L32 64.01c-17.67 0-32 14.32-32 32s14.33 32 32 32h15.34L136.9 256l-89.6 128H32c-17.67 0-32 14.31-32 32s14.33 31.1 32 31.1l32-.0024c10.44 0 20.23-5.086 26.22-13.65L176 311.8l85.78 122.5C267.8 442.9 277.6 448 288 448l32 .0024c17.67 0 32-14.31 32-31.1s-14.33-32-32-32h-15.34l-89.6-128l89.6-127.1H320z"]},yb={prefix:"fas",iconName:"superscript",icon:[512,512,[],"f12b","M480 160v-128c0-11.09-5.75-21.37-15.17-27.22C455.4-1.048 443.6-1.548 433.7 3.39l-32 16c-15.81 7.906-22.22 27.12-14.31 42.94C392.1 73.55 404.3 80.01 416 80.01v80c-17.67 0-32 14.31-32 32s14.33 32 32 32h64c17.67 0 32-14.31 32-32S497.7 160 480 160zM320 128c17.67 0 32-14.31 32-32s-14.33-32-32-32l-32-.0024c-10.44 0-20.23 5.101-26.22 13.66L176 200.2L90.22 77.67C84.23 69.11 74.44 64.01 64 64.01L32 64.01c-17.67 0-32 14.32-32 32s14.33 32 32 32h15.34L136.9 256l-89.6 128H32c-17.67 0-32 14.31-32 32s14.33 31.1 32 31.1l32-.0024c10.44 0 20.23-5.086 26.22-13.65L176 311.8l85.78 122.5C267.8 442.9 277.6 448 288 448l32 .0024c17.67 0 32-14.31 32-31.1s-14.33-32-32-32h-15.34l-89.6-128l89.6-127.1H320z"]},wb={prefix:"fas",iconName:"table",icon:[512,512,[],"f0ce","M448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM224 256V160H64V256H224zM64 320V416H224V320H64zM288 416H448V320H288V416zM448 256V160H288V256H448z"]},xb={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"]},kb=xb,Cb={prefix:"fas",iconName:"underline",icon:[448,512,[],"f0cd","M416 448H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h384c17.69 0 32-14.31 32-32S433.7 448 416 448zM48 64.01H64v160c0 88.22 71.78 159.1 160 159.1s160-71.78 160-159.1v-160h16c17.69 0 32-14.32 32-32s-14.31-31.1-32-31.1l-96-.0049c-17.69 0-32 14.32-32 32s14.31 32 32 32H320v160c0 52.94-43.06 95.1-96 95.1S128 276.1 128 224v-160h16c17.69 0 32-14.31 32-32s-14.31-32-32-32l-96 .0049c-17.69 0-32 14.31-32 31.1S30.31 64.01 48 64.01z"]};function Eb(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 Sb(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ob(e){return function(e){if(Array.isArray(e))return Nb(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)return;if("string"==typeof e)return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nb(e,t)}(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 Nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof e)return e;var i=(e.children||[]).map((function(e){return zb(e)})),o=Object.keys(e.attributes||{}).reduce((function(t,n){var r=e.attributes[n];switch(n){case"class":t.class=Fb(r);break;case"style":t.style=Pb(r);break;default:t.attrs[n]=r}return t}),{attrs:{},class:{},style:{}});n.class;var s=n.style,a=void 0===s?{}:s,l=Db(n,Ib);return(0,r.h)(e.tag,Sb(Sb(Sb({},t),{},{class:o.class,style:Sb(Sb({},o.style),a)},o.attrs),l),i)}var jb=!1;try{jb=!0}catch(e){}function Vb(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?Ab({},e,t):{}}function $b(e){return e&&"object"===Mb(e)&&e.prefix&&e.iconName&&e.icon?e:Vv.icon?Vv.icon(e):null===e?null:"object"===Mb(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}var Hb=(0,r.defineComponent)({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(e){return[!0,!1,"horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(Number.parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(e,t){var n=t.attrs,i=(0,r.computed)((function(){return $b(e.icon)})),o=(0,r.computed)((function(){return Vb("classes",function(e){var t,n=(Ab(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip":!0===e.flip,"fa-flip-horizontal":"horizontal"===e.flip||"both"===e.flip,"fa-flip-vertical":"vertical"===e.flip||"both"===e.flip},"fa-".concat(e.size),null!==e.size),Ab(t,"fa-rotate-".concat(e.rotation),null!==e.rotation),Ab(t,"fa-pull-".concat(e.pull),null!==e.pull),Ab(t,"fa-swap-opacity",e.swapOpacity),Ab(t,"fa-bounce",e.bounce),Ab(t,"fa-shake",e.shake),Ab(t,"fa-beat",e.beat),Ab(t,"fa-fade",e.fade),Ab(t,"fa-beat-fade",e.beatFade),Ab(t,"fa-flash",e.flash),Ab(t,"fa-spin-pulse",e.spinPulse),Ab(t,"fa-spin-reverse",e.spinReverse),t);return Object.keys(n).map((function(e){return n[e]?e:null})).filter((function(e){return e}))}(e))})),s=(0,r.computed)((function(){return Vb("transform","string"==typeof e.transform?Vv.transform(e.transform):e.transform)})),a=(0,r.computed)((function(){return Vb("mask",$b(e.mask))})),l=(0,r.computed)((function(){return $v(i.value,Sb(Sb(Sb(Sb({},o.value),s.value),a.value),{},{symbol:e.symbol,title:e.title}))}));(0,r.watch)(l,(function(e){if(!e)return function(){var e;!jb&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find one or more icon(s)",i.value,a.value)}),{immediate:!0});var u=(0,r.computed)((function(){return l.value?zb(l.value.abstract[0],{},n):null}));return function(){return u.value}}}),Wb=((0,r.defineComponent)({name:"FontAwesomeLayers",props:{fixedWidth:{type:Boolean,default:!1}},setup:function(e,t){var n=t.slots,i=zv.familyPrefix,o=(0,r.computed)((function(){return["".concat(i,"-layers")].concat(Ob(e.fixedWidth?["".concat(i,"-fw")]:[]))}));return function(){return(0,r.h)("div",{class:o.value},n.default?n.default():[])}}}),(0,r.defineComponent)({name:"FontAwesomeLayersText",props:{value:{type:[String,Number],default:""},transform:{type:[String,Object],default:null},counter:{type:Boolean,default:!1},position:{type:String,default:null,validator:function(e){return["bottom-left","bottom-right","top-left","top-right"].indexOf(e)>-1}}},setup:function(e,t){var n=t.attrs,i=zv.familyPrefix,o=(0,r.computed)((function(){return Vb("classes",[].concat(Ob(e.counter?["".concat(i,"-layers-counter")]:[]),Ob(e.position?["".concat(i,"-layers-").concat(e.position)]:[])))})),s=(0,r.computed)((function(){return Vb("transform","string"==typeof e.transform?Vv.transform(e.transform):e.transform)})),a=(0,r.computed)((function(){var t=Hv(e.value.toString(),Sb(Sb({},s.value),o.value)).abstract;return e.counter&&(t[0].attributes.class=t[0].attributes.class.replace("fa-layers-text","")),t[0]})),l=(0,r.computed)((function(){return zb(a.value,{},n)}));return function(){return l.value}}}),{class:"pointer-events-none absolute left-0 w-full flex justify-center z-100",style:{bottom:"36px"}}),Ub=["innerHTML"],Kb=["innerHTML"];var qb={prefix:"fas",iconName:"horizontal-rule",icon:[640,512,[8213],"f86c","M607.9 288h-576C14.25 288 0 273.7 0 256S14.38 224 32.06 224h576C625.8 224 640 238.3 640 255.1S625.6 288 607.9 288z"]},Gb={prefix:"fas",iconName:"image-polaroid",icon:[448,512,[],"f8c4","M145.7 230.6l-46.67 64c-3.549 4.863-4.064 11.31-1.334 16.68C100.5 316.6 105.1 320 112 320h224c5.9 0 11.32-3.246 14.11-8.449c2.783-5.203 2.479-11.52-.7949-16.43l-85.33-128C261 162.7 256 160 250.7 160s-10.35 2.672-13.31 7.125L183.8 247.4L171.6 230.6C168.6 226.4 163.8 224 158.7 224S148.8 226.4 145.7 230.6zM400 32h-352C21.6 32 0 53.6 0 80v352C0 458.4 21.6 480 48 480h352c26.4 0 48-21.6 48-48v-352C448 53.6 426.4 32 400 32zM384 352H64V96h320V352zM128 192c17.62 0 32-14.38 32-32S145.6 128 128 128S96 142.4 96 160S110.4 192 128 192z"]},Zb={prefix:"fas",iconName:"paragraph-left",icon:[384,512,["paragraph-rtl"],"f878","M147.8 224h12.11v64C159.9 305.7 174.3 320 191.1 320s31.98-14.33 31.98-31.1V64h32v224c0 17.67 14.35 31.1 32.02 31.1s31.98-14.33 31.98-31.1V64c17.67 0 32-14.33 32-31.1S337.6 0 319.9 0h-175.1C80.36 0 32.53 47.41 31.94 110.8C31.37 173.1 85.57 224 147.8 224zM352 384H128v-48c0-6.203-3.595-11.86-9.22-14.48c-5.549-2.594-12.24-1.781-17.04 2.188l-96.01 80C2.11 406.8 0 411.3 0 416s2.11 9.25 5.75 12.3l96.01 80C104.7 510.7 108.3 512 112 512c2.299 0 4.633-.5 6.789-1.516C124.4 507.9 128 502.2 128 496V448h223.1C369.7 448 384 433.7 384 415.1C384 398.3 369.7 384 352 384z"]},Xb=Zb,Jb={prefix:"far",iconName:"cube",icon:[512,512,[],"f1b2","M236.1 5.865C248.9 1.011 263.1 1.011 275.9 5.865L475.9 81.73C497.6 89.98 512 110.8 512 134.1V377.9C512 401.2 497.6 422 475.9 430.3L275.9 506.1C263.1 510.1 248.9 510.1 236.1 506.1L36.14 430.3C14.39 422 0 401.2 0 377.9V134.1C0 110.8 14.39 89.98 36.14 81.73L236.1 5.865zM258.8 50.74C257 50.05 254.1 50.05 253.2 50.74L63.62 122.6L256 198.2L448.4 122.6L258.8 50.74zM53.16 385.4L232 453.2V240.4L48 168.1V377.9C48 381.2 50.06 384.2 53.16 385.4zM280 453.2L458.8 385.4C461.9 384.2 464 381.2 464 377.9V168.1L280 240.4V453.2z"]};function Yb(e){return function(e){if(Array.isArray(e))return Qb(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)return;if("string"==typeof e)return Qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qb(e,t)}(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 Qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1),this.noopener=!!(e.rel&&e.rel.indexOf("noopener")>-1),this.noreferrer=!!(e.rel&&e.rel.indexOf("noreferrer")>-1)}else this.url="",this.openInNewWindow=!1,this.nofollow=!1,this.noopener=!1,this.noreferrer=!1,this.linkMode="url",this.extraClasses="",this.title="";this.linkMenuIsActive=!0},hideLinkMenu:function(){this.linkMenuIsActive=!1},removeFile:function(){this.file=null,this.filename=null,this.$refs.fileInput.value=null},resetUploading:function(){this.uploading=!1,this.uploadProgress=0},changeFile:function(e){e.length&&(this.file=e[0],this.filename=this.file.name)},uploadAndAddFile:function(e){var t=this;e.preventDefault(),this.uploading=!0;var n=new FormData;n.append("file",this.file),n.append("disk",this.fileDisk),n.append("path",this.filePath);var r={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){return t.uploadProgress=e.loaded/e.total*100}};axios.post("/nova-tiptap/api/file",n,r).then(function(e){this.resetUploading(),this.removeFile();var t={href:e.data.url,"tt-mode":"file",download:"true"};this.setLink(t),this.hideLinkMenu()}.bind(this)).catch(function(e){this.resetUploading(),this.removeFile()}.bind(this))},setLinkFromUrl:function(e){e.preventDefault();var t={href:this.url,"tt-mode":"url"};this.openInNewWindow?t.target="_blank":t.target="_self",this.setLink(t),this.hideLinkMenu()},setLink:function(e){if(this.extraClasses&&(e.class=this.extraClasses),this.title&&(e.title=this.title),(this.nofollow||this.noopener||this.noreferrer)&&(e.rel="",this.nofollow&&(e.rel+="nofollow "),this.noopener&&(e.rel+="noopener "),this.noreferrer&&(e.rel+="noreferrer "),e.rel=_.trim(e.rel)),this.editor.isActive("image"))this.editor.getAttributes("image");else this.editor.chain().extendMarkRange("link").unsetLink().run(),this.editor.chain().focus().setLink(e).run()},unsetLink:function(){this.editor.chain().focus().unsetLink().run()}}},uy=(0,o.Z)(ly,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("font-awesome-icon"),l=(0,r.resolveComponent)("Modal"),u=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",null,[(0,r.createVNode)(l,{isActive:e.linkMenuIsActive,hideMethod:s.hideLinkMenu},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",lm,[s.withFileUpload?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createElementVNode)("span",{class:(0,r.normalizeClass)(["uppercase cursor-pointer font-bold text-sm border-b",{"text-primary-500 border-primary-500":"url"==e.linkMode,"text-gray-500 border-transparent":"url"!=e.linkMode}]),onClick:t[0]||(t[0]=function(t){return e.linkMode="url"}),textContent:(0,r.toDisplayString)(e.ttt("url"))},null,10,um),(0,r.createElementVNode)("span",{class:(0,r.normalizeClass)(["ml-4 uppercase cursor-pointer font-bold text-sm border-b",{"text-primary-500 border-primary-500":"file"==e.linkMode,"text-gray-500 border-transparent":"file"!=e.linkMode}]),onClick:t[1]||(t[1]=function(t){return e.linkMode="file"}),textContent:(0,r.toDisplayString)(e.ttt("file upload"))},null,10,cm)],64)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",dm,[(0,r.withDirectives)((0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("div",fm,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("url"))},null,8,hm),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.url=t}),placeholder:"https://"},null,512),[[r.vModelText,e.url]]),(0,r.createElementVNode)("div",{class:"ml-1 mt-1 text-xs text-80",textContent:(0,r.toDisplayString)(e.ttt("external links should start with http:// or https://"))},null,8,pm),(0,r.createElementVNode)("div",mm,[(0,r.withDirectives)((0,r.createElementVNode)("input",{id:"openInNewWindow_"+n.field.attribute,type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=function(t){return e.openInNewWindow=t})},null,8,gm),[[r.vModelCheckbox,e.openInNewWindow]]),(0,r.createElementVNode)("label",{class:"text-sm ml-2",for:"openInNewWindow_"+n.field.attribute,textContent:(0,r.toDisplayString)(e.ttt("open in new window"))},null,8,_m)])])],512),[[r.vShow,"url"==e.linkMode]]),s.withFileUpload?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)("div",vm,[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["flex items-center transition-opacity duration-150",{"pointer-events-none opacity-50":e.uploading}])},[(0,r.createElementVNode)("label",bm,[(0,r.createElementVNode)("input",{ref:"fileInput",type:"file",onChange:t[4]||(t[4]=function(e){return s.changeFile(e.target.files)}),class:"w-full h-full absolute top-0 left-0",style:{opacity:"0"}},null,544),(0,r.createElementVNode)("span",{textContent:(0,r.toDisplayString)(e.ttt("select file"))},null,8,ym)]),(0,r.createElementVNode)("div",wm,[e.file?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:0,textContent:(0,r.toDisplayString)(e.ttt("no file selected"))},null,8,xm)),e.file?((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:1,textContent:(0,r.toDisplayString)(e.filename)},null,8,km)):(0,r.createCommentVNode)("",!0)]),e.file?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,onClick:t[5]||(t[5]=function(e){return s.removeFile()}),class:"cursor-pointer text-xl text-primary",style:{"margin-left":"16px"}},[(0,r.createVNode)(a,{icon:["fas","trash-alt"]})])):(0,r.createCommentVNode)("",!0)],2),(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["w-full h-2 mt-4",{"bg-gray-200":e.uploading}])},[(0,r.createElementVNode)("div",{class:"bg-primary-400 h-full",style:(0,r.normalizeStyle)({width:e.uploadProgress+"%"})},null,4)],2)],512)),[[r.vShow,"file"==e.linkMode]]):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",Cm,[(0,r.createElementVNode)("label",{class:"block text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("custom css classes"))},null,8,Em),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.extraClasses=t})},null,512),[[r.vModelText,e.extraClasses]]),(0,r.createElementVNode)("label",{class:"block text-sm mt-4 mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("title"))},null,8,Sm),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.title=t})},null,512),[[r.vModelText,e.title]]),(0,r.createElementVNode)("div",Mm,[(0,r.createElementVNode)("div",Am,[(0,r.withDirectives)((0,r.createElementVNode)("input",{id:"nofollow_"+n.field.attribute,type:"checkbox","onUpdate:modelValue":t[8]||(t[8]=function(t){return e.nofollow=t})},null,8,Dm),[[r.vModelCheckbox,e.nofollow]]),(0,r.createElementVNode)("label",{class:"text-sm ml-2",for:"nofollow_"+n.field.attribute,textContent:"nofollow"},null,8,Om)]),(0,r.createElementVNode)("div",Nm,[(0,r.withDirectives)((0,r.createElementVNode)("input",{id:"noopener_"+n.field.attribute,type:"checkbox","onUpdate:modelValue":t[9]||(t[9]=function(t){return e.noopener=t})},null,8,Tm),[[r.vModelCheckbox,e.noopener]]),(0,r.createElementVNode)("label",{class:"text-sm ml-2",for:"noopener_"+n.field.attribute,textContent:"noopener"},null,8,Lm)]),(0,r.createElementVNode)("div",Rm,[(0,r.withDirectives)((0,r.createElementVNode)("input",{id:"noreferrer_"+n.field.attribute,type:"checkbox","onUpdate:modelValue":t[10]||(t[10]=function(t){return e.noreferrer=t})},null,8,Bm),[[r.vModelCheckbox,e.noreferrer]]),(0,r.createElementVNode)("label",{class:"text-sm ml-2",for:"noreferrer_"+n.field.attribute,textContent:"noreferrer"},null,8,Im)])])])]),(0,r.createElementVNode)("div",Pm,[(0,r.createElementVNode)("div",Fm,[(0,r.createElementVNode)("button",{type:"button",class:"font-bold py-1 cursor-pointer mr-4",onClick:t[11]||(t[11]=function(){return s.hideLinkMenu&&s.hideLinkMenu.apply(s,arguments)}),textContent:(0,r.toDisplayString)(e.ttt("cancel"))},null,8,zm),(0,r.createElementVNode)("button",{type:"button",class:"relative bg-primary-500 text-white rounded font-bold shadow py-1 px-4 cursor-pointer",style:(0,r.normalizeStyle)("url"==e.linkMode&&!e.url||"file"==e.linkMode&&!e.file?"opacity: 0.5":""),disabled:"url"==e.linkMode&&!e.url||"file"==e.linkMode&&!e.file,onClick:t[12]||(t[12]=function(t){return"url"==e.linkMode?s.setLinkFromUrl(t):s.uploadAndAddFile(t)}),textContent:(0,r.toDisplayString)("url"==e.linkMode?e.ttt("set link"):e.ttt("upload and link file"))},null,12,jm)])])]})),_:1},8,["isActive","hideMethod"]),(0,r.createElementVNode)("span",Vm,[(0,r.createVNode)(u,{isActive:s.linkIsActive,isDisabled:!s.linkCanBeUsed,clickMethod:s.showLinkMenu,title:s.linkIsActive?e.ttt("edit link"):e.ttt("set link"),icon:["fas","link"]},null,8,["isActive","isDisabled","clickMethod","title"]),(0,r.createVNode)(u,{isActive:s.linkIsActive,isDisabled:!s.linkCanBeUsed,clickMethod:s.unsetLink,title:e.ttt("unset link"),icon:["fas","unlink"]},null,8,["isActive","isDisabled","clickMethod","title"])])])}]]);const cy={props:["button","editor","mode"],components:{BaseButton:ny},computed:{buttonIsActive:function(){return!!this.editor&&this.editor.isActive(this.button)},icon:function(){return"bold"==this.button?["fas","bold"]:"italic"==this.button?["fas","italic"]:"highlight"==this.button?["fas","highlighter"]:"strike"==this.button?["fas","strikethrough"]:"underline"==this.button?["fas","underline"]:"blockquote"==this.button?["fas","quote-right"]:"bulletList"==this.button?["fas","list-ul"]:"orderedList"==this.button?["fas","list-ol"]:"horizontalRule"==this.button?["fas","horizontal-rule"]:"table"==this.button?["fas","table"]:"subscript"==this.button?["fas","subscript"]:"superscript"==this.button?["fas","superscript"]:"paragraph"==this.button?["fas","paragraph"]:null},innerHtml:function(){return"code"==this.button?" <> ":"codeBlock"==this.button?" </> ":"hardBreak"==this.button?" BR ":null}},methods:{toggleButton:function(){var e=this.editor.chain().focus();"bold"==this.button?e.toggleBold():"code"==this.button?e.toggleCode():"italic"==this.button?e.toggleItalic():"highlight"==this.button?e.toggleHighlight():"strike"==this.button?e.toggleStrike():"underline"==this.button?e.toggleUnderline():"subscript"==this.button?e.toggleSubscript():"superscript"==this.button?e.toggleSuperscript():"blockquote"==this.button?e.toggleBlockquote():"bulletList"==this.button?e.toggleBulletList():"orderedList"==this.button?e.toggleOrderedList():"codeBlock"==this.button?e.toggleCodeBlock():"horizontalRule"==this.button?e.setHorizontalRule():"table"==this.button?e.insertTable({rows:3,cols:3,withHeaderRow:!0}):"hardBreak"==this.button?e.setHardBreak():"paragraph"==this.button&&e.setParagraph(),e.run()}}},dy=(0,o.Z)(cy,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createBlock)(a,{isActive:s.buttonIsActive,isDisabled:"editor"!=n.mode,clickMethod:s.toggleButton,title:e.__(n.button),icon:s.icon,innerHtml:s.innerHtml},null,8,["isActive","isDisabled","clickMethod","title","icon","innerHtml"])}]]);var fy={class:"whitespace-nowrap"};const hy={props:["headingLevels","editor","mode"],components:{BaseButton:ny},methods:{headingIsActive:function(e){return!!this.editor&&this.editor.isActive("heading",{level:e})},setHeading:function(e){this.editor&&this.editor.chain().focus().toggleHeading({level:e}).run()}}},py=(0,o.Z)(hy,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",fy,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.headingLevels,(function(t){return(0,r.openBlock)(),(0,r.createBlock)(a,{key:"heading-button"+t,isActive:s.headingIsActive(t),isDisabled:"editor"!=n.mode,clickMethod:s.setHeading,clickMethodParameters:t,title:e.__("heading :level",{level:t}),innerHtml:"H"+t},null,8,["isActive","isDisabled","clickMethod","clickMethodParameters","title","innerHtml"])})),128))])}]]);var my={class:"bg-primary-500 p-1 leading-none text-xs"},gy=["onClick","disabled","innerHTML"];const _y={data:function(){var e=this;return{buttons:[{command:function(){return e.editor.chain().focus().addRowBefore().run()},disabledIf:function(){return!e.editor.can().addRowBefore()},title:"add row before"},{command:function(){return e.editor.chain().focus().addRowAfter().run()},disabledIf:function(){return!e.editor.can().addRowAfter()},title:"add row after"},{command:function(){return e.editor.chain().focus().deleteRow().run()},disabledIf:function(){return!e.editor.can().deleteRow()},title:"delete row"},{command:function(){return e.editor.chain().focus().addColumnBefore().run()},disabledIf:function(){return!e.editor.can().addColumnBefore()},title:"add col before"},{command:function(){return e.editor.chain().focus().addColumnAfter().run()},disabledIf:function(){return!e.editor.can().addColumnAfter()},title:"add col after"},{command:function(){return e.editor.chain().focus().deleteColumn().run()},disabledIf:function(){return!e.editor.can().deleteColumn()},title:"delete col"},{command:function(){return e.editor.chain().focus().mergeCells().run()},disabledIf:function(){return!e.editor.can().mergeCells()},title:"merge cells"},{command:function(){return e.editor.chain().focus().splitCell().run()},disabledIf:function(){return!e.editor.can().splitCell()},title:"split cell"},{command:function(){return e.editor.chain().focus().toggleHeaderColumn().run()},disabledIf:function(){return!e.editor.can().toggleHeaderColumn()},title:"header col"},{command:function(){return e.editor.chain().focus().toggleHeaderRow().run()},disabledIf:function(){return!e.editor.can().toggleHeaderRow()},title:"header row"},{command:function(){return e.editor.chain().focus().toggleHeaderCell().run()},disabledIf:function(){return!e.editor.can().toggleHeaderCell()},title:"header cell"},{command:function(){return e.editor.chain().focus().deleteTable().run()},disabledIf:function(){return!e.editor.can().deleteTable()},title:"delete table"}]}},props:["editor"]},vy=(0,o.Z)(_y,[["render",function(e,t,n,i,o,s){return(0,r.openBlock)(),(0,r.createElementBlock)("div",my,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.buttons,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("button",{key:e.title,type:"button",onClick:function(t){return e.command()},disabled:e.disabledIf(),innerHTML:e.title,class:(0,r.normalizeClass)(["px-2 rounded-full py-px text-black text-xs bg-white hover:bg-gray-200",{"cursor-not-allowed":e.disabledIf()}]),style:(0,r.normalizeStyle)([{margin:"4px"},e.disabledIf()?"opacity: 0.5":""])},null,14,gy)})),128))])}]]);var by={class:"whitespace-nowrap"};const yy={props:["alignments","alignElements","defaultAlignment","editor","mode"],components:{BaseButton:ny},methods:{iconName:function(e){return"start"==e?"left":"end"==e?"right":e},alignmentIsActive:function(e){var t=!!this.editor&&this.editor.isActive({textAlign:e});return"left"==e&&(t=!!this.editor&&(this.editor.isActive({textAlign:"left"})||this.editor.isActive({textAlign:"start"}))),"right"==e&&(t=!!this.editor&&(this.editor.isActive({textAlign:"right"})||this.editor.isActive({textAlign:"end"}))),t},setAlignment:function(e){"left"==e&&(e="start"),"right"==e&&(e="end"),this.editor.chain().focus().setTextAlign(e).run()}}},wy=(0,o.Z)(yy,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",by,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.alignments,(function(t){return(0,r.openBlock)(),(0,r.createBlock)(a,{key:"alignment-button"+t,isActive:s.alignmentIsActive(t),isDisabled:"editor"!=n.mode,clickMethod:s.setAlignment,clickMethodParameters:t,title:e.__("align "+t),icon:["fas","align-"+s.iconName(t)]},null,8,["isActive","isDisabled","clickMethod","clickMethodParameters","title","icon"])})),128))])}]]);var xy={class:"whitespace-nowrap"};const ky={props:["alignments","alignElements","defaultAlignment","editor","mode"],components:{BaseButton:ny},methods:{rtlIsActive:function(){return!!this.editor&&this.editor.isActive({dir:"rtl"})},setRtl:function(){var e=this,t=["paragraph","heading"];this.rtlIsActive()?t.forEach((function(t){return e.editor.chain().focus().updateAttributes(t,{dir:"ltr"}).run()})):t.forEach((function(t){return e.editor.chain().focus().updateAttributes(t,{dir:"rtl"}).run()}))}}},Cy=(0,o.Z)(ky,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",xy,[(0,r.createVNode)(a,{isActive:s.rtlIsActive(),isDisabled:"editor"!=n.mode,clickMethod:s.setRtl,title:"RTL",icon:["fas","paragraph-rtl"]},null,8,["isActive","isDisabled","clickMethod"])])}]]);var Ey={class:"whitespace-nowrap"};const Sy={props:["editor","mode"],components:{BaseButton:ny},methods:{changeHistory:function(e){"undo"==e?this.editor.chain().focus().undo().run():this.editor.chain().focus().redo().run()}}},My=(0,o.Z)(Sy,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",Ey,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(["undo","redo"],(function(t){return(0,r.createVNode)(a,{key:"history-button"+t,isDisabled:"editor"!=n.mode,clickMethod:s.changeHistory,clickMethodParameters:t,title:e.__(t),icon:["fas",t+"-alt"]},null,8,["isDisabled","clickMethod","clickMethodParameters","title","icon"])})),64))])}]]);var Ay={class:"z-10"},Dy={class:"px-8 py-8 bg-white"},Oy={key:0},Ny=["textContent"],Ty=["textContent"],Ly={key:1,style:{"padding-top":"32px"}},Ry={key:0},By={class:"relative bg-primary-500 text-white rounded font-bold shadow py-1 px-4 cursor-pointer"},Iy=["textContent"],Py={class:"h-16 flex items-center",style:{"margin-left":"16px"}},Fy=["textContent"],zy=["src"],jy={class:""},Vy={class:"flex flex-col"},$y=["textContent"],Hy={style:{"padding-top":"32px"}},Wy={class:"flex flex-col"},Uy=["textContent"],Ky={class:"grid grid-cols-2 gap-3 mt-4"},qy={class:"flex flex-col"},Gy=["textContent"],Zy={class:"flex flex-col mt-4"},Xy=["textContent"],Jy={class:"bg-gray-200 px-8 py-3"},Yy={class:"flex items-center justify-end"},Qy=["textContent"],ew=["disabled","textContent"],tw={class:"whitespace-nowrap"};jv.add(Yv,kb);const nw={mixins:[ay],props:["button","editor","field","mode","imageDisk","imagePath"],data:function(){return{imageMenuIsActive:!1,file:null,preview:null,url:"",uploadProgress:0,uploading:!1,extraClasses:"",imageMode:"url",title:"",alt:""}},components:{FontAwesomeIcon:Hb,BaseButton:ny,Modal:sy},computed:{imageIsActive:function(){return!!this.editor&&this.editor.isActive("image")},withFileUpload:function(){return!this.field.imageSettings||"boolean"!=typeof this.field.imageSettings.withFileUpload||this.field.imageSettings.withFileUpload},defaultMode:function(){return this.withFileUpload?"file":"url"}},methods:{showImageMenu:function(){if(this.imageIsActive){var e=this.editor.getAttributes("image");this.url=e.src,this.imageMode=e["tt-mode"]?e["tt-mode"]:this.defaultMode,this.extraClasses=e.class?e.class:"",this.title=e.title?e.title:"",this.alt=e.alt?e.alt:""}else this.url="",this.imageMode=this.defaultMode,this.extraClasses="",this.title="",this.alt="";this.imageMenuIsActive=!0},hideImageMenu:function(){this.imageMenuIsActive=!1},removeFile:function(){this.file=null,this.preview=null,this.$refs.fileInput.value=null},resetUploading:function(){this.uploading=!1,this.uploadProgress=0},changeFile:function(e){e.length&&(this.file=e[0],this.preview=URL.createObjectURL(this.file))},addImageFromUrl:function(e){e.preventDefault();var t={src:this.url,"tt-mode":"url",class:this.extraClasses,title:this.title,alt:this.alt};this.editor.chain().focus().setImage(t).run(),this.hideImageMenu()},uploadAndAddImage:function(e){var t=this;e.preventDefault(),this.uploading=!0;var n=new FormData;n.append("file",this.file),n.append("disk",this.imageDisk),n.append("path",this.imagePath);var r={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){return t.uploadProgress=e.loaded/e.total*100}};axios.post("/nova-tiptap/api/image",n,r).then(function(e){this.resetUploading(),this.removeFile();var t={src:e.data.url,"tt-mode":"file",class:this.extraClasses,title:this.title,alt:this.alt};this.editor.chain().focus().setImage(t).run(),this.hideImageMenu()}.bind(this)).catch(function(e){this.resetUploading(),this.removeFile(),console.log(e)}.bind(this))},updateImage:function(e){e.preventDefault();var t={class:this.extraClasses,title:this.title,alt:this.alt};this.editor.chain().focus().updateAttributes("image",t).run(),this.hideImageMenu()}}},rw=(0,o.Z)(nw,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("font-awesome-icon"),l=(0,r.resolveComponent)("Modal"),u=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",Ay,[(0,r.createVNode)(l,{isActive:e.imageMenuIsActive,hideMethod:s.hideImageMenu},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",Dy,[!s.imageIsActive&&s.withFileUpload?((0,r.openBlock)(),(0,r.createElementBlock)("div",Oy,[(0,r.createElementVNode)("span",{class:(0,r.normalizeClass)(["uppercase cursor-pointer font-bold text-sm border-b",{"text-primary-500 border-primary-500":"file"==e.imageMode,"text-gray-500 border-transparent":"file"!=e.imageMode}]),onClick:t[0]||(t[0]=function(t){return e.imageMode="file"}),textContent:(0,r.toDisplayString)(e.ttt("file upload"))},null,10,Ny),(0,r.createElementVNode)("span",{class:(0,r.normalizeClass)(["ml-4 uppercase cursor-pointer font-bold text-sm border-b",{"text-primary-500 border-primary-500":"url"==e.imageMode,"text-gray-500 border-transparent":"url"!=e.imageMode}]),onClick:t[1]||(t[1]=function(t){return e.imageMode="url"}),textContent:(0,r.toDisplayString)(e.ttt("external url"))},null,10,Ty)])):(0,r.createCommentVNode)("",!0),s.imageIsActive?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("div",Ly,[s.withFileUpload?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)("div",Ry,[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["flex items-center",{"pointer-events-none opacity-50":e.uploading}])},[(0,r.createElementVNode)("label",By,[(0,r.createElementVNode)("input",{ref:"fileInput",type:"file",onChange:t[2]||(t[2]=function(e){return s.changeFile(e.target.files)}),accept:"image/*",class:"w-full h-full absolute top-0 left-0",style:{opacity:"0"}},null,544),(0,r.createElementVNode)("span",{textContent:(0,r.toDisplayString)(e.ttt("select file"))},null,8,Iy)]),(0,r.createElementVNode)("div",Py,[e.preview?(0,r.createCommentVNode)("",!0):((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:0,textContent:(0,r.toDisplayString)(e.ttt("no file selected"))},null,8,Fy)),e.preview?((0,r.openBlock)(),(0,r.createElementBlock)("img",{key:1,src:e.preview,class:"w-auto",style:{height:"64px"}},null,8,zy)):(0,r.createCommentVNode)("",!0)]),e.file?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,onClick:t[3]||(t[3]=function(e){return s.removeFile()}),class:"cursor-pointer text-xl text-primary",style:{"margin-left":"16px"}},[(0,r.createVNode)(a,{icon:["fas","trash-alt"]})])):(0,r.createCommentVNode)("",!0)],2),(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["w-full h-2 mt-4",{"bg-gray-200":e.uploading}])},[(0,r.createElementVNode)("div",{class:"bg-primary-400 h-full",style:(0,r.normalizeStyle)({width:e.uploadProgress+"%"})},null,4)],2)],512)),[[r.vShow,"file"==e.imageMode]]):(0,r.createCommentVNode)("",!0),(0,r.withDirectives)((0,r.createElementVNode)("div",jy,[(0,r.createElementVNode)("div",Vy,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("url"))},null,8,$y),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.url=t}),placeholder:"https://"},null,512),[[r.vModelText,e.url]])])],512),[[r.vShow,"url"==e.imageMode]])])),(0,r.createElementVNode)("div",Hy,[(0,r.createElementVNode)("div",Wy,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("custom css classes"))},null,8,Uy),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[5]||(t[5]=function(t){return e.extraClasses=t})},null,512),[[r.vModelText,e.extraClasses]])]),(0,r.createElementVNode)("div",Ky,[(0,r.createElementVNode)("div",qy,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("title"))},null,8,Gy),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.title=t})},null,512),[[r.vModelText,e.title]])]),(0,r.createElementVNode)("div",Zy,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1",textContent:(0,r.toDisplayString)(e.ttt("alt text"))},null,8,Xy),(0,r.withDirectives)((0,r.createElementVNode)("input",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none",type:"text","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.alt=t})},null,512),[[r.vModelText,e.alt]])])])])]),(0,r.createElementVNode)("div",Jy,[(0,r.createElementVNode)("div",Yy,[(0,r.createElementVNode)("button",{type:"button",class:"font-bold py-1 cursor-pointer mr-4",onClick:t[8]||(t[8]=function(){return s.hideImageMenu&&s.hideImageMenu.apply(s,arguments)}),textContent:(0,r.toDisplayString)(e.ttt("cancel"))},null,8,Qy),(0,r.createElementVNode)("button",{type:"button",class:"relative bg-primary-500 text-white rounded font-bold shadow py-1 px-4 cursor-pointer",style:(0,r.normalizeStyle)("url"==e.imageMode&&!e.url||"file"==e.imageMode&&!e.file?"opacity: 0.5":""),disabled:!s.imageIsActive&&("url"==e.imageMode&&!e.url||"file"==e.imageMode&&!e.file),onClick:t[9]||(t[9]=function(t){return s.imageIsActive?s.updateImage(t):"url"==e.imageMode?s.addImageFromUrl(t):s.uploadAndAddImage(t)}),textContent:(0,r.toDisplayString)(s.imageIsActive?e.ttt("update image"):"url"==e.imageMode?e.ttt("add image"):e.ttt("upload and add image"))},null,12,ew)])])]})),_:1},8,["isActive","hideMethod"]),(0,r.createElementVNode)("span",tw,[(0,r.createVNode)(u,{isActive:s.imageIsActive,isDisabled:"editor"!=n.mode,clickMethod:s.showImageMenu,icon:["fas","image"],title:s.imageIsActive?e.ttt("edit image"):e.ttt("add image")},null,8,["isActive","isDisabled","clickMethod","title"])])])}]]);var iw={class:"z-10"},ow={class:"fixed top-0 left-0 w-full h-full z-50 flex items-center justify-center"},sw={class:"rounded-lg shadow-lg overflow-hidden z-20 w-action-fields max-w-full"},aw={class:"px-8 py-8 bg-white"},lw=["textContent"],uw={class:"max-h-search overflow-auto"},cw=["onClick","textContent"],dw={class:"bg-30 px-6 py-3"},fw={class:"flex items-center justify-end"},hw=["textContent"],pw={class:"whitespace-nowrap"};const mw={props:["button","editor","field","mode"],data:function(){return{menuIsActive:!1,blockKey:"default"}},components:{BaseButton:ny},methods:{addBlock:function(e){this.editor.chain().focus().insertContent(''+e.title+"").run(),this.menuIsActive=!1},showMenu:function(){this.menuIsActive=!0},hideMenu:function(){this.menuIsActive=!1}}},gw=(0,o.Z)(mw,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",iw,[(0,r.withDirectives)((0,r.createElementVNode)("div",ow,[(0,r.createElementVNode)("div",sw,[(0,r.createElementVNode)("div",aw,[(0,r.createElementVNode)("p",{textContent:(0,r.toDisplayString)(e.__("which placeholder block do you want to add")+":"),class:"mb-4"},null,8,lw),(0,r.createElementVNode)("div",uw,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.field.placeholderBlocks,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{key:e.key,class:"mb-2"},[(0,r.createElementVNode)("button",{type:"button",class:"btn btn-default btn-primary",onClick:function(t){return s.addBlock(e)},textContent:(0,r.toDisplayString)(e.title)},null,8,cw)])})),128))])]),(0,r.createElementVNode)("div",dw,[(0,r.createElementVNode)("div",fw,[(0,r.createElementVNode)("button",{type:"button",class:"btn h-9 px-3 font-normal text-80",onClick:t[0]||(t[0]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)}),textContent:(0,r.toDisplayString)(e.__("cancel"))},null,8,hw)])])]),(0,r.createElementVNode)("div",{class:"z-10 absolute top-0 left-0 w-full h-full bg-80 opacity-75",onClick:t[1]||(t[1]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)})})],512),[[r.vShow,e.menuIsActive]]),(0,r.createElementVNode)("span",pw,[(0,r.createVNode)(a,{isDisabled:"editor"!=n.mode,clickMethod:s.showMenu,icon:["far","cube"],title:e.__("add placeholder")},null,8,["isDisabled","clickMethod","title"])])])}]]);var _w={class:"z-10"},vw={class:"fixed top-0 left-0 w-full h-full z-50 flex items-center justify-center"},bw={class:"rounded-lg shadow-lg overflow-hidden z-20 w-action-fields max-w-full"},yw={class:"px-8 py-8 bg-white"},ww=["textContent"],xw={class:"max-h-search overflow-auto"},kw=["onClick","textContent"],Cw={class:"bg-30 px-6 py-3"},Ew={class:"flex items-center justify-end"},Sw=["textContent"],Mw={class:"whitespace-nowrap"};const Aw={props:["button","editor","field","mode","imageDisk","imagePath"],data:function(){return{menuIsActive:!1,blockKey:"default"}},components:{BaseButton:ny},methods:{addBlock:function(e){var t="",n=String(_.random(0,999))+String(Date.now());t+="<"+e.key+'-content-block key="'+n+'" imageDisk="'+this.imageDisk+'" imagePath="'+this.imagePath+'">",this.editor.chain().focus().insertContent(t).run(),this.menuIsActive=!1},showMenu:function(){this.menuIsActive=!0},hideMenu:function(){this.menuIsActive=!1}}},Dw=(0,o.Z)(Aw,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("base-button");return(0,r.openBlock)(),(0,r.createElementBlock)("span",_w,[(0,r.withDirectives)((0,r.createElementVNode)("div",vw,[(0,r.createElementVNode)("div",bw,[(0,r.createElementVNode)("div",yw,[(0,r.createElementVNode)("p",{textContent:(0,r.toDisplayString)(e.__("which content block do you want to add")+":"),class:"mb-4"},null,8,ww),(0,r.createElementVNode)("div",xw,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.field.contentBlocks,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{key:e.key,class:"mb-2"},[(0,r.createElementVNode)("button",{type:"button",class:"btn btn-default btn-primary",onClick:function(t){return s.addBlock(e)},textContent:(0,r.toDisplayString)(e.title)},null,8,kw)])})),128))])]),(0,r.createElementVNode)("div",Cw,[(0,r.createElementVNode)("div",Ew,[(0,r.createElementVNode)("button",{type:"button",class:"btn h-9 px-3 font-normal text-80",onClick:t[0]||(t[0]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)}),textContent:(0,r.toDisplayString)(e.__("cancel"))},null,8,Sw)])])]),(0,r.createElementVNode)("div",{class:"z-10 absolute top-0 left-0 w-full h-full bg-80 opacity-75",onClick:t[1]||(t[1]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)})})],512),[[r.vShow,e.menuIsActive]]),(0,r.createElementVNode)("span",Mw,[(0,r.createVNode)(a,{isDisabled:"editor"!=n.mode,clickMethod:s.showMenu,icon:["fas","cubes"],title:e.__("add content")},null,8,["isDisabled","clickMethod","title"])])])}]]);var Ow=function(e){return(0,r.pushScopeId)("data-v-cb89810c"),e=e(),(0,r.popScopeId)(),e},Nw=Ow((function(){return(0,r.createElementVNode)("div",{class:"absolute text-xs leading-none pt-2",style:{right:"128px",top:"6px"}}," language: ",-1)})),Tw=Ow((function(){return(0,r.createElementVNode)("option",{value:null}," auto ",-1)})),Lw=Ow((function(){return(0,r.createElementVNode)("option",{disabled:""}," — ",-1)})),Rw=["value"];const Bw={components:{NodeViewWrapper:ou,NodeViewContent:iu},props:au,data:function(){return{languages:this.extension.options.lowlight.listLanguages()}},computed:{selectedLanguage:{get:function(){return this.node.attrs.language},set:function(e){this.updateAttributes({language:e})}}}};var Iw=n(3379),Pw=n.n(Iw),Fw=n(8023),zw={insert:"head",singleton:!1};Pw()(Fw.Z,zw);Fw.Z.locals;const jw=(0,o.Z)(Bw,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("node-view-content"),l=(0,r.resolveComponent)("node-view-wrapper");return(0,r.openBlock)(),(0,r.createBlock)(l,{class:"code-block"},{default:(0,r.withCtx)((function(){return[Nw,(0,r.withDirectives)((0,r.createElementVNode)("select",{contenteditable:"false","onUpdate:modelValue":t[0]||(t[0]=function(e){return s.selectedLanguage=e}),class:"absolute right-0 text-xs leading-none text-white"},[Tw,Lw,((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(o.languages,(function(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)("option",{value:e,key:t},(0,r.toDisplayString)(e),9,Rw)})),128))],512),[[r.vModelSelect,s.selectedLanguage]]),(0,r.createElementVNode)("pre",null,[(0,r.createVNode)(a,{as:"code"})])]})),_:1})}],["__scopeId","data-v-cb89810c"]]),Vw=jw;var $w=n(8341),Hw={insert:"head",singleton:!1};Pw()($w.Z,Hw);$w.Z.locals;var Ww=n(4631),Uw=n.n(Ww),Kw=n(5650),qw={insert:"head",singleton:!1};Pw()(Kw.Z,qw);Kw.Z.locals;n(8293);var Gw=n(2027),Zw=n.n(Gw),Xw=(n(790),Object.defineProperty),Jw=Object.defineProperties,Yw=Object.getOwnPropertyDescriptors,Qw=Object.getOwnPropertySymbols,ex=Object.prototype.hasOwnProperty,tx=Object.prototype.propertyIsEnumerable,nx=(e,t,n)=>t in e?Xw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rx=(e,t)=>{for(var n in t||(t={}))ex.call(t,n)&&nx(e,n,t[n]);if(Qw)for(var n of Qw(t))tx.call(t,n)&&nx(e,n,t[n]);return e};!window.CodeMirror&&(window.CodeMirror=Uw());const ix=window.CodeMirror||Uw();var ox=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n};const sx=(0,r.defineComponent)({name:"DefaultMode",props:{name:{type:String,default:"cm-textarea-"+ +new Date},value:{type:String,default:""},content:{type:String,default:""},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>null},placeholder:{type:String,default:""}},emits:{ready:e=>e,"update:cminstance":e=>e},setup(e,{emit:t}){const n=(0,r.ref)(),i=(0,r.ref)(null),o=()=>{i.value=(0,r.markRaw)(ix.fromTextArea(n.value,e.options)),t("update:cminstance",i.value);const o=(0,r.watch)((()=>e.cminstance),(n=>{var s;n&&(null==(s=e.cminstance)||s.setValue(e.value||e.content)),t("ready",(0,r.unref)(i)),null==o||o()}),{deep:!0})};return(0,r.onMounted)((()=>{o()})),{textarea:n,initialize:o}}}),ax=["name","placeholder"];var lx=ox(sx,[["render",function(e,t,n,i,o,s){return(0,r.openBlock)(),(0,r.createElementBlock)("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,ax)}]]);window.diff_match_patch=Zw(),window.DIFF_DELETE=-1,window.DIFF_INSERT=1,window.DIFF_EQUAL=0;const ux=(0,r.defineComponent)({name:"MergeMode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=(0,r.ref)(),i=(0,r.ref)(),o=()=>{n.value=(0,r.markRaw)(ix.MergeView(i.value,e.options)),t("update:cminstance",n.value),t("ready",n)};return(0,r.onMounted)((()=>{o()})),{mergeView:i,initialize:o}}}),cx={ref:"mergeView"};var dx,fx,hx=ox(ux,[["render",function(e,t,n,i,o,s){return(0,r.openBlock)(),(0,r.createElementBlock)("div",cx,null,512)}]]);(fx=dx||(dx={})).info="info",fx.warning="warning",fx.error="error";const px=[{regex:/(\[.*?\])([ \t]*)([ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];ix.defineSimpleMode("fclog",{start:[...px,{regex:/.*/,token:"hr"}],error:[...px,{regex:/.*/,token:"error.strong"}],info:[...px,{regex:/.*/,token:"bracket"}],warning:[...px,{regex:/.*\[/,token:"comment"}]}),ix.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const mx=(0,r.defineComponent)({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:"cm-textarea-"+ +new Date},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(e,{emit:t}){const n=(0,r.ref)(),i=(0,r.ref)(null),o=(t=e.cminstance)=>{t.getAllMarks().forEach((e=>e.clear()));const n=t.getValue(),r=[].concat(function(e){const t=/#link#(.+)#link#/g,n=[];let r;for(r=t.exec(e);r;){const i=document.createElement("a"),o=JSON.parse(r[1]),s=Object.entries(o);for(const[e,t]of s)i.setAttribute(e,t);i.className="editor_custom_link",i.innerHTML="logDownload",n.push({start:r.index,end:r.index+r[0].length,node:i}),r=t.exec(e)}return n}(n)).concat(function(e){const t=[];return function(){const n=/#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g;let r;for(r=n.exec(e);r;){const i=r[0].replace(/\r\n/g,"\n").split("\n"),o=r[2].replace(/\r\n/g,"\n").split("\n"),s=document.createElement("span"),a=r[1];s.className=`c-editor--log__${a}`;let l=0;for(let e=0;e{var s;i.value=(0,r.markRaw)(ix.fromTextArea(n.value,e.options)),t("update:cminstance",(0,r.unref)(i)),null==(s=i.value)||s.on("change",o)};return(0,r.watch)((()=>e.cminstance),(n=>{var r;n&&(o(e.cminstance),null==(r=e.cminstance)||r.setValue(e.value),t("ready",i))}),{deep:!0,immediate:!0}),(0,r.onMounted)((()=>{s()})),{initialize:s,textarea:n}}}),gx=["name","placeholder"];var _x=ox(mx,[["render",function(e,t,n,i,o,s){return(0,r.openBlock)(),(0,r.createElementBlock)("textarea",{ref:"textarea",name:e.$props.name,placeholder:e.$props.placeholder},null,8,gx)}]]);const vx={"update:value":e=>e,change:(e,t)=>({value:e,cm:t}),input:e=>e,ready:e=>e},bx=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],yx=rx(rx({},vx),(()=>{const e={};return bx.forEach((t=>{e[t]=(...e)=>e})),e})()),wx={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2};const xx=({props:e,cminstance:t,emit:n,internalInstance:i,content:o})=>{const s=(0,r.computed)((()=>{var n;return e.merge?null==(n=(0,r.unref)(t))?void 0:n.editor():(0,r.unref)(t)}));return{listenerEvents:()=>{s.value.on("change",(t=>{const r=t.getValue();r!==o.value&&(o.value=r,o.value&&n("update:value",o.value||""),o.value&&n("input",o.value||""),Promise.resolve().then((()=>{n("change",o.value,t)})),e.keepCursorInEnd&&function(e){Promise.resolve().then((()=>{const t=e.getScrollInfo();e.scrollTo(t.left,t.height)}))}(t))}));const t={};(()=>{const e=[];return Object.keys(null==i?void 0:i.vnode.props).forEach((t=>{if(t.startsWith("on")){const n=t.replace(t[2],t[2].toLowerCase()).slice(2);!vx[n]&&e.push(n)}})),e})().filter((e=>!t[e]&&(t[e]=!0))).forEach((e=>{s.value.on(e,((...t)=>{n(e,...t)}))}))}}};const kx=(0,r.defineComponent)({props:{value:{type:String,default:""},options:{type:Object,default:()=>wx},globalOptions:{type:Object,default:()=>wx},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},originalStyle:{type:Boolean,default:!1},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:yx,setup(e,{expose:t,emit:n}){var i,o;const s=e;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let e=1;e{var e;return s.merge?null==(e=(0,r.unref)(a))?void 0:e.editor():(0,r.unref)(a)})),{refresh:m,resize:g,destroy:_,containerHeight:v,reviseStyle:b}=function({props:e,cminstance:t,presetRef:n}){const i=(0,r.ref)(null),o=(0,r.ref)(null),s=(0,r.computed)((()=>{var n;return e.merge?null==(n=(0,r.unref)(t))?void 0:n.editor():(0,r.unref)(t)})),a=()=>{(0,r.nextTick)((()=>{var e;null==(e=s.value)||e.refresh()}))},l=()=>{var e;const t=null==(e=s.value)?void 0:e.getWrapperElement();null==t||t.remove()},u=()=>{const e=document.querySelector(".CodeMirror-gutters");return"0"!==(null==e?void 0:e.style.left.replace("px",""))};return{reload:()=>{var e,t,r;const i=null==(e=s.value)?void 0:e.getDoc().getHistory();null==(t=n.value)||t.initialize(),l(),null==(r=s.value)||r.getDoc().setHistory(i)},refresh:a,resize:(t=e.width,n=e.height)=>{var r;i.value=String(t).replace("px",""),o.value=String(n).replace("px","");const a=o.value;null==(r=s.value)||r.setSize(i.value,a)},destroy:l,containerHeight:o,reviseStyle:()=>{if(a(),!u())return;const e=setInterval((()=>{u()?a():clearInterval(e)}),60),t=setTimeout((()=>{clearInterval(e),clearTimeout(t)}),400)}}}({props:s,cminstance:a,presetRef:h}),{listenerEvents:y}=xx({props:s,cminstance:a,emit:n,internalInstance:d,content:l}),w=()=>{void 0!==s.unseenLines&&void 0!==s.marker&&s.unseenLines.forEach((e=>{var t,n;const r=null==(t=a.value)?void 0:t.lineInfo(e);null==(n=a.value)||n.setGutterMarker(e,"breakpoints",(null==r?void 0:r.gutterMarkers)?null:s.marker())}))},x=()=>{y(),w(),g(s.width,s.height),n("ready",a.value),(0,r.watch)([()=>s.width,()=>s.height],(([e,t])=>{g(e,t)}),{deep:!0})};return(0,r.watch)((()=>s.options),(e=>{var t;for(const n in s.options)null==(t=p.value)||t.setOption(n,(0,r.unref)(e[n]))}),{deep:!0}),(0,r.watch)((()=>s.value),(e=>{var t,n,r;(t=e)!==(null==(n=a.value)?void 0:n.getValue())&&(null==(r=a.value)||r.setValue(t),l.value=t,b()),w()})),(0,r.watch)((()=>s.placeholder),(e=>{var t;null==(t=p.value)||t.setOption("placeholder",e)})),(0,r.watch)((()=>s.merge),(e=>{"fclog"!==s.options.mode&&"log"!==s.options.mode?s.merge?u.value=hx:u.value=lx:u.value=_x}),{immediate:!0}),(0,r.onBeforeUnmount)((()=>{_()})),t({cminstance:a,resize:g,refresh:m,destroy:_}),(e,t)=>{return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["codemirror-container",{merge:e.$props.merge,bordered:e.$props.border||e.$props.merge&&!s.originalStyle,"width-auto":!e.$props.width||"100%"==e.$props.width,"height-auto":!e.$props.height||"100%"==e.$props.height,"original-style":s.originalStyle}]),style:(0,r.normalizeStyle)({height:(0,r.unref)(v)+"px"})},[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)((0,r.unref)(u)),(0,r.mergeProps)({ref_key:"presetRef",ref:h,cminstance:a.value,"onUpdate:cminstance":t[0]||(t[0]=e=>a.value=e),style:{height:"100%"}},(n=rx(rx({},e.$props),e.$attrs),i={options:c.value,name:(0,r.unref)(f),content:l.value},Jw(n,Yw(i))),{onReady:x}),null,16,["cminstance"]))],6);var n,i}}});window.CodeMirror;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".codemirror-container {\n position: relative;\n display: inline-block;\n height: 100%;\n width: fit-content;\n font-size: 12px;\n overflow: hidden;\n}\n.codemirror-container.bordered {\n border-radius: 4px;\n border: 1px solid #dddddd;\n}\n.codemirror-container.width-auto {\n width: 100%;\n}\n.codemirror-container.height-auto {\n height: 100%;\n}\n.codemirror-container.height-auto .CodeMirror,\n.codemirror-container.height-auto .cm-s-default {\n height: 100% !important;\n}\n.codemirror-container .editor_custom_link {\n cursor: pointer;\n color: #1474f1;\n text-decoration: underline;\n}\n.codemirror-container .editor_custom_link:hover {\n color: #04b4fa;\n}\n.codemirror-container:not(.original-style) .CodeMirror-lines .CodeMirror-placeholder.CodeMirror-line-like {\n color: #666;\n}\n.codemirror-container:not(.original-style) .CodeMirror,\n.codemirror-container:not(.original-style) .CodeMirror-merge-pane {\n height: 100%;\n font-family: consolas !important;\n}\n.codemirror-container:not(.original-style) .CodeMirror-merge,\n.codemirror-container:not(.original-style) .CodeMirror-merge-right .CodeMirror {\n height: 100%;\n border: none !important;\n}\n.codemirror-container:not(.original-style) .c-editor--log__error {\n color: #bb0606;\n font-weight: bold;\n}\n.codemirror-container:not(.original-style) .c-editor--log__info {\n color: #333333;\n font-weight: bold;\n}\n.codemirror-container:not(.original-style) .c-editor--log__warning {\n color: #ee9900;\n}\n.codemirror-container:not(.original-style) .c-editor--log__success {\n color: #669600;\n}\n.codemirror-container:not(.original-style) .cm-header,\n.codemirror-container:not(.original-style) .cm-strong {\n font-weight: bold;\n}\n");n(6876);var Cx=n(5063),Ex={insert:"head",singleton:!1};Pw()(Cx.Z,Ex);Cx.Z.locals;const Sx={props:{modelValue:String,theme:String},components:{Codemirror:kx},data:function(){return{cmOptions:{tabSize:4,mode:"text/xml",theme:this.theme?this.theme:"dracula",lineNumbers:!0,line:!0}}},methods:{updateValue:function(e){this.$emit("update:modelValue",e)}}},Mx=(0,o.Z)(Sx,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("Codemirror");return(0,r.openBlock)(),(0,r.createBlock)(a,{value:n.modelValue,options:o.cmOptions,border:"",placeholder:"test placeholder",height:200,onChange:s.updateValue},null,8,["value","options","onChange"])}]]),Ax="undefined"!=typeof navigator?navigator:null,Dx="undefined"!=typeof document?document:null,Ox=Ax&&Ax.userAgent||"",Nx=/Edge\/(\d+)/.exec(Ox),Tx=/MSIE \d/.exec(Ox),Lx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ox),Rx=!!(Tx||Lx||Nx),Bx=Tx?document.documentMode:Lx?+Lx[1]:Nx?+Nx[1]:0,Ix=!Rx&&/gecko\/(\d+)/i.test(Ox);Ix&&(/Firefox\/(\d+)/.exec(Ox)||[0,0])[1];const Px=!Rx&&/Chrome\/(\d+)/.exec(Ox),Fx=!!Px,zx=Px?+Px[1]:0,jx=!Rx&&!!Ax&&/Apple Computer/.test(Ax.vendor),Vx=jx&&(/Mobile\/\w+/.test(Ox)||!!Ax&&Ax.maxTouchPoints>2),$x=Vx||!!Ax&&/Mac/.test(Ax.platform),Hx=/Android \d/.test(Ox),Wx=!!Dx&&"webkitFontSmoothing"in Dx.documentElement.style,Ux=Wx?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Kx=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t};const qx=function(e,t,n,r){return n&&(Zx(e,t,n,r,-1)||Zx(e,t,n,r,1))},Gx=/^(img|br|input|textarea|hr)$/i;function Zx(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Xx(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Jx(e)||Gx.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Kx(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Xx(e):0}}}function Xx(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Jx(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Yx=function(e){let t=e.isCollapsed;return t&&Fx&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Qx(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const ek=function(e){e&&(this.nodeName=e)};ek.prototype=Object.create(null);new ek;function tk(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(Yx(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ct.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Xx(e);r||i;){if(e==n)return!0;let t=Kx(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Xx(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ct(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ck(e,a,u,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{nk(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const ik=jx||Fx&&zx<63;function ok(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||lt.between(t,n,r)}function dk(e){let t=e.domSelection();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(e){return!1}}function fk(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&it.findFrom(o,t)}function hk(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function pk(e,t,n){let r=e.state.selection;if(!(r instanceof lt)){if(r instanceof ct&&r.node.isInline)return hk(e,new lt(t>0?r.$to:r.$from));{let n=fk(e.state,t);return!!n&&hk(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=fk(e.state,t);return!!(n&&n instanceof ct)&&hk(e,n)}if(!($x&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ct.isSelectable(o)?hk(e,new ct(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Wx&&hk(e,new lt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function mk(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function gk(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function _k(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Ix&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(gk(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(bk(n))break;{let t=n.previousSibling;for(;t&&gk(t);)i=n.parentNode,o=Kx(t),t=t.previousSibling;if(t)n=t,r=mk(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?yk(e,t,n,r):i&&yk(e,t,i,o)}function vk(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=mk(n);for(;;)if(r{e.state==i&&rk(e)}),50)}function wk(e,t,n){let r=e.state.selection;if(r instanceof lt&&!r.empty||n.indexOf("s")>-1)return!1;if($x&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=fk(e.state,t);if(n&&n instanceof ct)return hk(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof ft?it.near(n,t):it.findFrom(n,t);return!!s&&hk(e,s)}return!1}function xk(e,t){if(!(e.state.selection instanceof lt))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function kk(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ck(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||$x&&72==n&&"c"==r?xk(e,-1)||_k(e):46==n||$x&&68==n&&"c"==r?xk(e,1)||vk(e):13==n||27==n||(37==n||$x&&66==n&&"c"==r?pk(e,-1,r)||_k(e):39==n||$x&&70==n&&"c"==r?pk(e,1,r)||vk(e):38==n||$x&&80==n&&"c"==r?wk(e,-1,r)||_k(e):40==n||$x&&78==n&&"c"==r?function(e){if(!jx||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;kk(e,n,"true"),setTimeout((()=>kk(e,n,"false")),20)}return!1}(e)||wk(e,1,r)||vk(e):r==($x?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ek(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||ve.fromSchema(e.state.schema),a=Bk(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Lk[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Sk(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new C(v.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):C.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=ve.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Bk().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Lk[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||le.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Mk.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=v.from(t.create(n[e+1],i)),o++,s++}return new C(i,o,s)}(Tk(s,+c[1],+c[2]),c[4]);else if(s=C.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Dk(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ok(o[o.length-1],r.length));let t=Ak(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return v.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e{s=e(s)})),s}const Mk=/^(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 Ak(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,v.from(e));return e}function Dk(e,t,n,r,i){if(i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Tk(e,t,n){return t0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Vk(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function $k(e,t,n,r,i){return jk(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ct&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ct.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Vk(e,ct.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ct.isSelectable(r))&&(Vk(e,new ct(n),"pointer"),!0)}(e,n))}function Hk(e,t,n,r){return jk(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Wk(e,t,n,r){return jk(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Vk(e,lt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Vk(e,lt.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ct.isSelectable(n))continue;Vk(e,ct.create(r,o),"pointer")}return!0}}(e,n,r)}function Uk(e){return Yk(e)}Pk.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Gk(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Hx||!Fx||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Vx||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Ck(e,n)?n.preventDefault():Fk(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Qx(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Pk.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Pk.keypress=(e,t)=>{let n=t;if(Gk(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||$x&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof lt&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const Kk=$x?"metaKey":"ctrlKey";Ik.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Uk(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Kk]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(zk(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new qk(e,s,n,!!r)):("doubleClick"==o?Hk:Wk)(e,s.pos,s.inside,n)?n.preventDefault():Fk(e,"pointer"))};class qk{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Kk],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ct&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Ix||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((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Fk(e,"pointer")}done(){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((()=>rk(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(zk(e))),this.allowDefault||!t?Fk(this.view,"pointer"):$k(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||jx&&this.mightDrag&&!this.mightDrag.node.isAtom||Fx&&!(this.view.state.selection instanceof lt)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Vk(this.view,it.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Fk(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Fk(this.view,"pointer"),0==e.buttons&&this.done()}}function Gk(e,t){return!!e.composing||!!(jx&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ik.touchdown=e=>{Uk(e),Fk(e,"pointer")},Ik.contextmenu=e=>Uk(e);const Zk=Hx?5e3:-1;function Xk(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Yk(e)),t))}function Jk(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Yk(e,t=!1){if(!(Hx&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jk(e),t||e.docView&&e.docView.dirty){let t=tk(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Pk.compositionstart=Pk.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Yk(e,!0),e.markCursor=null;else if(Yk(e),Ix&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Xk(e,Zk)},Pk.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Xk(e,20))};const Qk=Rx&&Bx<15||Vx&&Ux<604;function eC(e,t,n,r){let i=Sk(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||C.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ik.copy=Pk.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Qk?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ek(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Pk.paste=(e,t)=>{let n=t;if(e.composing&&!Hx)return;let r=Qk?null:n.clipboardData;r&&eC(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let 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(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?eC(e,r.value,null,t):eC(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class tC{constructor(e,t){this.slice=e,this.move=t}}const nC=$x?"altKey":"ctrlKey";Ik.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(zk(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ct?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ct.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Ek(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Qk?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Qk||n.dataTransfer.setData("text/plain",l),e.dragging=new tC(s,!n[nC])},Ik.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Pk.dragover=Pk.dragenter=(e,t)=>t.preventDefault(),Pk.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(zk(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Sk(e,n.dataTransfer.getData(Qk?"Text":"text/plain"),Qk?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[nC]);if(e.someProp("handleDrop",(t=>t(e,n,s||C.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?He(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(f))return;let h=u.doc.resolve(c);if(d&&ct.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ct(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(ck(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},Ik.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&rk(e)}),20))},Ik.blur=(e,t)=>{let 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)},Ik.beforeinput=(e,t)=>{if(Fx&&Hx&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Qx(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Pk)Ik[e]=Pk[e];function rC(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class iC{constructor(e,t){this.toDOM=e,this.spec=t||uC,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new aC(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof iC&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rC(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oC{constructor(e,t){this.attrs=e,this.spec=t||uC}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new aC(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==dC||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uC)}mapInner(e,t,n,r,i){let o;for(let s=0;s{for(let s=0;su+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:f,offset:h}=r.content.findIndex(c),p=r.maybeChild(f);if(p&&h==c&&h+p.nodeSize==d){let r=a[t+2].mapInner(n,p,l+1,e[t]+o+1,s);r!=dC?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o{let s,a=o+n;if(s=pC(t,e,a)){for(r||(r=this.children.slice());io&&t.to=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;ei&&t.type instanceof oC){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(e,t,uC)));return fC.from(n)}forChild(e,t){if(t.isLeaf)return cC.empty;let n=[];for(let r=0;rn&&t.to{let a=pC(e,t,s+n);if(a){o=!0;let e=gC(a,t,n+s+1,r);e!=dC&&i.push(s,s+t.nodeSize,e)}}));let s=hC(o?mC(e):e,-n).sort(_C);for(let e=0;e0;)t++;e.splice(t,0,n)}class yC extends it{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return yC.valid(n)?new yC(n):it.near(n)}content(){return C.empty}eq(e){return e instanceof yC&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new yC(e.resolve(t.pos))}getBookmark(){return new wC(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&yC.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(yC.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ct.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(yC.valid(s))return s}return null}}}yC.prototype.visible=!1,yC.findFrom=yC.findGapCursorFrom,it.jsonID("gapcursor",yC);class wC{constructor(e){this.pos=e}map(e){return new wC(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return yC.valid(t)?new yC(t):it.near(t)}}const xC=Ui({ArrowLeft:kC("horiz",-1),ArrowRight:kC("horiz",1),ArrowUp:kC("vert",-1),ArrowDown:kC("vert",1)});function kC(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof lt){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=yC.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new yC(l))),!0)}}function CC(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!yC.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ct.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new yC(r))),!0)}function EC(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof yC))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=v.empty;for(let e=r.length-1;e>=0;e--)i=v.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new C(i,0,0));return o.setSelection(lt.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function SC(e){if(!(e.selection instanceof yC))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",cC.create(e.doc,[aC.widget(e.selection.head,t,{key:"gapcursor"})])}const MC=Wo.create({name:"gapCursor",addProseMirrorPlugins:()=>[new kt({props:{decorations:SC,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&yC.valid(n)?new yC(n):null,handleClick:CC,handleKeyDown:xC,handleDOMEvents:{beforeinput:EC}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=Ao(wo(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}});const AC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],DC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],OC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],NC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],TC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var LC="\\.([0-9](_*[0-9])*)",RC="[0-9a-fA-F](_*[0-9a-fA-F])*",BC={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${LC})|\\.)?|(${LC}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${LC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${LC})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${RC})\\.?|(${RC})?\\.(${RC}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${RC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function IC(e,t,n){return-1===n?"":e.replace(t,(r=>IC(e,t,n-1)))}const PC="[A-Za-z$_][0-9A-Za-z$_]*",FC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],zC=["true","false","null","undefined","NaN","Infinity"],jC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$C=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HC=["arguments","this","super","console","window","document","localStorage","module","global"],WC=[].concat($C,jC,VC);var UC="\\.([0-9](_*[0-9])*)",KC="[0-9a-fA-F](_*[0-9a-fA-F])*",qC={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${UC})|\\.)?|(${UC}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${UC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${UC})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${KC})\\.?|(${KC})?\\.(${KC}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${KC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const GC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ZC=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],XC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],JC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],YC=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),QC=XC.concat(JC);const eE=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],tE=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],nE=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],rE=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],iE=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function oE(e){return e?"string"==typeof e?e:e.source:null}function sE(e){return aE("(?=",e,")")}function aE(...e){return e.map((e=>oE(e))).join("")}function lE(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>oE(e))).join("|")+")"}const uE=e=>aE(/\b/,e,/\w$/.test(e)?/\b/:/\B/),cE=["Protocol","Type"].map(uE),dE=["init","self"].map(uE),fE=["Any","Self"],hE=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],pE=["false","nil","true"],mE=["assignment","associativity","higherThan","left","lowerThan","none","right"],gE=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],_E=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],vE=lE(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),bE=lE(vE,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),yE=aE(vE,bE,"*"),wE=lE(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),xE=lE(wE,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),kE=aE(wE,xE,"*"),CE=aE(/[A-Z]/,xE,"*"),EE=["autoclosure",aE(/convention\(/,lE("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",aE(/objc\(/,kE,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],SE=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const ME="[A-Za-z$_][0-9A-Za-z$_]*",AE=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],DE=["true","false","null","undefined","NaN","Infinity"],OE=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],NE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],TE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],LE=["arguments","this","super","console","window","document","localStorage","module","global"],RE=[].concat(TE,OE,NE);const BE=n(3390);var IE=n(6291);const PE=Object.assign(FE(Error),{eval:FE(EvalError),range:FE(RangeError),reference:FE(ReferenceError),syntax:FE(SyntaxError),type:FE(TypeError),uri:FE(URIError)});function FE(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?IE(t,...n):t;return new e(r)}}const zE={}.hasOwnProperty,jE="hljs-";function VE(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw PE("Expected `string` for name, got `%s`",e);if(!BE.getLanguage(e))throw PE("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw PE("Expected `string` for value, got `%s`",t);null==r&&(r=jE),BE.configure({__emitter:$E,classPrefix:r});const i=BE.highlight(t,{language:e,ignoreIllegals:!0});if(BE.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class $E{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const HE={highlight:VE,highlightAuto:function(e,t={}){const n=t.subset||BE.listLanguages();let r=t.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=jE),"string"!=typeof e)throw PE("Expected `string` for value, got `%s`",e);for(;++io.data.relevance&&(o=s)}return o},registerLanguage:function(e,t){BE.registerLanguage(e,t)},registered:function(e){return Boolean(BE.getLanguage(e))},listLanguages:function(){return BE.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)BE.registerAliases(t,{languageName:e});else{let t;for(t in e)zE.call(e,t)&&BE.registerAliases(e[t],{languageName:t})}}};HE.registerLanguage("arduino",(function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)(decltype\\(auto\\)|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},p=[h,u,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:f},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),HE.registerLanguage("bash",(function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),u={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),u,a,e.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),HE.registerLanguage("c",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(decltype\\(auto\\)|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[u,s,n,e.C_BLOCK_COMMENT_MODE,l,a],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:h.concat([{begin:/\(/,end:/\)/,keywords:f,contains:h.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:a,keywords:f}}})),HE.registerLanguage("cpp",(function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)(decltype\\(auto\\)|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",f={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},p=[h,u,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:f,illegal:"",keywords:f,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:f},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),HE.registerLanguage("csharp",(function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},u={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},c=e.inherit(u,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[u,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const d={variants:[u,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",p={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},d,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,f],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},p]}})),HE.registerLanguage("css",(function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+OC.join("|")+")"},{begin:":(:)?("+NC.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+TC.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:DC.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+AC.join("|")+")\\b"}]}})),HE.registerLanguage("diff",(function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),HE.registerLanguage("go",(function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:")?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,BC,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},BC,o]}})),HE.registerLanguage("javascript",(function(e){const t=e.regex,n=PC,r="<>",i="",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="",M={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,f,h,p,u,y,{className:"attr",begin:n+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},b,E,{match:/\$[(.]/}]}})),HE.registerLanguage("json",(function(e){const t={beginKeywords:["true","false","null"].join(" ")};return{name:"JSON",contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),HE.registerLanguage("kotlin",(function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"})]}]},l=qC,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),c={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=c;return d.variants[1].contains=[c],c.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[c,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,a,o,e.C_NUMBER_MODE]},u]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},s,a]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),HE.registerLanguage("less",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=QC,r="([\\w-]+|@\\{[\\w-]+\\})",i=[],o=[],s=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},a=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ZC.join(" ")},u={begin:"\\(",end:"\\)",contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,a("variable","@@?[\\w-]+",10),a("variable","@\\{[\\w-]+\\}"),a("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT);const c=o.concat({begin:/\{/,end:/\}/,contains:i}),d={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},f={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YC.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:o,relevance:0}},p={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:c}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,a("keyword","all\\b"),a("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+GC.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,a("selector-tag",r,0),a("selector-id","#"+r),a("selector-class","\\."+r,0),a("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+XC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+JC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:c},{begin:"!important"},t.FUNCTION_DISPATCH]},g={begin:`[\\w-]+:(:)?(${n.join("|")})`,returnBegin:!0,contains:[m]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,p,g,f,m),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}})),HE.registerLanguage("lua",(function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}})),HE.registerLanguage("makefile",(function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},o=e.inherit(r,{contains:[]}),s=e.inherit(i,{contains:[]});r.contains.push(s),i.contains.push(o);let a=[t,n];return[r,i,o,s].forEach((e=>{e.contains=e.contains.concat(a)})),a=a.concat(r,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}})),HE.registerLanguage("objectivec",(function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}})),HE.registerLanguage("perl",(function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(e,r,i="\\1")=>{const o="\\1"===i?i:t.concat(i,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},c=(e,r,i)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,n),d=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",t.either(...l,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:c("(?:m|qr)?",/\//,/\//)},{begin:c("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:c("m|qr",/\(/,/\)/)},{begin:c("m|qr",/\[/,/\]/)},{begin:c("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=d,o.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:d}})),HE.registerLanguage("php",(function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",u={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},c={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},d=["false","null","true"],f=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],p={keyword:f,literal:(e=>{const t=[];return e.forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(d),built_in:h},m=e=>e.map((e=>e.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(h).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(r,"\\b(?!\\()"),v={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},b={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},y={relevance:0,begin:/\(/,end:/\)/,keywords:p,contains:[b,o,v,e.C_BLOCK_COMMENT_MODE,u,c,g]},w={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(f).join("\\b|"),"|",m(h).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[y]};y.contains.push(w);const x=[b,v,e.C_BLOCK_COMMENT_MODE,u,c,g];return{case_insensitive:!1,keywords:p,contains:[{begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:d,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:d,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",match:i}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,w,v,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:p,contains:["self",o,v,e.C_BLOCK_COMMENT_MODE,u,c]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},u,c]}})),HE.registerLanguage("php-template",(function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),HE.registerLanguage("plaintext",(function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),HE.registerLanguage("python",(function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u="[0-9](_?[0-9])*",c=`(\\b(${u}))?\\.(${u})|\\b(${u})\\.`,d=`\\b|${r.join("|")}`,f={className:"number",relevance:0,variants:[{begin:`(\\b(${u})|(${c}))[eE][+-]?(${u})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${u})[jJ](?=${d})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},p={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,f,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,f,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,f,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[p]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,p,l]}]}})),HE.registerLanguage("python-repl",(function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),HE.registerLanguage("r",(function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),HE.registerLanguage("ruby",(function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:o},c={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},d="[0-9](_?[0-9])*",f={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},p=[c,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/class\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{relevance:0,match:[i,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[c,{begin:n}],relevance:0},f,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);u.contains=p,h.contains=p;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:p}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:p}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(p)}})),HE.registerLanguage("rust",(function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"],keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},n]}})),HE.registerLanguage("scss",(function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=rE,r=nE,i="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+eE.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+iE.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:tE.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}})),HE.registerLanguage("shell",(function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),HE.registerLanguage("sql",(function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],o=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=o,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!o.includes(e))),u={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e))}(l,{when:e=>e.length<3}),literal:r,type:i,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:i}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},u,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),HE.registerLanguage("swift",(function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,lE(...cE,...dE)],className:{2:"keyword"}},o={match:aE(/\./,lE(...hE)),relevance:0},s=hE.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:lE(...hE.filter((e=>"string"!=typeof e)).concat(fE).map(uE),...dE)}]},l={$pattern:lE(/\b\w+/,/#\w+/),keyword:s.concat(gE),literal:pE},u=[i,o,a],c=[{match:aE(/\./,lE(..._E)),relevance:0},{className:"built_in",match:aE(/\b/,lE(..._E),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:"operator",relevance:0,variants:[{match:yE},{match:`\\.(\\.|${bE})+`}]}],h="([0-9a-fA-F]_*)+",p={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:`\\b0x(${h})(\\.(${h}))?([pP][+-]?(([0-9]_*)+))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},m=(e="")=>({className:"subst",variants:[{match:aE(/\\/,e,/[0\\tnr"']/)},{match:aE(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),g=(e="")=>({className:"subst",match:aE(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(e="")=>({className:"subst",label:"interpol",begin:aE(/\\/,e,/\(/),end:/\)/}),v=(e="")=>({begin:aE(e,/"""/),end:aE(/"""/,e),contains:[m(e),g(e),_(e)]}),b=(e="")=>({begin:aE(e,/"/),end:aE(/"/,e),contains:[m(e),_(e)]}),y={className:"string",variants:[v(),v("#"),v("##"),v("###"),b(),b("#"),b("##"),b("###")]},w={match:aE(/`/,kE,/`/)},x=[w,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${xE}+`}],k=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:SE,contains:[...f,p,y]}]}},{className:"keyword",match:aE(/@/,lE(...EE))},{className:"meta",match:aE(/@/,kE)}],C={match:sE(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:aE(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xE,"+")},{className:"type",match:CE,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:aE(/\s+&\s+/,sE(CE)),relevance:0}]},E={begin://,keywords:l,contains:[...r,...u,...k,d,C]};C.contains.push(E);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:aE(kE,/\s*:/),keywords:"_|0",relevance:0},...r,...u,...c,...f,p,y,...x,...k,C]},M={begin://,contains:[...r,C]},A={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:lE(sE(aE(kE,/\s*:/)),sE(aE(kE,/\s+/,kE,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:kE}]},...r,...u,...f,p,y,...k,C,S],endsParent:!0,illegal:/["']/},D={match:[/func/,/\s+/,lE(w.match,kE,yE)],className:{1:"keyword",3:"title.function"},contains:[M,A,t],illegal:[/\[/,/%/]},O={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[M,A,t],illegal:/\[|%/},N={match:[/operator/,/\s+/,yE],className:{1:"keyword",3:"title"}},T={begin:[/precedencegroup/,/\s+/,CE],className:{1:"keyword",3:"title"},contains:[C],keywords:[...mE,...pE],end:/}/};for(const e of y.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...u,...c,...f,p,y,...x];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,D,O,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},N,T,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...u,...c,...f,p,y,...x,...k,C,S]}})),HE.registerLanguage("typescript",(function(e){const t=function(e){const t=e.regex,n=ME,r="<>",i="",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let i;">"===r&&(((e,{after:t})=>{const n="",M={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,f,h,p,u,y,{className:"attr",begin:n+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},b,E,{match:/\$[(.]/}]}}(e),n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},o={$pattern:ME,keyword:AE.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:DE,built_in:RE.concat(n),"variable.language":LE},s={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},a=(e,t,n)=>{const r=e.contains.findIndex((e=>e.label===t));if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};return Object.assign(t.keywords,o),t.exports.PARAMS_CONTAINS.push(s),t.contains=t.contains.concat([s,r,i]),a(t,"shebang",e.SHEBANG()),a(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t})),HE.registerLanguage("vbnet",(function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(i,o),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}})),HE.registerLanguage("xml",(function(e){const t=e.regex,n=t.concat(/[A-Z_]/,t.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,o,a,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),HE.registerLanguage("yaml",(function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},u=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},o,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,r],c=[...u];return c.pop(),c.push(i),s.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:u}}));var WE=n(7994),UE=n.n(WE),KE=n(5317),qE={class:"w-full flex justify-between items-center bg-30 px-3 py-2 rounded-lg shadow-sm my-4",contenteditable:"false"},GE={class:"cursor-move pr-4 text-60 text-lg",contenteditable:"false",draggable:"true","data-drag-handle":""},ZE={class:"w-full"};jv.add(rb,kb);const XE={props:au,components:{NodeViewWrapper:ou,NodeViewContent:iu,FontAwesomeIcon:Hb},methods:{deleteBlock:function(){this.$el.remove()}}},JE=(0,o.Z)(XE,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("font-awesome-icon"),l=(0,r.resolveComponent)("node-view-content"),u=(0,r.resolveComponent)("node-view-wrapper");return(0,r.openBlock)(),(0,r.createBlock)(u,null,{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",qE,[(0,r.createElementVNode)("div",GE,[(0,r.createVNode)(a,{icon:["fas","grip-horizontal"]})]),(0,r.createElementVNode)("div",ZE,[(0,r.createVNode)(l,{class:"text-80",contenteditable:"false"})]),(0,r.createElementVNode)("div",{class:"pl-4 text-60 text-lg cursor-pointer",contenteditable:"false",onClick:t[0]||(t[0]=function(){return s.deleteBlock&&s.deleteBlock.apply(s,arguments)})},[(0,r.createVNode)(a,{icon:["fas","trash-alt"]})])])]})),_:1})}]]),YE=js.create({name:"placeholderBlock",group:"block",content:"block+",draggable:!0,parseHTML:function(){return[{tag:"placeholder-block"}]},renderHTML:function(e){return["placeholder-block",Eo(e.HTMLAttributes),0]},addNodeView:function(){return uu(JE)}});var QE=["textContent"],eS=["textContent"],tS=["textContent"],nS=["textContent"],rS=["textContent"],iS=["textContent"],oS={class:"fixed top-0 left-0 w-full h-full z-50 flex items-center justify-center"},sS={class:"rounded-lg shadow-lg overflow-hidden z-20 w-action-fields max-w-full"},aS={class:"px-8 py-8 bg-white"},lS={class:"flex flex-col"},uS=["textContent"],cS={class:"mt-4"},dS=["textContent"],fS={class:"mt-4"},hS=["textContent"],pS={class:"mt-4"},mS=["textContent"],gS=["value","textContent"],_S={class:"bg-30 px-6 py-3"},vS={class:"flex items-center justify-end"},bS=["textContent"],yS=["textContent"];var wS={class:"relative w-full my-8",contenteditable:"false"},xS={class:"flex justify-center"},kS=["textContent"],CS={class:"w-full flex justify-between items-center bg-60 px-3 py-2 rounded-lg"},ES={class:"cursor-move pr-4 text-white text-lg",draggable:"true","data-drag-handle":""},SS={class:"w-full"},MS={class:"flex justify-center hidden"},AS=["textContent"];jv.add(rb,kb);const DS={props:{label:String,nodeKey:String|Number},components:{NodeViewWrapper:ou,FontAwesomeIcon:Hb},methods:{deleteBlock:function(){this.$el.remove()}}},OS=(0,o.Z)(DS,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("font-awesome-icon"),l=(0,r.resolveComponent)("node-view-wrapper");return(0,r.openBlock)(),(0,r.createBlock)(l,null,{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",wS,[(0,r.createElementVNode)("div",xS,[(0,r.createElementVNode)("div",{textContent:(0,r.toDisplayString)(n.label),class:"bg-60 rounded-t text-white uppercase font-bold text-xs px-2 pt-1",draggable:"true","data-drag-handle":""},null,8,kS)]),(0,r.createElementVNode)("div",CS,[(0,r.createElementVNode)("div",ES,[(0,r.createVNode)(a,{icon:["fas","grip-horizontal"]})]),(0,r.createElementVNode)("div",SS,[(0,r.renderSlot)(e.$slots,"default")]),(0,r.createElementVNode)("div",{class:"pl-4 text-white text-lg cursor-pointer",onClick:t[0]||(t[0]=function(){return s.deleteBlock&&s.deleteBlock.apply(s,arguments)})},[(0,r.createVNode)(a,{icon:["fas","trash-alt"]})])]),(0,r.createElementVNode)("div",MS,[(0,r.createElementVNode)("div",{textContent:(0,r.toDisplayString)(n.nodeKey),class:"text-xs pt-1"},null,8,AS)])])]})),_:3})}]]),NS={props:au,components:{ContentBlockWrapper:OS},data:function(){return{menuIsActive:!1,embedCode:"",caption:"",credits:"",ratio:"",ratioOptions:["16:9","4:3","1:1","9:16","3:4","2:1","8:5"]}},computed:{title:function(){var e=this.node.attrs.embedCode;if(!e||!e.substr("src="))return this.__("no embed code");var t=e.substr(e.indexOf("src=")+5),n=(t=t.substr(0,t.indexOf('"'))).substr(t.lastIndexOf("/")+1);n.indexOf("?")>-1&&(n=n.substr(0,n.indexOf("?")));var r="";return _.each(["vimeo","youtube"],(function(e){t.toLowerCase().indexOf(e)>-1&&(r=_.upperFirst(e)+" Video ("+n+")")})),r||(r=t,r.lastIndexOf("?")>-1&&(r=r.substr(0,r.lastIndexOf("?"))),r.indexOf("//")>-1&&(r=r.substr(r.indexOf("//")+2))),r}},methods:{showMenu:function(){this.embedCode=this.node.attrs.embedCode?this.node.attrs.embedCode:"",this.caption=this.node.attrs.caption?this.node.attrs.caption:"",this.credits=this.node.attrs.credits?this.node.attrs.credits:"",this.ratio=this.node.attrs.ratio?this.node.attrs.ratio:"16:9",this.menuIsActive=!0},update:function(){this.updateAttributes({embedCode:this.embedCode,caption:this.caption,credits:this.credits,ratio:this.ratio}),this.hideMenu()},hideMenu:function(){this.menuIsActive=!1},deleteBlock:function(){this.$el.remove()},__:function(e){return e}}},TS=(0,o.Z)(NS,[["render",function(e,t,n,i,o,s){var a=(0,r.resolveComponent)("ContentBlockWrapper");return(0,r.openBlock)(),(0,r.createBlock)(a,{label:"Video",nodeKey:e.node.attrs.key},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",{onClick:t[0]||(t[0]=function(){return s.showMenu&&s.showMenu.apply(s,arguments)}),class:"cursor-pointer grid grid-cols-2"},[(0,r.createElementVNode)("div",{class:"font-bold",textContent:(0,r.toDisplayString)(s.title)},null,8,QE),(0,r.createElementVNode)("div",{class:"",textContent:(0,r.toDisplayString)("Ratio: "+e.node.attrs.ratio)},null,8,eS),(0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("span",{class:"capitalize",textContent:(0,r.toDisplayString)(s.__("caption")+": ")},null,8,tS),(0,r.createElementVNode)("span",{textContent:(0,r.toDisplayString)(e.node.attrs.caption?e.node.attrs.caption:"")},null,8,nS)]),(0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("span",{class:"capitalize",textContent:(0,r.toDisplayString)(s.__("credits")+": ")},null,8,rS),(0,r.createElementVNode)("span",{textContent:(0,r.toDisplayString)(e.node.attrs.credits?e.node.attrs.credits:"")},null,8,iS)])]),(0,r.withDirectives)((0,r.createElementVNode)("div",oS,[(0,r.createElementVNode)("div",sS,[(0,r.createElementVNode)("div",aS,[(0,r.createElementVNode)("div",lS,[(0,r.createElementVNode)("div",null,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1 capitalize",textContent:(0,r.toDisplayString)(s.__("embed code"))},null,8,uS),(0,r.withDirectives)((0,r.createElementVNode)("textarea",{class:"form-input form-input-bordered h-32 px-2 py-1 w-full text-sm text-90 leading-none","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.embedCode=e})},null,512),[[r.vModelText,o.embedCode]])]),(0,r.createElementVNode)("div",cS,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1 capitalize",textContent:(0,r.toDisplayString)(s.__("caption"))},null,8,dS),(0,r.withDirectives)((0,r.createElementVNode)("textarea",{class:"form-input form-input-bordered h-16 px-2 py-1 w-full text-sm text-90 leading-none","onUpdate:modelValue":t[2]||(t[2]=function(e){return o.caption=e})},null,512),[[r.vModelText,o.caption]])]),(0,r.createElementVNode)("div",fS,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1 capitalize",textContent:(0,r.toDisplayString)(s.__("credits"))},null,8,hS),(0,r.withDirectives)((0,r.createElementVNode)("input",{type:"text",class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none","onUpdate:modelValue":t[3]||(t[3]=function(e){return o.credits=e})},null,512),[[r.vModelText,o.credits]])]),(0,r.createElementVNode)("div",pS,[(0,r.createElementVNode)("label",{class:"text-sm mb-1 ml-1 capitalize",textContent:(0,r.toDisplayString)(s.__("ratio"))},null,8,mS),(0,r.withDirectives)((0,r.createElementVNode)("select",{class:"form-input form-input-bordered px-2 py-1 w-full text-sm text-90 leading-none","onUpdate:modelValue":t[4]||(t[4]=function(e){return o.ratio=e})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(o.ratioOptions,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("option",{key:e,value:e,textContent:(0,r.toDisplayString)(e)},null,8,gS)})),128))],512),[[r.vModelSelect,o.ratio]])])])]),(0,r.createElementVNode)("div",_S,[(0,r.createElementVNode)("div",vS,[(0,r.createElementVNode)("button",{type:"button",class:"btn h-9 px-3 font-normal text-80",onClick:t[5]||(t[5]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)}),textContent:(0,r.toDisplayString)(s.__("cancel"))},null,8,bS),(0,r.createElementVNode)("button",{type:"button",class:"ml-3 btn btn-default btn-primary",onClick:t[6]||(t[6]=function(e){return s.update()}),textContent:(0,r.toDisplayString)(s.__("update video"))},null,8,yS)])])]),(0,r.createElementVNode)("div",{class:"z-10 absolute top-0 left-0 w-full h-full bg-80 opacity-75",onClick:t[7]||(t[7]=function(){return s.hideMenu&&s.hideMenu.apply(s,arguments)})})],512),[[r.vShow,o.menuIsActive]])]})),_:1},8,["nodeKey"])}]]),LS=js.create({name:"videoContentBlock",group:"block",atom:!0,draggable:!0,addAttributes:function(){return{embedCode:{default:""},caption:{default:""},credits:{default:""},ratio:{default:"16:9"},key:{default:""}}},parseHTML:function(){return[{tag:"video-content-block"}]},renderHTML:function(e){return["video-content-block",Eo(e.HTMLAttributes)]},addNodeView:function(){return uu(TS)}});var RS=["textContent"],BS=["textContent"],IS={class:"fixed top-0 left-0 w-full h-full overflow-scroll py-8 z-50 flex items-center justify-center"},PS={class:"m-auto rounded-lg shadow-lg overflow-hidden z-20 w-action-fields max-w-full"},FS={class:"px-8 py-8 bg-white"},zS={class:"flex flex-col"},jS=["textContent"],VS={class:"mb-2 flex items-center justify-between text-primary"},$S={class:"flex items-center"},HS=["textContent"],WS=["onClick"],US=["onClick"],KS=["onClick"],qS={class:"relative btn btn-default btn-primary"},GS=["onChange"],ZS=["textContent"],XS={key:0,class:"h-16 w-auto"},JS={key:0,class:"h-16 w-16 flex items-center justify-center border border-primary text-primary"},YS=[(0,r.createElementVNode)("span",null,"Video",-1)],QS=["src"],eM={key:1,class:"ml-8 h-16 flex items-center"},tM=["textContent"],nM={key:1,class:"h-16 w-auto"},rM={key:0,class:"h-16 w-16 flex items-center justify-center border border-primary text-primary"},iM=[(0,r.createElementVNode)("span",null,"Video",-1)],oM=["src"],sM=["onClick"],aM={key:3},lM=["disabled","onClick","textContent"],uM={class:"grid grid-cols-2 gap-x-6 gap-y-4"},cM=["textContent"],dM=["onUpdate:modelValue"],fM=["textContent"],hM=["onUpdate:modelValue"],pM=["textContent"],mM=["onUpdate:modelValue"],gM=["textContent"],_M=["onUpdate:modelValue"],vM=["textContent"],bM=["textContent"],yM={class:"col-span-2"},wM=["textContent"],xM=["onUpdate:modelValue"],kM={class:"col-span-2"},CM=["textContent"],EM=["textContent"],SM={class:"mt-8 grid grid-cols-2 gap-8"},MM=["textContent"],AM=["value","id"],DM=["for","textContent"],OM=["textContent"],NM=["value","textContent"],TM={class:"mt-8 grid grid-cols-2 gap-8"},LM=["textContent"],RM=["value","id"],BM=["for","textContent"],IM=["textContent"],PM=["value","textContent"],FM={class:"bg-30 px-6 py-3"},zM={class:"flex items-center justify-end"},jM=["textContent"],VM=["textContent"];jv.add(Yv,kb,Gv,Zv);const $M={props:au,components:{ContentBlockWrapper:OS,FontAwesomeIcon:Hb},data:function(){return{modalIsActive:!1,slides:[],uploadingIndexes:[],mode:"",formatMode:"flexible",format:"",maxColumns:1,modeOptions:{slideshow:"Slideshow",grid:"Grid"},formatModeOptions:{flexible:"flexible",fixed:"fixed"},fixedModeOptions:["16:9","4:3","1:1","9:16","3:4","2:1","8:5"],imageDisk:"",imagePath:"",fileDisk:"",filePath:""}},computed:{title:function(){return this.node.attrs.slideCount+" Slide(s)"},slideCount:function(){return _.size(this.slides)}},methods:{initSlideText:function(e){this.$refs.textEditor[e].editor.insertHTML(this.slides[e].text)},updateSlideText:function(e){this.slides[e].text=this.$refs.textEditor[e].value},addSlide:function(){var e=String(_.random(0,999))+String(Date.now()),t=String(_.random(0,999))+String(Date.now());this.slides.push({key:e,fileInputKey:t,caption:"",credits:"",preview:"",file:"",name:"",src:"",link:"",linkTarget:"",embedCode:"",text:"",uploading:!1,uploadProgress:0})},removeSlide:function(e){for(var t=[],n=0;n0}),onClick:function(e){return s.moveUp(n)}},[(0,r.createVNode)(a,{icon:["fas","angle-up"]})],10,US),(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)({"pointer-events-none opacity-25":n>=s.slideCount-1,"cursor-pointer":n")?this.value+"

":this.value},buttons:function(){var e=this.field.buttons?this.field.buttons:["bold","italic"];return _.map(e,(function(e){return"|"==e||"br"==e?e:_.camelCase(e)}))},headingLevels:function(){return this.field.headingLevels?this.field.headingLevels:[1,2,3]},alignments:function(){return this.field.alignments?this.field.alignments:["start","center","end","justify"]},alignElements:function(){return this.field.alignElements?this.field.alignElements:["heading","paragraph"]},defaultAlignment:function(){return this.field.defaultAlignment?this.field.defaultAlignment:"left"},cssProps:function(){return{"--text-align":this.defaultAlignment}},htmlTheme:function(){return this.field.htmlTheme?this.field.htmlTheme:""},tableIsActive:function(){return this.buttons.indexOf("table")>-1&&(!!this.editor&&this.editor.isActive("table"))},saveAsJson:function(){return!!this.field.saveAsJson&&this.field.saveAsJson}},methods:{updateValue:function(e){this.value=e},switchMode:function(){"html"==this.mode?(this.editor.commands.setContent(this.htmlModeValue),this.updateValue(this.editor.getHTML()),this.mode="editor"):(this.htmlModeValue=UE()(this.editor.getHTML()),this.mode="html")}},mounted:function(){this.placeholder=this.field.placeholder?this.field.placeholder:this.field.extraAttributes?this.field.extraAttributes.placeholder:"",this.field.imageSettings&&this.field.imageSettings.path&&(this.imagePath=this.field.imageSettings.path),this.field.imageSettings&&this.field.imageSettings.disk&&(this.imageDisk=this.field.imageSettings.disk),this.field.fileSettings&&this.field.fileSettings.path&&(this.filePath=this.field.fileSettings.path),this.field.fileSettings&&this.field.fileSettings.disk&&(this.fileDisk=this.field.fileSettings.disk);var e=[Ud,_u,xu,zu,Lu,YE.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{"data-key":{default:"bogus"}})}}),LS,WM,dd.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{"tt-mode":{default:"url"},class:String,rel:String,title:String,download:String})}}),_d,yd,wd,vd,bd,xd.configure({levels:this.headingLevels}).extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{dir:String})}}),fu.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{dir:String})}}),bu.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{dir:String})}}),Ru,fd,pd.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{dir:String})}}),tm,em.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{dir:String,data:String})}}),Xp.configure({resizable:!0}),Jp,Yp,Qp,kd.configure({types:this.alignElements,alignments:this.alignments,defaultAlignment:this.defaultAlignment}),Wd,cu,MC,nm.configure({placeholder:this.placeholder}),im.extend({addAttributes:function(){var e;return KM(KM({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{},{"tt-mode":{default:"file"},"tt-link-url":{default:""},"tt-link-target":{default:""},"tt-link-mode":{default:"url"},class:String,title:String,alt:String})}}),am];this.buttons.includes("codeBlock")&&this.field.syntaxHighlighting?e.push(Ou.extend({addNodeView:function(){return uu(Vw)}}).configure({lowlight:HE})):this.buttons.includes("codeBlock")&&e.push(Eu);var t=this;this.editor=new nu({extensions:e,content:this.contentWithTrailingParagraph,onCreate:function(){try{var e=JSON.parse(t.value);this.commands.setContent(e)}catch(e){}},onUpdate:function(){if(t.saveAsJson){var e=this.getJSON();t.updateValue(JSON.stringify(e.content))}else t.updateValue(this.getHTML())}})},beforeDestroy:function(){this.editor.destroy()}};var ZM=n(7936),XM={insert:"head",singleton:!1};Pw()(ZM.Z,XM);ZM.Z.locals;const JM=(0,o.Z)(GM,[["render",function(e,t,n,i,o,s){var h=(0,r.resolveComponent)("heading-buttons"),p=(0,r.resolveComponent)("link-button"),m=(0,r.resolveComponent)("image-button"),g=(0,r.resolveComponent)("placeholder-block-button"),_=(0,r.resolveComponent)("content-block-button"),v=(0,r.resolveComponent)("text-align-buttons"),b=(0,r.resolveComponent)("rtl-button"),y=(0,r.resolveComponent)("history-buttons"),w=(0,r.resolveComponent)("base-button"),x=(0,r.resolveComponent)("normal-button"),k=(0,r.resolveComponent)("table-buttons"),C=(0,r.resolveComponent)("editor-content"),E=(0,r.resolveComponent)("edit-html"),S=(0,r.resolveComponent)("default-field");return(0,r.openBlock)(),(0,r.createBlock)(S,{field:n.field,errors:e.errors,"full-width-content":!0,"show-help-text":e.showHelpText},{field:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",a,[(0,r.createElementVNode)("div",l,[(0,r.createElementVNode)("div",u,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.buttons,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{key:"button-"+t,class:(0,r.normalizeClass)({"inline-block":"br"!=t})},["|"==t?((0,r.openBlock)(),(0,r.createElementBlock)("button",c)):"br"==t?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[],64)):"heading"==t?((0,r.openBlock)(),(0,r.createBlock)(h,{key:2,headingLevels:s.headingLevels,mode:o.mode,editor:o.editor},null,8,["headingLevels","mode","editor"])):"link"==t?((0,r.openBlock)(),(0,r.createBlock)(p,{key:3,editor:o.editor,button:t,field:n.field,mode:o.mode,fileDisk:o.fileDisk,filePath:o.filePath},null,8,["editor","button","field","mode","fileDisk","filePath"])):"image"==t?((0,r.openBlock)(),(0,r.createBlock)(m,{key:4,editor:o.editor,button:t,field:n.field,mode:o.mode,imageDisk:o.imageDisk,imagePath:o.imagePath},null,8,["editor","button","field","mode","imageDisk","imagePath"])):"placeholderBlock"==t?((0,r.openBlock)(),(0,r.createBlock)(g,{key:5,editor:o.editor,button:t,field:n.field,mode:o.mode},null,8,["editor","button","field","mode"])):"contentBlock"==t?((0,r.openBlock)(),(0,r.createBlock)(_,{key:6,editor:o.editor,button:t,field:n.field,mode:o.mode,imageDisk:o.imageDisk,imagePath:o.imagePath},null,8,["editor","button","field","mode","imageDisk","imagePath"])):"textAlign"==t?((0,r.openBlock)(),(0,r.createBlock)(v,{key:7,editor:o.editor,mode:o.mode,alignments:s.alignments,alignElements:s.alignElements,defaultAlignment:s.defaultAlignment},null,8,["editor","mode","alignments","alignElements","defaultAlignment"])):"rtl"==t?((0,r.openBlock)(),(0,r.createBlock)(b,{key:8,editor:o.editor,mode:o.mode},null,8,["editor","mode"])):"history"==t?((0,r.openBlock)(),(0,r.createBlock)(y,{key:9,editor:o.editor,mode:o.mode},null,8,["editor","mode"])):"editHtml"==t?((0,r.openBlock)(),(0,r.createBlock)(w,{key:10,isActive:"html"==o.mode,clickMethod:s.switchMode,icon:["fas","file-code"],title:e.__("edit html")},null,8,["isActive","clickMethod","title"])):((0,r.openBlock)(),(0,r.createBlock)(x,{key:11,editor:o.editor,button:t,mode:o.mode},null,8,["editor","button","mode"]))],2)})),128))]),s.tableIsActive?((0,r.openBlock)(),(0,r.createElementBlock)("div",d,[(0,r.createVNode)(k,{editor:o.editor},null,8,["editor"])])):(0,r.createCommentVNode)("",!0)]),(0,r.withDirectives)((0,r.createElementVNode)("div",{class:"nova-tiptap-editor mt-4 form-input form-input-bordered w-full pt-2 pb-2",style:(0,r.normalizeStyle)(s.cssProps)},[(0,r.createVNode)(C,{editor:o.editor},null,8,["editor"])],4),[[r.vShow,"editor"==o.mode]]),(0,r.withDirectives)((0,r.createElementVNode)("div",f,[(0,r.createVNode)(E,{theme:s.htmlTheme,modelValue:o.htmlModeValue,"onUpdate:modelValue":t[0]||(t[0]=function(e){return o.htmlModeValue=e})},null,8,["theme","modelValue"])],512),[[r.vShow,"html"==o.mode]])])]})),_:1},8,["field","errors","show-help-text"])}]]);window.pretty=n(7994),window._=n(6486),window.axios=n(9669),Nova.booting((function(e,t){e.component("detail-tiptap",s),e.component("form-tiptap",JM)}))},8293:(e,t,n)=>{!function(e){"use strict";var t=e.Pos,n="http://www.w3.org/2000/svg";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function i(t){t.diffOutOfDate&&(t.diff=O(t.orig.getValue(),t.edit.getValue(),t.mv.options.ignoreWhitespace),t.chunks=N(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}r.prototype={constructor:r,init:function(t,n,r){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=e(t,$({value:n,readOnly:!this.mv.options.allowEditingOriginals},$(r))),"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new q(this.edit)),this.orig.state.trackAlignable=new q(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.lockButton.setAttribute("aria-label",this.lockButton.title),this.orig.state.diffViews=[this];var i=r.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(i)&&(i=[i]),this.classes.classLocation=i,this.diff=O(D(n),D(r.value),this.mv.options.ignoreWhitespace),this.chunks=N(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=!1!==r.showDifferences},registerEvents:function(e){this.forceUpdate=s(this),c(this,!0,!1),a(this,e)},setShowDifferences:function(e){(e=!1!==e)!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var o=!1;function s(t){var n,r={from:0,to:0,marked:[]},s={from:0,to:0,marked:[]},a=!1;function u(e){o=!0,a=!1,"full"==e&&(t.svg&&j(t.svg),t.copyButtons&&j(t.copyButtons),f(t.edit,r.marked,t.classes),f(t.orig,s.marked,t.classes),r.from=r.to=s.from=s.to=0),i(t),t.showDifferences&&(h(t.edit,t.diff,r,DIFF_INSERT,t.classes),h(t.orig,t.diff,s,DIFF_DELETE,t.classes)),"align"==t.mv.options.connect&&w(t),g(t),null!=t.needsScrollSync&&l(t,t.needsScrollSync),o=!1}function c(e){o||(t.dealigned=!0,d(e))}function d(e){o||a||(clearTimeout(n),!0===e&&(a=!0),n=setTimeout(u,!0===e?20:250))}function p(e,n){t.diffOutOfDate||(t.diffOutOfDate=!0,r.from=r.to=s.from=s.to=0),c(n.text.length-1!=n.to.line-n.from.line)}function m(){t.diffOutOfDate=!0,t.dealigned=!0,u("full")}return t.edit.on("change",p),t.orig.on("change",p),t.edit.on("swapDoc",m),t.orig.on("swapDoc",m),"align"==t.mv.options.connect&&(e.on(t.edit.state.trackAlignable,"realign",c),e.on(t.orig.state.trackAlignable,"realign",c)),t.edit.on("viewportChange",(function(){d(!1)})),t.orig.on("viewportChange",(function(){d(!1)})),u(),u}function a(e,t){e.edit.on("scroll",(function(){l(e,!0)&&g(e)})),e.orig.on("scroll",(function(){l(e,!1)&&g(e),t&&l(t,!0)&&g(t)}))}function l(e,t){if(e.diffOutOfDate)return e.lockScroll&&null==e.needsScrollSync&&(e.needsScrollSync=t),!1;if(e.needsScrollSync=null,!e.lockScroll)return!0;var n,r,i=+new Date;if(t?(n=e.edit,r=e.orig):(n=e.orig,r=e.edit),n.state.scrollSetBy==e&&(n.state.scrollSetAt||0)+250>i)return!1;var o=n.getScrollInfo();if("align"==e.mv.options.connect)g=o.top;else{var s,a,l=.5*o.clientHeight,c=o.top+l,d=n.lineAtHeight(c,"local"),f=R(e.chunks,d,t),h=u(n,t?f.edit:f.orig),p=u(r,t?f.orig:f.edit),m=(c-h.top)/(h.bot-h.top),g=p.top-l+m*(p.bot-p.top);if(g>o.top&&(a=o.top/l)<1)g=g*a+o.top*(1-a);else if((s=o.height-o.clientHeight-o.top)s&&(a=s/l)<1&&(g=g*a+(_.height-_.clientHeight-s)*(1-a))}}return r.scrollTo(o.left,g),r.state.scrollSetAt=i,r.state.scrollSetBy=e,!0}function u(e,t){var n=t.after;return null==n&&(n=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(n,"local")}}function c(t,n,r){t.lockScroll=n,n&&0!=r&&l(t,DIFF_INSERT)&&g(t),(n?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function d(e,t,n){for(var r=n.classLocation,i=0;i20||n.from-o.to>20?(f(e,n.marked,i),m(e,t,r,n.marked,o.from,o.to,i),n.from=o.from,n.to=o.to):(o.fromn.to&&(m(e,t,r,n.marked,n.to,o.to,i),n.to=o.to))}))}function p(e,t,n,r,i,o){for(var s=n.classLocation,a=e.getLineHandle(t),l=0;ly&&(m&&(f(h,y),m=!1),h=w)}else if(m=!0,v==r){var x=H(l,b,!0),k=Z(u,l),C=G(c,x);X(k,C)||i.push(e.markText(k,C,{className:d})),l=x}}m&&f(h,l.line+1)}function g(e){if(e.showDifferences){if(e.svg){j(e.svg);var t=e.gap.offsetWidth;V(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&j(e.copyButtons);for(var n=e.edit.getViewport(),r=e.orig.getViewport(),i=e.mv.wrap.getBoundingClientRect().top,o=i-e.edit.getScrollerElement().getBoundingClientRect().top+e.edit.getScrollInfo().top,s=i-e.orig.getScrollerElement().getBoundingClientRect().top+e.orig.getScrollInfo().top,a=0;a=n.from&&l.origFrom<=r.to&&l.origTo>=r.from&&C(e,l,s,o,t)}}}function _(e,t){for(var n=0,r=0,i=0;ie&&o.editFrom<=e)return null;if(o.editFrom>e)break;n=o.editTo,r=o.origTo}return r+(e-n)}function v(e,t,n){for(var r=e.state.trackAlignable,i=e.firstLine(),o=0,s=[],a=0;;a++){for(var l=t[a],u=l?n?l.origFrom:l.editFrom:1e9;od){o++,i--;continue e}if(f.editTo>c){if(f.editFrom<=c)continue e;break}a+=f.origTo-f.origFrom-(f.editTo-f.editFrom),s++}if(c==d-a)l[r]=d,o++;else if(c1&&r.push(k(e[s],n[s],l))}}function k(e,t,n){var r=!0;t>e.lastLine()&&(t--,r=!1);var i=document.createElement("div");return i.className="CodeMirror-merge-spacer",i.style.height=n+"px",i.style.minWidth="1px",e.addLineWidget(t,i,{height:n,above:r,mergeSpacer:!0,handleMouseEvents:!0})}function C(e,t,r,i,o){var s="left"==e.type,a=e.orig.heightAtLine(t.origFrom,"local",!0)-r;if(e.svg){var l=a,u=e.edit.heightAtLine(t.editFrom,"local",!0)-i;if(s){var c=l;l=u,u=c}var d=e.orig.heightAtLine(t.origTo,"local",!0)-r,f=e.edit.heightAtLine(t.editTo,"local",!0)-i;s&&(c=d,d=f,f=c);var h=" C "+o/2+" "+u+" "+o/2+" "+l+" "+(o+2)+" "+l,p=" C "+o/2+" "+d+" "+o/2+" "+f+" -1 "+f;V(e.svg.appendChild(document.createElementNS(n,"path")),"d","M -1 "+u+h+" L "+(o+2)+" "+d+p+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(z("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),g=e.mv.options.allowEditingOriginals;if(m.title=e.edit.phrase(g?"Push to left":"Revert chunk"),m.chunk=t,m.style.top=(t.origTo>t.origFrom?a:e.edit.heightAtLine(t.editFrom,"local")-i)+"px",m.setAttribute("role","button"),m.setAttribute("tabindex","0"),m.setAttribute("aria-label",m.title),g){var _=e.edit.heightAtLine(t.editFrom,"local")-i,v=e.copyButtons.appendChild(z("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));v.title="Push to right",v.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},v.style.top=_+"px","right"==e.type?v.style.left="2px":v.style.right="2px",v.setAttribute("role","button"),v.setAttribute("tabindex","0"),v.setAttribute("aria-label",v.title)}}}function E(e,n,r,i){if(!e.diffOutOfDate){var o=i.origTo>r.lastLine()?t(i.origFrom-1):t(i.origFrom,0),s=t(i.origTo,0),a=i.editTo>n.lastLine()?t(i.editFrom-1):t(i.editFrom,0),l=t(i.editTo,0),u=e.mv.options.revertChunk;u?u(e.mv,r,o,s,n,a,l):n.replaceRange(r.getRange(o,s),a,l)}}var S,M=e.MergeView=function(t,n){if(!(this instanceof M))return new M(t,n);this.options=n;var i=n.origLeft,o=null==n.origRight?n.orig:n.origRight,s=null!=i,a=null!=o,l=1+(s?1:0)+(a?1:0),u=[],c=this.left=null,d=this.right=null,f=this;if(s){c=this.left=new r(this,"left");var h=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");u.push(h),u.push(A(c))}var p=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(u.push(p),a){d=this.right=new r(this,"right"),u.push(A(d));var m=z("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");u.push(m)}(a?m:p).className+=" CodeMirror-merge-pane-rightmost",u.push(z("div",null,null,"height: 0; clear: both;"));var _=this.wrap=t.appendChild(z("div",u,"CodeMirror-merge CodeMirror-merge-"+l+"pane"));this.edit=e(p,$(n)),c&&c.init(h,i,n),d&&d.init(m,o,n),n.collapseIdentical&&this.editor().operation((function(){F(f,n.collapseIdentical)})),"align"==n.connect&&(this.aligners=[],w(this.left||this.right,!0)),c&&c.registerEvents(d),d&&d.registerEvents(c);var v=function(){c&&g(c),d&&g(d)};e.on(window,"resize",v);var b=setInterval((function(){for(var t=_.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(b),e.off(window,"resize",v))}),5e3)};function A(t){var r=t.lockButton=z("div",null,"CodeMirror-merge-scrolllock");r.setAttribute("role","button"),r.setAttribute("tabindex","0");var i=z("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",(function(){c(t,!t.lockScroll)})),e.on(r,"keyup",(function(e){"Enter"===e.key&&c(t,!t.lockScroll)}));var o=[i];if(!1!==t.mv.options.revertButtons){function a(e){var n=e.target||e.srcElement;n.chunk&&("CodeMirror-merge-copy-reverse"!=n.className?E(t,t.edit,t.orig,n.chunk):E(t,t.orig,t.edit,n.chunk))}t.copyButtons=z("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",a),e.on(t.copyButtons,"keyup",(function(e){"Enter"===e.key&&a(e)})),o.unshift(t.copyButtons)}if("align"!=t.mv.options.connect){var s=document.createElementNS&&document.createElementNS(n,"svg");s&&!s.createSVGRect&&(s=null),t.svg=s,s&&o.push(s)}return t.gap=z("div",o,"CodeMirror-merge-gap")}function D(e){return"string"==typeof e?e:e.getValue()}function O(e,t,n){S||(S=new diff_match_patch);for(var r=S.diff_main(e,t),i=0;id&&(a&&n.push({origFrom:i,origTo:f,editFrom:r,editTo:d}),r=p,i=m)}else H(u==DIFF_INSERT?o:s,l[1])}return(r<=o.line||i<=s.line)&&n.push({origFrom:i,origTo:s.line+1,editFrom:r,editTo:o.line+1}),n}function T(e,t){if(t==e.length-1)return!0;var n=e[t+1][1];return!(1==n.length&&t1||t==e.length-3)&&10==n.charCodeAt(0))}function L(e,t){if(0==t)return!0;var n=e[t-1][1];return 10==n.charCodeAt(n.length-1)&&(1==t||10==(n=e[t-2][1]).charCodeAt(n.length-1))}function R(e,t,n){for(var r,i,o,s,a=0;at?(i=l.editFrom,s=l.origFrom):c>t&&(i=l.editTo,s=l.origTo)),c<=t?(r=l.editTo,o=l.origTo):u<=t&&(r=l.editFrom,o=l.origFrom)}return{edit:{before:r,after:i},orig:{before:o,after:s}}}function B(n,r,i){n.addLineClass(r,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title=n.phrase("Identical text collapsed. Click to expand.");var s=n.markText(t(r,0),t(i-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});function a(){s.clear(),n.removeLineClass(r,"wrap","CodeMirror-merge-collapsed-line")}return s.explicitlyCleared&&a(),e.on(o,"click",a),s.on("clear",a),e.on(o,"click",a),{mark:s,clear:a}}function I(e,t){var n=[];function r(){for(var e=0;e=0&&at){var c=[{line:l,cm:r}];e.left&&c.push({line:_(l,e.left.chunks),cm:e.left.orig}),e.right&&c.push({line:_(l,e.right.chunks),cm:e.right.orig});var d=I(u,c);e.options.onCollapse&&e.options.onCollapse(e,l,u,d)}}}function z(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild)}function V(e){for(var t=1;t0?e:t}function X(e,t){return e.line==t.line&&e.ch==t.ch}function J(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],o=(n?i.origTo:i.editTo)-1;if(ot)return o}}function Q(t,n){var r=null,o=t.state.diffViews,s=t.getCursor().line;if(o)for(var a=0;ar:c0)break}this.signal(),this.alignable.splice(n,0,e,t)},find:function(e){for(var t=0;t-1){var u=this.alignable[o+1];u==U?this.alignable.splice(o,2):this.alignable[o+1]=u&~U}s>-1&&n&&this.set(e+n,U)}},e.commands.goNextDiff=function(e){return Q(e,1)},e.commands.goPrevDiff=function(e){return Q(e,-1)}}(n(4631))},790:(e,t,n)=>{!function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e.unicode&&(n+="u"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",n)}function r(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n2&&c.token&&"string"!=typeof c.token){for(var h=2;h-1)return e.Pass;var s=r.indent.length-1,a=t[r.state];e:for(;;){for(var u=0;u2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,l=!0);var k=b&&(u||f&&(null==x||x<12.11)),C=n||s&&a>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,M=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return A(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function V(e,t){for(var n=0;n=t)return r+Math.min(s,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function Z(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function se(e){return e.charCodeAt(0)>=768&&oe.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ce=null;function de(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,d=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function xe(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){_e(this,e,t)}}function ke(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){ke(e),Ce(e)}function Me(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var De,Oe,Ne=function(){if(s&&a<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Te(e){if(null==De){var t=O("span","​");D(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=De?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Le(e){if(null!=Oe)return Oe;var t=D(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return A(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Re,Be=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(Re=O("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Fe=null;function ze(e){if(null!=Fe)return Fe;var t=D(e,O("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return Fe=Math.abs(n.left-r.left)>1}var je={},Ve={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function He(e,t){Ve[e]=t}function We(e){if("string"==typeof e&&Ve.hasOwnProperty(e))e=Ve[e];else if(e&&"string"==typeof e.name&&Ve.hasOwnProperty(e.name)){var t=Ve[e.name];"string"==typeof t&&(t={name:t}),(e=ee(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=We(t);var n=je[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(Ke.hasOwnProperty(t.name)){var i=Ke[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var Ke={};function qe(e,t){F(t,Ke.hasOwnProperty(e)?Ke[e]:Ke[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ze(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ye(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?st(n,Ye(e,n).text.length):pt(t,Ye(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?st(e.line,t):n<0?st(e.line,0):e}function mt(e,t){for(var n=[],r=0;r=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.post},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var gt=function(e,t){this.state=e,this.lookAhead=t},_t=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,r){var i=[e.state.modeGen],o={};Mt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],l=1,u=0;n.state=!0,Mt(e,t.text,a.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=vt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new _t(r,!0,t);var o=At(e,t,n),s=o>r.first&&Ye(r,o-1).stateAfter,a=s?_t.fromSaved(r,s,o):new _t(r,Xe(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}_t.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},_t.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},_t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_t.fromSaved=function(e,t,n){return t instanceof gt?new _t(e,Ge(e.mode,t.state),n,t.lookAhead):new _t(e,Ge(e.mode,t),n)},_t.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};var Ct=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Et(e,t,n,r){var i,o,s=e.doc,a=s.mode,l=Ye(s,(t=ht(s,t)).line),u=yt(e,t.line,n),c=new Je(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(a=!1,s&&wt(e,t,r,d.pos),d.pos=t.length,l=null):l=St(kt(n,d,r.state,f),o),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!a||c!=l){for(;us;--a){if(a<=o.first)return o.first;var l=Ye(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof gt?u.lookAhead:0)<=o.modeFrontier))return a;var c=z(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function Dt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Ye(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Rt(s,o.from,a?null:o.to))}}return r}function zt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from0&&a)for(var b=0;b0)){var c=[l,1],d=at(u.from,a.from),f=at(u.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&c.push({from:u.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Ht(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Yt(e,t,n,r,i){var o=Ye(e,t),s=Nt&&o.markedSpans;if(s)for(var a=0;a=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.to,n)>=0:at(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.from,r)<=0:at(u.from,r)<0)))return!0}}}function Qt(e){for(var t;t=Zt(e);)e=t.find(-1,!0).line;return e}function en(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function tn(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function nn(e,t){var n=Ye(e,t),r=Qt(n);return n==r?t:nt(r)}function rn(e,t){if(t>e.lastLine())return t;var n,r=Ye(e,t);if(!on(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return nt(r)+1}function on(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var cn=function(e,t,n){this.text=e,Wt(this,t),this.height=n?n(this):1};function dn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ht(e),Wt(e,n);var i=r?r(e):1;i!=e.height&&tt(e,i)}function fn(e){e.parent=null,Ht(e)}cn.prototype.lineNo=function(){return nt(this)},xe(cn);var hn={},pn={};function mn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:hn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,s=void 0;r.pos=0,r.addToken=vn,Le(e.display.measure)&&(s=he(o,e.doc.direction))&&(r.addToken=yn(r.addToken,s)),r.map=[],xn(o,r,bt(e,o,t!=e.display.externalMeasured&&nt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=B(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=B(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Te(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=B(r.pre.className,r.textClass||"")),r}function _n(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?bn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));s&&a<9?u.appendChild(O("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var _=void 0;if("\t"==p[0]){var v=e.cm.options.tabSize,b=v-e.col%v;(_=u.appendChild(O("span",Z(b),"cm-tab"))).setAttribute("role","presentation"),_.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((_=u.appendChild(O("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((_=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),s&&a<9?u.appendChild(O("span",[_])):u.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),s&&a<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||l){var y=n||"";r&&(y+=r),i&&(y+=i);var w=O("span",[u],y,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return e.content.appendChild(w)}e.content.appendChild(u)}}function bn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,s,a,l);e(n,r.slice(0,d.to-u),i,o,null,a,l),o=null,r=r.slice(d.to-u),u=d.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var s,a,l,u,c,d,f,h=i.length,p=0,m=1,g="",_=0;;){if(_==p){l=u=c=a="",f=null,d=null,_=1/0;for(var v=[],b=void 0,y=0;yp||x.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&_>w.to&&(_=w.to,u=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==_&&(b||(b=[])).push(x.endStyle,w.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var k in x.attributes)(f||(f={}))[k]=x.attributes[k];x.collapsed&&(!d||qt(d.marker,x)<0)&&(d=w)}else w.from>p&&_>w.from&&(_=w.from)}if(b)for(var C=0;C=h)break;for(var S=Math.min(h,_);;){if(g){var M=p+g.length;if(!d){var A=M>S?g.slice(0,S-p):g;t.addToken(t,A,s?s+l:l,c,p+A.length==_?u:"",a,f)}if(M>=S){g=g.slice(S-p),p=S;break}p=M,c=""}g=i.slice(o,o=n[m++]),s=mn(n[m++],t.cm.options)}}else for(var D=1;D2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function er(e,t){var n=nt(t=Qt(t)),r=e.display.externalMeasured=new kn(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,D(e.display.lineMeasure,i.pre),r}function tr(e,t,n,r){return ir(e,rr(e,t),n,r)}function nr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-a)-1,t>=l&&(s="right")),null!=i){if(r=e[u+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],s="left";if("right"==n&&i==l-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function ur(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&se(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Nr(e.display),top:p.top,bottom:p.bottom}:sr}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,_=(m+g)/2,v=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(e,t,n){return s(n?e-1:e,1==a[t].level!=n)}var d=de(a,l,u),f=ce,h=c(l,d,"before"==u);return null!=f&&(h.other=c(l,f,"before"!=u)),h}function wr(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Ye(e.doc,t.line),i=an(r)+Kn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=st(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function kr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=rt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Ye(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=Ye(r,i);;){var a=Mr(e,s,i,t,n),l=Jt(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==i)return u;s=Ye(r,i=u.line)}}function Cr(e,t,n,r){r-=gr(t);var i=t.text.length,o=le((function(t){return ir(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=le((function(t){return ir(e,n,t).top>r}),o,i)}}function Er(e,t,n,r){return n||(n=rr(e,t)),Cr(e,t,n,_r(e,t,ir(e,n,r),"line").top)}function Sr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Mr(e,t,n,r,i){i-=an(t);var o=rr(e,t),s=gr(t),a=0,l=t.text.length,u=!0,c=he(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Dr:Ar)(e,t,n,o,c,r,i);a=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,h,p=null,m=null,g=le((function(t){var n=ir(e,o,t);return n.top+=s,n.bottom+=s,!!Sr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),a,l),_=!1;if(m){var v=r-m.left=y.bottom?1:0}return xr(n,g=ae(t.text,g,1),h,_,r-f)}function Ar(e,t,n,r,i,o,s){var a=le((function(a){var l=i[a],u=1!=l.level;return Sr(yr(e,st(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,s,!0)}),0,i.length-1),l=i[a];if(a>0){var u=1!=l.level,c=yr(e,st(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Sr(c,o,s,!0)&&c.top>s&&(l=i[a-1])}return l}function Dr(e,t,n,r,i,o,s){var a=Cr(e,t,r,s),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||h.to<=l)){var p=ir(e,r,1!=h.level?Math.min(u,h.to)-1:Math.max(l,h.from)).right,m=pm)&&(c=h,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==or){or=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(O("br"));or.appendChild(document.createTextNode("x"))}D(e.measure,or);var n=or.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),A(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),n=O("pre",[t],"CodeMirror-line-like");D(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Tr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(on(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s0&&(l=Ye(e.doc,u.line).text).length==u.ch){var c=z(l,l.length,e.options.tabSize)-l.length;u=st(u.line,Math.max(0,Math.round((o-Gn(e.display).left)/Nr(e.display))-c))}return u}function Pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&nn(e.doc,t)i.viewFrom?jr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)jr(e);else if(t<=i.viewFrom){var o=Vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):jr(e)}else if(n>=i.viewTo){var s=Vr(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):jr(e)}else{var a=Vr(e,t,t,-1),l=Vr(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Cn(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):jr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Pr(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==V(s,n)&&s.push(n)}}}function jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vr(e,t,n,r){var i,o=Pr(e,t),s=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l0){if(o==s.length-1)return null;i=a+s[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;nn(e.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function $r(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Cn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Cn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Pr(e,n)))),r.viewTo=n}function Hr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?s:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Gr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),s=Gn(e.display),a=s.left,l=Math.max(r.sizerWidth,Xn(e)-r.sizer.offsetLeft)-s.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,s,d=Ye(i,t),f=d.text.length;function h(n,r){return br(e,st(t,n),"div",d,r)}function p(t,n,r){var i=Er(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=he(d,i.direction);return ue(m,n||0,null==r?f:r,(function(e,t,i,d){var g="ltr"==i,_=h(e,g?"left":"right"),v=h(t-1,g?"right":"left"),b=null==n&&0==e,y=null==r&&t==f,w=0==d,x=!m||d==m.length-1;if(v.top-_.top<=3){var k=(u?y:b)&&x,C=(u?b:y)&&w?a:(g?_:v).left,E=k?l:(g?v:_).right;c(C,_.top,E-C,_.bottom)}else{var S,M,A,D;g?(S=u&&b&&w?a:_.left,M=u?l:p(e,i,"before"),A=u?a:p(t,i,"after"),D=u&&y&&x?l:v.right):(S=u?p(e,i,"before"):a,M=!u&&b&&w?l:_.right,A=!u&&y&&x?a:v.left,D=u?p(t,i,"after"):l),c(S,_.top,M-S,_.bottom),_.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Qr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Yr(e))}function Jr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Qr(e))}),100)}function Yr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Zr(e))}function Qr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||m<-.005)&&(ie.display.sizerWidth){var _=Math.ceil(f/Nr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ti(e){if(e.widgets)for(var t=0;t=s&&(o=rt(t,an(Ye(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function ri(e,t){if(!be(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=O("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Kn(e.display))+"px;\n height: "+(t.bottom-t.top+Zn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ii(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?st(t.line,t.ch+1,"before"):t,t=t.ch?st(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,a=yr(e,t),l=n&&n!=t?yr(e,n):a,u=si(e,i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(hi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(mi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return i}function oi(e,t){var n=si(e,t);null!=n.scrollTop&&hi(e,n.scrollTop),null!=n.scrollLeft&&mi(e,n.scrollLeft)}function si(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Jn(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+qn(n),l=t.topa-r;if(t.topi+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(s.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,h=Xn(e)-n.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?s.scrollLeft=0:t.lefth+f-3&&(s.scrollLeft=t.right+(p?0:10)-h),s}function ai(e,t){null!=t&&(di(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function li(e){di(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ui(e,t,n){null==t&&null==n||di(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ci(e,t){di(e),e.curOp.scrollToPos=t}function di(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,fi(e,wr(e,t.from),wr(e,t.to),t.margin))}function fi(e,t,n,r){var i=si(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ui(e,i.scrollLeft,i.scrollTop)}function hi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Wi(e,{top:t}),pi(e,t,!0),n&&Wi(e),Ii(e,100))}function pi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function mi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Zn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var _i=function(e,t,n){this.cm=n;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),me(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_i.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},_i.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_i.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_i.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new j,this.disableVert=new j},_i.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,r)}e.style.visibility="",t.set(1e3,r)},_i.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vi=function(){};function bi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;yi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ei(e),yi(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function yi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var wi={native:_i,null:vi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?mi(e,t):hi(e,t)}),e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function Ci(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ki,markArrays:null},Sn(e.curOp)}function Ei(e){var t=e.curOp;t&&An(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Fi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ai(e){e.updatedDisplay=e.mustUpdate&&$i(e.cm,e.update)}function Di(e){var t=e.cm,n=t.display;e.updatedDisplay&&ei(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=tr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Zn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=yt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,l=vt(e,o,r,!0);a&&(r.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fn)return Ii(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ti(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hr(e))return!1;Zi(e)&&(jr(e),t.dims=Tr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(i,n.viewTo)),Nt&&(o=nn(e.doc,o),s=rn(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;$r(e,o,s),n.viewOffset=an(Ye(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Hr(e);if(!a&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=ji(e);return l>4&&(n.lineDiv.style.display="none"),Ui(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Vi(u),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ii(e,400)),n.updateLineNumbers=null,!0}function Hi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ni(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Jn(e),n.top)}),t.visible=ni(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!$i(e,t))break;ei(e);var i=gi(e);Wr(e),bi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Wi(e,t){var n=new Fi(e,t);if($i(e,n)){ei(e),Hi(e,n);var r=gi(e);Wr(e),bi(e,r),qi(e,r),n.finish()}}function Ui(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function a(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(h=!1),Tn(e,f,c,n)),h&&(A(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ot(e.options,c)))),s=f.node.nextSibling}else{var p=jn(e,f,c,n);o.insertBefore(p,s)}c+=f.size}for(;s;)s=a(s)}function Ki(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",On(e,"gutterChanged",e)}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Zn(e)+"px"}function Gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",s=0;s=102&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=no(t),i=r.x,o=r.y,s=to;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,s=1);var a=e.display,u=a.scroller,h=u.scrollWidth>u.clientWidth,p=u.scrollHeight>u.clientHeight;if(i&&h||o&&p){if(o&&b&&l)e:for(var m=t.target,g=a.view;m!=u;m=m.parentNode)for(var _=0;_=0&&at(e,r.to())<=0)return n}return-1};var so=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=V(t,i);for(var o=1;o0:l>=0){var u=dt(a.from(),s.from()),c=ct(a.to(),s.to()),d=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new so(d?c:u,d?u:c))}}return new oo(t,n)}function lo(e,t){return new oo([new so(e,t||e)],0)}function uo(e){return e.text?st(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return uo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=uo(t).ch-t.to.ch),st(n,r)}function fo(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,p-1),e.insert(a.line+1,_)}On(e,"change",e,t)}function bo(e,t,n){function r(e,i,o){if(e.linked)for(var s=0;s1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function Mo(e,t,n,r){var i=e.history;i.undone.length=0;var o,s,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=So(i,i.lastOp==r)))s=X(o.changes),0==at(t.from,t.to)&&0==at(t.from,s.to)?s.to=uo(t):o.changes.push(Co(e,t));else{var l=X(i.done);for(l&&l.ranges||Oo(e.sel,i.done),o={changes:[Co(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||ve(e,"historyAdded")}function Ao(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Do(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ao(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Eo(i.undone)}function Oo(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function To(e){if(!e)return null;for(var t,n=0;n-1&&(X(a)[d]=u[d],delete u[d])}}}return r}function Io(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new so(i,t)}return new so(n||t,t)}function Po(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ho(e,new oo([Io(e.sel.primary(),t,n,i)],0),r)}function Fo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=at(d,n))&&(r<0?f<0:f>0))return Go(e,d,t,r,i)}var h=l.find(r<0?-1:1);return(r<0?u:c)&&(h=Xo(e,h,r,h.line==t.line?o:null)),h?Go(e,h,t,r,i):null}}return t}function Zo(e,t,n,r,i){var o=r||1,s=Go(e,t,n,o,i)||!i&&Go(e,t,n,o,!0)||Go(e,t,n,-o,i)||!i&&Go(e,t,n,-o,!0);return s||(e.cantEdit=!0,st(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ht(e,st(t.line-1)):null:n>0&&t.ch==(r||Ye(e,t.line)).text.length?t.line=0;--i)es(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else es(e,t)}}function es(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=fo(e,t);Mo(e,t,n,e.cm?e.cm.curOp.id:NaN),rs(e,t,n,jt(e,t));var r=[];bo(e,(function(e,n){n||-1!=V(r,e.history)||(ls(e.history,t),r.push(e.history)),rs(e,t,null,jt(e,t))}))}}function ts(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--h){var p=f(h);if(p)return p.v}}}}function ns(e,t){if(0!=t&&(e.first+=t,e.sel=new oo(J(e.sel.ranges,(function(e){return new so(st(e.anchor.line+t,e.anchor.ch),st(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:st(o,Ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qe(e,t.from,t.to),n||(n=fo(e,t)),e.cm?is(e.cm,t,r):vo(e,t,r),Wo(e,n,W),e.cantEdit&&Zo(e,st(e.firstLine(),0))&&(e.cantEdit=!1)}}function is(e,t,n){var r=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=nt(Qt(Ye(r,o.line))),r.iter(l,s.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ye(e),vo(r,t,n,Rr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=ln(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Dt(r,o.line),Ii(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?Fr(e):o.line!=s.line||1!=t.text.length||_o(e.doc,t)?Fr(e,o.line,s.line+1,u):zr(e,o.line,"text");var c=we(e,"changes"),d=we(e,"change");if(d||c){var f={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&On(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function os(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Qo(e,{from:n,to:r,text:t,origin:i})}function ss(e,t,n,r){n1||!(this.children[0]instanceof cs))){var a=[];this.collapse(a),this.children=[new cs(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=i.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Yt(e,t.line,t,n,o)||t.line!=n.line&&Yt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}o.addToHistory&&Mo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Qt(r)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&tt(r,0),Pt(r,new Rt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){on(e,t)&&tt(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Tt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ms,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Fr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)zr(u,c,"text");o.atomic&&Ko(u.doc),On(u,"markerAdded",u,o)}return o}gs.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ci(e),we(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ko(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Ei(e),this.parent&&this.parent.clear()}},gs.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Qo(this,r[l]);a?$o(this,a):this.cm&&li(this.cm)})),undo:Bi((function(){ts(this,"undo")})),redo:Bi((function(){ts(this,"redo")})),undoSelection:Bi((function(){ts(this,"undo",!0)})),redoSelection:Bi((function(){ts(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ht(this,st(n,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Wo(t.doc,lo(n,n)),f)for(var h=0;h=0;t--)os(e.doc,"",r[t].from,r[t].to,"+delete");li(e)}))}function Gs(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Zs(e,t,n){var r=Gs(e,t.ch,n);return null==r?null:new st(t.line,r,n<0?"after":"before")}function Xs(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(n,t.doc.direction);if(o){var s,a=i<0?X(o):o[0],l=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=rr(t,n);s=i<0?n.text.length-1:0;var c=ir(t,u,s).top;s=le((function(e){return ir(t,u,e).top==c}),i<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Gs(n,s,1))}else s=i<0?a.to:a.from;return new st(r,s,l)}}return new st(r,i<0?n.text.length:0,i<0?"before":"after")}function Js(e,t,n,r){var i=he(t,e.doc.direction);if(!i)return Zs(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=de(i,n.ch,n.sticky),s=i[o];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&f>=c.begin)){var h=d?"before":"after";return new st(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new st(n.line,l(e,1),"before"):new st(n.line,e,"after")};e>=0&&e0==(1!=s.level),u=a?r.begin:l(r.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,u(g)))?null:m}zs.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},zs.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},zs.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},zs.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},zs.default=b?zs.macDefault:zs.pcDefault;var Ys={selectAll:Jo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return qs(e,(function(t){if(t.empty()){var n=Ye(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new st(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),st(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Ye(e.doc,i.line-1).text;s&&(i=new st(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),st(i.line-1,s.length-1),i,"+transpose"))}n.push(new so(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ti(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(at((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?ka(e,r,t,o):Ea(e,r,t,o)}function ka(e,t,n,r){var i=e.display,o=!1,u=Li(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Jr(e)),_e(i.wrapper.ownerDocument,"mouseup",u),_e(i.wrapper.ownerDocument,"mousemove",c),_e(i.scroller,"dragstart",d),_e(i.scroller,"drop",u),o||(ke(t),r.addNew||Po(e.doc,n,null,null,r.extend),l&&!h||s&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,me(i.wrapper.ownerDocument,"mouseup",u),me(i.wrapper.ownerDocument,"mousemove",c),me(i.scroller,"dragstart",d),me(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ca(e,t,n){if("char"==n)return new so(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new so(st(t.line,0),ht(e.doc,st(t.line+1,0)));var r=n(e,t);return new so(r.from,r.to)}function Ea(e,t,n,r){s&&Jr(e);var i=e.display,o=e.doc;ke(t);var a,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new so(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new so(n,n)),n=Ir(e,t,!0,!0),l=-1;else{var d=Ca(e,n,r.unit);a=r.extend?Io(a,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Ho(o,ao(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Ho(o,ao(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):zo(o,l,a,U):(l=0,Ho(o,new oo([a],0),U),u=o.sel);var f=n;function h(t){if(0!=at(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],s=e.options.tabSize,c=z(Ye(o,n.line).text,n.ch,s),d=z(Ye(o,t.line).text,t.ch,s),h=Math.min(c,d),p=Math.max(c,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var _=Ye(o,m).text,v=q(_,h,s);h==p?i.push(new so(st(m,v),st(m,v))):_.length>v&&i.push(new so(st(m,v),st(m,q(_,p,s))))}i.length||i.push(new so(n,n)),Ho(o,ao(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,y=a,w=Ca(e,t,r.unit),x=y.anchor;at(w.anchor,x)>0?(b=w.head,x=dt(y.from(),w.anchor)):(b=w.anchor,x=ct(y.to(),w.head));var k=u.ranges.slice(0);k[l]=Sa(e,new so(ht(o,x),b)),Ho(o,ao(e,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,s=Ir(e,t,!0,"rectangle"==r.unit);if(s)if(0!=at(s,f)){e.curOp.focus=L(),h(s);var a=ni(i,o);(s.line>=a.to||s.linep.bottom?20:0;l&&setTimeout(Li(e,(function(){m==n&&(i.scroller.scrollTop+=l,g(t))})),50)}}function _(t){e.state.selectingText=!1,m=1/0,t&&(ke(t),i.input.focus()),_e(i.wrapper.ownerDocument,"mousemove",v),_e(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var v=Li(e,(function(e){0!==e.buttons&&Ae(e)?g(e):_(e)})),b=Li(e,_);e.state.selectingText=b,me(i.wrapper.ownerDocument,"mousemove",v),me(i.wrapper.ownerDocument,"mouseup",b)}function Sa(e,t){var n=t.anchor,r=t.head,i=Ye(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=he(i);if(!o)return t;var s=de(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=de(o,r.ch,r.sticky),d=c-s||(r.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new so(new st(n.line,p,m),r)}function Ma(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ke(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!we(e,n))return Ee(t);o-=a.top-s.viewOffset;for(var l=0;l=i)return ve(e,n,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),Ee(t)}}function Aa(e,t){return Ma(e,t,"gutterClick",!0)}function Da(e,t){Un(e.display,t)||Oa(e,t)||be(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function Oa(e,t){return!!we(e,"gutterContextMenu")&&Ma(e,t,"gutterContextMenu",!1)}function Na(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(e)}_a.prototype.compare=function(e,t,n){return this.time+ga>e&&0==at(t,this.pos)&&n==this.button};var Ta={toString:function(){return"CodeMirror.Init"}},La={},Ra={};function Ba(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ta&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ta,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,mo(e)}),!0),n("indentUnit",2,mo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),hr(e),Fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(st(r,o))}r++}));for(var i=n.length-1;i>=0;i--)os(e.doc,t,n[i],st(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ta&&e.refresh()})),n("specialCharPlaceholder",_n,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Na(e),Yi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ks(t),i=n!=Ta&&Ks(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Pa,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Yi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return bi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),bi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Yi(e)}),!0),n("firstLineNumber",1,Yi,!0),n("lineNumberFormatter",(function(e){return e}),Yi,!0),n("showCursorWhenSelecting",!1,Wr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Qr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ia),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wr,!0),n("singleCursorHeightPerLine",!0,Wr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ia(e,t,n){if(!t!=!(n&&n!=Ta)){var r=e.display.dragFunctions,i=t?me:_e;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Pa(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),un(e)),Br(e),Fr(e),hr(e),setTimeout((function(){return bi(e)}),100)}function Fa(e,t){var n=this;if(!(this instanceof Fa))return new Fa(e,t);this.options=t=t?F(t):{},F(La,t,!1);var r=t.value;"string"==typeof r?r=new Cs(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Fa.inputStyles[t.inputStyle](this),o=this.display=new Qi(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Na(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),za(this),Ts(),Ci(this),this.curOp.forceUpdate=!0,yo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Yr(n)}),20):Qr(this),Ra)Ra.hasOwnProperty(u)&&Ra[u](this,t[u],Ta);Zi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}me(t.scroller,"touchstart",(function(i){if(!be(e,i)&&!o(i)&&!Aa(e,i)){t.input.ensurePolled(),clearTimeout(n);var s=+new Date;t.activeTouch={start:s,moved:!1,prev:s-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new so(s,s):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(s):new so(st(s.line,0),ht(e.doc,st(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ke(n)}i()})),me(t.scroller,"touchcancel",i),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(hi(e,t.scroller.scrollTop),mi(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return io(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Se(t)},over:function(t){be(e,t)||(As(e,t),Se(t))},start:function(t){return Ms(e,t)},drop:Li(e,Ss),leave:function(t){be(e,t)||Ds(e)}};var u=t.input.getField();me(u,"keyup",(function(t){return fa.call(e,t)})),me(u,"keydown",Li(e,ca)),me(u,"keypress",Li(e,ha)),me(u,"focus",(function(t){return Yr(e,t)})),me(u,"blur",(function(t){return Qr(e,t)}))}Fa.defaults=La,Fa.optionHandlers=Ra;var ja=[];function Va(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=yt(e,t).state:n="prev");var s=e.options.tabSize,a=Ye(o,t),l=z(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==H||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?z(Ye(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/s);h;--h)f+=s,d+="\t";if(fs,l=Be(t),u=null;if(a&&r.ranges.length>1)if($a&&$a.text.join("\n")==t){if(r.ranges.length%$a.text.length==0){u=[];for(var c=0;c<$a.text.length;c++)u.push(o.splitLines($a.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=J(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=st(p.line,p.ch-n):e.state.overwrite&&!a?m=st(m.line,Math.min(Ye(o,m.line).text.length,m.ch+X(l).length)):a&&$a&&$a.lineWise&&$a.text.join("\n")==l.join("\n")&&(p=m=st(p.line,0)));var g={from:p,to:m,text:u?u[f%u.length]:l,origin:i||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};Qo(e.doc,g),On(e,"inputRead",e,g)}t&&!a&&Ka(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ua(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Ti(t,(function(){return Wa(t,n,0,null,"paste")})),!0}function Ka(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Va(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Va(e,i.head.line,"smart"));s&&On(e,"electricInput",e,i.head.line)}}}function qa(e){for(var t=[],n=[],r=0;rn&&(Va(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),s=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&zo(this.doc,r,new so(o,u[r].to()),W)}}})),getTokenAt:function(e,t){return Et(this,e,t)},getLineTokens:function(e,t){return Et(this,st(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,n=bt(this,Ye(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]o&&(e=o,i=!0),r=Ye(this.doc,e)}else r=e;return _r(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,s=(e=yr(this,ht(this.doc,e))).bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)s=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&oi(this,{left:a,top:s,right:a+t.offsetWidth,bottom:s+t.offsetHeight})},triggerOnKeyDown:Ri(ca),triggerOnKeyPress:Ri(ha),triggerOnKeyUp:fa,triggerOnMouseDown:Ri(ba),execCommand:function(e){if(Ys.hasOwnProperty(e))return Ys[e].call(null,this)},triggerElectric:Ri((function(e){Ka(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ht(this.doc,e),s=0;s0&&s(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Br(this),ve(this,"refresh",this)})),swapDoc:Ri((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,e),hr(this),this.display.input.reset(),ui(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ja(e,t,n,r,i){var o=t,s=n,a=Ye(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new st(n,t.ch,t.sticky),a=Ye(e,n))}function c(o){var s;if("codepoint"==r){var c=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))s=null;else{var d=n>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new st(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(d?2:1))),-n)}}else s=i?Js(e.cm,a,t,n):Zs(a,t,n);if(null==s){if(o||!u())return!1;t=Xs(i,e.cm,a,t.line,l)}else t=s;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var m=a.text.charAt(t.ch)||"\n",g=re(m,h)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||p||g||(g="s"),d&&d!=g){n<0&&(n=1,c(),t.sticky="after");break}if(g&&(d=g),n>0&&!c(!p))break}var _=Zo(e,t,o,s,!0);return lt(o,_)&&(_.hitSide=!0),_}function Ya(e,t,n,r){var i,o,s=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=kr(e,a,i)).outside;){if(n<0?i<=0:i>=s.height){o.hitSide=!0;break}i+=5*n}return o}var Qa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function el(e,t){var n=nr(e,t.line);if(!n||n.hidden)return null;var r=Ye(e.doc,t.line),i=Qn(n,r,t.line),o=he(r,e.doc.direction),s="left";o&&(s=de(o,t.ch)%2?"right":"left");var a=ar(i.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function tl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function nl(e,t){return t&&(e.bad=!0),e}function rl(e,t,n,r,i){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){s&&(o+=a,l&&(o+=a),s=l=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(st(r,0),st(i+1,0),u(+h));return void(p.length&&(o=p[0].find(0))&&d(Qe(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&el(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(s=st(s.line-1,Ye(r.doc,s.line-1).length)),a.ch==Ye(r.doc,a.line).text.length&&a.linei.viewTo-1)return!1;s.line==i.viewFrom||0==(e=Pr(r,s.line))?(t=nt(i.view[0].line),n=i.view[0].node):(t=nt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Pr(r,a.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=nt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(rl(r,n,u,t,l)),f=Qe(r.doc,st(t,0),st(l,Ye(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],_=Math.min(m.length,g.length);h<_&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var v=X(d),b=X(f),y=Math.min(v.length-(1==d.length?h:0),b.length-(1==f.length?h:0));ps.ch&&v.charCodeAt(v.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=v.slice(0,v.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=st(t,h),x=st(l,f.length?X(f).length-p:0);return d.length>1||d[0]||at(w,x)?(os(r.doc,d,w,x,"+input"),!0):void 0},Qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qa.prototype.reset=function(){this.forceCompositionEnd()},Qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Qa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ti(this.cm,(function(){return Fr(e.cm)}))},Qa.prototype.setUneditable=function(e){e.contentEditable="false"},Qa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Li(this.cm,Wa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Qa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Qa.prototype.onContextMenu=function(){},Qa.prototype.resetPosition=function(){},Qa.prototype.needsContentAttribute=!0;var sl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=L();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(_e(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Fa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a}function ll(e){e.off=_e,e.on=me,e.wheelEventPixels=ro,e.Doc=Cs,e.splitLines=Be,e.countColumn=z,e.findColumn=q,e.isWordChar=ne,e.Pass=H,e.signal=ve,e.Line=cn,e.changeEnd=uo,e.scrollbarModel=wi,e.Pos=st,e.cmpPos=at,e.modes=je,e.mimeModes=Ve,e.resolveMode=We,e.getMode=Ue,e.modeExtensions=Ke,e.extendMode=qe,e.copyState=Ge,e.startState=Xe,e.innerMode=Ze,e.commands=Ys,e.keyMap=zs,e.keyName=Us,e.isModifierKey=Hs,e.lookupKey=$s,e.normalizeKeyMap=Vs,e.StringStream=Je,e.SharedTextMarker=vs,e.TextMarker=gs,e.LineWidget=fs,e.e_preventDefault=ke,e.e_stopPropagation=Ce,e.e_stop=Se,e.addClass=R,e.contains=T,e.rmClass=M,e.keyNames=Bs}sl.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!be(r,e)){if(r.somethingSelected())Ha({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qa(r);Ha({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,W):(n.prevInput="",i.value=t.text.join("\n"),I(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),me(i,"input",(function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),me(i,"paste",(function(e){be(r,e)||Ua(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),me(i,"cut",o),me(i,"copy",o),me(e.scroller,"paste",(function(t){if(!Un(e,t)&&!be(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),me(e.lineSpace,"selectstart",(function(t){Un(e,t)||ke(t)})),me(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),me(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},sl.prototype.createField=function(e){this.wrapper=Za(),this.textarea=this.wrapper.firstChild},sl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},sl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ur(e);if(e.options.moveInputWithCursor){var i=yr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},sl.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},sl.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},sl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Ir(n,e),u=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Li(n,Ho)(n.doc,lo(o),W);var c,d=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=_,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&g(),C){Se(e);var m=function(){_e(window,"mouseup",m),setTimeout(_,20)};me(window,"mouseup",m)}else setTimeout(_,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function _(){if(t.contextMenuPending==_&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!s||s&&a<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Li(n,Jo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},sl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,Ba(Fa),Xa(Fa);var ul="iter insert remove copy getEditor constructor".split(" ");for(var cl in Cs.prototype)Cs.prototype.hasOwnProperty(cl)&&V(ul,cl)<0&&(Fa.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Cs.prototype[cl]));return xe(Cs),Fa.inputStyles={textarea:sl,contenteditable:Qa},Fa.defineMode=function(e){Fa.defaults.mode||"null"==e||(Fa.defaults.mode=e),$e.apply(this,arguments)},Fa.defineMIME=He,Fa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Fa.defineMIME("text/plain","null"),Fa.defineExtension=function(e,t){Fa.prototype[e]=t},Fa.defineDocExtension=function(e,t){Cs.prototype[e]=t},Fa.fromTextArea=al,ll(Fa),Fa.version="5.65.6",Fa}()},6876:(e,t,n)=>{!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,s=n.statementIndent,a=n.jsonld,l=n.json||a,u=!1!==n.trackScope,c=n.typescript,d=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function g(e,t,n){return r=e,i=n,t}function _(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=v(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&e.eat(">"))return g("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==n)return e.eat("*")?(t.tokenize=b,b(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):it(e,t,1)?(m(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==n&&e.eatWhile(d))return g("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?g("."):g("operator","operator",e.current());if(d.test(n)){e.eatWhile(d);var r=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(r)){var i=f[r];return g(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",r)}return g("variable","variable",r)}}function v(e){return function(t,n){var r,i=!1;if(a&&"@"==t.peek()&&t.match(p))return n.tokenize=_,g("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=_),g("string","string")}}function b(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=_;break}r="*"==n}return g("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=_;break}r=!r&&"\\"==n}return g("quasi","string-2",e.current())}var w="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,s=n-1;s>=0;--s){var a=e.string.charAt(s),l=w.indexOf(a);if(l>=0&&l<3){if(!i){++s;break}if(0==--i){"("==a&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(d.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--s){if(0==s)return;if(e.string.charAt(s-1)==a&&"\\"!=e.string.charAt(s-2)){s--;break}}else if(o&&!i){++s;break}}o&&!i&&(t.fatArrowAt=s)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function C(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function E(e,t){if(!u)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function S(e,t,n,r,i){var o=e.cc;for(M.state=e,M.stream=i,M.marked=null,M.cc=o,M.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?U:H)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return M.marked?M.marked:"variable"==n&&E(e,r)?"variable-2":t}}var M={state:null,column:null,marked:null,cc:null};function A(){for(var e=arguments.length-1;e>=0;e--)M.cc.push(arguments[e])}function D(){return A.apply(null,arguments),!0}function O(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function N(e){var t=M.state;if(M.marked="def",u){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=T(e,t.context);if(null!=r)return void(t.context=r)}else if(!O(e,t.localVars))return void(t.localVars=new B(e,t.localVars));n.globalVars&&!O(e,t.globalVars)&&(t.globalVars=new B(e,t.globalVars))}}function T(e,t){if(t){if(t.block){var n=T(e,t.prev);return n?n==t.prev?t:new R(n,t.vars,!0):null}return O(e,t.vars)?t:new R(t.prev,new B(e,t.vars),!1)}return null}function L(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function B(e,t){this.name=e,this.next=t}var I=new B("this",new B("arguments",null));function P(){M.state.context=new R(M.state.context,M.state.localVars,!1),M.state.localVars=I}function F(){M.state.context=new R(M.state.context,M.state.localVars,!0),M.state.localVars=null}function z(){M.state.localVars=M.state.context.vars,M.state.context=M.state.context.prev}function j(e,t){var n=function(){var n=M.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new C(r,M.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function V(){var e=M.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function $(e){function t(n){return n==e?D():";"==e||"}"==n||")"==n||"]"==n?A():D(t)}return t}function H(e,t){return"var"==e?D(j("vardef",t),Ae,$(";"),V):"keyword a"==e?D(j("form"),q,H,V):"keyword b"==e?D(j("form"),H,V):"keyword d"==e?M.stream.match(/^\s*$/,!1)?D():D(j("stat"),Z,$(";"),V):"debugger"==e?D($(";")):"{"==e?D(j("}"),F,fe,V,z):";"==e?D():"if"==e?("else"==M.state.lexical.info&&M.state.cc[M.state.cc.length-1]==V&&M.state.cc.pop()(),D(j("form"),q,H,V,Re)):"function"==e?D(Fe):"for"==e?D(j("form"),F,Be,H,z,V):"class"==e||c&&"interface"==t?(M.marked="keyword",D(j("form","class"==e?e:t),He,V)):"variable"==e?c&&"declare"==t?(M.marked="keyword",D(H)):c&&("module"==t||"enum"==t||"type"==t)&&M.stream.match(/^\s*\w/,!1)?(M.marked="keyword","enum"==t?D(tt):"type"==t?D(je,$("operator"),_e,$(";")):D(j("form"),De,$("{"),j("}"),fe,V,V)):c&&"namespace"==t?(M.marked="keyword",D(j("form"),U,H,V)):c&&"abstract"==t?(M.marked="keyword",D(H)):D(j("stat"),oe):"switch"==e?D(j("form"),q,$("{"),j("}","switch"),F,fe,V,V,z):"case"==e?D(U,$(":")):"default"==e?D($(":")):"catch"==e?D(j("form"),P,W,H,V,z):"export"==e?D(j("stat"),qe,V):"import"==e?D(j("stat"),Ze,V):"async"==e?D(H):"@"==t?D(U,H):A(j("stat"),U,$(";"),V)}function W(e){if("("==e)return D(Ve,$(")"))}function U(e,t){return G(e,t,!1)}function K(e,t){return G(e,t,!0)}function q(e){return"("!=e?A():D(j(")"),Z,$(")"),V)}function G(e,t,n){if(M.state.fatArrowAt==M.stream.start){var r=n?te:ee;if("("==e)return D(P,j(")"),ce(Ve,")"),V,$("=>"),r,z);if("variable"==e)return A(P,De,$("=>"),r,z)}var i=n?J:X;return k.hasOwnProperty(e)?D(i):"function"==e?D(Fe,i):"class"==e||c&&"interface"==t?(M.marked="keyword",D(j("form"),$e,V)):"keyword c"==e||"async"==e?D(n?K:U):"("==e?D(j(")"),Z,$(")"),V,i):"operator"==e||"spread"==e?D(n?K:U):"["==e?D(j("]"),et,V,i):"{"==e?de(ae,"}",null,i):"quasi"==e?A(Y,i):"new"==e?D(ne(n)):D()}function Z(e){return e.match(/[;\}\)\],]/)?A():A(U)}function X(e,t){return","==e?D(Z):J(e,t,!1)}function J(e,t,n){var r=0==n?X:J,i=0==n?U:K;return"=>"==e?D(P,n?te:ee,z):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?D(r):c&&"<"==t&&M.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(j(">"),ce(_e,">"),V,r):"?"==t?D(U,$(":"),i):D(i):"quasi"==e?A(Y,r):";"!=e?"("==e?de(K,")","call",r):"."==e?D(se,r):"["==e?D(j("]"),Z,$("]"),V,r):c&&"as"==t?(M.marked="keyword",D(_e,r)):"regexp"==e?(M.state.lastType=M.marked="operator",M.stream.backUp(M.stream.pos-M.stream.start-1),D(i)):void 0:void 0}function Y(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(Y):D(Z,Q)}function Q(e){if("}"==e)return M.marked="string-2",M.state.tokenize=y,D(Y)}function ee(e){return x(M.stream,M.state),A("{"==e?H:U)}function te(e){return x(M.stream,M.state),A("{"==e?H:K)}function ne(e){return function(t){return"."==t?D(e?ie:re):"variable"==t&&c?D(Ee,e?J:X):A(e?K:U)}}function re(e,t){if("target"==t)return M.marked="keyword",D(X)}function ie(e,t){if("target"==t)return M.marked="keyword",D(J)}function oe(e){return":"==e?D(V,H):A(X,$(";"),V)}function se(e){if("variable"==e)return M.marked="property",D()}function ae(e,t){return"async"==e?(M.marked="property",D(ae)):"variable"==e||"keyword"==M.style?(M.marked="property","get"==t||"set"==t?D(le):(c&&M.state.fatArrowAt==M.stream.start&&(n=M.stream.match(/^\s*:\s*/,!1))&&(M.state.fatArrowAt=M.stream.pos+n[0].length),D(ue))):"number"==e||"string"==e?(M.marked=a?"property":M.style+" property",D(ue)):"jsonld-keyword"==e?D(ue):c&&L(t)?(M.marked="keyword",D(ae)):"["==e?D(U,he,$("]"),ue):"spread"==e?D(K,ue):"*"==t?(M.marked="keyword",D(ae)):":"==e?A(ue):void 0;var n}function le(e){return"variable"!=e?A(ue):(M.marked="property",D(Fe))}function ue(e){return":"==e?D(K):"("==e?A(Fe):void 0}function ce(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var s=M.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),D((function(n,r){return n==t||r==t?A():A(e)}),r)}return i==t||o==t?D():n&&n.indexOf(";")>-1?A(e):D($(t))}return function(n,i){return n==t||i==t?D():A(e,r)}}function de(e,t,n){for(var r=3;r"),_e):"quasi"==e?A(we,Ce):void 0}function ve(e){if("=>"==e)return D(_e)}function be(e){return e.match(/[\}\)\]]/)?D():","==e||";"==e?D(be):A(ye,be)}function ye(e,t){return"variable"==e||"keyword"==M.style?(M.marked="property",D(ye)):"?"==t||"number"==e||"string"==e?D(ye):":"==e?D(_e):"["==e?D($("variable"),pe,$("]"),ye):"("==e?A(ze,ye):e.match(/[;\}\)\],]/)?void 0:D()}function we(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(we):D(_e,xe)}function xe(e){if("}"==e)return M.marked="string-2",M.state.tokenize=y,D(we)}function ke(e,t){return"variable"==e&&M.stream.match(/^\s*[?:]/,!1)||"?"==t?D(ke):":"==e?D(_e):"spread"==e?D(ke):A(_e)}function Ce(e,t){return"<"==t?D(j(">"),ce(_e,">"),V,Ce):"|"==t||"."==e||"&"==t?D(_e):"["==e?D(_e,$("]"),Ce):"extends"==t||"implements"==t?(M.marked="keyword",D(_e)):"?"==t?D(_e,$(":"),_e):void 0}function Ee(e,t){if("<"==t)return D(j(">"),ce(_e,">"),V,Ce)}function Se(){return A(_e,Me)}function Me(e,t){if("="==t)return D(_e)}function Ae(e,t){return"enum"==t?(M.marked="keyword",D(tt)):A(De,he,Te,Le)}function De(e,t){return c&&L(t)?(M.marked="keyword",D(De)):"variable"==e?(N(t),D()):"spread"==e?D(De):"["==e?de(Ne,"]"):"{"==e?de(Oe,"}"):void 0}function Oe(e,t){return"variable"!=e||M.stream.match(/^\s*:/,!1)?("variable"==e&&(M.marked="property"),"spread"==e?D(De):"}"==e?A():"["==e?D(U,$("]"),$(":"),Oe):D($(":"),De,Te)):(N(t),D(Te))}function Ne(){return A(De,Te)}function Te(e,t){if("="==t)return D(K)}function Le(e){if(","==e)return D(Ae)}function Re(e,t){if("keyword b"==e&&"else"==t)return D(j("form","else"),H,V)}function Be(e,t){return"await"==t?D(Be):"("==e?D(j(")"),Ie,V):void 0}function Ie(e){return"var"==e?D(Ae,Pe):"variable"==e?D(Pe):A(Pe)}function Pe(e,t){return")"==e?D():";"==e?D(Pe):"in"==t||"of"==t?(M.marked="keyword",D(U,Pe)):A(U,Pe)}function Fe(e,t){return"*"==t?(M.marked="keyword",D(Fe)):"variable"==e?(N(t),D(Fe)):"("==e?D(P,j(")"),ce(Ve,")"),V,me,H,z):c&&"<"==t?D(j(">"),ce(Se,">"),V,Fe):void 0}function ze(e,t){return"*"==t?(M.marked="keyword",D(ze)):"variable"==e?(N(t),D(ze)):"("==e?D(P,j(")"),ce(Ve,")"),V,me,z):c&&"<"==t?D(j(">"),ce(Se,">"),V,ze):void 0}function je(e,t){return"keyword"==e||"variable"==e?(M.marked="type",D(je)):"<"==t?D(j(">"),ce(Se,">"),V):void 0}function Ve(e,t){return"@"==t&&D(U,Ve),"spread"==e?D(Ve):c&&L(t)?(M.marked="keyword",D(Ve)):c&&"this"==e?D(he,Te):A(De,he,Te)}function $e(e,t){return"variable"==e?He(e,t):We(e,t)}function He(e,t){if("variable"==e)return N(t),D(We)}function We(e,t){return"<"==t?D(j(">"),ce(Se,">"),V,We):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(M.marked="keyword"),D(c?_e:U,We)):"{"==e?D(j("}"),Ue,V):void 0}function Ue(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&L(t))&&M.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(M.marked="keyword",D(Ue)):"variable"==e||"keyword"==M.style?(M.marked="property",D(Ke,Ue)):"number"==e||"string"==e?D(Ke,Ue):"["==e?D(U,he,$("]"),Ke,Ue):"*"==t?(M.marked="keyword",D(Ue)):c&&"("==e?A(ze,Ue):";"==e||","==e?D(Ue):"}"==e?D():"@"==t?D(U,Ue):void 0}function Ke(e,t){if("!"==t)return D(Ke);if("?"==t)return D(Ke);if(":"==e)return D(_e,Te);if("="==t)return D(K);var n=M.state.lexical.prev;return A(n&&"interface"==n.info?ze:Fe)}function qe(e,t){return"*"==t?(M.marked="keyword",D(Qe,$(";"))):"default"==t?(M.marked="keyword",D(U,$(";"))):"{"==e?D(ce(Ge,"}"),Qe,$(";")):A(H)}function Ge(e,t){return"as"==t?(M.marked="keyword",D($("variable"))):"variable"==e?A(K,Ge):void 0}function Ze(e){return"string"==e?D():"("==e?A(U):"."==e?A(X):A(Xe,Je,Qe)}function Xe(e,t){return"{"==e?de(Xe,"}"):("variable"==e&&N(t),"*"==t&&(M.marked="keyword"),D(Ye))}function Je(e){if(","==e)return D(Xe,Je)}function Ye(e,t){if("as"==t)return M.marked="keyword",D(Xe)}function Qe(e,t){if("from"==t)return M.marked="keyword",D(U)}function et(e){return"]"==e?D():A(ce(K,"]"))}function tt(){return A(j("form"),De,$("{"),j("}"),ce(nt,"}"),V,V)}function nt(){return A(De,Te)}function rt(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function it(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return P.lex=F.lex=!0,z.lex=!0,V.lex=!0,{startState:function(e){var t={tokenize:_,lastType:"sof",cc:[],lexical:new C((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new R(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),x(e,t)),t.tokenize!=b&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",S(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==b||t.tokenize==y)return e.Pass;if(t.tokenize!=_)return 0;var i,a=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==V)l=l.prev;else if(c!=Re&&c!=z)break}for(;("stat"==l.type||"form"==l.type)&&("}"==a||(i=t.cc[t.cc.length-1])&&(i==X||i==J)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;s&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=a==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==a?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(rt(t,r)?s||o:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:it,skipExpression:function(t){S(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4631))},9124:(e,t,n)=>{"use strict";var r=n(9400),i=n(6919),o=n(9731);e.exports=function(e,t){var n,s=i({},t),a=s.sep||"\n\n",l=s.min;return"number"==typeof l&&2!==l&&(n=new RegExp("(\\r\\n|\\n|\\u2424) {"+l+",}")),void 0===n&&(n=s.regex||/(\r\n|\n|\u2424){2,}/g),!0!==s.keepWhitespace&&(e=e.split("\n").map((function(e){return r(e)?e.trim():e})).join("\n")),e=function(e,t){var n=t.trailingNewline;if(!1===n)return e;switch(o(n)){case"string":e=e.replace(/\s+$/,t.trailingNewline);break;case"function":e=t.trailingNewline(e);break;default:e=e.replace(/\s+$/,"\n")}return e}(e,s),e.replace(n,a)}},9731:(e,t,n)=>{var r=n(8738),i=Object.prototype.toString;e.exports=function(e){if(void 0===e)return"undefined";if(null===e)return"null";if(!0===e||!1===e||e instanceof Boolean)return"boolean";if("string"==typeof e||e instanceof String)return"string";if("number"==typeof e||e instanceof Number)return"number";if("function"==typeof e||e instanceof Function)return"function";if(void 0!==Array.isArray&&Array.isArray(e))return"array";if(e instanceof RegExp)return"regexp";if(e instanceof Date)return"date";var t=i.call(e);return"[object RegExp]"===t?"regexp":"[object Date]"===t?"date":"[object Arguments]"===t?"arguments":"[object Error]"===t?"error":r(e)?"buffer":"[object Set]"===t?"set":"[object WeakSet]"===t?"weakset":"[object Map]"===t?"map":"[object WeakMap]"===t?"weakmap":"[object Symbol]"===t?"symbol":"[object Int8Array]"===t?"int8array":"[object Uint8Array]"===t?"uint8array":"[object Uint8ClampedArray]"===t?"uint8clampedarray":"[object Int16Array]"===t?"int16array":"[object Uint16Array]"===t?"uint16array":"[object Int32Array]"===t?"int32array":"[object Uint32Array]"===t?"uint32array":"[object Float32Array]"===t?"float32array":"[object Float64Array]"===t?"float64array":"object"}},8023:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3645),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".code-block[data-v-cb89810c]{padding-top:15px;position:relative}.code-block select[data-v-cb89810c]{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:#3c4b5f url(\"data:image/svg+xml;utf8,\") no-repeat;background-position:right 5px top 5px;border-top-left-radius:2px;border-top-right-radius:2px;height:20px;padding-left:8px;top:10px;width:122px}",""]);const o=i},7936:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3645),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,'.nova-tiptap-editor{padding-bottom:20px;padding-top:20px}.nova-tiptap-editor .ProseMirror-focused{outline:none}.nova-tiptap-editor img.ProseMirror-selectednode{outline:3px solid var(--primary-30)}.nova-tiptap-editor .ProseMirror p.is-editor-empty:first-child:before{color:#ced4da;content:attr(data-placeholder);float:left;height:0;pointer-events:none}.nova-tiptap-editor .ProseMirror blockquote,.nova-tiptap-editor .ProseMirror h1,.nova-tiptap-editor .ProseMirror h2,.nova-tiptap-editor .ProseMirror h3,.nova-tiptap-editor .ProseMirror h4,.nova-tiptap-editor .ProseMirror h5,.nova-tiptap-editor .ProseMirror h6,.nova-tiptap-editor .ProseMirror ol,.nova-tiptap-editor .ProseMirror p,.nova-tiptap-editor .ProseMirror pre,.nova-tiptap-editor .ProseMirror table,.nova-tiptap-editor .ProseMirror ul{line-height:1.5em;margin-top:1em}.nova-tiptap-editor .ProseMirror h1{font-size:3em}.nova-tiptap-editor .ProseMirror h2{font-size:2.4em}.nova-tiptap-editor .ProseMirror h3{font-size:1.8em}.nova-tiptap-editor .ProseMirror h4{font-size:1.5em}.nova-tiptap-editor .ProseMirror h5{font-size:1.3em}.nova-tiptap-editor .ProseMirror h6{font-size:1.1em}.nova-tiptap-editor .ProseMirror h1,.nova-tiptap-editor .ProseMirror h2,.nova-tiptap-editor .ProseMirror h3,.nova-tiptap-editor .ProseMirror h4,.nova-tiptap-editor .ProseMirror h5,.nova-tiptap-editor .ProseMirror h6{text-align:var(--text-align)}.nova-tiptap-editor .ProseMirror a{color:#0ea5e9;text-decoration:underline}.nova-tiptap-editor .ProseMirror pre{background-color:#3c4b5f;border-radius:.125rem;color:#fff;padding:5px 12px}.nova-tiptap-editor .ProseMirror blockquote:first-child,.nova-tiptap-editor .ProseMirror h1:first-child,.nova-tiptap-editor .ProseMirror h2:first-child,.nova-tiptap-editor .ProseMirror h3:first-child,.nova-tiptap-editor .ProseMirror h4:first-child,.nova-tiptap-editor .ProseMirror h5:first-child,.nova-tiptap-editor .ProseMirror h6:first-child,.nova-tiptap-editor .ProseMirror ol:first-child,.nova-tiptap-editor .ProseMirror p:first-child,.nova-tiptap-editor .ProseMirror pre:first-child,.nova-tiptap-editor .ProseMirror table:first-child,.nova-tiptap-editor .ProseMirror ul:first-child{margin-top:0}.nova-tiptap-editor .ProseMirror blockquote{border-left:3px solid #ddd;display:block;margin-bottom:1.5em;margin-top:1.5em;padding-left:15px}.nova-tiptap-editor .ProseMirror a{pointer-events:none}.nova-tiptap-editor .ProseMirror ul{padding-left:16px}.nova-tiptap-editor .ProseMirror ul li{list-style:disc}.nova-tiptap-editor .ProseMirror ol{padding-left:16px}.nova-tiptap-editor .ProseMirror ol li{list-style:numeric}.nova-tiptap-editor .ProseMirror hr{border-top:1px solid #ddd;margin-bottom:10px;margin-top:20px}.nova-tiptap-editor .ProseMirror .tableWrapper{margin-top:15px;overflow-x:auto}.nova-tiptap-editor .ProseMirror .resize-cursor{cursor:ew-resize;cursor:col-resize}.nova-tiptap-editor .ProseMirror table{border-collapse:collapse;overflow:hidden;table-layout:fixed;width:100%}.nova-tiptap-editor .ProseMirror table td,.nova-tiptap-editor .ProseMirror table th{border:2px solid #ddd;box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.nova-tiptap-editor .ProseMirror table td>*,.nova-tiptap-editor .ProseMirror table th>*{margin-bottom:0}.nova-tiptap-editor .ProseMirror table th{background-color:#fafafa;font-weight:700;text-align:left}.nova-tiptap-editor .ProseMirror table .selectedCell:after{background:rgba(200,200,255,.4);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:2}.nova-tiptap-editor .ProseMirror table .column-resize-handle{background-color:#adf;bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}',""]);const o=i},5650:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3645),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,'.CodeMirror-merge{border:1px solid #ddd;position:relative;white-space:pre}.CodeMirror-merge,.CodeMirror-merge .CodeMirror{height:350px}.CodeMirror-merge-2pane .CodeMirror-merge-pane{width:47%}.CodeMirror-merge-2pane .CodeMirror-merge-gap{width:6%}.CodeMirror-merge-3pane .CodeMirror-merge-pane{width:31%}.CodeMirror-merge-3pane .CodeMirror-merge-gap{width:3.5%}.CodeMirror-merge-pane{display:inline-block;vertical-align:top;white-space:normal}.CodeMirror-merge-pane-rightmost{position:absolute;right:0;z-index:1}.CodeMirror-merge-gap{background:#f8f8f8;border-left:1px solid #ddd;border-right:1px solid #ddd;box-sizing:border-box;display:inline-block;height:100%;overflow:hidden;position:relative;z-index:2}.CodeMirror-merge-scrolllock-wrap{bottom:0;left:50%;position:absolute}.CodeMirror-merge-scrolllock{color:#555;cursor:pointer;left:-50%;line-height:1;position:relative}.CodeMirror-merge-scrolllock:after{content:"\\21db\\00a0\\00a0\\21da"}.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after{content:"\\21db\\21da"}.CodeMirror-merge-copybuttons-left,.CodeMirror-merge-copybuttons-right{bottom:0;left:0;line-height:1;position:absolute;right:0;top:0}.CodeMirror-merge-copy{z-index:3}.CodeMirror-merge-copy,.CodeMirror-merge-copy-reverse{color:#44c;cursor:pointer;position:absolute}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-l-inserted,.CodeMirror-merge-r-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:0 100%;background-repeat:repeat-x}.CodeMirror-merge-l-deleted,.CodeMirror-merge-r-deleted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);background-position:0 100%;background-repeat:repeat-x}.CodeMirror-merge-r-chunk{background:#ffffe0}.CodeMirror-merge-r-chunk-start{border-top:1px solid #ee8}.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #ee8}.CodeMirror-merge-r-connect{fill:#ffffe0;stroke:#ee8;stroke-width:1px}.CodeMirror-merge-l-chunk{background:#eef}.CodeMirror-merge-l-chunk-start{border-top:1px solid #88e}.CodeMirror-merge-l-chunk-end{border-bottom:1px solid #88e}.CodeMirror-merge-l-connect{fill:#eef;stroke:#88e;stroke-width:1px}.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk{background:#dfd}.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start{border-top:1px solid #4e4}.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #4e4}.CodeMirror-merge-collapsed-widget:before{content:"(...)"}.CodeMirror-merge-collapsed-widget{background:#eef;border:1px solid #ddf;border-radius:4px;color:#88b;cursor:pointer;font-size:90%;padding:0 3px}.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt{display:none}',""]);const o=i},8341:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3645),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,'.CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative;z-index:0}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;outline:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;background:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}',""]);const o=i},5063:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3645),i=n.n(r)()((function(e){return e[1]}));i.push([e.id,".cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;border:none;color:#f8f8f2!important}.cm-s-dracula .CodeMirror-gutters{color:#282a36}.cm-s-dracula .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-type,.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-activeline-background{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}",""]);const o=i},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){void 0===i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var o=i;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var s=r,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var u=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var c=this.diff_compute_(e,n,s,o);return l&&c.unshift(new t.Diff(0,l)),u&&c.push(new t.Diff(0,u)),this.diff_cleanupMerge(c),c},t.prototype.diff_compute_=function(e,r,i,o){var s;if(!e)return[new t.Diff(1,r)];if(!r)return[new t.Diff(n,e)];var a=e.length>r.length?e:r,l=e.length>r.length?r:e,u=a.indexOf(l);if(-1!=u)return s=[new t.Diff(1,a.substring(0,u)),new t.Diff(0,l),new t.Diff(1,a.substring(u+l.length))],e.length>r.length&&(s[0][0]=s[2][0]=n),s;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,r)];var c=this.diff_halfMatch_(e,r);if(c){var d=c[0],f=c[1],h=c[2],p=c[3],m=c[4],g=this.diff_main(d,h,i,o),_=this.diff_main(f,p,i,o);return g.concat([new t.Diff(0,m)],_)}return i&&e.length>100&&r.length>100?this.diff_lineMode_(e,r,o):this.diff_bisect_(e,r,o)},t.prototype.diff_lineMode_=function(e,r,i){var o=this.diff_linesToChars_(e,r);e=o.chars1,r=o.chars2;var s=o.lineArray,a=this.diff_main(e,r,!1,i);this.diff_charsToLines_(a,s),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,u=0,c=0,d="",f="";l=1&&c>=1){a.splice(l-u-c,u+c),l=l-u-c;for(var h=this.diff_main(d,f,!1,i),p=h.length-1;p>=0;p--)a.splice(l,0,h[p]);l+=h.length}c=0,u=0,d="",f=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,r,i){for(var o=e.length,s=r.length,a=Math.ceil((o+s)/2),l=a,u=2*a,c=new Array(u),d=new Array(u),f=0;fi);b++){for(var y=-b+m;y<=b-g;y+=2){for(var w=l+y,x=(M=y==-b||y!=b&&c[w-1]o)g+=2;else if(x>s)m+=2;else if(p){if((E=l+h-y)>=0&&E=(C=o-d[E]))return this.diff_bisectSplit_(e,r,M,x,i)}}for(var k=-b+_;k<=b-v;k+=2){for(var C,E=l+k,S=(C=k==-b||k!=b&&d[E-1]o)v+=2;else if(S>s)_+=2;else if(!p){if((w=l+h-k)>=0&&w=(C=o-C))return this.diff_bisectSplit_(e,r,M,x,i)}}}}return[new t.Diff(n,e),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),u=this.diff_main(o,s,!1,i),c=this.diff_main(a,l,!1,i);return u.concat(c)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t="",i=0,s=-1,a=n.length;sr?e=e.substring(n-r):nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,o,s,a,c]:null}var s,a,l,u,c,d=o(n,r,Math.ceil(n.length/4)),f=o(n,r,Math.ceil(n.length/2));return d||f?(s=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(a=s[0],l=s[1],u=s[2],c=s[3]):(u=s[0],c=s[1],a=s[2],l=s[3]),[a,l,u,c,s[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var r=!1,i=[],o=0,s=null,a=0,l=0,u=0,c=0,d=0;a0?i[o-1]:-1,l=0,u=0,c=0,d=0,s=null,r=!0)),a++;for(r&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a=m?(p>=f.length/2||p>=h.length/2)&&(e.splice(a,0,new t.Diff(0,h.substring(0,p))),e[a-1][1]=f.substring(0,f.length-p),e[a+1][1]=h.substring(p),a++):(m>=f.length/2||m>=h.length/2)&&(e.splice(a,0,new t.Diff(0,f.substring(0,m))),e[a-1][0]=1,e[a-1][1]=h.substring(0,h.length-m),e[a+1][0]=n,e[a+1][1]=f.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),o=r.match(t.nonAlphaNumericRegex_),s=i.match(t.nonAlphaNumericRegex_),a=o&&r.match(t.whitespaceRegex_),l=s&&i.match(t.whitespaceRegex_),u=a&&r.match(t.linebreakRegex_),c=l&&i.match(t.linebreakRegex_),d=u&&e.match(t.blanklineEndRegex_),f=c&&n.match(t.blanklineStartRegex_);return d||f?5:u||c?4:o&&!a&&l?3:a||l?2:o||s?1:0}for(var r=1;r=f&&(f=h,u=i,c=o,d=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=c,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var r=!1,i=[],o=0,s=null,a=0,l=!1,u=!1,c=!1,d=!1;a0?i[o-1]:-1,c=d=!1),r=!0)),a++;r&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var r,i=0,o=0,s=0,a="",l="";i1?(0!==o&&0!==s&&(0!==(r=this.diff_commonPrefix(l,a))&&(i-o-s>0&&0==e[i-o-s-1][0]?e[i-o-s-1][1]+=l.substring(0,r):(e.splice(0,0,new t.Diff(0,l.substring(0,r))),i++),l=l.substring(r),a=a.substring(r)),0!==(r=this.diff_commonSuffix(l,a))&&(e[i][1]=l.substring(l.length-r)+e[i][1],l=l.substring(0,l.length-r),a=a.substring(0,a.length-r))),i-=o+s,e.splice(i,o+s),a.length&&(e.splice(i,0,new t.Diff(n,a)),i++),l.length&&(e.splice(i,0,new t.Diff(1,l)),i++),i++):0!==i&&0==e[i-1][0]?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,s=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var u=!1;for(i=1;it));r++)s=i,a=o;return e.length!=r&&e[r][0]===n?a:a+(t-s)},t.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,i=//g,s=/\n/g,a=0;a");switch(l){case 1:t[a]=''+u+"";break;case n:t[a]=''+u+"";break;case 0:t[a]=""+u+""}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(e,r){var o=e/t.length,s=Math.abs(n-r);return i.Match_Distance?o+s/i.Match_Distance:s?1:o}var s=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(s=Math.min(o(0,a),s),-1!=(a=e.lastIndexOf(t,n+t.length))&&(s=Math.min(o(0,a),s)));var l,u,c=1<=p;_--){var v=r[e.charAt(_-1)];if(g[_]=0===h?(g[_+1]<<1|1)&v:(g[_+1]<<1|1)&v|(d[_+1]|d[_])<<1|1|d[_+1],g[_]&c){var b=o(h,_-1);if(b<=s){if(s=b,!((a=_-1)>n))break;p=Math.max(1,2*n-a)}}}if(o(h+1,n)>s)break;d=g}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n2&&(this.diff_cleanupSemantic(s),this.diff_cleanupEfficiency(s));else if(e&&"object"==typeof e&&void 0===r&&void 0===i)s=e,o=this.diff_text1(s);else if("string"==typeof e&&r&&"object"==typeof r&&void 0===i)o=e,s=r;else{if("string"!=typeof e||"string"!=typeof r||!i||"object"!=typeof i)throw new Error("Unknown call format to patch_make.");o=e,s=i}if(0===s.length)return[];for(var a=[],l=new t.patch_obj,u=0,c=0,d=0,f=o,h=o,p=0;p=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,f),a.push(l),l=new t.patch_obj,u=0,f=h,c=d)}1!==m&&(c+=g.length),m!==n&&(d+=g.length)}return u&&(this.patch_addContext_(l,f),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;rthis.Match_MaxBits?-1!=(a=this.match_main(t,c.substring(0,this.Match_MaxBits),u))&&(-1==(d=this.match_main(t,c.substring(c.length-this.Match_MaxBits),u+c.length-this.Match_MaxBits))||a>=d)&&(a=-1):a=this.match_main(t,c,u),-1==a)o[s]=!1,i-=e[s].length2-e[s].length1;else if(o[s]=!0,i=a-u,c==(l=-1==d?t.substring(a,a+c.length):t.substring(a,d+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[s].diffs)+t.substring(a+c.length);else{var f=this.diff_main(c,l,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(f)/c.length>this.Patch_DeleteThreshold)o[s]=!1;else{this.diff_cleanupSemanticLossless(f);for(var h,p=0,m=0;ms[0][1].length){var a=n-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=a,o.start2-=a,o.length1+=a,o.length2+=a}if(0==(s=(o=e[e.length-1]).diffs).length||0!=s[s.length-1][0])s.push(new t.Diff(0,r)),o.length1+=n,o.length2+=n;else if(n>s[s.length-1][1].length){a=n-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,a),o.length1+=a,o.length2+=a}return r},t.prototype.patch_splitMax=function(e){for(var r=this.Match_MaxBits,i=0;i2*r?(u.length1+=f.length,s+=f.length,c=!1,u.diffs.push(new t.Diff(d,f)),o.diffs.shift()):(f=f.substring(0,r-u.length1-this.Patch_Margin),u.length1+=f.length,s+=f.length,0===d?(u.length2+=f.length,a+=f.length):c=!1,u.diffs.push(new t.Diff(d,f)),f==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(f.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var h=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==h&&(u.length1+=h.length,u.length2+=h.length,0!==u.diffs.length&&0===u.diffs[u.diffs.length-1][0]?u.diffs[u.diffs.length-1][1]+=h:u.diffs.push(new t.Diff(0,h))),c||e.splice(++i,0,u)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n{"use strict";var r=n(1833);function i(e,t){for(var n in t)o(t,n)&&(e[n]=t[n])}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){r(e)||(e={});for(var t=arguments.length,n=1;n{!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),a=0,l=e.length,u="",c=!1,d=!1,f=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1833:e=>{"use strict";e.exports=function(e){return null!=e&&("object"==typeof e||"function"==typeof e)}},9400:e=>{"use strict";var t;e.exports=function(e){return"string"==typeof e&&(t||(t=new RegExp('^[\\s\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"]+$'))).test(e)}},4204:(e,t,n)=>{"use strict";var r,i;r=[n(7937),n(5040),n(3566)],void 0===(i=function(e,t,n){return function(e,t,n){var r=function(t,n){return e.js_beautify(t,n)};return r.js=e.js_beautify,r.css=t.css_beautify,r.html=n.html_beautify,r.js_beautify=e.js_beautify,r.css_beautify=t.css_beautify,r.html_beautify=n.html_beautify,r}(e,t,n)}.apply(t,r))||(e.exports=i)},5040:(e,t)=>{var n;!function(){var r;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function r(e,r){this.__indent_cache=new n(e,r),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},r.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(e,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(e)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=r},,,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,i={};for(n in e=r(e))n!==t&&(i[n]=e[n]);if(t&&e[t])for(n in e[t])i[n]=e[t][n];return i}function r(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},t.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=r,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var r=n(16).Beautifier,i=n(17).Options;e.exports=function(e,t){return new r(e,t).beautify()},e.exports.defaultOptions=function(){return new i}},function(e,t,n){var r=n(17).Options,i=n(2).Output,o=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,d=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,f=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function h(e,t){this._source_text=e||"",this._options=new r(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}h.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},h.prototype.eatWhitespace=function(e){for(var t=u.test(this._input.peek()),n=0;u.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n0&&this._indentLevel--},h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&a.test(e||"")&&(t=e.match(a)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0];this._output=new i(this._options,n),this._input=new o(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r,h,p=0,m=!1,g=!1,_=!1,v=!1,b=!1,y=!1,w=this._ch,x=!1;r=""!==this._input.read(c),h=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var k=this._input.read(d),C=s.get_directives(k);C&&"start"===C.ignore&&(k+=s.readIgnored(this._input)),this.print_string(k),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(f)),this.eatWhitespace(!0);else if("@"===this._ch||"$"===this._ch)if(this.preserveSingleSpace(r),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var E=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);E.match(/[ :]$/)&&(E=this.eatString(": ").replace(/\s$/,""),this.print_string(E),this._output.space_before_token=!0),"extend"===(E=E.replace(/\s$/,""))?v=!0:"import"===E&&(b=!0),E in this.NESTED_AT_RULE?(this._nestedLevel+=1,E in this.CONDITIONAL_GROUP_RULE&&(_=!0)):m||0!==p||-1===E.indexOf(":")||(g=!0,this.indent())}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(r),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),_?(_=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),b=!1,v=!1,g&&(this.outdent(),g=!1),this.print_string(this._ch),m=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var S=0;S"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==p)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(r),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var D='"'===h||"'"===h;this.preserveSingleSpace(D||r),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&x&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=h},function(e,t,n){var r=n(6).Options;function i(e){r.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i{var r,i;!function(){var o;!function(){"use strict";var e=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function r(e,r){this.__indent_cache=new n(e,r),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},r.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(e,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(e)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=r},function(e){e.exports.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,i={};for(n in e=r(e))n!==t&&(i[n]=e[n]);if(t&&e[t])for(n in e[t])i[n]=e[t][n];return i}function r(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},t.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=r,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var r=n(8).InputScanner,i=n(3).Token,o=n(10).TokenStream,s=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new r(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new o,this._reset();for(var t=new i(a.START,""),n=null,r=[],s=new o;t.type!==a.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new o),e.parent=n,this._is_opening(e)?(r.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=r.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new i(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=a},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position=0&&e/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new r,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},o.prototype.read_options=function(e){var t=this._create();for(var n in i)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},o.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},o.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},o.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},o.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=o},,,,function(e,t,n){var r=n(19).Beautifier,i=n(20).Options;e.exports=function(e,t,n,i){return new r(e,t,n,i).beautify()},e.exports.defaultOptions=function(){return new i}},function(e,t,n){var r=n(20).Options,i=n(2).Output,o=n(21).Tokenizer,s=n(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,u=function(e,t){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new i(e,t)};u.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},u.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},u.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},u.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},u.prototype.print_preserved_newlines=function(e){var t=0;e.type!==s.TEXT&&e.previous.type!==s.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines0);return 0!==t},u.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},u.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},u.prototype.print_newline=function(e){this._output.add_new_line(e)},u.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},u.prototype.indent=function(){this.indent_level++},u.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var c=function(e,t){var n=null,r=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==s.EOF&&e.closed!==n;){if(n.type===s.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===s.EQUALS&&n.next.next&&n.next.next.type===s.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function d(e,t){return-1!==t.indexOf(e)}function f(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function h(e){this._printer=e,this._current_frame=null}function p(e,t,n,i){this._source_text=e||"",t=t||{},this._js_beautify=n,this._css_beautify=i,this._tag_stack=null;var o=new r(t,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}h.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},h.prototype.record_tag=function(e){var t=new f(this._current_frame,e,this._printer.indent_level);this._current_frame=t},h.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},h.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},h.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},h.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&a.test(e)&&(t=e.match(a)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0],r={text:"",type:""},i=new m,c=new u(this._options,n),d=new o(e,this._options).tokenize();this._tag_stack=new h(c);for(var f=null,p=d.next();p.type!==s.EOF;)p.type===s.TAG_OPEN||p.type===s.COMMENT?i=f=this._handle_tag_open(c,p,i,r):p.type===s.ATTRIBUTE||p.type===s.EQUALS||p.type===s.VALUE||p.type===s.TEXT&&!i.tag_complete?f=this._handle_inside_tag(c,p,i,d):p.type===s.TAG_CLOSE?f=this._handle_tag_close(c,p,i):p.type===s.TEXT?f=this._handle_text(c,p,i):c.add_raw_token(p),r=f,p=d.next();return c._output.get_code(t)},p.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},p.prototype._handle_inside_tag=function(e,t,n,r){var i=n.has_wrapped_attrs,o={text:t.text,type:t.type};if(e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted)e.add_raw_token(t);else if("{"===n.tag_start_char&&t.type===s.TEXT)e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t);else{if(t.type===s.ATTRIBUTE?(e.set_space_before_token(!0),n.attr_count+=1):(t.type===s.EQUALS||t.type===s.VALUE&&t.previous.type===s.EQUALS)&&e.set_space_before_token(!1),t.type===s.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),i=i||0!==t.newlines),this._is_wrap_attributes_force)){var a=n.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===n.attr_count){var l,u=!0,c=0;do{if((l=r.peek(c)).type===s.ATTRIBUTE){u=!1;break}c+=1}while(c<4&&l.type!==s.EOF&&l.type!==s.TAG_CLOSE);a=!u}a&&(e.print_newline(!1),i=!0)}e.print_token(t),i=i||e.previous_token_wrapped(),n.has_wrapped_attrs=i}return o},p.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},p.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var i,o=t.text,s=1,a="",l="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(e,t){return new p(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?s=0:"separate"===this._options.indent_scripts&&(s=-e.indent_level);var u=e.get_full_indent(s);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(|]]>)$/.exec(o);if(!c)return void e.add_raw_token(t);a=u+c[1]+"\n",o=c[4],c[5]&&(l=u+c[5]),o=o.replace(/\n[ \t]*$/,""),(c[2]||-1!==c[3].indexOf("\n"))&&(c=c[3].match(/[ \t]+$/))&&(t.whitespace_before=c[0])}if(o)if(i){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,o=i(u+o,new d)}else{var f=t.whitespace_before;f&&(o=o.replace(new RegExp("\n("+f+")?","g"),"\n")),o=u+o.replace(/\n/g,"\n"+u)}a&&(o=o?a+o+"\n"+l:a+l),e.print_newline(!1),o&&(t.text=o,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},p.prototype._handle_tag_open=function(e,t,n,r){var i=this._get_tag_open_token(t);return!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==s.TAG_OPEN||0!==t.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=t.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"",(t.text.startsWith("{{#>")||t.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==t.next?this.tag_check=t.next.text.split(" ")[0]:this.tag_check=t.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),t.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||t.closed&&"/>"===t.closed.text;var r=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(r=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(r)))}else this.tag_complete=!0};p.prototype._get_tag_open_token=function(e){var t=new m(this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||d(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&d(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&d(t.tag_check,this._options.content_unformatted),t.is_inline_element=d(t.tag_name,this._options.inline)||"{"===t.tag_start_char,t},p.prototype._set_tag_position=function(e,t,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=c(n.tag_check,t)))),d(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&i.type===s.TAG_CLOSE&&r.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var o=!1;o=(o=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===s.TAG_CLOSE&&n.start_tag_token===r)&&"TK_CONTENT"!==i.type,(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===i.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},p.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var g=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],_=["a","audio","del","ins","map","noscript","video"];p.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==g.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==_.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},e.exports.Beautifier=p},function(e,t,n){var r=n(6).Options;function i(e){r.call(this,e,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}i.prototype=new r,e.exports.Options=i},function(e,t,n){var r=n(9).Tokenizer,i=n(9).TOKEN,o=n(13).Directives,s=n(14).TemplatablePattern,a=n(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},u=new o(/<\!--/,/-->/),c=function(e,t){r.call(this,e,t),this._current_tag_name="";var n=new s(this._input).read_options(this._options),i=new a(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),handlebars_open:i.until(/[\n\r\t }]/),handlebars_raw_close:i.until(/}}/),comment:i.starting_with(//),cdata:i.starting_with(//),conditional_comment:i.starting_with(//),processing:i.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=i.matching(o).until_after(o)}};(c.prototype=new r)._is_comment=function(e){return!1},c.prototype._is_opening=function(e){return e.type===l.TAG_OPEN},c.prototype._is_closing=function(e,t){return e.type===l.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])},c.prototype._reset=function(){this._current_tag_name=""},c.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(l.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(l.UNKNOWN,this._input.next())},c.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=u.get_directives(n))&&"start"===r.ignore&&(n+=u.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=r));return t},c.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(l.COMMENT,n)).directives=null)}return t},c.prototype._read_open=function(e,t){var n=null,r=null;return t||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(l.TAG_OPEN,n)),r},c.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t||this._options.indent_handlebars&&"{"===e&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(l.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(l.TAG_OPEN,n))),r},c.prototype._read_close=function(e,t){var n=null,r=null;return t&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(l.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(l.TAG_CLOSE,"}}"))),r},c.prototype._read_attribute=function(e,t,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(l.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(l.VALUE,o)}else(i=this.__patterns.attribute.read())&&(r=t.type===l.EQUALS?this._create_token(l.VALUE,i):this._create_token(l.ATTRIBUTE,i));return r},c.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},c.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===l.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var i=t.opened.text.substr(1).toLowerCase();if("script"===i||"style"===i){var o=this._read_comment_or_cdata(e);if(o)return o.type=l.TEXT,o;r=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("","ig")))}return r?this._create_token(l.TEXT,r):null},c.prototype._read_content_word=function(e){var t="";if(this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(t=this.__patterns.unformatted_content_delimiter.read()),t||(t=this.__patterns.word.read()),t)return this._create_token(l.TEXT,t)},e.exports.Tokenizer=c,e.exports.TOKEN=l}],t={};var n=function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(18);o=n}();var s=o;r=[n,n(7937),n(5040)],i=function(e){var t=n(7937),r=n(5040);return{html_beautify:function(e,n){return s(e,n,t.js_beautify,r.css_beautify)}}}.apply(t,r),void 0===i||(e.exports=i)}()},7937:(e,t)=>{var n;!function(){var r;!function(){"use strict";var e=[function(e,t,n){var r=n(1).Beautifier,i=n(5).Options;e.exports=function(e,t){return new r(e,t).beautify()},e.exports.defaultOptions=function(){return new i}},function(e,t,n){var r=n(2).Output,i=n(3).Token,o=n(4),s=n(5).Options,a=n(7).Tokenizer,l=n(7).line_starters,u=n(7).positionable_operators,c=n(7).TOKEN;function d(e,t){return-1!==t.indexOf(e)}function f(e,t){return e&&e.type===c.RESERVED&&e.text===t}function h(e,t){return e&&e.type===c.RESERVED&&d(e.text,t)}var p=["case","return","do","if","throw","else","await","break","continue","async"],m=function(e){for(var t={},n=0;nn&&(n=e.line_indent_level)),{mode:t,parent:e,last_token:e?e.last_token:new i(c.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:n,alignment:0,line_indent_level:e?e.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},M.prototype._reset=function(e){var t=e.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new r(this._options,t),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(_);var n=new a(e,this._options);return this._tokens=n.tokenize(),e},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&o.lineBreak.test(e||"")&&(t=e.match(o.lineBreak)[0]));for(var n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(t)},M.prototype.handle_token=function(e,t){e.type===c.START_EXPR?this.handle_start_expr(e):e.type===c.END_EXPR?this.handle_end_expr(e):e.type===c.START_BLOCK?this.handle_start_block(e):e.type===c.END_BLOCK?this.handle_end_block(e):e.type===c.WORD||e.type===c.RESERVED?this.handle_word(e):e.type===c.SEMICOLON?this.handle_semicolon(e):e.type===c.STRING?this.handle_string(e):e.type===c.EQUALS?this.handle_equals(e):e.type===c.OPERATOR?this.handle_operator(e):e.type===c.COMMA?this.handle_comma(e):e.type===c.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===c.COMMENT?this.handle_comment(e,t):e.type===c.DOT?this.handle_dot(e):e.type===c.EOF?this.handle_eof(e):(e.type,c.UNKNOWN,this.handle_unknown(e,t))},M.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&E(this._flags.mode);if(e.comments_before)for(var i=e.comments_before.next();i;)this.handle_whitespace_and_comments(i,t),this.handle_token(i,t),i=e.comments_before.next();if(r)for(var o=0;o0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var s=1;s0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===v&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===b&&this._flags.mode===v&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||h(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||h(this._flags.last_token,["var","let","const"])&&e.type===c.WORD)||f(this._flags.last_token,"do"))||!(this._flags.parent.mode===b&&this._flags.mode===v)&&h(this._flags.last_token,A)&&!e.newlines)||f(this._flags.last_token,"else")&&!(f(e,"if")&&!e.comments_before))||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===w||this._previous_flags.mode===x))||this._flags.last_token.type===c.WORD&&this._flags.mode===_&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==c.WORD&&e.type!==c.RESERVED)||this._flags.mode===b&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||h(this._flags.last_token,["get","set"])))&&(this.set_mode(v),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,h(e,["do","for","if","while"])),!0)},M.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=k;if("["===e.text){if(this._flags.last_token.type===c.WORD||")"===this._flags.last_token.text)return h(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=y,E(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),d(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=w):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=x):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(d(this._flags.last_token.text,l)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);h(n,["async","function"])||"*"===n.text&&h(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===b?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===c.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(d(this._last_last_text,["function","yield"])||this._flags.mode===b&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===c.START_BLOCK?this.print_newline():this._flags.last_token.type!==c.END_EXPR&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==c.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(e){for(;this._flags.mode===v;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==c.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===x&&(this._previous_flags.mode=k,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(_),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(_):n&&(d(n.text,[":",","])&&d(t.type,[c.STRING,c.WORD,c.RESERVED])||d(t.text,["get","set","..."])&&d(n.type,[c.WORD,c.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(n.text,[":",","])?this.set_mode(_):this.set_mode(b):this._flags.last_token.type===c.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(_):d(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||h(this._flags.last_token,["return","throw","import","default"])?this.set_mode(b):this.set_mode(_),this._flags.last_token&&h(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var o=0,s=null;this._flags.inline_frame=!0;do{if(o+=1,(s=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(s.type!==c.EOF&&(s.type!==c.END_BLOCK||s.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(i||this._flags.last_token.type===c.EQUALS||h(this._flags.last_token,p)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!E(this._previous_flags.mode)||this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.COMMA||((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type!==c.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},M.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===v;)this.restore_mode();var t=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(E(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},M.prototype.handle_word=function(e){if(e.type===c.RESERVED)if(d(e.text,["set","get"])&&this._flags.mode!==b)e.type=c.WORD;else if("import"===e.text&&d(this._tokens.peek().text,["(","."]))e.type=c.WORD;else if(d(e.text,["as","from"])&&!this._flags.import_block)e.type=c.WORD;else if(this._flags.mode===b){":"===this._tokens.peek().text&&(e.type=c.WORD)}if(this.start_of_statement(e)?h(this._flags.last_token,["var","let","const"])&&e.type===c.WORD&&(this._flags.declaration_statement=!0):!e.newlines||S(this._flags.mode)||this._flags.last_token.type===c.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===c.EQUALS||!this._options.preserve_newlines&&h(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(f(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&f(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===v;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&h(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR&&this._flags.last_token.type!==c.EQUALS&&this._flags.last_token.type!==c.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e),f(e,"function"))return(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!d(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==c.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?h(this._flags.last_token,["get","set","new","export"])||h(this._flags.last_token,A)||f(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!S(this._flags.mode)&&!E(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":h(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===_?t="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&S(this._flags.mode)?t="SPACE":this._flags.last_token.type===c.STRING?t="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||"*"===this._flags.last_token.text&&(d(this._last_last_text,["function","yield"])||this._flags.mode===b&&d(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===c.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),h(e,l)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),h(e,["else","catch","finally"]))?(this._flags.last_token.type!==c.END_BLOCK||this._previous_flags.mode!==_||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?h(this._flags.last_token,p)||"declare"===this._flags.last_token.text&&h(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?this._flags.last_token.type===c.START_EXPR&&h(e,["var","let","const"])||":"===this._flags.last_token.text||(f(e,"if")&&f(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):h(e,l)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==c.WORD&&e.previous.type!==c.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===c.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&f(e,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==v||this._flags.if_block&&f(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},M.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==c.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==c.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},M.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},M.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(S(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===b||this._flags.mode===v&&this._flags.parent.mode===b?(this._flags.mode===v&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},M.prototype.handle_operator=function(e){var t="*"===e.text&&(h(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),n=d(e.text,["-","+"])&&(d(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||d(this._flags.last_token.text,l)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==c.DOT)if("::"!==e.text){if(this._flags.last_token.type===c.OPERATOR&&d(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,o=!0,s=!1;if(":"===e.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,s=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&d(e.text,u)){var a=":"===e.text,f=a&&s,b=a&&!s;switch(this._options.operator_position){case m.before_newline:return this._output.space_before_token=!b,this.print_token(e),a&&!f||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case m.after_newline:return this._output.space_before_token=!0,!a||f?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case m.preserve_newline:return b||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||b),this._output.space_before_token=i,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),i=!1;var y=this._tokens.peek();o=y&&d(y.type,[c.WORD,c.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),i=this._flags.last_token.type===c.START_BLOCK,o=!1;else if(d(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==c.COMMA&&this._flags.last_token.type!==c.START_EXPR||this.allow_wrap_or_preserved_newline(e),i=!1,o=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=h(this._flags.last_token,p)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&S(this._flags.mode)&&(i=!0),this._flags.last_token.type===c.RESERVED?i=!0:this._flags.last_token.type===c.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===c.OPERATOR&&(i=d(e.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(e.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(o=!0)),(this._flags.mode!==_||this._flags.inline_frame)&&this._flags.mode!==v||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(e),this._output.space_before_token=o}else this.print_token(e);else this.print_token(e)},M.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):o.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},M.prototype.print_block_commment=function(e,t){var n,r=function(e){for(var t=[],n=(e=e.replace(o.allLineBreaks,"\n")).indexOf("\n");-1!==n;)t.push(e.substring(0,n)),n=(e=e.substring(n+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),i=!1,s=!1,a=e.whitespace_before,l=a.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(r[0]),this.print_newline(!1,t),r.length>1){for(i=function(e,t){for(var n=0;n0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function r(e,r){this.__indent_cache=new n(e,r),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},r.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(e,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(e)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=r},function(e){e.exports.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(e,t){var n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\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\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\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\\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-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\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-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\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\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\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-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\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",i="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+r+"])";t.identifier=new RegExp(o+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\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\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\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\\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-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\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-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\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\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\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-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\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\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+n+r+i+"])+");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")},function(e,t,n){var r=n(6).Options,i=["before-newline","after-newline","preserve-newline"];function o(e){r.call(this,e,"js");var t=this.raw_options.brace_style||null;"expand-strict"===t?this.raw_options.brace_style="expand":"collapse-preserve-inline"===t?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=(_="\\?\\.(?!\\d) "+(_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var v,b=new RegExp(_),y="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),w=y.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+w.join("|")+")$"),k=function(e,t){i.call(this,e,t),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new l(this._input),r=new u(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(a.identifier).matching(a.identifierMatch),number:n.matching(h),punct:n.matching(b),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(a.lineBreak),shebang:n.starting_with(/#!/).until_after(a.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};(k.prototype=new i)._is_comment=function(e){return e.type===d.COMMENT||e.type===d.BLOCK_COMMENT||e.type===d.UNKNOWN},k.prototype._is_opening=function(e){return e.type===d.START_BLOCK||e.type===d.START_EXPR},k.prototype._is_closing=function(e,t){return(e.type===d.END_BLOCK||e.type===d.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},k.prototype._reset=function(){v=!1},k.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(d.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(d.UNKNOWN,this._input.next())},k.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(a.allLineBreaks,"\n"),e.type!==d.DOT&&(e.type!==d.RESERVED||"set"!==e.text&&"get"!==e.text)&&x.test(t)?"in"!==t&&"of"!==t||e.type!==d.WORD&&e.type!==d.STRING?this._create_token(d.RESERVED,t):this._create_token(d.OPERATOR,t):this._create_token(d.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(d.WORD,t):void 0},k.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(d.START_EXPR,e):")"===e||"]"===e?t=this._create_token(d.END_EXPR,e):"{"===e?t=this._create_token(d.START_BLOCK,e):"}"===e?t=this._create_token(d.END_BLOCK,e):";"===e?t=this._create_token(d.SEMICOLON,e):"."===e&&m.test(this._input.peek(1))?t=this._create_token(d.DOT,e):","===e&&(t=this._create_token(d.COMMA,e)),t&&this._input.next(),t},k.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(d.EQUALS,e):"?."===e?this._create_token(d.DOT,e):this._create_token(d.OPERATOR,e)},k.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(d.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(d.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(p)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)t+=this._input.next();return v=!0,this._create_token(d.COMMENT,t)}}else if(v&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return v=!1,this._create_token(d.COMMENT,t);return null},k.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=f.get_directives(n);r&&"start"===r.ignore&&(n+=f.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),(t=this._create_token(d.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(d.COMMENT,n))}return t},k.prototype._read_string=function(e){if("`"===e||"'"===e||'"'===e){var t=this._input.next();return this.has_char_escapes=!1,t+="`"===e?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(e),this.has_char_escapes&&this._options.unescape_strings&&(t=function(e){var t="",n=0,i=new r(e),o=null;for(;i.hasNext();)if((o=i.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=o[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())o=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){t+="\\",i.hasNext()&&(t+=i.next());continue}o=i.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return e;if((n=parseInt(o[1],16))>126&&n<=255&&0===o[0].indexOf("x"))return e;if(n>=0&&n<32){t+="\\"+o[0];continue}t+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(t)),this._input.peek()===e&&(t+=this._input.next()),t=t.replace(a.allLineBreaks,"\n"),this._create_token(d.STRING,t)}return null},k.prototype._allow_regexp_or_xml=function(e){return e.type===d.RESERVED&&c(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===d.END_EXPR&&")"===e.text&&e.opened.previous.type===d.RESERVED&&c(e.opened.previous.text,["if","while","for"])||c(e.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},k.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==e)&&!this._input.testChar(a.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?i=!0:"]"===this._input.peek()&&(i=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(d.STRING,n)}return null},k.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===i.indexOf("{"),s=0;r;){var l=!!r[1],u=r[2];if(!(!!r[r.length-1]||"![CDATA["===u.slice(0,8))&&(u===i||o&&u.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--s:++s),n+=r[0],s<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(d.STRING,n)}}return null},k.prototype._read_string_recursive=function(e,t,n){var r,i;"'"===e?i=this.__patterns.single_quote:'"'===e?i=this.__patterns.double_quote:"`"===e?i=this.__patterns.template_text:"}"===e&&(i=this.__patterns.template_expression);for(var o=i.read(),s="";this._input.hasNext();){if((s=this._input.next())===e||!t&&a.newline.test(s)){this._input.back();break}"\\"===s&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),s+=this._input.next()):n&&("${"===n&&"$"===s&&"{"===this._input.peek()&&(s+=this._input.next()),n===s&&(s+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(s+=this._input.next()))),o+=s+=i.read()}return o},e.exports.Tokenizer=k,e.exports.TOKEN=d,e.exports.positionable_operators=g.slice(),e.exports.line_starters=y.slice()},function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},function(e,t,n){var r=n(8).InputScanner,i=n(3).Token,o=n(10).TokenStream,s=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(e,t){this._input=new r(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new o,this._reset();for(var t=new i(a.START,""),n=null,r=[],s=new o;t.type!==a.EOF;){for(e=this._get_next_token(t,n);this._is_comment(e);)s.add(e),e=this._get_next_token(t,n);s.isEmpty()||(e.comments_before=s,s=new o),e.parent=n,this._is_opening(e)?(r.push(n),n=e):n&&this._is_closing(e,n)&&(e.opened=n,n.closed=e,n=r.pop(),e.parent=n),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},l.prototype._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return!1},l.prototype._is_closing=function(e,t){return!1},l.prototype._create_token=function(e,t){return new i(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=l,e.exports.TOKEN=a},function(e){function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return 0===this.__tokens_length},t.prototype.hasNext=function(){return this.__position=0&&e/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new r,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},o.prototype.read_options=function(e){var t=this._create();for(var n in i)t._disabled[n]=-1===e.templating.indexOf(n);return t._update(),t},o.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},o.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},o.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},o.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},e.exports.TemplatablePattern=o}],t={};var n=function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(0);r=n}();var i=r;void 0===(n=function(){return{js_beautify:i}}.apply(t,[]))||(e.exports=n)}()},5317:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=41)}([function(e,t,n){"use strict";var r=n(40),i=n(152),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function a(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===o.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(o)})),e.exports=l}).call(t,n(70))},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(109),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e,t,n){return t in e?(0,o.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(9),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=!0},function(e,t,n){"use strict";var r=n(14);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){var r=n(11).f,i=n(17),o=n(2)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(54)("keys"),i=n(59);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(48),i=n(21);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(18).Symbol;e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapProps=void 0;var r,i=n(194),o=(r=i)&&r.__esModule?r:{default:r},s={showHelpText:{type:Boolean,default:!1},shownViaNewRelationModal:{type:Boolean,default:!1},resourceId:{type:[Number,String]},resourceName:{type:String},field:{type:Object,required:!0},viaResource:{type:String,required:!1},viaResourceId:{type:[String,Number],required:!1},viaRelationship:{type:String,required:!1},shouldOverrideMeta:{type:Boolean,default:!1}};t.mapProps=function(e){return o.default.pick(s,e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=["1/2","1/3","2/3","1/4","3/4","1/5","2/5","3/5","4/5","1/6","5/6"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(150);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(t,"Form",{enumerable:!0,get:function(){return o(r).default}});var i=n(60);function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Errors",{enumerable:!0,get:function(){return o(i).default}})},function(e,t,n){"use strict";(function(t){var r=n(0),i=n(97),o=n(100),s=n(106),a=n(104),l=n(39),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(99);e.exports=function(e){return new Promise((function(c,d){var f=e.data,h=e.headers;r.isFormData(f)&&delete h["Content-Type"];var p=new XMLHttpRequest,m="onreadystatechange",g=!1;if("test"===t.env.NODE_ENV||"undefined"==typeof window||!window.XDomainRequest||"withCredentials"in p||a(e.url)||(p=new window.XDomainRequest,m="onload",g=!0,p.onprogress=function(){},p.ontimeout=function(){}),e.auth){var _=e.auth.username||"",v=e.auth.password||"";h.Authorization="Basic "+u(_+":"+v)}if(p.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p[m]=function(){if(p&&(4===p.readyState||g)&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var t="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:1223===p.status?204:p.status,statusText:1223===p.status?"No Content":p.statusText,headers:t,config:e,request:p};i(c,d,n),p=null}},p.onerror=function(){d(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){d(l("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=n(102),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?b.read(e.xsrfCookieName):void 0;y&&(h[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(h,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete h[t]:p.setRequestHeader(t,e)})),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),d(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}}).call(t,n(70))},function(e,t,n){"use strict";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){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";var r=n(96);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;rn;)t.push(arguments[n++]);return _[++g]=function(){a("function"==typeof e?e:Function(e),t)},r(g),g},h=function(e){delete _[e]},"process"==n(15)(d)?r=function(e){d.nextTick(s(b,e,1))}:m&&m.now?r=function(e){m.now(s(b,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=y,r=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",y,!1)):r=v in u("script")?function(e){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),b.call(e)}}:function(e){setTimeout(s(b,e,1),0)}),e.exports={set:f,clear:h}},function(e,t,n){var r=n(28),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(21);e.exports=function(e){return Object(r(e))}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.record(t)}return r(e,[{key:"all",value:function(){return this.errors}},{key:"has",value:function(e){var t=this.errors.hasOwnProperty(e);return t||(t=Object.keys(this.errors).filter((function(t){return t.startsWith(e+".")||t.startsWith(e+"[")})).length>0),t}},{key:"first",value:function(e){return this.get(e)[0]}},{key:"get",value:function(e){return this.errors[e]||[]}},{key:"any",value:function(){return Object.keys(this.errors).length>0}},{key:"record",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.errors=e}},{key:"clear",value:function(e){if(e){var t=Object.assign({},this.errors);Object.keys(t).filter((function(t){return t===e||t.startsWith(e+".")||t.startsWith(e+"[")})).forEach((function(e){return delete t[e]})),this.errors=t}else this.errors={}}}]),e}();t.default=o},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(71))},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(12),i=n(13);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:null;return this.viaManyToMany?this.detachResources(e):Nova.request({url:"/nova-api/"+this.resourceName,method:"delete",params:(0,o.default)({},this.queryString,{resources:s(e)})}).then(n||function(){t.deleteModalOpen=!1,t.getResources()}).then((function(){Nova.$emit("resources-deleted")}))},deleteSelectedResources:function(){this.deleteResources(this.selectedResources)},deleteAllMatchingResources:function(){var e=this;return this.viaManyToMany?this.detachAllMatchingResources():Nova.request({url:this.deleteAllMatchingResourcesEndpoint,method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){e.deleteModalOpen=!1,e.getResources()})).then((function(){Nova.$emit("resources-deleted")}))},detachResources:function(e){var t=this;return Nova.request({url:"/nova-api/"+this.resourceName+"/detach",method:"delete",params:(0,o.default)({},this.queryString,{resources:s(e)},{pivots:a(e)})}).then((function(){t.deleteModalOpen=!1,t.getResources()})).then((function(){Nova.$emit("resources-detached")}))},detachAllMatchingResources:function(){var e=this;return Nova.request({url:"/nova-api/"+this.resourceName+"/detach",method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){e.deleteModalOpen=!1,e.getResources()})).then((function(){Nova.$emit("resources-detached")}))},forceDeleteResources:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Nova.request({url:"/nova-api/"+this.resourceName+"/force",method:"delete",params:(0,o.default)({},this.queryString,{resources:s(e)})}).then(n||function(){t.deleteModalOpen=!1,t.getResources()}).then((function(){Nova.$emit("resources-deleted")}))},forceDeleteSelectedResources:function(){this.forceDeleteResources(this.selectedResources)},forceDeleteAllMatchingResources:function(){var e=this;return Nova.request({url:this.forceDeleteSelectedResourcesEndpoint,method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){e.deleteModalOpen=!1,e.getResources()})).then((function(){Nova.$emit("resources-deleted")}))},restoreResources:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Nova.request({url:"/nova-api/"+this.resourceName+"/restore",method:"put",params:(0,o.default)({},this.queryString,{resources:s(e)})}).then(n||function(){t.restoreModalOpen=!1,t.getResources()}).then((function(){Nova.$emit("resources-restored")}))},restoreSelectedResources:function(){this.restoreResources(this.selectedResources)},restoreAllMatchingResources:function(){var e=this;return Nova.request({url:this.restoreAllMatchingResourcesEndpoint,method:"put",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){e.restoreModalOpen=!1,e.getResources()})).then((function(){Nova.$emit("resources-restored")}))}},computed:{deleteAllMatchingResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens:"/nova-api/"+this.resourceName},forceDeleteSelectedResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens+"/force":"/nova-api/"+this.resourceName+"/force"},restoreAllMatchingResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens+"/restore":"/nova-api/"+this.resourceName+"/restore"},queryString:function(){return{search:this.currentSearch,filters:this.encodedFilters,trashed:this.currentTrashed,viaResource:this.viaResource,viaResourceId:this.viaResourceId,viaRelationship:this.viaRelationship}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o,s=u(n(44)),a=u(n(20)),l=u(n(43));function u(e){return e&&e.__esModule?e:{default:e}}t.default={methods:{clearSelectedFilters:(o=(0,l.default)(s.default.mark((function e(t){var n;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName,lens:t});case 3:e.next=7;break;case 5:return e.next=7,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName});case 7:this.updateQueryString((n={},(0,a.default)(n,this.pageParameter,1),(0,a.default)(n,this.filterParameter,""),n));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)}),filterChanged:function(){var e;this.updateQueryString((e={},(0,a.default)(e,this.pageParameter,1),(0,a.default)(e,this.filterParameter,this.$store.getters[this.resourceName+"/currentEncodedFilters"]),e))},initializeFilters:(i=(0,l.default)(s.default.mark((function e(t){return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.$store.commit(this.resourceName+"/clearFilters"),e.next=3,this.$store.dispatch(this.resourceName+"/fetchFilters",{resourceName:this.resourceName,viaResource:this.viaResource,viaResourceId:this.viaResourceId,viaRelationship:this.viaRelationship,lens:t});case 3:return e.next=5,this.initializeState(t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)}),initializeState:(r=(0,l.default)(s.default.mark((function e(t){return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.initialEncodedFilters){e.next=5;break}return e.next=3,this.$store.dispatch(this.resourceName+"/initializeCurrentFilterValuesFromQueryString",this.initialEncodedFilters);case 3:e.next=7;break;case 5:return e.next=7,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName,lens:t});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},computed:{filterParameter:function(){return this.resourceName+"_filter"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(33);t.default={props:(0,r.mapProps)(["shownViaNewRelationModal","field","viaResource","viaResourceId","viaRelationship","resourceName","showHelpText"]),data:function(){return{value:""}},mounted:function(){var e=this;this.setInitialValue(),this.field.fill=this.fill,Nova.$on(this.field.attribute+"-value",(function(t){e.value=t}))},destroyed:function(){Nova.$off(this.field.attribute+"-value")},methods:{setInitialValue:function(){this.value=void 0!==this.field.value&&null!==this.field.value?this.field.value:""},fill:function(e){e.append(this.field.attribute,String(this.value))},handleChange:function(e){this.value=e.target.value,this.field&&Nova.$emit(this.field.attribute+"-change",this.value)}},computed:{isReadonly:function(){return this.field.readonly||_.get(this.field,"extraAttributes.readonly")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35);t.default={props:{errors:{default:function(){return new r.Errors}}},data:function(){return{errorClass:"border-danger"}},computed:{errorClasses:function(){return this.hasError?[this.errorClass]:[]},fieldAttribute:function(){return this.field.attribute},validationKey:function(){return this.field.validationKey},hasError:function(){return this.errors.has(this.validationKey)},firstError:function(){if(this.hasError)return this.errors.first(this.validationKey)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=a(n(44)),o=a(n(43)),s=a(n(34));function a(e){return e&&e.__esModule?e:{default:e}}t.default={props:{loadCards:{type:Boolean,default:!0}},data:function(){return{cards:[]}},created:function(){this.fetchCards()},watch:{cardsEndpoint:function(){this.fetchCards()}},methods:{fetchCards:(r=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loadCards){e.next=6;break}return e.next=3,Nova.request().get(this.cardsEndpoint,{params:this.extraCardParams});case 3:t=e.sent,n=t.data,this.cards=n;case 6:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},computed:{shouldShowCards:function(){return this.cards.length>0},smallCards:function(){return _.filter(this.cards,(function(e){return-1!==s.default.indexOf(e.width)}))},largeCards:function(){return _.filter(this.cards,(function(e){return"full"==e.width}))},extraCardParams:function(){return null}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={methods:{toAppTimezone:function(e){return e?moment.tz(e,this.userTimezone).clone().tz(Nova.config.timezone).format("YYYY-MM-DD HH:mm:ss"):e},fromAppTimezone:function(e){return e?moment.tz(e,Nova.config.timezone).clone().tz(this.userTimezone).format("YYYY-MM-DD HH:mm:ss"):e},localizeDateTimeField:function(e){if(!e.value)return e.value;var t=moment.tz(e.value,Nova.config.timezone).clone().tz(this.userTimezone);return e.format?t.format(e.format):this.usesTwelveHourTime?t.format("YYYY-MM-DD h:mm:ss A"):t.format("YYYY-MM-DD HH:mm:ss")},localizeDateField:function(e){if(!e.value)return e.value;var t=moment.tz(e.value,Nova.config.timezone).clone().tz(this.userTimezone);return e.format?t.format(e.format):t.format("YYYY-MM-DD")}},computed:{userTimezone:function(){return Nova.config.userTimezone?Nova.config.userTimezone:moment.tz.guess()},usesTwelveHourTime:function(){return _.endsWith((new Date).toLocaleString(),"AM")||_.endsWith((new Date).toLocaleString(),"PM")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(188),o=(r=i)&&r.__esModule?r:{default:r};t.default={methods:{updateQueryString:function(e){this.$router.push({query:(0,o.default)(e,this.$route.query)}).catch((function(e){if("NavigationDuplicated"!=e.name)throw e}))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={computed:{resourceInformation:function(){var e=this;return _.find(Nova.config.resources,(function(t){return t.uriKey==e.resourceName}))},viaResourceInformation:function(){var e=this;if(this.viaResource)return _.find(Nova.config.resources,(function(t){return t.uriKey==e.viaResource}))},authorizedToCreate:function(){return this.resourceInformation.authorizedToCreate}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(20),o=(r=i)&&r.__esModule?r:{default:r};t.default={methods:{selectPreviousPage:function(){this.updateQueryString((0,o.default)({},this.pageParameter,this.currentPage-1))},selectNextPage:function(){this.updateQueryString((0,o.default)({},this.pageParameter,this.currentPage+1))}},computed:{currentPage:function(){return parseInt(this.$route.query[this.pageParameter]||1)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(20),o=(r=i)&&r.__esModule?r:{default:r};t.default={data:function(){return{perPage:25}},methods:{initializePerPageFromQueryString:function(){this.perPage=this.currentPerPage},perPageChanged:function(){this.updateQueryString((0,o.default)({},this.perPageParameter,this.perPage))}},computed:{currentPerPage:function(){return this.$route.query[this.perPageParameter]||25}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(187),o=(r=i)&&r.__esModule?r:{default:r};t.default={data:function(){return{search:"",selectedResource:"",availableResources:[]}},methods:{selectResource:function(e){this.selectedResource=e,this.field&&Nova.$emit(this.field.attribute+"-change",this.selectedResource.value)},handleSearchCleared:function(){this.availableResources=[]},clearSelection:function(){this.selectedResource="",this.availableResources=[],this.field&&Nova.$emit(this.field.attribute+"-change",null)},performSearch:function(e){var t=this;this.search=e;var n=e.trim();""!=n&&this.debouncer((function(){t.getAvailableResources(n)}),500)},debouncer:(0,o.default)((function(e){return e()}),500)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={beforeRouteLeave:function(e,t,n){this.canLeave||window.confirm(this.__("Do you really want to leave? You have unsaved changes."))?n():n(!1)},data:function(){return{canLeave:!0}},methods:{updateFormStatus:function(){this.canLeave=!1}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{withTrashed:!1}},methods:{toggleWithTrashed:function(){this.withTrashed=!this.withTrashed},enableWithTrashed:function(){this.withTrashed=!0},disableWithTrashed:function(){this.withTrashed=!1}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,o.default)(e)};var r,i=n(199),o=(r=i)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(42),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return o.default.all([e,new o.default((function(e){setTimeout((function(){return e()}),t)}))]).then((function(e){return e[0]}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,s.default)(t)&&null==t.match(/^(.*)[A-Za-zÀ-ÖØ-öø-ÿ]$/)?t:e>1||0==e?i.Inflector.pluralize(t):i.Inflector.singularize(t)};var r,i=n(41),o=n(191),s=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";var r={uncountableWords:["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"],pluralRules:[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]],singularRules:[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]],nonTitlecasedWords:["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"],idSuffix:new RegExp("(_ids|_id)$","g"),underbar:new RegExp("_","g"),spaceOrUnderbar:new RegExp("[ _]","g"),uppercase:new RegExp("([A-Z])","g"),underbarPrefix:new RegExp("^_"),applyRules:function(e,t,n,r){if(r)e=r;else if(!(n.indexOf(e.toLowerCase())>-1))for(var i=0;i>8-s%1*8)){if((n=i.charCodeAt(s+=3/4))>255)throw new r;t=t<<8|n}return o}},function(e,t,n){"use strict";var r=n(0);function i(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 o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var s=[];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)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}return o&&(e+=(-1===e.indexOf("?")?"?":"&")+o),e}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.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){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(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=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";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){"use strict";var r=n(0),i=["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,o,s={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){e.exports={default:n(111),__esModule:!0}},function(e,t,n){e.exports={default:n(112),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(108),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default||function(e){for(var t=1;tc;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(16),i=n(121),o=n(120),s=n(4),a=n(57),l=n(140),u={},c={};(t=e.exports=function(e,t,n,d,f){var h,p,m,g,_=f?function(){return e}:l(e),v=r(n,d,t?2:1),b=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(h=a(e.length);h>b;b++)if((g=t?v(s(p=e[b])[0],p[1]):v(e[b]))===u||g===c)return g}else for(m=_.call(e);!(p=m.next()).done;)if((g=i(m,v,p.value,t))===u||g===c)return g}).BREAK=u,t.RETURN=c},function(e,t,n){e.exports=!n(5)&&!n(23)((function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a}))},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(10),i=n(2)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(4);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(127),i=n(53),o=n(26),s={};n(7)(s,n(2)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(2)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(1),i=n(56).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,l="process"==n(15)(s);e.exports=function(){var e,t,n,u=function(){var r,i;for(l&&(r=s.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){s.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);n=function(){c.then(u)}}else n=function(){i.call(r,u)};else{var d=!0,f=document.createTextNode("");new o(u).observe(f,{characterData:!0}),n=function(){f.data=d=!d}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";var r=n(50),i=n(129),o=n(132),s=n(58),a=n(48),l=Object.assign;e.exports=!l||n(23)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){for(var n=s(e),l=arguments.length,u=1,c=i.f,d=o.f;l>u;)for(var f,h=a(arguments[u++]),p=c?r(h).concat(c(h)):r(h),m=p.length,g=0;m>g;)d.call(h,f=p[g++])&&(n[f]=h[f]);return n}:l},function(e,t,n){var r=n(4),i=n(128),o=n(46),s=n(27)("IE_PROTO"),a=function(){},l=function(){var e,t=n(22)("iframe"),r=o.length;for(t.style.display="none",n(47).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("