moreShopAdmin/build/admin/assets/highlight.js.31cd7941.js

5 lines
146 KiB
JavaScript
Raw Normal View History

2024-05-31 15:21:43 +08:00
function ct(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],s=typeof t;(s==="object"||s==="function")&&!Object.isFrozen(t)&&ct(t)}),n}class Nn{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function lt(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ue(n,...e){const t=Object.create(null);for(const s in n)t[s]=n[s];return e.forEach(function(s){for(const d in s)t[d]=s[d]}),t}const Tt="</span>",hn=n=>!!n.scope,vt=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((s,d)=>`${s}${"_".repeat(d+1)}`)].join(" ")}return`${e}${n}`};class Ot{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=lt(e)}openNode(e){if(!hn(e))return;const t=vt(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){!hn(e)||(this.buffer+=Tt)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const yn=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class _n{constructor(){this.rootNode=yn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=yn({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(s=>this._walk(e,s)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&(!e.children||(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{_n._collapse(t)})))}}class wt extends _n{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const s=e.root;t&&(s.scope=`language:${t}`),this.add(s)}toHTML(){return new Ot(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function he(n){return n?typeof n=="string"?n:n.source:null}function dt(n){return pe("(?=",n,")")}function Rt(n){return pe("(?:",n,")*")}function At(n){return pe("(?:",n,")?")}function pe(...n){return n.map(t=>he(t)).join("")}function Mt(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function mn(...n){return"("+(Mt(n).capture?"":"?:")+n.map(s=>he(s)).join("|")+")"}function ut(n){return new RegExp(n.toString()+"|").exec("").length-1}function It(n,e){const t=n&&n.exec(e);return t&&t.index===0}const Ct=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function En(n,{joinWith:e}){let t=0;return n.map(s=>{t+=1;const d=t;let o=he(s),i="";for(;o.length>0;){const r=Ct.exec(o);if(!r){i+=o;break}i+=o.substring(0,r.index),o=o.substring(r.index+r[0].length),r[0][0]==="\\"&&r[1]?i+="\\"+String(Number(r[1])+d):(i+=r[0],r[0]==="("&&t++)}return i}).map(s=>`(${s})`).join(e)}const kt=/\b\B/,gt="[a-zA-Z]\\w*",fn="[a-zA-Z_]\\w*",bt="\\b\\d+(\\.\\d+)?",pt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_t="\\b(0b[01]+)",xt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Dt=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=pe(e,/.*\b/,n.binary,/\b.*/)),ue({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,s)=>{t.index!==0&&s.ignoreMatch()}},n)},ye={begin:"\\\\[\\s\\S]",relevance:0},Lt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ye]},Bt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ye]},Ut={begin:/\b(a
https://github.com/highlightjs/highlight.js/issues/2277`),U=u,k=f),w===void 0&&(w=!0);const Y={code:k,language:U};B("before:highlight",Y);const ne=Y.result?Y.result:g(Y.language,Y.code,w);return ne.code=Y.code,B("after:highlight",ne),ne}function g(u,f,w,k){const U=Object.create(null);function Y(_,y){return _.keywords[y]}function ne(){if(!T.keywords){G.addText(P);return}let _=0;T.keywordPatternRe.lastIndex=0;let y=T.keywordPatternRe.exec(P),v="";for(;y;){v+=P.substring(_,y.index);const x=re.case_insensitive?y[0].toLowerCase():y[0],X=Y(T,x);if(X){const[se,Me]=X;if(G.addText(v),v="",U[x]=(U[x]||0)+1,U[x]<=pr&&(me+=Me),se.startsWith("_"))v+=y[0];else{const Ie=re.classNameAliases[se]||se;Z(y[0],Ie)}}else v+=y[0];_=T.keywordPatternRe.lastIndex,y=T.keywordPatternRe.exec(P)}v+=P.substring(_),G.addText(v)}function te(){if(P==="")return;let _=null;if(typeof T.subLanguage=="string"){if(!e[T.subLanguage]){G.addText(P);return}_=g(T.subLanguage,P,!0,ve[T.subLanguage]),ve[T.subLanguage]=_._top}else _=p(P,T.subLanguage.length?T.subLanguage:null);T.relevance>0&&(me+=_.relevance),G.__addSublanguage(_._emitter,_.language)}function z(){T.subLanguage!=null?te():ne(),P=""}function Z(_,y){_!==""&&(G.startScope(y),G.addText(_),G.endScope())}function q(_,y){let v=1;const x=y.length-1;for(;v<=x;){if(!_._emit[v]){v++;continue}const X=re.classNameAliases[_[v]]||_[v],se=y[v];X?Z(se,X):(P=se,ne(),P=""),v++}}function K(_,y){return _.scope&&typeof _.scope=="string"&&G.openNode(re.classNameAliases[_.scope]||_.scope),_.beginScope&&(_.beginScope._wrap?(Z(P,re.classNameAliases[_.beginScope._wrap]||_.beginScope._wrap),P=""):_.beginScope._multi&&(q(_.beginScope,y),P="")),T=Object.create(_,{parent:{value:T}}),T}function Q(_,y,v){let x=It(_.endRe,v);if(x){if(_["on:end"]){const X=new Nn(_);_["on:end"](y,X),X.isMatchIgnored&&(x=!1)}if(x){for(;_.endsParent&&_.parent;)_=_.parent;return _}}if(_.endsWithParent)return Q(_.parent,y,v)}function j(_){return T.matcher.regexIndex===0?(P+=_[0],1):(ce=!0,0)}function ee(_){const y=_[0],v=_.rule,x=new Nn(v),X=[v.__beforeBegin,v["on:begin"]];for(const se of X)if(!!se&&(se(_,x),x.isMatchIgnored))return j(y);return v.skip?P+=y:(v.excludeBegin&&(P+=y),z(),!v.returnBegin&&!v.excludeBegin&&(P=y)),K(v,_),v.returnBegin?0:y.length}function ie(_){const y=_[0],v=f.substring(_.index),x=Q(T,_,v);if(!x)return On;const X=T;T.endScope&&T.endScope._wrap?(z(),Z(y,T.endScope._wrap)):T.endScope&&T.endScope._multi?(z(),q(T.endScope,_)):X.skip?P+=y:(X.returnEnd||X.excludeEnd||(P+=y),z(),X.excludeEnd&&(P=y));do T.scope&&G.closeNode(),!T.skip&&!T.subLanguage&&(me+=T.relevance),T=T.parent;while(T!==x.parent);return x.starts&&K(x.starts,_),X.returnEnd?0:y.length}function oe(){const _=[];for(let y=T;y!==re;y=y.parent)y.scope&&_.unshift(y.scope);_.forEach(y=>G.openNode(y))}let ge={};function Se(_,y){const v=y&&y[0];if(P+=_,v==null)return z(),0;if(ge.type==="begin"&&y.type==="end"&&ge.index===y.index&&v===""){if(P+=f.slice(y.index,y.index+1),!d){const x=new Error(`0 width match regex (${u})`);throw x.languageName=u,x.badRule=ge.rule,x}return 1}if(ge=y,y.type==="begin")return ee(y);if(y.type==="illegal"&&!w){const x=new Error('Illegal lexeme "'+v+'" for mode "'+(T.scope||"<unnamed>")+'"');throw x.mode=T,x}else if(y.type==="end"){const x=ie(y);if(x!==On)return x}if(y.type==="illegal"&&v==="")return 1;if(de>1e5&&de>y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return P+=v,v.length}const re=C(u);if(!re)throw be(o.replace("{}",u)),new Error('Unknown language: "'+u+'"');const Te=dr(re);let _e="",T=k||Te;const ve={},G=new r.__emitter(r);oe();let P="",me=0,le=0,de=0,ce=!1;try{if(re.__emitTokens)re.__emitTokens(f,G);else{for(T.matcher.considerAll();;){de++,ce?ce=!1:T.matcher.considerAll(),T.matcher.lastIndex=le;const _=T.matcher.exec(f);if(!_)break;const y=f.substring(le,_.index),v=Se(y,_);le=_.index+v}Se(f.substring(le))}return G.finalize(),_e=G.toHTML(),{language:u,value:_e,relevance:me,illegal:!1,_emitter:G,_top:T}}catch(_){if(_.message&&_.message.includes("Illegal"))return{language:u,value:Ce(f),illegal:!0,relevance:0
`},m]}}return Ye=d,Ye}var Ze,Kn;function kr(){if(Kn)return Ze;Kn=1;const n=a=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.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:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["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"],t=["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"],s=["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"],d=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],o=["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-radiu
]`,m={scope:"string",variants:[c,l,g,b]},E={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},h=["false","null","true"],N=["__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"],O=["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"],M={keyword:N,literal:(W=>{const B=[];return W.forEach(V=>{B.push(V),V.toLowerCase()===V?B.push(V.toUpperCase()):B.push(V.toLowerCase())}),B})(h),built_in:O},A=W=>W.map(B=>B.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",A(O).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(d,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},C={scope:"attr",match:t.concat(d,t.lookahead(":"),t.lookahead(/(?!::)/))},H={relevance:0,begin:/\(/,end:/\)/,keywords:M,contains:[C,i,S,e.C_BLOCK_COMMENT_MODE,m,E,D]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",A(N).join("\\b|"),"|",A(O).join("\\b|"),"\\b)"),d,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[H]};H.contains.push(F);const J=[C,S,e.C_BLOCK_COMMENT_MODE,m,E,D],ae={begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...J]},...J,{