{"version":3,"sources":["webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/card/card.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js","webpack:///./node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"],"names":["defaultElement","document","createElement","name","value","queueUpdate","this","target","setProperty","removeProperty","DocumentStyleSheetTarget","super","sheet","CSSStyleSheet","cssRules","insertRule","style","adoptedStyleSheets","HeadStyleElementStyleSheetTarget","head","appendChild","index","length","store","Map","controller","$fastController","addStyles","getNotifier","subscribe","handleChange","key","entries","set","delete","source","observable","prototype","RootStyleSheetTarget","properties","roots","values","PropertyTargetManager","getOrCreate","normalizeRoot","root","has","add","Set","propertyTargetCache","WeakMap","propertyTargetCtor","supportsAdoptedStyleSheets","create","Object","freeze","get","Document","configuration","subscribers","_appliedTo","cssCustomPropertyName","cssCustomProperty","cssVar","id","uniqueId","tokensById","nameOrConfig","token","element","undefined","Error","alias","existsFor","setValueFor","subscriber","subscriberSet","getOrCreateSubscriberSet","list","record","forEach","sub","getValueFor","toString","node","dependencies","observer","binding","call","disconnect","observe","notify","track","nodeCache","childToParent","children","assignedValues","reflecting","bindingObservers","tokenValueChangeHandler","arg","getTokenById","isCSSDesignToken","parent","isReflecting","parentValue","sourceValue","stopReflectToCSS","reflectToCSS","addBehaviors","isConnected","bind","start","current","raw","getRaw","hydrate","_a","findClosestAssignedNode","isDerivedDesignTokenValue","tearDownBindingObserver","setupBindingObserver","upstream","findParent","keys","removeChild","child","reParent","filter","x","contains","push","all","childIndex","indexOf","splice","unsubscribe","test","cssCustomPropertyReflector","startReflection","stopReflection","property","remove","resolveCSSValue","createCSS","DesignToken","from","notifyConnection","notifyDisconnection","unbind","registerRoot","unregisterRoot","arguments","proxy","initialValue","indeterminate","keypressHandler","e","checked","clickHandler","disabled","readOnly","setAttribute","HTMLInputElement","attribute","mode","presentationKeyFromTag","tagName","toLowerCase","presentationRegistry","ComponentPresentation","presentation","container","register","instance","existing","findResponsibleContainer","DefaultComponentPresentation","template","styles","Array","isArray","checkboxTemplate","context","definition","required","c","event","checkedIndicator","indeterminateIndicator","defaultSlottedNodes","Card","cardTemplate","ElementDisambiguation","definitionCallbackOnly","ignoreDuplicate","Symbol","elementTypesByTag","elementTagsByType","rootDesignSystem","designSystemKey","createInterface","cachedCallback","handler","DefaultDesignSystem","DesignSystem","tagFor","type","owned","$$designSystem$$","getOrCreateDOMContainer","system","owner","designTokensInitialized","prefix","shadowRootMode","disambiguate","callback","designTokenRoot","registrations","elementDefinitionEntries","elementPrefix","params","elementDefinitionType","elementDefinitionCallback","extractedParams","extractTryDefineElementParams","baseClass","elementName","typeFoundByName","needsDefine","result","ElementDefinitionEntry","registerWithContext","entry","willDefine","define","assign"],"mappings":"oOAEO,MAAMA,EAAiBC,SAASC,cAAc,OAIrD,MAAM,EACF,YAAYC,EAAMC,GACd,IAAIC,YAAY,IAAMC,KAAKC,OAAOC,YAAYL,EAAMC,IAExD,eAAeD,GACX,IAAIE,YAAY,IAAMC,KAAKC,OAAOE,eAAeN,KAczD,MAAMO,UAAiC,EACnC,cACIC,QACA,MAAMC,EAAQ,IAAIC,cAClBP,KAAKC,OAASK,EAAME,SAASF,EAAMG,WAAW,YAAYC,MAC1Df,SAASgB,mBAAqB,IACvBhB,SAASgB,mBACZL,IAIZ,MAAMM,UAAyC,EAC3C,cACIP,QACAL,KAAKU,MAAQf,SAASC,cAAc,SACpCD,SAASkB,KAAKC,YAAYd,KAAKU,OAC/B,MAAM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I,IAAsBlL,KAAKyM,KAAMzJ,OAAOuL,OAAOvL,OAAOuL,OAAO,GAAIrD,GAAa,CAAErL,KAAMG,KAAKH,QAErH,OAAO4M,GACH,OAAOF,EAAaC,OAAOC","file":"vendors~248c90ae.a48a601c48c3748a0f84.chunk.js","sourcesContent":["import { __decorate } from \"tslib\";\nimport { DOM, ElementStyles, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nexport const defaultElement = document.createElement(\"div\");\nfunction isFastElement(element) {\n    return element instanceof FASTElement;\n}\nclass QueuedStyleSheetTarget {\n    setProperty(name, value) {\n        DOM.queueUpdate(() => this.target.setProperty(name, value));\n    }\n    removeProperty(name) {\n        DOM.queueUpdate(() => this.target.removeProperty(name));\n    }\n}\n/**\n * Handles setting properties for a FASTElement using Constructable Stylesheets\n */\nclass ConstructableStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor(source) {\n        super();\n        const sheet = new CSSStyleSheet();\n        this.target = sheet.cssRules[sheet.insertRule(\":host{}\")].style;\n        source.$fastController.addStyles(ElementStyles.create([sheet]));\n    }\n}\nclass DocumentStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor() {\n        super();\n        const sheet = new CSSStyleSheet();\n        this.target = sheet.cssRules[sheet.insertRule(\":root{}\")].style;\n        document.adoptedStyleSheets = [\n            ...document.adoptedStyleSheets,\n            sheet,\n        ];\n    }\n}\nclass HeadStyleElementStyleSheetTarget extends QueuedStyleSheetTarget {\n    constructor() {\n        super();\n        this.style = document.createElement(\"style\");\n        document.head.appendChild(this.style);\n        const { sheet } = this.style;\n        // Because the HTMLStyleElement has been appended,\n        // there shouldn't exist a case where `sheet` is null,\n        // but if-check it just in case.\n        if (sheet) {\n            // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n            // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n            const index = sheet.insertRule(\":root{}\", sheet.cssRules.length);\n            this.target = sheet.cssRules[index].style;\n        }\n    }\n}\n/**\n * Handles setting properties for a FASTElement using an HTMLStyleElement\n */\nclass StyleElementStyleSheetTarget {\n    constructor(target) {\n        this.store = new Map();\n        this.target = null;\n        const controller = target.$fastController;\n        this.style = document.createElement(\"style\");\n        controller.addStyles(this.style);\n        Observable.getNotifier(controller).subscribe(this, \"isConnected\");\n        this.handleChange(controller, \"isConnected\");\n    }\n    targetChanged() {\n        if (this.target !== null) {\n            for (const [key, value] of this.store.entries()) {\n                this.target.setProperty(key, value);\n            }\n        }\n    }\n    setProperty(name, value) {\n        this.store.set(name, value);\n        DOM.queueUpdate(() => {\n            if (this.target !== null) {\n                this.target.setProperty(name, value);\n            }\n        });\n    }\n    removeProperty(name) {\n        this.store.delete(name);\n        DOM.queueUpdate(() => {\n            if (this.target !== null) {\n                this.target.removeProperty(name);\n            }\n        });\n    }\n    handleChange(source, key) {\n        // HTMLStyleElement.sheet is null if the element isn't connected to the DOM,\n        // so this method reacts to changes in DOM connection for the element hosting\n        // the HTMLStyleElement.\n        //\n        // All rules applied via the CSSOM also get cleared when the element disconnects,\n        // so we need to add a new rule each time and populate it with the stored properties\n        const { sheet } = this.style;\n        if (sheet) {\n            // Safari will throw if we try to use the return result of insertRule()\n            // to index the rule inline, so store as a const prior to indexing.\n            // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation,\n            // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument.\n            const index = sheet.insertRule(\":host{}\", sheet.cssRules.length);\n            this.target = sheet.cssRules[index].style;\n        }\n        else {\n            this.target = null;\n        }\n    }\n}\n__decorate([\n    observable\n], StyleElementStyleSheetTarget.prototype, \"target\", void 0);\n/**\n * Handles setting properties for a normal HTMLElement\n */\nclass ElementStyleSheetTarget {\n    constructor(source) {\n        this.target = source.style;\n    }\n    setProperty(name, value) {\n        DOM.queueUpdate(() => this.target.setProperty(name, value));\n    }\n    removeProperty(name) {\n        DOM.queueUpdate(() => this.target.removeProperty(name));\n    }\n}\n/**\n * Controls emission for default values. This control is capable\n * of emitting to multiple {@link PropertyTarget | PropertyTargets},\n * and only emits if it has at least one root.\n *\n * @internal\n */\nexport class RootStyleSheetTarget {\n    setProperty(name, value) {\n        RootStyleSheetTarget.properties[name] = value;\n        for (const target of RootStyleSheetTarget.roots.values()) {\n            PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value);\n        }\n    }\n    removeProperty(name) {\n        delete RootStyleSheetTarget.properties[name];\n        for (const target of RootStyleSheetTarget.roots.values()) {\n            PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name);\n        }\n    }\n    static registerRoot(root) {\n        const { roots } = RootStyleSheetTarget;\n        if (!roots.has(root)) {\n            roots.add(root);\n            const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root));\n            for (const key in RootStyleSheetTarget.properties) {\n                target.setProperty(key, RootStyleSheetTarget.properties[key]);\n            }\n        }\n    }\n    static unregisterRoot(root) {\n        const { roots } = RootStyleSheetTarget;\n        if (roots.has(root)) {\n            roots.delete(root);\n            const target = PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(root));\n            for (const key in RootStyleSheetTarget.properties) {\n                target.removeProperty(key);\n            }\n        }\n    }\n    /**\n     * Returns the document when provided the default element,\n     * otherwise is a no-op\n     * @param root - the root to normalize\n     */\n    static normalizeRoot(root) {\n        return root === defaultElement ? document : root;\n    }\n}\nRootStyleSheetTarget.roots = new Set();\nRootStyleSheetTarget.properties = {};\n// Caches PropertyTarget instances\nconst propertyTargetCache = new WeakMap();\n// Use Constructable StyleSheets for FAST elements when supported, otherwise use\n// HTMLStyleElement instances\nconst propertyTargetCtor = DOM.supportsAdoptedStyleSheets\n    ? ConstructableStyleSheetTarget\n    : StyleElementStyleSheetTarget;\n/**\n * Manages creation and caching of PropertyTarget instances.\n *\n * @internal\n */\nexport const PropertyTargetManager = Object.freeze({\n    getOrCreate(source) {\n        if (propertyTargetCache.has(source)) {\n            /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */\n            return propertyTargetCache.get(source);\n        }\n        let target;\n        if (source === defaultElement) {\n            target = new RootStyleSheetTarget();\n        }\n        else if (source instanceof Document) {\n            target = DOM.supportsAdoptedStyleSheets\n                ? new DocumentStyleSheetTarget()\n                : new HeadStyleElementStyleSheetTarget();\n        }\n        else if (isFastElement(source)) {\n            target = new propertyTargetCtor(source);\n        }\n        else {\n            target = new ElementStyleSheetTarget(source);\n        }\n        propertyTargetCache.set(source, target);\n        return target;\n    },\n});\n","import { __decorate } from \"tslib\";\nimport { CSSDirective, defaultExecutionContext, FASTElement, observable, Observable, } from \"@microsoft/fast-element\";\nimport { composedParent } from \"../utilities\";\nimport { composedContains } from \"../utilities/composed-contains\";\nimport { PropertyTargetManager, RootStyleSheetTarget } from \"./custom-property-manager\";\nimport { defaultElement } from \"./custom-property-manager\";\n/**\n * Implementation of {@link (DesignToken:interface)}\n */\nclass DesignTokenImpl extends CSSDirective {\n    constructor(configuration) {\n        super();\n        this.subscribers = new WeakMap();\n        this._appliedTo = new Set();\n        this.name = configuration.name;\n        if (configuration.cssCustomPropertyName !== null) {\n            this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`;\n            this.cssVar = `var(${this.cssCustomProperty})`;\n        }\n        this.id = DesignTokenImpl.uniqueId();\n        DesignTokenImpl.tokensById.set(this.id, this);\n    }\n    get appliedTo() {\n        return [...this._appliedTo];\n    }\n    static from(nameOrConfig) {\n        return new DesignTokenImpl({\n            name: typeof nameOrConfig === \"string\" ? nameOrConfig : nameOrConfig.name,\n            cssCustomPropertyName: typeof nameOrConfig === \"string\"\n                ? nameOrConfig\n                : nameOrConfig.cssCustomPropertyName === void 0\n                    ? nameOrConfig.name\n                    : nameOrConfig.cssCustomPropertyName,\n        });\n    }\n    static isCSSDesignToken(token) {\n        return typeof token.cssCustomProperty === \"string\";\n    }\n    static isDerivedDesignTokenValue(value) {\n        return typeof value === \"function\";\n    }\n    /**\n     * Gets a token by ID. Returns undefined if the token was not found.\n     * @param id - The ID of the token\n     * @returns\n     */\n    static getTokenById(id) {\n        return DesignTokenImpl.tokensById.get(id);\n    }\n    getOrCreateSubscriberSet(target = this) {\n        return (this.subscribers.get(target) ||\n            (this.subscribers.set(target, new Set()) && this.subscribers.get(target)));\n    }\n    createCSS() {\n        return this.cssVar || \"\";\n    }\n    getValueFor(element) {\n        const value = DesignTokenNode.getOrCreate(element).get(this);\n        if (value !== undefined) {\n            return value;\n        }\n        throw new Error(`Value could not be retrieved for token named \"${this.name}\". Ensure the value is set for ${element} or an ancestor of ${element}.`);\n    }\n    setValueFor(element, value) {\n        this._appliedTo.add(element);\n        if (value instanceof DesignTokenImpl) {\n            value = this.alias(value);\n        }\n        DesignTokenNode.getOrCreate(element).set(this, value);\n        return this;\n    }\n    deleteValueFor(element) {\n        this._appliedTo.delete(element);\n        if (DesignTokenNode.existsFor(element)) {\n            DesignTokenNode.getOrCreate(element).delete(this);\n        }\n        return this;\n    }\n    withDefault(value) {\n        this.setValueFor(defaultElement, value);\n        return this;\n    }\n    subscribe(subscriber, target) {\n        const subscriberSet = this.getOrCreateSubscriberSet(target);\n        if (target && !DesignTokenNode.existsFor(target)) {\n            DesignTokenNode.getOrCreate(target);\n        }\n        if (!subscriberSet.has(subscriber)) {\n            subscriberSet.add(subscriber);\n        }\n    }\n    unsubscribe(subscriber, target) {\n        const list = this.subscribers.get(target || this);\n        if (list && list.has(subscriber)) {\n            list.delete(subscriber);\n        }\n    }\n    /**\n     * Notifies subscribers that the value for an element has changed.\n     * @param element - The element to emit a notification for\n     */\n    notify(element) {\n        const record = Object.freeze({ token: this, target: element });\n        if (this.subscribers.has(this)) {\n            this.subscribers.get(this).forEach(sub => sub.handleChange(record));\n        }\n        if (this.subscribers.has(element)) {\n            this.subscribers.get(element).forEach(sub => sub.handleChange(record));\n        }\n    }\n    /**\n     * Alias the token to the provided token.\n     * @param token - the token to alias to\n     */\n    alias(token) {\n        return ((target) => token.getValueFor(target));\n    }\n}\nDesignTokenImpl.uniqueId = (() => {\n    let id = 0;\n    return () => {\n        id++;\n        return id.toString(16);\n    };\n})();\n/**\n * Token storage by token ID\n */\nDesignTokenImpl.tokensById = new Map();\nclass CustomPropertyReflector {\n    startReflection(token, target) {\n        token.subscribe(this, target);\n        this.handleChange({ token, target });\n    }\n    stopReflection(token, target) {\n        token.unsubscribe(this, target);\n        this.remove(token, target);\n    }\n    handleChange(record) {\n        const { token, target } = record;\n        this.add(token, target);\n    }\n    add(token, target) {\n        PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token)));\n    }\n    remove(token, target) {\n        PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty);\n    }\n    resolveCSSValue(value) {\n        return value && typeof value.createCSS === \"function\" ? value.createCSS() : value;\n    }\n}\n/**\n * A light wrapper around BindingObserver to handle value caching and\n * token notification\n */\nclass DesignTokenBindingObserver {\n    constructor(source, token, node) {\n        this.source = source;\n        this.token = token;\n        this.node = node;\n        this.dependencies = new Set();\n        this.observer = Observable.binding(source, this, false);\n        // This is a little bit hacky because it's using internal APIs of BindingObserverImpl.\n        // BindingObserverImpl queues updates to batch it's notifications which doesn't work for this\n        // scenario because the DesignToken.getValueFor API is not async. Without this, using DesignToken.getValueFor()\n        // after DesignToken.setValueFor() when setting a dependency of the value being retrieved can return a stale\n        // value. Assigning .handleChange to .call forces immediate invocation of this classes handleChange() method,\n        // allowing resolution of values synchronously.\n        // TODO: https://github.com/microsoft/fast/issues/5110\n        this.observer.handleChange = this.observer.call;\n        this.handleChange();\n    }\n    disconnect() {\n        this.observer.disconnect();\n    }\n    /**\n     * @internal\n     */\n    handleChange() {\n        this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext));\n    }\n}\n/**\n * Stores resolved token/value pairs and notifies on changes\n */\nclass Store {\n    constructor() {\n        this.values = new Map();\n    }\n    set(token, value) {\n        if (this.values.get(token) !== value) {\n            this.values.set(token, value);\n            Observable.getNotifier(this).notify(token.id);\n        }\n    }\n    get(token) {\n        Observable.track(this, token.id);\n        return this.values.get(token);\n    }\n    delete(token) {\n        this.values.delete(token);\n    }\n    all() {\n        return this.values.entries();\n    }\n}\nconst nodeCache = new WeakMap();\nconst childToParent = new WeakMap();\n/**\n * A node responsible for setting and getting token values,\n * emitting values to CSS custom properties, and maintaining\n * inheritance structures.\n */\nclass DesignTokenNode {\n    constructor(target) {\n        this.target = target;\n        /**\n         * Stores all resolved token values for a node\n         */\n        this.store = new Store();\n        /**\n         * All children assigned to the node\n         */\n        this.children = [];\n        /**\n         * All values explicitly assigned to the node in their raw form\n         */\n        this.assignedValues = new Map();\n        /**\n         * Tokens currently being reflected to CSS custom properties\n         */\n        this.reflecting = new Set();\n        /**\n         * Binding observers for assigned and inherited derived values.\n         */\n        this.bindingObservers = new Map();\n        /**\n         * Emits notifications to token when token values\n         * change the DesignTokenNode\n         */\n        this.tokenValueChangeHandler = {\n            handleChange: (source, arg) => {\n                const token = DesignTokenImpl.getTokenById(arg);\n                if (token) {\n                    // Notify any token subscribers\n                    token.notify(this.target);\n                    if (DesignTokenImpl.isCSSDesignToken(token)) {\n                        const parent = this.parent;\n                        const reflecting = this.isReflecting(token);\n                        if (parent) {\n                            const parentValue = parent.get(token);\n                            const sourceValue = source.get(token);\n                            if (parentValue !== sourceValue && !reflecting) {\n                                this.reflectToCSS(token);\n                            }\n                            else if (parentValue === sourceValue && reflecting) {\n                                this.stopReflectToCSS(token);\n                            }\n                        }\n                        else if (!reflecting) {\n                            this.reflectToCSS(token);\n                        }\n                    }\n                }\n            },\n        };\n        nodeCache.set(target, this);\n        // Map store change notifications to token change notifications\n        Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler);\n        if (target instanceof FASTElement) {\n            target.$fastController.addBehaviors([this]);\n        }\n        else if (target.isConnected) {\n            this.bind();\n        }\n    }\n    /**\n     * Returns a DesignTokenNode for an element.\n     * Creates a new instance if one does not already exist for a node,\n     * otherwise returns the cached instance\n     *\n     * @param target - The HTML element to retrieve a DesignTokenNode for\n     */\n    static getOrCreate(target) {\n        return nodeCache.get(target) || new DesignTokenNode(target);\n    }\n    /**\n     * Determines if a DesignTokenNode has been created for a target\n     * @param target - The element to test\n     */\n    static existsFor(target) {\n        return nodeCache.has(target);\n    }\n    /**\n     * Searches for and return the nearest parent DesignTokenNode.\n     * Null is returned if no node is found or the node provided is for a default element.\n     */\n    static findParent(node) {\n        if (!(defaultElement === node.target)) {\n            let parent = composedParent(node.target);\n            while (parent !== null) {\n                if (nodeCache.has(parent)) {\n                    return nodeCache.get(parent);\n                }\n                parent = composedParent(parent);\n            }\n            return DesignTokenNode.getOrCreate(defaultElement);\n        }\n        return null;\n    }\n    /**\n     * Finds the closest node with a value explicitly assigned for a token, otherwise null.\n     * @param token - The token to look for\n     * @param start - The node to start looking for value assignment\n     * @returns\n     */\n    static findClosestAssignedNode(token, start) {\n        let current = start;\n        do {\n            if (current.has(token)) {\n                return current;\n            }\n            current = current.parent\n                ? current.parent\n                : current.target !== defaultElement\n                    ? DesignTokenNode.getOrCreate(defaultElement)\n                    : null;\n        } while (current !== null);\n        return null;\n    }\n    /**\n     * The parent DesignTokenNode, or null.\n     */\n    get parent() {\n        return childToParent.get(this) || null;\n    }\n    /**\n     * Checks if a token has been assigned an explicit value the node.\n     * @param token - the token to check.\n     */\n    has(token) {\n        return this.assignedValues.has(token);\n    }\n    /**\n     * Gets the value of a token for a node\n     * @param token - The token to retrieve the value for\n     * @returns\n     */\n    get(token) {\n        const value = this.store.get(token);\n        if (value !== undefined) {\n            return value;\n        }\n        const raw = this.getRaw(token);\n        if (raw !== undefined) {\n            this.hydrate(token, raw);\n            return this.get(token);\n        }\n    }\n    /**\n     * Retrieves the raw assigned value of a token from the nearest assigned node.\n     * @param token - The token to retrieve a raw value for\n     * @returns\n     */\n    getRaw(token) {\n        var _a;\n        if (this.assignedValues.has(token)) {\n            return this.assignedValues.get(token);\n        }\n        return (_a = DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token);\n    }\n    /**\n     * Sets a token to a value for a node\n     * @param token - The token to set\n     * @param value - The value to set the token to\n     */\n    set(token, value) {\n        if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) {\n            this.tearDownBindingObserver(token);\n        }\n        this.assignedValues.set(token, value);\n        if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n            this.setupBindingObserver(token, value);\n        }\n        else {\n            this.store.set(token, value);\n        }\n    }\n    /**\n     * Deletes a token value for the node.\n     * @param token - The token to delete the value for\n     */\n    delete(token) {\n        this.assignedValues.delete(token);\n        this.tearDownBindingObserver(token);\n        const upstream = this.getRaw(token);\n        if (upstream) {\n            this.hydrate(token, upstream);\n        }\n        else {\n            this.store.delete(token);\n        }\n    }\n    /**\n     * Invoked when the DesignTokenNode.target is attached to the document\n     */\n    bind() {\n        const parent = DesignTokenNode.findParent(this);\n        if (parent) {\n            parent.appendChild(this);\n        }\n        for (const key of this.assignedValues.keys()) {\n            key.notify(this.target);\n        }\n    }\n    /**\n     * Invoked when the DesignTokenNode.target is detached from the document\n     */\n    unbind() {\n        if (this.parent) {\n            const parent = childToParent.get(this);\n            parent.removeChild(this);\n        }\n    }\n    /**\n     * Appends a child to a parent DesignTokenNode.\n     * @param child - The child to append to the node\n     */\n    appendChild(child) {\n        if (child.parent) {\n            childToParent.get(child).removeChild(child);\n        }\n        const reParent = this.children.filter(x => child.contains(x));\n        childToParent.set(child, this);\n        this.children.push(child);\n        reParent.forEach(x => child.appendChild(x));\n        Observable.getNotifier(this.store).subscribe(child);\n        // How can we not notify *every* subscriber?\n        for (const [token, value] of this.store.all()) {\n            child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value);\n        }\n    }\n    /**\n     * Removes a child from a node.\n     * @param child - The child to remove.\n     */\n    removeChild(child) {\n        const childIndex = this.children.indexOf(child);\n        if (childIndex !== -1) {\n            this.children.splice(childIndex, 1);\n        }\n        Observable.getNotifier(this.store).unsubscribe(child);\n        return child.parent === this ? childToParent.delete(child) : false;\n    }\n    /**\n     * Tests whether a provided node is contained by\n     * the calling node.\n     * @param test - The node to test\n     */\n    contains(test) {\n        return composedContains(this.target, test.target);\n    }\n    /**\n     * Instructs the node to reflect a design token for the provided token.\n     * @param token - The design token to reflect\n     */\n    reflectToCSS(token) {\n        if (!this.isReflecting(token)) {\n            this.reflecting.add(token);\n            DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target);\n        }\n    }\n    /**\n     * Stops reflecting a DesignToken to CSS\n     * @param token - The design token to stop reflecting\n     */\n    stopReflectToCSS(token) {\n        if (this.isReflecting(token)) {\n            this.reflecting.delete(token);\n            DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target);\n        }\n    }\n    /**\n     * Determines if a token is being reflected to CSS for a node.\n     * @param token - The token to check for reflection\n     * @returns\n     */\n    isReflecting(token) {\n        return this.reflecting.has(token);\n    }\n    /**\n     * Handle changes to upstream tokens\n     * @param source - The parent DesignTokenNode\n     * @param property - The token ID that changed\n     */\n    handleChange(source, property) {\n        const token = DesignTokenImpl.getTokenById(property);\n        if (!token) {\n            return;\n        }\n        this.hydrate(token, this.getRaw(token));\n    }\n    /**\n     * Hydrates a token with a DesignTokenValue, making retrieval available.\n     * @param token - The token to hydrate\n     * @param value - The value to hydrate\n     */\n    hydrate(token, value) {\n        if (!this.has(token)) {\n            const observer = this.bindingObservers.get(token);\n            if (DesignTokenImpl.isDerivedDesignTokenValue(value)) {\n                if (observer) {\n                    // If the binding source doesn't match, we need\n                    // to update the binding\n                    if (observer.source !== value) {\n                        this.tearDownBindingObserver(token);\n                        this.setupBindingObserver(token, value);\n                    }\n                }\n                else {\n                    this.setupBindingObserver(token, value);\n                }\n            }\n            else {\n                if (observer) {\n                    this.tearDownBindingObserver(token);\n                }\n                this.store.set(token, value);\n            }\n        }\n    }\n    /**\n     * Sets up a binding observer for a derived token value that notifies token\n     * subscribers on change.\n     *\n     * @param token - The token to notify when the binding updates\n     * @param source - The binding source\n     */\n    setupBindingObserver(token, source) {\n        const binding = new DesignTokenBindingObserver(source, token, this);\n        this.bindingObservers.set(token, binding);\n        return binding;\n    }\n    /**\n     * Tear down a binding observer for a token.\n     */\n    tearDownBindingObserver(token) {\n        if (this.bindingObservers.has(token)) {\n            this.bindingObservers.get(token).disconnect();\n            this.bindingObservers.delete(token);\n            return true;\n        }\n        return false;\n    }\n}\n/**\n * Responsible for reflecting tokens to CSS custom properties\n */\nDesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector();\n__decorate([\n    observable\n], DesignTokenNode.prototype, \"children\", void 0);\nfunction create(nameOrConfig) {\n    return DesignTokenImpl.from(nameOrConfig);\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n/**\n * Factory object for creating {@link (DesignToken:interface)} instances.\n * @public\n */\nexport const DesignToken = Object.freeze({\n    create,\n    /**\n     * Informs DesignToken that an HTMLElement for which tokens have\n     * been set has been connected to the document.\n     *\n     * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n     * in all scenarios, so invoking this method manually is necessary when:\n     *\n     * 1. Token values are set for an HTMLElement.\n     * 2. The HTMLElement does not inherit from FASTElement.\n     * 3. The HTMLElement is not connected to the document when token values are set.\n     *\n     * @param element - The element to notify\n     * @returns - true if notification was successful, otherwise false.\n     */\n    notifyConnection(element) {\n        if (!element.isConnected || !DesignTokenNode.existsFor(element)) {\n            return false;\n        }\n        DesignTokenNode.getOrCreate(element).bind();\n        return true;\n    },\n    /**\n     * Informs DesignToken that an HTMLElement for which tokens have\n     * been set has been disconnected to the document.\n     *\n     * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness\n     * in all scenarios, so invoking this method manually is necessary when:\n     *\n     * 1. Token values are set for an HTMLElement.\n     * 2. The HTMLElement does not inherit from FASTElement.\n     *\n     * @param element - The element to notify\n     * @returns - true if notification was successful, otherwise false.\n     */\n    notifyDisconnection(element) {\n        if (element.isConnected || !DesignTokenNode.existsFor(element)) {\n            return false;\n        }\n        DesignTokenNode.getOrCreate(element).unbind();\n        return true;\n    },\n    /**\n     * Registers and element or document as a DesignToken root.\n     * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via\n     * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all\n     * registered roots.\n     * @param target - The root to register\n     */\n    registerRoot(target = defaultElement) {\n        RootStyleSheetTarget.registerRoot(target);\n    },\n    /**\n     * Unregister an element or document as a DesignToken root.\n     * @param target - The root to deregister\n     */\n    unregisterRoot(target = defaultElement) {\n        RootStyleSheetTarget.unregisterRoot(target);\n    },\n});\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n","import { CheckableFormAssociated } from \"../form-associated/form-associated\";\nimport { FoundationElement } from \"../foundation-element\";\nclass _Checkbox extends FoundationElement {\n}\n/**\n * A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.\n *\n * @internal\n */\nexport class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {\n    constructor() {\n        super(...arguments);\n        this.proxy = document.createElement(\"input\");\n    }\n}\n","import { __decorate } from \"tslib\";\nimport { attr, observable } from \"@microsoft/fast-element\";\nimport { keySpace } from \"@microsoft/fast-web-utilities\";\nimport { FormAssociatedCheckbox } from \"./checkbox.form-associated\";\n/**\n * A Checkbox Custom HTML Element.\n * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.\n *\n * @public\n */\nexport class Checkbox extends FormAssociatedCheckbox {\n    constructor() {\n        super();\n        /**\n         * The element's value to be included in form submission when checked.\n         * Default to \"on\" to reach parity with input[type=\"checkbox\"]\n         *\n         * @internal\n         */\n        this.initialValue = \"on\";\n        /**\n         * The indeterminate state of the control\n         */\n        this.indeterminate = false;\n        /**\n         * @internal\n         */\n        this.keypressHandler = (e) => {\n            switch (e.key) {\n                case keySpace:\n                    this.checked = !this.checked;\n                    break;\n            }\n        };\n        /**\n         * @internal\n         */\n        this.clickHandler = (e) => {\n            if (!this.disabled && !this.readOnly) {\n                this.checked = !this.checked;\n            }\n        };\n        this.proxy.setAttribute(\"type\", \"checkbox\");\n    }\n    readOnlyChanged() {\n        if (this.proxy instanceof HTMLInputElement) {\n            this.proxy.readOnly = this.readOnly;\n        }\n    }\n}\n__decorate([\n    attr({ attribute: \"readonly\", mode: \"boolean\" })\n], Checkbox.prototype, \"readOnly\", void 0);\n__decorate([\n    observable\n], Checkbox.prototype, \"defaultSlottedNodes\", void 0);\n__decorate([\n    observable\n], Checkbox.prototype, \"indeterminate\", void 0);\n","import { ElementStyles, } from \"@microsoft/fast-element\";\nimport { DI, Registration } from \"../di/di\";\nfunction presentationKeyFromTag(tagName) {\n    return `${tagName.toLowerCase()}:presentation`;\n}\nconst presentationRegistry = new Map();\n/**\n * An API gateway to component presentation features.\n * @public\n */\nexport const ComponentPresentation = Object.freeze({\n    /**\n     * Defines a component presentation for an element.\n     * @param tagName - The element name to define the presentation for.\n     * @param presentation - The presentation that will be applied to matching elements.\n     * @param container - The dependency injection container to register the configuration in.\n     * @public\n     */\n    define(tagName, presentation, container) {\n        const key = presentationKeyFromTag(tagName);\n        const existing = presentationRegistry.get(key);\n        if (existing === void 0) {\n            presentationRegistry.set(key, presentation);\n        }\n        else {\n            // false indicates that we have more than one presentation\n            // registered for a tagName and we must resolve through DI\n            presentationRegistry.set(key, false);\n        }\n        container.register(Registration.instance(key, presentation));\n    },\n    /**\n     * Finds a component presentation for the specified element name,\n     * searching the DOM hierarchy starting from the provided element.\n     * @param tagName - The name of the element to locate the presentation for.\n     * @param element - The element to begin the search from.\n     * @returns The component presentation or null if none is found.\n     * @public\n     */\n    forTag(tagName, element) {\n        const key = presentationKeyFromTag(tagName);\n        const existing = presentationRegistry.get(key);\n        if (existing === false) {\n            const container = DI.findResponsibleContainer(element);\n            return container.get(key);\n        }\n        return existing || null;\n    },\n});\n/**\n * The default implementation of ComponentPresentation, used by FoundationElement.\n * @public\n */\nexport class DefaultComponentPresentation {\n    /**\n     * Creates an instance of DefaultComponentPresentation.\n     * @param template - The template to apply to the element.\n     * @param styles - The styles to apply to the element.\n     * @public\n     */\n    constructor(template, styles) {\n        this.template = template || null;\n        this.styles =\n            styles === void 0\n                ? null\n                : Array.isArray(styles)\n                    ? ElementStyles.create(styles)\n                    : styles instanceof ElementStyles\n                        ? styles\n                        : ElementStyles.create([styles]);\n    }\n    /**\n     * Applies the presentation details to the specified element.\n     * @param element - The element to apply the presentation details to.\n     * @public\n     */\n    applyTo(element) {\n        const controller = element.$fastController;\n        if (controller.template === null) {\n            controller.template = this.template;\n        }\n        if (controller.styles === null) {\n            controller.styles = this.styles;\n        }\n    }\n}\n","import { html, slotted } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.\n * @public\n */\nexport const checkboxTemplate = (context, definition) => html `\n    <template\n        role=\"checkbox\"\n        aria-checked=\"${x => x.checked}\"\n        aria-required=\"${x => x.required}\"\n        aria-disabled=\"${x => x.disabled}\"\n        aria-readonly=\"${x => x.readOnly}\"\n        tabindex=\"${x => (x.disabled ? null : 0)}\"\n        @keypress=\"${(x, c) => x.keypressHandler(c.event)}\"\n        @click=\"${(x, c) => x.clickHandler(c.event)}\"\n        class=\"${x => (x.readOnly ? \"readonly\" : \"\")} ${x => x.checked ? \"checked\" : \"\"} ${x => (x.indeterminate ? \"indeterminate\" : \"\")}\"\n    >\n        <div part=\"control\" class=\"control\">\n            <slot name=\"checked-indicator\">\n                ${definition.checkedIndicator || \"\"}\n            </slot>\n            <slot name=\"indeterminate-indicator\">\n                ${definition.indeterminateIndicator || \"\"}\n            </slot>\n        </div>\n        <label\n            part=\"label\"\n            class=\"${x => x.defaultSlottedNodes && x.defaultSlottedNodes.length\n    ? \"label\"\n    : \"label label__hidden\"}\"\n        >\n            <slot ${slotted(\"defaultSlottedNodes\")}></slot>\n        </label>\n    </template>\n`;\n","import { FoundationElement } from \"../foundation-element\";\n/**\n * An Card Custom HTML Element.\n *\n * @public\n */\nexport class Card extends FoundationElement {\n}\n","import { html } from \"@microsoft/fast-element\";\n/**\n * The template for the {@link @microsoft/fast-foundation#Card} component.\n * @public\n */\nexport const cardTemplate = (context, definition) => html `\n    <slot></slot>\n`;\n","import { FASTElementDefinition } from \"@microsoft/fast-element\";\nimport { FoundationElement } from \"../foundation-element/foundation-element\";\nimport { DI, Registration } from \"../di/di\";\nimport { DesignToken } from \"../design-token/design-token\";\nimport { ComponentPresentation } from \"./component-presentation\";\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/**\n * Indicates what to do with an ambiguous (duplicate) element.\n * @public\n */\nexport const ElementDisambiguation = Object.freeze({\n    /**\n     * Skip defining the element but still call the provided callback passed\n     * to DesignSystemRegistrationContext.tryDefineElement\n     */\n    definitionCallbackOnly: null,\n    /**\n     * Ignore the duplicate element entirely.\n     */\n    ignoreDuplicate: Symbol(),\n});\nconst elementTypesByTag = new Map();\nconst elementTagsByType = new Map();\nlet rootDesignSystem = null;\nconst designSystemKey = DI.createInterface(x => x.cachedCallback(handler => {\n    if (rootDesignSystem === null) {\n        rootDesignSystem = new DefaultDesignSystem(null, handler);\n    }\n    return rootDesignSystem;\n}));\n/**\n * An API gateway to design system features.\n * @public\n */\nexport const DesignSystem = Object.freeze({\n    /**\n     * Returns the HTML element name that the type is defined as.\n     * @param type - The type to lookup.\n     * @public\n     */\n    tagFor(type) {\n        return elementTagsByType.get(type);\n    },\n    /**\n     * Searches the DOM hierarchy for the design system that is responsible\n     * for the provided element.\n     * @param element - The element to locate the design system for.\n     * @returns The located design system.\n     * @public\n     */\n    responsibleFor(element) {\n        const owned = element.$$designSystem$$;\n        if (owned) {\n            return owned;\n        }\n        const container = DI.findResponsibleContainer(element);\n        return container.get(designSystemKey);\n    },\n    /**\n     * Gets the DesignSystem if one is explicitly defined on the provided element;\n     * otherwise creates a design system defined directly on the element.\n     * @param element - The element to get or create a design system for.\n     * @returns The design system.\n     * @public\n     */\n    getOrCreate(node) {\n        if (!node) {\n            if (rootDesignSystem === null) {\n                rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey);\n            }\n            return rootDesignSystem;\n        }\n        const owned = node.$$designSystem$$;\n        if (owned) {\n            return owned;\n        }\n        const container = DI.getOrCreateDOMContainer(node);\n        if (container.has(designSystemKey, false)) {\n            return container.get(designSystemKey);\n        }\n        else {\n            const system = new DefaultDesignSystem(node, container);\n            container.register(Registration.instance(designSystemKey, system));\n            return system;\n        }\n    },\n});\nfunction extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) {\n    if (typeof params === \"string\") {\n        return {\n            name: params,\n            type: elementDefinitionType,\n            callback: elementDefinitionCallback,\n        };\n    }\n    else {\n        return params;\n    }\n}\nclass DefaultDesignSystem {\n    constructor(owner, container) {\n        this.owner = owner;\n        this.container = container;\n        this.designTokensInitialized = false;\n        this.prefix = \"fast\";\n        this.shadowRootMode = undefined;\n        this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly;\n        if (owner !== null) {\n            owner.$$designSystem$$ = this;\n        }\n    }\n    withPrefix(prefix) {\n        this.prefix = prefix;\n        return this;\n    }\n    withShadowRootMode(mode) {\n        this.shadowRootMode = mode;\n        return this;\n    }\n    withElementDisambiguation(callback) {\n        this.disambiguate = callback;\n        return this;\n    }\n    withDesignTokenRoot(root) {\n        this.designTokenRoot = root;\n        return this;\n    }\n    register(...registrations) {\n        const container = this.container;\n        const elementDefinitionEntries = [];\n        const disambiguate = this.disambiguate;\n        const shadowRootMode = this.shadowRootMode;\n        const context = {\n            elementPrefix: this.prefix,\n            tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) {\n                const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback);\n                const { name, callback, baseClass } = extractedParams;\n                let { type } = extractedParams;\n                let elementName = name;\n                let typeFoundByName = elementTypesByTag.get(elementName);\n                let needsDefine = true;\n                while (typeFoundByName) {\n                    const result = disambiguate(elementName, type, typeFoundByName);\n                    switch (result) {\n                        case ElementDisambiguation.ignoreDuplicate:\n                            return;\n                        case ElementDisambiguation.definitionCallbackOnly:\n                            needsDefine = false;\n                            typeFoundByName = void 0;\n                            break;\n                        default:\n                            elementName = result;\n                            typeFoundByName = elementTypesByTag.get(elementName);\n                            break;\n                    }\n                }\n                if (needsDefine) {\n                    if (elementTagsByType.has(type) || type === FoundationElement) {\n                        type = class extends type {\n                        };\n                    }\n                    elementTypesByTag.set(elementName, type);\n                    elementTagsByType.set(type, elementName);\n                    if (baseClass) {\n                        elementTagsByType.set(baseClass, elementName);\n                    }\n                }\n                elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine));\n            },\n        };\n        if (!this.designTokensInitialized) {\n            this.designTokensInitialized = true;\n            if (this.designTokenRoot !== null) {\n                DesignToken.registerRoot(this.designTokenRoot);\n            }\n        }\n        container.registerWithContext(context, ...registrations);\n        for (const entry of elementDefinitionEntries) {\n            entry.callback(entry);\n            if (entry.willDefine && entry.definition !== null) {\n                entry.definition.define();\n            }\n        }\n        return this;\n    }\n}\nclass ElementDefinitionEntry {\n    constructor(container, name, type, shadowRootMode, callback, willDefine) {\n        this.container = container;\n        this.name = name;\n        this.type = type;\n        this.shadowRootMode = shadowRootMode;\n        this.callback = callback;\n        this.willDefine = willDefine;\n        this.definition = null;\n    }\n    definePresentation(presentation) {\n        ComponentPresentation.define(this.name, presentation, this.container);\n    }\n    defineElement(definition) {\n        this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name }));\n    }\n    tagFor(type) {\n        return DesignSystem.tagFor(type);\n    }\n}\n/* eslint-enable @typescript-eslint/no-non-null-assertion */\n"],"sourceRoot":""}