Files
Buffteks-Website/buffteks/lib/python3.12/site-packages/streamlit_ace/frontend/build/7ffade0c8465ae70dbd39220f1d3a3f6.js
2025-05-08 21:10:14 -05:00

1 line
3.7 KiB
JavaScript

ace.define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],(function(e,n,t){"use strict";var o=e("../line_widgets").LineWidgets,r=e("../lib/event"),i=e("../lib/lang"),s=e("../lib/dom");function a(e,n){if(e&n.CHANGE_LINES||e&n.CHANGE_FULL||e&n.CHANGE_SCROLL||e&n.CHANGE_TEXT){var t=n.session,o=n.session.lineWidgets,r=n.$textLayer,i=r.$lenses;if(o){var a=n.$textLayer.$lines.cells,d=n.layerConfig,c=n.$padding;i||(i=r.$lenses=[]);for(var l=0,u=0;u<a.length;u++){var f=a[u].row,g=o[f],v=g&&g.lenses;if(v&&v.length){var L=i[l];L||(L=i[l]=s.buildDom(["div",{class:"ace_codeLens"}],n.container)),L.style.height=d.lineHeight+"px",l++;for(var p=0;p<v.length;p++){var h=L.childNodes[2*p];h||(0!=p&&L.appendChild(s.createTextNode("\xa0|\xa0")),h=s.buildDom(["a"],L)),h.textContent=v[p].title,h.lensCommand=v[p]}for(;L.childNodes.length>2*p-1;)L.lastChild.remove();var m=n.$cursorLayer.getPixelPosition({row:f,column:0},!0).top-d.lineHeight*g.rowsAbove-d.offset;L.style.top=m+"px";var $=n.gutterWidth,C=t.getLine(f).search(/\S|$/);-1==C&&(C=0),$+=C*d.characterWidth,$-=n.scrollLeft,L.style.paddingLeft=c+$+"px"}}for(;l<i.length;)i.pop().remove()}else i&&function(e){var n=e.$textLayer,t=n.$lenses;t&&t.forEach((function(e){e.remove()})),n.$lenses=null}(n)}}function d(e){e.codeLensProviders=[],e.renderer.on("afterRender",a),e.$codeLensClickHandler||(e.$codeLensClickHandler=function(n){var t=n.target.lensCommand;t&&e.execCommand(t.id,t.arguments)},r.addListener(e.container,"click",e.$codeLensClickHandler,e)),e.$updateLenses=function(){var t=e.session;if(t){t.widgetManager||(t.widgetManager=new o(t),t.widgetManager.attach(e));var r=e.codeLensProviders.length,i=[];e.codeLensProviders.forEach((function(o){o.provideCodeLenses(t,(function(o,s){o||(s.forEach((function(e){i.push(e)})),0==--r&&function(){var o=t.selection.cursor,r=t.documentToScreenRow(o);n.setLenses(t,i);var s=t.$undoManager&&t.$undoManager.$lastDelta;if(s&&"remove"==s.action&&s.lines.length>1)return;var a=t.documentToScreenRow(o),d=e.renderer.layerConfig.lineHeight,c=t.getScrollTop()+(a-r)*d;t.setScrollTop(c)}())}))}))}};var t=i.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){t.delay(250)},e.on("input",e.$updateLensesOnInput)}n.setLenses=function(e,n){var t=Number.MAX_VALUE;!function(e){if(e.lineWidgets){var n=e.widgetManager;e.lineWidgets.forEach((function(e){e&&e.lenses&&n.removeLineWidget(e)}))}}(e),n&&n.forEach((function(n){var o=n.start.row,r=n.start.column,i=e.lineWidgets&&e.lineWidgets[o];i&&i.lenses||(i=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:o,column:r,lenses:[]})),i.lenses.push(n.command),o<t&&(t=o)})),e._emit("changeFold",{data:{start:{row:t}}})},n.registerCodeLensProvider=function(e,n){e.setOption("enableCodeLens",!0),e.codeLensProviders.push(n),e.$updateLensesOnInput()},n.clear=function(e){n.setLenses(e,null)};var c=e("../editor").Editor;e("../config").defineOptions(c.prototype,"editor",{enableCodeLens:{set:function(e){var n;e?d(this):((n=this).off("input",n.$updateLensesOnInput),n.renderer.off("afterRender",a),n.$codeLensClickHandler&&n.container.removeEventListener("click",n.$codeLensClickHandler))}}}),s.importCssString(".ace_codeLens { position: absolute; color: #aaa; font-size: 88%; background: inherit; width: 100%; display: flex; align-items: flex-end; pointer-events: none;}.ace_codeLens > a { cursor: pointer; pointer-events: auto;}.ace_codeLens > a:hover { color: #0000ff; text-decoration: underline;}.ace_dark > .ace_codeLens > a:hover { color: #4e94ce;}","")})),ace.require(["ace/ext/code_lens"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));