(()=>{"use strict";var t={208:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleBrowserManager=void 0;const n=i(506);e.SimpleBrowserManager=class{extensionUri;_activeView;constructor(t){this.extensionUri=t}dispose(){this._activeView?.dispose(),this._activeView=void 0}show(t,e){const i="string"==typeof t?t:t.toString(!0);if(this._activeView)this._activeView.show(i,e);else{const t=n.SimpleBrowserView.create(this.extensionUri,i,e);this.registerWebviewListeners(t),this._activeView=t}}restore(t,e){const i=e?.url??"",s=n.SimpleBrowserView.restore(this.extensionUri,i,t);this.registerWebviewListeners(s),this._activeView??=s}registerWebviewListeners(t){t.onDispose(()=>{this._activeView===t&&(this._activeView=void 0)})}}},256:function(t,e,i){var n,s=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||(n=function(t){return n=Object.getOwnPropertyNames||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[e.length]=i);return e},n(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i=n(t),o=0;o{e.restore(t,i)}})),t.subscriptions.push(a.commands.registerCommand(p,async t=>{t||(t=await a.window.showInputBox({placeHolder:a.l10n.t("https://example.com"),prompt:a.l10n.t("Enter url to visit")})),t&&e.show(t)})),t.subscriptions.push(a.commands.registerCommand(u,(t,i)=>{e.show(t,i)})),t.subscriptions.push(a.window.registerExternalUriOpener(w,{canOpenExternalUri(t){const e=new URL(t.toString(!0));return d.has(e.hostname)?"object"==typeof process&&process.versions.node||a.env.uiKind!==a.UIKind.Web?a.ExternalUriOpenerPriority.Option:a.ExternalUriOpenerPriority.Default:a.ExternalUriOpenerPriority.None},openExternalUri:t=>e.show(t,{viewColumn:a.window.activeTextEditor?a.ViewColumn.Beside:a.ViewColumn.Active})},{schemes:["http","https"],label:a.l10n.t("Open in simple browser")}))};const a=o(i(398)),c=i(208),l=i(506),u="simpleBrowser.api.open",p="simpleBrowser.show",d=new Set(["localhost","127.0.0.1","[0:0:0:0:0:0:0:1]","[::1]","0.0.0.0","[0:0:0:0:0:0:0:0]","[::]"]),w="simpleBrowser.open"},398:t=>{t.exports=require("vscode")},506:function(t,e,i){var n,s=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||(n=function(t){return n=Object.getOwnPropertyNames||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[e.length]=i);return e},n(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i=n(t),o=0;o{if("openExternal"===t.type)try{const e=a.Uri.parse(t.url);a.env.openExternal(e)}catch{}})),this._register(this._webviewPanel.onDidDispose(()=>{this.dispose()})),this._register(a.workspace.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("simpleBrowser.focusLockIndicator.enabled")){const t=a.workspace.getConfiguration("simpleBrowser");this._webviewPanel.webview.postMessage({type:"didChangeFocusLockIndicatorEnabled",focusLockEnabled:t.get("focusLockIndicator.enabled",!0)})}})),this.show(e)}dispose(){this._onDidDispose.fire(),super.dispose()}show(t,e){this._webviewPanel.webview.html=this.getHtml(t),this._webviewPanel.reveal(e?.viewColumn,e?.preserveFocus)}getHtml(t){const e=a.workspace.getConfiguration("simpleBrowser"),i=(0,l.generateUuid)(),n=this.extensionResourceUrl("media","index.js"),s=this.extensionResourceUrl("media","main.css"),r=this.extensionResourceUrl("media","codicon.css");return`\n\t\t\t\n\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
${a.l10n.t("Focus Lock")}
\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t