Version 5.0.0 beta 10
This commit is contained in:
1 parent
56979f8ee8
commit
264eeb97e0
325 files changed
+6442
-1849
No files matched your search
@@ -82,6 +82,9 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
// iFrame Sync
|
||||
document.getElementById('themeEditorIframe').addEventListener('load', e => this.iframeSync());
|
||||
|
||||
// Color scheme sync
|
||||
document.addEventListener("ips:colorScheme", this.closeColorPicker);
|
||||
|
||||
// Update value of "color-scheme" button if system setting changes, and preference was set to auto
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
||||
if (document.documentElement.getAttribute('data-ips-scheme-active') != 'system') return;
|
||||
@@ -136,9 +139,6 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
this.removeAttribute('data-loading');
|
||||
}, 3000);
|
||||
|
||||
// Update the active Color Scheme button
|
||||
this.querySelector(`[data-workspace='color'] [value='${document.documentElement.getAttribute("data-ips-scheme")}']`).setAttribute('data-active', true);
|
||||
|
||||
// Add custom setting UIs (header drag, etc)
|
||||
this.customSettingUIs();
|
||||
|
||||
@@ -243,15 +243,8 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
target.setAttribute('data-active', true);
|
||||
document.documentElement.setAttribute(`data-workspace-${type}`, target.value);
|
||||
}
|
||||
|
||||
// Update color scheme by clicking a color scheme button in the iframe
|
||||
if(type === 'color' && e.isTrusted){
|
||||
this.iframe.document.querySelector(`[data-ips-prefers-color-scheme=${target.value}]`).click();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Navigate through panels, and store the history in an array so we can 'go back'
|
||||
* @param {Event} event
|
||||
@@ -493,19 +486,14 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
|
||||
|
||||
/**
|
||||
* When a "change color-scheme" button inside the iframe is clicked, change the color of the theme editor.
|
||||
* @param {HTMLElement} target The 'prefers color scheme' button
|
||||
* When a "change color-scheme" button is clicked, close the color picker if it's open
|
||||
* @param {Event} event The event
|
||||
*/
|
||||
colorSchemeSync(target){
|
||||
|
||||
document.querySelector('[data-ips-prefers-color-scheme=' + target.getAttribute('data-ips-prefers-color-scheme') + ']').click();
|
||||
|
||||
// .. update the value of the workspace options to either light/dark
|
||||
this.querySelector('[data-workspace=color] [value=' + document.documentElement.getAttribute('data-ips-scheme') +']').click();
|
||||
closeColorPicker(event){
|
||||
|
||||
// If we're editing a color setting (such as Body Background), and if we change color scheme, we need to flick back to the "color settings" list otherwise we'll be editing the wrong color
|
||||
if(this.currentPanel.matches('#panel__colorSelector')){
|
||||
this.currentPanel.querySelector('[data-panel-nav="back"]').click();
|
||||
if(document.querySelector("#panel__colorSelector[aria-hidden='false']")){
|
||||
document.querySelector('#panel__colorSelector [data-panel-nav="back"]').click();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1055,9 +1043,6 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
this.applyDataAttributes(attr, value);
|
||||
}
|
||||
|
||||
// Add click events to iframe (for color scheme sync)
|
||||
this.iframe.addEventListener('click', e => this.handleIframeClicks(e));
|
||||
|
||||
this.removeAttribute('data-loading');
|
||||
|
||||
}
|
||||
@@ -1081,16 +1066,6 @@ customElements.define('theme-editor', class extends HTMLElement {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle all iframe click events
|
||||
* @param {Event} e
|
||||
*/
|
||||
handleIframeClicks(e){
|
||||
let el;
|
||||
if(el = e.target.closest('[data-ips-prefers-color-scheme]')) this.colorSchemeSync(el);
|
||||
}
|
||||
|
||||
|
||||
/* Handle drag/reorder elements */
|
||||
handleDragStart(e) {
|
||||
e.currentTarget.setAttribute('data-dragging', true);
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
var ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var RA={exports:{}},Mf={},NA={exports:{}},Ye={};/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Fu=Symbol.for("react.element"),pF=Symbol.for("react.portal"),_F=Symbol.for("react.fragment"),fF=Symbol.for("react.strict_mode"),mF=Symbol.for("react.profiler"),gF=Symbol.for("react.provider"),hF=Symbol.for("react.context"),EF=Symbol.for("react.forward_ref"),SF=Symbol.for("react.suspense"),TF=Symbol.for("react.memo"),bF=Symbol.for("react.lazy"),MR=Symbol.iterator;function yF(e){return e===null||typeof e!="object"?null:(e=MR&&e[MR]||e["@@iterator"],typeof e=="function"?e:null)}var vA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},OA=Object.assign,AA={};function Rl(e,t,n){this.props=e,this.context=t,this.refs=AA,this.updater=n||vA}Rl.prototype.isReactComponent={};Rl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Rl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function IA(){}IA.prototype=Rl.prototype;function KS(e,t,n){this.props=e,this.context=t,this.refs=AA,this.updater=n||vA}var QS=KS.prototype=new IA;QS.constructor=KS;OA(QS,Rl.prototype);QS.isPureReactComponent=!0;var LR=Array.isArray,wA=Object.prototype.hasOwnProperty,XS={current:null},DA={key:!0,ref:!0,__self:!0,__source:!0};function xA(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)wA.call(t,r)&&!DA.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Fu,type:e,key:o,ref:s,props:i,_owner:XS.current}}function CF(e,t){return{$$typeof:Fu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jS(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fu}function RF(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kR=/\/+/g;function Ug(e,t){return typeof e=="object"&&e!==null&&e.key!=null?RF(""+e.key):t.toString(36)}function zp(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Fu:case pF:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Ug(s,0):r,LR(i)?(n="",e!=null&&(n=e.replace(kR,"$&/")+"/"),zp(i,t,n,"",function(u){return u})):i!=null&&(jS(i)&&(i=CF(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(kR,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",LR(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Ug(o,a);s+=zp(o,t,n,l,i)}else if(l=yF(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Ug(o,a++),s+=zp(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function jd(e,t,n){if(e==null)return e;var r=[],i=0;return zp(e,r,"","",function(o){return t.call(n,o,i++)}),r}function NF(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Un={current:null},Vp={transition:null},vF={ReactCurrentDispatcher:Un,ReactCurrentBatchConfig:Vp,ReactCurrentOwner:XS};function MA(){throw Error("act(...) is not supported in production builds of React.")}Ye.Children={map:jd,forEach:function(e,t,n){jd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return jd(e,function(){t++}),t},toArray:function(e){return jd(e,function(t){return t})||[]},only:function(e){if(!jS(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ye.Component=Rl;Ye.Fragment=_F;Ye.Profiler=mF;Ye.PureComponent=KS;Ye.StrictMode=fF;Ye.Suspense=SF;Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vF;Ye.act=MA;Ye.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=OA({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=XS.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)wA.call(t,l)&&!DA.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Fu,type:e.type,key:i,ref:o,props:r,_owner:s}};Ye.createContext=function(e){return e={$$typeof:hF,_currentValue:e,_currentValue2:e,_threadCountLine truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var OF=F,AF=Symbol.for("react.element"),IF=Symbol.for("react.fragment"),wF=Object.prototype.hasOwnProperty,DF=OF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xF={key:!0,ref:!0,__self:!0,__source:!0};function LA(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)wF.call(t,r)&&!xF.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:AF,type:e,key:o,ref:s,props:i,_owner:DF.current}}Mf.Fragment=IF;Mf.jsx=LA;Mf.jsxs=LA;RA.exports=Mf;var N=RA.exports,iE={},kA={exports:{}},mr={},PA={exports:{}},UA={};/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/(function(e){function t(w,G){var W=w.length;w.push(G);e:for(;0<W;){var J=W-1>>>1,re=w[J];if(0<i(re,G))w[J]=G,w[W]=re,W=J;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var G=w[0],W=w.pop();if(W!==G){w[0]=W;e:for(var J=0,re=w.length,De=re>>>1;J<De;){var He=2*(J+1)-1,be=w[He],Ie=He+1,it=w[Ie];if(0>i(be,W))Ie<re&&0>i(it,be)?(w[J]=it,w[Ie]=W,J=Ie):(w[J]=be,w[He]=W,J=He);else if(Ie<re&&0>i(it,W))w[J]=it,w[Ie]=W,J=Ie;else break e}}return G}function i(w,G){var W=w.sortIndex-G.sortIndex;return W!==0?W:w.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],p=1,_=null,f=3,g=!1,h=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(w){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=w)r(u),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(u)}}function A(w){if(E=!1,R(w),!h)if(n(l)!==null)h=!0,Ne(I);else{var G=n(u);G!==null&&x(A,G.startTime-w)}}function I(w,G){h=!1,E&&(E=!1,T($),$=-1),g=!0;var W=f;try{for(R(G),_=n(l);_!==null&&(!(_.expirationTime>G)||w&&!ae());){var J=_.callback;if(typeof J=="function"){_.callback=null,f=_.priorityLevel;var re=J(_.expirationTime<=G);G=e.unstable_now(),typeof re=="function"?_.callback=re:_===n(l)&&r(l),R(G)}else r(l);_=n(l)}if(_!==null)var De=!0;else{var He=n(u);He!==null&&x(A,He.startTime-G),De=!1}return De}finally{_=null,f=W,g=!1}}var M=!1,k=null,$=-1,z=5,H=-1;function ae(){return!(e.unstable_now()-H<z)}function fe(){if(k!==null){var w=e.unstable_now();H=w;var G=!0;try{G=k(!0,w)}finally{G?de():(M=!1,k=null)}}else M=!1}var de;if(typeof y=="function")de=function(){y(fe)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,ge=le.port2;le.port1.onmessage=fe,de=function(){ge.postMessage(null)}}else de=function(){b(fe,0)};function Ne(w){k=w,M||(M=!0,de())}function x(w,G){$=b(function(){w(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(w){w.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,Ne(I))},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(w){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var W=f;f=G;try{return w()}finally{f=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,G){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var W=f;f=w;try{return G()}finally{f=W}},e.unstable_scheduleCallback=function(w,G,W){var J=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,w){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=W+re,w={id:p++,callback:G,priorityLevel:w,startTime:W,expirationTime:re,sortIndex:-1},W>J?(w.sortIndex=W,t(u,w),n(l)===null&&w===n(u)&&(E?(T($),$=-1):E=!0,x(A,W-J))):(w.sortIndex=re,t(l,w),h||g||(h=!0,Ne(I))),w},e.unstable_shouldYield=ae,e.unstable_wrapCallback=function(w){var G=f;return function(){var W=f;f=G;try{return w.apply(this,arguments)}finally{f=W}}}})(UA);PA.exports=UA;var MF=PA.exports;/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var LF=F,fr=MF;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var BA=new Set,eu={};function ra(e,t){ll(e,t),ll(e+"Capture",t)}function ll(e,t){for(eu[e]=t,e=0;e<t.length;e++)BA.add(t[e])}var Qi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oE=Object.prototype.hasOwnProperty,kF=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,PR={},UR={};function PF(e){return oE.call(UR,e)?!0:oE.call(PR,e)?!1:kF.test(e)?UR[e]=!0:(PR[e]=!0,!1)}function UF(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function BF(e,t,n,r){if(t===null||typeof t>"u"||UF(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var ln={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ln[e]=new Bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ln[t]=new Bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ln[e]=new Bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ln[e]=new Bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ln[e]=new Bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ln[e]=new Bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ln[e]=new Bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ln[e]=new Bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ln[e]=new Bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ZS=/[\-:]([a-z])/g;function JS(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ZS,JS);ln[t]=new Bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ZS,JS);ln[t]=new Bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ZS,JS);ln[t]=new Bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ln[e]=new Bn(e,1,!1,e.toLowerCase(),null,!1,!1)});ln.xlinkHref=new Bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ln[e]=new Bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function eT(e,t,n,r){var i=ln.hasOwnProperty(t)?ln[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==
Line truncated
|
||||
`+Bg+e}var Fg=!1;function Gg(e,t){if(!e||Fg)return"";Fg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
||||
`),o=r.stack.split(`
|
||||
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
|
||||
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Fg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Rc(e):""}function FF(e){switch(e.tag){case 5:return Rc(e.type);case 16:return Rc("Lazy");case 13:return Rc("Suspense");case 19:return Rc("SuspenseList");case 0:case 2:case 15:return e=Gg(e.type,!1),e;case 11:return e=Gg(e.type.render,!1),e;case 1:return e=Gg(e.type,!0),e;default:return""}}function cE(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ka:return"Fragment";case La:return"Portal";case sE:return"Profiler";case tT:return"StrictMode";case aE:return"Suspense";case lE:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case GA:return(e.displayName||"Context")+".Consumer";case FA:return(e._context.displayName||"Context")+".Provider";case nT:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rT:return t=e.displayName||null,t!==null?t:cE(e.type)||"Memo";case To:t=e._payload,e=e._init;try{return cE(e(t))}catch{}}return null}function GF(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cE(t);case 8:return t===tT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function jo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function HA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YF(e){var t=HA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jd(e){e._valueTracker||(e._valueTracker=YF(e))}function $A(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=HA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function p_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function uE(e,t){var n=t.checked;return vt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function FR(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=jo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zA(e,t){t=t.checked,t!=null&&eT(e,"checked",t,!1)}function dE(e,t){zA(e,t);var n=jo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pE(e,t.type,n):t.hasOwnProperty("defaultValue")&&pE(e,t.type,jo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function GR(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pE(e,t,n){(t!=="number"||p_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nc=Array.isArray;function Ka(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+jo(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _E(e,t){if(t.dan
Line truncated
|
||||
`).replace(jG,"")}function ap(e,t,n){if(t=cN(t),cN(e)!==t&&n)throw Error(te(425))}function T_(){}var vE=null,OE=null;function AE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var IE=typeof setTimeout=="function"?setTimeout:void 0,ZG=typeof clearTimeout=="function"?clearTimeout:void 0,uN=typeof Promise=="function"?Promise:void 0,JG=typeof queueMicrotask=="function"?queueMicrotask:typeof uN<"u"?function(e){return uN.resolve(null).then(e).catch(eY)}:IE;function eY(e){setTimeout(function(){throw e})}function Jg(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ou(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ou(t)}function Ho(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function dN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var vl=Math.random().toString(36).slice(2),gi="__reactFiber$"+vl,uu="__reactProps$"+vl,Xi="__reactContainer$"+vl,wE="__reactEvents$"+vl,tY="__reactListeners$"+vl,nY="__reactHandles$"+vl;function ws(e){var t=e[gi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xi]||n[gi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dN(e);e!==null;){if(n=e[gi])return n;e=dN(e)}return t}e=n,n=e.parentNode}return null}function Hu(e){return e=e[gi]||e[Xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(te(33))}function Bf(e){return e[uu]||null}var DE=[],Ga=-1;function ss(e){return{current:e}}function gt(e){0>Ga||(e.current=DE[Ga],DE[Ga]=null,Ga--)}function ct(e,t){Ga++,DE[Ga]=e.current,e.current=t}var Zo={},Sn=ss(Zo),Xn=ss(!1),Ws=Zo;function cl(e,t){var n=e.type.contextTypes;if(!n)return Zo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function jn(e){return e=e.childContextTypes,e!=null}function b_(){gt(Xn),gt(Sn)}function pN(e,t,n){if(Sn.current!==Zo)throw Error(te(168));ct(Sn,t),ct(Xn,n)}function xI(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(te(108,GF(e)||"Unknown",i));return vt({},n,r)}function y_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zo,Ws=Sn.current,ct(Sn,e),ct(Xn,Xn.current),!0}function _N(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=xI(e,t,Ws),r.__reactInternalMemoizedMergedChildContext=e,gt(Xn),gt(Sn),ct(Sn,e)):gt(Xn),ct(Xn,n)}var Yi=null,Ff=!1,eh=!1;function MI(e){Yi===null?Yi=[e]:Yi.push(e)}function rY(e){Ff=!0,MI(e)}function as(){if(!eh&&Yi!==null){eh=!0;var e=0,t=et;try{var n=Yi;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Yi=null,Ff=!1}catch(i){throw Yi!==null&&(Yi=Yi.slice(e+1)),iI(oT,as),i}finally{et=t,eh=!1}}return null}var Ya=[],Ha=0,C_=null,R_=0,wr=[],Dr=0,qs=null,$i=1,zi="";function Rs(e,t){Ya[Ha++]=R_,Ya[Ha++]=C_,C_=e,R_=t}function LI(e,t,n){wr[Dr++]=$i,wr[Dr++]=zi,wr[Dr++]=qs,qs=e;var r=$i;e=zi;var i=32-Zr(r)-1;r&=~(1<<i),n+=1;var o=32-Zr(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,$i=1<<32-Zr(t)+i|n<<i|r,zi=o+e}else $i=1<<o|n<<i|r,zi=e}function fT(e){e.return!==null&&(Rs(e,1),LI(e,1,0))}function mT(e){for(;e===C_;)C_=Ya[--Ha],Ya[Ha]=null,R_=Ya[--Ha],Ya[Ha]=null;for(;e===qs;)qs=wr[--Dr],wr[Dr]=null,zi=wr[--Dr],wr[Dr]=null,$i=wr[--Dr],wr[Dr]=null}var _r=null,dr=null,Tt=!1,Qr=null;function kI(e,t){var n=Mr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fN(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_r=e,dr=Ho(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_r=e,dr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=qs!==null?{id:$i,overflow:zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Mr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_r=e,dr=null,!0):!1;default:return!1}}function xE(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ME(e){if(Tt){var t=dr;if(t){var n=t;if(!fN(e,t)){if(xE(e))throw Error(te(418));t=Ho(n.nextSibling);var r=_r;t&&fN(e,t)?kI(r,n):(e.flags=e.flags&-4097|2,Tt=!1,_r=e)}}else{if(xE(e))throw Error(te(418));e.flags=e.flags&-4097|2,Tt=!1,_r=e}}}function mN(e){
Line truncated
|
||||
Error generating stack: `+o.message+`
|
||||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function oh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function UE(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var pY=typeof WeakMap=="function"?WeakMap:Map;function lw(e,t,n){n=qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){x_||(x_=!0,qE=r),UE(e,t)},n}function cw(e,t,n){n=qi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){UE(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){UE(e,t),typeof r!="function"&&(zo===null?zo=new Set([this]):zo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function CN(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new pY;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=vY.bind(null,e,t,n),t.then(e,e))}function RN(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function NN(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=qi(-1,1),t.tag=2,$o(n,t,1))),n.lanes|=1),e)}var _Y=eo.ReactCurrentOwner,Qn=!1;function Dn(e,t,n,r){t.child=e===null?BI(t,null,n,r):dl(t,e.child,n,r)}function vN(e,t,n,r,i){n=n.render;var o=t.ref;return Za(t,i),r=vT(e,t,n,r,o,i),n=OT(),e!==null&&!Qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zi(e,t,i)):(Tt&&n&&fT(t),t.flags|=1,Dn(e,t,r,i),t.child)}function ON(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!UT(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,uw(e,t,o,r,i)):(e=t_(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:au,n(s,r)&&e.ref===t.ref)return Zi(e,t,i)}return t.flags|=1,e=Wo(o,r),e.ref=t.ref,e.return=t,t.child=e}function uw(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(au(o,r)&&e.ref===t.ref)if(Qn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Qn=!0);else return t.lanes=e.lanes,Zi(e,t,i)}return BE(e,t,n,r,i)}function dw(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(Va,cr),cr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ct(Va,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ct(Va,cr),cr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ct(Va,cr),cr|=r;return Dn(e,t,i,n),t.child}function pw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function BE(e,t,n,r,i){var o=jn(n)?Ws:Sn.current;return o=cl(t,o),Za(t,i),n=vT(e,t,n,r,o,i),r=OT(),e!==null&&!Qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zi(e,t,i)):(Tt&&r&&fT(t),t.flags|=1,Dn(e,t,n,i),t.child)}function AN(e,t,n,r,i){if(jn(n)){var o=!0;y_(t)}else o=!1;if(Za(t,i),t.stateNode===null)Zp(e,t),aw(t,n,r),PE(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ur(u):(u=jn(n)?Ws:Sn.current,u=cl(t,u));var p=n.getDerivedStateFromProps,_=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";_||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&yN(t,s,r,u),bo=!1;var f=t.memoizedState;s.state=f,O_(t,r,s,i),l=t.memoizedState,a!==r||f!==l||Xn.current||bo?(typeof p=="function"&&(kE(t,n,p,r),l=t.memoizedState),(a=bo||bN(t,n,a,r,f,l,u))?(_||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,GI(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:qr(t.type,a),s.props=u,_=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ur(l):(l=jn(n)?Ws:Sn.current,l=cl(t,l));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==_||f!==l)&&yN(t,s,r,l),bo=!1,f=t.memoizedState,s.state=f,O_(t,r,s,i);var h=t.memoizedS
Line truncated
|
||||
`)}}js.empty=new js(!0);class $Y{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function zw(e){let t=[];do t.push(zY(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function zY(e){let t=[];do t.push(VY(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function VY(e){let t=KY(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("{"))t=WY(e,t);else break;return t}function $N(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function WY(e,t){let n=$N(e),r=n;return e.eat(",")&&(e.next!="}"?r=$N(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function qY(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function KY(e){if(e.eat("(")){let t=zw(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=qY(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function QY(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let u={term:l,to:a};return t[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let p=n();i(o(s.expr,l),p),l=p}if(s.max==-1)i(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let p=n();r(l,p),i(o(s.expr,l),p),l=p}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Vw(e,t){return t-e}function zN(e,t){let n=[];return r(t),n.sort(Vw);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function XY(e){let t=Object.create(null);return n(zN(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let p=0;p<i.length;p++)i[p][0]==a&&(u=i[p][1]);zN(e,l).forEach(p=>{u||i.push([a,u=[]]),u.indexOf(p)==-1&&u.push(p)})})});let o=t[r.join(",")]=new js(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(Vw);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function jY(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ww(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function qw(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Kw(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function Qw(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new JY(e,r,t[r]);return n}let VN=class Xw{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Qw(t,r.attrs),this.defaultAttrs=Ww(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==js.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultA
Line truncated
|
||||
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=t.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;Jw.hasOwnProperty(s)&&this.parser.normalizeLists&&rH(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:nH.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,p=this.needsBlock;if(Zw.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let _=l&&l.skip?n:this.readStyles(t,n);_&&this.addAll(t,_),u&&this.sync(o),this.needsBlock=p}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
||||
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(t);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=nt.none;for(let s of r.concat(t.marks))(i.type?i.type.allowsMarkType(s.type):XN(s.type,t.type))&&(o=s.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=qN(t,o,s.options);s.options&zc&&s.content.length==0&&(a|=zc);let l=nt.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):XN(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new mp(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Eu)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let p=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!p||p.name!=u&&!p.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function rH(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Jw.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function iH(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function
Line truncated
|
||||
`))}})}function hH(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function EH(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 Xt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new oe(j.from(s),0,0),1,!0))}function tl(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,p=n-2;u>o;u--,p--){let _=i.node(u),f=i.index(u);if(_.type.spec.isolating)return!1;let g=_.content.cutByIndex(f,_.childCount),h=r&&r[p+1];h&&(g=g.replaceChild(0,h.type.create(h.attrs)));let E=r&&r[p]||_;if(!_.canReplace(f+1,_.childCount)||!E.type.validContent(g))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 SH(e,t,n=1,r){let i=e.doc.resolve(t),o=j.empty,s=j.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=j.from(i.node(a).copy(o));let p=r&&r[u];s=j.from(p?p.type.create(p.attrs,s):i.node(a).copy(s))}e.step(new qt(t,t,new oe(o.append(s),n,n),!0))}function ls(e,t){let n=e.resolve(t),r=n.index();return aD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function TH(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function aD(e,t){return!!(e&&t&&!e.isLeaf&&TH(e,t))}function Xf(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&aD(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function bH(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let p=s.whitespace=="pre",_=!!s.contentMatch.matchType(i);p&&!_?r=!1:!p&&_&&(r=!0)}let a=e.steps.length;if(r===!1){let p=e.doc.resolve(t+n);sD(e,p.node(),p.before(),a)}s.inlineContent&&$T(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new qt(u,l.map(t+n,-1),oe.empty,!0)),r===!0){let p=e.doc.resolve(u);oD(e,p.node(),p.before(),e.steps.length)}return e}function yH(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function CH(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),p=!1;if(o==1)p=u.canReplace(l,l,i);else{let _=u.contentMatchAt(l).findWrapping(i.firstChild.type);p=_&&u.canReplaceWith(l,l,_[0])}if(p)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function jf(e,t,n=t,r=oe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return lD(i,o,r)?new qt(t,n,r):new RH(i,o,r).fit()}function lD(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class RH{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=j.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new oe(o,s,a);return t>-1?new Xt(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new qt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n+
Line truncated
|
||||
`),_&&h==g.nodeValue.length)for(let E=g,b;E;E=E.parentNode){if(b=E.nextSibling){b.nodeName=="BR"&&(a=l={node:b.parentNode,offset:on(b)+1});break}let T=E.pmViewDesc;if(T&&T.node&&T.node.isBlock)break}}else{let E=g.childNodes[h-1];_=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(ri&&p.focusNode&&p.focusNode!=l.node&&p.focusNode.nodeType==1){let g=p.focusNode.childNodes[p.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||_&&Ln)&&Zs(a.node,a.offset,p.anchorNode,p.anchorOffset)&&Zs(l.node,l.offset,p.focusNode,p.focusOffset))return;let f=!1;if((u.extend||t==n)&&!_){u.collapse(a.node,a.offset);try{t!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let h=a;a=l,l=h}let g=document.createRange();g.setEnd(l.node,l.offset),g.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(g)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?Ms:fv,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=yi:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ms:yi}r=s}this.dirty=Ms}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Ms:fv;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class CD extends qu{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Pr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||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 r2 extends qu{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Js extends qu{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=oa.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Js(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&yi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=yi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Pr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Pr}}slice(t,n,r){let i=Js.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=cS(o,n,s,r)),t>0&&(o=cS(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Qo extends qu{constructor(t,n,r,i,o,s,a,l,u){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),p=u&&u.dom,_=u&&u.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:_}=oa.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!_&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let f=p;return p=OD(p,r,n),u?l=new i2(t,n,r,i,p,_||null,f,u,o,s+1):n.isText?new em(t,n,r,i,p,f,o):new Qo(t,n,r,i,p,_||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>j.empty)}return t}matchesNode(t,n,r){return this.dirty==Pr&&t.eq(this.
Line truncated
|
||||
|
||||
`);return{dom:l,text:f,slice:t}}function MD(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,o||r,e)}),o)return t?new oe(j.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
||||
`))),0,0):oe.empty;let _=e.someProp("clipboardTextParser",f=>f(t,i,r,e));if(_)a=_;else{let f=i.marks(),{schema:g}=e.state,h=oa.fromSchema(g);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(E=>{let b=s.appendChild(document.createElement("p"));E&&b.appendChild(h.serializeNode(g.text(E,f)))})}}else e.someProp("transformPastedHTML",_=>{n=_(n,e)}),s=N2(n),Wu&&v2(s);let u=s&&s.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let _=+p[3];_>0;_--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||$c.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||p),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!y2.test(f.parentNode.nodeName)?{ignore:!0}:null}})),p)a=O2(Ov(a,+p[1],+p[2]),p[4]);else if(a=oe.maxOpen(C2(a.content,i),!0),a.openStart||a.openEnd){let _=0,f=0;for(let g=a.content.firstChild;_<a.openStart&&!g.type.spec.isolating;_++,g=g.firstChild);for(let g=a.content.lastChild;f<a.openEnd&&!g.type.spec.isolating;f++,g=g.lastChild);a=Ov(a,_,f)}return e.someProp("transformPasted",_=>{a=_(a,e)}),a}const y2=/^(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 C2(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&kD(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=PD(s[s.length-1],o.length));let p=LD(a,l);s.push(p),i=i.matchType(p.type),o=l}}),s)return j.from(s)}return e}function LD(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,j.from(e));return e}function kD(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=kD(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(j.from(LD(n,e,i+1))))}}function PD(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,PD(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(j.empty,!0);return e.copy(n.append(r))}function pS(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=pS(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(j.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Ov(e,t,n){return t<e.openStart&&(e=new oe(pS(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new oe(pS(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const UD={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Av=null;function BD(){return Av||(Av=document.implementation.createHTMLDocument("title"))}let Sh=null;function R2(e){let t=window.trustedTypes;return t?(Sh||(Sh=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Sh.createHTML(e)):e}function N2(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=BD().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&UD[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=R2(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function v2(e){let t=e.querySelectorAll(hn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function O2(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=j.from(l.create(r[a+1],i)),o++,s++}return new oe(i,o,s)}const kn={},Pn={},A2={touchstart:!0,touchmove:!0};class I2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function w2(e){for(let t in kn){let n=kn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{x2(e,r)&&!XT(e,r)&&(e.editable||!(r.type in Pn))&&n(e,r)},A2[t]?{passive:!0}:void 0)}Ln&&e.dom.addEventListener("input",()=>null),
Line truncated
|
||||
`).scrollIntoView()),!0)};function JD(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const D$=(e,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=JD(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Oe.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},x$=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ei||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=JD(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(Se.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},M$=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(tl(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ol(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},L$=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Te.create(e.doc,i))),!0)};function k$(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!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||ls(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function ex(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&k$(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let g=t.pos+o.nodeSize,h=j.empty;for(let T=s.length-1;T>=0;T--)h=j.from(s[T].create(null,h));h=j.from(i.copy(h));let E=e.tr.step(new Xt(t.pos-1,g,t.pos,g,new oe(h,1,0),s.length,!0)),b=E.doc.resolve(g+2*s.length);b.nodeAfter&&b.nodeAfter.type==i.type&&ls(E.doc,b.pos)&&E.join(b.pos),n(E.scrollIntoView())}return!0}let p=o.type.spec.isolating||r>0&&l?null:Oe.findFrom(t,1),_=p&&p.$from.blockRange(p.$to),f=_&&Ol(_);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(_,f).scrollIntoView()),!0;if(u&&El(o,"start",!0)&&El(i,"end")){let g=i,h=[];for(;h.push(g),!g.isTextblock;)g=g.lastChild;let E=o,b=1;for(;!E.isTextblock;E=E.firstChild)b++;if(g.canReplace(g.childCount,g.childCount,E.content)){if(n){let T=j.empty;for(let R=h.length-1;R>=0;R--)T=j.from(h[R].copy(T));let y=e.tr.step(new Xt(t.pos-h.length,t.pos+o.nodeSize,t.pos+b,t.pos+o.nodeSize-b,new oe(T,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function tx(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(Se.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const P$=tx(-1),U$=tx(1);function B$(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&zT(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Gv(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let p=n.doc.resolve(u),_=p.index();i=p.parent.canReplaceWith(_,_+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function F$(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return G$(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function G$(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new F_(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new F_(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=zT(o,n,r,t);return a?(e&&Y$(e,t,a,i,n),!0):!1}function Y$(e,t,n,r,i){let o=j.empty;for(let p=n.length-1;p>=0;p--)o=j.from(n[p].type.create(n[p].attrs,o));e.step(new Xt(t.start-(r?2:0),t.end,t.start,t.end,new oe(o,0,0),n.length,!0));let s=0;for(let p=0;p<n.length;p++)n[p].type==i&&(s=p+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let p=t.startIndex,_=t.endIndex,f=!0;p<_;p++,f=!1)!f&&tl(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(p).nodeSize;return e}function H$(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type=
Line truncated
|
||||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function J$(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ep(e){return J$(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function om(e,t){const n={...e};return Ep(e)&&Ep(t)&&Object.keys(t).forEach(r=>{Ep(t[r])&&Ep(e[r])?n[r]=om(e[r],t[r]):n[r]=t[r]}),n}class cn{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&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=Be(_e(this,"addOptions",{name:this.name}))),this.storage=Be(_e(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new cn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>om(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new cn(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(_e(n,"addOptions",{name:n.name})),n.storage=Be(_e(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}function ez(e){return typeof e=="number"}class tz{constructor(t){this.find=t.find,this.handler=t.handler}}const nz=(e,t,n)=>{if(rb(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function rz(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:p}=new rm({editor:t,state:n}),_=[];return n.doc.nodesBetween(r,i,(g,h)=>{if(!g.isTextblock||g.type.spec.code)return;const E=Math.max(r,h),b=Math.min(i,h+g.content.size),T=g.textBetween(E-h,b-h,void 0,"");nz(T,o.find,s).forEach(R=>{if(R.index===void 0)return;const A=E+R.index+1,I=A+R[0].length,M={from:n.tr.mapping.map(A),to:n.tr.mapping.map(I)},k=o.handler({state:n,range:M,match:R,commands:l,chain:u,can:p,pasteEvent:s,dropEvent:a});_.push(k)})}),_.every(g=>g!==null)}const iz=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function oz(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:p,from:_,to:f,rule:g,pasteEvt:h})=>{const E=p.tr,b=nm({state:p,transaction:E});if(!(!rz({editor:t,state:b,from:Math.max(_-1,0),to:f.b-1,rule:g,pasteEvent:h,dropEvent:a})||!E.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(p=>new je({view(_){const f=g=>{var h;r=!((h=_.dom.parentElement)===null||h===void 0)&&h.contains(g.target)?_.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(_,f)=>(o=r===_.dom.parentElement,a=f,!1),paste:(_,f)=>{var g;const h=(g=f.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(_,f,g)=>{const h=_[0],E=h.getMeta("uiEvent")==="paste"&&!i,b=h.getMeta("uiEvent")==="drop"&&!o,T=h.getMeta("applyPasteRules"),y=!!T;if(!E&&!b&&!y)return;if(y){let{text:I}=T;typeof I=="string"?I=I:I=Ku(j.from(I),g.schema);const{from:M}=T,k=M+I.length,$=iz(I);return l({rule:p,state:g,from:M,to:{b:k},pasteEvt:$})}const R=f.doc.content.findDiffStart(g.doc.content),A=f.doc.content.findDiffEnd(g.doc.content);if(!(!ez(R)||!A||R===A.b))return l({rule:p,state:g,from:R,to:A,pasteEvt:s})}}))}function sz(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class qa{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=qa.resolve(t),this.schema=Q$(this.extensions,n),this.setupExtensions()}static resolve(t){const n=qa.sort(qa.flatten(t)),r=sz(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'
Line truncated
|
||||
|
||||
`,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(l,u,p,_)=>{var f;l.isBlock&&u>r&&(a+=o);const g=s==null?void 0:s[l.type.name];if(g)return p&&(a+=g({node:l,pos:u,parent:p,index:_,range:t})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(r,u)-u,i-u))}),a}function ox(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const az=bt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new je({key:new Qe("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(p=>p.$from.pos)),a=Math.max(...o.map(p=>p.$to.pos)),l=ox(n);return ix(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),lz=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),cz=(e=!1)=>({commands:t})=>t.setContent("",e),uz=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:p}=t,_=u.resolve(p.map(l)),f=u.resolve(p.map(l+a.nodeSize)),g=_.blockRange(f);if(!g)return;const h=Ol(g);if(a.type.isTextblock){const{defaultType:E}=_.parent.contentMatchAt(_.index());t.setNodeMarkup(g.start,E)}(h||h===0)&&t.lift(g,h)})}),!0},dz=e=>t=>e(t),pz=()=>({state:e,dispatch:t})=>x$(e,t),_z=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Se(r.doc.resolve(s-1))),!0},fz=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},mz=e=>({tr:t,state:n,dispatch:r})=>{const i=Zt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},gz=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},hz=()=>({state:e,dispatch:t})=>T$(e,t),Ez=()=>({commands:e})=>e.keyboardShortcut("Enter"),Sz=()=>({state:e,dispatch:t})=>D$(e,t);function K_(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:rb(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function sx(e,t,n={}){return e.find(r=>r.type===t&&K_(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function zv(e,t,n={}){return!!sx(e,t,n)}function ib(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!sx([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,l=s+1,u=a+i.node.nodeSize;for(;s>0&&zv([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&zv([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function us(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Tz=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=us(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:p}=a;if(i){const _=ib(l,o,t);if(_&&_.from<=u&&_.to>=p){const f=Se.create(s,_.from,_.to);n.setSelection(f)}}return!0},bz=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function ax(e){return e instanceof Se}function Lo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function lx(e,t=null){if(!t)return null;const n=Oe.atStart(e),r=Oe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Se.create(e,Lo(0,i,o),Lo(e.content.size,i,o)):Se.create(e,Lo(t,i,o),Lo(t,i,o))}function sm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const yz=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{sm()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!ax(n.state.selection))return s(),!0;const a=lx(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},Cz=(e,t)=>n=>e.every((r,i)=>t
Line truncated
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ProseMirror {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
white-space: break-spaces;
|
||||
-webkit-font-variant-ligatures: none;
|
||||
font-variant-ligatures: none;
|
||||
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
||||
}
|
||||
|
||||
.ProseMirror [contenteditable="false"] {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.ProseMirror pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
img.ProseMirror-separator {
|
||||
display: inline !important;
|
||||
border: none !important;
|
||||
margin: 0 !important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
}
|
||||
|
||||
.ProseMirror-gapcursor {
|
||||
display: none;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ProseMirror-gapcursor:after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
width: 20px;
|
||||
border-top: 1px solid black;
|
||||
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
||||
}
|
||||
|
||||
@keyframes ProseMirror-cursor-blink {
|
||||
to {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.ProseMirror-hideselection *::selection {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.ProseMirror-hideselection *::-moz-selection {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.ProseMirror-hideselection * {
|
||||
caret-color: transparent;
|
||||
}
|
||||
|
||||
.ProseMirror-focused .ProseMirror-gapcursor {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tippy-box[data-animation=fade][data-state=hidden] {
|
||||
opacity: 0
|
||||
}`;function kV(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}class PV extends W${constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},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=kV(LV,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=rx(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var t,n;const i=[...this.options.enableCoreExtensions?[IV,az.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),OV,wV,DV,MV,AV,xV].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new qa(i,this)}createCommandManager(){this.commandManager=new rm({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=fS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=fS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=lx(n,this.options.autofocus);this.view=new u$(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Wa.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isC
Line truncated
|
||||
|
||||
`,textSerializers:r={}}=t||{};return eV(this.state.doc,{blockSeparator:n,textSerializers:{...ox(this.schema),...r}})}get isEmpty(){return lb(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(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new As(n,this)}get $doc(){return this.$pos(0)}}function ea(e){return new Qu({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),p=u+s.length;if(ab(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(E=>E===e.type&&E!==g.mark.type)).filter(g=>g.to>u).length)return null;p<n.to&&o.delete(p,n.to),u>n.from&&o.delete(n.from+l,u);const f=n.from+l+s.length;o.addMark(n.from+l,f,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function _x(e){return new Qu({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Be(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let p=s+u;p>a?p=a:a=p+r[1].length;const _=r[0][r[0].length-1];o.insertText(_,s+r[0].length-1),o.replaceWith(p,a,l)}else if(r[0]){const u=e.type.isInline?s:s-1;o.insert(u,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function hS(e){return new Qu({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Be(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 xt(e){return new Qu({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const l=o-s;l>0&&(i=r[0].slice(a-l,a)+i,o=s)}t.tr.insertText(i,o,s)}})}function Nu(e){return new Qu({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Be(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&zT(l,e.type,o);if(!u)return null;if(s.wrap(l,u),e.keepMarks&&e.editor){const{selection:_,storedMarks:f}=t,{splittableMarks:g}=e.editor.extensionManager,h=f||_.$to.parentOffset&&_.$from.marks();if(h){const E=h.filter(b=>g.includes(b.type.name));s.ensureMarks(E)}}if(e.keepAttributes){const _=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(_,o).run()}const p=s.doc.resolve(n.from-1).nodeBefore;p&&p.type===e.type&&ls(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,p))&&s.join(n.from-1)}})}class rt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&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=Be(_e(this,"addOptions",{name:this.name}))),this.storage=Be(_e(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new rt(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>om(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new rt(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Be(_e(n,"addOptions",{name:n.name})),n.storage=Be(_e(n,"addStorage",{name:n.name,options:n.options})),n}}function UV(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class BV{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,s,a,l;const{view:u}=this.editor,p=t.target,_=p.nodeType===3?(n=p.parentElement)===null||n===void 0?
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Kv;function YV(){if(Kv)return Oh;Kv=1;var e=St;function t(_,f){return _===f&&(_!==0||1/_===1/f)||_!==_&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(_,f){var g=f(),h=r({inst:{value:g,getSnapshot:f}}),E=h[0].inst,b=h[1];return o(function(){E.value=g,E.getSnapshot=f,l(E)&&b({inst:E})},[_,g,f]),i(function(){return l(E)&&b({inst:E}),_(function(){l(E)&&b({inst:E})})},[_]),s(g),g}function l(_){var f=_.getSnapshot;_=_.value;try{var g=f();return!n(_,g)}catch{return!0}}function u(_,f){return f()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Oh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Oh}fx.exports=YV();var cb=fx.exports;const HV=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},$V=({contentComponent:e})=>{const t=cb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return St.createElement(St.Fragment,null,Object.values(t))};function zV(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:UY.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class VV extends St.Component{constructor(t){var n;super(t),this.editorContentRef=St.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=zV(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return St.createElement(St.Fragment,null,St.createElement("div",{ref:HV(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&St.createElement($V,{contentComponent:t.contentComponent}))}}const WV=F.forwardRef((e,t)=>{const n=St.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return St.createElement(VV,{key:n,innerRef:t,...e})}),qV=St.memo(WV);var KV=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},QV=GV(KV),mx={exports:{}},Ah={};/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim/with-selector.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Qv;function XV(){if(Qv)return Ah;Qv=1;var e=St,t=cb;function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Ah.useSyncExternalStoreWithSelector=function(u,p,_,f,g){var h=o(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=a(function(){function T(M){if(!y){if(y=!0,R=M,M=f(M),g!==void 0&&E.hasValue){var k=E.value;if(g(k,M))return A=k}return A=M}if(k=A,r(R,M))return k;var $=f(M);return g!==void 0&&g(k,$)?k:(R=M,A=$)}var y=!1,R,A,I=_===void 0?null:_;return[function(){return T(p())},I===null?void 0:function(){return T(I())}]},[p,_,f,g]);var b=i(u,h[0],h[1]);return s(function(){E.hasValue=!0,E.value=b},[b]),l(b),b},Ah}mx.exports=XV();var jV=mx.exports;const ZV=typeof window<"u"?F.useLayoutEffect:F.useEffect;class JV{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function eW(e){var t;const[n]=F.useState(()=>new JV(e.editor)),r=jV.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:QV);return ZV(()=>n.watch(e.editor),[e.editor,n]),F.useDebugValue(r),r}const tW=!1,ES=typeof window>"u",nW=ES||!!(typeof window<"u"&&window.next);class rW{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return ES||nW?null:this.createEditor();if(this.options.current.immediatelyRender&&ES&&tW)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new PV(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?this.editor.setOptions({...this.options.curreLine truncated
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/X_.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,p="__lodash_placeholder__",_=1,f=2,g=4,h=1,E=2,b=1,T=2,y=4,R=8,A=16,I=32,M=64,k=128,$=256,z=512,H=30,ae="...",fe=800,de=16,le=1,ge=2,Ne=3,x=1/0,w=9007199254740991,G=17976931348623157e292,W=NaN,J=4294967295,re=J-1,De=J>>>1,He=[["ary",k],["bind",b],["bindKey",T],["curry",R],["curryRight",A],["flip",z],["partial",I],["partialRight",M],["rearg",$]],be="[object Arguments]",Ie="[object Array]",it="[object AsyncFunction]",ot="[object Boolean]",xe="[object Date]",Ee="[object DOMException]",Rn="[object Error]",Fn="[object Function]",oi="[object GeneratorFunction]",pt="[object Map]",qe="[object Number]",Ze="[object Null]",Jt="[object Object]",Fr="[object Promise]",ne="[object Proxy]",hr="[object RegExp]",ve="[object Set]",he="[object String]",Nn="[object Symbol]",$t="[object Undefined]",Gn="[object WeakMap]",si="[object WeakSet]",Y="[object ArrayBuffer]",K="[object DataView]",ie="[object Float32Array]",pe="[object Float64Array]",Fe="[object Int8Array]",ht="[object Int16Array]",no="[object Int32Array]",ro="[object Uint8Array]",Ju="[object Uint8ClampedArray]",ed="[object Uint16Array]",td="[object Uint32Array]",$b=/\b__p \+= '';/g,zb=/\b(__p \+=) '' \+/g,Vb=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gm=/&(?:amp|lt|gt|quot|#39);/g,hm=/[&<>"']/g,Wb=RegExp(gm.source),qb=RegExp(hm.source),Kb=/<%-([\s\S]+?)%>/g,Qb=/<%([\s\S]+?)%>/g,Em=/<%=([\s\S]+?)%>/g,Xb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jb=/^\w*$/,Zb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nd=/[\\^$.*+?()[\]{}|]/g,Jb=RegExp(nd.source),rd=/^\s+/,ey=/\s/,ty=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ny=/\{\n\/\* \[wrapped with (.+)\] \*/,ry=/,? & /,iy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oy=/[()=,{}\[\]\/\s]/,sy=/\\(\\)?/g,ay=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sm=/\w*$/,ly=/^[-+]0x[0-9a-f]+$/i,cy=/^0b[01]+$/i,uy=/^\[object .+?Constructor\]$/,dy=/^0o[0-7]+$/i,py=/^(?:0|[1-9]\d*)$/,_y=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kl=/($^)/,fy=/['\n\r\u2028\u2029\\]/g,Pl="\\ud800-\\udfff",my="\\u0300-\\u036f",gy="\\ufe20-\\ufe2f",hy="\\u20d0-\\u20ff",Tm=my+gy+hy,bm="\\u2700-\\u27bf",ym="a-z\\xdf-\\xf6\\xf8-\\xff",Ey="\\xac\\xb1\\xd7\\xf7",Sy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ty="\\u2000-\\u206f",by=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Cm="A-Z\\xc0-\\xd6\\xd8-\\xde",Rm="\\ufe0e\\ufe0f",Nm=Ey+Sy+Ty+by,id="['’]",yy="["+Pl+"]",vm="["+Nm+"]",Ul="["+Tm+"]",Om="\\d+",Cy="["+bm+"]",Am="["+ym+"]",Im="[^"+Pl+Nm+Om+bm+ym+Cm+"]",Bl="\\ud83c[\\udffb-\\udfff]",wm="(?:"+Ul+"|"+Bl+")",od="[^"+Pl+"]",Fl="(?:\\ud83c[\\udde6-\\uddff]){2}",Gl="[\\ud800-\\udbff][\\udc00-\\udfff]",io="["+Cm+"]",sd="\\u200d",Yl="(?:"+Am+"|"+Im+")",ad="(?:"+io+"|"+Im+")",Hl="(?:"+id+"(?:d|ll|m|re|s|t|ve))?",ld="(?:"+id+"(?:D|LL|M|RE|S|T|VE))?",cd=wm+"?",$l="["+Rm+"]?",ca="(?:"+sd+"(?:"+[od,Fl,Gl].join("|")+")"+$l+cd+")*",zl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ud="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vl=$l+cd+ca,dd="(?:"+[Cy,Fl,Gl].join("|")+")"+Vl,Ry="(?:"+[od+Ul+"?",Ul,Fl,Gl,yy].join("|")+")",Ny=RegExp(id,"g"),yL=RegExp(Ul,"g"),Dm=RegExp(Bl+"(?="+Bl+")|"+Ry+Vl,"g"),CL=RegExp([io+"?"+Am+"+"+Hl+"(?="+[vm,io,"$"].join("|")+")",ad+"+"+ld+"(?="+[vm,io+Yl,"$"].join("|")+")",io+"?"+Yl+"+"+Hl,io+"+"+ld,ud,zl,Om,dd].join("|"),"g"),RL=RegExp("["+sd+Pl+Tm+Rm+"]"),NL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vL=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],OL=-1,_t={};_t[ie]=_t[pe]=_t[Fe]=_t[ht]=_t[no]=_t[ro]=_t[Ju]=_t[ed]=_t[td]=!0,_t[be]=_t[Ie]=_t[Y]=_t[ot]=_t[K]=_t[xe]=_t[Rn]=_t[Fn]=_t[pt]=_t[qe]=_t[Jt]=_t[hr]=_t[ve]=_t[he]=_t[Gn]=!1;var st={};st[be]=st[Ie]=st[Y]=st[K]=st[ot]=st[xe]=st[ie]=st[pe]=st[Fe]=st[ht]=st[no]=st[pt]=st[qe]=st[Jt]=st[hr]=st[ve]=st[he]=st[Nn]=st[ro]=st[Ju]=st[ed]=st[td]=!0,st[Rn]=st[Fn]=st[Gn]=!1;var AL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",Line truncated
|
||||
/* [wrapped with `+d+`] */
|
||||
`)}function zP(c){return we(c)||Ss(c)||!!(Ky&&c&&c[Ky])}function Ii(c,d){var m=typeof c;return d=d??w,!!d&&(m=="number"||m!="symbol"&&py.test(c))&&c>-1&&c%1==0&&c<d}function On(c,d,m){if(!yt(m))return!1;var S=typeof d;return(S=="number"?Hn(m)&&Ii(d,m.length):S=="string"&&d in m)?Hr(m[d],c):!1}function Eg(c,d){if(we(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||sr(c)?!0:jb.test(c)||!Xb.test(c)||d!=null&&c in tt(d)}function VP(c){var d=typeof c;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?c!=="__proto__":c===null}function Sg(c){var d=Gd(c),m=v[d];if(typeof m!="function"||!(d in $e.prototype))return!1;if(c===m)return!0;var S=mg(m);return!!S&&c===S[0]}function WP(c){return!!zy&&zy in c}var qP=gd?wi:Pg;function ic(c){var d=c&&c.constructor,m=typeof d=="function"&&d.prototype||fa;return c===m}function zC(c){return c===c&&!yt(c)}function VC(c,d){return function(m){return m==null?!1:m[c]===d&&(d!==n||c in tt(m))}}function KP(c){var d=Wd(c,function(S){return m.size===u&&m.clear(),S}),m=d.cache;return d}function QP(c,d){var m=c[1],S=d[1],C=m|S,O=C<(b|T|k),D=S==k&&m==R||S==k&&m==$&&c[7].length<=d[8]||S==(k|$)&&d[7].length<=d[8]&&m==R;if(!(O||D))return c;S&b&&(c[2]=d[2],C|=m&b?0:y);var L=d[3];if(L){var B=c[3];c[3]=B?OC(B,L,d[4]):L,c[4]=B?ao(c[3],p):d[4]}return L=d[5],L&&(B=c[5],c[5]=B?AC(B,L,d[6]):L,c[6]=B?ao(c[5],p):d[6]),L=d[7],L&&(c[7]=L),S&k&&(c[8]=c[8]==null?d[8]:un(c[8],d[8])),c[9]==null&&(c[9]=d[9]),c[0]=d[0],c[1]=C,c}function XP(c){var d=[];if(c!=null)for(var m in tt(c))d.push(m);return d}function jP(c){return Ed.call(c)}function WC(c,d,m){return d=Ft(d===n?c.length-1:d,0),function(){for(var S=arguments,C=-1,O=Ft(S.length-d,0),D=V(O);++C<O;)D[C]=S[d+C];C=-1;for(var L=V(d+1);++C<d;)L[C]=S[C];return L[d]=m(D),rr(c,this,L)}}function qC(c,d){return d.length<2?c:gs(c,Cr(d,0,-1))}function ZP(c,d){for(var m=c.length,S=un(d.length,m),C=Yn(c);S--;){var O=d[S];c[S]=Ii(O,m)?C[O]:n}return c}function Tg(c,d){if(!(d==="constructor"&&typeof c[d]=="function")&&d!="__proto__")return c[d]}var KC=XC(hC),oc=_k||function(c,d){return en.setTimeout(c,d)},bg=XC(bP);function QC(c,d,m){var S=d+"";return bg(c,$P(S,JP(GP(S),m)))}function XC(c){var d=0,m=0;return function(){var S=hk(),C=de-(S-m);if(m=S,C>0){if(++d>=fe)return arguments[0]}else d=0;return c.apply(n,arguments)}}function Hd(c,d){var m=-1,S=c.length,C=S-1;for(d=d===n?S:d;++m<d;){var O=rg(m,C),D=c[O];c[O]=c[m],c[m]=D}return c.length=d,c}var jC=KP(function(c){var d=[];return c.charCodeAt(0)===46&&d.push(""),c.replace(Zb,function(m,S,C,O){d.push(C?O.replace(sy,"$1"):S||m)}),d});function ci(c){if(typeof c=="string"||sr(c))return c;var d=c+"";return d=="0"&&1/c==-x?"-0":d}function Es(c){if(c!=null){try{return hd.call(c)}catch{}try{return c+""}catch{}}return""}function JP(c,d){return Sr(He,function(m){var S="_."+m[0];d&m[1]&&!pd(c,S)&&c.push(S)}),c.sort()}function ZC(c){if(c instanceof $e)return c.clone();var d=new br(c.__wrapped__,c.__chain__);return d.__actions__=Yn(c.__actions__),d.__index__=c.__index__,d.__values__=c.__values__,d}function e0(c,d,m){(m?On(c,d,m):d===n)?d=1:d=Ft(Me(d),0);var S=c==null?0:c.length;if(!S||d<1)return[];for(var C=0,O=0,D=V(Rd(S/d));C<S;)D[O++]=Cr(c,C,C+=d);return D}function t0(c){for(var d=-1,m=c==null?0:c.length,S=0,C=[];++d<m;){var O=c[d];O&&(C[S++]=O)}return C}function n0(){var c=arguments.length;if(!c)return[];for(var d=V(c-1),m=arguments[0],S=c;S--;)d[S-1]=arguments[S];return so(we(m)?Yn(m):[m],tn(d,1))}var r0=Ue(function(c,d){return Mt(c)?Jl(c,tn(d,1,Mt,!0)):[]}),i0=Ue(function(c,d){var m=Rr(d);return Mt(m)&&(m=n),Mt(c)?Jl(c,tn(d,1,Mt,!0),ye(m,2)):[]}),o0=Ue(function(c,d){var m=Rr(d);return Mt(m)&&(m=n),Mt(c)?Jl(c,tn(d,1,Mt,!0),n,m):[]});function s0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Me(d),Cr(c,d<0?0:d,S)):[]}function a0(c,d,m){var S=c==null?0:c.length;return S?(d=m||d===n?1:Me(d),d=S-d,Cr(c,0,d<0?0:d)):[]}function l0(c,d){return c&&c.length?Ld(c,ye(d,3),!0,!0):[]}function c0(c,d){return c&&c.length?Ld(c,ye(d,3),!0):[]}function u0(c,d,m,S){var C=c==null?0:c.length;return C?(m&&typeof m!="number"&&On(c,d,m)&&(m=0,S=C),nP(c,d,m,S)):[]}function JC(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Me(m);return C<0&&(C=Ft(S+C,0)),_d(c,ye(d,3),C)}function eR(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=S-1;return m!==n&&(C=Me(m),C=m<0?Ft(S+C,0):un(C,S-1)),_d(c,ye(d,3),C,!0)}function tR(c){var d=c==null?0:c.length;return d?tn(c,1):[]}function d0(c){var d=c==null?0:c.length;return d?tn(c,x):[]}function p0(c,d){var m=c==null?0:c.length;return m?(d=d===n?1:Me(d),tn(c,d)):[]}function _0(c){for(var d=-1,m=c==null?0:c.length,S={};++d<m;){var C=c[d];S[C[0]]=C[1]}return S}function nR(c){return c&&c.length?c[0]:n}function f0(c,d,m){var S=c==null?0:c.length;if(!S)return-1;var C=m==null?0:Me(m);return C<0&&(C=Ft(S+C,0)),ua(c,d,C)}function m0(c){var d=c==null?0:c.length;return d?Cr(c,0,-1):[]}var g0=Ue(function(c){var d=Et(c,lg);return d.length&&d[0]===c[0]?Zm(d):[]}),h0=Ue(
Line truncated
|
||||
`;c.replace(se,function(Re,Ge,ze,ar,An,lr){return ze||(ze=ar),Z+=c.slice(Q,lr).replace(fy,qL),Ge&&(L=!0,Z+=`' +
|
||||
__e(`+Ge+`) +
|
||||
'`),An&&(B=!0,Z+=`';
|
||||
`+An+`;
|
||||
__p += '`),ze&&(Z+=`' +
|
||||
((__t = (`+ze+`)) == null ? '' : __t) +
|
||||
'`),Q=lr+Re.length,Re}),Z+=`';
|
||||
`;var Ce=Je.call(d,"variable")&&d.variable;if(!Ce)Z=`with (obj) {
|
||||
`+Z+`
|
||||
}
|
||||
`;else if(oy.test(Ce))throw new Ae(a);Z=(B?Z.replace($b,""):Z).replace(zb,"$1").replace(Vb,"$1;"),Z="function("+(Ce||"obj")+`) {
|
||||
`+(Ce?"":`obj || (obj = {});
|
||||
`)+"var __t, __p = ''"+(L?", __e = _.escape":"")+(B?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+Z+`return __p
|
||||
}`;var Le=wR(function(){return Ke(O,me+"return "+Z).apply(n,D)});if(Le.source=Z,vg(Le))throw Le;return Le}function SB(c){return Xe(c).toLowerCase()}function TB(c){return Xe(c).toUpperCase()}function bB(c,d,m){if(c=Xe(c),c&&(m||d===n))return Fy(c);if(!c||!(d=or(d)))return c;var S=Gr(c),C=Gr(d),O=Gy(S,C),D=Yy(S,C)+1;return _o(S,O,D).join("")}function yB(c,d,m){if(c=Xe(c),c&&(m||d===n))return c.slice(0,$y(c)+1);if(!c||!(d=or(d)))return c;var S=Gr(c),C=Yy(S,Gr(d))+1;return _o(S,0,C).join("")}function CB(c,d,m){if(c=Xe(c),c&&(m||d===n))return c.replace(rd,"");if(!c||!(d=or(d)))return c;var S=Gr(c),C=Gy(S,Gr(d));return _o(S,C).join("")}function RB(c,d){var m=H,S=ae;if(yt(d)){var C="separator"in d?d.separator:C;m="length"in d?Me(d.length):m,S="omission"in d?or(d.omission):S}c=Xe(c);var O=c.length;if(da(c)){var D=Gr(c);O=D.length}if(m>=O)return c;var L=m-pa(S);if(L<1)return S;var B=D?_o(D,0,L).join(""):c.slice(0,L);if(C===n)return B+S;if(D&&(L+=B.length-L),Og(C)){if(c.slice(L).search(C)){var Q,X=B;for(C.global||(C=$m(C.source,Xe(Sm.exec(C))+"g")),C.lastIndex=0;Q=C.exec(X);)var Z=Q.index;B=B.slice(0,Z===n?L:Z)}}else if(c.indexOf(or(C),L)!=L){var se=B.lastIndexOf(C);se>-1&&(B=B.slice(0,se))}return B+S}function NB(c){return c=Xe(c),c&&Wb.test(c)?c.replace(gm,ek):c}var vB=Sa(function(c,d,m){return c+(m?" ":"")+d.toUpperCase()}),wg=DC("toUpperCase");function IR(c,d,m){return c=Xe(c),d=m?n:d,d===n?QL(c)?rk(c):GL(c):c.match(d)||[]}var wR=Ue(function(c,d){try{return rr(c,n,d)}catch(m){return vg(m)?m:new Ae(m)}}),OB=Ai(function(c,d){return Sr(d,function(m){m=ci(m),vi(c,m,Rg(c[m],c))}),c});function AB(c){var d=c==null?0:c.length,m=ye();return c=d?Et(c,function(S){if(typeof S[1]!="function")throw new Tr(s);return[m(S[0]),S[1]]}):[],Ue(function(S){for(var C=-1;++C<d;){var O=c[C];if(rr(O[0],this,S))return rr(O[1],this,S)}})}function IB(c){return eP(yr(c,_))}function Dg(c){return function(){return c}}function wB(c,d){return c==null||c!==c?d:c}var DB=MC(),xB=MC(!0);function zn(c){return c}function xg(c){return cC(typeof c=="function"?c:yr(c,_))}function MB(c){return dC(yr(c,_))}function LB(c,d){return pC(c,yr(d,_))}var kB=Ue(function(c,d){return function(m){return ec(m,c,d)}}),PB=Ue(function(c,d){return function(m){return ec(c,m,d)}});function Mg(c,d,m){var S=zt(d),C=Dd(d,S);m==null&&!(yt(d)&&(C.length||!S.length))&&(m=d,d=c,c=this,C=Dd(d,zt(d)));var O=!(yt(m)&&"chain"in m)||!!m.chain,D=wi(c);return Sr(C,function(L){var B=d[L];c[L]=B,D&&(c.prototype[L]=function(){var Q=this.__chain__;if(O||Q){var X=c(this.__wrapped__),Z=X.__actions__=Yn(this.__actions__);return Z.push({func:B,args:arguments,thisArg:c}),X.__chain__=Q,X}return B.apply(c,so([this.value()],arguments))})}),c}function UB(){return en._===this&&(en._=ck),this}function Lg(){}function BB(c){return c=Me(c),Ue(function(d){return _C(d,c)})}var FB=dg(Et),GB=dg(Ly),YB=dg(Pm);function DR(c){return Eg(c)?Um(ci(c)):hP(c)}function HB(c){return function(d){return c==null?n:gs(c,d)}}var $B=kC(),zB=kC(!0);function kg(){return[]}function Pg(){return!1}function VB(){return{}}function WB(){return""}function qB(){return!0}function KB(c,d){if(c=Me(c),c<1||c>w)return[];var m=J,S=un(c,J);d=ye(d),c-=J;for(var C=Gm(S,d);++m<c;)d(m);return C}function QB(c){return we(c)?Et(c,ci):sr(c)?[c]:Yn(jC(Xe(c)))}function XB(c){var d=++ak;return Xe(c)+d}var jB=Ud(function(c,d){return c+d},0),ZB=pg("ceil"),JB=Ud(function(c,d){return c/d},1),eF=pg("floor");function tF(c){return c&&c.length?wd(c,zn,jm):n}function nF(c,d){return c&&c.length?wd(c,ye(d,2),jm):n}function rF(c){return Uy(c,zn)}function iF(c,d){return Uy(c,ye(d,2))}function oF(c){return c&&c.length?wd(c,zn,tg):n}function sF(c,d){return c&&c.length?wd(c,ye(d,2),tg):n}var aF=Ud(function(c,d){return c*d},1),lF=pg("round"),cF=Ud(function(c,d){return c-d},0);function uF(c){return c&&c.length?Fm(c,zn):0}function dF(c,d){return c&&c.length?Fm(c,ye(d,2)):0}return v.after=M1,v.ary=lR,v.assign=TU,v.assignIn=yR,v.assignInWith=Xd,v.assignWith=bU,v.at=yU,v.before=cR,v.bind=Rg,v.bindAll=OB,v.bindKey=uR,v.castArray=V1,v.chain=oR,v.chunk=e0,v.compact=t0,v.concat=n0,v.cond=AB,v.conforms=IB,v.constant=Dg,v.countBy=u1,v.create=CU,v.curry=dR,v.curryRight=pR,v.debounce=_R,v.defaults=RU,v.defaultsDeep=NU,v.defer=L1,v.delay=k1,v.difference=r0,v.differenceBy=i0,v.differenceWith=o0,v.drop=s0,v.dropRight=a0,v.dropRightWhile=l0,v.dropWhile=c0,v.fill=u0,v.filter=p1,v.flatMap=m1,v.flatMapDeep=g1,v.flatMapDepth=h1,v.flatten=tR,v.flattenDeep=d0,v.flattenDepth=p0,v.flip=P1,v.flow=DB,v.flowRight=xB,v.fromPairs=_0,v.functions=xU,v.functionsIn=MU,v.groupBy=E1,v.initial=m0,v.intersection=g0,v.intersectionBy=h0,v.intersectionWith=E0,v.invert=kU,v.invertBy=PU,v.invokeMap=T1,v.iteratee=xg,v.keyBy=b1,v.keys=zt,v.keysIn=$n,v.map=zd,v.mapKeys=BU,v.mapValues=FU,v.matches=MB,v.matchesProperty=LB,v.memoize=Wd,v.merge=GU,v.mergeWith=CR,v.method=kB,v.methodOf=PB,v.mixin=Mg,v.negate=qd,v.nthArg=BB,v.omit=YU,v.omitBy=HU,v.once=U1,v.orderBy=y1,v.over=FB,v.overArgs=B1,v.overEvery=GB,v.overSome=YB,
Line truncated
|
||||
|
||||
`);return!o||!s?!1:e.chain().command(({tr:a})=>(a.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||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:u})=>(u.setSelection(Oe.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[hS({find:RW,type:this.type,getAttributes:e=>({language:e[1]})}),hS({find:NW,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new je({key:new Qe("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||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=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
|
||||
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Se.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function OW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vx(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&vx(n)}),e}let oO=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ox(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ko(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const AW="</span>",sO=e=>!!e.scope,IW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};let wW=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Ox(t)}openNode(t){if(!sO(t))return;const n=IW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){sO(t)&&(this.buffer+=AW)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}};const aO=(e={})=>{const t={children:[]};return Object.assign(t,e),t};let DW=class Ax{constructor(){this.rootNode=aO(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=aO({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Ax._collapse(n)}))}},xW=class extends DW{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new wW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function vu(e){return e?typeof e=="string"?e:e.source:null}function Ix(e){return aa("(?=",e,")")}function MW(e){return aa("(?:",e,")*")}function LW(e){return aa("(?:",e,")?")}function aa(...e){return e.map(n=>vu(n)).join("")}function kW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function db(...e){return"("+(kW(e).capture?"":"?:")+e.map(r=>vu(r)).join("|")+")"}function wx(e){return new RegExp(e.toString()+"|").exec("").length-1}function PW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const UW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function pb(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=vu(r),s="";for(;o.length>0;){const a=UW.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}const BW=/\b\B/,Dx="[a-zA-Z]\\w*",_b="[a-zA-Z_]\\w*",xx="\\b\\d+(\\.\\d+)?",Mx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Lx="\\b(0b[01]+)",FW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",GW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=aa(t,/.*\b/,e.binary,/\b.*/)),ko({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Ou={begin:"\\\\[\\s\\S]",relevance:0},YW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ou]},HW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ou]},$W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},um=function(e,t,n={}){const r=ko({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=db("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:aa(/[ ]
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),J=x,W=w),G===void 0&&(G=!0);const re={code:W,language:J};ge("before:highlight",re);const De=re.result?re.result:_(re.language,re.code,G);return De.code=re.code,ge("after:highlight",De),De}function _(x,w,G,W){const J=Object.create(null);function re(Y,K){return Y.keywords[K]}function De(){if(!ne.keywords){ve.addText(he);return}let Y=0;ne.keywordPatternRe.lastIndex=0;let K=ne.keywordPatternRe.exec(he),ie="";for(;K;){ie+=he.substring(Y,K.index);const pe=Ze.case_insensitive?K[0].toLowerCase():K[0],Fe=re(ne,pe);if(Fe){const[ht,no]=Fe;if(ve.addText(ie),ie="",J[pe]=(J[pe]||0)+1,J[pe]<=Tq&&(Nn+=no),ht.startsWith("_"))ie+=K[0];else{const ro=Ze.classNameAliases[ht]||ht;Ie(K[0],ro)}}else ie+=K[0];Y=ne.keywordPatternRe.lastIndex,K=ne.keywordPatternRe.exec(he)}ie+=he.substring(Y),ve.addText(ie)}function He(){if(he==="")return;let Y=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){ve.addText(he);return}Y=_(ne.subLanguage,he,!0,hr[ne.subLanguage]),hr[ne.subLanguage]=Y._top}else Y=g(he,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(Nn+=Y.relevance),ve.__addSublanguage(Y._emitter,Y.language)}function be(){ne.subLanguage!=null?He():De(),he=""}function Ie(Y,K){Y!==""&&(ve.startScope(K),ve.addText(Y),ve.endScope())}function it(Y,K){let ie=1;const pe=K.length-1;for(;ie<=pe;){if(!Y._emit[ie]){ie++;continue}const Fe=Ze.classNameAliases[Y[ie]]||Y[ie],ht=K[ie];Fe?Ie(ht,Fe):(he=ht,De(),he=""),ie++}}function ot(Y,K){return Y.scope&&typeof Y.scope=="string"&&ve.openNode(Ze.classNameAliases[Y.scope]||Y.scope),Y.beginScope&&(Y.beginScope._wrap?(Ie(he,Ze.classNameAliases[Y.beginScope._wrap]||Y.beginScope._wrap),he=""):Y.beginScope._multi&&(it(Y.beginScope,K),he="")),ne=Object.create(Y,{parent:{value:ne}}),ne}function xe(Y,K,ie){let pe=PW(Y.endRe,ie);if(pe){if(Y["on:end"]){const Fe=new oO(Y);Y["on:end"](K,Fe),Fe.isMatchIgnored&&(pe=!1)}if(pe){for(;Y.endsParent&&Y.parent;)Y=Y.parent;return Y}}if(Y.endsWithParent)return xe(Y.parent,K,ie)}function Ee(Y){return ne.matcher.regexIndex===0?(he+=Y[0],1):(si=!0,0)}function Rn(Y){const K=Y[0],ie=Y.rule,pe=new oO(ie),Fe=[ie.__beforeBegin,ie["on:begin"]];for(const ht of Fe)if(ht&&(ht(Y,pe),pe.isMatchIgnored))return Ee(K);return ie.skip?he+=K:(ie.excludeBegin&&(he+=K),be(),!ie.returnBegin&&!ie.excludeBegin&&(he=K)),ot(ie,Y),ie.returnBegin?0:K.length}function Fn(Y){const K=Y[0],ie=w.substring(Y.index),pe=xe(ne,Y,ie);if(!pe)return dO;const Fe=ne;ne.endScope&&ne.endScope._wrap?(be(),Ie(K,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(be(),it(ne.endScope,Y)):Fe.skip?he+=K:(Fe.returnEnd||Fe.excludeEnd||(he+=K),be(),Fe.excludeEnd&&(he=K));do ne.scope&&ve.closeNode(),!ne.skip&&!ne.subLanguage&&(Nn+=ne.relevance),ne=ne.parent;while(ne!==pe.parent);return pe.starts&&ot(pe.starts,Y),Fe.returnEnd?0:K.length}function oi(){const Y=[];for(let K=ne;K!==Ze;K=K.parent)K.scope&&Y.unshift(K.scope);Y.forEach(K=>ve.openNode(K))}let pt={};function qe(Y,K){const ie=K&&K[0];if(he+=Y,ie==null)return be(),0;if(pt.type==="begin"&&K.type==="end"&&pt.index===K.index&&ie===""){if(he+=w.slice(K.index,K.index+1),!i){const pe=new Error(`0 width match regex (${x})`);throw pe.languageName=x,pe.badRule=pt.rule,pe}return 1}if(pt=K,K.type==="begin")return Rn(K);if(K.type==="illegal"&&!G){const pe=new Error('Illegal lexeme "'+ie+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw pe.mode=ne,pe}else if(K.type==="end"){const pe=Fn(K);if(pe!==dO)return pe}if(K.type==="illegal"&&ie==="")return 1;if(Gn>1e5&&Gn>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=ie,ie.length}const Ze=z(x);if(!Ze)throw $s(o.replace("{}",x)),new Error('Unknown language: "'+x+'"');const Jt=gq(Ze);let Fr="",ne=W||Jt;const hr={},ve=new a.__emitter(a);oi();let he="",Nn=0,$t=0,Gn=0,si=!1;try{if(Ze.__emitTokens)Ze.__emitTokens(w,ve);else{for(ne.matcher.considerAll();;){Gn++,si?si=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=$t;const Y=ne.matcher.exec(w);if(!Y)break;const K=w.substring($t,Y.index),ie=qe(K,Y);$t=Y.index+ie}qe(w.substring($t))}return ve.finalize(),Fr=ve.toHTML(),{language:x,value:Fr,relevance:Nn,illegal:!1,_emitter:ve,_top:ne}}catch(Y){if(Y.message&&Y.message.includes("Illegal"))return{language:x,value:Dh(w),illegal:!0,relevance:0,_illegalBy:{message:Y.message,index:$t,context:w.slice($t-100,$t+100),mode:Y.mode,resultSoFar:Fr},_emitter:ve};if(i)return{language:x,value:Dh(w),illegal:!1,relevance:0,errorRaised:Y,_emitter:ve,_top:ne};throw Y}}function f(x){const w={value:Dh(x),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(x),w}function g(x,w){w=w||a.languages||Object.keys(t);const G=f(x),W=w.filter(z).filter(ae).map(be=>_(be,x,!1));W.unshift(G);const J=W.sort((be,Ie)=>{if(be.relevance!==Ie.relevance)return Ie.relevance-be.relevance;if(be.language&&Ie.language){if(z(be.language).supersetOf===Ie.language)return 1;if(z(Ie.language).supersetOf===be.language)return-1}return 0}),[re,De]=J,
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function cQ(e){const t="[a-z][a-zA-Z0-9_]*",n={className:"string",begin:"\\$.{1}"},r={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:t+":",relevance:0},e.C_NUMBER_MODE,r,n,{begin:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+t}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,n,e.C_NUMBER_MODE,r]}]}}function uQ(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}function dQ(e){const t={className:"variable",begin:/\b_+[a-zA-Z]\w*/},n={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},r={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},i=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],o=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],s=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSites","allTurrets","allUnits","allUnitsUAV","allUsers","allVariables","ambientTemperature","ammo","ammoOnPylon","and","animate","animateBay","animateDoor","animatePylon","animateSouLine truncated
|
||||
]*?"'`},{begin:`"[^\r
|
||||
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}function fQ(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}const mQ=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_-]*/}}),gQ=["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"],hQ=["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"],EQ=["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"],SQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],TQ=["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","backgrou
Line truncated
|
||||
(multipart)?`,end:`\\]
|
||||
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}function CQ(e){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}function RQ(e){return{name:"Test Anything Protocol",case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"meta",variants:[{begin:"^TAP version (\\d+)$"},{begin:"^1\\.\\.(\\d+)$"}]},{begin:/---$/,end:"\\.\\.\\.$",subLanguage:"yaml",relevance:0},{className:"number",begin:" (\\d+) "},{className:"symbol",variants:[{begin:"^ok"},{begin:"^not ok"}]}]}}function NQ(e){const t=e.regex,n=/[a-zA-Z_][a-zA-Z0-9_]*/,r={className:"number",variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[e.COMMENT(";[ \\t]*#","$"),e.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:t.concat(/\$/,t.optional(/::/),n,"(::",n,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[r]}]},{className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null})]},r]}}function vQ(e){const t=["bool","byte","i16","i32","i64","double","string","binary"];return{name:"Thrift",keywords:{keyword:["namespace","const","typedef","struct","enum","service","exception","void","oneway","set","list","map","required","optional"],type:t,literal:"true false"},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"struct enum service exception",end:/\{/,illegal:/\n/,contains:[e.inherit(e.TITLE_MODE,{starts:{endsWithParent:!0,excludeEnd:!0}})]},{begin:"\\b(set|list|map)\\s*<",keywords:{type:[...t,"set","list","map"]},end:">",contains:["self"]}]}}function OQ(e){const t={className:"number",begin:"[1-9][0-9]*",relevance:0},n={className:"symbol",begin:":[^\\]]+"},r={className:"built_in",begin:"(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",end:"\\]",contains:["self",t,n]},i={className:"built_in",begin:"(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",end:"\\]",contains:["self",t,e.QUOTE_STRING_MODE,n]};return{name:"TP",keywords:{keyword:["ABORT","ACC","ADJUST","AND","AP_LD","BREAK","CALL","CNT","COL","CONDITION","CONFIG","DA","DB","DIV","DETECT","ELSE","END","ENDFOR","ERR_NUM","ERROR_PROG","FINE","FOR","GP","GUARD","INC","IF","JMP","LINEAR_MAX_SPEED","LOCK","MOD","MONITOR","OFFSET","Offset","OR","OVERRIDE","PAUSE","PREG","PTH","RT_LD","RUN","SELECT","SKIP","Skip","TA","TB","TO","TOOL_OFFSET","Tool_Offset","UF","UT","UFRAME_NUM","UTOOL_NUM","UNLOCK","WAIT","X","Y","Z","W","P","R","STRLEN","SUBSTR","FINDSTR","VOFFSET","PROG","ATTR","MN","POS"],literal:["ON","OFF","max_speed","LPOS","JPOS","ENABLE","DISABLE","START","STOP","RESET"]},contains:[r,i,{className:"keyword",begin:"/(PROG|ATTR|MN|POS|END)\\b"},{className:"keyword",begin:"(CALL|RUN|POINT_LOGIC|LBL)\\b"},{className:"keyword",begin:"\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"},{className:"number",begin:"\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",relevance:0},e.COMMENT
Line truncated
|
||||
`},u]}}const p4=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_-]*/}}),_4=["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"],f4=["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"],Vx=["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"],Wx=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],m4=["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","fon
Line truncated
|
||||
]`,g={scope:"string",variants:[u,l,p,_]},h={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},E=["false","null","true"],b=["__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"],T=["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"],R={keyword:b,literal:(de=>{const le=[];return de.forEach(ge=>{le.push(ge),ge.toLowerCase()===ge?le.push(ge.toUpperCase()):le.push(ge.toLowerCase())}),le})(E),built_in:T},A=de=>de.map(le=>le.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",A(T).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},M=t.concat(r,"\\b(?!\\()"),k={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),M],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"}}]},$={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[$,o,k,e.C_BLOCK_COMMENT_MODE,g,h,I]},H={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",A(b).join("\\b|"),"|",A(T).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(H);const ae=[$,k,e.C_BLOCK_COMMENT_MODE,g,h,I],fe={begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...ae]},...ae,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:R,contains:[fe,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}]}},s,{scope:"variable.language",match:/\$this\b/},o,H,k,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{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:R,contains:["self",o,k,e.C_BLOCK_COMMENT_MODE,g,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trai
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),J=x,W=w),G===void 0&&(G=!0);const re={code:W,language:J};ge("before:highlight",re);const De=re.result?re.result:_(re.language,re.code,G);return De.code=re.code,ge("after:highlight",De),De}function _(x,w,G,W){const J=Object.create(null);function re(Y,K){return Y.keywords[K]}function De(){if(!ne.keywords){ve.addText(he);return}let Y=0;ne.keywordPatternRe.lastIndex=0;let K=ne.keywordPatternRe.exec(he),ie="";for(;K;){ie+=he.substring(Y,K.index);const pe=Ze.case_insensitive?K[0].toLowerCase():K[0],Fe=re(ne,pe);if(Fe){const[ht,no]=Fe;if(ve.addText(ie),ie="",J[pe]=(J[pe]||0)+1,J[pe]<=V5&&(Nn+=no),ht.startsWith("_"))ie+=K[0];else{const ro=Ze.classNameAliases[ht]||ht;Ie(K[0],ro)}}else ie+=K[0];Y=ne.keywordPatternRe.lastIndex,K=ne.keywordPatternRe.exec(he)}ie+=he.substring(Y),ve.addText(ie)}function He(){if(he==="")return;let Y=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){ve.addText(he);return}Y=_(ne.subLanguage,he,!0,hr[ne.subLanguage]),hr[ne.subLanguage]=Y._top}else Y=g(he,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(Nn+=Y.relevance),ve.__addSublanguage(Y._emitter,Y.language)}function be(){ne.subLanguage!=null?He():De(),he=""}function Ie(Y,K){Y!==""&&(ve.startScope(K),ve.addText(Y),ve.endScope())}function it(Y,K){let ie=1;const pe=K.length-1;for(;ie<=pe;){if(!Y._emit[ie]){ie++;continue}const Fe=Ze.classNameAliases[Y[ie]]||Y[ie],ht=K[ie];Fe?Ie(ht,Fe):(he=ht,De(),he=""),ie++}}function ot(Y,K){return Y.scope&&typeof Y.scope=="string"&&ve.openNode(Ze.classNameAliases[Y.scope]||Y.scope),Y.beginScope&&(Y.beginScope._wrap?(Ie(he,Ze.classNameAliases[Y.beginScope._wrap]||Y.beginScope._wrap),he=""):Y.beginScope._multi&&(it(Y.beginScope,K),he="")),ne=Object.create(Y,{parent:{value:ne}}),ne}function xe(Y,K,ie){let pe=a5(Y.endRe,ie);if(pe){if(Y["on:end"]){const Fe=new SO(Y);Y["on:end"](K,Fe),Fe.isMatchIgnored&&(pe=!1)}if(pe){for(;Y.endsParent&&Y.parent;)Y=Y.parent;return Y}}if(Y.endsWithParent)return xe(Y.parent,K,ie)}function Ee(Y){return ne.matcher.regexIndex===0?(he+=Y[0],1):(si=!0,0)}function Rn(Y){const K=Y[0],ie=Y.rule,pe=new SO(ie),Fe=[ie.__beforeBegin,ie["on:begin"]];for(const ht of Fe)if(ht&&(ht(Y,pe),pe.isMatchIgnored))return Ee(K);return ie.skip?he+=K:(ie.excludeBegin&&(he+=K),be(),!ie.returnBegin&&!ie.excludeBegin&&(he=K)),ot(ie,Y),ie.returnBegin?0:K.length}function Fn(Y){const K=Y[0],ie=w.substring(Y.index),pe=xe(ne,Y,ie);if(!pe)return NO;const Fe=ne;ne.endScope&&ne.endScope._wrap?(be(),Ie(K,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(be(),it(ne.endScope,Y)):Fe.skip?he+=K:(Fe.returnEnd||Fe.excludeEnd||(he+=K),be(),Fe.excludeEnd&&(he=K));do ne.scope&&ve.closeNode(),!ne.skip&&!ne.subLanguage&&(Nn+=ne.relevance),ne=ne.parent;while(ne!==pe.parent);return pe.starts&&ot(pe.starts,Y),Fe.returnEnd?0:K.length}function oi(){const Y=[];for(let K=ne;K!==Ze;K=K.parent)K.scope&&Y.unshift(K.scope);Y.forEach(K=>ve.openNode(K))}let pt={};function qe(Y,K){const ie=K&&K[0];if(he+=Y,ie==null)return be(),0;if(pt.type==="begin"&&K.type==="end"&&pt.index===K.index&&ie===""){if(he+=w.slice(K.index,K.index+1),!i){const pe=new Error(`0 width match regex (${x})`);throw pe.languageName=x,pe.badRule=pt.rule,pe}return 1}if(pt=K,K.type==="begin")return Rn(K);if(K.type==="illegal"&&!G){const pe=new Error('Illegal lexeme "'+ie+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw pe.mode=ne,pe}else if(K.type==="end"){const pe=Fn(K);if(pe!==NO)return pe}if(K.type==="illegal"&&ie==="")return 1;if(Gn>1e5&&Gn>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=ie,ie.length}const Ze=z(x);if(!Ze)throw zs(o.replace("{}",x)),new Error('Unknown language: "'+x+'"');const Jt=Y5(Ze);let Fr="",ne=W||Jt;const hr={},ve=new a.__emitter(a);oi();let he="",Nn=0,$t=0,Gn=0,si=!1;try{if(Ze.__emitTokens)Ze.__emitTokens(w,ve);else{for(ne.matcher.considerAll();;){Gn++,si?si=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=$t;const Y=ne.matcher.exec(w);if(!Y)break;const K=w.substring($t,Y.index),ie=qe(K,Y);$t=Y.index+ie}qe(w.substring($t))}return ve.finalize(),Fr=ve.toHTML(),{language:x,value:Fr,relevance:Nn,illegal:!1,_emitter:ve,_top:ne}}catch(Y){if(Y.message&&Y.message.includes("Illegal"))return{language:x,value:Ph(w),illegal:!0,relevance:0,_illegalBy:{message:Y.message,index:$t,context:w.slice($t-100,$t+100),mode:Y.mode,resultSoFar:Fr},_emitter:ve};if(i)return{language:x,value:Ph(w),illegal:!1,relevance:0,errorRaised:Y,_emitter:ve,_top:ne};throw Y}}function f(x){const w={value:Ph(x),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return w._emitter.addText(x),w}function g(x,w){w=w||a.languages||Object.keys(t);const G=f(x),W=w.filter(z).filter(ae).map(be=>_(be,x,!1));W.unshift(G);const J=W.sort((be,Ie)=>{if(be.relevance!==Ie.relevance)return Ie.relevance-be.relevance;if(be.language&&Ie.language){if(z(be.language).supersetOf===Ie.language)return 1;if(z(Ie.language).supersetOf===be.language)return-1}return 0}),[re,De]=J,
Line truncated
|
||||
|
||||
`);return!r||!i?!1:!!e.chain().command(({tr:o})=>(o.delete(t.pos-2,t.pos),!0)).exitCode().run()}function o6(){if(this.options.codeMode)return!1;const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?!!this.editor.commands.clearNodes():!1}function s6({editor:e}){const t=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset);return(t==null?void 0:t.split(`
|
||||
`))||[]}const Tb=["arduino","bash","c","cpp","csharp","css","diff","go","graphql","ini","java","javascript","json","kotlin","less","lua","makefile","markdown","objectivec","perl","php","php-template","plaintext","python","python-repl","r","ruby","rust","scss","shell","sql","swift","typescript","vbnet","wasm","xml","yaml","ipsphtml","ipscss"],a6=rt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",We(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)}}}),Du=a6.extend({parseHTML(){return[{tag:"li",getAttrs:e=>{var t;if(((t=e.childNodes)==null?void 0:t.length)>1){const n=document.createElement("div");n.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(n)}return null}}]}});function Kt(e,t="",n=!0){const r=i=>{t&&(i.message=t+": "+i.message),window.Debug[n?"warn":"error"](i)};try{const i=e();return i instanceof Promise?new Promise(o=>{i.catch(r).finally(()=>o(!1))}):!0}catch(i){return r(i),!1}}const tr=fb.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this)}},addAttributes(){var e;return{language:{default:this.options.defaultLanguage||((e=this.options.allowedLanguages)==null?void 0:e[0])||"plaintext",parseHTML:t=>{var r,i;const n=(r=(()=>{if(t.hasAttribute("language"))return t.getAttribute("language");for(const o of t.classList)if(o.match(/^language-([a-z0-9\-_]+)$/i))return o.match(/^language-([a-z0-9\-_]+)$/i)[1];if(t.dataset.language&&t.dataset.language in tf)return tf[t.dataset.language];for(const o of t.querySelectorAll("code")){if(o.hasAttribute("language"))return o.getAttribute("language");for(const s of o.classList)if(s.match(/^language-([a-z0-9\-_]+)$/i))return s.match(/^language-([a-z0-9\-_]+)$/i)[1]}})())==null?void 0:r.toLowerCase();return this.options.codeMode&&(!n||!Tb.includes(n)||n!==this.options.defaultLanguage&&this.options.allowedLanguages&&!this.options.allowedLanguages.includes(n))?this.options.defaultLanguage||((i=this.options.allowedLanguages)==null?void 0:i[0])||"plaintext":n}}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),codeMode:!1,allowedLanguages:null}},renderHTML({HTMLAttributes:e}){var n;const t=this.options.codeMode?this.editor.options.lastLang||((n=this.editor.options.allowedLanguages)==null?void 0:n[0])||"plaintext":e.language;return["pre",{spellcheck:"false",class:`${this.options.codeMode?"":"ipsCode "}language-${t}`,"data-language":bl[t]||t},["code",{},0]]},onUpdate({editor:e}){this.options.codeMode&&e.options.lastLang&&e.options.lastLang!==e.getAttributes(this).language&&e.chain().setCodeBlock({language:e.options.lastLang}).run()},addKeyboardShortcuts(){const e=this.editor;return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{var o;if(!e.state.selection.empty||((o=e.state.selection.$from.parent)==null?void 0:o.type.name)!==this.name)return!1;if(o6.call(this))return!0;if(!this.options.codeMode&&(!e.state.selection.$from.parent.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(e.state.selection.$from.parent.attrs.language)))return!1;const n=e.state.selection.$from.parent.textContent.slice(0,e.state.selection.$from.parentOffset),r=e.state.selection.$from.parent.textContent.slice(e.state.selection.$from.parentOffset);if(n&&r){for(const s in Wt)if(n.endsWith(s)&&r.startsWith(Wt[s]))return e.chain().deleteRange({from:e.state.selection.from-s.length,to:e.state.selection.from+Wt[s].length}).setTextSelection(e.state.selection.from-s.length).focus().run()}const i=n.match(/(\t)[^\n]*(\n\t+)$/);return i?e.chain().deleteRange({from:e.state.selection.from-i[2].length,to:e.state.selection.from}).setTextSelection(e.state.selection.from-i[2].length).focus().run():!1},Enter:({editor:t})=>{var y,R,A,I,M,k,$,z,H,ae,fe;if(i6.call(this,{editor:t}))return!0;const{$from:r}=t.state.selection,{parent:i}=r;if(!t.state.selection.empty||(i==null?void 0:i.type.name)!==this.name||!this.options.codeMode&&(!i.attrs.language||["plaintext","bash","shell","zsh","sh"].includes(i.attrs.language)))return!1;const o=s6({editor:t});if(!o.length)return!1;const s=o[o.length-1],a=o[o.length-2];let l=((R=(y=s.match(/^\t*/))==null?void 0:y[0])==null?void 0:R.length)||0,u=!1;const p=i.attrs.language,_=["ipsphtml","xml","html","xhtml","html5"].includes(p),f=["ipscss","css","scss","sass","less"].includes(p),g=["plaintext","rtf","markdown","md","bbcode"].includes(p),h=_?/(<[^>/]*>)$/:/([{[(.:]|->)$/,E=_?/(<\/[^/>]*>)$/:/^\s*([}\])]+[,;]?)$/;let b=!1;if(!_&&!f&&!g&&s.match(/^\s+(\.|->)?[a-z0-9_-]/i))if(s.match(/^\s+(\.|->)/))b=!0,l--;else{let de=1;for(;de<o.length&&((M=(I=(A=o[o.length-1-de])==null?void 0:A.match(/^\t*/))==null?void 0:I[0])==null?void 0:M.length)<
Line truncated
|
||||
`+" ".repeat(l);u?(de-=s.length,ge=s.replace(/^\t/,"")+ge):T&&(le=`
|
||||
`+(l>1?" ".repeat(l-1):""),ge+=le);let Ne=this.editor.chain().insertContentAt({from:de,to:t.state.selection.from},{type:"text",text:ge});return le&&(Ne=Ne.setTextSelection(t.state.selection.from+ge.length-le.length)),Ne.focus().run()}return!1},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown||this.options.codeMode)return!1;const{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:s}=r;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0||i.nodeAt(l)?!1:!!t.commands.exitCode()},ArrowUp:l6.bind(this),Tab:Ip.bind(this,!1,{editor:e}),"Shift-Tab":Ip.bind(this,!0,{editor:e}),"Alt-Tab":Ip.bind(this,!1,{editor:e},!0),"Shift-Alt-Tab":Ip.bind(this,!0,{editor:e},!0)}},addProseMirrorPlugins(){var t;const e={};for(const n in Wt)e[Wt[n]]=n;return[...((t=this.parent)==null?void 0:t.call(this))||[],new je({key:new Qe("ipsCodeModeSyntaxHelpers"),props:{handleKeyDown:(n,r)=>{var o;if(!(r instanceof KeyboardEvent)||r.metaKey||r.altKey)return;const i=this.editor;if(((o=r.key)==null?void 0:o.toLowerCase())in Wt)return r.key.toLowerCase()in e&&vO({editor:i,opener:r.key.toLowerCase()})?!0:!!c6({editor:i,char:r.key.toLowerCase()});if(r.key.toLowerCase()in e)return!!vO({editor:i,opener:e[r.key.toLowerCase()]})}}})]}});function l6({editor:e}){if(e.options.codeMode)return!1;const{$from:t,empty:n}=e.state.selection;if(t.nodeBefore||!n||t.parent.type!==this.type)return!1;let r=0,i;for(const s of[...t.path].reverse()){if(!Number.isInteger(s)&&(r++,r===2))break;i=s}return!r||!Number.isInteger(i)||i!==0||!(t.parentOffset===0)?!1:(e.chain().insertContentAt(t.before(),"<p> </p>",{updateSelection:!0}).run(),!0)}function Ip(e=!1,{editor:t=null},n=!1){var r,i,o,s;if((!t.state.selection.empty||e)&&t.isActive(this.name)&&(t.options.codeMode||[...t.state.selection.$from.path].reverse()[3]===[...t.state.selection.$to.path].reverse()[3]))return t.state.selection.empty&&e&&t.state.selection.$from.parentOffset===0||Kt(()=>{t.chain().command(({tr:a,chain:l})=>{var u,p,_,f;try{const{from:g,to:h}=t.state.selection,E=[...t.state.selection.$from.path].reverse()[3]+1;let b=g;if(b>[...t.state.selection.$from.path].reverse()[3]){for(;b>[...t.state.selection.$from.path].reverse()[3]&&!((u=a.doc.slice(b-1,b--).content.content[0])!=null&&u.textContent.startsWith(`
|
||||
`)););b++}const T=((p=a.doc.slice(b,h).content.content[0])==null?void 0:p.textContent)||"",y=g-b,R=T.split(`
|
||||
`),A=R.map(k=>e?k.replace(/^\t/,""):" "+k).join(`
|
||||
`);let I=!1;try{e&&R.length>1&&R[R.length-1].match(/^\t/)&&((f=(_=a.doc.slice(h,h+1))==null?void 0:_.content.content[0])==null?void 0:f.textContent)===" "&&(I=!0)}catch{}a.insertText(A,b,h);const M={from:b+y,to:b+A.length};e&&T.startsWith(" ")?M.from--:e||M.from++,I&&M.to++,E>M.from&&(M.from=E),l().setTextSelection(M).focus().run()}catch{}return!0}).run()},"Something went wrong when modifying indents in a codeblock selection"),!0;if(!n&&t.isActive(Du.name))return!1;if(t.state.selection.empty){if(e){if(t.state.selection.$from.parentOffset>0){const a=t.state.doc.slice(t.state.selection.from-1,t.state.selection.from);if(((i=(r=a==null?void 0:a.content)==null?void 0:r.content[0])==null?void 0:i.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l-1,l),!0)).setTextSelection({from:l-1,to:l-1}).run(),!0}}if(t.state.selection.$from.parentOffset<t.state.selection.$from.parent.nodeSize-2){const a=t.state.doc.slice(t.state.selection.from,t.state.selection.from+1);if(((s=(o=a==null?void 0:a.content)==null?void 0:o.content[0])==null?void 0:s.textContent)===" "){const{from:l}=t.state.selection;return t.chain().command(({tr:u})=>(u.deleteRange(l,l+1),!0)).setTextSelection({from:l,to:l}).run(),!0}}}}else return!0;return t.chain().insertContent(" ").focus().run(),!0}function c6({editor:e,char:t}){var _,f,g;if(!(t in Wt))return!1;const{$from:n,$to:r}=e.state.selection,i=n.parent,o=r.parent;if(((_=i==null?void 0:i.type)==null?void 0:_.name)!==fb.name||i!==o)return!1;if(e.state.selection.empty)return e.chain().insertContent(`${t}${Wt[t]}`).setTextSelection(e.state.selection.from+t.length).focus().run();const s=i.textContent;let a=s.slice(n.parentOffset,r.parentOffset);if(!a)return!1;if(['"',"'","`"].includes(t)){const h=new RegExp(`(^|[^\\\\])\\${t}`,"g");a=a.replaceAll(h,`$1\\${t}`).replaceAll(/\n/g,"\\n")}let l="",u=0;if(a.match(/\n/)){const E=s.slice(0,n.parentOffset).split(`
|
||||
`).pop(),b=s.slice(r.parentOffset).split(`
|
||||
`).shift();let T=Math.max(0,((g=(f=E.match(/^\t*/))==null?void 0:f[0])==null?void 0:g.length)+1);E.match(/^\t*$/)&&b.match(/^\t+$/)&&(T+=b.match(/^\t+$/)[0].length),b.match(/^\s*$/)&&(a=a.replace(/^\s*?\n\s*(.?)/,"$1")),u=T+1;const y=" ".repeat(T),R=new RegExp(`\\n\\t{0,${T?T-1:0}}`,"g");if(a=a.replaceAll(R,`
|
||||
${y}`),a=`${t}
|
||||
${y}${a}
|
||||
${y?y.slice(0,y.length-1):""}${Wt[t]}`,r.parentOffset<s.length)try{const A=s.slice(r.parentOffset,r.parentOffset+1);A!=null&&A.match(/\n/)||(l=`
|
||||
`+(y?y.slice(0,y.length-1):""),a+=l)}catch{}}else a=`${t}${a}${Wt[t]}`;const p={from:e.state.selection.from+t.length+u,to:e.state.selection.from+a.length-Wt[t].length-l.length-(u?u-1:0)};return e.chain().insertContentAt({from:e.state.selection.from,to:e.state.selection.to},{type:"text",text:a}).setTextSelection(p).focus().run()}function vO({editor:e,opener:t}){var o;if(!(t in Wt)||!e.state.selection.empty)return!1;const{$from:n}=e.state.selection,r=n.parent;if((r==null?void 0:r.type.name)!==fb.name)return!1;const i=(o=n.parent)==null?void 0:o.textContent;if(n.parentOffset<1||n.parentOffset>=i.length)return!1;try{const s=n.parentOffset;let a=i==null?void 0:i.slice(s,s+Wt[t].length);if(!a)return;if(a.startsWith(Wt[t]))return s>0&&['"',"'","`"].includes(t)&&(i==null?void 0:i[s-1])==="\\"?e.chain().insertContent({type:"text",text:Wt[t]}).focus().run():e.chain().setTextSelection(e.state.selection.from+Wt[t].length).focus().run()}catch{return!1}return!1}const Wt={"{":"}","[":"]","(":")","'":"'",'"':'"',"`":"`"},Sc={};function TM(e,t,n=[]){var r;if(!((r=Sc[e])!=null&&r.to)){let i=!1;if(e===t)i=[e];else if(e in Uo){const o=[e];if(t in Uo[e])o.push(t);else{let s;n=[...n,...o];for(const a in Uo[e])if(!(n.includes(a)||a===e)&&Uo[a]){const l=TM(a,t,n);Array.isArray(l)&&(!s||s.length>l.length)&&(s=l)}Array.isArray(s)&&o.splice(1,0,...s)}o.length&&o[o.length-1]===t&&(i=o)}e in Sc||(Sc[e]={}),Sc[e][t]=i}return Sc[e][t]}function u6(e,t,n){const r=TM(e,t);if(!Array.isArray(r))throw new RangeError(`Cannot convert ${e} to ${t} because there is not a known conversion pathway`);r.length===1&&e===Tn.name&&n.chain().toggleHeading({level:n.level||1});for(let i=0;i<r.length-1;i++){const o=Uo[r[i]][r[i+1]](n);if(o!==void 0&&!o)throw new Error(`Could not convert ${r[i]} to ${r[i+1]}`)}return!0}function bb(e){const t=[...e.state.selection.$from.path].reverse()[2],n=t==null?void 0:t.type.name;return n===Tn.name?[n,{level:t.attrs.level||1}]:[n||"",{}]}function s_(e){var n;if(e[0]===Tn.name)return`Heading ${((n=e[1])==null?void 0:n.level)||""}`;const t=e[0]in vS?e[0]:Dt.name;return vS[t]}function d6(e){if(e in OO)return[OO[e],{}];const t=s_([Tn.name,{}]);if(e.startsWith(t)){const n=parseInt(e.replace("Heading","").trim())||1;return[Tn.name,{level:n}]}return[Dt.name,{}]}const vS={[Ji.name]:"Ordered List",[ts.name]:"Bullet List",[tr.name]:"Code Block",[Dt.name]:"Paragraph"},OO=Object.fromEntries([...Object.entries(vS)].map(e=>e.reverse()));function p6(e){for(let t of Tn.options.levels)if(e.isActive(Tn.name,{level:t}))return{level:t};return null}function bM(e){const t=bb(e);return t[0]in Uo?_6(...t).filter(n=>{var r,i;return(n[0]!==Tn.name||!((r=e.options.restrictions)!=null&&r.has("heading")))&&!(n[0]===Tn.name&&n[1].level===1&&((i=e.options.restrictions)!=null&&i.has("heading_1")))}):[]}const Tc={};function _6(e,t={}){const n=JSON.stringify({name:e,attributes:t});if(!(n in Tc)){const r=yM(e);Tc[n]=[];for(const i of r)if(i===Tn.name)for(let o=1;o<=6;o++)Tc[n].push([Tn.name,{level:o}]);else Tc[n].push([i,{}])}return Tc[n]}function yM(e,t){if(t=t||new Set,t.add(e),e in Uo)for(const n in Uo[e])t.has(n)||yM(n,t);return t}const Uo={[Dt.name]:{[tr.name]:({chain:e})=>e().setCodeBlock(),[Tn.name]:({chain:e,level:t=1})=>e().setHeading({level:t})},[tr.name]:{[Dt.name]:({chain:e})=>e().toggleCodeBlock()},[Tn.name]:{[Dt.name]:({chain:e,editor:t,level:n})=>{var r;return n=n||((r=p6(t))==null?void 0:r.level),n?e().toggleHeading({level:n}):!1}}};function f6({...e}){const{editor:t}=F.useContext(Pe),n=bb(t);return e.dropdownOptions=e.dropdownOptions||{},e.dropdownOptions.className=e.dropdownOptions.className||"",e.dropdownOptions.className=[...e.dropdownOptions.className.split(/\s+/),"ipsRichText"].join(" "),N.jsx(sa,{current:N.jsx(N.Fragment,{children:N.jsx("i",{className:"fa-solid fa-paragraph"})}),currentValue:s_(n),blank:N.jsx(AO,{block:[Dt.title,{}]}),items:bM(t).map(r=>[s_(r),N.jsx(AO,{block:r},s_(r))]),onChange:r=>{const i=d6(r);t.chain().command(o=>u6(n[0],i[0],{...i[1]||{},...o})).focus().run()},...e,dropdownOptions:{...e.dropdownOptions,location:"se"}})}function AO({block:e,style:t=!0}){if(e[0]===Tn.name){const n=`h${e[1].level}`;return t?N.jsxs(n,{children:["Heading ",e[1].level]}):N.jsxs(N.Fragment,{children:["Heading ",e[1].level]})}return e[0]===tr.name?t?N.jsx("code",{children:"Code Block"}):N.jsx(N.Fragment,{children:"Code Block"}):N.jsx(N.Fragment,{children:"Paragraph"})}const xu=cn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",We(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()}}}),Mu=cn.create({name:"superscript",addOptionsLine truncated
|
||||
`,C6="️",R6="",Yh="";let wp=null,Dp=null;function N6(e=[]){const t={};qn.groups=t;const n=new qn;wp==null&&(wp=DO(h6)),Dp==null&&(Dp=DO(E6)),ee(n,"'",Rb),ee(n,"{",Kc),ee(n,"}",Qc),ee(n,"[",nf),ee(n,"]",rf),ee(n,"(",of),ee(n,")",sf),ee(n,"<",af),ee(n,">",lf),ee(n,"(",cf),ee(n,")",uf),ee(n,"「",df),ee(n,"」",pf),ee(n,"『",_f),ee(n,"』",ff),ee(n,"<",mf),ee(n,">",gf),ee(n,"&",hf),ee(n,"*",Ef),ee(n,"@",Co),ee(n,"`",Tf),ee(n,"^",bf),ee(n,":",Ao),ee(n,",",Nb),ee(n,"$",yf),ee(n,".",_i),ee(n,"=",Cf),ee(n,"!",vb),ee(n,"-",Ar),ee(n,"%",Xc),ee(n,"|",Rf),ee(n,"+",Nf),ee(n,"#",vf),ee(n,"?",jc),ee(n,'"',Ob),ee(n,"/",fi),ee(n,";",Ab),ee(n,"~",Zc),ee(n,"_",Of),ee(n,"\\",Sf),ee(n,"・",vM);const r=At(n,ki,yb,{[OS]:!0});At(r,ki,r);const i=At(r,Li,RM,{[qc]:!0}),o=At(r,bc,NM,{[Dc]:!0}),s=At(n,Li,Ui,{[AS]:!0});At(s,ki,i),At(s,Li,s),At(i,ki,i),At(i,Li,i);const a=At(n,bc,DS,{[IS]:!0});At(a,Li),At(a,ki,o),At(a,bc,a),At(o,ki,o),At(o,Li),At(o,bc,o);const l=ee(n,Gh,Cb,{[Uh]:!0}),u=ee(n,wO,LS,{[Uh]:!0}),p=At(n,Fh,LS,{[Uh]:!0});ee(n,Yh,p),ee(u,Gh,l),ee(u,Yh,p),At(u,Fh,p),ee(p,wO),ee(p,Gh),At(p,Fh,p),ee(p,Yh,p);const _=At(n,Bh,OM,{[CM]:!0});ee(_,"#"),At(_,Bh,_),ee(_,C6,_);const f=ee(_,R6);ee(f,"#"),At(f,Bh,_);const g=[[Li,s],[ki,i]],h=[[Li,null],[bc,a],[ki,o]];for(let E=0;E<wp.length;E++)go(n,wp[E],xS,Ui,g);for(let E=0;E<Dp.length;E++)go(n,Dp[E],MS,DS,h);ks(xS,{tld:!0,ascii:!0},t),ks(MS,{utld:!0,alpha:!0},t),go(n,"file",a_,Ui,g),go(n,"mailto",a_,Ui,g),go(n,"http",Ma,Ui,g),go(n,"https",Ma,Ui,g),go(n,"ftp",Ma,Ui,g),go(n,"ftps",Ma,Ui,g),ks(a_,{scheme:!0,ascii:!0},t),ks(Ma,{slashscheme:!0,ascii:!0},t),e=e.sort((E,b)=>E[0]>b[0]?1:-1);for(let E=0;E<e.length;E++){const b=e[E][0],y=e[E][1]?{[S6]:!0}:{[T6]:!0};b.indexOf("-")>=0?y[wS]=!0:Li.test(b)?ki.test(b)?y[qc]=!0:y[AS]=!0:y[OS]=!0,IO(n,b,b,y)}return IO(n,"localhost",Lu,{ascii:!0}),n.jd=new qn(Af),{start:n,tokens:ta({groups:t},AM)}}function IM(e,t){const n=v6(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,l=null,u=0,p=null,_=-1,f=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(_=0,f=0,p=a):_>=0&&(_+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=_,s-=f,u-=_,i.push({t:p.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function v6(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||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}function go(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];e.j[l]?o=e.j[l]:(o=new qn(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new qn(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function DO(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const yl={defaultProtocol:"http",events:null,format:xO,formatHref:xO,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function pm(e,t=null){let n=ta({},yl);e&&(n=ta(n,e instanceof pm?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}pm.prototype={o:yl,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:yl[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function xO(e){return e}var O6=Object.freeze({__proto__:null,defaults:yl,Options:pm,assign:ta});function wM(e,t){this.t="token",this.v=e,this.tk=t}wM.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=yl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),u=e.get("rel",n,t),p=e.getObj("attributes",n,t),_=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),p&&ta(s,p),{tagName:i,aLine truncated
|
||||
1. Must only contain digits, lowercase ASCII letters or "-"
|
||||
2. Cannot start or end with "-"
|
||||
3. "-" cannot repeat`);mt.customSchemes.push([e,t])}function L6(){mt.scanner=N6(mt.customSchemes);for(let e=0;e<mt.tokenQueue.length;e++)mt.tokenQueue[e][1]({scanner:mt.scanner});mt.parser=I6(mt.scanner.tokens);for(let e=0;e<mt.pluginQueue.length;e++)mt.pluginQueue[e][1]({scanner:mt.scanner,parser:mt.parser});return mt.initialized=!0,mt}function Ib(e){return mt.initialized||L6(),w6(mt.parser.start,e,IM(mt.scanner.start,e))}Ib.scan=IM;function wb(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new pm(n),i=Ib(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}function k6(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function P6(e){return new je({key:new Qe("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=t.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=jz(n.doc,[...t]);if(iV(a).forEach(({newRange:u})=>{const p=Jz(r.doc,u,g=>g.isTextblock);let _,f;if(p.length>1?(_=p[0],f=r.doc.textBetween(_.pos,_.pos+_.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(_=p[0],f=r.doc.textBetween(_.pos,u.to,void 0," ")),_&&f){const g=f.split(" ").filter(T=>T!=="");if(g.length<=0)return!1;const h=g[g.length-1],E=_.pos+f.lastIndexOf(h);if(!h)return!1;const b=Ib(h).map(T=>T.toObject(e.defaultProtocol));if(!k6(b))return!1;b.filter(T=>T.isLink).map(T=>({...T,from:E+T.start+1,to:E+T.end+1})).filter(T=>r.schema.marks.code?!r.doc.rangeHasMark(T.from,T.to,r.schema.marks.code):!0).filter(T=>e.validate(T.value)).filter(T=>e.shouldAutoLink(T.value)).forEach(T=>{ab(T.from,T.to,r.doc).some(y=>y.mark.type===e.type)||s.addMark(T.from,T.to,e.type.create({href:T.href}))})}}),!!s.steps.length)return s}})}function U6(e){return new je({key:new Qe("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=sb(t.state,e.type.name),u=r.target,p=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,_=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&p?(window.open(p,_),!0):!1}}})}function B6(e){return new je({key:new Qe("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(u=>{a+=u.textContent});const l=wb(a,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(e.editor.commands.setMark(e.type,{href:l.href}),!0)}}})}const F6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function yc(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(F6,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Cc=cn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){kO(e);return}kO(e.scheme,e.optionalSlashes)})},onDestroy(){M6()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!yc(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!yc(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!yc(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",We(this.options.HTMLAttributes,e),0]:["a",We(this.options.HTMLAttributes,{...e,href:""}),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[es({find:e=>{const t=[];if(e){const{protocols:n,defaul
Line truncated
|
||||
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:p})=>{if(p&&l&&s){const _=l.filter(f=>a.includes(f.type.name));u.ensureMarks(_)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),u_=rt.create({name:"doc",topNode:!0,content:"block+"}),_L=bt.create({name:"ipsAutosave",addCommands(){return{clearAutosave:()=>({editor:e,chain:t})=>(e.options.autoSaveKey&&(window.ips.utils.db.remove("editorSave",e.options.autoSaveKey),t().hideMessage("autosave").run()),!0)}},onUpdate(){this.storage.updateCallback()},onCreate(){var e,t;if(this.storage.updateCallback=er.debounce(()=>{var n;(n=this.editor)!=null&&n.options.autoSaveKey&&(this.editor.getHTML().trim()&&this.editor.getHTML()!=="<p></p>"?window.ips.utils.db.set("editorSave",this.editor.options.autoSaveKey,{content:this.editor.getHTML(),time:Math.round(Date.now()/1e3)}):this.editor.commands.clearAutosave(),this.editor.commands.hideMessage("autosave"))},500),(e=this.editor)!=null&&e.options.autoSaveKey){const n=window.ips.utils.db.get("editorSave",this.editor.options.autoSaveKey);if((t=n==null?void 0:n.content)!=null&&t.trim()&&(!n.time||Date.now()/1e3-86400*3<parseInt(n.time))){const r=new DOMParser().parseFromString(n.content,"text/html");if(!(r.body.innerText.trim().length||r.body.querySelector("iframe,img,video,audio,a,embed,.ipsEmoji,.ipsEmbeddedVideo,.ipsEmbeddedBrightcove,.ipsEmbeddedOther,.ipsEmbeddedPhoto")))return;this.storage.initial=this.editor.getHTML(),this.editor.chain().setContent(n.content).command(({tr:i,chain:o})=>(!i.docChanged||fL(i.doc)?o().undo().hideMessage("autosave").run():o().showMessage("autosave").focus().run(),!0)).run()}}},addStorage(){return{initial:"",updateCallback:()=>{}}}});function fL(e){var t,n,r;return e.textContent==="<p></p>"?!0:!((t=e.textContent)!=null&&t.trim().length||![u_.name,Dt.name,ti.name,Bu.name].includes(e.type.name)||(r=(n=e.content)==null?void 0:n.content)!=null&&r.length&&!e.content.content.some(i=>!fL(i)))}function dj(){const{editor:e}=F.useContext(Pe);return N.jsxs(N.Fragment,{children:["The content was restored from an automatically saved draft. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:()=>e.chain().clearAutosave().setContent(e.storage[_L.name].initial||"").focus().run(),children:"clear draft."})]})}function pj({positions:e="",href:t}){const{editor:n}=F.useContext(Pe),r=()=>{if(!e.length){n.commands.hideMessage("autoembed");return}let i=n.chain();for(const o of e)i=i.command(({tr:s,chain:a})=>a().insertContentAt({from:Math.max(0,s.mapping.map(o[0])),to:Math.min(s.doc.nodeSize-2,s.mapping.map(o[1]))},`<a href="${encodeURI(t)}" >${o[2]}</a>`));i.hideMessage("autoembed").focus().run()};return N.jsxs(N.Fragment,{children:["A URL was inserted as embedded content. Click to ",N.jsx("button",{className:"ipsEditor__autosave-clear",onClick:r,children:"insert as link"})," instead."]})}function uA({name:e}){const{editor:t}=F.useContext(Pe);return N.jsxs("div",{className:`ipsEditor__global-message ipsEditor__global-message--${e}`,children:[N.jsxs("div",{className:"ipsEditor__global-message-content",children:[N.jsx("i",{className:"fa-solid fa-circle-info"})," ",N.jsx(_j,{name:e})]}),N.jsx("button",{className:"ipsEditor__global-message-close",onClick:()=>t==null?void 0:t.commands.hideMessage(e),children:N.jsx("i",{className:"fa-solid fa-times-circle"})})]})}function _j({name:e}){const{messages:t}=F.useContext(qS),n=t.get(e);switch(e){case"autosave":return N.jsx(dj,{});case"autoembed":return N.jsx(pj,{...n});default:return typeof n=="string"&&n?N.jsx("span",{"data-ipseditorcustommessage":"true",dangerouslySetInnerHTML:{__html:n}}):N.jsx(N.Fragment,{children:"This is a global message!"})}}const qS=F.createContext({messages:new Map,addMessage(e,t=""){this.messages.set(e,t)},removeMessage(e){this.messages.has(e)&&this.messages.delete(e)}});function fj({children:e}){var l;const[t,n]=F.useState(()=>new Map),[r,i]=F.useState(!1),{editor:o}=F.useContext(Pe),s=F.useMemo(()=>({messages:t,addMessage:(u,p="")=>{if(!t.has(u)||t.get(u)!==p){t.set(u,p);const _=new Map;for(const[f,g]of t.entries())_.set(f,g);n(_)}},removeMessage:u=>{if(t.has(u)){t.delete(u);const p=new Map;for(const[_,f]of t.entries())p.set(_,f);n(p)}},onVisibilityChange(u=!1){u!==r&&i(u)},visible:r}),[t,n,r,i]);if(F.useEffect(()=>{!o.options.codeMode&&!o.options.simpleRichText&&o.can().registerMessageInterface(s)&&(o==null||o.commands.registerMessageInterface(s))},[s,o]),o.options.codeMode||o.options.simpleRichText)return N.jsx(N.Fragment,{children:e});const a=[...t.keys()];return o.options.messagesCLine truncated
|
||||
`+t.message,window.Debug.error(t),$p=null}).finally(()=>{for(const t of SA)t($p),SA.delete(t);e($p)})})}const y8=bt.create({name:"ipsMessages",addCommands(){let e={_messages:new Map,addMessage(n,r=""){this._messages.set(n,r)},removeMessage(n){this._messages.delete(n)},get messages(){return this._messages},onVisibilityChange(n){t=n}},t=!1;return{showMessage:(n,r="")=>()=>{e==null||e.addMessage(n,r)},hideMessage:n=>()=>{e==null||e.removeMessage(n)},registerMessageInterface:n=>()=>{var i,o,s;if(Object.is(n,e))return!1;let r=!1;for(const a in n)if(!Object.is(n[a],e[a])){r=!0;break}if(!r)return!1;if(e.messages instanceof Map)for(const a of e.messages.keys())(o=(i=n==null?void 0:n.messages)==null?void 0:i.has)!=null&&o.call(i,a)&&n.messages.get(a)===e.messages.get(a)||n.addMessage(a,e.messages.get(a));(!("visible"in n)||n.visible!==t)&&((s=n.onVisibilityChange)==null||s.call(n,t)),e=n},fireVisibilityChange:n=>()=>{var r;t=!!n,(r=e==null?void 0:e.onVisibilityChange)==null||r.call(e,t)}}}}),C8=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new je({key:e||new Qe("fileHandler"),props:{handleDrop(o,s){var a;if(!r||!(!((a=s.dataTransfer)===null||a===void 0)&&a.files.length))return!1;const l=o.posAtCoords({left:s.clientX,top:s.clientY});let u=Array.from(s.dataTransfer.files);return i&&(u=u.filter(p=>i.includes(p.type))),u.length!==0&&(s.preventDefault(),s.stopPropagation(),r(t,u,(l==null?void 0:l.pos)||0),!0)},handlePaste(o,s){var a;if(!n||!(!((a=s.clipboardData)===null||a===void 0)&&a.files.length))return!1;let l=Array.from(s.clipboardData.files);const u=s.clipboardData.getData("text/html");return i&&(l=l.filter(p=>i.includes(p.type))),l.length!==0&&(s.preventDefault(),s.stopPropagation(),n(t,l,u),!(u.length>0))}}}),R8=bt.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}),addProseMirrorPlugins(){return[C8({key:new Qe(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function N8({mimeTypes:e,handler:t}){let n;Array.isArray(e)&&(n=new Set(e.map(i=>i.toLowerCase())));const r=i=>{const o=i instanceof DragEvent?i.dataTransfer:i.clipboardData;if(o.files.length){const s=[];for(const a of o.files)(!n||n.has(a.type.toLowerCase()))&&s.push(a);if(s.length)return t(s),!0}};return new je({key:new Qe("ipsDataTransferFixer"),props:{handlePaste:(i,o)=>r(o),handleDrop:(i,o)=>r(o)}})}const v8=R8.extend({addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),injectAttachments:t=>({editor:n,chain:r})=>{const i=O8(n.options.postkey);if(!i)return!1;let o=r();for(const s of t){const a=Math.round(Math.random()*Math.pow(10,8));let l=!1;o=o.insertContent({type:ut.name,attrs:{attachmentType:"file",attachmentSrc:"",attachmentLink:"",fileId:a,attachmentTitle:"Uploading Attachment..."}}),i.dispatchEvent(new A8({file:s,data:{ready:u=>{if(l)return;l=!0;const p=xb(n.$doc,a);p.length&&n.commands.command(({tr:_,chain:f})=>{let g=f();for(const{to:h,from:E}of p)g=g.insertContentAt({from:_.mapping.map(E),to:_.mapping.map(h)},u,{parseOptions:{preserveWhitespace:!1}});return!0})},error:u=>{l||(l=!0,u instanceof Error&&(u.message=`File upload failed:
|
||||
${u.message}`,window.Debug.warn(u),n.commands.showMessage("file-attach","Couldn't insert one or more files pasted or dropped in the editor.")),n.commands.removeAttachment(a))}}}))}return o.run(),!0}}},addProseMirrorPlugins(){var e;return[N8({mimeTypes:this.options.allowedMimeTypes,handler:t=>this.options.onPaste(this.editor,t)}),...((e=this.parent)==null?void 0:e.call(this))||[]]}}).configure({onPaste(e,t){return e.commands.injectAttachments(t)},onDrop(e,t){return e.commands.injectAttachments(t)}});function O8(e){return!e||typeof e!="string"?null:document.querySelector(`[data-ipsuploader-postkey="${e}"]`)}class A8 extends Event{constructor(t){super("injectFile"),this.data=t}}const I8=["name","group","isInline","isBlock","isText","selectable","exitable","atom","addOptions","addKeyboardShortcuts","addAttributes","addGlobalAttributes","renderHTML","parseHTML","onCreate","onUpdate","onBeforeCreate","onFocus","onBlur","onBeforeCreate","onSelectionUpdate","onDestroy","onTransaction","priority","defaultOptions","addInputRules","marks","addNodeView","whitespace","defining","isolating","renderText"];function w8(e,t){var a,l,u;if(!e.ipsPlugins){e.ipsPlugins={buttons:{},extensions:[],nodes:[],marks:[]};return}e.ipsPlugins.buttons={},Array.isArray((a=e.ipsPlugins)==null?void 0:a.extensions)?s(e.ipsPlugins.extensions,bt):e.ipsPlugins.extensions=[],Array.isArray((l=e.ipsPlugins)==null?void 0:l.nodes)?s(e.ipsPlugins.nodes,rt):e.ipsPlugins.nodes=[],Array.isArray((u=e.ipsPlugins)==null?void 0:u.marks)?s(e.ipsPlugins.marks,cn):e.ipsPlugins.marks=[],e.ipsPlugins.nestedToolbars={},e.pluginButtonKeys=new Set;const n=new Set(e.tools.toolbar);for(const p in e.ipsPlugins.buttons)for(const{before:_,after:f}of e.ipsPlugins.buttons[p].locations){let g,h=!1;if(typeof f=="string"&&f in qO){const E=qO[f];e.ipsPlugins.nestedToolbars[E]=e.ipsPlugins.nestedToolbars[E]||[...rs[E]],e.ipsPlugins.nestedToolbars[E].push(`custom:${p}`),h=!0}else if(typeof f=="string"&&n.has(f))g=e.tools.toolbar.indexOf(f)+1;else if(typeof _=="string"&&n.has(_))g=e.tools.toolbar.indexOf(_);else if(!_&&!f||_===null||f===null)g=e.tools.toolbar.length;else continue;e.pluginButtonKeys.add(`custom:${p}`),h||(n.add(`custom:${p}`),e.tools.toolbar.splice(g,0,`custom:${p}`))}function r(p){for(const _ of p.attributes)["class","style","id","src","title","rel","alt"].includes(_.name.toLowerCase())||p.removeAttribute(_.name);for(const _ of p.querySelectorAll(":scope > *"))r(_)}function i(p,_){var f;if(p.addButtons instanceof Function){const g=p.addButtons.bind(_)();if(typeof g!="object")throw new TypeError;const h=new DOMParser;for(const E in g){let{html:b,command:T,locations:y,element:R,isActive:A,isAvailable:I}=g[E];if(typeof b!="string"&&!(R instanceof HTMLElement)||!(T instanceof Function)||!Array.isArray(y))throw new TypeError;A!==void 0&&typeof A!="boolean"&&!(A instanceof Function)&&(window.Debug.warn(`Expected isActive to be a boolean or a Function, got a ${typeof A}. Casting to boolean.`),A=!!A),I!==void 0&&typeof I!="boolean"&&!(I instanceof Function)&&(window.Debug.warn(`Expected isAvailable to be a boolean or a Function, got a ${typeof I}. Casting to boolean.`),I=!!I);const M=[];for(const H of y)if(H===null)M.push({after:null,before:void 0});else if(typeof H=="object"){if(![void 0,null].includes(H.before)&&typeof H.before!="string"||![void 0,null].includes(H.after)&&typeof H.after!="string")throw new TypeError;M.push({after:H.after,before:H.before})}else typeof H=="string"?M.push({after:H,before:void 0}):M.push({after:void 0,before:void 0});y=M;const k=["script","link","style","pre","code","iframe","object","embed","noscript","video"];if(R instanceof Element)R.querySelectorAll(k.join(",")).forEach(H=>H.remove());else{const H=h.parseFromString(b,"text/html");if(!(H instanceof Document))throw new RangeError("The html passed in for the button is not readable");if(H.querySelectorAll(k.join(",")).forEach(ae=>ae.remove()),!(((f=H==null?void 0:H.body)==null?void 0:f.firstElementChild)instanceof HTMLElement)||!H.body.firstElementChild.innerHTML.length)throw new RangeError("The html passed in for the button is not readable");R=H.body.firstElementChild}if(r(R),k.includes(R.tagName.toLowerCase()))throw new RangeError(`The element of type ${R.tagName} cannot be used as a toolbar button`);const $=R.cloneNode(!0),z=`${p.name}_${E}`;e.ipsPlugins.buttons[z]={get element(){return $},set element(H){throw new Error("Cannot update the element of an ipsPlugin button!")},get command(){return T.bind(_)},set command(H){throw new Error("Cannot update the command of an ipsPlugin button!")},get isActive(){return A instanceof Function?A.bind(_):A},set isActive(H){throw new Error("Cannot update the isActive property of an ipsPlugin button!")},get isAvailable(){return I instanceof Function?I.bind(_):I},set isAvailable(H){throw new Error("Cannot update the isAvailable property of an ipsPlugin button!")},get locations(){return y},set locations(H){throw new Error("Cannot update properties of ips
Line truncated
|
||||
${g.message}`,window.Debug.warn(g)}}}const rE=bt.create({name:"ipsHomeEnd",addKeyboardShortcuts(){return{Home:({editor:e})=>(Kt(()=>{var i,o,s;const{$from:t}=e.state.selection,n=t.pos-t.parentOffset;let r=t.pos;for(;r>n;){const a=e.state.doc.slice(r-1,r);if(((i=a.content.content[0])==null?void 0:i.textContent)===`
|
||||
`||((s=(o=a.content.content[0])==null?void 0:o.type)==null?void 0:s.name)===Bu.name)break;r--}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'Home' key press"),!0),End:({editor:e})=>(Kt(()=>{var i,o,s;const{$to:t}=e.state.selection,n=[...t.path].reverse()[3]+t.parent.nodeSize-1;let r=t.pos;for(;r<n;){const a=e.state.doc.slice(r,r+1);if(((i=a.content.content[0])==null?void 0:i.textContent)===`
|
||||
`||((s=(o=a.content.content[0])==null?void 0:o.type)==null?void 0:s.name)===Bu.name)break;r++}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'End' key press"),!0)}}}),D8=bt.create({name:"IPSSimpleRichText",addProseMirrorPlugins(){return[new je({key:new Qe("ipsSimpleRichTextPlugin"),filterTransaction:e=>!(this.editor.options.lengthFunction instanceof Function&&typeof this.editor.options.maxLength=="number"&&this.editor.options.lengthFunction(Ku(e.doc.content,this.editor.schema))>this.editor.options.maxLength),appendTransaction:(e,t,n)=>{const r=[];let i;const{from:o,to:s}=n.selection;n.doc.descendants((l,u)=>{var p,_;if(typeof l.textContent=="string"&&!l.textContent&&!l.isInline){const f=n.doc.resolve(u),g=x8(f,n.doc),h=M8(f,n.doc);if([o,s].some(E=>g.pos<E&&h.pos>E)){if(i===void 0&&e.some(E=>{var b;return(b=E.steps)==null?void 0:b.length})){let E=1,b=l;for(;(_=(p=b.content)==null?void 0:p.content)!=null&&_.length;)E++,b=b.content.content[0];i=E+u}return!1}return r.push([u,u+l.nodeSize]),!1}if(l.isInline||!l.content.content.length)return!1});const{tr:a}=n;for(const[l,u]of r.reverse())a.delete(l,u);if(i!==void 0){const l=Se.atStart(n.doc).from,u=Se.atEnd(n.doc).to,p=Se.create(n.doc,Lo(i,l,u));o===p.from&&o===s||a.setSelection(p)}return a}})]},addKeyboardShortcuts(){return{Enter:({editor:e})=>{const t=e.view.dom.closest("form");if(t){let n=t.querySelector('button:is([type="submit"], :not([type]))');n||(n=document.createElement("button"),n.setAttribute("type","button"),n.setAttribute("hidden",""),t.appendChild(n),setTimeout(()=>n.documentElement===document.documentElement&&n.remove(),200)),n.click()}return!0},"Shift-Enter":({editor:e})=>(e.isActive(Du.name)?e.commands.splitListItem(Du.name):e.commands.splitBlock(),!1)}},onCreate(){this.editor.view.dom.addEventListener("clear",e=>{var t;this.editor.commands.setContent(((t=e.detail)==null?void 0:t.content)||"")})}});function x8(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]>0){let o=n[2].content.content[n[1]-1],s=0;for(;o;)o=(i=(r=o.content)==null?void 0:r.content)!=null&&i.length?o.content.content[o.content.content.length-1]:null,s++;return t.resolve(e.pos-s)}n.splice(0,3)}return t.resolve(0)}function M8(e,t){var r,i;const n=[...e.path].reverse();for(;n.length>=3;){if(n[1]<n[2].content.content.length-1){let o=n[2].content.content[n[1]+1],s=0;for(;o;)s++,o=(i=(r=o.content)==null?void 0:r.content)==null?void 0:i[0];return t.resolve(e.pos+n[2].content.content[n[1]].nodeSize+s)}n.splice(0,3)}return t.resolve(t.nodeSize-2)}const L8=rt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",We(this.options.HTMLAttributes,e),0]}}),k8=rt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",We(this.options.HTMLAttributes,e),0]}}),P8=rt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",We(this.options.HTMLAttributes,e),0]}}),U8=bt.create({name:"ipsClearNewLine",addOptions(){return{removeNewLinesBefore:[]}},addStorage(){return{observedNodes:[tr.name,nr.name,sl.name,ns.name,Ub.name,ut.name]}},onCreate(){this.options.removeNewLinesBefore.length&&(this.storage.observedNodes=[...new Set([...this.storage.observedNodes,...this.options.removeNewLinesBefore])])},addKeyboardShortcuts(){return{Backspace:({editor:e})=>{var o,s,a,l,u,p,_;const{observedNodes:t}=this.storage;if(!(t!=null&&t.length))return;const n=e.state.selection;if(!n.empty)return;const r=n.$from.parent;if(!r||r.type.name!==Dt.name)return;const i=[...n.$from.path].reverse();if(r.content.size){if(!((u=(l=r==null?void 0:r.content)==null?void 0:l.content)!=null&&u.length)||r.content.content.length<2||((p=n.$from.nodeAfter)==null?void 0:p.type.name)!==Bu.name||!t.includes((_=r.content.content[n.$from.parentOffset+1])==null?void 0:_.type.name))return;const f=i[1];let g;if(f!==0){if(!t.includes(r.content.content[f-1]))return;g=n.from-r.content.content[f-1].nodeSize}else{const h=i[5],E=i[4],b=h.type.name===sl.name?1:0;E>b&&t.includes(h.content.content[E-1].type.name)&&(g=i[3]-h.content.content[E-1].nodeSize)}return(typeof g!="number"||Number.isNaN(g))&&(g=n.from),e.chain().deleteRange({from:n.from,to:n.from+1}).setNodeSelection(g).run(),!0}else{const f=i[5],g=i[4];if(!f||g===void 0)return;co
Line truncated
|
||||
`}}),...(f=e.restrictions)!=null&&f.has("tables")?[!1]:[uL.configure({resizable:!0,cellMinWidth:((g=e.table)==null?void 0:g.cellMinWidth)||100}),L8,k8,P8],pL,U8].filter(R=>!!R);return window.navigator.platform==="MacIntel"&&t.push(rE),e.autoSaveKey&&t.push(_L),e.postkey&&(t.push(v8),t.push(ut.configure({externalImages:!((h=e.restrictions)!=null&&h.has("external_image")),externalVideos:!((E=e.restrictions)!=null&&E.has("external_video")),float:!((b=e.restrictions)!=null&&b.has("float"))}))),(T=e.restrictions)!=null&&T.has("heading")||t.push(Tn.configure({levels:(y=e.restrictions)!=null&&y.has("heading_1")?[2,3,4,5,6]:[1,2,3,4,5,6]})),t}async function TA(e,t){var n,r;if(e.pluginButtonKeys=new Set,e.simpleRichText?(delete e.codeMode,e.tools={toolbar:[...ZM]},e.react&&mW(e.react)):await r6(),e.restrictions&&Symbol.iterator in e.restrictions?e.restrictions=new Set(e.restrictions):delete e.restrictions,e.jQuery=e.jQuery||window.jQuery,e.editorProps={attributes:{class:e.codeMode?"":"ipsRichText"}},e.itemStates={},e.extensions=B8(e),!(e.messagesContainer instanceof Element)&&((n=t==null?void 0:t.closest(".ipsEditor"))!=null&&n.querySelector('[data-role="editor-messages-container"]'))&&(e.messagesContainer=(r=t==null?void 0:t.closest(".ipsEditor"))==null?void 0:r.querySelector('[data-role="editor-messages-container"]')),e.codeMode)return e.tools={toolbar:["codelanguage"]},e;if(e.simpleRichText||w8(e,e.extensions),e.stockrepliesenabled){const i=await Pb();Object.keys(i).length?window.Debug.log("Loaded stock replies"):(e.stockrepliesenabled=!1,window.Debug.log("No stock replies, disabling the button"))}if(!e.codeMode){for(const i in e.tools)e.tools[i]=e.tools[i].filter(o=>o==="giphy"&&!e.giphyenabled||o==="stockreply"&&!e.stockrepliesenabled?!1:!(e.hidebuttons instanceof Array&&e.hidebuttons.includes(o)));e.parseOptions=e.parseOptions||{},e.parseOptions.preserveWhitespace=!1}return e.tools.toolbar&&e.tools.toolbar[0]!=="block"&&(e.tools.toolbar=["block",...e.tools.toolbar.filter(i=>i!=="block")]),e}let bA=!1;function F8(){if(!bA){for(const e of["click","focus","keydown","keyup"])document.addEventListener(e,t=>{var n,r,i;(r=(n=t.target)==null?void 0:n.closest)!=null&&r.call(n,".ipsEditor__toolbar-item--unavailable")&&(t.preventDefault(),t.stopPropagation(),(i=t.stopImmediatePropagation)==null||i.call(t))},{capture:!0});bA=!0}}setTimeout(()=>window.ips.createModule("ips.utils.tiptap",()=>{const e={tools:{toolbar:["block","insert","bold","italic","underline","size","color","link","icon","stockreply","giphy","clear","format","tableOptions"]},allowedIframeDomains:window.ips.getSetting("allowedIframeDomains")||[],restrictions:new Set};return document.dispatchEvent(new CustomEvent("ipsTiptapLoaded")),{editorInstance(t,n={}){const r=iE.createRoot(t),i=er.debounce((o,s)=>{s([o,r]),o.options.name&&setTimeout(()=>o.options.jQuery(o.view.dom.closest("[data-ipseditorv5]")).trigger("editorWidgetInitialized",{id:o.options.name}))},10,{leading:!1});return F8(),new Promise(o=>{TA({...e,...n},t).then(s=>{r.render(N.jsx(St.StrictMode,{children:N.jsx(mj,{resolve:a=>{i(a,o)},config:s})}))})})},allCodeLanguages:bl,async decorateSimpleRichTextConfig(t){return t.simpleRichText=!0,await TA(t)}}}));
|
||||
@@ -69,7 +69,7 @@
|
||||
"isDynamicEntry": true
|
||||
},
|
||||
"src/main.jsx": {
|
||||
"file": "assets/main-Ce8dEiGN.js",
|
||||
"file": "assets/main-Du6DOVZr.js",
|
||||
"name": "main",
|
||||
"src": "src/main.jsx",
|
||||
"isEntry": true,
|
||||
|
||||
Reference in new issue
Block a user