"use strict";(self.webpackChunkcolor_admin=self.webpackChunkcolor_admin||[]).push([[980],{9980:($,_,c)=>{c.r(_),c.d(_,{HighlightLineNumbers:()=>D,activateLineNumbers:()=>F});var y=c(467),o=c(1360),C=c(9377),g=c(6377);function F(){const l=window,m=document,r="hljs-ln",E="hljs-ln-code",p="hljs-ln-n",N="data-line-number",O=/\r\n|\r|\n/g;function T(e){try{const t=m.querySelectorAll("code.hljs,code.nohighlight");for(const n in t)t.hasOwnProperty(n)&&(I(t[n])||v(t[n],e))}catch(t){l.console.error("LineNumbers error: ",t)}}function I(e){return e.classList.contains("nohljsln")}function v(e,t){"object"==typeof e&&function k(e){l.setTimeout(e,0)}(function(){e.innerHTML=M(e,t)})}function M(e,t){const n=function W(e,t){return{singleLine:K(t=t||{}),startFrom:V(e,t)}}(e,t);return A(e),function U(e,t){const n=j(e);if(""===n[n.length-1].trim()&&n.pop(),n.length>1||t.singleLine){let i="";for(let s=0,a=n.length;s<a;s++)i+=f('<tr><td class="{0} {1}" {3}="{5}"><div class="{2}" {3}="{5}"></div></td><td class="{0} {4}" {3}="{5}">{6}</td></tr>',["hljs-ln-line","hljs-ln-numbers",p,N,E,s+t.startFrom,n[s].length>0?n[s]:" "]);return f('<table class="{0}">{1}</table>',[r,i])}return e}(e.innerHTML,n)}function K(e){return!!e.singleLine&&e.singleLine}function V(e,t){let i=1;isFinite(t.startFrom)&&(i=t.startFrom);const s=function G(e,t){return e.hasAttribute(t)?e.getAttribute(t):null}(e,"data-ln-start-from");return null!==s&&(i=function Z(e,t){if(!e)return t;const n=Number(e);return isFinite(n)?n:t}(s,1)),i}function A(e){const t=e.childNodes;for(const n in t)if(t.hasOwnProperty(n)){const i=t[n];Q(i.textContent)>0&&(i.childNodes.length>0?A(i):X(i.parentNode))}}function X(e){const t=e.className;if(!/hljs-/.test(t))return;const n=j(e.innerHTML);let i="";for(let s=0;s<n.length;s++)i+=f('<span class="{0}">{1}</span>\n',[t,n[s].length>0?n[s]:" "]);e.innerHTML=i.trim()}function j(e){return 0===e.length?[]:e.split(O)}function Q(e){return(e.trim().match(O)||[]).length}function f(e,t){return e.replace(/\{(\d+)\}/g,function(n,i){return void 0!==t[i]?t[i]:n})}l.hljs?(l.hljs.initLineNumbersOnLoad=function R(e){"interactive"===m.readyState||"complete"===m.readyState?T(e):l.addEventListener("DOMContentLoaded",function(){T(e)})},l.hljs.lineNumbersBlock=v,l.hljs.lineNumbersValue=function H(e,t){if("string"!=typeof e)return;const n=document.createElement("code");return n.innerHTML=e,M(n,t)},function S(){const e=m.createElement("style");e.type="text/css",e.innerHTML=f(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[r,p,N]),m.getElementsByTagName("head")[0].appendChild(e)}()):l.console.error("highlight.js not detected!"),document.addEventListener("copy",function(e){const t=window.getSelection();if(function w(e){let t=e;for(;t;){if(t.className&&-1!==t.className.indexOf("hljs-ln-code"))return!0;t=t.parentNode}return!1}(t.anchorNode)){let n;n=-1!==window.navigator.userAgent.indexOf("Edge")?function P(e){const t=e.toString();let n=e.anchorNode;for(;"TD"!==n.nodeName;)n=n.parentNode;let i=e.focusNode;for(;"TD"!==i.nodeName;)i=i.parentNode;let s=parseInt(n.dataset.lineNumber),a=parseInt(i.dataset.lineNumber);if(s!=a){let d=n.textContent,h=i.textContent;if(s>a){let u=s;s=a,a=u,u=d,d=h,h=u}for(;0!==t.indexOf(d);)d=d.slice(1);for(;-1===t.lastIndexOf(h);)h=h.slice(0,-1);let b=d;const z=function x(e){let t=e;for(;"TABLE"!==t.nodeName;)t=t.parentNode;return t}(n);for(let u=s+1;u<a;++u){const J=f('.{0}[{1}="{2}"]',[E,N,u]);b+="\n"+z.querySelector(J).textContent}return b+="\n"+h,b}return t}(t):t.toString(),e.clipboardData.setData("text/plain",n),e.preventDefault()}})}let D=(()=>{class l{constructor(){this._platform=(0,o.WQX)(o.Agw),this.options=(0,o.WQX)(g.sq)?.lineNumbersOptions,this._hljs=(0,o.WQX)(g.cR),this._highlight=(0,o.WQX)(g.Gf),this._nativeElement=(0,o.WQX)(o.aKT).nativeElement,this.startFrom=this.options?.startFrom,this.singleLine=this.options?.singleLine,(0,C.UE)(this._platform)&&(0,o.QZP)(()=>{this._highlight.highlightResult()&&this.addLineNumbers()})}addLineNumbers(){var r=this;this.destroyLineNumbersObserver(),requestAnimationFrame((0,y.A)(function*(){yield r._hljs.lineNumbersBlock(r._nativeElement,{startFrom:r.startFrom,singleLine:r.singleLine}),r._lineNumbersObs=new MutationObserver(()=>{"TABLE"===r._nativeElement.firstElementChild?.tagName.toUpperCase()&&r._nativeElement.classList.add("hljs-line-numbers"),r.destroyLineNumbersObserver()}),r._lineNumbersObs.observe(r._nativeElement,{childList:!0})}))}destroyLineNumbersObserver(){this._lineNumbersObs&&(this._lineNumbersObs.disconnect(),this._lineNumbersObs=null)}static{this.\u0275fac=function(L){return new(L||l)}}static{this.\u0275dir=o.FsC({type:l,selectors:[["","highlight","","lineNumbers",""],["","highlightAuto","","lineNumbers",""]],inputs:{startFrom:[2,"startFrom","startFrom",o.Udg],singleLine:[2,"singleLine","singleLine",o.L39]}})}}return l})()}}]);