(()=>{"use strict";var _e={},K=Object.defineProperty,Q=(i,t,e)=>t in i?K(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,X=(i,t,e)=>(Q(i,typeof t!="symbol"?t+"":t,e),e);class D{constructor(t){this.method=t,X(this,"_")}}class P extends D{}class C extends D{}function $(i,t,e){i.method===t.method&&e(t.params)}const ee=new P("webview/ready"),Te=new P("command/execute"),te=new P("configuration/preview"),ne=new P("configuration/update"),B=new C("configuration/didChange"),oe=new C("configuration/didPreview"),L=new C("webview/didOpenAnchor"),E=/(?\[.*?\])|(?YYYY|YY)|(?M{1,4})|(?Do|DD?)|(?d{2,4})|(?HH?|hh?)|(?mm?)|(?ss?)|(?SSS)|(?A|a)|(?ZZ?)/g,N=/(?full|long|medium|short)(?:\+(?full|long|medium|short))?/,se=null;let y;const S=new Map;let p,k,g;function ie(i){typeof i=="string"?i==="system"?p=void 0:p=[i]:p=i??void 0,k=void 0,g=void 0,S.clear(),y=void 0}function Ce(i,t){const e=new Date(i.getTime());for(const[n,o]of Object.entries(t))if(!!o)switch(n){case"years":e.setFullYear(e.getFullYear()+o);break;case"months":e.setMonth(e.getMonth()+o);break;case"days":e.setDate(e.getDate()+o);break;case"hours":e.setHours(e.getHours()+o);break;case"minutes":e.setMinutes(e.getMinutes()+o);break;case"seconds":e.setSeconds(e.getSeconds()+o);break}return e}function $e(i,t){const e=i.getTime()-new Date().getTime();for(const[n,o,s,r]of se){const l=Math.abs(e);if(l>=o||o===1e3)return t?(y==null&&(g!=null?y=g.resolvedOptions().locale:k!=null?y=k.resolvedOptions().locale:(g=new Intl.RelativeTimeFormat(p,{localeMatcher:"best fit",numeric:"always",style:"narrow"}),y=g.resolvedOptions().locale)),y==="en"||y?.startsWith("en-")?`${Math.round(l/s)}${r}`:(g==null&&(g=new Intl.RelativeTimeFormat(p,{localeMatcher:"best fit",numeric:"always",style:"narrow"})),g.format(Math.round(e/s),n))):(k==null&&(k=new Intl.RelativeTimeFormat(p,{localeMatcher:"best fit",numeric:"auto",style:"long"})),k.format(Math.round(e/s),n))}return""}function q(i,t,e,n=!0){t=t??void 0;const o=`${e??""}:${t}`;let s=S.get(o);if(s==null){const a=re(t);let c;e==null?c=p:e==="system"?c=void 0:c=[e],s=new Intl.DateTimeFormat(c,a),n&&S.set(o,s)}if(t==null||N.test(t))return s.format(i);function r(a){const c=`${e??""}:time:${a}`;let u=S.get(c);if(u==null){const f={localeMatcher:"best fit",timeStyle:a};let m;e==null?m=p:e==="system"?m=void 0:m=[e],u=new Intl.DateTimeFormat(m,f),n&&S.set(c,u)}return u}const l=s.formatToParts(i);return t.replace(E,(a,c,u,f,m,Ie,Ve,Me,Ae,De,Be,Le,Ee,Ne,Z)=>{if(c!=null)return c.substring(1,c.length-1);for(const G in Z){const A=Z[G];if(A==null)continue;const w=l.find(U=>U.type===G);return A==="Do"&&w?.type==="day"?ae(Number(w.value)):A==="a"&&w?.type==="dayPeriod"?` ${(r("short").formatToParts(i).find(Pe=>Pe.type==="dayPeriod")??w)?.value??""}`:w?.value??""}return""})}function xe(i,t,e){const n=(typeof t=="number"?t:t.getTime())-(typeof i=="number"?i:i.getTime());switch(e){case"days":return Math.floor(n/(1e3*60*60*24));case"hours":return Math.floor(n/(1e3*60*60));case"minutes":return Math.floor(n/(1e3*60));case"seconds":return Math.floor(n/1e3);default:return n}}function re(i){if(i==null)return{localeMatcher:"best fit",dateStyle:"full",timeStyle:"short"};const t=N.exec(i);if(t?.groups!=null){const{dateStyle:n,timeStyle:o}=t.groups;return{localeMatcher:"best fit",dateStyle:n||"full",timeStyle:o||void 0}}const e={localeMatcher:"best fit"};for(const{groups:n}of i.matchAll(E))if(n!=null)for(const o in n){const s=n[o];if(s!=null)switch(o){case"year":e.year=s.length===4?"numeric":"2-digit";break;case"month":switch(s.length){case 4:e.month="long";break;case 3:e.month="short";break;case 2:e.month="2-digit";break;case 1:e.month="numeric";break}break;case"day":s==="DD"?e.day="2-digit":e.day="numeric";break;case"weekday":switch(s.length){case 4:e.weekday="long";break;case 3:e.weekday="short";break;case 2:e.weekday="narrow";break}break;case"hour":e.hour=s.length===2?"2-digit":"numeric",e.hour12=s==="hh"||s==="h";break;case"minute":e.minute=s.length===2?"2-digit":"numeric";break;case"second":e.second=s.length===2?"2-digit":"numeric";break;case"fractionalSecond":e.fractionalSecondDigits=3;break;case"dayPeriod":e.dayPeriod="narrow",e.hour12=!0,e.hourCycle="h12";break;case"timeZoneName":e.timeZoneName=s.length===2?"long":"short";break}}return e}const x=["th","st","nd","rd"];function ae(i){const t=i%100;return`${i}${x[(t-20)%10]??x[t]??x[0]}`}var d;(i=>{function t(o,s,r,l){let a=!1;if(typeof o=="string"){const u=function(f){const m=f?.target;!m?.matches(o)||r(f,m)};return document.addEventListener(s,u,l??!0),{dispose:()=>{a||(a=!0,document.removeEventListener(s,u,l??!0))}}}const c=function(u){r(u,this)};return o.addEventListener(s,c,l??!1),{dispose:()=>{a||(a=!0,o.removeEventListener(s,c,l??!1))}}}i.on=t;function e(o,s,r){const l=document.getElementById(o);if(s.replaceChildren(l?.content.cloneNode(!0)),s.className=l.className,r?.visible!=null){const a=s.querySelectorAll("[data-visible]");for(const c of a){const u=c.dataset.visible;!u||(r.visible[u]?c.style.display="initial":c.style.display="none")}}if(r?.bindings!=null){const a=s.querySelectorAll("[data-bind]");for(const c of a){const u=c.dataset.bind;if(!u)continue;const f=r.bindings[u];f!=null&&(c.textContent=String(f))}}}i.insertTemplate=e;function n(o){o.replaceChildren(),o.className=""}i.resetSlot=n})(d||(d={}));const le=/^(?:(#?)([0-9a-f]{3}|[0-9a-f]{6})|((?:rgb|hsl)a?)\((-?\d+%?)[,\s]+(-?\d+%?)[,\s]+(-?\d+%?)[,\s]*(-?[\d.]+%?)?\))$/i;function I(i,t){const e=i+t,n=t<0?e<0?0:e:e>255?255:e;return Math.round(n)}function h(i,t){return b(i,-t)}function b(i,t){const e=O(i);if(e==null)return i;const[n,o,s,r]=e,l=255*t/100;return`rgba(${I(n,l)}, ${I(o,l)}, ${I(s,l)}, ${r})`}function v(i,t){const e=O(i);if(e==null)return i;const[n,o,s,r]=e;return`rgba(${n}, ${o}, ${s}, ${r*(t/100)})`}function O(i){i=i.trim();const t=le.exec(i);if(t==null)return null;if(t[1]==="#"){const e=t[2];switch(e.length){case 3:return[parseInt(e[0]+e[0],16),parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),1];case 6:return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16),1]}return null}switch(t[3]){case"rgb":return[parseInt(t[4],10),parseInt(t[5],10),parseInt(t[6],10),1];case"rgba":return[parseInt(t[4],10),parseInt(t[5],10),parseInt(t[6],10),parseFloat(t[7])];default:return null}}function ce(){const i=()=>{const e=document.body,n=window.getComputedStyle(e),o=e.style;o.setProperty("--font-family",n.getPropertyValue("--vscode-font-family").trim()),o.setProperty("--font-size",n.getPropertyValue("--vscode-font-size").trim()),o.setProperty("--font-weight",n.getPropertyValue("--vscode-font-weight").trim()),o.setProperty("--editor-font-family",n.getPropertyValue("--vscode-editor-font-family").trim()),o.setProperty("--editor-font-size",n.getPropertyValue("--vscode-editor-font-size").trim()),o.setProperty("--editor-font-weight",n.getPropertyValue("--vscode-editor-font-weight").trim());let s=n.getPropertyValue("--vscode-editor-background").trim();o.setProperty("--color-background",s),o.setProperty("--color-background--lighten-05",b(s,5)),o.setProperty("--color-background--darken-05",h(s,5)),o.setProperty("--color-background--lighten-075",b(s,7.5)),o.setProperty("--color-background--darken-075",h(s,7.5)),o.setProperty("--color-background--lighten-15",b(s,15)),o.setProperty("--color-background--darken-15",h(s,15)),o.setProperty("--color-background--lighten-30",b(s,30)),o.setProperty("--color-background--darken-30",h(s,30)),o.setProperty("--color-background--lighten-50",b(s,50)),o.setProperty("--color-background--darken-50",h(s,50)),s=n.getPropertyValue("--vscode-button-background").trim(),o.setProperty("--color-button-background",s),o.setProperty("--color-button-background--darken-30",h(s,30)),s=n.getPropertyValue("--vscode-button-secondaryBackground").trim(),o.setProperty("--color-button-secondary-background",s),o.setProperty("--color-button-secondary-background--darken-30",h(s,30)),s=n.getPropertyValue("--vscode-button-background").trim(),o.setProperty("--color-highlight",s),o.setProperty("--color-highlight--75",v(s,75)),o.setProperty("--color-highlight--50",v(s,50)),o.setProperty("--color-highlight--25",v(s,25)),s=n.getPropertyValue("--vscode-button-foreground").trim(),o.setProperty("--color-button-foreground",s);let r=n.getPropertyValue("--vscode-editor-foreground").trim();r||(r=n.getPropertyValue("--vscode-foreground").trim()),o.setProperty("--color-foreground",r),o.setProperty("--color-foreground--85",v(r,85)),o.setProperty("--color-foreground--75",v(r,75)),o.setProperty("--color-foreground--65",v(r,65)),o.setProperty("--color-foreground--50",v(r,50)),s=n.getPropertyValue("--vscode-focusBorder").trim(),o.setProperty("--color-focus-border",s),s=n.getPropertyValue("--vscode-textLink-foreground").trim(),o.setProperty("--color-link-foreground",s),o.setProperty("--color-link-foreground--darken-20",h(s,20)),o.setProperty("--color-link-foreground--lighten-20",b(s,20)),s=n.getPropertyValue("--vscode-sideBar-foreground").trim(),o.setProperty("--color-view-foreground",s||r),o.setProperty("--color-view-header-foreground",n.getPropertyValue("--vscode-sideBarSectionHeader-foreground").trim()||s||r),s=n.getPropertyValue("--vscode-editorHoverWidget-background").trim(),o.setProperty("--color-hover-background",s),s=n.getPropertyValue("--vscode-editorHoverWidget-border").trim(),o.setProperty("--color-hover-border",s),s=n.getPropertyValue("--vscode-editorHoverWidget-foreground").trim(),o.setProperty("--color-hover-foreground",s),s=n.getPropertyValue("--vscode-editorHoverWidget-statusBarBackground").trim(),o.setProperty("--color-hover-statusBarBackground",s)},t=new MutationObserver(i);return t.observe(document.body,{attributes:!0,attributeFilter:["class"]}),i(),t}var ue=Object.defineProperty,de=(i,t,e)=>t in i?ue(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,V=(i,t,e)=>(de(i,typeof t!="symbol"?t+"":t,e),e);const pe=2**30;let _=0;function F(){return _===pe?_=1:_++,`webview:${_}`}class ge{constructor(t){this.appName=t,V(this,"_api"),V(this,"state"),V(this,"bindDisposables"),this.state=window.bootstrap,window.bootstrap=void 0,this.log(`${this.appName}()`),this._api=acquireVsCodeApi(),ce(),requestAnimationFrame(()=>{this.log(`${this.appName}.initializing`);try{this.onInitialize?.(),this.bind(),this.onMessageReceived!=null&&window.addEventListener("message",this.onMessageReceived.bind(this)),this.sendCommand(ee,void 0),this.onInitialized?.()}finally{setTimeout(()=>{document.body.classList.remove("preload")},500)}})}bind(){this.bindDisposables?.forEach(t=>t.dispose()),this.bindDisposables=this.onBind?.()}log(t){}getState(){return this._api.getState()}sendCommand(t,e){const n=F();return this.log(`${this.appName}.sendCommand(${n}): name=${t.method}`),this.postMessage({id:n,method:t.method,params:e})}sendCommandWithCompletion(t,e,n,o){const s=F();this.log(`${this.appName}.sendCommandWithCompletion(${s}): name=${t.method}`);const r=d.on(window,"message",l=>{$(n,l.data,a=>{a.completionId===s&&(r.dispose(),o(a))})});return this.postMessage({id:s,method:t.method,params:e})}setState(t){this.state=t,t!=null&&this._api.setState(t)}postMessage(t){this._api.postMessage(t)}}var he=Object.defineProperty,fe=(i,t,e)=>t in i?he(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,M=(i,t,e)=>(fe(i,typeof t!="symbol"?t+"":t,e),e);const R=new Date().getTimezoneOffset()/60*100,W=new Date(`Wed Jul 25 2018 19:18:00 GMT${R>=0?"-":"+"}${String(Math.abs(R)).padStart(4,"0")}`);class me extends ge{constructor(t){super(t);M(this,"_changes",Object.create(null)),M(this,"_updating",!1),M(this,"_scrollTimer")}onInitialized(){this.updateState()}onBind(){const t=super.onBind?.()??[];return t.push(d.on("input[type=checkbox][data-setting]","change",(e,n)=>this.onInputChecked(n)),d.on("input[type=text][data-setting], input[type=number][data-setting], input:not([type])[data-setting]","blur",(e,n)=>this.onInputBlurred(n)),d.on("input[type=text][data-setting], input[type=number][data-setting], input:not([type])[data-setting]","focus",(e,n)=>this.onInputFocused(n)),d.on("input[type=text][data-setting][data-setting-preview], input[type=number][data-setting][data-setting-preview]","input",(e,n)=>this.onInputChanged(n)),d.on("select[data-setting]","change",(e,n)=>this.onInputSelected(n)),d.on(".popup","mousedown",(e,n)=>this.onPopupMouseDown(n,e))),t}onMessageReceived(t){const e=t.data;switch(this.log(`${this.appName}.onMessageReceived(${e.id}): name=${e.method}`),e.method){case L.method:{$(L,e,n=>{this.scrollToAnchor(n.anchor,n.scrollBehavior)});break}case B.method:$(B,e,n=>{this.state.config=n.config,this.state.customSettings=n.customSettings,this.updateState()});break;default:super.onMessageReceived?.(t)}}applyChanges(){this.sendCommand(ne,{changes:{...this._changes},removes:Object.keys(this._changes).filter(t=>this._changes[t]===void 0),scope:this.getSettingsScope()}),this._changes=Object.create(null)}getSettingsScope(){return"user"}onInputBlurred(t){this.log(`${this.appName}.onInputBlurred: name=${t.name}, value=${t.value}`);const e=document.getElementById(`${t.name}.popup`);e?.classList.add("hidden");let n=t.value;(n==null||n.length===0)&&(n=t.dataset.defaultValue,n===void 0&&(n=null)),this._changes[t.name]=t.type==="number"&&n!=null?Number(n):n,this.applyChanges()}onInputChanged(t){if(!this._updating)for(const e of document.querySelectorAll(`span[data-setting-preview="${t.name}"]`))this.updatePreview(e,t.value)}onInputChecked(t){if(!this._updating){switch(this.log(`${this.appName}.onInputChecked: name=${t.name}, checked=${t.checked}, value=${t.value}`),t.dataset.settingType){case"object":{const e=t.name.split("."),n=e.splice(0,1)[0],o=this.getSettingValue(n)??Object.create(null);t.checked?j(o,e.join("."),z(t.value)):j(o,e.join("."),!1),this._changes[n]=o;break}case"array":{const e=this.getSettingValue(t.name)??[];if(Array.isArray(e)){if(t.checked)e.includes(t.value)||e.push(t.value);else{const n=e.indexOf(t.value);n!==-1&&e.splice(n,1)}this._changes[t.name]=e}break}case"custom":{this._changes[t.name]=t.checked;break}default:{t.checked?this._changes[t.name]=z(t.value):this._changes[t.name]=t.dataset.valueOff==null?!1:t.dataset.valueOff;break}}this.setAdditionalSettings(t.checked?t.dataset.addSettingsOn:t.dataset.addSettingsOff),this.applyChanges()}}onInputFocused(t){this.log(`${this.appName}.onInputFocused: name=${t.name}, value=${t.value}`);const e=document.getElementById(`${t.name}.popup`);if(e!=null){if(e.childElementCount===0){const n=document.querySelector("#token-popup")?.content.cloneNode(!0);e.appendChild(n)}e.classList.remove("hidden")}}onInputSelected(t){if(this._updating)return;const e=t.options[t.selectedIndex].value;this.log(`${this.appName}.onInputSelected: name=${t.name}, value=${e}`),this._changes[t.name]=H(e),this.applyChanges()}onPopupMouseDown(t,e){e.preventDefault();const n=e.target;n?.matches("[data-token]")&&this.onTokenMouseDown(n,e)}onTokenMouseDown(t,e){if(this._updating)return;this.log(`${this.appName}.onTokenClicked: id=${t.id}`);const n=t.closest(".setting");if(n==null)return;const o=n.querySelector("input[type=text], input:not([type])");if(o==null)return;const s=`\${${t.dataset.token}}`;let r=o.selectionStart;r!=null?(o.value=`${o.value.substring(0,r)}${s}${o.value.substr(o.selectionEnd??r)}`,r+=s.length):r=o.value.length,o.focus(),o.setSelectionRange(r,r),r===o.value.length&&(o.scrollLeft=o.scrollWidth),setTimeout(()=>this.onInputChanged(o),0),setTimeout(()=>o.focus(),250),e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault()}scrollToAnchor(t,e,n){const o=document.getElementById(t);o!=null&&this.scrollTo(o,e,n)}scrollTo(t,e,n){const o=t.getBoundingClientRect().top-document.body.getBoundingClientRect().top-(n??0);window.scrollTo({top:o,behavior:e??"smooth"});const s=()=>{this._scrollTimer!=null&&clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>{window.removeEventListener("scroll",s);const r=t.getBoundingClientRect().top-document.body.getBoundingClientRect().top-(n??0);o!==r&&this.scrollTo(t,e,n)},50)};window.addEventListener("scroll",s,!1)}evaluateStateExpression(t,e){let n=!1;for(const o of t.trim().split("&")){const[s,r,l]=ve(o);switch(r){case"=":{let a=e[s];a===void 0&&(a=this.getSettingValue(s)??!1),n=l!==void 0?l===String(a):Boolean(a);break}case"!":{let a=e[s];a===void 0&&(a=this.getSettingValue(s)??!1),n=l!==void 0?l!==String(a):!a;break}case"+":{if(l!==void 0){const a=this.getSettingValue(s);n=a!==void 0?a.includes(l.toString()):!1}break}}if(!n)break}return n}getCustomSettingValue(t){return this.state.customSettings?.[t]}getSettingValue(t){const e=this.getCustomSettingValue(t);return e??ye(this.state.config,t)}updateState(){this._updating=!0,ie(this.state.config.defaultDateLocale);try{for(const e of document.querySelectorAll("input[type=checkbox][data-setting]"))if(e.dataset.settingType==="custom")e.checked=this.getCustomSettingValue(e.name)??!1;else if(e.dataset.settingType==="array")e.checked=(this.getSettingValue(e.name)??[]).includes(e.value);else if(e.dataset.valueOff!=null){const n=this.getSettingValue(e.name);e.checked=e.dataset.valueOff!==n}else e.checked=this.getSettingValue(e.name)??!1;for(const e of document.querySelectorAll("input[type=text][data-setting], input[type=number][data-setting], input:not([type])[data-setting]"))e.value=this.getSettingValue(e.name)??"";for(const e of document.querySelectorAll("select[data-setting]")){const n=this.getSettingValue(e.name),o=e.querySelector(`option[value='${n}']`);o!=null&&(o.selected=!0)}for(const e of document.querySelectorAll("span[data-setting-preview]"))this.updatePreview(e)}finally{this._updating=!1}const t=Y(this.state.config);this.setVisibility(t),this.setEnablement(t)}setAdditionalSettings(t){if(!t)return;const e=be(t);for(const[n,o]of e)this._changes[n]=o}setEnablement(t){for(const e of document.querySelectorAll("[data-enablement]")){const n=!this.evaluateStateExpression(e.dataset.enablement,t);if(n?e.setAttribute("disabled",""):e.removeAttribute("disabled"),e.matches("input,select"))e.disabled=n;else{const o=e.querySelector("input,select");if(o==null)continue;o.disabled=n}}}setVisibility(t){for(const e of document.querySelectorAll("[data-visibility]"))e.classList.toggle("hidden",!this.evaluateStateExpression(e.dataset.visibility,t))}updatePreview(t,e){switch(t.dataset.settingPreviewType){case"date":{e===void 0&&(e=this.getSettingValue(t.dataset.settingPreview)),e||(e=t.dataset.settingPreviewDefault),t.innerText=e==null?"":q(W,e,void 0,!1);break}case"date-locale":{e===void 0&&(e=this.getSettingValue(t.dataset.settingPreview)),e||(e=void 0);const n=this.getSettingValue(t.dataset.settingPreviewDefault)??"MMMM Do, YYYY h:mma";try{t.innerText=q(W,n,e,!1)}catch(o){t.innerText=o.message}break}case"commit":{if(e===void 0&&(e=this.getSettingValue(t.dataset.settingPreview)),e||(e=t.dataset.settingPreviewDefault),e==null){t.innerText="";return}this.sendCommandWithCompletion(te,{key:t.dataset.settingPreview,type:"commit",format:e},oe,n=>{t.innerText=n.preview??""});break}default:break}}}function H(i){return i==="true"?!0:i==="false"?!1:i==="null"?null:i}function ye(i,t){return t.split(".").reduce((e={},n)=>e?.[n],i)}function j(i,t,e){const n=t.split("."),o=n.length,s=o-1;let r=-1,l=i;for(;l!=null&&++r{const[n,o]=e.split("=");return[n,H(o)]})}function ve(i){const[t,e,n]=i.trim().split(/([=+!])/);return[t.trim(),e!==void 0?e.trim():"=",n!==void 0?n.trim():n]}function Y(i,t){const e={};for(const n in i){const o=i[n];Array.isArray(o)||(typeof o=="object"?Object.assign(e,Y(o,t===void 0?n:`${t}.${n}`)):e[t===void 0?n:`${t}.${n}`]=o)}return e}function z(i){switch(i){case"on":return!0;case"null":return null;case"undefined":return;default:return i}}var ke=Object.defineProperty,Se=(i,t,e)=>t in i?ke(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,T=(i,t,e)=>(Se(i,typeof t!="symbol"?t+"":t,e),e);const J=83;class we extends me{constructor(){super("SettingsApp");T(this,"_scopes",null),T(this,"_observer"),T(this,"_activeSection","general"),T(this,"_sections",new Map)}onInitialize(){const t=document.getElementById("scopes");if(t!=null&&this.state.scopes.length>1){for(const[o,s]of this.state.scopes){const r=document.createElement("option");r.value=o,r.innerHTML=s,this.state.scope===o&&(r.selected=!0),t.appendChild(r)}t.parentElement.parentElement.classList.remove("hidden"),this._scopes=t}let e=J;const n=document.querySelector(".hero__area--sticky");n!=null&&(e=n.clientHeight),this._observer=new IntersectionObserver(this.onObserver.bind(this),{rootMargin:`-${e}px 0px 0px 0px`});for(const o of document.querySelectorAll("section[id]>.section__header"))this._sections.set(o.parentElement.id,!1),this._observer.observe(o);for(const o of document.querySelectorAll("[data-setting]")){!o.title&&o.type==="checkbox"&&(o.title=`Setting name: "gitlens.${o.name}"`);for(const s of document.querySelectorAll(`label[for="${o.id}"]`))s.title||(s.title=`Setting name: "gitlens.${o.name}"`)}}onBind(){const t=super.onBind?.()??[];return t.push(d.on(".section--collapsible>.section__header","click",(e,n)=>this.onSectionHeaderClicked(n,e)),d.on(".setting--expandable .setting__expander","click",(e,n)=>this.onSettingExpanderCicked(n,e)),d.on('a[data-action="jump"]',"mousedown",e=>{e.stopPropagation(),e.preventDefault()}),d.on('a[data-action="jump"]',"click",(e,n)=>this.onJumpToLinkClicked(n,e)),d.on("[data-action]","mousedown",e=>{e.stopPropagation(),e.preventDefault()}),d.on("[data-action]","click",(e,n)=>this.onActionLinkClicked(n,e))),t}scrollToAnchor(t,e){let n=J;const o=document.querySelector(".hero__area--sticky");o!=null&&(n=o.clientHeight),super.scrollToAnchor(t,e,n)}onObserver(t,e){for(const o of t)this._sections.set(o.target.parentElement.id,o.isIntersecting);let n;for(const[o,s]of this._sections.entries())if(s){n=o;break}if(n===void 0){if(t.length!==1)return;const o=t[0];if(o.boundingClientRect==null||o.rootBounds==null)return;if(n=o.target.parentElement.id,o.boundingClientRect.top>=o.rootBounds.bottom){const s=[...this._sections.keys()],r=s.indexOf(n);if(r<=0)return;n=s[r-1]}}this._activeSection!==n&&(this._activeSection!==void 0&&this.toggleJumpLink(this._activeSection,!1),this._activeSection=n,this.toggleJumpLink(this._activeSection,!0))}getSettingsScope(){return this._scopes!=null?this._scopes.options[this._scopes.selectedIndex].value:"user"}onActionLinkClicked(t,e){switch(t.dataset.action){case"collapse":for(const n of document.querySelectorAll(".section--collapsible"))n.classList.add("collapsed");document.querySelector('[data-action="collapse"]').classList.add("hidden"),document.querySelector('[data-action="expand"]').classList.remove("hidden");break;case"expand":for(const n of document.querySelectorAll(".section--collapsible"))n.classList.remove("collapsed");document.querySelector('[data-action="collapse"]').classList.remove("hidden"),document.querySelector('[data-action="expand"]').classList.add("hidden");break}e.preventDefault(),e.stopPropagation()}onInputSelected(t){t!==this._scopes&&super.onInputSelected(t)}onJumpToLinkClicked(t,e){const n=t.getAttribute("href");if(n==null)return;const o=n.substr(1);this.scrollToAnchor(o,"smooth"),e.stopPropagation(),e.preventDefault()}onSectionHeaderClicked(t,e){e.target.matches("a, input, label, i.icon__info")||t.parentElement.classList.toggle("collapsed")}onSettingExpanderCicked(t,e){t.parentElement.parentElement.classList.toggle("expanded")}toggleJumpLink(t,e){const n=document.querySelector(`a.sidebar__jump-link[href="#${t}"]`);n?.classList.toggle("active",e)}}new we})(); //# sourceMappingURL=settings.js.map