Files
dash-api/lib/python3.11/site-packages/dash/dcc/async-highlight.js

2 lines
134 KiB
JavaScript
Raw Permalink Normal View History

2025-09-07 22:09:54 +02:00
(self.webpackChunkdash_core_components=self.webpackChunkdash_core_components||[]).push([[254],{46125:function(u,D,e){var n=e(96763);function t(u,D){return function(u){if(Array.isArray(u))return u}(u)||function(u,D){var e=null==u?null:"undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(null!=e){var n,t,a,r,i=[],s=!0,F=!1;try{if(a=(e=e.call(u)).next,0===D){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=a.call(e)).done)&&(i.push(n.value),i.length!==D);s=!0);}catch(u){F=!0,t=u}finally{try{if(!s&&null!=e.return&&(r=e.return(),Object(r)!==r))return}finally{if(F)throw t}}return i}}(u,D)||function(u,D){if(u){if("string"==typeof u)return a(u,D);var e={}.toString.call(u).slice(8,-1);return"Object"===e&&u.constructor&&(e=u.constructor.name),"Map"===e||"Set"===e?Array.from(u):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(u,D):void 0}}(u,D)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(u,D){(null==D||D>u.length)&&(D=u.length);for(var e=0,n=Array(D);e<D;e++)n[e]=u[e];return n}function r(u){return u instanceof Map?u.clear=u.delete=u.set=function(){throw new Error("map is read-only")}:u instanceof Set&&(u.add=u.clear=u.delete=function(){throw new Error("set is read-only")}),Object.freeze(u),Object.getOwnPropertyNames(u).forEach((D=>{var e=u[D],n=typeof e;"object"!==n&&"function"!==n||Object.isFrozen(e)||r(e)})),u}class i{constructor(u){void 0===u.data&&(u.data={}),this.data=u.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(u){return u.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function F(u){var D=Object.create(null);for(var e in u)D[e]=u[e];for(var n=arguments.length,t=new Array(n>1?n-1:0),a=1;a<n;a++)t[a-1]=arguments[a];return t.forEach((function(u){for(var e in u)D[e]=u[e]})),D}var o=u=>!!u.scope;class A{constructor(u,D){this.buffer="",this.classPrefix=D.classPrefix,u.walk(this)}addText(u){this.buffer+=s(u)}openNode(u){if(o(u)){var D=(u=>{var D={prefix:this.classPrefix}.prefix;if(u.startsWith("language:"))return u.replace("language:","language-");if(u.includes(".")){var e=u.split(".");return["".concat(D).concat(e.shift()),...e.map(((u,D)=>"".concat(u).concat("_".repeat(D+1))))].join(" ")}return"".concat(D).concat(u)})(u.scope);this.span(D)}}closeNode(u){o(u)&&(this.buffer+="</span>")}value(){return this.buffer}span(u){this.buffer+='<span class="'.concat(u,'">')}}var l=function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},D={children:[]};return Object.assign(D,u),D};class C{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(u){this.top.children.push(u)}openNode(u){var D=l({scope:u});this.add(D),this.stack.push(D)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(u){return this.constructor._walk(u,this.rootNode)}static _walk(u,D){return"string"==typeof D?u.addText(D):D.children&&(u.openNode(D),D.children.forEach((D=>this._walk(u,D))),u.closeNode(D)),u}static _collapse(u){"string"!=typeof u&&u.children&&(u.children.every((u=>"string"==typeof u))?u.children=[u.children.join("")]:u.children.forEach((u=>{C._collapse(u)})))}}class E extends C{constructor(u){super(),this.options=u}addText(u){""!==u&&this.add(u)}startScope(u){this.openNode(u)}endScope(){this.closeNode()}__addSublanguage(u,D){var e=u.root;D&&(e.scope="language:".concat(D)),this.add(e)}toHTML(){return new A(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function c(u){return u?"string"==typeof u?u:u.source:null}function d(u){return b("(?=",u,")")}function B(u){return b("(?:",u,")*")}function g(u){return b("(?:",u,")?")}function b(){for(var u=arguments.length,D=new Array(u),e=0;e<u;e++)D[e]=arguments[e];return D.map((u=>c(u))).join("")}function m(){for(var u=arguments.l
//# sourceMappingURL=async-highlight.js.map