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KG,MAAQH,KAAKE,cAChBU,QAAUc,IAAWF,EAAMG,SAAUD,KACrCZ,KAAM,IACT,CAeAc,MAAAA,CAAQC,EAAeC,GAWtB,YAVKC,IAAcD,IAClBA,GAAU9B,KAAKqB,SAAUQ,IAGrBC,EACJ9B,KAAKuB,IAAKM,GAEV7B,KAAKyB,OAAQI,GAGPC,CACR,CAaAE,OAAAA,CAASH,EAAeI,GACvB,QAAOjC,KAAKqB,SAAUQ,KAItB7B,KAAKyB,OAAQI,GACb7B,KAAKuB,IAAKU,IAEH,EACR,CAcAC,QAAAA,CAAUC,GACT,OAAO,CACR,G","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","../../packages/token-list/src/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * A set of tokens.\n *\n * @see https://dom.spec.whatwg.org/#domtokenlist\n */\nexport default class TokenList {\n\tprivate _currentValue: string;\n\tprivate _valueAsArray: string[];\n\n\t/**\n\t * Constructs a new instance of TokenList.\n\t *\n\t * @param initialValue Initial value to assign.\n\t */\n\tconstructor( initialValue: string = '' ) {\n\t\tthis._currentValue = '';\n\t\tthis._valueAsArray = [];\n\t\tthis.value = initialValue;\n\t}\n\n\tentries( ...args: Parameters< Array< string >[ 'entries' ] > ) {\n\t\treturn this._valueAsArray.entries( ...args );\n\t}\n\n\tforEach( ...args: Parameters< Array< string >[ 'forEach' ] > ) {\n\t\treturn this._valueAsArray.forEach( ...args );\n\t}\n\n\tkeys( ...args: Parameters< Array< string >[ 'keys' ] > ) {\n\t\treturn this._valueAsArray.keys( ...args );\n\t}\n\n\tvalues( ...args: Parameters< Array< string >[ 'values' ] > ) {\n\t\treturn this._valueAsArray.values( ...args );\n\t}\n\n\t/**\n\t * Returns the associated set as string.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-value\n\t *\n\t * @return Token set as string.\n\t */\n\tget value(): string {\n\t\treturn this._currentValue;\n\t}\n\n\t/**\n\t * Replaces the associated set with a new string value.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-value\n\t *\n\t * @param value New token set as string.\n\t */\n\tset value( value: string ) {\n\t\tvalue = String( value );\n\t\tthis._valueAsArray = [\n\t\t\t...new Set( value.split( /\\s+/g ).filter( Boolean ) ),\n\t\t];\n\t\tthis._currentValue = this._valueAsArray.join( ' ' );\n\t}\n\n\t/**\n\t * Returns the number of tokens.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-length\n\t *\n\t * @return Number of tokens.\n\t */\n\tget length(): number {\n\t\treturn this._valueAsArray.length;\n\t}\n\n\t/**\n\t * Returns the stringified form of the TokenList.\n\t *\n\t * @see https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior\n\t * @see https://www.ecma-international.org/ecma-262/9.0/index.html#sec-tostring\n\t *\n\t * @return Token set as string.\n\t */\n\ttoString(): string {\n\t\treturn this.value;\n\t}\n\n\t/**\n\t * Returns an iterator for the TokenList, iterating items of the set.\n\t *\n\t * @see https://dom.spec.whatwg.org/#domtokenlist\n\t *\n\t * @return TokenList iterator.\n\t */\n\t*[ Symbol.iterator ](): IterableIterator< string > {\n\t\treturn yield* this._valueAsArray;\n\t}\n\n\t/**\n\t * Returns the token with index `index`.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-item\n\t *\n\t * @param index Index at which to return token.\n\t *\n\t * @return Token at index.\n\t */\n\titem( index: number ): string | undefined {\n\t\treturn this._valueAsArray[ index ];\n\t}\n\n\t/**\n\t * Returns true if `token` is present, and false otherwise.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-contains\n\t *\n\t * @param item Token to test.\n\t *\n\t * @return Whether token is present.\n\t */\n\tcontains( item: string ): boolean {\n\t\treturn this._valueAsArray.indexOf( item ) !== -1;\n\t}\n\n\t/**\n\t * Adds all arguments passed, except those already present.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-add\n\t *\n\t * @param items Items to add.\n\t */\n\tadd( ...items: string[] ): void {\n\t\tthis.value += ' ' + items.join( ' ' );\n\t}\n\n\t/**\n\t * Removes arguments passed, if they are present.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-remove\n\t *\n\t * @param items Items to remove.\n\t */\n\tremove( ...items: string[] ): void {\n\t\tthis.value = this._valueAsArray\n\t\t\t.filter( ( val ) => ! items.includes( val ) )\n\t\t\t.join( ' ' );\n\t}\n\n\t/**\n\t * If `force` is not given, \"toggles\" `token`, removing it if it’s present\n\t * and adding it if it’s not present. If `force` is true, adds token (same\n\t * as add()). If force is false, removes token (same as remove()). Returns\n\t * true if `token` is now present, and false otherwise.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-toggle\n\t *\n\t * @param token Token to toggle.\n\t * @param [force] Presence to force.\n\t *\n\t * @return Whether token is present after toggle.\n\t */\n\ttoggle( token: string, force?: boolean ): boolean {\n\t\tif ( undefined === force ) {\n\t\t\tforce = ! this.contains( token );\n\t\t}\n\n\t\tif ( force ) {\n\t\t\tthis.add( token );\n\t\t} else {\n\t\t\tthis.remove( token );\n\t\t}\n\n\t\treturn force;\n\t}\n\n\t/**\n\t * Replaces `token` with `newToken`. Returns true if `token` was replaced\n\t * with `newToken`, and false otherwise.\n\t *\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-replace\n\t *\n\t * @param token Token to replace with `newToken`.\n\t * @param newToken Token to use in place of `token`.\n\t *\n\t * @return Whether replacement occurred.\n\t */\n\treplace( token: string, newToken: string ): boolean {\n\t\tif ( ! this.contains( token ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.remove( token );\n\t\tthis.add( newToken );\n\n\t\treturn true;\n\t}\n\n\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\t/**\n\t * Returns true if `token` is in the associated attribute’s supported\n\t * tokens. Returns false otherwise.\n\t *\n\t * Always returns `true` in this implementation.\n\t *\n\t * @param _token\n\t * @see https://dom.spec.whatwg.org/#dom-domtokenlist-supports\n\t *\n\t * @return Whether token is supported.\n\t */\n\tsupports( _token: string ): boolean {\n\t\treturn true;\n\t}\n\t/* eslint-enable @typescript-eslint/no-unused-vars */\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","TokenList","constructor","initialValue","this","_currentValue","_valueAsArray","value","entries","args","forEach","keys","values","String","Set","split","filter","Boolean","join","length","toString","Symbol","iterator","item","index","contains","indexOf","add","items","remove","val","includes","toggle","token","force","undefined","replace","newToken","supports","_token"],"sourceRoot":""}