notebook 7.3.0a1__py3-none-any.whl → 7.3.0b0__py3-none-any.whl
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.
Potentially problematic release.
This version of notebook might be problematic. Click here for more details.
- notebook/_version.py +1 -1
- notebook/app.py +10 -2
- notebook/static/113.bundle.js +1 -1
- notebook/static/1198.bundle.js +1 -1
- notebook/static/134.bundle.js +1 -1
- notebook/static/1408.bundle.js +1 -1
- notebook/static/1496.bundle.js +1 -1
- notebook/static/1584.bundle.js +1 -1
- notebook/static/1647.bundle.js +1 -1
- notebook/static/1650.bundle.js +1 -1
- notebook/static/1684.bundle.js +1 -1
- notebook/static/170.bundle.js +1 -1
- notebook/static/1809.bundle.js +1 -1
- notebook/static/1827.bundle.js +1 -1
- notebook/static/1828.bundle.js +1 -1
- notebook/static/1833.bundle.js +1 -1
- notebook/static/1958.bundle.js +1 -1
- notebook/static/1962.bundle.js +1 -1
- notebook/static/2007.bundle.js +1 -1
- notebook/static/2065.bundle.js +1 -1
- notebook/static/2088.bundle.js +1 -1
- notebook/static/2089.bundle.js +1 -1
- notebook/static/2122.bundle.js +1 -1
- notebook/static/2167.bundle.js +1 -1
- notebook/static/2184.bundle.js +1 -1
- notebook/static/2311.bundle.js +1 -1
- notebook/static/{3030.bundle.js → 2323.bundle.js} +1 -1
- notebook/static/2401.bundle.js +1 -1
- notebook/static/2424.bundle.js +377 -0
- notebook/static/2479.bundle.js +1 -1
- notebook/static/2489.bundle.js +1 -1
- notebook/static/2607.bundle.js +1 -1
- notebook/static/2615.bundle.js +1 -1
- notebook/static/2636.bundle.js +1 -1
- notebook/static/2756.bundle.js +1 -1
- notebook/static/2813.bundle.js +1 -1
- notebook/static/2866.bundle.js +1 -1
- notebook/static/2924.bundle.js +1 -1
- notebook/static/2944.bundle.js +1 -1
- notebook/static/2955.bundle.js +1 -0
- notebook/static/3129.bundle.js +1 -1
- notebook/static/3146.bundle.js +1 -1
- notebook/static/3187.bundle.js +1 -1
- notebook/static/3213.bundle.js +1 -1
- notebook/static/3301.bundle.js +1 -1
- notebook/static/3325.bundle.js +1 -1
- notebook/static/3340.bundle.js +1 -1
- notebook/static/3360.bundle.js +1 -1
- notebook/static/{1261.bundle.js → 3463.bundle.js} +1 -1
- notebook/static/3466.bundle.js +1 -1
- notebook/static/35.bundle.js +1 -1
- notebook/static/3512.bundle.js +1 -1
- notebook/static/3676.bundle.js +1 -1
- notebook/static/3680.bundle.js +1 -1
- notebook/static/374.bundle.js +1 -1
- notebook/static/3768.bundle.js +1 -1
- notebook/static/377.bundle.js +1 -1
- notebook/static/3863.bundle.js +1 -1
- notebook/static/3881.bundle.js +1 -1
- notebook/static/4042.bundle.js +1 -1
- notebook/static/4058.bundle.js +1 -1
- notebook/static/409.bundle.js +1 -1
- notebook/static/4212.bundle.js +1 -1
- notebook/static/4242.bundle.js +79 -0
- notebook/static/4271.bundle.js +1 -1
- notebook/static/4291.bundle.js +1 -1
- notebook/static/4382.bundle.js +1 -1
- notebook/static/4526.bundle.js +1 -1
- notebook/static/4588.bundle.js +1 -1
- notebook/static/4630.bundle.js +1 -1
- notebook/static/4645.bundle.js +1 -1
- notebook/static/4811.bundle.js +1 -1
- notebook/static/4837.bundle.js +1 -1
- notebook/static/5099.bundle.js +1 -1
- notebook/static/5135.bundle.js +1 -1
- notebook/static/5166.bundle.js +1 -1
- notebook/static/5234.bundle.js +1 -1
- notebook/static/5254.bundle.js +1 -1
- notebook/static/5261.bundle.js +1 -1
- notebook/static/5263.bundle.js +1 -0
- notebook/static/5313.bundle.js +1 -1
- notebook/static/5325.bundle.js +1 -1
- notebook/static/5346.bundle.js +1 -1
- notebook/static/5426.bundle.js +1 -1
- notebook/static/5430.bundle.js +653 -0
- notebook/static/545.bundle.js +1 -1
- notebook/static/5451.bundle.js +1 -1
- notebook/static/5573.bundle.js +1 -1
- notebook/static/5601.bundle.js +1 -1
- notebook/static/5649.bundle.js +3 -3
- notebook/static/5733.bundle.js +1 -1
- notebook/static/5850.bundle.js +1 -1
- notebook/static/5912.bundle.js +1 -1
- notebook/static/5921.bundle.js +1 -1
- notebook/static/6017.bundle.js +1 -1
- notebook/static/6061.bundle.js +1 -1
- notebook/static/6139.bundle.js +1 -1
- notebook/static/62.bundle.js +1 -1
- notebook/static/6271.bundle.js +1 -1
- notebook/static/6345.bundle.js +1 -1
- notebook/static/6604.bundle.js +1 -1
- notebook/static/6621.bundle.js +1 -1
- notebook/static/6627.bundle.js +1 -1
- notebook/static/6648.bundle.js +1 -0
- notebook/static/6731.bundle.js +1 -1
- notebook/static/6748.bundle.js +1 -1
- notebook/static/677.bundle.js +1 -1
- notebook/static/6815.bundle.js +1 -1
- notebook/static/6853.bundle.js +1 -1
- notebook/static/6893.bundle.js +1 -1
- notebook/static/690.bundle.js +1 -1
- notebook/static/6962.bundle.js +1 -1
- notebook/static/6999.bundle.js +1 -1
- notebook/static/7226.bundle.js +1 -1
- notebook/static/7252.bundle.js +1 -1
- notebook/static/7302.bundle.js +1 -1
- notebook/static/7369.bundle.js +1 -1
- notebook/static/7386.bundle.js +1 -1
- notebook/static/7391.bundle.js +1 -1
- notebook/static/7543.bundle.js +1 -1
- notebook/static/7603.bundle.js +1 -1
- notebook/static/7639.bundle.js +1 -1
- notebook/static/7655.bundle.js +1 -1
- notebook/static/7684.bundle.js +1 -1
- notebook/static/7812.bundle.js +1 -1
- notebook/static/7819.bundle.js +1 -1
- notebook/static/7821.bundle.js +1 -1
- notebook/static/7854.bundle.js +1 -1
- notebook/static/7866.bundle.js +1 -0
- notebook/static/7900.bundle.js +1 -1
- notebook/static/7906.bundle.js +1 -1
- notebook/static/8010.bundle.js +1 -1
- notebook/static/8032.bundle.js +1 -1
- notebook/static/8285.bundle.js +1 -1
- notebook/static/8471.bundle.js +1 -1
- notebook/static/8579.bundle.js +1 -1
- notebook/static/8633.bundle.js +1 -1
- notebook/static/8635.bundle.js +41 -0
- notebook/static/8771.bundle.js +1 -1
- notebook/static/8781.bundle.js +1 -1
- notebook/static/8875.bundle.js +1 -1
- notebook/static/8907.bundle.js +1 -1
- notebook/static/8928.bundle.js +1 -1
- notebook/static/8929.bundle.js +1 -1
- notebook/static/893.bundle.js +1 -1
- notebook/static/901.bundle.js +1 -1
- notebook/static/9068.bundle.js +1 -1
- notebook/static/911.bundle.js +1 -1
- notebook/static/9136.bundle.js +1 -1
- notebook/static/9151.bundle.js +1 -1
- notebook/static/9161.bundle.js +1 -1
- notebook/static/9268.bundle.js +1 -1
- notebook/static/9335.bundle.js +1 -1
- notebook/static/9341.bundle.js +1 -1
- notebook/static/9380.bundle.js +1 -1
- notebook/static/9605.bundle.js +1 -1
- notebook/static/9638.bundle.js +1 -1
- notebook/static/9672.bundle.js +352 -0
- notebook/static/9680.bundle.js +1 -1
- notebook/static/9685.bundle.js +1 -1
- notebook/static/9752.bundle.js +1 -1
- notebook/static/9799.bundle.js +1 -0
- notebook/static/9821.bundle.js +1 -1
- notebook/static/9852.bundle.js +1 -1
- notebook/static/bundle.js +1 -1
- notebook/static/third-party-licenses.json +124 -130
- notebook/templates/consoles.html +1 -1
- notebook/templates/edit.html +1 -1
- notebook/templates/error.html +1 -1
- notebook/templates/notebooks.html +1 -1
- notebook/templates/terminals.html +1 -1
- notebook/templates/tree.html +1 -1
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +17 -17
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +11 -11
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +18 -18
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -1
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +13 -13
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +12 -12
- notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.67f8b11d2af855286118.js +1 -0
- notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js → notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/907.767373e59d0c0e33ef12.js +1 -1
- notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.50419fa0a72e54064396.js +1 -0
- notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.fd0956ebf15f666a19f8.js +1 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
- {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/METADATA +2 -2
- {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/RECORD +210 -218
- notebook/static/1226.bundle.js +0 -1
- notebook/static/1750.bundle.js +0 -1
- notebook/static/1884.bundle.js +0 -386
- notebook/static/4045.bundle.js +0 -1
- notebook/static/4434.bundle.js +0 -1
- notebook/static/5018.bundle.js +0 -1
- notebook/static/5712.bundle.js +0 -1
- notebook/static/6164.bundle.js +0 -1
- notebook/static/6318.bundle.js +0 -1
- notebook/static/6619.bundle.js +0 -1
- notebook/static/6898.bundle.js +0 -1
- notebook/static/7506.bundle.js +0 -703
- notebook/static/7579.bundle.js +0 -1
- notebook/static/8054.bundle.js +0 -1
- notebook/static/8647.bundle.js +0 -1
- notebook/static/8723.bundle.js +0 -1
- notebook/static/9734.bundle.js +0 -1
- notebook/static/9906.bundle.js +0 -1
- notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +0 -1
- notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js +0 -1
- notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +0 -1
- /notebook/static/{7506.bundle.js.LICENSE.txt → 4242.bundle.js.LICENSE.txt} +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
- {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
- {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/WHEEL +0 -0
- {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/entry_points.txt +0 -0
- {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/licenses/LICENSE +0 -0
notebook/_version.py
CHANGED
notebook/app.py
CHANGED
|
@@ -203,8 +203,16 @@ class NotebookHandler(NotebookBaseHandler):
|
|
|
203
203
|
"""A notebook page handler."""
|
|
204
204
|
|
|
205
205
|
@web.authenticated
|
|
206
|
-
def get(self, path: str
|
|
207
|
-
"""Get the notebook page."""
|
|
206
|
+
async def get(self, path: str = "") -> t.Any:
|
|
207
|
+
"""Get the notebook page. Redirect if it's a directory."""
|
|
208
|
+
path = path.strip("/")
|
|
209
|
+
cm = self.contents_manager
|
|
210
|
+
|
|
211
|
+
if await ensure_async(cm.dir_exists(path=path)):
|
|
212
|
+
url = ujoin(self.base_url, "tree", url_escape(path))
|
|
213
|
+
self.log.debug("Redirecting %s to %s since path is a directory", self.request.path, url)
|
|
214
|
+
self.redirect(url)
|
|
215
|
+
return None
|
|
208
216
|
tpl = self.render_template("notebooks.html", page_config=self.get_page_config())
|
|
209
217
|
return self.write(tpl)
|
|
210
218
|
|
notebook/static/113.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[113],{113:(t,e,s)=>{s.r(e),s.d(e,{default:()=>K});var i,n=s(87844),r=s(25291),o=s(12668),l=s(16934),a=s(20998),c=s(2549),h=s(18395);!function(t){t.editBinding="shortcuts:edit-keybinding",t.addBinding="shortcuts:add-keybinding",t.deleteBinding="shortcuts:delete-keybinding",t.toggleSelectors="shortcuts:toggle-selectors",t.resetAll="shortcuts:reset-all"}(i||(i={}));var d=s(78156),u=s.n(d),p=s(33625),m=s(80554);class g extends d.Component{constructor(t){super(t),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?(this.props.toggleInput(),this.setState({value:"",userInput:""})):await this._updateShortcut():(await this._updateShortcut(),this.setState({value:"",keys:[],currentChain:""}),this.props.toggleInput()),this._updateConflictDisplay()},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this.handleOverwrite=async()=>{const t=[...this.state.keys,this.state.currentChain];for(const e of this.state.conflicts){const s=e.keybindings.filter((e=>a.JSONExt.deepEqual(e.keys,t)||t.some((t=>a.JSONExt.deepEqual(e.keys,[t])))))[0];s?await this.props.deleteKeybinding(e,s):console.error(`Conflicting binding could not be found for ${e} using keys ${t}`)}this.setState({conflicts:[]}),await this._updateShortcut(),this._updateConflictDisplay()},this.parseChaining=(t,e,s,i,n)=>{let r=m.EN_US.keyForKeydownEvent(t.nativeEvent);const o=["Shift","Control","Alt","Meta","Ctrl","Accel"];if("Backspace"===t.key)s="",i=[],n="",this.setState({value:"",userInput:s,keys:i,currentChain:n});else if("CapsLock"!==t.key){const e=s.substr(s.lastIndexOf(" ")+1,s.length).trim();-1===o.lastIndexOf(e)&&""!=e?(s+=",",i.push(n),n="",t.ctrlKey&&"Control"!=t.key&&(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()),t.metaKey&&"Meta"!=t.key&&(s=(s+" Accel").trim(),n=(n+" Accel").trim()),t.altKey&&"Alt"!=t.key&&(s=(s+" Alt").trim(),n=(n+" Alt").trim()),t.shiftKey&&"Shift"!=t.key&&(s=(s+" Shift").trim(),n=(n+" Shift").trim()),-1===o.lastIndexOf(t.key)?(s=(s+" "+r).trim(),n=(n+" "+r).trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+t.key).trim(),n=(n+" "+t.key).trim())):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+r).trim(),n=(n+" "+r).trim())}return this.setState({keys:i,currentChain:n}),[s,i,n]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],e=this.state.currentChain.split(" "),s=e[e.length-1];return this.setState({isFunctional:!(-1!==t.indexOf(s))}),-1!==t.indexOf(s)},this.checkShortcutAvailability=(t,e,s)=>{const i=this.props.findConflictsFor([...e,s],this.props.shortcut.selector),n=""===t||0===i.length;return!n&&1===i.length&&i[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:n}),i)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const e=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=e[0],i=e[1],n=e[2],r=this.props.toSymbols(s);let o=this.checkShortcutAvailability(s,i,n);this.setState({value:r,userInput:s,conflicts:o,keys:i,currentChain:n},(()=>{this.checkNonFunctional(),this._updateConflictDisplay()}))},this.handleBlur=t=>{null!==t.relatedTarget&&"no-blur"===t.relatedTarget.id||(this.props.toggleInput(),this.setState({value:"",userInput:"",conflicts:[]},(()=>{this._updateConflictDisplay()})))},this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,conflicts:[],keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_updateConflictDisplay(){this.props.displayConflicts({conflictsWith:this.state.conflicts,keys:this.state.keys,overwrite:this.handleOverwrite})}render(){const t=this.props.translator.load("jupyterlab");let e="jp-Shortcuts-Input";return this.state.isAvailable||(e+=" jp-mod-unavailable-Input"),d.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",onBlur:t=>this.handleBlur(t)},d.createElement("div",{tabIndex:0,id:"no-blur",className:e,onKeyDown:this.handleInput,ref:t=>t&&t.focus(),"data-lm-suppress-shortcuts":"true"},d.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":""===this.state.value?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},""===this.state.value?t.__("press keys"):this.state.value)),d.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",id:"no-blur",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit},this.state.isAvailable?d.createElement(o.checkIcon.react,null):d.createElement(o.errorIcon.react,null)))}}class y extends d.Component{constructor(t){super(t),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput})},this.toSymbols=t=>t.split(" ").reduce(((t,e)=>"Ctrl"===e?(t+" ⌃").trim():"Alt"===e?(t+" ⌥").trim():"Shift"===e?(t+" ⇧").trim():"Accel"===e&&h.Platform.IS_MAC?(t+" ⌘").trim():"Accel"===e?(t+" ⌃").trim():(t+" "+e).trim()),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if(!("shortcutId"in e)||e.shortcutId===this.props.shortcut.id){if("add-keybinding"===e.request)return this.toggleInputNew();if("edit-keybinding"===e.request&&this.toggleInputReplaceMethod(e.keybinding),"delete-keybinding"===e.request){const t=this.props.shortcut,s=t.keybindings[e.keybinding];this.props.deleteKeybinding(t,s).catch(console.error)}}}getCategoryCell(){return d.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var t;return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-label"},null!==(t=this.props.shortcut.label)&&void 0!==t?t:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return d.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const t=this.props.shortcut.keybindings.every((t=>t.isDefault));return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(t){const e=["jp-Shortcuts-ShortcutCell"];switch(t.length){case 1:e.push("jp-Shortcuts-SingleCell");break;case 0:e.push("jp-Shortcuts-EmptyCell")}return e.join(" ")}toggleInputReplaceMethod(t){const e=this.state.displayReplaceInput[t];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[t]:!e}})}getDisplayReplaceInput(t){return this.state.displayReplaceInput[t]}getOrDiplayIfNeeded(t){const e=["jp-Shortcuts-Or"];return(t||this.state.displayNewInput)&&e.push("jp-Shortcuts-Or-Forced"),d.createElement("div",{className:e.join(" ")},this._trans.__("or"))}getShortCutAsInput(t,e){return d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(e),shortcut:this.props.shortcut,keybinding:t,displayConflicts:e=>{const s=new Map(this.state.conflicts);s.set(t,e),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(e),placeholder:this.toSymbols(t.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(t){return t.keys.map(((e,s)=>d.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:s},d.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(e)),s+1<t.keys.length?d.createElement("div",{className:"jp-Shortcuts-Comma"},","):null)))}isLocationBeingEdited(t){return this.state.displayReplaceInput[t]}getDivForKey(t,e,s){return d.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+t,"data-keybinding":t,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(t)},this.isLocationBeingEdited(t)?this.getShortCutAsInput(e,t):this.getShortCutForDisplayOnly(e),this.getOrDiplayIfNeeded(t<s.length-1))}getAddLink(){return d.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:t=>{const e=new Map(this.state.conflicts);e.set(null,t),this.setState({conflicts:e})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):d.createElement("div",null)}getShortCutsCell(t){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:this.getClassNameForShortCuts(t)},t.map(((e,s)=>this.getDivForKey(s,e,t))),t.length>=1&&!this.state.displayNewInput&&!this.state.displayReplaceInput[0]&&this.getAddLink(),0===t.length&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const t=[...this.state.conflicts.values()].filter((t=>0!==t.conflictsWith.length));return 0===t.length?d.createElement(d.Fragment,null):d.createElement("div",{className:"jp-Shortcuts-Row"},d.createElement("div",{className:"jp-Shortcuts-ConflictContainer"},t.map((t=>{const e=t.keys.join(" ")+"_"+t.conflictsWith.map((t=>t.id)).join("");return d.createElement("div",{className:"jp-Shortcuts-Conflict",key:e},d.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map((t=>{var e;return null!==(e=t.label)&&void 0!==e?e:t.command})).join(", "))),d.createElement("div",{className:"jp-Shortcuts-ErrorButton"},d.createElement("button",null,this._trans.__("Cancel")),d.createElement("button",{id:"no-blur",onClick:()=>{t.overwrite()}},this._trans.__("Overwrite"))))}))))}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter((t=>0!==t.keys.filter((t=>""!=t)).length))}render(){return d.createElement(d.Fragment,null,d.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}class S extends d.Component{render(){return d.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:this.props.height-115+"px"},id:"shortcutListContainer"},d.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map((t=>d.createElement(y,{key:t.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:t,showSelectors:this.props.showSelectors,external:this.props.external})))))}}class b extends d.Component{render(){return d.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,d.createElement(o.caretDownEmptyThinIcon.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function f(t){return d.createElement("div",{className:"jp-Shortcuts-Symbols"},d.createElement("table",null,d.createElement("tbody",null,d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Cmd")),d.createElement("td",null,"⌘"),d.createElement("td",null,d.createElement("kbd",null,"Ctrl")),d.createElement("td",null,"⌃")),d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Alt")),d.createElement("td",null,"⌥"),d.createElement("td",null,d.createElement("kbd",null,"Shift")),d.createElement("td",null,"⇧")))))}function C(t){const e=t.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.toggleSelectors()},t.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.resetShortcuts()},e.__("Reset All")))}class k extends d.Component{constructor(t){super(t)}getShortCutTitleItem(t,e){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement(b,{title:t,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:e}))}render(){const t=this.props.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-Top"},d.createElement("div",{className:"jp-Shortcuts-TopNav"},d.createElement(f,null),d.createElement(o.FilterBox,{"aria-label":t.__("Search shortcuts"),updateFilter:(t,e)=>this.props.updateSearchQuery(null!=e?e:""),placeholder:t.__("Search…"),useFuzzyFilter:!1}),d.createElement(C,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),d.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},d.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(t.__("Category"),"category"),this.getShortCutTitleItem(t.__("Command"),"command"),d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"title-div"},t.__("Shortcut"))),this.getShortCutTitleItem(t.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(t.__("Selectors"),"selector"))))}}class v extends Map{constructor(t){var e,s,i;super();const{settings:n,commandRegistry:r}=t,o=null!==(e=n.user.shortcuts)&&void 0!==e?e:[],l=new Set(o.map(this._computeKeybindingId.bind(this))),a=null!==(s=n.composite.shortcuts)&&void 0!==s?s:[];for(const t of a){const e=this._computeTargetId(t),s=this._computeKeybindingId(t),n={keys:t.keys,isDefault:!l.has(s)},o=this.get(e);if(o)o.keybindings.push(n);else{const s=t.command.split(":"),o=null!==(i=r.label(t.command,t.args))&&void 0!==i?i:s.length>1?s[1]:void 0,l=s[0];this.set(e,{id:e,selector:t.selector,command:t.command,category:l,label:o,args:t.args,keybindings:[n]})}}}findConflictsFor(t,e){const s=new _({registry:this});let i=s.findConflicts(t,e);if(0!==i.length)return i;for(const n of t)if(i=s.findConflicts([n],e),0!==i.length)return i;return[]}_computeTargetId(t){var e;return t.command+"_"+t.selector+"_"+JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{})}_computeKeybindingId(t){var e;return[t.command,t.selector,JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{}),t.keys.join(" ")].join("_")}}class _{constructor(t){var e;const s=new Map;for(const i of t.registry.values())for(const t of i.keybindings){const n=this._keybindingHash(t.keys,i.selector),r=null!==(e=s.get(n))&&void 0!==e?e:[];r.push(i),s.set(n,r)}this._keybindingsMap=s}findConflicts(t,e){var s;const i=this._keybindingHash(t,e);return null!==(s=this._keybindingsMap.get(i))&&void 0!==s?s:[]}_keybindingHash(t,e){return t.join(" ")+"_"+e}}function E(t,e){var s;const i=t.category.toLowerCase(),n=`${i} ${(null!==(s=t.label)&&void 0!==s?s:"").toLowerCase()}`;let r=1/0,o=null;const l=/\b\w/g;for(;;){const t=l.exec(n);if(!t)break;const s=p.StringExt.matchSumOfDeltas(n,e,t.index);if(!s)break;s&&s.score<=r&&(r=s.score,o=s.indices)}if(!o||r===1/0)return null;const a=i.length+1,c=p.ArrayExt.lowerBound(o,a,((t,e)=>t-e)),h=o.slice(0,c),d=o.slice(c);for(let t=0,e=d.length;t<e;++t)d[t]-=a;return 0===h.length?{matchType:0,categoryIndices:null,labelIndices:d,score:r,item:t}:0===d.length?{matchType:1,categoryIndices:h,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:h,labelIndices:d,score:r,item:t}}class I extends d.Component{constructor(t){super(t),this.updateSearchQuery=t=>{this.setState({searchQuery:t},(()=>{const t=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(t)},(()=>{this.sortShortcuts()}))}))},this.resetShortcuts=async()=>{const t=await this.props.external.getSettings();await t.set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{for(const e of t.keybindings)await this._setKeybinding(t,e.isDefault?e.keys:[],e)},this.replaceKeybinding=async(t,e,s)=>this._setKeybinding(t,s,e),this.deleteKeybinding=async(t,e)=>{await this._setKeybinding(t,[],e)},this.addKeybinding=async(t,e)=>{await this._setKeybinding(t,e)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if("toggle-selectors"===e.request)return this.toggleSelectors();"reset-all"===e.request&&await this.resetShortcuts()}async _refreshShortcutList(){const t=await this.props.external.getSettings(),e=new v({commandRegistry:this.props.external.commandRegistry,settings:t});this.setState({shortcutRegistry:e,filteredShortcutList:this._searchFilterShortcuts(e),shortcutsFetched:!0},(()=>{this.sortShortcuts()}))}_searchFilterShortcuts(t){return t?function(t,e){e=e.replace(/\s+/g,"").toLowerCase();let s=[];for(const i of t.values()){if(!e){s.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let t=E(i,e);t&&s.push(t)}return s}(t,this.state.searchQuery).map((t=>t.item)):[]}async _setKeybinding(t,e,s){var i,n,r;1===e.length&&""==e[0]&&(e=[]);const o=await this.props.external.getSettings(),l=null!==(i=o.user.shortcuts)&&void 0!==i?i:[],c=[];let h=!1;for(let i of l)if(i.command===t.command&&i.selector===t.selector&&a.JSONExt.deepEqual(null!==(n=i.args)&&void 0!==n?n:{},null!==(r=t.args)&&void 0!==r?r:{})&&s&&a.JSONExt.deepEqual(s.keys,i.keys)){const t=s&&s.isDefault&&a.JSONExt.deepEqual(s.keys,e);0===e.length||t||c.push({command:i.command,selector:i.selector,keys:e}),h=!0}else{if(s&&!a.JSONExt.deepEqual(s.keys,i.keys)&&0===e.length)continue;c.push(i)}if(!h){const i=!s||!a.JSONExt.deepEqual(s.keys,e);s&&s.isDefault&&i&&c.push({command:t.command,selector:t.selector,disabled:!0,keys:s.keys}),0!==e.length&&c.push({command:t.command,selector:t.selector,keys:e})}await o.set("shortcuts",c),await this._refreshShortcutList()}sortShortcuts(){const t=this.state.filteredShortcutList;let e=this.state.currentSort;"command"===e&&(e="label");const s=t=>{var s;return"source"===e?t.keybindings.every((t=>t.isDefault))?"default":"other":null!==(s=t[e])&&void 0!==s?s:""};t.sort(((t,e)=>{var i,n;const r=s(t),o=s(e),l=r.localeCompare(o);if(l)return l;{const s=null!==(i=t.label)&&void 0!==i?i:"",r=null!==(n=e.label)&&void 0!==n?n:"";return s.localeCompare(r)}})),this.setState({filteredShortcutList:t})}render(){return this.state.shortcutsFetched?d.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},d.createElement(k,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),d.createElement(S,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(t,e)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,e):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}var w=s(81997);const j="@jupyterlab/shortcuts-extension:shortcuts";function x(t,e,s,i){return{translator:s,getSettings:()=>t.load(j,!0),commandRegistry:e.commands,actionRequested:i}}const N={id:j,description:"Adds the keyboard shortcuts editor.",requires:[n.ISettingRegistry],optional:[r.ITranslator,o.IFormRendererRegistry],activate:async(t,e,s,o)=>{const c=null!=s?s:r.nullTranslator,d=c.load("jupyterlab"),{commands:p}=t;let m,g,y={};if(o){const s=new w.Signal({}),n=t=>void 0!==t.dataset.shortcut;t.commands.addCommand(i.editBinding,{label:d.__("Edit Keybinding"),caption:d.__("Edit existing keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"edit-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.deleteBinding,{label:d.__("Delete Keybinding"),caption:d.__("Delete chosen keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"delete-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.addBinding,{label:d.__("Add Keybinding"),caption:d.__("Add new keybinding for existing shortcut target"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.shortcut;if(!i)return console.log("Missing shortcut id to add keybinding to");s.emit({request:"add-keybinding",shortcutId:i})}}),p.addCommand(i.toggleSelectors,{label:d.__("Toggle Selectors"),caption:d.__("Toggle command selectors"),execute:()=>{s.emit({request:"toggle-selectors"})}}),p.addCommand(i.resetAll,{label:d.__("Reset All"),caption:d.__("Reset all shortcuts"),execute:()=>{s.emit({request:"reset-all"})}});const r={fieldRenderer:i=>(t=>u().createElement(I,{external:t.external,height:1e3,width:1e3}))({external:x(e,t,c,s),...i})};o.addRenderer(`${N.id}.shortcuts`,r)}function S(s){const i=t.commands.listCommands().join("\n");g||(g=a.JSONExt.deepCopy(s.properties.shortcuts.default)),y={},s.properties.shortcuts.default=Object.keys(e.plugins).map((t=>{const s=e.plugins[t].schema["jupyter.lab.shortcuts"]||[];return y[t]=s,s})).concat([g]).reduce(((t,e)=>h.Platform.IS_MAC?t.concat(e):t.concat(e.filter((t=>!t.keys.some((t=>{const{cmd:e}=l.CommandRegistry.parseKeystroke(t);return e})))))),[]).sort(((t,e)=>t.command.localeCompare(e.command))),s.properties.shortcuts.description=d.__('Note: To disable a system default shortcut,\ncopy it to User Preferences and add the\n"disabled" key, for example:\n{\n "command": "application:activate-next-tab",\n "keys": [\n "Ctrl Shift ]"\n ],\n "selector": "body",\n "disabled": true\n}\n\nList of commands followed by keyboard shortcuts:\n%1\n\nList of keyboard shortcuts:',i)}e.pluginChanged.connect((async(t,s)=>{if(s!==N.id){const t=y[s],i=e.plugins[s].schema["jupyter.lab.shortcuts"]||[];void 0!==t&&a.JSONExt.deepEqual(t,i)||(m=null,e.plugins[N.id].schema.properties.shortcuts.default=g,await e.load(N.id,!0))}})),e.transform(N.id,{compose:t=>{var e,s,i,r;m||(m=a.JSONExt.deepCopy(t.schema),S(m));const o=null!==(i=null===(s=null===(e=m.properties)||void 0===e?void 0:e.shortcuts)||void 0===s?void 0:s.default)&&void 0!==i?i:[],l={shortcuts:null!==(r=t.data.user.shortcuts)&&void 0!==r?r:[]},c={shortcuts:n.SettingRegistry.reconcileShortcuts(o,l.shortcuts)};return t.data={composite:c,user:l},t},fetch:t=>(m||(m=a.JSONExt.deepCopy(t.schema),S(m)),{data:t.data,id:t.id,raw:t.raw,schema:m,version:t.version})});try{m=null;const t=await e.load(N.id);A.loadShortcuts(p,t.composite),t.changed.connect((()=>{A.loadShortcuts(p,t.composite)}))}catch(t){console.error(`Loading ${N.id} failed.`,t)}},autoStart:!0},K=N;var A;!function(t){let e;t.loadShortcuts=function(t,s){var i;const n=null!==(i=null==s?void 0:s.shortcuts)&&void 0!==i?i:[];e&&e.dispose(),e=n.reduce(((e,s)=>{const i=function(t){if(!t||"object"!=typeof t)return;const{isArray:e}=Array;return"command"in t&&"keys"in t&&"selector"in t&&e(t.keys)?t:void 0}(s);return i&&e.add(t.addKeyBinding(i)),e}),new c.DisposableSet)}}(A||(A={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[113],{113:(t,e,s)=>{s.r(e),s.d(e,{default:()=>A});var i,n=s(3012),r=s(93050),o=s(76878),l=s(86072),a=s(21961),c=s(49901),h=s(47392);!function(t){t.editBinding="shortcuts:edit-keybinding",t.addBinding="shortcuts:add-keybinding",t.deleteBinding="shortcuts:delete-keybinding",t.toggleSelectors="shortcuts:toggle-selectors",t.resetAll="shortcuts:reset-all"}(i||(i={}));var d=s(78156),u=s.n(d),p=s(14931),m=s(70013);const g="jp-Shortcuts-ConflictContainer";class y extends d.Component{constructor(t){super(t),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?this.props.toggleInput():await this._updateShortcut():(await this._updateShortcut(),this.props.toggleInput())},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this._handleOverwrite=async(t,e)=>{for(const s of t){const t=s.keybindings.filter((t=>a.JSONExt.deepEqual(t.keys,e)||e.some((e=>a.JSONExt.deepEqual(t.keys,[e])))))[0];t?await this.props.deleteKeybinding(s,t):console.error(`Conflicting binding could not be found for ${s} using keys ${e}`)}await this._updateShortcut()},this.parseChaining=(t,e,s,i,n)=>{let r=m.EN_US.keyForKeydownEvent(t.nativeEvent);const o=["Shift","Control","Alt","Meta","Ctrl","Accel"];if("Backspace"===t.key)s="",i=[],n="",this.setState({value:"",userInput:s,keys:i,currentChain:n});else if("CapsLock"!==t.key){const e=s.substr(s.lastIndexOf(" ")+1,s.length).trim();-1===o.lastIndexOf(e)&&""!=e?(s+=",",i.push(n),n="",t.ctrlKey&&"Control"!=t.key&&(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()),t.metaKey&&"Meta"!=t.key&&(s=(s+" Accel").trim(),n=(n+" Accel").trim()),t.altKey&&"Alt"!=t.key&&(s=(s+" Alt").trim(),n=(n+" Alt").trim()),t.shiftKey&&"Shift"!=t.key&&(s=(s+" Shift").trim(),n=(n+" Shift").trim()),-1===o.lastIndexOf(t.key)?(s=(s+" "+r).trim(),n=(n+" "+r).trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+t.key).trim(),n=(n+" "+t.key).trim())):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+r).trim(),n=(n+" "+r).trim())}return this.setState({keys:i,currentChain:n}),[s,i,n]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],e=this.state.currentChain.split(" "),s=e[e.length-1];return this.setState({isFunctional:!(-1!==t.indexOf(s))}),-1!==t.indexOf(s)},this.checkShortcutAvailability=(t,e,s)=>{const i=this.props.findConflictsFor([...e,s],this.props.shortcut.selector),n=""===t||0===i.length;return!n&&1===i.length&&i[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:n}),i)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const e=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=e[0],i=e[1],n=e[2],r=this.props.toSymbols(s);let o=this.checkShortcutAvailability(s,i,n);this.setState({value:r,userInput:s,keys:i,currentChain:n},(()=>{this.checkNonFunctional(),this._emitConflicts(o)}))},this._handleBlur=t=>{var e,s;(null===(e=this._ref.current)||void 0===e?void 0:e.contains(t.relatedTarget))||(null===(s=t.relatedTarget)||void 0===s?void 0:s.closest(`.${g}`))||this.props.toggleInput()},this._ref=d.createRef(),this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(t){const e=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:t,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:!0}),await this._handleOverwrite(t,e),this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const t=this.props.translator.load("jupyterlab");let e="jp-Shortcuts-Input";return this.state.isAvailable||(e+=" jp-mod-unavailable-Input"),d.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},d.createElement("div",{tabIndex:0,className:e,onKeyDown:this.handleInput,ref:t=>t&&t.focus(),"data-lm-suppress-shortcuts":"true"},d.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":""===this.state.value?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},""===this.state.value?t.__("press keys"):this.state.value)),d.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit},this.state.isAvailable?d.createElement(o.checkIcon.react,null):d.createElement(o.errorIcon.react,null)))}}class S extends d.Component{constructor(t){super(t),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})},this.toSymbols=t=>t.split(" ").reduce(((t,e)=>"Ctrl"===e?(t+" ⌃").trim():"Alt"===e?(t+" ⌥").trim():"Shift"===e?(t+" ⇧").trim():"Accel"===e&&h.Platform.IS_MAC?(t+" ⌘").trim():"Accel"===e?(t+" ⌃").trim():(t+" "+e).trim()),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if(!("shortcutId"in e)||e.shortcutId===this.props.shortcut.id){if("add-keybinding"===e.request)return this.toggleInputNew();if("edit-keybinding"===e.request&&this.toggleInputReplaceMethod(e.keybinding),"delete-keybinding"===e.request){const t=this.props.shortcut,s=t.keybindings[e.keybinding];this.props.deleteKeybinding(t,s).catch(console.error)}}}getCategoryCell(){return d.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var t;return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-label"},null!==(t=this.props.shortcut.label)&&void 0!==t?t:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return d.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const t=this.props.shortcut.keybindings.every((t=>t.isDefault));return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(t){const e=["jp-Shortcuts-ShortcutCell"];switch(t.length){case 1:e.push("jp-Shortcuts-SingleCell");break;case 0:e.push("jp-Shortcuts-EmptyCell")}return e.join(" ")}toggleInputReplaceMethod(t){const e=this.state.displayReplaceInput[t];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[t]:!e},conflicts:new Map})}getDisplayReplaceInput(t){return this.state.displayReplaceInput[t]}getOrDiplayIfNeeded(t){const e=["jp-Shortcuts-Or"];return(t||this.state.displayNewInput)&&e.push("jp-Shortcuts-Or-Forced"),d.createElement("div",{className:e.join(" ")},this._trans.__("or"))}getShortCutAsInput(t,e){return d.createElement(y,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(e),shortcut:this.props.shortcut,keybinding:t,displayConflicts:e=>{const s=new Map(this.state.conflicts);s.set(t,e),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(e),placeholder:this.toSymbols(t.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(t){return t.keys.map(((e,s)=>d.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:s},d.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(e)),s+1<t.keys.length?d.createElement("div",{className:"jp-Shortcuts-Comma"},","):null)))}isLocationBeingEdited(t){return this.state.displayReplaceInput[t]}getDivForKey(t,e,s){return d.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+t,"data-keybinding":t,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(t)},this.isLocationBeingEdited(t)?this.getShortCutAsInput(e,t):this.getShortCutForDisplayOnly(e),this.getOrDiplayIfNeeded(t<s.length-1))}getAddLink(){return d.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?d.createElement(y,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:t=>{const e=new Map(this.state.conflicts);e.set(null,t),this.setState({conflicts:e})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):d.createElement("div",null)}getShortCutsCell(t){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:this.getClassNameForShortCuts(t)},t.map(((e,s)=>this.getDivForKey(s,e,t))),t.length>=1&&!this.state.displayNewInput&&!this.state.displayReplaceInput[0]&&this.getAddLink(),0===t.length&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const t=[...this.state.conflicts.values()].filter((t=>0!==t.conflictsWith.length));return 0===t.length?d.createElement(d.Fragment,null):d.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},d.createElement("div",{className:g},t.map((t=>{const e=t.keys.join(" ")+"_"+t.conflictsWith.map((t=>t.id)).join("");return d.createElement("div",{className:"jp-Shortcuts-Conflict",key:e},d.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map((t=>{var e;return null!==(e=t.label)&&void 0!==e?e:t.command})).join(", "))),d.createElement("div",{className:"jp-Shortcuts-ErrorButton"},d.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(t),t.cancel()}},this._trans.__("Cancel")),d.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(t),t.overwrite()}},this._trans.__("Overwrite"))))}))))}_clearConflict(t){const e=new Map,s=this._conflictId(t);for(const[t,i]of this.state.conflicts.entries())this._conflictId(i)!==s&&e.set(t,i);this.setState({conflicts:e})}_conflictId(t){return t.keys.join(" ")+"_"+t.conflictsWith.map((t=>t.id)).join("")}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter((t=>0!==t.keys.filter((t=>""!=t)).length))}render(){return d.createElement(d.Fragment,null,d.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}class f extends d.Component{render(){return d.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:this.props.height-115+"px"},id:"shortcutListContainer"},d.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map((t=>d.createElement(S,{key:t.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:t,showSelectors:this.props.showSelectors,external:this.props.external})))))}}class b extends d.Component{render(){return d.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,d.createElement(o.caretDownEmptyThinIcon.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function C(t){return d.createElement("div",{className:"jp-Shortcuts-Symbols"},d.createElement("table",null,d.createElement("tbody",null,d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Cmd")),d.createElement("td",null,"⌘"),d.createElement("td",null,d.createElement("kbd",null,"Ctrl")),d.createElement("td",null,"⌃")),d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Alt")),d.createElement("td",null,"⌥"),d.createElement("td",null,d.createElement("kbd",null,"Shift")),d.createElement("td",null,"⇧")))))}function _(t){const e=t.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.toggleSelectors()},t.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.resetShortcuts()},e.__("Reset All")))}class v extends d.Component{constructor(t){super(t)}getShortCutTitleItem(t,e){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement(b,{title:t,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:e}))}render(){const t=this.props.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-Top"},d.createElement("div",{className:"jp-Shortcuts-TopNav"},d.createElement(C,null),d.createElement(o.FilterBox,{"aria-label":t.__("Search shortcuts"),updateFilter:(t,e)=>this.props.updateSearchQuery(null!=e?e:""),placeholder:t.__("Search…"),useFuzzyFilter:!1}),d.createElement(_,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),d.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},d.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(t.__("Category"),"category"),this.getShortCutTitleItem(t.__("Command"),"command"),d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"title-div"},t.__("Shortcut"))),this.getShortCutTitleItem(t.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(t.__("Selectors"),"selector"))))}}class k extends Map{constructor(t){var e,s,i;super();const{settings:n,commandRegistry:r}=t,o=null!==(e=n.user.shortcuts)&&void 0!==e?e:[],l=new Set(o.map(this._computeKeybindingId.bind(this))),a=null!==(s=n.composite.shortcuts)&&void 0!==s?s:[];for(const t of a){const e=this._computeTargetId(t),s=this._computeKeybindingId(t),n={keys:t.keys,isDefault:!l.has(s)},o=this.get(e);if(o)o.keybindings.push(n);else{const s=t.command.split(":"),o=null!==(i=r.label(t.command,t.args))&&void 0!==i?i:s.length>1?s[1]:void 0,l=s[0];this.set(e,{id:e,selector:t.selector,command:t.command,category:l,label:o,args:t.args,keybindings:[n]})}}}findConflictsFor(t,e){const s=new E({registry:this});let i=s.findConflicts(t,e);if(0!==i.length)return i;for(const n of t)if(i=s.findConflicts([n],e),0!==i.length)return i;return[]}_computeTargetId(t){var e;return t.command+"_"+t.selector+"_"+JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{})}_computeKeybindingId(t){var e;return[t.command,t.selector,JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{}),t.keys.join(" ")].join("_")}}class E{constructor(t){var e;const s=new Map;for(const i of t.registry.values())for(const t of i.keybindings){const n=this._keybindingHash(t.keys,i.selector),r=null!==(e=s.get(n))&&void 0!==e?e:[];r.push(i),s.set(n,r)}this._keybindingsMap=s}findConflicts(t,e){var s;const i=this._keybindingHash(t,e);return null!==(s=this._keybindingsMap.get(i))&&void 0!==s?s:[]}_keybindingHash(t,e){return t.join(" ")+"_"+e}}function I(t,e){var s;const i=t.category.toLowerCase(),n=`${i} ${(null!==(s=t.label)&&void 0!==s?s:"").toLowerCase()}`;let r=1/0,o=null;const l=/\b\w/g;for(;;){const t=l.exec(n);if(!t)break;const s=p.StringExt.matchSumOfDeltas(n,e,t.index);if(!s)break;s&&s.score<=r&&(r=s.score,o=s.indices)}if(!o||r===1/0)return null;const a=i.length+1,c=p.ArrayExt.lowerBound(o,a,((t,e)=>t-e)),h=o.slice(0,c),d=o.slice(c);for(let t=0,e=d.length;t<e;++t)d[t]-=a;return 0===h.length?{matchType:0,categoryIndices:null,labelIndices:d,score:r,item:t}:0===d.length?{matchType:1,categoryIndices:h,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:h,labelIndices:d,score:r,item:t}}class w extends d.Component{constructor(t){super(t),this.updateSearchQuery=t=>{this.setState({searchQuery:t},(()=>{const t=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(t)},(()=>{this.sortShortcuts()}))}))},this.resetShortcuts=async()=>{const t=await this.props.external.getSettings();await t.set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{await this._setKeybinding(t,[])},this.replaceKeybinding=async(t,e,s)=>this._setKeybinding(t,s,e),this.deleteKeybinding=async(t,e)=>{await this._setKeybinding(t,[],e)},this.addKeybinding=async(t,e)=>{await this._setKeybinding(t,e)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if("toggle-selectors"===e.request)return this.toggleSelectors();"reset-all"===e.request&&await this.resetShortcuts()}async _refreshShortcutList(){const t=await this.props.external.getSettings(),e=new k({commandRegistry:this.props.external.commandRegistry,settings:t});this.setState({shortcutRegistry:e,filteredShortcutList:this._searchFilterShortcuts(e),shortcutsFetched:!0},(()=>{this.sortShortcuts()}))}_searchFilterShortcuts(t){return t?function(t,e){e=e.replace(/\s+/g,"").toLowerCase();let s=[];for(const i of t.values()){if(!e){s.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let t=I(i,e);t&&s.push(t)}return s}(t,this.state.searchQuery).map((t=>t.item)):[]}async _setKeybinding(t,e,s){var i,n,r,o,l;1===e.length&&""==e[0]&&(e=[]);const c=await this.props.external.getSettings(),h=null!==(i=c.user.shortcuts)&&void 0!==i?i:[],d=[];let u=!1;for(let i of h)if(i.command===t.command&&i.selector===t.selector&&a.JSONExt.deepEqual(null!==(n=i.args)&&void 0!==n?n:{},null!==(r=t.args)&&void 0!==r?r:{})&&s&&a.JSONExt.deepEqual(s.keys,i.keys)){const t=s&&s.isDefault&&a.JSONExt.deepEqual(s.keys,e);0===e.length||t||d.push({command:i.command,selector:i.selector,keys:e}),u=!0}else{if(i.command===t.command&&i.selector===t.selector&&a.JSONExt.deepEqual(null!==(o=i.args)&&void 0!==o?o:{},null!==(l=t.args)&&void 0!==l?l:{})&&!s&&0===e.length)continue;d.push(i)}if(!u){const i=!s||!a.JSONExt.deepEqual(s.keys,e);s&&s.isDefault&&i&&d.push({command:t.command,selector:t.selector,disabled:!0,keys:s.keys}),0!==e.length&&d.push({command:t.command,selector:t.selector,keys:e})}await c.set("shortcuts",d),await this._refreshShortcutList()}sortShortcuts(){const t=this.state.filteredShortcutList;let e=this.state.currentSort;"command"===e&&(e="label");const s=t=>{var s;return"source"===e?t.keybindings.every((t=>t.isDefault))?"default":"other":null!==(s=t[e])&&void 0!==s?s:""};t.sort(((t,e)=>{var i,n;const r=s(t),o=s(e),l=r.localeCompare(o);if(l)return l;{const s=null!==(i=t.label)&&void 0!==i?i:"",r=null!==(n=e.label)&&void 0!==n?n:"";return s.localeCompare(r)}})),this.setState({filteredShortcutList:t})}render(){return this.state.shortcutsFetched?d.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},d.createElement(v,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),d.createElement(f,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(t,e)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,e):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}var j=s(2159);const N="@jupyterlab/shortcuts-extension:shortcuts";function x(t,e,s,i){return{translator:s,getSettings:()=>t.load(N,!0),commandRegistry:e.commands,actionRequested:i}}const K={id:N,description:"Adds the keyboard shortcuts editor.",requires:[n.ISettingRegistry],optional:[r.ITranslator,o.IFormRendererRegistry],activate:async(t,e,s,o)=>{const c=null!=s?s:r.nullTranslator,d=c.load("jupyterlab"),{commands:p}=t;let m,g,y={};if(o){const s=new j.Signal({}),n=t=>void 0!==t.dataset.shortcut;t.commands.addCommand(i.editBinding,{label:d.__("Edit Keybinding"),caption:d.__("Edit existing keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"edit-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.deleteBinding,{label:d.__("Delete Keybinding"),caption:d.__("Delete chosen keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"delete-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.addBinding,{label:d.__("Add Keybinding"),caption:d.__("Add new keybinding for existing shortcut target"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.shortcut;if(!i)return console.log("Missing shortcut id to add keybinding to");s.emit({request:"add-keybinding",shortcutId:i})}}),p.addCommand(i.toggleSelectors,{label:d.__("Toggle Selectors"),caption:d.__("Toggle command selectors"),execute:()=>{s.emit({request:"toggle-selectors"})}}),p.addCommand(i.resetAll,{label:d.__("Reset All"),caption:d.__("Reset all shortcuts"),execute:()=>{s.emit({request:"reset-all"})}});const r={fieldRenderer:i=>(t=>u().createElement(w,{external:t.external,height:1e3,width:1e3}))({external:x(e,t,c,s),...i})};o.addRenderer(`${K.id}.shortcuts`,r)}function S(s){const i=t.commands.listCommands().join("\n");g||(g=a.JSONExt.deepCopy(s.properties.shortcuts.default)),y={},s.properties.shortcuts.default=Object.keys(e.plugins).map((t=>{const s=e.plugins[t].schema["jupyter.lab.shortcuts"]||[];return y[t]=s,s})).concat([g]).reduce(((t,e)=>h.Platform.IS_MAC?t.concat(e):t.concat(e.filter((t=>!t.keys.some((t=>{const{cmd:e}=l.CommandRegistry.parseKeystroke(t);return e})))))),[]).sort(((t,e)=>t.command.localeCompare(e.command))),s.properties.shortcuts.description=d.__('Note: To disable a system default shortcut,\ncopy it to User Preferences and add the\n"disabled" key, for example:\n{\n "command": "application:activate-next-tab",\n "keys": [\n "Ctrl Shift ]"\n ],\n "selector": "body",\n "disabled": true\n}\n\nList of commands followed by keyboard shortcuts:\n%1\n\nList of keyboard shortcuts:',i)}e.pluginChanged.connect((async(t,s)=>{if(s!==K.id){const t=y[s],i=e.plugins[s].schema["jupyter.lab.shortcuts"]||[];void 0!==t&&a.JSONExt.deepEqual(t,i)||(m=null,e.plugins[K.id].schema.properties.shortcuts.default=g,await e.load(K.id,!0))}})),e.transform(K.id,{compose:t=>{var e,s,i,r;m||(m=a.JSONExt.deepCopy(t.schema),S(m));const o=null!==(i=null===(s=null===(e=m.properties)||void 0===e?void 0:e.shortcuts)||void 0===s?void 0:s.default)&&void 0!==i?i:[],l={shortcuts:null!==(r=t.data.user.shortcuts)&&void 0!==r?r:[]},c={shortcuts:n.SettingRegistry.reconcileShortcuts(o,l.shortcuts)};return t.data={composite:c,user:l},t},fetch:t=>(m||(m=a.JSONExt.deepCopy(t.schema),S(m)),{data:t.data,id:t.id,raw:t.raw,schema:m,version:t.version})});try{m=null;const t=await e.load(K.id);R.loadShortcuts(p,t.composite),t.changed.connect((()=>{R.loadShortcuts(p,t.composite)}))}catch(t){console.error(`Loading ${K.id} failed.`,t)}},autoStart:!0},A=K;var R;!function(t){let e;t.loadShortcuts=function(t,s){var i;const n=null!==(i=null==s?void 0:s.shortcuts)&&void 0!==i?i:[];e&&e.dispose(),e=n.reduce(((e,s)=>{const i=function(t){if(!t||"object"!=typeof t)return;const{isArray:e}=Array;return"command"in t&&"keys"in t&&"selector"in t&&e(t.keys)?t:void 0}(s);return i&&e.add(t.addKeyBinding(i)),e}),new c.DisposableSet)}}(R||(R={}))}}]);
|
notebook/static/1198.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1198,8907],{41198:(t,e,s)=>{s.r(e),s.d(e,{IPropertyInspectorProvider:()=>c,SideBarPropertyInspectorProvider:()=>a});var n=s(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1198,8907],{41198:(t,e,s)=>{s.r(e),s.d(e,{IPropertyInspectorProvider:()=>c,SideBarPropertyInspectorProvider:()=>a});var n=s(93050),r=s(76878),o=s(2159),i=s(2260);const c=new(s(21961).Token)("@jupyterlab/property-inspector:IPropertyInspectorProvider","A service to register new widgets in the property inspector side panel.");class h extends i.Widget{constructor(){super(),this._tracker=new i.FocusTracker,this._inspectors=new Map,this.addClass("jp-PropertyInspector"),this._tracker=new i.FocusTracker,this._tracker.currentChanged.connect(this._onCurrentChanged,this)}register(t){if(this._inspectors.has(t))throw new Error("Widget is already registered");const e=new l.PropertyInspector(t);return t.disposed.connect(this._onWidgetDisposed,this),this._inspectors.set(t,e),e.onAction.connect(this._onInspectorAction,this),this._tracker.add(t),e}get currentWidget(){return this._tracker.currentWidget}refresh(){const t=this._tracker.currentWidget;if(!t)return void this.setContent(null);const e=this._inspectors.get(t);e&&this.setContent(e.content)}_onWidgetDisposed(t){const e=this._inspectors.get(t);e&&(e.dispose(),this._inspectors.delete(t))}_onInspectorAction(t,e){const s=t.owner,n=this._tracker.currentWidget;switch(e){case"content":n===s&&this.setContent(t.content);break;case"dispose":s&&(this._tracker.remove(s),this._inspectors.delete(s));break;case"show-panel":n===s&&this.showPanel();break;default:throw new Error("Unsupported inspector action")}}_onCurrentChanged(){const t=this._tracker.currentWidget;if(t){const e=this._inspectors.get(t).content;this.setContent(e)}else this.setContent(null)}}class a extends h{constructor({shell:t,placeholder:e,translator:s}){super(),this._labshell=t,this.translator=s||n.nullTranslator,this._trans=this.translator.load("jupyterlab");const r=this.layout=new i.SingletonLayout;if(e)this._placeholder=e;else{const t=document.createElement("div"),e=document.createElement("div"),s=document.createElement("h3"),n=document.createElement("p");s.textContent=this._trans.__("No Properties"),n.textContent=this._trans.__("The property inspector allows to view and edit properties of a selected notebook."),e.className="jp-PropertyInspector-placeholderContent",e.appendChild(s),e.appendChild(n),t.appendChild(e),this._placeholder=new i.Widget({node:t}),this._placeholder.addClass("jp-PropertyInspector-placeholder")}r.widget=this._placeholder,this._labshell.currentChanged.connect(this._onShellCurrentChanged,this),this._onShellCurrentChanged()}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-PropertyInspector-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-PropertyInspector-content"),e.widget=t}showPanel(){this._labshell.activateById(this.id)}_onShellCurrentChanged(){const t=this.currentWidget;if(!t)return void this.setContent(null);const e=this._labshell.currentWidget;(null==e?void 0:e.node.contains(t.node))?this.refresh():this.setContent(null)}}var l;!function(t){t.PropertyInspector=class{constructor(t){this._isDisposed=!1,this._content=null,this._owner=null,this._onAction=new o.Signal(this),this._owner=t}get owner(){return this._owner}get content(){return this._content}get isDisposed(){return this._isDisposed}get onAction(){return this._onAction}showPanel(){this._isDisposed||this._onAction.emit("show-panel")}render(t){this._isDisposed||(t instanceof i.Widget?this._content=t:this._content=r.ReactWidget.create(t),this._onAction.emit("content"))}dispose(){this._isDisposed||(this._isDisposed=!0,this._content=null,this._owner=null,o.Signal.clearData(this))}}}(l||(l={}))}}]);
|
notebook/static/134.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(71370),n=s(58194),i=s(2159);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
|
notebook/static/1408.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(21961),s=a(58194);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class o{constructor(){this._initialized=!1}async _ensureInitialized(){this._initialized||(this._mathDocument=await c.ensureMathDocument(),this._initialized=!0)}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const r={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:s.ILatexTypesetter,activate:e=>{const t=new o;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0};var c;!function(e){let t=null;e.ensureMathDocument=async function(){if(!t){t=new i.PromiseDelegate,Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const[{mathjax:e},{CHTML:n},{TeX:s},{TeXFont:o},{AllPackages:r},{SafeHandler:c},{HTMLHandler:l},{browserAdaptor:m},{AssistiveMmlHandler:h}]=await Promise.all([a.e(4971).then(a.bind(a,44971)),Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),a.e(8285).then(a.t.bind(a,78285,23)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),a.e(270).then(a.bind(a,90270)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23))]);e.handlers.register(h(c(new l(m()))));class d extends o{}d.defaultFonts={};const u=new n({font:new d}),p=new s({packages:r.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}),x=e.document(window.document,{InputJax:p,OutputJax:u});t.resolve(x)}return t.promise}}(c||(c={}))}}]);
|
notebook/static/1496.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(27961),s=n(15465),r=n(44548),l=n(2646),o=n(25291),i=n(12668),c=n(78156),d=n(60211),u=n(20998),m=n(81997),h=n(24475),p=n(63485);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"csv",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© 2015-2023 Project Jupyter Contributors")),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.createButton({label:r.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"],loading:"lazy"});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.createButton({label:l.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),m.addGroup([{command:k}],20);const y=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),y.push({command:t})})),m.addGroup(y,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function y(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=y(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${m} ${t.title}`},icon:e=>y(`${e.format}`).icon,execute:async e=>{var t;const n=y(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(73852),s=n(53876),r=n(20754),l=n(70607),o=n(93050),i=n(76878),c=n(78156),d=n(5348),u=n(21961),m=n(2159),h=n(47087),p=n(2260);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"json",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© %1-%2 Project Jupyter Contributors",2015,2024)),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.createButton({label:r.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"],loading:"lazy"});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.createButton({label:l.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),m.addGroup([{command:k}],20);const y=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),y.push({command:t})})),m.addGroup(y,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function y(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=y(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${m} ${t.title}`},icon:e=>y(`${e.format}`).icon,execute:async e=>{var t;const n=y(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
|
notebook/static/1584.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1584,4434],{31584:(t,e,n)=>{n.r(e),n.d(e,{DocInput:()=>b,HighlightStyle:()=>Dt,IndentContext:()=>F,LRLanguage:()=>p,Language:()=>f,LanguageDescription:()=>N,LanguageSupport:()=>I,ParseContext:()=>x,StreamLanguage:()=>ee,StringStream:()=>Qt,TreeIndentContext:()=>_,bidiIsolates:()=>ve,bracketMatching:()=>Ht,bracketMatchingHandle:()=>Gt,codeFolding:()=>bt,continuedIndent:()=>J,defaultHighlightStyle:()=>Mt,defineLanguageFacet:()=>u,delimitedIndent:()=>z,ensureSyntaxTree:()=>m,flatIndent:()=>G,foldAll:()=>dt,foldCode:()=>ut,foldEffect:()=>nt,foldGutter:()=>At,foldInside:()=>Q,foldKeymap:()=>kt,foldNodeProp:()=>Z,foldService:()=>K,foldState:()=>it,foldable:()=>tt,foldedRanges:()=>ot,forceParsing:()=>w,getIndentUnit:()=>L,getIndentation:()=>R,highlightingFor:()=>Lt,indentNodeProp:()=>V,indentOnInput:()=>Y,indentRange:()=>M,indentService:()=>O,indentString:()=>B,indentUnit:()=>E,language:()=>D,languageDataProp:()=>h,matchBrackets:()=>Yt,sublanguageProp:()=>c,syntaxHighlighting:()=>Et,syntaxParserRunning:()=>v,syntaxTree:()=>g,syntaxTreeAvailable:()=>k,toggleFold:()=>mt,unfoldAll:()=>pt,unfoldCode:()=>ct,unfoldEffect:()=>rt});var r,s=n(79352),i=n(89843),o=n(37960),a=n(92209),l=n(4434);const h=new s.NodeProp;function u(t){return i.Facet.define({combine:t?e=>e.concat(t):void 0})}const c=new s.NodeProp;class f{constructor(t,e,n=[],r=""){this.data=t,this.name=r,i.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(i.EditorState.prototype,"tree",{get(){return g(this)}}),this.parser=e,this.extension=[D.of(this),i.EditorState.languageData.of(((t,e,n)=>{let r=d(t,e,n),s=r.type.prop(h);if(!s)return[];let i=t.facet(s),o=r.type.prop(c);if(o){let s=r.resolve(e-r.from,n);for(let e of o)if(e.test(s,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(t,e,n=-1){return d(t,e,n).type.prop(h)==this.data}findRegions(t){let e=t.facet(D);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],r=(t,e)=>{if(t.prop(h)==this.data)return void n.push({from:e,to:e+t.length});let i=t.prop(s.NodeProp.mounted);if(i){if(i.tree.prop(h)==this.data){if(i.overlay)for(let t of i.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(i.overlay){let t=n.length;if(r(i.tree,i.overlay[0].from+e),n.length>t)return}}for(let n=0;n<t.children.length;n++){let i=t.children[n];i instanceof s.Tree&&r(i,t.positions[n]+e)}};return r(g(t),0),n}get allowsNesting(){return!0}}function d(t,e,n){let r=t.facet(D),i=g(t).topNode;if(!r||r.allowsNesting)for(let t=i;t;t=t.enter(e,n,s.IterMode.ExcludeBuffers))t.type.isTop&&(i=t);return i}f.setState=i.StateEffect.define();class p extends f{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=u(t.languageData);return new p(e,t.parser.configure({props:[h.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function g(t){let e=t.field(f.state,!1);return e?e.tree:s.Tree.empty}function m(t,e,n=50){var r;let s=null===(r=t.field(f.state,!1))||void 0===r?void 0:r.context;if(!s)return null;let i=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(i),o}function k(t,e=t.doc.length){var n;return(null===(n=t.field(f.state,!1))||void 0===n?void 0:n.context.isDone(e))||!1}function w(t,e=t.viewport.to,n=100){let r=m(t.state,e,n);return r!=g(t.state)&&t.dispatch({}),!!r}function v(t){var e;return(null===(e=t.plugin(C))||void 0===e?void 0:e.isWorking())||!1}class b{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let y=null;class x{constructor(t,e,n=[],r,s,i,o,a){this.parser=t,this.state=e,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=i,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new x(t,e,[],s.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new b(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=s.Tree.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=y;y=this;try{return t()}finally{y=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=S(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,n,r,s)=>e.push({fromA:t,toA:n,fromB:r,toB:s}))),n=s.TreeFragment.applyChanges(n,e),r=s.Tree.empty,i=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){a=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&a.push({from:n,to:r})}}}return new x(this.parser,e,n,r,i,o,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:n,to:r}=this.skipped[e];n<t.to&&r>t.from&&(this.fragments=S(this.fragments,n,r),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends s.Parser{createParse(e,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let e=y;if(e){for(let t of r)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new s.Tree(s.NodeType.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return y}}function S(t,e,n){return s.TreeFragment.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class T{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new T(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=x.create(t.facet(D).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new T(n)}}f.state=i.StateField.define({create:T.init,update(t,e){for(let t of e.effects)if(t.is(f.setState))return t.value;return e.startState.facet(D)!=e.state.facet(D)?T.init(e.state):t.apply(e)}});let P=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(P=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const A="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,C=o.ViewPlugin.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(f.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(f.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=P(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(f.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,t&&!A?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<r&&n.doc.length>r+1e3,a=s.context.work((()=>A&&A()||Date.now()>i),r+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:f.setState.of(new T(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,o.logException)(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),D=i.Facet.define({combine:t=>t.length?t[0]:null,enables:t=>[f.state,C,o.EditorView.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class I{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class N{constructor(t,e,n,r,s,i=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=i,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new N(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n)for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e;return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some((t=>t==e)))return n;if(n)for(let n of t)for(let t of n.alias){let r=e.indexOf(t);if(r>-1&&(t.length>2||!/\w/.test(e[r-1])&&!/\w/.test(e[r+t.length])))return n}return null}}const O=i.Facet.define(),E=i.Facet.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function L(t){let e=t.facet(E);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){let n="",r=t.tabSize,s=t.facet(E)[0];if("\t"==s){for(;e>=r;)n+="\t",e-=r;s=" "}for(let t=0;t<e;t++)n+=s;return n}function R(t,e){t instanceof i.EditorState&&(t=new F(t));for(let n of t.state.facet(O)){let r=n(t,e);if(void 0!==r)return r}let n=g(t.state);return n.length>=e?function(t,e,n){let r=e.resolveStack(n),s=r.node.enterUnfinishedNodesBefore(n);if(s!=r.node){let t=[];for(let e=s;e!=r.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return U(r,t,n)}(t,n,e):null}function M(t,e,n){let r=Object.create(null),s=new F(t,{overrideIndentation:t=>{var e;return null!==(e=r[t])&&void 0!==e?e:-1}}),i=[];for(let o=e;o<=n;){let e=t.doc.lineAt(o);o=e.to+1;let n=R(s,e.from);if(null==n)continue;/\S/.test(e.text)||(n=0);let a=/^\s*/.exec(e.text)[0],l=B(t,n);a!=l&&(r[e.from]=n,i.push({from:e.from,to:e.from+a.length,insert:l}))}return t.changes(i)}class F{constructor(t,e={}){this.state=t,this.options=e,this.unit=L(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return null!=r&&r>=n.from&&r<=n.to?s&&r==t?{text:"",from:t}:(e<0?r<t:r<=t)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(t,e);return n.slice(t-r,Math.min(n.length,t+100-r))}column(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.countColumn(n,t-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(s+=i-this.countColumn(n,n.search(/\S|$/))),s}countColumn(t,e=t.length){return(0,i.countColumn)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(r);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const V=new s.NodeProp;function U(t,e,n){for(let r=t;r;r=r.next){let t=j(r.node);if(t)return t(_.create(e,n,r))}return 0}function j(t){let e=t.type.prop(V);if(e)return e;let n,r=t.firstChild;if(r&&(n=r.type.prop(s.NodeProp.closedBy))){let e=t.lastChild,r=e&&n.indexOf(e.name)>-1;return t=>H(t,!0,1,void 0,r&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?W:null}function W(){return 0}class _ extends F{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new _(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return U(this.context.next,this.base,this.pos)}}function $(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function z({closing:t,align:e=!0,units:n=1}){return r=>H(r,e,n,t)}function H(t,e,n,r,s){let i=t.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==t.pos+o,l=e?function(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),o=null==s||s<=i.from?i.to:Math.min(i.to,s);for(let t=n.to;;){let s=e.childAfter(t);if(!s||s==r)return null;if(!s.type.isSkipped)return s.from<o?n:null;t=s.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const G=t=>t.baseIndent;function J({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const q=200;function Y(){return i.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+q)return t;let i=n.sliceString(s.from,r);if(!e.some((t=>t.test(i))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let n=R(o,e.from);if(null==n)continue;let r=/^\s*/.exec(e.text)[0],s=B(o,n);r!=s&&l.push({from:e.from,to:e.from+r.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const K=i.Facet.define(),Z=new s.NodeProp;function Q(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function X(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function tt(t,e,n){for(let r of t.facet(K)){let s=r(t,e,n);if(s)return s}return function(t,e,n){let r=g(t);if(r.length<n)return null;let s=null;for(let i=r.resolveStack(n,1);i;i=i.next){let o=i.node;if(o.to<=n||o.from>n)continue;if(s&&o.from<e)break;let a=o.type.prop(Z);if(a&&(o.to<r.length-50||r.length==t.doc.length||!X(o))){let r=a(o,t);r&&r.from<=n&&r.from>=e&&r.to>n&&(s=r)}}return s}(t,e,n)}function et(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const nt=i.StateEffect.define({map:et}),rt=i.StateEffect.define({map:et});function st(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some((t=>t.from<=n&&t.to>=n))||e.push(t.lineBlockAt(n));return e}const it=i.StateField.define({create:()=>o.Decoration.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(nt)&&!lt(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(vt),s=r?o.Decoration.replace({widget:new St(r(e.state,n.value))}):xt;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(rt)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,((t,e)=>{t<r&&e>r&&(n=!0)})),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r}))}return t},provide:t=>o.EditorView.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,((t,e)=>{n.push(t,e)})),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if("number"!=typeof r||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");e.push(xt.range(r,s))}return o.Decoration.set(e,!0)}});function ot(t){return t.field(it,!1)||i.RangeSet.empty}function at(t,e,n){var r;let s=null;return null===(r=t.field(it,!1))||void 0===r||r.between(e,n,((t,e)=>{(!s||s.from>t)&&(s={from:t,to:e})})),s}function lt(t,e,n){let r=!1;return t.between(e,e,((t,s)=>{t==e&&s==n&&(r=!0)})),r}function ht(t,e){return t.field(it,!1)?e:e.concat(i.StateEffect.appendConfig.of(bt()))}const ut=t=>{for(let e of st(t)){let n=tt(t.state,e.from,e.to);if(n)return t.dispatch({effects:ht(t.state,[nt.of(n),ft(t,n)])}),!0}return!1},ct=t=>{if(!t.state.field(it,!1))return!1;let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);r&&e.push(rt.of(r),ft(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function ft(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return o.EditorView.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const dt=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=tt(e,s.from,s.to);i&&n.push(nt.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:ht(t.state,n)}),!!n.length},pt=t=>{let e=t.state.field(it,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,((t,e)=>{n.push(rt.of({from:t,to:e}))})),t.dispatch({effects:n}),!0};function gt(t,e){for(let n=e;;){let r=tt(t.state,n.from,n.to);if(r&&r.to>e.from)return r;if(!n.from)return null;n=t.lineBlockAt(n.from-1)}}const mt=t=>{let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);if(r)e.push(rt.of(r),ft(t,r,!1));else{let r=gt(t,n);r&&e.push(nt.of(r),ft(t,r))}}return e.length>0&&t.dispatch({effects:ht(t.state,e)}),!!e.length},kt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ct},{key:"Ctrl-Alt-[",run:dt},{key:"Ctrl-Alt-]",run:pt}],wt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},vt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,wt)});function bt(t){let e=[it,Ct];return t&&e.push(vt.of(t)),e}function yt(t,e){let{state:n}=t,r=n.facet(vt),s=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),r=at(t.state,n.from,n.to);r&&t.dispatch({effects:rt.of(r)}),e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const xt=o.Decoration.replace({widget:new class extends o.WidgetType{toDOM(t){return yt(t,null)}}});class St extends o.WidgetType{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return yt(t,this.value)}}const Tt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Pt extends o.GutterMarker{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function At(t={}){let e=Object.assign(Object.assign({},Tt),t),n=new Pt(e,!0),r=new Pt(e,!1),s=o.ViewPlugin.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(D)!=t.state.facet(D)||t.startState.field(it,!1)!=t.state.field(it,!1)||g(t.startState)!=g(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new i.RangeSetBuilder;for(let s of t.viewportLineBlocks){let i=at(t.state,s.from,s.to)?r:tt(t.state,s.from,s.to)?n:null;i&&e.add(s.from,s.from,i)}return e.finish()}}),{domEventHandlers:a}=e;return[s,(0,o.gutter)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||i.RangeSet.empty},initialSpacer:()=>new Pt(e,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(t,e,n)=>{if(a.click&&a.click(t,e,n))return!0;let r=at(t.state,e.from,e.to);if(r)return t.dispatch({effects:rt.of(r)}),!0;let s=tt(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:nt.of(s)}),!0)}})}),bt()]}const Ct=o.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Dt{constructor(t,e){let n;function r(t){let e=l.V.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?r(e.all):void 0,i=e.scope;this.scope=i instanceof f?t=>t.prop(h)==i.data:i?t=>t==i:void 0,this.style=(0,a.tagHighlighter)(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=n?new l.V(n):null,this.themeType=e.themeType}static define(t,e){return new Dt(t,e||{})}}const It=i.Facet.define(),Nt=i.Facet.define({combine:t=>t.length?[t[0]]:null});function Ot(t){let e=t.facet(It);return e.length?e:t.facet(Nt)}function Et(t,e){let n,r=[Rt];return t instanceof Dt&&(t.module&&r.push(o.EditorView.styleModule.of(t.module)),n=t.themeType),(null==e?void 0:e.fallback)?r.push(Nt.of(t)):n?r.push(It.computeN([o.EditorView.darkTheme],(e=>e.facet(o.EditorView.darkTheme)==("dark"==n)?[t]:[]))):r.push(It.of(t)),r}function Lt(t,e,n){let r=Ot(t),s=null;if(r)for(let t of r)if(!t.scope||n&&t.scope(n)){let n=t.style(e);n&&(s=s?s+" "+n:n)}return s}class Bt{constructor(t){this.markCache=Object.create(null),this.tree=g(t.state),this.decorations=this.buildDeco(t,Ot(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=g(t.state),n=Ot(t.state),r=n!=Ot(t.startState),{viewport:s}=t.view,i=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!r&&e.type==this.tree.type&&i>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=i):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.Decoration.none;let n=new i.RangeSetBuilder;for(let{from:r,to:s}of t.visibleRanges)(0,a.highlightTree)(this.tree,e,((t,e,r)=>{n.add(t,e,this.markCache[r]||(this.markCache[r]=o.Decoration.mark({class:r})))}),r,s);return n.finish()}}const Rt=i.Prec.high(o.ViewPlugin.fromClass(Bt,{decorations:t=>t.decorations})),Mt=Dt.define([{tag:a.tags.meta,color:"#404740"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),Ft=o.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vt=1e4,Ut="()[]{}",jt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,{afterCursor:!0,brackets:Ut,maxScanDistance:Vt,renderMatch:$t})}),Wt=o.Decoration.mark({class:"cm-matchingBracket"}),_t=o.Decoration.mark({class:"cm-nonmatchingBracket"});function $t(t){let e=[],n=t.matched?Wt:_t;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const zt=[i.StateField.define({create:()=>o.Decoration.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(jt);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=Yt(e.state,t.head,-1,r)||t.head>0&&Yt(e.state,t.head-1,1,r)||r.afterCursor&&(Yt(e.state,t.head,1,r)||t.head<e.state.doc.length&&Yt(e.state,t.head+1,-1,r));s&&(n=n.concat(r.renderMatch(s,e.state)))}return o.Decoration.set(n,!0)},provide:t=>o.EditorView.decorations.from(t)}),Ft];function Ht(t={}){return[jt.of(t),zt]}const Gt=new s.NodeProp;function Jt(t,e,n){let r=t.prop(e<0?s.NodeProp.openedBy:s.NodeProp.closedBy);if(r)return r;if(1==t.name.length){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function qt(t){let e=t.type.prop(Gt);return e?e(t.node):t}function Yt(t,e,n,r={}){let s=r.maxScanDistance||Vt,i=r.brackets||Ut,o=g(t),a=o.resolveInner(e,n);for(let t=a;t;t=t.parent){let r=Jt(t.type,n,i);if(r&&t.from<t.to){let s=qt(t);if(s&&(n>0?e>=s.from&&e<s.to:e>s.from&&e<=s.to))return Kt(0,0,n,t,s,r,i)}}return function(t,e,n,r,s,i,o){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),c=0;for(let t=0;!u.next().done&&t<=i;){let i=u.value;n<0&&(t+=i.length);let a=e+t*n;for(let t=n>0?0:i.length-1,e=n>0?i.length:-1;t!=e;t+=n){let e=o.indexOf(i[t]);if(!(e<0||r.resolveInner(a+t,1).type!=s))if(e%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};c--}}n>0&&(t+=i.length)}return u.done?{start:h,matched:!1}:null}(t,e,n,o,a.type,s,i)}function Kt(t,e,n,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},h=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==h&&i.indexOf(u.type.name)>-1&&u.from<u.to){let t=qt(u);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Jt(u.type,n,o))h++;else if(Jt(u.type,-n,o)){if(0==h){let t=qt(u);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function Zt(t,e,n,r=0,s=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let i=s;for(let s=r;s<e;s++)9==t.charCodeAt(s)?i+=n-i%n:i++;return i}class Qt{constructor(t,e,n,r){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t instanceof RegExp?t.test(n):t(n)),e)return++this.pos,n}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Zt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:Zt(this.string,null,this.tabSize)}match(t,e,n){if("string"==typeof t){let r=t=>n?t.toLowerCase():t;return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Xt(t){if("object"!=typeof t)return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const te=new WeakMap;class ee extends f{constructor(t){let e,n=u(t.languageData),r={name:(i=t).name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Xt,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||oe};var i;super(n,new class extends s.Parser{createParse(t,n,r){return new se(e,t,n,r)}},[O.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=s.NodeType.define({id:ae.length,name:"Document",props:[h.add((()=>t))],top:!0});return ae.push(e),e}(n),e=this,this.streamParser=r,this.stateAfter=new s.NodeProp({perNode:!0}),this.tokenTable=t.tokenTable?new fe(r.tokenTable):de}static define(t){return new ee(t)}getIndent(t,e){let n,r=g(t.state),s=r.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:i}=t.options;i&&(n=te.get(t.state),null!=n&&n<e-1e4&&(n=void 0));let o,a,l=ne(this,r,0,s.from,null!=n?n:e);if(l?(a=l.state,o=l.pos+1):(a=this.streamParser.startState(t.unit),o=0),e-o>1e4)return null;for(;o<e;){let n=t.state.doc.lineAt(o),r=Math.min(e,n.to);if(n.length){let e=i?i(n.from):-1,s=new Qt(n.text,t.state.tabSize,t.unit,e<0?void 0:e);for(;s.pos<r-n.from;)ie(this.streamParser.token,s,a)}else this.streamParser.blankLine(a,t.unit);if(r==e)break;o=n.to+1}let h=t.lineAt(e);return i&&null==n&&te.set(t.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],t)}get allowsNesting(){return!1}}function ne(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=n+e.positions[o],h=a instanceof s.Tree&&l<i&&ne(t,a,l,r,i);if(h)return h}return null}function re(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;i||e.type!=t.topNode||(i=!0);for(let o=e.children.length-1;o>=0;o--){let a,l=e.positions[o],h=e.children[o];if(l<r&&h instanceof s.Tree){if(!(a=re(t,h,n-l,r-l,i)))break;return i?new s.Tree(e.type,e.children.slice(0,o).concat(a),e.positions.slice(0,o+1),l+a.length):a}}return null}class se{constructor(t,e,n,r){this.lang=t,this.input=e,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=x.get(),o=r[0].from,{state:a,tree:l}=function(t,e,n,r){for(let r of e){let e,s=r.from+(r.openStart?25:0),i=r.to-(r.openEnd?25:0),o=s<=n&&i>n&&ne(t,r.tree,0-r.offset,n,i);if(o&&(e=re(t,r.tree,n+r.offset,o.pos+r.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(r?L(r):4),tree:s.Tree.empty}}(t,n,o,null==i?void 0:i.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let t=0;t<l.children.length;t++)this.chunks.push(l.children[t]),this.chunkPos.push(l.positions[t]);i&&this.parsedPos<i.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(L(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let t=x.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+2048);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let t=this.rangeIndex;;){let r=this.ranges[t].to;if(r>=n)break;if(e=e.slice(0,r-(n-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,i=this.lineAfter(s);e+=i,n=s+i.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+e;if(n>0?r>s:r>=s)break;e+=this.ranges[++this.rangeIndex].from-r}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,r,s){if(this.ranges.length>1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;n+=s=this.skipGapsTo(n,s,-1),r+=this.chunk.length-t}return this.chunk.push(t,e,n,r),s}parseLine(t){let{line:e,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,i=new Qt(e,t?t.state.tabSize:4,t?L(t.state):2);if(i.eol())s.blankLine(this.state,i.indentUnit);else for(;!i.eol();){let t=ie(s.token,i,this.state);if(t&&(r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+i.start,this.parsedPos+i.pos,4,r)),i.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=s.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:le,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new s.Tree(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new s.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ie(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const oe=Object.create(null),ae=[s.NodeType.none],le=new s.NodeSet(ae),he=[],ue=Object.create(null),ce=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ce[t]=ge(oe,e);class fe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ce)}resolve(t){return t?this.table[t]||(this.table[t]=ge(this.extra,t)):0}}const de=new fe(oe);function pe(t,e){he.indexOf(t)>-1||(he.push(t),console.warn(e))}function ge(t,e){let n=[];for(let r of e.split(" ")){let e=[];for(let n of r.split(".")){let r=t[n]||a.tags[n];r?"function"==typeof r?e.length?e=e.map(r):pe(n,`Modifier ${n} used at start of tag`):e.length?pe(n,`Tag ${n} used as modifier`):e=Array.isArray(r)?r:[r]:pe(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map((t=>t.id)),o=ue[i];if(o)return o.id;let l=ue[i]=s.NodeType.define({id:ae.length,name:r,props:[(0,a.styleTags)({[r]:n})]});return ae.push(l),l.id}function me(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function ke(t){for(let e=t.iter();!e.next().done;)if(me(e.value))return!0;return!1}const we=i.Facet.define({combine:t=>t.some((t=>t))});function ve(t={}){let e=[be];return t.alwaysIsolate&&e.push(we.of(!0)),e}const be=o.ViewPlugin.fromClass(class{constructor(t){this.always=t.state.facet(we)||t.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection),this.hasRTL=!this.always&&ke(t.state.doc),this.tree=g(t.state),this.decorations=this.always||this.hasRTL?ye(t,this.tree,this.always):o.Decoration.none}update(t){let e=t.state.facet(we)||t.view.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,n,r,s,i)=>{!e&&ke(i)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let n=g(t.state);(e!=this.always||n!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=n,this.always=e,this.decorations=ye(t.view,n,e))}},{provide:t=>{function e(e){var n,r;return null!==(r=null===(n=e.plugin(t))||void 0===n?void 0:n.decorations)&&void 0!==r?r:o.Decoration.none}return[o.EditorView.outerDecorations.of(e),i.Prec.lowest(o.EditorView.bidiIsolatedRanges.of(e))]}});function ye(t,e,n){let r=new i.RangeSetBuilder,o=t.visibleRanges;n||(o=function(t,e){let n=e.iter(),r=0,s=[],i=null;for(let{from:e,to:o}of t)for(e!=r&&(r<e&&n.next(e-r),r=e);;){let t=r,e=r+n.value.length;if(!n.lineBreak&&me(n.value)&&(i&&i.to>t-10?i.to=Math.min(o,e):s.push(i={from:t,to:Math.min(o,e)})),r>=o)break;r=e,n.next()}return s}(o,t.state.doc));for(let{from:t,to:n}of o)e.iterate({enter:t=>{let e=t.type.prop(s.NodeProp.isolate);e&&r.add(t.from,t.to,xe[e])},from:t,to:n});return r.finish()}const xe={rtl:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:o.Direction.RTL}),ltr:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:o.Direction.LTR}),auto:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},4434:(t,e,n)=>{n.d(e,{V:()=>o});const r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),s="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(t,e){this.rules=[];let{finish:n}=e||{};function r(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,i,o){let a=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return i.push(t[0]+";");for(let n in e){let o=e[n];if(/&/.test(n))s(n.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,i);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");s(r(n),o,a,h)}else null!=o&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&i.push((!n||l||o?t:t.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(r(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=i[r]||1;return i[r]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let r=t[s],i=n&&n.nonce;r?i&&r.setNonce(i):r=new l(t,i),r.mount(Array.isArray(e)?e:[e])}}let a=new Map;class l{constructor(t,e){let n=t.ownerDocument||t,r=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let e=a.get(n);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[s]=e;this.sheet=new r.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],a.set(n,this)}else{this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let r=t.head||t;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],t[s]=this}mount(t){let e=this.sheet,n=0,r=0;for(let s=0;s<t.length;s++){let i=t[s],o=this.modules.indexOf(i);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,i),e)for(let t=0;t<i.rules.length;t++)e.insertRule(i.rules[t],n++)}else{for(;r<o;)n+=this.modules[r++].rules.length;n+=i.rules.length,r++}}if(!e){let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1584],{31584:(t,e,n)=>{n.r(e),n.d(e,{DocInput:()=>b,HighlightStyle:()=>Dt,IndentContext:()=>F,LRLanguage:()=>p,Language:()=>f,LanguageDescription:()=>N,LanguageSupport:()=>I,ParseContext:()=>x,StreamLanguage:()=>ee,StringStream:()=>Qt,TreeIndentContext:()=>_,bidiIsolates:()=>ve,bracketMatching:()=>Ht,bracketMatchingHandle:()=>Gt,codeFolding:()=>bt,continuedIndent:()=>J,defaultHighlightStyle:()=>Mt,defineLanguageFacet:()=>u,delimitedIndent:()=>z,ensureSyntaxTree:()=>m,flatIndent:()=>G,foldAll:()=>dt,foldCode:()=>ut,foldEffect:()=>nt,foldGutter:()=>At,foldInside:()=>Q,foldKeymap:()=>kt,foldNodeProp:()=>Z,foldService:()=>K,foldState:()=>it,foldable:()=>tt,foldedRanges:()=>ot,forceParsing:()=>w,getIndentUnit:()=>L,getIndentation:()=>R,highlightingFor:()=>Lt,indentNodeProp:()=>V,indentOnInput:()=>Y,indentRange:()=>M,indentService:()=>O,indentString:()=>B,indentUnit:()=>E,language:()=>D,languageDataProp:()=>h,matchBrackets:()=>Yt,sublanguageProp:()=>c,syntaxHighlighting:()=>Et,syntaxParserRunning:()=>v,syntaxTree:()=>g,syntaxTreeAvailable:()=>k,toggleFold:()=>mt,unfoldAll:()=>pt,unfoldCode:()=>ct,unfoldEffect:()=>rt});var r,s=n(79352),i=n(89843),o=n(63720),a=n(92209),l=n(4434);const h=new s.NodeProp;function u(t){return i.Facet.define({combine:t?e=>e.concat(t):void 0})}const c=new s.NodeProp;class f{constructor(t,e,n=[],r=""){this.data=t,this.name=r,i.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(i.EditorState.prototype,"tree",{get(){return g(this)}}),this.parser=e,this.extension=[D.of(this),i.EditorState.languageData.of(((t,e,n)=>{let r=d(t,e,n),s=r.type.prop(h);if(!s)return[];let i=t.facet(s),o=r.type.prop(c);if(o){let s=r.resolve(e-r.from,n);for(let e of o)if(e.test(s,t)){let n=t.facet(e.facet);return"replace"==e.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(t,e,n=-1){return d(t,e,n).type.prop(h)==this.data}findRegions(t){let e=t.facet(D);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[],r=(t,e)=>{if(t.prop(h)==this.data)return void n.push({from:e,to:e+t.length});let i=t.prop(s.NodeProp.mounted);if(i){if(i.tree.prop(h)==this.data){if(i.overlay)for(let t of i.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}if(i.overlay){let t=n.length;if(r(i.tree,i.overlay[0].from+e),n.length>t)return}}for(let n=0;n<t.children.length;n++){let i=t.children[n];i instanceof s.Tree&&r(i,t.positions[n]+e)}};return r(g(t),0),n}get allowsNesting(){return!0}}function d(t,e,n){let r=t.facet(D),i=g(t).topNode;if(!r||r.allowsNesting)for(let t=i;t;t=t.enter(e,n,s.IterMode.ExcludeBuffers))t.type.isTop&&(i=t);return i}f.setState=i.StateEffect.define();class p extends f{constructor(t,e,n){super(t,e,[],n),this.parser=e}static define(t){let e=u(t.languageData);return new p(e,t.parser.configure({props:[h.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new p(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function g(t){let e=t.field(f.state,!1);return e?e.tree:s.Tree.empty}function m(t,e,n=50){var r;let s=null===(r=t.field(f.state,!1))||void 0===r?void 0:r.context;if(!s)return null;let i=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(i),o}function k(t,e=t.doc.length){var n;return(null===(n=t.field(f.state,!1))||void 0===n?void 0:n.context.isDone(e))||!1}function w(t,e=t.viewport.to,n=100){let r=m(t.state,e,n);return r!=g(t.state)&&t.dispatch({}),!!r}function v(t){var e;return(null===(e=t.plugin(C))||void 0===e?void 0:e.isWorking())||!1}class b{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}}let y=null;class x{constructor(t,e,n=[],r,s,i,o,a){this.parser=t,this.state=e,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=i,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,n){return new x(t,e,[],s.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new b(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=s.Tree.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(s.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=y;y=this;try{return t()}finally{y=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=S(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,n,r,s)=>e.push({fromA:t,toA:n,fromB:r,toB:s}))),n=s.TreeFragment.applyChanges(n,e),r=s.Tree.empty,i=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){a=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&a.push({from:n,to:r})}}}return new x(this.parser,e,n,r,i,o,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:n,to:r}=this.skipped[e];n<t.to&&r>t.from&&(this.fragments=S(this.fragments,n,r),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends s.Parser{createParse(e,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let e=y;if(e){for(let t of r)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new s.Tree(s.NodeType.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return y}}function S(t,e,n){return s.TreeFragment.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class T{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),n=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,n)||e.takeTree(),new T(e)}static init(t){let e=Math.min(3e3,t.doc.length),n=x.create(t.facet(D).parser,t,{from:0,to:e});return n.work(20,e)||n.takeTree(),new T(n)}}f.state=i.StateField.define({create:T.init,update(t,e){for(let t of e.effects)if(t.is(f.setState))return t.value;return e.startState.facet(D)!=e.state.facet(D)?T.init(e.state):t.apply(e)}});let P=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(P=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const A="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,C=o.ViewPlugin.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(f.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(f.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=P(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(f.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,t&&!A?Math.max(25,t.timeRemaining()-5):1e9),o=s.context.treeLen<r&&n.doc.length>r+1e3,a=s.context.work((()=>A&&A()||Date.now()>i),r+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:f.setState.of(new T(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,o.logException)(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),D=i.Facet.define({combine:t=>t.length?t[0]:null,enables:t=>[f.state,C,o.EditorView.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class I{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class N{constructor(t,e,n,r,s,i=void 0){this.name=t,this.alias=e,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=i,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new N(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let n of t)if(n.filename&&n.filename.test(e))return n;let n=/\.([^.]+)$/.exec(e);if(n)for(let e of t)if(e.extensions.indexOf(n[1])>-1)return e;return null}static matchLanguageName(t,e,n=!0){e=e.toLowerCase();for(let n of t)if(n.alias.some((t=>t==e)))return n;if(n)for(let n of t)for(let t of n.alias){let r=e.indexOf(t);if(r>-1&&(t.length>2||!/\w/.test(e[r-1])&&!/\w/.test(e[r+t.length])))return n}return null}}const O=i.Facet.define(),E=i.Facet.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function L(t){let e=t.facet(E);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function B(t,e){let n="",r=t.tabSize,s=t.facet(E)[0];if("\t"==s){for(;e>=r;)n+="\t",e-=r;s=" "}for(let t=0;t<e;t++)n+=s;return n}function R(t,e){t instanceof i.EditorState&&(t=new F(t));for(let n of t.state.facet(O)){let r=n(t,e);if(void 0!==r)return r}let n=g(t.state);return n.length>=e?function(t,e,n){let r=e.resolveStack(n),s=r.node.enterUnfinishedNodesBefore(n);if(s!=r.node){let t=[];for(let e=s;e!=r.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return U(r,t,n)}(t,n,e):null}function M(t,e,n){let r=Object.create(null),s=new F(t,{overrideIndentation:t=>{var e;return null!==(e=r[t])&&void 0!==e?e:-1}}),i=[];for(let o=e;o<=n;){let e=t.doc.lineAt(o);o=e.to+1;let n=R(s,e.from);if(null==n)continue;/\S/.test(e.text)||(n=0);let a=/^\s*/.exec(e.text)[0],l=B(t,n);a!=l&&(r[e.from]=n,i.push({from:e.from,to:e.from+a.length,insert:l}))}return t.changes(i)}class F{constructor(t,e={}){this.state=t,this.options=e,this.unit=L(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return null!=r&&r>=n.from&&r<=n.to?s&&r==t?{text:"",from:t}:(e<0?r<t:r<=t)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(t,e);return n.slice(t-r,Math.min(n.length,t+100-r))}column(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.countColumn(n,t-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(s+=i-this.countColumn(n,n.search(/\S|$/))),s}countColumn(t,e=t.length){return(0,i.countColumn)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:r}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(r);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const V=new s.NodeProp;function U(t,e,n){for(let r=t;r;r=r.next){let t=j(r.node);if(t)return t(_.create(e,n,r))}return 0}function j(t){let e=t.type.prop(V);if(e)return e;let n,r=t.firstChild;if(r&&(n=r.type.prop(s.NodeProp.closedBy))){let e=t.lastChild,r=e&&n.indexOf(e.name)>-1;return t=>H(t,!0,1,void 0,r&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?W:null}function W(){return 0}class _ extends F{constructor(t,e,n){super(t.state,t.options),this.base=t,this.pos=e,this.context=n}get node(){return this.context.node}static create(t,e,n){return new _(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return U(this.context.next,this.base,this.pos)}}function $(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function z({closing:t,align:e=!0,units:n=1}){return r=>H(r,e,n,t)}function H(t,e,n,r,s){let i=t.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==t.pos+o,l=e?function(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),o=null==s||s<=i.from?i.to:Math.min(i.to,s);for(let t=n.to;;){let s=e.childAfter(t);if(!s||s==r)return null;if(!s.type.isSkipped)return s.from<o?n:null;t=s.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const G=t=>t.baseIndent;function J({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const q=200;function Y(){return i.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+q)return t;let i=n.sliceString(s.from,r);if(!e.some((t=>t.test(i))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let n=R(o,e.from);if(null==n)continue;let r=/^\s*/.exec(e.text)[0],s=B(o,n);r!=s&&l.push({from:e.from,to:e.from+r.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const K=i.Facet.define(),Z=new s.NodeProp;function Q(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function X(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function tt(t,e,n){for(let r of t.facet(K)){let s=r(t,e,n);if(s)return s}return function(t,e,n){let r=g(t);if(r.length<n)return null;let s=null;for(let i=r.resolveStack(n,1);i;i=i.next){let o=i.node;if(o.to<=n||o.from>n)continue;if(s&&o.from<e)break;let a=o.type.prop(Z);if(a&&(o.to<r.length-50||r.length==t.doc.length||!X(o))){let r=a(o,t);r&&r.from<=n&&r.from>=e&&r.to>n&&(s=r)}}return s}(t,e,n)}function et(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const nt=i.StateEffect.define({map:et}),rt=i.StateEffect.define({map:et});function st(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some((t=>t.from<=n&&t.to>=n))||e.push(t.lineBlockAt(n));return e}const it=i.StateField.define({create:()=>o.Decoration.none,update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(nt)&&!lt(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(vt),s=r?o.Decoration.replace({widget:new St(r(e.state,n.value))}):xt;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(rt)&&(t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,((t,e)=>{t<r&&e>r&&(n=!0)})),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r}))}return t},provide:t=>o.EditorView.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,((t,e)=>{n.push(t,e)})),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],s=t[n++];if("number"!=typeof r||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");e.push(xt.range(r,s))}return o.Decoration.set(e,!0)}});function ot(t){return t.field(it,!1)||i.RangeSet.empty}function at(t,e,n){var r;let s=null;return null===(r=t.field(it,!1))||void 0===r||r.between(e,n,((t,e)=>{(!s||s.from>t)&&(s={from:t,to:e})})),s}function lt(t,e,n){let r=!1;return t.between(e,e,((t,s)=>{t==e&&s==n&&(r=!0)})),r}function ht(t,e){return t.field(it,!1)?e:e.concat(i.StateEffect.appendConfig.of(bt()))}const ut=t=>{for(let e of st(t)){let n=tt(t.state,e.from,e.to);if(n)return t.dispatch({effects:ht(t.state,[nt.of(n),ft(t,n)])}),!0}return!1},ct=t=>{if(!t.state.field(it,!1))return!1;let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);r&&e.push(rt.of(r),ft(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function ft(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return o.EditorView.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const dt=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let s=t.lineBlockAt(r),i=tt(e,s.from,s.to);i&&n.push(nt.of(i)),r=(i?t.lineBlockAt(i.to):s).to+1}return n.length&&t.dispatch({effects:ht(t.state,n)}),!!n.length},pt=t=>{let e=t.state.field(it,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,((t,e)=>{n.push(rt.of({from:t,to:e}))})),t.dispatch({effects:n}),!0};function gt(t,e){for(let n=e;;){let r=tt(t.state,n.from,n.to);if(r&&r.to>e.from)return r;if(!n.from)return null;n=t.lineBlockAt(n.from-1)}}const mt=t=>{let e=[];for(let n of st(t)){let r=at(t.state,n.from,n.to);if(r)e.push(rt.of(r),ft(t,r,!1));else{let r=gt(t,n);r&&e.push(nt.of(r),ft(t,r))}}return e.length>0&&t.dispatch({effects:ht(t.state,e)}),!!e.length},kt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ut},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ct},{key:"Ctrl-Alt-[",run:dt},{key:"Ctrl-Alt-]",run:pt}],wt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},vt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,wt)});function bt(t){let e=[it,Ct];return t&&e.push(vt.of(t)),e}function yt(t,e){let{state:n}=t,r=n.facet(vt),s=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target)),r=at(t.state,n.from,n.to);r&&t.dispatch({effects:rt.of(r)}),e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const xt=o.Decoration.replace({widget:new class extends o.WidgetType{toDOM(t){return yt(t,null)}}});class St extends o.WidgetType{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return yt(t,this.value)}}const Tt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Pt extends o.GutterMarker{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function At(t={}){let e=Object.assign(Object.assign({},Tt),t),n=new Pt(e,!0),r=new Pt(e,!1),s=o.ViewPlugin.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(D)!=t.state.facet(D)||t.startState.field(it,!1)!=t.state.field(it,!1)||g(t.startState)!=g(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new i.RangeSetBuilder;for(let s of t.viewportLineBlocks){let i=at(t.state,s.from,s.to)?r:tt(t.state,s.from,s.to)?n:null;i&&e.add(s.from,s.from,i)}return e.finish()}}),{domEventHandlers:a}=e;return[s,(0,o.gutter)({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||i.RangeSet.empty},initialSpacer:()=>new Pt(e,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(t,e,n)=>{if(a.click&&a.click(t,e,n))return!0;let r=at(t.state,e.from,e.to);if(r)return t.dispatch({effects:rt.of(r)}),!0;let s=tt(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:nt.of(s)}),!0)}})}),bt()]}const Ct=o.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Dt{constructor(t,e){let n;function r(t){let e=l.V.newName();return(n||(n=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?r(e.all):void 0,i=e.scope;this.scope=i instanceof f?t=>t.prop(h)==i.data:i?t=>t==i:void 0,this.style=(0,a.tagHighlighter)(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=n?new l.V(n):null,this.themeType=e.themeType}static define(t,e){return new Dt(t,e||{})}}const It=i.Facet.define(),Nt=i.Facet.define({combine:t=>t.length?[t[0]]:null});function Ot(t){let e=t.facet(It);return e.length?e:t.facet(Nt)}function Et(t,e){let n,r=[Rt];return t instanceof Dt&&(t.module&&r.push(o.EditorView.styleModule.of(t.module)),n=t.themeType),(null==e?void 0:e.fallback)?r.push(Nt.of(t)):n?r.push(It.computeN([o.EditorView.darkTheme],(e=>e.facet(o.EditorView.darkTheme)==("dark"==n)?[t]:[]))):r.push(It.of(t)),r}function Lt(t,e,n){let r=Ot(t),s=null;if(r)for(let t of r)if(!t.scope||n&&t.scope(n)){let n=t.style(e);n&&(s=s?s+" "+n:n)}return s}class Bt{constructor(t){this.markCache=Object.create(null),this.tree=g(t.state),this.decorations=this.buildDeco(t,Ot(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=g(t.state),n=Ot(t.state),r=n!=Ot(t.startState),{viewport:s}=t.view,i=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!r&&e.type==this.tree.type&&i>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=i):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return o.Decoration.none;let n=new i.RangeSetBuilder;for(let{from:r,to:s}of t.visibleRanges)(0,a.highlightTree)(this.tree,e,((t,e,r)=>{n.add(t,e,this.markCache[r]||(this.markCache[r]=o.Decoration.mark({class:r})))}),r,s);return n.finish()}}const Rt=i.Prec.high(o.ViewPlugin.fromClass(Bt,{decorations:t=>t.decorations})),Mt=Dt.define([{tag:a.tags.meta,color:"#404740"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),Ft=o.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vt=1e4,Ut="()[]{}",jt=i.Facet.define({combine:t=>(0,i.combineConfig)(t,{afterCursor:!0,brackets:Ut,maxScanDistance:Vt,renderMatch:$t})}),Wt=o.Decoration.mark({class:"cm-matchingBracket"}),_t=o.Decoration.mark({class:"cm-nonmatchingBracket"});function $t(t){let e=[],n=t.matched?Wt:_t;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const zt=[i.StateField.define({create:()=>o.Decoration.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(jt);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=Yt(e.state,t.head,-1,r)||t.head>0&&Yt(e.state,t.head-1,1,r)||r.afterCursor&&(Yt(e.state,t.head,1,r)||t.head<e.state.doc.length&&Yt(e.state,t.head+1,-1,r));s&&(n=n.concat(r.renderMatch(s,e.state)))}return o.Decoration.set(n,!0)},provide:t=>o.EditorView.decorations.from(t)}),Ft];function Ht(t={}){return[jt.of(t),zt]}const Gt=new s.NodeProp;function Jt(t,e,n){let r=t.prop(e<0?s.NodeProp.openedBy:s.NodeProp.closedBy);if(r)return r;if(1==t.name.length){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function qt(t){let e=t.type.prop(Gt);return e?e(t.node):t}function Yt(t,e,n,r={}){let s=r.maxScanDistance||Vt,i=r.brackets||Ut,o=g(t),a=o.resolveInner(e,n);for(let t=a;t;t=t.parent){let r=Jt(t.type,n,i);if(r&&t.from<t.to){let s=qt(t);if(s&&(n>0?e>=s.from&&e<s.to:e>s.from&&e<=s.to))return Kt(0,0,n,t,s,r,i)}}return function(t,e,n,r,s,i,o){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),c=0;for(let t=0;!u.next().done&&t<=i;){let i=u.value;n<0&&(t+=i.length);let a=e+t*n;for(let t=n>0?0:i.length-1,e=n>0?i.length:-1;t!=e;t+=n){let e=o.indexOf(i[t]);if(!(e<0||r.resolveInner(a+t,1).type!=s))if(e%2==0==n>0)c++;else{if(1==c)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};c--}}n>0&&(t+=i.length)}return u.done?{start:h,matched:!1}:null}(t,e,n,o,a.type,s,i)}function Kt(t,e,n,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},h=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==h&&i.indexOf(u.type.name)>-1&&u.from<u.to){let t=qt(u);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Jt(u.type,n,o))h++;else if(Jt(u.type,-n,o)){if(0==h){let t=qt(u);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}h--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function Zt(t,e,n,r=0,s=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let i=s;for(let s=r;s<e;s++)9==t.charCodeAt(s)?i+=n-i%n:i++;return i}class Qt{constructor(t,e,n,r){this.string=t,this.tabSize=e,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t instanceof RegExp?t.test(n):t(n)),e)return++this.pos,n}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Zt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:Zt(this.string,null,this.tabSize)}match(t,e,n){if("string"==typeof t){let r=t=>n?t.toLowerCase():t;return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Xt(t){if("object"!=typeof t)return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const te=new WeakMap;class ee extends f{constructor(t){let e,n=u(t.languageData),r={name:(i=t).name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||Xt,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||oe};var i;super(n,new class extends s.Parser{createParse(t,n,r){return new se(e,t,n,r)}},[O.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=s.NodeType.define({id:ae.length,name:"Document",props:[h.add((()=>t))],top:!0});return ae.push(e),e}(n),e=this,this.streamParser=r,this.stateAfter=new s.NodeProp({perNode:!0}),this.tokenTable=t.tokenTable?new fe(r.tokenTable):de}static define(t){return new ee(t)}getIndent(t,e){let n,r=g(t.state),s=r.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:i}=t.options;i&&(n=te.get(t.state),null!=n&&n<e-1e4&&(n=void 0));let o,a,l=ne(this,r,0,s.from,null!=n?n:e);if(l?(a=l.state,o=l.pos+1):(a=this.streamParser.startState(t.unit),o=0),e-o>1e4)return null;for(;o<e;){let n=t.state.doc.lineAt(o),r=Math.min(e,n.to);if(n.length){let e=i?i(n.from):-1,s=new Qt(n.text,t.state.tabSize,t.unit,e<0?void 0:e);for(;s.pos<r-n.from;)ie(this.streamParser.token,s,a)}else this.streamParser.blankLine(a,t.unit);if(r==e)break;o=n.to+1}let h=t.lineAt(e);return i&&null==n&&te.set(t.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],t)}get allowsNesting(){return!1}}function ne(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=n+e.positions[o],h=a instanceof s.Tree&&l<i&&ne(t,a,l,r,i);if(h)return h}return null}function re(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;i||e.type!=t.topNode||(i=!0);for(let o=e.children.length-1;o>=0;o--){let a,l=e.positions[o],h=e.children[o];if(l<r&&h instanceof s.Tree){if(!(a=re(t,h,n-l,r-l,i)))break;return i?new s.Tree(e.type,e.children.slice(0,o).concat(a),e.positions.slice(0,o+1),l+a.length):a}}return null}class se{constructor(t,e,n,r){this.lang=t,this.input=e,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=x.get(),o=r[0].from,{state:a,tree:l}=function(t,e,n,r){for(let r of e){let e,s=r.from+(r.openStart?25:0),i=r.to-(r.openEnd?25:0),o=s<=n&&i>n&&ne(t,r.tree,0-r.offset,n,i);if(o&&(e=re(t,r.tree,n+r.offset,o.pos+r.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(r?L(r):4),tree:s.Tree.empty}}(t,n,o,null==i?void 0:i.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let t=0;t<l.children.length;t++)this.chunks.push(l.children[t]),this.chunkPos.push(l.positions[t]);i&&this.parsedPos<i.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(L(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let t=x.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(e,this.chunkStart+2048);for(t&&(n=Math.min(n,t.viewport.to));this.parsedPos<n;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let t=this.rangeIndex;;){let r=this.ranges[t].to;if(r>=n)break;if(e=e.slice(0,r-(n-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,i=this.lineAfter(s);e+=i,n=s+i.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+e;if(n>0?r>s:r>=s)break;e+=this.ranges[++this.rangeIndex].from-r}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,n,r,s){if(this.ranges.length>1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;n+=s=this.skipGapsTo(n,s,-1),r+=this.chunk.length-t}return this.chunk.push(t,e,n,r),s}parseLine(t){let{line:e,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,i=new Qt(e,t?t.state.tabSize:4,t?L(t.state):2);if(i.eol())s.blankLine(this.state,i.indentUnit);else for(;!i.eol();){let t=ie(s.token,i,this.state);if(t&&(r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+i.start,this.parsedPos+i.pos,4,r)),i.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=s.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:le,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new s.Tree(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new s.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ie(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let r=t(e,n);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const oe=Object.create(null),ae=[s.NodeType.none],le=new s.NodeSet(ae),he=[],ue=Object.create(null),ce=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ce[t]=ge(oe,e);class fe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),ce)}resolve(t){return t?this.table[t]||(this.table[t]=ge(this.extra,t)):0}}const de=new fe(oe);function pe(t,e){he.indexOf(t)>-1||(he.push(t),console.warn(e))}function ge(t,e){let n=[];for(let r of e.split(" ")){let e=[];for(let n of r.split(".")){let r=t[n]||a.tags[n];r?"function"==typeof r?e.length?e=e.map(r):pe(n,`Modifier ${n} used at start of tag`):e.length?pe(n,`Tag ${n} used as modifier`):e=Array.isArray(r)?r:[r]:pe(n,`Unknown highlighting tag ${n}`)}for(let t of e)n.push(t)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map((t=>t.id)),o=ue[i];if(o)return o.id;let l=ue[i]=s.NodeType.define({id:ae.length,name:r,props:[(0,a.styleTags)({[r]:n})]});return ae.push(l),l.id}function me(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function ke(t){for(let e=t.iter();!e.next().done;)if(me(e.value))return!0;return!1}const we=i.Facet.define({combine:t=>t.some((t=>t))});function ve(t={}){let e=[be];return t.alwaysIsolate&&e.push(we.of(!0)),e}const be=o.ViewPlugin.fromClass(class{constructor(t){this.always=t.state.facet(we)||t.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection),this.hasRTL=!this.always&&ke(t.state.doc),this.tree=g(t.state),this.decorations=this.always||this.hasRTL?ye(t,this.tree,this.always):o.Decoration.none}update(t){let e=t.state.facet(we)||t.view.textDirection!=o.Direction.LTR||t.state.facet(o.EditorView.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,n,r,s,i)=>{!e&&ke(i)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let n=g(t.state);(e!=this.always||n!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=n,this.always=e,this.decorations=ye(t.view,n,e))}},{provide:t=>{function e(e){var n,r;return null!==(r=null===(n=e.plugin(t))||void 0===n?void 0:n.decorations)&&void 0!==r?r:o.Decoration.none}return[o.EditorView.outerDecorations.of(e),i.Prec.lowest(o.EditorView.bidiIsolatedRanges.of(e))]}});function ye(t,e,n){let r=new i.RangeSetBuilder,o=t.visibleRanges;n||(o=function(t,e){let n=e.iter(),r=0,s=[],i=null;for(let{from:e,to:o}of t)for(e!=r&&(r<e&&n.next(e-r),r=e);;){let t=r,e=r+n.value.length;if(!n.lineBreak&&me(n.value)&&(i&&i.to>t-10?i.to=Math.min(o,e):s.push(i={from:t,to:Math.min(o,e)})),r>=o)break;r=e,n.next()}return s}(o,t.state.doc));for(let{from:t,to:n}of o)e.iterate({enter:t=>{let e=t.type.prop(s.NodeProp.isolate);e&&r.add(t.from,t.to,xe[e])},from:t,to:n});return r.finish()}const xe={rtl:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:o.Direction.RTL}),ltr:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:o.Direction.LTR}),auto:o.Decoration.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})}},4434:(t,e,n)=>{n.d(e,{V:()=>o});const r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),s="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(t,e){this.rules=[];let{finish:n}=e||{};function r(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,i,o){let a=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return i.push(t[0]+";");for(let n in e){let o=e[n];if(/&/.test(n))s(n.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,i);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");s(r(n),o,a,h)}else null!=o&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&i.push((!n||l||o?t:t.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(r(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=i[r]||1;return i[r]=t+1,"ͼ"+t.toString(36)}static mount(t,e,n){let r=t[s],i=n&&n.nonce;r?i&&r.setNonce(i):r=new l(t,i),r.mount(Array.isArray(e)?e:[e])}}let a=new Map;class l{constructor(t,e){let n=t.ownerDocument||t,r=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let e=a.get(n);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[s]=e;this.sheet=new r.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],a.set(n,this)}else{this.styleTag=n.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let r=t.head||t;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],t[s]=this}mount(t){let e=this.sheet,n=0,r=0;for(let s=0;s<t.length;s++){let i=t[s],o=this.modules.indexOf(i);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,i),e)for(let t=0;t<i.rules.length;t++)e.insertRule(i.rules[t],n++)}else{for(;r<o;)n+=this.modules[r++].rules.length;n+=i.rules.length,r++}}if(!e){let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}}}]);
|
notebook/static/1647.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(21961).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(76878),n=o(58194),r=o(2260);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null,this.addClass("jp-ThemedContainer");const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
|
notebook/static/1650.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(20754),a=o(7073),i=o(28976),d=o(2159);const s=[{id:"@jupyter-notebook/docmanager-extension:opener",autoStart:!0,optional:[i.INotebookPathOpener,i.INotebookShell],provides:a.IDocumentWidgetOpener,description:"Open documents in a new browser tab",activate:(e,t,o)=>{const a=n.PageConfig.getBaseUrl(),s=e.docRegistry,r=null!=t?t:i.defaultNotebookPathOpener;let l=0;return new class{constructor(){this._opened=new d.Signal(this)}async open(t,i){var d,c,u;const p=null!==(d=null==i?void 0:i.type)&&void 0!==d?d:"",h=null==i?void 0:i.ref,v=null===(u=null===(c=null==o?void 0:o.userLayout)||void 0===c?void 0:c[p])||void 0===u?void 0:u.area;if("_noref"!==h&&void 0===v){const e=t.context.path,o=n.PathExt.extname(e);let i,d="edit";return("default"===p&&".ipynb"===o||p.includes("Notebook"))&&(t.context.sessionContext.kernelPreference.name&&await t.context.save(),d="notebooks"),p!==s.defaultWidgetFactory(e).name&&(i=new URLSearchParams({factory:p})),r.open({prefix:n.URLExt.join(a,d),path:e,searchParams:i}),void t.dispose()}t.id||(t.id="document-manager-"+ ++l),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.shell.add(t,"main",i||{}),e.shell.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}}]}}]);
|
notebook/static/1684.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(73852),o=n(20754),i=n(88117),r=n(28976),s=n(14931);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
|