Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -0,0 +1,267 @@
|
||||
var G$=Object.defineProperty;var $$=(e,t,n)=>t in e?G$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var fi=(e,t,n)=>$$(e,typeof t!="symbol"?t+"":t,n);var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jI={exports:{}},am={},XI={exports:{}},ze={};/**
|
||||
* @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 id=Symbol.for("react.element"),Y$=Symbol.for("react.portal"),H$=Symbol.for("react.fragment"),z$=Symbol.for("react.strict_mode"),V$=Symbol.for("react.profiler"),W$=Symbol.for("react.provider"),q$=Symbol.for("react.context"),K$=Symbol.for("react.forward_ref"),Q$=Symbol.for("react.suspense"),j$=Symbol.for("react.memo"),X$=Symbol.for("react.lazy"),FR=Symbol.iterator;function Z$(e){return e===null||typeof e!="object"?null:(e=FR&&e[FR]||e["@@iterator"],typeof e=="function"?e:null)}var ZI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},JI=Object.assign,ew={};function $l(e,t,n){this.props=e,this.context=t,this.refs=ew,this.updater=n||ZI}$l.prototype.isReactComponent={};$l.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")};$l.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tw(){}tw.prototype=$l.prototype;function UT(e,t,n){this.props=e,this.context=t,this.refs=ew,this.updater=n||ZI}var GT=UT.prototype=new tw;GT.constructor=UT;JI(GT,$l.prototype);GT.isPureReactComponent=!0;var UR=Array.isArray,nw=Object.prototype.hasOwnProperty,$T={current:null},rw={key:!0,ref:!0,__self:!0,__source:!0};function iw(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)nw.call(t,r)&&!rw.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:id,type:e,key:o,ref:s,props:i,_owner:$T.current}}function J$(e,t){return{$$typeof:id,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function YT(e){return typeof e=="object"&&e!==null&&e.$$typeof===id}function eY(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GR=/\/+/g;function fh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?eY(""+e.key):t.toString(36)}function hf(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 id:case Y$:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+fh(s,0):r,UR(i)?(n="",e!=null&&(n=e.replace(GR,"$&/")+"/"),hf(i,t,n,"",function(u){return u})):i!=null&&(YT(i)&&(i=J$(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(GR,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",UR(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+fh(o,a);s+=hf(o,t,n,l,i)}else if(l=Z$(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+fh(o,a++),s+=hf(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 Tp(e,t,n){if(e==null)return e;var r=[],i=0;return hf(e,r,"","",function(o){return t.call(n,o,i++)}),r}function tY(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 $n={current:null},Ef={transition:null},nY={ReactCurrentDispatcher:$n,ReactCurrentBatchConfig:Ef,ReactCurrentOwner:$T};function ow(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:Tp,forEach:function(e,t,n){Tp(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Tp(e,function(){t++}),t},toArray:function(e){return Tp(e,function(t){return t})||[]},only:function(e){if(!YT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=$l;ze.Fragment=H$;ze.Profiler=V$;ze.PureComponent=UT;ze.StrictMode=z$;ze.Suspense=Q$;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nY;ze.act=ow;ze.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=JI({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=$T.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)nw.call(t,l)&&!rw.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:id,type:e.type,key:i,ref:o,props:r,_owner:s}};ze.createContext=function(e){return e={$$typeof:q$,_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 rY=L,iY=Symbol.for("react.element"),oY=Symbol.for("react.fragment"),sY=Object.prototype.hasOwnProperty,aY=rY.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lY={key:!0,ref:!0,__self:!0,__source:!0};function sw(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)sY.call(t,r)&&!lY.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:iY,type:e,key:o,ref:s,props:i,_owner:aY.current}}am.Fragment=oY;am.jsx=sw;am.jsxs=sw;jI.exports=am;var v=jI.exports,HE={},aw={exports:{}},Cr={},lw={exports:{}},cw={};/**
|
||||
* @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(k,U){var V=k.length;k.push(U);e:for(;0<V;){var W=V-1>>>1,ee=k[W];if(0<i(ee,U))k[W]=U,k[V]=ee,V=W;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var U=k[0],V=k.pop();if(V!==U){k[0]=V;e:for(var W=0,ee=k.length,he=ee>>>1;W<he;){var ye=2*(W+1)-1,pe=k[ye],Ge=ye+1,at=k[Ge];if(0>i(pe,V))Ge<ee&&0>i(at,pe)?(k[W]=at,k[Ge]=V,W=Ge):(k[W]=pe,k[ye]=V,W=ye);else if(Ge<ee&&0>i(at,V))k[W]=at,k[Ge]=V,W=Ge;else break e}}return U}function i(k,U){var V=k.sortIndex-U.sortIndex;return V!==0?V:k.id-U.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=[],d=1,f=null,_=3,m=!1,h=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,S=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 C(k){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=k)r(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(u)}}function O(k){if(E=!1,C(k),!h)if(n(l)!==null)h=!0,$(N);else{var U=n(u);U!==null&&F(O,U.startTime-k)}}function N(k,U){h=!1,E&&(E=!1,S(D),D=-1),m=!0;var V=_;try{for(C(U),f=n(l);f!==null&&(!(f.expirationTime>U)||k&&!oe());){var W=f.callback;if(typeof W=="function"){f.callback=null,_=f.priorityLevel;var ee=W(f.expirationTime<=U);U=e.unstable_now(),typeof ee=="function"?f.callback=ee:f===n(l)&&r(l),C(U)}else r(l);f=n(l)}if(f!==null)var he=!0;else{var ye=n(u);ye!==null&&F(O,ye.startTime-U),he=!1}return he}finally{f=null,_=V,m=!1}}var w=!1,x=null,D=-1,z=5,P=-1;function oe(){return!(e.unstable_now()-P<z)}function _e(){if(x!==null){var k=e.unstable_now();P=k;var U=!0;try{U=x(!0,k)}finally{U?le():(w=!1,x=null)}}else w=!1}var le;if(typeof y=="function")le=function(){y(_e)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,q=se.port2;se.port1.onmessage=_e,le=function(){q.postMessage(null)}}else le=function(){T(_e,0)};function $(k){x=k,w||(w=!0,le())}function F(k,U){D=T(function(){k(e.unstable_now())},U)}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(k){k.callback=null},e.unstable_continueExecution=function(){h||m||(h=!0,$(N))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(k){switch(_){case 1:case 2:case 3:var U=3;break;default:U=_}var V=_;_=U;try{return k()}finally{_=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,U){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var V=_;_=k;try{return U()}finally{_=V}},e.unstable_scheduleCallback=function(k,U,V){var W=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?W+V:W):V=W,k){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=V+ee,k={id:d++,callback:U,priorityLevel:k,startTime:V,expirationTime:ee,sortIndex:-1},V>W?(k.sortIndex=V,t(u,k),n(l)===null&&k===n(u)&&(E?(S(D),D=-1):E=!0,F(O,V-W))):(k.sortIndex=ee,t(l,k),h||m||(h=!0,$(N))),k},e.unstable_shouldYield=oe,e.unstable_wrapCallback=function(k){var U=_;return function(){var V=_;_=U;try{return k.apply(this,arguments)}finally{_=V}}}})(cw);lw.exports=cw;var cY=lw.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 uY=L,yr=cY;function ie(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 uw=new Set,gu={};function Ea(e,t){bl(e,t),bl(e+"Capture",t)}function bl(e,t){for(gu[e]=t,e=0;e<t.length;e++)uw.add(t[e])}var oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zE=Object.prototype.hasOwnProperty,dY=/^[: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]*$/,$R={},YR={};function pY(e){return zE.call(YR,e)?!0:zE.call($R,e)?!1:dY.test(e)?YR[e]=!0:($R[e]=!0,!1)}function fY(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 _Y(e,t,n,r){if(t===null||typeof t>"u"||fY(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 Yn(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 hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new Yn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new Yn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new Yn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new Yn(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){hn[e]=new Yn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new Yn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new Yn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new Yn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new Yn(e,5,!1,e.toLowerCase(),null,!1,!1)});var HT=/[\-:]([a-z])/g;function zT(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(HT,zT);hn[t]=new Yn(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(HT,zT);hn[t]=new Yn(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(HT,zT);hn[t]=new Yn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new Yn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!0,!0)});function VT(e,t,n,r){var i=hn.hasOwnProperty(t)?hn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!==
Line truncated
|
||||
`+_h+e}var mh=!1;function gh(e,t){if(!e||mh)return"";mh=!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{mh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pc(e):""}function mY(e){switch(e.tag){case 5:return Pc(e.type);case 16:return Pc("Lazy");case 13:return Pc("Suspense");case 19:return Pc("SuspenseList");case 0:case 2:case 15:return e=gh(e.type,!1),e;case 11:return e=gh(e.type.render,!1),e;case 1:return e=gh(e.type,!0),e;default:return""}}function KE(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 Xa:return"Fragment";case ja:return"Portal";case VE:return"Profiler";case WT:return"StrictMode";case WE:return"Suspense";case qE:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pw:return(e.displayName||"Context")+".Consumer";case dw:return(e._context.displayName||"Context")+".Provider";case qT:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case KT:return t=e.displayName||null,t!==null?t:KE(e.type)||"Memo";case ko:t=e._payload,e=e._init;try{return KE(e(t))}catch{}}return null}function gY(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 KE(t);case 8:return t===WT?"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 ps(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _w(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hY(e){var t=_w(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 yp(e){e._valueTracker||(e._valueTracker=hY(e))}function mw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_w(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gf(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 QE(e,t){var n=t.checked;return Nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zR(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ps(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 gw(e,t){t=t.checked,t!=null&&VT(e,"checked",t,!1)}function jE(e,t){gw(e,t);var n=ps(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")?XE(e,t.type,n):t.hasOwnProperty("defaultValue")&&XE(e,t.type,ps(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function VR(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 XE(e,t,n){(t!=="number"||Gf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bc=Array.isArray;function cl(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=""+ps(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 ZE(e,t){if(t.dan
Line truncated
|
||||
`).replace(OH,"")}function wp(e,t,n){if(t=_N(t),_N(e)!==t&&n)throw Error(ie(425))}function Kf(){}var dS=null,pS=null;function fS(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 _S=typeof setTimeout=="function"?setTimeout:void 0,AH=typeof clearTimeout=="function"?clearTimeout:void 0,mN=typeof Promise=="function"?Promise:void 0,IH=typeof queueMicrotask=="function"?queueMicrotask:typeof mN<"u"?function(e){return mN.resolve(null).then(e).catch(wH)}:_S;function wH(e){setTimeout(function(){throw e})}function Ih(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),bu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);bu(t)}function ns(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 gN(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 Hl=Math.random().toString(36).slice(2),bi="__reactFiber$"+Hl,Nu="__reactProps$"+Hl,so="__reactContainer$"+Hl,mS="__reactEvents$"+Hl,xH="__reactListeners$"+Hl,DH="__reactHandles$"+Hl;function zs(e){var t=e[bi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[so]||n[bi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gN(e);e!==null;){if(n=e[bi])return n;e=gN(e)}return t}e=n,n=e.parentNode}return null}function ad(e){return e=e[bi]||e[so],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function tl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function pm(e){return e[Nu]||null}var gS=[],nl=-1;function Ss(e){return{current:e}}function ht(e){0>nl||(e.current=gS[nl],gS[nl]=null,nl--)}function pt(e,t){nl++,gS[nl]=e.current,e.current=t}var fs={},On=Ss(fs),ir=Ss(!1),la=fs;function yl(e,t){var n=e.type.contextTypes;if(!n)return fs;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 or(e){return e=e.childContextTypes,e!=null}function Qf(){ht(ir),ht(On)}function hN(e,t,n){if(On.current!==fs)throw Error(ie(168));pt(On,t),pt(ir,n)}function ix(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(ie(108,gY(e)||"Unknown",i));return Nt({},n,r)}function jf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fs,la=On.current,pt(On,e),pt(ir,ir.current),!0}function EN(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=ix(e,t,la),r.__reactInternalMemoizedMergedChildContext=e,ht(ir),ht(On),pt(On,e)):ht(ir),pt(ir,n)}var Ki=null,fm=!1,wh=!1;function ox(e){Ki===null?Ki=[e]:Ki.push(e)}function MH(e){fm=!0,ox(e)}function Ts(){if(!wh&&Ki!==null){wh=!0;var e=0,t=it;try{var n=Ki;for(it=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ki=null,fm=!1}catch(i){throw Ki!==null&&(Ki=Ki.slice(e+1)),ww(jT,Ts),i}finally{it=t,wh=!1}}return null}var rl=[],il=0,Xf=null,Zf=0,Fr=[],Ur=0,ca=null,Xi=1,Zi="";function Us(e,t){rl[il++]=Zf,rl[il++]=Xf,Xf=e,Zf=t}function sx(e,t,n){Fr[Ur++]=Xi,Fr[Ur++]=Zi,Fr[Ur++]=ca,ca=e;var r=Xi;e=Zi;var i=32-oi(r)-1;r&=~(1<<i),n+=1;var o=32-oi(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Xi=1<<32-oi(t)+i|n<<i|r,Zi=o+e}else Xi=1<<o|n<<i|r,Zi=e}function ob(e){e.return!==null&&(Us(e,1),sx(e,1,0))}function sb(e){for(;e===Xf;)Xf=rl[--il],rl[il]=null,Zf=rl[--il],rl[il]=null;for(;e===ca;)ca=Fr[--Ur],Fr[Ur]=null,Zi=Fr[--Ur],Fr[Ur]=null,Xi=Fr[--Ur],Fr[Ur]=null}var Tr=null,Sr=null,Tt=!1,ti=null;function ax(e,t){var n=$r(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 SN(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,Tr=e,Sr=ns(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Tr=e,Sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ca!==null?{id:Xi,overflow:Zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=$r(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Tr=e,Sr=null,!0):!1;default:return!1}}function hS(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ES(e){if(Tt){var t=Sr;if(t){var n=t;if(!SN(e,t)){if(hS(e))throw Error(ie(418));t=ns(n.nextSibling);var r=Tr;t&&SN(e,t)?ax(r,n):(e.flags=e.flags&-4097|2,Tt=!1,Tr=e)}}else{if(hS(e))throw Error(ie(418));e.flags=e.flags&-4097|2,Tt=!1,Tr=e}}}function TN(e){
Line truncated
|
||||
Error generating stack: `+o.message+`
|
||||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function kh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function yS(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var YH=typeof WeakMap=="function"?WeakMap:Map;function Lx(e,t,n){n=to(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){s_||(s_=!0,DS=r),yS(e,t)},n}function kx(e,t,n){n=to(-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(){yS(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){yS(e,t),typeof r!="function"&&(is===null?is=new Set([this]):is.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function AN(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new YH;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=n2.bind(null,e,t,n),t.then(e,e))}function IN(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 wN(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=to(-1,1),t.tag=2,rs(n,t,1))),n.lanes|=1),e)}var HH=_o.ReactCurrentOwner,nr=!1;function kn(e,t,n,r){t.child=e===null?ux(t,null,n,r):vl(t,e.child,n,r)}function xN(e,t,n,r,i){n=n.render;var o=t.ref;return fl(t,i),r=hb(e,t,n,r,o,i),n=Eb(),e!==null&&!nr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lo(e,t,i)):(Tt&&n&&ob(t),t.flags|=1,kn(e,t,r,i),t.child)}function DN(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Ab(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Px(e,t,o,r,i)):(e=Af(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:Cu,n(s,r)&&e.ref===t.ref)return lo(e,t,i)}return t.flags|=1,e=as(o,r),e.ref=t.ref,e.return=t,t.child=e}function Px(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Cu(o,r)&&e.ref===t.ref)if(nr=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(nr=!0);else return t.lanes=e.lanes,lo(e,t,i)}return CS(e,t,n,r,i)}function Bx(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},pt(al,gr),gr|=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,pt(al,gr),gr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,pt(al,gr),gr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,pt(al,gr),gr|=r;return kn(e,t,i,n),t.child}function Fx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function CS(e,t,n,r,i){var o=or(n)?la:On.current;return o=yl(t,o),fl(t,i),n=hb(e,t,n,r,o,i),r=Eb(),e!==null&&!nr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lo(e,t,i)):(Tt&&r&&ob(t),t.flags|=1,kn(e,t,n,i),t.child)}function MN(e,t,n,r,i){if(or(n)){var o=!0;jf(t)}else o=!1;if(fl(t,i),t.stateNode===null)Rf(e,t),Mx(t,n,r),bS(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=Vr(u):(u=or(n)?la:On.current,u=yl(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&ON(t,s,r,u),Po=!1;var _=t.memoizedState;s.state=_,t_(t,r,s,i),l=t.memoizedState,a!==r||_!==l||ir.current||Po?(typeof d=="function"&&(TS(t,n,d,r),l=t.memoizedState),(a=Po||NN(t,n,a,r,_,l,u))?(f||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,px(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Jr(t.type,a),s.props=u,f=t.pendingProps,_=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Vr(l):(l=or(n)?la:On.current,l=yl(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||_!==l)&&ON(t,s,r,l),Po=!1,_=t.memoizedState,s.state=_,t_(t,r,s,i);var h=t.memoizedS
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Al=L;function _2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var m2=typeof Object.is=="function"?Object.is:_2,g2=Al.useState,h2=Al.useEffect,E2=Al.useLayoutEffect,S2=Al.useDebugValue;function T2(e,t){var n=t(),r=g2({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return E2(function(){i.value=n,i.getSnapshot=t,Uh(i)&&o({inst:i})},[e,n,t]),h2(function(){return Uh(i)&&o({inst:i}),e(function(){Uh(i)&&o({inst:i})})},[e]),S2(n),n}function Uh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!m2(e,n)}catch{return!0}}function b2(e,t){return t()}var y2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b2:T2;cD.useSyncExternalStore=Al.useSyncExternalStore!==void 0?Al.useSyncExternalStore:y2;lD.exports=cD;var Mb=lD.exports;function pn(e){this.content=e}pn.prototype={constructor:pn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new pn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new pn(n)},addToStart:function(e,t){return new pn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new pn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new pn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=pn.from(e),e.size?new pn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=pn.from(e),e.size?new pn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=pn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};pn.from=function(e){if(e instanceof pn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new pn(t)};function uD(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=uD(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function dD(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let u=0,d=Math.min(s.text.length,a.text.length);for(;u<d&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let u=dD(s.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class J{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>t&&r(l,i+a,o||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,n-d),r,i+d)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new J(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new J(r,i)}cutByIndex(t,n){return t==n?J.empty:t==0&&n==this.content.length?this:new J(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new J(i,o)}addToStart(t){return new J([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new J(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.lenLine truncated
|
||||
`)}}fa.empty=new fa(!0);class A2{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 ED(e){let t=[];do t.push(I2(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function I2(e){let t=[];do t.push(w2(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function w2(e){let t=M2(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=x2(e,t);else break;return t}function KN(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function x2(e,t){let n=KN(e),r=n;return e.eat(",")&&(e.next!="}"?r=KN(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function D2(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 M2(e){if(e.eat("(")){let t=ED(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=D2(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 L2(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 d=n();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let d=n();r(l,d),i(o(s.expr,l),d),l=d}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function SD(e,t){return t-e}function QN(e,t){let n=[];return r(t),n.sort(SD);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 k2(e){let t=Object.create(null);return n(QN(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);QN(e,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let o=t[r.join(",")]=new fa(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(SD);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function P2(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 TD(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 bD(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 yD(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 CD(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new F2(e,r,t[r]);return n}let jN=class vD{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=CD(t,r.attrs),this.defaultAttrs=TD(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==fa.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,!/\S/.test(r)),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;OD.hasOwnProperty(s)&&this.parser.normalizeLists&&Y2(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:$2.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,d=this.needsBlock;if(ND.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 f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),u&&this.sync(o),this.needsBlock=d}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,!0)}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,t.nodeName=="BR")||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,!1));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,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(t);if(u&&(!i||i.length>u.length+a)&&(i=u,o=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=ct.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):tO(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);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=ZN(t,o,s.options);s.options&iu&&s.content.length==0&&(a|=iu);let l=ct.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):tO(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Fp(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|=Lu)}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 d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=u&&!d.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 Y2(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&OD.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function H2(e,t){return(e.matches||e.msMatchesSelector||e.webkit
Line truncated
|
||||
`))}})}function nz(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function rz(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 sn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ce(J.from(s),0,0),1,!0))}function no(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,d=n-2;u>o;u--,d--){let f=i.node(u),_=i.index(u);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(_,f.childCount),h=r&&r[d+1];h&&(m=m.replaceChild(0,h.type.create(h.attrs)));let E=r&&r[d]||f;if(!f.canReplace(_+1,f.childCount)||!E.type.validContent(m))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 iz(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 d=r&&r[u];s=J.from(d?d.type.create(d.attrs,s):i.node(a).copy(s))}e.step(new rn(t,t,new ce(o.append(s),n,n),!0))}function ys(e,t){let n=e.resolve(t),r=n.index();return kD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function oz(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 kD(e,t){return!!(e&&t&&!e.isLeaf&&oz(e,t))}function vm(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&&kD(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 sz(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 d=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let a=e.steps.length;if(r===!1){let d=e.doc.resolve(t+n);LD(e,d.node(),d.before(),a)}s.inlineContent&&kb(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 rn(u,l.map(t+n,-1),ce.empty,!0)),r===!0){let d=e.doc.resolve(u);MD(e,d.node(),d.before(),e.steps.length)}return e}function az(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 Bb(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),d=!1;if(o==1)d=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=f&&u.canReplaceWith(l,l,f[0])}if(d)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Rm(e,t,n=t,r=ce.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return PD(i,o,r)?new rn(t,n,r):new lz(i,o,r).fit()}function PD(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class lz{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 ce(o,s,a);return t>-1?new sn(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new rn(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
|
||||
`).scrollIntoView()),!0)};function zb(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 bz=(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=zb(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(Ae.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},XD=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ar||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=zb(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(be.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},ZD=(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(no(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&zl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function yz(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof Te&&t.selection.node.isBlock)return!r.parentOffset||!no(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,u=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),u=r.start(m)==r.pos-(r.depth-m),a=zb(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),o.unshift(l&&a?{type:a}:null),s=m;break}else{if(m==1)return!1;o.unshift(null)}let d=t.tr;(t.selection instanceof be||t.selection instanceof ar)&&d.deleteSelection();let f=d.mapping.map(r.pos),_=no(d.doc,f,o.length,o);if(_||(o[0]=a?{type:a}:null,_=no(d.doc,f,o.length,o)),!_)return!1;if(d.split(f,o.length,o),!l&&u&&r.node(s).type!=a){let m=d.mapping.map(r.before(s)),h=d.doc.resolve(m);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(s)),a)}return n&&n(d.scrollIntoView()),!0}}const Cz=yz(),vz=(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 Rz(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||ys(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function JD(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&Rz(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 m=t.pos+o.nodeSize,h=J.empty;for(let S=s.length-1;S>=0;S--)h=J.from(s[S].create(null,h));h=J.from(i.copy(h));let E=e.tr.step(new sn(t.pos-1,m,t.pos,m,new ce(h,1,0),s.length,!0)),T=E.doc.resolve(m+2*s.length);T.nodeAfter&&T.nodeAfter.type==i.type&&ys(E.doc,T.pos)&&E.join(T.pos),n(E.scrollIntoView())}return!0}let d=o.type.spec.isolating||r>0&&l?null:Ae.findFrom(t,1),f=d&&d.$from.blockRange(d.$to),_=f&&zl(f);if(_!=null&&_>=t.depth)return n&&n(e.tr.lift(f,_).scrollIntoView()),!0;if(u&&wl(o,"start",!0)&&wl(i,"end")){let m=i,h=[];for(;h.push(m),!m.isTextblock;)m=m.lastChild;let E=o,T=1;for(;!E.isTextblock;E=E.firstChild)T++;if(m.canReplace(m.childCount,m.childCount,E.content)){if(n){let S=J.empty;for(let C=h.length-1;C>=0;C--)S=J.from(h[C].copy(S));let y=e.tr.step(new sn(t.pos-h.length,t.pos+o.nodeSize,t.pos+T,t.pos+o.nodeSize-T,new ce(S,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function eM(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(be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const Nz=eM(-1),Oz=eM(1);function Az(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Pb(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function pO(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 d=n.doc.resolve(u),f=d.index();i=d.parent.canReplaceWith(f,f+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}}function Vb(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}Vb($b,zD,WD);Vb($b,KD,QD);Vb(jD,XD,ZD,Cz);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";const I
Line truncated
|
||||
`),f&&h==m.nodeValue.length)for(let E=m,T;E;E=E.parentNode){if(T=E.nextSibling){T.nodeName=="BR"&&(a=l={node:T.parentNode,offset:fn(T)+1});break}let S=E.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let E=m.childNodes[h-1];f=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(li&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||f&&Fn)&&ma(a.node,a.offset,d.anchorNode,d.anchorOffset)&&ma(l.node,l.offset,d.focusNode,d.focusOffset))return;let _=!1;if((u.extend||t==n)&&!f){u.collapse(a.node,a.offset);try{t!=n&&u.extend(l.node,l.offset),_=!0}catch{}}if(!_){if(t>n){let h=a;a=l,l=h}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(m)}}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?Ks:TO,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Oi:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ks:Oi}r=s}this.dirty=Ks}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Ks:TO;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class cM extends pd{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==zr&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class aV extends pd{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 ga extends pd{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=bs.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ga(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Oi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=zr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=zr}}slice(t,n,r){let i=ga.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=qS(o,n,s,r)),t>0&&(o=qS(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 cs extends pd{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),d=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=bs.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let _=d;return d=fM(d,r,n),u?l=new lV(t,n,r,i,d,f||null,_,u,o,s+1):n.isText?new Am(t,n,r,i,d,_,o):new cs(t,n,r,i,d,f||null,_,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.con
Line truncated
|
||||
|
||||
`);return{dom:l,text:_,slice:t}}function jb(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",_=>{t=_(t,o||r,e)}),o)return t?new ce(J.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
||||
`))),0,0):ce.empty;let f=e.someProp("clipboardTextParser",_=>_(t,i,r,e));if(f)a=f;else{let _=i.marks(),{schema:m}=e.state,h=bs.fromSchema(m);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(E=>{let T=s.appendChild(document.createElement("p"));E&&T.appendChild(h.serializeNode(m.text(E,_)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=IV(n),dd&&wV(s);let u=s&&s.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let _=s.firstChild;for(;_&&_.nodeType!=1;)_=_.nextSibling;if(!_)break;s=_}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||ml.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(_){return _.nodeName=="BR"&&!_.nextSibling&&_.parentNode&&!NV.test(_.parentNode.nodeName)?{ignore:!0}:null}})),d)a=xV(MO(a,+d[1],+d[2]),d[4]);else if(a=ce.maxOpen(OV(a.content,i),!0),a.openStart||a.openEnd){let f=0,_=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;_<a.openEnd&&!m.type.spec.isolating;_++,m=m.lastChild);a=MO(a,f,_)}return e.someProp("transformPasted",f=>{a=f(a,e)}),a}const NV=/^(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 OV(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&&SM(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=TM(s[s.length-1],o.length));let d=EM(a,l);s.push(d),i=i.matchType(d.type),o=l}}),s)return J.from(s)}return e}function EM(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,J.from(e));return e}function SM(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=SM(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(EM(n,e,i+1))))}}function TM(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,TM(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(J.empty,!0);return e.copy(n.append(r))}function jS(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=jS(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 MO(e,t,n){return t<e.openStart&&(e=new ce(jS(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ce(jS(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const bM={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 LO=null;function yM(){return LO||(LO=document.implementation.createHTMLDocument("title"))}let jh=null;function AV(e){let t=window.trustedTypes;return t?(jh||(jh=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),jh.createHTML(e)):e}function IV(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=yM().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&bM[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=AV(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function wV(e){let t=e.querySelectorAll(Nn?"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 xV(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 ce(i,o,s)}const Un={},Gn={},DV={touchstart:!0,touchmove:!0};class MV{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},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 LV(e){for(let t in Un){let n=Un[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{PV(e,r)&&!Xb(e,r)&&(e.editable||!(r.type in Gn))&&n(e,r)},DV[t]?{passive:!0}:void 0)}Fn&&e.dom.addEventL
Line truncated
|
||||
|
||||
`,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(l,u,d,f)=>{var _;l.isBlock&&u>r&&(a+=o);const m=s==null?void 0:s[l.type.name];if(m)return d&&(a+=m({node:l,pos:u,parent:d,index:f,range:t})),!1;l.isText&&(a+=(_=l==null?void 0:l.text)==null?void 0:_.slice(Math.max(r,u)-u,i-u))}),a}function vq(e,t){const n={from:0,to:e.content.size};return WM(e,n,t)}function qM(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function Rq(e,t){const n=zt(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function cy(e,t){const n=Mm(typeof t=="string"?t:t.name,e.schema);return n==="node"?Rq(e,t):n==="mark"?GM(e,t):{}}function Nq(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Oq(e){const t=Nq(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function KM(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=t.slice(o).map(a,-1),d=t.slice(o).map(l),f=t.invert().map(u,-1),_=t.invert().map(d);r.push({oldRange:{from:f,to:_},newRange:{from:u,to:d}})})}),Oq(r)}function uy(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=sy(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var Aq=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const a=i.node(o);(a==null?void 0:a.type.name)===t?s=a:o-=1}return[s,o]};function tE(e,t){return t.nodes[e]||t.marks[e]||null}function xf(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var Iq=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var l,u;const d=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-o))}),n};function eT(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?mo(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>T_(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:_})=>{const m=f.pos,h=_.pos;e.doc.nodesBetween(m,h,(E,T)=>{if(!E.isText&&!E.marks.length)return;const S=Math.max(m,T),y=Math.min(h,T+E.nodeSize),C=y-S;s+=C,a.push(...E.marks.map(O=>({mark:O,from:S,to:y})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>T_(f.mark.attrs,n,{strict:!1})).reduce((f,_)=>f+_.to-_.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,_)=>f+_.to-_.from,0);return(l>0?l+u:l)>=s}function wq(e,t,n={}){if(!t)return ms(e,null,n)||eT(e,null,n);const r=Mm(t,e.schema);return r==="node"?ms(e,t,n):r==="mark"?eT(e,t,n):!1}var xq=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=Lm(a=>a.type.name===t)(e.selection);if(!o)return!1;const s=e.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Dq=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function XO(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function ZO(e,t){const{nodeExtensions:n}=Yu(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ze(Ce(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function km(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(km(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function QM(e){return e instanceof Te}function Mq(e,t,n){var r;const{selection:i}=t;let o=null;if(kM(i)&&(o=i.$cursor),o){const a=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(d,f,_)=>{if(u)return!1;if(d.isInline){const m=!_||_.type.allowsMarkType(n),h=!!n.isInSet(d.marks)||!d.marks.some(E=>E.type.excludes(n));u=m&&h}return!u}),u})}var Lq=(e,t={})=>({tr:n,state:r,dispatch
Line truncated
|
||||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function tK(e){return Object.prototype.toString.call(e).slice(8,-1)}function Yp(e){return tK(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function jM(e,t){const n={...e};return Yp(e)&&Yp(t)&&Object.keys(t).forEach(r=>{Yp(t[r])&&Yp(e[r])?n[r]=jM(e[r],t[r]):n[r]=t[r]}),n}var dy=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Ze(Ce(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Ze(Ce(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>jM(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Hn=class XM extends dy{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new XM(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}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function nK(e){return typeof e=="number"}var ZM=class{constructor(e){this.find=e.find,this.handler=e.handler}},rK=(e,t,n)=>{if(oy(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 iK(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:d}=new xm({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(m,h)=>{var E,T,S,y,C;if((T=(E=m.type)==null?void 0:E.spec)!=null&&T.code||!(m.isText||m.isTextblock||m.isInline))return;const O=(C=(y=(S=m.content)==null?void 0:S.size)!=null?y:m.nodeSize)!=null?C:0,N=Math.max(r,h),w=Math.min(i,h+O);if(N>=w)return;const x=m.isText?m.text||"":m.textBetween(N-h,w-h,void 0,"");rK(x,o.find,s).forEach(z=>{if(z.index===void 0)return;const P=N+z.index+1,oe=P+z[0].length,_e={from:n.tr.mapping.map(P),to:n.tr.mapping.map(oe)},le=o.handler({state:n,range:_e,match:z,commands:l,chain:u,can:d,pasteEvent:s,dropEvent:a});f.push(le)})}),f.every(m=>m!==null)}var Hp=null,oK=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function sK(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:d,from:f,to:_,rule:m,pasteEvt:h})=>{const E=d.tr,T=wm({state:d,transaction:E});if(!(!iK({editor:t,state:T,from:Math.max(f-1,0),to:_.b-1,rule:m,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(d=>new Fe({view(f){const _=h=>{var E;r=(E=f.dom.parentElement)!=null&&E.contains(h.target)?f.dom.parentElement:null,r&&(Hp=t)},m=()=>{Hp&&(Hp=null)};return window.addEventListener("dragstart",_),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",_),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(f,_)=>{if(o=r===f.dom.parentElement,a=_,!o){const m=Hp;m!=null&&m.isEditable&&setTimeout(()=>{const h=m.state.selection;h&&m.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(f,_)=>{var m;const h=(m=_.clipboardData)==null?void 0:m.getData("text/html");return s=_,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(f,_,m)=>{const h=f[0],E=h.getMeta("uiEvent")==="paste"&&!i,T=h.getMeta("uiEvent")==="drop"&&!o,S=h.getMeta("applyPasteRules"),y=!!S;if(!E&&!T&&!y)return;if(y){let{text:N}=S;typeof N=="string"?N=N:N=Vl(J.from(N),m.schema);const{from:w}=S,x=w+N.length,D=oK(N);return l({rule:d,state:m,from:w,to:{b:x},pasteEvt:D})}const C=_.doc.content.findDiffStart(m.doc.content),O=_.doc.content.findDiffEnd(m.doc.content);if(!(!nK(C)||!O||C===O.b))return l({rule:d,state:m,from:C,to:O,pasteEvt:s})}}))}var Pm=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=VM(e),this.schema=yq(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:tE
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;
|
||||
}`;function uK(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}var uL=class extends Zq{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=PM(t,this.options.autofocus);this.editorState=qs.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=uK(cK,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=HM(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[iL,eL.configure({blockSeparator:(t=(e=this.options.coreExtensionO
Line truncated
|
||||
|
||||
`,textSerializers:n={}}=e||{};return vq(this.state.doc,{blockSeparator:t,textSerializers:{...qM(this.schema),...n}})}get isEmpty(){return km(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new lK(t,this)}get $doc(){return this.$pos(0)}};function co(e){return new fd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ze(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),d=u+s.length;if(uy(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(E=>E===e.type&&E!==m.mark.type)).filter(m=>m.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+l,u);const _=n.from+l+s.length;o.addMark(n.from+l,_,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function py(e){return new fd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ze(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 d=s+u;d>a?d=a:a=d+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(d,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()},undoable:e.undoable})}function tT(e){return new fd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ze(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)},undoable:e.undoable})}function Lt(e){return new fd({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)},undoable:e.undoable})}function Ml(e){return new fd({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Ze(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&Pb(l,e.type,o);if(!u)return null;if(s.wrap(l,u),e.keepMarks&&e.editor){const{selection:f,storedMarks:_}=t,{splittableMarks:m}=e.editor.extensionManager,h=_||f.$to.parentOffset&&f.$from.marks();if(h){const E=h.filter(T=>m.includes(T.type.name));s.ensureMarks(E)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&ys(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)},undoable:e.undoable})}var dK=e=>"touches"in e,pK=class{constructor(e){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=s=>{if(!this.isResizing||!this.activeHandle)return;const a=s.clientX-this.startX,l=s.clientY-this.startY;this.handleResize(a,l)},this.handleTouchMove=s=>{if(!this.isResizing||!this.activeHandle)return;const a=s.touches[0];if(!a)return;const l=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(l,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const s=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(s,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=s=>{s.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=s=>{s.key==="Shift"&&(this.isShiftKeyPressed=!1)};var t,n,r,i,o;this.node=e.node,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(t=e.options)!=null&&t.min&&(this.minSize={...this.minSize,...e.options.min}),(n=e.options)!=null&&n.max&&(this.maxSize=e.options.max),(r=e==null?void 0:e.options)!=null&&r.directions&&(this.directions=e.options.directions),(i=e.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(o=e.options)!=null&&o.className&&(this.classNames={container:e
Line truncated
|
||||
|
||||
`);return`:::${u}${E}
|
||||
|
||||
${T}
|
||||
|
||||
:::`}}}function EK(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function SK(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function dL(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=EK,serializeAttributes:o=SK,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,u=n||t,d=_=>{if(!l)return _;const m={};return l.forEach(h=>{h in _&&(m[h]=_[h])}),m},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(_,m)=>{const h={...s,..._.attributes};if(a)return m.createNode(t,h);const E=r?r(_):_.content||"";return E?m.createNode(t,h,[m.createTextNode(E)]):m.createNode(t,h,[])},markdownTokenizer:{name:t,level:"inline",start(_){const m=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),h=_.match(m),E=h==null?void 0:h.index;return E!==void 0?E:-1},tokenize(_,m,h){const E=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),T=_.match(E);if(!T)return;let S="",y="";if(a){const[,O]=T;y=O}else{const[,O,N]=T;y=O,S=N||""}const C=i(y.trim());return{type:t,raw:T[0],content:S.trim(),attributes:C}}},renderMarkdown:_=>{let m="";r?m=r(_):_.content&&_.content.length>0&&(m=_.content.filter(S=>S.type==="text").map(S=>S.text).join(""));const h=d(_.attrs||{}),E=o(h),T=E?` ${E}`:"";return a?`[${u}${T}]`:`[${u}${T}]${m}[/${u}]`}}}function nT(e,t,n){var r,i,o,s;const a=e.split(`
|
||||
`),l=[];let u="",d=0;const f=t.baseIndentSize||2;for(;d<a.length;){const _=a[d],m=_.match(t.itemPattern);if(!m){if(l.length>0)break;if(_.trim()===""){d+=1;continue}else return}const h=t.extractItemData(m),{indentLevel:E,mainContent:T}=h;u=`${u}${_}
|
||||
`;const S=[T];for(d+=1;d<a.length;){const N=a[d];if(N.trim()===""){const x=a.slice(d+1).findIndex(P=>P.trim()!=="");if(x===-1)break;if((((i=(r=a[d+1+x].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>E){S.push(N),u=`${u}${N}
|
||||
`,d+=1;continue}else break}if((((s=(o=N.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>E)S.push(N),u=`${u}${N}
|
||||
`,d+=1;else break}let y;const C=S.slice(1);if(C.length>0){const N=C.map(w=>w.slice(E+f)).join(`
|
||||
`);N.trim()&&(t.customNestedParser?y=t.customNestedParser(N):y=n.blockTokens(N))}const O=t.createToken(h,y);l.push(O)}if(l.length!==0)return{items:l,raw:u.trim()}}function my(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=[`${i}${a}`];return s&&s.length>0&&s.forEach(u=>{const d=t.renderChildren([u]);if(d){const f=d.split(`
|
||||
`).map(_=>_?t.indent(_):"").join(`
|
||||
`);l.push(f)}}),l.join(`
|
||||
`)}function TK(e,t,n={}){const{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((a,l)=>{const u=o.mapping.map(l),d=o.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(m=>{if(m!==s)return!1;f=m}),!f)return;let _=!1;if(Object.keys(n).forEach(m=>{n[m]!==f.attrs[m]&&(_=!0)}),_){const m=e.type.create({...e.attrs,...n});o.removeMark(u,d,e.type),o.addMark(u,d,m)}}),o.docChanged&&t.view.dispatch(o)}var st=class pL extends dy{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new pL(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},bK=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,d=u.nodeType===3?(t=u.parentElement)==null?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(u)||!d)return;let f=0,_=0;if(this.dom!==d){const y=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),O=(i=e.offsetX)!=null?i:(r=e.nativeEvent)==null?void 0:r.offsetX,N=(s=e.offsetY)!=null?s:(o=e.nativeEvent)==null?void 0:o.offsetY;f=C.x-y.x+O,_=C.y-y.y+N}const m=this.dom.cloneNode(!0);try{const y=this.dom.getBoundingClientRect();m.style.width=`${Math.round(y.width)}px`,m.style.height=`${Math.round(y.height)}px`,m.style.boxSizing="border-box",m.style.pointerEvents="none"}catch{}let h=null;try{h=document.createElement("div"),h.style.position="absolute",h.style.top="-9999px",h.style.left="-9999px",h.style.pointerEvents="none",h.appendChild(m),document.body.appendChild(h),(a=e.dataTransfer)==null||a.setDragImage(m,f,_)}finally{h&&setTimeout(()=>{try{h==null||h.remove()}catch{}},0)}const E=this.getPos();if(typeof E!="number")return;const T=Te.create(l.state.doc,E),S=l.state.tr.setSelection(T);l.dispatch(S)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const i=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,u=!!this.node.type.spec.draggable,d=Te.isSelectable(this.node),f=e.type==="copy",_=e.type==="paste",m=e.type==="cut",h=e.type==="mousedown";if(!u&&d&&i&&e.target===this.dom&&e.preventDefault(),u&&i&&!l&&e.target===this.dom)return e.preventDefault(),!1;if(u&&a&&!l&&h){const E=n.closest("[data-drag-handle]");E&&(this.dom===E||this.dom.contains(E))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(l||o||f||_||m||h&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Dm()||BM())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function uo(e){return new ZM({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Ze(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),f=n.from+l.indexOf(a),_=f+a.length;if(uy(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(T=>T===e.type&&T!==h.mark.type)).filter(h=>h.to>f).length)return null;_<n.to&&s.delete(_,n.to),f>n.from&&s.delete(n.from+d,f),u=n.from+d+a.length,s.addMark(n.from+d,u,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}function yK(e){return new ZM({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){const o=Ze(e.getAttributes,void 0,t,i),s=Ze(e.getContent,void 0,o);if(o===!1||o===null)return null;const a={type:e.type.name,attrs:o};s&&(a.content=s),t.input&&n().deleteRange(r).insertContentAt(r.from,a)}})}var CK=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n
Line truncated
|
||||
* @license React
|
||||
* use-sync-external-store-shim/with-selector.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Bm=L,RK=Mb;function NK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var OK=typeof Object.is=="function"?Object.is:NK,AK=RK.useSyncExternalStore,IK=Bm.useRef,wK=Bm.useEffect,xK=Bm.useMemo,DK=Bm.useDebugValue;_L.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=IK(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=xK(function(){function l(m){if(!u){if(u=!0,d=m,m=r(m),i!==void 0&&s.hasValue){var h=s.value;if(i(h,m))return f=h}return f=m}if(h=f,OK(d,m))return h;var E=r(m);return i!==void 0&&i(h,E)?(d=m,h):(d=m,f=E)}var u=!1,d,f,_=n===void 0?null:n;return[function(){return l(t())},_===null?void 0:function(){return l(_())}]},[t,n,r,i]);var a=AK(e,o[0],o[1]);return wK(function(){s.hasValue=!0,s.value=a},[a]),DK(a),a};fL.exports=_L;var MK=fL.exports,LK=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},kK=({contentComponent:e})=>{const t=Mb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return v.jsx(v.Fragment,{children:Object.values(t)})};function PK(){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]:f2.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var BK=class extends rr.Component{constructor(e){var t;super(e),this.editorContentRef=rr.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(e.view.dom),e.setOptions({element:t}),e.contentComponent=PK(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.firstChild))return;const n=document.createElement("div");n.append(t.view.dom),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:LK(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&v.jsx(kK,{contentComponent:e.contentComponent})]})}},FK=L.forwardRef((e,t)=>{const n=rr.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return rr.createElement(BK,{key:n,innerRef:t,...e})}),UK=rr.memo(FK),GK=typeof window<"u"?L.useLayoutEffect:L.useEffect,$K=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function YK(e){var t;const[n]=L.useState(()=>new $K(e.editor)),r=MK.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:vK);return GK(()=>n.watch(e.editor),[e.editor,n]),L.useDebugValue(r),r}var HK=!1,rT=typeof window>"u",zK=rT||!!(typeof window<"u"&&window.next),VK=class mL{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(){return this.options.current.immediatelyRender===voiLine 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
|
||||
*/b_.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,d="__lodash_placeholder__",f=1,_=2,m=4,h=1,E=2,T=1,S=2,y=4,C=8,O=16,N=32,w=64,x=128,D=256,z=512,P=30,oe="...",_e=800,le=16,se=1,q=2,$=3,F=1/0,k=9007199254740991,U=17976931348623157e292,V=NaN,W=4294967295,ee=W-1,he=W>>>1,ye=[["ary",x],["bind",T],["bindKey",S],["curry",C],["curryRight",O],["flip",z],["partial",N],["partialRight",w],["rearg",D]],pe="[object Arguments]",Ge="[object Array]",at="[object AsyncFunction]",Et="[object Boolean]",ke="[object Date]",Xt="[object DOMException]",Ot="[object Error]",zn="[object Function]",ve="[object GeneratorFunction]",bt="[object Map]",yt="[object Number]",Zt="[object Null]",Vt="[object Object]",Re="[object Promise]",fe="[object Proxy]",Xe="[object RegExp]",Ee="[object Set]",Ye="[object String]",Jt="[object Symbol]",Vn="[object Undefined]",Wn="[object WeakMap]",ae="[object WeakSet]",Q="[object ArrayBuffer]",te="[object DataView]",de="[object Float32Array]",Ne="[object Float64Array]",Je="[object Int8Array]",En="[object Int16Array]",So="[object Int32Array]",ya="[object Uint8Array]",yd="[object Uint8ClampedArray]",Cd="[object Uint16Array]",vd="[object Uint32Array]",Ky=/\b__p \+= '';/g,Qy=/\b(__p \+=) '' \+/g,jy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wm=/&(?:amp|lt|gt|quot|#39);/g,qm=/[&<>"']/g,Xy=RegExp(Wm.source),Zy=RegExp(qm.source),Jy=/<%-([\s\S]+?)%>/g,eC=/<%([\s\S]+?)%>/g,Km=/<%=([\s\S]+?)%>/g,tC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nC=/^\w*$/,rC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rd=/[\\^$.*+?()[\]{}|]/g,iC=RegExp(Rd.source),Nd=/^\s+/,oC=/\s/,sC=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,aC=/\{\n\/\* \[wrapped with (.+)\] \*/,lC=/,? & /,cC=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,uC=/[()=,{}\[\]\/\s]/,dC=/\\(\\)?/g,pC=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qm=/\w*$/,fC=/^[-+]0x[0-9a-f]+$/i,_C=/^0b[01]+$/i,mC=/^\[object .+?Constructor\]$/,gC=/^0o[0-7]+$/i,hC=/^(?:0|[1-9]\d*)$/,EC=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jl=/($^)/,SC=/['\n\r\u2028\u2029\\]/g,Xl="\\ud800-\\udfff",TC="\\u0300-\\u036f",bC="\\ufe20-\\ufe2f",yC="\\u20d0-\\u20ff",jm=TC+bC+yC,Xm="\\u2700-\\u27bf",Zm="a-z\\xdf-\\xf6\\xf8-\\xff",CC="\\xac\\xb1\\xd7\\xf7",vC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",RC="\\u2000-\\u206f",NC=" \\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",Jm="A-Z\\xc0-\\xd6\\xd8-\\xde",eg="\\ufe0e\\ufe0f",tg=CC+vC+RC+NC,Od="['’]",OC="["+Xl+"]",ng="["+tg+"]",Zl="["+jm+"]",rg="\\d+",AC="["+Xm+"]",ig="["+Zm+"]",og="[^"+Xl+tg+rg+Xm+Zm+Jm+"]",Jl="\\ud83c[\\udffb-\\udfff]",sg="(?:"+Zl+"|"+Jl+")",Ad="[^"+Xl+"]",ec="(?:\\ud83c[\\udde6-\\uddff]){2}",tc="[\\ud800-\\udbff][\\udc00-\\udfff]",To="["+Jm+"]",Id="\\u200d",nc="(?:"+ig+"|"+og+")",wd="(?:"+To+"|"+og+")",rc="(?:"+Od+"(?:d|ll|m|re|s|t|ve))?",xd="(?:"+Od+"(?:D|LL|M|RE|S|T|VE))?",Dd=sg+"?",ic="["+eg+"]?",Ca="(?:"+Id+"(?:"+[Ad,ec,tc].join("|")+")"+ic+Dd+")*",oc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Md="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sc=ic+Dd+Ca,Ld="(?:"+[AC,ec,tc].join("|")+")"+sc,IC="(?:"+[Ad+Zl+"?",Zl,ec,tc,OC].join("|")+")",wC=RegExp(Od,"g"),jP=RegExp(Zl,"g"),ag=RegExp(Jl+"(?="+Jl+")|"+IC+sc,"g"),XP=RegExp([To+"?"+ig+"+"+rc+"(?="+[ng,To,"$"].join("|")+")",wd+"+"+xd+"(?="+[ng,To+nc,"$"].join("|")+")",To+"?"+nc+"+"+rc,To+"+"+xd,Md,oc,rg,Ld].join("|"),"g"),ZP=RegExp("["+Id+Xl+jm+eg+"]"),JP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,e0=["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"],t0=-1,_t={};_t[de]=_t[Ne]=_t[Je]=_t[En]=_t[So]=_t[ya]=_t[yd]=_t[Cd]=_t[vd]=!0,_t[pe]=_t[Ge]=_t[Q]=_t[Et]=_t[te]=_t[ke]=_t[Ot]=_t[zn]=_t[bt]=_t[yt]=_t[Vt]=_t[Xe]=_t[Ee]=_t[Ye]=_t[Wn]=!1;var ut={};ut[pe]=ut[Ge]=ut[Q]=ut[te]=ut[Et]=ut[ke]=ut[de]=ut[Ne]=ut[Je]=ut[En]=ut[So]=ut[bt]=ut[yt]=ut[Vt]=ut[Xe]=ut[Ee]=ut[Ye]=ut[Jt]=ut[ya]=ut[yd]=ut[Cd]=ut[vd]=!0,ut[Ot]=ut[zn]=ut[Wn]=!1;var n0={À:"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 `+p+`] */
|
||||
`)}function EB(c){return Me(c)||Ms(c)||!!(JC&&c&&c[JC])}function ki(c,p){var g=typeof c;return p=p??k,!!p&&(g=="number"||g!="symbol"&&hC.test(c))&&c>-1&&c%1==0&&c<p}function xn(c,p,g){if(!Ct(g))return!1;var b=typeof p;return(b=="number"?Kn(g)&&ki(p,g.length):b=="string"&&p in g)?Qr(g[p],c):!1}function Kg(c,p){if(Me(c))return!1;var g=typeof c;return g=="number"||g=="symbol"||g=="boolean"||c==null||fr(c)?!0:nC.test(c)||!tC.test(c)||p!=null&&c in lt(p)}function SB(c){var p=typeof c;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?c!=="__proto__":c===null}function Qg(c){var p=cp(c),g=A[p];if(typeof g!="function"||!(p in Ve.prototype))return!1;if(c===g)return!0;var b=Vg(g);return!!b&&c===b[0]}function TB(c){return!!QC&&QC in c}var bB=Ud?Pi:ph;function Sc(c){var p=c&&c.constructor,g=typeof p=="function"&&p.prototype||Aa;return c===g}function Qv(c){return c===c&&!Ct(c)}function jv(c,p){return function(g){return g==null?!1:g[c]===p&&(p!==n||c in lt(g))}}function yB(c){var p=mp(c,function(b){return g.size===u&&g.clear(),b}),g=p.cache;return p}function CB(c,p){var g=c[1],b=p[1],R=g|b,I=R<(T|S|x),M=b==x&&g==C||b==x&&g==D&&c[7].length<=p[8]||b==(x|D)&&p[7].length<=p[8]&&g==C;if(!(I||M))return c;b&T&&(c[2]=p[2],R|=g&T?0:y);var B=p[3];if(B){var H=c[3];c[3]=H?Dv(H,B,p[4]):B,c[4]=H?Co(c[3],d):p[4]}return B=p[5],B&&(H=c[5],c[5]=H?Mv(H,B,p[6]):B,c[6]=H?Co(c[5],d):p[6]),B=p[7],B&&(c[7]=B),b&x&&(c[8]=c[8]==null?p[8]:Sn(c[8],p[8])),c[9]==null&&(c[9]=p[9]),c[0]=p[0],c[1]=R,c}function vB(c){var p=[];if(c!=null)for(var g in lt(c))p.push(g);return p}function RB(c){return $d.call(c)}function Xv(c,p,g){return p=qt(p===n?c.length-1:p,0),function(){for(var b=arguments,R=-1,I=qt(b.length-p,0),M=K(I);++R<I;)M[R]=b[p+R];R=-1;for(var B=K(p+1);++R<p;)B[R]=b[R];return B[p]=g(M),ur(c,this,B)}}function Zv(c,p){return p.length<2?c:ws(c,wr(p,0,-1))}function NB(c,p){for(var g=c.length,b=Sn(p.length,g),R=qn(c);b--;){var I=p[b];c[b]=ki(I,g)?R[I]:n}return c}function jg(c,p){if(!(p==="constructor"&&typeof c[p]=="function")&&p!="__proto__")return c[p]}var Jv=tR(yv),Tc=$0||function(c,p){return cn.setTimeout(c,p)},Xg=tR(Q1);function eR(c,p,g){var b=p+"";return Xg(c,hB(b,OB(_B(b),g)))}function tR(c){var p=0,g=0;return function(){var b=V0(),R=le-(b-g);if(g=b,R>0){if(++p>=_e)return arguments[0]}else p=0;return c.apply(n,arguments)}}function dp(c,p){var g=-1,b=c.length,R=b-1;for(p=p===n?b:p;++g<p;){var I=Mg(g,R),M=c[I];c[I]=c[g],c[g]=M}return c.length=p,c}var nR=yB(function(c){var p=[];return c.charCodeAt(0)===46&&p.push(""),c.replace(rC,function(g,b,R,I){p.push(R?I.replace(dC,"$1"):b||g)}),p});function pi(c){if(typeof c=="string"||fr(c))return c;var p=c+"";return p=="0"&&1/c==-F?"-0":p}function Ds(c){if(c!=null){try{return Gd.call(c)}catch{}try{return c+""}catch{}}return""}function OB(c,p){return Nr(ye,function(g){var b="_."+g[0];p&g[1]&&!kd(c,b)&&c.push(b)}),c.sort()}function rR(c){if(c instanceof Ve)return c.clone();var p=new Ar(c.__wrapped__,c.__chain__);return p.__actions__=qn(c.__actions__),p.__index__=c.__index__,p.__values__=c.__values__,p}function AB(c,p,g){(g?xn(c,p,g):p===n)?p=1:p=qt(Le(p),0);var b=c==null?0:c.length;if(!b||p<1)return[];for(var R=0,I=0,M=K(qd(b/p));R<b;)M[I++]=wr(c,R,R+=p);return M}function IB(c){for(var p=-1,g=c==null?0:c.length,b=0,R=[];++p<g;){var I=c[p];I&&(R[b++]=I)}return R}function wB(){var c=arguments.length;if(!c)return[];for(var p=K(c-1),g=arguments[0],b=c;b--;)p[b-1]=arguments[b];return yo(Me(g)?qn(g):[g],un(p,1))}var xB=Ue(function(c,p){return kt(c)?_c(c,un(p,1,kt,!0)):[]}),DB=Ue(function(c,p){var g=xr(p);return kt(g)&&(g=n),kt(c)?_c(c,un(p,1,kt,!0),Oe(g,2)):[]}),MB=Ue(function(c,p){var g=xr(p);return kt(g)&&(g=n),kt(c)?_c(c,un(p,1,kt,!0),n,g):[]});function LB(c,p,g){var b=c==null?0:c.length;return b?(p=g||p===n?1:Le(p),wr(c,p<0?0:p,b)):[]}function kB(c,p,g){var b=c==null?0:c.length;return b?(p=g||p===n?1:Le(p),p=b-p,wr(c,0,p<0?0:p)):[]}function PB(c,p){return c&&c.length?rp(c,Oe(p,3),!0,!0):[]}function BB(c,p){return c&&c.length?rp(c,Oe(p,3),!0):[]}function FB(c,p,g,b){var R=c==null?0:c.length;return R?(g&&typeof g!="number"&&xn(c,p,g)&&(g=0,b=R),w1(c,p,g,b)):[]}function iR(c,p,g){var b=c==null?0:c.length;if(!b)return-1;var R=g==null?0:Le(g);return R<0&&(R=qt(b+R,0)),Pd(c,Oe(p,3),R)}function oR(c,p,g){var b=c==null?0:c.length;if(!b)return-1;var R=b-1;return g!==n&&(R=Le(g),R=g<0?qt(b+R,0):Sn(R,b-1)),Pd(c,Oe(p,3),R,!0)}function sR(c){var p=c==null?0:c.length;return p?un(c,1):[]}function UB(c){var p=c==null?0:c.length;return p?un(c,F):[]}function GB(c,p){var g=c==null?0:c.length;return g?(p=p===n?1:Le(p),un(c,p)):[]}function $B(c){for(var p=-1,g=c==null?0:c.length,b={};++p<g;){var R=c[p];b[R[0]]=R[1]}return b}function aR(c){return c&&c.length?c[0]:n}function YB(c,p,g){var b=c==null?0:c.length;if(!b)return-1;var R=g==null?0:Le(g);return R<0&&(R=qt(b+R,0)),va(c,p,R)}function HB(c){var p=c==null?0:c.length;return p?wr(c,0,-1):[]}var zB=Ue(function(c){var p=St(c,Fg);return p.length&&p[0]===c[0]?Ag(p):[]}),VB=Ue(
Line truncated
|
||||
`;c.replace(ue,function(we,He,We,_r,Dn,mr){return We||(We=_r),ne+=c.slice(X,mr).replace(SC,b0),He&&(B=!0,ne+=`' +
|
||||
__e(`+He+`) +
|
||||
'`),Dn&&(H=!0,ne+=`';
|
||||
`+Dn+`;
|
||||
__p += '`),We&&(ne+=`' +
|
||||
((__t = (`+We+`)) == null ? '' : __t) +
|
||||
'`),X=mr+we.length,we}),ne+=`';
|
||||
`;var Ie=nt.call(p,"variable")&&p.variable;if(!Ie)ne=`with (obj) {
|
||||
`+ne+`
|
||||
}
|
||||
`;else if(uC.test(Ie))throw new De(a);ne=(H?ne.replace(Ky,""):ne).replace(Qy,"$1").replace(jy,"$1;"),ne="function("+(Ie||"obj")+`) {
|
||||
`+(Ie?"":`obj || (obj = {});
|
||||
`)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(H?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+ne+`return __p
|
||||
}`;var Pe=kR(function(){return et(I,Se+"return "+ne).apply(n,M)});if(Pe.source=ne,nh(Pe))throw Pe;return Pe}function qG(c){return tt(c).toLowerCase()}function KG(c){return tt(c).toUpperCase()}function QG(c,p,g){if(c=tt(c),c&&(g||p===n))return zC(c);if(!c||!(p=pr(p)))return c;var b=qr(c),R=qr(p),I=VC(b,R),M=WC(b,R)+1;return Ao(b,I,M).join("")}function jG(c,p,g){if(c=tt(c),c&&(g||p===n))return c.slice(0,KC(c)+1);if(!c||!(p=pr(p)))return c;var b=qr(c),R=WC(b,qr(p))+1;return Ao(b,0,R).join("")}function XG(c,p,g){if(c=tt(c),c&&(g||p===n))return c.replace(Nd,"");if(!c||!(p=pr(p)))return c;var b=qr(c),R=VC(b,qr(p));return Ao(b,R).join("")}function ZG(c,p){var g=P,b=oe;if(Ct(p)){var R="separator"in p?p.separator:R;g="length"in p?Le(p.length):g,b="omission"in p?pr(p.omission):b}c=tt(c);var I=c.length;if(Ra(c)){var M=qr(c);I=M.length}if(g>=I)return c;var B=g-Na(b);if(B<1)return b;var H=M?Ao(M,0,B).join(""):c.slice(0,B);if(R===n)return H+b;if(M&&(B+=H.length-B),rh(R)){if(c.slice(B).search(R)){var X,Z=H;for(R.global||(R=Sg(R.source,tt(Qm.exec(R))+"g")),R.lastIndex=0;X=R.exec(Z);)var ne=X.index;H=H.slice(0,ne===n?B:ne)}}else if(c.indexOf(pr(R),B)!=B){var ue=H.lastIndexOf(R);ue>-1&&(H=H.slice(0,ue))}return H+b}function JG(c){return c=tt(c),c&&Xy.test(c)?c.replace(Wm,A0):c}var e$=Ma(function(c,p,g){return c+(g?" ":"")+p.toUpperCase()}),sh=Pv("toUpperCase");function LR(c,p,g){return c=tt(c),p=g?n:p,p===n?C0(c)?x0(c):_0(c):c.match(p)||[]}var kR=Ue(function(c,p){try{return ur(c,n,p)}catch(g){return nh(g)?g:new De(g)}}),t$=Li(function(c,p){return Nr(p,function(g){g=pi(g),Di(c,g,eh(c[g],c))}),c});function n$(c){var p=c==null?0:c.length,g=Oe();return c=p?St(c,function(b){if(typeof b[1]!="function")throw new Or(s);return[g(b[0]),b[1]]}):[],Ue(function(b){for(var R=-1;++R<p;){var I=c[R];if(ur(I[0],this,b))return ur(I[1],this,b)}})}function r$(c){return A1(Ir(c,f))}function ah(c){return function(){return c}}function i$(c,p){return c==null||c!==c?p:c}var o$=Fv(),s$=Fv(!0);function jn(c){return c}function lh(c){return _v(typeof c=="function"?c:Ir(c,f))}function a$(c){return gv(Ir(c,f))}function l$(c,p){return hv(c,Ir(p,f))}var c$=Ue(function(c,p){return function(g){return mc(g,c,p)}}),u$=Ue(function(c,p){return function(g){return mc(c,g,p)}});function ch(c,p,g){var b=en(p),R=ep(p,b);g==null&&!(Ct(p)&&(R.length||!b.length))&&(g=p,p=c,c=this,R=ep(p,en(p)));var I=!(Ct(g)&&"chain"in g)||!!g.chain,M=Pi(c);return Nr(R,function(B){var H=p[B];c[B]=H,M&&(c.prototype[B]=function(){var X=this.__chain__;if(I||X){var Z=c(this.__wrapped__),ne=Z.__actions__=qn(this.__actions__);return ne.push({func:H,args:arguments,thisArg:c}),Z.__chain__=X,Z}return H.apply(c,yo([this.value()],arguments))})}),c}function d$(){return cn._===this&&(cn._=B0),this}function uh(){}function p$(c){return c=Le(c),Ue(function(p){return Ev(p,c)})}var f$=$g(St),_$=$g(UC),m$=$g(pg);function PR(c){return Kg(c)?fg(pi(c)):V1(c)}function g$(c){return function(p){return c==null?n:ws(c,p)}}var h$=Gv(),E$=Gv(!0);function dh(){return[]}function ph(){return!1}function S$(){return{}}function T$(){return""}function b$(){return!0}function y$(c,p){if(c=Le(c),c<1||c>k)return[];var g=W,b=Sn(c,W);p=Oe(p),c-=W;for(var R=gg(b,p);++g<c;)p(g);return R}function C$(c){return Me(c)?St(c,pi):fr(c)?[c]:qn(nR(tt(c)))}function v$(c){var p=++k0;return tt(c)+p}var R$=sp(function(c,p){return c+p},0),N$=Yg("ceil"),O$=sp(function(c,p){return c/p},1),A$=Yg("floor");function I$(c){return c&&c.length?Jd(c,jn,Og):n}function w$(c,p){return c&&c.length?Jd(c,Oe(p,2),Og):n}function x$(c){return YC(c,jn)}function D$(c,p){return YC(c,Oe(p,2))}function M$(c){return c&&c.length?Jd(c,jn,xg):n}function L$(c,p){return c&&c.length?Jd(c,Oe(p,2),xg):n}var k$=sp(function(c,p){return c*p},1),P$=Yg("round"),B$=sp(function(c,p){return c-p},0);function F$(c){return c&&c.length?mg(c,jn):0}function U$(c,p){return c&&c.length?mg(c,Oe(p,2)):0}return A.after=aU,A.ary=fR,A.assign=KU,A.assignIn=OR,A.assignInWith=Sp,A.assignWith=QU,A.at=jU,A.before=_R,A.bind=eh,A.bindAll=t$,A.bindKey=mR,A.castArray=SU,A.chain=uR,A.chunk=AB,A.compact=IB,A.concat=wB,A.cond=n$,A.conforms=r$,A.constant=ah,A.countBy=FF,A.create=XU,A.curry=gR,A.curryRight=hR,A.debounce=ER,A.defaults=ZU,A.defaultsDeep=JU,A.defer=lU,A.delay=cU,A.difference=xB,A.differenceBy=DB,A.differenceWith=MB,A.drop=LB,A.dropRight=kB,A.dropRightWhile=PB,A.dropWhile=BB,A.fill=FB,A.filter=GF,A.flatMap=HF,A.flatMapDeep=zF,A.flatMapDepth=VF,A.flatten=sR,A.flattenDeep=UB,A.flattenDepth=GB,A.flip=uU,A.flow=o$,A.flowRight=s$,A.fromPairs=$B,A.functions=sG,A.functionsIn=aG,A.groupBy=WF,A.initial=HB,A.intersection=zB,A.intersectionBy=VB,A.intersectionWith=WB,A.invert=cG,A.invertBy=uG,A.invokeMap=KF,A.iteratee=lh,A.keyBy=QF,A.keys=en,A.keysIn=Qn,A.map=fp,A.mapKeys=pG,A.mapValues=fG,A.matches=a$,A.matchesProperty=l$,A.memoize=mp,A.merge=_G,A.mergeWith=AR,A.method=c$,A.methodOf=u$,A.mixin=ch,A.negate=gp,A.nthArg=p$,A.omit=mG,A.omitBy=gG,A.once=dU,A.orderBy=jF,A.over=f$,A.overArgs=pU,A.overEvery=_$,A.overS
Line truncated
|
||||
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(l3,this.editor.getAttributes(aA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ml({find:lA,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ml({find:lA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(aA),editor:this.editor})),[e]}}),NL=st.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",qe(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))n=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const s=e.tokens.slice(1),a=t.parseChildren(s);n.push(...a)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>my(e,t,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),c3={};a3(c3,{findListItemPos:()=>md,getNextListDepth:()=>hy,handleBackspace:()=>cT,handleDelete:()=>uT,hasListBefore:()=>OL,hasListItemAfter:()=>u3,hasListItemBefore:()=>AL,listItemHasSubList:()=>IL,nextListIsDeeper:()=>wL,nextListIsHigher:()=>xL});var md=(e,t)=>{const{$from:n}=t.selection,r=zt(e,t.schema);let i=null,o=n.depth,s=n.pos,a=null;for(;o>0&&a===null;)i=n.node(o),i.type===r?a=o:(o-=1,s-=1);return a===null?null:{$pos:t.doc.resolve(s),depth:a}},hy=(e,t)=>{const n=md(e,t);if(!n)return!1;const[,r]=Aq(t,e,n.$pos.pos+4);return r},OL=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},AL=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},IL=(e,t,n)=>{if(!n)return!1;const r=zt(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},cT=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!ms(e.state,t)&&OL(e.state,t,n)){const{$anchor:a}=e.state.selection,l=e.state.doc.resolve(a.before()-1),u=[];l.node().descendants((_,m)=>{_.type.name===t&&u.push({node:_,pos:m})});const d=u.at(-1);if(!d)return!1;const f=e.state.doc.resolve(l.start()+d.pos+1);return e.chain().cut({from:a.start()-1,to:a.end()+1},f.end()).joinForward().run()}if(!ms(e.state,t)||!Dq(e.state))return!1;const r=md(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=IL(t,e.state,o);return AL(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},wL=(e,t)=>{const n=hy(e,t),r=md(e,t);return!r||!n?!1:n>r.depth},xL=(e,t)=>{const n=hy(e,t),r=md(e,t);return!r||!n?!1:n<r.depth},uT=(e,t)=>{if(!ms(e.state,t)||!xq(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:wL(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():xL(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},u3=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},d3=je.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&uT(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&uT(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&cT(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&cT(e,n,r)&&(t=!0)}),t}}}}),cA=/^(\s*)(\d+)\.\s+(.*)$/,p3=/^\s/;function f3(e){const t=[];let n=0,r
Line truncated
|
||||
`,f+=1;else if(m.match(p3))_.push(m),d+=`
|
||||
${m.slice(u+2)}`,f+=1;else break}t.push({indent:u,number:parseInt(a,10),content:d.trim(),raw:_.join(`
|
||||
`)}),r=f,n=f}return[t,r]}function DL(e,t,n){var r;const i=[];let o=0;for(;o<e.length;){const s=e[o];if(s.indent===t){const a=s.content.split(`
|
||||
`),l=((r=a[0])==null?void 0:r.trim())||"",u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join(`
|
||||
`).trim();if(d){const m=n.blockTokens(d);u.push(...m)}let f=o+1;const _=[];for(;f<e.length&&e[f].indent>t;)_.push(e[f]),f+=1;if(_.length>0){const m=Math.min(..._.map(E=>E.indent)),h=DL(_,m,n);u.push({type:"list",ordered:!0,start:_[0].number,items:h,raw:_.map(E=>E.raw).join(`
|
||||
`)})}i.push({type:"list_item",raw:s.raw,tokens:u}),o=f}else o+=1}return i}function _3(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=t.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=t.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var m3="listItem",uA="textStyle",dA=/^(\d+)\.\s$/,Ai=st.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",qe(this.options.HTMLAttributes,n),0]:["ol",qe(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?_3(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||||
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
|
||||
`),[o,s]=f3(i);if(o.length===0)return;const a=DL(o,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,s).join(`
|
||||
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(m3,this.editor.getAttributes(uA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Ml({find:dA,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ml({find:dA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(uA)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),g3=/^\s*(\[([( |x])?\])\s$/,h3=st.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",qe(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return my(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=d=>{var f,_;a.ariaLabel=((_=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:_.call(f,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return u(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:_})=>{const m=n();if(typeof m!="number")return!1;const h=_.doc.nodeAt(m);return _.setNodeMarkup(m,void 0,{...h==null?void 0:h.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(t).forEach(([d,f])=>{i.setAttribute(d,f)}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,u(d),!0)}}},addInputRules(){return[Ml({find:g3,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),E3=st.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",qe(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||||
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const s=nT(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},i=nT(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});je.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(po.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(NL.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(d3.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ai.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(h3.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(E3.configure(this.options.taskList)),e}});var aE=4,S3=/^```([a-z]+)?[\s\n]$/,T3=/^~~~([a-z]+)?[\s\n]$/,b3=st.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:aE,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",qe(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
|
||||
`):r=`\`\`\`${i}
|
||||
|
||||
\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:aE,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:l})=>{const{from:u,to:d}=i,m=r.doc.textBetween(u,d,`
|
||||
`,`
|
||||
`).split(`
|
||||
`).map(h=>a+h).join(`
|
||||
`);return l.replaceWith(u,d,r.schema.text(m)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:aE,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?e.commands.command(({tr:a})=>{var l;const{pos:u}=o,d=o.start(),f=o.end(),m=r.doc.textBetween(d,f,`
|
||||
`,`
|
||||
`).split(`
|
||||
`);let h=0,E=0;const T=u-d;for(let w=0;w<m.length;w+=1){if(E+m[w].length>=T){h=w;break}E+=m[w].length+1}const y=((l=m[h].match(/^ */))==null?void 0:l[0])||"",C=Math.min(y.length,n);if(C===0)return!0;let O=d;for(let w=0;w<h;w+=1)O+=m[w].length+1;return a.delete(O,O+C),u-O<=C&&a.setSelection(be.create(a.doc,O)),!0}):e.commands.command(({tr:a})=>{const{from:l,to:u}=i,_=r.doc.textBetween(l,u,`
|
||||
`,`
|
||||
`).split(`
|
||||
`).map(m=>{var h;const E=((h=m.match(/^ */))==null?void 0:h[0])||"",T=Math.min(E.length,n);return m.slice(T)}).join(`
|
||||
`);return a.replaceWith(l,u,r.schema.text(_)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
||||
|
||||
`);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(Ae.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[tT({find:S3,type:this.type,getAttributes:e=>({language:e[1]})}),tT({find:T3,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Fe({key:new $e("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(be.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),y3=b3;function ML(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)&&ML(n)}),e}let pA=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function LL(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function jo(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 C3="</span>",fA=e=>!!e.scope,v3=(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 R3=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=LL(t)}openNode(t){if(!fA(t))return;const n=v3(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){fA(t)&&(this.buffer+=C3)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}};const _A=(e={})=>{const t={children:[]};return Object.assign(t,e),t};let N3=class kL{constructor(){this.rootNode=_A(),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=_A({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=>{kL._collapse(n)}))}},O3=class extends N3{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 R3(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Vu(e){return e?typeof e=="string"?e:e.source:null}function PL(e){return Ta("(?=",e,")")}function A3(e){return Ta("(?:",e,")*")}function I3(e){return Ta("(?:",e,")?")}function Ta(...e){return e.map(n=>Vu(n)).join("")}function w3(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ey(...e){return"("+(w3(e).capture?"":"?:")+e.map(r=>Vu(r)).join("|")+")"}function BL(e){return new RegExp(e.toString()+"|").exec("").length-1}function x3(e,t){const n=e&&e.exec(t);return n&&n.index===0}const D3=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Sy(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=D3.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 M3=/\b\B/,FL="[a-zA-Z]\\w*",Ty="[a-zA-Z_]\\w*",UL="\\b\\d+(\\.\\d+)?",GL="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$L="\\b(0b[01]+)",L3="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",k3=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ta(t,/.*\b/,e.binary,/\b.*/)),jo({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Wu={begin:"\\\\[\\s\\S]",relevance:0},P3={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Wu]},B3={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Wu]},F3={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=jo({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=Ey("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:Ta(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},U3=Um("//","$"),G3=Um("/\\*","\\*/"),$3=Um("#","$"
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),V=$,U=F),k===void 0&&(k=!0);const W={code:U,language:V};se("before:highlight",W);const ee=W.result?W.result:f(W.language,W.code,k);return ee.code=W.code,se("after:highlight",ee),ee}function f($,F,k,U){const V=Object.create(null);function W(ae,Q){return ae.keywords[Q]}function ee(){if(!Re.keywords){Xe.addText(Ee);return}let ae=0;Re.keywordPatternRe.lastIndex=0;let Q=Re.keywordPatternRe.exec(Ee),te="";for(;Q;){te+=Ee.substring(ae,Q.index);const de=yt.case_insensitive?Q[0].toLowerCase():Q[0],Ne=W(Re,de);if(Ne){const[Je,En]=Ne;if(Xe.addText(te),te="",V[de]=(V[de]||0)+1,V[de]<=mQ&&(Ye+=En),Je.startsWith("_"))te+=Q[0];else{const So=yt.classNameAliases[Je]||Je;pe(Q[0],So)}}else te+=Q[0];ae=Re.keywordPatternRe.lastIndex,Q=Re.keywordPatternRe.exec(Ee)}te+=Ee.substring(ae),Xe.addText(te)}function he(){if(Ee==="")return;let ae=null;if(typeof Re.subLanguage=="string"){if(!t[Re.subLanguage]){Xe.addText(Ee);return}ae=f(Re.subLanguage,Ee,!0,fe[Re.subLanguage]),fe[Re.subLanguage]=ae._top}else ae=m(Ee,Re.subLanguage.length?Re.subLanguage:null);Re.relevance>0&&(Ye+=ae.relevance),Xe.__addSublanguage(ae._emitter,ae.language)}function ye(){Re.subLanguage!=null?he():ee(),Ee=""}function pe(ae,Q){ae!==""&&(Xe.startScope(Q),Xe.addText(ae),Xe.endScope())}function Ge(ae,Q){let te=1;const de=Q.length-1;for(;te<=de;){if(!ae._emit[te]){te++;continue}const Ne=yt.classNameAliases[ae[te]]||ae[te],Je=Q[te];Ne?pe(Je,Ne):(Ee=Je,ee(),Ee=""),te++}}function at(ae,Q){return ae.scope&&typeof ae.scope=="string"&&Xe.openNode(yt.classNameAliases[ae.scope]||ae.scope),ae.beginScope&&(ae.beginScope._wrap?(pe(Ee,yt.classNameAliases[ae.beginScope._wrap]||ae.beginScope._wrap),Ee=""):ae.beginScope._multi&&(Ge(ae.beginScope,Q),Ee="")),Re=Object.create(ae,{parent:{value:Re}}),Re}function Et(ae,Q,te){let de=x3(ae.endRe,te);if(de){if(ae["on:end"]){const Ne=new pA(ae);ae["on:end"](Q,Ne),Ne.isMatchIgnored&&(de=!1)}if(de){for(;ae.endsParent&&ae.parent;)ae=ae.parent;return ae}}if(ae.endsWithParent)return Et(ae.parent,Q,te)}function ke(ae){return Re.matcher.regexIndex===0?(Ee+=ae[0],1):(Wn=!0,0)}function Xt(ae){const Q=ae[0],te=ae.rule,de=new pA(te),Ne=[te.__beforeBegin,te["on:begin"]];for(const Je of Ne)if(Je&&(Je(ae,de),de.isMatchIgnored))return ke(Q);return te.skip?Ee+=Q:(te.excludeBegin&&(Ee+=Q),ye(),!te.returnBegin&&!te.excludeBegin&&(Ee=Q)),at(te,ae),te.returnBegin?0:Q.length}function Ot(ae){const Q=ae[0],te=F.substring(ae.index),de=Et(Re,ae,te);if(!de)return EA;const Ne=Re;Re.endScope&&Re.endScope._wrap?(ye(),pe(Q,Re.endScope._wrap)):Re.endScope&&Re.endScope._multi?(ye(),Ge(Re.endScope,ae)):Ne.skip?Ee+=Q:(Ne.returnEnd||Ne.excludeEnd||(Ee+=Q),ye(),Ne.excludeEnd&&(Ee=Q));do Re.scope&&Xe.closeNode(),!Re.skip&&!Re.subLanguage&&(Ye+=Re.relevance),Re=Re.parent;while(Re!==de.parent);return de.starts&&at(de.starts,ae),Ne.returnEnd?0:Q.length}function zn(){const ae=[];for(let Q=Re;Q!==yt;Q=Q.parent)Q.scope&&ae.unshift(Q.scope);ae.forEach(Q=>Xe.openNode(Q))}let ve={};function bt(ae,Q){const te=Q&&Q[0];if(Ee+=ae,te==null)return ye(),0;if(ve.type==="begin"&&Q.type==="end"&&ve.index===Q.index&&te===""){if(Ee+=F.slice(Q.index,Q.index+1),!i){const de=new Error(`0 width match regex (${$})`);throw de.languageName=$,de.badRule=ve.rule,de}return 1}if(ve=Q,Q.type==="begin")return Xt(Q);if(Q.type==="illegal"&&!k){const de=new Error('Illegal lexeme "'+te+'" for mode "'+(Re.scope||"<unnamed>")+'"');throw de.mode=Re,de}else if(Q.type==="end"){const de=Ot(Q);if(de!==EA)return de}if(Q.type==="illegal"&&te==="")return Ee+=`
|
||||
`,1;if(Vn>1e5&&Vn>Q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ee+=te,te.length}const yt=D($);if(!yt)throw ia(o.replace("{}",$)),new Error('Unknown language: "'+$+'"');const Zt=dQ(yt);let Vt="",Re=U||Zt;const fe={},Xe=new a.__emitter(a);zn();let Ee="",Ye=0,Jt=0,Vn=0,Wn=!1;try{if(yt.__emitTokens)yt.__emitTokens(F,Xe);else{for(Re.matcher.considerAll();;){Vn++,Wn?Wn=!1:Re.matcher.considerAll(),Re.matcher.lastIndex=Jt;const ae=Re.matcher.exec(F);if(!ae)break;const Q=F.substring(Jt,ae.index),te=bt(Q,ae);Jt=ae.index+te}bt(F.substring(Jt))}return Xe.finalize(),Vt=Xe.toHTML(),{language:$,value:Vt,relevance:Ye,illegal:!1,_emitter:Xe,_top:Re}}catch(ae){if(ae.message&&ae.message.includes("Illegal"))return{language:$,value:lE(F),illegal:!0,relevance:0,_illegalBy:{message:ae.message,index:Jt,context:F.slice(Jt-100,Jt+100),mode:ae.mode,resultSoFar:Vt},_emitter:Xe};if(i)return{language:$,value:lE(F),illegal:!1,relevance:0,errorRaised:ae,_emitter:Xe,_top:Re};throw ae}}function _($){const F={value:lE($),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return F._emitter.addText($),F}function m($,F){F=F||a.languages||Object.keys(t);const k=_($),U=F.filter(D).filter(P).map(ye=>f(ye,$,!1));U.unshift(k);const V=U.sort((ye,pe)=>{if(ye.relevance!==pe.relevance)return pe.relevance-ye.relevance;if(ye.language&&pe.language){if(D(ye.language).supersetOf===pe.language)return 1;if(D(pe.language).supersetOf===ye.language)return-1}return 0}),[W,ee]=V,he=W;return he.secondBest=ee,he}function h($,F,k){const U=F&&n[F]||k;$.classList.add("hljs"),$.classList.add(`language-${U}`)}function E($){let F=null;const k=u($);if(l(k))return;if(se("before:highlightElement",{el:$,language:k}),$.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$);return}if($.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($)),a.throwUnescapedHTML))throw new _Q("One of your code blocks includes unescaped HTML.",$.innerHTML);F=$;const U=F.textContent,V=k?d(U,{language:k,ignoreIllegals:!0}):m(U);$.innerHTML=V.value,$.dataset.highlighted="yes",h($,k,V.language),$.result={language:V.language,re:V.relevance,relevance:V.relevance},V.secondBest&&($.secondBest={language:V.secondBest.language,relevance:V.secondBest.relevance}),se("after:highlightElement",{el:$,result:V,text:U})}function T($){a=hA(a,$)}const S=()=>{O(),Ga("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){O(),Ga("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function O(){function $(){O()}if(document.readyState==="loading"){C||window.addEventListener("DOMContentLoaded",$,!1),C=!0;return}document.querySelectorAll(a.cssSelector).forEach(E)}function N($,F){let k=null;try{k=F(e)}catch(U){if(ia("Language definition for '{}' could not be registered.".replace("{}",$)),i)ia(U);else throw U;k=s}k.name||(k.name=$),t[$]=k,k.rawDefinition=F.bind(null,e),k.aliases&&z(k.aliases,{languageName:$})}function w($){delete t[$];for(const F of Object.keys(n))n[F]===$&&delete n[F]}function x(){return Object.keys(t)}function D($){return $=($||"").toLowerCase(),t[$]||t[n[$]]}function z($,{languageName:F}){typeof $=="string"&&($=[$]),$.forEach(k=>{n[k.toLowerCase()]=F})}function P($){const F=D($);return F&&!F.disableAutodetect}function oe($){$["before:highlightBlock"]&&!$["before:highlightElement"]&&($["before:highlightElement"]=F=>{$["before:highlightBlock"](Object.assign({block:F.el},F))}),$["after:highlightBlock"]&&!$["after:highlightElement"]&&($["after:highlightElement"]=F=>{$["after:highlightBlock"](Object.assign({block:F.el},F))})}function _e($){oe($),r.push($)}function le($){const F=r.indexOf($);F!==-1&&r.splice(F,1)}function se($,F){const k=$;r.forEach(function(U){U[k]&&U[k](F)})}function q($){return Ga("10.7.0","highlightBlock will be removed entirely in v12.0"),Ga("10.7.0","Please use highlightElement now."),E($)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:E,highlightBlock:q,configure:T,initHighlighting:S,initHighlightingOnLoad:y,registerLanguage:N,unregisterLanguage:w,listLanguages:x,getLanguage:D,registerAliases:z,autoDetection:P,inherit:hA,addPlugin:_e,removePlugin:le}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=fQ,e.regex={concat:Ta,lookahead:PL,either:Ey,optional:I3,anyNumberOfTimes:A3};for(const $ in Wp)typeof Wp[$]=="object"&&ML(Wp[$]);return Object.assign(e,Wp),e},Ll=VL({});Ll.newInstance=()=>VL({});var gQ=Ll;Ll.HighlightJS=Ll;Ll.default=Ll;const hQ=Gl(gQ);function WL(e,t=[]){return e.flatMap(n=>{const r=[...t,...n.properties?n.properties.className:[]];return n.children?WL(n.children,r):{text:n.value,classes:r}})}function SA(e){r
Line truncated
|
||||
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}function i5(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 o5(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 s5(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 c5(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 u5=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_-]*/}}),d5=["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"],p5=["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"],f5=["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"],_5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],m5=["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 E5(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 S5(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 T5(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 b5(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 y5(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 a9=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_-]*/}}),l9=["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"],c9=["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"],ZL=["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"],JL=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],u9=["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
|
||||
]`,m={scope:"string",variants:[u,l,d,f]},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"],T=["__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"],S=["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"],C={keyword:T,literal:(le=>{const se=[];return le.forEach(q=>{se.push(q),q.toLowerCase()===q?se.push(q.toUpperCase()):se.push(q.toLowerCase())}),se})(E),built_in:S},O=le=>le.map(se=>se.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(_,"+"),t.concat("(?!",O(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},w=t.concat(r,"\\b(?!\\()"),x={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),w],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"}}]},D={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[D,o,x,e.C_BLOCK_COMMENT_MODE,m,h,N]},P={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",O(T).join("\\b|"),"|",O(S).join("\\b|"),"\\b)"),r,t.concat(_,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(P);const oe=[D,x,e.C_BLOCK_COMMENT_MODE,m,h,N],_e={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",...oe]},...oe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:C,contains:[_e,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,P,x,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{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:C,contains:["self",o,x,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",ill
Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),W=F,V=k),U===void 0&&(U=!0);const ee={code:V,language:W};q("before:highlight",ee);const he=ee.result?ee.result:f(ee.language,ee.code,U);return he.code=ee.code,q("after:highlight",he),he}function f(F,k,U,V){const W=Object.create(null);function ee(Q,te){return Q.keywords[te]}function he(){if(!fe.keywords){Ee.addText(Ye);return}let Q=0;fe.keywordPatternRe.lastIndex=0;let te=fe.keywordPatternRe.exec(Ye),de="";for(;te;){de+=Ye.substring(Q,te.index);const Ne=Zt.case_insensitive?te[0].toLowerCase():te[0],Je=ee(fe,Ne);if(Je){const[En,So]=Je;if(Ee.addText(de),de="",W[Ne]=(W[Ne]||0)+1,W[Ne]<=G6&&(Jt+=So),En.startsWith("_"))de+=te[0];else{const ya=Zt.classNameAliases[En]||En;Ge(te[0],ya)}}else de+=te[0];Q=fe.keywordPatternRe.lastIndex,te=fe.keywordPatternRe.exec(Ye)}de+=Ye.substring(Q),Ee.addText(de)}function ye(){if(Ye==="")return;let Q=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){Ee.addText(Ye);return}Q=f(fe.subLanguage,Ye,!0,Xe[fe.subLanguage]),Xe[fe.subLanguage]=Q._top}else Q=m(Ye,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(Jt+=Q.relevance),Ee.__addSublanguage(Q._emitter,Q.language)}function pe(){fe.subLanguage!=null?ye():he(),Ye=""}function Ge(Q,te){Q!==""&&(Ee.startScope(te),Ee.addText(Q),Ee.endScope())}function at(Q,te){let de=1;const Ne=te.length-1;for(;de<=Ne;){if(!Q._emit[de]){de++;continue}const Je=Zt.classNameAliases[Q[de]]||Q[de],En=te[de];Je?Ge(En,Je):(Ye=En,he(),Ye=""),de++}}function Et(Q,te){return Q.scope&&typeof Q.scope=="string"&&Ee.openNode(Zt.classNameAliases[Q.scope]||Q.scope),Q.beginScope&&(Q.beginScope._wrap?(Ge(Ye,Zt.classNameAliases[Q.beginScope._wrap]||Q.beginScope._wrap),Ye=""):Q.beginScope._multi&&(at(Q.beginScope,te),Ye="")),fe=Object.create(Q,{parent:{value:fe}}),fe}function ke(Q,te,de){let Ne=n6(Q.endRe,de);if(Ne){if(Q["on:end"]){const Je=new NA(Q);Q["on:end"](te,Je),Je.isMatchIgnored&&(Ne=!1)}if(Ne){for(;Q.endsParent&&Q.parent;)Q=Q.parent;return Q}}if(Q.endsWithParent)return ke(Q.parent,te,de)}function Xt(Q){return fe.matcher.regexIndex===0?(Ye+=Q[0],1):(ae=!0,0)}function Ot(Q){const te=Q[0],de=Q.rule,Ne=new NA(de),Je=[de.__beforeBegin,de["on:begin"]];for(const En of Je)if(En&&(En(Q,Ne),Ne.isMatchIgnored))return Xt(te);return de.skip?Ye+=te:(de.excludeBegin&&(Ye+=te),pe(),!de.returnBegin&&!de.excludeBegin&&(Ye=te)),Et(de,Q),de.returnBegin?0:te.length}function zn(Q){const te=Q[0],de=k.substring(Q.index),Ne=ke(fe,Q,de);if(!Ne)return DA;const Je=fe;fe.endScope&&fe.endScope._wrap?(pe(),Ge(te,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(pe(),at(fe.endScope,Q)):Je.skip?Ye+=te:(Je.returnEnd||Je.excludeEnd||(Ye+=te),pe(),Je.excludeEnd&&(Ye=te));do fe.scope&&Ee.closeNode(),!fe.skip&&!fe.subLanguage&&(Jt+=fe.relevance),fe=fe.parent;while(fe!==Ne.parent);return Ne.starts&&Et(Ne.starts,Q),Je.returnEnd?0:te.length}function ve(){const Q=[];for(let te=fe;te!==Zt;te=te.parent)te.scope&&Q.unshift(te.scope);Q.forEach(te=>Ee.openNode(te))}let bt={};function yt(Q,te){const de=te&&te[0];if(Ye+=Q,de==null)return pe(),0;if(bt.type==="begin"&&te.type==="end"&&bt.index===te.index&&de===""){if(Ye+=k.slice(te.index,te.index+1),!i){const Ne=new Error(`0 width match regex (${F})`);throw Ne.languageName=F,Ne.badRule=bt.rule,Ne}return 1}if(bt=te,te.type==="begin")return Ot(te);if(te.type==="illegal"&&!U){const Ne=new Error('Illegal lexeme "'+de+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw Ne.mode=fe,Ne}else if(te.type==="end"){const Ne=zn(te);if(Ne!==DA)return Ne}if(te.type==="illegal"&&de==="")return 1;if(Wn>1e5&&Wn>te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ye+=de,de.length}const Zt=z(F);if(!Zt)throw oa(o.replace("{}",F)),new Error('Unknown language: "'+F+'"');const Vt=P6(Zt);let Re="",fe=V||Vt;const Xe={},Ee=new a.__emitter(a);ve();let Ye="",Jt=0,Vn=0,Wn=0,ae=!1;try{if(Zt.__emitTokens)Zt.__emitTokens(k,Ee);else{for(fe.matcher.considerAll();;){Wn++,ae?ae=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=Vn;const Q=fe.matcher.exec(k);if(!Q)break;const te=k.substring(Vn,Q.index),de=yt(te,Q);Vn=Q.index+de}yt(k.substring(Vn))}return Ee.finalize(),Re=Ee.toHTML(),{language:F,value:Re,relevance:Jt,illegal:!1,_emitter:Ee,_top:fe}}catch(Q){if(Q.message&&Q.message.includes("Illegal"))return{language:F,value:fE(k),illegal:!0,relevance:0,_illegalBy:{message:Q.message,index:Vn,context:k.slice(Vn-100,Vn+100),mode:Q.mode,resultSoFar:Re},_emitter:Ee};if(i)return{language:F,value:fE(k),illegal:!1,relevance:0,errorRaised:Q,_emitter:Ee,_top:fe};throw Q}}function _(F){const k={value:fE(F),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return k._emitter.addText(F),k}function m(F,k){k=k||a.languages||Object.keys(t);const U=_(F),V=k.filter(z).filter(oe).map(pe=>f(pe,F,!1));V.unshift(U);const W=V.sort((pe,Ge)=>{if(pe.relevance!==Ge.relevance)return Ge.relevance-pe.relevance;if(pe.language&&Ge.language){if(z(pe.language).supersetOf===Ge.language)return 1;if(z(Ge.language)
Line truncated
|
||||
|
||||
`);return!r||!i?!1:!!e.chain().command(({tr:o})=>(o.delete(t.pos-2,t.pos),!0)).exitCode().run()}function J6(){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 eX({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 Ny=["arduino","bash","c","cpp","csharp","css","diff","go","graphql","ini","java","javascript","json","kotlin","less","lua","makefile","markdown","objectivec","perl","php","php-template","plaintext","powershell","python","python-repl","r","ruby","rust","scss","shell","sql","swift","typescript","vbnet","wasm","xml","yaml","ipsphtml","ipscss"],ju=NL.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 Qt(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 Mt=qu.extend({draggable:!0,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 N_)return N_[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||!Ny.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":gs[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(J6.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 nn)if(n.endsWith(s)&&r.startsWith(nn[s]))return e.chain().deleteRange({from:e.state.selection.from-s.length,to:e.state.selection.from+nn[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,C,O,N,w,x,D,z,P,oe,_e;if(Z6.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=eX({editor:t});if(!o.length)return!1;const s=o[o.length-1],a=o[o.length-2];let l=((C=(y=s.match(/^\t*/))==null?void 0:y[0])==null?void 0:C.length)||0,u=!1;const d=i.attrs.language,f=["ipsphtml","xml","html","xhtml","html5"].includes(d),_=["ipscss","css","scss","sass","less"].includes(d),m=["plaintext","rtf","markdown","md","bbcode"].includes(d),h=f?/(<[^>/]*>)$/:/([{[(.:]|->)$/,E=f?/(<\/[^/>]*>)$/:/^\s*([}\])]+[,;]?)$/;let T=!1;if(!f&&!_&&!m&&s.match(/^\s+(\.|->)?[a-z0-9_-]/i))if(s.match(/^\s+(\.|->)/))T=!0,l--;else{let le=1;for(;le<o.length&&((w=(N=(O=o[o.length-1-le])==null?void 0:O.match(/^\t*/))==null?void 0:N[0])==null?void 0:w.length)<=l;)le++;(x=o[o.length-le])!=null&&x.match(/(\.|->)\s*$/)&&(T=!0,l--)}let S=!1;if(!T)if(s.match(h)){const le=s.match(h)[0];if((f||le in nn)&&t.state.selection.$from.parentOffset<t.state.selection.$from.parent.textContent.length){const se=((P=(z=(D=t.state.doc.slice(t.state.selection.from,t.state.selection.from-t.state.selection.$from.parentOffset+t.state.selection.$from.parent.textContent.length))==null?void 0:D.content)==null?void 0:z.content)==null?void 0:P.re
Line truncated
|
||||
`+" ".repeat(l);u?(le-=s.length,q=s.replace(/^\t/,"")+q):S&&(se=`
|
||||
`+(l>1?" ".repeat(l-1):""),q+=se);let $=this.editor.chain().insertContentAt({from:le,to:t.state.selection.from},{type:"text",text:q});return se&&($=$.setTextSelection(t.state.selection.from+q.length-se.length)),$.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:tX.bind(this),Tab:Jp.bind(this,!1,{editor:e}),"Shift-Tab":Jp.bind(this,!0,{editor:e}),"Alt-Tab":Jp.bind(this,!1,{editor:e},!0),"Shift-Alt-Tab":Jp.bind(this,!0,{editor:e},!0)}},addProseMirrorPlugins(){var t;const e={};for(const n in nn)e[nn[n]]=n;return[...((t=this.parent)==null?void 0:t.call(this))||[],new Fe({key:new $e("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 nn)return r.key.toLowerCase()in e&&LA({editor:i,opener:r.key.toLowerCase()})?!0:!!nX({editor:i,char:r.key.toLowerCase()});if(r.key.toLowerCase()in e)return!!LA({editor:i,opener:e[r.key.toLowerCase()]})}}})]}});function tX({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 Jp(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||Qt(()=>{t.chain().command(({tr:a,chain:l})=>{var u,d,f,_;try{const{from:m,to:h}=t.state.selection,E=[...t.state.selection.$from.path].reverse()[3]+1;let T=m;if(T>[...t.state.selection.$from.path].reverse()[3]){for(;T>[...t.state.selection.$from.path].reverse()[3]&&!((u=a.doc.slice(T-1,T--).content.content[0])!=null&&u.textContent.startsWith(`
|
||||
`)););T++}const S=((d=a.doc.slice(T,h).content.content[0])==null?void 0:d.textContent)||"",y=m-T,C=S.split(`
|
||||
`),O=C.map(x=>e?x.replace(/^\t/,""):" "+x).join(`
|
||||
`);let N=!1;try{e&&C.length>1&&C[C.length-1].match(/^\t/)&&((_=(f=a.doc.slice(h,h+1))==null?void 0:f.content.content[0])==null?void 0:_.textContent)===" "&&(N=!0)}catch{}a.insertText(O,T,h);const w={from:T+y,to:T+O.length};e&&S.startsWith(" ")?w.from--:e||w.from++,N&&w.to++,E>w.from&&(w.from=E),l().setTextSelection(w).focus().run()}catch{}return!0}).run()},"Something went wrong when modifying indents in a codeblock selection"),!0;if(!n&&t.isActive(ju.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 nX({editor:e,char:t}){var f,_,m;if(!(t in nn))return!1;const{$from:n,$to:r}=e.state.selection,i=n.parent,o=r.parent;if(((f=i==null?void 0:i.type)==null?void 0:f.name)!==qu.name||i!==o)return!1;if(e.state.selection.empty)return e.chain().insertContent(`${t}${nn[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(),T=s.slice(r.parentOffset).split(`
|
||||
`).shift();let S=Math.max(0,((m=(_=E.match(/^\t*/))==null?void 0:_[0])==null?void 0:m.length)+1);E.match(/^\t*$/)&&T.match(/^\t+$/)&&(S+=T.match(/^\t+$/)[0].length),T.match(/^\s*$/)&&(a=a.replace(/^\s*?\n\s*(.?)/,"$1")),u=S+1;const y=" ".repeat(S),C=new RegExp(`\\n\\t{0,${S?S-1:0}}`,"g");if(a=a.replaceAll(C,`
|
||||
${y}`),a=`${t}
|
||||
${y}${a}
|
||||
${y?y.slice(0,y.length-1):""}${nn[t]}`,r.parentOffset<s.length)try{const O=s.slice(r.parentOffset,r.parentOffset+1);O!=null&&O.match(/\n/)||(l=`
|
||||
`+(y?y.slice(0,y.length-1):""),a+=l)}catch{}}else a=`${t}${a}${nn[t]}`;const d={from:e.state.selection.from+t.length+u,to:e.state.selection.from+a.length-nn[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(d).focus().run()}function LA({editor:e,opener:t}){var o;if(!(t in nn)||!e.state.selection.empty)return!1;const{$from:n}=e.state.selection,r=n.parent;if((r==null?void 0:r.type.name)!==qu.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+nn[t].length);if(!a)return;if(a.startsWith(nn[t]))return s>0&&['"',"'","`"].includes(t)&&(i==null?void 0:i[s-1])==="\\"?e.chain().insertContent({type:"text",text:nn[t]}).focus().run():e.chain().setTextSelection(e.state.selection.from+nn[t].length).focus().run()}catch{return!1}return!1}const nn={"{":"}","[":"]","(":")","'":"'",'"':'"',"`":"`"};function rX(e){const t=[...e.state.selection.$from.path].reverse()[2],n=t==null?void 0:t.type.name;return n===Yr.name?[n,{level:t.attrs.level||1}]:[n||"",{}]}function Hc(e){var n;if(e[0]===Yr.name)return`Heading ${((n=e[1])==null?void 0:n.level)||""}`;const t=e[0]in fT?e[0]:Ht.name;return fT[t]}function iX(e){if(e in kA)return[kA[e],{}];const t=Hc([Yr.name,{}]);if(e.startsWith(t)){const n=parseInt(e.replace("Heading","").trim())||1;return[Yr.name,{level:n}]}return[Ht.name,{}]}const fT={[Ai.name]:"Ordered List",[po.name]:"Bullet List",[Mt.name]:"Code Block",[Ht.name]:"Paragraph"},kA=Object.fromEntries([...Object.entries(fT)].map(e=>e.reverse())),_E=new WeakMap;function oX(e){if(!_E.has(e)){const t=[...zc].filter(i=>!(i===Yr.name&&e.options.restrictions.has("heading"))&&e.extensionManager.extensions.some(o=>o.name===i)),n=[],r=e.extensionManager.extensions.find(i=>i.name===Yr.name);t.forEach(i=>{i===Yr.name?r.options.levels.forEach(o=>n.push([Yr.name,{level:o}])):n.push([i,{}])}),_E.set(e,n)}return _E.get(e)}const zc=new Set([Ht.name,Mt.name,Yr.name]);function sX({...e}){const{editor:t}=L.useContext(xe),n=rX(t);e.dropdownOptions=e.dropdownOptions||{},e.dropdownOptions.className=e.dropdownOptions.className||"",e.dropdownOptions.className=[...e.dropdownOptions.className.split(/\s+/),"ipsRichText"].join(" ");const r=oX(t);return v.jsx(vs,{current:v.jsx(v.Fragment,{children:v.jsx("i",{className:"fa-solid fa-paragraph"})}),currentValue:Hc(n),blank:v.jsx(PA,{block:[Ht.title,{}]}),items:r.filter(i=>i[0]!==Mt.name).map(i=>[Hc(i),v.jsx(PA,{block:i},Hc(i))]),itemProps:Object.fromEntries(r.map(i=>[Hc(i),{disabled:!t.can().convertBlocks(i)}])),onChange:i=>{const o=iX(i);t.chain().convertBlocks(o).focus().run()},...e,dropdownOptions:{...e.dropdownOptions,location:"se"}})}function PA({block:e,style:t=!0}){if(e[0]===Yr.name){const n=`h${e[1].level}`,r=window.ips.getString(`editor_node--heading_${e[1].level}`);return t?v.jsx(n,{children:r}):v.jsx(v.Fragment,{children:r})}if(e[0]===Mt.name){const n=window.ips.getString("editor_node--code_block");return t?v.jsx("code",{children:n}):v.jsx(v.Fragment,{children:n})}return v.jsx(v.Fragment,{children:window.ips.getString("editor_node--paragraph")})}var Xu=Hn.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",qe(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()}}}),Zu=Hn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return e!=="super"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sup",qe(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});const aX=st.create({name:"ipsLatexContainer",group:"inline",inline:!0,content:"text*",renderHTML(){return["span",{class:"ipsLatexContainer"},0]},parseHTML(){return[{tag:"span",getAttrs:e=>e.classList.contains("ipsLatexContainer")&&null}]}});var gd=st.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",qe(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!fK(t,t.schema.nodes[this.name]))return!1;const{seleLine truncated
|
||||
`,mX="️",gX="",SE="";let ef=null,tf=null;function hX(e=[]){const t={};Jn.groups=t;const n=new Jn;ef==null&&(ef=UA(cX)),tf==null&&(tf=UA(uX)),re(n,"'",Y_),re(n,"{",lu),re(n,"}",cu),re(n,"[",O_),re(n,"]",A_),re(n,"(",I_),re(n,")",w_),re(n,"<",x_),re(n,">",D_),re(n,"(",M_),re(n,")",L_),re(n,"「",k_),re(n,"」",P_),re(n,"『",B_),re(n,"』",F_),re(n,"<",U_),re(n,">",G_),re(n,"&",$_),re(n,"*",H_),re(n,"@",Fo),re(n,"`",V_),re(n,"^",W_),re(n,":",Ho),re(n,",",Iy),re(n,"$",q_),re(n,".",hi),re(n,"=",K_),re(n,"!",wy),re(n,"-",Pr),re(n,"%",uu),re(n,"|",Q_),re(n,"+",j_),re(n,"#",X_),re(n,"?",du),re(n,'"',xy),re(n,"/",Ei),re(n,";",Dy),re(n,"~",pu),re(n,"_",Z_),re(n,"\\",z_),re(n,"・",wk);const r=It(n,$i,Oy,{[_T]:!0});It(r,$i,r);const i=It(r,Gi,Ak,{[au]:!0}),o=It(r,Lc,Ik,{[Vc]:!0}),s=It(n,Gi,zi,{[mT]:!0});It(s,$i,i),It(s,Gi,s),It(i,$i,i),It(i,Gi,i);const a=It(n,Lc,ET,{[gT]:!0});It(a,Gi),It(a,$i,o),It(a,Lc,a),It(o,$i,o),It(o,Gi),It(o,Lc,o);const l=re(n,EE,Ay,{[mE]:!0}),u=re(n,FA,bT,{[mE]:!0}),d=It(n,hE,bT,{[mE]:!0});re(n,SE,d),re(u,EE,l),re(u,SE,d),It(u,hE,d),re(d,FA),re(d,EE),It(d,hE,d),re(d,SE,d);const f=It(n,gE,xk,{[Ok]:!0});re(f,"#"),It(f,gE,f),re(f,mX,f);const _=re(f,gX);re(_,"#"),It(_,gE,f);const m=[[Gi,s],[$i,i]],h=[[Gi,null],[Lc,a],[$i,o]];for(let E=0;E<ef.length;E++)xo(n,ef[E],ST,zi,m);for(let E=0;E<tf.length;E++)xo(n,tf[E],TT,ET,h);js(ST,{tld:!0,ascii:!0},t),js(TT,{utld:!0,alpha:!0},t),xo(n,"file",Mf,zi,m),xo(n,"mailto",Mf,zi,m),xo(n,"http",Qa,zi,m),xo(n,"https",Qa,zi,m),xo(n,"ftp",Qa,zi,m),xo(n,"ftps",Qa,zi,m),js(Mf,{scheme:!0,ascii:!0},t),js(Qa,{slashscheme:!0,ascii:!0},t),e=e.sort((E,T)=>E[0]>T[0]?1:-1);for(let E=0;E<e.length;E++){const T=e[E][0],y=e[E][1]?{[dX]:!0}:{[pX]:!0};T.indexOf("-")>=0?y[hT]=!0:Gi.test(T)?$i.test(T)?y[au]=!0:y[mT]=!0:y[_T]=!0,BA(n,T,T,y)}return BA(n,"localhost",Ju,{ascii:!0}),n.jd=new Jn(J_),{start:n,tokens:Object.assign({groups:t},Dk)}}function Mk(e,t){const n=EX(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,d=null,f=-1,_=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(f=0,_=0,d=a):f>=0&&(f+=n[s].length,_++),u+=n[s].length,o+=n[s].length,s++;o-=f,s-=_,u-=f,i.push({t:d.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function EX(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 xo(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 Jn(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new Jn(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function UA(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 Bl={defaultProtocol:"http",events:null,format:GA,formatHref:GA,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function $m(e,t=null){let n=Object.assign({},Bl);e&&(n=Object.assign(n,e instanceof $m?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}$m.prototype={o:Bl,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]:Bl[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 GA(e){return e}var SX=Object.freeze({__proto__:null,Options:$m,defaults:Bl});function Lk(e,t){this.t="token",this.v=e,this.tk=t}Lk.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=Bl.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),d=e.getObj("attributes",n,t),f=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),Line truncated
|
||||
1. Must only contain digits, lowercase ASCII letters or "-"
|
||||
2. Cannot start or end with "-"
|
||||
3. "-" cannot repeat`);gt.customSchemes.push([e,t])}function NX(){gt.scanner=hX(gt.customSchemes);for(let e=0;e<gt.tokenQueue.length;e++)gt.tokenQueue[e][1]({scanner:gt.scanner});gt.parser=bX(gt.scanner.tokens);for(let e=0;e<gt.pluginQueue.length;e++)gt.pluginQueue[e][1]({scanner:gt.scanner,parser:gt.parser});return gt.initialized=!0,gt}function My(e){return gt.initialized||NX(),yX(gt.parser.start,e,Mk(gt.scanner.start,e))}My.scan=Mk;function Ly(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 $m(n),i=My(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}var ky="[\0- -\u2029 ]",OX=new RegExp(ky),AX=new RegExp(`${ky}$`),IX=new RegExp(ky,"g");function wX(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function xX(e){return new Fe({key:new $e("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=$M(n.doc,[...t]);if(KM(a).forEach(({newRange:u})=>{const d=Sq(r.doc,u,m=>m.isTextblock);let f,_;if(d.length>1)f=d[0],_=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const m=r.doc.textBetween(u.from,u.to," "," ");if(!AX.test(m))return;f=d[0],_=r.doc.textBetween(f.pos,u.to,void 0," ")}if(f&&_){const m=_.split(OX).filter(Boolean);if(m.length<=0)return!1;const h=m[m.length-1],E=f.pos+_.lastIndexOf(h);if(!h)return!1;const T=My(h).map(S=>S.toObject(e.defaultProtocol));if(!wX(T))return!1;T.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>e.validate(S.value)).filter(S=>e.shouldAutoLink(S.value)).forEach(S=>{uy(S.from,S.to,r.doc).some(y=>y.mark.type===e.type)||s.addMark(S.from,S.to,e.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function DX(e){return new Fe({key:new $e("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let d=r.target;const f=[];for(;d.nodeName!=="DIV";)f.push(d),d=d.parentNode;s=f.find(_=>_.nodeName==="A")}if(!s)return!1;const a=cy(t.state,e.type.name),l=(i=s==null?void 0:s.href)!=null?i:a.href,u=(o=s==null?void 0:s.target)!=null?o:a.target;return e.enableClickSelection&&e.editor.commands.extendMarkRange(e.type.name),s&&l?(window.open(l,u),!0):!1}}})}function MX(e){return new Fe({key:new $e("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:o}=t,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=Ly(l,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||i!==void 0&&!i(u.href)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function Bs(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(IX,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Ya=Hn.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"){HA(e);return}HA(e.scheme,e.optionalSlashes)})},onDestroy(){RX()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Bs(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=>!!Bs(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=>!!Bs(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",qe(this.options.HTMLAttributes,e),0]:["a",qe(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n;const r=((n=e.attrs)==null?void 0:n.
Line truncated
|
||||
`+t.message,window.Debug.error(t),Si=null}).finally(()=>{for(const t of kc)t(Si),kc.delete(t);if(!window.Debug.isEnabled()){const t=86400*(window.ips.getSetting("memberID")?1e3:7e3);window.ips.utils.db.set(jA,"",Si,!1,Math.round((Date.now()+t)/1e3))}e(Si)})}})}function jk(e){var t,n,r,i;return((i=(r=(n=(t=window==null?void 0:window.ips)==null?void 0:t.utils)==null?void 0:n.iconpicker)==null?void 0:r.getEmojiSearchTree)==null?void 0:i.call(r).getShortCode(e))??e.toLowerCase().trim().replaceAll(/[^\p{L}\p{N}\s]+/gu,"").replaceAll(/\s+/g,"_").replaceAll(/_+/g,"_")}let IE=!1;function x8({iconPicked:e,children:t,...n}){var u,d,f;const{editor:r}=L.useContext(xe),i=L.useRef(null),o=L.useRef(null),s=L.useMemo(()=>{const _=window.navigator.userAgent.toLowerCase();return _.includes("safari")&&!_.includes("chrome")&&_.includes("macintosh")&&!_.includes("iphone")&&!_.includes("ipad")},[])&&!window.safari_test_toolbar_iconpicker,a=L.useMemo(()=>{var m,h,E;const _={customEmoji:!0,nativeEmoji:!0,allowedTypes:[]};return(m=r.options.restrictions)!=null&&m.has("native_emoji")&&(_.nativeEmoji=!1),(h=r.options.restrictions)!=null&&h.has("custom_emoji")&&(_.customEmoji=!1),(_.customEmoji||_.nativeEmoji)&&_.allowedTypes.push("emoji"),(E=r.options.restrictions)!=null&&E.has("fa_icons")||_.allowedTypes.push("fa"),_},[(u=r.options.restrictions)==null?void 0:u.has("native_emoji"),(d=r.options.restrictions)==null?void 0:d.has("custom_emoji"),(f=r.options.restrictions)==null?void 0:f.has("fa_icons")]),l=L.useCallback(()=>{var _;if(!a.allowedTypes.length){window.ips.ui.alert.show({message:window.ips.getString("iconpicker_error_fatal"),type:"alert"});return}(_=window.ips.utils.iconpicker.pick({defaultTab:"emoji",container:o.current,submitOnClick:!0,afterHide:s?void 0:()=>{var m;(m=o.current)==null||m.dispatchEvent(new CustomEvent("ipsAnchorClose",{bubbles:!0}))},shortCodeFixer:jk,...a}))==null||_.then(m=>{e==null||e(m)})},[e,s,a]);return L.useEffect(()=>{IE||(IE=!0,window.Debug.log("Preloading icons for the editor"),window.ips.utils.iconpicker.loadFa6().then(()=>{window.ips.utils.fontawesome.buildSearchTree(),window.ips.utils.iconpicker.compileEmojiSearchIndex(!0)}))},[IE]),a.allowedTypes.length?s?v.jsx(Yt,{ref:i,...n,onClick:l,children:t}):v.jsxs(v.Fragment,{children:[v.jsx(Yt,{ref:i,...n,children:t}),v.jsx(ln,{closeOnPanelActivity:!1,afterOpen:()=>{if(!o.current.querySelector(".ipsIconPicker"))l();else try{setTimeout(()=>{var _;return(_=o.current.querySelector('[name="icon_picker_search_box"]'))==null?void 0:_.focus()},150)}catch{}},anchorActiveClasses:[["ipsEditor__toolbar-item--active"]],anchorInactiveClasses:[["ipsEditor__toolbar-item--inactive"]],ref:o,className:"ipsEditor__iconpicker-wrap ipsBox",anchorRef:i,location:"se"})]}):v.jsx(v.Fragment,{})}function Xk({current:e,onChange:t,...n}){let{update:r,...i}=Ed(e);const{node:o}=L.useContext(ho);e=e||(i==null?void 0:i.alignStyle),e in bE||(e="regular");let s="wrapNone";e==="left"||e==="inline"?s="wrap":e==="right"&&(s="wrapInverted");const a={};return v.jsx(vs,{current:v.jsx(El,{name:s}),currentValue:bE[e],items:Object.fromEntries([...Object.entries(bE)].filter(([l])=>{var u;return l!=="inline"||[ot.name,cr.name].includes((u=o==null?void 0:o.type)==null?void 0:u.name)}).map(([l,u])=>(a[u]=l,[u,v.jsx(El,{name:D8[l]||"wrapNone"},l)]))),onChange:l=>{const u=a[l];return t instanceof Function?t(u):r==null?void 0:r({alignStyle:u})},...n,dropdownOptions:{location:i.inNodeView?"s":"se"}})}const D8={regular:"wrapNone",right:"wrapInverted",left:"wrap",inline:"wrap"},Ul={1:"inherit",2:"initial",3:"revert",4:"revert-layer",5:"unset",6:"serif",7:"sans-serif",8:"monospace",9:"cursive",10:"fantasy",11:"system-ui",12:"ui-serif",13:"ui-sans-serif",14:"ui-monospace",15:"ui-rounded",16:"emoji",17:"math",18:"fangsong"},Zk={Default:{main:1,fallbacks:[]},Helvetica:{main:"Helvetica",fallbacks:["Arial",7]},Arial:{main:"Arial",fallbacks:["Helvetica",7]},"Arial Black":{main:"Arial Black",fallbacks:["Impact","Arial","Helvetica",7]},Verdana:{main:"Verdana",fallbacks:["Arial","Helvetica",7]},Tahoma:{main:"Tahoma",fallbacks:["Verdana","Arial","Helvetica",7]},"Trebuchet MS":{main:"Trebuchet MS",fallbacks:["Arial","Helvetica",7]},Impact:{main:"Impact",fallbacks:["Arial Black","Arial",7]},"Gill Sans":{main:"Gill Sans",fallbacks:["Arial",7]},"Times New Roman":{main:"Times New Roman",fallbacks:["Georgia",6]},Georgia:{main:"Georgia",fallbacks:["Times New Roman",6]},Palatino:{main:"Palatino",fallbacks:["Times New Roman","Georgia",6]},Baskerville:{main:"Baskerville",fallbacks:["Times New Roman","Georgia",6]},"Andalé Mono":{main:"Andale Mono",fallbacks:[8]},Courier:{main:"Courier",fallbacks:[8]},Monaco:{main:"Monaco",fallbacks:["Console Sans",8]},"Bradley Hand":{main:"Bradley Hand",fallbacks:[9]},"Brush Script MT":{main:"Brush Script MT",fallbacks:[9]},Luminari:{main:"Luminari",fallbacks:[9]}},Uy=["80%","90%","100%","125%","150%","175%","200%"],em="100%",ed=Hn.create({name:"IPSTextSize",addAttributes(){return{size:{def
Line truncated
|
||||
${JSON.stringify({id:r,title:i},null,2)}`));continue}this._store.set(r,new Xs(r,i))}},"Failed to fetch stock replies!")),Array.from(this._store.entries())}async getContent(){return typeof this._content!="string"&&await Qt(async()=>{const t=await Fl({data:{do:"storedReplies",id:this.id}});if(typeof t!="object"||typeof t.reply!="string")throw new TypeError(`Could not fetch valid content for the stored reply.
|
||||
${JSON.stringify(t,null,2)}`);this._content=t.reply,typeof t.title=="string"&&(this.title=t.title)},`Failed to fetch stock reply content for id ${this.id}`),this._content||""}static stockRepliesLoaded(){var t;return!!((t=this._store)!=null&&t.size)}},fi(Xs,"_store"),Xs);function Y8(e){const[t,n]=L.useState(null),{editor:r}=L.useContext(xe);return L.useEffect(()=>{t===null&&tm.getStore().then(n)},[t,n]),v.jsx(vs,{current:v.jsx("i",{className:"fa-solid fa-message"}),currentValue:null,items:(t==null?void 0:t.map(([i,{title:o}])=>[i,o]))||[],useTitles:!1,onChange:async i=>{const o=await(await tm.getStore()).find(([s])=>i===s)[1].getContent();o&&r.chain().insertContent(o,{parseOptions:{preserveWhitespace:!1}}).focus().run()},...e})}const Mo={};async function H8(e,t){var n,r;return e=vT(e),(!((n=Mo[e])!=null&&n[t])||Mo[e][t][0]<Date.now()/1e3-JA)&&await Qt(async()=>{const i=await Fl({data:{do:"giphy",search:e,limit:eI,offset:eI*t}}),o={};for(const s of i.images)o[s.thumb]=s;i.images=[...Object.values(o)],Mo[e]=Mo[e]||{},Mo[e][t]=[Math.floor(Date.now()/1e3),{...i,page:t}],setTimeout(()=>{var s;(s=Mo[e])!=null&&s[t]&&(window.Debug.log("Cleaning up cached giphy results."),delete Mo[e][t])},JA*1e3)},"Failed to load giphy results"),(r=Mo[e])==null?void 0:r[t][1]}function vT(e){return e.toLowerCase().trim().replaceAll(/\s+/g," ").replaceAll(/[()\\/!@#$%^&*"':;\-_=+.,<>?\[\]{}`~|]/g,"")}const JA=600,eI=30;function z8(e){const[t,n]=L.useState(""),[r,i]=L.useState(0),[o,s]=L.useState([]),[a,l]=L.useState("closed"),{editor:u}=L.useContext(xe),d=L.useRef(null),f=L.useRef(null),_=L.useRef(null);L.useEffect(()=>{f.current&&(f.current.querySelector("form").dataset.state=a),(a==="loading"||a==="infiniteScrollLoading")&&H8(t,r).then(E=>{var T,S;t===vT(((S=(T=f.current)==null?void 0:T.querySelector("input"))==null?void 0:S.value)||"")&&(E!==void 0&&s([...o,E]),l("ready"))})});const m=o[o.length-1];let h=!1;return m&&(h=parseInt(m.pagination.count)+parseInt(m.pagination.offset)<parseInt(m.pagination.total_count)),v.jsxs(v.Fragment,{children:[v.jsx(Yt,{...e,ref:d,children:v.jsxs("span",{className:"i-font-family_monospace",children:["GIF ",v.jsx("i",{className:"fa-solid fa-caret-down"})]})}),v.jsx(ln,{anchorActiveClasses:["ipsEditor__toolbar-item--active"],anchorInactiveClasses:["ipsEditor__toolbar-item--inactive"],usePortal:!1,anchorRef:d,"data-panel-anchor":e["data-toolbar-item"],ref:f,className:"ipsEditor__giphy-panel ipsEditor__toolbar-panel",closeOnPanelActivity:!1,afterOpen:()=>{s([]),_.current&&(_.current.value=""),n(""),i(0),l("loading")},afterClose:()=>{l("closed")},children:v.jsxs("form",{"data-state":"mounting",onSubmitCapture:E=>{E.stopPropagation(),E.preventDefault()},children:[v.jsx("input",{ref:_,name:"",type:"text",placeholder:window.ips.getString("editor_giphy_prompt"),defaultValue:t,onChange:gn.debounce(E=>{const T=vT(E.target.value);T!==t&&(i(0),l("loading"),s([]),n(T))},100,{leading:!0}),className:"ipsEditor__giphy-search ipsInput",onKeyDownCapture:E=>{E.key==="Enter"&&(E.stopPropagation(),E.preventDefault())}}),v.jsx(V8,{state:a,results:o,onScroll:h&&a==="ready"?gn.debounce(E=>{if(!E.target.querySelector(":scope > .ipsEditor__giphy-results-page")||!E.target.closest('[data-state="ready"]')||E.target.getRootNode()!==document.getRootNode())return;const T=E.target.getBoundingClientRect(),S=T.top+T.height*2,y=[...E.nativeEvent.target.querySelectorAll(":scope img")].reduce((C,O)=>O.getBoundingClientRect().width*O.getBoundingClientRect().height===0?C:Math.max(C||O.getBoundingClientRect().bottom,O.getBoundingClientRect().bottom),null);y!==null&&y<=S&&(i(r+1),l("infiniteScrollLoading"))},300):void 0,addImage:(E,T)=>{const S=document.createElement("img");S.src=E.url,S.title=E.title,S.alt=E.title,S.loading="lazy",u.chain().insertContent(S.outerHTML).focus().run(),T==null||T.target.dispatchEvent(new CustomEvent("ipsAnchorClose",{bubbles:!0}))}}),v.jsxs("a",{href:"https://giphy.com/",target:"_blank",className:"ipsEditor__giphy-attribution",children:[window.ips.getString("editor_giphy_attribution"),v.jsx("img",{src:window.ips.getSetting("baseURL").replace(/\/+$/,"")+"/applications/core/interface/static/giphy/full_logo_63px.png",alt:""}),v.jsx("i",{className:"fa-solid fa-external-link"})]})]})})]})}function V8({state:e,results:t,addImage:n,...r}){if(e==="closed")return v.jsx(v.Fragment,{});if(e==="loading")return v.jsx("div",{className:"ipsEditor__giphy-results ipsLoading"});if(e==="ready"){let i=!1;for(const{images:o}of t)if(o.length){i=!0;break}if(!i)return v.jsx("div",{className:"ipsEditor__giphy-results",children:v.jsx("h3",{children:"No Results"})})}return v.jsxs("div",{className:"ipsEditor__giphy-results",...r,children:[t.map(({images:i,page:o})=>v.jsx("div",{className:"ipsEditor__giphy-results-page",children:i.map(s=>v.jsx(Yt,{type:"button",style:{"--i-giphy-ratio":`${s.width}/${s.height}`},onClick:a=>{n(s,a)},addToolbarClasses:!1,children:v.jsx("img",{loading:"lazy",title:s.title,src:s.thumb,alt:s.title})},s.url))},o)Line truncated
|
||||
`).map(l=>l.trim()===""?n:`${n} ${l}`);r.push(a.join(`
|
||||
`))}),r.join(`
|
||||
${n}
|
||||
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ml({find:q8,type:this.type})]}});let lf,Q8=0;function j8(){if(lf!==void 0)return lf;if(Q8++>20)return window.Debug.warn("Couldn't determine the max height of a truncated quote element"),lf=275,275;const e=document.createElement("div");e.classList.add("ipsRichText"),e.style.opacity="0",document.body.appendChild(e);const t="temp_quote_"+window.ips.uid().replaceAll("-","");e.innerHTML=`<blockquote class="ipsQuote"><div class="ipsQuote_contents" data-ipstruncate data-ipstruncated="true" id="${t}"></div></blockquote>`;const n=getComputedStyle(document.querySelector(`#${t}`)),r=parseFloat(n.maxHeight)||0;if(e.remove(),r&&!Number.isNaN(r))lf=r;else return 275;return r}function X8({editor:e,getPos:t,node:n}){const r=L.useRef(null),i=L.useRef(null);L.useEffect(()=>{const a=()=>{var f;const l=(f=r.current)==null?void 0:f.querySelector(":scope > .ipsQuote_contents");if(!l)return;const u=t();if(u===void 0)return;let d=!0;if(l.scrollHeight>j8()){for(const _ of[e.state.selection.$from,e.state.selection.$to])if(_.pos>=u&&_.pos<=u+n.nodeSize){d=!1;break}}else d=!1;d===!("truncateExpanded"in l.dataset)&&d===!i.current.hasAttribute("hidden")||(d?(delete l.dataset.truncateExpanded,i.current.removeAttribute("hidden")):(l.dataset.truncateExpanded="true",i.current.setAttribute("hidden","")))};return setTimeout(()=>{a()}),e.on("selectionUpdate",a),()=>e.off("selectionUpdate",a)});const o=n.attrs,s=qe(o,{class:"ipsQuote","data-gramm":"false","data-ipsquote":""});return s.className=s.class,s.cite=s.citeLink,delete s.citeLink,delete s.class,delete s.citation,v.jsxs(Wl,{as:"blockquote",...s,"data-gramm":"false",ref:r,children:[v.jsx(Z8,{HTMLAttributes:o}),v.jsx(nP,{}),v.jsx(Kl,{editor:e,getPos:t,nodeSize:()=>n.nodeSize}),v.jsx(gy,{as:"div","data-gramm":"false","data-ipstruncate":"","data-truncated":"true",className:"ipsQuote_contents ipsClearfix"}),v.jsxs("button",{contentEditable:!1,ref:i,type:"button",hidden:!0,onClick:()=>{const a=t();a!==void 0&&e.chain().setTextSelection(a+1).focus().run()},className:"ipsTruncate_more","data-action":"expandTruncate",children:[v.jsx("span",{children:window.ips.haveString("edit_show_more")?window.ips.getString("edit_show_more"):"edit_show_more"}),v.jsx("i",{className:"fa-solid fa-pencil"})]})]})}function Z8({HTMLAttributes:e}){return e.citation?v.jsx("header",{className:"ipsQuote_citation",contentEditable:!1,children:e.citation}):v.jsx(v.Fragment,{})}const J8=["timestamp","userid","username","contentapp","contenttype","contentclass","contentid","contentcommentid"],$y=K8.extend({draggable:!0,content:"block+",addAttributes(){return{...Object.fromEntries(J8.map(t=>[`data-ipsquote-${t}`,{default:null}])),citation:{default:null,parseHTML:t=>{const n=t.querySelector(":scope > .ipsQuote_citation");if(n){const r=n.innerText;return n.remove(),r}return null}},citeLink:{default:"",parseHTML:t=>t.getAttribute("cite")||""}}},renderHTML:({HTMLAttributes:e})=>{const t=qe(e,{class:"ipsQuote","data-gramm":"false",cite:e.citeLink||void 0,"data-ipsquote":""});t.cite=t.citeLink,delete t.citation,delete t.citeLink;const n=["blockquote",t,["div",{class:"ipsQuote_contents ipsClearfix","data-gramm":"false","data-ipstruncate":""},0]];return e.citation&&n.splice(2,0,["header",{class:"ipsQuote_citation"},e.citation]),n},addNodeView(){return hd(X8)}}).configure({HTMLAttributes:{class:"ipsQuote","data-gramm":"false"}});function eZ(e){return!e.parentElement||!Yy(e.parentElement)?!1:oP(e.parentElement)===e}function Yy(e){return e.tagName.toLowerCase()==="details"||e.classList.contains("ipsSpoiler")||e.classList.contains("ipsRichTextBox")||e.classList.contains("ipsAccordion")}function oP(e){return e.querySelector(":scope > :is(summary, .ipsSpoiler_header, .ipsRichTextBox__title)")||null}function sP(e){return e.querySelector(":scope > :is(i-richtext-box-content)")||null}function aP(e){if(!e)return null;for(const t of[...e.path].reverse())if(typeof t!="number"&&t.type.name===io.name)return t;return null}function tZ(e){var t,n,r;return((r=aP((n=(t=e==null?void 0:e.state)==null?void 0:t.selection)==null?void 0:n.$from))==null?void 0:r.attrs.boxColor)||"root"}function Hy(e){var t,n,r;return((r=aP((n=(t=e==null?void 0:e.state)==null?void 0:t.selection)==null?void 0:n.$from))==null?void 0:r.attrs)||null}function nZ(){return new Fe({key:new $e("AttachmentLinkClick"),props:{handleDOMEvents:{click:(e,t)=>{if(t.target.closest(".ipsEditor__tiptap-wrap summary"))return t.preventDefault(),!0}}}})}const Qi=st.create({name:"ipsBoxTitle",content:"inline*",group:"boxContent",selectable:!1,defining:!0,isolating:!0,addAttributes(){return{boxmode:{default:"alwaysopen",parseHTML:e=>e.parentElement.classList.contains("ipsSpoiler")||e.parentElementLine truncated
|
||||
`;const _=new Array(s).fill(0).map((h,E)=>d&&u[E]&&u[E].text||"");return f+=`| ${_.map((h,E)=>l(h,a[E])).join(" | ")} |
|
||||
`,f+=`| ${a.map(h=>"-".repeat(Math.max(3,h))).join(" | ")} |
|
||||
`,(d?o.slice(1):o).forEach(h=>{f+=`| ${new Array(s).fill(0).map((E,T)=>l(h[T]&&h[T].text||"",a[T])).join(" | ")} |
|
||||
`}),f}var v7=C7,vP=st.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:h7,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=CP(e,this.options.cellMinWidth),o=t.style;function s(){return o||(r?`width: ${r}`:`min-width: ${i}`)}const a=["table",qe(this.options.HTMLAttributes,t,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(e,t)=>{const n=[];if(e.header){const r=[];e.header.forEach(i=>{r.push(t.createNode("tableHeader",{},[{type:"paragraph",content:t.parseInline(i.tokens)}]))}),n.push(t.createNode("tableRow",{},r))}return e.rows&&e.rows.forEach(r=>{const i=[];r.forEach(o=>{i.push(t.createNode("tableCell",{},[{type:"paragraph",content:t.parseInline(o.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>v7(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=S7(o.schema,e,t,n);if(i){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(be.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>PZ(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>BZ(e,t),deleteColumn:()=>({state:e,dispatch:t})=>UZ(e,t),addRowBefore:()=>({state:e,dispatch:t})=>$Z(e,t),addRowAfter:()=>({state:e,dispatch:t})=>YZ(e,t),deleteRow:()=>({state:e,dispatch:t})=>zZ(e,t),deleteTable:()=>({state:e,dispatch:t})=>XZ(e,t),mergeCells:()=>({state:e,dispatch:t})=>lI(e,t),splitCell:()=>({state:e,dispatch:t})=>cI(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>td("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>td("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>QZ(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>lI(e,t)?!0:cI(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>qZ(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>dI(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>dI(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&_P(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=ft.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:pf,"Mod-Backspace":pf,Delete:pf,"Mod-Delete":pf}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[a7({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],g7({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Ze(Ce(e,"tableRole",t))}}});je.create({name:"tableKit",addExtensions(){const e=[];return this.options.table!==!1&&e.push(vP.configure(this.options.table)),this.options.tableCell!==!1&&e.push(TP.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(bP.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(yP.configure(this.options.tableRow)),e}});function R7(e){class t extends e{constructor(r,i,o,s){super(r,i),this.node=r,this.selected=!1,this.getPos=s,this.dom.dataset.nodeViewWrapper="",this.dom.classList.add("ipsRichText__table-wrapper");const a=document.createElement("div");a.appendChild(this.dom),this.dom=a,a.classList.add("ipsEditor__table-wrapper"),this.contentDOM.dataset.nodeViewContent="",this.arrowIndicators=this.dom.appendChild(document.createElement("div")),this.arrowIndicators.classList.add("ipsEditor__create-sibling-wrapper"),this.arrowIndicatorButtons={},this.view=o;for(const l of["before","after"]){const u=this.arrowIndicators.appendChild(document.createElement("button"));this.arrowIndicatorButtons[l]=u,u.classList.add("ipsEditor__create-sibling",`ipsEditor__create-sibling--${l}`),u.dataset.ipstooltip="",u.setAttribute("title",window.ips.getString(l==="before"?"editor_insert_line_before":"editor_insert_line_after")),u.setAttribute("type","button"),u.addEventListener("mouseover",f=>{f.preventDefault(),f.stopImmediatePropagation(),f.stopPropagation()},{capture:!0}),u.appendChild(document.createElement("i")).classList.add("fa-solid","fa-turn-down")}Wc.has(o)||Wc.set(o,new Set),Wc.get(o).add(this)}createSibling(r=!0){const i=NP.get(this.view.dom);if(!i)return;const o=this.node.nodeSize||2,s=this.getPos();if(typeof s=="number"){const a=r?s+1:s+o+1;i.commands.insertContentAt(r?s:s+o,"<p></p>"),setTimeout(()=>{i.chain().setTextSelection(a).focus().run()},10)}}update(r){return super.update(r),!0}$handleSele
Line truncated
|
||||
`},renderMarkdown:()=>`
|
||||
`,parseMarkdown:()=>({type:"hardBreak"}),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:d})=>{if(d&&l&&s){const f=l.filter(_=>a.includes(_.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ff=st.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||||
|
||||
`):""});const IP=je.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.initial=this.editor.getHTML(),(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"),i=ml.fromSchema(this.editor.state.schema).parse(r.body).toJSON(),o=wP(i)?null:Vl(br.fromJSON(this.editor.state.schema,i).content,this.editor.state.schema);o&&o!==this.editor.getHTML()&&this.editor.chain().setContent(i).showMessage("autosave").focus().run()}this.storage.updateCallback=gn.debounce(()=>{var r;(r=this.editor)!=null&&r.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)}},addStorage(){return{initial:"",updateCallback:()=>{}}}});function wP(e){var t,n,r;return e.textContent==="<p></p>"?!0:!((t=e.textContent)!=null&&t.trim().length||![Ff.name,Ht.name,Ri.name,nd.name].includes(e.type.name)||(r=(n=e.content)==null?void 0:n.content)!=null&&r.length&&!e.content.content.some(i=>!wP(i)))}function $7(){const{editor:e}=L.useContext(xe);return v.jsxs(v.Fragment,{children:[window.ips.getString("editor_tool--autosave-message-before")," ",v.jsx("button",{className:"ipsEditor__autosave-clear",onClick:()=>e.chain().clearAutosave().setContent(e.storage[IP.name].initial||"").focus().run(),children:window.ips.getString("editor_tool--autosave-message-inner")}),window.ips.getString("editor_tool--autosave-message-after")]})}function Y7({positions:e="",href:t}){const{editor:n}=L.useContext(xe),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 v.jsxs(v.Fragment,{children:[window.ips.getString("editor_tool--autoembed-message-before"),v.jsx("button",{className:"ipsEditor__autosave-clear",onClick:r,children:window.ips.getString("editor_tool--autoembed-message-inner")}),window.ips.getString("editor_tool--autoembed-message-after")]})}function H7(){const{editor:e}=L.useContext(xe),t=()=>{if(!e.storage[Ke.name].autolinked){e.commands.hideMessage("autolink");return}const n=e.storage[Ke.name].autolinked,{from:r,to:i}=e.state.selection;e.chain().setTextSelection({from:n.from,to:n.to}).unsetMark(Ke.name).setTextSelection({from:r,to:i}).focus().hideMessage("autolink").run()};return v.jsxs(v.Fragment,{children:[window.ips.getString("editor_tool--autolink-message-before"),v.jsx("button",{className:"ipsEditor__autosave-clear",onClick:t,children:window.ips.getString("editor_tool--autolink-message-inner")}),window.ips.getString("editor_tool--autolink-message-after")]})}function NI({name:e}){const{editor:t}=L.useContext(xe);return v.jsxs("div",{className:`ipsEditor__global-message ipsEditor__global-message--${e}`,children:[v.jsxs("div",{className:"ipsEditor__global-message-content",children:[v.jsx("i",{className:"fa-solid fa-circle-info"})," ",v.jsx(z7,{name:e})]}),v.jsx("button",{className:"ipsEditor__global-message-close",onClick:()=>t==null?void 0:t.commands.hideMessage(e),children:v.jsx("i",{className:"fa-solid fa-times-circle"})})]})}function z7({name:e}){const{messages:t}=L.useContext(PT),n=t.get(e);switch(e){case"autosave":return v.jsx($7,{});case"autoembed":return v.jsx(Y7,{...n});case"autolink":return v.jsx(H7,{});default:return typeof n=="string"&&n?v.jsx("span",{"data-ipseditorcustommessage":"true",dangerouslySetInnerHTML:{__html:n}}):v.jsx(v.Fragment,{children:"This is a global message!"})}}const PT=L.createContext({messages:new Map,addMessage(e,t=""){this.messages.set(e,t)},removeMessage(e){this.messages.has(e)&&this.messages.delete(e)}});function V7({children:e}){var l;const[t,n]=L.useState(()=>new Map),[r,i]=L.useState(!1),{editor:o}=L.useContext(xe),s=L.useMemo(()=>({messages:t,addMessage:(u,d="")=>{if(!t.has(u)||t.get(u)!==d){t.set(u,d);const f=new Map;for(const[_,m]of t.entries())f.set(_,m);n(f)}},removeMessage:u=>{if(t.has(u)){t.delete(u);const d=new Map;for(const[f,_]of t.entries())d.set(f,_);n(d)}},onVisibilityChange(u=!1){u!==r&&i(u)},visible:r}),[t,n,r,i]);if(L.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)retuLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(n),!0).forEach(function(r){eJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function qc(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function im(e){return{}.toString.call(e).includes("Object")}function nJ(e){return!Object.keys(e).length}function rd(e){return typeof e=="function"}function rJ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function iJ(e,t){return im(t)||ds("changeType"),Object.keys(t).some(function(n){return!rJ(e,n)})&&ds("changeField"),t}function oJ(e){rd(e)||ds("selectorType")}function sJ(e){rd(e)||im(e)||ds("handlerType"),im(e)&&Object.values(e).some(function(t){return!rd(t)})&&ds("handlersType")}function aJ(e){e||ds("initialIsRequired"),im(e)||ds("initialType"),nJ(e)&&ds("initialContent")}function lJ(e,t){throw new Error(e[t]||e.default)}var cJ={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ds=qc(lJ)(cJ),ff={changes:iJ,selector:oJ,handler:sJ,initial:aJ};function uJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ff.initial(e),ff.handler(t);var n={current:e},r=qc(fJ)(n,t),i=qc(pJ)(n),o=qc(ff.changes)(e),s=qc(dJ)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ff.selector(u),u(n.current)}function l(u){tJ(r,i,o,s)(u)}return[a,l]}function dJ(e,t){return rd(t)?t(e.current):t}function pJ(e,t){return e.current=xI(xI({},e.current),t),t}function fJ(e,t,n){return rd(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var _J={create:uJ},mJ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function gJ(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function hJ(e){return{}.toString.call(e).includes("Object")}function EJ(e){return e||DI("configIsRequired"),hJ(e)||DI("configType"),e.urls?(SJ(),{paths:{vs:e.urls.monacoBase}}):e}function SJ(){console.warn(xP.deprecation)}function TJ(e,t){throw new Error(e[t]||e.default)}var xP={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||||
You are using deprecated way of configuration.
|
||||
|
||||
Instead of using
|
||||
monaco.config({ urls: { monacoBase: '...' } })
|
||||
use
|
||||
monaco.config({ paths: { vs: '...' } })
|
||||
|
||||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||||
`},DI=gJ(TJ)(xP),bJ={config:EJ},yJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function DP(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],DP(e[n],t[n]))}),AI(AI({},e),t)}var CJ={type:"cancelation",msg:"operation is manually canceled"};function PE(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(CJ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var vJ=_J.create({config:mJ,isInitialized:!1,resolve:null,reject:null,monaco:null}),MP=Q7(vJ,2),bd=MP[0],zm=MP[1];function RJ(e){var t=bJ.config(e),n=t.monaco,r=K7(t,["monaco"]);zm(function(i){return{config:DP(i.config,r),monaco:n}})}function NJ(){var e=bd(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(zm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),PE(BE);if(window.monaco&&window.monaco.editor)return LP(window.monaco),e.resolve(window.monaco),PE(BE);yJ(OJ,IJ)(wJ)}return PE(BE)}function OJ(e){return document.body.appendChild(e)}function AJ(e){var t=document.createElement("script");return e&&(t.src=e),t}function IJ(e){var t=bd(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=AJ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function wJ(){var e=bd(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){LP(n),e.resolve(n)},function(n){e.reject(n)})}function LP(e){bd().monaco||zm({monaco:e})}function xJ(){return bd(function(e){var t=e.monaco;return t})}var BE=new Promise(function(e,t){return zm({resolve:e,reject:t})}),om={config:RJ,init:NJ,__getMonacoInstance:xJ},DJ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},FE=DJ,MJ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},LJ=MJ;function kJ({children:e}){return rr.createElement("div",{style:LJ.container},e)}var PJ=kJ,BJ=PJ;function FJ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return rr.createElement("section",{style:{...FE.wrapper,width:e,height:t},...s},!n&&rr.createElement(BJ,null,r),rr.createElement("div",{ref:i,style:{...FE.fullWidth,...!n&&FE.hide},className:o}))}var UJ=FJ,kP=L.memo(UJ);function GJ(e){L.useEffect(e,[])}var PP=GJ;function $J(e,t,n=!0){let r=L.useRef(!0);L.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var hr=$J;function _u(){}function ll(e,t,n,r){return YJ(e,r)||HJ(e,t,n,r)}function YJ(e,t){return e.editor.getModel(BP(e,t))}function HJ(e,t,n,r){return e.editor.createModel(t,n,r?BP(e,r):void 0)}function BP(e,t){return e.Uri.parse(t)}function zJ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:d="Loading...",options:f={},height:_="100%",width:m="100%",className:h,wrapperProps:E={},beforeMount:T=_u,onMount:S=_u}){let[y,C]=L.useState(!1),[O,N]=L.useState(!0),w=L.useRef(null),x=L.useRef(null),D=L.useRef(null),z=L.useRef(S),P=L.useRef(T),oe=L.useRef(!1);PP(()=>{let q=om.init();return q.then($=>(x.current=$)&&N(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>w.current?se():q.cancel()}),hr(()=>{if(w.current&&x.current){let q=w.current.getOriginalEditor(),$=ll(x.current,e||"",r||n||"text",o||"");$!==q.getModel()&&q.setModel($)}},[o],y),hr(()=>{if(w.current&&x.current){let q=w.current.getModifiedEditor(),$=ll(x.current,t||"",i||n||"text",s||"");$!==q.getModel()&&q.setModel($)}},[s],y),hr(()=>{let q=w.current.getModifiedEditor();q.getOption(x.current.editor.EditorOption.readOnly)?q.setValue(t||""):t!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[t],y),hr(()=>{var q,$;($=(q=w.current)==null?void 0:q.getModel())==null||$.original.setValue(e||"")},[e],y),hr(()=>{let{original:q,modified:$}=w.current.getModel();x.current.editor.setModelLanguage(q,r||n||"text"),x.current.editor.setModelLanguage($,i||n||"text")},[n,r,i],y),hr(()=>{var q;(q=x.current)==null||q.editor.setTheme(u)},[u],y),hr(()=>{var q;(q=w.current)==null||q.updateOptions(f)},[f],y);let _e=L.useCallback(()=>{var F;if(!x.current)return;P.current(x.current);let q=ll(x.current,e||"",r||n||"text",o||""),$=ll(x.current,t||"",i||n||"text",s||"");(F=w.current)==null||F.setModel({original:q,modified:$})},[n,t,i,e,r,o,s]),le=L.useCallback(()=>{var q;!oe.current&&D.current&&(w.current=x.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...f}),_e(),(q=x.current)==null||q.editor.setTheme(u),C(!0),oe.current=!0)},[f,u,_e]);L.useEffect(()=>{y&&z.current(w.cur
Line truncated
|
||||
${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(){return[ate({mimeTypes:this.options.allowedMimeTypes,handler:e=>this.options.onPaste(this.editor,e)})]}}).configure({onPaste(e,t){return e.commands.injectAttachments(t)},onDrop(e,t){return e.commands.injectAttachments(t)}});class cte extends Event{constructor(t){super("injectFile"),this.data=t}}const ute=["name","group","isInline","isBlock","isText","content","isLeaf","selectable","exitable","atom","addOptions","addKeyboardShortcuts","addAttributes","addGlobalAttributes","addStorage","addCommands","renderHTML","parseHTML","onCreate","onUpdate","onBeforeCreate","onFocus","onBlur","onBeforeCreate","onSelectionUpdate","onDestroy","onTransaction","priority","defaultOptions","addInputRules","addPasteRules","addProseMirrorPlugins","marks","addNodeView","whitespace","defining","isolating","renderText"];function dte(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,je):e.ipsPlugins.extensions=[],Array.isArray((l=e.ipsPlugins)==null?void 0:l.nodes)?s(e.ipsPlugins.nodes,st):e.ipsPlugins.nodes=[],Array.isArray((u=e.ipsPlugins)==null?void 0:u.marks)?s(e.ipsPlugins.marks,Hn):e.ipsPlugins.marks=[],e.ipsPlugins.nestedToolbars={},e.pluginButtonKeys=new Set;const n=new Set(e.tools.toolbar);for(const d in e.ipsPlugins.buttons)for(const{before:f,after:_}of e.ipsPlugins.buttons[d].locations){let m,h=!1;if(typeof _=="string"&&_ in iI){const E=iI[_];e.ipsPlugins.nestedToolbars[E]=e.ipsPlugins.nestedToolbars[E]||[...hs[E]],e.ipsPlugins.nestedToolbars[E].push(`custom:${d}`),h=!0}else if(typeof _=="string"&&n.has(_))m=e.tools.toolbar.indexOf(_)+1;else if(typeof f=="string"&&n.has(f))m=e.tools.toolbar.indexOf(f);else if(!f&&!_||f===null||_===null)m=e.tools.toolbar.length;else continue;e.pluginButtonKeys.add(`custom:${d}`),h||(n.add(`custom:${d}`),e.tools.toolbar.splice(m,0,`custom:${d}`))}function r(d){for(const f of d.attributes)["class","style","id","src","title","rel","alt"].includes(f.name.toLowerCase())||d.removeAttribute(f.name);for(const f of d.querySelectorAll(":scope > *"))r(f)}function i(d,f){var _;if(d.addButtons instanceof Function){const m=d.addButtons.bind(f)();if(typeof m!="object")throw new TypeError;const h=new DOMParser;for(const E in m){let{html:T,command:S,locations:y,element:C,isActive:O,isAvailable:N}=m[E];if(typeof T!="string"&&!(C instanceof HTMLElement)||!(S instanceof Function)||!Array.isArray(y))throw new TypeError;O!==void 0&&typeof O!="boolean"&&!(O instanceof Function)&&(window.Debug.warn(`Expected isActive to be a boolean or a Function, got a ${typeof O}. Casting to boolean.`),O=!!O),N!==void 0&&typeof N!="boolean"&&!(N instanceof Function)&&(window.Debug.warn(`Expected isAvailable to be a boolean or a Function, got a ${typeof N}. Casting to boolean.`),N=!!N);const w=[];for(const P of y)if(P===null)w.push({after:null,before:void 0});else if(typeof P=="object"){if(![void 0,null].includes(P.before)&&typeof P.before!="string"||![void 0,null].includes(P.after)&&typeof P.after!="string")throw new TypeError;w.push({after:P.after,before:P.before})}else typeof P=="string"?w.push({after:P,before:void 0}):w.push({after:void 0,before:void 0});y=w;const x=["script","link","style","pre","code","iframe","object","embed","noscript","video"];if(C instanceof Element)C.querySelectorAll(x.join(",")).forEach(P=>P.remove());else{const P=h.parseFromString(T,"text/html");if(!(P instanceof Document))throw new RangeError("The html passed in for the button is not readable");if(P.querySelectorAll(x.join(",")).forEach(oe=>oe.remove()),!(((_=P==null?void 0:P.body)==null?void 0:_.firstElementChild)instanceof HTMLElement)||!P.body.firstElementChild.innerHTML.length)throw new RangeError("The html passed in for the button is not readable");C=P.body.firstElementChild}if(r(C),x.includes(C.tagName.toLowerCase()))throw new RangeError(`The element of type ${C.tagName} cannot be used as a toolbar button`);const D=C.cloneNode(!0),z=`${d.name}_${E}`;e.ipsPlugins.buttons[z]={get element(){return D},set element(P){throw new Error("Cannot update the element of an ipsPlugin button!")},get command(){return S.bind(f)},set command(P){throw new Error("Cannot update the command of an ipsPlugin button!")},get isActive(){return O instanceof Function?O.bind(f):O},set isActive(P){throw new Error("Cannot update the isActive property of an ipsPlugin button!")},get isAvailable(){return N instanceof Function?N.bind(f):N},set isAvailable(P){throw new Error("Cannot update the isAvailable property of an ipsPlugin button!")},get locations(){return y},set locations(P){throw new Error("Cannot update properties of ipsPlugin buttons")}}}delete d.addButtons}}function o(d){for(const f of Object.
Line truncated
|
||||
${m.message}`,window.Debug.warn(m)}}}const YE=je.create({name:"ipsHomeEnd",addKeyboardShortcuts(){return{Home:({editor:e})=>(Qt(()=>{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)===nd.name)break;r--}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'Home' key press"),!0),End:({editor:e})=>(Qt(()=>{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)===nd.name)break;r++}e.chain().setTextSelection(r).focus().run()},"Something went wrong handling the 'End' key press"),!0)}}}),pte=je.create({name:"IPSSimpleRichText",addProseMirrorPlugins(){return[new Fe({key:new $e("ipsSimpleRichTextPlugin"),filterTransaction:e=>!(this.editor.options.lengthFunction instanceof Function&&typeof this.editor.options.maxLength=="number"&&this.editor.options.lengthFunction(Vl(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 d,f;if(typeof l.textContent=="string"&&!l.textContent&&!l.isInline){const _=n.doc.resolve(u),m=fte(_,n.doc),h=_te(_,n.doc);if([o,s].some(E=>m.pos<E&&h.pos>E)){if(i===void 0&&e.some(E=>{var T;return(T=E.steps)==null?void 0:T.length})){let E=1,T=l;for(;(f=(d=T.content)==null?void 0:d.content)!=null&&f.length;)E++,T=T.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=be.atStart(n.doc).from,u=be.atEnd(n.doc).to,d=be.create(n.doc,Qo(i,l,u));o===d.from&&o===s||a.setSelection(d)}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(ju.name)?e.commands.splitListItem(ju.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 fte(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 _te(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 mte=je.create({name:"ipsClearNewLine",addOptions(){return{removeNewLinesBefore:[]}},addStorage(){return{observedNodes:[Mt.name,cr.name,io.name,fo.name,$y.name,ot.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,d,f;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!==Ht.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||((d=n.$from.nodeAfter)==null?void 0:d.type.name)!==nd.name||!t.includes((f=r.content.content[n.$from.parentOffset+1])==null?void 0:f.type.name))return;const _=i[1];let m;if(_!==0){if(!t.includes(r.content.content[_-1]))return;m=n.from-r.content.content[_-1].nodeSize}else{const h=i[5],E=i[4],T=h.type.name===io.name?1:0;E>T&&t.includes(h.content.content[E-1].type.name)&&(m=i[3]-h.content.content[E-1].nodeSize)}return(typeof m!="number"||Number.isNaN(m))&&(m=n.from),e.chain().deleteRange({from:n.from,to:n.from+1}).setNodeSelection(m).run(),!0}else{const _=i[5],m=i[4];if(!_||m===void 0)return;const h=_.content.content[m+1];if(!h||!(h.type.name===Ht.name&&h.content.content.length===1&&t.includes((o=h.content.content[0])==null?void 0:o.type.name)||t.includes(h.type.name)))return;const E=_.type.name===io.name?1:0;if(m>E&&!t.includes(_.content.content[m-1].type.name))return;const T=i[3];let S=m>E?T-_.content.content[m-1].nodeSize:m;return Number.isNaN(S)&&(window.Debug.warn(new RangeError(`The position following an empty line deletion couldn't be determined. Most likely, the previous sibling's position cannot be determined. (Prev sib size: ${(s=_.content.content[m])==null?void 0:s.nodeSize}; current parent pos: ${T})`)),S=n.from,Number.isNaN(S))?void 0:(S>=n.from&&h.type.name===Ht.name&&h.content.content.length===1&&t.includes((a=h==null?void 0:h.content.content[0])==null?void 0:a.type.name)&&S++,e.chain().deleteRange({from:T,to:T+r.nodeSize}).setNodeSelection(S).run(),!0)}},Escape:()=>{if(this.editor.state.selection.empty&&zy(this.editor.state.selection.$from,this.editor.state).size)return this.editor.chain().stronglyRemoveAllMarks().focus().run(),!0}}},addComma
Line truncated
|
||||
`);return n.chain().insertContentAt({from:a,to:h},{type:Mt.name,attrs:f,content:[{type:"text",text:E}]}).setNodeSelection(a)}}}}),hte=st.create({name:"IPSLazyLoadLegacy",parseHTML(){return[{tag:"*",getAttrs:e=>(window.ips.utils.lazyload.parseLazyLoadElements(e,!1),!1)}]},renderHTML(){return window.Debug.warn("The IPSLazyLoadLegacy node fixer is being rendered as HTML, but should never exist in the ProseMirror Node tree. This will create one empty <i-lazy-load-dummy-element> wrapper"),["i-lazy-load-dummy-element",0]},priority:1e4}),Vm=[[/(\{\{)(?=[^\n]*}})/,[{token:"delimiter",next:"@ipsTemplateTag"}]],[/(\{)([a-zA-Z0-9-]+)(=)(?=[^\n]*})/,["delimiter","attribute.name",{token:"delimiter",next:"@ipsPlugin"}]],[/(\{)(\$)(?=[a-zA-Z][^\n]*})/,["delimiter",{token:"symbol",goBack:2,next:"@ipsTemplateVar"}]]],Ete=Vm.map(([e])=>{const t=e.toString().replace(/^\//,"").replace(/\/[a-z0-9]*$/,"");return t.match(/^\((\?[:=!])?\\\{/)?t.replace(/^\((\?[:=!])?\\\{/,"($1").replace(/^\((\?[:=!])?\)/,""):!1}).filter(e=>typeof e=="string"),qP={ipsRoot:[...Vm],ipsPlugin:[[/(})/,{token:"delimiter",next:"@pop"}],[/(")/,{token:"attribute.value",next:"@ipsPlugin_nestedPHP_dq",nextEmbedded:"phpSimplified"}],[/(')/,{token:"attribute.value",next:"@ipsPlugin_nestedPHP_sq",nextEmbedded:"phpSimplified"}],[/([a-zA-Z0-9-_]+)(=)/,["attribute.name","delimiter"]],[/\s/],[/./,{token:"@rematch",next:"@pop"}]],ipsPlugin_nestedPHP_dq:[[/(})/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/(")/,{token:"attribute.value",next:"@pop",nextEmbedded:"@pop"}],{include:"@ipsTemplateKeywords"},[/[^}"]+/]],ipsPlugin_nestedPHP_sq:[[/(})/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/(')/,{token:"attribute.value",next:"@pop",nextEmbedded:"@pop"}],{include:"@ipsTemplateKeywords"},[/[^}']+/]],ipsTemplateTag:[[/(if|else|elseif|endif|foreach|endforeach)/,{token:"keyword",next:"@ipsTemplateTag_inner",nextEmbedded:"phpSimplified"}],[/(}})/,[{token:"delimiter",next:"@pop"}]],[/(.)/,{token:"",goBack:1,next:"@ipsTemplateTag_inner",nextEmbedded:"phpSimplified"}]],ipsTemplateTag_inner:[[/(}})/,{token:"delimiter",next:"@pop",nextEmbedded:"@pop",goBack:2}],{include:"@ipsTemplateKeywords"},[/[^}]*|}(?!})/]],ipsTemplateVar:[[/(})/,{token:"delimiter",next:"@pop"}],[/(\|)([a-zA-Z0-9_-]+)([^|}a-zA-Z0-9_-])/,["delimiter","keyword",{token:"",goBack:1,next:"@pop"}]],[/(\|)([a-zA-Z0-9_-]+)/,[{token:"delimiter"},{token:"keyword"}]],[/(\|)/,"delimiter"],[/(\{\$)/,{token:"",goBack:1,next:"@ipsTemplateVar_inner",nextEmbedded:"phpSimplified"}],[/(.)/,{token:"@rematch",next:"@pop",goBack:1}]],ipsTemplateVar_inner:[[/([|}])/,{token:"",next:"@pop",nextEmbedded:"@pop",goBack:1}],[/[^|}]+/]],ipsTemplateKeywords:[[/(member|request|setting|cookie)(\.)(?=[a-zA-Z_])*/,["constant.php","delimiter.php"]]]};function tr(e){if(["string","number","boolean","symbol"].includes(typeof e)||[null,void 0,Number.NaN].includes(e))return e;if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(t=>tr(t));if(typeof e=="object"){const t={};for(const n in e)t[n]=tr(e[n]);return t}return e}function Ste(e){e=tr(e);const t=e.loader;let n,r=!1,i=new Set;return e.loader=async()=>{if(n)return n;if(r)return await new Promise(s=>i.add(s));r=!0;let o=await(t==null?void 0:t())||{conf:{},language:{tokenizer:{}}};o=tr(o),o.language.languageId=e.id;for(const s of["tokenizer"]){if(!o.language[s])continue;const a={};for(const l in o.language[s]){const u=[];o.language[s][l].forEach(d=>{if(Array.isArray(d)&&d.length>=1&&d[0]instanceof RegExp){const f=d[0].toString().replace(/^\//,"").replace(/\/[a-z]*$/,""),_=/(^|[^\\])(\[\^)([^{]*?[^\\{])(])(\+\??|\*)?/g,m=f.replaceAll(_,(...h)=>{var T;let E=h[2]+h[3]+h[4]+h[5];return(T=h[3])!=null&&T.includes("{")||(E="(?:\\{[^"+h[3]+"{]*|[^"+h[3]+"{]"+h[5]+")"),h[1]+E});if(m!==f){const h=QP(d);h&&(u.push(h.newRule),Object.assign(a,h.scopes)),u.push([new RegExp(`${m}`,d[0].flags),...tr(d.slice(1))]);return}}u.push(d)}),o.language[s][l]=u,o.language[s][l].splice(0,0,...tr(Vm))}Object.assign(o.language[s],a),Object.assign(o.language[s],qP),o.language.tokenPostfix=".phtml"}return delete o.language.stateNames,o.conf.brackets=o.conf.brackets||o.language.brackets||[],o.conf.brackets.some(s=>Array.isArray(s)&&s[0]==="{"&&s[1]==="}"||!Array.isArray(s)&&s.open==="{"&&s.close==="}")||o.conf.brackets.push(["{","}"]),o.conf.brackets.some(s=>Array.isArray(s)&&s[0]==="{{"&&s[1]==="}}"||!Array.isArray(s)&&s.open==="{{"&&s.close==="}}")||o.conf.brackets.push(["{{","}}"]),n=o,r=!1,setTimeout(()=>{i.forEach(s=>s(n)),i.clear()}),n},e}const KP={"(":")","(?:":")","[":"]","{":"}"};function VI(e=""){var u;let t,n=[],r=0,i=0,o=0,s=!0,a=[],l=!1;for(;(t=e.slice(r).match(/[\[\]{})]|\((?:\?[!=:])?/))&&t;){let d=e.slice(r,r+t.index);if(r+=t.index+t.length,(((u=d.match(/\\+$/))==null?void 0:u[0].length)||0)%2){(!n.length||n[n.length-1].bracket!=="{")&&(s=!1);continue}if(!l&&!n.some(({bracket:f})=>f==="(")&&(l=!0),n.length&&n[n.length-1].bracket==="["&&t[0]!=="]"){s=!1;continue}if(!(n.leng
Line truncated
|
||||
`}}),...(_=e.restrictions)!=null&&_.has("tables")?[!1]:[RP.configure({resizable:!0,cellMinWidth:((m=e.table)==null?void 0:m.cellMinWidth)||20}),yP,bP,TP],OP,mte,$ee.configure({class:"ipsEditor__drop-cursor",width:3})].filter(C=>!!C);return window.navigator.platform==="MacIntel"&&t.push(YE),e.autoSaveKey&&t.push(IP),e.postkey&&(t.push(lte),t.push(ot.configure({externalImages:!((h=e.restrictions)!=null&&h.has("external_image")),externalVideos:!((E=e.restrictions)!=null&&E.has("external_video")),float:!((T=e.restrictions)!=null&&T.has("float"))}))),(S=e.restrictions)!=null&&S.has("heading")||t.push(Yr.configure({levels:(y=e.restrictions)!=null&&y.has("heading_1")?[2,3,4,5,6]:[1,2,3,4,5,6]})),t.push(hte),t}async function WI(e,t){var n,r,i,o,s;if(await Qk(),e.pluginButtonKeys=new Set,e.simpleRichText?(delete e.codeMode,e.tools={toolbar:[...cP]},e.react&&XK(e.react)):await MA(),e.restrictions&&Symbol.iterator in e.restrictions?e.restrictions=new Set(e.restrictions):(delete e.restrictions,e.restrictions=new Set),e.jQuery=e.jQuery||window.jQuery,e.editorProps={attributes:{class:e.codeMode?"":"ipsRichText"}},e.itemStates={},e.restrictions.has("native_emoji")&&!e.restrictions.has("custom_emoji")&&!await window.ips.utils.iconpicker.hasCustomEmoji()&&e.restrictions.add("custom_emoji"),e.supportedTextColors&&Object.getPrototypeOf(e.supportedTextColors)===Object.prototype)for(const a in e.supportedTextColors)e.supportedBoxColors=e.supportedBoxColors&&Object.getPrototypeOf(e.supportedBoxColors)===Object.prototype?e.supportedBoxColors:{},!(a in e.supportedBoxColors)&&(e.supportedBoxColors[a]=e.supportedTextColors[a]);if(e.extensions=await Tte(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){for(e.tools={toolbar:["codelanguage"]},await MA(),((i=window.ips)==null?void 0:i.getSetting)instanceof Function&&om.config({paths:{vs:window.ips.getSetting("monaco-vs-root")||new URL(window.ips.getSetting("baseURL"),window.location.href).toString().replace(/\/+$/,"")+"/applications/core/interface/static/tiptap/monaco/vs"}});(o=e.allowedLanguages)!=null&&o.includes("txt");)e.allowedLanguages.splice(e.allowedLanguages.indexOf("txt"),1,"plaintext");const a=[],l=await om.init();if((!!e.hasTags||["ipsphtml","ipscss","ipsplaintext"].some(d=>{var f;return(f=e.allowedLanguages)==null?void 0:f.includes(d)}))&&((s=e.allowedLanguages)!=null&&s.length||(e.allowedLanguages=["plaintext"]),[["html","ipsphtml"],["css","ipscss"],["plaintext","ipsplaintext"]].forEach(([d,f])=>{var _;for(;(_=e.allowedLanguages)!=null&&_.includes(d);)e.allowedLanguages.splice(e.allowedLanguages.indexOf(d),1,...e.allowedLanguages.includes(f)?[]:[f])})),[["html","ipsphtml"],["css","ipscss"],["plaintext","ipsplaintext"]].forEach(([d,f])=>{var _;if((_=e.allowedLanguages)!=null&&_.includes(f)){const m=l.languages.getLanguages().find(E=>E.id===d),h=Ste({...m,id:f,aliases:void 0,mimetypes:[],extensions:[]});for(a.push(h);e.allowedLanguages.includes(d);)e.allowedLanguages.splice(e.allowedLanguages.indexOf(d),1)}}),a.length){const d=l.languages.getLanguages().find(E=>E.id==="php");let f,_,m=new Set;const h={...d,id:"phpSimplified",aliases:void 0,mimetypes:[],extensions:[],loader:async()=>{if(f)return f;if(_)return new Promise(T=>m.add(T));_=!0;const E=tr(await d.loader());return E.language.languageId="phpSimplified",E.language.tokenizer={phpRoot:E.language.tokenizer.phpRoot,...E.language.tokenizer},E.language.tokenizer.phpRoot.splice(0,0,...tr(qP.ipsTemplateKeywords)),E.language.tokenizer.root.splice(0,0,{include:"phpRoot"}),f=E,setTimeout(()=>{m.forEach(T=>{try{T(f)}catch(S){console.error(S)}}),m.clear()}),f}};a.splice(0,0,h),a.forEach(E=>{l.languages.register(E),l.languages.registerTokensProviderFactory(E.id,{create:async()=>(await E.loader()).language}),l.languages.onLanguageEncountered(E.id,async()=>{l.languages.setLanguageConfiguration(E.id,(await E.loader()).conf)})})}return e}if(e.simpleRichText||dte(e,e.extensions),e.stockrepliesenabled&&((await tm.getStore()).length?window.Debug.log("Loaded stock replies"):(e.stockrepliesenabled=!1,window.Debug.log("No stock replies, disabling the button"))),!e.codeMode){for(const a in e.tools)e.tools[a]=e.tools[a].filter(l=>l==="giphy"&&!e.giphyenabled||l==="stockreply"&&!e.stockrepliesenabled?!1:!(e.hidebuttons instanceof Array&&e.hidebuttons.includes(l)));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(a=>a!=="block")]),e}let qI=!1;function bte(){if(!qI){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.preventDefau
Line truncated
|
||||
@@ -75,7 +75,7 @@
|
||||
"isDynamicEntry": true
|
||||
},
|
||||
"src/main.jsx": {
|
||||
"file": "assets/main-6RAkeGwz.js",
|
||||
"file": "assets/main-Hp4FYAlM.js",
|
||||
"name": "main",
|
||||
"src": "src/main.jsx",
|
||||
"isEntry": true,
|
||||
|
||||
Reference in new issue
Block a user