Viewing File: /usr/local/cpanel/base/frontend/jupiter/koality/_nuxt/kkTDvnL6.js

const y=[[/^(<!--)(.+)(-->)$/,!1],[/^(\/\*)(.+)(\*\/)$/,!1],[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/,!0],[/^(\*)(.+)$/,!0]];function k(t,i,n){const o=[];for(const l of t){if(n==="v3"){const s=l.children.flatMap((r,e)=>{if(r.type!=="element")return r;const a=r.children[0];if(a.type!=="text")return r;const h=e===l.children.length-1;if(!x(a.value,h))return r;const u=a.value.split(/(\s+\/\/)/);if(u.length<=1)return r;let g=[u[0]];for(let d=1;d<u.length;d+=2)g.push(u[d]+(u[d+1]||""));return g=g.filter(Boolean),g.length<=1?r:g.map(d=>({...r,children:[{type:"text",value:d}]}))});s.length!==l.children.length&&(l.children=s)}const c=l.children;let m=c.length-1;n==="v1"?m=0:i&&(m=c.length-2);for(let s=Math.max(m,0);s<c.length;s++){const r=c[s];if(r.type!=="element")continue;const e=r.children.at(0);if(e?.type!=="text")continue;const a=s===c.length-1,h=x(e.value,a);if(h)if(i&&!a&&s!==0){const f=v(c[s-1],"{")&&v(c[s+1],"}");o.push({info:h,line:l,token:r,isLineCommentOnly:c.length===3&&r.children.length===1,isJsxStyle:f})}else o.push({info:h,line:l,token:r,isLineCommentOnly:c.length===1&&r.children.length===1,isJsxStyle:!1})}}return o}function v(t,i){if(t.type!=="element")return!1;const n=t.children[0];return n.type!=="text"?!1:n.value.trim()===i}function x(t,i){let n=t.trimStart();const o=t.length-n.length;n=n.trimEnd();const l=t.length-n.length-o;for(const[c,m]of y){if(m&&!i)continue;const s=c.exec(n);if(s)return[" ".repeat(o)+s[1],s[2],s[3]?s[3]+" ".repeat(l):void 0]}}function L(t){const i=t.match(/(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/);return i&&i[1].trim().length===0?t.slice(0,i.index):t}function A(t,i,n,o){return o==null&&(o="v3"),{name:t,code(l){const c=l.children.filter(e=>e.type==="element"),m=[];l.data??={};const s=l.data;s._shiki_notation??=k(c,["jsx","tsx"].includes(this.options.lang),o);const r=s._shiki_notation;for(const e of r){if(e.info[1].length===0)continue;let a=c.indexOf(e.line);e.isLineCommentOnly&&o!=="v1"&&a++;let h=!1;if(e.info[1]=e.info[1].replace(i,(...u)=>n.call(this,u,e.line,e.token,c,a)?(h=!0,""):u[0]),!h)continue;o==="v1"&&(e.info[1]=L(e.info[1]));const f=e.info[1].trim().length===0;if(f&&(e.info[1]=""),f&&e.isLineCommentOnly)m.push(e.line);else if(f&&e.isJsxStyle)e.line.children.splice(e.line.children.indexOf(e.token)-1,3);else if(f)e.line.children.splice(e.line.children.indexOf(e.token),1);else{const u=e.token.children[0];u.type==="text"&&(u.value=e.info.join(""))}}for(const e of m){const a=l.children.indexOf(e),h=l.children[a+1];let f=1;h?.type==="text"&&h?.value===`
`&&(f=2),l.children.splice(a,f)}}}}function C(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(t={},i="@shikijs/transformers:notation-map"){const{classMap:n={},classActivePre:o=void 0}=t;return A(i,new RegExp(`\\s*\\[!code (${Object.keys(n).map(C).join("|")})(:\\d+)?\\]`),function([l,c,m=":1"],s,r,e,a){const h=Number.parseInt(m.slice(1),10);for(let f=a;f<Math.min(a+h,e.length);f++)this.addClassToHast(e[f],n[c]);return o&&this.addClassToHast(this.pre,o),!0},t.matchAlgorithm)}function O(t={}){const{classLineAdd:i="diff add",classLineRemove:n="diff remove",classActivePre:o="has-diff"}=t;return p({classMap:{"++":i,"--":n},classActivePre:o,matchAlgorithm:t.matchAlgorithm},"@shikijs/transformers:notation-diff")}function M(t={}){const{classMap:i={error:["highlighted","error"],warning:["highlighted","warning"]},classActivePre:n="has-highlighted"}=t;return p({classMap:i,classActivePre:n,matchAlgorithm:t.matchAlgorithm},"@shikijs/transformers:notation-error-level")}function j(t={}){const{classActiveLine:i="focused",classActivePre:n="has-focused"}=t;return p({classMap:{focus:i},classActivePre:n,matchAlgorithm:t.matchAlgorithm},"@shikijs/transformers:notation-focus")}function E(t={}){const{classActiveLine:i="highlighted",classActivePre:n="has-highlighted"}=t;return p({classMap:{highlight:i,hl:i},classActivePre:n,matchAlgorithm:t.matchAlgorithm},"@shikijs/transformers:notation-highlight")}export{A as createCommentNotationTransformer,O as transformerNotationDiff,M as transformerNotationErrorLevel,j as transformerNotationFocus,E as transformerNotationHighlight,p as transformerNotationMap};
Back to Directory File Manager