mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
243 lines
106 KiB
JavaScript
243 lines
106 KiB
JavaScript
(()=>{"use strict";var Re={};Re.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var Ui={};const B=function(){if(typeof globalThis<"u")return globalThis;if(typeof Re.g<"u")return Re.g;if(typeof self<"u")return self;if(typeof window<"u")return window;try{return new Function("return this")()}catch{return{}}}();B.trustedTypes===void 0&&(B.trustedTypes={createPolicy:(n,e)=>e});const ut={configurable:!1,enumerable:!1,writable:!1};B.FAST===void 0&&Reflect.defineProperty(B,"FAST",Object.assign({value:Object.create(null)},ut));const Z=B.FAST;if(Z.getById===void 0){const n=Object.create(null);Reflect.defineProperty(Z,"getById",Object.assign({value(e,t){let r=n[e];return r===void 0&&(r=t?n[e]=t():null),r}},ut))}const J=Object.freeze([]),Oe=B.FAST.getById(1,()=>{const n=[],e=[];function t(){if(e.length)throw e.shift()}function r(o){try{o.call()}catch(a){e.push(a),setTimeout(t,0)}}function i(){let a=0;for(;a<n.length;)if(r(n[a]),a++,a>1024){for(let c=0,l=n.length-a;c<l;c++)n[c]=n[c+a];n.length-=a,a=0}n.length=0}function s(o){n.length<1&&B.requestAnimationFrame(i),n.push(o)}return Object.freeze({enqueue:s,process:i})}),dt=B.trustedTypes.createPolicy("fast-html",{createHTML:n=>n});let Ee=dt;const X=`fast-${Math.random().toString(36).substring(2,8)}`,ht=`${X}{`,Be=`}${X}`,y=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(n){if(Ee!==dt)throw new Error("The HTML policy can only be set once.");Ee=n},createHTML(n){return Ee.createHTML(n)},isMarker(n){return n&&n.nodeType===8&&n.data.startsWith(X)},extractDirectiveIndexFromMarker(n){return parseInt(n.data.replace(`${X}:`,""))},createInterpolationPlaceholder(n){return`${ht}${n}${Be}`},createCustomAttributePlaceholder(n,e){return`${n}="${this.createInterpolationPlaceholder(e)}"`},createBlockPlaceholder(n){return`<!--${X}:${n}-->`},queueUpdate:Oe.enqueue,processUpdates:Oe.process,nextUpdate(){return new Promise(Oe.enqueue)},setAttribute(n,e,t){t==null?n.removeAttribute(e):n.setAttribute(e,t)},setBooleanAttribute(n,e,t){t?n.setAttribute(e,""):n.removeAttribute(e)},removeChildNodes(n){for(let e=n.firstChild;e!==null;e=n.firstChild)n.removeChild(e)},createTemplateWalker(n){return document.createTreeWalker(n,133,null,!1)}});function $n(n){const e=this.spillover;e.indexOf(n)===-1&&e.push(n)}function Tn(n){const e=this.spillover,t=e.indexOf(n);t!==-1&&e.splice(t,1)}function _n(n){const e=this.spillover,t=this.source;for(let r=0,i=e.length;r<i;++r)e[r].handleChange(t,n)}function Dn(n){return this.spillover.indexOf(n)!==-1}class Fe{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return this.sub1===e||this.sub2===e}subscribe(e){if(!this.has(e)){if(this.sub1===void 0){this.sub1=e;return}if(this.sub2===void 0){this.sub2=e;return}this.spillover=[this.sub1,this.sub2,e],this.subscribe=$n,this.unsubscribe=Tn,this.notify=_n,this.has=Dn,this.sub1=void 0,this.sub2=void 0}}unsubscribe(e){this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0)}notify(e){const t=this.sub1,r=this.sub2,i=this.source;t!==void 0&&t.handleChange(i,e),r!==void 0&&r.handleChange(i,e)}}class ft{constructor(e){this.subscribers={},this.sourceSubscribers=null,this.source=e}notify(e){var t;const r=this.subscribers[e];r!==void 0&&r.notify(e),(t=this.sourceSubscribers)===null||t===void 0||t.notify(e)}subscribe(e,t){var r;if(t){let i=this.subscribers[t];i===void 0&&(this.subscribers[t]=i=new Fe(this.source)),i.subscribe(e)}else this.sourceSubscribers=(r=this.sourceSubscribers)!==null&&r!==void 0?r:new Fe(this.source),this.sourceSubscribers.subscribe(e)}unsubscribe(e,t){var r;if(t){const i=this.subscribers[t];i!==void 0&&i.unsubscribe(e)}else(r=this.sourceSubscribers)===null||r===void 0||r.unsubscribe(e)}}const P=Z.getById(2,()=>{const n=/(:|&&|\|\||if)/,e=new WeakMap,t=new WeakMap,r=y.queueUpdate;let i,s=d=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function o(d){let u=d.$fastController||e.get(d);return u===void 0&&(Array.isArray(d)?u=s(d):e.set(d,u=new ft(d))),u}function a(d){let u=t.get(d);if(u===void 0){let h=Reflect.getPrototypeOf(d);for(;u===void 0&&h!==null;)u=t.get(h),h=Reflect.getPrototypeOf(h);u===void 0?u=[]:u=u.slice(0),t.set(d,u)}return u}class c{constructor(u){this.name=u,this.field=`_${u}`,this.callback=`${u}Changed`}getValue(u){return i!==void 0&&i.watch(u,this.name),u[this.field]}setValue(u,h){const m=this.field,w=u[m];if(w!==h){u[m]=h;const k=u[this.callback];typeof k=="function"&&k.call(u,w,h),o(u).notify(this.name)}}}class l extends Fe{constructor(u,h,m=!1){super(u,h);this.binding=u,this.isVolatileBinding=m,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(u,h){this.needsRefresh&&this.last!==null&&this.disconnect();const m=i;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const w=this.binding(u,h);return i=m,w}disconnect(){if(this.last!==null){let u=this.first;for(;u!==void 0;)u.notifier.unsubscribe(this,u.propertyName),u=u.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(u,h){const m=this.last,w=o(u),k=m===null?this.first:{};if(k.propertySource=u,k.propertyName=h,k.notifier=w,w.subscribe(this,h),m!==null){if(!this.needsRefresh){let V;i=void 0,V=m.propertySource[m.propertyName],i=this,u===V&&(this.needsRefresh=!0)}m.next=k}this.last=k}handleChange(){this.needsQueue&&(this.needsQueue=!1,r(this))}call(){this.last!==null&&(this.needsQueue=!0,this.notify(this))}records(){let u=this.first;return{next:()=>{const h=u;return h===void 0?{value:void 0,done:!0}:(u=u.next,{value:h,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(d){s=d},getNotifier:o,track(d,u){i!==void 0&&i.watch(d,u)},trackVolatile(){i!==void 0&&(i.needsRefresh=!0)},notify(d,u){o(d).notify(u)},defineProperty(d,u){typeof u=="string"&&(u=new c(u)),a(d).push(u),Reflect.defineProperty(d,u.name,{enumerable:!0,get:function(){return u.getValue(this)},set:function(h){u.setValue(this,h)}})},getAccessors:a,binding(d,u,h=this.isVolatileBinding(d)){return new l(d,u,h)},isVolatileBinding(d){return n.test(d.toString())}})});function q(n,e){P.defineProperty(n,e)}function Wi(n,e,t){return Object.assign({},t,{get:function(){return P.trackVolatile(),t.get.apply(this)}})}const pt=Z.getById(3,()=>{let n=null;return{get(){return n},set(e){n=e}}});class K{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return pt.get()}get isEven(){return this.index%2===0}get isOdd(){return this.index%2!==0}get isFirst(){return this.index===0}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){pt.set(e)}}P.defineProperty(K.prototype,"index"),P.defineProperty(K.prototype,"length");const ee=Object.seal(new K);class T{constructor(){this.targets=new WeakSet,this.behaviors=null}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=this.behaviors===null?e:this.behaviors.concat(e),this}}T.create=(()=>{if(y.supportsAdoptedStyleSheets){const n=new Map;return e=>new Rn(e,n)}return n=>new Bn(n)})();function Ae(n){return n.map(e=>e instanceof T?Ae(e.styles):[e]).reduce((e,t)=>e.concat(t),[])}function gt(n){return n.map(e=>e instanceof T?e.behaviors:null).reduce((e,t)=>t===null?e:(e===null&&(e=[]),e.concat(t)),null)}class Rn extends T{constructor(e,t){super();this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=gt(e)}get styleSheets(){if(this._styleSheets===void 0){const e=this.styles,t=this.styleSheetCache;this._styleSheets=Ae(e).map(r=>{if(r instanceof CSSStyleSheet)return r;let i=t.get(r);return i===void 0&&(i=new CSSStyleSheet,i.replaceSync(r),t.set(r,i)),i})}return this._styleSheets}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.styleSheets],super.addStylesTo(e)}removeStylesFrom(e){const t=this.styleSheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter(r=>t.indexOf(r)===-1),super.removeStylesFrom(e)}}let On=0;function En(){return`fast-style-class-${++On}`}class Bn extends T{constructor(e){super();this.styles=e,this.behaviors=null,this.behaviors=gt(e),this.styleSheets=Ae(e),this.styleClass=En()}addStylesTo(e){const t=this.styleSheets,r=this.styleClass;e=this.normalizeTarget(e);for(let i=0;i<t.length;i++){const s=document.createElement("style");s.innerHTML=t[i],s.className=r,e.append(s)}super.addStylesTo(e)}removeStylesFrom(e){e=this.normalizeTarget(e);const t=e.querySelectorAll(`.${this.styleClass}`);for(let r=0,i=t.length;r<i;++r)e.removeChild(t[r]);super.removeStylesFrom(e)}isAttachedTo(e){return super.isAttachedTo(this.normalizeTarget(e))}normalizeTarget(e){return e===document?document.body:e}}const Fn={toView(n){return n?"true":"false"},fromView(n){return!(n==null||n==="false"||n===!1||n===0)}},Gi={toView(n){if(n==null)return null;const e=n*1;return isNaN(e)?null:e.toString()},fromView(n){if(n==null)return null;const e=n*1;return isNaN(e)?null:e}};class he{constructor(e,t,r=t.toLowerCase(),i="reflect",s){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=r,this.mode=i,this.converter=s,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i==="boolean"&&s===void 0&&(this.converter=Fn)}setValue(e,t){const r=e[this.fieldName],i=this.converter;i!==void 0&&(t=i.fromView(t)),r!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](r,t),e.$fastController.notify(this.name))}getValue(e){return P.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,r=this.guards;r.has(e)||t==="fromView"||y.queueUpdate(()=>{r.add(e);const i=e[this.fieldName];switch(t){case"reflect":const s=this.converter;y.setAttribute(e,this.attribute,s!==void 0?s.toView(i):i);break;case"boolean":y.setBooleanAttribute(e,this.attribute,i);break}r.delete(e)})}static collect(e,...t){const r=[];t.push(e.attributes);for(let i=0,s=t.length;i<s;++i){const o=t[i];if(o!==void 0)for(let a=0,c=o.length;a<c;++a){const l=o[a];typeof l=="string"?r.push(new he(e,l)):r.push(new he(e,l.property,l.attribute,l.mode,l.converter))}}return r}}function p(n,e){let t;function r(i,s){arguments.length>1&&(t.property=s),(i.constructor.attributes||(i.constructor.attributes=[])).push(t)}if(arguments.length>1){t={},r(n,e);return}return t=n===void 0?{}:n,r}const bt={mode:"open"},mt={},Ie=Z.getById(4,()=>{const n=new Map;return Object.freeze({register(e){return n.has(e.type)?!1:(n.set(e.type,e),!0)},getByType(e){return n.get(e)}})});class fe{constructor(e,t=e.definition){typeof t=="string"&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const r=he.collect(e,t.attributes),i=new Array(r.length),s={},o={};for(let a=0,c=r.length;a<c;++a){const l=r[a];i[a]=l.attribute,s[l.name]=l,o[l.attribute]=l}this.attributes=r,this.observedAttributes=i,this.propertyLookup=s,this.attributeLookup=o,this.shadowOptions=t.shadowOptions===void 0?bt:t.shadowOptions===null?void 0:Object.assign(Object.assign({},bt),t.shadowOptions),this.elementOptions=t.elementOptions===void 0?mt:Object.assign(Object.assign({},mt),t.elementOptions),this.styles=t.styles===void 0?void 0:Array.isArray(t.styles)?T.create(t.styles):t.styles instanceof T?t.styles:T.create([t.styles])}get isDefined(){return!!Ie.getByType(this.type)}define(e=customElements){const t=this.type;if(Ie.register(this)){const r=this.attributes,i=t.prototype;for(let s=0,o=r.length;s<o;++s)P.defineProperty(i,r[s]);Reflect.defineProperty(t,"observedAttributes",{value:this.observedAttributes,enumerable:!0})}return e.get(this.name)||e.define(this.name,t,this.elementOptions),this}}fe.forType=Ie.getByType;/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Me=function(n,e){return Me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Me(n,e)};function Qi(n,e){Me(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var yt=function(){return yt=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},yt.apply(this,arguments)};function Yi(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function g(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function Zi(n,e){return function(t,r){e(t,r,n)}}function Ji(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function Xi(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{l(r.next(d))}catch(u){o(u)}}function c(d){try{l(r.throw(d))}catch(u){o(u)}}function l(d){d.done?s(d.value):i(d.value).then(a,c)}l((r=r.apply(n,e||[])).next())})}function Ki(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(d){l=[6,d],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function es(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function ts(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function vt(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function An(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function ns(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(An(arguments[e]));return n}function rs(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function pe(n){return this instanceof pe?(this.v=n,this):new pe(n)}function is(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(m){return new Promise(function(w,k){s.push([h,m,w,k])>1||a(h,m)})})}function a(h,m){try{c(r[h](m))}catch(w){u(s[0][3],w)}}function c(h){h.value instanceof pe?Promise.resolve(h.value.v).then(l,d):u(s[0][2],h)}function l(h){a("next",h)}function d(h){a("throw",h)}function u(h,m){h(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function ss(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:pe(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function os(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof vt=="function"?vt(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,c){o=n[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function as(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function ls(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function cs(n){return n&&n.__esModule?n:{default:n}}function us(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function ds(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}const wt=new WeakMap,In={bubbles:!0,composed:!0,cancelable:!0};function Ne(n){return n.shadowRoot||wt.get(n)||null}class Ve extends ft{constructor(e,t){super(e);this.boundObservables=null,this.behaviors=null,this.needsInitialization=!0,this._template=null,this._styles=null,this._isConnected=!1,this.$fastController=this,this.view=null,this.element=e,this.definition=t;const r=t.shadowOptions;if(r!==void 0){const s=e.attachShadow(r);r.mode==="closed"&&wt.set(e,s)}const i=P.getAccessors(e);if(i.length>0){const s=this.boundObservables=Object.create(null);for(let o=0,a=i.length;o<a;++o){const c=i[o].name,l=e[c];l!==void 0&&(delete e[c],s[c]=l)}}}get isConnected(){return P.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,P.notify(this,"isConnected")}get template(){return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get styles(){return this._styles}set styles(e){this._styles!==e&&(this._styles!==null&&this.removeStyles(this._styles),this._styles=e,!this.needsInitialization&&e!==null&&this.addStyles(e))}addStyles(e){const t=Ne(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.append(e);else if(!e.isAttachedTo(t)){const r=e.behaviors;e.addStylesTo(t),r!==null&&this.addBehaviors(r)}}removeStyles(e){const t=Ne(this.element)||this.element.getRootNode();if(e instanceof HTMLStyleElement)t.removeChild(e);else if(e.isAttachedTo(t)){const r=e.behaviors;e.removeStylesFrom(t),r!==null&&this.removeBehaviors(r)}}addBehaviors(e){const t=this.behaviors||(this.behaviors=new Map),r=e.length,i=[];for(let s=0;s<r;++s){const o=e[s];t.has(o)?t.set(o,t.get(o)+1):(t.set(o,1),i.push(o))}if(this._isConnected){const s=this.element;for(let o=0;o<i.length;++o)i[o].bind(s,ee)}}removeBehaviors(e,t=!1){const r=this.behaviors;if(r===null)return;const i=e.length,s=[];for(let o=0;o<i;++o){const a=e[o];if(r.has(a)){const c=r.get(a)-1;c===0||t?r.delete(a)&&s.push(a):r.set(a,c)}}if(this._isConnected){const o=this.element;for(let a=0;a<s.length;++a)s[a].unbind(o)}}onConnectedCallback(){if(this._isConnected)return;const e=this.element;this.needsInitialization?this.finishInitialization():this.view!==null&&this.view.bind(e,ee);const t=this.behaviors;if(t!==null)for(const[r]of t)r.bind(e,ee);this.setIsConnected(!0)}onDisconnectedCallback(){if(!this._isConnected)return;this.setIsConnected(!1);const e=this.view;e!==null&&e.unbind();const t=this.behaviors;if(t!==null){const r=this.element;for(const[i]of t)i.unbind(r)}}onAttributeChangedCallback(e,t,r){const i=this.definition.attributeLookup[e];i!==void 0&&i.onAttributeChangedCallback(this.element,r)}emit(e,t,r){return this._isConnected?this.element.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},In),r))):!1}finishInitialization(){const e=this.element,t=this.boundObservables;if(t!==null){const i=Object.keys(t);for(let s=0,o=i.length;s<o;++s){const a=i[s];e[a]=t[a]}this.boundObservables=null}const r=this.definition;this._template===null&&(this.element.resolveTemplate?this._template=this.element.resolveTemplate():r.template&&(this._template=r.template||null)),this._template!==null&&this.renderTemplate(this._template),this._styles===null&&(this.element.resolveStyles?this._styles=this.element.resolveStyles():r.styles&&(this._styles=r.styles||null)),this._styles!==null&&this.addStyles(this._styles),this.needsInitialization=!1}renderTemplate(e){const t=this.element,r=Ne(t)||t;this.view!==null?(this.view.dispose(),this.view=null):this.needsInitialization||y.removeChildNodes(r),e&&(this.view=e.render(t,r,t))}static forCustomElement(e){const t=e.$fastController;if(t!==void 0)return t;const r=fe.forType(e.constructor);if(r===void 0)throw new Error("Missing FASTElement definition.");return e.$fastController=new Ve(e,r)}}function kt(n){return class extends n{constructor(){super();Ve.forCustomElement(this)}$emit(e,t,r){return this.$fastController.emit(e,t,r)}connectedCallback(){this.$fastController.onConnectedCallback()}disconnectedCallback(){this.$fastController.onDisconnectedCallback()}attributeChangedCallback(e,t,r){this.$fastController.onAttributeChangedCallback(e,t,r)}}}const ge=Object.assign(kt(HTMLElement),{from(n){return kt(n)},define(n,e){return new fe(n,e).define().type}});function hs(n){return function(e){new FASTElementDefinition(e,n).define()}}const Le=new Map;"metadata"in Reflect||(Reflect.metadata=function(n,e){return function(t){Reflect.defineMetadata(n,e,t)}},Reflect.defineMetadata=function(n,e,t){let r=Le.get(t);r===void 0&&Le.set(t,r=new Map),r.set(n,e)},Reflect.getOwnMetadata=function(n,e){const t=Le.get(e);if(t!==void 0)return t.get(n)});class Mn{constructor(e,t){this.container=e,this.key=t}instance(e){return this.registerResolver(0,e)}singleton(e){return this.registerResolver(1,e)}transient(e){return this.registerResolver(2,e)}callback(e){return this.registerResolver(3,e)}cachedCallback(e){return this.registerResolver(3,Rt(e))}aliasTo(e){return this.registerResolver(5,e)}registerResolver(e,t){const{container:r,key:i}=this;return this.container=this.key=void 0,r.registerResolver(i,new _(i,e,t))}}function te(n){const e=n.slice(),t=Object.keys(n),r=t.length;let i;for(let s=0;s<r;++s)i=t[s],Ft(i)||(e[i]=n[i]);return e}const Nn=Object.freeze({none(n){throw Error(`${n.toString()} not registered, did you forget to add @singleton()?`)},singleton(n){return new _(n,1,n)},transient(n){return new _(n,2,n)}}),je=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:Nn.singleton})}),Ct=new Map;function xt(n){return e=>Reflect.getOwnMetadata(n,e)}let Pt=null;const b=Object.freeze({createContainer(n){return new ne(null,Object.assign({},je.default,n))},findResponsibleContainer(n){const e=n.$$container$$;return e&&e.responsibleForOwnerRequests?e:b.findParentContainer(n)},findParentContainer(n){const e=new CustomEvent(Dt,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return n.dispatchEvent(e),e.detail.container||b.getOrCreateDOMContainer()},getOrCreateDOMContainer(n,e){return n?n.$$container$$||new ne(n,Object.assign({},je.default,e,{parentLocator:b.findParentContainer})):Pt||(Pt=new ne(null,Object.assign({},je.default,e,{parentLocator:()=>null})))},getDesignParamtypes:xt("design:paramtypes"),getAnnotationParamtypes:xt("di:paramtypes"),getOrCreateAnnotationParamTypes(n){let e=this.getAnnotationParamtypes(n);return e===void 0&&Reflect.defineMetadata("di:paramtypes",e=[],n),e},getDependencies(n){let e=Ct.get(n);if(e===void 0){const t=n.inject;if(t===void 0){const r=b.getDesignParamtypes(n),i=b.getAnnotationParamtypes(n);if(r===void 0)if(i===void 0){const s=Object.getPrototypeOf(n);typeof s=="function"&&s!==Function.prototype?e=te(b.getDependencies(s)):e=[]}else e=te(i);else if(i===void 0)e=te(r);else{e=te(r);let s=i.length,o;for(let l=0;l<s;++l)o=i[l],o!==void 0&&(e[l]=o);const a=Object.keys(i);s=a.length;let c;for(let l=0;l<s;++l)c=a[l],Ft(c)||(e[c]=i[c])}}else e=te(t);Ct.set(n,e)}return e},defineProperty(n,e,t,r=!1){const i=`$di_${e}`;Reflect.defineProperty(n,e,{get:function(){let s=this[i];if(s===void 0&&(s=(this instanceof HTMLElement?b.findResponsibleContainer(this):b.getOrCreateDOMContainer()).get(t),this[i]=s,r&&this instanceof ge)){const a=this.$fastController,c=()=>{const d=b.findResponsibleContainer(this).get(t),u=this[i];d!==u&&(this[i]=s,a.notify(e))};a.subscribe({handleChange:c},"isConnected")}return s}})},createInterface(n,e){const t=typeof n=="function"?n:e,r=typeof n=="string"?n:n&&"friendlyName"in n&&n.friendlyName||Et,i=typeof n=="string"?!1:n&&"respectConnection"in n&&n.respectConnection||!1,s=function(o,a,c){if(o==null||new.target!==void 0)throw new Error(`No registration for interface: '${s.friendlyName}'`);if(a)b.defineProperty(o,a,s,i);else{const l=b.getOrCreateAnnotationParamTypes(o);l[c]=s}};return s.$isInterface=!0,s.friendlyName=r??"(anonymous)",t!=null&&(s.register=function(o,a){return t(new Mn(o,a??s))}),s.toString=function(){return`InterfaceSymbol<${s.friendlyName}>`},s},inject(...n){return function(e,t,r){if(typeof r=="number"){const i=b.getOrCreateAnnotationParamTypes(e),s=n[0];s!==void 0&&(i[r]=s)}else if(t)b.defineProperty(e,t,n[0]);else{const i=r?b.getOrCreateAnnotationParamTypes(r.value):b.getOrCreateAnnotationParamTypes(e);let s;for(let o=0;o<n.length;++o)s=n[o],s!==void 0&&(i[o]=s)}}},transient(n){return n.register=function(t){return re.transient(n,n).register(t)},n.registerInRequestor=!1,n},singleton(n,e=Ln){return n.register=function(r){return re.singleton(n,n).register(r)},n.registerInRequestor=e.scoped,n}}),Vn=b.createInterface("Container"),fs=null;function be(n){return function(e){const t=function(r,i,s){b.inject(t)(r,i,s)};return t.$isResolver=!0,t.resolve=function(r,i){return n(e,r,i)},t}}const ps=b.inject;function St(n){return b.transient(n)}function gs(n){return n==null?St:St(n)}const Ln={scoped:!1};function bs(n){return b.singleton(n)}function ms(n){return typeof n=="function"?b.singleton(n):function(e){return b.singleton(e,n)}}function jn(n){return function(e,t){t=!!t;const r=function(i,s,o){b.inject(r)(i,s,o)};return r.$isResolver=!0,r.resolve=function(i,s){return n(e,i,s,t)},r}}const ys=jn((n,e,t,r)=>t.getAll(n,r)),vs=be((n,e,t)=>()=>t.get(n)),ws=be((n,e,t)=>{if(t.has(n,!0))return t.get(n)});function He(n,e,t){b.inject(He)(n,e,t)}He.$isResolver=!0,He.resolve=()=>{};const ks=be((n,e,t)=>{const r=$t(n,e),i=new _(n,0,r);return t.registerResolver(n,i),r}),Cs=be((n,e,t)=>$t(n,e));function $t(n,e){return e.getFactory(n).construct(e)}class _{constructor(e,t,r){this.key=e,this.strategy=t,this.state=r,this.resolving=!1}get $isResolver(){return!0}register(e){return e.registerResolver(this.key,this)}resolve(e,t){switch(this.strategy){case 0:return this.state;case 1:{if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=e.getFactory(this.state).construct(t),this.strategy=0,this.resolving=!1,this.state}case 2:{const r=e.getFactory(this.state);if(r===null)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return r.construct(t)}case 3:return this.state(e,t,this);case 4:return this.state[0].resolve(e,t);case 5:return t.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(e){var t,r,i;switch(this.strategy){case 1:case 2:return e.getFactory(this.state);case 5:return(i=(r=(t=e.getResolver(this.state))===null||t===void 0?void 0:t.getFactory)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:null;default:return null}}}function Tt(n){return this.get(n)}function Hn(n,e){return e(n)}class zn{constructor(e,t){this.Type=e,this.dependencies=t,this.transformers=null}construct(e,t){let r;return t===void 0?r=new this.Type(...this.dependencies.map(Tt,e)):r=new this.Type(...this.dependencies.map(Tt,e),...t),this.transformers==null?r:this.transformers.reduce(Hn,r)}registerTransformer(e){(this.transformers||(this.transformers=[])).push(e)}}const qn={$isResolver:!0,resolve(n,e){return e}};function me(n){return typeof n.register=="function"}function Un(n){return me(n)&&typeof n.registerInRequestor=="boolean"}function _t(n){return Un(n)&&n.registerInRequestor}function Wn(n){return n.prototype!==void 0}const Gn=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),Dt="__DI_LOCATE_PARENT__",ze=new Map;class ne{constructor(e,t){this.owner=e,this.config=t,this._parent=void 0,this.registerDepth=0,this.context=null,e!==null&&(e.$$container$$=this),this.resolvers=new Map,this.resolvers.set(Vn,qn),e instanceof Node&&e.addEventListener(Dt,r=>{r.composedPath()[0]!==this.owner&&(r.detail.container=this,r.stopImmediatePropagation())})}get parent(){return this._parent===void 0&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return this.parent===null?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(e,...t){return this.context=e,this.register(...t),this.context=null,this}register(...e){if(++this.registerDepth===100)throw new Error("Unable to autoregister dependency");let t,r,i,s,o;const a=this.context;for(let c=0,l=e.length;c<l;++c)if(t=e[c],!!Bt(t))if(me(t))t.register(this,a);else if(Wn(t))re.singleton(t,t).register(this);else for(r=Object.keys(t),s=0,o=r.length;s<o;++s)i=t[r[s]],Bt(i)&&(me(i)?i.register(this,a):this.register(i));return--this.registerDepth,this}registerResolver(e,t){ye(e);const r=this.resolvers,i=r.get(e);return i==null?r.set(e,t):i instanceof _&&i.strategy===4?i.state.push(t):r.set(e,new _(e,4,[i,t])),t}registerTransformer(e,t){const r=this.getResolver(e);if(r==null)return!1;if(r.getFactory){const i=r.getFactory(this);return i==null?!1:(i.registerTransformer(t),!0)}return!1}getResolver(e,t=!0){if(ye(e),e.resolve!==void 0)return e;let r=this,i;for(;r!=null;)if(i=r.resolvers.get(e),i==null){if(r.parent==null){const s=_t(e)?this:r;return t?this.jitRegister(e,s):null}r=r.parent}else return i;return null}has(e,t=!1){return this.resolvers.has(e)?!0:t&&this.parent!=null?this.parent.has(e,!0):!1}get(e){if(ye(e),e.$isResolver)return e.resolve(this,this);let t=this,r;for(;t!=null;)if(r=t.resolvers.get(e),r==null){if(t.parent==null){const i=_t(e)?this:t;return r=this.jitRegister(e,i),r.resolve(t,this)}t=t.parent}else return r.resolve(t,this);throw new Error(`Unable to resolve key: ${e}`)}getAll(e,t=!1){ye(e);const r=this;let i=r,s;if(t){let o=J;for(;i!=null;)s=i.resolvers.get(e),s!=null&&(o=o.concat(Ot(s,i,r))),i=i.parent;return o}else for(;i!=null;)if(s=i.resolvers.get(e),s==null){if(i=i.parent,i==null)return J}else return Ot(s,i,r);return J}getFactory(e){let t=ze.get(e);if(t===void 0){if(Qn(e))throw new Error(`${e.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`);ze.set(e,t=new zn(e,b.getDependencies(e)))}return t}registerFactory(e,t){ze.set(e,t)}createChild(e){return new ne(null,Object.assign({},this.config,e,{parentLocator:()=>this}))}jitRegister(e,t){if(typeof e!="function")throw new Error(`Attempted to jitRegister something that is not a constructor: '${e}'. Did you forget to register this dependency?`);if(Gn.has(e.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${e.name}. Did you forget to add @inject(Key)`);if(me(e)){const r=e.register(t);if(!(r instanceof Object)||r.resolve==null){const i=t.resolvers.get(e);if(i!=null)return i;throw new Error("A valid resolver was not returned from the static register method")}return r}else{if(e.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${e.friendlyName}`);{const r=this.config.defaultResolver(e,t);return t.resolvers.set(e,r),r}}}}const qe=new WeakMap;function Rt(n){return function(e,t,r){if(qe.has(r))return qe.get(r);const i=n(e,t,r);return qe.set(r,i),i}}const re=Object.freeze({instance(n,e){return new _(n,0,e)},singleton(n,e){return new _(n,1,e)},transient(n,e){return new _(n,2,e)},callback(n,e){return new _(n,3,e)},cachedCallback(n,e){return new _(n,3,Rt(e))},aliasTo(n,e){return new _(e,5,n)}});function ye(n){if(n==null)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function Ot(n,e,t){if(n instanceof _&&n.strategy===4){const r=n.state;let i=r.length;const s=new Array(i);for(;i--;)s[i]=r[i].resolve(e,t);return s}return[n.resolve(e,t)]}const Et="(anonymous)";function Bt(n){return typeof n=="object"&&n!==null||typeof n=="function"}const Qn=function(){const n=new WeakMap;let e=!1,t="",r=0;return function(i){return e=n.get(i),e===void 0&&(t=i.toString(),r=t.length,e=r>=29&&r<=100&&t.charCodeAt(r-1)===125&&t.charCodeAt(r-2)<=32&&t.charCodeAt(r-3)===93&&t.charCodeAt(r-4)===101&&t.charCodeAt(r-5)===100&&t.charCodeAt(r-6)===111&&t.charCodeAt(r-7)===99&&t.charCodeAt(r-8)===32&&t.charCodeAt(r-9)===101&&t.charCodeAt(r-10)===118&&t.charCodeAt(r-11)===105&&t.charCodeAt(r-12)===116&&t.charCodeAt(r-13)===97&&t.charCodeAt(r-14)===110&&t.charCodeAt(r-15)===88,n.set(i,e)),e}}(),ve={};function Ft(n){switch(typeof n){case"number":return n>=0&&(n|0)===n;case"string":{const e=ve[n];if(e!==void 0)return e;const t=n.length;if(t===0)return ve[n]=!1;let r=0;for(let i=0;i<t;++i)if(r=n.charCodeAt(i),i===0&&r===48&&t>1||r<48||r>57)return ve[n]=!1;return ve[n]=!0}default:return!1}}function At(n){return`${n.toLowerCase()}:presentation`}const we=new Map,It=Object.freeze({define(n,e,t){const r=At(n);we.get(r)===void 0?we.set(r,e):we.set(r,!1),t.register(re.instance(r,e))},forTag(n,e){const t=At(n),r=we.get(t);return r===!1?b.findResponsibleContainer(e).get(t):r||null}});class Yn{constructor(e,t){this.template=e||null,this.styles=t===void 0?null:Array.isArray(t)?T.create(t):t instanceof T?t:T.create([t])}applyTo(e){const t=e.$fastController;t.template===null&&(t.template=this.template),t.styles===null&&(t.styles=this.styles)}}class L extends ge{constructor(){super(...arguments);this._presentation=void 0}get $presentation(){return this._presentation===void 0&&(this._presentation=It.forTag(this.tagName,this)),this._presentation}templateChanged(){this.template!==void 0&&(this.$fastController.template=this.template)}stylesChanged(){this.styles!==void 0&&(this.$fastController.styles=this.styles)}connectedCallback(){this.$presentation!==null&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(e){return(t={})=>new Zn(this===L?class extends L{}:this,e,t)}}g([q],L.prototype,"template",void 0),g([q],L.prototype,"styles",void 0);function ie(n,e,t){return typeof n=="function"?n(e,t):n}class Zn{constructor(e,t,r){this.type=e,this.elementDefinition=t,this.overrideDefinition=r,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(e,t){const r=this.definition,i=this.overrideDefinition,o=`${r.prefix||t.elementPrefix}-${r.baseName}`;t.tryDefineElement({name:o,type:this.type,baseClass:this.elementDefinition.baseClass,callback:a=>{const c=new Yn(ie(r.template,a,r),ie(r.styles,a,r));a.definePresentation(c);let l=ie(r.shadowOptions,a,r);a.shadowRootMode&&(l?i.shadowOptions||(l.mode=a.shadowRootMode):l!==null&&(l={mode:a.shadowRootMode})),a.defineElement({elementOptions:ie(r.elementOptions,a,r),shadowOptions:l,attributes:ie(r.attributes,a,r)})}})}}class Mt{createCSS(){return""}createBehavior(){}}function Ue(n){const e=n.parentElement;if(e)return e;{const t=n.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}function Jn(n,e){let t=e;for(;t!==null;){if(t===n)return!0;t=Ue(t)}return!1}const R=document.createElement("div");function Xn(n){return n instanceof ge}class We{setProperty(e,t){y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){y.queueUpdate(()=>this.target.removeProperty(e))}}class Kn extends We{constructor(e){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(T.create([t]))}}class er extends We{constructor(){super();const e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}}class tr extends We{constructor(){super();this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:e}=this.style;if(e){const t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}}class Nt{constructor(e){this.store=new Map,this.target=null;const t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),P.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(this.target!==null)for(const[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),y.queueUpdate(()=>{this.target!==null&&this.target.setProperty(e,t)})}removeProperty(e){this.store.delete(e),y.queueUpdate(()=>{this.target!==null&&this.target.removeProperty(e)})}handleChange(e,t){const{sheet:r}=this.style;if(r){const i=r.insertRule(":host{}",r.cssRules.length);this.target=r.cssRules[i].style}else this.target=null}}g([q],Nt.prototype,"target",void 0);class nr{constructor(e){this.target=e.style}setProperty(e,t){y.queueUpdate(()=>this.target.setProperty(e,t))}removeProperty(e){y.queueUpdate(()=>this.target.removeProperty(e))}}class S{setProperty(e,t){S.properties[e]=t;for(const r of S.roots.values())U.getOrCreate(S.normalizeRoot(r)).setProperty(e,t)}removeProperty(e){delete S.properties[e];for(const t of S.roots.values())U.getOrCreate(S.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){const{roots:t}=S;if(!t.has(e)){t.add(e);const r=U.getOrCreate(this.normalizeRoot(e));for(const i in S.properties)r.setProperty(i,S.properties[i])}}static unregisterRoot(e){const{roots:t}=S;if(t.has(e)){t.delete(e);const r=U.getOrCreate(S.normalizeRoot(e));for(const i in S.properties)r.removeProperty(i)}}static normalizeRoot(e){return e===R?document:e}}S.roots=new Set,S.properties={};const Ge=new WeakMap,rr=y.supportsAdoptedStyleSheets?Kn:Nt,U=Object.freeze({getOrCreate(n){if(Ge.has(n))return Ge.get(n);let e;return n===R?e=new S:n instanceof Document?e=y.supportsAdoptedStyleSheets?new er:new tr:Xn(n)?e=new rr(n):e=new nr(n),Ge.set(n,e),e}});class $ extends Mt{constructor(e){super();this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,e.cssCustomPropertyName!==null&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=$.uniqueId(),$.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new $({name:typeof e=="string"?e:e.name,cssCustomPropertyName:typeof e=="string"?e:e.cssCustomPropertyName===void 0?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return typeof e.cssCustomProperty=="string"}static isDerivedDesignTokenValue(e){return typeof e=="function"}static getTokenById(e){return $.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){const t=C.getOrCreate(e).get(this);if(t!==void 0)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof $&&(t=this.alias(t)),C.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),C.existsFor(e)&&C.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(R,e),this}subscribe(e,t){const r=this.getOrCreateSubscriberSet(t);t&&!C.existsFor(t)&&C.getOrCreate(t),r.has(e)||r.add(e)}unsubscribe(e,t){const r=this.subscribers.get(t||this);r&&r.has(e)&&r.delete(e)}notify(e){const t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach(r=>r.handleChange(t)),this.subscribers.has(e)&&this.subscribers.get(e).forEach(r=>r.handleChange(t))}alias(e){return t=>e.getValueFor(t)}}$.uniqueId=(()=>{let n=0;return()=>(n++,n.toString(16))})(),$.tokensById=new Map;class ir{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){const{token:t,target:r}=e;this.add(t,r)}add(e,t){U.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(C.getOrCreate(t).get(e)))}remove(e,t){U.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&typeof e.createCSS=="function"?e.createCSS():e}}class sr{constructor(e,t,r){this.source=e,this.token=t,this.node=r,this.dependencies=new Set,this.observer=P.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,ee))}}class or{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),P.getNotifier(this).notify(e.id))}get(e){return P.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const se=new WeakMap,oe=new WeakMap;class C{constructor(e){this.target=e,this.store=new or,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(t,r)=>{const i=$.getTokenById(r);if(i&&(i.notify(this.target),$.isCSSDesignToken(i))){const s=this.parent,o=this.isReflecting(i);if(s){const a=s.get(i),c=t.get(i);a!==c&&!o?this.reflectToCSS(i):a===c&&o&&this.stopReflectToCSS(i)}else o||this.reflectToCSS(i)}}},se.set(e,this),P.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof ge?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return se.get(e)||new C(e)}static existsFor(e){return se.has(e)}static findParent(e){if(R!==e.target){let t=Ue(e.target);for(;t!==null;){if(se.has(t))return se.get(t);t=Ue(t)}return C.getOrCreate(R)}return null}static findClosestAssignedNode(e,t){let r=t;do{if(r.has(e))return r;r=r.parent?r.parent:r.target!==R?C.getOrCreate(R):null}while(r!==null);return null}get parent(){return oe.get(this)||null}has(e){return this.assignedValues.has(e)}get(e){const t=this.store.get(e);if(t!==void 0)return t;const r=this.getRaw(e);if(r!==void 0)return this.hydrate(e,r),this.get(e)}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):(t=C.findClosestAssignedNode(e,this))===null||t===void 0?void 0:t.getRaw(e)}set(e,t){$.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),$.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);const t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){const e=C.findParent(this);e&&e.appendChild(this);for(const t of this.assignedValues.keys())t.notify(this.target)}unbind(){this.parent&&oe.get(this).removeChild(this)}appendChild(e){e.parent&&oe.get(e).removeChild(e);const t=this.children.filter(r=>e.contains(r));oe.set(e,this),this.children.push(e),t.forEach(r=>e.appendChild(r)),P.getNotifier(this.store).subscribe(e);for(const[r,i]of this.store.all())e.hydrate(r,this.bindingObservers.has(r)?this.getRaw(r):i)}removeChild(e){const t=this.children.indexOf(e);return t!==-1&&this.children.splice(t,1),P.getNotifier(this.store).unsubscribe(e),e.parent===this?oe.delete(e):!1}contains(e){return Jn(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),C.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),C.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){const r=$.getTokenById(t);!r||this.hydrate(r,this.getRaw(r))}hydrate(e,t){if(!this.has(e)){const r=this.bindingObservers.get(e);$.isDerivedDesignTokenValue(t)?r?r.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(r&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){const r=new sr(t,e,this);return this.bindingObservers.set(e,r),r}tearDownBindingObserver(e){return this.bindingObservers.has(e)?(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0):!1}}C.cssCustomPropertyReflector=new ir,g([q],C.prototype,"children",void 0);function ar(n){return $.from(n)}const Vt=Object.freeze({create:ar,notifyConnection(n){return!n.isConnected||!C.existsFor(n)?!1:(C.getOrCreate(n).bind(),!0)},notifyDisconnection(n){return n.isConnected||!C.existsFor(n)?!1:(C.getOrCreate(n).unbind(),!0)},registerRoot(n=R){S.registerRoot(n)},unregisterRoot(n=R){S.unregisterRoot(n)}}),Qe=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),Ye=new Map,ke=new Map;let W=null;const ae=b.createInterface(n=>n.cachedCallback(e=>(W===null&&(W=new jt(null,e)),W))),Lt=Object.freeze({tagFor(n){return ke.get(n)},responsibleFor(n){const e=n.$$designSystem$$;return e||b.findResponsibleContainer(n).get(ae)},getOrCreate(n){if(!n)return W===null&&(W=b.getOrCreateDOMContainer().get(ae)),W;const e=n.$$designSystem$$;if(e)return e;const t=b.getOrCreateDOMContainer(n);if(t.has(ae,!1))return t.get(ae);{const r=new jt(n,t);return t.register(re.instance(ae,r)),r}}});function lr(n,e,t){return typeof n=="string"?{name:n,type:e,callback:t}:n}class jt{constructor(e,t){this.owner=e,this.container=t,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>Qe.definitionCallbackOnly,e!==null&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){const t=this.container,r=[],i=this.disambiguate,s=this.shadowRootMode,o={elementPrefix:this.prefix,tryDefineElement(a,c,l){const d=lr(a,c,l),{name:u,callback:h,baseClass:m}=d;let{type:w}=d,k=u,V=Ye.get(k),De=!0;for(;V;){const lt=i(k,w,V);switch(lt){case Qe.ignoreDuplicate:return;case Qe.definitionCallbackOnly:De=!1,V=void 0;break;default:k=lt,V=Ye.get(k);break}}De&&((ke.has(w)||w===L)&&(w=class extends w{}),Ye.set(k,w),ke.set(w,k),m&&ke.set(m,k)),r.push(new cr(t,k,w,s,h,De))}};this.designTokensInitialized||(this.designTokensInitialized=!0,this.designTokenRoot!==null&&Vt.registerRoot(this.designTokenRoot)),t.registerWithContext(o,...e);for(const a of r)a.callback(a),a.willDefine&&a.definition!==null&&a.definition.define();return this}}class cr{constructor(e,t,r,i,s,o){this.container=e,this.name=t,this.type=r,this.shadowRootMode=i,this.callback=s,this.willDefine=o,this.definition=null}definePresentation(e){It.define(this.name,e,this.container)}defineElement(e){this.definition=new fe(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return Lt.tagFor(e)}}function ur(n){return Lt.getOrCreate(n).withPrefix("vscode")}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Ze=function(n,e){return Ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},Ze(n,e)};function xs(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ze(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ht=function(){return Ht=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Ht.apply(this,arguments)};function Ps(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function dr(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function Ss(n,e){return function(t,r){e(t,r,n)}}function $s(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function Ts(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{l(r.next(d))}catch(u){o(u)}}function c(d){try{l(r.throw(d))}catch(u){o(u)}}function l(d){d.done?s(d.value):i(d.value).then(a,c)}l((r=r.apply(n,e||[])).next())})}function _s(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(d){l=[6,d],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var zt=Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function Ds(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&zt(e,n,t)}function qt(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hr(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function Rs(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(hr(arguments[e]));return n}function Os(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function Es(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function Ce(n){return this instanceof Ce?(this.v=n,this):new Ce(n)}function Bs(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(m){return new Promise(function(w,k){s.push([h,m,w,k])>1||a(h,m)})})}function a(h,m){try{c(r[h](m))}catch(w){u(s[0][3],w)}}function c(h){h.value instanceof Ce?Promise.resolve(h.value.v).then(l,d):u(s[0][2],h)}function l(h){a("next",h)}function d(h){a("throw",h)}function u(h,m){h(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Fs(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:Ce(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function As(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof qt=="function"?qt(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,c){o=n[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Is(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var fr=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e};function Ms(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&zt(e,n,t);return fr(e,n),e}function Ns(n){return n&&n.__esModule?n:{default:n}}function Vs(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function Ls(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t}class x{}g([p({attribute:"aria-atomic",mode:"fromView"})],x.prototype,"ariaAtomic",void 0),g([p({attribute:"aria-busy",mode:"fromView"})],x.prototype,"ariaBusy",void 0),g([p({attribute:"aria-controls",mode:"fromView"})],x.prototype,"ariaControls",void 0),g([p({attribute:"aria-current",mode:"fromView"})],x.prototype,"ariaCurrent",void 0),g([p({attribute:"aria-describedby",mode:"fromView"})],x.prototype,"ariaDescribedby",void 0),g([p({attribute:"aria-details",mode:"fromView"})],x.prototype,"ariaDetails",void 0),g([p({attribute:"aria-disabled",mode:"fromView"})],x.prototype,"ariaDisabled",void 0),g([p({attribute:"aria-errormessage",mode:"fromView"})],x.prototype,"ariaErrormessage",void 0),g([p({attribute:"aria-flowto",mode:"fromView"})],x.prototype,"ariaFlowto",void 0),g([p({attribute:"aria-haspopup",mode:"fromView"})],x.prototype,"ariaHaspopup",void 0),g([p({attribute:"aria-hidden",mode:"fromView"})],x.prototype,"ariaHidden",void 0),g([p({attribute:"aria-invalid",mode:"fromView"})],x.prototype,"ariaInvalid",void 0),g([p({attribute:"aria-keyshortcuts",mode:"fromView"})],x.prototype,"ariaKeyshortcuts",void 0),g([p({attribute:"aria-label",mode:"fromView"})],x.prototype,"ariaLabel",void 0),g([p({attribute:"aria-labelledby",mode:"fromView"})],x.prototype,"ariaLabelledby",void 0),g([p({attribute:"aria-live",mode:"fromView"})],x.prototype,"ariaLive",void 0),g([p({attribute:"aria-owns",mode:"fromView"})],x.prototype,"ariaOwns",void 0),g([p({attribute:"aria-relevant",mode:"fromView"})],x.prototype,"ariaRelevant",void 0),g([p({attribute:"aria-roledescription",mode:"fromView"})],x.prototype,"ariaRoledescription",void 0);class Je{constructor(){this.targetIndex=0}}class Ut extends Je{constructor(){super(...arguments);this.createPlaceholder=y.createInterpolationPlaceholder}}class Wt extends Je{constructor(e,t,r){super();this.name=e,this.behavior=t,this.options=r}createPlaceholder(e){return y.createCustomAttributePlaceholder(this.name,e)}createBehavior(e){return new this.behavior(e,this.options)}}function pr(n,e){this.source=n,this.context=e,this.bindingObserver===null&&(this.bindingObserver=P.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(n,e))}function gr(n,e){this.source=n,this.context=e,this.target.addEventListener(this.targetName,this)}function br(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function mr(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const n=this.target.$fastView;n!==void 0&&n.isComposed&&(n.unbind(),n.needsBindOnly=!0)}function yr(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function vr(n){y.setAttribute(this.target,this.targetName,n)}function wr(n){y.setBooleanAttribute(this.target,this.targetName,n)}function kr(n){if(n==null&&(n=""),n.create){this.target.textContent="";let e=this.target.$fastView;e===void 0?e=n.create():this.target.$fastTemplate!==n&&(e.isComposed&&(e.remove(),e.unbind()),e=n.create()),e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.source,this.context)):(e.isComposed=!0,e.bind(this.source,this.context),e.insertBefore(this.target),this.target.$fastView=e,this.target.$fastTemplate=n)}else{const e=this.target.$fastView;e!==void 0&&e.isComposed&&(e.isComposed=!1,e.remove(),e.needsBindOnly?e.needsBindOnly=!1:e.unbind()),this.target.textContent=n}}function Cr(n){this.target[this.targetName]=n}function xr(n){const e=this.classVersions||Object.create(null),t=this.target;let r=this.version||0;if(n!=null&&n.length){const i=n.split(/\s+/);for(let s=0,o=i.length;s<o;++s){const a=i[s];a!==""&&(e[a]=r,t.classList.add(a))}}if(this.classVersions=e,this.version=r+1,r!==0){r-=1;for(const i in e)e[i]===r&&t.classList.remove(i)}}class Xe extends Ut{constructor(e){super();this.binding=e,this.bind=pr,this.unbind=br,this.updateTarget=vr,this.isBindingVolatile=P.isVolatileBinding(this.binding)}get targetName(){return this.originalTargetName}set targetName(e){if(this.originalTargetName=e,e!==void 0)switch(e[0]){case":":if(this.cleanedTargetName=e.substr(1),this.updateTarget=Cr,this.cleanedTargetName==="innerHTML"){const t=this.binding;this.binding=(r,i)=>y.createHTML(t(r,i))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=wr;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=gr,this.unbind=yr;break;default:this.cleanedTargetName=e,e==="class"&&(this.updateTarget=xr);break}}targetAtContent(){this.updateTarget=kr,this.unbind=mr}createBehavior(e){return new Pr(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class Pr{constructor(e,t,r,i,s,o,a){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=t,this.isBindingVolatile=r,this.bind=i,this.unbind=s,this.updateTarget=o,this.targetName=a}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){K.setEvent(e);const t=this.binding(this.source,this.context);K.setEvent(null),t!==!0&&e.preventDefault()}}let Ke=null;class et{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){Ke=this}static borrow(e){const t=Ke||new et;return t.directives=e,t.reset(),Ke=null,t}}function Sr(n){if(n.length===1)return n[0];let e;const t=n.length,r=n.map(o=>typeof o=="string"?()=>o:(e=o.targetName||e,o.binding)),i=(o,a)=>{let c="";for(let l=0;l<t;++l)c+=r[l](o,a);return c},s=new Xe(i);return s.targetName=e,s}const $r=Be.length;function Gt(n,e){const t=e.split(ht);if(t.length===1)return null;const r=[];for(let i=0,s=t.length;i<s;++i){const o=t[i],a=o.indexOf(Be);let c;if(a===-1)c=o;else{const l=parseInt(o.substring(0,a));r.push(n.directives[l]),c=o.substring(a+$r)}c!==""&&r.push(c)}return r}function Qt(n,e,t=!1){const r=e.attributes;for(let i=0,s=r.length;i<s;++i){const o=r[i],a=o.value,c=Gt(n,a);let l=null;c===null?t&&(l=new Xe(()=>a),l.targetName=o.name):l=Sr(c),l!==null&&(e.removeAttributeNode(o),i--,s--,n.addFactory(l))}}function Tr(n,e,t){const r=Gt(n,e.textContent);if(r!==null){let i=e;for(let s=0,o=r.length;s<o;++s){const a=r[s],c=s===0?e:i.parentNode.insertBefore(document.createTextNode(""),i.nextSibling);typeof a=="string"?c.textContent=a:(c.textContent=" ",n.captureContentBinding(a)),i=c,n.targetIndex++,c!==e&&t.nextNode()}n.targetIndex--}}function _r(n,e){const t=n.content;document.adoptNode(t);const r=et.borrow(e);Qt(r,n,!0);const i=r.behaviorFactories;r.reset();const s=y.createTemplateWalker(t);let o;for(;o=s.nextNode();)switch(r.targetIndex++,o.nodeType){case 1:Qt(r,o);break;case 3:Tr(r,o,s);break;case 8:y.isMarker(o)&&r.addFactory(e[y.extractDirectiveIndexFromMarker(o)])}let a=0;(y.isMarker(t.firstChild)||t.childNodes.length===1&&e.length)&&(t.insertBefore(document.createComment(""),t.firstChild),a=-1);const c=r.behaviorFactories;return r.release(),{fragment:t,viewBehaviorFactories:c,hostBehaviorFactories:i,targetOffset:a}}const tt=document.createRange();class Dr{constructor(e,t){this.fragment=e,this.behaviors=t,this.source=null,this.context=null,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=e.parentNode,r=this.lastChild;let i=this.firstChild,s;for(;i!==r;)s=i.nextSibling,t.insertBefore(i,e),i=s;t.insertBefore(r,e)}}remove(){const e=this.fragment,t=this.lastChild;let r=this.firstChild,i;for(;r!==t;)i=r.nextSibling,e.appendChild(r),r=i;e.appendChild(t)}dispose(){const e=this.firstChild.parentNode,t=this.lastChild;let r=this.firstChild,i;for(;r!==t;)i=r.nextSibling,e.removeChild(r),r=i;e.removeChild(t);const s=this.behaviors,o=this.source;for(let a=0,c=s.length;a<c;++a)s[a].unbind(o)}bind(e,t){const r=this.behaviors;if(this.source!==e)if(this.source!==null){const i=this.source;this.source=e,this.context=t;for(let s=0,o=r.length;s<o;++s){const a=r[s];a.unbind(i),a.bind(e,t)}}else{this.source=e,this.context=t;for(let i=0,s=r.length;i<s;++i)r[i].bind(e,t)}}unbind(){if(this.source===null)return;const e=this.behaviors,t=this.source;for(let r=0,i=e.length;r<i;++r)e[r].unbind(t);this.source=null}static disposeContiguousBatch(e){if(e.length!==0){tt.setStartBefore(e[0].firstChild),tt.setEndAfter(e[e.length-1].lastChild),tt.deleteContents();for(let t=0,r=e.length;t<r;++t){const i=e[t],s=i.behaviors,o=i.source;for(let a=0,c=s.length;a<c;++a)s[a].unbind(o)}}}}class Yt{constructor(e,t){this.behaviorCount=0,this.hasHostBehaviors=!1,this.fragment=null,this.targetOffset=0,this.viewBehaviorFactories=null,this.hostBehaviorFactories=null,this.html=e,this.directives=t}create(e){if(this.fragment===null){let l;const d=this.html;if(typeof d=="string"){l=document.createElement("template"),l.innerHTML=y.createHTML(d);const h=l.content.firstElementChild;h!==null&&h.tagName==="TEMPLATE"&&(l=h)}else l=d;const u=_r(l,this.directives);this.fragment=u.fragment,this.viewBehaviorFactories=u.viewBehaviorFactories,this.hostBehaviorFactories=u.hostBehaviorFactories,this.targetOffset=u.targetOffset,this.behaviorCount=this.viewBehaviorFactories.length+this.hostBehaviorFactories.length,this.hasHostBehaviors=this.hostBehaviorFactories.length>0}const t=this.fragment.cloneNode(!0),r=this.viewBehaviorFactories,i=new Array(this.behaviorCount),s=y.createTemplateWalker(t);let o=0,a=this.targetOffset,c=s.nextNode();for(let l=r.length;o<l;++o){const d=r[o],u=d.targetIndex;for(;c!==null;)if(a===u){i[o]=d.createBehavior(c);break}else c=s.nextNode(),a++}if(this.hasHostBehaviors){const l=this.hostBehaviorFactories;for(let d=0,u=l.length;d<u;++d,++o)i[o]=l[d].createBehavior(e)}return new Dr(t,i)}render(e,t,r){typeof t=="string"&&(t=document.getElementById(t)),r===void 0&&(r=t);const i=this.create(r);return i.bind(e,ee),i.appendTo(t),i}}const Rr=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function le(n,...e){const t=[];let r="";for(let i=0,s=n.length-1;i<s;++i){const o=n[i];let a=e[i];if(r+=o,a instanceof Yt){const c=a;a=()=>c}if(typeof a=="function"&&(a=new Xe(a)),a instanceof Ut){const c=Rr.exec(o);c!==null&&(a.targetName=c[2])}a instanceof Je?(r+=a.createPlaceholder(t.length),t.push(a)):r+=a}return r+=n[n.length-1],new Yt(r,t)}class Or{constructor(e,t){this.target=e,this.propertyName=t}bind(e){e[this.propertyName]=this.target}unbind(){}}function O(n){return new Wt("fast-ref",Or,n)}class Er{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}}const Br=(n,e)=>le`
|
|
<span
|
|
part="end"
|
|
${O("endContainer")}
|
|
class=${t=>e.end?"end":void 0}
|
|
>
|
|
<slot name="end" ${O("end")} @slotchange="${t=>t.handleEndContentChange()}">
|
|
${e.end||""}
|
|
</slot>
|
|
</span>
|
|
`,Fr=(n,e)=>le`
|
|
<span
|
|
part="start"
|
|
${O("startContainer")}
|
|
class="${t=>e.start?"start":void 0}"
|
|
>
|
|
<slot
|
|
name="start"
|
|
${O("start")}
|
|
@slotchange="${t=>t.handleStartContentChange()}"
|
|
>
|
|
${e.start||""}
|
|
</slot>
|
|
</span>
|
|
`,js=le`
|
|
<span part="end" ${O("endContainer")}>
|
|
<slot
|
|
name="end"
|
|
${O("end")}
|
|
@slotchange="${n=>n.handleEndContentChange()}"
|
|
></slot>
|
|
</span>
|
|
`,Hs=le`
|
|
<span part="start" ${O("startContainer")}>
|
|
<slot
|
|
name="start"
|
|
${O("start")}
|
|
@slotchange="${n=>n.handleStartContentChange()}"
|
|
></slot>
|
|
</span>
|
|
`;function Zt(n,...e){e.forEach(t=>{if(Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))}),t.attributes){const r=n.attributes||[];n.attributes=r.concat(t.attributes)}})}var Jt;(function(n){n[n.alt=18]="alt",n[n.arrowDown=40]="arrowDown",n[n.arrowLeft=37]="arrowLeft",n[n.arrowRight=39]="arrowRight",n[n.arrowUp=38]="arrowUp",n[n.back=8]="back",n[n.backSlash=220]="backSlash",n[n.break=19]="break",n[n.capsLock=20]="capsLock",n[n.closeBracket=221]="closeBracket",n[n.colon=186]="colon",n[n.colon2=59]="colon2",n[n.comma=188]="comma",n[n.ctrl=17]="ctrl",n[n.delete=46]="delete",n[n.end=35]="end",n[n.enter=13]="enter",n[n.equals=187]="equals",n[n.equals2=61]="equals2",n[n.equals3=107]="equals3",n[n.escape=27]="escape",n[n.forwardSlash=191]="forwardSlash",n[n.function1=112]="function1",n[n.function10=121]="function10",n[n.function11=122]="function11",n[n.function12=123]="function12",n[n.function2=113]="function2",n[n.function3=114]="function3",n[n.function4=115]="function4",n[n.function5=116]="function5",n[n.function6=117]="function6",n[n.function7=118]="function7",n[n.function8=119]="function8",n[n.function9=120]="function9",n[n.home=36]="home",n[n.insert=45]="insert",n[n.menu=93]="menu",n[n.minus=189]="minus",n[n.minus2=109]="minus2",n[n.numLock=144]="numLock",n[n.numPad0=96]="numPad0",n[n.numPad1=97]="numPad1",n[n.numPad2=98]="numPad2",n[n.numPad3=99]="numPad3",n[n.numPad4=100]="numPad4",n[n.numPad5=101]="numPad5",n[n.numPad6=102]="numPad6",n[n.numPad7=103]="numPad7",n[n.numPad8=104]="numPad8",n[n.numPad9=105]="numPad9",n[n.numPadDivide=111]="numPadDivide",n[n.numPadDot=110]="numPadDot",n[n.numPadMinus=109]="numPadMinus",n[n.numPadMultiply=106]="numPadMultiply",n[n.numPadPlus=107]="numPadPlus",n[n.openBracket=219]="openBracket",n[n.pageDown=34]="pageDown",n[n.pageUp=33]="pageUp",n[n.period=190]="period",n[n.print=44]="print",n[n.quote=222]="quote",n[n.scrollLock=145]="scrollLock",n[n.shift=16]="shift",n[n.space=32]="space",n[n.tab=9]="tab",n[n.tilde=192]="tilde",n[n.windowsLeft=91]="windowsLeft",n[n.windowsOpera=219]="windowsOpera",n[n.windowsRight=92]="windowsRight"})(Jt||(Jt={}));const zs=18,qs=40,Us=37,Ws=39,Gs=38,Qs=8,Ys=220,Zs=19,Js=20,Xs=221,Ks=186,eo=59,to=188,no=17,ro=46,io=35,so=13,oo=187,ao=61,lo=107,co=27,uo=191,ho=112,fo=121,po=122,go=123,bo=113,mo=114,yo=115,vo=116,wo=117,ko=118,Co=119,xo=120,Po=36,So=45,$o=93,To=189,_o=109,Do=144,Ro=96,Oo=97,Eo=98,Bo=99,Fo=100,Ao=101,Io=102,Mo=103,No=104,Vo=105,Lo=111,jo=110,Ho=109,zo=106,qo=107,Uo=219,Wo=34,Go=33,Qo=190,Yo=44,Zo=222,Jo=145,Xo=16,Ko=32,ea=9,ta=192,na=91,ra=219,ia=92,Ar="ArrowDown",Ir="ArrowLeft",Mr="ArrowRight",Nr="ArrowUp",Vr="Enter",sa="Escape",oa="Home",aa="End",la="F2",ca="PageDown",ua="PageUp",da=" ",ha="Tab",fa="Backspace",pa="Delete",ga={ArrowDown:Ar,ArrowLeft:Ir,ArrowRight:Mr,ArrowUp:Nr},Xt="form-associated-proxy",Kt="ElementInternals",en=Kt in window&&"setFormValue"in window[Kt].prototype,tn=new WeakMap;function nn(n){const e=class extends n{constructor(...t){super(...t);this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return en}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const t=this.proxy.labels,r=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=t?r.concat(Array.from(t)):r;return Object.freeze(i)}else return J}valueChanged(t,r){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(t,r){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(t,r){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),y.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(t,r){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(t,r){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),y.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!en)return null;let t=tn.get(this);return t||(t=this.attachInternals(),tn.set(this,t)),t}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){this.proxyEventsToBlock.forEach(t=>this.proxy.removeEventListener(t,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(t,r,i){this.elementInternals?this.elementInternals.setValidity(t,r,i):typeof r=="string"&&this.proxy.setCustomValidity(r)}formDisabledCallback(t){this.disabled=t}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var t;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(r=>this.proxy.addEventListener(r,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",Xt),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",Xt)),(t=this.shadowRoot)===null||t===void 0||t.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var t;this.removeChild(this.proxy),(t=this.shadowRoot)===null||t===void 0||t.removeChild(this.proxySlot)}validate(){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage)}setFormValue(t,r){this.elementInternals&&this.elementInternals.setFormValue(t,r||t)}_keypressHandler(t){switch(t.key){case Vr:if(this.form instanceof HTMLFormElement){const r=this.form.querySelector("[type=submit]");r?.click()}break}}stopPropagation(t){t.stopPropagation()}};return p({mode:"boolean"})(e.prototype,"disabled"),p({mode:"fromView",attribute:"value"})(e.prototype,"initialValue"),p({attribute:"current-value"})(e.prototype,"currentValue"),p(e.prototype,"name"),p({mode:"boolean"})(e.prototype,"required"),q(e.prototype,"value"),e}function ba(n){class e extends nn(n){}class t extends e{constructor(...i){super(i);this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(i,s){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),i!==void 0&&this.$emit("change"),this.validate()}currentCheckedChanged(i,s){this.checked=this.currentChecked}updateForm(){const i=this.checked?this.value:null;this.setFormValue(i,i)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return attr({attribute:"checked",mode:"boolean"})(t.prototype,"checkedAttribute"),attr({attribute:"current-checked",converter:booleanConverter})(t.prototype,"currentChecked"),observable(t.prototype,"defaultChecked"),observable(t.prototype,"checked"),t}class Lr extends L{}class jr extends nn(Lr){constructor(){super(...arguments);this.proxy=document.createElement("input")}}class D extends jr{constructor(){super(...arguments);this.handleClick=e=>{var t;this.disabled&&((t=this.defaultSlottedContent)===null||t===void 0?void 0:t.length)<=1&&e.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const e=this.proxy.isConnected;e||this.attachProxy(),typeof this.form.requestSubmit=="function"?this.form.requestSubmit(this.proxy):this.proxy.click(),e||this.detachProxy()},this.handleFormReset=()=>{var e;(e=this.form)===null||e===void 0||e.reset()},this.handleUnsupportedDelegatesFocus=()=>{var e;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&((e=this.$fastController.definition.shadowOptions)===null||e===void 0?void 0:e.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,t){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),t==="submit"&&this.addEventListener("click",this.handleSubmission),e==="submit"&&this.removeEventListener("click",this.handleSubmission),t==="reset"&&this.addEventListener("click",this.handleFormReset),e==="reset"&&this.removeEventListener("click",this.handleFormReset)}connectedCallback(){var e;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const t=Array.from((e=this.control)===null||e===void 0?void 0:e.children);t&&t.forEach(r=>{r.addEventListener("click",this.handleClick)})}disconnectedCallback(){var e;super.disconnectedCallback();const t=Array.from((e=this.control)===null||e===void 0?void 0:e.children);t&&t.forEach(r=>{r.removeEventListener("click",this.handleClick)})}}g([p({mode:"boolean"})],D.prototype,"autofocus",void 0),g([p({attribute:"form"})],D.prototype,"formId",void 0),g([p],D.prototype,"formaction",void 0),g([p],D.prototype,"formenctype",void 0),g([p],D.prototype,"formmethod",void 0),g([p({mode:"boolean"})],D.prototype,"formnovalidate",void 0),g([p],D.prototype,"formtarget",void 0),g([p],D.prototype,"type",void 0),g([q],D.prototype,"defaultSlottedContent",void 0);class xe{}g([p({attribute:"aria-expanded",mode:"fromView"})],xe.prototype,"ariaExpanded",void 0),g([p({attribute:"aria-pressed",mode:"fromView"})],xe.prototype,"ariaPressed",void 0),Zt(xe,x),Zt(D,Er,xe);function ma(n){return n?function(e,t,r){return e.nodeType===1&&e.matches(n)}:function(e,t,r){return e.nodeType===1}}class Hr{constructor(e,t){this.target=e,this.options=t,this.source=null}bind(e){const t=this.options.property;this.shouldUpdate=P.getAccessors(e).some(r=>r.name===t),this.source=e,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(J),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let e=this.getNodes();return this.options.filter!==void 0&&(e=e.filter(this.options.filter)),e}updateTarget(e){this.source[this.options.property]=e}}class zr extends Hr{constructor(e,t){super(e,t)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}function qr(n){return typeof n=="string"&&(n={property:n}),new Wt("fast-slotted",zr,n)}const Ur=(n,e)=>le`
|
|
<button
|
|
class="control"
|
|
part="control"
|
|
?autofocus="${t=>t.autofocus}"
|
|
?disabled="${t=>t.disabled}"
|
|
form="${t=>t.formId}"
|
|
formaction="${t=>t.formaction}"
|
|
formenctype="${t=>t.formenctype}"
|
|
formmethod="${t=>t.formmethod}"
|
|
formnovalidate="${t=>t.formnovalidate}"
|
|
formtarget="${t=>t.formtarget}"
|
|
name="${t=>t.name}"
|
|
type="${t=>t.type}"
|
|
value="${t=>t.value}"
|
|
aria-atomic="${t=>t.ariaAtomic}"
|
|
aria-busy="${t=>t.ariaBusy}"
|
|
aria-controls="${t=>t.ariaControls}"
|
|
aria-current="${t=>t.ariaCurrent}"
|
|
aria-describedby="${t=>t.ariaDescribedby}"
|
|
aria-details="${t=>t.ariaDetails}"
|
|
aria-disabled="${t=>t.ariaDisabled}"
|
|
aria-errormessage="${t=>t.ariaErrormessage}"
|
|
aria-expanded="${t=>t.ariaExpanded}"
|
|
aria-flowto="${t=>t.ariaFlowto}"
|
|
aria-haspopup="${t=>t.ariaHaspopup}"
|
|
aria-hidden="${t=>t.ariaHidden}"
|
|
aria-invalid="${t=>t.ariaInvalid}"
|
|
aria-keyshortcuts="${t=>t.ariaKeyshortcuts}"
|
|
aria-label="${t=>t.ariaLabel}"
|
|
aria-labelledby="${t=>t.ariaLabelledby}"
|
|
aria-live="${t=>t.ariaLive}"
|
|
aria-owns="${t=>t.ariaOwns}"
|
|
aria-pressed="${t=>t.ariaPressed}"
|
|
aria-relevant="${t=>t.ariaRelevant}"
|
|
aria-roledescription="${t=>t.ariaRoledescription}"
|
|
${O("control")}
|
|
>
|
|
${Fr(n,e)}
|
|
<span class="content" part="content">
|
|
<slot ${qr("defaultSlottedContent")}></slot>
|
|
</span>
|
|
${Br(n,e)}
|
|
</button>
|
|
`;function rn(n,e){const t=[];let r="";const i=[];for(let s=0,o=n.length-1;s<o;++s){r+=n[s];let a=e[s];if(a instanceof Mt){const c=a.createBehavior();a=a.createCSS(),c&&i.push(c)}a instanceof T||a instanceof CSSStyleSheet?(r.trim()!==""&&(t.push(r),r=""),t.push(a)):r+=a}return r+=n[n.length-1],r.trim()!==""&&t.push(r),{styles:t,behaviors:i}}function ce(n,...e){const{styles:t,behaviors:r}=rn(n,e),i=T.create(t);return r.length&&i.withBehaviors(...r),i}class Wr extends null{constructor(e,t){super();this.behaviors=t,this.css="";const r=e.reduce((i,s)=>(typeof s=="string"?this.css+=s:i.push(s),i),[]);r.length&&(this.styles=ElementStyles.create(r))}createBehavior(){return this}createCSS(){return this.css}bind(e){this.styles&&e.$fastController.addStyles(this.styles),this.behaviors.length&&e.$fastController.addBehaviors(this.behaviors)}unbind(e){this.styles&&e.$fastController.removeStyles(this.styles),this.behaviors.length&&e.$fastController.removeBehaviors(this.behaviors)}}function ya(n,...e){const{styles:t,behaviors:r}=rn(n,e);return new Wr(t,r)}const Gr=":host([hidden]){display:none}";function Qr(n){return`${Gr}:host{display:${n}}`}function Yr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Zr(...n){return n.every(e=>e instanceof HTMLElement)}function va(n,e){return!n||!e||!Zr(n)?void 0:Array.from(n.querySelectorAll(e)).filter(r=>r.offsetParent!==null)}function wa(n){return n===null?null:n.which||n.keyCode||n.charCode}function Jr(){const n=document.querySelector('meta[property="csp-nonce"]');return n?n.getAttribute("content"):null}let F;function Xr(){if(typeof F=="boolean")return F;if(!Yr())return F=!1,F;const n=document.createElement("style"),e=Jr();e!==null&&n.setAttribute("nonce",e),document.head.appendChild(n);try{n.sheet.insertRule("foo:focus-visible {color:inherit}",0),F=!0}catch{F=!1}finally{document.head.removeChild(n)}return F}let G;function ka(){if(typeof G=="boolean")return G;try{G=CSS.supports("display","grid")}catch{G=!1}return G}function Ca(){return canUseDOM()&&(window.matchMedia("(forced-colors: none)").matches||window.matchMedia("(forced-colors: active)").matches)}function xa(){G=void 0,F=void 0}const Pa=null,Pe=Xr()?"focus-visible":"focus",Kr="not-allowed";function ei(n){window.addEventListener("load",()=>{new MutationObserver(()=>{sn(n)}).observe(document.body,{attributes:!0,attributeFilter:["class"]}),sn(n)})}function sn(n){const e=getComputedStyle(document.body),t=document.querySelector("body");if(t){const r=t.getAttribute("data-vscode-theme-kind");for(const[i,s]of n){let o=e.getPropertyValue(i).toString();r==="vscode-high-contrast"?(o.length===0&&s.name.includes("background")&&(o="transparent"),s.name==="button-icon-hover-background"&&(o="transparent")):s.name==="contrast-active-border"&&(o="transparent"),s.setValueFor(t,o)}}}const on=new Map;let an=!1;function f(n,e){const t=Vt.create(n);if(e){if(e.includes("--fake-vscode-token")){const r="id"+Math.random().toString(16).slice(2);e=`${e}-${r}`}on.set(e,t)}return an||(ei(on),an=!0),t}const Sa=f("background","--vscode-editor-background").withDefault("#1e1e1e"),E=f("border-width").withDefault(1),ti=f("contrast-active-border","--vscode-contrastActiveBorder").withDefault("#f38518"),$a=f("contrast-border","--vscode-contrastBorder").withDefault("#6fc3df"),ni=f("corner-radius").withDefault(0),ln=f("design-unit").withDefault(4),ri=f("disabled-opacity").withDefault(.4),Se=f("focus-border","--vscode-focusBorder").withDefault("#007fd4"),ii=f("font-family","--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"),Ta=f("font-weight","--vscode-font-weight").withDefault("400"),si=f("foreground","--vscode-foreground").withDefault("#cccccc"),_a=f("input-height").withDefault("26"),Da=f("input-min-width").withDefault("100px"),oi=f("type-ramp-base-font-size","--vscode-font-size").withDefault("13px"),ai=f("type-ramp-base-line-height").withDefault("normal"),Ra=f("type-ramp-minus1-font-size").withDefault("11px"),Oa=f("type-ramp-minus1-line-height").withDefault("16px"),Ea=f("type-ramp-minus2-font-size").withDefault("9px"),Ba=f("type-ramp-minus2-line-height").withDefault("16px"),Fa=f("type-ramp-plus1-font-size").withDefault("16px"),Aa=f("type-ramp-plus1-line-height").withDefault("24px"),Ia=f("scrollbarWidth").withDefault("10px"),Ma=f("scrollbarHeight").withDefault("10px"),Na=f("scrollbar-slider-background","--vscode-scrollbarSlider-background").withDefault("#79797966"),Va=f("scrollbar-slider-hover-background","--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"),La=f("scrollbar-slider-active-background","--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"),ja=f("badge-background","--vscode-badge-background").withDefault("#4d4d4d"),Ha=f("badge-foreground","--vscode-badge-foreground").withDefault("#ffffff"),li=f("button-border","--vscode-button-border").withDefault("transparent"),cn=f("button-icon-background").withDefault("transparent"),ci=f("button-icon-corner-radius").withDefault("5px"),ui=f("button-icon-outline-offset").withDefault(0),un=f("button-icon-hover-background","--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"),di=f("button-icon-padding").withDefault("3px"),Q=f("button-primary-background","--vscode-button-background").withDefault("#0e639c"),dn=f("button-primary-foreground","--vscode-button-foreground").withDefault("#ffffff"),hn=f("button-primary-hover-background","--vscode-button-hoverBackground").withDefault("#1177bb"),nt=f("button-secondary-background","--vscode-button-secondaryBackground").withDefault("#3a3d41"),hi=f("button-secondary-foreground","--vscode-button-secondaryForeground").withDefault("#ffffff"),fi=f("button-secondary-hover-background","--vscode-button-secondaryHoverBackground").withDefault("#45494e"),pi=f("button-padding-horizontal").withDefault("11px"),gi=f("button-padding-vertical").withDefault("6px"),za=f("checkbox-background","--vscode-checkbox-background").withDefault("#3c3c3c"),qa=f("checkbox-border","--vscode-checkbox-border").withDefault("#3c3c3c"),Ua=f("checkbox-corner-radius").withDefault(3),Wa=f("checkbox-foreground","--vscode-checkbox-foreground").withDefault("#f0f0f0"),Ga=f("list-active-selection-background","--vscode-list-activeSelectionBackground").withDefault("#094771"),Qa=f("list-active-selection-foreground","--vscode-list-activeSelectionForeground").withDefault("#ffffff"),Ya=f("list-hover-background","--vscode-list-hoverBackground").withDefault("#2a2d2e"),Za=f("divider-background","--vscode-settings-dropdownListBorder").withDefault("#454545"),Ja=f("dropdown-background","--vscode-dropdown-background").withDefault("#3c3c3c"),Xa=f("dropdown-border","--vscode-dropdown-border").withDefault("#3c3c3c"),Ka=f("dropdown-foreground","--vscode-dropdown-foreground").withDefault("#f0f0f0"),el=f("dropdown-list-max-height").withDefault("200px"),tl=f("input-background","--vscode-input-background").withDefault("#3c3c3c"),nl=f("input-foreground","--vscode-input-foreground").withDefault("#cccccc"),rl=f("input-placeholder-foreground","--vscode-input-placeholderForeground").withDefault("#cccccc"),il=f("link-active-foreground","--vscode-textLink-activeForeground").withDefault("#3794ff"),sl=f("link-foreground","--vscode-textLink-foreground").withDefault("#3794ff"),ol=f("progress-background","--vscode-progressBar-background").withDefault("#0e70c0"),al=f("panel-tab-active-border","--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"),ll=f("panel-tab-active-foreground","--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"),cl=f("panel-tab-foreground","--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"),ul=f("panel-view-background","--vscode-panel-background").withDefault("#1e1e1e"),dl=f("panel-view-border","--vscode-panel-border").withDefault("#80808059"),hl=f("tag-corner-radius").withDefault("2px"),bi=ce`
|
|
${Qr("inline-flex")} :host {
|
|
outline: none;
|
|
font-family: ${ii};
|
|
font-size: ${oi};
|
|
line-height: ${ai};
|
|
color: ${dn};
|
|
background: ${Q};
|
|
border-radius: calc(${ni} * 1px);
|
|
fill: currentColor;
|
|
cursor: pointer;
|
|
}
|
|
.control {
|
|
background: transparent;
|
|
height: inherit;
|
|
flex-grow: 1;
|
|
box-sizing: border-box;
|
|
display: inline-flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: ${gi} ${pi};
|
|
white-space: wrap;
|
|
outline: none;
|
|
text-decoration: none;
|
|
border: calc(${E} * 1px) solid ${li};
|
|
color: inherit;
|
|
border-radius: inherit;
|
|
fill: inherit;
|
|
cursor: inherit;
|
|
font-family: inherit;
|
|
max-width: 300px;
|
|
}
|
|
:host(:hover) {
|
|
background: ${hn};
|
|
}
|
|
:host(:active) {
|
|
background: ${Q};
|
|
}
|
|
.control:${Pe} {
|
|
outline: calc(${E} * 1px) solid ${Se};
|
|
outline-offset: calc(${E} * 2px);
|
|
}
|
|
.control::-moz-focus-inner {
|
|
border: 0;
|
|
}
|
|
:host([disabled]) {
|
|
opacity: ${ri};
|
|
background: ${Q};
|
|
cursor: ${Kr};
|
|
}
|
|
.content {
|
|
display: flex;
|
|
}
|
|
.start {
|
|
display: flex;
|
|
}
|
|
::slotted(svg),
|
|
::slotted(span) {
|
|
width: calc(${ln} * 4px);
|
|
height: calc(${ln} * 4px);
|
|
}
|
|
.start {
|
|
margin-inline-end: 8px;
|
|
}
|
|
`,mi=ce`
|
|
:host([appearance='primary']) {
|
|
background: ${Q};
|
|
color: ${dn};
|
|
}
|
|
:host([appearance='primary']:hover) {
|
|
background: ${hn};
|
|
}
|
|
:host([appearance='primary']:active) .control:active {
|
|
background: ${Q};
|
|
}
|
|
:host([appearance='primary']) .control:${Pe} {
|
|
outline: calc(${E} * 1px) solid ${Se};
|
|
outline-offset: calc(${E} * 2px);
|
|
}
|
|
:host([appearance='primary'][disabled]) {
|
|
background: ${Q};
|
|
}
|
|
`,yi=ce`
|
|
:host([appearance='secondary']) {
|
|
background: ${nt};
|
|
color: ${hi};
|
|
}
|
|
:host([appearance='secondary']:hover) {
|
|
background: ${fi};
|
|
}
|
|
:host([appearance='secondary']:active) .control:active {
|
|
background: ${nt};
|
|
}
|
|
:host([appearance='secondary']) .control:${Pe} {
|
|
outline: calc(${E} * 1px) solid ${Se};
|
|
outline-offset: calc(${E} * 2px);
|
|
}
|
|
:host([appearance='secondary'][disabled]) {
|
|
background: ${nt};
|
|
}
|
|
`,vi=ce`
|
|
:host([appearance='icon']) {
|
|
background: ${cn};
|
|
border-radius: ${ci};
|
|
color: ${si};
|
|
}
|
|
:host([appearance='icon']:hover) {
|
|
background: ${un};
|
|
outline: 1px dotted ${ti};
|
|
outline-offset: -1px;
|
|
}
|
|
:host([appearance='icon']) .control {
|
|
padding: ${di};
|
|
border: calc(${E} * 1px) solid transparent;
|
|
}
|
|
:host([appearance='icon']:active) .control:active {
|
|
background: ${un};
|
|
}
|
|
:host([appearance='icon']) .control:${Pe} {
|
|
outline: calc(${E} * 1px) solid ${Se};
|
|
outline-offset: ${ui};
|
|
}
|
|
:host([appearance='icon'][disabled]) {
|
|
background: ${cn};
|
|
}
|
|
`,wi=(n,e)=>ce`
|
|
${bi}
|
|
${mi}
|
|
${yi}
|
|
${vi}
|
|
`;class fn extends D{connectedCallback(){if(super.connectedCallback(),!this.appearance){const e=this.getAttribute("appearance");this.appearance=e}}attributeChangedCallback(e,t,r){e==="appearance"&&r==="icon"&&(this.getAttribute("aria-label")||(this.ariaLabel="Icon Button")),e==="aria-label"&&(this.ariaLabel=r),e==="disabled"&&(this.disabled=r!==null)}}dr([p],fn.prototype,"appearance",void 0);const ki=fn.compose({baseName:"button",template:Ur,styles:wi,shadowOptions:{delegatesFocus:!0}}),pn=/(?<literal>\[.*?\])|(?<year>YYYY|YY)|(?<month>M{1,4})|(?<day>Do|DD?)|(?<weekday>d{2,4})|(?<hour>HH?|hh?)|(?<minute>mm?)|(?<second>ss?)|(?<fractionalSecond>SSS)|(?<dayPeriod>A|a)|(?<timeZoneName>ZZ?)/g,gn=/(?<dateStyle>full|long|medium|short)(?:\+(?<timeStyle>full|long|medium|short))?/,Ci=null;let j;const ue=new Map;let A,Y,I;function fl(n){typeof n=="string"?n==="system"?A=void 0:A=[n]:A=n??void 0,Y=void 0,I=void 0,ue.clear(),j=void 0}function pl(n,e){const t=new Date(n.getTime());for(const[r,i]of Object.entries(e))if(!!i)switch(r){case"years":t.setFullYear(t.getFullYear()+i);break;case"months":t.setMonth(t.getMonth()+i);break;case"days":t.setDate(t.getDate()+i);break;case"hours":t.setHours(t.getHours()+i);break;case"minutes":t.setMinutes(t.getMinutes()+i);break;case"seconds":t.setSeconds(t.getSeconds()+i);break}return t}function gl(n,e){const t=n.getTime()-new Date().getTime();for(const[r,i,s,o]of Ci){const a=Math.abs(t);if(a>=i||i===1e3)return e?(j==null&&(I!=null?j=I.resolvedOptions().locale:Y!=null?j=Y.resolvedOptions().locale:(I=new Intl.RelativeTimeFormat(A,{localeMatcher:"best fit",numeric:"always",style:"narrow"}),j=I.resolvedOptions().locale)),j==="en"||j?.startsWith("en-")?`${Math.round(a/s)}${o}`:(I==null&&(I=new Intl.RelativeTimeFormat(A,{localeMatcher:"best fit",numeric:"always",style:"narrow"})),I.format(Math.round(t/s),r))):(Y==null&&(Y=new Intl.RelativeTimeFormat(A,{localeMatcher:"best fit",numeric:"auto",style:"long"})),Y.format(Math.round(t/s),r))}return""}function bl(n,e,t,r=!0){e=e??void 0;const i=`${t??""}:${e}`;let s=ue.get(i);if(s==null){const c=Pi(e);let l;t==null?l=A:t==="system"?l=void 0:l=[t],s=new Intl.DateTimeFormat(l,c),r&&ue.set(i,s)}if(e==null||gn.test(e))return s.format(n);function o(c){const l=`${t??""}:time:${c}`;let d=ue.get(l);if(d==null){const u={localeMatcher:"best fit",timeStyle:c};let h;t==null?h=A:t==="system"?h=void 0:h=[t],d=new Intl.DateTimeFormat(h,u),r&&ue.set(l,d)}return d}const a=s.formatToParts(n);return e.replace(pn,(c,l,d,u,h,m,w,k,V,De,lt,Dl,Rl,Ol,xn)=>{if(l!=null)return l.substring(1,l.length-1);for(const Pn in xn){const ct=xn[Pn];if(ct==null)continue;const de=a.find(Sn=>Sn.type===Pn);return ct==="Do"&&de?.type==="day"?Si(Number(de.value)):ct==="a"&&de?.type==="dayPeriod"?` ${(o("short").formatToParts(n).find(qi=>qi.type==="dayPeriod")??de)?.value??""}`:de?.value??""}return""})}function xi(n,e,t){const r=(typeof e=="number"?e:e.getTime())-(typeof n=="number"?n:n.getTime());switch(t){case"days":return Math.floor(r/(1e3*60*60*24));case"hours":return Math.floor(r/(1e3*60*60));case"minutes":return Math.floor(r/(1e3*60));case"seconds":return Math.floor(r/1e3);default:return r}}function Pi(n){if(n==null)return{localeMatcher:"best fit",dateStyle:"full",timeStyle:"short"};const e=gn.exec(n);if(e?.groups!=null){const{dateStyle:r,timeStyle:i}=e.groups;return{localeMatcher:"best fit",dateStyle:r||"full",timeStyle:i||void 0}}const t={localeMatcher:"best fit"};for(const{groups:r}of n.matchAll(pn))if(r!=null)for(const i in r){const s=r[i];if(s!=null)switch(i){case"year":t.year=s.length===4?"numeric":"2-digit";break;case"month":switch(s.length){case 4:t.month="long";break;case 3:t.month="short";break;case 2:t.month="2-digit";break;case 1:t.month="numeric";break}break;case"day":s==="DD"?t.day="2-digit":t.day="numeric";break;case"weekday":switch(s.length){case 4:t.weekday="long";break;case 3:t.weekday="short";break;case 2:t.weekday="narrow";break}break;case"hour":t.hour=s.length===2?"2-digit":"numeric",t.hour12=s==="hh"||s==="h";break;case"minute":t.minute=s.length===2?"2-digit":"numeric";break;case"second":t.second=s.length===2?"2-digit":"numeric";break;case"fractionalSecond":t.fractionalSecondDigits=3;break;case"dayPeriod":t.dayPeriod="narrow",t.hour12=!0,t.hourCycle="h12";break;case"timeZoneName":t.timeZoneName=s.length===2?"long":"short";break}}return t}const rt=null;function Si(n){const e=n%100;return`${n}${rt[(e-20)%10]??rt[e]??rt[0]}`}var $i=(n=>(n.Free="free",n.FreePlus="free+",n.Pro="pro",n.Teams="teams",n.Enterprise="enterprise",n))($i||{}),M=(n=>(n[n.VerificationRequired=-1]="VerificationRequired",n[n.Free=0]="Free",n[n.FreeInPreview=1]="FreeInPreview",n[n.FreePreviewExpired=2]="FreePreviewExpired",n[n.FreePlusInTrial=3]="FreePlusInTrial",n[n.FreePlusTrialExpired=4]="FreePlusTrialExpired",n[n.Paid=5]="Paid",n))(M||{});function ml(n){const{account:e,plan:{actual:t,effective:r},previewTrial:i}=n;if(e?.verified===!1)return-1;if(t.id===r.id)switch(r.id){case"free":return i==null?0:2;case"free+":return 4;case"pro":case"teams":case"enterprise":return 5}switch(r.id){case"free":return i==null?0:1;case"free+":return 4;case"pro":return t.id==="free"?1:3;case"teams":case"enterprise":return 5}}function yl(n,e,t){return{id:n,name:Ti(n),startedOn:(e??new Date).toISOString(),expiresOn:t?.toISOString()}}function Ti(n){switch(n){case"free+":return"GitLens+";case"pro":return"GitLens+ Pro";case"teams":return"GitLens+ Teams";case"enterprise":return"GitLens+ Enterprise";case"free":default:return"GitLens"}}const _i=new Map([[void 0,-1],["free",0],["free+",1],["pro",2],["teams",3],["enterprise",4]]);function vl(n){return _i.get(n)}function it(n,e){return bn(n.plan.effective.expiresOn,e)}function bn(n,e){return n!=null?xi(Date.now(),new Date(n),e):void 0}function wl(n){return Di(n.plan.effective.id)}function Di(n){return n!=="free"&&n!=="free+"}function kl(n){const e=it(n);return e!=null&&e<=0}function Cl(n){return n.plan.actual.id!==n.plan.effective.id}function xl(n){const e=bn(n.previewTrial?.expiresOn);return e!=null?e<=0:void 0}var Ri=Object.defineProperty,Oi=(n,e,t)=>e in n?Ri(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ei=(n,e,t)=>(Oi(n,typeof e!="symbol"?e+"":e,t),t);class mn{constructor(e){this.method=e,Ei(this,"_")}}class $e extends mn{}class Te extends mn{}function yn(n,e,t){n.method===e.method&&t(e.params)}const Bi=new $e("webview/ready"),Fi=new $e("command/execute"),Pl=new $e("configuration/preview"),Sl=new $e("configuration/update"),$l=new Te("configuration/didChange"),Tl=new Te("configuration/didPreview"),_l=new Te("webview/didOpenAnchor");var st=(n=>(n.DismissedWelcome="dismissed:welcome",n.OpenedSCM="opened:scm",n))(st||{});const vn=new Te("subscription/didChange");var v;(n=>{function e(i,s,o,a){let c=!1;if(typeof i=="string"){const d=function(u){const h=u?.target;!h?.matches(i)||o(u,h)};return document.addEventListener(s,d,a??!0),{dispose:()=>{c||(c=!0,document.removeEventListener(s,d,a??!0))}}}const l=function(d){o(d,this)};return i.addEventListener(s,l,a??!1),{dispose:()=>{c||(c=!0,i.removeEventListener(s,l,a??!1))}}}n.on=e;function t(i,s,o){const a=document.getElementById(i);if(s.replaceChildren(a?.content.cloneNode(!0)),s.className=a.className,o?.visible!=null){const c=s.querySelectorAll("[data-visible]");for(const l of c){const d=l.dataset.visible;!d||(o.visible[d]?l.style.display="initial":l.style.display="none")}}if(o?.bindings!=null){const c=s.querySelectorAll("[data-bind]");for(const l of c){const d=l.dataset.bind;if(!d)continue;const u=o.bindings[d];u!=null&&(l.textContent=String(u))}}}n.insertTemplate=t;function r(i){i.replaceChildren(),i.className=""}n.resetSlot=r})(v||(v={}));const Ai=/^(?:(#?)([0-9a-f]{3}|[0-9a-f]{6})|((?:rgb|hsl)a?)\((-?\d+%?)[,\s]+(-?\d+%?)[,\s]+(-?\d+%?)[,\s]*(-?[\d.]+%?)?\))$/i;function ot(n,e){const t=n+e,r=e<0?t<0?0:t:t>255?255:t;return Math.round(r)}function N(n,e){return H(n,-e)}function H(n,e){const t=wn(n);if(t==null)return n;const[r,i,s,o]=t,a=255*e/100;return`rgba(${ot(r,a)}, ${ot(i,a)}, ${ot(s,a)}, ${o})`}function z(n,e){const t=wn(n);if(t==null)return n;const[r,i,s,o]=t;return`rgba(${r}, ${i}, ${s}, ${o*(e/100)})`}function wn(n){n=n.trim();const e=Ai.exec(n);if(e==null)return null;if(e[1]==="#"){const t=e[2];switch(t.length){case 3:return[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1];case 6:return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16),1]}return null}switch(e[3]){case"rgb":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),1];case"rgba":return[parseInt(e[4],10),parseInt(e[5],10),parseInt(e[6],10),parseFloat(e[7])];default:return null}}function Ii(){const n=()=>{const t=document.body,r=window.getComputedStyle(t),i=t.style;i.setProperty("--font-family",r.getPropertyValue("--vscode-font-family").trim()),i.setProperty("--font-size",r.getPropertyValue("--vscode-font-size").trim()),i.setProperty("--font-weight",r.getPropertyValue("--vscode-font-weight").trim()),i.setProperty("--editor-font-family",r.getPropertyValue("--vscode-editor-font-family").trim()),i.setProperty("--editor-font-size",r.getPropertyValue("--vscode-editor-font-size").trim()),i.setProperty("--editor-font-weight",r.getPropertyValue("--vscode-editor-font-weight").trim());let s=r.getPropertyValue("--vscode-editor-background").trim();i.setProperty("--color-background",s),i.setProperty("--color-background--lighten-05",H(s,5)),i.setProperty("--color-background--darken-05",N(s,5)),i.setProperty("--color-background--lighten-075",H(s,7.5)),i.setProperty("--color-background--darken-075",N(s,7.5)),i.setProperty("--color-background--lighten-15",H(s,15)),i.setProperty("--color-background--darken-15",N(s,15)),i.setProperty("--color-background--lighten-30",H(s,30)),i.setProperty("--color-background--darken-30",N(s,30)),i.setProperty("--color-background--lighten-50",H(s,50)),i.setProperty("--color-background--darken-50",N(s,50)),s=r.getPropertyValue("--vscode-button-background").trim(),i.setProperty("--color-button-background",s),i.setProperty("--color-button-background--darken-30",N(s,30)),s=r.getPropertyValue("--vscode-button-secondaryBackground").trim(),i.setProperty("--color-button-secondary-background",s),i.setProperty("--color-button-secondary-background--darken-30",N(s,30)),s=r.getPropertyValue("--vscode-button-background").trim(),i.setProperty("--color-highlight",s),i.setProperty("--color-highlight--75",z(s,75)),i.setProperty("--color-highlight--50",z(s,50)),i.setProperty("--color-highlight--25",z(s,25)),s=r.getPropertyValue("--vscode-button-foreground").trim(),i.setProperty("--color-button-foreground",s);let o=r.getPropertyValue("--vscode-editor-foreground").trim();o||(o=r.getPropertyValue("--vscode-foreground").trim()),i.setProperty("--color-foreground",o),i.setProperty("--color-foreground--85",z(o,85)),i.setProperty("--color-foreground--75",z(o,75)),i.setProperty("--color-foreground--65",z(o,65)),i.setProperty("--color-foreground--50",z(o,50)),s=r.getPropertyValue("--vscode-focusBorder").trim(),i.setProperty("--color-focus-border",s),s=r.getPropertyValue("--vscode-textLink-foreground").trim(),i.setProperty("--color-link-foreground",s),i.setProperty("--color-link-foreground--darken-20",N(s,20)),i.setProperty("--color-link-foreground--lighten-20",H(s,20)),s=r.getPropertyValue("--vscode-sideBar-foreground").trim(),i.setProperty("--color-view-foreground",s||o),i.setProperty("--color-view-header-foreground",r.getPropertyValue("--vscode-sideBarSectionHeader-foreground").trim()||s||o),s=r.getPropertyValue("--vscode-editorHoverWidget-background").trim(),i.setProperty("--color-hover-background",s),s=r.getPropertyValue("--vscode-editorHoverWidget-border").trim(),i.setProperty("--color-hover-border",s),s=r.getPropertyValue("--vscode-editorHoverWidget-foreground").trim(),i.setProperty("--color-hover-foreground",s),s=r.getPropertyValue("--vscode-editorHoverWidget-statusBarBackground").trim(),i.setProperty("--color-hover-statusBarBackground",s)},e=new MutationObserver(n);return e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),n(),e}var Mi=Object.defineProperty,Ni=(n,e,t)=>e in n?Mi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,at=(n,e,t)=>(Ni(n,typeof e!="symbol"?e+"":e,t),t);const Vi=2**30;let _e=0;function kn(){return _e===Vi?_e=1:_e++,`webview:${_e}`}class Li{constructor(e){this.appName=e,at(this,"_api"),at(this,"state"),at(this,"bindDisposables"),this.state=window.bootstrap,window.bootstrap=void 0,this.log(`${this.appName}()`),this._api=acquireVsCodeApi(),Ii(),requestAnimationFrame(()=>{this.log(`${this.appName}.initializing`);try{this.onInitialize?.(),this.bind(),this.onMessageReceived!=null&&window.addEventListener("message",this.onMessageReceived.bind(this)),this.sendCommand(Bi,void 0),this.onInitialized?.()}finally{setTimeout(()=>{document.body.classList.remove("preload")},500)}})}bind(){this.bindDisposables?.forEach(e=>e.dispose()),this.bindDisposables=this.onBind?.()}log(e){}getState(){return this._api.getState()}sendCommand(e,t){const r=kn();return this.log(`${this.appName}.sendCommand(${r}): name=${e.method}`),this.postMessage({id:r,method:e.method,params:t})}sendCommandWithCompletion(e,t,r,i){const s=kn();this.log(`${this.appName}.sendCommandWithCompletion(${s}): name=${e.method}`);const o=v.on(window,"message",a=>{yn(r,a.data,c=>{c.completionId===s&&(o.dispose(),i(c))})});return this.postMessage({id:s,method:e.method,params:t})}setState(e){this.state=e,e!=null&&this._api.setState(e)}postMessage(e){this._api.postMessage(e)}}var ji=Object.defineProperty,Hi=(n,e,t)=>e in n?ji(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Cn=(n,e,t)=>(Hi(n,typeof e!="symbol"?e+"":e,t),t);class zi extends Li{constructor(){super("HomeApp");Cn(this,"$slots"),Cn(this,"$footer")}onInitialize(){ur().register({register:function(e,t){ki().register(e,t)}}),this.$slots=[document.getElementById("slot1"),document.getElementById("slot2"),document.getElementById("slot3")],this.$footer=document.getElementById("slot-footer"),this.updateState()}onBind(){const e=super.onBind?.()??[];return e.push(v.on("[data-action]","click",(t,r)=>this.onActionClicked(t,r))),e}onMessageReceived(e){const t=e.data;switch(t.method){case vn.method:this.log(`${this.appName}.onMessageReceived(${t.id}): name=${t.method}`),yn(vn,t,r=>{this.state=r,this.updateState()});break;default:super.onMessageReceived?.(e);break}}onActionClicked(e,t){const r=t.dataset.action;r?.startsWith("command:")&&this.sendCommand(Fi,{command:r.slice(8)})}updateState(){const{subscription:e,completedActions:t}=this.state,r=!t.includes(st.OpenedSCM),i=!t.includes(st.DismissedWelcome);let s=0;if(e.account?.verified===!1)v.insertTemplate("state:verify-email",this.$slots[s++]),v.insertTemplate(i?"welcome":"links",this.$slots[s++]);else{switch(e.state){case M.Free:i?(v.insertTemplate("welcome",this.$slots[s++]),v.resetSlot(this.$footer)):v.insertTemplate("links",this.$footer),r&&v.insertTemplate("views",this.$slots[s++]),v.insertTemplate("state:free",this.$slots[s++]);break;case M.FreeInPreview:{r&&v.insertTemplate("views",this.$slots[s++]);const o=it(e,"days")??0;v.insertTemplate("state:free-preview",this.$slots[s++],{bindings:{previewDays:`${o===1?`${o} day`:`${o} days`}`}});break}case M.FreePreviewExpired:r&&v.insertTemplate("views",this.$slots[s++]),v.insertTemplate("state:free-preview-expired",this.$slots[s++]);break;case M.FreePlusInTrial:{r&&v.insertTemplate("views",this.$slots[s++]);const o=it(e,"days")??0;v.insertTemplate("state:plus-trial",this.$slots[s++],{bindings:{plan:e.plan.effective.name,trialDays:`${o===1?`${o} day`:`${o} days`}`}});break}case M.FreePlusTrialExpired:r&&v.insertTemplate("views",this.$slots[s++]),v.insertTemplate("state:plus-trial-expired",this.$slots[s++]);break;case M.Paid:r&&v.insertTemplate("views",this.$slots[s++]),v.insertTemplate("state:paid",this.$slots[s++],{bindings:{plan:e.plan.effective.name}});break}e.state!==M.Free&&(i?(v.insertTemplate("welcome",this.$slots[s++]),v.resetSlot(this.$footer)):v.insertTemplate("links",this.$footer))}for(let o=1;o<s;o++)this.$slots[o].classList.add("divider");for(let o=s;o<this.$slots.length;o++)v.resetSlot(this.$slots[o])}}new zi})();
|
|
|
|
//# sourceMappingURL=home.js.map
|