@tensorix/metahub 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/dist/cli.js +3755 -2524
  4. package/dist/cli.js.map +35 -32
  5. package/dist/core/databases.d.ts.map +1 -1
  6. package/dist/core/db.d.ts +7 -0
  7. package/dist/core/db.d.ts.map +1 -1
  8. package/dist/core/documents.d.ts +11 -0
  9. package/dist/core/documents.d.ts.map +1 -1
  10. package/dist/core/errors.d.ts +32 -0
  11. package/dist/core/errors.d.ts.map +1 -0
  12. package/dist/core/history.d.ts +86 -0
  13. package/dist/core/history.d.ts.map +1 -0
  14. package/dist/core/index.d.ts +1 -0
  15. package/dist/core/index.d.ts.map +1 -1
  16. package/dist/core/properties.d.ts.map +1 -1
  17. package/dist/core/records.d.ts.map +1 -1
  18. package/dist/core/resolve.d.ts.map +1 -1
  19. package/dist/core/schema.d.ts +1 -1
  20. package/dist/core/schema.d.ts.map +1 -1
  21. package/dist/core/sites.d.ts +21 -0
  22. package/dist/core/sites.d.ts.map +1 -1
  23. package/dist/core/snapshot.d.ts.map +1 -1
  24. package/dist/core/sync/client.d.ts.map +1 -1
  25. package/dist/core/sync/files.d.ts.map +1 -1
  26. package/dist/core/sync/openapi.d.ts +5 -2
  27. package/dist/core/sync/openapi.d.ts.map +1 -1
  28. package/dist/core/sync/pairing.d.ts.map +1 -1
  29. package/dist/core/sync/peers-routes.d.ts +1 -1
  30. package/dist/core/sync/peers-routes.d.ts.map +1 -1
  31. package/dist/core/sync/routes.d.ts +4 -0
  32. package/dist/core/sync/routes.d.ts.map +1 -1
  33. package/dist/core/sync/server.d.ts +14 -1
  34. package/dist/core/sync/server.d.ts.map +1 -1
  35. package/dist/core/sync/sites-routes.d.ts +1 -1
  36. package/dist/core/sync/sites-routes.d.ts.map +1 -1
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2547 -1574
  40. package/dist/index.js.map +25 -23
  41. package/dist/{core/sync/webui.d.ts → webui/server/assets.d.ts} +1 -5
  42. package/dist/webui/server/assets.d.ts.map +1 -0
  43. package/dist/webui/server/routes.d.ts +3 -0
  44. package/dist/webui/server/routes.d.ts.map +1 -0
  45. package/dist/webui.js +51 -51
  46. package/package.json +1 -1
  47. package/dist/core/sync/webui-routes.d.ts +0 -3
  48. package/dist/core/sync/webui-routes.d.ts.map +0 -1
  49. package/dist/core/sync/webui.d.ts.map +0 -1
package/dist/webui.js CHANGED
@@ -1,59 +1,59 @@
1
- var x1=Object.create;var{getPrototypeOf:j1,defineProperty:S8,getOwnPropertyNames:D1}=Object;var h1=Object.prototype.hasOwnProperty;function m1(Z){return this[Z]}var u1,E1,p1=(Z,J,Q)=>{var $=Z!=null&&typeof Z==="object";if($){var q=J?u1??=new WeakMap:E1??=new WeakMap,X=q.get(Z);if(X)return X}Q=Z!=null?x1(j1(Z)):{};let W=J||!Z||!Z.__esModule?S8(Q,"default",{value:Z,enumerable:!0}):Q;for(let F of D1(Z))if(!h1.call(W,F))S8(W,F,{get:m1.bind(Z,F),enumerable:!0});if($)q.set(Z,W);return W};var U0=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var c4=U0((P$,i4)=>{function k4(Z){if(Z instanceof Map)Z.clear=Z.delete=Z.set=function(){throw Error("map is read-only")};else if(Z instanceof Set)Z.add=Z.clear=Z.delete=function(){throw Error("set is read-only")};return Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach((J)=>{let Q=Z[J],$=typeof Q;if(($==="object"||$==="function")&&!Object.isFrozen(Q))k4(Q)}),Z}class nZ{constructor(Z){if(Z.data===void 0)Z.data={};this.data=Z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function R4(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Q9(Z,...J){let Q=Object.create(null);for(let $ in Z)Q[$]=Z[$];return J.forEach(function($){for(let q in $)Q[q]=$[q]}),Q}var j7="</span>",O4=(Z)=>{return!!Z.scope},D7=(Z,{prefix:J})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){let Q=Z.split(".");return[`${J}${Q.shift()}`,...Q.map(($,q)=>`${$}${"_".repeat(q+1)}`)].join(" ")}return`${J}${Z}`};class I4{constructor(Z,J){this.buffer="",this.classPrefix=J.classPrefix,Z.walk(this)}addText(Z){this.buffer+=R4(Z)}openNode(Z){if(!O4(Z))return;let J=D7(Z.scope,{prefix:this.classPrefix});this.span(J)}closeNode(Z){if(!O4(Z))return;this.buffer+=j7}value(){return this.buffer}span(Z){this.buffer+=`<span class="${Z}">`}}var _4=(Z={})=>{let J={children:[]};return Object.assign(J,Z),J};class tZ{constructor(){this.rootNode=_4(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Z){this.top.children.push(Z)}openNode(Z){let J=_4({scope:Z});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Z){return this.constructor._walk(Z,this.rootNode)}static _walk(Z,J){if(typeof J==="string")Z.addText(J);else if(J.children)Z.openNode(J),J.children.forEach((Q)=>this._walk(Z,Q)),Z.closeNode(J);return Z}static _collapse(Z){if(typeof Z==="string")return;if(!Z.children)return;if(Z.children.every((J)=>typeof J==="string"))Z.children=[Z.children.join("")];else Z.children.forEach((J)=>{tZ._collapse(J)})}}class b4 extends tZ{constructor(Z){super();this.options=Z}addText(Z){if(Z==="")return;this.add(Z)}startScope(Z){this.openNode(Z)}endScope(){this.closeNode()}__addSublanguage(Z,J){let Q=Z.root;if(J)Q.scope=`language:${J}`;this.add(Q)}toHTML(){return new I4(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function j9(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function S4(Z){return K9("(?=",Z,")")}function h7(Z){return K9("(?:",Z,")*")}function m7(Z){return K9("(?:",Z,")?")}function K9(...Z){return Z.map((Q)=>j9(Q)).join("")}function u7(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function sZ(...Z){return"("+(u7(Z).capture?"":"?:")+Z.map(($)=>j9($)).join("|")+")"}function T4(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function E7(Z,J){let Q=Z&&Z.exec(J);return Q&&Q.index===0}var p7=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function oZ(Z,{joinWith:J}){let Q=0;return Z.map(($)=>{Q+=1;let q=Q,X=j9($),W="";while(X.length>0){let F=p7.exec(X);if(!F){W+=X;break}if(W+=X.substring(0,F.index),X=X.substring(F.index+F[0].length),F[0][0]==="\\"&&F[1])W+="\\"+String(Number(F[1])+q);else if(W+=F[0],F[0]==="(")Q++}return W}).map(($)=>`(${$})`).join(J)}var i7=/\b\B/,g4="[a-zA-Z]\\w*",eZ="[a-zA-Z_]\\w*",x4="\\b\\d+(\\.\\d+)?",j4="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",D4="\\b(0b[01]+)",c7="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a7=(Z={})=>{let J=/^#![ ]*\//;if(Z.binary)Z.begin=K9(J,/.*\b/,Z.binary,/\b.*/);return Q9({scope:"meta",begin:J,end:/$/,relevance:0,"on:begin":(Q,$)=>{if(Q.index!==0)$.ignoreMatch()}},Z)},D9={begin:"\\\\[\\s\\S]",relevance:0},d7={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D9]},r7={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[D9]},l7={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/},FZ=function(Z,J,Q={}){let $=Q9({scope:"comment",begin:Z,end:J,contains:[]},Q);$.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let q=sZ("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 $.contains.push({begin:K9(/[ ]+/,"(",q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),$},n7=FZ("//","$"),t7=FZ("/\\*","\\*/"),s7=FZ("#","$"),o7={scope:"number",begin:x4,relevance:0},e7={scope:"number",begin:j4,relevance:0},ZJ={scope:"number",begin:D4,relevance:0},JJ={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D9,{begin:/\[/,end:/\]/,relevance:0,contains:[D9]}]},QJ={scope:"title",begin:g4,relevance:0},zJ={scope:"title",begin:eZ,relevance:0},$J={begin:"\\.\\s*"+eZ,relevance:0},qJ=function(Z){return Object.assign(Z,{"on:begin":(J,Q)=>{Q.data._beginMatch=J[1]},"on:end":(J,Q)=>{if(Q.data._beginMatch!==J[1])Q.ignoreMatch()}})},XZ=Object.freeze({__proto__:null,APOS_STRING_MODE:d7,BACKSLASH_ESCAPE:D9,BINARY_NUMBER_MODE:ZJ,BINARY_NUMBER_RE:D4,COMMENT:FZ,C_BLOCK_COMMENT_MODE:t7,C_LINE_COMMENT_MODE:n7,C_NUMBER_MODE:e7,C_NUMBER_RE:j4,END_SAME_AS_BEGIN:qJ,HASH_COMMENT_MODE:s7,IDENT_RE:g4,MATCH_NOTHING_RE:i7,METHOD_GUARD:$J,NUMBER_MODE:o7,NUMBER_RE:x4,PHRASAL_WORDS_MODE:l7,QUOTE_STRING_MODE:r7,REGEXP_MODE:JJ,RE_STARTERS_RE:c7,SHEBANG:a7,TITLE_MODE:QJ,UNDERSCORE_IDENT_RE:eZ,UNDERSCORE_TITLE_MODE:zJ});function XJ(Z,J){if(Z.input[Z.index-1]===".")J.ignoreMatch()}function WJ(Z,J){if(Z.className!==void 0)Z.scope=Z.className,delete Z.className}function FJ(Z,J){if(!J)return;if(!Z.beginKeywords)return;if(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=XJ,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0)Z.relevance=0}function GJ(Z,J){if(!Array.isArray(Z.illegal))return;Z.illegal=sZ(...Z.illegal)}function HJ(Z,J){if(!Z.match)return;if(Z.begin||Z.end)throw Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}function KJ(Z,J){if(Z.relevance===void 0)Z.relevance=1}var YJ=(Z,J)=>{if(!Z.beforeMatch)return;if(Z.starts)throw Error("beforeMatch cannot be used with starts");let Q=Object.assign({},Z);Object.keys(Z).forEach(($)=>{delete Z[$]}),Z.keywords=Q.keywords,Z.begin=K9(Q.beforeMatch,S4(Q.begin)),Z.starts={relevance:0,contains:[Object.assign(Q,{endsParent:!0})]},Z.relevance=0,delete Q.beforeMatch},UJ=["of","and","for","in","not","or","if","then","parent","list","value"],yJ="keyword";function h4(Z,J,Q=yJ){let $=Object.create(null);if(typeof Z==="string")q(Q,Z.split(" "));else if(Array.isArray(Z))q(Q,Z);else Object.keys(Z).forEach(function(X){Object.assign($,h4(Z[X],J,X))});return $;function q(X,W){if(J)W=W.map((F)=>F.toLowerCase());W.forEach(function(F){let H=F.split("|");$[H[0]]=[X,BJ(H[0],H[1])]})}}function BJ(Z,J){if(J)return Number(J);return LJ(Z)?0:1}function LJ(Z){return UJ.includes(Z.toLowerCase())}var M4={},H9=(Z)=>{console.error(Z)},N4=(Z,...J)=>{console.log(`WARN: ${Z}`,...J)},A9=(Z,J)=>{if(M4[`${Z}/${J}`])return;console.log(`Deprecated as of ${Z}. ${J}`),M4[`${Z}/${J}`]=!0},WZ=Error();function m4(Z,J,{key:Q}){let $=0,q=Z[Q],X={},W={};for(let F=1;F<=J.length;F++)W[F+$]=q[F],X[F+$]=!0,$+=T4(J[F-1]);Z[Q]=W,Z[Q]._emit=X,Z[Q]._multi=!0}function wJ(Z){if(!Array.isArray(Z.begin))return;if(Z.skip||Z.excludeBegin||Z.returnBegin)throw H9("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),WZ;if(typeof Z.beginScope!=="object"||Z.beginScope===null)throw H9("beginScope must be object"),WZ;m4(Z,Z.begin,{key:"beginScope"}),Z.begin=oZ(Z.begin,{joinWith:""})}function PJ(Z){if(!Array.isArray(Z.end))return;if(Z.skip||Z.excludeEnd||Z.returnEnd)throw H9("skip, excludeEnd, returnEnd not compatible with endScope: {}"),WZ;if(typeof Z.endScope!=="object"||Z.endScope===null)throw H9("endScope must be object"),WZ;m4(Z,Z.end,{key:"endScope"}),Z.end=oZ(Z.end,{joinWith:""})}function CJ(Z){if(Z.scope&&typeof Z.scope==="object"&&Z.scope!==null)Z.beginScope=Z.scope,delete Z.scope}function AJ(Z){if(CJ(Z),typeof Z.beginScope==="string")Z.beginScope={_wrap:Z.beginScope};if(typeof Z.endScope==="string")Z.endScope={_wrap:Z.endScope};wJ(Z),PJ(Z)}function vJ(Z){function J(W,F){return new RegExp(j9(W),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(F?"g":""))}class Q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(W,F){F.position=this.position++,this.matchIndexes[this.matchAt]=F,this.regexes.push([F,W]),this.matchAt+=T4(W)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let W=this.regexes.map((F)=>F[1]);this.matcherRe=J(oZ(W,{joinWith:"|"}),!0),this.lastIndex=0}exec(W){this.matcherRe.lastIndex=this.lastIndex;let F=this.matcherRe.exec(W);if(!F)return null;let H=F.findIndex((Y,K)=>K>0&&Y!==void 0),G=this.matchIndexes[H];return F.splice(0,H),Object.assign(F,G)}}class ${constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(W){if(this.multiRegexes[W])return this.multiRegexes[W];let F=new Q;return this.rules.slice(W).forEach(([H,G])=>F.addRule(H,G)),F.compile(),this.multiRegexes[W]=F,F}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(W,F){if(this.rules.push([W,F]),F.type==="begin")this.count++}exec(W){let F=this.getMatcher(this.regexIndex);F.lastIndex=this.lastIndex;let H=F.exec(W);if(this.resumingScanAtSamePosition())if(H&&H.index===this.lastIndex);else{let G=this.getMatcher(0);G.lastIndex=this.lastIndex+1,H=G.exec(W)}if(H){if(this.regexIndex+=H.position+1,this.regexIndex===this.count)this.considerAll()}return H}}function q(W){let F=new $;if(W.contains.forEach((H)=>F.addRule(H.begin,{rule:H,type:"begin"})),W.terminatorEnd)F.addRule(W.terminatorEnd,{type:"end"});if(W.illegal)F.addRule(W.illegal,{type:"illegal"});return F}function X(W,F){let H=W;if(W.isCompiled)return H;[WJ,HJ,AJ,YJ].forEach((Y)=>Y(W,F)),Z.compilerExtensions.forEach((Y)=>Y(W,F)),W.__beforeBegin=null,[FJ,GJ,KJ].forEach((Y)=>Y(W,F)),W.isCompiled=!0;let G=null;if(typeof W.keywords==="object"&&W.keywords.$pattern)W.keywords=Object.assign({},W.keywords),G=W.keywords.$pattern,delete W.keywords.$pattern;if(G=G||/\w+/,W.keywords)W.keywords=h4(W.keywords,Z.case_insensitive);if(H.keywordPatternRe=J(G,!0),F){if(!W.begin)W.begin=/\B|\b/;if(H.beginRe=J(H.begin),!W.end&&!W.endsWithParent)W.end=/\B|\b/;if(W.end)H.endRe=J(H.end);if(H.terminatorEnd=j9(H.end)||"",W.endsWithParent&&F.terminatorEnd)H.terminatorEnd+=(W.end?"|":"")+F.terminatorEnd}if(W.illegal)H.illegalRe=J(W.illegal);if(!W.contains)W.contains=[];if(W.contains=[].concat(...W.contains.map(function(Y){return OJ(Y==="self"?W:Y)})),W.contains.forEach(function(Y){X(Y,H)}),W.starts)X(W.starts,F);return H.matcher=q(H),H}if(!Z.compilerExtensions)Z.compilerExtensions=[];if(Z.contains&&Z.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=Q9(Z.classNameAliases||{}),X(Z)}function u4(Z){if(!Z)return!1;return Z.endsWithParent||u4(Z.starts)}function OJ(Z){if(Z.variants&&!Z.cachedVariants)Z.cachedVariants=Z.variants.map(function(J){return Q9(Z,{variants:null},J)});if(Z.cachedVariants)return Z.cachedVariants;if(u4(Z))return Q9(Z,{starts:Z.starts?Q9(Z.starts):null});if(Object.isFrozen(Z))return Q9(Z);return Z}var _J="11.11.1";class E4 extends Error{constructor(Z,J){super(Z);this.name="HTMLInjectionError",this.html=J}}var lZ=R4,V4=Q9,f4=Symbol("nomatch"),MJ=7,p4=function(Z){let J=Object.create(null),Q=Object.create(null),$=[],q=!0,X="Could not find the language '{}', did you forget to load/include a language module?",W={disableAutodetect:!0,name:"Plain text",contains:[]},F={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b4};function H(R){return F.noHighlightRe.test(R)}function G(R){let N=R.className+" ";N+=R.parentNode?R.parentNode.className:"";let v=F.languageDetectRe.exec(N);if(v){let S=b(v[1]);if(!S)N4(X.replace("{}",v[1])),N4("Falling back to no-highlight mode for this block.",R);return S?v[1]:"no-highlight"}return N.split(/\s+/).find((S)=>H(S)||b(S))}function Y(R,N,v){let S="",o="";if(typeof N==="object")S=R,v=N.ignoreIllegals,o=N.language;else A9("10.7.0","highlight(lang, code, ...args) has been deprecated."),A9("10.7.0",`Please use highlight(code, options) instead.
2
- https://github.com/highlightjs/highlight.js/issues/2277`),o=R,S=N;if(v===void 0)v=!0;let Z0={code:S,language:o};t("before:highlight",Z0);let q0=Z0.result?Z0.result:K(Z0.language,Z0.code,v);return q0.code=Z0.code,t("after:highlight",q0),q0}function K(R,N,v,S){let o=Object.create(null);function Z0(E,s){return E.keywords[s]}function q0(){if(!Q0.keywords){T0.addText(P0);return}let E=0;Q0.keywordPatternRe.lastIndex=0;let s=Q0.keywordPatternRe.exec(P0),U="";while(s){U+=P0.substring(E,s.index);let P=M0.case_insensitive?s[0].toLowerCase():s[0],m=Z0(Q0,P);if(m){let[f,h]=m;if(T0.addText(U),U="",o[P]=(o[P]||0)+1,o[P]<=MJ)U9+=h;if(f.startsWith("_"))U+=s[0];else{let $0=M0.classNameAliases[f]||f;W0(s[0],$0)}}else U+=s[0];E=Q0.keywordPatternRe.lastIndex,s=Q0.keywordPatternRe.exec(P0)}U+=P0.substring(E),T0.addText(U)}function K0(){if(P0==="")return;let E=null;if(typeof Q0.subLanguage==="string"){if(!J[Q0.subLanguage]){T0.addText(P0);return}E=K(Q0.subLanguage,P0,!0,n0[Q0.subLanguage]),n0[Q0.subLanguage]=E._top}else E=y(P0,Q0.subLanguage.length?Q0.subLanguage:null);if(Q0.relevance>0)U9+=E.relevance;T0.__addSublanguage(E._emitter,E.language)}function O0(){if(Q0.subLanguage!=null)K0();else q0();P0=""}function W0(E,s){if(E==="")return;T0.startScope(s),T0.addText(E),T0.endScope()}function V(E,s){let U=1,P=s.length-1;while(U<=P){if(!E._emit[U]){U++;continue}let m=M0.classNameAliases[E[U]]||E[U],f=s[U];if(m)W0(f,m);else P0=f,q0(),P0="";U++}}function j(E,s){if(E.scope&&typeof E.scope==="string")T0.openNode(M0.classNameAliases[E.scope]||E.scope);if(E.beginScope){if(E.beginScope._wrap)W0(P0,M0.classNameAliases[E.beginScope._wrap]||E.beginScope._wrap),P0="";else if(E.beginScope._multi)V(E.beginScope,s),P0=""}return Q0=Object.create(E,{parent:{value:Q0}}),Q0}function d(E,s,U){let P=E7(E.endRe,U);if(P){if(E["on:end"]){let m=new nZ(E);if(E["on:end"](s,m),m.isMatchIgnored)P=!1}if(P){while(E.endsParent&&E.parent)E=E.parent;return E}}if(E.endsWithParent)return d(E.parent,s,U)}function l(E){if(Q0.matcher.regexIndex===0)return P0+=E[0],1;else return R9=!0,0}function F0(E){let s=E[0],U=E.rule,P=new nZ(U),m=[U.__beforeBegin,U["on:begin"]];for(let f of m){if(!f)continue;if(f(E,P),P.isMatchIgnored)return l(s)}if(U.skip)P0+=s;else{if(U.excludeBegin)P0+=s;if(O0(),!U.returnBegin&&!U.excludeBegin)P0=s}return j(U,E),U.returnBegin?0:s.length}function B0(E){let s=E[0],U=N.substring(E.index),P=d(Q0,E,U);if(!P)return f4;let m=Q0;if(Q0.endScope&&Q0.endScope._wrap)O0(),W0(s,Q0.endScope._wrap);else if(Q0.endScope&&Q0.endScope._multi)O0(),V(Q0.endScope,E);else if(m.skip)P0+=s;else{if(!(m.returnEnd||m.excludeEnd))P0+=s;if(O0(),m.excludeEnd)P0=s}do{if(Q0.scope)T0.closeNode();if(!Q0.skip&&!Q0.subLanguage)U9+=Q0.relevance;Q0=Q0.parent}while(Q0!==P.parent);if(P.starts)j(P.starts,E);return m.returnEnd?0:s.length}function J0(){let E=[];for(let s=Q0;s!==M0;s=s.parent)if(s.scope)E.unshift(s.scope);E.forEach((s)=>T0.openNode(s))}let c={};function a(E,s){let U=s&&s[0];if(P0+=E,U==null)return O0(),0;if(c.type==="begin"&&s.type==="end"&&c.index===s.index&&U===""){if(P0+=N.slice(s.index,s.index+1),!q){let P=Error(`0 width match regex (${R})`);throw P.languageName=R,P.badRule=c.rule,P}return 1}if(c=s,s.type==="begin")return F0(s);else if(s.type==="illegal"&&!v){let P=Error('Illegal lexeme "'+U+'" for mode "'+(Q0.scope||"<unnamed>")+'"');throw P.mode=Q0,P}else if(s.type==="end"){let P=B0(s);if(P!==f4)return P}if(s.type==="illegal"&&U==="")return P0+=`
3
- `,1;if(k9>1e5&&k9>s.index*3)throw Error("potential infinite loop, way more iterations than matches");return P0+=U,U.length}let M0=b(R);if(!M0)throw H9(X.replace("{}",R)),Error('Unknown language: "'+R+'"');let Y0=vJ(M0),r0="",Q0=S||Y0,n0={},T0=new F.__emitter(F);J0();let P0="",U9=0,t0=0,k9=0,R9=!1;try{if(!M0.__emitTokens){Q0.matcher.considerAll();for(;;){if(k9++,R9)R9=!1;else Q0.matcher.considerAll();Q0.matcher.lastIndex=t0;let E=Q0.matcher.exec(N);if(!E)break;let s=N.substring(t0,E.index),U=a(s,E);t0=E.index+U}a(N.substring(t0))}else M0.__emitTokens(N,T0);return T0.finalize(),r0=T0.toHTML(),{language:R,value:r0,relevance:U9,illegal:!1,_emitter:T0,_top:Q0}}catch(E){if(E.message&&E.message.includes("Illegal"))return{language:R,value:lZ(N),illegal:!0,relevance:0,_illegalBy:{message:E.message,index:t0,context:N.slice(t0-100,t0+100),mode:E.mode,resultSoFar:r0},_emitter:T0};else if(q)return{language:R,value:lZ(N),illegal:!1,relevance:0,errorRaised:E,_emitter:T0,_top:Q0};else throw E}}function A(R){let N={value:lZ(R),illegal:!1,relevance:0,_top:W,_emitter:new F.__emitter(F)};return N._emitter.addText(R),N}function y(R,N){N=N||F.languages||Object.keys(J);let v=A(R),S=N.filter(b).filter(i).map((O0)=>K(O0,R,!1));S.unshift(v);let o=S.sort((O0,W0)=>{if(O0.relevance!==W0.relevance)return W0.relevance-O0.relevance;if(O0.language&&W0.language){if(b(O0.language).supersetOf===W0.language)return 1;else if(b(W0.language).supersetOf===O0.language)return-1}return 0}),[Z0,q0]=o,K0=Z0;return K0.secondBest=q0,K0}function w(R,N,v){let S=N&&Q[N]||v;R.classList.add("hljs"),R.classList.add(`language-${S}`)}function _(R){let N=null,v=G(R);if(H(v))return;if(t("before:highlightElement",{el:R,language:v}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0){if(!F.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(R);if(F.throwUnescapedHTML)throw new E4("One of your code blocks includes unescaped HTML.",R.innerHTML)}N=R;let S=N.textContent,o=v?Y(S,{language:v,ignoreIllegals:!0}):y(S);if(R.innerHTML=o.value,R.dataset.highlighted="yes",w(R,v,o.language),R.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest)R.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance};t("after:highlightElement",{el:R,result:o,text:S})}function O(R){F=V4(F,R)}let k=()=>{L(),A9("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function I(){L(),A9("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let B=!1;function L(){function R(){L()}if(document.readyState==="loading"){if(!B)window.addEventListener("DOMContentLoaded",R,!1);B=!0;return}document.querySelectorAll(F.cssSelector).forEach(_)}function M(R,N){let v=null;try{v=N(Z)}catch(S){if(H9("Language definition for '{}' could not be registered.".replace("{}",R)),!q)throw S;else H9(S);v=W}if(!v.name)v.name=R;if(J[R]=v,v.rawDefinition=N.bind(null,Z),v.aliases)u(v.aliases,{languageName:R})}function C(R){delete J[R];for(let N of Object.keys(Q))if(Q[N]===R)delete Q[N]}function g(){return Object.keys(J)}function b(R){return R=(R||"").toLowerCase(),J[R]||J[Q[R]]}function u(R,{languageName:N}){if(typeof R==="string")R=[R];R.forEach((v)=>{Q[v.toLowerCase()]=N})}function i(R){let N=b(R);return N&&!N.disableAutodetect}function r(R){if(R["before:highlightBlock"]&&!R["before:highlightElement"])R["before:highlightElement"]=(N)=>{R["before:highlightBlock"](Object.assign({block:N.el},N))};if(R["after:highlightBlock"]&&!R["after:highlightElement"])R["after:highlightElement"]=(N)=>{R["after:highlightBlock"](Object.assign({block:N.el},N))}}function x(R){r(R),$.push(R)}function T(R){let N=$.indexOf(R);if(N!==-1)$.splice(N,1)}function t(R,N){let v=R;$.forEach(function(S){if(S[v])S[v](N)})}function H0(R){return A9("10.7.0","highlightBlock will be removed entirely in v12.0"),A9("10.7.0","Please use highlightElement now."),_(R)}Object.assign(Z,{highlight:Y,highlightAuto:y,highlightAll:L,highlightElement:_,highlightBlock:H0,configure:O,initHighlighting:k,initHighlightingOnLoad:I,registerLanguage:M,unregisterLanguage:C,listLanguages:g,getLanguage:b,registerAliases:u,autoDetection:i,inherit:V4,addPlugin:x,removePlugin:T}),Z.debugMode=function(){q=!1},Z.safeMode=function(){q=!0},Z.versionString=_J,Z.regex={concat:K9,lookahead:S4,either:sZ,optional:m7,anyNumberOfTimes:h7};for(let R in XZ)if(typeof XZ[R]==="object")k4(XZ[R]);return Object.assign(Z,XZ),Z},v9=p4({});v9.newInstance=()=>p4({});i4.exports=v9;v9.HighlightJS=v9;v9.default=v9});var d4=U0((C$,a4)=>{function NJ(Z){let J=Z.regex,Q=J.concat(/[\p{L}_]/u,J.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),$=/[\p{L}0-9._:-]+/u,q={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},X={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},W=Z.inherit(X,{begin:/\(/,end:/\)/}),F=Z.inherit(Z.APOS_STRING_MODE,{className:"string"}),H=Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),G={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:$,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[q]},{begin:/'/,end:/'/,contains:[q]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[X,H,F,W,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[X,W,H,F]}]}]},Z.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},q,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[H]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[G],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[G],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:J.concat(/</,J.lookahead(J.concat(Q,J.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:Q,relevance:0,starts:G}]},{className:"tag",begin:J.concat(/<\//,J.lookahead(J.concat(Q,/>/))),contains:[{className:"name",begin:Q,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}a4.exports=NJ});var l4=U0((A$,r4)=>{function VJ(Z){let J=Z.regex,Q={},$={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[Q]}]};Object.assign(Q,{className:"variable",variants:[{begin:J.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},$]});let q={className:"subst",begin:/\$\(/,end:/\)/,contains:[Z.BACKSLASH_ESCAPE]},X=Z.inherit(Z.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),W={begin:/<<-?\s*(?=\w+)/,starts:{contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},F={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,Q,q]};q.contains.push(F);let H={match:/\\"/},G={className:"string",begin:/'/,end:/'/},Y={match:/\\'/},K={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},Z.NUMBER_MODE,Q]},A=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=Z.SHEBANG({binary:`(${A.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[Z.inherit(Z.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],k={match:/(\/[a-z._-]+)+/},I=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],B=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],L=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:O,built_in:[...I,...B,"set","shopt",...L,...M]},contains:[y,Z.SHEBANG(),w,K,X,W,k,F,H,G,Y,Q]}}r4.exports=VJ});var t4=U0((v$,n4)=>{function fJ(Z){let J=Z.regex,Q=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),$="decltype\\(auto\\)",q="[a-zA-Z_]\\w*::",X="<[^<>]+>",W="(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",F={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},H="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",G={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(G,{className:"string"}),{className:"string",begin:/<.*?>/},Q,Z.C_BLOCK_COMMENT_MODE]},A={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},y=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",O={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[K,F,Q,Z.C_BLOCK_COMMENT_MODE,Y,G],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},B={begin:"("+W+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:y,returnBegin:!0,contains:[Z.inherit(A,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[Q,Z.C_BLOCK_COMMENT_MODE,G,Y,F,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",Q,Z.C_BLOCK_COMMENT_MODE,G,Y,F]}]},F,Q,Z.C_BLOCK_COMMENT_MODE,K]};return{name:"C",aliases:["h"],keywords:O,disableAutodetect:!0,illegal:"</",contains:[].concat(I,B,k,[K,{begin:Z.IDENT_RE+"::",keywords:O},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},Z.TITLE_MODE]}]),exports:{preprocessor:K,strings:G,keywords:O}}}n4.exports=fJ});var o4=U0((O$,s4)=>{function kJ(Z){let J=Z.regex,Q=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),$="decltype\\(auto\\)",q="[a-zA-Z_]\\w*::",X="<[^<>]+>",W="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",F={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},H="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",G={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(G,{className:"string"}),{className:"string",begin:/<.*?>/},Q,Z.C_BLOCK_COMMENT_MODE]},A={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},y=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],O=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],L={type:_,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:O},M={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,Z.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},C=[M,K,F,Q,Z.C_BLOCK_COMMENT_MODE,Y,G],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:C.concat([{begin:/\(/,end:/\)/,keywords:L,contains:C.concat(["self"]),relevance:0}]),relevance:0},b={className:"function",begin:"("+W+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:L,relevance:0},{begin:y,returnBegin:!0,contains:[A],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[G,Y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[Q,Z.C_BLOCK_COMMENT_MODE,G,Y,F,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",Q,Z.C_BLOCK_COMMENT_MODE,G,Y,F]}]},F,Q,Z.C_BLOCK_COMMENT_MODE,K]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(g,b,M,C,[K,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:L,contains:["self",F]},{begin:Z.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}s4.exports=kJ});var Z5=U0((_$,e4)=>{function RJ(Z){let J=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],Q=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],$=["default","false","null","true"],q=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],X=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],W={keyword:q.concat(X),built_in:J,literal:$},F=Z.inherit(Z.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),H={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},G={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},Y={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},K=Z.inherit(Y,{illegal:/\n/}),A={className:"subst",begin:/\{/,end:/\}/,keywords:W},y=Z.inherit(A,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},Z.BACKSLASH_ESCAPE,y]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},A]},O=Z.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});A.contains=[_,w,Y,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,H,Z.C_BLOCK_COMMENT_MODE],y.contains=[O,w,K,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,H,Z.inherit(Z.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let k={variants:[G,_,w,Y,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},I={begin:"<",end:">",contains:[{beginKeywords:"in out"},F]},B=Z.IDENT_RE+"(<"+Z.IDENT_RE+"(\\s*,\\s*"+Z.IDENT_RE+")*>)?(\\[\\])?",L={begin:"@"+Z.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:W,illegal:/::/,contains:[Z.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,H,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},F,I,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[F,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[F,I,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+B+"\\s+)+"+Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:W,contains:[{beginKeywords:Q.join(" "),relevance:0},{begin:Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[Z.TITLE_MODE,I],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:W,relevance:0,contains:[k,H,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},L]}}e4.exports=RJ});var Q5=U0((M$,J5)=>{var IJ=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},bJ=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],SJ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TJ=[...bJ,...SJ],gJ=["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"].sort().reverse(),xJ=["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"].sort().reverse(),jJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DJ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function hJ(Z){let J=Z.regex,Q=IJ(Z),$={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},q="and or not only",X=/@-?\w[\w]*(-\w+)*/,W="[a-zA-Z-][a-zA-Z0-9_-]*",F=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[Q.BLOCK_COMMENT,$,Q.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},Q.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+xJ.join("|")+")"},{begin:":(:)?("+jJ.join("|")+")"}]},Q.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[Q.BLOCK_COMMENT,Q.HEXCOLOR,Q.IMPORTANT,Q.CSS_NUMBER_MODE,...F,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...F,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},Q.FUNCTION_DISPATCH]},{begin:J.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:X},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:gJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...F,Q.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TJ.join("|")+")\\b"}]}}J5.exports=hJ});var $5=U0((N$,z5)=>{function mJ(Z){let J=Z.regex,Q={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},$={begin:"^[-\\*]{3,}",end:"$"},q={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},X={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},W={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},F=/[A-Za-z][A-Za-z0-9+.-]*/,H={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:J.concat(/\[.+?\]\(/,F,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},G={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},Y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},K=Z.inherit(G,{contains:[]}),A=Z.inherit(Y,{contains:[]});G.contains.push(A),Y.contains.push(K);let y=[Q,H];return[G,Y,K,A].forEach((k)=>{k.contains=k.contains.concat(y)}),y=y.concat(G,Y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},Q,X,G,Y,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},q,$,H,W,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}z5.exports=mJ});var X5=U0((V$,q5)=>{function uJ(Z){let J=Z.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:J.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:J.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}q5.exports=uJ});var F5=U0((f$,W5)=>{function EJ(Z){let J=Z.regex,Q="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",$=J.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),q=J.concat($,/(::\w+)*/),W={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},F={className:"doctag",begin:"@[A-Za-z]+"},H={begin:"#<",end:">"},G=[Z.COMMENT("#","$",{contains:[F]}),Z.COMMENT("^=begin","^=end",{contains:[F],relevance:10}),Z.COMMENT("^__END__",Z.MATCH_NOTHING_RE)],Y={className:"subst",begin:/#\{/,end:/\}/,keywords:W},K={className:"string",contains:[Z.BACKSLASH_ESCAPE,Y],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:J.concat(/<<[-~]?'?/,J.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[Z.BACKSLASH_ESCAPE,Y]})]}]},A="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:W}]},C=[K,{variants:[{match:[/class\s+/,q,/\s+<\s+/,q]},{match:[/\b(class|module)\s+/,q]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:W},{match:[/(include|extend)\s+/,q],scope:{2:"title.class"},keywords:W},{relevance:0,match:[q,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:$,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:Z.IDENT_RE+"::"},{className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[K,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:W},{begin:"("+Z.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[Z.BACKSLASH_ESCAPE,Y],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(H,G),relevance:0}].concat(H,G);Y.contains=C,_.contains=C;let g="[>?]>",b="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",u="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",i=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+g+"|"+b+"|"+u+")(?=[ ])",starts:{end:"$",keywords:W,contains:C}}];return G.unshift(H),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:W,illegal:/\/\*/,contains:[Z.SHEBANG({binary:"ruby"})].concat(i).concat(G).concat(C)}}W5.exports=EJ});var H5=U0((k$,G5)=>{function pJ(Z){let X={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:X,illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"string",variants:[Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[Z.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:X,illegal:/["']/}]}]}}G5.exports=pJ});var Y5=U0((R$,K5)=>{function iJ(Z){let J=Z.regex,Q=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[Z.HASH_COMMENT_MODE,Z.QUOTE_STRING_MODE,Z.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:J.concat(Q,J.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}K5.exports=iJ});var y5=U0((I$,U5)=>{function cJ(Z){let J=Z.regex,Q={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:Z.NUMBER_RE}]},$=Z.COMMENT();$.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let q={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},X={className:"literal",begin:/\bon|off|true|false|yes|no\b/},W={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},F={begin:/\[/,end:/\]/,contains:[$,X,q,W,Q,"self"],relevance:0},H=/[A-Za-z0-9_-]+/,G=/"(\\"|[^"])*"/,Y=/'[^']*'/,K=J.either(H,G,Y),A=J.concat(K,"(\\s*\\.\\s*",K,")*",J.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[$,{className:"section",begin:/\[+/,end:/\]+/},{begin:A,className:"attr",starts:{end:/$/,contains:[$,F,X,q,W,Q]}}]}}U5.exports=cJ});var P5=U0((b$,w5)=>{var O9="[0-9](_*[0-9])*",GZ=`\\.(${O9})`,HZ="[0-9a-fA-F](_*[0-9a-fA-F])*",B5={className:"number",variants:[{begin:`(\\b(${O9})((${GZ})|\\.)?|(${GZ}))[eE][+-]?(${O9})[fFdD]?\\b`},{begin:`\\b(${O9})((${GZ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${GZ})[fFdD]?\\b`},{begin:`\\b(${O9})[fFdD]\\b`},{begin:`\\b0[xX]((${HZ})\\.?|(${HZ})?\\.(${HZ}))[pP][+-]?(${O9})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${HZ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function L5(Z,J,Q){if(Q===-1)return"";return Z.replace(J,($)=>{return L5(Z,J,Q-1)})}function aJ(Z){let J=Z.regex,Q="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",$="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+L5("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),H={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},G={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},Y={className:"params",begin:/\(/,end:/\)/,keywords:H,relevance:0,contains:[Z.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:H,illegal:/<\/|#/,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[Z.BACKSLASH_ESCAPE]},Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[J.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[Y,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+$+"\\s+)",Z.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:H,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:H,relevance:0,contains:[G,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,B5,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},B5,G]}}w5.exports=aJ});var _5=U0((S$,O5)=>{var dJ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rJ=["true","false","null","undefined","NaN","Infinity"],C5=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],A5=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],v5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nJ=[].concat(v5,C5,A5);function tJ(Z){let J=Z.regex,Q=(v,{after:S})=>{let o="</"+v[0].slice(1);return v.input.indexOf(o,S)!==-1},$="[A-Za-z$_][0-9A-Za-z$_]*",q={begin:"<>",end:"</>"},X=/<[A-Za-z0-9\\._:-]+\s*\/>/,W={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,S)=>{let o=v[0].length+v.index,Z0=v.input[o];if(Z0==="<"||Z0===","){S.ignoreMatch();return}if(Z0===">"){if(!Q(v,{after:o}))S.ignoreMatch()}let q0,K0=v.input.substring(o);if(q0=K0.match(/^\s*=/)){S.ignoreMatch();return}if(q0=K0.match(/^\s+extends\s+/)){if(q0.index===0){S.ignoreMatch();return}}}},F={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:dJ,literal:rJ,built_in:nJ,"variable.language":lJ},H="[0-9](_?[0-9])*",G="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:F,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,A]},I={className:"comment",variants:[Z.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},B=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,y,w,_,O,{match:/\$\d+/},K];A.contains=B.concat({begin:/\{/,end:/\}/,keywords:F,contains:["self"].concat(B)});let L=[].concat(I,A.contains),M=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:F,contains:["self"].concat(L)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:F,contains:M},g={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},b={relevance:0,match:J.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...C5,...A5]}},u={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},i={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},r={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(v){return J.concat("(?!",v.join("|"),")")}let T={match:J.concat(/\b/,x([...v5,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},t={begin:J.concat(/\./,J.lookahead(J.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H0={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:F,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:b},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),u,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,y,w,_,O,I,{match:/\$\d+/},K,b,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},N,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[I,Z.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:F,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:q.begin,end:q.end},{match:X},{begin:W.begin,"on:begin":W.isTrulyOpeningTag,end:W.end}],subLanguage:"xml",contains:[{begin:W.begin,end:W.end,skip:!0,contains:["self"]}]}]},i,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},t,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},T,r,g,H0,{match:/\$[(.]/}]}}O5.exports=tJ});var N5=U0((T$,M5)=>{function sJ(Z){let J={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},Q={match:/[{}[\],:]/,className:"punctuation",relevance:0},$=["true","false","null"],q={scope:"literal",beginKeywords:$.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:$},contains:[J,Q,Z.QUOTE_STRING_MODE,q,Z.C_NUMBER_MODE,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}M5.exports=sJ});var f5=U0((g$,V5)=>{var _9="[0-9](_*[0-9])*",KZ=`\\.(${_9})`,YZ="[0-9a-fA-F](_*[0-9a-fA-F])*",oJ={className:"number",variants:[{begin:`(\\b(${_9})((${KZ})|\\.)?|(${KZ}))[eE][+-]?(${_9})[fFdD]?\\b`},{begin:`\\b(${_9})((${KZ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${KZ})[fFdD]?\\b`},{begin:`\\b(${_9})[fFdD]\\b`},{begin:`\\b0[xX]((${YZ})\\.?|(${YZ})?\\.(${YZ}))[pP][+-]?(${_9})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${YZ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function eJ(Z){let J={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},Q={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},$={className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"@"},q={className:"subst",begin:/\$\{/,end:/\}/,contains:[Z.C_NUMBER_MODE]},X={className:"variable",begin:"\\$"+Z.UNDERSCORE_IDENT_RE},W={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[X,q]},{begin:"'",end:"'",illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE,X,q]}]};q.contains.push(W);let F={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+Z.UNDERSCORE_IDENT_RE+")?"},H={className:"meta",begin:"@"+Z.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[Z.inherit(W,{className:"string"}),"self"]}]},G=oJ,Y=Z.COMMENT("/\\*","\\*/",{contains:[Z.C_BLOCK_COMMENT_MODE]}),K={variants:[{className:"type",begin:Z.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},A=K;return A.variants[1].contains=[K],K.variants[1].contains=[A],{name:"Kotlin",aliases:["kt","kts"],keywords:J,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),Z.C_LINE_COMMENT_MODE,Y,Q,$,F,H,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:J,relevance:5,contains:[{begin:Z.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[Z.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:J,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[K,Z.C_LINE_COMMENT_MODE,Y],relevance:0},Z.C_LINE_COMMENT_MODE,Y,F,H,W,Z.C_NUMBER_MODE]},Y]},{begin:[/class|interface|trait/,/\s+/,Z.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},Z.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},F,H]},W,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
4
- `},G]}}V5.exports=eJ});var b5=U0((x$,I5)=>{var ZQ=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},JQ=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],QQ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],zQ=[...JQ,...QQ],$Q=["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"].sort().reverse(),k5=["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"].sort().reverse(),R5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qQ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),XQ=k5.concat(R5).sort().reverse();function WQ(Z){let J=ZQ(Z),Q=XQ,$="and or not only",q="[\\w-]+",X="([\\w-]+|@\\{[\\w-]+\\})",W=[],F=[],H=function(B){return{className:"string",begin:"~?"+B+".*?"+B}},G=function(B,L,M){return{className:B,begin:L,relevance:M}},Y={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:$Q.join(" ")},K={begin:"\\(",end:"\\)",contains:F,keywords:Y,relevance:0};F.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,H("'"),H('"'),J.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},J.HEXCOLOR,K,G("variable","@@?[\\w-]+",10),G("variable","@\\{[\\w-]+\\}"),G("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},J.IMPORTANT,{beginKeywords:"and not"},J.FUNCTION_DISPATCH);let A=F.concat({begin:/\{/,end:/\}/,contains:W}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(F)},w={begin:X+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qQ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:F}}]},_={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:Y,returnEnd:!0,contains:F,relevance:0}},O={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:A}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:X,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,y,G("keyword","all\\b"),G("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+zQ.join("|")+")\\b",className:"selector-tag"},J.CSS_NUMBER_MODE,G("selector-tag",X,0),G("selector-id","#"+X),G("selector-class","\\."+X,0),G("selector-tag","&",0),J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+k5.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+R5.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:A},{begin:"!important"},J.FUNCTION_DISPATCH]},I={begin:`[\\w-]+:(:)?(${Q.join("|")})`,returnBegin:!0,contains:[k]};return W.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,_,O,I,w,k,y,J.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:W}}I5.exports=WQ});var T5=U0((j$,S5)=>{function FQ(Z){let $={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},q=[Z.COMMENT("--(?!\\[=*\\[)","$"),Z.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[$],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:Z.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:q.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[Z.inherit(Z.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:q}].concat(q)},Z.C_NUMBER_MODE,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[$],relevance:5}])}}S5.exports=FQ});var x5=U0((D$,g5)=>{function GQ(Z){let J={className:"variable",variants:[{begin:"\\$\\("+Z.UNDERSCORE_IDENT_RE+"\\)",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},Q={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,J]},$={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[J,Q]},q={begin:"^"+Z.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},X={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},W={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[J]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[Z.HASH_COMMENT_MODE,J,Q,$,q,X,W]}}g5.exports=GQ});var D5=U0((h$,j5)=>{function HQ(Z){let J=Z.regex,Q=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],$=/[dualxmsipngr]{0,12}/,q={$pattern:/[\w.]+/,keyword:Q.join(" ")},X={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:q},W={begin:/->\{/,end:/\}/},F={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},H={scope:"variable",variants:[{begin:/\$\d/},{begin:J.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[F]},G={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},Y=[Z.BACKSLASH_ESCAPE,X,H],K=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],A=(_,O,k="\\1")=>{let I=k==="\\1"?k:J.concat(k,O);return J.concat(J.concat("(?:",_,")"),O,/(?:\\.|[^\\\/])*?/,I,/(?:\\.|[^\\\/])*?/,k,$)},y=(_,O,k)=>{return J.concat(J.concat("(?:",_,")"),O,/(?:\\.|[^\\\/])*?/,k,$)},w=[H,Z.HASH_COMMENT_MODE,Z.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),W,{className:"string",contains:Y,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},G,{begin:"(\\/\\/|"+Z.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[Z.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:A("s|tr|y",J.either(...K,{capture:!0}))},{begin:A("s|tr|y","\\(","\\)")},{begin:A("s|tr|y","\\[","\\]")},{begin:A("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",J.either(...K,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[Z.TITLE_MODE,F]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[Z.TITLE_MODE,F,G]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return X.contains=w,W.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:q,contains:w}}j5.exports=HQ});var m5=U0((m$,h5)=>{function KQ(Z){let J={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},Q=/[a-zA-Z@][a-zA-Z0-9_]*/,F={"variable.language":["this","super"],$pattern:Q,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},H={$pattern:Q,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:F,illegal:"</",contains:[J,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,Z.C_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+H.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:H,contains:[Z.UNDERSCORE_TITLE_MODE]},{begin:"\\."+Z.UNDERSCORE_IDENT_RE,relevance:0}]}}h5.exports=KQ});var E5=U0((u$,u5)=>{function YQ(Z){let J=Z.regex,Q=/(?![A-Za-z0-9])(?![$])/,$=J.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,Q),q=J.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,Q),X=J.concat(/[A-Z]+/,Q),W={scope:"variable",match:"\\$+"+$},F={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},H={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},G=Z.inherit(Z.APOS_STRING_MODE,{illegal:null}),Y=Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,contains:Z.QUOTE_STRING_MODE.contains.concat(H)}),K={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:Z.QUOTE_STRING_MODE.contains.concat(H),"on:begin":(t,H0)=>{H0.data._beginMatch=t[1]||t[2]},"on:end":(t,H0)=>{if(H0.data._beginMatch!==t[1])H0.ignoreMatch()}},A=Z.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
5
- ]`,w={scope:"string",variants:[Y,G,K,A]},_={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},O=["false","null","true"],k=["__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"],I=["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"],L={keyword:k,literal:((t)=>{let H0=[];return t.forEach((R)=>{if(H0.push(R),R.toLowerCase()===R)H0.push(R.toUpperCase());else H0.push(R.toLowerCase())}),H0})(O),built_in:I},M=(t)=>{return t.map((H0)=>{return H0.replace(/\|\d+$/,"")})},C={variants:[{match:[/new/,J.concat(`[
6
- ]`,"+"),J.concat("(?!",M(I).join("\\b|"),"\\b)"),q],scope:{1:"keyword",4:"title.class"}}]},g=J.concat($,"\\b(?!\\()"),b={variants:[{match:[J.concat(/::/,J.lookahead(/(?!class\b)/)),g],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[q,J.concat(/::/,J.lookahead(/(?!class\b)/)),g],scope:{1:"title.class",3:"variable.constant"}},{match:[q,J.concat("::",J.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[q,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},u={scope:"attr",match:J.concat($,J.lookahead(":"),J.lookahead(/(?!::)/))},i={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[u,W,b,Z.C_BLOCK_COMMENT_MODE,w,_,C]},r={relevance:0,match:[/\b/,J.concat("(?!fn\\b|function\\b|",M(k).join("\\b|"),"|",M(I).join("\\b|"),"\\b)"),$,J.concat(`[
7
- ]`,"*"),J.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[i]};i.contains.push(r);let x=[u,b,Z.C_BLOCK_COMMENT_MODE,w,_,C],T={begin:J.concat(/#\[\s*\\?/,J.either(q,X)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:O,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:O,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",variants:[{match:q},{match:X}]}]};return{case_insensitive:!1,keywords:L,contains:[T,Z.HASH_COMMENT_MODE,Z.COMMENT("//","$"),Z.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:Z.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},F,{scope:"variable.language",match:/\$this\b/},W,r,b,{match:[/const/,/\s/,$],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},Z.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:L,contains:["self",T,W,b,Z.C_BLOCK_COMMENT_MODE,w,_]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},Z.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[Z.inherit(Z.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},Z.UNDERSCORE_TITLE_MODE]},w,_]}}u5.exports=YQ});var i5=U0((E$,p5)=>{function UQ(Z){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},Z.inherit(Z.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}p5.exports=UQ});var a5=U0((p$,c5)=>{function yQ(Z){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}c5.exports=yQ});var r5=U0((i$,d5)=>{function BQ(Z){let J=Z.regex,Q=/[\p{XID_Start}_]\p{XID_Continue}*/u,$=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],F={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:$,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},H={className:"meta",begin:/^(>>>|\.\.\.) /},G={className:"subst",begin:/\{/,end:/\}/,keywords:F,illegal:/#/},Y={begin:/\{\{/,relevance:0},K={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,H],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,H],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,H,Y,G]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,H,Y,G]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[Z.BACKSLASH_ESCAPE,Y,G]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,Y,G]},Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},A="[0-9](_?[0-9])*",y="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",w=`\\b|${$.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${w})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${w})`}]},O={className:"comment",begin:J.lookahead(/# type:/),end:/$/,keywords:F,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:F,contains:["self",H,_,K,Z.HASH_COMMENT_MODE]}]};return G.contains=[K,_,H],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:F,illegal:/(<\/|\?)|=>/,contains:[H,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},K,O,Z.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,Q],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,Q,/\s*/,/\(\s*/,Q,/\s*\)/]},{match:[/\bclass/,/\s+/,Q]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,k,K]}]}}d5.exports=BQ});var n5=U0((c$,l5)=>{function LQ(Z){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}l5.exports=LQ});var s5=U0((a$,t5)=>{function wQ(Z){let J=Z.regex,Q=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,$=J.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),q=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,X=J.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:Q,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[Z.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:J.lookahead(J.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:Q},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),Z.HASH_COMMENT_MODE,{scope:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[q,$]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,$]},{scope:{1:"punctuation",2:"number"},match:[X,$]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,$]}]},{scope:{3:"operator"},match:[Q,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:q},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:X},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}t5.exports=wQ});var e5=U0((d$,o5)=>{function PQ(Z){let J=Z.regex,Q=/(r#)?/,$=J.concat(Q,Z.UNDERSCORE_IDENT_RE),q=J.concat(Q,Z.IDENT_RE),X={className:"title.function.invoke",relevance:0,begin:J.concat(/\b/,/(?!let|for|while|if|else|match\b)/,q,J.lookahead(/\s*\(/))},W="([ui](8|16|32|64|128|size)|f(32|64))?",F=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],H=["true","false","Some","None","Ok","Err"],G=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],Y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:Z.IDENT_RE+"!?",type:Y,keyword:F,literal:H,built_in:G},illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.COMMENT("/\\*","\\*/",{contains:["self"]}),Z.inherit(Z.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,$],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,$],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,$,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,$],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,$],className:{1:"keyword",3:"title.class"}},{begin:Z.IDENT_RE+"::",keywords:{keyword:"Self",built_in:G,type:Y}},{className:"punctuation",begin:"->"},X]}}o5.exports=PQ});var J6=U0((r$,Z6)=>{var CQ=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},AQ=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],vQ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OQ=[...AQ,...vQ],_Q=["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"].sort().reverse(),MQ=["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"].sort().reverse(),NQ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),VQ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function fQ(Z){let J=CQ(Z),Q=NQ,$=MQ,q="@[a-z-]+",X="and or not only",W="[a-zA-Z-][a-zA-Z0-9_-]*",F={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,J.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+OQ.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+$.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Q.join("|")+")"},F,{begin:/\(/,end:/\)/,contains:[J.CSS_NUMBER_MODE]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+VQ.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[J.BLOCK_COMMENT,F,J.HEXCOLOR,J.CSS_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.IMPORTANT,J.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:_Q.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},F,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.HEXCOLOR,J.CSS_NUMBER_MODE]},J.FUNCTION_DISPATCH]}}Z6.exports=fQ});var z6=U0((l$,Q6)=>{function kQ(Z){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}Q6.exports=kQ});var q6=U0((n$,$6)=>{function RQ(Z){let J=Z.regex,Q=Z.COMMENT("--","$"),$={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},q={begin:/"/,end:/"/,contains:[{match:/""/}]},X=["true","false","unknown"],W=["double precision","large object","with timezone","without timezone"],F=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],H=["add","asc","collation","desc","final","first","last","view"],G=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],Y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],K=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],A=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=Y,w=[...G,...H].filter((M)=>{return!Y.includes(M)}),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:J.concat(/\b/,J.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function I(M){return J.concat(/\b/,J.either(...M.map((C)=>{return C.replace(/\s+/,"\\s+")})),/\b/)}let B={scope:"keyword",match:I(A),relevance:0};function L(M,{exceptions:C,when:g}={}){let b=g;return C=C||[],M.map((u)=>{if(u.match(/\|\d+$/)||C.includes(u))return u;else if(b(u))return`${u}|0`;else return u})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(w,{when:(M)=>M.length<3}),literal:X,type:F,built_in:K},contains:[{scope:"type",match:I(W)},B,k,_,$,q,Z.C_NUMBER_MODE,Z.C_BLOCK_COMMENT_MODE,Q,O]}}$6.exports=RQ});var y6=U0((t$,U6)=>{function G6(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function h9(Z){return A0("(?=",Z,")")}function A0(...Z){return Z.map((Q)=>G6(Q)).join("")}function IQ(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function m0(...Z){return"("+(IQ(Z).capture?"":"?:")+Z.map(($)=>G6($)).join("|")+")"}var Q8=(Z)=>A0(/\b/,Z,/\w$/.test(Z)?/\b/:/\B/),bQ=["Protocol","Type"].map(Q8),X6=["init","self"].map(Q8),SQ=["Any","Self"],Z8=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],W6=["false","nil","true"],TQ=["assignment","associativity","higherThan","left","lowerThan","none","right"],gQ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],F6=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],H6=m0(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),K6=m0(H6,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),J8=A0(H6,K6,"*"),Y6=m0(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),yZ=m0(Y6,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),l0=A0(Y6,yZ,"*"),UZ=A0(/[A-Z]/,yZ,"*"),xQ=["attached","autoclosure",A0(/convention\(/,m0("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",A0(/objc\(/,l0,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],jQ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function DQ(Z){let J={match:/\s+/,relevance:0},Q=Z.COMMENT("/\\*","\\*/",{contains:["self"]}),$=[Z.C_LINE_COMMENT_MODE,Q],q={match:[/\./,m0(...bQ,...X6)],className:{2:"keyword"}},X={match:A0(/\./,m0(...Z8)),relevance:0},W=Z8.filter((Y0)=>typeof Y0==="string").concat(["_|0"]),F=Z8.filter((Y0)=>typeof Y0!=="string").concat(SQ).map(Q8),H={variants:[{className:"keyword",match:m0(...F,...X6)}]},G={$pattern:m0(/\b\w+/,/#\w+/),keyword:W.concat(gQ),literal:W6},Y=[q,X,H],K={match:A0(/\./,m0(...F6)),relevance:0},A={className:"built_in",match:A0(/\b/,m0(...F6),/(?=\()/)},y=[K,A],w={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:J8},{match:`\\.(\\.|${K6})+`}]},O=[w,_],k="([0-9]_*)+",I="([0-9a-fA-F]_*)+",B={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},L=(Y0="")=>({className:"subst",variants:[{match:A0(/\\/,Y0,/[0\\tnr"']/)},{match:A0(/\\/,Y0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(Y0="")=>({className:"subst",match:A0(/\\/,Y0,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(Y0="")=>({className:"subst",label:"interpol",begin:A0(/\\/,Y0,/\(/),end:/\)/}),g=(Y0="")=>({begin:A0(Y0,/"""/),end:A0(/"""/,Y0),contains:[L(Y0),M(Y0),C(Y0)]}),b=(Y0="")=>({begin:A0(Y0,/"/),end:A0(/"/,Y0),contains:[L(Y0),C(Y0)]}),u={className:"string",variants:[g(),g("#"),g("##"),g("###"),b(),b("#"),b("##"),b("###")]},i=[Z.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[Z.BACKSLASH_ESCAPE]}],r={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:i},x=(Y0)=>{let r0=A0(Y0,/\//),Q0=A0(/\//,Y0);return{begin:r0,end:Q0,contains:[...i,{scope:"comment",begin:`#(?!.*${Q0})`,end:/$/}]}},T={scope:"regexp",variants:[x("###"),x("##"),x("#"),r]},t={match:A0(/`/,l0,/`/)},H0={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${yZ}+`},N=[t,H0,R],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jQ,contains:[...O,B,u]}]}},S={scope:"keyword",match:A0(/@/,m0(...xQ),h9(m0(/\(/,/\s+/)))},o={scope:"meta",match:A0(/@/,l0)},Z0=[v,S,o],q0={match:h9(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:A0(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,yZ,"+")},{className:"type",match:UZ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:A0(/\s+&\s+/,h9(UZ)),relevance:0}]},K0={begin:/</,end:/>/,keywords:G,contains:[...$,...Y,...Z0,w,q0]};q0.contains.push(K0);let O0={match:A0(l0,/\s*:/),keywords:"_|0",relevance:0},W0={begin:/\(/,end:/\)/,relevance:0,keywords:G,contains:["self",O0,...$,T,...Y,...y,...O,B,u,...N,...Z0,q0]},V={begin:/</,end:/>/,keywords:"repeat each",contains:[...$,q0]},j={begin:m0(h9(A0(l0,/\s*:/)),h9(A0(l0,/\s+/,l0,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:l0}]},d={begin:/\(/,end:/\)/,keywords:G,contains:[j,...$,...Y,...O,B,u,...Z0,q0,W0],endsParent:!0,illegal:/["']/},l={match:[/(func|macro)/,/\s+/,m0(t.match,l0,J8)],className:{1:"keyword",3:"title.function"},contains:[V,d,J],illegal:[/\[/,/%/]},F0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[V,d,J],illegal:/\[|%/},B0={match:[/operator/,/\s+/,J8],className:{1:"keyword",3:"title"}},J0={begin:[/precedencegroup/,/\s+/,UZ],className:{1:"keyword",3:"title"},contains:[q0],keywords:[...TQ,...W6],end:/}/},c={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},a={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},M0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,l0,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:G,contains:[V,...Y,{begin:/:/,end:/\{/,keywords:G,contains:[{scope:"title.class.inherited",match:UZ},...Y],relevance:0}]};for(let Y0 of u.variants){let r0=Y0.contains.find((n0)=>n0.label==="interpol");r0.keywords=G;let Q0=[...Y,...y,...O,B,u,...N];r0.contains=[...Q0,{begin:/\(/,end:/\)/,contains:["self",...Q0]}]}return{name:"Swift",keywords:G,contains:[...$,l,F0,c,a,M0,B0,J0,{beginKeywords:"import",end:/$/,contains:[...$],relevance:0},T,...Y,...y,...O,B,u,...N,...Z0,q0,W0]}}U6.exports=DQ});var L6=U0((s$,B6)=>{function hQ(Z){let $={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},q={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},X={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},W={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[Z.BACKSLASH_ESCAPE,q]},F=Z.inherit(W,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),H="[0-9]{4}(-[0-9][0-9]){0,2}",G="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",Y="(\\.[0-9]*)?",K="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",A={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},w={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},O=[$,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},Z.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},A,{className:"number",begin:Z.C_NUMBER_RE+"\\b",relevance:0},w,_,X,W],k=[...O];return k.pop(),k.push(F),y.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}B6.exports=hQ});var N6=U0((o$,M6)=>{var w6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],P6=["true","false","null","undefined","NaN","Infinity"],C6=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],A6=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],v6=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],O6=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_6=[].concat(v6,C6,A6);function mQ(Z){let J=Z.regex,Q=(v,{after:S})=>{let o="</"+v[0].slice(1);return v.input.indexOf(o,S)!==-1},$="[A-Za-z$_][0-9A-Za-z$_]*",q={begin:"<>",end:"</>"},X=/<[A-Za-z0-9\\._:-]+\s*\/>/,W={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,S)=>{let o=v[0].length+v.index,Z0=v.input[o];if(Z0==="<"||Z0===","){S.ignoreMatch();return}if(Z0===">"){if(!Q(v,{after:o}))S.ignoreMatch()}let q0,K0=v.input.substring(o);if(q0=K0.match(/^\s*=/)){S.ignoreMatch();return}if(q0=K0.match(/^\s+extends\s+/)){if(q0.index===0){S.ignoreMatch();return}}}},F={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:w6,literal:P6,built_in:_6,"variable.language":O6},H="[0-9](_?[0-9])*",G="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:F,contains:[]},y={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,A]},I={className:"comment",variants:[Z.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},B=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,y,w,_,O,{match:/\$\d+/},K];A.contains=B.concat({begin:/\{/,end:/\}/,keywords:F,contains:["self"].concat(B)});let L=[].concat(I,A.contains),M=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:F,contains:["self"].concat(L)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:F,contains:M},g={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},b={relevance:0,match:J.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...C6,...A6]}},u={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},i={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},r={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(v){return J.concat("(?!",v.join("|"),")")}let T={match:J.concat(/\b/,x([...v6,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},t={begin:J.concat(/\./,J.lookahead(J.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H0={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:F,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:b},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),u,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,y,w,_,O,I,{match:/\$\d+/},K,b,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},N,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[I,Z.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:F,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:q.begin,end:q.end},{match:X},{begin:W.begin,"on:begin":W.isTrulyOpeningTag,end:W.end}],subLanguage:"xml",contains:[{begin:W.begin,end:W.end,skip:!0,contains:["self"]}]}]},i,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},t,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},T,r,g,H0,{match:/\$[(.]/}]}}function uQ(Z){let J=Z.regex,Q=mQ(Z),$="[A-Za-z$_][0-9A-Za-z$_]*",q=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],X={begin:[/namespace/,/\s+/,Z.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},W={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:q},contains:[Q.exports.CLASS_REFERENCE]},F={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},H=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],G={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:w6.concat(H),literal:P6,built_in:_6.concat(q),"variable.language":O6},Y={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},K=(_,O,k)=>{let I=_.contains.findIndex((B)=>B.label===O);if(I===-1)throw Error("can not find mode to replace");_.contains.splice(I,1,k)};Object.assign(Q.keywords,G),Q.exports.PARAMS_CONTAINS.push(Y);let A=Q.contains.find((_)=>_.scope==="attr"),y=Object.assign({},A,{match:J.concat("[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\?:/))});Q.exports.PARAMS_CONTAINS.push([Q.exports.CLASS_REFERENCE,A,y]),Q.contains=Q.contains.concat([Y,X,W,y]),K(Q,"shebang",Z.SHEBANG()),K(Q,"use_strict",F);let w=Q.contains.find((_)=>_.label==="func.def");return w.relevance=0,Object.assign(Q,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),Q}M6.exports=uQ});var f6=U0((e$,V6)=>{function EQ(Z){let J=Z.regex,Q={className:"string",begin:/"(""|[^/n])"C\b/},$={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},q=/\d{1,2}\/\d{1,2}\/\d{4}/,X=/\d{4}-\d{1,2}-\d{1,2}/,W=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,F=/\d{1,2}(:\d{1,2}){1,2}/,H={className:"literal",variants:[{begin:J.concat(/# */,J.either(X,q),/ *#/)},{begin:J.concat(/# */,F,/ *#/)},{begin:J.concat(/# */,W,/ *#/)},{begin:J.concat(/# */,J.either(X,q),/ +/,J.either(W,F),/ *#/)}]},G={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},Y={className:"label",begin:/^\w+:/},K=Z.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),A=Z.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[Q,$,H,G,Y,K,A,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[A]}]}}V6.exports=EQ});var R6=U0((Z2,k6)=>{function pQ(Z){Z.regex;let J=Z.COMMENT(/\(;/,/;\)/);J.contains.push("self");let Q=Z.COMMENT(/;;/,/$/),$=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],q={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},X={className:"variable",begin:/\$[\w_]+/},W={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},F={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},H={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},G={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:$},contains:[Q,J,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},X,W,q,Z.QUOTE_STRING_MODE,H,G,F]}}k6.exports=pQ});var b6=U0((J2,I6)=>{var G0=c4();G0.registerLanguage("xml",d4());G0.registerLanguage("bash",l4());G0.registerLanguage("c",t4());G0.registerLanguage("cpp",o4());G0.registerLanguage("csharp",Z5());G0.registerLanguage("css",Q5());G0.registerLanguage("markdown",$5());G0.registerLanguage("diff",X5());G0.registerLanguage("ruby",F5());G0.registerLanguage("go",H5());G0.registerLanguage("graphql",Y5());G0.registerLanguage("ini",y5());G0.registerLanguage("java",P5());G0.registerLanguage("javascript",_5());G0.registerLanguage("json",N5());G0.registerLanguage("kotlin",f5());G0.registerLanguage("less",b5());G0.registerLanguage("lua",T5());G0.registerLanguage("makefile",x5());G0.registerLanguage("perl",D5());G0.registerLanguage("objectivec",m5());G0.registerLanguage("php",E5());G0.registerLanguage("php-template",i5());G0.registerLanguage("plaintext",a5());G0.registerLanguage("python",r5());G0.registerLanguage("python-repl",n5());G0.registerLanguage("r",s5());G0.registerLanguage("rust",e5());G0.registerLanguage("scss",J6());G0.registerLanguage("shell",z6());G0.registerLanguage("sql",q6());G0.registerLanguage("swift",y6());G0.registerLanguage("yaml",L6());G0.registerLanguage("typescript",N6());G0.registerLanguage("vbnet",f6());G0.registerLanguage("wasm",R6());G0.HighlightJS=G0;G0.default=G0;I6.exports=G0});var o9,C0,D8,i1,Z9,T8,h8,m8,NZ,d9,I9,u8,RZ,VZ,fZ,c1,n9={},t9=[],a1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,e9=Array.isArray;function s0(Z,J){for(var Q in J)Z[Q]=J[Q];return Z}function IZ(Z){Z&&Z.parentNode&&Z.parentNode.removeChild(Z)}function d1(Z,J,Q){var $,q,X,W={};for(X in J)X=="key"?$=J[X]:X=="ref"?q=J[X]:W[X]=J[X];if(arguments.length>2&&(W.children=arguments.length>3?o9.call(arguments,2):Q),typeof Z=="function"&&Z.defaultProps!=null)for(X in Z.defaultProps)W[X]===void 0&&(W[X]=Z.defaultProps[X]);return r9(Z,W,$,q,null)}function r9(Z,J,Q,$,q){var X={type:Z,props:J,key:Q,ref:$,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:q==null?++D8:q,__i:-1,__u:0};return q==null&&C0.vnode!=null&&C0.vnode(X),X}function z0(Z){return Z.children}function l9(Z,J){this.props=Z,this.context=J}function y9(Z,J){if(J==null)return Z.__?y9(Z.__,Z.__i+1):null;for(var Q;J<Z.__k.length;J++)if((Q=Z.__k[J])!=null&&Q.__e!=null)return Q.__e;return typeof Z.type=="function"?y9(Z):null}function r1(Z){if(Z.__P&&Z.__d){var J=Z.__v,Q=J.__e,$=[],q=[],X=s0({},J);X.__v=J.__v+1,C0.vnode&&C0.vnode(X),bZ(Z.__P,X,J,Z.__n,Z.__P.namespaceURI,32&J.__u?[Q]:null,$,Q==null?y9(J):Q,!!(32&J.__u),q),X.__v=J.__v,X.__.__k[X.__i]=X,c8($,X,q),J.__e=J.__=null,X.__e!=Q&&E8(X)}}function E8(Z){if((Z=Z.__)!=null&&Z.__c!=null)return Z.__e=Z.__c.base=null,Z.__k.some(function(J){if(J!=null&&J.__e!=null)return Z.__e=Z.__c.base=J.__e}),E8(Z)}function g8(Z){(!Z.__d&&(Z.__d=!0)&&Z9.push(Z)&&!s9.__r++||T8!=C0.debounceRendering)&&((T8=C0.debounceRendering)||h8)(s9)}function s9(){try{for(var Z,J=1;Z9.length;)Z9.length>J&&Z9.sort(m8),Z=Z9.shift(),J=Z9.length,r1(Z)}finally{Z9.length=s9.__r=0}}function p8(Z,J,Q,$,q,X,W,F,H,G,Y){var K,A,y,w,_,O,k,I=$&&$.__k||t9,B=J.length;for(H=l1(Q,J,I,H,B),K=0;K<B;K++)(y=Q.__k[K])!=null&&(A=y.__i!=-1&&I[y.__i]||n9,y.__i=K,O=bZ(Z,y,A,q,X,W,F,H,G,Y),w=y.__e,y.ref&&A.ref!=y.ref&&(A.ref&&SZ(A.ref,null,y),Y.push(y.ref,y.__c||w,y)),_==null&&w!=null&&(_=w),(k=!!(4&y.__u))||A.__k===y.__k?(H=i8(y,H,Z,k),k&&A.__e&&(A.__e=null)):typeof y.type=="function"&&O!==void 0?H=O:w&&(H=w.nextSibling),y.__u&=-7);return Q.__e=_,H}function l1(Z,J,Q,$,q){var X,W,F,H,G,Y=Q.length,K=Y,A=0;for(Z.__k=Array(q),X=0;X<q;X++)(W=J[X])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=Z.__k[X]=r9(null,W,null,null,null):e9(W)?W=Z.__k[X]=r9(z0,{children:W},null,null,null):W.constructor===void 0&&W.__b>0?W=Z.__k[X]=r9(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):Z.__k[X]=W,H=X+A,W.__=Z,W.__b=Z.__b+1,F=null,(G=W.__i=n1(W,Q,H,K))!=-1&&(K--,(F=Q[G])&&(F.__u|=2)),F==null||F.__v==null?(G==-1&&(q>Y?A--:q<Y&&A++),typeof W.type!="function"&&(W.__u|=4)):G!=H&&(G==H-1?A--:G==H+1?A++:(G>H?A--:A++,W.__u|=4))):Z.__k[X]=null;if(K)for(X=0;X<Y;X++)(F=Q[X])!=null&&(2&F.__u)==0&&(F.__e==$&&($=y9(F)),d8(F,F));return $}function i8(Z,J,Q,$){var q,X;if(typeof Z.type=="function"){for(q=Z.__k,X=0;q&&X<q.length;X++)q[X]&&(q[X].__=Z,J=i8(q[X],J,Q,$));return J}Z.__e!=J&&($&&(J&&Z.type&&!J.parentNode&&(J=y9(Z)),Q.insertBefore(Z.__e,J||null)),J=Z.__e);do J=J&&J.nextSibling;while(J!=null&&J.nodeType==8);return J}function n1(Z,J,Q,$){var q,X,W,F=Z.key,H=Z.type,G=J[Q],Y=G!=null&&(2&G.__u)==0;if(G===null&&F==null||Y&&F==G.key&&H==G.type)return Q;if($>(Y?1:0)){for(q=Q-1,X=Q+1;q>=0||X<J.length;)if((G=J[W=q>=0?q--:X++])!=null&&(2&G.__u)==0&&F==G.key&&H==G.type)return W}return-1}function x8(Z,J,Q){J[0]=="-"?Z.setProperty(J,Q==null?"":Q):Z[J]=Q==null?"":typeof Q!="number"||a1.test(J)?Q:Q+"px"}function a9(Z,J,Q,$,q){var X,W;Z:if(J=="style")if(typeof Q=="string")Z.style.cssText=Q;else{if(typeof $=="string"&&(Z.style.cssText=$=""),$)for(J in $)Q&&J in Q||x8(Z.style,J,"");if(Q)for(J in Q)$&&Q[J]==$[J]||x8(Z.style,J,Q[J])}else if(J[0]=="o"&&J[1]=="n")X=J!=(J=J.replace(u8,"$1")),W=J.toLowerCase(),J=W in Z||J=="onFocusOut"||J=="onFocusIn"?W.slice(2):J.slice(2),Z.l||(Z.l={}),Z.l[J+X]=Q,Q?$?Q[I9]=$[I9]:(Q[I9]=RZ,Z.addEventListener(J,X?fZ:VZ,X)):Z.removeEventListener(J,X?fZ:VZ,X);else{if(q=="http://www.w3.org/2000/svg")J=J.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(J!="width"&&J!="height"&&J!="href"&&J!="list"&&J!="form"&&J!="tabIndex"&&J!="download"&&J!="rowSpan"&&J!="colSpan"&&J!="role"&&J!="popover"&&J in Z)try{Z[J]=Q==null?"":Q;break Z}catch(F){}typeof Q=="function"||(Q==null||Q===!1&&J[4]!="-"?Z.removeAttribute(J):Z.setAttribute(J,J=="popover"&&Q==1?"":Q))}}function j8(Z){return function(J){if(this.l){var Q=this.l[J.type+Z];if(J[d9]==null)J[d9]=RZ++;else if(J[d9]<Q[I9])return;return Q(C0.event?C0.event(J):J)}}}function bZ(Z,J,Q,$,q,X,W,F,H,G){var Y,K,A,y,w,_,O,k,I,B,L,M,C,g,b,u=J.type;if(J.constructor!==void 0)return null;128&Q.__u&&(H=!!(32&Q.__u),X=[F=J.__e=Q.__e]),(Y=C0.__b)&&Y(J);Z:if(typeof u=="function")try{if(k=J.props,I=u.prototype&&u.prototype.render,B=(Y=u.contextType)&&$[Y.__c],L=Y?B?B.props.value:Y.__:$,Q.__c?O=(K=J.__c=Q.__c).__=K.__E:(I?J.__c=K=new u(k,L):(J.__c=K=new l9(k,L),K.constructor=u,K.render=s1),B&&B.sub(K),K.state||(K.state={}),K.__n=$,A=K.__d=!0,K.__h=[],K._sb=[]),I&&K.__s==null&&(K.__s=K.state),I&&u.getDerivedStateFromProps!=null&&(K.__s==K.state&&(K.__s=s0({},K.__s)),s0(K.__s,u.getDerivedStateFromProps(k,K.__s))),y=K.props,w=K.state,K.__v=J,A)I&&u.getDerivedStateFromProps==null&&K.componentWillMount!=null&&K.componentWillMount(),I&&K.componentDidMount!=null&&K.__h.push(K.componentDidMount);else{if(I&&u.getDerivedStateFromProps==null&&k!==y&&K.componentWillReceiveProps!=null&&K.componentWillReceiveProps(k,L),J.__v==Q.__v||!K.__e&&K.shouldComponentUpdate!=null&&K.shouldComponentUpdate(k,K.__s,L)===!1){J.__v!=Q.__v&&(K.props=k,K.state=K.__s,K.__d=!1),J.__e=Q.__e,J.__k=Q.__k,J.__k.some(function(i){i&&(i.__=J)}),t9.push.apply(K.__h,K._sb),K._sb=[],K.__h.length&&W.push(K);break Z}K.componentWillUpdate!=null&&K.componentWillUpdate(k,K.__s,L),I&&K.componentDidUpdate!=null&&K.__h.push(function(){K.componentDidUpdate(y,w,_)})}if(K.context=L,K.props=k,K.__P=Z,K.__e=!1,M=C0.__r,C=0,I)K.state=K.__s,K.__d=!1,M&&M(J),Y=K.render(K.props,K.state,K.context),t9.push.apply(K.__h,K._sb),K._sb=[];else do K.__d=!1,M&&M(J),Y=K.render(K.props,K.state,K.context),K.state=K.__s;while(K.__d&&++C<25);K.state=K.__s,K.getChildContext!=null&&($=s0(s0({},$),K.getChildContext())),I&&!A&&K.getSnapshotBeforeUpdate!=null&&(_=K.getSnapshotBeforeUpdate(y,w)),g=Y!=null&&Y.type===z0&&Y.key==null?a8(Y.props.children):Y,F=p8(Z,e9(g)?g:[g],J,Q,$,q,X,W,F,H,G),K.base=J.__e,J.__u&=-161,K.__h.length&&W.push(K),O&&(K.__E=K.__=null)}catch(i){if(J.__v=null,H||X!=null)if(i.then){for(J.__u|=H?160:128;F&&F.nodeType==8&&F.nextSibling;)F=F.nextSibling;X[X.indexOf(F)]=null,J.__e=F}else{for(b=X.length;b--;)IZ(X[b]);kZ(J)}else J.__e=Q.__e,J.__k=Q.__k,i.then||kZ(J);C0.__e(i,J,Q)}else X==null&&J.__v==Q.__v?(J.__k=Q.__k,J.__e=Q.__e):F=J.__e=t1(Q.__e,J,Q,$,q,X,W,H,G);return(Y=C0.diffed)&&Y(J),128&J.__u?void 0:F}function kZ(Z){Z&&(Z.__c&&(Z.__c.__e=!0),Z.__k&&Z.__k.some(kZ))}function c8(Z,J,Q){for(var $=0;$<Q.length;$++)SZ(Q[$],Q[++$],Q[++$]);C0.__c&&C0.__c(J,Z),Z.some(function(q){try{Z=q.__h,q.__h=[],Z.some(function(X){X.call(q)})}catch(X){C0.__e(X,q.__v)}})}function a8(Z){return typeof Z!="object"||Z==null||Z.__b>0?Z:e9(Z)?Z.map(a8):Z.constructor!==void 0?null:s0({},Z)}function t1(Z,J,Q,$,q,X,W,F,H){var G,Y,K,A,y,w,_,O=Q.props||n9,k=J.props,I=J.type;if(I=="svg"?q="http://www.w3.org/2000/svg":I=="math"?q="http://www.w3.org/1998/Math/MathML":q||(q="http://www.w3.org/1999/xhtml"),X!=null){for(G=0;G<X.length;G++)if((y=X[G])&&"setAttribute"in y==!!I&&(I?y.localName==I:y.nodeType==3)){Z=y,X[G]=null;break}}if(Z==null){if(I==null)return document.createTextNode(k);Z=document.createElementNS(q,I,k.is&&k),F&&(C0.__m&&C0.__m(J,X),F=!1),X=null}if(I==null)O===k||F&&Z.data==k||(Z.data=k);else{if(X=I=="textarea"&&k.defaultValue!=null?null:X&&o9.call(Z.childNodes),!F&&X!=null)for(O={},G=0;G<Z.attributes.length;G++)O[(y=Z.attributes[G]).name]=y.value;for(G in O)y=O[G],G=="dangerouslySetInnerHTML"?K=y:G=="children"||(G in k)||G=="value"&&("defaultValue"in k)||G=="checked"&&("defaultChecked"in k)||a9(Z,G,null,y,q);for(G in k)y=k[G],G=="children"?A=y:G=="dangerouslySetInnerHTML"?Y=y:G=="value"?w=y:G=="checked"?_=y:F&&typeof y!="function"||O[G]===y||a9(Z,G,y,O[G],q);if(Y)F||K&&(Y.__html==K.__html||Y.__html==Z.innerHTML)||(Z.innerHTML=Y.__html),J.__k=[];else if(K&&(Z.innerHTML=""),p8(J.type=="template"?Z.content:Z,e9(A)?A:[A],J,Q,$,I=="foreignObject"?"http://www.w3.org/1999/xhtml":q,X,W,X?X[0]:Q.__k&&y9(Q,0),F,H),X!=null)for(G=X.length;G--;)IZ(X[G]);F&&I!="textarea"||(G="value",I=="progress"&&w==null?Z.removeAttribute("value"):w!=null&&(w!==Z[G]||I=="progress"&&!w||I=="option"&&w!=O[G])&&a9(Z,G,w,O[G],q),G="checked",_!=null&&_!=Z[G]&&a9(Z,G,_,O[G],q))}return Z}function SZ(Z,J,Q){try{if(typeof Z=="function"){var $=typeof Z.__u=="function";$&&Z.__u(),$&&J==null||(Z.__u=Z(J))}else Z.current=J}catch(q){C0.__e(q,Q)}}function d8(Z,J,Q){var $,q;if(C0.unmount&&C0.unmount(Z),($=Z.ref)&&($.current&&$.current!=Z.__e||SZ($,null,J)),($=Z.__c)!=null){if($.componentWillUnmount)try{$.componentWillUnmount()}catch(X){C0.__e(X,J)}$.base=$.__P=null}if($=Z.__k)for(q=0;q<$.length;q++)$[q]&&d8($[q],J,Q||typeof Z.type!="function");Q||IZ(Z.__e),Z.__c=Z.__=Z.__e=void 0}function s1(Z,J,Q){return this.constructor(Z,Q)}function TZ(Z,J,Q){var $,q,X,W;J==document&&(J=document.documentElement),C0.__&&C0.__(Z,J),q=($=typeof Q=="function")?null:Q&&Q.__k||J.__k,X=[],W=[],bZ(J,Z=(!$&&Q||J).__k=d1(z0,null,[Z]),q||n9,n9,J.namespaceURI,!$&&Q?[Q]:q?null:J.firstChild?o9.call(J.childNodes):null,X,!$&&Q?Q:q?q.__e:J.firstChild,$,W),c8(X,Z,W)}o9=t9.slice,C0={__e:function(Z,J,Q,$){for(var q,X,W;J=J.__;)if((q=J.__c)&&!q.__)try{if((X=q.constructor)&&X.getDerivedStateFromError!=null&&(q.setState(X.getDerivedStateFromError(Z)),W=q.__d),q.componentDidCatch!=null&&(q.componentDidCatch(Z,$||{}),W=q.__d),W)return q.__E=q}catch(F){Z=F}throw Z}},D8=0,i1=function(Z){return Z!=null&&Z.constructor===void 0},l9.prototype.setState=function(Z,J){var Q;Q=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=s0({},this.state),typeof Z=="function"&&(Z=Z(s0({},Q),this.props)),Z&&s0(Q,Z),Z!=null&&this.__v&&(J&&this._sb.push(J),g8(this))},l9.prototype.forceUpdate=function(Z){this.__v&&(this.__e=!0,Z&&this.__h.push(Z),g8(this))},l9.prototype.render=z0,Z9=[],h8=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m8=function(Z,J){return Z.__v.__b-J.__v.__b},s9.__r=0,NZ=Math.random().toString(8),d9="__d"+NZ,I9="__a"+NZ,u8=/(PointerCapture)$|Capture$/i,RZ=0,VZ=j8(!1),fZ=j8(!0),c1=0;var B9,N0,gZ,r8,b9=0,J4=[],R0=C0,l8=R0.__b,n8=R0.__r,t8=R0.diffed,s8=R0.__c,o8=R0.unmount,e8=R0.__;function JZ(Z,J){R0.__h&&R0.__h(N0,Z,b9||J),b9=0;var Q=N0.__H||(N0.__H={__:[],__h:[]});return Z>=Q.__.length&&Q.__.push({}),Q.__[Z]}function p(Z){return b9=1,o1($4,Z)}function o1(Z,J,Q){var $=JZ(B9++,2);if($.t=Z,!$.__c&&($.__=[Q?Q(J):$4(void 0,J),function(F){var H=$.__N?$.__N[0]:$.__[0],G=$.t(H,F);H!==G&&($.__N=[G,$.__[1]],$.__c.setState({}))}],$.__c=N0,!N0.__f)){var q=function(F,H,G){if(!$.__c.__H)return!0;var Y=$.__c.__H.__.filter(function(A){return A.__c});if(Y.every(function(A){return!A.__N}))return!X||X.call(this,F,H,G);var K=$.__c.props!==F;return Y.some(function(A){if(A.__N){var y=A.__[0];A.__=A.__N,A.__N=void 0,y!==A.__[0]&&(K=!0)}}),X&&X.call(this,F,H,G)||K};N0.__f=!0;var{shouldComponentUpdate:X,componentWillUpdate:W}=N0;N0.componentWillUpdate=function(F,H,G){if(this.__e){var Y=X;X=void 0,q(F,H,G),X=Y}W&&W.call(this,F,H,G)},N0.shouldComponentUpdate=q}return $.__N||$.__}function L0(Z,J){var Q=JZ(B9++,3);!R0.__s&&jZ(Q.__H,J)&&(Q.__=Z,Q.u=J,N0.__H.__h.push(Q))}function Q4(Z,J){var Q=JZ(B9++,4);!R0.__s&&jZ(Q.__H,J)&&(Q.__=Z,Q.u=J,N0.__h.push(Q))}function y0(Z){return b9=5,z4(function(){return{current:Z}},[])}function z4(Z,J){var Q=JZ(B9++,7);return jZ(Q.__H,J)&&(Q.__=Z(),Q.__H=J,Q.__h=Z),Q.__}function q9(Z,J){return b9=8,z4(function(){return Z},J)}function e1(){for(var Z;Z=J4.shift();){var J=Z.__H;if(Z.__P&&J)try{J.__h.some(ZZ),J.__h.some(xZ),J.__h=[]}catch(Q){J.__h=[],R0.__e(Q,Z.__v)}}}R0.__b=function(Z){N0=null,l8&&l8(Z)},R0.__=function(Z,J){Z&&J.__k&&J.__k.__m&&(Z.__m=J.__k.__m),e8&&e8(Z,J)},R0.__r=function(Z){n8&&n8(Z),B9=0;var J=(N0=Z.__c).__H;J&&(gZ===N0?(J.__h=[],N0.__h=[],J.__.some(function(Q){Q.__N&&(Q.__=Q.__N),Q.u=Q.__N=void 0})):(J.__h.some(ZZ),J.__h.some(xZ),J.__h=[],B9=0)),gZ=N0},R0.diffed=function(Z){t8&&t8(Z);var J=Z.__c;J&&J.__H&&(J.__H.__h.length&&(J4.push(J)!==1&&r8===R0.requestAnimationFrame||((r8=R0.requestAnimationFrame)||Z7)(e1)),J.__H.__.some(function(Q){Q.u&&(Q.__H=Q.u),Q.u=void 0})),gZ=N0=null},R0.__c=function(Z,J){J.some(function(Q){try{Q.__h.some(ZZ),Q.__h=Q.__h.filter(function($){return!$.__||xZ($)})}catch($){J.some(function(q){q.__h&&(q.__h=[])}),J=[],R0.__e($,Q.__v)}}),s8&&s8(Z,J)},R0.unmount=function(Z){o8&&o8(Z);var J,Q=Z.__c;Q&&Q.__H&&(Q.__H.__.some(function($){try{ZZ($)}catch(q){J=q}}),Q.__H=void 0,J&&R0.__e(J,Q.__v))};var Z4=typeof requestAnimationFrame=="function";function Z7(Z){var J,Q=function(){clearTimeout($),Z4&&cancelAnimationFrame(J),setTimeout(Z)},$=setTimeout(Q,35);Z4&&(J=requestAnimationFrame(Q))}function ZZ(Z){var J=N0,Q=Z.__c;typeof Q=="function"&&(Z.__c=void 0,Q()),N0=J}function xZ(Z){var J=N0;Z.__c=Z.__(),N0=J}function jZ(Z,J){return!Z||Z.length!==J.length||J.some(function(Q,$){return Q!==Z[$]})}function $4(Z,J){return typeof J=="function"?J(Z):J}async function w0(Z,J,Q){let $=await fetch(J,{method:Z,headers:Q!==void 0?{"content-type":"application/json"}:void 0,body:Q!==void 0?JSON.stringify(Q):void 0}),q=await $.json().catch(()=>null);if(!$.ok||q&&q.error)throw Error(q&&q.error||`${$.status} ${$.statusText}`);return q}var b0=(Z)=>encodeURIComponent(Z),n={listDatabases:()=>w0("GET","/api/databases"),createDatabase:(Z)=>w0("POST","/api/databases",Z),updateDatabase:(Z,J)=>w0("PATCH",`/api/database?id=${b0(Z)}`,J),deleteDatabase:(Z)=>w0("DELETE",`/api/database?id=${b0(Z)}`),listProperties:(Z)=>w0("GET",`/api/properties?db=${b0(Z)}`),createProperty:(Z)=>w0("POST","/api/properties",Z),updateProperty:(Z,J)=>w0("PATCH",`/api/property?id=${b0(Z)}`,J),setColumnWidth:(Z,J)=>w0("PATCH",`/api/property/width?id=${b0(Z)}`,{width:J}),deleteProperty:(Z)=>w0("DELETE",`/api/property?id=${b0(Z)}`),listRecords:(Z,J={})=>{let Q=new URLSearchParams({db:Z});if(J.sort)Q.set("sort",J.sort);if(J.limit!=null)Q.set("limit",String(J.limit));return w0("GET",`/api/records?${Q}`)},createRecord:(Z,J)=>w0("POST",`/api/records?db=${b0(Z)}`,J),getRecord:(Z)=>w0("GET",`/api/record?id=${b0(Z)}`),updateRecord:(Z,J)=>w0("PATCH",`/api/record?id=${b0(Z)}`,J),moveRecord:(Z,J,Q)=>w0("PATCH",`/api/record/order?id=${b0(Z)}`,{target:J,where:Q}),deleteRecord:(Z)=>w0("DELETE",`/api/record?id=${b0(Z)}`),listDocuments:(Z)=>w0("GET",Z?`/api/documents?db=${b0(Z)}`:"/api/documents"),listDocumentsByParent:(Z)=>w0("GET",`/api/documents?parent=${b0(Z)}`),createDocument:(Z)=>w0("POST","/api/documents",Z),getDocument:(Z)=>w0("GET",`/api/document?id=${b0(Z)}`),updateDocument:(Z,J)=>w0("PATCH",`/api/document?id=${b0(Z)}`,J),deleteDocument:(Z)=>w0("DELETE",`/api/document?id=${b0(Z)}`),search:(Z,J)=>{let Q=new URLSearchParams({q:Z});if(J!=null)Q.set("limit",String(J));return w0("GET",`/api/search?${Q}`)},listPeers:()=>w0("GET","/api/peers"),newPairingCode:()=>w0("POST","/api/pair/new"),addPeerByPairing:(Z)=>w0("POST","/api/peers/pair",Z),updatePeer:(Z,J)=>w0("PATCH",`/api/peer?url=${b0(Z)}`,J),removePeer:(Z)=>w0("DELETE",`/api/peer?url=${b0(Z)}`),syncPeer:(Z)=>w0("POST",`/api/peer/sync?url=${b0(Z)}`),listGrants:()=>w0("GET","/api/grants"),revokeGrant:(Z)=>w0("DELETE",`/api/grant?token=${b0(Z)}`),version:()=>w0("GET","/api/version")},L9={text:{ic:"text",t:"文本"},number:{ic:"hash",t:"数字"},select:{ic:"select",t:"单选"},multi_select:{ic:"multi",t:"多选"},checkbox:{ic:"checkbox",t:"复选框"},date:{ic:"calendar",t:"日期"},url:{ic:"link",t:"链接"},relation:{ic:"relation",t:"关联"}};var J7=0;function z(Z,J,Q,$,q,X){J||(J={});var W,F,H=J;if("ref"in H)for(F in H={},J)F=="ref"?W=J[F]:H[F]=J[F];var G={type:Z,props:H,key:Q,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--J7,__i:-1,__u:0,__source:q,__self:X};if(typeof Z=="function"&&(W=Z.defaultProps))for(F in W)H[F]===void 0&&(H[F]=W[F]);return C0.vnode&&C0.vnode(G),G}var Q7={cube:'<path d="M21 7.5 12 2 3 7.5v9L12 22l9-5.5z"/><path d="m3 7.5 9 5.5 9-5.5M12 22v-9"/>',chevron:'<path d="m9 6 6 6-6 6"/>',chevronDown:'<path d="m6 9 6 6 6-6"/>',plus:'<path d="M12 5v14M5 12h14"/>',pin:'<path d="M9 4h6l-1 6 3 3v2H7v-2l3-3z"/><path d="M12 16v5"/>',search:'<circle cx="11" cy="11" r="7"/><path d="m20 20-3.2-3.2"/>',dots:'<circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/>',grip:'<circle cx="9" cy="6" r="1.3" fill="currentColor" stroke="none"/><circle cx="9" cy="12" r="1.3" fill="currentColor" stroke="none"/><circle cx="9" cy="18" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="6" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="12" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="18" r="1.3" fill="currentColor" stroke="none"/>',trash:'<path d="M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>',filter:'<path d="M3 5h18l-7 8v6l-4-2v-4z"/>',sort:'<path d="M7 3v14M7 17l-3-3M7 17l3-3M17 21V7M17 7l-3 3M17 7l3 3"/>',group:'<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',check:'<path d="M5 12.5 10 17l9-10"/>',x:'<path d="M6 6 18 18M18 6 6 18"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',database:'<ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"/><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"/>',table:'<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16"/>',alignLeft:'<path d="M4 6h16M4 12h10M4 18h13"/>',alignCenter:'<path d="M4 6h16M7 12h10M5 18h14"/>',alignRight:'<path d="M4 6h16M10 12h10M7 18h13"/>',share:'<path d="M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7"/><path d="M12 3v13M8 7l4-4 4 4"/>',download:'<path d="M12 3v12M8 11l4 4 4-4"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/>',copy:'<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/>',link:'<path d="M10 13a5 5 0 0 0 7 0l2-2a5 5 0 0 0-7-7l-1 1"/><path d="M14 11a5 5 0 0 0-7 0l-2 2a5 5 0 0 0 7 7l1-1"/>',calendar:'<rect x="3" y="4" width="18" height="17" rx="2"/><path d="M3 9h18M8 2v4M16 2v4"/>',timeline:'<rect x="3" y="5" width="9" height="3" rx="1.5"/><rect x="8" y="10.5" width="11" height="3" rx="1.5"/><rect x="5" y="16" width="7" height="3" rx="1.5"/>',hash:'<path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/>',text:'<path d="M4 6h16M4 6v-.5M8 6v13M4 19h8"/><path d="M14 11h6M17 11v8M14 19h6"/>',list:'<path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"/>',numList:'<path d="M10 6h10M10 12h10M10 18h10M4 5h1v4M4 9h2M4 13.5c0-.8 2-.8 2 0 0 .8-2 1.2-2 2.5h2"/>',checkbox:'<rect x="4" y="4" width="16" height="16" rx="3"/><path d="m9 12 2 2 4-4"/>',select:'<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3" fill="currentColor" stroke="none"/>',multi:'<path d="M8 6h12M8 12h12M8 18h12M3 6h.01M3 12h.01M3 18h.01"/>',relation:'<path d="M7 7h4v4H7zM13 13h4v4h-4z"/><path d="M11 9h2a2 2 0 0 1 2 2v2"/>',quote:'<path d="M7 7c-2 1-3 3-3 6h3v4H4v-4M17 7c-2 1-3 3-3 6h3v4h-3v-4"/>',code:'<path d="m8 8-4 4 4 4M16 8l4 4-4 4M13 6l-2 12"/>',minus:'<path d="M5 12h14"/>',heading:'<path d="M6 4v16M18 4v16M6 12h12"/>',panelLeft:'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16"/>',cornerUpRight:'<path d="M5 19V11a4 4 0 0 1 4-4h10M15 3l4 4-4 4"/>',openPeek:'<rect x="3" y="5" width="18" height="14" rx="2.5"/><rect x="6" y="8" width="4" height="8" rx="1" fill="currentColor" stroke="none"/>',settings:'<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>',eyeOff:'<path d="M4 4l16 16M9.5 9.5a3 3 0 0 0 4 4M6.5 6.7C4.5 8 3 10 2 12c2 4 6 7 10 7 1.6 0 3-.4 4.4-1.1M9.5 5.2A9.7 9.7 0 0 1 12 5c4 0 8 3 10 7-.6 1.3-1.5 2.5-2.5 3.5"/>',bold:'<path d="M6 4h7a4 4 0 0 1 0 8H6zM6 12h8a4 4 0 0 1 0 8H6z"/>',italic:'<path d="M19 4h-9M14 20H5M15 4 9 20"/>',underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4M4 21h16"/>',strike:'<path d="M4 12h16M7 7a4 4 0 0 1 7-1M9 17a4 4 0 0 0 7-2"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>',moon:'<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',monitor:'<rect x="3" y="4" width="18" height="13" rx="2"/><path d="M8 21h8M12 17v4"/>'};function D({name:Z,cls:J="ico"}){return z("svg",{class:J,viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:Q7[Z]??""}},void 0,!1,void 0,this)}var E0={text:"text",number:"hash",select:"select",multi_select:"multi",checkbox:"checkbox",date:"calendar",url:"link",relation:"relation"};function DZ(Z){let J=Z,Q=new Set;return{get:()=>J,set:($)=>{J=$,Q.forEach((q)=>q($))},use(){let[$,q]=p(J);return L0(()=>{return Q.add(q),()=>void Q.delete(q)},[]),$}}}var S9=DZ([]),z7=0;function V0(Z){let J=++z7;S9.set([...S9.get(),{id:J,msg:Z}]),setTimeout(()=>S9.set(S9.get().filter((Q)=>Q.id!==J)),2600)}var hZ=DZ(null);function v0(Z,J,Q={}){hZ.set({render:J,anchor:Z,minWidth:Q.minWidth})}function q4(){hZ.set(null)}function $7(Z){if(Z instanceof MouseEvent)return{x:Z.clientX,y:Z.clientY};if("rect"in Z)return{x:Z.rect.left,y:Z.rect.bottom,bottom:Z.rect.bottom};return{x:Z.x,y:Z.y}}function q7(){let Z=hZ.use(),J=y0(null),[Q,$]=p(null);if(Q4(()=>{if(!Z||!J.current)return $(null);let{x:q,y:X}=$7(Z.anchor),W=J.current.getBoundingClientRect();$({left:Math.min(q,innerWidth-W.width-10),top:Math.min(X+4,innerHeight-W.height-10)})},[Z]),!Z)return null;return z("div",{class:"menu-layer",onMouseDown:(q)=>q.target===q.currentTarget&&q4(),children:z("div",{ref:J,class:"pop",style:{left:Q?.left??-9999,top:Q?.top??-9999,minWidth:Z.minWidth},onMouseDown:(q)=>q.stopPropagation(),children:Z.render(q4)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function S0({children:Z}){return z("div",{class:"lbl",children:Z},void 0,!1,void 0,this)}function _0(){return z("div",{class:"sep"},void 0,!1,void 0,this)}function e({icon:Z,label:J,sublabel:Q,danger:$,checked:q,onClick:X}){return z("button",{class:"item"+($?" danger":""),onClick:X,children:[Z&&z("span",{class:"lico plain",children:z(D,{name:Z,cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"meta",children:[z("span",{class:"t",children:J},void 0,!1,void 0,this),Q&&z("span",{class:"d",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&z("span",{class:"chk",children:z(D,{name:"check",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var mZ=DZ(null);function X9(Z){mZ.set(Z)}function c0(){mZ.set(null)}function W9({title:Z,sub:J,children:Q,footer:$,width:q}){return z("div",{class:"modal",style:{width:q},onMouseDown:(X)=>X.stopPropagation(),children:[z("div",{class:"modal-head",children:[z("h3",{children:Z},void 0,!1,void 0,this),J&&z("p",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"modal-body",children:Q},void 0,!1,void 0,this),$&&z("div",{class:"modal-foot",children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function X7(){let Z=mZ.use();return L0(()=>{if(!Z)return;let J=(Q)=>Q.key==="Escape"&&c0();return addEventListener("keydown",J),()=>removeEventListener("keydown",J)},[Z]),z("div",{class:"modal-scrim"+(Z?" open":""),onMouseDown:(J)=>J.target===J.currentTarget&&c0(),children:Z},void 0,!1,void 0,this)}function j0(Z){return new Promise((J)=>{let Q=($)=>{c0(),J($)};X9(z(W9,{title:Z.title,footer:z(z0,{children:[z("button",{class:"btn btn-secondary",onClick:()=>Q(!1),children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn "+(Z.danger?"btn-danger":"btn-primary"),onClick:()=>Q(!0),children:Z.confirmLabel??"确定"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:z("div",{class:"muted",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this))})}function w9(Z){return new Promise((J)=>{let Q=Z.value??"",$=(q)=>{c0(),J(q)};X9(z(W9,{title:Z.title,footer:z(z0,{children:[z("button",{class:"btn btn-secondary",onClick:()=>$(null),children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:()=>$(Q.trim()||(Z.value??"")),children:Z.confirmLabel??"保存"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[Z.label&&z("div",{class:"field-label",children:Z.label},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,value:Z.value??"",placeholder:Z.placeholder,onInput:(q)=>Q=q.target.value,onKeyDown:(q)=>{if(q.key==="Enter")$(Q.trim()||(Z.value??""))}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))})}function QZ(){let Z=S9.use();return z(z0,{children:[z(q7,{},void 0,!1,void 0,this),z(X7,{},void 0,!1,void 0,this),z("div",{class:"toasts",children:Z.map((J)=>z("div",{class:"toast",children:[z(D,{name:"check",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:J.msg},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var uZ=null;function W4(Z){let[J,Q]=p(new Set),[$,q]=p(""),X=G7(Z.onResize),W=(y)=>{let w=new Set(J);w.has(y)?w.delete(y):w.add(y),Q(w)},F=(y)=>y().catch((w)=>Z.onError(String(w.message))),H=(y)=>F(async()=>{let w=await n.createDocument({title:"",...y?{parent_id:y}:{}});if(y)J.add(y);await Z.reloadNav(),Z.onOpenDoc(w.id)}),G=(y,w,_)=>F(async()=>{if(y===w.id)return;if(F7(Z.docs,y,w.id))return;let O=_==="into"?w.id:w.parent_id;if(await n.updateDocument(y,{parent_id:O}),_==="into")J.add(w.id);await Z.reloadNav()}),Y=(y,w)=>{y.stopPropagation(),v0(y,(_)=>z(z0,{children:[z(e,{icon:"settings",label:"重命名…",onClick:async()=>{_();let O=await w9({title:"重命名数据库",value:w.name});if(O&&O!==w.name)F(async()=>{await n.updateDatabase(w.id,{name:O}),await Z.reloadNav()})}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除数据库",danger:!0,onClick:async()=>{if(_(),await j0({title:"删除数据库?",message:`「${w.name}」及其所有记录将被永久删除。`,confirmLabel:"删除",danger:!0}))F(async()=>{await n.deleteDatabase(w.id),await Z.reloadNav(),Z.afterDelete("db",w.id)})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},K=(y,w)=>{y.stopPropagation();let _=Z.docs.filter((O)=>O.parent_id===w.id).length;v0(y,(O)=>z(z0,{children:[z(e,{icon:"plus",label:"新建子页",onClick:()=>{O(),H(w.id)}},void 0,!1,void 0,this),z(e,{icon:"settings",label:"重命名…",onClick:async()=>{O();let k=await w9({title:"重命名文档",value:w.title});if(k)F(async()=>{await n.updateDocument(w.id,{title:k}),await Z.reloadNav()})}},void 0,!1,void 0,this),w.parent_id&&z(e,{icon:"cornerUpRight",label:"移到顶层",onClick:()=>{O(),F(async()=>{await n.updateDocument(w.id,{parent_id:null}),await Z.reloadNav()})}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除",danger:!0,onClick:async()=>{if(O(),await j0({title:"删除文档?",message:_?`「${w.title||"无标题"}」及其 ${_} 个子页将被删除。`:`「${w.title||"无标题"}」将被删除。`,confirmLabel:"删除",danger:!0}))F(async()=>{await G4(Z.docs,w.id),await Z.reloadNav(),Z.afterDelete("doc",w.id)})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},A=(y,w=0)=>{return Z.docs.filter((O)=>O.parent_id===y).map((O)=>{let k=Z.docs.filter((B)=>B.parent_id===O.id),I=k.length>0&&J.has(O.id);return z("div",{class:w?"navchildren":"",children:[z("div",{class:"navitem"+(Z.activeKind==="doc"&&Z.activeId===O.id?" active":""),draggable:!0,onClick:()=>Z.onOpenDoc(O.id),onDragStart:(B)=>{B.stopPropagation(),uZ=O.id,B.currentTarget.classList.add("dragging")},onDragEnd:(B)=>{B.currentTarget.classList.remove("dragging"),EZ()},onDragOver:(B)=>{B.preventDefault(),B.stopPropagation(),W7(B.currentTarget,B)},onDrop:(B)=>{B.preventDefault(),B.stopPropagation();let L=F4(B.currentTarget,B),M=uZ;if(uZ=null,EZ(),M)G(M,O,L)},children:[z("span",{class:"tw"+(I?" open":""),onClick:(B)=>{if(B.stopPropagation(),k.length)W(O.id)},children:k.length>0&&z(D,{name:"chevron",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"emoji",children:z(D,{name:"file",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"label",children:O.title||"无标题"},void 0,!1,void 0,this),z("span",{class:"acts",children:[z("button",{title:"新建子页",onClick:(B)=>{B.stopPropagation(),H(O.id)},children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{title:"更多",onClick:(B)=>K(B,O),children:z(D,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I&&A(O.id,w+1)]},O.id,!0,void 0,this)})};return z("div",{class:"sidebar"+(Z.collapsed?" collapsed":""),style:{width:Z.width,marginLeft:Z.collapsed?-Z.width:void 0},children:[z("div",{class:"sb-head",children:[z("div",{class:"brand",children:[z("span",{class:"mark",children:z(D,{name:"cube"},void 0,!1,void 0,this)},void 0,!1,void 0,this),"Metahub"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"收起侧栏",onClick:Z.onCollapse,children:z(D,{name:"panelLeft"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-search",onClick:(y)=>y.currentTarget.querySelector("input")?.focus(),children:[z(D,{name:"search",cls:"ico sm"},void 0,!1,void 0,this),z("input",{placeholder:"搜索…",value:$,onInput:(y)=>q(y.target.value),onKeyDown:(y)=>{if(y.key==="Enter"&&$.trim())Z.onSearch($.trim())}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-scroll",children:[z("div",{class:"sb-section",children:[z("div",{class:"sb-section-head",children:[z("span",{children:"数据库"},void 0,!1,void 0,this),z("button",{class:"add",title:"新建数据库",onClick:()=>H7(Z.onOpenDb,Z.reloadNav,Z.onError),children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z.databases.map((y)=>z("div",{class:"navitem"+(Z.activeKind==="db"&&Z.activeId===y.id?" active":""),onClick:()=>Z.onOpenDb(y.id),children:[z("span",{class:"emoji",children:y.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("span",{class:"label",children:y.name},void 0,!1,void 0,this),z("span",{class:"acts",children:z("button",{title:"更多",onClick:(w)=>Y(w,y),children:z(D,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},y.id,!0,void 0,this)),Z.databases.length===0&&z("div",{class:"navitem muted",children:"暂无"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-section",children:[z("div",{class:"sb-section-head",children:[z("span",{children:"文档"},void 0,!1,void 0,this),z("button",{class:"add",title:"新建文档",onClick:()=>H(null),children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A(null),Z.docs.length===0&&z("div",{class:"navitem muted",children:"暂无"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-footer",children:z("button",{class:"navitem"+(Z.settingsActive?" active":""),onClick:Z.onOpenSettings,children:[z("span",{class:"emoji",children:z(D,{name:"settings",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"label",children:"设置"},void 0,!1,void 0,this),Z.updatePending&&z("span",{class:"nav-dot",title:"有可用更新"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("div",{class:"sb-resizer",onMouseDown:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function EZ(){document.querySelectorAll(".drop-into,.drop-before,.drop-after").forEach((Z)=>Z.classList.remove("drop-into","drop-before","drop-after"))}function F4(Z,J){let Q=Z.getBoundingClientRect(),$=J.clientY-Q.top;return $<Q.height*0.28?"before":$>Q.height*0.72?"after":"into"}function W7(Z,J){EZ(),Z.classList.add("drop-"+F4(Z,J))}function F7(Z,J,Q){let $=Z.find((q)=>q.id===Q);while($){if($.parent_id===J)return!0;$=Z.find((q)=>q.id===$.parent_id)}return!1}async function G4(Z,J){for(let Q of Z.filter(($)=>$.parent_id===J))await G4(Z,Q.id);await n.deleteDocument(J)}function G7(Z){return(J)=>{J.preventDefault();let Q=(q)=>Z(Math.max(210,Math.min(460,q.clientX))),$=()=>{removeEventListener("mousemove",Q),removeEventListener("mouseup",$)};addEventListener("mousemove",Q),addEventListener("mouseup",$)}}var X4={blank:[{name:"名称",type:"text"}],tasks:[{name:"名称",type:"text"},{name:"状态",type:"select",config:{options:["待办","进行中","已完成"]}},{name:"优先级",type:"select",config:{options:["高","中","低"]}},{name:"截止",type:"date"}],crm:[{name:"姓名",type:"text"},{name:"公司",type:"text"},{name:"分类",type:"select",config:{options:["客户","合作","潜在"]}},{name:"邮箱",type:"url"}]};function H7(Z,J,Q){X9(z(K7,{onOpenDb:Z,reloadNav:J,onError:Q},void 0,!1,void 0,this))}function K7(Z){let J=["\uD83D\uDDC2️","\uD83C\uDFAF","\uD83E\uDD1D","\uD83D\uDCE6","\uD83D\uDCDA","\uD83D\uDCA1","\uD83E\uDDE9","\uD83D\uDCCA","\uD83D\uDDD3️","✅"],Q=[["blank","空白","仅一个「名称」列"],["tasks","任务","状态·优先级·截止"],["crm","联系人","公司·分类·邮箱"]],[$,q]=p(""),[X,W]=p(J[0]),[F,H]=p("blank"),G=y0(!1),Y=async()=>{if(G.current)return;G.current=!0;try{let K=await n.createDatabase({name:$.trim()||"未命名数据库",icon:X});for(let A of X4[F]??X4.blank)await n.createProperty({db:K.id,name:A.name,type:A.type,config:A.config});c0(),await Z.reloadNav(),Z.onOpenDb(K.id),V0(`已创建数据库「${K.name}」`)}catch(K){Z.onError(String(K.message))}finally{G.current=!1}};return z(W9,{title:"新建数据库",sub:"创建一个带属性列的结构化数据表。",footer:z(z0,{children:[z("button",{class:"btn btn-secondary",onClick:c0,children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:Y,children:"创建"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{class:"field-label",children:"名称"},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,placeholder:"例如:项目、客户、库存…",value:$,onInput:(K)=>q(K.target.value),onKeyDown:(K)=>K.key==="Enter"&&Y()},void 0,!1,void 0,this),z("div",{class:"field-label",children:"图标"},void 0,!1,void 0,this),z("div",{class:"icon-pick",children:J.map((K)=>z("button",{class:K===X?"sel":"",onClick:()=>W(K),children:K},K,!1,void 0,this))},void 0,!1,void 0,this),z("div",{class:"field-label",children:"模板"},void 0,!1,void 0,this),z("div",{class:"tmpl",children:Q.map(([K,A,y])=>z("button",{class:K===F?"sel":"",onClick:()=>H(K),children:[z("div",{class:"tt",children:A},void 0,!1,void 0,this),z("div",{class:"td",children:y},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var H4=[4,28,45,130,165,200,220,255,290,330];function pZ(Z){let J=0;for(let Q=0;Q<Z.length;Q++)J=J*31+Z.charCodeAt(Q)>>>0;return`hsl(${H4[J%H4.length]} 65% 45%)`}function F9({text:Z}){return z("span",{class:"chip",style:{["--c"]:pZ(Z)},children:Z},void 0,!1,void 0,this)}function P9({prop:Z,val:J}){if(J==null||J===""||Array.isArray(J)&&J.length===0)return z("span",{class:"muted",children:" "},void 0,!1,void 0,this);if(Z.type==="select")return z(F9,{text:String(J)},void 0,!1,void 0,this);if(Z.type==="multi_select"||Z.type==="relation")return z(z0,{children:J.map((Q)=>z(F9,{text:String(Q)},String(Q),!1,void 0,this))},void 0,!1,void 0,this);if(Z.type==="url")return z("a",{href:String(J),target:"_blank",rel:"noreferrer",onClick:(Q)=>Q.stopPropagation(),children:String(J)},void 0,!1,void 0,this);return z("span",{children:String(J)},void 0,!1,void 0,this)}function iZ(Z,J){if(Z==="relation")return J.split(",").map((Q)=>Q.trim()).filter(Boolean);return J}function K4(Z,J){if(J==null)return"";if(Array.isArray(J))return J.join(", ");return String(J)}var G9="\x00__ungrouped__";function Y4({props:Z,records:J,onCommitValue:Q,onCreate:$,onOpenRecord:q,onMove:X}){let W=Z.filter((L)=>L.type==="select"||L.type==="multi_select"),[F,H]=p(null),G=Z.find((L)=>L.id===F)??W.find((L)=>L.type==="select")??W[0]??null,Y=y0(null);if(!G)return z("div",{class:"view-placeholder",children:"看板视图需要一个「单选」或「多选」属性来分组。请在表格视图中添加一个单选列后再切换到看板。"},void 0,!1,void 0,this);let K=Z[0],A=G.type==="multi_select",y=G.config?.options??[],w=(L)=>{let M=L.values[G.name];if(A){let g=(Array.isArray(M)?M:[]).map(String).filter((b)=>y.includes(b));return g.length?g:[G9]}let C=M==null?"":String(M);return C&&y.includes(C)?[C]:[G9]},_=new Map;for(let L of y)_.set(L,[]);_.set(G9,[]);for(let L of J)for(let M of w(L))_.get(M)?.push(L);let O=[...y];if((_.get(G9)?.length??0)>0)O.push(G9);let k=()=>document.querySelectorAll(".board-col.drop-into").forEach((L)=>L.classList.remove("drop-into")),I=(L,M)=>{if(L.button!==0)return;if(L.target.closest("button,a,input"))return;let C=L.currentTarget.closest(".kcard");if(!C)return;let g=C.getBoundingClientRect();L.preventDefault(),Y.current={id:M.id,pointerId:L.pointerId,startX:L.clientX,startY:L.clientY,offsetX:L.clientX-g.left,offsetY:L.clientY-g.top,active:!1,source:C,ghost:null};let b=(i)=>{let r=Y.current;if(!r||r.pointerId!==i.pointerId)return;if(!r.active){if(Math.hypot(i.clientX-r.startX,i.clientY-r.startY)<4)return;r.active=!0;let T=r.source.cloneNode(!0);T.classList.add("dragging-ghost"),T.style.width=`${g.width}px`,document.body.appendChild(T),r.ghost=T,r.source.classList.add("drag-source"),document.body.classList.add("table-dragging")}if(i.preventDefault(),r.ghost)r.ghost.style.transform=`translate3d(${Math.round(i.clientX-r.offsetX)}px, ${Math.round(i.clientY-r.offsetY)}px, 0)`;k(),document.elementFromPoint(i.clientX,i.clientY)?.closest?.(".board-col")?.classList.add("drop-into")},u=(i)=>{let r=Y.current;if(!r||r.pointerId!==i.pointerId)return;if(removeEventListener("pointermove",b),removeEventListener("pointerup",u),removeEventListener("pointercancel",u),r.ghost?.remove(),r.source.classList.remove("drag-source"),document.body.classList.remove("table-dragging"),k(),Y.current=null,!r.active){q(M.id);return}let x=document.elementFromPoint(i.clientX,i.clientY)?.closest?.(".board-col");if(!x)return;if(!A){let H0=x.dataset.colKey,R=String(M.values[G.name]??""),N=H0===G9?null:H0;if(String(N??"")!==R)Q(M,G,N)}let T=document.elementFromPoint(i.clientX,i.clientY)?.closest?.(".kcard"),t=T?.dataset.recId;if(t&&t!==M.id){let H0=T.getBoundingClientRect();X(M.id,t,i.clientY<H0.top+H0.height/2?"before":"after")}};addEventListener("pointermove",b,{passive:!1}),addEventListener("pointerup",u),addEventListener("pointercancel",u)};return z("div",{class:"board-wrap",children:[z("div",{class:"board-bar",children:[z("button",{class:"tbtn",onClick:(L)=>v0(L,(M)=>z(z0,{children:[z(S0,{children:"按属性分组"},void 0,!1,void 0,this),W.map((C)=>z(e,{icon:E0[C.type],label:C.name,onClick:()=>{H(C.id),M()}},C.id,!1,void 0,this))]},void 0,!0,void 0,this)),children:[z(D,{name:"group",cls:"ico sm"},void 0,!1,void 0,this),"分组:",G.name]},void 0,!0,void 0,this),A&&z("span",{class:"muted",style:{fontSize:12},children:"多选分组不支持拖拽改值"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"board",children:O.map((L)=>{let M=_.get(L)??[],C=L===G9;return z("div",{class:"board-col","data-col-key":L,children:[z("div",{class:"board-col-head",children:[C?z("span",{class:"muted",style:{fontWeight:600},children:"未分组"},void 0,!1,void 0,this):z(F9,{text:L},void 0,!1,void 0,this),z("span",{class:"board-count",children:M.length},void 0,!1,void 0,this),z("div",{class:"spacer"},void 0,!1,void 0,this),z("button",{class:"iconbtn sm",title:"新建记录",onClick:()=>$(C?{}:{[G.name]:L}),children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"board-col-body",children:[M.map((g)=>z("div",{class:"kcard","data-rec-id":g.id,onPointerDown:(b)=>I(b,g),children:[z("div",{class:"kcard-title",children:Y7(g,K)||z("span",{class:"muted",children:"无标题"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z.filter((b)=>b!==K&&b.id!==G.id&&!U7(g.values[b.name])).slice(0,4).map((b)=>z("div",{class:"kcard-field",children:[z(D,{name:E0[b.type]??"text",cls:"ico sm"},void 0,!1,void 0,this),z(P9,{prop:b,val:g.values[b.name]},void 0,!1,void 0,this)]},b.id,!0,void 0,this))]},g.id,!0,void 0,this)),z("button",{class:"board-add",onClick:()=>$(C?{}:{[G.name]:L}),children:[z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},L,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Y7(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}function U7(Z){return Z==null||Z===""||Array.isArray(Z)&&Z.length===0}function T9(Z){if(Z==null)return null;let J=String(Z).trim();if(!J)return null;let Q=/^(\d{4})-(\d{2})-(\d{2})/.exec(J);if(Q)return new Date(Number(Q[1]),Number(Q[2])-1,Number(Q[3]));let $=new Date(J);return Number.isNaN($.getTime())?null:new Date($.getFullYear(),$.getMonth(),$.getDate())}function a0(Z){let J=Z.getFullYear(),Q=String(Z.getMonth()+1).padStart(2,"0"),$=String(Z.getDate()).padStart(2,"0");return`${J}-${Q}-${$}`}function g0(Z,J){return new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()+J)}function cZ(Z,J){return Z.getFullYear()===J.getFullYear()&&Z.getMonth()===J.getMonth()&&Z.getDate()===J.getDate()}function y7(Z,J){return new Date(Z,J,1)}function B7(Z,J){return new Date(Z,J+1,0)}function C9(Z,J){let Q=Date.UTC(Z.getFullYear(),Z.getMonth(),Z.getDate()),$=Date.UTC(J.getFullYear(),J.getMonth(),J.getDate());return Math.round(($-Q)/86400000)}function zZ(){let Z=new Date;return new Date(Z.getFullYear(),Z.getMonth(),Z.getDate())}function L7(Z){let J=(Z.getDay()+6)%7;return g0(Z,-J)}function U4(Z,J){let Q=L7(y7(Z,J)),$=B7(Z,J),q=[],X=Q;while(X<=$||q.length===0||X.getDay()!==1){let W=[];for(let F=0;F<7;F++)W.push(g0(X,F));if(q.push(W),X=g0(X,7),q.length>=6)break}return q}var w7=["一","二","三","四","五","六","日"],aZ=3;function y4({props:Z,records:J,onCommitValue:Q,onCreate:$,onOpenRecord:q}){let X=Z.filter((C)=>C.type==="date"),[W,F]=p(null),H=Z.find((C)=>C.id===W)??X[0]??null,G=zZ(),[Y,K]=p({y:G.getFullYear(),m:G.getMonth()}),A=y0(null);if(!H)return z("div",{class:"view-placeholder",children:"日历视图需要一个「日期」属性。请在表格视图中添加一个日期列后再切换到日历。"},void 0,!1,void 0,this);let y=Z[0],w=U4(Y.y,Y.m),_=J.map((C)=>({rec:C,date:T9(C.values[H.name])})).filter((C)=>C.date!=null),O=(C)=>_.filter((g)=>cZ(g.date,C)),k=(C)=>{let g=Y.m+C;K({y:Y.y+Math.floor(g/12),m:(g%12+12)%12})},I=()=>K({y:G.getFullYear(),m:G.getMonth()}),B=()=>document.querySelectorAll(".cal-day.drop-into").forEach((C)=>C.classList.remove("drop-into")),L=(C,g)=>{if(C.button!==0)return;C.preventDefault(),C.stopPropagation(),A.current={id:g.id,pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,active:!1,ghost:null};let b=(i)=>{let r=A.current;if(!r||r.pointerId!==i.pointerId)return;if(!r.active){if(Math.hypot(i.clientX-r.startX,i.clientY-r.startY)<4)return;r.active=!0,r.ghost=P7($Z(g,y)),document.body.classList.add("table-dragging")}if(i.preventDefault(),r.ghost)r.ghost.style.transform=`translate3d(${Math.round(i.clientX+8)}px, ${Math.round(i.clientY+8)}px, 0)`;B(),document.elementFromPoint(i.clientX,i.clientY)?.closest?.(".cal-day")?.classList.add("drop-into")},u=(i)=>{let r=A.current;if(!r||r.pointerId!==i.pointerId)return;if(removeEventListener("pointermove",b),removeEventListener("pointerup",u),removeEventListener("pointercancel",u),r.ghost?.remove(),document.body.classList.remove("table-dragging"),B(),A.current=null,!r.active){q(g.id);return}let T=document.elementFromPoint(i.clientX,i.clientY)?.closest?.(".cal-day")?.dataset.iso;if(T&&T!==String(g.values[H.name]??""))Q(g,H,T)};addEventListener("pointermove",b,{passive:!1}),addEventListener("pointerup",u),addEventListener("pointercancel",u)},M=(C)=>v0(C,(g)=>z(z0,{children:[z(S0,{children:"按日期属性"},void 0,!1,void 0,this),X.map((b)=>z(e,{icon:E0[b.type],label:b.name,onClick:()=>{F(b.id),g()}},b.id,!1,void 0,this))]},void 0,!0,void 0,this));return z("div",{class:"cal",children:[z("div",{class:"cal-nav",children:[z("button",{class:"iconbtn",title:"上个月",onClick:()=>k(-1),children:z(D,{name:"chevron",cls:"ico flip"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"cal-title",children:[Y.y," 年 ",Y.m+1," 月"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"下个月",onClick:()=>k(1),children:z(D,{name:"chevron",cls:"ico"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"tbtn",onClick:I,children:"今天"},void 0,!1,void 0,this),z("div",{class:"spacer"},void 0,!1,void 0,this),X.length>1&&z("button",{class:"tbtn",onClick:M,children:[z(D,{name:"calendar",cls:"ico sm"},void 0,!1,void 0,this),H.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"cal-grid cal-head",children:w7.map((C)=>z("div",{class:"cal-wd",children:C},C,!1,void 0,this))},void 0,!1,void 0,this),z("div",{class:"cal-body",children:w.map((C,g)=>z("div",{class:"cal-grid cal-week",children:C.map((b)=>{let u=b.getMonth()!==Y.m,i=cZ(b,G),r=O(b),x=a0(b);return z("div",{class:"cal-day"+(u?" dim":"")+(i?" today":""),"data-iso":x,onClick:(T)=>{if(T.target.closest(".cal-ev,.cal-add,.cal-more"))return;$({[H.name]:x})},children:[z("div",{class:"cal-daynum",children:[z("span",{children:b.getDate()},void 0,!1,void 0,this),z("button",{class:"cal-add",title:"新建记录",onClick:(T)=>{T.stopPropagation(),$({[H.name]:x})},children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"cal-events",children:[r.slice(0,aZ).map(({rec:T})=>z("div",{class:"cal-ev",style:{["--c"]:pZ($Z(T,y)||T.id)},onPointerDown:(t)=>L(t,T),children:$Z(T,y)||"无标题"},T.id,!1,void 0,this)),r.length>aZ&&z("button",{class:"cal-more",onClick:(T)=>{T.stopPropagation(),v0(T,(t)=>z(z0,{children:[z(S0,{children:[x," · ",r.length," 条记录"]},void 0,!0,void 0,this),r.map(({rec:H0})=>z(e,{label:$Z(H0,y)||"无标题",onClick:()=>{t(),q(H0.id)}},H0.id,!1,void 0,this))]},void 0,!0,void 0,this))},children:["+",r.length-aZ," 更多"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},x,!0,void 0,this)})},g,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $Z(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}function P7(Z){let J=document.createElement("div");return J.className="drag-ghost",J.textContent=Z||"移动记录",document.body.appendChild(J),J}var J9=200,g9=36,x9=44,h0=28,B4=3;function w4({props:Z,records:J,onCommitValue:Q,onOpenRecord:$}){let q=Z.filter((N)=>N.type==="date"),[X,W]=p(null),[F,H]=p(null),G=Z.find((N)=>N.id===X)??q[0]??null,Y=F==="none"?null:Z.find((N)=>N.id===F)??q.find((N)=>N!==G)??null,K=y0(null),A=y0(null);if(!G)return z("div",{class:"view-placeholder",children:"时间轴视图需要一个「日期」属性作为开始日期。请在表格视图中添加一个日期列后再切换到时间轴。"},void 0,!1,void 0,this);let y=Z[0],w=zZ(),_=J.map((N)=>{let v=T9(N.values[G.name]),S=Y?T9(N.values[Y.name]):null;return{rec:N,s:v,e:S&&v&&S<v?v:S}}),O=_.filter((N)=>N.s),k=w,I=w;if(O.length){k=O[0].s,I=O[0].s;for(let N of O){if(N.s<k)k=N.s;let v=N.e??N.s;if(v>I)I=v}}else k=g0(w,-10),I=g0(w,14);let B=g0(k,-B4),L=g0(I,B4),M=C9(B,L)+1,C=J9+M*h0,g=(N)=>J9+N*h0,b=C9(B,w),u=[];for(let N=0;N<M;N++)u.push(g0(B,N));let i=(N,v,S,o,Z0)=>{if(Z0===0)return;if(o==="move"){if(v)Q(N,G,a0(g0(v,Z0)));if(Y&&S)Q(N,Y,a0(g0(S,Z0)))}else if(o==="l"&&v){let q0=g0(v,Z0);Q(N,G,a0(S&&q0>S?S:q0))}else if(o==="r"&&Y&&S){let q0=g0(S,Z0);Q(N,Y,a0(v&&q0<v?v:q0))}},r=(N,v)=>{let S=A.current;if(!S)return;S.style.left=N+"px",S.style.display="block";let o=S.firstElementChild;if(o)o.textContent=v},x=()=>{if(A.current)A.current.style.display="none"},T=(N,v,S,o,Z0,q0)=>{if(N.button!==0||!S)return;N.preventDefault(),N.stopPropagation();let{offsetLeft:K0,offsetWidth:O0}=q0,W0=!1;K.current={pointerId:N.pointerId,startX:N.clientX};let V=(d)=>{let l=K.current;if(!l||l.pointerId!==d.pointerId)return;let F0=Math.round((d.clientX-l.startX)/h0);if(Math.abs(d.clientX-l.startX)>3)W0=!0;let B0,J0;if(Z0==="move"){let c=K0+F0*h0;q0.style.left=c+"px",B0=c,J0=g0(S,F0)}else if(Z0==="l"){let c=K0+F0*h0;q0.style.left=c+"px",q0.style.width=Math.max(h0,O0-F0*h0)+"px",B0=c,J0=g0(S,F0)}else{let c=Math.max(h0,O0+F0*h0);q0.style.width=c+"px",B0=K0+c,J0=g0(S,Math.round(c/h0)-1)}r(B0,a0(J0))},j=(d)=>{let l=K.current;if(!l||l.pointerId!==d.pointerId)return;removeEventListener("pointermove",V),removeEventListener("pointerup",j),removeEventListener("pointercancel",j),K.current=null,x();let F0=Math.round((d.clientX-l.startX)/h0);if(!W0){$(v.id);return}i(v,S,o,Z0,F0)};addEventListener("pointermove",V,{passive:!1}),addEventListener("pointerup",j),addEventListener("pointercancel",j)},t=(N,v)=>{if(Q(N,G,a0(v)),Y)Q(N,Y,a0(v))},H0=(N,v)=>{let S=N.currentTarget.closest(".tl-row");if(!S)return;let o=N.clientX-S.getBoundingClientRect().left;if(o<J9)return;let Z0=Math.max(0,Math.min(M-1,Math.round((o-J9)/h0)));t(v,g0(B,Z0))};return z("div",{class:"tl",children:[z("div",{class:"tl-toolbar",children:z("button",{class:"tbtn",onClick:(N)=>v0(N,(v)=>z(z0,{children:[z(S0,{children:"开始日期"},void 0,!1,void 0,this),q.map((S)=>z(e,{icon:E0[S.type],label:S.name,checked:S===G,onClick:()=>{W(S.id),v()}},S.id,!1,void 0,this)),z(_0,{},void 0,!1,void 0,this),z(S0,{children:"结束日期(可选)"},void 0,!1,void 0,this),z(e,{icon:"x",label:"无(里程碑)",checked:!Y,onClick:()=>{H("none"),v()}},void 0,!1,void 0,this),q.map((S)=>z(e,{icon:E0[S.type],label:S.name,checked:S===Y,onClick:()=>{H(S.id),v()}},S.id,!1,void 0,this))]},void 0,!0,void 0,this)),children:[z(D,{name:"timeline",cls:"ico sm"},void 0,!1,void 0,this),G.name,Y?` → ${Y.name}`:"(里程碑)"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("div",{class:"tl-scroll",children:z("div",{class:"tl-canvas",style:{width:C,height:x9+_.length*g9+8},children:[z("div",{class:"tl-axis",style:{height:x9},children:[z("div",{class:"tl-corner",style:{width:J9},children:"记录"},void 0,!1,void 0,this),u.map((N,v)=>{let S=N.getDate()===1;return z("div",{class:"tl-tick"+(S?" mstart":"")+(C9(N,w)===0?" today":""),style:{left:g(v),width:h0},children:[S&&z("span",{class:"tl-month",children:[N.getMonth()+1,"月"]},void 0,!0,void 0,this),z("span",{class:"tl-dnum",children:N.getDate()},void 0,!1,void 0,this)]},v,!0,void 0,this)})]},void 0,!0,void 0,this),_.map(({rec:N,s:v,e:S},o)=>{let Z0=v?C9(B,v):0,q0=v&&S?C9(v,S)+1:1;return z("div",{class:"tl-row",style:{top:x9+o*g9,height:g9},children:[z("div",{class:"tl-rowlabel",style:{width:J9},children:L4(N,y)||z("span",{class:"muted",children:"无标题"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!v?z("div",{class:"tl-track-empty",style:{left:J9},onClick:(K0)=>H0(K0,N),title:"点击空白处排期",children:z("button",{class:"tl-schedule",style:{left:J9+8},onClick:(K0)=>{K0.stopPropagation(),t(N,w)},children:"未排期 · 排到今天"},void 0,!1,void 0,this)},void 0,!1,void 0,this):S?z("div",{class:"tl-item",style:{left:g(Z0),width:q0*h0},onPointerDown:(K0)=>T(K0,N,v,S,"move",K0.currentTarget),children:[z("span",{class:"tl-h l",onPointerDown:(K0)=>T(K0,N,v,S,"l",K0.currentTarget.parentElement)},void 0,!1,void 0,this),z("span",{class:"tl-label",children:L4(N,y)},void 0,!1,void 0,this),z("span",{class:"tl-h r",onPointerDown:(K0)=>T(K0,N,v,S,"r",K0.currentTarget.parentElement)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):z("div",{class:"tl-milestone",style:{left:g(Z0)},title:a0(v),onPointerDown:(K0)=>T(K0,N,v,null,"move",K0.currentTarget)},void 0,!1,void 0,this)]},N.id,!0,void 0,this)}),b>=0&&b<M&&z("div",{class:"tl-today",style:{left:g(b)+h0/2,height:x9+_.length*g9}},void 0,!1,void 0,this),z("div",{class:"tl-guide",ref:A,style:{display:"none",height:x9+_.length*g9},children:z("span",{class:"tl-guide-label"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function L4(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}var C7=[["表格","list"],["看板","group"],["日历","calendar"],["时间轴","timeline"]];function qZ(Z){return{r0:Math.min(Z.a.r,Z.b.r),r1:Math.max(Z.a.r,Z.b.r),c0:Math.min(Z.a.c,Z.b.c),c1:Math.max(Z.a.c,Z.b.c)}}function A4({db:Z,reloadNav:J,onError:Q}){let[$,q]=p([]),[X,W]=p([]),[F,H]=p(0),[G,Y]=p(new Set),[K,A]=p(null),[y,w]=p(null),[_,O]=p(null),[k,I]=p(null),B=(V)=>V.config?.width??180,L=y0(null),M=y0(null),C=y0(null),g=y0(!1),b=(V)=>V().catch((j)=>Q(String(j.message))),u=async()=>{let[V,j]=await Promise.all([n.listProperties(Z.id),n.listRecords(Z.id)]);q(V),W(j)};L0(()=>{Y(new Set),O(null),H(0),I(null),u().catch((V)=>Q(String(V.message)))},[Z.id]);let i=(V,j,d)=>b(async()=>{let l=await n.updateRecord(V.id,{[j.name]:d});W((F0)=>F0.map((B0)=>B0.id===V.id?l:B0)),w(null)}),r=(V)=>b(async()=>{let j=await n.createRecord(Z.id,V);W((d)=>[...d,j])}),x=()=>r({}),T=(V)=>b(async()=>{if(await Promise.all(V.map((j)=>n.deleteRecord(j))),W((j)=>j.filter((d)=>!V.includes(d.id))),Y(new Set),_&&V.includes(_))O(null)}),t=(V)=>b(async()=>{let j=await n.createRecord(Z.id,V.values);W((d)=>{let l=d.findIndex((F0)=>F0.id===V.id);return[...d.slice(0,l+1),j,...d.slice(l+1)]})}),H0=(V,j,d)=>{if(V===j||K)return;W((l)=>P4(l,V,j,d))},R=(V,j,d)=>{if(V===j||K)return;H0(V,j,d),n.moveRecord(V,j,d).catch((l)=>{Q(String(l.message)),u().catch((F0)=>Q(String(F0.message)))})},N=(V,j,d)=>{if(V===j)return;q((l)=>{let F0=P4(l,V,j,d).map((c,a)=>({...c,position:a+1})),B0=new Map(l.map((c)=>[c.id,c.position])),J0=F0.filter((c)=>B0.get(c.id)!==c.position);if(J0.length)Promise.all(J0.map((c)=>n.updateProperty(c.id,{position:c.position}))).catch((c)=>{Q(String(c.message)),u().catch((a)=>Q(String(a.message)))});return F0})},v=(V,j)=>{if(K||V.button!==0)return;let d=V.currentTarget.closest("tr");if(!d)return;V.preventDefault();let l=d.getBoundingClientRect(),F0={id:j.id,pointerId:V.pointerId,startX:V.clientX,startY:V.clientY,offsetX:V.clientX-l.left,offsetY:V.clientY-l.top,active:!1,source:d,ghost:null,targetId:null,where:"before"};L.current=F0;let B0=(c)=>{let a=L.current;if(!a||a.pointerId!==c.pointerId)return;if(!a.active){let M0=c.clientX-a.startX,Y0=c.clientY-a.startY;if(Math.hypot(M0,Y0)<4)return;a.active=!0,a.ghost=N7(a.source),a.source.classList.add("drag-source"),document.body.classList.add("table-dragging")}c.preventDefault(),C4(a.ghost,c.clientX-a.offsetX,c.clientY-a.offsetY),_7(a,c.clientX,c.clientY)},J0=(c)=>{let a=L.current;if(!a||a.pointerId!==c.pointerId)return;if(removeEventListener("pointermove",B0),removeEventListener("pointerup",J0),removeEventListener("pointercancel",J0),a.ghost?.remove(),a.source.classList.remove("drag-source"),document.body.classList.remove("table-dragging"),dZ(),L.current=null,a.active&&a.targetId)R(a.id,a.targetId,a.where)};addEventListener("pointermove",B0,{passive:!1}),addEventListener("pointerup",J0),addEventListener("pointercancel",J0)},S=(V,j)=>{if(V.button!==0)return;let d=V.currentTarget.closest("th");if(!d)return;let l=d.getBoundingClientRect(),F0={id:j.id,pointerId:V.pointerId,startX:V.clientX,startY:V.clientY,offsetX:V.clientX-l.left,offsetY:V.clientY-l.top,active:!1,source:d,ghost:null,targetId:null,where:"before"};C.current=F0;let B0=(c)=>{let a=C.current;if(!a||a.pointerId!==c.pointerId)return;if(!a.active){let M0=c.clientX-a.startX,Y0=c.clientY-a.startY;if(Math.hypot(M0,Y0)<4)return;a.active=!0,g.current=!0,a.ghost=V7(a.source),a.source.classList.add("drag-source"),document.body.classList.add("table-dragging")}c.preventDefault(),C4(a.ghost,c.clientX-a.offsetX,c.clientY-a.offsetY),M7(a,c.clientX,c.clientY)},J0=(c)=>{let a=C.current;if(!a||a.pointerId!==c.pointerId)return;if(removeEventListener("pointermove",B0),removeEventListener("pointerup",J0),removeEventListener("pointercancel",J0),a.ghost?.remove(),a.source.classList.remove("drag-source"),document.body.classList.remove("table-dragging"),rZ(),C.current=null,a.active)setTimeout(()=>{g.current=!1},0);if(a.active&&a.targetId)N(a.id,a.targetId,a.where)};addEventListener("pointermove",B0,{passive:!1}),addEventListener("pointerup",J0),addEventListener("pointercancel",J0)},o=(V,j,d)=>{if(V.button!==0)return;if(V.target.closest("input,button,a"))return;let l=V.shiftKey&&k?k.a:{r:j,c:d};I({a:l,b:{r:j,c:d}}),M.current={pointerId:V.pointerId,startX:V.clientX,startY:V.clientY,active:!1};let F0=(J0)=>{let c=M.current;if(!c||c.pointerId!==J0.pointerId)return;if(!c.active){if(Math.hypot(J0.clientX-c.startX,J0.clientY-c.startY)<4)return;c.active=!0,document.body.classList.add("cell-selecting")}J0.preventDefault();let a=document.elementFromPoint(J0.clientX,J0.clientY)?.closest?.("td.cell-td");if(!a||a.dataset.r==null)return;I({a:l,b:{r:Number(a.dataset.r),c:Number(a.dataset.c)}})},B0=(J0)=>{let c=M.current;if(!c||c.pointerId!==J0.pointerId)return;removeEventListener("pointermove",F0),removeEventListener("pointerup",B0),removeEventListener("pointercancel",B0),document.body.classList.remove("cell-selecting"),M.current=null};addEventListener("pointermove",F0,{passive:!1}),addEventListener("pointerup",B0),addEventListener("pointercancel",B0)},Z0=(V)=>b(async()=>{if(!k)return;let{r0:j,r1:d,c0:l,c1:F0}=qZ(k),B0=$.slice(l,F0+1),J0=K0.slice(j,d+1),c=await Promise.all(J0.map((a)=>{let M0={};for(let Y0 of B0)M0[Y0.name]=V(Y0);return n.updateRecord(a.id,M0)}));W((a)=>a.map((M0)=>c.find((Y0)=>Y0.id===M0.id)??M0))}),q0=async()=>{if(!k)return;let{r0:V,r1:j,c0:d,c1:l}=qZ(k),F0=$.slice(d,l+1),B0=K0.slice(V,j+1).map((J0)=>F0.map((c)=>K4(c,J0.values[c.name])).join("\t")).join(`
8
- `);try{await navigator.clipboard.writeText(B0)}catch{}},K0=K?[...X].sort((V,j)=>{let d=String(V.values[K.name]??""),l=String(j.values[K.name]??"");return(K.desc?-1:1)*d.localeCompare(l,"zh")}):X,O0=X.find((V)=>V.id===_)??null,W0=k?qZ(k):null;return L0(()=>{let V=(j)=>{if(!k||y)return;let d=document.activeElement,l=(d?.tagName||"").toLowerCase();if(l==="input"||l==="textarea"||d?.isContentEditable)return;if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="c")j.preventDefault(),q0();else if(j.key==="Escape")I(null);else if(j.key==="Delete"||j.key==="Backspace"){let F0=qZ(k);if(F0.r0!==F0.r1||F0.c0!==F0.c1)j.preventDefault(),Z0(()=>null)}};return addEventListener("keydown",V),()=>removeEventListener("keydown",V)},[k,y,X,$,K]),z("div",{class:"db",onPointerDown:(V)=>{if(!V.target.closest("td.cell-td, .cellselbar"))I(null)},children:[z("div",{class:"db-head",children:[z("div",{class:"db-icon",children:Z.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("div",{children:z("div",{class:"db-title",contentEditable:!0,onBlur:(V)=>{let j=V.target.textContent?.trim()||Z.name;if(j!==Z.name)b(async()=>{await n.updateDatabase(Z.id,{name:j}),await J()})},children:Z.name},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"views",children:[C7.map(([V,j],d)=>z("div",{class:"view-tab"+(d===F?" active":""),onClick:()=>H(d),children:[z(D,{name:j},void 0,!1,void 0,this),V]},V,!0,void 0,this)),z("div",{class:"view-tab",title:"新建视图",children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"spacer",style:{flex:1}},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:x,children:[z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F===0&&z("div",{class:"toolbar",children:[z("button",{class:"tbtn",onClick:(V)=>S7(V,$,K,A),children:[z(D,{name:"sort",cls:"ico sm"},void 0,!1,void 0,this),"排序"]},void 0,!0,void 0,this),z("button",{class:"tbtn",children:[z(D,{name:"filter",cls:"ico sm"},void 0,!1,void 0,this),"筛选"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F===1?z(Y4,{props:$,records:X,onCommitValue:i,onCreate:r,onOpenRecord:O,onMove:R},void 0,!1,void 0,this):F===2?z(y4,{props:$,records:X,onCommitValue:i,onCreate:r,onOpenRecord:O},void 0,!1,void 0,this):F===3?z(w4,{props:$,records:X,onCommitValue:i,onCreate:r,onOpenRecord:O},void 0,!1,void 0,this):z("div",{class:"tablewrap",children:[z("div",{class:"tablescroll",children:z("table",{class:"grid",children:[z("colgroup",{children:[z("col",{style:{width:38}},void 0,!1,void 0,this),z("col",{style:{width:26}},void 0,!1,void 0,this),$.map((V)=>z("col",{"data-col-id":V.id,style:{width:B(V)}},V.id,!1,void 0,this)),z("col",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("thead",{children:z("tr",{children:[z("th",{class:"selcell",children:z("input",{type:"checkbox",checked:G.size>0&&G.size===X.length,onChange:(V)=>Y(V.target.checked?new Set(X.map((j)=>j.id)):new Set)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("th",{class:"gripcol"},void 0,!1,void 0,this),$.map((V)=>z("th",{"data-col-id":V.id,children:[z("div",{class:"colhead",onPointerDown:(j)=>S(j,V),onClick:(j)=>{if(g.current){g.current=!1,j.preventDefault(),j.stopPropagation();return}R7(j,V,Z.id,u,$)},children:[z("span",{class:"ti",children:z(D,{name:E0[V.type]??"text",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"nm",children:V.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(f7,{colId:V.id,startWidth:B(V),onCommit:(j)=>{q((d)=>d.map((l)=>l.id===V.id?{...l,config:{...l.config??{},width:j}}:l)),n.setColumnWidth(V.id,j).catch((d)=>{Q(String(d.message)),u().catch(()=>{})})}},void 0,!1,void 0,this)]},V.id,!0,void 0,this)),z("th",{class:"addcol",children:z("div",{class:"colhead",title:"新建属性",onClick:(V)=>b7(V,Z.id,u),children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("tbody",{children:K0.map((V,j)=>z("tr",{"data-row-id":V.id,class:G.has(V.id)?"sel":"",children:[z("td",{class:"selcell",children:z("input",{type:"checkbox",checked:G.has(V.id),onChange:()=>Y((d)=>{let l=new Set(d);return l.has(V.id)?l.delete(V.id):l.add(V.id),l})},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("td",{class:"rowgrip",title:K?"清除排序后可拖拽移动":"拖拽移动","aria-disabled":K?"true":void 0,onPointerDown:(d)=>v(d,V),children:z(D,{name:"grip",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.map((d,l)=>{let F0=W0!=null&&j>=W0.r0&&j<=W0.r1&&l>=W0.c0&&l<=W0.c1,B0;if(F0&&W0){let J0=[];if(j===W0.r0)J0.push("inset 0 2px 0 0 var(--accent)");if(j===W0.r1)J0.push("inset 0 -2px 0 0 var(--accent)");if(l===W0.c0)J0.push("inset 2px 0 0 0 var(--accent)");if(l===W0.c1)J0.push("inset -2px 0 0 0 var(--accent)");B0=J0.join(",")||void 0}return z("td",{class:"cell-td"+(F0?" cellsel":""),"data-r":j,"data-c":l,style:B0?{boxShadow:B0}:void 0,onPointerDown:(J0)=>o(J0,j,l),children:z(A7,{rec:V,prop:d,first:l===0,editing:y?.rec===V.id&&y?.prop===d.id,onEdit:()=>w({rec:V.id,prop:d.id}),onCancel:()=>w(null),onCommit:(J0)=>i(V,d,J0),onOpen:()=>O(V.id),onRowMenu:(J0)=>T7(J0,V,()=>O(V.id),()=>t(V),()=>T([V.id]))},void 0,!1,void 0,this)},d.id,!1,void 0,this)}),z("td",{class:"filler"},void 0,!1,void 0,this)]},V.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("div",{class:"addrow",onClick:x,children:[z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建记录"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"gridfoot",children:[z("span",{children:["共 ",X.length," 条记录"]},void 0,!0,void 0,this),z("span",{children:[$.length," 个属性"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.size>0&&z("div",{class:"selbar",children:[z("span",{class:"cnt",children:[G.size," 已选"]},void 0,!0,void 0,this),z("button",{onClick:()=>b(async()=>{for(let V of G)await t(X.find((j)=>j.id===V))}),children:[z(D,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"复制"]},void 0,!0,void 0,this),z("button",{class:"del",onClick:async()=>{if(await j0({title:"删除记录?",message:`确定删除选中的 ${G.size} 条记录?`,confirmLabel:"删除",danger:!0}))T([...G])},children:[z(D,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this),"删除"]},void 0,!0,void 0,this),z("button",{onClick:()=>Y(new Set),children:z(D,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W0&&(W0.r0!==W0.r1||W0.c0!==W0.c1)&&z("div",{class:"selbar cellselbar",children:[z("span",{class:"cnt",children:[(W0.r1-W0.r0+1)*(W0.c1-W0.c0+1)," 个单元格"]},void 0,!0,void 0,this),z("button",{onClick:q0,children:[z(D,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"复制"]},void 0,!0,void 0,this),z("button",{onClick:()=>Z0((V)=>K0[W0.r0].values[V.name]??null),children:[z(D,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"填充"]},void 0,!0,void 0,this),z("button",{class:"del",onClick:()=>Z0(()=>null),children:[z(D,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this),"清空"]},void 0,!0,void 0,this),z("button",{onClick:()=>I(null),children:z(D,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O0&&z(g7,{db:Z,props:$,rec:O0,onClose:()=>O(null),onCommit:(V,j)=>i(O0,V,j),onDelete:()=>T([O0.id]),onDuplicate:()=>t(O0)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function A7({rec:Z,prop:J,first:Q,editing:$,onEdit:q,onCancel:X,onCommit:W,onOpen:F,onRowMenu:H}){let G=Z.values[J.name];if(J.type==="checkbox")return z("div",{class:"cell center",children:z("input",{type:"checkbox",checked:!!G,style:{width:16,height:16,accentColor:"var(--accent)"},onChange:()=>W(!G)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if($&&(J.type==="select"||J.type==="multi_select"));if($&&J.type!=="select"&&J.type!=="multi_select"){let A=Array.isArray(G)?G.join(", "):G==null?"":String(G);return z("div",{class:"cell",children:z("input",{class:"inlineedit",type:J.type==="number"?"number":J.type==="date"?"date":"text",value:A,autofocus:!0,onBlur:(y)=>W(iZ(J.type,y.target.value)),onKeyDown:(y)=>{if(y.key==="Enter")y.target.blur();if(y.key==="Escape")X()}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}let Y=(A)=>{if(J.type==="select"||J.type==="multi_select")v4(A,J,G,W);else q()},K=z(P9,{prop:J,val:G},void 0,!1,void 0,this);if(Q)return z("div",{class:"cell",onDblClick:Y,onContextMenu:(A)=>{A.preventDefault(),H(A)},children:z("div",{class:"firstcell",children:[K,z("div",{class:"rowactions",children:z("button",{class:"rowopen",title:"打开",onClick:(A)=>{A.stopPropagation(),F()},children:z(D,{name:"openPeek",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return z("div",{class:"cell",onDblClick:Y,children:K},void 0,!1,void 0,this)}function P4(Z,J,Q,$){let q=[...Z],X=q.findIndex((H)=>H.id===J);if(X<0)return Z;let W=q.splice(X,1)[0],F=q.findIndex((H)=>H.id===Q);if(F<0)return Z;if($==="after")F+=1;return q.splice(F,0,W),q}function dZ(){document.querySelectorAll("table.grid tr.drop-before,table.grid tr.drop-after").forEach((Z)=>Z.classList.remove("drop-before","drop-after"))}function v7(Z,J){dZ();let Q=Z.getBoundingClientRect(),$=J<Q.top+Q.height/2?"before":"after";return Z.classList.add($==="before"?"drop-before":"drop-after"),$}function rZ(){document.querySelectorAll("table.grid th.drop-before,table.grid th.drop-after").forEach((Z)=>Z.classList.remove("drop-before","drop-after"))}function O7(Z,J){rZ();let Q=Z.getBoundingClientRect(),$=J<Q.left+Q.width/2?"before":"after";return Z.classList.add($==="before"?"drop-before":"drop-after"),$}function _7(Z,J,Q){let $=document.elementFromPoint(J,Q)?.closest?.("tr[data-row-id]");if(!$||$.dataset.rowId===Z.id){dZ(),Z.targetId=null;return}Z.targetId=$.dataset.rowId??null,Z.where=v7($,Q)}function M7(Z,J,Q){let $=document.elementFromPoint(J,Q)?.closest?.("th[data-col-id]");if(!$||$.dataset.colId===Z.id){rZ(),Z.targetId=null;return}Z.targetId=$.dataset.colId??null,Z.where=O7($,J)}function C4(Z,J,Q){if(!Z)return;Z.style.transform=`translate3d(${Math.round(J)}px, ${Math.round(Q)}px, 0)`}function N7(Z){let J=Z.getBoundingClientRect(),Q=document.createElement("div");Q.className="drag-ghost row-ghost",Q.style.width=`${J.width}px`,Q.style.height=`${J.height}px`;let $=Array.from(Z.querySelectorAll("td")).map((q)=>(q.textContent??"").trim()).filter(Boolean).join(" ");return Q.textContent=$||"移动记录",document.body.appendChild(Q),Q}function V7(Z){let J=Z.getBoundingClientRect(),Q=document.createElement("div");return Q.className="drag-ghost col-ghost",Q.style.width=`${J.width}px`,Q.style.height=`${J.height}px`,Q.textContent=Z.textContent?.trim()||"移动属性",document.body.appendChild(Q),Q}function f7({colId:Z,startWidth:J,onCommit:Q}){return z("div",{class:"col-resizer",onPointerDown:(q)=>{q.preventDefault(),q.stopPropagation();let X=q.currentTarget,W=document.querySelector(`col[data-col-id="${CSS.escape(Z)}"]`),F=q.clientX,H=J,G=0;X.classList.add("dragging"),document.body.classList.add("col-resizing");let Y=()=>{if(G=0,W)W.style.width=H+"px"},K=(y)=>{if(H=Math.max(80,J+y.clientX-F),!G)G=requestAnimationFrame(Y)},A=()=>{if(G)cancelAnimationFrame(G);if(W)W.style.width=H+"px";removeEventListener("pointermove",K),removeEventListener("pointerup",A),removeEventListener("pointercancel",A),X.classList.remove("dragging"),document.body.classList.remove("col-resizing"),Q(H)};addEventListener("pointermove",K,{passive:!1}),addEventListener("pointerup",A),addEventListener("pointercancel",A)}},void 0,!1,void 0,this)}function v4(Z,J,Q,$){Z.stopPropagation();let q=J.type==="multi_select",X=J.config?.options??[];v0(Z,(W)=>z(k7,{multi:q,options:X,value:Q,onPick:(F)=>{if($(F),!q)W()}},void 0,!1,void 0,this))}function k7({multi:Z,options:J,value:Q,onPick:$}){let[q,X]=p(Q),W=(H)=>Z?Array.isArray(q)?q.includes(H):!1:q===H,F=(H)=>{if(Z){let G=new Set(Array.isArray(q)?q:[]);G.has(H)?G.delete(H):G.add(H);let Y=[...G];X(Y),$(Y)}else X(H),$(H)};return z(z0,{children:[z(S0,{children:Z?"多选 — 点选切换":"单选"},void 0,!1,void 0,this),J.map((H)=>z("button",{class:"item",onClick:()=>F(H),children:[z(F9,{text:H},void 0,!1,void 0,this),W(H)&&z("span",{class:"chk",children:z(D,{name:"check",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this)),Z&&Array.isArray(q)&&q.length>0&&z(z0,{children:[z(_0,{},void 0,!1,void 0,this),z(e,{icon:"x",label:"清空",onClick:()=>{X([]),$([])}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function R7(Z,J,Q,$,q){Z.stopPropagation(),v0(Z,(X)=>z(I7,{prop:J,dbId:Q,reload:$,close:X,allProps:q},void 0,!1,void 0,this),{minWidth:252})}function I7({prop:Z,dbId:J,reload:Q,close:$,allProps:q}){let[X,W]=p(Z.name),[F,H]=p(Z.type),[G,Y]=p(Z.config?.options??[]),K=(w)=>n.updateProperty(Z.id,w).then(Q).catch(()=>{}),A=(w)=>{H(w);let _=G;if((w==="select"||w==="multi_select")&&_.length===0)_=["选项 1","选项 2"],Y(_);K({type:w,...w==="select"||w==="multi_select"?{config:{options:_}}:{}})},y=(w)=>{Y(w),K({config:{options:w}})};return z(z0,{children:[z("input",{class:"field",value:X,onInput:(w)=>W(w.target.value),onBlur:()=>X&&X!==Z.name&&K({name:X}),onKeyDown:(w)=>{if(w.key==="Enter")w.target.blur(),$()}},void 0,!1,void 0,this),z(S0,{children:"属性类型"},void 0,!1,void 0,this),z("div",{class:"typegrid",children:Object.keys(L9).map((w)=>z("button",{class:"item"+(w===F?" sel":""),onClick:()=>A(w),children:[z("span",{class:"lico",children:z(D,{name:E0[w],cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"d",children:L9[w].t},void 0,!1,void 0,this)]},w,!0,void 0,this))},void 0,!1,void 0,this),(F==="select"||F==="multi_select")&&z(z0,{children:[z(_0,{},void 0,!1,void 0,this),z(S0,{children:"选项"},void 0,!1,void 0,this),G.map((w,_)=>z("div",{class:"optrow",children:[z(F9,{text:w},void 0,!1,void 0,this),z("button",{class:"x",onClick:()=>y(G.filter((O,k)=>k!==_)),children:z(D,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},w+_,!0,void 0,this)),z(e,{icon:"plus",label:"添加选项",onClick:()=>y([...G,"选项 "+(G.length+1)])},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"cornerUpRight",label:"在右侧插入列",onClick:()=>{$(),n.createProperty({db:J,name:"新属性",type:"text"}).then(Q)}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除属性",danger:!0,onClick:async()=>{if($(),await j0({title:"删除属性?",message:`「${Z.name}」及其所有单元格数据将被移除。`,confirmLabel:"删除",danger:!0}))n.deleteProperty(Z.id).then(Q)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function b7(Z,J,Q){Z.stopPropagation(),v0(Z,($)=>z(z0,{children:[z(S0,{children:"新建属性 · 选择类型"},void 0,!1,void 0,this),z("div",{class:"typegrid",children:Object.keys(L9).map((q)=>z("button",{class:"item",onClick:()=>{$();let X=q==="select"||q==="multi_select"?{options:["选项 1","选项 2"]}:void 0;n.createProperty({db:J,name:L9[q].t,type:q,config:X}).then(Q).catch(()=>{})},children:[z("span",{class:"lico",children:z(D,{name:E0[q],cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"d",children:L9[q].t},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this))}function S7(Z,J,Q,$){v0(Z,(q)=>z(z0,{children:[z(S0,{children:"排序依据"},void 0,!1,void 0,this),J.map((X)=>z(e,{icon:E0[X.type],label:X.name,onClick:()=>{$({name:X.name,desc:Q?.name===X.name?!Q.desc:!1}),q()}},X.id,!1,void 0,this)),Q&&z(z0,{children:[z(_0,{},void 0,!1,void 0,this),z(e,{icon:"x",label:"清除排序",onClick:()=>{$(null),q()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this))}function T7(Z,J,Q,$,q){Z.stopPropagation(),v0(Z,(X)=>z(z0,{children:[z(e,{icon:"cornerUpRight",label:"打开记录",onClick:()=>{X(),Q()}},void 0,!1,void 0,this),z(e,{icon:"copy",label:"复制记录",onClick:()=>{X(),$()}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除记录",danger:!0,onClick:async()=>{if(X(),await j0({title:"删除记录?",message:"确定删除这条记录?",confirmLabel:"删除",danger:!0}))q()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))}function g7({db:Z,props:J,rec:Q,onClose:$,onCommit:q,onDelete:X,onDuplicate:W}){let[F,H]=p(null),G=J[0];return z(z0,{children:[z("div",{class:"scrim open",onClick:$},void 0,!1,void 0,this),z("div",{class:"peek open",children:[z("div",{class:"peek-head",children:[z("button",{class:"iconbtn",onClick:$,children:z(D,{name:"x"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{style:{flex:1}},void 0,!1,void 0,this),z("button",{class:"iconbtn",title:"更多",onClick:(Y)=>v0(Y,(K)=>z(z0,{children:[z(e,{icon:"copy",label:"复制记录",onClick:()=>{K(),W()}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除记录",danger:!0,onClick:async()=>{if(K(),await j0({title:"删除记录?",message:"确定删除这条记录?",confirmLabel:"删除",danger:!0}))X()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)),children:z(D,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"peek-body",children:[z("h2",{contentEditable:!0,onBlur:(Y)=>G&&q(G,Y.target.textContent??""),children:G?String(Q.values[G.name]??"无标题"):"无标题"},void 0,!1,void 0,this),J.map((Y)=>z("div",{class:"proprow",children:[z("div",{class:"k",children:[z(D,{name:E0[Y.type]??"text",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:Y.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(x7,{prop:Y,rec:Q,editing:F===Y.id,onEdit:()=>H(Y.id),onCommit:(K)=>{q(Y,K),H(null)}},void 0,!1,void 0,this)]},Y.id,!0,void 0,this)),z("div",{class:"peek-divider"},void 0,!1,void 0,this),z("div",{class:"muted",style:{fontSize:12,fontWeight:600,marginBottom:8},children:"页面正文"},void 0,!1,void 0,this),z("div",{class:"editable",contentEditable:!0,"data-ph":"记录也可拥有自己的块级正文…",style:{minHeight:90},children:"每条记录都可作为页面打开,并拥有块级正文。"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function x7({prop:Z,rec:J,editing:Q,onEdit:$,onCommit:q}){let X=J.values[Z.name];if(Z.type==="checkbox")return z("div",{class:"v",children:z("input",{type:"checkbox",checked:!!X,style:{width:16,height:16,accentColor:"var(--accent)"},onChange:()=>q(!X)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Z.type==="select"||Z.type==="multi_select")return z("div",{class:"v",onClick:(W)=>v4(W,Z,X,q),children:z(P9,{prop:Z,val:X},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Q){let W=Array.isArray(X)?X.join(", "):X==null?"":String(X);return z("div",{class:"v",children:z("input",{class:"inlineedit",type:Z.type==="number"?"number":Z.type==="date"?"date":"text",value:W,autofocus:!0,onBlur:(F)=>q(iZ(Z.type,F.target.value)),onKeyDown:(F)=>{if(F.key==="Enter")F.target.blur()}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}return z("div",{class:"v",onClick:$,children:z(P9,{prop:Z,val:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var S6=p1(b6(),1);var BZ=S6.default;function iQ(Z){for(var J=1;J<arguments.length;J++){var Q=arguments[J];for(var $ in Q)if(Object.prototype.hasOwnProperty.call(Q,$))Z[$]=Q[$]}return Z}function X8(Z,J){return Array(J+1).join(Z)}function x6(Z){return Z.replace(/^\n*/,"")}function j6(Z){var J=Z.length;while(J>0&&Z[J-1]===`
9
- `)J--;return Z.substring(0,J)}function D6(Z){return j6(x6(Z))}var cQ=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function W8(Z){return F8(Z,cQ)}var h6=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function m6(Z){return F8(Z,h6)}function aQ(Z){return E6(Z,h6)}var u6=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function dQ(Z){return F8(Z,u6)}function rQ(Z){return E6(Z,u6)}function F8(Z,J){return J.indexOf(Z.nodeName)>=0}function E6(Z,J){return Z.getElementsByTagName&&J.some(function(Q){return Z.getElementsByTagName(Q).length})}var lQ=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function p6(Z){return lQ.reduce(function(J,Q){return J.replace(Q[0],Q[1])},Z)}var D0={};D0.paragraph={filter:"p",replacement:function(Z){return`
1
+ var G7=Object.create;var{getPrototypeOf:H7,defineProperty:e1,getOwnPropertyNames:F7}=Object;var K7=Object.prototype.hasOwnProperty;function Y7(Z){return this[Z]}var U7,y7,B7=(Z,J,Q)=>{var $=Z!=null&&typeof Z==="object";if($){var q=J?U7??=new WeakMap:y7??=new WeakMap,X=q.get(Z);if(X)return X}Q=Z!=null?G7(H7(Z)):{};let W=J||!Z||!Z.__esModule?e1(Q,"default",{value:Z,enumerable:!0}):Q;for(let G of F7(Z))if(!K7.call(W,G))e1(W,G,{get:Y7.bind(Z,G),enumerable:!0});if($)q.set(Z,W);return W};var F0=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var Y4=F0((Q2,K4)=>{function t8(Z){if(Z instanceof Map)Z.clear=Z.delete=Z.set=function(){throw Error("map is read-only")};else if(Z instanceof Set)Z.add=Z.clear=Z.delete=function(){throw Error("set is read-only")};return Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach((J)=>{let Q=Z[J],$=typeof Q;if(($==="object"||$==="function")&&!Object.isFrozen(Q))t8(Q)}),Z}class Y1{constructor(Z){if(Z.data===void 0)Z.data={};this.data=Z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o8(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function H9(Z,...J){let Q=Object.create(null);for(let $ in Z)Q[$]=Z[$];return J.forEach(function($){for(let q in $)Q[q]=$[q]}),Q}var WJ="</span>",i8=(Z)=>{return!!Z.scope},GJ=(Z,{prefix:J})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){let Q=Z.split(".");return[`${J}${Q.shift()}`,...Q.map(($,q)=>`${$}${"_".repeat(q+1)}`)].join(" ")}return`${J}${Z}`};class s8{constructor(Z,J){this.buffer="",this.classPrefix=J.classPrefix,Z.walk(this)}addText(Z){this.buffer+=o8(Z)}openNode(Z){if(!i8(Z))return;let J=GJ(Z.scope,{prefix:this.classPrefix});this.span(J)}closeNode(Z){if(!i8(Z))return;this.buffer+=WJ}value(){return this.buffer}span(Z){this.buffer+=`<span class="${Z}">`}}var d8=(Z={})=>{let J={children:[]};return Object.assign(J,Z),J};class U1{constructor(){this.rootNode=d8(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Z){this.top.children.push(Z)}openNode(Z){let J=d8({scope:Z});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Z){return this.constructor._walk(Z,this.rootNode)}static _walk(Z,J){if(typeof J==="string")Z.addText(J);else if(J.children)Z.openNode(J),J.children.forEach((Q)=>this._walk(Z,Q)),Z.closeNode(J);return Z}static _collapse(Z){if(typeof Z==="string")return;if(!Z.children)return;if(Z.children.every((J)=>typeof J==="string"))Z.children=[Z.children.join("")];else Z.children.forEach((J)=>{U1._collapse(J)})}}class e8 extends U1{constructor(Z){super();this.options=Z}addText(Z){if(Z==="")return;this.add(Z)}startScope(Z){this.openNode(Z)}endScope(){this.closeNode()}__addSublanguage(Z,J){let Q=Z.root;if(J)Q.scope=`language:${J}`;this.add(Q)}toHTML(){return new s8(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function c9(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function Z4(Z){return w9("(?=",Z,")")}function HJ(Z){return w9("(?:",Z,")*")}function FJ(Z){return w9("(?:",Z,")?")}function w9(...Z){return Z.map((Q)=>c9(Q)).join("")}function KJ(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function y1(...Z){return"("+(KJ(Z).capture?"":"?:")+Z.map(($)=>c9($)).join("|")+")"}function J4(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function YJ(Z,J){let Q=Z&&Z.exec(J);return Q&&Q.index===0}var UJ=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B1(Z,{joinWith:J}){let Q=0;return Z.map(($)=>{Q+=1;let q=Q,X=c9($),W="";while(X.length>0){let G=UJ.exec(X);if(!G){W+=X;break}if(W+=X.substring(0,G.index),X=X.substring(G.index+G[0].length),G[0][0]==="\\"&&G[1])W+="\\"+String(Number(G[1])+q);else if(W+=G[0],G[0]==="(")Q++}return W}).map(($)=>`(${$})`).join(J)}var yJ=/\b\B/,Q4="[a-zA-Z]\\w*",L1="[a-zA-Z_]\\w*",z4="\\b\\d+(\\.\\d+)?",$4="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q4="\\b(0b[01]+)",BJ="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",LJ=(Z={})=>{let J=/^#![ ]*\//;if(Z.binary)Z.begin=w9(J,/.*\b/,Z.binary,/\b.*/);return H9({scope:"meta",begin:J,end:/$/,relevance:0,"on:begin":(Q,$)=>{if(Q.index!==0)$.ignoreMatch()}},Z)},i9={begin:"\\\\[\\s\\S]",relevance:0},PJ={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[i9]},wJ={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[i9]},CJ={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/},OZ=function(Z,J,Q={}){let $=H9({scope:"comment",begin:Z,end:J,contains:[]},Q);$.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let q=y1("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 $.contains.push({begin:w9(/[ ]+/,"(",q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),$},AJ=OZ("//","$"),OJ=OZ("/\\*","\\*/"),_J=OZ("#","$"),vJ={scope:"number",begin:z4,relevance:0},NJ={scope:"number",begin:$4,relevance:0},MJ={scope:"number",begin:q4,relevance:0},kJ={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[i9,{begin:/\[/,end:/\]/,relevance:0,contains:[i9]}]},fJ={scope:"title",begin:Q4,relevance:0},VJ={scope:"title",begin:L1,relevance:0},RJ={begin:"\\.\\s*"+L1,relevance:0},IJ=function(Z){return Object.assign(Z,{"on:begin":(J,Q)=>{Q.data._beginMatch=J[1]},"on:end":(J,Q)=>{if(Q.data._beginMatch!==J[1])Q.ignoreMatch()}})},CZ=Object.freeze({__proto__:null,APOS_STRING_MODE:PJ,BACKSLASH_ESCAPE:i9,BINARY_NUMBER_MODE:MJ,BINARY_NUMBER_RE:q4,COMMENT:OZ,C_BLOCK_COMMENT_MODE:OJ,C_LINE_COMMENT_MODE:AJ,C_NUMBER_MODE:NJ,C_NUMBER_RE:$4,END_SAME_AS_BEGIN:IJ,HASH_COMMENT_MODE:_J,IDENT_RE:Q4,MATCH_NOTHING_RE:yJ,METHOD_GUARD:RJ,NUMBER_MODE:vJ,NUMBER_RE:z4,PHRASAL_WORDS_MODE:CJ,QUOTE_STRING_MODE:wJ,REGEXP_MODE:kJ,RE_STARTERS_RE:BJ,SHEBANG:LJ,TITLE_MODE:fJ,UNDERSCORE_IDENT_RE:L1,UNDERSCORE_TITLE_MODE:VJ});function SJ(Z,J){if(Z.input[Z.index-1]===".")J.ignoreMatch()}function TJ(Z,J){if(Z.className!==void 0)Z.scope=Z.className,delete Z.className}function bJ(Z,J){if(!J)return;if(!Z.beginKeywords)return;if(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=SJ,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0)Z.relevance=0}function gJ(Z,J){if(!Array.isArray(Z.illegal))return;Z.illegal=y1(...Z.illegal)}function xJ(Z,J){if(!Z.match)return;if(Z.begin||Z.end)throw Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}function jJ(Z,J){if(Z.relevance===void 0)Z.relevance=1}var DJ=(Z,J)=>{if(!Z.beforeMatch)return;if(Z.starts)throw Error("beforeMatch cannot be used with starts");let Q=Object.assign({},Z);Object.keys(Z).forEach(($)=>{delete Z[$]}),Z.keywords=Q.keywords,Z.begin=w9(Q.beforeMatch,Z4(Q.begin)),Z.starts={relevance:0,contains:[Object.assign(Q,{endsParent:!0})]},Z.relevance=0,delete Q.beforeMatch},hJ=["of","and","for","in","not","or","if","then","parent","list","value"],mJ="keyword";function X4(Z,J,Q=mJ){let $=Object.create(null);if(typeof Z==="string")q(Q,Z.split(" "));else if(Array.isArray(Z))q(Q,Z);else Object.keys(Z).forEach(function(X){Object.assign($,X4(Z[X],J,X))});return $;function q(X,W){if(J)W=W.map((G)=>G.toLowerCase());W.forEach(function(G){let F=G.split("|");$[F[0]]=[X,uJ(F[0],F[1])]})}}function uJ(Z,J){if(J)return Number(J);return pJ(Z)?0:1}function pJ(Z){return hJ.includes(Z.toLowerCase())}var a8={},P9=(Z)=>{console.error(Z)},r8=(Z,...J)=>{console.log(`WARN: ${Z}`,...J)},V9=(Z,J)=>{if(a8[`${Z}/${J}`])return;console.log(`Deprecated as of ${Z}. ${J}`),a8[`${Z}/${J}`]=!0},AZ=Error();function W4(Z,J,{key:Q}){let $=0,q=Z[Q],X={},W={};for(let G=1;G<=J.length;G++)W[G+$]=q[G],X[G+$]=!0,$+=J4(J[G-1]);Z[Q]=W,Z[Q]._emit=X,Z[Q]._multi=!0}function EJ(Z){if(!Array.isArray(Z.begin))return;if(Z.skip||Z.excludeBegin||Z.returnBegin)throw P9("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),AZ;if(typeof Z.beginScope!=="object"||Z.beginScope===null)throw P9("beginScope must be object"),AZ;W4(Z,Z.begin,{key:"beginScope"}),Z.begin=B1(Z.begin,{joinWith:""})}function cJ(Z){if(!Array.isArray(Z.end))return;if(Z.skip||Z.excludeEnd||Z.returnEnd)throw P9("skip, excludeEnd, returnEnd not compatible with endScope: {}"),AZ;if(typeof Z.endScope!=="object"||Z.endScope===null)throw P9("endScope must be object"),AZ;W4(Z,Z.end,{key:"endScope"}),Z.end=B1(Z.end,{joinWith:""})}function iJ(Z){if(Z.scope&&typeof Z.scope==="object"&&Z.scope!==null)Z.beginScope=Z.scope,delete Z.scope}function dJ(Z){if(iJ(Z),typeof Z.beginScope==="string")Z.beginScope={_wrap:Z.beginScope};if(typeof Z.endScope==="string")Z.endScope={_wrap:Z.endScope};EJ(Z),cJ(Z)}function aJ(Z){function J(W,G){return new RegExp(c9(W),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(G?"g":""))}class Q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(W,G){G.position=this.position++,this.matchIndexes[this.matchAt]=G,this.regexes.push([G,W]),this.matchAt+=J4(W)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let W=this.regexes.map((G)=>G[1]);this.matcherRe=J(B1(W,{joinWith:"|"}),!0),this.lastIndex=0}exec(W){this.matcherRe.lastIndex=this.lastIndex;let G=this.matcherRe.exec(W);if(!G)return null;let F=G.findIndex((K,Y)=>Y>0&&K!==void 0),H=this.matchIndexes[F];return G.splice(0,F),Object.assign(G,H)}}class ${constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(W){if(this.multiRegexes[W])return this.multiRegexes[W];let G=new Q;return this.rules.slice(W).forEach(([F,H])=>G.addRule(F,H)),G.compile(),this.multiRegexes[W]=G,G}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(W,G){if(this.rules.push([W,G]),G.type==="begin")this.count++}exec(W){let G=this.getMatcher(this.regexIndex);G.lastIndex=this.lastIndex;let F=G.exec(W);if(this.resumingScanAtSamePosition())if(F&&F.index===this.lastIndex);else{let H=this.getMatcher(0);H.lastIndex=this.lastIndex+1,F=H.exec(W)}if(F){if(this.regexIndex+=F.position+1,this.regexIndex===this.count)this.considerAll()}return F}}function q(W){let G=new $;if(W.contains.forEach((F)=>G.addRule(F.begin,{rule:F,type:"begin"})),W.terminatorEnd)G.addRule(W.terminatorEnd,{type:"end"});if(W.illegal)G.addRule(W.illegal,{type:"illegal"});return G}function X(W,G){let F=W;if(W.isCompiled)return F;[TJ,xJ,dJ,DJ].forEach((K)=>K(W,G)),Z.compilerExtensions.forEach((K)=>K(W,G)),W.__beforeBegin=null,[bJ,gJ,jJ].forEach((K)=>K(W,G)),W.isCompiled=!0;let H=null;if(typeof W.keywords==="object"&&W.keywords.$pattern)W.keywords=Object.assign({},W.keywords),H=W.keywords.$pattern,delete W.keywords.$pattern;if(H=H||/\w+/,W.keywords)W.keywords=X4(W.keywords,Z.case_insensitive);if(F.keywordPatternRe=J(H,!0),G){if(!W.begin)W.begin=/\B|\b/;if(F.beginRe=J(F.begin),!W.end&&!W.endsWithParent)W.end=/\B|\b/;if(W.end)F.endRe=J(F.end);if(F.terminatorEnd=c9(F.end)||"",W.endsWithParent&&G.terminatorEnd)F.terminatorEnd+=(W.end?"|":"")+G.terminatorEnd}if(W.illegal)F.illegalRe=J(W.illegal);if(!W.contains)W.contains=[];if(W.contains=[].concat(...W.contains.map(function(K){return rJ(K==="self"?W:K)})),W.contains.forEach(function(K){X(K,F)}),W.starts)X(W.starts,G);return F.matcher=q(F),F}if(!Z.compilerExtensions)Z.compilerExtensions=[];if(Z.contains&&Z.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=H9(Z.classNameAliases||{}),X(Z)}function G4(Z){if(!Z)return!1;return Z.endsWithParent||G4(Z.starts)}function rJ(Z){if(Z.variants&&!Z.cachedVariants)Z.cachedVariants=Z.variants.map(function(J){return H9(Z,{variants:null},J)});if(Z.cachedVariants)return Z.cachedVariants;if(G4(Z))return H9(Z,{starts:Z.starts?H9(Z.starts):null});if(Object.isFrozen(Z))return H9(Z);return Z}var lJ="11.11.1";class H4 extends Error{constructor(Z,J){super(Z);this.name="HTMLInjectionError",this.html=J}}var K1=o8,l8=H9,n8=Symbol("nomatch"),nJ=7,F4=function(Z){let J=Object.create(null),Q=Object.create(null),$=[],q=!0,X="Could not find the language '{}', did you forget to load/include a language module?",W={disableAutodetect:!0,name:"Plain text",contains:[]},G={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:e8};function F(S){return G.noHighlightRe.test(S)}function H(S){let f=S.className+" ";f+=S.parentNode?S.parentNode.className:"";let B=G.languageDetectRe.exec(f);if(B){let M=g(B[1]);if(!M)r8(X.replace("{}",B[1])),r8("Falling back to no-highlight mode for this block.",S);return M?B[1]:"no-highlight"}return f.split(/\s+/).find((M)=>F(M)||g(M))}function K(S,f,B){let M="",x="";if(typeof f==="object")M=S,B=f.ignoreIllegals,x=f.language;else V9("10.7.0","highlight(lang, code, ...args) has been deprecated."),V9("10.7.0",`Please use highlight(code, options) instead.
2
+ https://github.com/highlightjs/highlight.js/issues/2277`),x=S,M=f;if(B===void 0)B=!0;let o={code:M,language:x};$0("before:highlight",o);let z0=o.result?o.result:Y(o.language,o.code,B);return z0.code=o.code,$0("after:highlight",z0),z0}function Y(S,f,B,M){let x=Object.create(null);function o(u,d){return u.keywords[d]}function z0(){if(!e.keywords){k0.addText(C0);return}let u=0;e.keywordPatternRe.lastIndex=0;let d=e.keywordPatternRe.exec(C0),X0="";while(d){X0+=C0.substring(u,d.index);let L0=m0.case_insensitive?d[0].toLowerCase():d[0],x0=o(e,L0);if(x0){let[l0,uZ]=x0;if(k0.addText(X0),X0="",x[L0]=(x[L0]||0)+1,x[L0]<=nJ)K9+=uZ;if(l0.startsWith("_"))X0+=d[0];else{let pZ=m0.classNameAliases[l0]||l0;j(d[0],pZ)}}else X0+=d[0];u=e.keywordPatternRe.lastIndex,d=e.keywordPatternRe.exec(C0)}X0+=C0.substring(u),k0.addText(X0)}function n(){if(C0==="")return;let u=null;if(typeof e.subLanguage==="string"){if(!J[e.subLanguage]){k0.addText(C0);return}u=Y(e.subLanguage,C0,!0,O9[e.subLanguage]),O9[e.subLanguage]=u._top}else u=w(C0,e.subLanguage.length?e.subLanguage:null);if(e.relevance>0)K9+=u.relevance;k0.__addSublanguage(u._emitter,u.language)}function k(){if(e.subLanguage!=null)n();else z0();C0=""}function j(u,d){if(u==="")return;k0.startScope(d),k0.addText(u),k0.endScope()}function T(u,d){let X0=1,L0=d.length-1;while(X0<=L0){if(!u._emit[X0]){X0++;continue}let x0=m0.classNameAliases[u[X0]]||u[X0],l0=d[X0];if(x0)j(l0,x0);else C0=l0,z0(),C0="";X0++}}function i(u,d){if(u.scope&&typeof u.scope==="string")k0.openNode(m0.classNameAliases[u.scope]||u.scope);if(u.beginScope){if(u.beginScope._wrap)j(C0,m0.classNameAliases[u.beginScope._wrap]||u.beginScope._wrap),C0="";else if(u.beginScope._multi)T(u.beginScope,d),C0=""}return e=Object.create(u,{parent:{value:e}}),e}function J0(u,d,X0){let L0=YJ(u.endRe,X0);if(L0){if(u["on:end"]){let x0=new Y1(u);if(u["on:end"](d,x0),x0.isMatchIgnored)L0=!1}if(L0){while(u.endsParent&&u.parent)u=u.parent;return u}}if(u.endsWithParent)return J0(u.parent,d,X0)}function H0(u){if(e.matcher.regexIndex===0)return C0+=u[0],1;else return j9=!0,0}function B0(u){let d=u[0],X0=u.rule,L0=new Y1(X0),x0=[X0.__beforeBegin,X0["on:begin"]];for(let l0 of x0){if(!l0)continue;if(l0(u,L0),L0.isMatchIgnored)return H0(d)}if(X0.skip)C0+=d;else{if(X0.excludeBegin)C0+=d;if(k(),!X0.returnBegin&&!X0.excludeBegin)C0=d}return i(X0,u),X0.returnBegin?0:d.length}function O0(u){let d=u[0],X0=f.substring(u.index),L0=J0(e,u,X0);if(!L0)return n8;let x0=e;if(e.endScope&&e.endScope._wrap)k(),j(d,e.endScope._wrap);else if(e.endScope&&e.endScope._multi)k(),T(e.endScope,u);else if(x0.skip)C0+=d;else{if(!(x0.returnEnd||x0.excludeEnd))C0+=d;if(k(),x0.excludeEnd)C0=d}do{if(e.scope)k0.closeNode();if(!e.skip&&!e.subLanguage)K9+=e.relevance;e=e.parent}while(e!==L0.parent);if(L0.starts)i(L0.starts,u);return x0.returnEnd?0:d.length}function g0(){let u=[];for(let d=e;d!==m0;d=d.parent)if(d.scope)u.unshift(d.scope);u.forEach((d)=>k0.openNode(d))}let N0={};function d0(u,d){let X0=d&&d[0];if(C0+=u,X0==null)return k(),0;if(N0.type==="begin"&&d.type==="end"&&N0.index===d.index&&X0===""){if(C0+=f.slice(d.index,d.index+1),!q){let L0=Error(`0 width match regex (${S})`);throw L0.languageName=S,L0.badRule=N0.rule,L0}return 1}if(N0=d,d.type==="begin")return B0(d);else if(d.type==="illegal"&&!B){let L0=Error('Illegal lexeme "'+X0+'" for mode "'+(e.scope||"<unnamed>")+'"');throw L0.mode=e,L0}else if(d.type==="end"){let L0=O0(d);if(L0!==n8)return L0}if(d.type==="illegal"&&X0==="")return C0+=`
3
+ `,1;if(x9>1e5&&x9>d.index*3)throw Error("potential infinite loop, way more iterations than matches");return C0+=X0,X0.length}let m0=g(S);if(!m0)throw P9(X.replace("{}",S)),Error('Unknown language: "'+S+'"');let P0=aJ(m0),s0="",e=M||P0,O9={},k0=new G.__emitter(G);g0();let C0="",K9=0,$9=0,x9=0,j9=!1;try{if(!m0.__emitTokens){e.matcher.considerAll();for(;;){if(x9++,j9)j9=!1;else e.matcher.considerAll();e.matcher.lastIndex=$9;let u=e.matcher.exec(f);if(!u)break;let d=f.substring($9,u.index),X0=d0(d,u);$9=u.index+X0}d0(f.substring($9))}else m0.__emitTokens(f,k0);return k0.finalize(),s0=k0.toHTML(),{language:S,value:s0,relevance:K9,illegal:!1,_emitter:k0,_top:e}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:S,value:K1(f),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:$9,context:f.slice($9-100,$9+100),mode:u.mode,resultSoFar:s0},_emitter:k0};else if(q)return{language:S,value:K1(f),illegal:!1,relevance:0,errorRaised:u,_emitter:k0,_top:e};else throw u}}function C(S){let f={value:K1(S),illegal:!1,relevance:0,_top:W,_emitter:new G.__emitter(G)};return f._emitter.addText(S),f}function w(S,f){f=f||G.languages||Object.keys(J);let B=C(S),M=f.filter(g).filter(l).map((k)=>Y(k,S,!1));M.unshift(B);let x=M.sort((k,j)=>{if(k.relevance!==j.relevance)return j.relevance-k.relevance;if(k.language&&j.language){if(g(k.language).supersetOf===j.language)return 1;else if(g(j.language).supersetOf===k.language)return-1}return 0}),[o,z0]=x,n=o;return n.secondBest=z0,n}function y(S,f,B){let M=f&&Q[f]||B;S.classList.add("hljs"),S.classList.add(`language-${M}`)}function v(S){let f=null,B=H(S);if(F(B))return;if($0("before:highlightElement",{el:S,language:B}),S.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",S);return}if(S.children.length>0){if(!G.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(S);if(G.throwUnescapedHTML)throw new H4("One of your code blocks includes unescaped HTML.",S.innerHTML)}f=S;let M=f.textContent,x=B?K(M,{language:B,ignoreIllegals:!0}):w(M);if(S.innerHTML=x.value,S.dataset.highlighted="yes",y(S,B,x.language),S.result={language:x.language,re:x.relevance,relevance:x.relevance},x.secondBest)S.secondBest={language:x.secondBest.language,relevance:x.secondBest.relevance};$0("after:highlightElement",{el:S,result:x,text:M})}function V(S){G=l8(G,S)}let I=()=>{A(),V9("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){A(),V9("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let P=!1;function A(){function S(){A()}if(document.readyState==="loading"){if(!P)window.addEventListener("DOMContentLoaded",S,!1);P=!0;return}document.querySelectorAll(G.cssSelector).forEach(v)}function O(S,f){let B=null;try{B=f(Z)}catch(M){if(P9("Language definition for '{}' could not be registered.".replace("{}",S)),!q)throw M;else P9(M);B=W}if(!B.name)B.name=S;if(J[S]=B,B.rawDefinition=f.bind(null,Z),B.aliases)h(B.aliases,{languageName:S})}function L(S){delete J[S];for(let f of Object.keys(Q))if(Q[f]===S)delete Q[f]}function D(){return Object.keys(J)}function g(S){return S=(S||"").toLowerCase(),J[S]||J[Q[S]]}function h(S,{languageName:f}){if(typeof S==="string")S=[S];S.forEach((B)=>{Q[B.toLowerCase()]=f})}function l(S){let f=g(S);return f&&!f.disableAutodetect}function c(S){if(S["before:highlightBlock"]&&!S["before:highlightElement"])S["before:highlightElement"]=(f)=>{S["before:highlightBlock"](Object.assign({block:f.el},f))};if(S["after:highlightBlock"]&&!S["after:highlightElement"])S["after:highlightElement"]=(f)=>{S["after:highlightBlock"](Object.assign({block:f.el},f))}}function Y0(S){c(S),$.push(S)}function Q0(S){let f=$.indexOf(S);if(f!==-1)$.splice(f,1)}function $0(S,f){let B=S;$.forEach(function(M){if(M[B])M[B](f)})}function y0(S){return V9("10.7.0","highlightBlock will be removed entirely in v12.0"),V9("10.7.0","Please use highlightElement now."),v(S)}Object.assign(Z,{highlight:K,highlightAuto:w,highlightAll:A,highlightElement:v,highlightBlock:y0,configure:V,initHighlighting:I,initHighlightingOnLoad:N,registerLanguage:O,unregisterLanguage:L,listLanguages:D,getLanguage:g,registerAliases:h,autoDetection:l,inherit:l8,addPlugin:Y0,removePlugin:Q0}),Z.debugMode=function(){q=!1},Z.safeMode=function(){q=!0},Z.versionString=lJ,Z.regex={concat:w9,lookahead:Z4,either:y1,optional:FJ,anyNumberOfTimes:HJ};for(let S in CZ)if(typeof CZ[S]==="object")t8(CZ[S]);return Object.assign(Z,CZ),Z},R9=F4({});R9.newInstance=()=>F4({});K4.exports=R9;R9.HighlightJS=R9;R9.default=R9});var y4=F0((z2,U4)=>{function tJ(Z){let J=Z.regex,Q=J.concat(/[\p{L}_]/u,J.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),$=/[\p{L}0-9._:-]+/u,q={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},X={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},W=Z.inherit(X,{begin:/\(/,end:/\)/}),G=Z.inherit(Z.APOS_STRING_MODE,{className:"string"}),F=Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),H={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:$,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[q]},{begin:/'/,end:/'/,contains:[q]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[X,F,G,W,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[X,W,F,G]}]}]},Z.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},q,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[F]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[H],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[H],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:J.concat(/</,J.lookahead(J.concat(Q,J.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:Q,relevance:0,starts:H}]},{className:"tag",begin:J.concat(/<\//,J.lookahead(J.concat(Q,/>/))),contains:[{className:"name",begin:Q,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}U4.exports=tJ});var L4=F0(($2,B4)=>{function oJ(Z){let J=Z.regex,Q={},$={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[Q]}]};Object.assign(Q,{className:"variable",variants:[{begin:J.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},$]});let q={className:"subst",begin:/\$\(/,end:/\)/,contains:[Z.BACKSLASH_ESCAPE]},X=Z.inherit(Z.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),W={begin:/<<-?\s*(?=\w+)/,starts:{contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},G={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,Q,q]};q.contains.push(G);let F={match:/\\"/},H={className:"string",begin:/'/,end:/'/},K={match:/\\'/},Y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},Z.NUMBER_MODE,Q]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=Z.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[Z.inherit(Z.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],V=["true","false"],I={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:v,literal:V,built_in:[...N,...P,"set","shopt",...A,...O]},contains:[w,Z.SHEBANG(),y,Y,X,W,I,G,F,H,K,Q]}}B4.exports=oJ});var w4=F0((q2,P4)=>{function sJ(Z){let J=Z.regex,Q=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),$="decltype\\(auto\\)",q="[a-zA-Z_]\\w*::",X="<[^<>]+>",W="(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",G={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},F="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",H={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},K={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(H,{className:"string"}),{className:"string",begin:/<.*?>/},Q,Z.C_BLOCK_COMMENT_MODE]},C={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},w=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",V={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},I=[Y,G,Q,Z.C_BLOCK_COMMENT_MODE,K,H],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:V,contains:I.concat([{begin:/\(/,end:/\)/,keywords:V,contains:I.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+W+"[\\*&\\s]+)+"+w,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:V,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:V,relevance:0},{begin:w,returnBegin:!0,contains:[Z.inherit(C,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:[Q,Z.C_BLOCK_COMMENT_MODE,H,K,G,{begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:["self",Q,Z.C_BLOCK_COMMENT_MODE,H,K,G]}]},G,Q,Z.C_BLOCK_COMMENT_MODE,Y]};return{name:"C",aliases:["h"],keywords:V,disableAutodetect:!0,illegal:"</",contains:[].concat(N,P,I,[Y,{begin:Z.IDENT_RE+"::",keywords:V},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},Z.TITLE_MODE]}]),exports:{preprocessor:Y,strings:H,keywords:V}}}P4.exports=sJ});var A4=F0((X2,C4)=>{function eJ(Z){let J=Z.regex,Q=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),$="decltype\\(auto\\)",q="[a-zA-Z_]\\w*::",X="<[^<>]+>",W="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",G={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},F="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",H={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},K={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},Y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(H,{className:"string"}),{className:"string",begin:/<.*?>/},Q,Z.C_BLOCK_COMMENT_MODE]},C={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},w=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],V=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],I=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:v,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:V},O={className:"function.dispatch",relevance:0,keywords:{_hint:I},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,Z.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},L=[O,Y,G,Q,Z.C_BLOCK_COMMENT_MODE,K,H],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:L.concat([{begin:/\(/,end:/\)/,keywords:A,contains:L.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+W+"[\\*&\\s]+)+"+w,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:A,relevance:0},{begin:w,returnBegin:!0,contains:[C],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[H,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[Q,Z.C_BLOCK_COMMENT_MODE,H,K,G,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",Q,Z.C_BLOCK_COMMENT_MODE,H,K,G]}]},G,Q,Z.C_BLOCK_COMMENT_MODE,Y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,g,O,L,[Y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",G]},{begin:Z.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}C4.exports=eJ});var _4=F0((W2,O4)=>{function Z3(Z){let J=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],Q=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],$=["default","false","null","true"],q=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],X=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],W={keyword:q.concat(X),built_in:J,literal:$},G=Z.inherit(Z.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),F={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},H={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},K={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Y=Z.inherit(K,{illegal:/\n/}),C={className:"subst",begin:/\{/,end:/\}/,keywords:W},w=Z.inherit(C,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},Z.BACKSLASH_ESCAPE,w]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},C]},V=Z.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},w]});C.contains=[v,y,K,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,F,Z.C_BLOCK_COMMENT_MODE],w.contains=[V,y,Y,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,F,Z.inherit(Z.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let I={variants:[H,v,y,K,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},G]},P=Z.IDENT_RE+"(<"+Z.IDENT_RE+"(\\s*,\\s*"+Z.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+Z.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:W,illegal:/::/,contains:[Z.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},I,F,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},G,N,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[G,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[G,N,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:W,contains:[{beginKeywords:Q.join(" "),relevance:0},{begin:Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[Z.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:W,relevance:0,contains:[I,F,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},A]}}O4.exports=Z3});var N4=F0((G2,v4)=>{var J3=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},Q3=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],z3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],$3=[...Q3,...z3],q3=["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"].sort().reverse(),X3=["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"].sort().reverse(),W3=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),G3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function H3(Z){let J=Z.regex,Q=J3(Z),$={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},q="and or not only",X=/@-?\w[\w]*(-\w+)*/,W="[a-zA-Z-][a-zA-Z0-9_-]*",G=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[Q.BLOCK_COMMENT,$,Q.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},Q.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+X3.join("|")+")"},{begin:":(:)?("+W3.join("|")+")"}]},Q.CSS_VARIABLE,{className:"attribute",begin:"\\b("+G3.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[Q.BLOCK_COMMENT,Q.HEXCOLOR,Q.IMPORTANT,Q.CSS_NUMBER_MODE,...G,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...G,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},Q.FUNCTION_DISPATCH]},{begin:J.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:X},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:q3.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...G,Q.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+$3.join("|")+")\\b"}]}}v4.exports=H3});var k4=F0((H2,M4)=>{function F3(Z){let J=Z.regex,Q={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},$={begin:"^[-\\*]{3,}",end:"$"},q={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},X={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},W={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},G=/[A-Za-z][A-Za-z0-9+.-]*/,F={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:J.concat(/\[.+?\]\(/,G,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},H={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},K={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Y=Z.inherit(H,{contains:[]}),C=Z.inherit(K,{contains:[]});H.contains.push(C),K.contains.push(Y);let w=[Q,F];return[H,K,Y,C].forEach((I)=>{I.contains=I.contains.concat(w)}),w=w.concat(H,K),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},Q,X,H,K,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},q,$,F,W,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}M4.exports=F3});var V4=F0((F2,f4)=>{function K3(Z){let J=Z.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:J.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:J.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}f4.exports=K3});var I4=F0((K2,R4)=>{function Y3(Z){let J=Z.regex,Q="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",$=J.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),q=J.concat($,/(::\w+)*/),W={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},G={className:"doctag",begin:"@[A-Za-z]+"},F={begin:"#<",end:">"},H=[Z.COMMENT("#","$",{contains:[G]}),Z.COMMENT("^=begin","^=end",{contains:[G],relevance:10}),Z.COMMENT("^__END__",Z.MATCH_NOTHING_RE)],K={className:"subst",begin:/#\{/,end:/\}/,keywords:W},Y={className:"string",contains:[Z.BACKSLASH_ESCAPE,K],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:J.concat(/<<[-~]?'?/,J.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[Z.BACKSLASH_ESCAPE,K]})]}]},C="[1-9](_?[0-9])*|0",w="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:W}]},L=[Y,{variants:[{match:[/class\s+/,q,/\s+<\s+/,q]},{match:[/\b(class|module)\s+/,q]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:W},{match:[/(include|extend)\s+/,q],scope:{2:"title.class"},keywords:W},{relevance:0,match:[q,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:$,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:Z.IDENT_RE+"::"},{className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Y,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:W},{begin:"("+Z.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[Z.BACKSLASH_ESCAPE,K],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(F,H),relevance:0}].concat(F,H);K.contains=L,v.contains=L;let D="[>?]>",g="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",h="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",l=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+D+"|"+g+"|"+h+")(?=[ ])",starts:{end:"$",keywords:W,contains:L}}];return H.unshift(F),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:W,illegal:/\/\*/,contains:[Z.SHEBANG({binary:"ruby"})].concat(l).concat(H).concat(L)}}R4.exports=Y3});var T4=F0((Y2,S4)=>{function U3(Z){let X={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:X,illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"string",variants:[Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[Z.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:X,illegal:/["']/}]}]}}S4.exports=U3});var g4=F0((U2,b4)=>{function y3(Z){let J=Z.regex,Q=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[Z.HASH_COMMENT_MODE,Z.QUOTE_STRING_MODE,Z.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:J.concat(Q,J.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}b4.exports=y3});var j4=F0((y2,x4)=>{function B3(Z){let J=Z.regex,Q={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:Z.NUMBER_RE}]},$=Z.COMMENT();$.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let q={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},X={className:"literal",begin:/\bon|off|true|false|yes|no\b/},W={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},G={begin:/\[/,end:/\]/,contains:[$,X,q,W,Q,"self"],relevance:0},F=/[A-Za-z0-9_-]+/,H=/"(\\"|[^"])*"/,K=/'[^']*'/,Y=J.either(F,H,K),C=J.concat(Y,"(\\s*\\.\\s*",Y,")*",J.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[$,{className:"section",begin:/\[+/,end:/\]+/},{begin:C,className:"attr",starts:{end:/$/,contains:[$,G,X,q,W,Q]}}]}}x4.exports=B3});var u4=F0((B2,m4)=>{var I9="[0-9](_*[0-9])*",_Z=`\\.(${I9})`,vZ="[0-9a-fA-F](_*[0-9a-fA-F])*",D4={className:"number",variants:[{begin:`(\\b(${I9})((${_Z})|\\.)?|(${_Z}))[eE][+-]?(${I9})[fFdD]?\\b`},{begin:`\\b(${I9})((${_Z})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_Z})[fFdD]?\\b`},{begin:`\\b(${I9})[fFdD]\\b`},{begin:`\\b0[xX]((${vZ})\\.?|(${vZ})?\\.(${vZ}))[pP][+-]?(${I9})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vZ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function h4(Z,J,Q){if(Q===-1)return"";return Z.replace(J,($)=>{return h4(Z,J,Q-1)})}function L3(Z){let J=Z.regex,Q="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",$="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+h4("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),F={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},H={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},K={className:"params",begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:[Z.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:F,illegal:/<\/|#/,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[Z.BACKSLASH_ESCAPE]},Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[J.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[K,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+$+"\\s+)",Z.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:F,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:[H,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,D4,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},D4,H]}}m4.exports=L3});var d4=F0((L2,i4)=>{var P3=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],w3=["true","false","null","undefined","NaN","Infinity"],p4=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],E4=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],c4=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],C3=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],A3=[].concat(c4,p4,E4);function O3(Z){let J=Z.regex,Q=(B,{after:M})=>{let x="</"+B[0].slice(1);return B.input.indexOf(x,M)!==-1},$="[A-Za-z$_][0-9A-Za-z$_]*",q={begin:"<>",end:"</>"},X=/<[A-Za-z0-9\\._:-]+\s*\/>/,W={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,M)=>{let x=B[0].length+B.index,o=B.input[x];if(o==="<"||o===","){M.ignoreMatch();return}if(o===">"){if(!Q(B,{after:x}))M.ignoreMatch()}let z0,n=B.input.substring(x);if(z0=n.match(/^\s*=/)){M.ignoreMatch();return}if(z0=n.match(/^\s+extends\s+/)){if(z0.index===0){M.ignoreMatch();return}}}},G={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:P3,literal:w3,built_in:A3,"variable.language":C3},F="[0-9](_?[0-9])*",H="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:G,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,C]},N={className:"comment",variants:[Z.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},P=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,w,y,v,V,{match:/\$\d+/},Y];C.contains=P.concat({begin:/\{/,end:/\}/,keywords:G,contains:["self"].concat(P)});let A=[].concat(N,C.contains),O=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:G,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,contains:O},D={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},g={relevance:0,match:J.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...p4,...E4]}},h={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},l={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},c={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y0(B){return J.concat("(?!",B.join("|"),")")}let Q0={match:J.concat(/\b/,Y0([...c4,"super","import"].map((B)=>`${B}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},$0={begin:J.concat(/\./,J.lookahead(J.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y0={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",f={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:G,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:g},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),h,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,w,y,v,V,N,{match:/\$\d+/},Y,g,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},f,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,Z.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:q.begin,end:q.end},{match:X},{begin:W.begin,"on:begin":W.isTrulyOpeningTag,end:W.end}],subLanguage:"xml",contains:[{begin:W.begin,end:W.end,skip:!0,contains:["self"]}]}]},l,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},$0,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},Q0,c,D,y0,{match:/\$[(.]/}]}}i4.exports=O3});var r4=F0((P2,a4)=>{function _3(Z){let J={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},Q={match:/[{}[\],:]/,className:"punctuation",relevance:0},$=["true","false","null"],q={scope:"literal",beginKeywords:$.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:$},contains:[J,Q,Z.QUOTE_STRING_MODE,q,Z.C_NUMBER_MODE,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}a4.exports=_3});var n4=F0((w2,l4)=>{var S9="[0-9](_*[0-9])*",NZ=`\\.(${S9})`,MZ="[0-9a-fA-F](_*[0-9a-fA-F])*",v3={className:"number",variants:[{begin:`(\\b(${S9})((${NZ})|\\.)?|(${NZ}))[eE][+-]?(${S9})[fFdD]?\\b`},{begin:`\\b(${S9})((${NZ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${NZ})[fFdD]?\\b`},{begin:`\\b(${S9})[fFdD]\\b`},{begin:`\\b0[xX]((${MZ})\\.?|(${MZ})?\\.(${MZ}))[pP][+-]?(${S9})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${MZ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function N3(Z){let J={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},Q={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},$={className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"@"},q={className:"subst",begin:/\$\{/,end:/\}/,contains:[Z.C_NUMBER_MODE]},X={className:"variable",begin:"\\$"+Z.UNDERSCORE_IDENT_RE},W={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[X,q]},{begin:"'",end:"'",illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE,X,q]}]};q.contains.push(W);let G={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+Z.UNDERSCORE_IDENT_RE+")?"},F={className:"meta",begin:"@"+Z.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[Z.inherit(W,{className:"string"}),"self"]}]},H=v3,K=Z.COMMENT("/\\*","\\*/",{contains:[Z.C_BLOCK_COMMENT_MODE]}),Y={variants:[{className:"type",begin:Z.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},C=Y;return C.variants[1].contains=[Y],Y.variants[1].contains=[C],{name:"Kotlin",aliases:["kt","kts"],keywords:J,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),Z.C_LINE_COMMENT_MODE,K,Q,$,G,F,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:J,relevance:5,contains:[{begin:Z.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[Z.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:J,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[Y,Z.C_LINE_COMMENT_MODE,K],relevance:0},Z.C_LINE_COMMENT_MODE,K,G,F,W,Z.C_NUMBER_MODE]},K]},{begin:[/class|interface|trait/,/\s+/,Z.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},Z.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},G,F]},W,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
4
+ `},H]}}l4.exports=N3});var e4=F0((C2,s4)=>{var M3=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},k3=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],f3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],V3=[...k3,...f3],R3=["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"].sort().reverse(),t4=["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"].sort().reverse(),o4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),I3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),S3=t4.concat(o4).sort().reverse();function T3(Z){let J=M3(Z),Q=S3,$="and or not only",q="[\\w-]+",X="([\\w-]+|@\\{[\\w-]+\\})",W=[],G=[],F=function(P){return{className:"string",begin:"~?"+P+".*?"+P}},H=function(P,A,O){return{className:P,begin:A,relevance:O}},K={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:R3.join(" ")},Y={begin:"\\(",end:"\\)",contains:G,keywords:K,relevance:0};G.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,F("'"),F('"'),J.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},J.HEXCOLOR,Y,H("variable","@@?[\\w-]+",10),H("variable","@\\{[\\w-]+\\}"),H("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},J.IMPORTANT,{beginKeywords:"and not"},J.FUNCTION_DISPATCH);let C=G.concat({begin:/\{/,end:/\}/,contains:W}),w={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(G)},y={begin:X+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+I3.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:G}}]},v={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:K,returnEnd:!0,contains:G,relevance:0}},V={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:C}},I={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:X,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,w,H("keyword","all\\b"),H("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+V3.join("|")+")\\b",className:"selector-tag"},J.CSS_NUMBER_MODE,H("selector-tag",X,0),H("selector-id","#"+X),H("selector-class","\\."+X,0),H("selector-tag","&",0),J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+t4.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+o4.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:C},{begin:"!important"},J.FUNCTION_DISPATCH]},N={begin:`[\\w-]+:(:)?(${Q.join("|")})`,returnBegin:!0,contains:[I]};return W.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,v,V,N,y,I,w,J.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:W}}s4.exports=T3});var J5=F0((A2,Z5)=>{function b3(Z){let $={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},q=[Z.COMMENT("--(?!\\[=*\\[)","$"),Z.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[$],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:Z.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:q.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[Z.inherit(Z.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:q}].concat(q)},Z.C_NUMBER_MODE,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[$],relevance:5}])}}Z5.exports=b3});var z5=F0((O2,Q5)=>{function g3(Z){let J={className:"variable",variants:[{begin:"\\$\\("+Z.UNDERSCORE_IDENT_RE+"\\)",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},Q={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,J]},$={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[J,Q]},q={begin:"^"+Z.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},X={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},W={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[J]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[Z.HASH_COMMENT_MODE,J,Q,$,q,X,W]}}Q5.exports=g3});var q5=F0((_2,$5)=>{function x3(Z){let J=Z.regex,Q=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],$=/[dualxmsipngr]{0,12}/,q={$pattern:/[\w.]+/,keyword:Q.join(" ")},X={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:q},W={begin:/->\{/,end:/\}/},G={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},F={scope:"variable",variants:[{begin:/\$\d/},{begin:J.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[G]},H={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},K=[Z.BACKSLASH_ESCAPE,X,F],Y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],C=(v,V,I="\\1")=>{let N=I==="\\1"?I:J.concat(I,V);return J.concat(J.concat("(?:",v,")"),V,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,I,$)},w=(v,V,I)=>{return J.concat(J.concat("(?:",v,")"),V,/(?:\\.|[^\\\/])*?/,I,$)},y=[F,Z.HASH_COMMENT_MODE,Z.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),W,{className:"string",contains:K,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},H,{begin:"(\\/\\/|"+Z.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[Z.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:C("s|tr|y",J.either(...Y,{capture:!0}))},{begin:C("s|tr|y","\\(","\\)")},{begin:C("s|tr|y","\\[","\\]")},{begin:C("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:w("(?:m|qr)?",/\//,/\//)},{begin:w("m|qr",J.either(...Y,{capture:!0}),/\1/)},{begin:w("m|qr",/\(/,/\)/)},{begin:w("m|qr",/\[/,/\]/)},{begin:w("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[Z.TITLE_MODE,G]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[Z.TITLE_MODE,G,H]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return X.contains=y,W.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:q,contains:y}}$5.exports=x3});var W5=F0((v2,X5)=>{function j3(Z){let J={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},Q=/[a-zA-Z@][a-zA-Z0-9_]*/,G={"variable.language":["this","super"],$pattern:Q,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},F={$pattern:Q,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:G,illegal:"</",contains:[J,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,Z.C_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[Z.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+F.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:F,contains:[Z.UNDERSCORE_TITLE_MODE]},{begin:"\\."+Z.UNDERSCORE_IDENT_RE,relevance:0}]}}X5.exports=j3});var H5=F0((N2,G5)=>{function D3(Z){let J=Z.regex,Q=/(?![A-Za-z0-9])(?![$])/,$=J.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,Q),q=J.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,Q),X=J.concat(/[A-Z]+/,Q),W={scope:"variable",match:"\\$+"+$},G={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},F={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},H=Z.inherit(Z.APOS_STRING_MODE,{illegal:null}),K=Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,contains:Z.QUOTE_STRING_MODE.contains.concat(F)}),Y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:Z.QUOTE_STRING_MODE.contains.concat(F),"on:begin":($0,y0)=>{y0.data._beginMatch=$0[1]||$0[2]},"on:end":($0,y0)=>{if(y0.data._beginMatch!==$0[1])y0.ignoreMatch()}},C=Z.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),w=`[
5
+ ]`,y={scope:"string",variants:[K,H,Y,C]},v={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},V=["false","null","true"],I=["__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"],N=["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"],A={keyword:I,literal:(($0)=>{let y0=[];return $0.forEach((S)=>{if(y0.push(S),S.toLowerCase()===S)y0.push(S.toUpperCase());else y0.push(S.toLowerCase())}),y0})(V),built_in:N},O=($0)=>{return $0.map((y0)=>{return y0.replace(/\|\d+$/,"")})},L={variants:[{match:[/new/,J.concat(`[
6
+ ]`,"+"),J.concat("(?!",O(N).join("\\b|"),"\\b)"),q],scope:{1:"keyword",4:"title.class"}}]},D=J.concat($,"\\b(?!\\()"),g={variants:[{match:[J.concat(/::/,J.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[q,J.concat(/::/,J.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[q,J.concat("::",J.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[q,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},h={scope:"attr",match:J.concat($,J.lookahead(":"),J.lookahead(/(?!::)/))},l={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[h,W,g,Z.C_BLOCK_COMMENT_MODE,y,v,L]},c={relevance:0,match:[/\b/,J.concat("(?!fn\\b|function\\b|",O(I).join("\\b|"),"|",O(N).join("\\b|"),"\\b)"),$,J.concat(`[
7
+ ]`,"*"),J.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[l]};l.contains.push(c);let Y0=[h,g,Z.C_BLOCK_COMMENT_MODE,y,v,L],Q0={begin:J.concat(/#\[\s*\\?/,J.either(q,X)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:V,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:V,keyword:["new","array"]},contains:["self",...Y0]},...Y0,{scope:"meta",variants:[{match:q},{match:X}]}]};return{case_insensitive:!1,keywords:A,contains:[Q0,Z.HASH_COMMENT_MODE,Z.COMMENT("//","$"),Z.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:Z.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},G,{scope:"variable.language",match:/\$this\b/},W,c,g,{match:[/const/,/\s/,$],scope:{1:"keyword",3:"variable.constant"}},L,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},Z.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",Q0,W,g,Z.C_BLOCK_COMMENT_MODE,y,v]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},Z.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[Z.inherit(Z.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},Z.UNDERSCORE_TITLE_MODE]},y,v]}}G5.exports=D3});var K5=F0((M2,F5)=>{function h3(Z){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},Z.inherit(Z.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}F5.exports=h3});var U5=F0((k2,Y5)=>{function m3(Z){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}Y5.exports=m3});var B5=F0((f2,y5)=>{function u3(Z){let J=Z.regex,Q=/[\p{XID_Start}_]\p{XID_Continue}*/u,$=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],G={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:$,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},F={className:"meta",begin:/^(>>>|\.\.\.) /},H={className:"subst",begin:/\{/,end:/\}/,keywords:G,illegal:/#/},K={begin:/\{\{/,relevance:0},Y={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,F],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,F],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,F,K,H]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,F,K,H]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[Z.BACKSLASH_ESCAPE,K,H]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,K,H]},Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",w="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",y=`\\b|${$.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${y})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${y})`}]},V={className:"comment",begin:J.lookahead(/# type:/),end:/$/,keywords:G,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},I={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,contains:["self",F,v,Y,Z.HASH_COMMENT_MODE]}]};return H.contains=[Y,v,F],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:G,illegal:/(<\/|\?)|=>/,contains:[F,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Y,V,Z.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,Q],scope:{1:"keyword",3:"title.function"},contains:[I]},{variants:[{match:[/\bclass/,/\s+/,Q,/\s*/,/\(\s*/,Q,/\s*\)/]},{match:[/\bclass/,/\s+/,Q]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,I,Y]}]}}y5.exports=u3});var P5=F0((V2,L5)=>{function p3(Z){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}L5.exports=p3});var C5=F0((R2,w5)=>{function E3(Z){let J=Z.regex,Q=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,$=J.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),q=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,X=J.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:Q,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[Z.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:J.lookahead(J.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:Q},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),Z.HASH_COMMENT_MODE,{scope:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[q,$]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,$]},{scope:{1:"punctuation",2:"number"},match:[X,$]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,$]}]},{scope:{3:"operator"},match:[Q,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:q},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:X},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}w5.exports=E3});var O5=F0((I2,A5)=>{function c3(Z){let J=Z.regex,Q=/(r#)?/,$=J.concat(Q,Z.UNDERSCORE_IDENT_RE),q=J.concat(Q,Z.IDENT_RE),X={className:"title.function.invoke",relevance:0,begin:J.concat(/\b/,/(?!let|for|while|if|else|match\b)/,q,J.lookahead(/\s*\(/))},W="([ui](8|16|32|64|128|size)|f(32|64))?",G=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],F=["true","false","Some","None","Ok","Err"],H=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],K=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:Z.IDENT_RE+"!?",type:K,keyword:G,literal:F,built_in:H},illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.COMMENT("/\\*","\\*/",{contains:["self"]}),Z.inherit(Z.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,$],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,$],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,$,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,$],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,$],className:{1:"keyword",3:"title.class"}},{begin:Z.IDENT_RE+"::",keywords:{keyword:"Self",built_in:H,type:K}},{className:"punctuation",begin:"->"},X]}}A5.exports=c3});var v5=F0((S2,_5)=>{var i3=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},d3=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],a3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r3=[...d3,...a3],l3=["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"].sort().reverse(),n3=["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"].sort().reverse(),t3=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),o3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function s3(Z){let J=i3(Z),Q=t3,$=n3,q="@[a-z-]+",X="and or not only",W="[a-zA-Z-][a-zA-Z0-9_-]*",G={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,J.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+r3.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+$.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Q.join("|")+")"},G,{begin:/\(/,end:/\)/,contains:[J.CSS_NUMBER_MODE]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+o3.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[J.BLOCK_COMMENT,G,J.HEXCOLOR,J.CSS_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.IMPORTANT,J.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:l3.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},G,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.HEXCOLOR,J.CSS_NUMBER_MODE]},J.FUNCTION_DISPATCH]}}_5.exports=s3});var M5=F0((T2,N5)=>{function e3(Z){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}N5.exports=e3});var f5=F0((b2,k5)=>{function ZQ(Z){let J=Z.regex,Q=Z.COMMENT("--","$"),$={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},q={begin:/"/,end:/"/,contains:[{match:/""/}]},X=["true","false","unknown"],W=["double precision","large object","with timezone","without timezone"],G=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],F=["add","asc","collation","desc","final","first","last","view"],H=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],K=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],Y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],w=K,y=[...H,...F].filter((O)=>{return!K.includes(O)}),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},V={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},I={match:J.concat(/\b/,J.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function N(O){return J.concat(/\b/,J.either(...O.map((L)=>{return L.replace(/\s+/,"\\s+")})),/\b/)}let P={scope:"keyword",match:N(C),relevance:0};function A(O,{exceptions:L,when:D}={}){let g=D;return L=L||[],O.map((h)=>{if(h.match(/\|\d+$/)||L.includes(h))return h;else if(g(h))return`${h}|0`;else return h})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(y,{when:(O)=>O.length<3}),literal:X,type:G,built_in:Y},contains:[{scope:"type",match:N(W)},P,I,v,$,q,Z.C_NUMBER_MODE,Z.C_BLOCK_COMMENT_MODE,Q,V]}}k5.exports=ZQ});var j5=F0((g2,x5)=>{function S5(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function d9(Z){return v0("(?=",Z,")")}function v0(...Z){return Z.map((Q)=>S5(Q)).join("")}function JQ(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function E0(...Z){return"("+(JQ(Z).capture?"":"?:")+Z.map(($)=>S5($)).join("|")+")"}var C1=(Z)=>v0(/\b/,Z,/\w$/.test(Z)?/\b/:/\B/),QQ=["Protocol","Type"].map(C1),V5=["init","self"].map(C1),zQ=["Any","Self"],P1=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],R5=["false","nil","true"],$Q=["assignment","associativity","higherThan","left","lowerThan","none","right"],qQ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],I5=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],T5=E0(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),b5=E0(T5,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),w1=v0(T5,b5,"*"),g5=E0(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),fZ=E0(g5,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Q9=v0(g5,fZ,"*"),kZ=v0(/[A-Z]/,fZ,"*"),XQ=["attached","autoclosure",v0(/convention\(/,E0("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",v0(/objc\(/,Q9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],WQ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function GQ(Z){let J={match:/\s+/,relevance:0},Q=Z.COMMENT("/\\*","\\*/",{contains:["self"]}),$=[Z.C_LINE_COMMENT_MODE,Q],q={match:[/\./,E0(...QQ,...V5)],className:{2:"keyword"}},X={match:v0(/\./,E0(...P1)),relevance:0},W=P1.filter((P0)=>typeof P0==="string").concat(["_|0"]),G=P1.filter((P0)=>typeof P0!=="string").concat(zQ).map(C1),F={variants:[{className:"keyword",match:E0(...G,...V5)}]},H={$pattern:E0(/\b\w+/,/#\w+/),keyword:W.concat(qQ),literal:R5},K=[q,X,F],Y={match:v0(/\./,E0(...I5)),relevance:0},C={className:"built_in",match:v0(/\b/,E0(...I5),/(?=\()/)},w=[Y,C],y={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:w1},{match:`\\.(\\.|${b5})+`}]},V=[y,v],I="([0-9]_*)+",N="([0-9a-fA-F]_*)+",P={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(P0="")=>({className:"subst",variants:[{match:v0(/\\/,P0,/[0\\tnr"']/)},{match:v0(/\\/,P0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(P0="")=>({className:"subst",match:v0(/\\/,P0,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(P0="")=>({className:"subst",label:"interpol",begin:v0(/\\/,P0,/\(/),end:/\)/}),D=(P0="")=>({begin:v0(P0,/"""/),end:v0(/"""/,P0),contains:[A(P0),O(P0),L(P0)]}),g=(P0="")=>({begin:v0(P0,/"/),end:v0(/"/,P0),contains:[A(P0),L(P0)]}),h={className:"string",variants:[D(),D("#"),D("##"),D("###"),g(),g("#"),g("##"),g("###")]},l=[Z.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[Z.BACKSLASH_ESCAPE]}],c={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:l},Y0=(P0)=>{let s0=v0(P0,/\//),e=v0(/\//,P0);return{begin:s0,end:e,contains:[...l,{scope:"comment",begin:`#(?!.*${e})`,end:/$/}]}},Q0={scope:"regexp",variants:[Y0("###"),Y0("##"),Y0("#"),c]},$0={match:v0(/`/,Q9,/`/)},y0={className:"variable",match:/\$\d+/},S={className:"variable",match:`\\$${fZ}+`},f=[$0,y0,S],B={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:WQ,contains:[...V,P,h]}]}},M={scope:"keyword",match:v0(/@/,E0(...XQ),d9(E0(/\(/,/\s+/)))},x={scope:"meta",match:v0(/@/,Q9)},o=[B,M,x],z0={match:d9(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:v0(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,fZ,"+")},{className:"type",match:kZ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:v0(/\s+&\s+/,d9(kZ)),relevance:0}]},n={begin:/</,end:/>/,keywords:H,contains:[...$,...K,...o,y,z0]};z0.contains.push(n);let k={match:v0(Q9,/\s*:/),keywords:"_|0",relevance:0},j={begin:/\(/,end:/\)/,relevance:0,keywords:H,contains:["self",k,...$,Q0,...K,...w,...V,P,h,...f,...o,z0]},T={begin:/</,end:/>/,keywords:"repeat each",contains:[...$,z0]},i={begin:E0(d9(v0(Q9,/\s*:/)),d9(v0(Q9,/\s+/,Q9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Q9}]},J0={begin:/\(/,end:/\)/,keywords:H,contains:[i,...$,...K,...V,P,h,...o,z0,j],endsParent:!0,illegal:/["']/},H0={match:[/(func|macro)/,/\s+/,E0($0.match,Q9,w1)],className:{1:"keyword",3:"title.function"},contains:[T,J0,J],illegal:[/\[/,/%/]},B0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[T,J0,J],illegal:/\[|%/},O0={match:[/operator/,/\s+/,w1],className:{1:"keyword",3:"title"}},g0={begin:[/precedencegroup/,/\s+/,kZ],className:{1:"keyword",3:"title"},contains:[z0],keywords:[...$Q,...R5],end:/}/},N0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},d0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},m0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Q9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:H,contains:[T,...K,{begin:/:/,end:/\{/,keywords:H,contains:[{scope:"title.class.inherited",match:kZ},...K],relevance:0}]};for(let P0 of h.variants){let s0=P0.contains.find((O9)=>O9.label==="interpol");s0.keywords=H;let e=[...K,...w,...V,P,h,...f];s0.contains=[...e,{begin:/\(/,end:/\)/,contains:["self",...e]}]}return{name:"Swift",keywords:H,contains:[...$,H0,B0,N0,d0,m0,O0,g0,{beginKeywords:"import",end:/$/,contains:[...$],relevance:0},Q0,...K,...w,...V,P,h,...f,...o,z0,j]}}x5.exports=GQ});var h5=F0((x2,D5)=>{function HQ(Z){let $={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},q={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},X={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},W={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[Z.BACKSLASH_ESCAPE,q]},G=Z.inherit(W,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),F="[0-9]{4}(-[0-9][0-9]){0,2}",H="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",K="(\\.[0-9]*)?",Y="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",C={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},y={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},V=[$,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},Z.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},C,{className:"number",begin:Z.C_NUMBER_RE+"\\b",relevance:0},y,v,X,W],I=[...V];return I.pop(),I.push(G),w.contains=I,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:V}}D5.exports=HQ});var r5=F0((j2,a5)=>{var m5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],u5=["true","false","null","undefined","NaN","Infinity"],p5=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],E5=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],c5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],i5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d5=[].concat(c5,p5,E5);function FQ(Z){let J=Z.regex,Q=(B,{after:M})=>{let x="</"+B[0].slice(1);return B.input.indexOf(x,M)!==-1},$="[A-Za-z$_][0-9A-Za-z$_]*",q={begin:"<>",end:"</>"},X=/<[A-Za-z0-9\\._:-]+\s*\/>/,W={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,M)=>{let x=B[0].length+B.index,o=B.input[x];if(o==="<"||o===","){M.ignoreMatch();return}if(o===">"){if(!Q(B,{after:x}))M.ignoreMatch()}let z0,n=B.input.substring(x);if(z0=n.match(/^\s*=/)){M.ignoreMatch();return}if(z0=n.match(/^\s+extends\s+/)){if(z0.index===0){M.ignoreMatch();return}}}},G={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:m5,literal:u5,built_in:d5,"variable.language":i5},F="[0-9](_?[0-9])*",H="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Y={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:G,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},V={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,C]},N={className:"comment",variants:[Z.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},P=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,w,y,v,V,{match:/\$\d+/},Y];C.contains=P.concat({begin:/\{/,end:/\}/,keywords:G,contains:["self"].concat(P)});let A=[].concat(N,C.contains),O=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:G,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,contains:O},D={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},g={relevance:0,match:J.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...p5,...E5]}},h={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},l={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},c={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y0(B){return J.concat("(?!",B.join("|"),")")}let Q0={match:J.concat(/\b/,Y0([...c5,"super","import"].map((B)=>`${B}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},$0={begin:J.concat(/\./,J.lookahead(J.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y0={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",f={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:G,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:g},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),h,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,w,y,v,V,N,{match:/\$\d+/},Y,g,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},f,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,Z.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:q.begin,end:q.end},{match:X},{begin:W.begin,"on:begin":W.isTrulyOpeningTag,end:W.end}],subLanguage:"xml",contains:[{begin:W.begin,end:W.end,skip:!0,contains:["self"]}]}]},l,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},$0,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},Q0,c,D,y0,{match:/\$[(.]/}]}}function KQ(Z){let J=Z.regex,Q=FQ(Z),$="[A-Za-z$_][0-9A-Za-z$_]*",q=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],X={begin:[/namespace/,/\s+/,Z.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},W={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:q},contains:[Q.exports.CLASS_REFERENCE]},G={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},F=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],H={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:m5.concat(F),literal:u5,built_in:d5.concat(q),"variable.language":i5},K={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Y=(v,V,I)=>{let N=v.contains.findIndex((P)=>P.label===V);if(N===-1)throw Error("can not find mode to replace");v.contains.splice(N,1,I)};Object.assign(Q.keywords,H),Q.exports.PARAMS_CONTAINS.push(K);let C=Q.contains.find((v)=>v.scope==="attr"),w=Object.assign({},C,{match:J.concat("[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\?:/))});Q.exports.PARAMS_CONTAINS.push([Q.exports.CLASS_REFERENCE,C,w]),Q.contains=Q.contains.concat([K,X,W,w]),Y(Q,"shebang",Z.SHEBANG()),Y(Q,"use_strict",G);let y=Q.contains.find((v)=>v.label==="func.def");return y.relevance=0,Object.assign(Q,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),Q}a5.exports=KQ});var n5=F0((D2,l5)=>{function YQ(Z){let J=Z.regex,Q={className:"string",begin:/"(""|[^/n])"C\b/},$={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},q=/\d{1,2}\/\d{1,2}\/\d{4}/,X=/\d{4}-\d{1,2}-\d{1,2}/,W=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,G=/\d{1,2}(:\d{1,2}){1,2}/,F={className:"literal",variants:[{begin:J.concat(/# */,J.either(X,q),/ *#/)},{begin:J.concat(/# */,G,/ *#/)},{begin:J.concat(/# */,W,/ *#/)},{begin:J.concat(/# */,J.either(X,q),/ +/,J.either(W,G),/ *#/)}]},H={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},K={className:"label",begin:/^\w+:/},Y=Z.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),C=Z.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[Q,$,F,H,K,Y,C,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[C]}]}}l5.exports=YQ});var o5=F0((h2,t5)=>{function UQ(Z){Z.regex;let J=Z.COMMENT(/\(;/,/;\)/);J.contains.push("self");let Q=Z.COMMENT(/;;/,/$/),$=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],q={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},X={className:"variable",begin:/\$[\w_]+/},W={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},G={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},F={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},H={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:$},contains:[Q,J,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},X,W,q,Z.QUOTE_STRING_MODE,F,H,G]}}t5.exports=UQ});var e5=F0((m2,s5)=>{var G0=Y4();G0.registerLanguage("xml",y4());G0.registerLanguage("bash",L4());G0.registerLanguage("c",w4());G0.registerLanguage("cpp",A4());G0.registerLanguage("csharp",_4());G0.registerLanguage("css",N4());G0.registerLanguage("markdown",k4());G0.registerLanguage("diff",V4());G0.registerLanguage("ruby",I4());G0.registerLanguage("go",T4());G0.registerLanguage("graphql",g4());G0.registerLanguage("ini",j4());G0.registerLanguage("java",u4());G0.registerLanguage("javascript",d4());G0.registerLanguage("json",r4());G0.registerLanguage("kotlin",n4());G0.registerLanguage("less",e4());G0.registerLanguage("lua",J5());G0.registerLanguage("makefile",z5());G0.registerLanguage("perl",q5());G0.registerLanguage("objectivec",W5());G0.registerLanguage("php",H5());G0.registerLanguage("php-template",K5());G0.registerLanguage("plaintext",U5());G0.registerLanguage("python",B5());G0.registerLanguage("python-repl",P5());G0.registerLanguage("r",C5());G0.registerLanguage("rust",O5());G0.registerLanguage("scss",v5());G0.registerLanguage("shell",M5());G0.registerLanguage("sql",f5());G0.registerLanguage("swift",j5());G0.registerLanguage("yaml",h5());G0.registerLanguage("typescript",r5());G0.registerLanguage("vbnet",n5());G0.registerLanguage("wasm",o5());G0.HighlightJS=G0;G0.default=G0;s5.exports=G0});var WZ,A0,$8,L7,W9,Z8,q8,X8,EZ,JZ,D9,W8,aZ,cZ,iZ,P7,$Z={},qZ=[],w7=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,GZ=Array.isArray;function q9(Z,J){for(var Q in J)Z[Q]=J[Q];return Z}function rZ(Z){Z&&Z.parentNode&&Z.parentNode.removeChild(Z)}function C7(Z,J,Q){var $,q,X,W={};for(X in J)X=="key"?$=J[X]:X=="ref"?q=J[X]:W[X]=J[X];if(arguments.length>2&&(W.children=arguments.length>3?WZ.call(arguments,2):Q),typeof Z=="function"&&Z.defaultProps!=null)for(X in Z.defaultProps)W[X]===void 0&&(W[X]=Z.defaultProps[X]);return QZ(Z,W,$,q,null)}function QZ(Z,J,Q,$,q){var X={type:Z,props:J,key:Q,ref:$,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:q==null?++$8:q,__i:-1,__u:0};return q==null&&A0.vnode!=null&&A0.vnode(X),X}function a(Z){return Z.children}function zZ(Z,J){this.props=Z,this.context=J}function _9(Z,J){if(J==null)return Z.__?_9(Z.__,Z.__i+1):null;for(var Q;J<Z.__k.length;J++)if((Q=Z.__k[J])!=null&&Q.__e!=null)return Q.__e;return typeof Z.type=="function"?_9(Z):null}function A7(Z){if(Z.__P&&Z.__d){var J=Z.__v,Q=J.__e,$=[],q=[],X=q9({},J);X.__v=J.__v+1,A0.vnode&&A0.vnode(X),lZ(Z.__P,X,J,Z.__n,Z.__P.namespaceURI,32&J.__u?[Q]:null,$,Q==null?_9(J):Q,!!(32&J.__u),q),X.__v=J.__v,X.__.__k[X.__i]=X,K8($,X,q),J.__e=J.__=null,X.__e!=Q&&G8(X)}}function G8(Z){if((Z=Z.__)!=null&&Z.__c!=null)return Z.__e=Z.__c.base=null,Z.__k.some(function(J){if(J!=null&&J.__e!=null)return Z.__e=Z.__c.base=J.__e}),G8(Z)}function J8(Z){(!Z.__d&&(Z.__d=!0)&&W9.push(Z)&&!XZ.__r++||Z8!=A0.debounceRendering)&&((Z8=A0.debounceRendering)||q8)(XZ)}function XZ(){try{for(var Z,J=1;W9.length;)W9.length>J&&W9.sort(X8),Z=W9.shift(),J=W9.length,A7(Z)}finally{W9.length=XZ.__r=0}}function H8(Z,J,Q,$,q,X,W,G,F,H,K){var Y,C,w,y,v,V,I,N=$&&$.__k||qZ,P=J.length;for(F=O7(Q,J,N,F,P),Y=0;Y<P;Y++)(w=Q.__k[Y])!=null&&(C=w.__i!=-1&&N[w.__i]||$Z,w.__i=Y,V=lZ(Z,w,C,q,X,W,G,F,H,K),y=w.__e,w.ref&&C.ref!=w.ref&&(C.ref&&nZ(C.ref,null,w),K.push(w.ref,w.__c||y,w)),v==null&&y!=null&&(v=y),(I=!!(4&w.__u))||C.__k===w.__k?(F=F8(w,F,Z,I),I&&C.__e&&(C.__e=null)):typeof w.type=="function"&&V!==void 0?F=V:y&&(F=y.nextSibling),w.__u&=-7);return Q.__e=v,F}function O7(Z,J,Q,$,q){var X,W,G,F,H,K=Q.length,Y=K,C=0;for(Z.__k=Array(q),X=0;X<q;X++)(W=J[X])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=Z.__k[X]=QZ(null,W,null,null,null):GZ(W)?W=Z.__k[X]=QZ(a,{children:W},null,null,null):W.constructor===void 0&&W.__b>0?W=Z.__k[X]=QZ(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):Z.__k[X]=W,F=X+C,W.__=Z,W.__b=Z.__b+1,G=null,(H=W.__i=_7(W,Q,F,Y))!=-1&&(Y--,(G=Q[H])&&(G.__u|=2)),G==null||G.__v==null?(H==-1&&(q>K?C--:q<K&&C++),typeof W.type!="function"&&(W.__u|=4)):H!=F&&(H==F-1?C--:H==F+1?C++:(H>F?C--:C++,W.__u|=4))):Z.__k[X]=null;if(Y)for(X=0;X<K;X++)(G=Q[X])!=null&&(2&G.__u)==0&&(G.__e==$&&($=_9(G)),U8(G,G));return $}function F8(Z,J,Q,$){var q,X;if(typeof Z.type=="function"){for(q=Z.__k,X=0;q&&X<q.length;X++)q[X]&&(q[X].__=Z,J=F8(q[X],J,Q,$));return J}Z.__e!=J&&($&&(J&&Z.type&&!J.parentNode&&(J=_9(Z)),Q.insertBefore(Z.__e,J||null)),J=Z.__e);do J=J&&J.nextSibling;while(J!=null&&J.nodeType==8);return J}function _7(Z,J,Q,$){var q,X,W,G=Z.key,F=Z.type,H=J[Q],K=H!=null&&(2&H.__u)==0;if(H===null&&G==null||K&&G==H.key&&F==H.type)return Q;if($>(K?1:0)){for(q=Q-1,X=Q+1;q>=0||X<J.length;)if((H=J[W=q>=0?q--:X++])!=null&&(2&H.__u)==0&&G==H.key&&F==H.type)return W}return-1}function Q8(Z,J,Q){J[0]=="-"?Z.setProperty(J,Q==null?"":Q):Z[J]=Q==null?"":typeof Q!="number"||w7.test(J)?Q:Q+"px"}function ZZ(Z,J,Q,$,q){var X,W;Z:if(J=="style")if(typeof Q=="string")Z.style.cssText=Q;else{if(typeof $=="string"&&(Z.style.cssText=$=""),$)for(J in $)Q&&J in Q||Q8(Z.style,J,"");if(Q)for(J in Q)$&&Q[J]==$[J]||Q8(Z.style,J,Q[J])}else if(J[0]=="o"&&J[1]=="n")X=J!=(J=J.replace(W8,"$1")),W=J.toLowerCase(),J=W in Z||J=="onFocusOut"||J=="onFocusIn"?W.slice(2):J.slice(2),Z.l||(Z.l={}),Z.l[J+X]=Q,Q?$?Q[D9]=$[D9]:(Q[D9]=aZ,Z.addEventListener(J,X?iZ:cZ,X)):Z.removeEventListener(J,X?iZ:cZ,X);else{if(q=="http://www.w3.org/2000/svg")J=J.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(J!="width"&&J!="height"&&J!="href"&&J!="list"&&J!="form"&&J!="tabIndex"&&J!="download"&&J!="rowSpan"&&J!="colSpan"&&J!="role"&&J!="popover"&&J in Z)try{Z[J]=Q==null?"":Q;break Z}catch(G){}typeof Q=="function"||(Q==null||Q===!1&&J[4]!="-"?Z.removeAttribute(J):Z.setAttribute(J,J=="popover"&&Q==1?"":Q))}}function z8(Z){return function(J){if(this.l){var Q=this.l[J.type+Z];if(J[JZ]==null)J[JZ]=aZ++;else if(J[JZ]<Q[D9])return;return Q(A0.event?A0.event(J):J)}}}function lZ(Z,J,Q,$,q,X,W,G,F,H){var K,Y,C,w,y,v,V,I,N,P,A,O,L,D,g,h=J.type;if(J.constructor!==void 0)return null;128&Q.__u&&(F=!!(32&Q.__u),X=[G=J.__e=Q.__e]),(K=A0.__b)&&K(J);Z:if(typeof h=="function")try{if(I=J.props,N=h.prototype&&h.prototype.render,P=(K=h.contextType)&&$[K.__c],A=K?P?P.props.value:K.__:$,Q.__c?V=(Y=J.__c=Q.__c).__=Y.__E:(N?J.__c=Y=new h(I,A):(J.__c=Y=new zZ(I,A),Y.constructor=h,Y.render=N7),P&&P.sub(Y),Y.state||(Y.state={}),Y.__n=$,C=Y.__d=!0,Y.__h=[],Y._sb=[]),N&&Y.__s==null&&(Y.__s=Y.state),N&&h.getDerivedStateFromProps!=null&&(Y.__s==Y.state&&(Y.__s=q9({},Y.__s)),q9(Y.__s,h.getDerivedStateFromProps(I,Y.__s))),w=Y.props,y=Y.state,Y.__v=J,C)N&&h.getDerivedStateFromProps==null&&Y.componentWillMount!=null&&Y.componentWillMount(),N&&Y.componentDidMount!=null&&Y.__h.push(Y.componentDidMount);else{if(N&&h.getDerivedStateFromProps==null&&I!==w&&Y.componentWillReceiveProps!=null&&Y.componentWillReceiveProps(I,A),J.__v==Q.__v||!Y.__e&&Y.shouldComponentUpdate!=null&&Y.shouldComponentUpdate(I,Y.__s,A)===!1){J.__v!=Q.__v&&(Y.props=I,Y.state=Y.__s,Y.__d=!1),J.__e=Q.__e,J.__k=Q.__k,J.__k.some(function(l){l&&(l.__=J)}),qZ.push.apply(Y.__h,Y._sb),Y._sb=[],Y.__h.length&&W.push(Y);break Z}Y.componentWillUpdate!=null&&Y.componentWillUpdate(I,Y.__s,A),N&&Y.componentDidUpdate!=null&&Y.__h.push(function(){Y.componentDidUpdate(w,y,v)})}if(Y.context=A,Y.props=I,Y.__P=Z,Y.__e=!1,O=A0.__r,L=0,N)Y.state=Y.__s,Y.__d=!1,O&&O(J),K=Y.render(Y.props,Y.state,Y.context),qZ.push.apply(Y.__h,Y._sb),Y._sb=[];else do Y.__d=!1,O&&O(J),K=Y.render(Y.props,Y.state,Y.context),Y.state=Y.__s;while(Y.__d&&++L<25);Y.state=Y.__s,Y.getChildContext!=null&&($=q9(q9({},$),Y.getChildContext())),N&&!C&&Y.getSnapshotBeforeUpdate!=null&&(v=Y.getSnapshotBeforeUpdate(w,y)),D=K!=null&&K.type===a&&K.key==null?Y8(K.props.children):K,G=H8(Z,GZ(D)?D:[D],J,Q,$,q,X,W,G,F,H),Y.base=J.__e,J.__u&=-161,Y.__h.length&&W.push(Y),V&&(Y.__E=Y.__=null)}catch(l){if(J.__v=null,F||X!=null)if(l.then){for(J.__u|=F?160:128;G&&G.nodeType==8&&G.nextSibling;)G=G.nextSibling;X[X.indexOf(G)]=null,J.__e=G}else{for(g=X.length;g--;)rZ(X[g]);dZ(J)}else J.__e=Q.__e,J.__k=Q.__k,l.then||dZ(J);A0.__e(l,J,Q)}else X==null&&J.__v==Q.__v?(J.__k=Q.__k,J.__e=Q.__e):G=J.__e=v7(Q.__e,J,Q,$,q,X,W,F,H);return(K=A0.diffed)&&K(J),128&J.__u?void 0:G}function dZ(Z){Z&&(Z.__c&&(Z.__c.__e=!0),Z.__k&&Z.__k.some(dZ))}function K8(Z,J,Q){for(var $=0;$<Q.length;$++)nZ(Q[$],Q[++$],Q[++$]);A0.__c&&A0.__c(J,Z),Z.some(function(q){try{Z=q.__h,q.__h=[],Z.some(function(X){X.call(q)})}catch(X){A0.__e(X,q.__v)}})}function Y8(Z){return typeof Z!="object"||Z==null||Z.__b>0?Z:GZ(Z)?Z.map(Y8):Z.constructor!==void 0?null:q9({},Z)}function v7(Z,J,Q,$,q,X,W,G,F){var H,K,Y,C,w,y,v,V=Q.props||$Z,I=J.props,N=J.type;if(N=="svg"?q="http://www.w3.org/2000/svg":N=="math"?q="http://www.w3.org/1998/Math/MathML":q||(q="http://www.w3.org/1999/xhtml"),X!=null){for(H=0;H<X.length;H++)if((w=X[H])&&"setAttribute"in w==!!N&&(N?w.localName==N:w.nodeType==3)){Z=w,X[H]=null;break}}if(Z==null){if(N==null)return document.createTextNode(I);Z=document.createElementNS(q,N,I.is&&I),G&&(A0.__m&&A0.__m(J,X),G=!1),X=null}if(N==null)V===I||G&&Z.data==I||(Z.data=I);else{if(X=N=="textarea"&&I.defaultValue!=null?null:X&&WZ.call(Z.childNodes),!G&&X!=null)for(V={},H=0;H<Z.attributes.length;H++)V[(w=Z.attributes[H]).name]=w.value;for(H in V)w=V[H],H=="dangerouslySetInnerHTML"?Y=w:H=="children"||(H in I)||H=="value"&&("defaultValue"in I)||H=="checked"&&("defaultChecked"in I)||ZZ(Z,H,null,w,q);for(H in I)w=I[H],H=="children"?C=w:H=="dangerouslySetInnerHTML"?K=w:H=="value"?y=w:H=="checked"?v=w:G&&typeof w!="function"||V[H]===w||ZZ(Z,H,w,V[H],q);if(K)G||Y&&(K.__html==Y.__html||K.__html==Z.innerHTML)||(Z.innerHTML=K.__html),J.__k=[];else if(Y&&(Z.innerHTML=""),H8(J.type=="template"?Z.content:Z,GZ(C)?C:[C],J,Q,$,N=="foreignObject"?"http://www.w3.org/1999/xhtml":q,X,W,X?X[0]:Q.__k&&_9(Q,0),G,F),X!=null)for(H=X.length;H--;)rZ(X[H]);G&&N!="textarea"||(H="value",N=="progress"&&y==null?Z.removeAttribute("value"):y!=null&&(y!==Z[H]||N=="progress"&&!y||N=="option"&&y!=V[H])&&ZZ(Z,H,y,V[H],q),H="checked",v!=null&&v!=Z[H]&&ZZ(Z,H,v,V[H],q))}return Z}function nZ(Z,J,Q){try{if(typeof Z=="function"){var $=typeof Z.__u=="function";$&&Z.__u(),$&&J==null||(Z.__u=Z(J))}else Z.current=J}catch(q){A0.__e(q,Q)}}function U8(Z,J,Q){var $,q;if(A0.unmount&&A0.unmount(Z),($=Z.ref)&&($.current&&$.current!=Z.__e||nZ($,null,J)),($=Z.__c)!=null){if($.componentWillUnmount)try{$.componentWillUnmount()}catch(X){A0.__e(X,J)}$.base=$.__P=null}if($=Z.__k)for(q=0;q<$.length;q++)$[q]&&U8($[q],J,Q||typeof Z.type!="function");Q||rZ(Z.__e),Z.__c=Z.__=Z.__e=void 0}function N7(Z,J,Q){return this.constructor(Z,Q)}function tZ(Z,J,Q){var $,q,X,W;J==document&&(J=document.documentElement),A0.__&&A0.__(Z,J),q=($=typeof Q=="function")?null:Q&&Q.__k||J.__k,X=[],W=[],lZ(J,Z=(!$&&Q||J).__k=C7(a,null,[Z]),q||$Z,$Z,J.namespaceURI,!$&&Q?[Q]:q?null:J.firstChild?WZ.call(J.childNodes):null,X,!$&&Q?Q:q?q.__e:J.firstChild,$,W),K8(X,Z,W)}WZ=qZ.slice,A0={__e:function(Z,J,Q,$){for(var q,X,W;J=J.__;)if((q=J.__c)&&!q.__)try{if((X=q.constructor)&&X.getDerivedStateFromError!=null&&(q.setState(X.getDerivedStateFromError(Z)),W=q.__d),q.componentDidCatch!=null&&(q.componentDidCatch(Z,$||{}),W=q.__d),W)return q.__E=q}catch(G){Z=G}throw Z}},$8=0,L7=function(Z){return Z!=null&&Z.constructor===void 0},zZ.prototype.setState=function(Z,J){var Q;Q=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=q9({},this.state),typeof Z=="function"&&(Z=Z(q9({},Q),this.props)),Z&&q9(Q,Z),Z!=null&&this.__v&&(J&&this._sb.push(J),J8(this))},zZ.prototype.forceUpdate=function(Z){this.__v&&(this.__e=!0,Z&&this.__h.push(Z),J8(this))},zZ.prototype.render=a,W9=[],q8=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,X8=function(Z,J){return Z.__v.__b-J.__v.__b},XZ.__r=0,EZ=Math.random().toString(8),JZ="__d"+EZ,D9="__a"+EZ,W8=/(PointerCapture)$|Capture$/i,aZ=0,cZ=z8(!1),iZ=z8(!0),P7=0;var v9,f0,oZ,y8,h9=0,_8=[],I0=A0,B8=I0.__b,L8=I0.__r,P8=I0.diffed,w8=I0.__c,C8=I0.unmount,A8=I0.__;function FZ(Z,J){I0.__h&&I0.__h(f0,Z,h9||J),h9=0;var Q=f0.__H||(f0.__H={__:[],__h:[]});return Z>=Q.__.length&&Q.__.push({}),Q.__[Z]}function m(Z){return h9=1,M7(M8,Z)}function M7(Z,J,Q){var $=FZ(v9++,2);if($.t=Z,!$.__c&&($.__=[Q?Q(J):M8(void 0,J),function(G){var F=$.__N?$.__N[0]:$.__[0],H=$.t(F,G);F!==H&&($.__N=[H,$.__[1]],$.__c.setState({}))}],$.__c=f0,!f0.__f)){var q=function(G,F,H){if(!$.__c.__H)return!0;var K=$.__c.__H.__.filter(function(C){return C.__c});if(K.every(function(C){return!C.__N}))return!X||X.call(this,G,F,H);var Y=$.__c.props!==G;return K.some(function(C){if(C.__N){var w=C.__[0];C.__=C.__N,C.__N=void 0,w!==C.__[0]&&(Y=!0)}}),X&&X.call(this,G,F,H)||Y};f0.__f=!0;var{shouldComponentUpdate:X,componentWillUpdate:W}=f0;f0.componentWillUpdate=function(G,F,H){if(this.__e){var K=X;X=void 0,q(G,F,H),X=K}W&&W.call(this,G,F,H)},f0.shouldComponentUpdate=q}return $.__N||$.__}function Z0(Z,J){var Q=FZ(v9++,3);!I0.__s&&eZ(Q.__H,J)&&(Q.__=Z,Q.u=J,f0.__H.__h.push(Q))}function v8(Z,J){var Q=FZ(v9++,4);!I0.__s&&eZ(Q.__H,J)&&(Q.__=Z,Q.u=J,f0.__h.push(Q))}function W0(Z){return h9=5,N8(function(){return{current:Z}},[])}function N8(Z,J){var Q=FZ(v9++,7);return eZ(Q.__H,J)&&(Q.__=Z(),Q.__H=J,Q.__h=Z),Q.__}function U9(Z,J){return h9=8,N8(function(){return Z},J)}function k7(){for(var Z;Z=_8.shift();){var J=Z.__H;if(Z.__P&&J)try{J.__h.some(HZ),J.__h.some(sZ),J.__h=[]}catch(Q){J.__h=[],I0.__e(Q,Z.__v)}}}I0.__b=function(Z){f0=null,B8&&B8(Z)},I0.__=function(Z,J){Z&&J.__k&&J.__k.__m&&(Z.__m=J.__k.__m),A8&&A8(Z,J)},I0.__r=function(Z){L8&&L8(Z),v9=0;var J=(f0=Z.__c).__H;J&&(oZ===f0?(J.__h=[],f0.__h=[],J.__.some(function(Q){Q.__N&&(Q.__=Q.__N),Q.u=Q.__N=void 0})):(J.__h.some(HZ),J.__h.some(sZ),J.__h=[],v9=0)),oZ=f0},I0.diffed=function(Z){P8&&P8(Z);var J=Z.__c;J&&J.__H&&(J.__H.__h.length&&(_8.push(J)!==1&&y8===I0.requestAnimationFrame||((y8=I0.requestAnimationFrame)||f7)(k7)),J.__H.__.some(function(Q){Q.u&&(Q.__H=Q.u),Q.u=void 0})),oZ=f0=null},I0.__c=function(Z,J){J.some(function(Q){try{Q.__h.some(HZ),Q.__h=Q.__h.filter(function($){return!$.__||sZ($)})}catch($){J.some(function(q){q.__h&&(q.__h=[])}),J=[],I0.__e($,Q.__v)}}),w8&&w8(Z,J)},I0.unmount=function(Z){C8&&C8(Z);var J,Q=Z.__c;Q&&Q.__H&&(Q.__H.__.some(function($){try{HZ($)}catch(q){J=q}}),Q.__H=void 0,J&&I0.__e(J,Q.__v))};var O8=typeof requestAnimationFrame=="function";function f7(Z){var J,Q=function(){clearTimeout($),O8&&cancelAnimationFrame(J),setTimeout(Z)},$=setTimeout(Q,35);O8&&(J=requestAnimationFrame(Q))}function HZ(Z){var J=f0,Q=Z.__c;typeof Q=="function"&&(Z.__c=void 0,Q()),f0=J}function sZ(Z){var J=f0;Z.__c=Z.__(),f0=J}function eZ(Z,J){return!Z||Z.length!==J.length||J.some(function(Q,$){return Q!==Z[$]})}function M8(Z,J){return typeof J=="function"?J(Z):J}class KZ extends Error{code;status;constructor(Z,J,Q){super(Z);this.code=J;this.status=Q;this.name="ApiError"}}var y9="mh-nav-invalidate";function V7(Z,J){return Z!=="GET"&&(J.startsWith("/api/database")||J.startsWith("/api/document"))}async function K0(Z,J,Q){let $=await fetch(J,{method:Z,headers:Q!==void 0?{"content-type":"application/json"}:void 0,body:Q!==void 0?JSON.stringify(Q):void 0}),q=await $.json().catch(()=>null);if(!$.ok||q&&q.error)throw new KZ(q&&q.error||`${$.status} ${$.statusText}`,q?.code,$.status);if(V7(Z,J))document.dispatchEvent(new CustomEvent(y9));return q}var _0=(Z)=>encodeURIComponent(Z),p={listDatabases:()=>K0("GET","/api/databases"),createDatabase:(Z)=>K0("POST","/api/databases",Z),updateDatabase:(Z,J)=>K0("PATCH",`/api/database?id=${_0(Z)}`,J),deleteDatabase:(Z)=>K0("DELETE",`/api/database?id=${_0(Z)}`),listProperties:(Z)=>K0("GET",`/api/properties?db=${_0(Z)}`),createProperty:(Z)=>K0("POST","/api/properties",Z),updateProperty:(Z,J)=>K0("PATCH",`/api/property?id=${_0(Z)}`,J),setColumnWidth:(Z,J)=>K0("PATCH",`/api/property/width?id=${_0(Z)}`,{width:J}),deleteProperty:(Z)=>K0("DELETE",`/api/property?id=${_0(Z)}`),listRecords:(Z,J={})=>{let Q=new URLSearchParams({db:Z});if(J.sort)Q.set("sort",J.sort);if(J.limit!=null)Q.set("limit",String(J.limit));return K0("GET",`/api/records?${Q}`)},createRecord:(Z,J)=>K0("POST",`/api/records?db=${_0(Z)}`,J),getRecord:(Z)=>K0("GET",`/api/record?id=${_0(Z)}`),updateRecord:(Z,J)=>K0("PATCH",`/api/record?id=${_0(Z)}`,J),moveRecord:(Z,J,Q)=>K0("PATCH",`/api/record/order?id=${_0(Z)}`,{target:J,where:Q}),deleteRecord:(Z)=>K0("DELETE",`/api/record?id=${_0(Z)}`),listDocuments:(Z)=>K0("GET",Z?`/api/documents?db=${_0(Z)}`:"/api/documents"),listDocumentsByParent:(Z)=>K0("GET",`/api/documents?parent=${_0(Z)}`),createDocument:(Z)=>K0("POST","/api/documents",Z),getDocument:(Z)=>K0("GET",`/api/document?id=${_0(Z)}`),updateDocument:(Z,J)=>K0("PATCH",`/api/document?id=${_0(Z)}`,J),moveDocument:(Z,J,Q)=>K0("PATCH",`/api/document/move?id=${_0(Z)}`,{target:J,where:Q}),deleteDocument:(Z)=>K0("DELETE",`/api/document?id=${_0(Z)}`),search:(Z,J)=>{let Q=new URLSearchParams({q:Z});if(J!=null)Q.set("limit",String(J));return K0("GET",`/api/search?${Q}`)},listPeers:()=>K0("GET","/api/peers"),newPairingCode:()=>K0("POST","/api/pair/new"),addPeerByPairing:(Z)=>K0("POST","/api/peers/pair",Z),updatePeer:(Z,J)=>K0("PATCH",`/api/peer?url=${_0(Z)}`,J),removePeer:(Z)=>K0("DELETE",`/api/peer?url=${_0(Z)}`),syncPeer:(Z)=>K0("POST",`/api/peer/sync?url=${_0(Z)}`),listGrants:()=>K0("GET","/api/grants"),revokeGrant:(Z)=>K0("DELETE",`/api/grant?token=${_0(Z)}`),listSites:()=>K0("GET","/api/sites"),listSiteFiles:(Z)=>K0("GET",`/api/site/files?site=${_0(Z)}`),createSite:(Z)=>K0("POST","/api/sites",Z),updateSite:(Z,J)=>K0("PATCH",`/api/site?id=${_0(Z)}`,J),deleteSite:(Z)=>K0("DELETE",`/api/site?id=${_0(Z)}`),deleteSiteFile:(Z,J)=>K0("DELETE",`/api/site/file?site=${_0(Z)}&path=${_0(J)}`),uploadSiteFile:async(Z,J,Q)=>{let $=await fetch(`/api/site/file?site=${_0(Z)}&path=${_0(J)}`,{method:"POST",headers:{"content-type":Q.type||"application/octet-stream"},body:Q}),q=await $.json().catch(()=>null);if(!$.ok||q&&q.error)throw Error(q&&q.error||`${$.status} ${$.statusText}`);return q},version:()=>K0("GET","/api/version")},N9={text:{ic:"text",t:"文本"},number:{ic:"hash",t:"数字"},select:{ic:"select",t:"单选"},multi_select:{ic:"multi",t:"多选"},checkbox:{ic:"checkbox",t:"复选框"},date:{ic:"calendar",t:"日期"},url:{ic:"link",t:"链接"},relation:{ic:"relation",t:"关联"}};var R7=0;function z(Z,J,Q,$,q,X){J||(J={});var W,G,F=J;if("ref"in F)for(G in F={},J)G=="ref"?W=J[G]:F[G]=J[G];var H={type:Z,props:F,key:Q,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--R7,__i:-1,__u:0,__source:q,__self:X};if(typeof Z=="function"&&(W=Z.defaultProps))for(G in W)F[G]===void 0&&(F[G]=W[G]);return A0.vnode&&A0.vnode(H),H}var I7={cube:'<path d="M21 7.5 12 2 3 7.5v9L12 22l9-5.5z"/><path d="m3 7.5 9 5.5 9-5.5M12 22v-9"/>',chevron:'<path d="m9 6 6 6-6 6"/>',chevronDown:'<path d="m6 9 6 6 6-6"/>',arrowLeft:'<path d="M15 18l-6-6 6-6"/>',plus:'<path d="M12 5v14M5 12h14"/>',pin:'<path d="M9 4h6l-1 6 3 3v2H7v-2l3-3z"/><path d="M12 16v5"/>',search:'<circle cx="11" cy="11" r="7"/><path d="m20 20-3.2-3.2"/>',dots:'<circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/>',grip:'<circle cx="9" cy="6" r="1.3" fill="currentColor" stroke="none"/><circle cx="9" cy="12" r="1.3" fill="currentColor" stroke="none"/><circle cx="9" cy="18" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="6" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="12" r="1.3" fill="currentColor" stroke="none"/><circle cx="15" cy="18" r="1.3" fill="currentColor" stroke="none"/>',trash:'<path d="M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13M10 11v6M14 11v6"/>',filter:'<path d="M3 5h18l-7 8v6l-4-2v-4z"/>',sort:'<path d="M7 3v14M7 17l-3-3M7 17l3-3M17 21V7M17 7l-3 3M17 7l3 3"/>',group:'<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',check:'<path d="M5 12.5 10 17l9-10"/>',x:'<path d="M6 6 18 18M18 6 6 18"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',database:'<ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"/><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"/>',table:'<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16"/>',alignLeft:'<path d="M4 6h16M4 12h10M4 18h13"/>',alignCenter:'<path d="M4 6h16M7 12h10M5 18h14"/>',alignRight:'<path d="M4 6h16M10 12h10M7 18h13"/>',share:'<path d="M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7"/><path d="M12 3v13M8 7l4-4 4 4"/>',download:'<path d="M12 3v12M8 11l4 4 4-4"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/>',copy:'<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/>',link:'<path d="M10 13a5 5 0 0 0 7 0l2-2a5 5 0 0 0-7-7l-1 1"/><path d="M14 11a5 5 0 0 0-7 0l-2 2a5 5 0 0 0 7 7l1-1"/>',calendar:'<rect x="3" y="4" width="18" height="17" rx="2"/><path d="M3 9h18M8 2v4M16 2v4"/>',timeline:'<rect x="3" y="5" width="9" height="3" rx="1.5"/><rect x="8" y="10.5" width="11" height="3" rx="1.5"/><rect x="5" y="16" width="7" height="3" rx="1.5"/>',hash:'<path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/>',text:'<path d="M4 6h16M4 6v-.5M8 6v13M4 19h8"/><path d="M14 11h6M17 11v8M14 19h6"/>',list:'<path d="M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"/>',numList:'<path d="M10 6h10M10 12h10M10 18h10M4 5h1v4M4 9h2M4 13.5c0-.8 2-.8 2 0 0 .8-2 1.2-2 2.5h2"/>',checkbox:'<rect x="4" y="4" width="16" height="16" rx="3"/><path d="m9 12 2 2 4-4"/>',select:'<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3" fill="currentColor" stroke="none"/>',multi:'<path d="M8 6h12M8 12h12M8 18h12M3 6h.01M3 12h.01M3 18h.01"/>',relation:'<path d="M7 7h4v4H7zM13 13h4v4h-4z"/><path d="M11 9h2a2 2 0 0 1 2 2v2"/>',quote:'<path d="M7 7c-2 1-3 3-3 6h3v4H4v-4M17 7c-2 1-3 3-3 6h3v4h-3v-4"/>',code:'<path d="m8 8-4 4 4 4M16 8l4 4-4 4M13 6l-2 12"/>',minus:'<path d="M5 12h14"/>',heading:'<path d="M6 4v16M18 4v16M6 12h12"/>',panelLeft:'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16"/>',cornerUpRight:'<path d="M5 19V11a4 4 0 0 1 4-4h10M15 3l4 4-4 4"/>',openPeek:'<rect x="3" y="5" width="18" height="14" rx="2.5"/><rect x="6" y="8" width="4" height="8" rx="1" fill="currentColor" stroke="none"/>',settings:'<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>',eyeOff:'<path d="M4 4l16 16M9.5 9.5a3 3 0 0 0 4 4M6.5 6.7C4.5 8 3 10 2 12c2 4 6 7 10 7 1.6 0 3-.4 4.4-1.1M9.5 5.2A9.7 9.7 0 0 1 12 5c4 0 8 3 10 7-.6 1.3-1.5 2.5-2.5 3.5"/>',bold:'<path d="M6 4h7a4 4 0 0 1 0 8H6zM6 12h8a4 4 0 0 1 0 8H6z"/>',italic:'<path d="M19 4h-9M14 20H5M15 4 9 20"/>',underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4M4 21h16"/>',strike:'<path d="M4 12h16M7 7a4 4 0 0 1 7-1M9 17a4 4 0 0 0 7-2"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>',moon:'<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',monitor:'<rect x="3" y="4" width="18" height="13" rx="2"/><path d="M8 21h8M12 17v4"/>',globe:'<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.4 2.5 3.7 5.7 3.7 9S14.4 18.5 12 21c-2.4-2.5-3.7-5.7-3.7-9S9.6 5.5 12 3z"/>',eye:'<path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/>',lock:'<rect x="4.5" y="11" width="15" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',upload:'<path d="M12 16V4M8 8l4-4 4 4M5 20h14"/>',externalLink:'<path d="M14 4h6v6M20 4l-9 9M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5"/>'};function b({name:Z,cls:J="ico"}){return z("svg",{class:J,viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:I7[Z]??""}},void 0,!1,void 0,this)}var i0={text:"text",number:"hash",select:"select",multi_select:"multi",checkbox:"checkbox",date:"calendar",url:"link",relation:"relation"};function M9(Z,J){let Q=J.threshold??4,$=Q===0,q=(W)=>{if(W.pointerId!==Z.pointerId)return;if(!$){if(Math.hypot(W.clientX-Z.clientX,W.clientY-Z.clientY)<Q)return;$=!0,J.onStart?.(W)}W.preventDefault(),J.onMove(W)},X=(W)=>{if(W.pointerId!==Z.pointerId)return;removeEventListener("pointermove",q),removeEventListener("pointerup",X),removeEventListener("pointercancel",X),J.onEnd?.(W,$)};addEventListener("pointermove",q,{passive:!1}),addEventListener("pointerup",X),addEventListener("pointercancel",X)}function e0(){document.querySelectorAll(".drop-into,.drop-before,.drop-after").forEach((Z)=>Z.classList.remove("drop-into","drop-before","drop-after"))}function Z1(Z,J,Q){e0();let $=Z.getBoundingClientRect(),q=Q==="y"?J.clientY<$.top+$.height/2?"before":"after":J.clientX<$.left+$.width/2?"before":"after";return Z.classList.add("drop-"+q),q}function S7(Z,J,Q){let $=document.createElement("div");return $.className="drag-ghost "+Z,$.style.width=`${J.width}px`,$.style.height=`${J.height}px`,$.textContent=Q,document.body.appendChild($),$}function J1(Z,J,Q){if(!Z)return;Z.style.transform=`translate3d(${Math.round(J)}px, ${Math.round(Q)}px, 0)`}function Q1(Z,J){let Q=J.source.getBoundingClientRect(),$=Z.clientX-Q.left,q=Z.clientY-Q.top,X=null,W=null,G="before";M9(Z,{onStart:()=>{X=S7(J.ghostCls,Q,J.ghostText),J.source.classList.add("drag-source"),document.body.classList.add("table-dragging"),J.onActivate?.()},onMove:(F)=>{J1(X,F.clientX-$,F.clientY-q);let H=document.elementFromPoint(F.clientX,F.clientY)?.closest?.(J.targetSelector);if(!H||J.isSelf(H)){e0(),W=null;return}W=H,G=Z1(H,F,J.axis)},onEnd:(F,H)=>{if(X?.remove(),J.source.classList.remove("drag-source"),document.body.classList.remove("table-dragging"),e0(),H&&W)J.onDrop(W,G);J.onFinish?.(H)}})}function YZ(Z,J){let Q=Z.currentTarget,$=J.startWidth,q=0;Q.classList.add("dragging"),document.body.classList.add("col-resizing"),M9(Z,{threshold:0,onMove:(X)=>{if($=Math.max(J.min,J.startWidth+X.clientX-Z.clientX),!q)q=requestAnimationFrame(()=>{if(q=0,J.col)J.col.style.width=$+"px"})},onEnd:()=>{if(q)cancelAnimationFrame(q);if(J.col)J.col.style.width=$+"px";Q.classList.remove("dragging"),document.body.classList.remove("col-resizing"),J.onDone($)}})}var UZ="(max-width: 768px) and (pointer: coarse)";function z1(Z){let J=Z,Q=new Set;return{get:()=>J,set:($)=>{J=$,Q.forEach((q)=>q($))},use(){let[$,q]=m(J);return Z0(()=>{return Q.add(q),()=>void Q.delete(q)},[]),$}}}var m9=z1([]),T7=0;function U0(Z){let J=++T7;m9.set([...m9.get(),{id:J,msg:Z}]),setTimeout(()=>m9.set(m9.get().filter((Q)=>Q.id!==J)),2600)}var $1=z1(null);function w0(Z,J,Q={}){$1.set({render:J,anchor:Z,minWidth:Q.minWidth})}function k8(){$1.set(null)}function b7(Z){if(Z instanceof MouseEvent)return{x:Z.clientX,y:Z.clientY};if("rect"in Z)return{x:Z.rect.left,y:Z.rect.bottom,bottom:Z.rect.bottom};return{x:Z.x,y:Z.y}}function g7(){let Z=$1.use(),J=W0(null),[Q,$]=m(null),q=matchMedia(UZ).matches;if(v8(()=>{if(!Z||!J.current||q)return $(null);let{x:X,y:W}=b7(Z.anchor),G=J.current.getBoundingClientRect();$({left:Math.min(X,innerWidth-G.width-10),top:Math.min(W+4,innerHeight-G.height-10)})},[Z,q]),!Z)return null;return z("div",{class:"menu-layer",onMouseDown:(X)=>X.target===X.currentTarget&&k8(),children:z("div",{ref:J,class:"pop"+(q?" sheet":""),style:q?void 0:{left:Q?.left??-9999,top:Q?.top??-9999,minWidth:Z.minWidth},onMouseDown:(X)=>X.stopPropagation(),children:Z.render(k8)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function T0({children:Z}){return z("div",{class:"lbl",children:Z},void 0,!1,void 0,this)}function M0(){return z("div",{class:"sep"},void 0,!1,void 0,this)}function r({icon:Z,label:J,sublabel:Q,danger:$,checked:q,onClick:X}){return z("button",{class:"item"+($?" danger":""),onClick:X,children:[Z&&z("span",{class:"lico plain",children:z(b,{name:Z,cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"meta",children:[z("span",{class:"t",children:J},void 0,!1,void 0,this),Q&&z("span",{class:"d",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&z("span",{class:"chk",children:z(b,{name:"check",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function yZ(Z,J=240){let[Q,$]=m(!1);return Z0(()=>{let X=requestAnimationFrame(()=>$(!0));return()=>cancelAnimationFrame(X)},[]),{open:Q,close:()=>{$(!1),setTimeout(Z,J)}}}var q1=z1(null);function n0(Z){q1.set(Z)}function u0(){q1.set(null)}function Z9({title:Z,sub:J,children:Q,footer:$,width:q}){return z("div",{class:"modal",style:{width:q},onMouseDown:(X)=>X.stopPropagation(),children:[z("div",{class:"modal-head",children:[z("h3",{children:Z},void 0,!1,void 0,this),J&&z("p",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"modal-body",children:Q},void 0,!1,void 0,this),$&&z("div",{class:"modal-foot",children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function x7(){let Z=q1.use();return Z0(()=>{if(!Z)return;let J=(Q)=>Q.key==="Escape"&&u0();return addEventListener("keydown",J),()=>removeEventListener("keydown",J)},[Z]),z("div",{class:"modal-scrim"+(Z?" open":""),onMouseDown:(J)=>J.target===J.currentTarget&&u0(),children:Z},void 0,!1,void 0,this)}function b0(Z){return new Promise((J)=>{let Q=($)=>{u0(),J($)};n0(z(Z9,{title:Z.title,footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:()=>Q(!1),children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn "+(Z.danger?"btn-danger":"btn-primary"),onClick:()=>Q(!0),children:Z.confirmLabel??"确定"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:z("div",{class:"muted",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this))})}function J9(Z){return new Promise((J)=>{let Q=Z.value??"",$=(q)=>{u0(),J(q)};n0(z(Z9,{title:Z.title,footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:()=>$(null),children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:()=>$(Q.trim()||(Z.value??"")),children:Z.confirmLabel??"保存"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[Z.label&&z("div",{class:"field-label",children:Z.label},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,value:Z.value??"",placeholder:Z.placeholder,onInput:(q)=>Q=q.target.value,onKeyDown:(q)=>{if(q.key==="Enter")$(Q.trim()||(Z.value??""))}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))})}function BZ(){let Z=m9.use();return z(a,{children:[z(g7,{},void 0,!1,void 0,this),z(x7,{},void 0,!1,void 0,this),z("div",{class:"toasts",children:Z.map((J)=>z("div",{class:"toast",children:[z(b,{name:"check",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:J.msg},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var X1=null,j7=/mac/i.test(navigator.userAgentData?.platform??navigator.platform);function V8(Z){let{view:J,navigate:Q}=Z,[$,q]=m(new Set),[X,W]=m(""),[G,F]=m(!1),H=W0(null),[K,Y]=m(null),C=m7(Z.onResize);Z0(()=>{p.version().then((O)=>Y(O.version)).catch(()=>Y(null))},[]),Z0(()=>{if(G)H.current?.focus()},[G]);let w=(O)=>{let L=new Set($);L.has(O)?L.delete(O):L.add(O),q(L)},y=(O)=>O().catch((L)=>Z.onError(String(L.message))),v=(O)=>{if("id"in J&&J.id===O)Q({kind:"empty"},{replace:!0})},V=(O)=>y(async()=>{let L=await p.createDocument({title:"",...O?{parent_id:O}:{}});if(O)$.add(O);Q({kind:"doc",id:L.id})}),I=(O,L,D)=>y(async()=>{if(O===L.id)return;if(h7(Z.docs,O,L.id))return;if(await p.moveDocument(O,L.id,D),D==="into")$.add(L.id)}),N=(O,L)=>{O.stopPropagation(),w0(O,(D)=>z(a,{children:[z(r,{icon:"settings",label:"重命名…",onClick:async()=>{D();let g=await J9({title:"重命名数据库",value:L.name});if(g&&g!==L.name)y(async()=>{await p.updateDatabase(L.id,{name:g})})}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除数据库",danger:!0,onClick:async()=>{if(D(),await b0({title:"删除数据库?",message:`「${L.name}」及其所有记录将被永久删除。`,confirmLabel:"删除",danger:!0}))y(async()=>{await p.deleteDatabase(L.id),v(L.id)})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},P=(O,L)=>{O.stopPropagation();let D=Z.docs.filter((g)=>g.parent_id===L.id).length;w0(O,(g)=>z(a,{children:[z(r,{icon:"plus",label:"新建子页",onClick:()=>{g(),V(L.id)}},void 0,!1,void 0,this),z(r,{icon:"settings",label:"重命名…",onClick:async()=>{g();let h=await J9({title:"重命名文档",value:L.title});if(h)y(async()=>{await p.updateDocument(L.id,{title:h})})}},void 0,!1,void 0,this),L.parent_id&&z(r,{icon:"cornerUpRight",label:"移到顶层",onClick:()=>{g(),y(async()=>{await p.updateDocument(L.id,{parent_id:null})})}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除",danger:!0,onClick:async()=>{if(g(),await b0({title:"删除文档?",message:D?`「${L.title||"无标题"}」及其 ${D} 个子页将被删除。`:`「${L.title||"无标题"}」将被删除。`,confirmLabel:"删除",danger:!0}))y(async()=>{await I8(Z.docs,L.id),v(L.id)})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},A=(O,L=0)=>{return Z.docs.filter((g)=>g.parent_id===O).map((g)=>{let h=Z.docs.filter((c)=>c.parent_id===g.id),l=h.length>0&&$.has(g.id);return z("div",{class:L?"navchildren":"",children:[z("div",{class:"navitem"+(J.kind==="doc"&&J.id===g.id?" active":""),draggable:!0,onClick:()=>Q({kind:"doc",id:g.id}),onDragStart:(c)=>{c.stopPropagation(),X1=g.id,c.currentTarget.classList.add("dragging")},onDragEnd:(c)=>{c.currentTarget.classList.remove("dragging"),W1()},onDragOver:(c)=>{c.preventDefault(),c.stopPropagation(),D7(c.currentTarget,c)},onDrop:(c)=>{c.preventDefault(),c.stopPropagation();let Y0=R8(c.currentTarget,c),Q0=X1;if(X1=null,W1(),Q0)I(Q0,g,Y0)},children:[z("span",{class:"tw"+(l?" open":""),onClick:(c)=>{if(c.stopPropagation(),h.length)w(g.id)},children:h.length>0&&z(b,{name:"chevron",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"emoji",children:z(b,{name:"file",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"label",children:g.title||"无标题"},void 0,!1,void 0,this),z("span",{class:"acts",children:[z("button",{title:"新建子页",onClick:(c)=>{c.stopPropagation(),V(g.id)},children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{title:"更多",onClick:(c)=>P(c,g),children:z(b,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l&&A(g.id,L+1)]},g.id,!0,void 0,this)})};return z("div",{class:"sidebar"+(Z.collapsed?" collapsed":""),style:{width:Z.width,marginLeft:Z.collapsed?-Z.width:void 0},children:[z("div",{class:"sb-head",children:[z("div",{class:"brand",children:[z("span",{class:"mark",children:z(b,{name:"cube"},void 0,!1,void 0,this)},void 0,!1,void 0,this),"Metahub"]},void 0,!0,void 0,this),z("button",{class:"sb-act"+(G?" active":""),title:"搜索","aria-label":"搜索",onClick:()=>F((O)=>!O),children:z(b,{name:"search",cls:"ico"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"sb-act"+(J.kind==="sites"?" active":""),title:"站点","aria-label":"站点",onClick:()=>Q({kind:"sites"}),children:z(b,{name:"globe",cls:"ico"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"sb-act"+(J.kind==="settings"?" active":""),title:"设置","aria-label":"设置",onClick:()=>Q({kind:"settings"}),children:[z(b,{name:"settings",cls:"ico"},void 0,!1,void 0,this),Z.updatePending&&z("span",{class:"nav-dot",title:"有可用更新"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"收起侧栏",onClick:Z.onCollapse,children:z(b,{name:"panelLeft"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-search"+(G?" open":""),onClick:(O)=>O.currentTarget.querySelector("input")?.focus(),children:[z(b,{name:"search",cls:"ico sm"},void 0,!1,void 0,this),z("input",{ref:H,placeholder:"搜索…",value:X,onInput:(O)=>W(O.target.value),onKeyDown:(O)=>{if(O.key==="Enter"&&X.trim())Q({kind:"search",q:X.trim()},{replace:J.kind==="search"})}},void 0,!1,void 0,this),z("kbd",{children:j7?"⌘K":"Ctrl K"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-scroll",children:[z("div",{class:"sb-section",children:[z("div",{class:"sb-section-head",children:[z("span",{children:"数据库"},void 0,!1,void 0,this),z("button",{class:"add",title:"新建数据库",onClick:()=>u7((O)=>Q({kind:"db",id:O}),Z.onError),children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z.databases.map((O)=>z("div",{class:"navitem"+(J.kind==="db"&&J.id===O.id?" active":""),onClick:()=>Q({kind:"db",id:O.id}),children:[z("span",{class:"emoji",children:O.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("span",{class:"label",children:O.name},void 0,!1,void 0,this),z("span",{class:"acts",children:z("button",{title:"更多",onClick:(L)=>N(L,O),children:z(b,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O.id,!0,void 0,this)),Z.databases.length===0&&z("div",{class:"navitem muted",children:"暂无"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-section",children:[z("div",{class:"sb-section-head",children:[z("span",{children:"文档"},void 0,!1,void 0,this),z("button",{class:"add",title:"新建文档",onClick:()=>V(null),children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A(null),Z.docs.length===0&&z("div",{class:"navitem muted",children:"暂无"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-footer",children:[z("button",{class:"sb-act"+(J.kind==="settings"?" active":""),title:"设置","aria-label":"设置",onClick:()=>Q({kind:"settings"}),children:[z(b,{name:"settings",cls:"ico sm"},void 0,!1,void 0,this),Z.updatePending&&z("span",{class:"nav-dot",title:"有可用更新"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"sb-act"+(J.kind==="sites"?" active":""),title:"站点","aria-label":"站点",onClick:()=>Q({kind:"sites"}),children:z(b,{name:"globe",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K&&z("span",{class:"sbf-ver",title:`Metahub Core v${K}`,children:["v",K]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"sb-resizer",onMouseDown:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var W1=e0;function R8(Z,J){let Q=Z.getBoundingClientRect(),$=J.clientY-Q.top;return $<Q.height*0.28?"before":$>Q.height*0.72?"after":"into"}function D7(Z,J){W1(),Z.classList.add("drop-"+R8(Z,J))}function h7(Z,J,Q){let $=Z.find((q)=>q.id===Q);while($){if($.parent_id===J)return!0;$=Z.find((q)=>q.id===$.parent_id)}return!1}async function I8(Z,J){for(let Q of Z.filter(($)=>$.parent_id===J))await I8(Z,Q.id);await p.deleteDocument(J)}function m7(Z){return(J)=>{J.preventDefault();let Q=(q)=>Z(Math.max(210,Math.min(460,q.clientX))),$=()=>{removeEventListener("mousemove",Q),removeEventListener("mouseup",$)};addEventListener("mousemove",Q),addEventListener("mouseup",$)}}var f8={blank:[{name:"名称",type:"text"}],tasks:[{name:"名称",type:"text"},{name:"状态",type:"select",config:{options:["待办","进行中","已完成"]}},{name:"优先级",type:"select",config:{options:["高","中","低"]}},{name:"截止",type:"date"}],crm:[{name:"姓名",type:"text"},{name:"公司",type:"text"},{name:"分类",type:"select",config:{options:["客户","合作","潜在"]}},{name:"邮箱",type:"url"}]};function u7(Z,J){n0(z(p7,{onOpenDb:Z,onError:J},void 0,!1,void 0,this))}function p7(Z){let J=["\uD83D\uDDC2️","\uD83C\uDFAF","\uD83E\uDD1D","\uD83D\uDCE6","\uD83D\uDCDA","\uD83D\uDCA1","\uD83E\uDDE9","\uD83D\uDCCA","\uD83D\uDDD3️","✅"],Q=[["blank","空白","仅一个「名称」列"],["tasks","任务","状态·优先级·截止"],["crm","联系人","公司·分类·邮箱"]],[$,q]=m(""),[X,W]=m(J[0]),[G,F]=m("blank"),H=W0(!1),K=async()=>{if(H.current)return;H.current=!0;try{let Y=await p.createDatabase({name:$.trim()||"未命名数据库",icon:X});for(let C of f8[G]??f8.blank)await p.createProperty({db:Y.id,name:C.name,type:C.type,config:C.config});u0(),Z.onOpenDb(Y.id),U0(`已创建数据库「${Y.name}」`)}catch(Y){Z.onError(String(Y.message))}finally{H.current=!1}};return z(Z9,{title:"新建数据库",sub:"创建一个带属性列的结构化数据表。",footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:u0,children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:K,children:"创建"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{class:"field-label",children:"名称"},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,placeholder:"例如:项目、客户、库存…",value:$,onInput:(Y)=>q(Y.target.value),onKeyDown:(Y)=>Y.key==="Enter"&&K()},void 0,!1,void 0,this),z("div",{class:"field-label",children:"图标"},void 0,!1,void 0,this),z("div",{class:"icon-pick",children:J.map((Y)=>z("button",{class:Y===X?"sel":"",onClick:()=>W(Y),children:Y},Y,!1,void 0,this))},void 0,!1,void 0,this),z("div",{class:"field-label",children:"模板"},void 0,!1,void 0,this),z("div",{class:"tmpl",children:Q.map(([Y,C,w])=>z("button",{class:Y===G?"sel":"",onClick:()=>F(Y),children:[z("div",{class:"tt",children:C},void 0,!1,void 0,this),z("div",{class:"td",children:w},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var S8=[4,28,45,130,165,200,220,255,290,330];function G1(Z){let J=0;for(let Q=0;Q<Z.length;Q++)J=J*31+Z.charCodeAt(Q)>>>0;return`hsl(${S8[J%S8.length]} 65% 45%)`}function B9({text:Z}){return z("span",{class:"chip",style:{["--c"]:G1(Z)},children:Z},void 0,!1,void 0,this)}function k9({prop:Z,val:J}){if(J==null||J===""||Array.isArray(J)&&J.length===0)return z("span",{class:"muted",children:" "},void 0,!1,void 0,this);if(Z.type==="select")return z(B9,{text:String(J)},void 0,!1,void 0,this);if(Z.type==="multi_select"||Z.type==="relation")return z(a,{children:J.map((Q)=>z(B9,{text:String(Q)},String(Q),!1,void 0,this))},void 0,!1,void 0,this);if(Z.type==="url")return z("a",{href:String(J),target:"_blank",rel:"noreferrer",onClick:(Q)=>Q.stopPropagation(),children:String(J)},void 0,!1,void 0,this);return z("span",{children:String(J)},void 0,!1,void 0,this)}function T8(Z,J){if(Z==="relation")return J.split(",").map((Q)=>Q.trim()).filter(Boolean);return J}function b8(Z,J){if(J==null)return"";if(Array.isArray(J))return J.join(", ");return String(J)}var L9="\x00__ungrouped__";function g8({props:Z,records:J,onCommitValue:Q,onCreate:$,onOpenRecord:q,onMove:X}){let W=Z.filter((N)=>N.type==="select"||N.type==="multi_select"),[G,F]=m(null),H=Z.find((N)=>N.id===G)??W.find((N)=>N.type==="select")??W[0]??null;if(!H)return z("div",{class:"view-placeholder",children:"看板视图需要一个「单选」或「多选」属性来分组。请在表格视图中添加一个单选列后再切换到看板。"},void 0,!1,void 0,this);let K=Z[0],Y=H.type==="multi_select",C=H.config?.options??[],w=(N)=>{let P=N.values[H.name];if(Y){let O=(Array.isArray(P)?P:[]).map(String).filter((L)=>C.includes(L));return O.length?O:[L9]}let A=P==null?"":String(P);return A&&C.includes(A)?[A]:[L9]},y=new Map;for(let N of C)y.set(N,[]);y.set(L9,[]);for(let N of J)for(let P of w(N))y.get(P)?.push(N);let v=[...C];if((y.get(L9)?.length??0)>0)v.push(L9);let V=(N,P)=>{if(N.button!==0)return;if(N.target.closest("button,a,input"))return;let A=N.currentTarget.closest(".kcard");if(!A)return;let O=A.getBoundingClientRect();N.preventDefault();let L=N.clientX-O.left,D=N.clientY-O.top,g=null;M9(N,{onStart:()=>{g=A.cloneNode(!0),g.classList.add("dragging-ghost"),g.style.width=`${O.width}px`,document.body.appendChild(g),A.classList.add("drag-source"),document.body.classList.add("table-dragging")},onMove:(h)=>{J1(g,h.clientX-L,h.clientY-D),e0(),document.elementFromPoint(h.clientX,h.clientY)?.closest?.(".board-col")?.classList.add("drop-into")},onEnd:(h,l)=>{if(g?.remove(),A.classList.remove("drag-source"),document.body.classList.remove("table-dragging"),e0(),!l){q(P.id);return}let c=document.elementFromPoint(h.clientX,h.clientY)?.closest?.(".board-col");if(!c)return;if(!Y){let $0=c.dataset.colKey,y0=String(P.values[H.name]??""),S=$0===L9?null:$0;if(String(S??"")!==y0)Q(P,H,S)}let Y0=document.elementFromPoint(h.clientX,h.clientY)?.closest?.(".kcard"),Q0=Y0?.dataset.recId;if(Q0&&Q0!==P.id){let $0=Y0.getBoundingClientRect();X(P.id,Q0,h.clientY<$0.top+$0.height/2?"before":"after")}}})};return z("div",{class:"board-wrap",children:[z("div",{class:"board-bar",children:[z("button",{class:"tbtn",onClick:(N)=>w0(N,(P)=>z(a,{children:[z(T0,{children:"按属性分组"},void 0,!1,void 0,this),W.map((A)=>z(r,{icon:i0[A.type],label:A.name,onClick:()=>{F(A.id),P()}},A.id,!1,void 0,this))]},void 0,!0,void 0,this)),children:[z(b,{name:"group",cls:"ico sm"},void 0,!1,void 0,this),"分组:",H.name]},void 0,!0,void 0,this),Y&&z("span",{class:"muted",style:{fontSize:12},children:"多选分组不支持拖拽改值"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"board",children:v.map((N)=>{let P=y.get(N)??[],A=N===L9;return z("div",{class:"board-col","data-col-key":N,children:[z("div",{class:"board-col-head",children:[A?z("span",{class:"muted",style:{fontWeight:600},children:"未分组"},void 0,!1,void 0,this):z(B9,{text:N},void 0,!1,void 0,this),z("span",{class:"board-count",children:P.length},void 0,!1,void 0,this),z("div",{class:"spacer"},void 0,!1,void 0,this),z("button",{class:"iconbtn sm",title:"新建记录",onClick:()=>$(A?{}:{[H.name]:N}),children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"board-col-body",children:[P.map((O)=>z("div",{class:"kcard","data-rec-id":O.id,onPointerDown:(L)=>V(L,O),children:[z("div",{class:"kcard-title",children:E7(O,K)||z("span",{class:"muted",children:"无标题"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z.filter((L)=>L!==K&&L.id!==H.id&&!c7(O.values[L.name])).slice(0,4).map((L)=>z("div",{class:"kcard-field",children:[z(b,{name:i0[L.type]??"text",cls:"ico sm"},void 0,!1,void 0,this),z(k9,{prop:L,val:O.values[L.name]},void 0,!1,void 0,this)]},L.id,!0,void 0,this))]},O.id,!0,void 0,this)),z("button",{class:"board-add",onClick:()=>$(A?{}:{[H.name]:N}),children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function E7(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}function c7(Z){return Z==null||Z===""||Array.isArray(Z)&&Z.length===0}function u9(Z){if(Z==null)return null;let J=String(Z).trim();if(!J)return null;let Q=/^(\d{4})-(\d{2})-(\d{2})/.exec(J);if(Q)return new Date(Number(Q[1]),Number(Q[2])-1,Number(Q[3]));let $=new Date(J);return Number.isNaN($.getTime())?null:new Date($.getFullYear(),$.getMonth(),$.getDate())}function t0(Z){let J=Z.getFullYear(),Q=String(Z.getMonth()+1).padStart(2,"0"),$=String(Z.getDate()).padStart(2,"0");return`${J}-${Q}-${$}`}function j0(Z,J){return new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()+J)}function H1(Z,J){return Z.getFullYear()===J.getFullYear()&&Z.getMonth()===J.getMonth()&&Z.getDate()===J.getDate()}function i7(Z,J){return new Date(Z,J,1)}function d7(Z,J){return new Date(Z,J+1,0)}function f9(Z,J){let Q=Date.UTC(Z.getFullYear(),Z.getMonth(),Z.getDate()),$=Date.UTC(J.getFullYear(),J.getMonth(),J.getDate());return Math.round(($-Q)/86400000)}function LZ(){let Z=new Date;return new Date(Z.getFullYear(),Z.getMonth(),Z.getDate())}function a7(Z){let J=(Z.getDay()+6)%7;return j0(Z,-J)}function x8(Z,J){let Q=a7(i7(Z,J)),$=d7(Z,J),q=[],X=Q;while(X<=$||q.length===0||X.getDay()!==1){let W=[];for(let G=0;G<7;G++)W.push(j0(X,G));if(q.push(W),X=j0(X,7),q.length>=6)break}return q}var r7=["一","二","三","四","五","六","日"],F1=3;function j8({props:Z,records:J,onCommitValue:Q,onCreate:$,onOpenRecord:q}){let X=Z.filter((L)=>L.type==="date"),[W,G]=m(null),F=Z.find((L)=>L.id===W)??X[0]??null,H=LZ(),[K,Y]=m({y:H.getFullYear(),m:H.getMonth()}),C=W0(null);if(!F)return z("div",{class:"view-placeholder",children:"日历视图需要一个「日期」属性。请在表格视图中添加一个日期列后再切换到日历。"},void 0,!1,void 0,this);let w=Z[0],y=x8(K.y,K.m),v=J.map((L)=>({rec:L,date:u9(L.values[F.name])})).filter((L)=>L.date!=null),V=(L)=>v.filter((D)=>H1(D.date,L)),I=(L)=>{let D=K.m+L;Y({y:K.y+Math.floor(D/12),m:(D%12+12)%12})},N=()=>Y({y:H.getFullYear(),m:H.getMonth()}),P=()=>document.querySelectorAll(".cal-day.drop-into").forEach((L)=>L.classList.remove("drop-into")),A=(L,D)=>{if(L.button!==0)return;L.preventDefault(),L.stopPropagation(),C.current={id:D.id,pointerId:L.pointerId,startX:L.clientX,startY:L.clientY,active:!1,ghost:null};let g=(l)=>{let c=C.current;if(!c||c.pointerId!==l.pointerId)return;if(!c.active){if(Math.hypot(l.clientX-c.startX,l.clientY-c.startY)<4)return;c.active=!0,c.ghost=l7(PZ(D,w)),document.body.classList.add("table-dragging")}if(l.preventDefault(),c.ghost)c.ghost.style.transform=`translate3d(${Math.round(l.clientX+8)}px, ${Math.round(l.clientY+8)}px, 0)`;P(),document.elementFromPoint(l.clientX,l.clientY)?.closest?.(".cal-day")?.classList.add("drop-into")},h=(l)=>{let c=C.current;if(!c||c.pointerId!==l.pointerId)return;if(removeEventListener("pointermove",g),removeEventListener("pointerup",h),removeEventListener("pointercancel",h),c.ghost?.remove(),document.body.classList.remove("table-dragging"),P(),C.current=null,!c.active){q(D.id);return}let Q0=document.elementFromPoint(l.clientX,l.clientY)?.closest?.(".cal-day")?.dataset.iso;if(Q0&&Q0!==String(D.values[F.name]??""))Q(D,F,Q0)};addEventListener("pointermove",g,{passive:!1}),addEventListener("pointerup",h),addEventListener("pointercancel",h)},O=(L)=>w0(L,(D)=>z(a,{children:[z(T0,{children:"按日期属性"},void 0,!1,void 0,this),X.map((g)=>z(r,{icon:i0[g.type],label:g.name,onClick:()=>{G(g.id),D()}},g.id,!1,void 0,this))]},void 0,!0,void 0,this));return z("div",{class:"cal",children:[z("div",{class:"cal-nav",children:[z("button",{class:"iconbtn",title:"上个月",onClick:()=>I(-1),children:z(b,{name:"chevron",cls:"ico flip"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"cal-title",children:[K.y," 年 ",K.m+1," 月"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"下个月",onClick:()=>I(1),children:z(b,{name:"chevron",cls:"ico"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"tbtn",onClick:N,children:"今天"},void 0,!1,void 0,this),z("div",{class:"spacer"},void 0,!1,void 0,this),X.length>1&&z("button",{class:"tbtn",onClick:O,children:[z(b,{name:"calendar",cls:"ico sm"},void 0,!1,void 0,this),F.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"cal-grid cal-head",children:r7.map((L)=>z("div",{class:"cal-wd",children:L},L,!1,void 0,this))},void 0,!1,void 0,this),z("div",{class:"cal-body",children:y.map((L,D)=>z("div",{class:"cal-grid cal-week",children:L.map((g)=>{let h=g.getMonth()!==K.m,l=H1(g,H),c=V(g),Y0=t0(g);return z("div",{class:"cal-day"+(h?" dim":"")+(l?" today":""),"data-iso":Y0,onClick:(Q0)=>{if(Q0.target.closest(".cal-ev,.cal-add,.cal-more"))return;$({[F.name]:Y0})},children:[z("div",{class:"cal-daynum",children:[z("span",{children:g.getDate()},void 0,!1,void 0,this),z("button",{class:"cal-add",title:"新建记录",onClick:(Q0)=>{Q0.stopPropagation(),$({[F.name]:Y0})},children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"cal-events",children:[c.slice(0,F1).map(({rec:Q0})=>z("div",{class:"cal-ev",style:{["--c"]:G1(PZ(Q0,w)||Q0.id)},onPointerDown:($0)=>A($0,Q0),children:PZ(Q0,w)||"无标题"},Q0.id,!1,void 0,this)),c.length>F1&&z("button",{class:"cal-more",onClick:(Q0)=>{Q0.stopPropagation(),w0(Q0,($0)=>z(a,{children:[z(T0,{children:[Y0," · ",c.length," 条记录"]},void 0,!0,void 0,this),c.map(({rec:y0})=>z(r,{label:PZ(y0,w)||"无标题",onClick:()=>{$0(),q(y0.id)}},y0.id,!1,void 0,this))]},void 0,!0,void 0,this))},children:["+",c.length-F1," 更多"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},Y0,!0,void 0,this)})},D,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function PZ(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}function l7(Z){let J=document.createElement("div");return J.className="drag-ghost",J.textContent=Z||"移动记录",document.body.appendChild(J),J}var G9=200,p9=36,E9=44,p0=28,D8=3;function m8({props:Z,records:J,onCommitValue:Q,onOpenRecord:$}){let q=Z.filter((f)=>f.type==="date"),[X,W]=m(null),[G,F]=m(null),H=Z.find((f)=>f.id===X)??q[0]??null,K=G==="none"?null:Z.find((f)=>f.id===G)??q.find((f)=>f!==H)??null,Y=W0(null),C=W0(null);if(!H)return z("div",{class:"view-placeholder",children:"时间轴视图需要一个「日期」属性作为开始日期。请在表格视图中添加一个日期列后再切换到时间轴。"},void 0,!1,void 0,this);let w=Z[0],y=LZ(),v=J.map((f)=>{let B=u9(f.values[H.name]),M=K?u9(f.values[K.name]):null;return{rec:f,s:B,e:M&&B&&M<B?B:M}}),V=v.filter((f)=>f.s),I=y,N=y;if(V.length){I=V[0].s,N=V[0].s;for(let f of V){if(f.s<I)I=f.s;let B=f.e??f.s;if(B>N)N=B}}else I=j0(y,-10),N=j0(y,14);let P=j0(I,-D8),A=j0(N,D8),O=f9(P,A)+1,L=G9+O*p0,D=(f)=>G9+f*p0,g=f9(P,y),h=[];for(let f=0;f<O;f++)h.push(j0(P,f));let l=(f,B,M,x,o)=>{if(o===0)return;if(x==="move"){if(B)Q(f,H,t0(j0(B,o)));if(K&&M)Q(f,K,t0(j0(M,o)))}else if(x==="l"&&B){let z0=j0(B,o);Q(f,H,t0(M&&z0>M?M:z0))}else if(x==="r"&&K&&M){let z0=j0(M,o);Q(f,K,t0(B&&z0<B?B:z0))}},c=(f,B)=>{let M=C.current;if(!M)return;M.style.left=f+"px",M.style.display="block";let x=M.firstElementChild;if(x)x.textContent=B},Y0=()=>{if(C.current)C.current.style.display="none"},Q0=(f,B,M,x,o,z0)=>{if(f.button!==0||!M)return;f.preventDefault(),f.stopPropagation();let{offsetLeft:n,offsetWidth:k}=z0,j=!1;Y.current={pointerId:f.pointerId,startX:f.clientX};let T=(J0)=>{let H0=Y.current;if(!H0||H0.pointerId!==J0.pointerId)return;let B0=Math.round((J0.clientX-H0.startX)/p0);if(Math.abs(J0.clientX-H0.startX)>3)j=!0;let O0,g0;if(o==="move"){let N0=n+B0*p0;z0.style.left=N0+"px",O0=N0,g0=j0(M,B0)}else if(o==="l"){let N0=n+B0*p0;z0.style.left=N0+"px",z0.style.width=Math.max(p0,k-B0*p0)+"px",O0=N0,g0=j0(M,B0)}else{let N0=Math.max(p0,k+B0*p0);z0.style.width=N0+"px",O0=n+N0,g0=j0(M,Math.round(N0/p0)-1)}c(O0,t0(g0))},i=(J0)=>{let H0=Y.current;if(!H0||H0.pointerId!==J0.pointerId)return;removeEventListener("pointermove",T),removeEventListener("pointerup",i),removeEventListener("pointercancel",i),Y.current=null,Y0();let B0=Math.round((J0.clientX-H0.startX)/p0);if(!j){$(B.id);return}l(B,M,x,o,B0)};addEventListener("pointermove",T,{passive:!1}),addEventListener("pointerup",i),addEventListener("pointercancel",i)},$0=(f,B)=>{if(Q(f,H,t0(B)),K)Q(f,K,t0(B))},y0=(f,B)=>{let M=f.currentTarget.closest(".tl-row");if(!M)return;let x=f.clientX-M.getBoundingClientRect().left;if(x<G9)return;let o=Math.max(0,Math.min(O-1,Math.round((x-G9)/p0)));$0(B,j0(P,o))};return z("div",{class:"tl",children:[z("div",{class:"tl-toolbar",children:z("button",{class:"tbtn",onClick:(f)=>w0(f,(B)=>z(a,{children:[z(T0,{children:"开始日期"},void 0,!1,void 0,this),q.map((M)=>z(r,{icon:i0[M.type],label:M.name,checked:M===H,onClick:()=>{W(M.id),B()}},M.id,!1,void 0,this)),z(M0,{},void 0,!1,void 0,this),z(T0,{children:"结束日期(可选)"},void 0,!1,void 0,this),z(r,{icon:"x",label:"无(里程碑)",checked:!K,onClick:()=>{F("none"),B()}},void 0,!1,void 0,this),q.map((M)=>z(r,{icon:i0[M.type],label:M.name,checked:M===K,onClick:()=>{F(M.id),B()}},M.id,!1,void 0,this))]},void 0,!0,void 0,this)),children:[z(b,{name:"timeline",cls:"ico sm"},void 0,!1,void 0,this),H.name,K?` → ${K.name}`:"(里程碑)"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("div",{class:"tl-scroll",children:z("div",{class:"tl-canvas",style:{width:L,height:E9+v.length*p9+8},children:[z("div",{class:"tl-axis",style:{height:E9},children:[z("div",{class:"tl-corner",style:{width:G9},children:"记录"},void 0,!1,void 0,this),h.map((f,B)=>{let M=f.getDate()===1;return z("div",{class:"tl-tick"+(M?" mstart":"")+(f9(f,y)===0?" today":""),style:{left:D(B),width:p0},children:[M&&z("span",{class:"tl-month",children:[f.getMonth()+1,"月"]},void 0,!0,void 0,this),z("span",{class:"tl-dnum",children:f.getDate()},void 0,!1,void 0,this)]},B,!0,void 0,this)})]},void 0,!0,void 0,this),v.map(({rec:f,s:B,e:M},x)=>{let o=B?f9(P,B):0,z0=B&&M?f9(B,M)+1:1;return z("div",{class:"tl-row",style:{top:E9+x*p9,height:p9},children:[z("div",{class:"tl-rowlabel",style:{width:G9},children:h8(f,w)||z("span",{class:"muted",children:"无标题"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!B?z("div",{class:"tl-track-empty",style:{left:G9},onClick:(n)=>y0(n,f),title:"点击空白处排期",children:z("button",{class:"tl-schedule",style:{left:G9+8},onClick:(n)=>{n.stopPropagation(),$0(f,y)},children:"未排期 · 排到今天"},void 0,!1,void 0,this)},void 0,!1,void 0,this):M?z("div",{class:"tl-item",style:{left:D(o),width:z0*p0},onPointerDown:(n)=>Q0(n,f,B,M,"move",n.currentTarget),children:[z("span",{class:"tl-h l",onPointerDown:(n)=>Q0(n,f,B,M,"l",n.currentTarget.parentElement)},void 0,!1,void 0,this),z("span",{class:"tl-label",children:h8(f,w)},void 0,!1,void 0,this),z("span",{class:"tl-h r",onPointerDown:(n)=>Q0(n,f,B,M,"r",n.currentTarget.parentElement)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):z("div",{class:"tl-milestone",style:{left:D(o)},title:t0(B),onPointerDown:(n)=>Q0(n,f,B,null,"move",n.currentTarget)},void 0,!1,void 0,this)]},f.id,!0,void 0,this)}),g>=0&&g<O&&z("div",{class:"tl-today",style:{left:D(g)+p0/2,height:E9+v.length*p9}},void 0,!1,void 0,this),z("div",{class:"tl-guide",ref:C,style:{display:"none",height:E9+v.length*p9},children:z("span",{class:"tl-guide-label"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h8(Z,J){if(!J)return"";let Q=Z.values[J.name];return Q==null?"":Array.isArray(Q)?Q.join(", "):String(Q)}var n7=[["表格","list"],["看板","group"],["日历","calendar"],["时间轴","timeline"]];function wZ(Z){return{r0:Math.min(Z.a.r,Z.b.r),r1:Math.max(Z.a.r,Z.b.r),c0:Math.min(Z.a.c,Z.b.c),c1:Math.max(Z.a.c,Z.b.c)}}function p8({db:Z,onError:J}){let[Q,$]=m([]),[q,X]=m([]),[W,G]=m(0),[F,H]=m(new Set),[K,Y]=m(null),[C,w]=m(null),[y,v]=m(null),[V,I]=m(null),N=(k)=>k.config?.width??180,P=W0(!1),A=(k)=>k().catch((j)=>J(String(j.message))),O=async()=>{let[k,j]=await Promise.all([p.listProperties(Z.id),p.listRecords(Z.id)]);$(k),X(j)};Z0(()=>{H(new Set),v(null),G(0),I(null),O().catch((k)=>J(String(k.message)))},[Z.id]);let L=(k,j,T)=>A(async()=>{let i=await p.updateRecord(k.id,{[j.name]:T});X((J0)=>J0.map((H0)=>H0.id===k.id?i:H0)),w(null)}),D=(k)=>A(async()=>{let j=await p.createRecord(Z.id,k);X((T)=>[...T,j])}),g=()=>D({}),h=(k)=>A(async()=>{if(await Promise.all(k.map((j)=>p.deleteRecord(j))),X((j)=>j.filter((T)=>!k.includes(T.id))),H(new Set),y&&k.includes(y))v(null)}),l=(k)=>A(async()=>{let j=await p.createRecord(Z.id,k.values);X((T)=>{let i=T.findIndex((J0)=>J0.id===k.id);return[...T.slice(0,i+1),j,...T.slice(i+1)]})}),c=(k,j,T)=>{if(k===j||K)return;X((i)=>u8(i,k,j,T))},Y0=(k,j,T)=>{if(k===j||K)return;c(k,j,T),p.moveRecord(k,j,T).catch((i)=>{J(String(i.message)),O().catch((J0)=>J(String(J0.message)))})},Q0=(k,j,T)=>{if(k===j)return;$((i)=>{let J0=u8(i,k,j,T).map((O0,g0)=>({...O0,position:g0+1})),H0=new Map(i.map((O0)=>[O0.id,O0.position])),B0=J0.filter((O0)=>H0.get(O0.id)!==O0.position);if(B0.length)Promise.all(B0.map((O0)=>p.updateProperty(O0.id,{position:O0.position}))).catch((O0)=>{J(String(O0.message)),O().catch((g0)=>J(String(g0.message)))});return J0})},$0=(k,j)=>{if(K||k.button!==0)return;let T=k.currentTarget.closest("tr");if(!T)return;k.preventDefault(),Q1(k,{source:T,axis:"y",ghostCls:"row-ghost",ghostText:o7(T),targetSelector:"tr[data-row-id]",isSelf:(i)=>i.dataset.rowId===j.id,onDrop:(i,J0)=>Y0(j.id,i.dataset.rowId,J0)})},y0=(k,j)=>{if(k.button!==0)return;let T=k.currentTarget.closest("th");if(!T)return;Q1(k,{source:T,axis:"x",ghostCls:"col-ghost",ghostText:T.textContent?.trim()||"移动属性",targetSelector:"th[data-col-id]",isSelf:(i)=>i.dataset.colId===j.id,onActivate:()=>{P.current=!0},onDrop:(i,J0)=>Q0(j.id,i.dataset.colId,J0),onFinish:(i)=>{if(i)setTimeout(()=>{P.current=!1},0)}})},S=(k,j,T)=>{if(k.button!==0)return;if(k.target.closest("input,button,a"))return;let i=k.shiftKey&&V?V.a:{r:j,c:T};I({a:i,b:{r:j,c:T}}),M9(k,{onStart:()=>document.body.classList.add("cell-selecting"),onMove:(J0)=>{let H0=document.elementFromPoint(J0.clientX,J0.clientY)?.closest?.("td.cell-td");if(!H0||H0.dataset.r==null)return;I({a:i,b:{r:Number(H0.dataset.r),c:Number(H0.dataset.c)}})},onEnd:()=>document.body.classList.remove("cell-selecting")})},f=(k)=>A(async()=>{if(!V)return;let{r0:j,r1:T,c0:i,c1:J0}=wZ(V),H0=Q.slice(i,J0+1),B0=o.slice(j,T+1),O0=await Promise.all(B0.map((g0)=>{let N0={};for(let d0 of H0)N0[d0.name]=k(d0);return p.updateRecord(g0.id,N0)}));X((g0)=>g0.map((N0)=>O0.find((d0)=>d0.id===N0.id)??N0))}),B=async()=>{if(!V)return;let{r0:k,r1:j,c0:T,c1:i}=wZ(V),J0=Q.slice(T,i+1),H0=o.slice(k,j+1).map((B0)=>J0.map((O0)=>b8(O0,B0.values[O0.name])).join("\t")).join(`
8
+ `);try{await navigator.clipboard.writeText(H0)}catch{}},M=K?Q.find((k)=>k.name===K.name):void 0,x=(k)=>{let j=k==null||k===""?NaN:Number(k);return Number.isFinite(j)?j:Number.NEGATIVE_INFINITY},o=K?[...q].sort((k,j)=>{let T=k.values[K.name],i=j.values[K.name],J0=M?.type==="number"?x(T)-x(i):String(T??"").localeCompare(String(i??""),"zh");return(K.desc?-1:1)*J0}):q,z0=q.find((k)=>k.id===y)??null,n=V?wZ(V):null;return Z0(()=>{let k=(j)=>{if(!V||C)return;let T=document.activeElement,i=(T?.tagName||"").toLowerCase();if(i==="input"||i==="textarea"||T?.isContentEditable)return;if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="c")j.preventDefault(),B();else if(j.key==="Escape")I(null);else if(j.key==="Delete"||j.key==="Backspace"){let J0=wZ(V);if(J0.r0!==J0.r1||J0.c0!==J0.c1)j.preventDefault(),f(()=>null)}};return addEventListener("keydown",k),()=>removeEventListener("keydown",k)},[V,C,q,Q,K]),z("div",{class:"db",onPointerDown:(k)=>{if(!k.target.closest("td.cell-td, .cellselbar"))I(null)},children:[z("div",{class:"db-head",children:[z("div",{class:"db-icon",children:Z.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("div",{children:z("div",{class:"db-title",contentEditable:!0,onBlur:(k)=>{let j=k.target.textContent?.trim()||Z.name;if(j!==Z.name)A(async()=>{await p.updateDatabase(Z.id,{name:j})})},children:Z.name},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"views",children:[n7.map(([k,j],T)=>z("div",{class:"view-tab"+(T===W?" active":""),onClick:()=>G(T),children:[z(b,{name:j},void 0,!1,void 0,this),k]},k,!0,void 0,this)),z("div",{class:"spacer",style:{flex:1}},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:g,children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W===0&&z("div",{class:"toolbar",children:z("button",{class:"tbtn",onClick:(k)=>zJ(k,Q,K,Y),children:[z(b,{name:"sort",cls:"ico sm"},void 0,!1,void 0,this),"排序"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),W===1?z(g8,{props:Q,records:q,onCommitValue:L,onCreate:D,onOpenRecord:v,onMove:Y0},void 0,!1,void 0,this):W===2?z(j8,{props:Q,records:q,onCommitValue:L,onCreate:D,onOpenRecord:v},void 0,!1,void 0,this):W===3?z(m8,{props:Q,records:q,onCommitValue:L,onCreate:D,onOpenRecord:v},void 0,!1,void 0,this):z("div",{class:"tablewrap",children:[z("div",{class:"tablescroll",children:z("table",{class:"grid",children:[z("colgroup",{children:[z("col",{style:{width:38}},void 0,!1,void 0,this),z("col",{style:{width:26}},void 0,!1,void 0,this),Q.map((k)=>z("col",{"data-col-id":k.id,style:{width:N(k)}},k.id,!1,void 0,this)),z("col",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("thead",{children:z("tr",{children:[z("th",{class:"selcell",children:z("input",{type:"checkbox",checked:F.size>0&&F.size===q.length,onChange:(k)=>H(k.target.checked?new Set(q.map((j)=>j.id)):new Set)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("th",{class:"gripcol"},void 0,!1,void 0,this),Q.map((k)=>z("th",{"data-col-id":k.id,children:[z("div",{class:"colhead",onPointerDown:(j)=>y0(j,k),onClick:(j)=>{if(P.current){P.current=!1,j.preventDefault(),j.stopPropagation();return}ZJ(j,k,Z.id,O,Q)},children:[z("span",{class:"ti",children:z(b,{name:i0[k.type]??"text",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"nm",children:k.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(s7,{colId:k.id,startWidth:N(k),onCommit:(j)=>{$((T)=>T.map((i)=>i.id===k.id?{...i,config:{...i.config??{},width:j}}:i)),p.setColumnWidth(k.id,j).catch((T)=>{J(String(T.message)),O().catch(()=>{})})}},void 0,!1,void 0,this)]},k.id,!0,void 0,this)),z("th",{class:"addcol",children:z("div",{class:"colhead",title:"新建属性",onClick:(k)=>QJ(k,Z.id,O),children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("tbody",{children:o.map((k,j)=>z("tr",{"data-row-id":k.id,class:F.has(k.id)?"sel":"",children:[z("td",{class:"selcell",children:z("input",{type:"checkbox",checked:F.has(k.id),onChange:()=>H((T)=>{let i=new Set(T);return i.has(k.id)?i.delete(k.id):i.add(k.id),i})},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("td",{class:"rowgrip",title:K?"清除排序后可拖拽移动":"拖拽移动","aria-disabled":K?"true":void 0,onPointerDown:(T)=>$0(T,k),children:z(b,{name:"grip",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Q.map((T,i)=>{let J0=n!=null&&j>=n.r0&&j<=n.r1&&i>=n.c0&&i<=n.c1,H0;if(J0&&n){let B0=[];if(j===n.r0)B0.push("inset 0 2px 0 0 var(--accent)");if(j===n.r1)B0.push("inset 0 -2px 0 0 var(--accent)");if(i===n.c0)B0.push("inset 2px 0 0 0 var(--accent)");if(i===n.c1)B0.push("inset -2px 0 0 0 var(--accent)");H0=B0.join(",")||void 0}return z("td",{class:"cell-td"+(J0?" cellsel":""),"data-r":j,"data-c":i,style:H0?{boxShadow:H0}:void 0,onPointerDown:(B0)=>S(B0,j,i),children:z(t7,{rec:k,prop:T,first:i===0,editing:C?.rec===k.id&&C?.prop===T.id,onEdit:()=>w({rec:k.id,prop:T.id}),onCancel:()=>w(null),onCommit:(B0)=>L(k,T,B0),onOpen:()=>v(k.id),onRowMenu:(B0)=>$J(B0,k,()=>v(k.id),()=>l(k),()=>h([k.id]))},void 0,!1,void 0,this)},T.id,!1,void 0,this)}),z("td",{class:"filler"},void 0,!1,void 0,this)]},k.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z("div",{class:"addrow",onClick:g,children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建记录"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"gridfoot",children:[z("span",{children:["共 ",q.length," 条记录"]},void 0,!0,void 0,this),z("span",{children:[Q.length," 个属性"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.size>0&&z("div",{class:"selbar",children:[z("span",{class:"cnt",children:[F.size," 已选"]},void 0,!0,void 0,this),z("button",{onClick:()=>A(async()=>{for(let k of F)await l(q.find((j)=>j.id===k))}),children:[z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"复制"]},void 0,!0,void 0,this),z("button",{class:"del",onClick:async()=>{if(await b0({title:"删除记录?",message:`确定删除选中的 ${F.size} 条记录?`,confirmLabel:"删除",danger:!0}))h([...F])},children:[z(b,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this),"删除"]},void 0,!0,void 0,this),z("button",{onClick:()=>H(new Set),children:z(b,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&(n.r0!==n.r1||n.c0!==n.c1)&&z("div",{class:"selbar cellselbar",children:[z("span",{class:"cnt",children:[(n.r1-n.r0+1)*(n.c1-n.c0+1)," 个单元格"]},void 0,!0,void 0,this),z("button",{onClick:B,children:[z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"复制"]},void 0,!0,void 0,this),z("button",{onClick:()=>f((k)=>o[n.r0].values[k.name]??null),children:[z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this),"填充"]},void 0,!0,void 0,this),z("button",{class:"del",onClick:()=>f(()=>null),children:[z(b,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this),"清空"]},void 0,!0,void 0,this),z("button",{onClick:()=>I(null),children:z(b,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z0&&z(qJ,{db:Z,props:Q,rec:z0,onClose:()=>v(null),onCommit:(k,j)=>L(z0,k,j),onDelete:()=>h([z0.id]),onDuplicate:()=>l(z0)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function E8({prop:Z,val:J,onCommit:Q,onCancel:$}){let q=Array.isArray(J)?J.join(", "):J==null?"":String(J);return z("input",{class:"inlineedit",type:Z.type==="number"?"number":Z.type==="date"?"date":"text",value:q,autofocus:!0,onBlur:(X)=>Q(T8(Z.type,X.target.value)),onKeyDown:(X)=>{if(X.key==="Enter")X.target.blur();if(X.key==="Escape")$?.()}},void 0,!1,void 0,this)}function t7({rec:Z,prop:J,first:Q,editing:$,onEdit:q,onCancel:X,onCommit:W,onOpen:G,onRowMenu:F}){let H=Z.values[J.name];if(J.type==="checkbox")return z("div",{class:"cell center",children:z("input",{type:"checkbox",checked:!!H,style:{width:16,height:16,accentColor:"var(--accent)"},onChange:()=>W(!H)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if($&&J.type!=="select"&&J.type!=="multi_select")return z("div",{class:"cell",children:z(E8,{prop:J,val:H,onCommit:W,onCancel:X},void 0,!1,void 0,this)},void 0,!1,void 0,this);let K=(C)=>{if(J.type==="select"||J.type==="multi_select")c8(C,J,H,W);else q()},Y=z(k9,{prop:J,val:H},void 0,!1,void 0,this);if(Q)return z("div",{class:"cell",onDblClick:K,onContextMenu:(C)=>{C.preventDefault(),F(C)},children:z("div",{class:"firstcell",children:[Y,z("div",{class:"rowactions",children:z("button",{class:"rowopen",title:"打开",onClick:(C)=>{C.stopPropagation(),G()},children:z(b,{name:"openPeek",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return z("div",{class:"cell",onDblClick:K,children:Y},void 0,!1,void 0,this)}function u8(Z,J,Q,$){let q=[...Z],X=q.findIndex((F)=>F.id===J);if(X<0)return Z;let W=q.splice(X,1)[0],G=q.findIndex((F)=>F.id===Q);if(G<0)return Z;if($==="after")G+=1;return q.splice(G,0,W),q}function o7(Z){return Array.from(Z.querySelectorAll("td")).map((Q)=>(Q.textContent??"").trim()).filter(Boolean).join(" ")||"移动记录"}function s7({colId:Z,startWidth:J,onCommit:Q}){return z("div",{class:"col-resizer",onPointerDown:(q)=>{q.preventDefault(),q.stopPropagation(),YZ(q,{col:document.querySelector(`col[data-col-id="${CSS.escape(Z)}"]`),startWidth:J,min:80,onDone:Q})}},void 0,!1,void 0,this)}function c8(Z,J,Q,$){Z.stopPropagation();let q=J.type==="multi_select",X=J.config?.options??[];w0(Z,(W)=>z(e7,{multi:q,options:X,value:Q,onPick:(G)=>{if($(G),!q)W()}},void 0,!1,void 0,this))}function e7({multi:Z,options:J,value:Q,onPick:$}){let[q,X]=m(Q),W=(F)=>Z?Array.isArray(q)?q.includes(F):!1:q===F,G=(F)=>{if(Z){let H=new Set(Array.isArray(q)?q:[]);H.has(F)?H.delete(F):H.add(F);let K=[...H];X(K),$(K)}else X(F),$(F)};return z(a,{children:[z(T0,{children:Z?"多选 — 点选切换":"单选"},void 0,!1,void 0,this),J.map((F)=>z("button",{class:"item",onClick:()=>G(F),children:[z(B9,{text:F},void 0,!1,void 0,this),W(F)&&z("span",{class:"chk",children:z(b,{name:"check",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},F,!0,void 0,this)),Z&&Array.isArray(q)&&q.length>0&&z(a,{children:[z(M0,{},void 0,!1,void 0,this),z(r,{icon:"x",label:"清空",onClick:()=>{X([]),$([])}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function ZJ(Z,J,Q,$,q){Z.stopPropagation(),w0(Z,(X)=>z(JJ,{prop:J,dbId:Q,reload:$,close:X,allProps:q},void 0,!1,void 0,this),{minWidth:252})}function JJ({prop:Z,dbId:J,reload:Q,close:$,allProps:q}){let[X,W]=m(Z.name),[G,F]=m(Z.type),[H,K]=m(Z.config?.options??[]),Y=(y)=>p.updateProperty(Z.id,y).then(Q).catch(()=>{}),C=(y)=>{F(y);let v=H;if((y==="select"||y==="multi_select")&&v.length===0)v=["选项 1","选项 2"],K(v);Y({type:y,...y==="select"||y==="multi_select"?{config:{options:v}}:{}})},w=(y)=>{K(y),Y({config:{options:y}})};return z(a,{children:[z("input",{class:"field",value:X,onInput:(y)=>W(y.target.value),onBlur:()=>X&&X!==Z.name&&Y({name:X}),onKeyDown:(y)=>{if(y.key==="Enter")y.target.blur(),$()}},void 0,!1,void 0,this),z(T0,{children:"属性类型"},void 0,!1,void 0,this),z("div",{class:"typegrid",children:Object.keys(N9).map((y)=>z("button",{class:"item"+(y===G?" sel":""),onClick:()=>C(y),children:[z("span",{class:"lico",children:z(b,{name:i0[y],cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"d",children:N9[y].t},void 0,!1,void 0,this)]},y,!0,void 0,this))},void 0,!1,void 0,this),(G==="select"||G==="multi_select")&&z(a,{children:[z(M0,{},void 0,!1,void 0,this),z(T0,{children:"选项"},void 0,!1,void 0,this),H.map((y,v)=>z("div",{class:"optrow",children:[z(B9,{text:y},void 0,!1,void 0,this),z("button",{class:"x",onClick:()=>w(H.filter((V,I)=>I!==v)),children:z(b,{name:"x",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},y+v,!0,void 0,this)),z(r,{icon:"plus",label:"添加选项",onClick:()=>w([...H,"选项 "+(H.length+1)])},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"cornerUpRight",label:"在右侧插入列",onClick:()=>{$(),p.createProperty({db:J,name:"新属性",type:"text"}).then(Q)}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除属性",danger:!0,onClick:async()=>{if($(),await b0({title:"删除属性?",message:`「${Z.name}」及其所有单元格数据将被移除。`,confirmLabel:"删除",danger:!0}))p.deleteProperty(Z.id).then(Q)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function QJ(Z,J,Q){Z.stopPropagation(),w0(Z,($)=>z(a,{children:[z(T0,{children:"新建属性 · 选择类型"},void 0,!1,void 0,this),z("div",{class:"typegrid",children:Object.keys(N9).map((q)=>z("button",{class:"item",onClick:()=>{$();let X=q==="select"||q==="multi_select"?{options:["选项 1","选项 2"]}:void 0;p.createProperty({db:J,name:N9[q].t,type:q,config:X}).then(Q).catch(()=>{})},children:[z("span",{class:"lico",children:z(b,{name:i0[q],cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"d",children:N9[q].t},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this))}function zJ(Z,J,Q,$){w0(Z,(q)=>z(a,{children:[z(T0,{children:"排序依据"},void 0,!1,void 0,this),J.map((X)=>z(r,{icon:i0[X.type],label:X.name,onClick:()=>{$({name:X.name,desc:Q?.name===X.name?!Q.desc:!1}),q()}},X.id,!1,void 0,this)),Q&&z(a,{children:[z(M0,{},void 0,!1,void 0,this),z(r,{icon:"x",label:"清除排序",onClick:()=>{$(null),q()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this))}function $J(Z,J,Q,$,q){Z.stopPropagation(),w0(Z,(X)=>z(a,{children:[z(r,{icon:"cornerUpRight",label:"打开记录",onClick:()=>{X(),Q()}},void 0,!1,void 0,this),z(r,{icon:"copy",label:"复制记录",onClick:()=>{X(),$()}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除记录",danger:!0,onClick:async()=>{if(X(),await b0({title:"删除记录?",message:"确定删除这条记录?",confirmLabel:"删除",danger:!0}))q()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))}function qJ({db:Z,props:J,rec:Q,onClose:$,onCommit:q,onDelete:X,onDuplicate:W}){let[G,F]=m(null),{open:H,close:K}=yZ($),Y=J[0];return z(a,{children:[z("div",{class:"scrim"+(H?" open":""),onClick:K},void 0,!1,void 0,this),z("div",{class:"peek"+(H?" open":""),children:[z("div",{class:"peek-head",children:[z("button",{class:"iconbtn",onClick:K,children:z(b,{name:"x"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{style:{flex:1}},void 0,!1,void 0,this),z("button",{class:"iconbtn",title:"更多",onClick:(C)=>w0(C,(w)=>z(a,{children:[z(r,{icon:"copy",label:"复制记录",onClick:()=>{w(),W()}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除记录",danger:!0,onClick:async()=>{if(w(),await b0({title:"删除记录?",message:"确定删除这条记录?",confirmLabel:"删除",danger:!0}))X()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)),children:z(b,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"peek-body",children:[z("h2",{contentEditable:!0,onBlur:(C)=>Y&&q(Y,C.target.textContent??""),children:Y?String(Q.values[Y.name]??"无标题"):"无标题"},void 0,!1,void 0,this),J.map((C)=>z("div",{class:"proprow",children:[z("div",{class:"k",children:[z(b,{name:i0[C.type]??"text",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:C.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z(XJ,{prop:C,rec:Q,editing:G===C.id,onEdit:()=>F(C.id),onCommit:(w)=>{q(C,w),F(null)}},void 0,!1,void 0,this)]},C.id,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function XJ({prop:Z,rec:J,editing:Q,onEdit:$,onCommit:q}){let X=J.values[Z.name];if(Z.type==="checkbox")return z("div",{class:"v",children:z("input",{type:"checkbox",checked:!!X,style:{width:16,height:16,accentColor:"var(--accent)"},onChange:()=>q(!X)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Z.type==="select"||Z.type==="multi_select")return z("div",{class:"v",onClick:(W)=>c8(W,Z,X,q),children:z(k9,{prop:Z,val:X},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Q)return z("div",{class:"v",children:z(E8,{prop:Z,val:X,onCommit:q},void 0,!1,void 0,this)},void 0,!1,void 0,this);return z("div",{class:"v",onClick:$,children:z(k9,{prop:Z,val:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var Z6=B7(e5(),1);var VZ=Z6.default;function yQ(Z){for(var J=1;J<arguments.length;J++){var Q=arguments[J];for(var $ in Q)if(Object.prototype.hasOwnProperty.call(Q,$))Z[$]=Q[$]}return Z}function v1(Z,J){return Array(J+1).join(Z)}function z6(Z){return Z.replace(/^\n*/,"")}function $6(Z){var J=Z.length;while(J>0&&Z[J-1]===`
9
+ `)J--;return Z.substring(0,J)}function q6(Z){return $6(z6(Z))}var BQ=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function N1(Z){return M1(Z,BQ)}var X6=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function W6(Z){return M1(Z,X6)}function LQ(Z){return H6(Z,X6)}var G6=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function PQ(Z){return M1(Z,G6)}function wQ(Z){return H6(Z,G6)}function M1(Z,J){return J.indexOf(Z.nodeName)>=0}function H6(Z,J){return Z.getElementsByTagName&&J.some(function(Q){return Z.getElementsByTagName(Q).length})}var CQ=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function F6(Z){return CQ.reduce(function(J,Q){return J.replace(Q[0],Q[1])},Z)}var h0={};h0.paragraph={filter:"p",replacement:function(Z){return`
10
10
 
11
11
  `+Z+`
12
12
 
13
- `}};D0.lineBreak={filter:"br",replacement:function(Z,J,Q){return Q.br+`
14
- `}};D0.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(Z,J,Q){var $=Number(J.nodeName.charAt(1));if(Q.headingStyle==="setext"&&$<3){var q=X8($===1?"=":"-",Z.length);return`
13
+ `}};h0.lineBreak={filter:"br",replacement:function(Z,J,Q){return Q.br+`
14
+ `}};h0.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(Z,J,Q){var $=Number(J.nodeName.charAt(1));if(Q.headingStyle==="setext"&&$<3){var q=v1($===1?"=":"-",Z.length);return`
15
15
 
16
16
  `+Z+`
17
17
  `+q+`
18
18
 
19
19
  `}else return`
20
20
 
21
- `+X8("#",$)+" "+Z+`
21
+ `+v1("#",$)+" "+Z+`
22
22
 
23
- `}};D0.blockquote={filter:"blockquote",replacement:function(Z){return Z=D6(Z).replace(/^/gm,"> "),`
23
+ `}};h0.blockquote={filter:"blockquote",replacement:function(Z){return Z=q6(Z).replace(/^/gm,"> "),`
24
24
 
25
25
  `+Z+`
26
26
 
27
- `}};D0.list={filter:["ul","ol"],replacement:function(Z,J){var Q=J.parentNode;if(Q.nodeName==="LI"&&Q.lastElementChild===J)return`
27
+ `}};h0.list={filter:["ul","ol"],replacement:function(Z,J){var Q=J.parentNode;if(Q.nodeName==="LI"&&Q.lastElementChild===J)return`
28
28
  `+Z;else return`
29
29
 
30
30
  `+Z+`
31
31
 
32
- `}};D0.listItem={filter:"li",replacement:function(Z,J,Q){var $=Q.bulletListMarker+" ",q=J.parentNode;if(q.nodeName==="OL"){var X=q.getAttribute("start"),W=Array.prototype.indexOf.call(q.children,J);$=(X?Number(X)+W:W+1)+". "}var F=/\n$/.test(Z);return Z=D6(Z)+(F?`
32
+ `}};h0.listItem={filter:"li",replacement:function(Z,J,Q){var $=Q.bulletListMarker+" ",q=J.parentNode;if(q.nodeName==="OL"){var X=q.getAttribute("start"),W=Array.prototype.indexOf.call(q.children,J);$=(X?Number(X)+W:W+1)+". "}var G=/\n$/.test(Z);return Z=q6(Z)+(G?`
33
33
  `:""),Z=Z.replace(/\n/gm,`
34
34
  `+" ".repeat($.length)),$+Z+(J.nextSibling?`
35
- `:"")}};D0.indentedCodeBlock={filter:function(Z,J){return J.codeBlockStyle==="indented"&&Z.nodeName==="PRE"&&Z.firstChild&&Z.firstChild.nodeName==="CODE"},replacement:function(Z,J,Q){return`
35
+ `:"")}};h0.indentedCodeBlock={filter:function(Z,J){return J.codeBlockStyle==="indented"&&Z.nodeName==="PRE"&&Z.firstChild&&Z.firstChild.nodeName==="CODE"},replacement:function(Z,J,Q){return`
36
36
 
37
37
  `+J.firstChild.textContent.replace(/\n/g,`
38
38
  `)+`
39
39
 
40
- `}};D0.fencedCodeBlock={filter:function(Z,J){return J.codeBlockStyle==="fenced"&&Z.nodeName==="PRE"&&Z.firstChild&&Z.firstChild.nodeName==="CODE"},replacement:function(Z,J,Q){var $=J.firstChild.getAttribute("class")||"",q=($.match(/language-(\S+)/)||[null,""])[1],X=J.firstChild.textContent,W=Q.fence.charAt(0),F=3,H=new RegExp("^"+W+"{3,}","gm"),G;while(G=H.exec(X))if(G[0].length>=F)F=G[0].length+1;var Y=X8(W,F);return`
40
+ `}};h0.fencedCodeBlock={filter:function(Z,J){return J.codeBlockStyle==="fenced"&&Z.nodeName==="PRE"&&Z.firstChild&&Z.firstChild.nodeName==="CODE"},replacement:function(Z,J,Q){var $=J.firstChild.getAttribute("class")||"",q=($.match(/language-(\S+)/)||[null,""])[1],X=J.firstChild.textContent,W=Q.fence.charAt(0),G=3,F=new RegExp("^"+W+"{3,}","gm"),H;while(H=F.exec(X))if(H[0].length>=G)G=H[0].length+1;var K=v1(W,G);return`
41
41
 
42
- `+Y+q+`
42
+ `+K+q+`
43
43
  `+X.replace(/\n$/,"")+`
44
- `+Y+`
44
+ `+K+`
45
45
 
46
- `}};D0.horizontalRule={filter:"hr",replacement:function(Z,J,Q){return`
46
+ `}};h0.horizontalRule={filter:"hr",replacement:function(Z,J,Q){return`
47
47
 
48
48
  `+Q.hr+`
49
49
 
50
- `}};D0.inlineLink={filter:function(Z,J){return J.linkStyle==="inlined"&&Z.nodeName==="A"&&Z.getAttribute("href")},replacement:function(Z,J){var Q=G8(J.getAttribute("href")),$=H8(LZ(J.getAttribute("title"))),q=$?' "'+$+'"':"";return"["+Z+"]("+Q+q+")"}};D0.referenceLink={filter:function(Z,J){return J.linkStyle==="referenced"&&Z.nodeName==="A"&&Z.getAttribute("href")},replacement:function(Z,J,Q){var $=G8(J.getAttribute("href")),q=LZ(J.getAttribute("title"));if(q)q=' "'+H8(q)+'"';var X,W;switch(Q.linkReferenceStyle){case"collapsed":X="["+Z+"][]",W="["+Z+"]: "+$+q;break;case"shortcut":X="["+Z+"]",W="["+Z+"]: "+$+q;break;default:var F=this.references.length+1;X="["+Z+"]["+F+"]",W="["+F+"]: "+$+q}return this.references.push(W),X},references:[],append:function(Z){var J="";if(this.references.length)J=`
50
+ `}};h0.inlineLink={filter:function(Z,J){return J.linkStyle==="inlined"&&Z.nodeName==="A"&&Z.getAttribute("href")},replacement:function(Z,J){var Q=k1(J.getAttribute("href")),$=f1(RZ(J.getAttribute("title"))),q=$?' "'+$+'"':"";return"["+Z+"]("+Q+q+")"}};h0.referenceLink={filter:function(Z,J){return J.linkStyle==="referenced"&&Z.nodeName==="A"&&Z.getAttribute("href")},replacement:function(Z,J,Q){var $=k1(J.getAttribute("href")),q=RZ(J.getAttribute("title"));if(q)q=' "'+f1(q)+'"';var X,W;switch(Q.linkReferenceStyle){case"collapsed":X="["+Z+"][]",W="["+Z+"]: "+$+q;break;case"shortcut":X="["+Z+"]",W="["+Z+"]: "+$+q;break;default:var G=this.references.length+1;X="["+Z+"]["+G+"]",W="["+G+"]: "+$+q}return this.references.push(W),X},references:[],append:function(Z){var J="";if(this.references.length)J=`
51
51
 
52
52
  `+this.references.join(`
53
53
  `)+`
54
54
 
55
- `,this.references=[];return J}};D0.emphasis={filter:["em","i"],replacement:function(Z,J,Q){if(!Z.trim())return"";return Q.emDelimiter+Z+Q.emDelimiter}};D0.strong={filter:["strong","b"],replacement:function(Z,J,Q){if(!Z.trim())return"";return Q.strongDelimiter+Z+Q.strongDelimiter}};D0.code={filter:function(Z){var J=Z.previousSibling||Z.nextSibling,Q=Z.parentNode.nodeName==="PRE"&&!J;return Z.nodeName==="CODE"&&!Q},replacement:function(Z){if(!Z)return"";Z=Z.replace(/\r?\n|\r/g," ");var J=/^`|^ .*?[^ ].* $|`$/.test(Z)?" ":"",Q="`",$=Z.match(/`+/gm)||[];while($.indexOf(Q)!==-1)Q=Q+"`";return Q+J+Z+J+Q}};D0.image={filter:"img",replacement:function(Z,J){var Q=p6(LZ(J.getAttribute("alt"))),$=G8(J.getAttribute("src")||""),q=LZ(J.getAttribute("title")),X=q?' "'+H8(q)+'"':"";return $?"!["+Q+"]("+$+X+")":""}};function LZ(Z){return Z?Z.replace(/(\n+\s*)+/g,`
56
- `):""}function G8(Z){var J=Z.replace(/([<>()])/g,"\\$1");return J.indexOf(" ")>=0?"<"+J+">":J}function H8(Z){return Z.replace(/"/g,"\\\"")}function i6(Z){this.options=Z,this._keep=[],this._remove=[],this.blankRule={replacement:Z.blankReplacement},this.keepReplacement=Z.keepReplacement,this.defaultRule={replacement:Z.defaultReplacement},this.array=[];for(var J in Z.rules)this.array.push(Z.rules[J])}i6.prototype={add:function(Z,J){this.array.unshift(J)},keep:function(Z){this._keep.unshift({filter:Z,replacement:this.keepReplacement})},remove:function(Z){this._remove.unshift({filter:Z,replacement:function(){return""}})},forNode:function(Z){if(Z.isBlank)return this.blankRule;var J;if(J=z8(this.array,Z,this.options))return J;if(J=z8(this._keep,Z,this.options))return J;if(J=z8(this._remove,Z,this.options))return J;return this.defaultRule},forEach:function(Z){for(var J=0;J<this.array.length;J++)Z(this.array[J],J)}};function z8(Z,J,Q){for(var $=0;$<Z.length;$++){var q=Z[$];if(nQ(q,J,Q))return q}return}function nQ(Z,J,Q){var $=Z.filter;if(typeof $==="string"){if($===J.nodeName.toLowerCase())return!0}else if(Array.isArray($)){if($.indexOf(J.nodeName.toLowerCase())>-1)return!0}else if(typeof $==="function"){if($.call(Z,J,Q))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function tQ(Z){var{element:J,isBlock:Q,isVoid:$}=Z,q=Z.isPre||function(K){return K.nodeName==="PRE"};if(!J.firstChild||q(J))return;var X=null,W=!1,F=null,H=T6(F,J,q);while(H!==J){if(H.nodeType===3||H.nodeType===4){var G=H.data.replace(/[ \r\n\t]+/g," ");if((!X||/ $/.test(X.data))&&!W&&G[0]===" ")G=G.substr(1);if(!G){H=$8(H);continue}H.data=G,X=H}else if(H.nodeType===1){if(Q(H)||H.nodeName==="BR"){if(X)X.data=X.data.replace(/ $/,"");X=null,W=!1}else if($(H)||q(H))X=null,W=!0;else if(X)W=!1}else{H=$8(H);continue}var Y=T6(F,H,q);F=H,H=Y}if(X){if(X.data=X.data.replace(/ $/,""),!X.data)$8(X)}}function $8(Z){var J=Z.nextSibling||Z.parentNode;return Z.parentNode.removeChild(Z),J}function T6(Z,J,Q){if(Z&&Z.parentNode===J||Q(J))return J.nextSibling||J.parentNode;return J.firstChild||J.nextSibling||J.parentNode}var K8=typeof window<"u"?window:{};function sQ(){var Z=K8.DOMParser,J=!1;try{if(new Z().parseFromString("","text/html"))J=!0}catch(Q){}return J}function oQ(){var Z=function(){};if(eQ())Z.prototype.parseFromString=function(J){var Q=new window.ActiveXObject("htmlfile");return Q.designMode="on",Q.open(),Q.write(J),Q.close(),Q};else Z.prototype.parseFromString=function(J){var Q=document.implementation.createHTMLDocument("");return Q.open(),Q.write(J),Q.close(),Q};return Z}function eQ(){var Z=!1;try{document.implementation.createHTMLDocument("").open()}catch(J){if(K8.ActiveXObject)Z=!0}return Z}var Z3=sQ()?K8.DOMParser:oQ();function J3(Z,J){var Q;if(typeof Z==="string"){var $=Q3().parseFromString('<x-turndown id="turndown-root">'+Z+"</x-turndown>","text/html");Q=$.getElementById("turndown-root")}else Q=Z.cloneNode(!0);return tQ({element:Q,isBlock:W8,isVoid:m6,isPre:J.preformattedCode?z3:null}),Q}var q8;function Q3(){return q8=q8||new Z3,q8}function z3(Z){return Z.nodeName==="PRE"||Z.nodeName==="CODE"}function $3(Z,J){return Z.isBlock=W8(Z),Z.isCode=Z.nodeName==="CODE"||Z.parentNode.isCode,Z.isBlank=q3(Z),Z.flankingWhitespace=X3(Z,J),Z}function q3(Z){return!m6(Z)&&!dQ(Z)&&/^\s*$/i.test(Z.textContent)&&!aQ(Z)&&!rQ(Z)}function X3(Z,J){if(Z.isBlock||J.preformattedCode&&Z.isCode)return{leading:"",trailing:""};var Q=W3(Z.textContent);if(Q.leadingAscii&&g6("left",Z,J))Q.leading=Q.leadingNonAscii;if(Q.trailingAscii&&g6("right",Z,J))Q.trailing=Q.trailingNonAscii;return{leading:Q.leading,trailing:Q.trailing}}function W3(Z){var J=Z.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:J[1],leadingAscii:J[2],leadingNonAscii:J[3],trailing:J[4],trailingNonAscii:J[5],trailingAscii:J[6]}}function g6(Z,J,Q){var $,q,X;if(Z==="left")$=J.previousSibling,q=/ $/;else $=J.nextSibling,q=/^ /;if($){if($.nodeType===3)X=q.test($.nodeValue);else if(Q.preformattedCode&&$.nodeName==="CODE")X=!1;else if($.nodeType===1&&!W8($))X=q.test($.textContent)}return X}var F3=Array.prototype.reduce;function m9(Z){if(!(this instanceof m9))return new m9(Z);var J={rules:D0,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(Q,$){return $.isBlock?`
55
+ `,this.references=[];return J}};h0.emphasis={filter:["em","i"],replacement:function(Z,J,Q){if(!Z.trim())return"";return Q.emDelimiter+Z+Q.emDelimiter}};h0.strong={filter:["strong","b"],replacement:function(Z,J,Q){if(!Z.trim())return"";return Q.strongDelimiter+Z+Q.strongDelimiter}};h0.code={filter:function(Z){var J=Z.previousSibling||Z.nextSibling,Q=Z.parentNode.nodeName==="PRE"&&!J;return Z.nodeName==="CODE"&&!Q},replacement:function(Z){if(!Z)return"";Z=Z.replace(/\r?\n|\r/g," ");var J=/^`|^ .*?[^ ].* $|`$/.test(Z)?" ":"",Q="`",$=Z.match(/`+/gm)||[];while($.indexOf(Q)!==-1)Q=Q+"`";return Q+J+Z+J+Q}};h0.image={filter:"img",replacement:function(Z,J){var Q=F6(RZ(J.getAttribute("alt"))),$=k1(J.getAttribute("src")||""),q=RZ(J.getAttribute("title")),X=q?' "'+f1(q)+'"':"";return $?"!["+Q+"]("+$+X+")":""}};function RZ(Z){return Z?Z.replace(/(\n+\s*)+/g,`
56
+ `):""}function k1(Z){var J=Z.replace(/([<>()])/g,"\\$1");return J.indexOf(" ")>=0?"<"+J+">":J}function f1(Z){return Z.replace(/"/g,"\\\"")}function K6(Z){this.options=Z,this._keep=[],this._remove=[],this.blankRule={replacement:Z.blankReplacement},this.keepReplacement=Z.keepReplacement,this.defaultRule={replacement:Z.defaultReplacement},this.array=[];for(var J in Z.rules)this.array.push(Z.rules[J])}K6.prototype={add:function(Z,J){this.array.unshift(J)},keep:function(Z){this._keep.unshift({filter:Z,replacement:this.keepReplacement})},remove:function(Z){this._remove.unshift({filter:Z,replacement:function(){return""}})},forNode:function(Z){if(Z.isBlank)return this.blankRule;var J;if(J=A1(this.array,Z,this.options))return J;if(J=A1(this._keep,Z,this.options))return J;if(J=A1(this._remove,Z,this.options))return J;return this.defaultRule},forEach:function(Z){for(var J=0;J<this.array.length;J++)Z(this.array[J],J)}};function A1(Z,J,Q){for(var $=0;$<Z.length;$++){var q=Z[$];if(AQ(q,J,Q))return q}return}function AQ(Z,J,Q){var $=Z.filter;if(typeof $==="string"){if($===J.nodeName.toLowerCase())return!0}else if(Array.isArray($)){if($.indexOf(J.nodeName.toLowerCase())>-1)return!0}else if(typeof $==="function"){if($.call(Z,J,Q))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function OQ(Z){var{element:J,isBlock:Q,isVoid:$}=Z,q=Z.isPre||function(Y){return Y.nodeName==="PRE"};if(!J.firstChild||q(J))return;var X=null,W=!1,G=null,F=J6(G,J,q);while(F!==J){if(F.nodeType===3||F.nodeType===4){var H=F.data.replace(/[ \r\n\t]+/g," ");if((!X||/ $/.test(X.data))&&!W&&H[0]===" ")H=H.substr(1);if(!H){F=O1(F);continue}F.data=H,X=F}else if(F.nodeType===1){if(Q(F)||F.nodeName==="BR"){if(X)X.data=X.data.replace(/ $/,"");X=null,W=!1}else if($(F)||q(F))X=null,W=!0;else if(X)W=!1}else{F=O1(F);continue}var K=J6(G,F,q);G=F,F=K}if(X){if(X.data=X.data.replace(/ $/,""),!X.data)O1(X)}}function O1(Z){var J=Z.nextSibling||Z.parentNode;return Z.parentNode.removeChild(Z),J}function J6(Z,J,Q){if(Z&&Z.parentNode===J||Q(J))return J.nextSibling||J.parentNode;return J.firstChild||J.nextSibling||J.parentNode}var V1=typeof window<"u"?window:{};function _Q(){var Z=V1.DOMParser,J=!1;try{if(new Z().parseFromString("","text/html"))J=!0}catch(Q){}return J}function vQ(){var Z=function(){};if(NQ())Z.prototype.parseFromString=function(J){var Q=new window.ActiveXObject("htmlfile");return Q.designMode="on",Q.open(),Q.write(J),Q.close(),Q};else Z.prototype.parseFromString=function(J){var Q=document.implementation.createHTMLDocument("");return Q.open(),Q.write(J),Q.close(),Q};return Z}function NQ(){var Z=!1;try{document.implementation.createHTMLDocument("").open()}catch(J){if(V1.ActiveXObject)Z=!0}return Z}var MQ=_Q()?V1.DOMParser:vQ();function kQ(Z,J){var Q;if(typeof Z==="string"){var $=fQ().parseFromString('<x-turndown id="turndown-root">'+Z+"</x-turndown>","text/html");Q=$.getElementById("turndown-root")}else Q=Z.cloneNode(!0);return OQ({element:Q,isBlock:N1,isVoid:W6,isPre:J.preformattedCode?VQ:null}),Q}var _1;function fQ(){return _1=_1||new MQ,_1}function VQ(Z){return Z.nodeName==="PRE"||Z.nodeName==="CODE"}function RQ(Z,J){return Z.isBlock=N1(Z),Z.isCode=Z.nodeName==="CODE"||Z.parentNode.isCode,Z.isBlank=IQ(Z),Z.flankingWhitespace=SQ(Z,J),Z}function IQ(Z){return!W6(Z)&&!PQ(Z)&&/^\s*$/i.test(Z.textContent)&&!LQ(Z)&&!wQ(Z)}function SQ(Z,J){if(Z.isBlock||J.preformattedCode&&Z.isCode)return{leading:"",trailing:""};var Q=TQ(Z.textContent);if(Q.leadingAscii&&Q6("left",Z,J))Q.leading=Q.leadingNonAscii;if(Q.trailingAscii&&Q6("right",Z,J))Q.trailing=Q.trailingNonAscii;return{leading:Q.leading,trailing:Q.trailing}}function TQ(Z){var J=Z.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:J[1],leadingAscii:J[2],leadingNonAscii:J[3],trailing:J[4],trailingNonAscii:J[5],trailingAscii:J[6]}}function Q6(Z,J,Q){var $,q,X;if(Z==="left")$=J.previousSibling,q=/ $/;else $=J.nextSibling,q=/^ /;if($){if($.nodeType===3)X=q.test($.nodeValue);else if(Q.preformattedCode&&$.nodeName==="CODE")X=!1;else if($.nodeType===1&&!N1($))X=q.test($.textContent)}return X}var bQ=Array.prototype.reduce;function a9(Z){if(!(this instanceof a9))return new a9(Z);var J={rules:h0,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(Q,$){return $.isBlock?`
57
57
 
58
58
  `:""},keepReplacement:function(Q,$){return $.isBlock?`
59
59
 
@@ -63,53 +63,53 @@ https://github.com/highlightjs/highlight.js/issues/2277`),o=R,S=N;if(v===void 0)
63
63
 
64
64
  `+Q+`
65
65
 
66
- `:Q}};this.options=iQ({},J,Z),this.rules=new i6(this.options)}m9.prototype={turndown:function(Z){if(!K3(Z))throw TypeError(Z+" is not a string, or an element/document/fragment node.");if(Z==="")return"";var J=c6.call(this,new J3(Z,this.options));return G3.call(this,J)},use:function(Z){if(Array.isArray(Z))for(var J=0;J<Z.length;J++)this.use(Z[J]);else if(typeof Z==="function")Z(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(Z,J){return this.rules.add(Z,J),this},keep:function(Z){return this.rules.keep(Z),this},remove:function(Z){return this.rules.remove(Z),this},escape:function(Z){return p6(Z)}};function c6(Z){var J=this;return F3.call(Z.childNodes,function(Q,$){$=new $3($,J.options);var q="";if($.nodeType===3)q=$.isCode?$.nodeValue:J.escape($.nodeValue);else if($.nodeType===1)q=H3.call(J,$);return a6(Q,q)},"")}function G3(Z){var J=this;return this.rules.forEach(function(Q){if(typeof Q.append==="function")Z=a6(Z,Q.append(J.options))}),Z.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function H3(Z){var J=this.rules.forNode(Z),Q=c6.call(this,Z),$=Z.flankingWhitespace;if($.leading||$.trailing)Q=Q.trim();return $.leading+J.replacement(Q,Z,this.options)+$.trailing}function a6(Z,J){var Q=j6(Z),$=x6(J),q=Math.max(Z.length-Q.length,J.length-$.length),X=`
66
+ `:Q}};this.options=yQ({},J,Z),this.rules=new K6(this.options)}a9.prototype={turndown:function(Z){if(!jQ(Z))throw TypeError(Z+" is not a string, or an element/document/fragment node.");if(Z==="")return"";var J=Y6.call(this,new kQ(Z,this.options));return gQ.call(this,J)},use:function(Z){if(Array.isArray(Z))for(var J=0;J<Z.length;J++)this.use(Z[J]);else if(typeof Z==="function")Z(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(Z,J){return this.rules.add(Z,J),this},keep:function(Z){return this.rules.keep(Z),this},remove:function(Z){return this.rules.remove(Z),this},escape:function(Z){return F6(Z)}};function Y6(Z){var J=this;return bQ.call(Z.childNodes,function(Q,$){$=new RQ($,J.options);var q="";if($.nodeType===3)q=$.isCode?$.nodeValue:J.escape($.nodeValue);else if($.nodeType===1)q=xQ.call(J,$);return U6(Q,q)},"")}function gQ(Z){var J=this;return this.rules.forEach(function(Q){if(typeof Q.append==="function")Z=U6(Z,Q.append(J.options))}),Z.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function xQ(Z){var J=this.rules.forNode(Z),Q=Y6.call(this,Z),$=Z.flankingWhitespace;if($.leading||$.trailing)Q=Q.trim();return $.leading+J.replacement(Q,Z,this.options)+$.trailing}function U6(Z,J){var Q=$6(Z),$=z6(J),q=Math.max(Z.length-Q.length,J.length-$.length),X=`
67
67
 
68
- `.substring(0,q);return Q+X+$}function K3(Z){return Z!=null&&(typeof Z==="string"||Z.nodeType&&(Z.nodeType===1||Z.nodeType===9||Z.nodeType===11))}var d6=/highlight-(?:text|source)-([a-z0-9]+)/;function Y3(Z){Z.addRule("highlightedCodeBlock",{filter:function(J){var Q=J.firstChild;return J.nodeName==="DIV"&&d6.test(J.className)&&Q&&Q.nodeName==="PRE"},replacement:function(J,Q,$){var q=Q.className||"",X=(q.match(d6)||[null,""])[1];return`
68
+ `.substring(0,q);return Q+X+$}function jQ(Z){return Z!=null&&(typeof Z==="string"||Z.nodeType&&(Z.nodeType===1||Z.nodeType===9||Z.nodeType===11))}var y6=/highlight-(?:text|source)-([a-z0-9]+)/;function DQ(Z){Z.addRule("highlightedCodeBlock",{filter:function(J){var Q=J.firstChild;return J.nodeName==="DIV"&&y6.test(J.className)&&Q&&Q.nodeName==="PRE"},replacement:function(J,Q,$){var q=Q.className||"",X=(q.match(y6)||[null,""])[1];return`
69
69
 
70
70
  `+$.fence+X+`
71
71
  `+Q.firstChild.textContent+`
72
72
  `+$.fence+`
73
73
 
74
- `}})}function U3(Z){Z.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(J){return"~"+J+"~"}})}var y3=Array.prototype.indexOf,B3=Array.prototype.every,M9={};M9.tableCell={filter:["th","td"],replacement:function(Z,J){return r6(Z,J)}};M9.tableRow={filter:"tr",replacement:function(Z,J){var Q="",$={left:":--",right:"--:",center:":-:"};if(Y8(J))for(var q=0;q<J.childNodes.length;q++){var X="---",W=(J.childNodes[q].getAttribute("align")||"").toLowerCase();if(W)X=$[W]||X;Q+=r6(X,J.childNodes[q])}return`
74
+ `}})}function hQ(Z){Z.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(J){return"~"+J+"~"}})}var mQ=Array.prototype.indexOf,uQ=Array.prototype.every,T9={};T9.tableCell={filter:["th","td"],replacement:function(Z,J){return B6(Z,J)}};T9.tableRow={filter:"tr",replacement:function(Z,J){var Q="",$={left:":--",right:"--:",center:":-:"};if(R1(J))for(var q=0;q<J.childNodes.length;q++){var X="---",W=(J.childNodes[q].getAttribute("align")||"").toLowerCase();if(W)X=$[W]||X;Q+=B6(X,J.childNodes[q])}return`
75
75
  `+Z+(Q?`
76
- `+Q:"")}};M9.table={filter:function(Z){return Z.nodeName==="TABLE"&&Y8(Z.rows[0])},replacement:function(Z){return Z=Z.replace(`
76
+ `+Q:"")}};T9.table={filter:function(Z){return Z.nodeName==="TABLE"&&R1(Z.rows[0])},replacement:function(Z){return Z=Z.replace(`
77
77
 
78
78
  `,`
79
79
  `),`
80
80
 
81
81
  `+Z+`
82
82
 
83
- `}};M9.tableSection={filter:["thead","tbody","tfoot"],replacement:function(Z){return Z}};function Y8(Z){var J=Z.parentNode;return J.nodeName==="THEAD"||J.firstChild===Z&&(J.nodeName==="TABLE"||L3(J))&&B3.call(Z.childNodes,function(Q){return Q.nodeName==="TH"})}function L3(Z){var J=Z.previousSibling;return Z.nodeName==="TBODY"&&(!J||J.nodeName==="THEAD"&&/^\s*$/i.test(J.textContent))}function r6(Z,J){var Q=y3.call(J.parentNode.childNodes,J),$=" ";if(Q===0)$="| ";return $+Z+" |"}function w3(Z){Z.keep(function(Q){return Q.nodeName==="TABLE"&&!Y8(Q.rows[0])});for(var J in M9)Z.addRule(J,M9[J])}function P3(Z){Z.addRule("taskListItems",{filter:function(J){return J.type==="checkbox"&&J.parentNode.nodeName==="LI"},replacement:function(J,Q){return(Q.checked?"[x]":"[ ]")+" "}})}function l6(Z){Z.use([Y3,U3,w3,P3])}function C3(Z){let J=Z.match(/(?:language|lang)-(\S+)/);return J?J[1]:""}function A3(){let Z=new m9({codeBlockStyle:"fenced",headingStyle:"atx",bulletListMarker:"-",emDelimiter:"*",strongDelimiter:"**"});return Z.use(l6),Z.addRule("fencedCodeWithLang",{filter:(J)=>J.nodeName==="PRE"&&!!J.querySelector("code"),replacement:(J,Q)=>{let $=Q.querySelector("code"),q=($?.textContent??Q.textContent??"").replace(/\n$/,""),X=$?C3($.className):"",W="```";return`
83
+ `}};T9.tableSection={filter:["thead","tbody","tfoot"],replacement:function(Z){return Z}};function R1(Z){var J=Z.parentNode;return J.nodeName==="THEAD"||J.firstChild===Z&&(J.nodeName==="TABLE"||pQ(J))&&uQ.call(Z.childNodes,function(Q){return Q.nodeName==="TH"})}function pQ(Z){var J=Z.previousSibling;return Z.nodeName==="TBODY"&&(!J||J.nodeName==="THEAD"&&/^\s*$/i.test(J.textContent))}function B6(Z,J){var Q=mQ.call(J.parentNode.childNodes,J),$=" ";if(Q===0)$="| ";return $+Z+" |"}function EQ(Z){Z.keep(function(Q){return Q.nodeName==="TABLE"&&!R1(Q.rows[0])});for(var J in T9)Z.addRule(J,T9[J])}function cQ(Z){Z.addRule("taskListItems",{filter:function(J){return J.type==="checkbox"&&J.parentNode.nodeName==="LI"},replacement:function(J,Q){return(Q.checked?"[x]":"[ ]")+" "}})}function L6(Z){Z.use([DQ,hQ,EQ,cQ])}function iQ(Z){let J=Z.match(/(?:language|lang)-(\S+)/);return J?J[1]:""}function dQ(){let Z=new a9({codeBlockStyle:"fenced",headingStyle:"atx",bulletListMarker:"-",emDelimiter:"*",strongDelimiter:"**"});return Z.use(L6),Z.addRule("fencedCodeWithLang",{filter:(J)=>J.nodeName==="PRE"&&!!J.querySelector("code"),replacement:(J,Q)=>{let $=Q.querySelector("code"),q=($?.textContent??Q.textContent??"").replace(/\n$/,""),X=$?iQ($.className):"",W="```";return`
84
84
 
85
85
  \`\`\`${X}
86
86
  ${q}
87
87
  \`\`\`
88
88
 
89
- `}}),Z}var n6=null;function t6(Z){return n6??=A3(),n6.turndown(Z)}var v3=0;function p0(){return`blk_${Date.now().toString(36)}_${(v3++).toString(36)}`}var O3=new Set(["bullet","numbered","todo"]),o0={fenceOpen:/^\s*(`{3,}|~{3,})\s*([^\s`]*)?.*$/,h:/^(#{1,3})\s+(.*)$/,todo:/^\s*[-*+]\s+\[([ xX])\]\s*(.*)$/,bullet:/^\s*[-*+]\s+(.*)$/,numbered:/^\s*(\d+)[.)]\s+(.*)$/,quote:/^>\s?(.*)$/,divider:/^\s*(?:-{3,}|\*{3,}|_{3,})\s*$/};function u0(Z){return O3.has(Z)}function s6(Z){return $1(Z,0,1).join(`
90
- `)}function PZ(Z){let J=(Z??"").replace(/\r\n?/g,`
89
+ `}}),Z}var P6=null;function w6(Z){return P6??=dQ(),P6.turndown(Z)}var aQ=0;function r0(){return`blk_${Date.now().toString(36)}_${(aQ++).toString(36)}`}var rQ=new Set(["bullet","numbered","todo"]),X9={fenceOpen:/^\s*(`{3,}|~{3,})\s*([^\s`]*)?.*$/,h:/^(#{1,3})\s+(.*)$/,todo:/^\s*[-*+]\s+\[([ xX])\]\s*(.*)$/,bullet:/^\s*[-*+]\s+(.*)$/,numbered:/^\s*(\d+)[.)]\s+(.*)$/,quote:/^>\s?(.*)$/,divider:/^\s*(?:-{3,}|\*{3,}|_{3,})\s*$/};function c0(Z){return rQ.has(Z)}function lQ(){return[["",""],["",""]]}function S1(Z,J,Q){if(Z.type=J,Z.content=Q.content??"",J==="todo")Z.checked=Q.checked??!1;else delete Z.checked;if(J==="code")Z.lang=Q.lang??"";else delete Z.lang;if(J==="numbered"&&Q.start!=null&&Q.start>1)Z.start=Q.start;else delete Z.start;if(J==="table")Z.rows=Q.rows?Q.rows.map(($)=>[...$]):lQ(),Z.align=Q.align?[...Q.align]:Array(Z.rows[0].length).fill(null);else delete Z.rows,delete Z.align}function SZ(Z,J={}){let Q={id:r0(),type:Z,content:""};if(S1(Q,Z,J),c0(Z)&&J.children?.length)Q.children=J.children;return Q}function C6(Z){return f6(Z,0,1).join(`
90
+ `)}function TZ(Z){let J=(Z??"").replace(/\r\n?/g,`
91
91
  `),Q=J?J.split(`
92
- `):[],$=J1(Q,0,0).blocks;o6($);let q=J.length-J.replace(/\n+$/,"").length;for(let X=1;X<q;X++)$.push({id:p0(),type:"p",content:""});return $}function N9(Z){return Z.type==="p"&&Z.content.trim()===""&&!Z.children?.length}function y8(Z){let J=new Map,Q=null;for(let $ of Z)if($.type==="numbered")Q=Q===null?Math.max(1,$.start??1):Q+1,J.set($.id,Q);else Q=null;return J}function o6(Z){let J=!0;for(let Q of Z){if(Q.type==="numbered")if(J){if((Q.start??1)<=1)delete Q.start;J=!1}else delete Q.start;else J=!0;if(Q.children)o6(Q.children)}}function e6(Z){return Z1(Z,0,!0).join(`
93
- `)}function Z1(Z,J,Q){let $=y8(Z.filter((F)=>!N9(F))),q=[],X=null,W=0;for(let F of Z){if(N9(F)){if(q.length)W++;continue}if(!q1(F))continue;if(q.length){let H=x3(X,F)||W>0?1:0;for(let G=0;G<H+W;G++)q.push("")}q.push(...$1(F,J,$.get(F.id)??1)),X=F,W=0}if(q.length&&W>0)for(let F=0;F<W+(Q?1:0);F++)q.push("");return q}function B8(Z,J){if(J===" "){if(Z==="# ")return{type:"h1",content:""};if(Z==="## ")return{type:"h2",content:""};if(Z==="### ")return{type:"h3",content:""};if(Z==="> ")return{type:"quote",content:""};if(/^[-*+] $/.test(Z))return{type:"bullet",content:""};let $=Z.match(/^(\d+)[.)] $/);if($)return{type:"numbered",content:"",start:parseInt($[1],10)};let q=Z.match(/^[-*+]\s+\[([ xX])\]\s$/);if(q)return{type:"todo",content:"",checked:q[1].toLowerCase()==="x"};return null}let Q=Z.match(/^```([A-Za-z0-9_+.#-]*)$/);if(Q)return{type:"code",content:"",lang:L8(Q[1]??"")};return null}function J1(Z,J,Q){let $=[],q=J,X=0;while(q<Z.length){let W=Z[q];if(W.trim()===""){let H=q;while(H<Z.length&&Z[H].trim()==="")H++;if(H>=Z.length||z9(Z[H])<Q)break;X+=H-q,q=H;continue}if(z9(W)<Q)break;if($.length&&X>1)for(let H=1;H<X;H++)$.push({id:p0(),type:"p",content:""});X=0;let F=_3(Z,q,Q)??R3(Z,q,Q)??M3(Z,q,Q);$.push(F.block),q=F.next}return{blocks:$,next:q}}function _3(Z,J,Q){let $=z1(Z[J],Q);if(!$)return null;let q={id:p0(),type:$.type,content:$.content};if($.type==="todo")q.checked=!!$.checked;if($.type==="numbered"&&$.num!=null)q.start=$.num;let X=J1(Z,J+1,$.indent+2);if(X.blocks.length)q.children=X.blocks;return{block:q,next:X.next}}function M3(Z,J,Q){let $=d0(Z[J],Q),q=$.match(o0.fenceOpen);if(q)return N3(Z,J,Q,q);if(o0.divider.test($.trim()))return{block:{id:p0(),type:"divider",content:""},next:J+1};let X=$.match(o0.h);if(X)return{block:{id:p0(),type:`h${X[1].length}`,content:X[2]},next:J+1};if(o0.quote.test($))return V3(Z,J,Q);return S3(Z,J,Q)}function N3(Z,J,Q,$){let q=$[1],X=[],W=J+1;for(;W<Z.length;W++){let F=Z[W],H=d0(F,Q);if(j3(H,q[0],q.length)){W++;break}X.push(H)}return{block:{id:p0(),type:"code",content:X.join(`
94
- `),lang:L8($[2]??"")},next:W}}function V3(Z,J,Q){let $=[],q=J;for(;q<Z.length;q++){let X=Z[q];if(X.trim()===""||z9(X)<Q)break;let W=d0(X,Q).match(o0.quote);if(!W)break;$.push(W[1]??"")}return{block:{id:p0(),type:"quote",content:$.join(`
95
- `)},next:q}}var f3=/^\s*:?-+:?\s*$/;function Q1(Z,J,Q){let $=Z[J],q=Z[J+1];if($==null||q==null)return!1;if(z9($)<Q||z9(q)<Q)return!1;let X=d0($,Q),W=d0(q,Q);if(!X.includes("|")||!W.includes("|"))return!1;let F=wZ(W);return F.length>0&&F.every((H)=>f3.test(H))}function wZ(Z){let J=[],Q="";for(let $=0;$<Z.length;$++){let q=Z[$];if(q==="\\"&&Z[$+1]==="|"){Q+="|",$++;continue}if(q==="|"){J.push(Q),Q="";continue}Q+=q}if(J.push(Q),J.length&&J[0].trim()==="")J.shift();if(J.length&&J[J.length-1].trim()==="")J.pop();return J.map(($)=>$.trim())}function k3(Z){let J=Z.trim(),Q=J.startsWith(":"),$=J.endsWith(":");if(Q&&$)return"center";if($)return"right";if(Q)return"left";return null}function U8(Z,J){let Q=Z.slice(0,J);while(Q.length<J)Q.push("");return Q}function R3(Z,J,Q){if(!Q1(Z,J,Q))return null;let $=wZ(d0(Z[J],Q)),q=Math.max(1,$.length),X=wZ(d0(Z[J+1],Q)).map(k3),W=[U8($,q)],F=J+2;for(;F<Z.length;F++){let H=Z[F];if(H.trim()===""||z9(H)<Q)break;let G=d0(H,Q);if(!G.includes("|"))break;W.push(U8(wZ(G),q))}while(X.length<q)X.push(null);return X.length=q,{block:{id:p0(),type:"table",content:"",rows:W,align:X},next:F}}function I3(Z){switch(Z){case"left":return":---";case"center":return":---:";case"right":return"---:";default:return"---"}}function b3(Z,J){let Q=" ".repeat(J),$=Z.rows??[],q=Math.max(1,...$.map((Y)=>Y.length)),X=Z.align??[],W=(Y)=>Y.replace(/\|/g,"\\|").replace(/\n/g," "),F=(Y)=>`${Q}| ${U8(Y,q).map(W).join(" | ")} |`,H=`${Q}| ${Array.from({length:q},(Y,K)=>I3(X[K]??null)).join(" | ")} |`,G=$[0]??Array.from({length:q},()=>"");return[F(G),H,...$.slice(1).map(F)]}function S3(Z,J,Q){let $=[],q=J;for(;q<Z.length;q++){let X=Z[q];if(X.trim()===""||z9(X)<Q)break;if($.length&&(T3(X,Q)||Q1(Z,q,Q)))break;$.push(d0(X,Q))}return{block:{id:p0(),type:"p",content:$.join(`
96
- `)},next:q}}function T3(Z,J){if(z1(Z,J))return!0;let Q=d0(Z,J);return!!Q.match(o0.fenceOpen)||!!Q.match(o0.h)||o0.divider.test(Q.trim())||o0.quote.test(Q)}function z1(Z,J){let Q=z9(Z);if(Q<J)return null;let $=d0(Z,Q),q=$.match(/^[-*+]\s+\[([ xX])\]\s*(.*)$/);if(q)return{indent:Q,type:"todo",checked:q[1].toLowerCase()==="x",content:q[2]};if(q=$.match(/^(\d+)[.)](?:\s+(.*))?$/),q)return{indent:Q,type:"numbered",content:q[2]??"",num:parseInt(q[1],10)};if(q=$.match(/^[-*+](?:\s+(.*))?$/),q)return{indent:Q,type:"bullet",content:q[1]??""};return null}function $1(Z,J,Q){let $=" ".repeat(J);switch(Z.type){case"h1":return[`${$}# ${Z.content}`];case"h2":return[`${$}## ${Z.content}`];case"h3":return[`${$}### ${Z.content}`];case"bullet":case"numbered":case"todo":return g3(Z,J,Q);case"quote":return Z.content.split(`
97
- `).map((q)=>`${$}>${q?` ${q}`:""}`);case"code":{let q=`${$}\`\`\`${Z.lang?L8(Z.lang):""}`,X=Z.content.split(`
98
- `).map((W)=>`${$}${W}`);return[q,...X,`${$}\`\`\``]}case"table":return b3(Z,J);case"divider":return[`${$}---`];default:return Z.content.split(`
99
- `).map((q)=>`${$}${q}`)}}function g3(Z,J,Q){let $=" ".repeat(J),q=Z.type==="numbered"?`${Q}. `:Z.type==="todo"?`- [${Z.checked?"x":" "}] `:"- ",X=[`${$}${q}${Z.content}`],W=Z.children??[],F=W.find((H)=>!N9(H)&&q1(H));if(F){if(!u0(F.type)&&Z.content.trim()!=="")X.push("");X.push(...Z1(W,J+2,!1))}return X}function x3(Z,J){if(!Z)return!1;return!(u0(Z.type)&&u0(J.type))}function q1(Z){if(Z.type==="divider")return!0;if(u0(Z.type))return!0;if(Z.type==="code")return Z.content.trim()!==""||!!Z.lang?.trim();if(Z.type==="table")return(Z.rows??[]).some((J)=>J.some((Q)=>Q.trim()!==""));return Z.content.trim()!==""}function z9(Z){let J=0;for(let Q of Z)if(Q===" ")J++;else if(Q==="\t")J+=4;else break;return J}function d0(Z,J){let Q=0,$=0;for(;$<Z.length&&Q<J;$++){let q=Z[$];if(q===" ")Q++;else if(q==="\t")Q+=4;else break}return Z.slice($)}function j3(Z,J,Q){let $=Z.trim();if(!$||$[0]!==J)return!1;for(let q of $)if(q!==J)return!1;return $.length>=Q}function L8(Z){return Z.trim().replace(/[^A-Za-z0-9_+.#-]/g,"")}var w8=[{id:"",label:"纯文本"},{id:"bash",label:"Bash"},{id:"shell",label:"Shell"},{id:"javascript",label:"JavaScript"},{id:"typescript",label:"TypeScript"},{id:"json",label:"JSON"},{id:"python",label:"Python"},{id:"go",label:"Go"},{id:"rust",label:"Rust"},{id:"java",label:"Java"},{id:"c",label:"C"},{id:"cpp",label:"C++"},{id:"csharp",label:"C#"},{id:"sql",label:"SQL"},{id:"yaml",label:"YAML"},{id:"xml",label:"HTML / XML"},{id:"css",label:"CSS"},{id:"scss",label:"SCSS"},{id:"markdown",label:"Markdown"},{id:"php",label:"PHP"},{id:"ruby",label:"Ruby"},{id:"swift",label:"Swift"},{id:"kotlin",label:"Kotlin"},{id:"objectivec",label:"Objective-C"},{id:"perl",label:"Perl"},{id:"lua",label:"Lua"},{id:"makefile",label:"Makefile"},{id:"ini",label:"INI / TOML"},{id:"diff",label:"Diff"}],P8=[{type:"p",ic:"text",t:"文本",d:"普通段落"},{type:"h1",ic:"heading",t:"标题 1",d:"大号标题"},{type:"h2",ic:"heading",t:"标题 2",d:"中号标题"},{type:"h3",ic:"heading",t:"标题 3",d:"小号标题"},{type:"bullet",ic:"list",t:"无序列表",d:"项目符号"},{type:"numbered",ic:"numList",t:"有序列表",d:"编号列表"},{type:"todo",ic:"checkbox",t:"待办清单",d:"复选项"},{type:"quote",ic:"quote",t:"引用",d:"引用块"},{type:"code",ic:"code",t:"代码",d:"代码块"},{type:"table",ic:"table",t:"表格",d:"插入表格"},{type:"divider",ic:"minus",t:"分隔线",d:"水平分隔"}];function f0(Z,J,Q=null){for(let $=0;$<Z.length;$++){let q=Z[$];if(q.id===J)return{block:q,parent:Z,index:$,parentBlock:Q};let X=q.children?f0(q.children,J,q):null;if(X)return X}return null}function C8(Z){let J=0;for(let Q of Z)J+=1+C8(Q.children??[]);return J}function CZ(Z){return{...Z,id:p0(),children:Z.children?.map(CZ)}}function A8(Z,J){for(let Q of Z??[])if(Q.id===J||A8(Q.children,J))return!0;return!1}function e0(Z,J=[]){for(let Q of Z)if(J.push(Q),Q.children)e0(Q.children,J);return J}function u9(Z,J){let Q=null,$=null,q=(X)=>{for(let W of X){if(W.id===J){$=Q;return}if(Q=W,W.children)q(W.children);if($)return}};return q(Z),$}function v8(Z,J){let Q=e0(Z),$=Q.findIndex((q)=>q.id===J);return $>=0&&$+1<Q.length?Q[$+1]:null}function AZ(Z,J){let Q=f0(Z,J);if(!Q)return null;let[$]=Q.parent.splice(Q.index,1);if(Q.parent.length===0&&Q.parentBlock)delete Q.parentBlock.children;return $??null}function X1(Z,J,Q,$){if(J===Q)return!1;let q=f0(Z,J),X=f0(Z,Q);if(!q||!X||A8(q.block.children,Q))return!1;let W=q.parent.splice(q.index,1)[0],F=f0(Z,Q);if(!F)return q.parent.splice(q.index,0,W),!1;if(q.parent.length===0&&q.parentBlock)delete q.parentBlock.children;return F.parent.splice(F.index+($==="after"?1:0),0,W),!0}function O8(Z,J){let Q=f0(Z,J);if(!Q||Q.index===0)return!1;let $=Q.parent[Q.index-1];if(!u0($.type))return!1;let q=Q.parent.splice(Q.index,1)[0];return $.children??=[],$.children.push(q),!0}function vZ(Z,J){let Q=f0(Z,J);if(!Q?.parentBlock)return!1;let $=f0(Z,Q.parentBlock.id);if(!$)return!1;let q=Q.parent.splice(Q.index);if(!q.length)return!1;if(Q.parent.length===0)delete Q.parentBlock.children;return $.parent.splice($.index+1,0,...q),!0}function V9(Z,J){let Q=new Set(J),$=[],q=(X,W)=>{for(let F of X){let H=Q.has(F.id);if(H&&!W)$.push(F.id);if(F.children)q(F.children,W||H)}};return q(Z,!1),$}function W1(Z,J,Q){let $=e0(Z),q=$.findIndex((H)=>H.id===J),X=$.findIndex((H)=>H.id===Q);if(q<0||X<0)return[];let[W,F]=q<=X?[q,X]:[X,q];return $.slice(W,F+1).map((H)=>H.id)}function F1(Z,J){if(!J.length)return null;let Q=new Set(J),$=e0(Z),q=$.findIndex((W)=>Q.has(W.id));if(q<0)return null;let X=null;for(let W=q-1;W>=0;W--)if(!Q.has($[W].id)){X=$[W].id;break}if(!X){for(let W=q+1;W<$.length;W++)if(!Q.has($[W].id)){X=$[W].id;break}}for(let W of V9(Z,J))AZ(Z,W);if(X&&!f0(Z,X))X=null;return X??e0(Z)[0]?.id??null}function G1(Z,J){let Q=V9(Z,J);if(!Q.length)return[];let $=[];for(let X of Q){let W=f0(Z,X);if(W)$.push(CZ(W.block))}let q=f0(Z,Q[Q.length-1]);if(!q||!$.length)return[];return q.parent.splice(q.index+1,0,...$),$.map((X)=>X.id)}function H1(Z,J,Q,$){let q=V9(Z,J);if(!q.length||q.includes(Q))return!1;for(let F of q){let H=f0(Z,F);if(H&&A8(H.block.children,Q))return!1}let X=[];for(let F of q){let H=AZ(Z,F);if(H)X.push(H)}let W=f0(Z,Q);if(!W)return Z.push(...X),!1;return W.parent.splice(W.index+($==="after"?1:0),0,...X),!0}function K1(Z,J){return V9(Z,J).map((Q)=>{let $=f0(Z,Q);return $?s6($.block):""}).filter(Boolean).join(`
100
- `)}function Y1(Z,J){let Q=[];for(let $ of V9(Z,J))if(O8(Z,$))Q.push($);return Q}function U1(Z,J){let Q=[];for(let $ of V9(Z,J))if(vZ(Z,$))Q.push($);return Q}function OZ(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var y1=String.fromCharCode(57344),B1=String.fromCharCode(57345),D3=new RegExp(y1+"(\\d+)"+B1,"g");function E9(Z){let J=[],Q=Z.replace(/`([^`]+)`/g,($,q)=>{return J.push(q),y1+(J.length-1)+B1});return Q=OZ(Q),Q=Q.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,($,q,X)=>{return`<a href="${String(X).replace(/"/g,"&quot;")}" target="_blank" rel="noreferrer">${q}</a>`}),Q=Q.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),Q=Q.replace(/(^|[^*])\*([^*\n]+)\*/g,"$1<em>$2</em>"),Q=Q.replace(D3,($,q)=>`<code>${OZ(J[+q]??"")}</code>`),Q}function p9(Z){let J=document.createElement("div");return J.innerHTML=Z,L1(J).replace(/\n{3,}/g,`
101
-
102
- `)}function L1(Z){let J="";return Z.childNodes.forEach((Q)=>{if(Q.nodeType===Node.TEXT_NODE){J+=Q.textContent??"";return}if(!(Q instanceof HTMLElement))return;let $=Q.tagName.toLowerCase(),q=L1(Q);if($==="br")J+=`
92
+ `):[],$=N6(Q,0,0).blocks;A6($);let q=J.length-J.replace(/\n+$/,"").length;for(let X=1;X<q;X++)$.push({id:r0(),type:"p",content:""});return $}function b9(Z){return Z.type==="p"&&Z.content.trim()===""&&!Z.children?.length}function T1(Z){let J=new Map,Q=null;for(let $ of Z)if($.type==="numbered")Q=Q===null?Math.max(1,$.start??1):Q+1,J.set($.id,Q);else Q=null;return J}function A6(Z){let J=!0;for(let Q of Z){if(Q.type==="numbered")if(J){if((Q.start??1)<=1)delete Q.start;J=!1}else delete Q.start;else J=!0;if(Q.children)A6(Q.children)}}function O6(Z){return _6(Z,0,!0).join(`
93
+ `)}function _6(Z,J,Q){let $=T1(Z.filter((G)=>!b9(G))),q=[],X=null,W=0;for(let G of Z){if(b9(G)){if(q.length)W++;continue}if(!V6(G))continue;if(q.length){let F=Wz(X,G)||W>0?1:0;for(let H=0;H<F+W;H++)q.push("")}q.push(...f6(G,J,$.get(G.id)??1)),X=G,W=0}if(q.length&&W>0)for(let G=0;G<W+(Q?1:0);G++)q.push("");return q}function b1(Z,J){if(J===" "){if(Z==="# ")return{type:"h1",content:""};if(Z==="## ")return{type:"h2",content:""};if(Z==="### ")return{type:"h3",content:""};if(Z==="> ")return{type:"quote",content:""};if(/^[-*+] $/.test(Z))return{type:"bullet",content:""};let $=Z.match(/^(\d+)[.)] $/);if($)return{type:"numbered",content:"",start:parseInt($[1],10)};let q=Z.match(/^[-*+]\s+\[([ xX])\]\s*$/);if(q)return{type:"todo",content:"",checked:q[1].toLowerCase()==="x"};return null}let Q=Z.match(/^```([A-Za-z0-9_+.#-]*)$/);if(Q)return{type:"code",content:"",lang:g1(Q[1]??"")};return null}function v6(Z){let J=Z.match(/^\[([ xX])\]$/);return J?{checked:J[1].toLowerCase()==="x"}:null}function N6(Z,J,Q){let $=[],q=J,X=0;while(q<Z.length){let W=Z[q];if(W.trim()===""){let F=q;while(F<Z.length&&Z[F].trim()==="")F++;if(F>=Z.length||F9(Z[F])<Q)break;X+=F-q,q=F;continue}if(F9(W)<Q)break;if($.length&&X>1)for(let F=1;F<X;F++)$.push({id:r0(),type:"p",content:""});X=0;let G=nQ(Z,q,Q)??Jz(Z,q,Q)??tQ(Z,q,Q);$.push(G.block),q=G.next}return{blocks:$,next:q}}function nQ(Z,J,Q){let $=k6(Z[J],Q);if(!$)return null;let q={id:r0(),type:$.type,content:$.content};if($.type==="todo")q.checked=!!$.checked;if($.type==="numbered"&&$.num!=null)q.start=$.num;let X=N6(Z,J+1,$.indent+2);if(X.blocks.length)q.children=X.blocks;return{block:q,next:X.next}}function tQ(Z,J,Q){let $=o0(Z[J],Q),q=$.match(X9.fenceOpen);if(q)return oQ(Z,J,Q,q);if(X9.divider.test($.trim()))return{block:{id:r0(),type:"divider",content:""},next:J+1};let X=$.match(X9.h);if(X)return{block:{id:r0(),type:`h${X[1].length}`,content:X[2]},next:J+1};if(X9.quote.test($))return sQ(Z,J,Q);return $z(Z,J,Q)}function oQ(Z,J,Q,$){let q=$[1],X=[],W=J+1;for(;W<Z.length;W++){let G=Z[W],F=o0(G,Q);if(Gz(F,q[0],q.length)){W++;break}X.push(F)}return{block:{id:r0(),type:"code",content:X.join(`
94
+ `),lang:g1($[2]??"")},next:W}}function sQ(Z,J,Q){let $=[],q=J;for(;q<Z.length;q++){let X=Z[q];if(X.trim()===""||F9(X)<Q)break;let W=o0(X,Q).match(X9.quote);if(!W)break;$.push(W[1]??"")}return{block:{id:r0(),type:"quote",content:$.join(`
95
+ `)},next:q}}var eQ=/^\s*:?-+:?\s*$/;function M6(Z,J,Q){let $=Z[J],q=Z[J+1];if($==null||q==null)return!1;if(F9($)<Q||F9(q)<Q)return!1;let X=o0($,Q),W=o0(q,Q);if(!X.includes("|")||!W.includes("|"))return!1;let G=IZ(W);return G.length>0&&G.every((F)=>eQ.test(F))}function IZ(Z){let J=[],Q="";for(let $=0;$<Z.length;$++){let q=Z[$];if(q==="\\"&&Z[$+1]==="|"){Q+="|",$++;continue}if(q==="|"){J.push(Q),Q="";continue}Q+=q}if(J.push(Q),J.length&&J[0].trim()==="")J.shift();if(J.length&&J[J.length-1].trim()==="")J.pop();return J.map(($)=>$.trim())}function Zz(Z){let J=Z.trim(),Q=J.startsWith(":"),$=J.endsWith(":");if(Q&&$)return"center";if($)return"right";if(Q)return"left";return null}function I1(Z,J){let Q=Z.slice(0,J);while(Q.length<J)Q.push("");return Q}function Jz(Z,J,Q){if(!M6(Z,J,Q))return null;let $=IZ(o0(Z[J],Q)),q=Math.max(1,$.length),X=IZ(o0(Z[J+1],Q)).map(Zz),W=[I1($,q)],G=J+2;for(;G<Z.length;G++){let F=Z[G];if(F.trim()===""||F9(F)<Q)break;let H=o0(F,Q);if(!H.includes("|"))break;W.push(I1(IZ(H),q))}while(X.length<q)X.push(null);return X.length=q,{block:{id:r0(),type:"table",content:"",rows:W,align:X},next:G}}function Qz(Z){switch(Z){case"left":return":---";case"center":return":---:";case"right":return"---:";default:return"---"}}function zz(Z,J){let Q=" ".repeat(J),$=Z.rows??[],q=Math.max(1,...$.map((K)=>K.length)),X=Z.align??[],W=(K)=>K.replace(/\|/g,"\\|").replace(/\n/g," "),G=(K)=>`${Q}| ${I1(K,q).map(W).join(" | ")} |`,F=`${Q}| ${Array.from({length:q},(K,Y)=>Qz(X[Y]??null)).join(" | ")} |`,H=$[0]??Array.from({length:q},()=>"");return[G(H),F,...$.slice(1).map(G)]}function $z(Z,J,Q){let $=[],q=J;for(;q<Z.length;q++){let X=Z[q];if(X.trim()===""||F9(X)<Q)break;if($.length&&(qz(X,Q)||M6(Z,q,Q)))break;$.push(o0(X,Q))}return{block:{id:r0(),type:"p",content:$.join(`
96
+ `)},next:q}}function qz(Z,J){if(k6(Z,J))return!0;let Q=o0(Z,J);return!!Q.match(X9.fenceOpen)||!!Q.match(X9.h)||X9.divider.test(Q.trim())||X9.quote.test(Q)}function k6(Z,J){let Q=F9(Z);if(Q<J)return null;let $=o0(Z,Q),q=$.match(/^[-*+]\s+\[([ xX])\]\s*(.*)$/);if(q)return{indent:Q,type:"todo",checked:q[1].toLowerCase()==="x",content:q[2]};if(q=$.match(/^(\d+)[.)](?:\s+(.*))?$/),q)return{indent:Q,type:"numbered",content:q[2]??"",num:parseInt(q[1],10)};if(q=$.match(/^[-*+](?:\s+(.*))?$/),q)return{indent:Q,type:"bullet",content:q[1]??""};return null}function f6(Z,J,Q){let $=" ".repeat(J);switch(Z.type){case"h1":return[`${$}# ${Z.content}`];case"h2":return[`${$}## ${Z.content}`];case"h3":return[`${$}### ${Z.content}`];case"bullet":case"numbered":case"todo":return Xz(Z,J,Q);case"quote":return Z.content.split(`
97
+ `).map((q)=>`${$}>${q?` ${q}`:""}`);case"code":{let q=`${$}\`\`\`${Z.lang?g1(Z.lang):""}`,X=Z.content.split(`
98
+ `).map((W)=>`${$}${W}`);return[q,...X,`${$}\`\`\``]}case"table":return zz(Z,J);case"divider":return[`${$}---`];default:return Z.content.split(`
99
+ `).map((q)=>`${$}${q}`)}}function Xz(Z,J,Q){let $=" ".repeat(J),q=Z.type==="numbered"?`${Q}. `:Z.type==="todo"?`- [${Z.checked?"x":" "}] `:"- ",X=[`${$}${q}${Z.content}`],W=Z.children??[],G=W.find((F)=>!b9(F)&&V6(F));if(G){if(!c0(G.type)&&Z.content.trim()!=="")X.push("");X.push(..._6(W,J+2,!1))}return X}function Wz(Z,J){if(!Z)return!1;return!(c0(Z.type)&&c0(J.type))}function V6(Z){if(Z.type==="divider")return!0;if(c0(Z.type))return!0;if(Z.type==="code")return Z.content.trim()!==""||!!Z.lang?.trim();if(Z.type==="table")return(Z.rows??[]).some((J)=>J.some((Q)=>Q.trim()!==""));return Z.content.trim()!==""}function F9(Z){let J=0;for(let Q of Z)if(Q===" ")J++;else if(Q==="\t")J+=4;else break;return J}function o0(Z,J){let Q=0,$=0;for(;$<Z.length&&Q<J;$++){let q=Z[$];if(q===" ")Q++;else if(q==="\t")Q+=4;else break}return Z.slice($)}function Gz(Z,J,Q){let $=Z.trim();if(!$||$[0]!==J)return!1;for(let q of $)if(q!==J)return!1;return $.length>=Q}function g1(Z){return Z.trim().replace(/[^A-Za-z0-9_+.#-]/g,"")}var x1=[{id:"",label:"纯文本"},{id:"bash",label:"Bash"},{id:"shell",label:"Shell"},{id:"javascript",label:"JavaScript"},{id:"typescript",label:"TypeScript"},{id:"json",label:"JSON"},{id:"python",label:"Python"},{id:"go",label:"Go"},{id:"rust",label:"Rust"},{id:"java",label:"Java"},{id:"c",label:"C"},{id:"cpp",label:"C++"},{id:"csharp",label:"C#"},{id:"sql",label:"SQL"},{id:"yaml",label:"YAML"},{id:"xml",label:"HTML / XML"},{id:"css",label:"CSS"},{id:"scss",label:"SCSS"},{id:"markdown",label:"Markdown"},{id:"php",label:"PHP"},{id:"ruby",label:"Ruby"},{id:"swift",label:"Swift"},{id:"kotlin",label:"Kotlin"},{id:"objectivec",label:"Objective-C"},{id:"perl",label:"Perl"},{id:"lua",label:"Lua"},{id:"makefile",label:"Makefile"},{id:"ini",label:"INI / TOML"},{id:"diff",label:"Diff"}],j1=[{type:"p",ic:"text",t:"文本",d:"普通段落"},{type:"h1",ic:"heading",t:"标题 1",d:"大号标题"},{type:"h2",ic:"heading",t:"标题 2",d:"中号标题"},{type:"h3",ic:"heading",t:"标题 3",d:"小号标题"},{type:"bullet",ic:"list",t:"无序列表",d:"项目符号"},{type:"numbered",ic:"numList",t:"有序列表",d:"编号列表"},{type:"todo",ic:"checkbox",t:"待办清单",d:"复选项"},{type:"quote",ic:"quote",t:"引用",d:"引用块"},{type:"code",ic:"code",t:"代码",d:"代码块"},{type:"table",ic:"table",t:"表格",d:"插入表格"},{type:"divider",ic:"minus",t:"分隔线",d:"水平分隔"}];function V0(Z,J,Q=null){for(let $=0;$<Z.length;$++){let q=Z[$];if(q.id===J)return{block:q,parent:Z,index:$,parentBlock:Q};let X=q.children?V0(q.children,J,q):null;if(X)return X}return null}function D1(Z){let J=0;for(let Q of Z)J+=1+D1(Q.children??[]);return J}function bZ(Z){return{...Z,id:r0(),children:Z.children?.map(bZ)}}function h1(Z,J){for(let Q of Z??[])if(Q.id===J||h1(Q.children,J))return!0;return!1}function z9(Z,J=[]){for(let Q of Z)if(J.push(Q),Q.children)z9(Q.children,J);return J}function r9(Z,J){let Q=null,$=null,q=(X)=>{for(let W of X){if(W.id===J){$=Q;return}if(Q=W,W.children)q(W.children);if($)return}};return q(Z),$}function m1(Z,J){let Q=z9(Z),$=Q.findIndex((q)=>q.id===J);return $>=0&&$+1<Q.length?Q[$+1]:null}function gZ(Z,J){let Q=V0(Z,J);if(!Q)return null;let[$]=Q.parent.splice(Q.index,1);if(Q.parent.length===0&&Q.parentBlock)delete Q.parentBlock.children;return $??null}function R6(Z,J,Q,$){if(J===Q)return!1;let q=V0(Z,J),X=V0(Z,Q);if(!q||!X||h1(q.block.children,Q))return!1;let W=q.parent.splice(q.index,1)[0],G=V0(Z,Q);if(!G)return q.parent.splice(q.index,0,W),!1;if(q.parent.length===0&&q.parentBlock)delete q.parentBlock.children;return G.parent.splice(G.index+($==="after"?1:0),0,W),!0}function u1(Z,J){let Q=V0(Z,J);if(!Q||Q.index===0)return!1;let $=Q.parent[Q.index-1];if(!c0($.type))return!1;let q=Q.parent.splice(Q.index,1)[0];return $.children??=[],$.children.push(q),!0}function xZ(Z,J){let Q=V0(Z,J);if(!Q?.parentBlock)return!1;let $=V0(Z,Q.parentBlock.id);if(!$)return!1;let q=Q.parent.splice(Q.index);if(!q.length)return!1;if(Q.parent.length===0)delete Q.parentBlock.children;return $.parent.splice($.index+1,0,...q),!0}function g9(Z,J){let Q=new Set(J),$=[],q=(X,W)=>{for(let G of X){let F=Q.has(G.id);if(F&&!W)$.push(G.id);if(G.children)q(G.children,W||F)}};return q(Z,!1),$}function I6(Z,J,Q){let $=z9(Z),q=$.findIndex((F)=>F.id===J),X=$.findIndex((F)=>F.id===Q);if(q<0||X<0)return[];let[W,G]=q<=X?[q,X]:[X,q];return $.slice(W,G+1).map((F)=>F.id)}function S6(Z,J){if(!J.length)return null;let Q=new Set(J),$=z9(Z),q=$.findIndex((W)=>Q.has(W.id));if(q<0)return null;let X=null;for(let W=q-1;W>=0;W--)if(!Q.has($[W].id)){X=$[W].id;break}if(!X){for(let W=q+1;W<$.length;W++)if(!Q.has($[W].id)){X=$[W].id;break}}for(let W of g9(Z,J))gZ(Z,W);if(X&&!V0(Z,X))X=null;return X??z9(Z)[0]?.id??null}function T6(Z,J){let Q=g9(Z,J);if(!Q.length)return[];let $=[];for(let X of Q){let W=V0(Z,X);if(W)$.push(bZ(W.block))}let q=V0(Z,Q[Q.length-1]);if(!q||!$.length)return[];return q.parent.splice(q.index+1,0,...$),$.map((X)=>X.id)}function b6(Z,J,Q,$){let q=g9(Z,J);if(!q.length||q.includes(Q))return!1;for(let G of q){let F=V0(Z,G);if(F&&h1(F.block.children,Q))return!1}let X=[];for(let G of q){let F=gZ(Z,G);if(F)X.push(F)}let W=V0(Z,Q);if(!W)return Z.push(...X),!1;return W.parent.splice(W.index+($==="after"?1:0),0,...X),!0}function g6(Z,J){return g9(Z,J).map((Q)=>{let $=V0(Z,Q);return $?C6($.block):""}).filter(Boolean).join(`
100
+ `)}function x6(Z,J){let Q=[];for(let $ of g9(Z,J))if(u1(Z,$))Q.push($);return Q}function j6(Z,J){let Q=[];for(let $ of g9(Z,J))if(xZ(Z,$))Q.push($);return Q}function jZ(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var D6=String.fromCharCode(57344),h6=String.fromCharCode(57345),Hz=new RegExp(D6+"(\\d+)"+h6,"g");function l9(Z){let J=[],Q=Z.replace(/`([^`]+)`/g,($,q)=>{return J.push(q),D6+(J.length-1)+h6});return Q=jZ(Q),Q=Q.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,($,q,X)=>{return`<a href="${String(X).replace(/"/g,"&quot;")}" target="_blank" rel="noreferrer">${q}</a>`}),Q=Q.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),Q=Q.replace(/(^|[^*])\*([^*\n]+)\*/g,"$1<em>$2</em>"),Q=Q.replace(Hz,($,q)=>`<code>${jZ(J[+q]??"")}</code>`),Q}function n9(Z){let J=document.createElement("div");return J.innerHTML=Z,m6(J).replace(/\n{3,}/g,`
101
+
102
+ `)}function m6(Z){let J="";return Z.childNodes.forEach((Q)=>{if(Q.nodeType===Node.TEXT_NODE){J+=Q.textContent??"";return}if(!(Q instanceof HTMLElement))return;let $=Q.tagName.toLowerCase(),q=m6(Q);if($==="br")J+=`
103
103
  `;else if($==="strong"||$==="b")J+=q?`**${q}**`:"";else if($==="em"||$==="i")J+=q?`*${q}*`:"";else if($==="code")J+=q?"`"+q+"`":"";else if($==="a"){let X=Q.getAttribute("href")||"";J+=X?`[${q}](${X})`:q}else if($==="div"||$==="p")J+=(J&&!J.endsWith(`
104
104
  `)?`
105
- `:"")+q;else J+=q}),J}function h3(Z,J){let Q;try{Q=J&&BZ.getLanguage(J)?BZ.highlight(Z,{language:J,ignoreIllegals:!0}).value:BZ.highlightAuto(Z).value}catch{Q=OZ(Z)}return Z.endsWith(`
105
+ `:"")+q;else J+=q}),J}function Fz(Z,J){let Q;try{Q=J&&VZ.getLanguage(J)?VZ.highlight(Z,{language:J,ignoreIllegals:!0}).value:VZ.highlightAuto(Z).value}catch{Q=jZ(Z)}return Z.endsWith(`
106
106
  `)?Q+`
107
- `:Q}function MZ({docId:Z,onTitleChange:J,onError:Q,onModeChange:$,onHandle:q}){let X=y0([]),W=y0(""),F=y0(null),H=y0(""),[G,Y]=p("blocks"),[K,A]=p(0),[y,w]=p(!0),[_,O]=p(null),[k,I]=p(null),[B,L]=p(null),M=y0(),C=y0({past:[],future:[],present:null,lastKey:null,lastTime:0}),g=()=>({blocks:structuredClone(X.current),title:H.current,focusId:n3()}),b=(U)=>{let P=C.current;if(!P.present){P.present=g(),P.lastKey=U,P.lastTime=Date.now();return}let m=Date.now();if(U&&U===P.lastKey&&m-P.lastTime<600){P.present=g(),P.lastTime=m;return}if(P.past.push(P.present),P.past.length>200)P.past.shift();P.present=g(),P.future=[],P.lastKey=U,P.lastTime=m},u=(U)=>{if(X.current=structuredClone(U.blocks),H.current=U.title,L(null),A((P)=>P+1),T(),U.focusId)requestAnimationFrame(()=>I0(U.focusId,!0))},i=()=>{let U=C.current;if(!U.past.length)return;if(U.present)U.future.push(U.present);let P=U.past.pop();U.present=P,U.lastKey=null,u(P)},r=()=>{let U=C.current;if(!U.future.length)return;if(U.present)U.past.push(U.present);let P=U.future.pop();U.present=P,U.lastKey=null,u(P)},x=()=>{b(null),A((U)=>U+1)};L0(()=>{return w(!0),O(null),C.current={past:[],future:[],present:null,lastKey:null,lastTime:0},n.getDocument(Z).then((U)=>{H.current=U.title??"",W.current=U.body??"",X.current=PZ(U.body),w(!1),x()}).catch((U)=>Q(String(U.message))),()=>clearTimeout(M.current)},[Z]);let T=()=>{clearTimeout(M.current),M.current=setTimeout(H0,700)},t=()=>{if(G==="source")return W.current=F.current?.value??W.current,W.current;return Y9(X.current),e6(X.current)},H0=()=>n.updateDocument(Z,{title:H.current,body:t()}).then(()=>J()).catch((U)=>Q(String(U.message))),R=async()=>{clearTimeout(M.current),await H0()},N=(U)=>{if(U===G)return;if(U==="source"){W.current=t(),O(null),I(null),L(null),Y("source"),$?.("source"),requestAnimationFrame(()=>{if(F.current)F.current.value=W.current,C1(F.current),F.current.focus()});return}W.current=F.current?.value??W.current,X.current=PZ(W.current),Y("blocks"),$?.("blocks"),A((P)=>P+1),requestAnimationFrame(()=>{let P=e0(X.current)[0];if(P)I0(P.id)})};L0(()=>{return q?.({getMode:()=>G,setMode:N,snapshotMarkdown:t,flushSave:R}),()=>q?.(null)},[q,G]);let v=X.current,S=B?W1(v,B.anchorId,B.focusId):[],o=(U,P="p",m={})=>{let f=M8(P,m);if(!U)v.push(f);else{let h=f0(v,U);if(h)h.parent.splice(h.index+1,0,f);else v.push(f)}return x(),requestAnimationFrame(()=>I0(f.id)),T(),f},Z0=(U,P,m={})=>{let h=f0(v,U)?.block;if(!h)return;let $0=u0(P)?h.children:void 0;if(h.type=P,h.content=m.content??"",P==="todo")h.checked=m.checked??!1;else delete h.checked;if(P==="code")h.lang=m.lang??"";else delete h.lang;if(P==="numbered"&&m.start!=null&&m.start>1)h.start=m.start;else delete h.start;if(P==="table")h.rows=m.rows?m.rows.map((X0)=>[...X0]):v1(),h.align=m.align?[...m.align]:Array(h.rows[0].length).fill(null);else delete h.rows,delete h.align;if($0?.length)h.children=$0;else delete h.children;if(x(),P!=="divider"&&P!=="table")requestAnimationFrame(()=>I0(U));T()},q0=(U)=>{if(!AZ(v,U))return;x(),T()},K0=(U,P)=>{U.content=i9(U,P),b("text:"+U.id);let m=P.textContent??"";if(m.startsWith("/")){let f=o3();O((h)=>({blockId:U.id,x:f.x,y:f.y,query:m.slice(1),idx:h?.blockId===U.id?h.idx:0}))}else if(_)O(null);T()},O0=(U,P,m)=>{let f=U.clipboardData?.getData("text/html"),$0=(f?t6(f):U.clipboardData?.getData("text/plain")??"").replace(/\r\n?/g,`
108
- `);if(!$0.trim())return;U.preventDefault();let X0=PZ($0);if(!X0.length)return;let k0=f0(v,P.id);if(!k0)return;let{before:x0,after:i0}=V8(m);if(X0.length===1&&X0[0].type==="p"&&(x0.trim()!==""||i0.trim()!=="")){P.content=x0+X0[0].content+i0;let g1=w1(x0+X0[0].content);x(),T(),requestAnimationFrame(()=>P1(P.id,g1));return}let $9=[...X0],c9=i0.trim()!==""?M8("p",{content:i0}):null;if(c9)$9.push(c9);if(x0.trim()===""&&!k0.block.children?.length)k0.parent.splice(k0.index,1,...$9);else P.content=x0,k0.parent.splice(k0.index+1,0,...$9);x(),T();let T1=c9??$9[$9.length-1];requestAnimationFrame(()=>I0(T1.id,!c9))},W0=_?P8.filter((U)=>(U.t+U.type+U.d).toLowerCase().includes(_.query.toLowerCase())):[],V=(U)=>{if(!_)return;Z0(_.blockId,U.type),O(null)},j=(U,P)=>{Z0(U.id,P.type,P),O(null)},d=(U,P)=>{U.content="",U.children??=[];let m=M8(P.type,P);U.children.unshift(m),O(null),x(),requestAnimationFrame(()=>I0(m.id)),T()},l=(U)=>{if(Y9(v),!O8(v,U))return;x(),requestAnimationFrame(()=>I0(U)),T()},F0=(U)=>{if(Y9(v),!vZ(v,U))return;x(),requestAnimationFrame(()=>I0(U)),T()},B0=(U)=>{let P=U==="createLink"?prompt("链接地址"):null;if(U==="createLink"&&!P)return;if(U==="code")d3();else document.execCommand(U,!1,P??void 0);t3(v),T(),_8(I)},J0=()=>L(null),c=()=>{let U=e0(v);if(!U.length)return;_Z(),L({anchorId:U[0].id,focusId:U[U.length-1].id})},a=(U)=>{Y9(v);let P=F1(v,U);if(J0(),x(),P)requestAnimationFrame(()=>I0(P,!0));T()},M0=(U,P)=>{if(Y9(v),!(P==="indent"?Y1(v,U):U1(v,U)).length)return;x(),T()},Y0=(U)=>{Y9(v);let P=G1(v,U);if(P.length)L({anchorId:P[0],focusId:P[P.length-1]});x(),T()},r0=(U)=>{let P=K1(v,U);if(P)navigator.clipboard?.writeText(P).catch(()=>{})},Q0=(U)=>{if(U.target?.closest?.(".doc-source"))return;let m=U.metaKey||U.ctrlKey;if(m&&(U.key==="z"||U.key==="Z")){if(U.preventDefault(),U.shiftKey)r();else i();return}if(m&&U.key==="y"){U.preventDefault(),r();return}if(!B)return;let f=S;if(!f.length)return;if(U.key==="Escape"){U.preventDefault();let h=B.anchorId;J0(),I0(h,!0);return}if(U.key==="Tab"){U.preventDefault(),M0(f,U.shiftKey?"outdent":"indent");return}if(U.key==="Backspace"||U.key==="Delete"){U.preventDefault(),a(f);return}if(m&&U.key==="d"){U.preventDefault(),Y0(f);return}if(m&&(U.key==="c"||U.key==="x")){if(U.preventDefault(),r0(f),U.key==="x")a(f);return}if(m&&U.key==="a"){U.preventDefault(),c();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();let h=e0(v),$0=h.findIndex((X0)=>X0.id===B.focusId);if($0<0)return;if(U.shiftKey){let X0=U.key==="ArrowDown"?Math.min($0+1,h.length-1):Math.max($0-1,0);L({anchorId:B.anchorId,focusId:h[X0].id})}else{let X0=U.key==="ArrowDown"?f[f.length-1]:f[0];J0(),I0(X0,U.key==="ArrowDown")}return}if(U.key.length===1&&!m){let h=f[f.length-1];J0(),I0(h,!0)}},n0=y0(null),T0=(U)=>{if(U.button!==0)return;let P=U.target;if(P.closest(".gutter")||P.closest(".pop")||P.closest(".doc-col-resizer")||P.closest("input, button, select, a"))return;let f=l3(U.target)?.getAttribute("data-bid")??null;if(!f){let $0=P.classList.contains("doc")?P:null;if(G==="blocks"&&$0){let X0=$0.querySelectorAll(".block"),k0=X0.length?X0[X0.length-1]:$0.querySelector(".doc-meta"),x0=k0?k0.getBoundingClientRect().bottom:0;if(U.clientY>x0){U.preventDefault();let i0=v[v.length-1];if(i0&&N9(i0))I0(i0.id,!0);else o(null);return}}J0();return}if(U.shiftKey&&B){U.preventDefault(),_Z(),L({anchorId:B.anchorId,focusId:f});return}if(!!P.closest(".editable, .code-input, .doc-td")){if(n0.current={anchorId:f,started:!1,sx:U.clientX,sy:U.clientY,mode:"text"},B)J0()}else U.preventDefault(),_Z(),L({anchorId:f,focusId:f}),n0.current={anchorId:f,started:!0,sx:U.clientX,sy:U.clientY,mode:"block"}};L0(()=>{let U=(m)=>{let f=n0.current;if(!f)return;let $0=document.elementFromPoint(m.clientX,m.clientY)?.closest(".block[data-bid]")?.getAttribute("data-bid")??null;if(f.mode==="text"){if($0&&$0!==f.anchorId)f.mode="block",_Z(),L({anchorId:f.anchorId,focusId:$0});return}if(!f.started&&Math.abs(m.clientX-f.sx)+Math.abs(m.clientY-f.sy)<4)return;if(f.started=!0,f8(!0),$0)L({anchorId:f.anchorId,focusId:$0})},P=()=>{n0.current=null,f8(!1)};return window.addEventListener("mousemove",U),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",P)}},[]);let P0=y0(Q0);P0.current=Q0,L0(()=>{let U=(P)=>P0.current(P);return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[]);let U9=(U,P,m)=>{if(_&&_.blockId===P.id){if(U.key==="ArrowDown"){U.preventDefault(),O({..._,idx:Math.min(_.idx+1,W0.length-1)});return}if(U.key==="ArrowUp"){U.preventDefault(),O({..._,idx:Math.max(_.idx-1,0)});return}if(U.key==="Enter"){U.preventDefault();let f=W0[_.idx];if(f)V(f);return}if(U.key==="Escape"){O(null);return}}if((U.metaKey||U.ctrlKey)&&(U.key==="a"||U.key==="A")){if(Zz(m))U.preventDefault(),c();return}if(U.key==="Tab"){U.preventDefault(),(U.shiftKey?F0:l)(P.id);return}if((U.key==="ArrowUp"||U.key==="ArrowDown")&&!U.shiftKey&&!N8()){let f=e3(m);if(U.key==="ArrowUp"&&f.first){let h=u9(v,P.id);if(h){U.preventDefault(),I0(h.id,!0);return}}else if(U.key==="ArrowDown"&&f.last){let h=v8(v,P.id);if(h){U.preventDefault(),I0(h.id);return}}}if(U.key===" "&&P.type==="p"&&!N8()){let{before:f,after:h}=V8(m),$0=B8(f+" "," ");if($0){U.preventDefault(),j(P,{...$0,content:h});return}}if(U.key==="Enter"&&!U.shiftKey&&P.type!=="code"){let f=B8((m.textContent??"").trim(),"Enter");if(f){if(U.preventDefault(),u0(P.type)&&f.type==="code"){d(P,f);return}j(P,f);return}U.preventDefault();let h=(m.textContent??"").trim()==="";if(u0(P.type)&&h&&!(P.children??[]).length){Z0(P.id,"p");return}let{before:$0,after:X0}=V8(m);P.content=$0,o(P.id,u0(P.type)?P.type:"p",{content:X0})}else if(U.key==="Backspace"){if((m.textContent??"")==="")if(U.preventDefault(),P.type!=="p")Z0(P.id,"p");else{let f=u9(v,P.id);if(f)q0(P.id),requestAnimationFrame(()=>I0(f.id,!0))}else if(!N8()&&s3(m))if(u0(P.type))U.preventDefault(),Z0(P.id,"p",{content:i9(P,m)});else{let f=u9(v,P.id);if(f&&f.type!=="code"&&f.type!=="table"&&f.type!=="divider"){U.preventDefault();let h=w1(f.content);f.content+=i9(P,m),q0(P.id),requestAnimationFrame(()=>{let $0=document.querySelector(`.block[data-bid="${f.id}"] .editable`);if($0){let X0=E9(f.content);if($0.innerHTML!==X0)$0.innerHTML=X0}P1(f.id,h)})}}}},t0=(U,P,m)=>{let{value:f,selectionStart:h,selectionEnd:$0}=m;if(U.key==="Tab"){if(U.preventDefault(),U.shiftKey){if(Y9(v),vZ(v,P.id))x(),requestAnimationFrame(()=>I0(P.id)),T();return}document.execCommand("insertText",!1," ");return}if(U.key==="Enter"&&!U.shiftKey&&h===$0){let X0=f.lastIndexOf(`
109
- `,h-1)+1,k0=f.indexOf(`
110
- `,h),x0=k0===-1,i0=f.slice(X0,x0?void 0:k0).trim()==="";if(x0&&i0)U.preventDefault(),P.content=f.replace(/\n[ \t]*$/,""),o(P.id,"p");return}if(U.key==="ArrowDown"&&h===$0&&f.indexOf(`
111
- `,h)===-1){U.preventDefault();let X0=v8(v,P.id);if(X0)I0(X0.id);else o(P.id,"p");return}if(U.key==="ArrowUp"&&h===$0&&f.lastIndexOf(`
112
- `,h-1)===-1){U.preventDefault();let X0=u9(v,P.id);if(X0)I0(X0.id,!0);return}if(U.key==="Backspace"&&f===""){U.preventDefault();let X0=f0(v,P.id),k0=X0?.parentBlock;if(X0&&k0&&u0(k0.type)&&k0.content.trim()===""){if(X0.parent.splice(X0.index,1),X0.parent.length===0)delete k0.children;x(),requestAnimationFrame(()=>I0(k0.id)),T();return}Z0(P.id,"p")}},k9=(U,P)=>{U.stopPropagation(),v0(U,(m)=>z(z0,{children:[z(S0,{children:"转换为"},void 0,!1,void 0,this),P8.filter((f)=>f.type!=="divider").map((f)=>z(e,{icon:f.ic,label:f.t,checked:P.type===f.type,onClick:()=>{Z0(P.id,f.type),m()}},f.type,!1,void 0,this)),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"copy",label:"复制块",onClick:()=>{let f=f0(v,P.id);if(f)f.parent.splice(f.index+1,0,CZ(P));x(),T(),m()}},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除块",danger:!0,onClick:()=>{q0(P.id),m()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},R9=y0(null);if(y)return z("div",{class:"empty",children:"加载中…"},void 0,!1,void 0,this);let E=new Set(S),s=(U,P=0)=>{let m=y8(U.filter((f)=>!N9(f)));return U.map((f)=>z(m3,{renderKey:K,block:f,depth:P,selected:E.has(f.id),number:f.type==="numbered"?m.get(f.id)??1:0,onInput:(h)=>K0(f,h),onPaste:(h,$0)=>O0(h,f,$0),onLangInput:(h)=>{f.lang=h,x(),T()},onKeyDown:(h,$0)=>U9(h,f,$0),onCodeInput:(h)=>{f.content=h,b("text:"+f.id),T()},onCodeKeyDown:(h,$0)=>t0(h,f,$0),onCellInput:(h,$0,X0)=>{if(!f.rows?.[h])return;f.rows[h][$0]=X0,b("table:"+f.id+":"+h+":"+$0),T()},onTableChange:()=>{x(),T()},onAdd:()=>o(f.id),onMenu:(h)=>k9(h,f),onToggle:()=>{f.checked=!f.checked,x(),T()},dragRef:R9,onReorder:(h,$0)=>{let X0=S;if(X0.length>1&&X0.includes(h)?H1(v,X0,f.id,$0):X1(v,h,f.id,$0))x(),T()},children:f.children?.length?s(f.children,P+1):null},f.id,!1,void 0,this))};return z("div",{class:"doc"+(G==="source"?" source-mode":""),onMouseDown:(U)=>T0(U),onMouseUp:()=>_8(I),onKeyUp:(U)=>{if(U.shiftKey||U.key.startsWith("Arrow"))_8(I)},children:[z("div",{class:"doc-title",contentEditable:!0,onInput:(U)=>{H.current=U.target.textContent??"",b("title"),T()},onBlur:()=>{J()},onKeyDown:(U)=>{if(U.key==="Enter")if(U.preventDefault(),!v.length)o(null);else I0(v[0].id)},dangerouslySetInnerHTML:{__html:H.current}},void 0,!1,void 0,this),z("div",{class:"doc-meta",children:[z("span",{children:[z(D,{name:"file",cls:"ico sm"},void 0,!1,void 0,this),C8(v)," 个块"]},void 0,!0,void 0,this),z("span",{children:"实时同步"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G==="source"?z("textarea",{ref:F,class:"doc-source",spellcheck:!1,defaultValue:W.current,onInput:(U)=>{let P=U.currentTarget;W.current=P.value,C1(P),T()}},void 0,!1,void 0,this):s(v),G==="blocks"&&v.length===0&&z("div",{class:"editable",style:{color:"var(--muted)",cursor:"text"},onClick:()=>o(null),children:"点此书写,或输入 “/” 选择块类型…"},void 0,!1,void 0,this),_&&W0.length>0&&(()=>{let m=innerHeight-(_.y+22)-8,f=_.y-8,h=m>=240||m>=f,$0=Math.min(_.x,innerWidth-270),X0=Math.min(h?m:f,Math.round(innerHeight*0.7)),k0=h?{left:$0,top:_.y+22,maxHeight:X0,minWidth:260}:{left:$0,bottom:innerHeight-_.y+6,maxHeight:X0,minWidth:260};return z("div",{class:"pop",style:k0,children:[z(S0,{children:"基础块"},void 0,!1,void 0,this),W0.map((x0,i0)=>z("button",{class:"item"+(i0===_.idx?" sel":""),onMouseDown:($9)=>{$9.preventDefault(),V(x0)},children:[z("span",{class:"lico",children:z(D,{name:x0.ic,cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"meta",children:[z("span",{class:"t",children:x0.t},void 0,!1,void 0,this),z("span",{class:"d",children:x0.d},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},x0.type,!0,void 0,this))]},void 0,!0,void 0,this)})(),k&&!B&&z(a3,{x:k.x,y:k.y,onCommand:B0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function m3({block:Z,number:J,depth:Q,renderKey:$,selected:q,onInput:X,onPaste:W,onLangInput:F,onKeyDown:H,onCodeInput:G,onCodeKeyDown:Y,onCellInput:K,onTableChange:A,onAdd:y,onMenu:w,onToggle:_,dragRef:O,onReorder:k,children:I}){let B=y0(null);L0(()=>{if(B.current&&Z.type!=="code"){let C=E9(Z.content);if(B.current.innerHTML!==C)B.current.innerHTML=C}},[$,Z.type]);let L=u0(Z.type)&&Z.content.trim()===""&&Z.children?.[0]?.type==="code",M="block b-"+Z.type+(Z.type==="todo"&&Z.checked?" b-done":"")+(L?" list-code-host":"")+(q?" selected":"");return z("div",{class:"block-wrap"+(Q?" nested":""),children:[z("div",{class:M,"data-bid":Z.id,onDragOver:(C)=>{if(O.current&&O.current!==Z.id){if(C.preventDefault(),C.dataTransfer)C.dataTransfer.dropEffect="move";Jz(C.currentTarget,C)}},onDrop:(C)=>{if(!O.current)return;C.preventDefault();let g=C.currentTarget.classList.contains("drop-after")?"after":"before",b=O.current;O.current=null,k8(),k(b,g)},children:[z("div",{class:"gutter",children:[z("button",{title:"在下方插入",onClick:y,children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"grip",title:"拖拽移动 · 点击菜单",draggable:!0,onClick:w,onDragStart:(C)=>{if(O.current=Z.id,C.dataTransfer)C.dataTransfer.effectAllowed="move",C.dataTransfer.setData("text/plain",Z.id);C.currentTarget.closest(".block").classList.add("dragging")},onDragEnd:(C)=>{C.currentTarget.closest(".block").classList.remove("dragging"),k8()},children:z(D,{name:"grip",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z.type==="divider"?z("hr",{},void 0,!1,void 0,this):Z.type==="table"?z(i3,{block:Z,renderKey:$,onCellInput:K,onTableChange:A},void 0,!1,void 0,this):z(z0,{children:[Z.type==="bullet"&&z("div",{class:"marker",children:"•"},void 0,!1,void 0,this),Z.type==="numbered"&&z("div",{class:"marker",children:[J,"."]},void 0,!0,void 0,this),Z.type==="todo"&&z("div",{class:"marker",children:z("input",{type:"checkbox",checked:!!Z.checked,onChange:_},void 0,!1,void 0,this)},void 0,!1,void 0,this),L?null:Z.type==="code"?z(p3,{block:Z,renderKey:$,onInput:G,onLangChange:F,onKeyDown:Y},void 0,!1,void 0,this):z("div",{ref:B,class:"editable",contentEditable:!0,"data-ph":u3(Z.type),"data-ph-hint":E3(Z.type)?"slash":"kind",onInput:(C)=>X(C.currentTarget),onPaste:(C)=>W(C,C.currentTarget),onKeyDown:(C)=>H(C,C.currentTarget)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I]},void 0,!0,void 0,this)}var A1={h1:"标题 1",h2:"标题 2",h3:"标题 3",code:"输入代码…",quote:"引用"};function u3(Z){return A1[Z]??"输入文本,“/” 唤出命令"}function E3(Z){return!(Z in A1)}function p3({block:Z,renderKey:J,onInput:Q,onLangChange:$,onKeyDown:q}){let X=y0(null),W=y0(null),F=y0(null),[H,G]=p(!1),Y=(y)=>{if(W.current)W.current.innerHTML=h3(y,Z.lang);if(F.current){let _=y.split(`
113
- `).length,O="1";for(let k=2;k<=_;k++)O+=`
114
- `+k;F.current.textContent=O}let w=X.current;if(w)w.style.height="auto",w.style.height=w.scrollHeight+"px"};L0(()=>{let y=X.current;if(y&&y.value!==Z.content)y.value=Z.content;Y(Z.content)},[J,Z.lang]);let K=Z.lang??"",A=w8.some((y)=>y.id===K);return z("div",{class:"codeblock",children:[z("div",{class:"code-body",children:[z("div",{ref:F,class:"code-gutter","aria-hidden":"true",children:"1"},void 0,!1,void 0,this),z("div",{class:"code-scroll",children:[z("pre",{class:"code-hl","aria-hidden":"true",children:z("code",{ref:W,class:"hljs"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("textarea",{ref:X,class:"code-input",rows:1,spellcheck:!1,wrap:"off",placeholder:"输入代码…",onInput:(y)=>{let w=y.currentTarget;Q(w.value),Y(w.value)},onKeyDown:(y)=>q(y,y.currentTarget),onScroll:(y)=>{let w=W.current?.parentElement;if(w)w.scrollLeft=y.currentTarget.scrollLeft}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"code-tools",children:[z("span",{class:"code-lang",children:[z("select",{value:K,onChange:(y)=>$(y.currentTarget.value),children:[!A&&z("option",{value:K,children:K||"纯文本"},void 0,!1,void 0,this),w8.map((y)=>z("option",{value:y.id,children:y.label},y.id,!1,void 0,this))]},void 0,!0,void 0,this),z(D,{name:"chevronDown",cls:"ico sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"code-copy"+(H?" ok":""),title:"复制代码",onClick:()=>{let y=X.current?.value??Z.content;navigator.clipboard?.writeText(y).then(()=>{G(!0),setTimeout(()=>G(!1),1400)}).catch(()=>{})},children:[z(D,{name:H?"check":"copy",cls:"ico sm"},void 0,!1,void 0,this),H?"已复制":"复制"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function i3({block:Z,renderKey:J,onCellInput:Q,onTableChange:$}){let q=Z.rows??[],X=q[0]?.length??0,W=Z.align??[],F=y0(null),H=y0([]);if(H.current.length!==X)H.current=Array.from({length:X},(B,L)=>H.current[L]??160);let G=()=>{Z.rows=[...q,Array(X).fill("")],$()},Y=()=>{Z.rows=q.map((B)=>[...B,""]),Z.align=[...W,null],$()},K=(B)=>{Z.rows=q.map((M)=>{let C=[...M];return C.splice(B,0,""),C});let L=[...W];L.splice(B,0,null),Z.align=L,$()},A=(B)=>{if(X<=1)return;Z.rows=q.map((L)=>L.filter((M,C)=>C!==B)),Z.align=W.filter((L,M)=>M!==B),$()},y=(B)=>{if(B===0||q.length<=2)return;Z.rows=q.filter((L,M)=>M!==B),$()},w=(B,L)=>{let M=Array.from({length:X},(C,g)=>W[g]??null);M[B]=L,Z.align=M,$()},_=(B,L)=>{let M=F.current?.querySelector(`.doc-td[data-r="${B}"][data-c="${L}"]`);if(!M)return!1;M.focus();let C=document.createRange();C.selectNodeContents(M),C.collapse(!1);let g=getSelection();return g?.removeAllRanges(),g?.addRange(C),!0},O=(B,L,M)=>{if(B.key==="Tab"){if(B.preventDefault(),B.shiftKey){if(M>0)_(L,M-1);else if(L>0)_(L-1,X-1)}else if(M<X-1)_(L,M+1);else if(L<q.length-1)_(L+1,0);else G(),requestAnimationFrame(()=>_(q.length,0));return}if(B.key==="Enter"){if(B.preventDefault(),L<q.length-1)_(L+1,M);else G(),requestAnimationFrame(()=>_(q.length,M));return}},k=(B,L)=>{B.preventDefault(),B.stopPropagation();let M=B.currentTarget,C=F.current?.querySelector(`col[data-tcol="${L}"]`),g=B.clientX,b=H.current[L]??160,u=b,i=0;M.classList.add("dragging"),document.body.classList.add("col-resizing");let r=()=>{if(i=0,C)C.style.width=u+"px"},x=(t)=>{if(u=Math.max(60,b+t.clientX-g),!i)i=requestAnimationFrame(r)},T=()=>{if(i)cancelAnimationFrame(i);if(C)C.style.width=u+"px";H.current[L]=u,removeEventListener("pointermove",x),removeEventListener("pointerup",T),removeEventListener("pointercancel",T),M.classList.remove("dragging"),document.body.classList.remove("col-resizing")};addEventListener("pointermove",x,{passive:!1}),addEventListener("pointerup",T),addEventListener("pointercancel",T)},I=(B,L)=>{B.preventDefault(),B.stopPropagation(),v0(B,(M)=>z(z0,{children:[z(S0,{children:"对齐方式"},void 0,!1,void 0,this),z(e,{icon:"alignLeft",label:"左对齐",checked:(W[L]??null)===null||W[L]==="left",onClick:()=>{w(L,"left"),M()}},void 0,!1,void 0,this),z(e,{icon:"alignCenter",label:"居中",checked:W[L]==="center",onClick:()=>{w(L,"center"),M()}},void 0,!1,void 0,this),z(e,{icon:"alignRight",label:"右对齐",checked:W[L]==="right",onClick:()=>{w(L,"right"),M()}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"plus",label:"在左侧插入列",onClick:()=>{K(L),M()}},void 0,!1,void 0,this),z(e,{icon:"cornerUpRight",label:"在右侧插入列",onClick:()=>{K(L+1),M()}},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除列",danger:!0,onClick:()=>{A(L),M()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))};return z("div",{class:"doc-table-wrap",children:z("div",{class:"doc-table-scroll",children:z("div",{class:"doc-table-inner",children:[z("div",{class:"doc-table-row",children:[z("table",{ref:F,class:"doc-table",children:[z("colgroup",{children:Array.from({length:X},(B,L)=>z("col",{"data-tcol":L,style:{width:H.current[L]}},L,!1,void 0,this))},void 0,!1,void 0,this),z("tbody",{children:q.map((B,L)=>z("tr",{children:B.map((M,C)=>z("td",{class:L===0?"doc-th":void 0,children:[z(c3,{value:M,renderKey:J,r:L,c:C,align:W[C]??null,onInput:(g)=>Q(L,C,g),onKeyDown:(g)=>O(g,L,C)},void 0,!1,void 0,this),L===0&&z(z0,{children:[z("button",{class:"doc-col-menu",title:"列选项",onMouseDown:(g)=>I(g,C),children:z(D,{name:"chevronDown",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"doc-col-resizer",onPointerDown:(g)=>k(g,C)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),C===0&&L>0&&q.length>2&&z("button",{class:"doc-row-del",title:"删除行",onMouseDown:(g)=>{g.preventDefault(),g.stopPropagation(),y(L)},children:z(D,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C,!0,void 0,this))},L,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"doc-table-addcol",title:"新增列",onMouseDown:(B)=>{B.preventDefault(),Y()},children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"doc-table-addrow",title:"新增行",onMouseDown:(B)=>{B.preventDefault(),G()},children:z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function c3({value:Z,renderKey:J,r:Q,c:$,align:q,onInput:X,onKeyDown:W}){let F=y0(null);return L0(()=>{if(F.current){let H=E9(Z);if(F.current.innerHTML!==H)F.current.innerHTML=H}},[J]),z("div",{ref:F,class:"doc-td","data-r":Q,"data-c":$,contentEditable:!0,"data-ph":Q===0?"表头":"",style:q?{textAlign:q}:void 0,onInput:(H)=>X(p9(H.currentTarget.innerHTML)),onKeyDown:(H)=>W(H)},void 0,!1,void 0,this)}function a3({x:Z,y:J,onCommand:Q}){let $=(q)=>(X)=>{X.preventDefault(),Q(q)};return z("div",{class:"pop",style:{left:Math.max(8,Math.min(Z,innerWidth-220)),top:J-46,minWidth:0,padding:3,display:"flex",gap:1},children:[["bold","bold"],["italic","italic"],["underline","underline"],["strikeThrough","strike"],["code","code"],["createLink","link"]].map(([q,X])=>z("button",{class:"item",style:{width:34,justifyContent:"center",padding:"7px 0"},onMouseDown:$(q),children:z(D,{name:X,cls:"ico sm"},void 0,!1,void 0,this)},q,!1,void 0,this))},void 0,!1,void 0,this)}function d3(){let Z=getSelection();if(!Z||Z.isCollapsed)return;let J=Z.toString();document.execCommand("insertHTML",!1,`<code>${J.replace(/</g,"&lt;")}</code>`)}function Y9(Z){document.querySelectorAll(".doc .block[data-bid]").forEach((J)=>r3(Z,J))}function r3(Z,J){let Q=J.matches(".block[data-bid]")?J:J.closest(".block[data-bid]"),$=Q?.getAttribute("data-bid"),q=$?f0(Z,$)?.block:null;if(!q||!Q)return;let X=Q.querySelector(".editable"),W=Q.querySelector(".code-input");if(X)q.content=i9(q,X);else if(W)q.content=W.value}function l3(Z){return(Z instanceof HTMLElement?Z:Z.parentElement)?.closest(".block[data-bid]")??null}function n3(){return document.activeElement?.closest?.(".doc .block[data-bid]")?.getAttribute("data-bid")??null}function f8(Z){document.querySelector(".doc")?.classList.toggle("selecting",Z)}function _Z(){getSelection()?.removeAllRanges(),document.activeElement?.blur?.(),f8(!0)}function _8(Z){let J=getSelection();if(!J||J.isCollapsed||!J.rangeCount)return Z(null);if(!J.anchorNode?.parentElement?.closest?.(".editable"))return Z(null);let $=J.getRangeAt(0),q=$.getBoundingClientRect(),X=q.width||q.height?q:$.getClientRects()[0];if(!X)return Z(null);Z({x:X.left,y:X.top})}function t3(Z){let J=getSelection()?.anchorNode?.parentElement?.closest?.(".editable"),$=J?.closest(".block")?.getAttribute("data-bid"),q=$?f0(Z,$)?.block:null;if(q&&J)q.content=i9(q,J)}function M8(Z,J={}){let Q={id:p0(),type:Z,content:J.content??""};if(Z==="todo")Q.checked=J.checked??!1;if(Z==="code")Q.lang=J.lang??"";if(Z==="numbered"&&J.start!=null&&J.start>1)Q.start=J.start;if(u0(Z)&&J.children?.length)Q.children=J.children;if(Z==="table")Q.rows=J.rows?J.rows.map(($)=>[...$]):v1(),Q.align=J.align?[...J.align]:Array(Q.rows[0].length).fill(null);return Q}function v1(){return[["",""],["",""]]}function i9(Z,J){return p9(J.innerHTML)}function N8(){let Z=getSelection();return!!Z&&!Z.isCollapsed}function s3(Z){let J=getSelection();if(!J||!J.rangeCount||!J.isCollapsed)return!1;let Q=J.getRangeAt(0);if(!Z.contains(Q.startContainer))return!1;let $=document.createRange();return $.selectNodeContents(Z),$.setEnd(Q.startContainer,Q.startOffset),$.toString().length===0}function o3(){let Z=getSelection();if(!Z||!Z.rangeCount)return{x:80,y:120};let J=Z.getRangeAt(0).getBoundingClientRect();return{x:J.left||80,y:J.top||120}}function e3(Z){let J=getSelection();if(!J||!J.rangeCount)return{first:!0,last:!0};let Q=J.getRangeAt(0).getBoundingClientRect(),$=Z.getBoundingClientRect();if(!Q.height&&!Q.top)return{first:!0,last:!0};let q=parseFloat(getComputedStyle(Z).lineHeight)||Q.height||20;return{first:Q.top-$.top<q*0.5,last:$.bottom-Q.bottom<q*0.5}}function Zz(Z){let J=Z.textContent??"";if(J.trim()==="")return!0;let Q=getSelection();if(!Q||!Q.rangeCount||Q.isCollapsed)return!1;if(!Z.contains(Q.anchorNode)||!Z.contains(Q.focusNode))return!1;return Q.toString().length>=J.length}function V8(Z){let J=getSelection();if(!J||!J.rangeCount||!Z.contains(J.getRangeAt(0).startContainer))return{before:p9(Z.innerHTML),after:""};let Q=J.getRangeAt(0),$=(q)=>{let X=document.createRange();X.selectNodeContents(Z),q(X);let W=document.createElement("div");return W.appendChild(X.cloneContents()),p9(W.innerHTML)};return{before:$((q)=>q.setEnd(Q.startContainer,Q.startOffset)),after:$((q)=>q.setStart(Q.endContainer,Q.endOffset))}}function w1(Z){let J=document.createElement("div");return J.innerHTML=E9(Z),(J.textContent??"").length}function P1(Z,J){let Q=document.querySelector(`.block[data-bid="${Z}"] .editable`);if(!Q)return;Q.focus();let $=document.createTreeWalker(Q,NodeFilter.SHOW_TEXT),q=J,X=null;for(let H=$.nextNode();H;H=$.nextNode()){if(X=H,q<=H.data.length)break;q-=H.data.length}let W=document.createRange();if(X)W.setStart(X,Math.min(q,X.data.length));else W.selectNodeContents(Q);W.collapse(!0);let F=getSelection();F?.removeAllRanges(),F?.addRange(W)}function I0(Z,J=!1){let Q=`.block[data-bid="${Z}"] .editable, .block[data-bid="${Z}"] .code-input`,$=document.querySelector(Q);if(!$)return;if($.focus(),$ instanceof HTMLTextAreaElement){let W=J?$.value.length:0;$.setSelectionRange(W,W);return}let q=document.createRange();q.selectNodeContents($),q.collapse(!J);let X=getSelection();X?.removeAllRanges(),X?.addRange(q)}function C1(Z){Z.style.height="auto",Z.style.height=Z.scrollHeight+"px"}function k8(){document.querySelectorAll(".block.drop-before,.block.drop-after").forEach((Z)=>Z.classList.remove("drop-before","drop-after"))}function Jz(Z,J){k8();let Q=Z.getBoundingClientRect();Z.classList.add(J.clientY<Q.top+Q.height/2?"drop-before":"drop-after")}function O1(){let Z=localStorage.getItem("mh-theme");return Z==="light"||Z==="dark"||Z==="system"?Z:"system"}function _1(Z){localStorage.setItem("mh-theme",Z),document.documentElement.dataset.theme=Z}var Qz=[{value:"light",icon:"sun",name:"浅色",desc:"始终使用明亮界面"},{value:"dark",icon:"moon",name:"深色",desc:"始终使用暗色界面"},{value:"system",icon:"monitor",name:"跟随系统",desc:"随操作系统外观自动切换"}];function N1({onUpdatePending:Z}={}){let[J,Q]=p(O1()),$=(q)=>{_1(q),Q(q)};return z("div",{class:"set-page",children:[z("div",{class:"set-title",children:"设置"},void 0,!1,void 0,this),z("div",{class:"set-sub",children:"个性化你的 Metahub 工作区。"},void 0,!1,void 0,this),z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"外观"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"选择界面的颜色主题。"},void 0,!1,void 0,this),z("div",{class:"theme-grid",children:Qz.map((q)=>z("button",{class:"theme-card"+(J===q.value?" sel":""),"aria-pressed":J===q.value,onClick:()=>$(q.value),children:[z("span",{class:"tc-check",children:z(D,{name:"check"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"tc-ico",children:z(D,{name:q.icon},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"tc-name",children:q.name},void 0,!1,void 0,this),z("span",{class:"tc-desc",children:q.desc},void 0,!1,void 0,this)]},q.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),typeof window<"u"&&window.metahubDesktop?.quicknote&&z(qz,{},void 0,!1,void 0,this),z(Xz,{},void 0,!1,void 0,this),z(Wz,{},void 0,!1,void 0,this),z(zz,{onUpdatePending:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function f9(Z,J){let Q=Z.replace(/^v/,"").split(".").map((q)=>parseInt(q,10)||0),$=J.replace(/^v/,"").split(".").map((q)=>parseInt(q,10)||0);for(let q=0;q<Math.max(Q.length,$.length);q++){let X=(Q[q]??0)-($[q]??0);if(X!==0)return X}return 0}function zz({onUpdatePending:Z}){let J=typeof window<"u"?window.metahubDesktop?.coreUpdate:void 0,[Q,$]=p(null),[q,X]=p(null),[W,F]=p(null),[H,G]=p(null),[Y,K]=p("idle"),[A,y]=p("");L0(()=>{n.version().then((L)=>X(L.version)).catch(()=>X(null)),(typeof window<"u"?window.metahubDesktop:void 0)?.appVersion?.().then($).catch(()=>$(null)),J?.installedVersion().then(F).catch(()=>F(null))},[]),L0(()=>{if(Y==="idle"&&q&&W&&f9(W,q)>0)K("staged"),Z?.(!0)},[q,W]);let w=()=>{if(q&&W)return f9(W,q)>0?W:q;return W??q},_=()=>!!(q&&W&&f9(W,q)>0),O=async()=>{K("checking"),y("");try{let{latest:B}=await J.check(),L=w();if(B&&(!L||f9(B,L)>0))G(B),K("available"),Z?.(!0);else V0("已是最新版本"),K(_()?"staged":"idle")}catch(B){y(B.message),K("error")}},k=async()=>{K("downloading"),y("");try{let B=await J.download();if(B)F(B),K("staged"),Z?.(!0),V0(`已下载 v${B}`);else V0("已是最新版本"),K(_()?"staged":"idle")}catch(B){y(B.message),K("error")}},I=null;if(J)switch(Y){case"checking":I=z("span",{class:"ver-act","aria-disabled":"true",children:"检查中…"},void 0,!1,void 0,this);break;case"downloading":I=z("span",{class:"ver-act","aria-disabled":"true",children:"下载中…"},void 0,!1,void 0,this);break;case"available":I=z("span",{class:"ver-up",children:[z("span",{class:"ver-dot pulse"},void 0,!1,void 0,this),z("span",{children:["新版本 ",z("span",{class:"ver-num",children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"ver-act accent",onClick:k,title:`下载并更新到 v${H}`,children:"下载"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;case"staged":I=z("span",{class:"ver-up",children:[z("span",{class:"ver-dot pulse"},void 0,!1,void 0,this),z("span",{children:[z("span",{class:"ver-num",children:W},void 0,!1,void 0,this)," 待重启"]},void 0,!0,void 0,this),z("button",{class:"ver-act accent",onClick:()=>void J.restart(),title:`重启应用以更新到 v${W}`,children:"重启"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;case"error":I=z("span",{class:"ver-up err",children:[z("span",{class:"ver-msg",children:"检查失败"},void 0,!1,void 0,this),z("button",{class:"ver-act",onClick:O,title:A||"重试",children:"重试"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;default:I=z("button",{class:"ver-act",onClick:O,children:"检查更新"},void 0,!1,void 0,this)}return z("div",{class:"set-footer",children:[Q&&z("span",{children:["App ",z("span",{class:"ver-num",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q&&q&&z("span",{class:"set-footer-sep",children:"·"},void 0,!1,void 0,this),q&&z("span",{children:["Core ",z("span",{class:"ver-num",children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I&&(q||Q)&&z("span",{class:"set-footer-sep",children:"·"},void 0,!1,void 0,this),I]},void 0,!0,void 0,this)}var R8="CommandOrControl+Shift+Space";function $z(Z){if(["Control","Meta","Alt","Shift"].includes(Z.key))return null;let J=[];if(Z.metaKey||Z.ctrlKey)J.push("CommandOrControl");if(Z.altKey)J.push("Alt");if(Z.shiftKey)J.push("Shift");let Q=Z.key;if(Q===" ")Q="Space";else if(Q.startsWith("Arrow"))Q=Q.slice(5);else if(Q.length===1)Q=Q.toUpperCase();if(J.length===0)return null;return J.push(Q),J.join("+")}function M1(Z){let J=typeof window<"u"&&window.metahubDesktop?.platform==="darwin";return Z.replace("CommandOrControl",J?"⌘":"Ctrl").replace("Alt",J?"⌥":"Alt").replace("Shift",J?"⇧":"Shift").split("+").join(J?" ":"+")}function qz(){let Z=window.metahubDesktop.quicknote,[J,Q]=p(R8),[$,q]=p(!1),[X,W]=p(!1);L0(()=>{Z.getSettings().then((Y)=>{Q(Y.shortcut),q(Y.alwaysOnTop)}).catch((Y)=>V0(`加载失败:${Y.message}`))},[]);let F=async(Y)=>{try{let K=await Z.setShortcut(Y);Q(K.shortcut),V0(`快捷键已设为 ${M1(K.shortcut)}`)}catch(K){V0(`设置失败:${K.message}`)}},H=(Y)=>{if(Y.preventDefault(),Y.key==="Escape"){W(!1);return}let K=$z(Y);if(!K)return;W(!1),F(K)},G=async()=>{let Y=!$;q(Y);try{q(await Z.setAlwaysOnTop(Y))}catch(K){q(!Y),V0(`设置失败:${K.message}`)}};return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"快速笔记"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"用全局快捷键随时唤起小窗记录想法。小窗也可从菜单栏图标打开。"},void 0,!1,void 0,this),z("div",{class:"qn-set-row",children:[z("div",{class:"qn-set-main",children:[z("div",{class:"qn-set-name",children:"唤起快捷键"},void 0,!1,void 0,this),z("div",{class:"qn-set-desc",children:"点击下方按钮,然后按下你想用的组合键。"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-secondary qn-shortcut"+(X?" capturing":""),onClick:()=>W(!0),onBlur:()=>W(!1),onKeyDown:X?H:void 0,children:X?"按下组合键…":M1(J)},void 0,!1,void 0,this),J!==R8&&z("button",{class:"btn btn-ghost",title:"重置默认",onClick:()=>void F(R8),children:"重置"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"qn-set-row",children:[z("div",{class:"qn-set-main",children:[z("div",{class:"qn-set-name",children:"默认始终置顶"},void 0,!1,void 0,this),z("div",{class:"qn-set-desc",children:"小窗浮在其他窗口之上;也可在小窗内用 \uD83D\uDCCC 按钮切换。"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn "+($?"btn-primary":"btn-secondary"),"aria-pressed":$,onClick:()=>void G(),children:$?"已开启":"已关闭"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function V1(Z){if(!Z)return"从未";return new Date(Z).toLocaleString()}function Xz(){let[Z,J]=p(null),Q=()=>n.listPeers().then(J).catch((G)=>V0(`加载失败:${G.message}`));L0(()=>{Q()},[]);let $=async()=>{try{let G=await n.newPairingCode();X9(z(Fz,{code:G.code,exp:G.exp},void 0,!1,void 0,this))}catch(G){V0(`生成失败:${G.message}`)}},q=()=>X9(z(Gz,{onDone:()=>{c0(),Q()}},void 0,!1,void 0,this)),X=async(G)=>{try{let Y=await n.syncPeer(G.url);V0(Y.ok?`已同步:推送 ${Y.pushed},拉取 ${Y.pulled}`:`同步失败:${Y.error}`),Q()}catch(Y){V0(`同步失败:${Y.message}`)}},W=async(G)=>{await n.updatePeer(G.url,{enabled:!G.enabled}).catch((Y)=>V0(Y.message)),Q()},F=async(G)=>{if(!await j0({title:"移除同步设备",message:`确定移除 ${G.url}?将停止与该设备的数据同步。`,confirmLabel:"移除",danger:!0}))return;await n.removePeer(G.url).catch((K)=>V0(K.message)),Q()},H=(G,Y)=>v0(G,(K)=>z(z0,{children:[z(e,{icon:"share",label:"立即同步",onClick:()=>{K(),X(Y)}},void 0,!1,void 0,this),z(e,{icon:Y.enabled?"eyeOff":"check",label:Y.enabled?"禁用":"启用",onClick:()=>{K(),W(Y)}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"移除",danger:!0,onClick:()=>{K(),F(Y)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this));return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"同步设备"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"与其他设备配对,自动双向同步数据。在对方设备生成配对码,然后在此添加。"},void 0,!1,void 0,this),z("div",{class:"peer-actions",children:[z("button",{class:"btn btn-primary",onClick:q,children:[z(D,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)," 添加设备"]},void 0,!0,void 0,this),z("button",{class:"btn btn-secondary",onClick:$,children:[z(D,{name:"link",cls:"ico sm"},void 0,!1,void 0,this)," 生成本机配对码"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"peer-list",children:Z==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):Z.length===0?z("div",{class:"muted",children:"还没有配对的设备。"},void 0,!1,void 0,this):Z.map((G)=>z("div",{class:"peer-row",children:[z("span",{class:"peer-dot"+(G.enabled?G.last_status==="error"?" err":" on":" off")},void 0,!1,void 0,this),z("div",{class:"peer-main",children:[z("div",{class:"peer-url",children:G.label||G.url},void 0,!1,void 0,this),z("div",{class:"peer-sub",children:[G.enabled?"已启用":"已禁用"," · 最近同步 ",V1(G.last_sync_at),G.last_status==="error"&&G.last_error?` · 错误:${G.last_error}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-ghost peer-menu",onClick:(Y)=>H(Y,G),children:z(D,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},G.url,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Wz(){let[Z,J]=p(null),Q=()=>n.listGrants().then(J).catch((q)=>V0(`加载失败:${q.message}`));L0(()=>{Q()},[]);let $=async(q)=>{if(!await j0({title:"吊销凭据",message:`吊销后,持有此凭据的设备${q.peer_url?`(${q.peer_url})`:""}将无法再同步进本机。`,confirmLabel:"吊销",danger:!0}))return;await n.revokeGrant(q.token).catch((W)=>V0(W.message)),Q()};return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"已授权设备"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"本机签发、允许其他设备同步进来的凭据。吊销即断开对方的入站访问。"},void 0,!1,void 0,this),z("div",{class:"peer-list",children:Z==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):Z.length===0?z("div",{class:"muted",children:"还没有签发任何凭据。"},void 0,!1,void 0,this):Z.map((q)=>z("div",{class:"peer-row",children:[z("span",{class:"peer-dot on"},void 0,!1,void 0,this),z("div",{class:"peer-main",children:[z("div",{class:"peer-url",children:q.peer_url||"(未知地址)"},void 0,!1,void 0,this),z("div",{class:"peer-sub",children:[q.token.slice(0,8),"… · 签发于 ",V1(q.created_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-ghost peer-menu",title:"吊销",onClick:()=>$(q),children:z(D,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},q.token,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Fz({code:Z,exp:J}){let[Q,$]=p(Math.max(0,Math.round((J-Date.now())/1000)));L0(()=>{let W=setInterval(()=>$(Math.max(0,Math.round((J-Date.now())/1000))),1000);return()=>clearInterval(W)},[J]);let q=Math.floor(Q/60),X=String(Q%60).padStart(2,"0");return z(W9,{title:"本机配对码",sub:"在另一台设备上输入此服务器地址和下面的配对码即可配对。配对码一次性使用。",footer:z("button",{class:"btn btn-primary",onClick:c0,children:"完成"},void 0,!1,void 0,this),children:[z("div",{class:"pair-code",children:Z},void 0,!1,void 0,this),z("div",{class:"muted",style:{textAlign:"center",marginTop:8},children:Q>0?`${q}:${X} 后过期`:"已过期,请重新生成"},void 0,!1,void 0,this),z("button",{class:"btn btn-secondary",style:{width:"100%",marginTop:12},onClick:()=>{navigator.clipboard?.writeText(Z),V0("已复制配对码")},children:[z(D,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this)," 复制"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Gz({onDone:Z}){let[J,Q]=p(""),[$,q]=p(""),[X,W]=p(location.origin),[F,H]=p(!1),G=async()=>{if(!J.trim()||!$.trim()){V0("地址和配对码必填");return}H(!0);try{let Y=await n.addPeerByPairing({url:J.trim(),code:$.trim(),self_url:X.trim()||void 0});await n.syncPeer(Y.url).catch(()=>{}),V0(`已配对 ${Y.url}`),Z()}catch(Y){V0(`配对失败:${Y.message}`),H(!1)}};return z(W9,{title:"添加同步设备",sub:"输入对方 Metahub 服务器的地址,以及它生成的一次性配对码。",footer:z(z0,{children:[z("button",{class:"btn btn-secondary",onClick:c0,disabled:F,children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:G,disabled:F,children:F?"配对中…":"配对"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{class:"field-label",children:"对方服务器地址"},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,placeholder:"http://192.168.1.10:7777",value:J,onInput:(Y)=>Q(Y.target.value)},void 0,!1,void 0,this),z("div",{class:"field-label",children:"配对码"},void 0,!1,void 0,this),z("input",{class:"text-input",placeholder:"对方「生成本机配对码」得到的码",value:$,onInput:(Y)=>q(Y.target.value),onKeyDown:(Y)=>Y.key==="Enter"&&G()},void 0,!1,void 0,this),z("div",{class:"field-label",children:"本机可达地址(可选)"},void 0,!1,void 0,this),z("input",{class:"text-input",placeholder:"留空则仅本机主动同步",value:X,onInput:(Y)=>W(Y.target.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var f1="mh-quicknote-last",k1="mh-quicknote-parent",R1="Quick Notes";function Hz(Z,J){return(J.created_hlc??"").localeCompare(Z.created_hlc??"")}async function Kz(){let Z=localStorage.getItem(k1);if(Z)try{return await n.getDocument(Z),Z}catch{}let $=(await n.listDocuments()).find((q)=>q.parent_id==null&&q.title===R1)?.id??(await n.createDocument({title:R1})).id;return localStorage.setItem(k1,$),$}function I1(){let[Z,J]=p(null),[Q,$]=p([]),[q,X]=p(null),[W,F]=p(""),[H,G]=p(!1),Y=y0(null),K=typeof window<"u"?window.metahubDesktop?.quicknote:void 0,A=q9(async(B)=>{let L=(await n.listDocumentsByParent(B)).sort(Hz);return $(L),L},[]),y=q9(async(B)=>{let L=await n.createDocument({title:"",parent_id:B});return await A(B),L.id},[A]);L0(()=>{(async()=>{try{let B=await Kz();J(B);let L=await A(B),M=localStorage.getItem(f1),C=M&&L.some((g)=>g.id===M)&&M||L[0]?.id||await y(B);X(C)}catch(B){F(String(B.message))}})()},[A,y]),L0(()=>{if(q)localStorage.setItem(f1,q)},[q]),L0(()=>{K?.getAlwaysOnTop().then(G).catch(()=>{})},[K]),L0(()=>{if(!K)return;let B=(L)=>{if(L.key==="Escape")K.hide()};return addEventListener("keydown",B),()=>removeEventListener("keydown",B)},[K]);let w=async()=>{if(!Z)return;try{X(await y(Z))}catch(B){F(String(B.message))}},_=async()=>{if(!K)return;let B=!H;G(B);try{G(await K.setAlwaysOnTop(B))}catch{G(!B)}},O=async()=>{if(!q||!Z)return;if(!await j0({title:"删除笔记?",message:"该快速笔记将被删除。",confirmLabel:"删除",danger:!0}))return;await n.deleteDocument(q);let L=await A(Z);X(L[0]?.id??await y(Z))},k=(B)=>{v0(B,(L)=>z(z0,{children:[z(S0,{children:"快速笔记"},void 0,!1,void 0,this),Q.length===0&&z("div",{class:"lbl",children:"还没有笔记"},void 0,!1,void 0,this),Q.map((M)=>z(e,{icon:"file",label:M.title||"无标题",checked:M.id===q,onClick:()=>{L(),X(M.id)}},M.id,!1,void 0,this)),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"plus",label:"新建笔记",onClick:()=>{L(),w()}},void 0,!1,void 0,this),q&&z(e,{icon:"trash",label:"删除当前笔记",danger:!0,onClick:()=>{L(),O()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),{minWidth:220})},I=Q.find((B)=>B.id===q)?.title;return z("div",{class:"qn",children:[z("div",{class:"qn-bar",children:[z("span",{class:"qn-brand",children:I||"快速笔记"},void 0,!1,void 0,this),z("div",{class:"qn-actions",children:[z("button",{class:"iconbtn",title:"新建笔记",onClick:()=>void w(),children:z(D,{name:"plus"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"iconbtn",title:"笔记列表",onClick:k,children:z(D,{name:"list"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K&&z("button",{class:"iconbtn"+(H?" active":""),title:H?"取消置顶":"始终置顶",onClick:()=>void _(),children:z(D,{name:"pin"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&z("div",{class:"error-bar",onClick:()=>F(""),children:["⚠ ",W,"(点击关闭)"]},void 0,!0,void 0,this),z("div",{class:"qn-body",children:q?z(MZ,{docId:q,onTitleChange:()=>Z&&void A(Z),onError:F,onHandle:(B)=>Y.current=B},q,!1,void 0,this):z("div",{class:"empty",children:z("div",{children:"加载中…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z(QZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var Yz=/[",\r\n]/;function Uz(Z){return Yz.test(Z)?`"${Z.replace(/"/g,'""')}"`:Z}function b1(Z){return Z.map((J)=>J.map(Uz).join(",")).join(`
115
- `)}function I8(Z,J){let Q=J.startsWith(".")?J:"."+J,$=Z.trim().replace(/[\\/:*?"<>|\x00-\x1f]/g,"-").replace(/\s+/g," ").replace(/^\.+$/,"").slice(0,90)||"untitled";return $.toLowerCase().endsWith(Q.toLowerCase())?$:$+Q}function b8(Z,J,Q){let $=URL.createObjectURL(new Blob([J],{type:Q})),q=document.createElement("a");q.href=$,q.download=Z,document.body.appendChild(q),q.click(),q.remove(),setTimeout(()=>URL.revokeObjectURL($),0)}function S1(Z,J){let Q=["id",...Z.map((q)=>q.name)],$=J.map((q)=>[q.id,...Z.map((X)=>yz(q.values[X.name]))]);return b1([Q,...$])}function yz(Z){if(Z==null)return"";if(typeof Z==="boolean")return Z?"true":"false";if(typeof Z==="object")return JSON.stringify(Z);return String(Z)}function Bz(){let[Z,J]=p([]),[Q,$]=p([]),[q,X]=p({kind:"empty"}),[W,F]=p(""),[H,G]=p(!1),[Y,K]=p(!1),[A,y]=p(268),[w,_]=p("blocks"),[O,k]=p(!1),I=y0(null),B=q9((x)=>F(x),[]),L=q9((x)=>{I.current=x},[]),M=q9(async()=>{let[x,T]=await Promise.all([n.listDatabases(),n.listDocuments()]);J(x),$(T)},[]);L0(()=>{M().catch((x)=>B(String(x.message)))},[M]),L0(()=>{let x=typeof window<"u"?window.metahubDesktop?.coreUpdate:void 0;if(!x)return;Promise.all([n.version().then((T)=>T.version).catch(()=>null),x.installedVersion().catch(()=>null)]).then(([T,t])=>{if(T&&t&&f9(t,T)>0)k(!0)})},[]);let C=(x)=>{X(x),G(!1)},g=()=>n.createDocument({title:""}).then((x)=>{M(),C({kind:"doc",id:x.id})}).catch((x)=>B(String(x.message))),b=q.kind==="db"?Z.find((x)=>x.id===q.id):void 0,u=q.kind==="doc"?Q.find((x)=>x.id===q.id):void 0,i=q.kind==="doc"?q.id:null;L0(()=>{_("blocks")},[i]);let r=(x)=>{if(q.kind==="doc"&&u)v0(x,(T)=>z(z0,{children:[z(e,{icon:"code",label:w==="source"?"块方式显示":"代码方式显示",checked:w==="source",onClick:()=>{T(),I.current?.setMode(w==="source"?"blocks":"source")}},void 0,!1,void 0,this),z(e,{icon:"download",label:"导出 Markdown",onClick:()=>{T();let t=I.current?.snapshotMarkdown();I.current?.flushSave(),(t==null?n.getDocument(u.id).then((R)=>R.body??""):Promise.resolve(t)).then((R)=>b8(I8(u.title||u.id,".md"),R,"text/markdown;charset=utf-8")).catch((R)=>B(String(R.message)))}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"settings",label:"重命名…",onClick:async()=>{T();let t=await w9({title:"重命名文档",value:u.title});if(t)await n.updateDocument(u.id,{title:t}),M()}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除文档",danger:!0,onClick:async()=>{if(T(),await j0({title:"删除文档?",message:`「${u.title||"无标题"}」将被删除。`,confirmLabel:"删除",danger:!0}))await n.deleteDocument(u.id),X({kind:"empty"}),M()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this));else if(q.kind==="db"&&b)v0(x,(T)=>z(z0,{children:[z(e,{icon:"download",label:"导出 CSV",onClick:()=>{T(),Promise.all([n.listProperties(b.id),n.listRecords(b.id)]).then(([t,H0])=>b8(I8(b.name||b.id,".csv"),S1(t,H0),"text/csv;charset=utf-8")).catch((t)=>B(String(t.message)))}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"settings",label:"重命名…",onClick:async()=>{T();let t=await w9({title:"重命名数据库",value:b.name});if(t&&t!==b.name)await n.updateDatabase(b.id,{name:t}),M()}},void 0,!1,void 0,this),z(_0,{},void 0,!1,void 0,this),z(e,{icon:"trash",label:"删除数据库",danger:!0,onClick:async()=>{if(T(),await j0({title:"删除数据库?",message:`「${b.name}」及其所有记录将被永久删除。`,confirmLabel:"删除",danger:!0}))await n.deleteDatabase(b.id),X({kind:"empty"}),M()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))};return z(z0,{children:[z(W4,{databases:Z,docs:Q,activeKind:q.kind,activeId:"id"in q?q.id:void 0,width:A,collapsed:Y,onResize:y,onOpenDb:(x)=>C({kind:"db",id:x}),onOpenDoc:(x)=>C({kind:"doc",id:x}),onSearch:(x)=>C({kind:"search",q:x}),onCollapse:()=>K(!0),onOpenSettings:()=>C({kind:"settings"}),settingsActive:q.kind==="settings",updatePending:O,reloadNav:M,onError:B,afterDelete:(x,T)=>{if("id"in q&&q.id===T)X({kind:"empty"})}},void 0,!1,void 0,this),z(wz,{open:H},void 0,!1,void 0,this),z("div",{class:"main",children:[z("div",{class:"topbar"+(q.kind==="empty"?" bare":""),children:[z("button",{class:"iconbtn hamburger"+(Y?" show-collapsed":""),title:Y?"展开侧栏":"菜单",onClick:()=>Y?K(!1):G(!0),children:z(D,{name:"panelLeft"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"crumb",children:[q.kind==="doc"&&z(z0,{children:[z("span",{class:"emoji",children:z(D,{name:"file",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{children:u?.title||"无标题"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.kind==="db"&&z(z0,{children:[z("span",{class:"emoji",children:b?.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("span",{children:b?.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.kind==="search"&&z("span",{children:["搜索:“",q.q,"”"]},void 0,!0,void 0,this),q.kind==="settings"&&z(z0,{children:[z("span",{class:"emoji",children:z(D,{name:"settings",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{children:"设置"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(q.kind==="doc"||q.kind==="db")&&z(z0,{children:[z("button",{class:"btn btn-ghost",children:[z(D,{name:"share",cls:"ico sm"},void 0,!1,void 0,this),"分享"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",onClick:r,children:z(D,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&z("div",{class:"error-bar",onClick:()=>F(""),children:["⚠ ",W,"(点击关闭)"]},void 0,!0,void 0,this),z("div",{class:"content",children:[q.kind==="empty"&&z(Lz,{onNewDoc:g},void 0,!1,void 0,this),q.kind==="db"&&b&&z(A4,{db:b,reloadNav:M,onError:B},b.id,!1,void 0,this),q.kind==="doc"&&z(MZ,{docId:q.id,onTitleChange:M,onError:B,onModeChange:_,onHandle:L},q.id,!1,void 0,this),q.kind==="search"&&z(Pz,{q:q.q,onOpenDoc:(x)=>C({kind:"doc",id:x}),onOpenDb:(x)=>C({kind:"db",id:x})},void 0,!1,void 0,this),q.kind==="settings"&&z(N1,{onUpdatePending:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"backdrop"+(H?" show":""),onClick:()=>G(!1)},void 0,!1,void 0,this),z(QZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Lz({onNewDoc:Z}){return z("div",{class:"empty",children:[z("svg",{class:"estate-art",viewBox:"0 0 220 190",fill:"none","aria-hidden":"true",children:[z("ellipse",{class:"kg-ground ground",cx:"110",cy:"176",rx:"62",ry:"8"},void 0,!1,void 0,this),z("circle",{class:"kg-glow fill-soft",cx:"116",cy:"88",r:"42"},void 0,!1,void 0,this),z("g",{class:"kg-plant",children:[z("path",{class:"kg-stem stroke-a draw",pathLength:"100",d:"M110 134 C110 117 108 106 113 92 C116 83 122 77 128 72"},void 0,!1,void 0,this),z("g",{class:"kg-leaf l1",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M108 108 C90 100 86 88 88 80 C102 80 111 90 108 108 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("g",{class:"kg-leaf l2",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M118 90 C133 83 144 86 150 94 C139 105 125 104 118 90 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("g",{class:"kg-leaf l3",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M128 72 C128 57 136 48 146 45 C150 58 144 69 128 72 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("rect",{class:"kg-cardB fill-soft",x:"76",y:"124",width:"68",height:"44",rx:"8",transform:"rotate(7 110 146)"},void 0,!1,void 0,this),z("g",{class:"kg-cardA",children:[z("rect",{class:"fill-surface stroke",x:"66",y:"128",width:"76",height:"46",rx:"9",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-a",x:"74",y:"136",width:"18",height:"18",rx:"5",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-soft",x:"98",y:"139",width:"34",height:"6",rx:"3",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-soft",x:"98",y:"150",width:"24",height:"6",rx:"3",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("circle",{class:"kg-particle p1 fill-a",cx:"44",cy:"62",r:"2.6"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p2 fill-soft",cx:"178",cy:"74",r:"3"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p3 fill-a",cx:"40",cy:"120",r:"2"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p4 fill-soft",cx:"182",cy:"126",r:"2.4"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p5 fill-a",cx:"150",cy:"44",r:"2.2"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("p",{class:"estate-title",children:"空空如也"},void 0,!1,void 0,this),z("p",{class:"estate-hint",children:"从左侧选择一个数据库或文档,或新建一个开始。"},void 0,!1,void 0,this),z("button",{class:"estate-link",onClick:Z,children:"+ 新建文档"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wz({open:Z}){return L0(()=>{let J=document.querySelector(".sidebar");if(J)J.classList.toggle("open",Z)},[Z]),null}function Pz({q:Z,onOpenDoc:J,onOpenDb:Q}){let[$,q]=p(null);return L0(()=>{q(null),n.search(Z).then(q).catch(()=>q([]))},[Z]),z("div",{class:"db",children:[z("div",{class:"db-title",style:{marginBottom:14},children:["搜索:“",Z,"”"]},void 0,!0,void 0,this),$===null&&z("p",{class:"muted",children:"搜索中…"},void 0,!1,void 0,this),$?.length===0&&z("p",{class:"muted",children:"没有匹配结果。"},void 0,!1,void 0,this),$?.map((X)=>z("div",{class:"error-bar",style:{background:"var(--surface)",color:"var(--fg)",margin:"0 0 8px"},onClick:()=>X.type==="document"?J(X.id):X.database_id&&Q(X.database_id),children:[z("strong",{children:X.title||X.id},void 0,!1,void 0,this)," ",z("span",{class:"muted",children:X.type},void 0,!1,void 0,this),z("div",{class:"muted",dangerouslySetInnerHTML:{__html:X.snippet}},void 0,!1,void 0,this)]},X.id,!0,void 0,this))]},void 0,!0,void 0,this)}if(typeof window<"u"&&window.metahubDesktop){if(document.body.classList.add("desktop"),window.metahubDesktop.platform==="darwin")document.body.classList.add("desktop-mac")}if(location.hash==="#quick"&&typeof window<"u"&&window.metahubDesktop)document.body.classList.add("quicknote"),TZ(z(I1,{},void 0,!1,void 0,this),document.getElementById("app"));else TZ(z(Bz,{},void 0,!1,void 0,this),document.getElementById("app"));
107
+ `:Q}function Kz(Z){return Z.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/(\*|_)([^*_]+)\1/g,"$2").replace(/~~([^~]+)~~/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").trim()}function Yz({blocks:Z}){let J=z9(Z).filter((W)=>W.type==="h1"||W.type==="h2"||W.type==="h3").map((W)=>({id:W.id,level:Number(W.type.slice(1)),text:Kz(W.content)||"无标题"})),[Q,$]=m(null),q=J.map((W)=>W.id).join("|");if(Z0(()=>{if(!J.length)return;let W=document.querySelector(".content"),G=0,F=()=>{let Y=Math.max(W?W.getBoundingClientRect().top:0,0)+100,C=J[0].id;for(let w of J){let y=document.querySelector(`.block[data-bid="${w.id}"]`);if(!y)continue;if(y.getBoundingClientRect().top-Y<=1)C=w.id;else break}$(C)},H=()=>{if(G)return;G=requestAnimationFrame(()=>{G=0,F()})};F();let K=new IntersectionObserver(F,{root:W,rootMargin:"-90px 0px -70% 0px",threshold:[0,1]});for(let Y of J){let C=document.querySelector(`.block[data-bid="${Y.id}"]`);if(C)K.observe(C)}return W?.addEventListener("scroll",H,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),()=>{if(K.disconnect(),W?.removeEventListener("scroll",H),window.removeEventListener("scroll",H),G)cancelAnimationFrame(G)}},[q]),!J.length)return null;let X=(W)=>{document.querySelector(`.block[data-bid="${W}"]`)?.scrollIntoView({behavior:"smooth",block:"start"})};return z("nav",{class:"doc-toc","aria-label":"文档目录",children:J.map((W)=>z("button",{class:"toc-row lvl-"+W.level+(W.id===Q?" active":""),title:W.text,onClick:()=>X(W.id),children:[z("span",{class:"toc-tick"},void 0,!1,void 0,this),z("span",{class:"toc-label",children:W.text},void 0,!1,void 0,this)]},W.id,!0,void 0,this))},void 0,!1,void 0,this)}function hZ({docId:Z,onError:J,onModeChange:Q,onHandle:$}){let q=W0([]),X=W0(""),W=W0(null),G=W0(""),[F,H]=m("blocks"),[K,Y]=m(0),[C,w]=m(!0),[y,v]=m(null),V=W0(null),[I,N]=m(null),[P,A]=m(null),O=W0(),L=W0(null),D=W0(!1),g=W0(0),h=W0(Promise.resolve()),[l,c]=m(!1),Y0=W0({past:[],future:[],present:null,lastKey:null,lastTime:0}),Q0=()=>({blocks:structuredClone(q.current),title:G.current,focusId:vz()}),$0=(U)=>{let _=Y0.current;if(!_.present){_.present=Q0(),_.lastKey=U,_.lastTime=Date.now();return}let t=Date.now();if(U&&U===_.lastKey&&t-_.lastTime<600){_.present=Q0(),_.lastTime=t;return}if(_.past.push(_.present),_.past.length>200)_.past.shift();_.present=Q0(),_.future=[],_.lastKey=U,_.lastTime=t},y0=(U)=>{if(q.current=structuredClone(U.blocks),G.current=U.title,A(null),Y((_)=>_+1),x(),U.focusId)requestAnimationFrame(()=>S0(U.focusId,!0))},S=()=>{let U=Y0.current;if(!U.past.length)return;if(U.present)U.future.push(U.present);let _=U.past.pop();U.present=_,U.lastKey=null,y0(_)},f=()=>{let U=Y0.current;if(!U.future.length)return;if(U.present)U.past.push(U.present);let _=U.future.pop();U.present=_,U.lastKey=null,y0(_)},B=()=>{$0(null),Y((U)=>U+1)},M=()=>{w(!0),v(null),c(!1),Y0.current={past:[],future:[],present:null,lastKey:null,lastTime:0},p.getDocument(Z).then((U)=>{G.current=U.title??"",X.current=U.body??"",q.current=TZ(U.body),L.current=U.version??null,D.current=!1,w(!1),B()}).catch((U)=>J(String(U.message)))};Z0(()=>{return M(),()=>clearTimeout(O.current)},[Z]),Z0(()=>{let U=(_)=>{if(!D.current)return;_.preventDefault(),_.returnValue=""};return window.addEventListener("beforeunload",U),()=>window.removeEventListener("beforeunload",U)},[]);let x=()=>{D.current=!0,clearTimeout(O.current),O.current=setTimeout(n,700)},o=()=>{if(F==="source")return X.current=W.current?.value??X.current,X.current;return C9(q.current),O6(q.current)},z0=(U={})=>p.updateDocument(Z,{title:G.current,body:o(),...U.force||L.current==null?{}:{if_match:L.current}}).then((_)=>{L.current=_.version??null,D.current=!1,g.current=0,c(!1)}).catch((_)=>{if(_ instanceof KZ&&_.code==="stale"){c(!0);return}J(String(_.message)),g.current=Math.min(Math.max(g.current*2,1000),30000),clearTimeout(O.current),O.current=setTimeout(n,g.current)}),n=(U={})=>h.current=h.current.then(()=>z0(U)),k=async()=>{clearTimeout(O.current),await n()},j=(U)=>{if(U===F)return;if(U==="source"){X.current=o(),v(null),N(null),A(null),H("source"),Q?.("source"),requestAnimationFrame(()=>{if(W.current)W.current.value=X.current,E6(W.current),W.current.focus()});return}X.current=W.current?.value??X.current,q.current=TZ(X.current),H("blocks"),Q?.("blocks"),Y((_)=>_+1),requestAnimationFrame(()=>{let _=z9(q.current)[0];if(_)S0(_.id)})};Z0(()=>{return $?.({getMode:()=>F,setMode:j,snapshotMarkdown:o,flushSave:k}),()=>$?.(null)},[$,F]);let T=q.current,i=P?I6(T,P.anchorId,P.focusId):[],J0=(U,_="p",t={})=>{let R=SZ(_,t);if(!U)T.push(R);else{let E=V0(T,U);if(E)E.parent.splice(E.index+1,0,R);else T.push(R)}return B(),requestAnimationFrame(()=>S0(R.id)),x(),R},H0=(U,_,t={})=>{let E=V0(T,U)?.block;if(!E)return;let s=c0(_)?E.children:void 0;if(S1(E,_,t),s?.length)E.children=s;else delete E.children;if(B(),_!=="divider"&&_!=="table")requestAnimationFrame(()=>S0(U));x()},B0=(U)=>{if(!gZ(T,U))return;B(),x()},O0=(U,_)=>{U.content=t9(U,_),$0("text:"+U.id);let t=_.textContent??"";if(t.startsWith("/")){let R=kz();v((E)=>({blockId:U.id,x:R.x,y:R.y,query:t.slice(1),idx:E?.blockId===U.id?E.idx:0}))}else if(y)v(null);x()},g0=(U,_,t)=>{let R=U.clipboardData?.getData("text/html"),s=(R?w6(R):U.clipboardData?.getData("text/plain")??"").replace(/\r\n?/g,`
108
+ `);if(!s.trim())return;U.preventDefault();let q0=TZ(s);if(!q0.length)return;let R0=V0(T,_.id);if(!R0)return;let{before:D0,after:a0}=c1(t);if(q0.length===1&&q0[0].type==="p"&&(D0.trim()!==""||a0.trim()!=="")){_.content=D0+q0[0].content+a0;let W7=u6(D0+q0[0].content);B(),x(),requestAnimationFrame(()=>p6(_.id,W7));return}let Y9=[...q0],e9=a0.trim()!==""?SZ("p",{content:a0}):null;if(e9)Y9.push(e9);if(D0.trim()===""&&!R0.block.children?.length)R0.parent.splice(R0.index,1,...Y9);else _.content=D0,R0.parent.splice(R0.index+1,0,...Y9);B(),x();let X7=e9??Y9[Y9.length-1];requestAnimationFrame(()=>S0(X7.id,!e9))},N0=y?j1.filter((U)=>(U.t+U.type+U.d).toLowerCase().includes(y.query.toLowerCase())):[],d0=(U)=>{if(!y)return;H0(y.blockId,U.type),v(null)},m0=(U,_)=>{H0(U.id,_.type,_),v(null)},P0=(U,_)=>{U.content="",U.children??=[];let t=SZ(_.type,_);U.children.unshift(t),v(null),B(),requestAnimationFrame(()=>S0(t.id)),x()},s0=(U)=>{if(C9(T),!u1(T,U))return;B(),requestAnimationFrame(()=>S0(U)),x()},e=(U)=>{if(C9(T),!xZ(T,U))return;B(),requestAnimationFrame(()=>S0(U)),x()},O9=async(U)=>{if(U==="createLink"){let _=getSelection(),t=_&&_.rangeCount?_.getRangeAt(0).cloneRange():null;if(!t||t.collapsed)return;N(null);let R=(await J9({title:"插入链接",label:"链接地址",placeholder:"https://…"}))?.trim();if(!R)return;t.startContainer.parentElement?.closest?.(".editable")?.focus();let s=getSelection();s?.removeAllRanges(),s?.addRange(t),document.execCommand("createLink",!1,R)}else if(U==="code")Az();else document.execCommand(U,!1,void 0);Nz(T),x(),p1(N)},k0=()=>A(null),C0=()=>{let U=z9(T);if(!U.length)return;DZ(),A({anchorId:U[0].id,focusId:U[U.length-1].id})},K9=(U)=>{C9(T);let _=S6(T,U);if(k0(),B(),_)requestAnimationFrame(()=>S0(_,!0));x()},$9=(U,_)=>{if(C9(T),!(_==="indent"?x6(T,U):j6(T,U)).length)return;B(),x()},x9=(U)=>{C9(T);let _=T6(T,U);if(_.length)A({anchorId:_[0],focusId:_[_.length-1]});B(),x()},j9=(U)=>{let _=g6(T,U);if(_)navigator.clipboard?.writeText(_).catch(()=>{})},u=(U)=>{if(U.target?.closest?.(".doc-source"))return;let t=U.metaKey||U.ctrlKey;if(t&&(U.key==="z"||U.key==="Z")){if(U.preventDefault(),U.shiftKey)f();else S();return}if(t&&U.key==="y"){U.preventDefault(),f();return}if(!P)return;let R=i;if(!R.length)return;if(U.key==="Escape"){U.preventDefault();let E=P.anchorId;k0(),S0(E,!0);return}if(U.key==="Tab"){U.preventDefault(),$9(R,U.shiftKey?"outdent":"indent");return}if(U.key==="Backspace"||U.key==="Delete"){U.preventDefault(),K9(R);return}if(t&&U.key==="d"){U.preventDefault(),x9(R);return}if(t&&(U.key==="c"||U.key==="x")){if(U.preventDefault(),j9(R),U.key==="x")K9(R);return}if(t&&U.key==="a"){U.preventDefault(),C0();return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();let E=z9(T),s=E.findIndex((q0)=>q0.id===P.focusId);if(s<0)return;if(U.shiftKey){let q0=U.key==="ArrowDown"?Math.min(s+1,E.length-1):Math.max(s-1,0);A({anchorId:P.anchorId,focusId:E[q0].id})}else{let q0=U.key==="ArrowDown"?R[R.length-1]:R[0];k0(),S0(q0,U.key==="ArrowDown")}return}if(U.key.length===1&&!t){let E=R[R.length-1];k0(),S0(E,!0)}},d=W0(null),X0=(U)=>{if(U.button!==0)return;let _=U.target;if(_.closest(".gutter")||_.closest(".pop")||_.closest(".doc-col-resizer")||_.closest("input, button, select, a"))return;let R=_z(U.target)?.getAttribute("data-bid")??null;if(!R){let s=_.classList.contains("doc")?_:null;if(F==="blocks"&&s){let q0=s.querySelectorAll(".block"),R0=q0.length?q0[q0.length-1]:s.querySelector(".doc-meta"),D0=R0?R0.getBoundingClientRect().bottom:0;if(U.clientY>D0){U.preventDefault();let a0=T[T.length-1];if(a0&&b9(a0))S0(a0.id,!0);else J0(null);return}}k0();return}if(U.shiftKey&&P){U.preventDefault(),DZ(),A({anchorId:P.anchorId,focusId:R});return}if(!!_.closest(".editable, .code-input, .doc-td")){if(d.current={anchorId:R,started:!1,sx:U.clientX,sy:U.clientY,mode:"text"},P)k0()}else U.preventDefault(),DZ(),A({anchorId:R,focusId:R}),d.current={anchorId:R,started:!0,sx:U.clientX,sy:U.clientY,mode:"block"}};Z0(()=>{let U=(t)=>{let R=d.current;if(!R)return;let s=document.elementFromPoint(t.clientX,t.clientY)?.closest(".block[data-bid]")?.getAttribute("data-bid")??null;if(R.mode==="text"){if(s&&s!==R.anchorId)R.mode="block",DZ(),A({anchorId:R.anchorId,focusId:s});return}if(!R.started&&Math.abs(t.clientX-R.sx)+Math.abs(t.clientY-R.sy)<4)return;if(R.started=!0,i1(!0),s)A({anchorId:R.anchorId,focusId:s})},_=()=>{d.current=null,i1(!1)};return window.addEventListener("mousemove",U),window.addEventListener("mouseup",_),()=>{window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",_)}},[]);let L0=W0(u);L0.current=u,Z0(()=>{let U=(_)=>L0.current(_);return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[]),Z0(()=>{if(!y)return;V.current?.querySelector(".item.sel")?.scrollIntoView({block:"nearest"})},[y?.idx,y?.blockId]),Z0(()=>{if(!y)return;let U=()=>v(null);return document.addEventListener("focusout",U),()=>document.removeEventListener("focusout",U)},[!!y]);let x0=(U,_,t)=>{if(y&&y.blockId===_.id){if(U.key==="ArrowDown"){U.preventDefault(),v({...y,idx:Math.min(y.idx+1,N0.length-1)});return}if(U.key==="ArrowUp"){U.preventDefault(),v({...y,idx:Math.max(y.idx-1,0)});return}if(U.key==="Enter"){U.preventDefault();let R=N0[y.idx];if(R)d0(R);return}if(U.key==="Escape"){v(null);return}}if((U.metaKey||U.ctrlKey)&&(U.key==="a"||U.key==="A")){if(Vz(t))U.preventDefault(),C0();return}if(U.key==="Tab"){U.preventDefault(),(U.shiftKey?e:s0)(_.id);return}if((U.key==="ArrowUp"||U.key==="ArrowDown")&&!U.shiftKey&&!E1()){let R=fz(t);if(U.key==="ArrowUp"&&R.first){let E=r9(T,_.id);if(E){U.preventDefault(),S0(E.id,!0);return}}else if(U.key==="ArrowDown"&&R.last){let E=m1(T,_.id);if(E){U.preventDefault(),S0(E.id);return}}}if(U.key===" "&&!E1()&&(_.type==="p"||_.type==="bullet")){let{before:R,after:E}=c1(t);if(_.type==="p"){let s=b1(R+" "," ");if(s){U.preventDefault(),m0(_,{...s,content:E});return}}else{let s=v6(R);if(s){U.preventDefault(),H0(_.id,"todo",{content:E,checked:s.checked});return}}}if(U.key==="Enter"&&!U.shiftKey&&_.type!=="code"){let R=b1((t.textContent??"").trim(),"Enter");if(R){if(U.preventDefault(),c0(_.type)&&R.type==="code"){P0(_,R);return}m0(_,R);return}U.preventDefault();let E=(t.textContent??"").trim()==="";if(c0(_.type)&&E&&!(_.children??[]).length){H0(_.id,"p");return}let{before:s,after:q0}=c1(t);_.content=s,J0(_.id,c0(_.type)?_.type:"p",{content:q0})}else if(U.key==="Backspace"){if((t.textContent??"")==="")if(U.preventDefault(),_.type!=="p")H0(_.id,"p");else{let R=r9(T,_.id);if(R)B0(_.id),requestAnimationFrame(()=>S0(R.id,!0))}else if(!E1()&&Mz(t))if(c0(_.type))U.preventDefault(),H0(_.id,"p",{content:t9(_,t)});else{let R=r9(T,_.id);if(R&&R.type!=="code"&&R.type!=="table"&&R.type!=="divider"){U.preventDefault();let E=u6(R.content);R.content+=t9(_,t),B0(_.id),requestAnimationFrame(()=>{let s=document.querySelector(`.block[data-bid="${R.id}"] .editable`);if(s){let q0=l9(R.content);if(s.innerHTML!==q0)s.innerHTML=q0}p6(R.id,E)})}}}},l0=(U,_,t)=>{let{value:R,selectionStart:E,selectionEnd:s}=t;if(U.key==="Tab"){if(U.preventDefault(),U.shiftKey){if(C9(T),xZ(T,_.id))B(),requestAnimationFrame(()=>S0(_.id)),x();return}document.execCommand("insertText",!1," ");return}if(U.key==="Enter"&&!U.shiftKey&&E===s){let q0=R.lastIndexOf(`
109
+ `,E-1)+1,R0=R.indexOf(`
110
+ `,E),D0=R0===-1,a0=R.slice(q0,D0?void 0:R0).trim()==="";if(D0&&a0)U.preventDefault(),_.content=R.replace(/\n[ \t]*$/,""),J0(_.id,"p");return}if(U.key==="ArrowDown"&&E===s&&R.indexOf(`
111
+ `,E)===-1){U.preventDefault();let q0=m1(T,_.id);if(q0)S0(q0.id);else J0(_.id,"p");return}if(U.key==="ArrowUp"&&E===s&&R.lastIndexOf(`
112
+ `,E-1)===-1){U.preventDefault();let q0=r9(T,_.id);if(q0)S0(q0.id,!0);return}if(U.key==="Backspace"&&R===""){U.preventDefault();let q0=V0(T,_.id),R0=q0?.parentBlock;if(q0&&R0&&c0(R0.type)&&R0.content.trim()===""){if(q0.parent.splice(q0.index,1),q0.parent.length===0)delete R0.children;B(),requestAnimationFrame(()=>S0(R0.id)),x();return}H0(_.id,"p")}},uZ=(U,_)=>{U.stopPropagation(),w0(U,(t)=>z(a,{children:[z(T0,{children:"转换为"},void 0,!1,void 0,this),j1.filter((R)=>R.type!=="divider").map((R)=>z(r,{icon:R.ic,label:R.t,checked:_.type===R.type,onClick:()=>{H0(_.id,R.type),t()}},R.type,!1,void 0,this)),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"copy",label:"复制块",onClick:()=>{let R=V0(T,_.id);if(R)R.parent.splice(R.index+1,0,bZ(_));B(),x(),t()}},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除块",danger:!0,onClick:()=>{B0(_.id),t()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},pZ=W0(null);if(C)return z("div",{class:"empty",children:"加载中…"},void 0,!1,void 0,this);let q7=new Set(i),s1=(U,_=0)=>{let t=T1(U.filter((R)=>!b9(R)));return U.map((R)=>z(Uz,{renderKey:K,block:R,depth:_,selected:q7.has(R.id),number:R.type==="numbered"?t.get(R.id)??1:0,onInput:(E)=>O0(R,E),onPaste:(E,s)=>g0(E,R,s),onLangInput:(E)=>{R.lang=E,B(),x()},onKeyDown:(E,s)=>x0(E,R,s),onCodeInput:(E)=>{R.content=E,$0("text:"+R.id),x()},onCodeKeyDown:(E,s)=>l0(E,R,s),onCellInput:(E,s,q0)=>{if(!R.rows?.[E])return;R.rows[E][s]=q0,$0("table:"+R.id+":"+E+":"+s),x()},onTableChange:()=>{B(),x()},onAdd:()=>J0(R.id),onMenu:(E)=>uZ(E,R),onToggle:()=>{R.checked=!R.checked,B(),x()},dragRef:pZ,onReorder:(E,s)=>{let q0=i;if(q0.length>1&&q0.includes(E)?b6(T,q0,R.id,s):R6(T,E,R.id,s))B(),x()},children:R.children?.length?s1(R.children,_+1):null},R.id,!1,void 0,this))};return z(a,{children:[F==="blocks"&&z(Yz,{blocks:T},K,!1,void 0,this),z("div",{class:"doc"+(F==="source"?" source-mode":""),onMouseDown:(U)=>X0(U),onMouseUp:()=>p1(N),onKeyUp:(U)=>{if(U.shiftKey||U.key.startsWith("Arrow"))p1(N)},children:[l&&z("div",{class:"doc-conflict",role:"alert",children:[z("span",{class:"doc-conflict-msg",children:"文档已被其他端修改,自动保存已暂停。"},void 0,!1,void 0,this),z("button",{class:"btn btn-secondary",onClick:()=>M(),children:"载入最新(弃本地改动)"},void 0,!1,void 0,this),z("button",{class:"btn btn-danger",onClick:()=>void n({force:!0}),children:"用本地版本覆盖"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"doc-title",contentEditable:!0,onInput:(U)=>{G.current=U.target.textContent??"",$0("title"),x()},onKeyDown:(U)=>{if(U.key==="Enter")if(U.preventDefault(),!T.length)J0(null);else S0(T[0].id)},dangerouslySetInnerHTML:{__html:G.current}},void 0,!1,void 0,this),z("div",{class:"doc-meta",children:[z("span",{children:[z(b,{name:"file",cls:"ico sm"},void 0,!1,void 0,this),D1(T)," 个块"]},void 0,!0,void 0,this),z("span",{children:"实时同步"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F==="source"?z("textarea",{ref:W,class:"doc-source",spellcheck:!1,defaultValue:X.current,onInput:(U)=>{let _=U.currentTarget;X.current=_.value,E6(_),x()}},void 0,!1,void 0,this):s1(T),F==="blocks"&&T.length===0&&z("div",{class:"editable",style:{color:"var(--muted)",cursor:"text"},onClick:()=>J0(null),children:"点此书写,或输入 “/” 选择块类型…"},void 0,!1,void 0,this),y&&N0.length>0&&(()=>{let t=innerHeight-(y.y+22)-8,R=y.y-8,E=t>=240||t>=R,s=Math.min(y.x,innerWidth-270),q0=Math.min(E?t:R,Math.round(innerHeight*0.7)),R0=E?{left:s,top:y.y+22,maxHeight:q0,minWidth:260}:{left:s,bottom:innerHeight-y.y+6,maxHeight:q0,minWidth:260};return z("div",{class:"pop",style:R0,ref:V,children:[z(T0,{children:"基础块"},void 0,!1,void 0,this),N0.map((D0,a0)=>z("button",{class:"item"+(a0===y.idx?" sel":""),onMouseDown:(Y9)=>{Y9.preventDefault(),d0(D0)},children:[z("span",{class:"lico",children:z(b,{name:D0.ic,cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"meta",children:[z("span",{class:"t",children:D0.t},void 0,!1,void 0,this),z("span",{class:"d",children:D0.d},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},D0.type,!0,void 0,this))]},void 0,!0,void 0,this)})(),I&&!P&&z(Cz,{x:I.x,y:I.y,onCommand:O9},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Uz({block:Z,number:J,depth:Q,renderKey:$,selected:q,onInput:X,onPaste:W,onLangInput:G,onKeyDown:F,onCodeInput:H,onCodeKeyDown:K,onCellInput:Y,onTableChange:C,onAdd:w,onMenu:y,onToggle:v,dragRef:V,onReorder:I,children:N}){let P=W0(null);Z0(()=>{if(P.current&&Z.type!=="code"){let L=l9(Z.content);if(P.current.innerHTML!==L)P.current.innerHTML=L}},[$,Z.type]);let A=c0(Z.type)&&Z.content.trim()===""&&Z.children?.[0]?.type==="code",O="block b-"+Z.type+(Z.type==="todo"&&Z.checked?" b-done":"")+(A?" list-code-host":"")+(q?" selected":"");return z("div",{class:"block-wrap"+(Q?" nested":""),children:[z("div",{class:O,"data-bid":Z.id,onDragOver:(L)=>{if(V.current&&V.current!==Z.id){if(L.preventDefault(),L.dataTransfer)L.dataTransfer.dropEffect="move";Rz(L.currentTarget,L)}},onDrop:(L)=>{if(!V.current)return;L.preventDefault();let D=L.currentTarget.classList.contains("drop-after")?"after":"before",g=V.current;V.current=null,c6(),I(g,D)},children:[z("div",{class:"gutter",children:[z("button",{title:"在下方插入",onClick:w,children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"grip",title:"拖拽移动 · 点击菜单",draggable:!0,onClick:y,onDragStart:(L)=>{if(V.current=Z.id,L.dataTransfer)L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",Z.id);L.currentTarget.closest(".block").classList.add("dragging")},onDragEnd:(L)=>{L.currentTarget.closest(".block").classList.remove("dragging"),c6()},children:z(b,{name:"grip",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z.type==="divider"?z("hr",{},void 0,!1,void 0,this):Z.type==="table"?z(Pz,{block:Z,renderKey:$,onCellInput:Y,onTableChange:C},void 0,!1,void 0,this):z(a,{children:[Z.type==="bullet"&&z("div",{class:"marker",children:"•"},void 0,!1,void 0,this),Z.type==="numbered"&&z("div",{class:"marker",children:[J,"."]},void 0,!0,void 0,this),Z.type==="todo"&&z("div",{class:"marker",children:z("input",{type:"checkbox",checked:!!Z.checked,onChange:v},void 0,!1,void 0,this)},void 0,!1,void 0,this),A?null:Z.type==="code"?z(Lz,{block:Z,renderKey:$,onInput:H,onLangChange:G,onKeyDown:K},void 0,!1,void 0,this):z("div",{ref:P,class:"editable",contentEditable:!0,"data-ph":yz(Z.type),"data-ph-hint":Bz(Z.type)?"slash":"kind",onInput:(L)=>X(L.currentTarget),onPaste:(L)=>W(L,L.currentTarget),onKeyDown:(L)=>F(L,L.currentTarget)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N]},void 0,!0,void 0,this)}var i6={h1:"标题 1",h2:"标题 2",h3:"标题 3",code:"输入代码…",quote:"引用"};function yz(Z){return i6[Z]??"输入文本,“/” 唤出命令"}function Bz(Z){return!(Z in i6)}function Lz({block:Z,renderKey:J,onInput:Q,onLangChange:$,onKeyDown:q}){let X=W0(null),W=W0(null),G=W0(null),[F,H]=m(!1),K=(w)=>{if(W.current)W.current.innerHTML=Fz(w,Z.lang);if(G.current){let v=w.split(`
113
+ `).length,V="1";for(let I=2;I<=v;I++)V+=`
114
+ `+I;G.current.textContent=V}let y=X.current;if(y)y.style.height="auto",y.style.height=y.scrollHeight+"px"};Z0(()=>{let w=X.current;if(w&&w.value!==Z.content)w.value=Z.content;K(Z.content)},[J,Z.lang]);let Y=Z.lang??"",C=x1.some((w)=>w.id===Y);return z("div",{class:"codeblock",children:[z("div",{class:"code-body",children:[z("div",{ref:G,class:"code-gutter","aria-hidden":"true",children:"1"},void 0,!1,void 0,this),z("div",{class:"code-scroll",children:[z("pre",{class:"code-hl","aria-hidden":"true",children:z("code",{ref:W,class:"hljs"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("textarea",{ref:X,class:"code-input",rows:1,spellcheck:!1,wrap:"off",placeholder:"输入代码…",onInput:(w)=>{let y=w.currentTarget;Q(y.value),K(y.value)},onKeyDown:(w)=>q(w,w.currentTarget),onScroll:(w)=>{let y=W.current?.parentElement;if(y)y.scrollLeft=w.currentTarget.scrollLeft}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"code-tools",children:[z("span",{class:"code-lang",children:[z("select",{value:Y,onChange:(w)=>$(w.currentTarget.value),children:[!C&&z("option",{value:Y,children:Y||"纯文本"},void 0,!1,void 0,this),x1.map((w)=>z("option",{value:w.id,children:w.label},w.id,!1,void 0,this))]},void 0,!0,void 0,this),z(b,{name:"chevronDown",cls:"ico sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"code-copy"+(F?" ok":""),title:"复制代码",onClick:()=>{let w=X.current?.value??Z.content;navigator.clipboard?.writeText(w).then(()=>{H(!0),setTimeout(()=>H(!1),1400)}).catch(()=>{})},children:[z(b,{name:F?"check":"copy",cls:"ico sm"},void 0,!1,void 0,this),F?"已复制":"复制"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Pz({block:Z,renderKey:J,onCellInput:Q,onTableChange:$}){let q=Z.rows??[],X=q[0]?.length??0,W=Z.align??[],G=W0(null),F=W0([]);if(F.current.length!==X)F.current=Array.from({length:X},(P,A)=>F.current[A]??160);let H=()=>{Z.rows=[...q,Array(X).fill("")],$()},K=()=>{Z.rows=q.map((P)=>[...P,""]),Z.align=[...W,null],$()},Y=(P)=>{Z.rows=q.map((O)=>{let L=[...O];return L.splice(P,0,""),L});let A=[...W];A.splice(P,0,null),Z.align=A,$()},C=(P)=>{if(X<=1)return;Z.rows=q.map((A)=>A.filter((O,L)=>L!==P)),Z.align=W.filter((A,O)=>O!==P),$()},w=(P)=>{if(P===0||q.length<=2)return;Z.rows=q.filter((A,O)=>O!==P),$()},y=(P,A)=>{let O=Array.from({length:X},(L,D)=>W[D]??null);O[P]=A,Z.align=O,$()},v=(P,A)=>{let O=G.current?.querySelector(`.doc-td[data-r="${P}"][data-c="${A}"]`);if(!O)return!1;O.focus();let L=document.createRange();L.selectNodeContents(O),L.collapse(!1);let D=getSelection();return D?.removeAllRanges(),D?.addRange(L),!0},V=(P,A,O)=>{if(P.key==="Tab"){if(P.preventDefault(),P.shiftKey){if(O>0)v(A,O-1);else if(A>0)v(A-1,X-1)}else if(O<X-1)v(A,O+1);else if(A<q.length-1)v(A+1,0);else H(),requestAnimationFrame(()=>v(q.length,0));return}if(P.key==="Enter"){if(P.preventDefault(),A<q.length-1)v(A+1,O);else H(),requestAnimationFrame(()=>v(q.length,O));return}},I=(P,A)=>{P.preventDefault(),P.stopPropagation(),YZ(P,{col:G.current?.querySelector(`col[data-tcol="${A}"]`)??null,startWidth:F.current[A]??160,min:60,onDone:(O)=>{F.current[A]=O}})},N=(P,A)=>{P.preventDefault(),P.stopPropagation(),w0(P,(O)=>z(a,{children:[z(T0,{children:"对齐方式"},void 0,!1,void 0,this),z(r,{icon:"alignLeft",label:"左对齐",checked:(W[A]??null)===null||W[A]==="left",onClick:()=>{y(A,"left"),O()}},void 0,!1,void 0,this),z(r,{icon:"alignCenter",label:"居中",checked:W[A]==="center",onClick:()=>{y(A,"center"),O()}},void 0,!1,void 0,this),z(r,{icon:"alignRight",label:"右对齐",checked:W[A]==="right",onClick:()=>{y(A,"right"),O()}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"plus",label:"在左侧插入列",onClick:()=>{Y(A),O()}},void 0,!1,void 0,this),z(r,{icon:"cornerUpRight",label:"在右侧插入列",onClick:()=>{Y(A+1),O()}},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除列",danger:!0,onClick:()=>{C(A),O()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))};return z("div",{class:"doc-table-wrap",children:z("div",{class:"doc-table-scroll",children:z("div",{class:"doc-table-inner",children:[z("div",{class:"doc-table-row",children:[z("table",{ref:G,class:"doc-table",children:[z("colgroup",{children:Array.from({length:X},(P,A)=>z("col",{"data-tcol":A,style:{width:F.current[A]}},A,!1,void 0,this))},void 0,!1,void 0,this),z("tbody",{children:q.map((P,A)=>z("tr",{children:P.map((O,L)=>z("td",{class:A===0?"doc-th":void 0,children:[z(wz,{value:O,renderKey:J,r:A,c:L,align:W[L]??null,onInput:(D)=>Q(A,L,D),onKeyDown:(D)=>V(D,A,L)},void 0,!1,void 0,this),A===0&&z(a,{children:[z("button",{class:"doc-col-menu",title:"列选项",onMouseDown:(D)=>N(D,L),children:z(b,{name:"chevronDown",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"doc-col-resizer",onPointerDown:(D)=>I(D,L)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L===0&&A>0&&q.length>2&&z("button",{class:"doc-row-del",title:"删除行",onMouseDown:(D)=>{D.preventDefault(),D.stopPropagation(),w(A)},children:z(b,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},L,!0,void 0,this))},A,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"doc-table-addcol",title:"新增列",onMouseDown:(P)=>{P.preventDefault(),K()},children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"doc-table-addrow",title:"新增行",onMouseDown:(P)=>{P.preventDefault(),H()},children:z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function wz({value:Z,renderKey:J,r:Q,c:$,align:q,onInput:X,onKeyDown:W}){let G=W0(null);return Z0(()=>{if(G.current){let F=l9(Z);if(G.current.innerHTML!==F)G.current.innerHTML=F}},[J]),z("div",{ref:G,class:"doc-td","data-r":Q,"data-c":$,contentEditable:!0,"data-ph":Q===0?"表头":"",style:q?{textAlign:q}:void 0,onInput:(F)=>X(n9(F.currentTarget.innerHTML)),onKeyDown:(F)=>W(F)},void 0,!1,void 0,this)}function Cz({x:Z,y:J,onCommand:Q}){let $=(q)=>(X)=>{X.preventDefault(),Q(q)};return z("div",{class:"pop",style:{left:Math.max(8,Math.min(Z,innerWidth-220)),top:J-46,minWidth:0,padding:3,display:"flex",gap:1},children:[["bold","bold"],["italic","italic"],["underline","underline"],["strikeThrough","strike"],["code","code"],["createLink","link"]].map(([q,X])=>z("button",{class:"item",style:{width:34,justifyContent:"center",padding:"7px 0"},onMouseDown:$(q),children:z(b,{name:X,cls:"ico sm"},void 0,!1,void 0,this)},q,!1,void 0,this))},void 0,!1,void 0,this)}function Az(){let Z=getSelection();if(!Z||Z.isCollapsed)return;let J=Z.toString();document.execCommand("insertHTML",!1,`<code>${J.replace(/</g,"&lt;")}</code>`)}function C9(Z){document.querySelectorAll(".doc .block[data-bid]").forEach((J)=>Oz(Z,J))}function Oz(Z,J){let Q=J.matches(".block[data-bid]")?J:J.closest(".block[data-bid]"),$=Q?.getAttribute("data-bid"),q=$?V0(Z,$)?.block:null;if(!q||!Q)return;let X=Q.querySelector(".editable"),W=Q.querySelector(".code-input");if(X)q.content=t9(q,X);else if(W)q.content=W.value}function _z(Z){return(Z instanceof HTMLElement?Z:Z.parentElement)?.closest(".block[data-bid]")??null}function vz(){return document.activeElement?.closest?.(".doc .block[data-bid]")?.getAttribute("data-bid")??null}function i1(Z){document.querySelector(".doc")?.classList.toggle("selecting",Z)}function DZ(){getSelection()?.removeAllRanges(),document.activeElement?.blur?.(),i1(!0)}function p1(Z){let J=getSelection();if(!J||J.isCollapsed||!J.rangeCount)return Z(null);if(!J.anchorNode?.parentElement?.closest?.(".editable"))return Z(null);let $=J.getRangeAt(0),q=$.getBoundingClientRect(),X=q.width||q.height?q:$.getClientRects()[0];if(!X)return Z(null);Z({x:X.left,y:X.top})}function Nz(Z){let J=getSelection()?.anchorNode?.parentElement?.closest?.(".editable"),$=J?.closest(".block")?.getAttribute("data-bid"),q=$?V0(Z,$)?.block:null;if(q&&J)q.content=t9(q,J)}function t9(Z,J){return n9(J.innerHTML)}function E1(){let Z=getSelection();return!!Z&&!Z.isCollapsed}function Mz(Z){let J=getSelection();if(!J||!J.rangeCount||!J.isCollapsed)return!1;let Q=J.getRangeAt(0);if(!Z.contains(Q.startContainer))return!1;let $=document.createRange();return $.selectNodeContents(Z),$.setEnd(Q.startContainer,Q.startOffset),$.toString().length===0}function kz(){let Z=getSelection();if(!Z||!Z.rangeCount)return{x:80,y:120};let J=Z.getRangeAt(0).getBoundingClientRect();return{x:J.left||80,y:J.top||120}}function fz(Z){let J=getSelection();if(!J||!J.rangeCount)return{first:!0,last:!0};let Q=J.getRangeAt(0).getBoundingClientRect(),$=Z.getBoundingClientRect();if(!Q.height&&!Q.top)return{first:!0,last:!0};let q=parseFloat(getComputedStyle(Z).lineHeight)||Q.height||20;return{first:Q.top-$.top<q*0.5,last:$.bottom-Q.bottom<q*0.5}}function Vz(Z){let J=Z.textContent??"";if(J.trim()==="")return!0;let Q=getSelection();if(!Q||!Q.rangeCount||Q.isCollapsed)return!1;if(!Z.contains(Q.anchorNode)||!Z.contains(Q.focusNode))return!1;return Q.toString().length>=J.length}function c1(Z){let J=getSelection();if(!J||!J.rangeCount||!Z.contains(J.getRangeAt(0).startContainer))return{before:n9(Z.innerHTML),after:""};let Q=J.getRangeAt(0),$=(q)=>{let X=document.createRange();X.selectNodeContents(Z),q(X);let W=document.createElement("div");return W.appendChild(X.cloneContents()),n9(W.innerHTML)};return{before:$((q)=>q.setEnd(Q.startContainer,Q.startOffset)),after:$((q)=>q.setStart(Q.endContainer,Q.endOffset))}}function u6(Z){let J=document.createElement("div");return J.innerHTML=l9(Z),(J.textContent??"").length}function p6(Z,J){let Q=document.querySelector(`.block[data-bid="${Z}"] .editable`);if(!Q)return;Q.focus();let $=document.createTreeWalker(Q,NodeFilter.SHOW_TEXT),q=J,X=null;for(let F=$.nextNode();F;F=$.nextNode()){if(X=F,q<=F.data.length)break;q-=F.data.length}let W=document.createRange();if(X)W.setStart(X,Math.min(q,X.data.length));else W.selectNodeContents(Q);W.collapse(!0);let G=getSelection();G?.removeAllRanges(),G?.addRange(W)}function S0(Z,J=!1){let Q=`.block[data-bid="${Z}"] .editable, .block[data-bid="${Z}"] .code-input`,$=document.querySelector(Q);if(!$)return;if($.focus(),$ instanceof HTMLTextAreaElement){let W=J?$.value.length:0;$.setSelectionRange(W,W);return}let q=document.createRange();q.selectNodeContents($),q.collapse(!J);let X=getSelection();X?.removeAllRanges(),X?.addRange(q)}function E6(Z){Z.style.height="auto",Z.style.height=Z.scrollHeight+"px"}var c6=e0;function Rz(Z,J){Z1(Z,J,"y")}function d1(){let Z=localStorage.getItem("mh-theme");return Z==="light"||Z==="dark"||Z==="system"?Z:"system"}function a1(){let Z=d1(),J=Z==="dark"||Z!=="light"&&matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.dataset.resolved=J?"dark":"light"}function d6(Z){localStorage.setItem("mh-theme",Z),a1(),mZ()}function mZ(){let Z=document.getElementById("theme-color-meta");if(!Z)return;let J=document.body.classList.contains("mobile")&&!document.body.classList.contains("mobile-content"),Q=getComputedStyle(document.documentElement).getPropertyValue(J?"--sidebar":"--bg").trim();if(Q)Z.setAttribute("content",Q)}function A9(Z,J){let Q=Z.replace(/^v/,"").split(".").map((q)=>parseInt(q,10)||0),$=J.replace(/^v/,"").split(".").map((q)=>parseInt(q,10)||0);for(let q=0;q<Math.max(Q.length,$.length);q++){let X=(Q[q]??0)-($[q]??0);if(X!==0)return X}return 0}var Iz=[{value:"light",icon:"sun",name:"浅色",desc:"始终使用明亮界面"},{value:"dark",icon:"moon",name:"深色",desc:"始终使用暗色界面"},{value:"system",icon:"monitor",name:"跟随系统",desc:"随操作系统外观自动切换"}];function r6({onUpdatePending:Z}={}){let[J,Q]=m(d1()),$=(q)=>{d6(q),Q(q)};return z("div",{class:"set-page",children:[z("div",{class:"set-title",children:"设置"},void 0,!1,void 0,this),z("div",{class:"set-sub",children:"个性化你的 Metahub 工作区。"},void 0,!1,void 0,this),z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"外观"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"选择界面的颜色主题。"},void 0,!1,void 0,this),z("div",{class:"theme-grid",children:Iz.map((q)=>z("button",{class:"theme-card"+(J===q.value?" sel":""),"aria-pressed":J===q.value,onClick:()=>$(q.value),children:[z("span",{class:"tc-check",children:z(b,{name:"check"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"tc-ico",children:z(b,{name:q.icon},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"tc-name",children:q.name},void 0,!1,void 0,this),z("span",{class:"tc-desc",children:q.desc},void 0,!1,void 0,this)]},q.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),typeof window<"u"&&window.metahubDesktop?.quicknote&&z(bz,{},void 0,!1,void 0,this),z(gz,{},void 0,!1,void 0,this),z(xz,{},void 0,!1,void 0,this),z(Sz,{onUpdatePending:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Sz({onUpdatePending:Z}){let J=typeof window<"u"?window.metahubDesktop?.coreUpdate:void 0,[Q,$]=m(null),[q,X]=m(null),[W,G]=m(null),[F,H]=m(null),[K,Y]=m("idle"),[C,w]=m("");Z0(()=>{p.version().then((A)=>X(A.version)).catch(()=>X(null)),(typeof window<"u"?window.metahubDesktop:void 0)?.appVersion?.().then($).catch(()=>$(null)),J?.installedVersion().then(G).catch(()=>G(null))},[]),Z0(()=>{if(K==="idle"&&q&&W&&A9(W,q)>0)Y("staged"),Z?.(!0)},[q,W]);let y=()=>{if(q&&W)return A9(W,q)>0?W:q;return W??q},v=()=>!!(q&&W&&A9(W,q)>0),V=async()=>{Y("checking"),w("");try{let{latest:P}=await J.check(),A=y();if(P&&(!A||A9(P,A)>0))H(P),Y("available"),Z?.(!0);else U0("已是最新版本"),Y(v()?"staged":"idle")}catch(P){w(P.message),Y("error")}},I=async()=>{Y("downloading"),w("");try{let P=await J.download();if(P)G(P),Y("staged"),Z?.(!0),U0(`已下载 v${P}`);else U0("已是最新版本"),Y(v()?"staged":"idle")}catch(P){w(P.message),Y("error")}},N=null;if(J)switch(K){case"checking":N=z("span",{class:"ver-act","aria-disabled":"true",children:"检查中…"},void 0,!1,void 0,this);break;case"downloading":N=z("span",{class:"ver-act","aria-disabled":"true",children:"下载中…"},void 0,!1,void 0,this);break;case"available":N=z("span",{class:"ver-up",children:[z("span",{class:"ver-dot pulse"},void 0,!1,void 0,this),z("span",{children:["新版本 ",z("span",{class:"ver-num",children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"ver-act accent",onClick:I,title:`下载并更新到 v${F}`,children:"下载"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;case"staged":N=z("span",{class:"ver-up",children:[z("span",{class:"ver-dot pulse"},void 0,!1,void 0,this),z("span",{children:[z("span",{class:"ver-num",children:W},void 0,!1,void 0,this)," 待重启"]},void 0,!0,void 0,this),z("button",{class:"ver-act accent",onClick:()=>void J.restart(),title:`重启应用以更新到 v${W}`,children:"重启"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;case"error":N=z("span",{class:"ver-up err",children:[z("span",{class:"ver-msg",children:"检查失败"},void 0,!1,void 0,this),z("button",{class:"ver-act",onClick:V,title:C||"重试",children:"重试"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);break;default:N=z("button",{class:"ver-act",onClick:V,children:"检查更新"},void 0,!1,void 0,this)}return z("div",{class:"set-footer",children:[Q&&z("span",{children:["App ",z("span",{class:"ver-num",children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q&&q&&z("span",{class:"set-footer-sep",children:"·"},void 0,!1,void 0,this),q&&z("span",{children:["Core ",z("span",{class:"ver-num",children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N&&(q||Q)&&z("span",{class:"set-footer-sep",children:"·"},void 0,!1,void 0,this),N]},void 0,!0,void 0,this)}var r1="CommandOrControl+Shift+Space";function Tz(Z){if(["Control","Meta","Alt","Shift"].includes(Z.key))return null;let J=[];if(Z.metaKey||Z.ctrlKey)J.push("CommandOrControl");if(Z.altKey)J.push("Alt");if(Z.shiftKey)J.push("Shift");let Q=Z.key;if(Q===" ")Q="Space";else if(Q.startsWith("Arrow"))Q=Q.slice(5);else if(Q.length===1)Q=Q.toUpperCase();if(J.length===0)return null;return J.push(Q),J.join("+")}function a6(Z){let J=typeof window<"u"&&window.metahubDesktop?.platform==="darwin";return Z.replace("CommandOrControl",J?"⌘":"Ctrl").replace("Alt",J?"⌥":"Alt").replace("Shift",J?"⇧":"Shift").split("+").join(J?" ":"+")}function bz(){let Z=window.metahubDesktop.quicknote,[J,Q]=m(r1),[$,q]=m(!1),[X,W]=m(!1);Z0(()=>{Z.getSettings().then((K)=>{Q(K.shortcut),q(K.alwaysOnTop)}).catch((K)=>U0(`加载失败:${K.message}`))},[]);let G=async(K)=>{try{let Y=await Z.setShortcut(K);Q(Y.shortcut),U0(`快捷键已设为 ${a6(Y.shortcut)}`)}catch(Y){U0(`设置失败:${Y.message}`)}},F=(K)=>{if(K.preventDefault(),K.key==="Escape"){W(!1);return}let Y=Tz(K);if(!Y)return;W(!1),G(Y)},H=async()=>{let K=!$;q(K);try{q(await Z.setAlwaysOnTop(K))}catch(Y){q(!K),U0(`设置失败:${Y.message}`)}};return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"快速笔记"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"用全局快捷键随时唤起小窗记录想法。小窗也可从菜单栏图标打开。"},void 0,!1,void 0,this),z("div",{class:"qn-set-row",children:[z("div",{class:"qn-set-main",children:[z("div",{class:"qn-set-name",children:"唤起快捷键"},void 0,!1,void 0,this),z("div",{class:"qn-set-desc",children:"点击下方按钮,然后按下你想用的组合键。"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-secondary qn-shortcut"+(X?" capturing":""),onClick:()=>W(!0),onBlur:()=>W(!1),onKeyDown:X?F:void 0,children:X?"按下组合键…":a6(J)},void 0,!1,void 0,this),J!==r1&&z("button",{class:"btn btn-ghost",title:"重置默认",onClick:()=>void G(r1),children:"重置"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"qn-set-row",children:[z("div",{class:"qn-set-main",children:[z("div",{class:"qn-set-name",children:"默认始终置顶"},void 0,!1,void 0,this),z("div",{class:"qn-set-desc",children:"小窗浮在其他窗口之上;也可在小窗内用 \uD83D\uDCCC 按钮切换。"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn "+($?"btn-primary":"btn-secondary"),"aria-pressed":$,onClick:()=>void H(),children:$?"已开启":"已关闭"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function l6(Z){if(!Z)return"从未";return new Date(Z).toLocaleString()}function gz(){let[Z,J]=m(null),Q=()=>p.listPeers().then(J).catch((H)=>U0(`加载失败:${H.message}`));Z0(()=>{Q()},[]);let $=async()=>{try{let H=await p.newPairingCode();n0(z(jz,{code:H.code,exp:H.exp},void 0,!1,void 0,this))}catch(H){U0(`生成失败:${H.message}`)}},q=()=>n0(z(Dz,{onDone:()=>{u0(),Q()}},void 0,!1,void 0,this)),X=async(H)=>{try{let K=await p.syncPeer(H.url);U0(K.ok?`已同步:推送 ${K.pushed},拉取 ${K.pulled}`:`同步失败:${K.error}`),Q()}catch(K){U0(`同步失败:${K.message}`)}},W=async(H)=>{await p.updatePeer(H.url,{enabled:!H.enabled}).catch((K)=>U0(K.message)),Q()},G=async(H)=>{if(!await b0({title:"移除同步设备",message:`确定移除 ${H.url}?将停止与该设备的数据同步。`,confirmLabel:"移除",danger:!0}))return;await p.removePeer(H.url).catch((Y)=>U0(Y.message)),Q()},F=(H,K)=>w0(H,(Y)=>z(a,{children:[z(r,{icon:"share",label:"立即同步",onClick:()=>{Y(),X(K)}},void 0,!1,void 0,this),z(r,{icon:K.enabled?"eyeOff":"check",label:K.enabled?"禁用":"启用",onClick:()=>{Y(),W(K)}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"移除",danger:!0,onClick:()=>{Y(),G(K)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this));return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"同步设备"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"与其他设备配对,自动双向同步数据。在对方设备生成配对码,然后在此添加。"},void 0,!1,void 0,this),z("div",{class:"peer-actions",children:[z("button",{class:"btn btn-primary",onClick:q,children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this)," 添加设备"]},void 0,!0,void 0,this),z("button",{class:"btn btn-secondary",onClick:$,children:[z(b,{name:"link",cls:"ico sm"},void 0,!1,void 0,this)," 生成本机配对码"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"peer-list",children:Z==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):Z.length===0?z("div",{class:"muted",children:"还没有配对的设备。"},void 0,!1,void 0,this):Z.map((H)=>z("div",{class:"peer-row",children:[z("span",{class:"peer-dot"+(H.enabled?H.last_status==="error"?" err":" on":" off")},void 0,!1,void 0,this),z("div",{class:"peer-main",children:[z("div",{class:"peer-url",children:H.label||H.url},void 0,!1,void 0,this),z("div",{class:"peer-sub",children:[H.enabled?"已启用":"已禁用"," · 最近同步 ",l6(H.last_sync_at),H.last_status==="error"&&H.last_error?` · 错误:${H.last_error}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-ghost peer-menu",onClick:(K)=>F(K,H),children:z(b,{name:"dots",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H.url,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function xz(){let[Z,J]=m(null),Q=()=>p.listGrants().then(J).catch((q)=>U0(`加载失败:${q.message}`));Z0(()=>{Q()},[]);let $=async(q)=>{if(!await b0({title:"吊销凭据",message:`吊销后,持有此凭据的设备${q.peer_url?`(${q.peer_url})`:""}将无法再同步进本机。`,confirmLabel:"吊销",danger:!0}))return;await p.revokeGrant(q.token).catch((W)=>U0(W.message)),Q()};return z("div",{class:"set-section",children:[z("div",{class:"set-section-head",children:"已授权设备"},void 0,!1,void 0,this),z("div",{class:"set-section-desc",children:"本机签发、允许其他设备同步进来的凭据。吊销即断开对方的入站访问。"},void 0,!1,void 0,this),z("div",{class:"peer-list",children:Z==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):Z.length===0?z("div",{class:"muted",children:"还没有签发任何凭据。"},void 0,!1,void 0,this):Z.map((q)=>z("div",{class:"peer-row",children:[z("span",{class:"peer-dot on"},void 0,!1,void 0,this),z("div",{class:"peer-main",children:[z("div",{class:"peer-url",children:q.peer_url||"(未知地址)"},void 0,!1,void 0,this),z("div",{class:"peer-sub",children:[q.token.slice(0,8),"… · 签发于 ",l6(q.created_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-ghost peer-menu",title:"吊销",onClick:()=>$(q),children:z(b,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},q.token,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function jz({code:Z,exp:J}){let[Q,$]=m(Math.max(0,Math.round((J-Date.now())/1000)));Z0(()=>{let W=setInterval(()=>$(Math.max(0,Math.round((J-Date.now())/1000))),1000);return()=>clearInterval(W)},[J]);let q=Math.floor(Q/60),X=String(Q%60).padStart(2,"0");return z(Z9,{title:"本机配对码",sub:"在另一台设备上输入此服务器地址和下面的配对码即可配对。配对码一次性使用。",footer:z("button",{class:"btn btn-primary",onClick:u0,children:"完成"},void 0,!1,void 0,this),children:[z("div",{class:"pair-code",children:Z},void 0,!1,void 0,this),z("div",{class:"muted",style:{textAlign:"center",marginTop:8},children:Q>0?`${q}:${X} 后过期`:"已过期,请重新生成"},void 0,!1,void 0,this),z("button",{class:"btn btn-secondary",style:{width:"100%",marginTop:12},onClick:()=>{navigator.clipboard?.writeText(Z),U0("已复制配对码")},children:[z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this)," 复制"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Dz({onDone:Z}){let[J,Q]=m(""),[$,q]=m(""),[X,W]=m(location.origin),[G,F]=m(!1),H=async()=>{if(!J.trim()||!$.trim()){U0("地址和配对码必填");return}F(!0);try{let K=await p.addPeerByPairing({url:J.trim(),code:$.trim(),self_url:X.trim()||void 0});await p.syncPeer(K.url).catch(()=>{}),U0(`已配对 ${K.url}`),Z()}catch(K){U0(`配对失败:${K.message}`),F(!1)}};return z(Z9,{title:"添加同步设备",sub:"输入对方 Metahub 服务器的地址,以及它生成的一次性配对码。",footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:u0,disabled:G,children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:H,disabled:G,children:G?"配对中…":"配对"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{class:"field-label",children:"对方服务器地址"},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,placeholder:"http://192.168.1.10:7777",value:J,onInput:(K)=>Q(K.target.value)},void 0,!1,void 0,this),z("div",{class:"field-label",children:"配对码"},void 0,!1,void 0,this),z("input",{class:"text-input",placeholder:"对方「生成本机配对码」得到的码",value:$,onInput:(K)=>q(K.target.value),onKeyDown:(K)=>K.key==="Enter"&&H()},void 0,!1,void 0,this),z("div",{class:"field-label",children:"本机可达地址(可选)"},void 0,!1,void 0,this),z("input",{class:"text-input",placeholder:"留空则仅本机主动同步",value:X,onInput:(K)=>W(K.target.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var o9=(Z)=>location.origin+"/sites/"+Z+"/",hz=(Z)=>(/\.([a-z0-9]+)$/i.exec(Z)?.[1]??"").toLowerCase(),t6=(Z)=>Z.startsWith("image/");function o6(Z){let J=Number(Z.split("-")[0]);if(!Number.isFinite(J)||J<=0)return"—";return new Date(J).toISOString().slice(0,10)}function mz(Z){let J=hz(Z.path);if(["html","htm","js","mjs","css","json","xml"].includes(J))return"code";if(t6(Z.content_type))return"file";if(["md","txt"].includes(J))return"text";return"file"}function s9(Z){navigator.clipboard?.writeText(Z).catch(()=>{}),U0("已复制")}function s6(){let[Z,J]=m(null),[Q,$]=m(null),[q,X]=m(null),W=()=>p.listSites().then((H)=>{J(H),$((K)=>K?H.find((Y)=>Y.id===K.id)??null:null)}).catch((H)=>U0(`加载失败:${H.message}`));Z0(()=>{W()},[]);let G=()=>n0(z(uz,{onCreated:(H)=>{W(),$(H)}},void 0,!1,void 0,this)),F=(H,K,Y)=>{w0(H,(C)=>z(a,{children:[z(r,{icon:"externalLink",label:"复制访问地址",onClick:()=>{C(),s9(o9(K.name))}},void 0,!1,void 0,this),z(r,{icon:"settings",label:"修改标题…",onClick:async()=>{C();let w=await J9({title:"修改标题",label:"标题",value:K.title??K.name});if(w==null)return;try{await p.updateSite(K.id,{title:w})}catch(y){return U0(y.message)}W()}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除站点",danger:!0,onClick:async()=>{if(C(),!await b0({title:"删除站点?",message:`「${K.name}」及其 ${K.file_count} 个文件将被删除。`,confirmLabel:"删除",danger:!0}))return;try{await p.deleteSite(K.id)}catch(y){return U0(y.message)}if(Y)$(null);W()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))};return z("div",{class:"db",children:[z("div",{class:"db-head",children:[z("div",{class:"db-icon",children:"\uD83C\uDF10"},void 0,!1,void 0,this),z("div",{children:[z("div",{class:"db-title",children:"站点管理"},void 0,!1,void 0,this),z("div",{class:"db-desc",children:"静态文件站点 · 通过 /sites/<name>/ 对外提供,随同步无冲突复制"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"toolbar",children:[z("div",{class:"spacer",style:{flex:1}},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:G,children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建站点"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z==null?z("div",{class:"muted",style:{padding:20},children:"加载中…"},void 0,!1,void 0,this):Z.length===0?z("div",{class:"site-empty",children:[z("div",{class:"ei",children:"\uD83C\uDF10"},void 0,!1,void 0,this),z("div",{class:"et",children:"还没有站点"},void 0,!1,void 0,this),z("div",{class:"ed",children:"站点是一个命名文件桶,发布后可通过 /sites/<name>/ 直接访问。"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:G,children:[z(b,{name:"plus",cls:"ico sm"},void 0,!1,void 0,this),"新建站点"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):z(a,{children:[z("div",{class:"sites-grid",children:Z.map((H)=>z("div",{class:"site-card",onClick:()=>$(H),children:[z("div",{class:"site-card-head",children:[z("span",{class:"si",children:z(b,{name:"globe"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"site-card-id",children:[z("div",{class:"slug",children:H.name},void 0,!1,void 0,this),z("div",{class:"ttl"+(H.title?"":" muted"),children:H.title||"未命名站点"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"site-addr",title:"点击复制访问地址",onClick:(K)=>{K.stopPropagation(),s9(o9(H.name))},children:[z(b,{name:"link",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:o9(H.name)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"site-card-meta",children:[z("span",{children:[z("b",{children:H.file_count},void 0,!1,void 0,this)," 文件"]},void 0,!0,void 0,this),z("span",{class:"dot",children:"·"},void 0,!1,void 0,this),z("span",{children:o6(H.created_hlc)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"site-card-foot",children:[z("button",{class:"btn btn-secondary",style:{flex:1},onClick:(K)=>{K.stopPropagation(),X(H)},children:[z(b,{name:"globe",cls:"ico sm"},void 0,!1,void 0,this),"访问"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"更多",onClick:(K)=>{K.stopPropagation(),F(K,H)},children:z(b,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this),z("div",{class:"gridfoot",children:[z("span",{children:["共 ",Z.length," 个站点"]},void 0,!0,void 0,this),z("span",{children:[Z.reduce((H,K)=>H+K.file_count,0)," 个文件"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q&&z(pz,{site:Q,onClose:()=>$(null),onVisit:()=>X(Q),onMenu:(H)=>F(H,Q,!0),onChanged:W},void 0,!1,void 0,this),q&&z(Ez,{site:q,onClose:()=>X(null)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function uz({onCreated:Z}){let[J,Q]=m(""),[$,q]=m(""),X=async()=>{let W=J.trim().toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"");if(!W)return U0("请填写站点名称");try{let G=await p.createSite({name:W,title:$.trim()||void 0});u0(),U0(`已创建站点「${W}」`),Z(G)}catch(G){U0(G.message)}};return z(Z9,{title:"新建站点",sub:"创建一个命名文件桶,随同步无冲突复制。",footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:u0,children:"取消"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:X,children:"创建"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{class:"field-label",children:"名称(slug)"},void 0,!1,void 0,this),z("input",{class:"text-input",autofocus:!0,value:J,placeholder:"例如:docs、demo、status",onInput:(W)=>Q(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")X()}},void 0,!1,void 0,this),z("div",{class:"field-label",children:"标题(可选)"},void 0,!1,void 0,this),z("input",{class:"text-input",value:$,placeholder:"人类可读的标题",onInput:(W)=>q(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")X()}},void 0,!1,void 0,this),z("div",{class:"muted",style:{fontSize:12,marginTop:10},children:["将通过 ",z("span",{style:{fontFamily:"var(--mono)"},children:"/sites/<名称>/"},void 0,!1,void 0,this)," 对外提供。"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pz({site:Z,onClose:J,onVisit:Q,onMenu:$,onChanged:q}){let[X,W]=m(null),G=W0(null),{open:F,close:H}=yZ(J),K=()=>p.listSiteFiles(Z.id).then(W).catch((y)=>U0(y.message));Z0(()=>{let y=!1;return W(null),p.listSiteFiles(Z.id).then((v)=>!y&&W(v)).catch((v)=>!y&&U0(v.message)),()=>{y=!0}},[Z.id]);let Y=async(y)=>{let v=y.target,V=Array.from(v.files??[]);if(v.value="",!V.length)return;let I=0;try{for(let N of V)await p.uploadSiteFile(Z.id,N.name,N),I++;U0(`已上传 ${I} 个文件`)}catch(N){U0(`已上传 ${I}/${V.length} 个,其余失败:${N.message}`)}finally{K(),q()}},C=async(y)=>{if(!await b0({title:"删除文件?",message:`「${y.path}」将从站点「${Z.name}」中删除。`,confirmLabel:"删除",danger:!0}))return;try{await p.deleteSiteFile(Z.id,y.path)}catch(V){return U0(V.message)}K(),q()},w=o9(Z.name);return z(a,{children:[z("div",{class:"scrim"+(F?" open":""),onClick:H},void 0,!1,void 0,this),z("div",{class:"peek"+(F?" open":""),children:[z("div",{class:"peek-head",children:[z("button",{class:"iconbtn",onClick:H,children:z(b,{name:"x"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{style:{flex:1,display:"flex",alignItems:"center",gap:8,minWidth:0,fontWeight:600,fontSize:14},children:[z(b,{name:"globe",cls:"ico sm"},void 0,!1,void 0,this),z("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Z.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"btn btn-secondary",onClick:()=>G.current?.click(),children:[z(b,{name:"upload",cls:"ico sm"},void 0,!1,void 0,this),"上传文件"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",title:"更多",onClick:(y)=>$(y),children:z(b,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("input",{ref:G,type:"file",multiple:!0,style:{display:"none"},onChange:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"peek-body",children:[z("h2",{style:{margin:"0 0 20px"},children:Z.title||Z.name},void 0,!1,void 0,this),z("div",{class:"acc-link",children:[z("span",{class:"url",children:w},void 0,!1,void 0,this),z("button",{title:"复制地址",onClick:()=>s9(w),children:z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"accent",title:"访问站点",onClick:Q,children:z(b,{name:"globe",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"site-meta",children:[z("span",{children:[z("b",{children:X?.length??Z.file_count},void 0,!1,void 0,this)," 个文件"]},void 0,!0,void 0,this),z("span",{children:["创建于 ",o6(Z.created_hlc)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"files-head",children:[z("span",{children:"文件"},void 0,!1,void 0,this),z("span",{children:X?.length??""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):X.length===0?z("div",{class:"site-empty",style:{marginTop:4},children:[z("div",{class:"ei",children:"\uD83D\uDCC1"},void 0,!1,void 0,this),z("div",{class:"et",children:"站点还没有文件"},void 0,!1,void 0,this),z("div",{class:"ed",children:"上传文件后即可通过站点地址访问。"},void 0,!1,void 0,this),z("button",{class:"btn btn-secondary",onClick:()=>G.current?.click(),children:[z(b,{name:"upload",cls:"ico sm"},void 0,!1,void 0,this),"上传文件"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):z("div",{children:X.map((y)=>z("div",{class:"filerow",onClick:()=>n0(z(n6,{site:Z,file:y},void 0,!1,void 0,this)),children:[z("span",{class:"fi",children:z(b,{name:mz(y),cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{class:"fpath",children:y.path},void 0,!1,void 0,this),z("span",{class:"enc-badge"+(y.encoding==="blob"?" blob":""),children:y.encoding},void 0,!1,void 0,this),z("div",{class:"facts",children:[z("button",{title:"预览",onClick:(v)=>{v.stopPropagation(),n0(z(n6,{site:Z,file:y},void 0,!1,void 0,this))},children:z(b,{name:"eye",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{title:"复制路径",onClick:(v)=>{v.stopPropagation(),s9("/sites/"+Z.name+"/"+y.path)},children:z(b,{name:"copy",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"del",title:"删除",onClick:(v)=>{v.stopPropagation(),C(y)},children:z(b,{name:"trash",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},y.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function n6({site:Z,file:J}){let Q="/sites/"+Z.name+"/"+J.path,[$,q]=m(null),X=t6(J.content_type),W=!X&&(J.encoding==="utf8"||/text\/|json|javascript|xml/.test(J.content_type));return Z0(()=>{if(!W)return;fetch(Q).then((G)=>G.text()).then(q).catch(()=>q("(无法加载内容)"))},[Q]),z(Z9,{title:J.path,sub:Q,width:680,footer:z(a,{children:[z("button",{class:"btn btn-secondary",onClick:()=>s9(Q),children:"复制路径"},void 0,!1,void 0,this),z("button",{class:"btn btn-primary",onClick:u0,children:"关闭"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[z("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center",color:"var(--muted)",fontSize:12,marginBottom:12},children:[z("span",{children:J.content_type},void 0,!1,void 0,this),z("span",{class:"enc-badge"+(J.encoding==="blob"?" blob":""),children:J.encoding},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?z("img",{src:Q,style:{maxWidth:"100%",borderRadius:"var(--radius)",border:"1px solid var(--line)"}},void 0,!1,void 0,this):W?$==null?z("div",{class:"muted",children:"加载中…"},void 0,!1,void 0,this):z("div",{class:"preview-box",children:$},void 0,!1,void 0,this):z("div",{class:"preview-bin",children:[z("div",{class:"pi",children:"\uD83D\uDCE6"},void 0,!1,void 0,this),z("div",{class:"pt",children:"二进制文件 · 在新标签打开查看"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Ez({site:Z,onClose:J}){Z0(()=>{let $=(q)=>{if(q.key==="Escape")J()};return addEventListener("keydown",$),()=>removeEventListener("keydown",$)},[]);let Q="/sites/"+Z.name+"/";return z("div",{class:"spv-scrim open",onClick:($)=>{if($.target===$.currentTarget)J()},children:z("div",{class:"spv",children:[z("div",{class:"spv-chrome",children:[z("div",{class:"spv-dots",children:[z("i",{},void 0,!1,void 0,this),z("i",{},void 0,!1,void 0,this),z("i",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("div",{class:"spv-url",children:[z(b,{name:"lock",cls:"ico sm"},void 0,!1,void 0,this),z("span",{children:o9(Z.name)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("button",{class:"spv-btn",title:"在新标签打开",onClick:()=>window.open(Q,"_blank"),children:[z(b,{name:"externalLink",cls:"ico sm"},void 0,!1,void 0,this),"新标签"]},void 0,!0,void 0,this),z("button",{class:"spv-btn icon",title:"关闭",onClick:J,children:z(b,{name:"x"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("iframe",{class:"spv-frame",src:Q,sandbox:"allow-scripts allow-same-origin"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function l1(Z){switch(Z.kind){case"db":return`#/db/${encodeURIComponent(Z.id)}`;case"doc":return`#/doc/${encodeURIComponent(Z.id)}`;case"search":return`#/search?q=${encodeURIComponent(Z.q)}`;case"settings":return"#/settings";case"sites":return"#/sites";case"empty":return"#/"}}function n1(Z){if(!Z.startsWith("#/"))return{kind:"empty"};let[J="",Q=""]=Z.slice(2).split("?",2),[$,q=""]=J.split("/",2);try{if($==="db"&&q)return{kind:"db",id:decodeURIComponent(q)};if($==="doc"&&q)return{kind:"doc",id:decodeURIComponent(q)};if($==="search"){let X=new URLSearchParams(Q).get("q");if(X)return{kind:"search",q:X}}if($==="settings")return{kind:"settings"};if($==="sites")return{kind:"sites"}}catch{}return{kind:"empty"}}var e6="mh-quicknote-last",Z7="mh-quicknote-parent",J7="Quick Notes";function cz(Z,J){return(J.created_hlc??"").localeCompare(Z.created_hlc??"")}async function iz(){let Z=localStorage.getItem(Z7);if(Z)try{return await p.getDocument(Z),Z}catch{}let $=(await p.listDocuments()).find((q)=>q.parent_id==null&&q.title===J7)?.id??(await p.createDocument({title:J7})).id;return localStorage.setItem(Z7,$),$}function Q7(){let[Z,J]=m(null),[Q,$]=m([]),[q,X]=m(null),[W,G]=m(""),[F,H]=m(!1),K=W0(null),Y=typeof window<"u"?window.metahubDesktop?.quicknote:void 0,C=U9(async(P)=>{let A=(await p.listDocumentsByParent(P)).sort(cz);return $(A),A},[]);Z0(()=>{if(!Z)return;let P,A=()=>{clearTimeout(P),P=setTimeout(()=>void C(Z),80)};return document.addEventListener(y9,A),()=>{clearTimeout(P),document.removeEventListener(y9,A)}},[Z,C]);let w=U9(async(P)=>{let A=await p.createDocument({title:"",parent_id:P});return await C(P),A.id},[C]);Z0(()=>{(async()=>{try{let P=await iz();J(P);let A=await C(P),O=localStorage.getItem(e6),L=O&&A.some((D)=>D.id===O)&&O||A[0]?.id||await w(P);X(L)}catch(P){G(String(P.message))}})()},[C,w]),Z0(()=>{if(q)localStorage.setItem(e6,q)},[q]),Z0(()=>{Y?.getAlwaysOnTop().then(H).catch(()=>{})},[Y]),Z0(()=>{if(!Y)return;let P=(A)=>{if(A.key==="Escape")Y.hide()};return addEventListener("keydown",P),()=>removeEventListener("keydown",P)},[Y]);let y=async()=>{if(!Z)return;try{X(await w(Z))}catch(P){G(String(P.message))}},v=async()=>{if(!Y)return;let P=!F;H(P);try{H(await Y.setAlwaysOnTop(P))}catch{H(!P)}},V=async()=>{if(!q||!Z)return;if(!await b0({title:"删除笔记?",message:"该快速笔记将被删除。",confirmLabel:"删除",danger:!0}))return;await p.deleteDocument(q);let A=await C(Z);X(A[0]?.id??await w(Z))},I=(P)=>{w0(P,(A)=>z(a,{children:[z(T0,{children:"快速笔记"},void 0,!1,void 0,this),Q.length===0&&z("div",{class:"lbl",children:"还没有笔记"},void 0,!1,void 0,this),Q.map((O)=>z(r,{icon:"file",label:O.title||"无标题",checked:O.id===q,onClick:()=>{A(),X(O.id)}},O.id,!1,void 0,this)),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"plus",label:"新建笔记",onClick:()=>{A(),y()}},void 0,!1,void 0,this),q&&z(r,{icon:"trash",label:"删除当前笔记",danger:!0,onClick:()=>{A(),V()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),{minWidth:220})},N=Q.find((P)=>P.id===q)?.title;return z("div",{class:"qn",children:[z("div",{class:"qn-bar",children:[z("span",{class:"qn-brand",children:N||"快速笔记"},void 0,!1,void 0,this),z("div",{class:"qn-actions",children:[z("button",{class:"iconbtn",title:"新建笔记",onClick:()=>void y(),children:z(b,{name:"plus"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{class:"iconbtn",title:"笔记列表",onClick:I,children:z(b,{name:"list"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&z("button",{class:"iconbtn"+(F?" active":""),title:F?"取消置顶":"始终置顶",onClick:()=>void v(),children:z(b,{name:"pin"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&z("div",{class:"error-bar",onClick:()=>G(""),children:["⚠ ",W,"(点击关闭)"]},void 0,!0,void 0,this),z("div",{class:"qn-body",children:q?z(hZ,{docId:q,onError:G,onHandle:(P)=>K.current=P},q,!1,void 0,this):z("div",{class:"empty",children:z("div",{children:"加载中…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z(BZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var dz=/[",\r\n]/;function az(Z){return dz.test(Z)?`"${Z.replace(/"/g,'""')}"`:Z}function z7(Z){return Z.map((J)=>J.map(az).join(",")).join(`
115
+ `)}function t1(Z,J){let Q=J.startsWith(".")?J:"."+J,$=Z.trim().replace(/[\\/:*?"<>|\x00-\x1f]/g,"-").replace(/\s+/g," ").replace(/^\.+$/,"").slice(0,90)||"untitled";return $.toLowerCase().endsWith(Q.toLowerCase())?$:$+Q}function o1(Z,J,Q){let $=URL.createObjectURL(new Blob([J],{type:Q})),q=document.createElement("a");q.href=$,q.download=Z,document.body.appendChild(q),q.click(),q.remove(),setTimeout(()=>URL.revokeObjectURL($),0)}function $7(Z,J){let Q=["id",...Z.map((q)=>q.name)],$=J.map((q)=>[q.id,...Z.map((X)=>rz(q.values[X.name]))]);return z7([Q,...$])}function rz(Z){if(Z==null)return"";if(typeof Z==="boolean")return Z?"true":"false";if(typeof Z==="object")return JSON.stringify(Z);return String(Z)}function lz(){let[Z,J]=m(()=>typeof window<"u"&&window.matchMedia(UZ).matches);return Z0(()=>{let Q=window.matchMedia(UZ),$=()=>J(Q.matches);return Q.addEventListener("change",$),()=>Q.removeEventListener("change",$)},[]),Z}function nz(){let[Z,J]=m([]),[Q,$]=m([]),[q,X]=m(()=>n1(location.hash)),[W,G]=m(""),[F,H]=m(!1),[K,Y]=m(268),[C,w]=m("blocks"),[y,v]=m(!1),[V,I]=m(!1),N=W0(null),P=lz(),A=U9((B)=>G(B),[]),O=U9((B)=>{N.current=B},[]),L=U9(async()=>{let[B,M]=await Promise.all([p.listDatabases(),p.listDocuments()]);J(B),$(M),v(!0)},[]);Z0(()=>{L().catch((B)=>A(String(B.message)))},[L]),Z0(()=>{let B,M=()=>{clearTimeout(B),B=setTimeout(()=>L().catch((x)=>A(String(x.message))),80)};return document.addEventListener(y9,M),()=>{clearTimeout(B),document.removeEventListener(y9,M)}},[L,A]),Z0(()=>{let B=typeof window<"u"?window.metahubDesktop?.coreUpdate:void 0;if(!B)return;Promise.all([p.version().then((M)=>M.version).catch(()=>null),B.installedVersion().catch(()=>null)]).then(([M,x])=>{if(M&&x&&A9(x,M)>0)I(!0)})},[]);let D=(B,M)=>{let x=l1(B);if(location.hash!==x)history[M?.replace?"replaceState":"pushState"](null,"",x);X(B)};Z0(()=>{if(location.hash&&!location.hash.startsWith("#/"))history.replaceState(null,"","#/");let B=()=>X(n1(location.hash));return window.addEventListener("hashchange",B),()=>window.removeEventListener("hashchange",B)},[]);let g=()=>p.createDocument({title:""}).then((B)=>D({kind:"doc",id:B.id})).catch((B)=>A(String(B.message))),h=q.kind==="db"?Z.find((B)=>B.id===q.id):void 0,l=q.kind==="doc"?Q.find((B)=>B.id===q.id):void 0,c=q.kind==="doc"?q.id:null;Z0(()=>{w("blocks")},[c]);let Y0=q.kind!=="empty",Q0=W0(0);Z0(()=>{let B=P&&Y0;if(B&&!document.body.classList.contains("mobile-content"))Q0.current=window.scrollY;if(document.body.classList.toggle("mobile",P),document.body.classList.toggle("mobile-content",B),mZ(),P)window.scrollTo(0,B?0:Q0.current)},[P,Y0,q]),Z0(()=>{let B=(M)=>{if((M.metaKey||M.ctrlKey)&&M.key.toLowerCase()==="k")M.preventDefault(),document.querySelector(".sb-search input")?.focus()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[]),Z0(()=>{let B=window.matchMedia("(prefers-color-scheme: dark)"),M=()=>{a1(),mZ()};return B.addEventListener("change",M),()=>B.removeEventListener("change",M)},[]);let $0=(B)=>{let M=N.current?.snapshotMarkdown();N.current?.flushSave(),(M==null?p.getDocument(B.id).then((o)=>o.body??""):Promise.resolve(M)).then((o)=>o1(t1(B.title||B.id,".md"),o,"text/markdown;charset=utf-8")).catch((o)=>A(String(o.message)))},y0=(B)=>{Promise.all([p.listProperties(B.id),p.listRecords(B.id)]).then(([M,x])=>o1(t1(B.name||B.id,".csv"),$7(M,x),"text/csv;charset=utf-8")).catch((M)=>A(String(M.message)))},S=(B)=>{w0(B,(M)=>z(a,{children:[z(r,{icon:"link",label:"复制链接",onClick:()=>{M(),navigator.clipboard.writeText(location.origin+location.pathname+l1(q)).then(()=>U0("链接已复制")).catch((x)=>A(String(x.message)))}},void 0,!1,void 0,this),q.kind==="doc"&&l&&z(r,{icon:"download",label:"导出 Markdown",onClick:()=>{M(),$0(l)}},void 0,!1,void 0,this),q.kind==="db"&&h&&z(r,{icon:"download",label:"导出 CSV",onClick:()=>{M(),y0(h)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))},f=(B)=>{if(q.kind==="doc"&&l)w0(B,(M)=>z(a,{children:[z(r,{icon:"code",label:C==="source"?"块方式显示":"代码方式显示",checked:C==="source",onClick:()=>{M(),N.current?.setMode(C==="source"?"blocks":"source")}},void 0,!1,void 0,this),z(r,{icon:"download",label:"导出 Markdown",onClick:()=>{M(),$0(l)}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"settings",label:"重命名…",onClick:async()=>{M();let x=await J9({title:"重命名文档",value:l.title});if(x)await p.updateDocument(l.id,{title:x})}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除文档",danger:!0,onClick:async()=>{if(M(),await b0({title:"删除文档?",message:`「${l.title||"无标题"}」将被删除。`,confirmLabel:"删除",danger:!0}))await p.deleteDocument(l.id),D({kind:"empty"},{replace:!0})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this));else if(q.kind==="db"&&h)w0(B,(M)=>z(a,{children:[z(r,{icon:"download",label:"导出 CSV",onClick:()=>{M(),y0(h)}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"settings",label:"重命名…",onClick:async()=>{M();let x=await J9({title:"重命名数据库",value:h.name});if(x&&x!==h.name)await p.updateDatabase(h.id,{name:x})}},void 0,!1,void 0,this),z(M0,{},void 0,!1,void 0,this),z(r,{icon:"trash",label:"删除数据库",danger:!0,onClick:async()=>{if(M(),await b0({title:"删除数据库?",message:`「${h.name}」及其所有记录将被永久删除。`,confirmLabel:"删除",danger:!0}))await p.deleteDatabase(h.id),D({kind:"empty"},{replace:!0})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this))};return z(a,{children:[z(V8,{databases:Z,docs:Q,view:q,navigate:D,width:K,collapsed:F,onResize:Y,onCollapse:()=>H(!0),updatePending:V,onError:A},void 0,!1,void 0,this),z("div",{class:"main",children:[z("div",{class:"topbar"+(q.kind==="empty"?" bare":""),children:[z("button",{class:"iconbtn hamburger"+(F?" show-collapsed":""),title:P?"返回":F?"展开侧栏":"菜单",onClick:()=>P?D({kind:"empty"}):H(!1),children:z(b,{name:P?"arrowLeft":"panelLeft"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{class:"crumb",children:[q.kind==="doc"&&z(a,{children:[z("span",{class:"emoji",children:z(b,{name:"file",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{children:l?.title||"无标题"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.kind==="db"&&z(a,{children:[z("span",{class:"emoji",children:h?.icon||"\uD83D\uDDC2️"},void 0,!1,void 0,this),z("span",{children:h?.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.kind==="search"&&z("span",{children:["搜索:“",q.q,"”"]},void 0,!0,void 0,this),q.kind==="settings"&&z(a,{children:[z("span",{class:"emoji",children:z(b,{name:"settings",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{children:"设置"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.kind==="sites"&&z(a,{children:[z("span",{class:"emoji",children:z(b,{name:"globe",cls:"ico sm"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("span",{children:"站点管理"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(q.kind==="doc"||q.kind==="db")&&z(a,{children:[z("button",{class:"btn btn-ghost",onClick:S,children:[z(b,{name:"share",cls:"ico sm"},void 0,!1,void 0,this),"分享"]},void 0,!0,void 0,this),z("button",{class:"iconbtn",onClick:f,children:z(b,{name:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&z("div",{class:"error-bar",onClick:()=>G(""),children:["⚠ ",W,"(点击关闭)"]},void 0,!0,void 0,this),z("div",{class:"content",children:[q.kind==="empty"&&z(tz,{onNewDoc:g},void 0,!1,void 0,this),q.kind==="db"&&h&&z(p8,{db:h,onError:A},h.id,!1,void 0,this),q.kind==="db"&&!h&&z("div",{class:"empty",children:y?"数据库不存在或已被删除。":"加载中…"},void 0,!1,void 0,this),q.kind==="doc"&&z(hZ,{docId:q.id,onError:A,onModeChange:w,onHandle:O},q.id,!1,void 0,this),q.kind==="search"&&z(sz,{q:q.q,onOpenDoc:(B)=>D({kind:"doc",id:B}),onOpenDb:(B)=>D({kind:"db",id:B})},void 0,!1,void 0,this),q.kind==="settings"&&z(r6,{onUpdatePending:I},void 0,!1,void 0,this),q.kind==="sites"&&z(s6,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z(BZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tz({onNewDoc:Z}){return z("div",{class:"empty",children:[z("svg",{class:"estate-art",viewBox:"0 0 220 190",fill:"none","aria-hidden":"true",children:[z("ellipse",{class:"kg-ground ground",cx:"110",cy:"176",rx:"62",ry:"8"},void 0,!1,void 0,this),z("circle",{class:"kg-glow fill-soft",cx:"116",cy:"88",r:"42"},void 0,!1,void 0,this),z("g",{class:"kg-plant",children:[z("path",{class:"kg-stem stroke-a draw",pathLength:"100",d:"M110 134 C110 117 108 106 113 92 C116 83 122 77 128 72"},void 0,!1,void 0,this),z("g",{class:"kg-leaf l1",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M108 108 C90 100 86 88 88 80 C102 80 111 90 108 108 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("g",{class:"kg-leaf l2",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M118 90 C133 83 144 86 150 94 C139 105 125 104 118 90 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("g",{class:"kg-leaf l3",children:z("g",{class:"kg-grow",children:z("path",{class:"fill-a",d:"M128 72 C128 57 136 48 146 45 C150 58 144 69 128 72 Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("rect",{class:"kg-cardB fill-soft",x:"76",y:"124",width:"68",height:"44",rx:"8",transform:"rotate(7 110 146)"},void 0,!1,void 0,this),z("g",{class:"kg-cardA",children:[z("rect",{class:"fill-surface stroke",x:"66",y:"128",width:"76",height:"46",rx:"9",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-a",x:"74",y:"136",width:"18",height:"18",rx:"5",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-soft",x:"98",y:"139",width:"34",height:"6",rx:"3",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this),z("rect",{class:"fill-soft",x:"98",y:"150",width:"24",height:"6",rx:"3",transform:"rotate(-5 104 151)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("circle",{class:"kg-particle p1 fill-a",cx:"44",cy:"62",r:"2.6"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p2 fill-soft",cx:"178",cy:"74",r:"3"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p3 fill-a",cx:"40",cy:"120",r:"2"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p4 fill-soft",cx:"182",cy:"126",r:"2.4"},void 0,!1,void 0,this),z("circle",{class:"kg-particle p5 fill-a",cx:"150",cy:"44",r:"2.2"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z("p",{class:"estate-title",children:"空空如也"},void 0,!1,void 0,this),z("p",{class:"estate-hint",children:"从左侧选择一个数据库或文档,或新建一个开始。"},void 0,!1,void 0,this),z("button",{class:"estate-link",onClick:Z,children:"+ 新建文档"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function oz({text:Z}){let J=Z.split(/\[([^\[\]]*)\]/g);return z(a,{children:J.map((Q,$)=>$%2?z("mark",{children:Q},$,!1,void 0,this):Q)},void 0,!1,void 0,this)}function sz({q:Z,onOpenDoc:J,onOpenDb:Q}){let[$,q]=m(null);return Z0(()=>{q(null),p.search(Z).then(q).catch(()=>q([]))},[Z]),z("div",{class:"db",children:[z("div",{class:"db-title",style:{marginBottom:14},children:["搜索:“",Z,"”"]},void 0,!0,void 0,this),$===null&&z("p",{class:"muted",children:"搜索中…"},void 0,!1,void 0,this),$?.length===0&&z("p",{class:"muted",children:"没有匹配结果。"},void 0,!1,void 0,this),$?.map((X)=>z("div",{class:"search-hit",onClick:()=>X.type==="document"?J(X.id):X.database_id&&Q(X.database_id),children:[z("strong",{children:X.title||X.id},void 0,!1,void 0,this)," ",z("span",{class:"muted",children:X.type==="document"?"文档":"记录"},void 0,!1,void 0,this),z("div",{class:"muted",children:z(oz,{text:X.snippet},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},X.id,!0,void 0,this))]},void 0,!0,void 0,this)}if(typeof window<"u"&&window.metahubDesktop){if(document.body.classList.add("desktop"),window.metahubDesktop.platform==="darwin")document.body.classList.add("desktop-mac")}if(location.hash==="#quick"&&typeof window<"u"&&window.metahubDesktop)document.body.classList.add("quicknote"),tZ(z(Q7,{},void 0,!1,void 0,this),document.getElementById("app"));else tZ(z(nz,{},void 0,!1,void 0,this),document.getElementById("app"));