File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@material/list/dist/mdc.list.js.map
{"version":3,"sources":["webpack://mdc.[name]/webpack/universalModuleDefinition","webpack://mdc.[name]/webpack/bootstrap","webpack://mdc.[name]/./node_modules/process/browser.js","webpack://mdc.[name]/./node_modules/safevalues/builders/attribute_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/inert_fragment.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/no_clobber.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/resource_url_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/script_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/sensitive_attributes.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_sheet_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/url_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/anchor.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/area.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/button.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/element.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/embed.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/form.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/iframe.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/input.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/link.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/object.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/script.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/style.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/document.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/dom_parser.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/global.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/location.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/range.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/service_worker_container.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/window.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/worker.js","webpack://mdc.[name]/./node_modules/safevalues/dom/index.js","webpack://mdc.[name]/./node_modules/safevalues/environment/dev.js","webpack://mdc.[name]/./node_modules/safevalues/index.js","webpack://mdc.[name]/./node_modules/safevalues/internals/attribute_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/html_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/resource_url_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/script_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/secrets.js","webpack://mdc.[name]/./node_modules/safevalues/internals/string_literal.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_sheet_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/trusted_types.js","webpack://mdc.[name]/./packages/mdc-base/component.ts","webpack://mdc.[name]/./packages/mdc-base/foundation.ts","webpack://mdc.[name]/./packages/mdc-dom/keyboard.ts","webpack://mdc.[name]/./packages/mdc-dom/ponyfill.ts","webpack://mdc.[name]/./packages/mdc-list/adapter.ts","webpack://mdc.[name]/./packages/mdc-list/component.ts","webpack://mdc.[name]/./packages/mdc-list/constants.ts","webpack://mdc.[name]/./packages/mdc-list/events.ts","webpack://mdc.[name]/./packages/mdc-list/foundation.ts","webpack://mdc.[name]/./packages/mdc-list/index.ts","webpack://mdc.[name]/./packages/mdc-list/typeahead.ts","webpack://mdc.[name]/./packages/mdc-list/types.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLzB;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,6BAA6B,mBAAO,CAAC,0FAAwB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,wCAAwC;AACxC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,gFAAwB;AAClD,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,4BAA4B;AAC5B,4BAA4B;AAC5B,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,2EAAuB;AAC/B,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,sBAAsB,mBAAO,CAAC,6EAAkB;AAChD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,mBAAmB,mBAAO,CAAC,qFAAc;AACzC,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAqC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,2BAA2B;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA,aAAa,EAEJ;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,8BAA8B,sGAAsG,EAAE;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,8CAA8C;AACvE;AACA;;;;;;;;;;;;;ACvQa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,wBAAwB;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA,4DAA4D,UAAU;AACtE;AACA;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gFAAgF;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6DAA6D;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAA6D;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,qFAA4B;AACpD,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/Ba;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,wBAAwB,mBAAO,CAAC,+GAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8EAA8E;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAA8E;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjPa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8FAA8F;;;;;;;;;;;;;ACnDlF;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,IAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B;AACpE;AACA;AACA;;;;;;;;;;;;;ACzNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,QAAQ,IAAqC;AAC7C,yCAAyC,iBAAiB,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,iDAAiD,qCAAqC,EAAE;AACxF;AACA;AACA;AACA;;;;;;;;;;;;;AC1Fa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,mBAAmB,mBAAO,CAAC,kFAAyB;AACpD;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,MAAM;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,yCAAyC;AACzC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA,eAAe;AACf,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,yBAAyB,mBAAO,CAAC,8FAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,2DAA2D;AAC3D;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvEa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAO,CAAC,6FAAgC;AAC/D,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,mBAAmB,mBAAO,CAAC,qFAA4B;AACvD;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iCAAiC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD,EAAE;AAC3G;AACA,qCAAqC,mCAAmC,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpIa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACda;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,yBAAyB,mBAAO,CAAC,iGAAkC;AACnE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,uBAAuB,qBAAqB,eAAe,eAAe;AAC1E,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,wBAAwB,oBAAoB,eAAe,eAAe;AAC1E,UAAU,UAAU;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB,eAAe;AAC/D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB,eAAe;AAC7D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,eAAe,kBAAkB,eAAe,aAAa;AAC7D,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,uFAAuF,wDAAwD,EAAE;AACjJ;AACA;;;;;;;;;;;;;AC5Da;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC,aAAa,EAAE;AACjE;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,yCAAyC,6BAA6B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAO,CAAC,2EAAmB;AAC/D,kCAAkC,mBAAO,CAAC,uEAAiB;AAC3D,oCAAoC,mBAAO,CAAC,2EAAmB;AAC/D,mCAAmC,mBAAO,CAAC,6EAAoB;AAC/D,mCAAmC,mBAAO,CAAC,yEAAkB;AAC7D,kCAAkC,mBAAO,CAAC,uEAAiB;AAC3D,oCAAoC,mBAAO,CAAC,2EAAmB;AAC/D,mCAAmC,mBAA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AAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,gIAAgI,EAAE;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ea;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,oIAAoI,EAAE;AAC5K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,UAAU,EAAE;AAC1D,gDAAgD,UAAU,EAAE;AAC5D,mDAAmD,UAAU;AAC7D,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;ACnDG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAA0C;AAC1C,gCAA2C;AAE3C,uCAA2C;AAG3C,SAAoB,YAAY;AACiB;AAC/C,kBAAkB,KAAQ,QAAa,cAAE,UAAE,GAAO;AAAK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O,WAAO;AAE1D,QAAkB,gBAAE;AAClB,iBAAmB,oBAAQ;AAC3B,YAAmB;AACD;AACA;AACR,sBAAO,MAAI,IAAc;AACX;AACb,uBAAO;AACK,mCACrB;AAP4C;AAQ9C,eAAgB,UAAc,eAAS;AACxC;AAED,QAAI,CAAQ,SAAE;AACZ,eAAO,CAAG;AACX;AAED,QAAoB,kBAAE;AACpB,iBAAmB,oBAAQ;AAC5B;AAED,QAAyB,sBAAmB,oBAAsB,mBAAQ;AAE1E,QAAuB,qBAAE;AACvB,YAAmB;AACD;AACA;AACR,sBAAK;AACS;AACb,uBAAO;AACK,mCACrB;AAP4C;AAQqB;AACnE,eAAgB,UAAc,eAAS;AACxC;AAED,WAAO,CACT;AAAC;AA/DD,wBA+DC,c;;;;;;;;;;;;;AC7WE","file":"mdc.list.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@material/list\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"list\"] = factory();\n\telse\n\t\troot[\"mdc\"] = root[\"mdc\"] || {}, root[\"mdc\"][\"list\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/mdc-list/index.ts\");\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeAttrPrefix = void 0;\nrequire(\"../environment/dev\");\nvar attribute_impl_1 = require(\"../internals/attribute_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar sensitive_attributes_1 = require(\"./sensitive_attributes\");\n/**\n * Creates a SafeAttributePrefix object from a template literal with no\n * interpolations for attributes that share a common prefix guaranteed to be not\n * security sensitive.\n *\n * The template literal is a prefix that makes it obvious this attribute is not\n * security sensitive. If it doesn't, this function will throw.\n */\nfunction safeAttrPrefix(templ) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templ, true, 'safeAttr is a template literal tag function ' +\n 'and should be called using the tagged template syntax. ' +\n 'For example, safeAttr`foo`;');\n }\n var attrPrefix = templ[0].toLowerCase();\n if (process.env.NODE_ENV !== 'production') {\n if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) {\n throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n \"to be safe as it is also a prefix for event handler attributes\" +\n \"Please use 'addEventListener' to set event handlers.\");\n }\n sensitive_attributes_1.SECURITY_SENSITIVE_ATTRIBUTES.forEach(function (sensitiveAttr) {\n if (sensitiveAttr.indexOf(attrPrefix) === 0) {\n throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n \"to be safe as it is also a prefix for \" +\n \"the security sensitive attribute '\".concat(sensitiveAttr, \"'. \") +\n \"Please use native or safe DOM APIs to set the attribute.\");\n }\n });\n }\n return (0, attribute_impl_1.createAttributePrefix)(attrPrefix);\n}\nexports.safeAttrPrefix = safeAttrPrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatHtmls = exports.createScriptSrc = exports.createScript = exports.htmlEscape = void 0;\nvar html_impl_1 = require(\"../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\n/**\n * Returns HTML-escaped text as a `SafeHtml` object.\n *\n * Available options:\n * - `preserveSpaces` turns every second consecutive space character into its\n * HTML entity representation (` `).\n * - `preserveNewlines` turns newline characters into breaks (`<br>`).\n * - `preserveTabs` wraps tab characters in a span with style=white-space:pre.\n */\nfunction htmlEscape(text, options) {\n if (options === void 0) { options = {}; }\n var htmlEscapedString = htmlEscapeToString(text);\n if (options.preserveSpaces) {\n // Do this first to ensure we preserve spaces after newlines and tabs.\n htmlEscapedString =\n htmlEscapedString.replace(/(^|[\\r\\n\\t ]) /g, '$1 ');\n }\n if (options.preserveNewlines) {\n htmlEscapedString = htmlEscapedString.replace(/(\\r\\n|\\n|\\r)/g, '<br>');\n }\n if (options.preserveTabs) {\n htmlEscapedString = htmlEscapedString.replace(/(\\t+)/g, '<span style=\"white-space:pre\">$1</span>');\n }\n return (0, html_impl_1.createHtml)(htmlEscapedString);\n}\nexports.htmlEscape = htmlEscape;\n/**\n * Creates a `SafeHtml` representing a script tag with inline script content.\n */\nfunction createScript(script, options) {\n if (options === void 0) { options = {}; }\n var unwrappedScript = (0, script_impl_1.unwrapScript)(script).toString();\n var stringTag = \"<script\";\n if (options.id) {\n stringTag += \" id=\\\"\".concat(htmlEscapeToString(options.id), \"\\\"\");\n }\n if (options.nonce) {\n stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(options.nonce), \"\\\"\");\n }\n if (options.type) {\n stringTag += \" type=\\\"\".concat(htmlEscapeToString(options.type), \"\\\"\");\n }\n stringTag += \">\".concat(unwrappedScript, \"</script>\");\n return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScript = createScript;\n/**\n * Creates a `SafeHtml` representing a script tag with the src attribute.\n * This also supports CSP nonces and async loading.\n */\nfunction createScriptSrc(src, async, nonce) {\n var unwrappedSrc = (0, resource_url_impl_1.unwrapResourceUrl)(src).toString();\n var stringTag = \"<script src=\\\"\".concat(htmlEscapeToString(unwrappedSrc), \"\\\"\");\n if (async) {\n stringTag += ' async';\n }\n if (nonce) {\n stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(nonce), \"\\\"\");\n }\n stringTag += '>\\x3c/script>';\n return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScriptSrc = createScriptSrc;\n/**\n * HTML-escapes the given text (`&`, `<`, `>`, `\"` and `'`).\n */\nfunction htmlEscapeToString(text) {\n var escaped = text.replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n return escaped;\n}\n/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */\nfunction concatHtmls(htmls) {\n return (0, html_impl_1.createHtml)(htmls.map(html_impl_1.unwrapHtml).join(''));\n}\nexports.concatHtmls = concatHtmls;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.HtmlSanitizerImpl = void 0;\nrequire(\"../../environment/dev\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/* g3_import_pure from '../../internals/pure' */\nvar secrets_1 = require(\"../../internals/secrets\");\nvar url_sanitizer_1 = require(\"../url_sanitizer\");\nvar inert_fragment_1 = require(\"./inert_fragment\");\nvar no_clobber_1 = require(\"./no_clobber\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** Implementation for `HtmlSanitizer` */\nvar HtmlSanitizerImpl = /** @class */ (function () {\n function HtmlSanitizerImpl(sanitizerTable, token) {\n this.sanitizerTable = sanitizerTable;\n this.changes = [];\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n HtmlSanitizerImpl.prototype.sanitizeAssertUnchanged = function (html) {\n this.changes = [];\n var sanitizedHtml = this.sanitize(html);\n if (this.changes.length !== 0) {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message =\n \"Unexpected change to HTML value as a result of sanitization. \" +\n \"Input: \\\"\".concat(html, \"\\\", sanitized output: \\\"\").concat(sanitizedHtml, \"\\\"\\n\") +\n \"List of changes:\".concat(this.changes.join('\\n'));\n }\n throw new Error(message);\n }\n return sanitizedHtml;\n };\n HtmlSanitizerImpl.prototype.sanitize = function (html) {\n var fakeRoot = document.createElement('span');\n fakeRoot.appendChild(this.sanitizeToFragment(html));\n // XML serialization is preferred over HTML serialization as it is\n // stricter and makes sure all attributes are properly escaped, avoiding\n // cases where the tree might mutate when parsed again later due to the\n // complexities of the HTML parsing algorithm\n var serializedNewTree = new XMLSerializer().serializeToString(fakeRoot);\n // We remove the outer most element as this is the span node created as\n // the root for the sanitized tree and contains a spurious xmlns attribute\n // from the XML serialization step.\n serializedNewTree = serializedNewTree.slice(serializedNewTree.indexOf('>') + 1, serializedNewTree.lastIndexOf('</'));\n return (0, html_impl_1.createHtml)(serializedNewTree);\n };\n HtmlSanitizerImpl.prototype.sanitizeToFragment = function (html) {\n var _this = this;\n var dirtyFragment = (0, inert_fragment_1.createInertFragment)(html);\n var treeWalker = document.createTreeWalker(dirtyFragment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, \n // IE10 and IE11 won't accept a proper `NodeFilter` interface, and\n // expect the filtering function to be passed directly. It seems that\n // other browsers also do not mind getting the function directly. see\n // https://stackoverflow.com/q/38245898\n (function (n) { return _this.nodeFilter(n); }), \n // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4.\n false);\n // `nextNode` is called so we skip the root `DocumentFragment`.\n var currentNode = treeWalker.nextNode();\n // We create a root element to attach all the children of the body to. We\n // use div as it as a semantic-free, generic container and does not\n // represent anything. This is removed when we serialize the tree back\n // into a string.\n var sanitizedFragment = document.createDocumentFragment();\n var sanitizedParent = sanitizedFragment;\n while (currentNode !== null) {\n var sanitizedNode = void 0;\n if ((0, no_clobber_1.isText)(currentNode)) {\n sanitizedNode = this.sanitizeTextNode(currentNode);\n }\n else if ((0, no_clobber_1.isElement)(currentNode)) {\n sanitizedNode = this.sanitizeElementNode(currentNode);\n }\n else {\n throw new Error('Node is not of type text or element');\n }\n sanitizedParent.appendChild(sanitizedNode);\n // Advance iterator while keeping track of the sanitized parent for the\n // current node\n currentNode = treeWalker.firstChild();\n if (currentNode) {\n sanitizedParent = sanitizedNode;\n }\n else {\n while (!(currentNode = treeWalker.nextSibling())) {\n if (!(currentNode = treeWalker.parentNode())) {\n break;\n }\n sanitizedParent = sanitizedParent.parentNode;\n }\n }\n }\n return sanitizedFragment;\n };\n HtmlSanitizerImpl.prototype.sanitizeTextNode = function (textNode) {\n return document.createTextNode(textNode.data);\n };\n HtmlSanitizerImpl.prototype.sanitizeElementNode = function (elementNode) {\n var e_1, _a;\n var elementName = (0, no_clobber_1.getNodeName)(elementNode);\n var newNode = document.createElement(elementName);\n var dirtyAttributes = elementNode.attributes;\n try {\n for (var dirtyAttributes_1 = __values(dirtyAttributes), dirtyAttributes_1_1 = dirtyAttributes_1.next(); !dirtyAttributes_1_1.done; dirtyAttributes_1_1 = dirtyAttributes_1.next()) {\n var _b = dirtyAttributes_1_1.value, name_1 = _b.name, value = _b.value;\n var policy = this.sanitizerTable.getAttributePolicy(name_1, elementName);\n if (!this.satisfiesAllConditions(policy.conditions, dirtyAttributes)) {\n this.recordChange(\"Not all conditions satisfied for attribute: \".concat(name_1, \".\"));\n continue;\n }\n switch (policy.policyAction) {\n case sanitizer_table_1.AttributePolicyAction.KEEP:\n newNode.setAttribute(name_1, value);\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL:\n var sanitizedAttrUrl = (0, url_sanitizer_1.restrictivelySanitizeUrl)(value);\n if (sanitizedAttrUrl !== value) {\n this.recordChange(\"Url in attribute \".concat(name_1, \" was modified during sanitization. Original url:\\\"\").concat(value, \"\\\" was sanitized to: \\\"\").concat(sanitizedAttrUrl, \"\\\"\"));\n }\n newNode.setAttribute(name_1, sanitizedAttrUrl);\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE:\n // We don't consider changing the case of an attribute value to be a\n // semantic change\n newNode.setAttribute(name_1, value.toLowerCase());\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE:\n newNode.setAttribute(name_1, value);\n break;\n case sanitizer_table_1.AttributePolicyAction.DROP:\n this.recordChange(\"Attribute: \".concat(name_1, \" was dropped\"));\n break;\n default:\n checkExhaustive(policy.policyAction, 'Unhandled AttributePolicyAction case');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (dirtyAttributes_1_1 && !dirtyAttributes_1_1.done && (_a = dirtyAttributes_1.return)) _a.call(dirtyAttributes_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return newNode;\n };\n HtmlSanitizerImpl.prototype.nodeFilter = function (node) {\n if ((0, no_clobber_1.isText)(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n else if (!(0, no_clobber_1.isElement)(node)) {\n // Getting a node that is neither an `Element` or a `Text` node. This is\n // likely due to something that is not supposed to be an element in user\n // code but recognized as such by the TreeWalker (e.g. a polyfill for\n // other kind of nodes). Since we can't recognize it as an element, we\n // drop the node, but we don't record it as a meaningful change.\n return NodeFilter.FILTER_REJECT;\n }\n var nodeName = (0, no_clobber_1.getNodeName)(node);\n if (nodeName === null) {\n this.recordChange(\"Node name was null for node: \".concat(node));\n return NodeFilter.FILTER_REJECT;\n }\n if (this.sanitizerTable.isAllowedElement(nodeName)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n this.recordChange(\"Element: \".concat(nodeName, \" was dropped\"));\n return NodeFilter.FILTER_REJECT;\n };\n HtmlSanitizerImpl.prototype.recordChange = function (errorMessage) {\n if (process.env.NODE_ENV !== 'production') {\n this.changes.push(errorMessage);\n }\n else if (this.changes.length === 0) {\n this.changes.push('');\n }\n };\n HtmlSanitizerImpl.prototype.satisfiesAllConditions = function (conditions, attrs) {\n var e_2, _a;\n var _b;\n if (!conditions) {\n return true;\n }\n try {\n for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {\n var _c = __read(conditions_1_1.value, 2), attrName = _c[0], expectedValues = _c[1];\n var value = (_b = attrs.getNamedItem(attrName)) === null || _b === void 0 ? void 0 : _b.value;\n if (value && !expectedValues.has(value)) {\n return false;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return true;\n };\n return HtmlSanitizerImpl;\n}());\nexports.HtmlSanitizerImpl = HtmlSanitizerImpl;\nvar defaultHtmlSanitizer = \n/* #__PURE__ */ (function () { return new HtmlSanitizerImpl(default_sanitizer_table_1.defaultSanitizerTable, secrets_1.secretToken); })();\n/** Sanitizes untrusted html using the default sanitizer configuration. */\nfunction sanitizeHtml(html) {\n return defaultHtmlSanitizer.sanitize(html);\n}\nexports.sanitizeHtml = sanitizeHtml;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlAssertUnchanged(html) {\n return defaultHtmlSanitizer.sanitizeAssertUnchanged(html);\n}\nexports.sanitizeHtmlAssertUnchanged = sanitizeHtmlAssertUnchanged;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlToFragment(html) {\n return defaultHtmlSanitizer.sanitizeToFragment(html);\n}\nexports.sanitizeHtmlToFragment = sanitizeHtmlToFragment;\nfunction checkExhaustive(value, msg) {\n if (msg === void 0) { msg = \"unexpected value \".concat(value, \"!\"); }\n throw new Error(msg);\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HtmlSanitizerBuilder = void 0;\nvar secrets_1 = require(\"../../internals/secrets\");\nvar html_sanitizer_1 = require(\"./html_sanitizer\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** This class allows modifications to the default sanitizer configuration. */\nvar HtmlSanitizerBuilder = /** @class */ (function () {\n function HtmlSanitizerBuilder() {\n // To denote if the builder has called build() and therefore should make no\n // further changes to the sanitizer table.\n this.calledBuild = false;\n this.sanitizerTable = default_sanitizer_table_1.defaultSanitizerTable;\n }\n /** Builder option to restrict allowed elements to a smaller subset. */\n HtmlSanitizerBuilder.prototype.onlyAllowElements = function (elementSet) {\n var e_1, _a;\n var allowedElements = new Set();\n var allowedElementPolicies = new Map();\n try {\n for (var elementSet_1 = __values(elementSet), elementSet_1_1 = elementSet_1.next(); !elementSet_1_1.done; elementSet_1_1 = elementSet_1.next()) {\n var element = elementSet_1_1.value;\n element = element.toUpperCase();\n if (!this.sanitizerTable.isAllowedElement(element)) {\n throw new Error(\"Element: \".concat(element, \", is not allowed by html5_contract.textpb\"));\n }\n var elementPolicy = this.sanitizerTable.elementPolicies.get(element);\n if (elementPolicy !== undefined) {\n allowedElementPolicies.set(element, elementPolicy);\n }\n else {\n allowedElements.add(element);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (elementSet_1_1 && !elementSet_1_1.done && (_a = elementSet_1.return)) _a.call(elementSet_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(allowedElements, allowedElementPolicies, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n return this;\n };\n /**\n * Builder option to restrict allowed attributes to a smaller subset.\n *\n * If the attribute isn't currently allowed then it won't be added.\n */\n HtmlSanitizerBuilder.prototype.onlyAllowAttributes = function (attributeSet) {\n var e_2, _a, e_3, _b, e_4, _c;\n var allowedGlobalAttributes = new Set();\n var globalAttributePolicies = new Map();\n var elementPolicies = new Map();\n try {\n for (var attributeSet_1 = __values(attributeSet), attributeSet_1_1 = attributeSet_1.next(); !attributeSet_1_1.done; attributeSet_1_1 = attributeSet_1.next()) {\n var attribute = attributeSet_1_1.value;\n if (this.sanitizerTable.allowedGlobalAttributes.has(attribute)) {\n allowedGlobalAttributes.add(attribute);\n }\n if (this.sanitizerTable.globalAttributePolicies.has(attribute)) {\n globalAttributePolicies.set(attribute, this.sanitizerTable.globalAttributePolicies.get(attribute));\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (attributeSet_1_1 && !attributeSet_1_1.done && (_a = attributeSet_1.return)) _a.call(attributeSet_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _d = __values(this.sanitizerTable\n .elementPolicies.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read(_e.value, 2), elementName = _f[0], originalElementPolicy = _f[1];\n var newElementPolicy = new Map();\n try {\n for (var _g = (e_4 = void 0, __values(originalElementPolicy\n .entries())), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read(_h.value, 2), attribute = _j[0], attributePolicy = _j[1];\n if (attributeSet.has(attribute)) {\n newElementPolicy.set(attribute, attributePolicy);\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_c = _g.return)) _c.call(_g);\n }\n finally { if (e_4) throw e_4.error; }\n }\n elementPolicies.set(elementName, newElementPolicy);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_3) throw e_3.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Allows the set of data attributes passed.\n *\n * These values must be prefixed with \"data-\"\n *\n * If called with onlyAllowElements or onlyAllowAttributes, those methods must\n * be called first.\n */\n HtmlSanitizerBuilder.prototype.allowDataAttributes = function (attributes) {\n var e_5, _a;\n var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes);\n try {\n for (var attributes_1 = __values(attributes), attributes_1_1 = attributes_1.next(); !attributes_1_1.done; attributes_1_1 = attributes_1.next()) {\n var attribute = attributes_1_1.value;\n if (attribute.indexOf('data-') !== 0) {\n throw new Error(\"data attribute: \".concat(attribute, \" does not begin with the prefix \\\"data-\\\"\"));\n }\n allowedGlobalAttributes.add(attribute);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (attributes_1_1 && !attributes_1_1.done && (_a = attributes_1.return)) _a.call(attributes_1);\n }\n finally { if (e_5) throw e_5.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n return this;\n };\n /**\n * Preserves style attributes. Note that the sanitizer won't parse and\n * sanitize the values but keep them as they are. In particular this means\n * that the code will be able to call functions that could do undesirable\n * things (e.g. `url` to trigger a network request), as well as any custom\n * properties or functions defined by the application.\n */\n HtmlSanitizerBuilder.prototype.allowStyleAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('style', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Preserves the class attribute on all elements. This means contents can\n * adopt CSS styles from other page elements and possibly mask themselves as\n * legitimate UI elements, which can lead to phishing.\n */\n HtmlSanitizerBuilder.prototype.allowClassAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('class', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Preserves id attributes. This carries moderate risk as it allows an\n * element to override other elements with the same ID.\n */\n HtmlSanitizerBuilder.prototype.allowIdAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('id', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n HtmlSanitizerBuilder.prototype.build = function () {\n if (this.calledBuild) {\n throw new Error('this sanitizer has already called build');\n }\n this.calledBuild = true;\n return new html_sanitizer_1.HtmlSanitizerImpl(this.sanitizerTable, secrets_1.secretToken);\n };\n return HtmlSanitizerBuilder;\n}());\nexports.HtmlSanitizerBuilder = HtmlSanitizerBuilder;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInertFragment = void 0;\nvar element_1 = require(\"../../dom/elements/element\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * Returns a fragment that contains the parsed HTML for `dirtyHtml` without\n * executing any of the potential payload.\n */\nfunction createInertFragment(dirtyHtml) {\n var template = document.createElement('template');\n // This call is only used to create an inert tree for the sanitizer to\n // further process and is never returned directly to the caller. We can't use\n // a reviewed conversion in order to avoid an import loop.\n var temporarySafeHtml = (0, html_impl_1.createHtml)(dirtyHtml);\n (0, element_1.setInnerHtml)(template, temporarySafeHtml);\n return template.content;\n}\nexports.createInertFragment = createInertFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isElement = exports.isText = exports.getNodeName = void 0;\n/**\n * Library that provides safe getters for different node properties and\n * checks for clobbering.\n */\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n var nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return (typeof nodeName === 'string') ? nodeName : 'FORM';\n}\nexports.getNodeName = getNodeName;\n/** Returns true if the object passed is a Text node. */\nfunction isText(node) {\n // The property cannot get clobbered on Text nodes.\n return node.nodeType === Node.TEXT_NODE;\n}\nexports.isText = isText;\n/** Returns true if the object passed is an Element node. */\nfunction isElement(node) {\n var nodeType = node.nodeType;\n // If the property is clobbered, we can assume it is an `HTMLFormElement`, and\n // thus an `Element`.\n return (nodeType === Node.ELEMENT_NODE) || (typeof nodeType !== 'number');\n}\nexports.isElement = isElement;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultSanitizerTable = void 0;\nvar sanitizer_table_1 = require(\"./sanitizer_table\");\n/**\n * GENERATED CODE, DO NOT MODIFY\n * This SanitizerTable was generated from the checked in html contract:\n * webutil/html/types/codegen/html5_contract.textpb\n *\n * You can regenerate this file with:\n * webutil/html/types/codegen/update_generated_source_files.sh\n */\nexports.defaultSanitizerTable = new sanitizer_table_1.SanitizerTable(new Set([\n 'ARTICLE', 'SECTION', 'NAV', 'ASIDE', 'H1', 'H2',\n 'H3', 'H4', 'H5', 'H6', 'HEADER', 'FOOTER',\n 'ADDRESS', 'P', 'HR', 'PRE', 'BLOCKQUOTE', 'OL',\n 'UL', 'LH', 'LI', 'DL', 'DT', 'DD',\n 'FIGURE', 'FIGCAPTION', 'MAIN', 'DIV', 'EM', 'STRONG',\n 'SMALL', 'S', 'CITE', 'Q', 'DFN', 'ABBR',\n 'RUBY', 'RB', 'RT', 'RTC', 'RP', 'DATA',\n 'TIME', 'CODE', 'VAR', 'SAMP', 'KBD', 'SUB',\n 'SUP', 'I', 'B', 'U', 'MARK', 'BDI',\n 'BDO', 'SPAN', 'BR', 'WBR', 'INS', 'DEL',\n 'PICTURE', 'PARAM', 'TRACK', 'MAP', 'TABLE', 'CAPTION',\n 'COLGROUP', 'COL', 'TBODY', 'THEAD', 'TFOOT', 'TR',\n 'TD', 'TH', 'SELECT', 'DATALIST', 'OPTGROUP', 'OPTION',\n 'OUTPUT', 'PROGRESS', 'METER', 'FIELDSET', 'LEGEND', 'DETAILS',\n 'SUMMARY', 'MENU', 'DIALOG', 'SLOT', 'CANVAS', 'FONT',\n 'CENTER',\n]), new Map([\n [\n 'A', new Map([\n ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'AREA', new Map([\n ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'LINK', new Map([\n [\n 'href', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL,\n conditions: new Map([[\n 'rel', new Set([\n 'alternate',\n 'author',\n 'bookmark',\n 'canonical',\n 'cite',\n 'help',\n 'icon',\n 'license',\n 'next',\n 'prefetch',\n 'dns-prefetch',\n 'prerender',\n 'preconnect',\n 'preload',\n 'prev',\n 'search',\n 'subresource',\n ])\n ]])\n }\n ],\n ])\n ],\n [\n 'SOURCE', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'IMG', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'VIDEO', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'AUDIO', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n]), new Set([\n 'title',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-checked',\n 'aria-current',\n 'aria-disabled',\n 'aria-dropeffect',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-label',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'alt',\n 'align',\n 'autocapitalize',\n 'autocomplete',\n 'autocorrect',\n 'autofocus',\n 'autoplay',\n 'bgcolor',\n 'border',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'datetime',\n 'disabled',\n 'download',\n 'draggable',\n 'enctype',\n 'face',\n 'formenctype',\n 'frameborder',\n 'height',\n 'hreflang',\n 'hidden',\n 'ismap',\n 'label',\n 'lang',\n 'loop',\n 'max',\n 'maxlength',\n 'media',\n 'minlength',\n 'min',\n 'multiple',\n 'muted',\n 'nonce',\n 'open',\n 'placeholder',\n 'preload',\n 'rel',\n 'required',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'spellcheck',\n 'start',\n 'step',\n 'summary',\n 'translate',\n 'type',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'itemscope',\n 'itemtype',\n 'itemid',\n 'itemprop',\n 'itemref',\n]), new Map([\n [\n 'dir', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'dir', new Set([\n 'auto',\n 'ltr',\n 'rtl',\n ])\n ]])\n }\n ],\n [\n 'async', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'async', new Set([\n 'async',\n ])\n ]])\n }\n ],\n ['cite', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n [\n 'loading', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'loading', new Set([\n 'eager',\n 'lazy',\n ])\n ]])\n }\n ],\n ['poster', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n [\n 'target', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'target', new Set([\n '_self',\n '_blank',\n ])\n ]])\n }\n ],\n]));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AttributePolicyAction = exports.SanitizerTable = void 0;\n/** Class for holding element and attribute policies used for sanitization. */\nvar SanitizerTable = /** @class */ (function () {\n function SanitizerTable(allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies) {\n this.allowedElements = allowedElements;\n this.elementPolicies = elementPolicies;\n this.allowedGlobalAttributes = allowedGlobalAttributes;\n this.globalAttributePolicies = globalAttributePolicies;\n }\n SanitizerTable.prototype.isAllowedElement = function (elementName) {\n // Note: `HTMLFormElement`s are always dropped, supporting them is very\n // costly because of the DOM clobberring they can cause. The additional code\n // size required to properly work around DOM clobberring issues is large and\n // shouldn't be put on every user of the sanitizer. Thoroughly review\n // b/210975025 and the CLs linked there before you start allowing form\n // elements.\n return elementName.toLowerCase() !== 'form' &&\n (this.allowedElements.has(elementName) ||\n this.elementPolicies.has(elementName));\n };\n SanitizerTable.prototype.getAttributePolicy = function (attributeName, elementName) {\n var elementPolicy = this.elementPolicies.get(elementName);\n if (elementPolicy === null || elementPolicy === void 0 ? void 0 : elementPolicy.has(attributeName)) {\n return elementPolicy.get(attributeName);\n }\n if (this.allowedGlobalAttributes.has(attributeName)) {\n return { policyAction: AttributePolicyAction.KEEP };\n }\n var globalPolicy = this.globalAttributePolicies.get(attributeName);\n return globalPolicy || { policyAction: AttributePolicyAction.DROP };\n };\n return SanitizerTable;\n}());\nexports.SanitizerTable = SanitizerTable;\n/**\n * Values derived from\n * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy\n */\nvar AttributePolicyAction;\n(function (AttributePolicyAction) {\n AttributePolicyAction[AttributePolicyAction[\"DROP\"] = 0] = \"DROP\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP\"] = 1] = \"KEEP\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_URL\"] = 2] = \"KEEP_AND_SANITIZE_URL\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_NORMALIZE\"] = 3] = \"KEEP_AND_NORMALIZE\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_STYLE\"] = 4] = \"KEEP_AND_SANITIZE_STYLE\";\n})(AttributePolicyAction = exports.AttributePolicyAction || (exports.AttributePolicyAction = {}));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.blobUrlFromScript = exports.replaceFragment = exports.appendParams = exports.trustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Check whether the base url contains a valid origin,\n *\n * A string for an origin must contain only alphanumeric or any of the\n * following: `-.:`, and must not be an IP address. Remember that, as per the\n * documentation for TrustedResourceUrl, the origin must be trustworthy.\n *\n * @param base The base url that contains an origin.\n */\nfunction hasValidOrigin(base) {\n if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n return false;\n }\n var originStart = base.indexOf('//') + 2;\n var originEnd = base.indexOf('/', originStart);\n // If the base url only contains the prefix (e.g. //), or the slash\n // for the origin is right after the prefix (e.g. ///), the origin is\n // missing.\n if (originEnd <= originStart) {\n throw new Error(\"Can't interpolate data in a url's origin, \" +\n \"Please make sure to fully specify the origin, terminated with '/'.\");\n }\n var origin = base.substring(originStart, originEnd);\n if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n throw new Error('The origin contains unsupported characters.');\n }\n if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n throw new Error('Invalid port number.');\n }\n if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n throw new Error('The top-level domain must start with a letter.');\n }\n return true;\n}\n/**\n * Check whether the base url contains a valid about url at its beginning.\n *\n * An about url is either exactly 'about:blank' or 'about:blank#<str>' where\n * <str> can be an arbitrary string.\n *\n * @param base The base url.\n */\nfunction isValidAboutUrl(base) {\n if (!/^about:blank/.test(base)) {\n return false;\n }\n if (base !== 'about:blank' && !/^about:blank#/.test(base)) {\n throw new Error('The about url is invalid.');\n }\n return true;\n}\n/**\n * Check whether the base url contains a valid path start at its beginning.\n *\n * A valid path start is either a '/' or a '/' followed by at least one\n * character that is not '/' or '\\'.\n *\n * @param base The base url.\n */\nfunction isValidPathStart(base) {\n if (!/^\\//.test(base)) {\n return false;\n }\n if ((base === '/') ||\n (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')) {\n return true;\n }\n throw new Error('The path start in the url is invalid.');\n}\n/**\n * Builds TrustedResourceUrl from a template literal.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n * trustedResourceUrl`//example.com/${bar}`;\n * or\n * trustedResourceUrl`//example.com`;\n *\n * When this function is called with a template literal without any embedded\n * expressions, the template string may contain anything as the whole URL is\n * a compile-time string constant.\n *\n * When this function is called with a template literal that contains embedded\n * expressions, the template must start with one of the following:\n * - `https://<origin>/`\n * - `//<origin>/`\n * - `/<pathStart>`\n * - `about:blank`\n * - `data:`\n *\n * `<origin>` must contain only alphanumeric or any of the following: `-.:`.\n * Remember that, as per the documentation for TrustedResourceUrl, the origin\n * must be trustworthy. An origin of \"example.com\" could be set with this\n * method, but would tie the security of your site to the security of\n * example.com. Similarly, formats that potentially cover redirects hosted\n * on a trusted origin are problematic, since that could lead to untrusted\n * origins.\n *\n * `<pathStart>` is either an empty string, or a non empty string that does not\n * start with '/' or '\\'.\n * In other words, `/<pathStart>` is either a '/' or a\n * '/' followed by at least one character that is not '/' or '\\'.\n *\n * `data:` (data URL) does not allow embedded expressions in the template\n * literal input.\n *\n * All embedded expressions are URL encoded when they are interpolated. Do not\n * embed expressions that are already URL encoded as they will be double encoded\n * by the builder.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param rest This represents the template's embedded expressions.\n */\nfunction trustedResourceUrl(templateObj) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n // Check if templateObj is actually from a template literal.\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'trustedResourceUrl is a template literal tag function and ' +\n 'can only be called as such (e.g. trustedResourceUrl`/somepath.js`)');\n }\n if (rest.length === 0) {\n return (0, resource_url_impl_1.createResourceUrl)(templateObj[0]);\n }\n var base = templateObj[0].toLowerCase();\n if (process.env.NODE_ENV !== 'production') {\n if (/^data:/.test(base)) {\n throw new Error('Data URLs cannot have expressions in the template literal input.');\n }\n if (!hasValidOrigin(base) && !isValidPathStart(base) &&\n !isValidAboutUrl(base)) {\n throw new Error('Trying to interpolate expressions in an unsupported url format.');\n }\n }\n var urlParts = [templateObj[0]];\n for (var i = 0; i < rest.length; i++) {\n urlParts.push(encodeURIComponent(rest[i]));\n urlParts.push(templateObj[i + 1]);\n }\n return (0, resource_url_impl_1.createResourceUrl)(urlParts.join(''));\n}\nexports.trustedResourceUrl = trustedResourceUrl;\n/**\n * Creates a new TrustedResourceUrl with params added to the URL's search\n * parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nfunction appendParams(trustedUrl, params) {\n var url = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n if (/#/.test(url)) {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = \"Found a hash in url (\".concat(url, \"), appending not supported\");\n }\n throw new Error(message);\n }\n var separator = /\\?/.test(url) ? '&' : '?';\n // for-of has a big polyfill.\n // tslint:disable-next-line:ban-iterable-foreach\n params.forEach(function (value, key) {\n var values = (value instanceof Array) ? value : [value];\n for (var i = 0; i < values.length; i++) {\n var v = values[i];\n if (v === null || v === undefined) {\n continue;\n }\n url += separator + encodeURIComponent(key) + '=' +\n encodeURIComponent(String(v));\n separator = '&';\n }\n });\n return (0, resource_url_impl_1.createResourceUrl)(url);\n}\nexports.appendParams = appendParams;\nvar BEFORE_FRAGMENT_REGEXP = /[^#]*/;\n/**\n * Creates a new TrustedResourceUrl based on an existing one but with the\n * addition of a fragment (the part after `#`). If the URL already has a\n * fragment, it is replaced with the new one.\n * @param fragment The fragment to add to the URL, verbatim, without the leading\n * `#`. No additional escaping is applied.\n */\nfunction replaceFragment(trustedUrl, fragment) {\n var urlString = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n return (0, resource_url_impl_1.createResourceUrl)(BEFORE_FRAGMENT_REGEXP.exec(urlString)[0] + '#' + fragment);\n}\nexports.replaceFragment = replaceFragment;\n/**\n * Creates a `TrustedResourceUrl` by generating a `Blob` from a\n * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`.\n *\n * Caller must call `URL.revokeObjectUrl()` on the stringified url to\n * release the underlying `Blob`.\n */\nfunction blobUrlFromScript(safeScript) {\n var scriptContent = (0, script_impl_1.unwrapScript)(safeScript).toString();\n var blob = new Blob([scriptContent], { type: 'text/javascript' });\n return (0, resource_url_impl_1.createResourceUrl)(URL.createObjectURL(blob));\n}\nexports.blobUrlFromScript = blobUrlFromScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeScriptWithArgs = exports.scriptFromJson = exports.concatScripts = exports.safeScript = void 0;\nrequire(\"../environment/dev\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Creates a SafeScript object from a template literal (without any embedded\n * expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeScript`foo`;\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeScript(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeScript is a template literal tag function ' +\n 'that only accepts template literals without expressions. ' +\n 'For example, safeScript`foo`;');\n }\n return (0, script_impl_1.createScript)(templateObj[0]);\n}\nexports.safeScript = safeScript;\n/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */\nfunction concatScripts(scripts) {\n return (0, script_impl_1.createScript)(scripts.map(script_impl_1.unwrapScript).join(''));\n}\nexports.concatScripts = concatScripts;\n/**\n * Converts a serializable value into JSON that is safe to interpolate into a\n * script context. In particular it escapes < characters so that a value of\n * \"</script>\" doesn't break out of the context.\n * @param value The value to serialize.\n */\nfunction scriptFromJson(value) {\n return (0, script_impl_1.createScript)(JSON.stringify(value).replace(/</g, '\\\\x3c'));\n}\nexports.scriptFromJson = scriptFromJson;\n/**\n * Creates a `SafeScript` object from a template literal (without any embedded\n * expressions) along with additional arguments that the script should have\n * access to. These arguments will be JSON-encoded and passed to the script as\n * a function call.\n * @example\n * ```ts\n * safeScriptWithArgs`function (name, props) {\n * console.log(name + ' is ' + props.age);\n * }`('Bob', { 'age': 42 })\n * ```\n * would return a `SafeScript` that represents the following code:\n * ```js\n * (function (name, props) {\n * console.log(name + ' is ' + props.age);\n * })(\"Bob\",{\"age\":42})\n * ```\n * @note Be careful when passing objects as arguments, as unquoted property\n * names may be changed during compilation.\n * @param templateObj This contains the literal part of the template literal.\n * @param emptyArgs Expressions that evaluate to the empty string to enable\n * inline comments.\n */\nfunction safeScriptWithArgs(templateObj) {\n var emptyArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n emptyArgs[_i - 1] = arguments[_i];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (emptyArgs.some(function (a) { return a !== ''; })) {\n throw new Error('safeScriptWithArgs only allows empty string expressions ' +\n 'to enable inline comments.');\n }\n (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'safeScriptWithArgs is a template literal tag function ' +\n 'that only accepts template literals. ' +\n 'For example, safeScriptWithArgs`foo`;');\n }\n return function () {\n var argValues = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argValues[_i] = arguments[_i];\n }\n var values = argValues.map(function (v) { return scriptFromJson(v).toString(); });\n return (0, script_impl_1.createScript)(\"(\".concat(templateObj.join(''), \")(\").concat(values.join(','), \")\"));\n };\n}\nexports.safeScriptWithArgs = safeScriptWithArgs;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SECURITY_SENSITIVE_ATTRIBUTES = void 0;\n// AUTOGENERATED. DO NOT EDIT.\n/**\n * Security sensitive attribute names that should not be set through\n * `setAttribute` or similar functions.\n */\nexports.SECURITY_SENSITIVE_ATTRIBUTES = [\n 'href',\n 'rel',\n 'src',\n 'srcdoc',\n 'action',\n 'formaction',\n 'sandbox',\n 'cite',\n 'poster',\n 'icon',\n];\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyles = exports.safeStyle = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_impl_1 = require(\"../internals/style_impl\");\n/**\n * Creates a SafeStyle object from a template literal (without any embedded\n * expressions).\n *\n * ` style` should be in the format\n * ` name: value; [name: value; ...]` and must not have any < or >\n * characters in it. This is so that SafeStyle's contract is preserved,\n * allowing the SafeStyle to correctly be interpreted as a sequence of CSS\n * declarations and without affecting the syntactic structure of any\n * surrounding CSS and HTML.\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeStyle`foo`;\n * This function first checks if it is called with a literal template, and\n * then performs basic sanity checks on the format of ` style`\n * but does not constrain the format of ` name} and {@code value`, except\n * for disallowing tag characters.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyle(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyle is a template literal tag function ' +\n 'that only accepts template literals without expressions. ' +\n 'For example, safeStyle`foo`;');\n }\n var style = templateObj[0];\n if (process.env.NODE_ENV !== 'production') {\n if (/[<>]/.test(style)) {\n throw new Error('Forbidden characters in style string: ' + style);\n }\n if (!/;$/.test(style)) {\n throw new Error('Style string does not end with \";\": ' + style);\n }\n if (!/:/.test(style)) {\n throw new Error('Style string should contain one or more \":\": ' + style);\n }\n }\n return (0, style_impl_1.createStyle)(style);\n}\nexports.safeStyle = safeStyle;\n/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */\nfunction concatStyles(styles) {\n return (0, style_impl_1.createStyle)(styles.map(style_impl_1.unwrapStyle).join(''));\n}\nexports.concatStyles = concatStyles;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyleSheets = exports.safeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_sheet_impl_1 = require(\"../internals/style_sheet_impl\");\n/**\n * Creates a SafeStyleSheet object from a template literal (without any\n * embedded expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeStyleSheet`foo`;\n * The argument must not have any < or > characters in it. This is so that\n * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to\n * correctly be interpreted as a sequence of CSS declarations and without\n * affecting the syntactic structure of any surrounding CSS and HTML.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyleSheet(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyleSheet is a template literal tag ' +\n 'function that only accepts template literals without ' +\n 'expressions. For example, safeStyleSheet`foo`;');\n }\n var styleSheet = templateObj[0];\n if (process.env.NODE_ENV !== 'production') {\n if (/[<>]/.test(styleSheet)) {\n throw new Error('Forbidden characters in styleSheet string: ' + styleSheet);\n }\n }\n return (0, style_sheet_impl_1.createStyleSheet)(styleSheet);\n}\nexports.safeStyleSheet = safeStyleSheet;\n/**\n * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s.\n */\nfunction concatStyleSheets(sheets) {\n return (0, style_sheet_impl_1.createStyleSheet)(sheets.map(style_sheet_impl_1.unwrapStyleSheet).join(''));\n}\nexports.concatStyleSheets = concatStyleSheets;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.restrictivelySanitizeUrl = exports.unwrapUrlOrSanitize = exports.sanitizeJavascriptUrl = void 0;\n/**\n * @fileoverview Provides functions to enforce the SafeUrl contract at the sink\n * level.\n */\nrequire(\"../environment/dev\");\nfunction extractScheme(url) {\n var parsedUrl;\n try {\n parsedUrl = new URL(url);\n }\n catch (e) {\n // According to https://url.spec.whatwg.org/#constructors, the URL\n // constructor with one parameter throws if `url` is not absolute. In this\n // case, we are sure that no explicit scheme (javascript: ) is set.\n // This can also be a URL parsing error, but in this case the URL won't be\n // run anyway.\n return 'https:';\n }\n return parsedUrl.protocol;\n}\n// We can't use an ES6 Set here because gws somehow depends on this code and\n// doesn't want to pay the cost of a polyfill.\nvar ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:'];\n/**\n * Checks that the URL scheme is not javascript.\n * The URL parsing relies on the URL API in browsers that support it.\n * @param url The URL to sanitize for a SafeUrl sink.\n * @return undefined if url has a javascript: scheme, the original URL\n * otherwise.\n */\nfunction sanitizeJavascriptUrl(url) {\n var parsedScheme = extractScheme(url);\n if (parsedScheme === 'javascript:') {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\"A URL with content '\".concat(url, \"' was sanitized away.\"));\n }\n return undefined;\n }\n return url;\n}\nexports.sanitizeJavascriptUrl = sanitizeJavascriptUrl;\n/**\n * Adapter to sanitize string URLs in DOM sink wrappers.\n * @return undefined if the URL was sanitized.\n */\nfunction unwrapUrlOrSanitize(url) {\n return sanitizeJavascriptUrl(url);\n}\nexports.unwrapUrlOrSanitize = unwrapUrlOrSanitize;\n/**\n * Sanitizes a URL restrictively.\n * This sanitizer protects against XSS and potentially other uncommon and\n * undesirable schemes that an attacker could use for e.g. phishing (tel:,\n * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by\n * the HTML sanitizer.\n */\nfunction restrictivelySanitizeUrl(url) {\n var parsedScheme = extractScheme(url);\n if (parsedScheme !== undefined &&\n ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) {\n return url;\n }\n return 'about:invalid#zClosurez';\n}\nexports.restrictivelySanitizeUrl = restrictivelySanitizeUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(anchor, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n anchor.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(area, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n area.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(button, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n button.formAction = sanitizedUrl;\n }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setPrefixedAttribute = exports.buildPrefixedAttributeSetter = exports.insertAdjacentHtml = exports.setCssText = exports.setOuterHtml = exports.setInnerHtml = void 0;\n/**\n * @fileoverview This contains safe wrappers for properties that aren't specific\n * to one kind of HTMLElement (like innerHTML), plus other setters and functions\n * that are not tied to elements (like location.href or Worker constructor).\n */\nvar attribute_impl_1 = require(\"../../internals/attribute_impl\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar style_impl_1 = require(\"../../internals/style_impl\");\n/**\n * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which\n * may not be a `<script>` element or a `<style>` element.\n */\nfunction setInnerHtml(elOrRoot, v) {\n if (isElement(elOrRoot)) {\n throwIfScriptOrStyle(elOrRoot);\n }\n elOrRoot.innerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setInnerHtml = setInnerHtml;\n/**\n * Safely set {@link Element.outerHTML} for the given Element.\n */\nfunction setOuterHtml(e, v) {\n var parent = e.parentElement;\n if (parent !== null) {\n throwIfScriptOrStyle(parent);\n }\n e.outerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setOuterHtml = setOuterHtml;\n/**\n * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`.\n */\nfunction setCssText(e, v) {\n e.style.cssText = (0, style_impl_1.unwrapStyle)(v);\n}\nexports.setCssText = setCssText;\n/**\n * Safely call {@link Element.insertAdjacentHTML} for the given Element.\n */\nfunction insertAdjacentHtml(element, position, v) {\n var tagContext = (position === 'beforebegin' || position === 'afterend') ?\n element.parentElement :\n element;\n if (tagContext !== null) {\n throwIfScriptOrStyle(tagContext);\n }\n element.insertAdjacentHTML(position, (0, html_impl_1.unwrapHtml)(v));\n}\nexports.insertAdjacentHtml = insertAdjacentHtml;\n/**\n * Given a set of known-to-be-safe prefixes (e.g., \"data-\", \"aria-\", \"js\"),\n * return a setter function that allows you to set attributes on an element,\n * as long as the names of the attributes to be set has one of the prefixes.\n *\n * The returned setter ensures that setting any dangerous attribute, e.g.,\n * \"src\", \"href\" will cause an exception. This is intended to be used as the\n * safe alterantive of `Element#setAttribute`, when applications need to set\n * attributes that do not have security implications and do not have a\n * corresponding DOM property.\n */\nfunction buildPrefixedAttributeSetter(prefix) {\n var otherPrefixes = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n otherPrefixes[_i - 1] = arguments[_i];\n }\n var prefixes = __spreadArray([prefix], __read(otherPrefixes), false);\n return function (e, attr, value) {\n setPrefixedAttribute(prefixes, e, attr, value);\n };\n}\nexports.buildPrefixedAttributeSetter = buildPrefixedAttributeSetter;\n/**\n * The safe alternative to Element#setAttribute. The function takes a list of\n * `SafeAttributePrefix`, making developer intention explicit. The attribute\n * to be set must has one of the safe prefixes, otherwise the function throws\n * an Error.\n */\nfunction setPrefixedAttribute(attrPrefixes, e, attr, value) {\n if (attrPrefixes.length === 0) {\n throw new Error('No prefixes are provided');\n }\n var prefixes = attrPrefixes.map(function (s) { return (0, attribute_impl_1.unwrapAttributePrefix)(s); });\n var attrLower = attr.toLowerCase();\n if (prefixes.every(function (p) { return attrLower.indexOf(p) !== 0; })) {\n throw new Error(\"Attribute \\\"\".concat(attr, \"\\\" does not match any of the allowed prefixes.\"));\n }\n e.setAttribute(attr, value);\n}\nexports.setPrefixedAttribute = setPrefixedAttribute;\nfunction throwIfScriptOrStyle(element) {\n if (element.tagName.toLowerCase() === 'script') {\n throw new Error('Use setTextContent with a SafeScript.');\n }\n else if (element.tagName.toLowerCase() === 'style') {\n throw new Error('Use setTextContent with a SafeStyleSheet.');\n }\n}\nfunction isElement(elOrRoot) {\n return elOrRoot.tagName !== undefined;\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Sets the Src attribute from the given SafeUrl.\n */\nfunction setSrc(embedEl, url) {\n embedEl.src = (0, resource_url_impl_1.unwrapResourceUrl)(url);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Action attribute from the given Url.\n */\nfunction setAction(form, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n form.action = sanitizedUrl;\n }\n}\nexports.setAction = setAction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrcdoc = exports.setSrc = void 0;\n/**\n * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure\n */\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(iframe, v) {\n iframe.src = (0, resource_url_impl_1.unwrapResourceUrl)(v).toString();\n}\nexports.setSrc = setSrc;\n/** Sets the Srcdoc attribute using a SafeHtml */\nfunction setSrcdoc(iframe, v) {\n iframe.srcdoc = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setSrcdoc = setSrcdoc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(input, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n input.formAction = sanitizedUrl;\n }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHrefAndRel = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar SAFE_URL_REL_VALUES = [\n 'alternate',\n 'author',\n 'bookmark',\n 'canonical',\n 'cite',\n 'help',\n 'icon',\n 'license',\n 'next',\n 'prefetch',\n 'dns-prefetch',\n 'prerender',\n 'preconnect',\n 'preload',\n 'prev',\n 'search',\n 'subresource',\n];\nfunction setHrefAndRel(link, url, rel) {\n if (url instanceof resource_url_impl_1.TrustedResourceUrl) {\n link.href = (0, resource_url_impl_1.unwrapResourceUrl)(url).toString();\n }\n else {\n if (SAFE_URL_REL_VALUES.indexOf(rel) === -1) {\n throw new Error(\"TrustedResourceUrl href attribute required with rel=\\\"\".concat(rel, \"\\\"\"));\n }\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl === undefined) {\n return;\n }\n link.href = sanitizedUrl;\n }\n link.rel = rel;\n}\nexports.setHrefAndRel = setHrefAndRel;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setData = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the data attribute using a TrustedResourceUrl */\nfunction setData(obj, v) {\n obj.data = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n}\nexports.setData = setData;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = exports.setTextContent = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/** Returns CSP nonce, if set for any script tag. */\nfunction getScriptNonceFromWindow(win) {\n var _a;\n var doc = win.document;\n // document.querySelector can be undefined in non-browser environments.\n var script = (_a = doc.querySelector) === null || _a === void 0 ? void 0 : _a.call(doc, 'script[nonce]');\n if (script) {\n // Try to get the nonce from the IDL property first, because browsers that\n // implement additional nonce protection features (currently only Chrome) to\n // prevent nonce stealing via CSS do not expose the nonce via attributes.\n // See https://github.com/whatwg/html/issues/2369\n return script['nonce'] || script.getAttribute('nonce') || '';\n }\n return '';\n}\n/** Propagates CSP nonce to dynamically created scripts. */\nfunction setNonceForScriptElement(script) {\n var win = script.ownerDocument && script.ownerDocument.defaultView;\n var nonce = getScriptNonceFromWindow(win || window);\n if (nonce) {\n script.setAttribute('nonce', nonce);\n }\n}\n/** Sets textContent from the given SafeScript. */\nfunction setTextContent(script, v) {\n script.textContent = (0, script_impl_1.unwrapScript)(v);\n setNonceForScriptElement(script);\n}\nexports.setTextContent = setTextContent;\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(script, v) {\n script.src = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n setNonceForScriptElement(script);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setTextContent = void 0;\nvar style_sheet_impl_1 = require(\"../../internals/style_sheet_impl\");\n/** Safe setters for `HTMLStyleElement`s. */\nfunction setTextContent(elem, safeStyleSheet) {\n elem.textContent = (0, style_sheet_impl_1.unwrapStyleSheet)(safeStyleSheet);\n}\nexports.setTextContent = setTextContent;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.execCommandInsertHtml = exports.execCommand = exports.write = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * write safely calls {@link Document.write} on the given {@link Document} with\n * the given {@link SafeHtml}.\n */\nfunction write(doc, text) {\n doc.write((0, html_impl_1.unwrapHtml)(text));\n}\nexports.write = write;\n/**\n * Safely calls {@link Document.execCommand}. When command is insertHtml, a\n * SafeHtml must be passed in as value.\n */\nfunction execCommand(doc, command, value) {\n var commandString = String(command);\n var valueArgument = value;\n if (commandString.toLowerCase() === 'inserthtml') {\n valueArgument = (0, html_impl_1.unwrapHtml)(value);\n }\n return doc.execCommand(commandString, /* showUi= */ false, valueArgument);\n}\nexports.execCommand = execCommand;\n/**\n * Safely calls {@link Document.execCommand}('insertHtml').\n * @deprecated Use safeDocument.execCommand.\n */\nfunction execCommandInsertHtml(doc, html) {\n return doc.execCommand('insertHTML', /* showUi= */ false, (0, html_impl_1.unwrapHtml)(html));\n}\nexports.execCommandInsertHtml = execCommandInsertHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseFromString = exports.parseHtml = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely parses a string using the HTML parser. */\nfunction parseHtml(parser, html) {\n return parseFromString(parser, html, 'text/html');\n}\nexports.parseHtml = parseHtml;\n/** Safely parses a string using the HTML or XML parser. */\nfunction parseFromString(parser, content, contentType) {\n return parser.parseFromString((0, html_impl_1.unwrapHtml)(content), contentType);\n}\nexports.parseFromString = parseFromString;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalEval = void 0;\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/**\n * Evaluates a SafeScript value in the given scope using eval.\n *\n * Strongly consider avoiding this, as eval blocks CSP adoption and does not\n * benefit from compiler optimizations.\n */\nfunction globalEval(win, script) {\n var trustedScript = (0, script_impl_1.unwrapScript)(script);\n var result = win.eval(trustedScript);\n if (result === trustedScript) {\n // https://crbug.com/1024786 manifesting in workers.\n result = win.eval(trustedScript.toString());\n }\n return result;\n}\nexports.globalEval = globalEval;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assign = exports.replace = exports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * setHref safely sets {@link Location.href} on the given {@link Location} with\n * given {@link Url}.\n */\nfunction setHref(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n/**\n * replace safely calls {@link Location.replace} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction replace(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.replace(sanitizedUrl);\n }\n}\nexports.replace = replace;\n/**\n * assign safely calls {@link Location.assign} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction assign(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.assign(sanitizedUrl);\n }\n}\nexports.assign = assign;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createContextualFragment = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely creates a contextualFragment. */\nfunction createContextualFragment(range, html) {\n return range.createContextualFragment((0, html_impl_1.unwrapHtml)(html));\n}\nexports.createContextualFragment = createContextualFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.register = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Safely registers a service worker by URL */\nfunction register(container, scriptURL, options) {\n return container.register((0, resource_url_impl_1.unwrapResourceUrl)(scriptURL), options);\n}\nexports.register = register;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.open = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * open calls {@link Window.open} on the given {@link Window}, given a\n * target {@link Url}.\n */\nfunction open(win, url, target, features) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n return win.open(sanitizedUrl, target, features);\n }\n return null;\n}\nexports.open = open;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.importScripts = exports.createShared = exports.create = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Safely creates a Web Worker.\n *\n * Example usage:\n * const trustedResourceUrl = trustedResourceUrl`/safe_script.js`;\n * safedom.safeWorker.create(trustedResourceUrl);\n * which is a safe alternative to\n * new Worker(url);\n * The latter can result in loading untrusted code.\n */\nfunction create(url, options) {\n return new Worker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.create = create;\n/** Safely creates a shared Web Worker. */\nfunction createShared(url, options) {\n return new SharedWorker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.createShared = createShared;\n/** Safely calls importScripts */\nfunction importScripts(scope) {\n var urls = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n urls[_i - 1] = arguments[_i];\n }\n scope.importScripts.apply(scope, __spreadArray([], __read(urls.map(function (url) { return (0, resource_url_impl_1.unwrapResourceUrl)(url); })), false));\n}\nexports.importScripts = importScripts;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeWorker = exports.safeWindow = exports.safeServiceWorkerContainer = exports.safeRange = exports.safeLocation = exports.safeGlobal = exports.safeDomParser = exports.safeDocument = exports.safeStyleEl = exports.safeScriptEl = exports.safeObjectEl = exports.safeLinkEl = exports.safeInputEl = exports.safeIframeEl = exports.safeFormEl = exports.safeEmbedEl = exports.safeElement = exports.safeButtonEl = exports.safeAreaEl = exports.safeAnchorEl = void 0;\n/**\n * @fileoverview This file re-exports all of the wrappers to ensure that we have\n * a clearly defined interface.\n */\nexports.safeAnchorEl = __importStar(require(\"./elements/anchor\"));\nexports.safeAreaEl = __importStar(require(\"./elements/area\"));\nexports.safeButtonEl = __importStar(require(\"./elements/button\"));\nexports.safeElement = __importStar(require(\"./elements/element\"));\nexports.safeEmbedEl = __importStar(require(\"./elements/embed\"));\nexports.safeFormEl = __importStar(require(\"./elements/form\"));\nexports.safeIframeEl = __importStar(require(\"./elements/iframe\"));\nexports.safeInputEl = __importStar(require(\"./elements/input\"));\nexports.safeLinkEl = __importStar(require(\"./elements/link\"));\nexports.safeObjectEl = __importStar(require(\"./elements/object\"));\nexports.safeScriptEl = __importStar(require(\"./elements/script\"));\nexports.safeStyleEl = __importStar(require(\"./elements/style\"));\nexports.safeDocument = __importStar(require(\"./globals/document\"));\nexports.safeDomParser = __importStar(require(\"./globals/dom_parser\"));\nexports.safeGlobal = __importStar(require(\"./globals/global\"));\nexports.safeLocation = __importStar(require(\"./globals/location\"));\nexports.safeRange = __importStar(require(\"./globals/range\"));\nexports.safeServiceWorkerContainer = __importStar(require(\"./globals/service_worker_container\"));\nexports.safeWindow = __importStar(require(\"./globals/window\"));\nexports.safeWorker = __importStar(require(\"./globals/worker\"));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Ensure process.env.NODE_ENV is set even when not running under Webpack or\n * Node. Terser will strip this out of production binaries.\n */\n/*#__PURE__*/ (function () {\n if (typeof process === 'undefined') {\n window.process = { env: { NODE_ENV: 'development' } };\n }\n})();\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.SafeStyleSheet = exports.isStyleSheet = exports.unwrapStyle = exports.SafeStyle = exports.isStyle = exports.unwrapScript = exports.SafeScript = exports.isScript = exports.EMPTY_SCRIPT = exports.unwrapResourceUrl = exports.TrustedResourceUrl = exports.isResourceUrl = exports.unwrapHtml = exports.SafeHtml = exports.isHtml = exports.EMPTY_HTML = exports.unwrapAttributePrefix = exports.SafeAttributePrefix = exports.safeStyleSheet = exports.concatStyleSheets = exports.safeStyle = exports.concatStyles = exports.scriptFromJson = exports.safeScriptWithArgs = exports.safeScript = exports.concatScripts = exports.trustedResourceUrl = exports.replaceFragment = exports.blobUrlFromScript = exports.appendParams = exports.HtmlSanitizerBuilder = exports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.htmlEscape = exports.createScriptSrc = exports.createScript = exports.concatHtmls = exports.safeAttrPrefix = void 0;\n/** Safe builders */\nvar attribute_builders_1 = require(\"./builders/attribute_builders\");\nObject.defineProperty(exports, \"safeAttrPrefix\", { enumerable: true, get: function () { return attribute_builders_1.safeAttrPrefix; } });\nvar html_builders_1 = require(\"./builders/html_builders\");\nObject.defineProperty(exports, \"concatHtmls\", { enumerable: true, get: function () { return html_builders_1.concatHtmls; } });\nObject.defineProperty(exports, \"createScript\", { enumerable: true, get: function () { return html_builders_1.createScript; } });\nObject.defineProperty(exports, \"createScriptSrc\", { enumerable: true, get: function () { return html_builders_1.createScriptSrc; } });\nObject.defineProperty(exports, \"htmlEscape\", { enumerable: true, get: function () { return html_builders_1.htmlEscape; } });\nvar html_sanitizer_1 = require(\"./builders/html_sanitizer/html_sanitizer\");\nObject.defineProperty(exports, \"sanitizeHtml\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtml; } });\nObject.defineProperty(exports, \"sanitizeHtmlAssertUnchanged\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlAssertUnchanged; } });\nObject.defineProperty(exports, \"sanitizeHtmlToFragment\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlToFragment; } });\nvar html_sanitizer_builder_1 = require(\"./builders/html_sanitizer/html_sanitizer_builder\");\nObject.defineProperty(exports, \"HtmlSanitizerBuilder\", { enumerable: true, get: function () { return html_sanitizer_builder_1.HtmlSanitizerBuilder; } });\nvar resource_url_builders_1 = require(\"./builders/resource_url_builders\");\nObject.defineProperty(exports, \"appendParams\", { enumerable: true, get: function () { return resource_url_builders_1.appendParams; } });\nObject.defineProperty(exports, \"blobUrlFromScript\", { enumerable: true, get: function () { return resource_url_builders_1.blobUrlFromScript; } });\nObject.defineProperty(exports, \"replaceFragment\", { enumerable: true, get: function () { return resource_url_builders_1.replaceFragment; } });\nObject.defineProperty(exports, \"trustedResourceUrl\", { enumerable: true, get: function () { return resource_url_builders_1.trustedResourceUrl; } });\nvar script_builders_1 = require(\"./builders/script_builders\");\nObject.defineProperty(exports, \"concatScripts\", { enumerable: true, get: function () { return script_builders_1.concatScripts; } });\nObject.defineProperty(exports, \"safeScript\", { enumerable: true, get: function () { return script_builders_1.safeScript; } });\nObject.defineProperty(exports, \"safeScriptWithArgs\", { enumerable: true, get: function () { return script_builders_1.safeScriptWithArgs; } });\nObject.defineProperty(exports, \"scriptFromJson\", { enumerable: true, get: function () { return script_builders_1.scriptFromJson; } });\nvar style_builders_1 = require(\"./builders/style_builders\");\nObject.defineProperty(exports, \"concatStyles\", { enumerable: true, get: function () { return style_builders_1.concatStyles; } });\nObject.defineProperty(exports, \"safeStyle\", { enumerable: true, get: function () { return style_builders_1.safeStyle; } });\nvar style_sheet_builders_1 = require(\"./builders/style_sheet_builders\");\nObject.defineProperty(exports, \"concatStyleSheets\", { enumerable: true, get: function () { return style_sheet_builders_1.concatStyleSheets; } });\nObject.defineProperty(exports, \"safeStyleSheet\", { enumerable: true, get: function () { return style_sheet_builders_1.safeStyleSheet; } });\n/** Types, constants and unwrappers */\nvar attribute_impl_1 = require(\"./internals/attribute_impl\");\nObject.defineProperty(exports, \"SafeAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.SafeAttributePrefix; } });\nObject.defineProperty(exports, \"unwrapAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.unwrapAttributePrefix; } });\nvar html_impl_1 = require(\"./internals/html_impl\");\nObject.defineProperty(exports, \"EMPTY_HTML\", { enumerable: true, get: function () { return html_impl_1.EMPTY_HTML; } });\nObject.defineProperty(exports, \"isHtml\", { enumerable: true, get: function () { return html_impl_1.isHtml; } });\nObject.defineProperty(exports, \"SafeHtml\", { enumerable: true, get: function () { return html_impl_1.SafeHtml; } });\nObject.defineProperty(exports, \"unwrapHtml\", { enumerable: true, get: function () { return html_impl_1.unwrapHtml; } });\nvar resource_url_impl_1 = require(\"./internals/resource_url_impl\");\nObject.defineProperty(exports, \"isResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.isResourceUrl; } });\nObject.defineProperty(exports, \"TrustedResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.TrustedResourceUrl; } });\nObject.defineProperty(exports, \"unwrapResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.unwrapResourceUrl; } });\nvar script_impl_1 = require(\"./internals/script_impl\");\nObject.defineProperty(exports, \"EMPTY_SCRIPT\", { enumerable: true, get: function () { return script_impl_1.EMPTY_SCRIPT; } });\nObject.defineProperty(exports, \"isScript\", { enumerable: true, get: function () { return script_impl_1.isScript; } });\nObject.defineProperty(exports, \"SafeScript\", { enumerable: true, get: function () { return script_impl_1.SafeScript; } });\nObject.defineProperty(exports, \"unwrapScript\", { enumerable: true, get: function () { return script_impl_1.unwrapScript; } });\nvar style_impl_1 = require(\"./internals/style_impl\");\nObject.defineProperty(exports, \"isStyle\", { enumerable: true, get: function () { return style_impl_1.isStyle; } });\nObject.defineProperty(exports, \"SafeStyle\", { enumerable: true, get: function () { return style_impl_1.SafeStyle; } });\nObject.defineProperty(exports, \"unwrapStyle\", { enumerable: true, get: function () { return style_impl_1.unwrapStyle; } });\nvar style_sheet_impl_1 = require(\"./internals/style_sheet_impl\");\nObject.defineProperty(exports, \"isStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.isStyleSheet; } });\nObject.defineProperty(exports, \"SafeStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.SafeStyleSheet; } });\nObject.defineProperty(exports, \"unwrapStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.unwrapStyleSheet; } });\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapAttributePrefix = exports.createAttributePrefix = exports.SafeAttributePrefix = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/** A prefix with which an attribute is safe to set using plain strings. */\nvar SafeAttributePrefix = /** @class */ (function () {\n function SafeAttributePrefix() {\n }\n return SafeAttributePrefix;\n}());\nexports.SafeAttributePrefix = SafeAttributePrefix;\n/** Implementation for `SafeAttributePrefix` */\nvar AttributePrefixImpl = /** @class */ (function (_super) {\n __extends(AttributePrefixImpl, _super);\n function AttributePrefixImpl(attrPrefix, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedAttrPrefix = attrPrefix;\n return _this;\n }\n AttributePrefixImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedAttrPrefix;\n };\n return AttributePrefixImpl;\n}(SafeAttributePrefix));\n/**\n * Builds a new `SafeAttribute` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createAttributePrefix(attrPrefix) {\n return new AttributePrefixImpl(attrPrefix, secrets_1.secretToken);\n}\nexports.createAttributePrefix = createAttributePrefix;\n/**\n * Returns the string value of the passed `SafeAttributePrefix` object while\n * ensuring it has the correct type.\n */\nfunction unwrapAttributePrefix(value) {\n if (value instanceof AttributePrefixImpl) {\n return value.privateDoNotAccessOrElseWrappedAttrPrefix;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeAttributePrefix';\n }\n throw new Error(message);\n }\n}\nexports.unwrapAttributePrefix = unwrapAttributePrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapHtml = exports.isHtml = exports.EMPTY_HTML = exports.createHtml = exports.SafeHtml = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedHTML` in browsers that don't support it.\n */\nvar HtmlImpl = /** @class */ (function () {\n function HtmlImpl(html, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedHtml = html;\n }\n HtmlImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedHtml.toString();\n };\n return HtmlImpl;\n}());\nfunction createHtmlInternal(html, trusted) {\n return (trusted !== null && trusted !== void 0 ? trusted : new HtmlImpl(html, secrets_1.secretToken));\n}\nvar GlobalTrustedHTML = (typeof window !== undefined) ? window.TrustedHTML : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeHtml = (GlobalTrustedHTML !== null && GlobalTrustedHTML !== void 0 ? GlobalTrustedHTML : HtmlImpl);\n/**\n * Builds a new `SafeHtml` from the given string, without enforcing safety\n * guarantees. It may cause side effects by creating a Trusted Types policy.\n * This shouldn't be exposed to application developers, and must only be used as\n * a step towards safe builders or safe constants.\n */\nfunction createHtml(html) {\n var _a;\n /** @noinline */\n var noinlineHtml = html;\n return createHtmlInternal(noinlineHtml, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createHTML(noinlineHtml));\n}\nexports.createHtml = createHtml;\n/**\n * An empty `SafeHtml` constant.\n * Unlike the function above, using this will not create a policy.\n */\nexports.EMPTY_HTML = \n/* #__PURE__ */ (function () { var _a; return createHtmlInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyHTML); })();\n/**\n * Checks if the given value is a `SafeHtml` instance.\n */\nfunction isHtml(value) {\n return value instanceof exports.SafeHtml;\n}\nexports.isHtml = isHtml;\n/**\n * Returns the value of the passed `SafeHtml` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedHTML` or a string if Trusted Types are disabled.\n */\nfunction unwrapHtml(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isHTML(value)) {\n return value;\n }\n else if (value instanceof HtmlImpl) {\n return value.privateDoNotAccessOrElseWrappedHtml;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeHtml';\n }\n throw new Error(message);\n }\n}\nexports.unwrapHtml = unwrapHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapResourceUrl = exports.isResourceUrl = exports.createResourceUrl = exports.TrustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScriptURL` in browsers that don't support\n * it.\n */\nvar ResourceUrlImpl = /** @class */ (function () {\n function ResourceUrlImpl(url, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedResourceUrl = url;\n }\n ResourceUrlImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedResourceUrl.toString();\n };\n return ResourceUrlImpl;\n}());\nvar GlobalTrustedScriptURL = (typeof window !== undefined) ? window.TrustedScriptURL : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.TrustedResourceUrl = (GlobalTrustedScriptURL !== null && GlobalTrustedScriptURL !== void 0 ? GlobalTrustedScriptURL : ResourceUrlImpl);\n/**\n * Builds a new `TrustedResourceUrl` from the given string, without\n * enforcing safety guarantees. It may cause side effects by creating a Trusted\n * Types policy. This shouldn't be exposed to application developers, and must\n * only be used as a step towards safe builders or safe constants.\n */\nfunction createResourceUrl(url) {\n var _a;\n /** @noinline */\n var noinlineUrl = url;\n var trustedScriptURL = (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScriptURL(noinlineUrl);\n return (trustedScriptURL !== null && trustedScriptURL !== void 0 ? trustedScriptURL : new ResourceUrlImpl(noinlineUrl, secrets_1.secretToken));\n}\nexports.createResourceUrl = createResourceUrl;\n/**\n * Checks if the given value is a `TrustedResourceUrl` instance.\n */\nfunction isResourceUrl(value) {\n return value instanceof exports.TrustedResourceUrl;\n}\nexports.isResourceUrl = isResourceUrl;\n/**\n * Returns the value of the passed `TrustedResourceUrl` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScriptURL` or a string if Trusted Types are\n * disabled.\n */\nfunction unwrapResourceUrl(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScriptURL(value)) {\n return value;\n }\n else if (value instanceof ResourceUrlImpl) {\n return value.privateDoNotAccessOrElseWrappedResourceUrl;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping TrustedResourceUrl';\n }\n throw new Error(message);\n }\n}\nexports.unwrapResourceUrl = unwrapResourceUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapScript = exports.isScript = exports.EMPTY_SCRIPT = exports.createScript = exports.SafeScript = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScript` in browswers that don't support it.\n * script element.\n */\nvar ScriptImpl = /** @class */ (function () {\n function ScriptImpl(script, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedScript = script;\n }\n ScriptImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedScript.toString();\n };\n return ScriptImpl;\n}());\nfunction createScriptInternal(script, trusted) {\n return (trusted !== null && trusted !== void 0 ? trusted : new ScriptImpl(script, secrets_1.secretToken));\n}\nvar GlobalTrustedScript = (typeof window !== undefined) ? window.TrustedScript : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeScript = (GlobalTrustedScript !== null && GlobalTrustedScript !== void 0 ? GlobalTrustedScript : ScriptImpl);\n/**\n * Builds a new `SafeScript` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nfunction createScript(script) {\n var _a;\n /** @noinline */\n var noinlineScript = script;\n return createScriptInternal(noinlineScript, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScript(noinlineScript));\n}\nexports.createScript = createScript;\n/**\n * An empty `SafeScript` constant.\n * Unlike the functions above, using this will not create a policy.\n */\nexports.EMPTY_SCRIPT = \n/* #__PURE__ */ (function () { var _a; return createScriptInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyScript); })();\n/**\n * Checks if the given value is a `SafeScript` instance.\n */\nfunction isScript(value) {\n return value instanceof exports.SafeScript;\n}\nexports.isScript = isScript;\n/**\n * Returns the value of the passed `SafeScript` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScript` or a string if Trusted Types are disabled.\n */\nfunction unwrapScript(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScript(value)) {\n return value;\n }\n else if (value instanceof ScriptImpl) {\n return value.privateDoNotAccessOrElseWrappedScript;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeScript';\n }\n throw new Error(message);\n }\n}\nexports.unwrapScript = unwrapScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureTokenIsValid = exports.secretToken = void 0;\n/**\n * A secret token that must be passed to safe type constructors. It is only\n * accessible from within safevalues, ensuring that unrestricted safe type\n * creation is only possible within safevalues. In particular, this prevents\n * forgery such as `safeHtmlValue.constructor('javascript:evil')`.\n */\nexports.secretToken = {};\n/**\n * Asserts that the given token matches the secret safevalues token. An\n * exception is thrown if that is not the case.\n */\nfunction ensureTokenIsValid(token) {\n if (token !== exports.secretToken) {\n throw new Error('Bad secret');\n }\n}\nexports.ensureTokenIsValid = ensureTokenIsValid;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertIsTemplateObject = void 0;\n/**\n * An object of type TemplateStringsArray represents the literal part(s) of a\n * template literal. This function checks if a TemplateStringsArray object is\n * actually from a template literal.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param hasExprs If true, the input template may contain embedded expressions.\n * @param errorMsg The custom error message in case any checks fail.\n */\nfunction assertIsTemplateObject(templateObj, hasExprs, errorMsg) {\n if (!Array.isArray(templateObj) || !Array.isArray(templateObj.raw) ||\n (!hasExprs && templateObj.length !== 1)) {\n throw new TypeError(errorMsg);\n }\n}\nexports.assertIsTemplateObject = assertIsTemplateObject;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyle = exports.isStyle = exports.createStyle = exports.SafeStyle = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * Sequence of CSS declarations safe to use in style contexts in an HTML\n * document or in DOM APIs.\n */\nvar SafeStyle = /** @class */ (function () {\n function SafeStyle() {\n }\n return SafeStyle;\n}());\nexports.SafeStyle = SafeStyle;\n/** Implementation for `SafeStyle` */\nvar StyleImpl = /** @class */ (function (_super) {\n __extends(StyleImpl, _super);\n function StyleImpl(style, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedStyle = style;\n return _this;\n }\n StyleImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedStyle;\n };\n return StyleImpl;\n}(SafeStyle));\n/**\n * Builds a new `SafeStyle` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyle(style) {\n return new StyleImpl(style, secrets_1.secretToken);\n}\nexports.createStyle = createStyle;\n/**\n * Checks if the given value is a `SafeStyle` instance.\n */\nfunction isStyle(value) {\n return value instanceof StyleImpl;\n}\nexports.isStyle = isStyle;\n/**\n * Returns the string value of the passed `SafeStyle` object while ensuring it\n * has the correct type.\n */\nfunction unwrapStyle(value) {\n if (value instanceof StyleImpl) {\n return value.privateDoNotAccessOrElseWrappedStyle;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeStyle';\n }\n throw new Error(message);\n }\n}\nexports.unwrapStyle = unwrapStyle;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.isStyleSheet = exports.createStyleSheet = exports.SafeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * A complete CSS style sheet, safe to use in style contexts in an HTML document\n * or DOM APIs.\n */\nvar SafeStyleSheet = /** @class */ (function () {\n function SafeStyleSheet() {\n }\n return SafeStyleSheet;\n}());\nexports.SafeStyleSheet = SafeStyleSheet;\n/** Implementation for `SafeStyleSheet` */\nvar StyleSheetImpl = /** @class */ (function (_super) {\n __extends(StyleSheetImpl, _super);\n function StyleSheetImpl(styleSheet, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedStyleSheet = styleSheet;\n return _this;\n }\n StyleSheetImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedStyleSheet;\n };\n return StyleSheetImpl;\n}(SafeStyleSheet));\n/**\n * Builds a new `SafeStyleSheet` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyleSheet(styleSheet) {\n return new StyleSheetImpl(styleSheet, secrets_1.secretToken);\n}\nexports.createStyleSheet = createStyleSheet;\n/**\n * Checks if the given value is a `SafeStyleSheet` instance.\n */\nfunction isStyleSheet(value) {\n return value instanceof StyleSheetImpl;\n}\nexports.isStyleSheet = isStyleSheet;\n/**\n * Returns the string value of the passed `SafeStyleSheet` object while\n * ensuring it has the correct type.\n */\nfunction unwrapStyleSheet(value) {\n if (value instanceof StyleSheetImpl) {\n return value.privateDoNotAccessOrElseWrappedStyleSheet;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeStyleSheet';\n }\n throw new Error(message);\n }\n}\nexports.unwrapStyleSheet = unwrapStyleSheet;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TEST_ONLY = exports.getTrustedTypesPolicy = exports.getTrustedTypes = void 0;\n/**\n * The name of the Trusted Types policy used by TS safevalues, or empty\n * to disable Trusted Types. This duplicates the 'google#safe', but\n * can be overridden in tests.\n */\nvar trustedTypesPolicyName = 'google#safe';\n/** Helper to retrieve the value of `window.trustedTypes`. */\nfunction trustedTypes() {\n if (typeof window !== 'undefined') {\n return window.trustedTypes;\n }\n return undefined;\n}\n/**\n * Returns window.trustedTypes if Trusted Types are enabled and supported, or\n * null otherwise.\n */\nfunction getTrustedTypes() {\n var _a;\n return (trustedTypesPolicyName !== '') ? ((_a = trustedTypes()) !== null && _a !== void 0 ? _a : null) : null;\n}\nexports.getTrustedTypes = getTrustedTypes;\n/**\n * The Trusted Types policy used by TS safevalues, or null if Trusted Types\n * are not enabled/supported, or undefined if the policy has not been created\n * yet.\n */\nvar trustedTypesPolicy;\n/**\n * Returns the Trusted Types policy used by TS safevalues, or null if Trusted\n * Types are not enabled/supported. The first call to this function will\n * create the policy.\n */\nfunction getTrustedTypesPolicy() {\n var _a, _b;\n if (trustedTypesPolicy === undefined) {\n try {\n trustedTypesPolicy =\n (_b = (_a = getTrustedTypes()) === null || _a === void 0 ? void 0 : _a.createPolicy(trustedTypesPolicyName, {\n createHTML: function (s) { return s; },\n createScript: function (s) { return s; },\n createScriptURL: function (s) { return s; }\n })) !== null && _b !== void 0 ? _b : null;\n }\n catch (_c) {\n // In Chromium versions before 81, trustedTypes.createPolicy throws if\n // called with a name that is already registered, even if no CSP is set.\n // Until users have largely migrated to 81 or above, catch the error not\n // to break the applications functionally. In such case, the code will\n // fall back to using regular Safe Types.\n trustedTypesPolicy = null;\n }\n }\n return trustedTypesPolicy;\n}\nexports.getTrustedTypesPolicy = getTrustedTypesPolicy;\n/** Helpers for tests. */\nexports.TEST_ONLY = {\n resetDefaults: function () {\n trustedTypesPolicy = undefined;\n trustedTypesPolicyName = 'google#safe';\n },\n setTrustedTypesPolicyName: function (name) {\n trustedTypesPolicyName = name;\n },\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {safeAttrPrefix} from 'safevalues';\nimport {safeElement} from 'safevalues/dom';\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nfunction toCamelCase(str: string) {\n // tslint:disable-next-line:enforce-name-casing\n return String(str).replace(/\\-([a-z])/g, (_, match) => match.toUpperCase());\n}\n\n/** MDC Component base */\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: HTMLElement): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that\n // takes a root element and returns an instantiated component with its root\n // set to that element. Also note that in the cases of subclasses, an\n // explicit foundation class will not have to be passed in; it will simply\n // be initialized from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected foundation: FoundationType;\n\n constructor(\n public root: HTMLElement, foundation?: FoundationType,\n ...args: unknown[]) {\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's\n // default param so that this.root is defined and can be used within the\n // foundation class.\n this.foundation =\n foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation.init();\n this.initialSyncWithDOM();\n }\n\n /* istanbul ignore next: method param only exists for typing purposes; it does\n * not need to be unit tested */\n // tslint:disable-next-line:enforce-name-casing\n initialize(..._args: unknown[]) {\n // Subclasses can override this to do any additional setup work that would\n // be considered part of a \"constructor\". Essentially, it is a hook into the\n // parent constructor before the foundation is initialized. Any additional\n // arguments besides root and foundation will be passed in here.\n }\n\n getDefaultFoundation(): FoundationType {\n // Subclasses must override this method to return a properly configured\n // foundation class for the component.\n throw new Error(\n 'Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n }\n\n initialSyncWithDOM() {\n // Subclasses should override this method if they need to perform work to\n // synchronize with a host DOM object. An example of this would be a form\n // control wrapper that needs to synchronize its internal state to some\n // property or attribute of the host DOM. Please note: this is *not* the\n // place to perform DOM reads/writes that would cause layout / paint, as\n // this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources /\n // deregister any listeners they have attached. An example of this might be\n // deregistering a resize event from the window object.\n this.foundation.destroy();\n }\n\n /**\n * Wrapper method to add an event listener to the component's root element.\n * This is most useful when listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>,\n options?: AddEventListenerOptions|boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>,\n options?: AddEventListenerOptions|boolean): void;\n listen(\n evtType: string, handler: EventListener,\n options?: AddEventListenerOptions|boolean) {\n this.root.addEventListener(evtType, handler, options);\n }\n\n /**\n * Wrapper method to remove an event listener to the component's root element.\n * This is most useful when unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>,\n options?: AddEventListenerOptions|boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>,\n options?: AddEventListenerOptions|boolean): void;\n unlisten(\n evtType: string, handler: EventListener,\n options?: AddEventListenerOptions|boolean) {\n this.root.removeEventListener(evtType, handler, options);\n }\n\n /**\n * Fires a cross-browser-compatible custom event from the component root of\n * the given type, with the given data.\n */\n emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt: CustomEvent<T>;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n this.root.dispatchEvent(evt);\n }\n\n /**\n * This is a intermediate fix to allow components to use safevalues. This\n * limits setAttribute to setting tabindex, data attributes, and aria\n * attributes.\n *\n * TODO(b/263990206): remove this method and add these directly in each\n * component. This will remove this abstraction and make it clear that the\n * caller can't set any attribute.\n */\n protected safeSetAttribute(\n element: HTMLElement,\n attribute: string,\n value: string,\n ) {\n if (attribute.toLowerCase() === 'tabindex') {\n element.tabIndex = Number(value);\n } else if (attribute.indexOf('data-') === 0) {\n const dataKey = toCamelCase(attribute.replace(/^data-/, ''));\n element.dataset[dataKey] = value;\n } else {\n safeElement.setPrefixedAttribute(\n [safeAttrPrefix`aria-`, safeAttrPrefix`role`],\n element,\n attribute,\n value,\n );\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** MDC Foundation */\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): {[key: string]: string} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports every CSS class the foundation class needs as a\n // property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): {[key: string]: string} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports all semantic strings as constants. e.g. {ARIA_ROLE:\n // 'tablist'}\n return {};\n }\n\n static get numbers(): {[key: string]: number} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports all of its semantic numbers as constants.\n // e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in\n // order to provide a convenient way of viewing the necessary methods of an\n // adapter. In the future, this could also be used for adapter validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines\n // (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization\n // routines (de-registering events, etc.)\n }\n}\n\n/**\n * The constructor for MDCFoundation.\n */\nexport interface MDCFoundationConstructor<AdapterType extends object = any> {\n new(adapter: AdapterType): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * The deprecated constructor for MDCFoundation.\n */\nexport interface MDCFoundationDeprecatedConstructor<\n AdapterType extends object = any> {\n readonly cssClasses: Record<string, string>;\n readonly strings: Record<string, string>;\n readonly numbers: Record<string, number>;\n readonly defaultAdapter: AdapterType;\n\n new(adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * Retrieves the AdapaterType from the provided MDCFoundation generic type.\n */\nexport type MDCFoundationAdapter<T> =\n T extends MDCFoundation<infer A>? A : never;\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * KEY provides normalized string values for keys.\n */\nexport const KEY = {\n UNKNOWN: 'Unknown',\n BACKSPACE: 'Backspace',\n ENTER: 'Enter',\n SPACEBAR: 'Spacebar',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n END: 'End',\n HOME: 'Home',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n DELETE: 'Delete',\n ESCAPE: 'Escape',\n TAB: 'Tab',\n};\n\nconst normalizedKeys = new Set<string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nnormalizedKeys.add(KEY.BACKSPACE);\nnormalizedKeys.add(KEY.ENTER);\nnormalizedKeys.add(KEY.SPACEBAR);\nnormalizedKeys.add(KEY.PAGE_UP);\nnormalizedKeys.add(KEY.PAGE_DOWN);\nnormalizedKeys.add(KEY.END);\nnormalizedKeys.add(KEY.HOME);\nnormalizedKeys.add(KEY.ARROW_LEFT);\nnormalizedKeys.add(KEY.ARROW_UP);\nnormalizedKeys.add(KEY.ARROW_RIGHT);\nnormalizedKeys.add(KEY.ARROW_DOWN);\nnormalizedKeys.add(KEY.DELETE);\nnormalizedKeys.add(KEY.ESCAPE);\nnormalizedKeys.add(KEY.TAB);\n\nconst KEY_CODE = {\n BACKSPACE: 8,\n ENTER: 13,\n SPACEBAR: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n DELETE: 46,\n ESCAPE: 27,\n TAB: 9,\n};\n\nconst mappedKeyCodes = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nmappedKeyCodes.set(KEY_CODE.BACKSPACE, KEY.BACKSPACE);\nmappedKeyCodes.set(KEY_CODE.ENTER, KEY.ENTER);\nmappedKeyCodes.set(KEY_CODE.SPACEBAR, KEY.SPACEBAR);\nmappedKeyCodes.set(KEY_CODE.PAGE_UP, KEY.PAGE_UP);\nmappedKeyCodes.set(KEY_CODE.PAGE_DOWN, KEY.PAGE_DOWN);\nmappedKeyCodes.set(KEY_CODE.END, KEY.END);\nmappedKeyCodes.set(KEY_CODE.HOME, KEY.HOME);\nmappedKeyCodes.set(KEY_CODE.ARROW_LEFT, KEY.ARROW_LEFT);\nmappedKeyCodes.set(KEY_CODE.ARROW_UP, KEY.ARROW_UP);\nmappedKeyCodes.set(KEY_CODE.ARROW_RIGHT, KEY.ARROW_RIGHT);\nmappedKeyCodes.set(KEY_CODE.ARROW_DOWN, KEY.ARROW_DOWN);\nmappedKeyCodes.set(KEY_CODE.DELETE, KEY.DELETE);\nmappedKeyCodes.set(KEY_CODE.ESCAPE, KEY.ESCAPE);\nmappedKeyCodes.set(KEY_CODE.TAB, KEY.TAB);\n\nconst navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand.\nnavigationKeys.add(KEY.PAGE_UP);\nnavigationKeys.add(KEY.PAGE_DOWN);\nnavigationKeys.add(KEY.END);\nnavigationKeys.add(KEY.HOME);\nnavigationKeys.add(KEY.ARROW_LEFT);\nnavigationKeys.add(KEY.ARROW_UP);\nnavigationKeys.add(KEY.ARROW_RIGHT);\nnavigationKeys.add(KEY.ARROW_DOWN);\n\n/**\n * normalizeKey returns the normalized string for a navigational action.\n */\nexport function normalizeKey(evt: KeyboardEvent): string {\n const {key} = evt;\n // If the event already has a normalized key, return it\n if (normalizedKeys.has(key)) {\n return key;\n }\n\n // tslint:disable-next-line:deprecation\n const mappedKey = mappedKeyCodes.get(evt.keyCode);\n if (mappedKey) {\n return mappedKey;\n }\n return KEY.UNKNOWN;\n}\n\n/**\n * isNavigationEvent returns whether the event is a navigation event\n */\nexport function isNavigationEvent(evt: KeyboardEvent): boolean {\n return navigationKeys.has(normalizeKey(evt));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global\n * prototype chain. This makes ponyfills safer than traditional polyfills,\n * especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element|null {\n if (element.closest) {\n return element.closest(selector);\n }\n\n let el: Element|null = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\n\n/** Element.matches with support for webkit and IE. */\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches || element.webkitMatchesSelector ||\n (element as any).msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n const htmlEl = element as HTMLElement;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n\n const clone = htmlEl.cloneNode(true) as HTMLElement;\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n const scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCListAdapter {\n /**\n * Returns the attribute value of list item at given `index`.\n */\n getAttributeForElementIndex(index: number, attr: string): string|null;\n\n getListItemCount(): number;\n\n getFocusedElementIndex(): number;\n\n setAttributeForElementIndex(index: number, attribute: string, value: string):\n void;\n\n addClassForElementIndex(index: number, className: string): void;\n\n removeClassForElementIndex(index: number, className: string): void;\n\n /**\n * Focuses list item at the index specified.\n */\n focusItemAtIndex(index: number): void;\n\n /**\n * Sets the tabindex to the value specified for all button/a element children\n * of the list item at the index specified.\n */\n setTabIndexForListItemChildren(listItemIndex: number, tabIndexValue: string):\n void;\n\n /**\n * @return true if radio button is present at given list item index.\n */\n hasRadioAtIndex(index: number): boolean;\n\n /**\n * @return true if checkbox is present at given list item index.\n */\n hasCheckboxAtIndex(index: number): boolean;\n\n /**\n * @return true if checkbox inside a list item is checked.\n */\n isCheckboxCheckedAtIndex(index: number): boolean;\n\n /**\n * @return true if root element is focused.\n */\n isRootFocused(): boolean;\n\n /**\n * @param index list item index.\n * @param className the name of the class whose presence is to be checked.\n * @return true if list item at `index` has class `className`.\n */\n listItemAtIndexHasClass(index: number, className: string): boolean;\n\n /**\n * Sets the checked status of checkbox or radio at given list item index.\n */\n setCheckedCheckboxOrRadioAtIndex(index: number, isChecked: boolean): void;\n\n /**\n * Notifies user action on list item.\n */\n notifyAction(index: number): void;\n\n /**\n * Notifies that items at the given indices have changed its\n * selection state through user interaction (e.g. click).\n *\n * This is invoked only for changes caused by user interaction\n * to match with the native `change` event semantics.\n */\n notifySelectionChange(changedIndices: number[]): void;\n\n /**\n * @return true when the current focused element is inside list root.\n */\n isFocusInsideList(): boolean;\n\n /**\n * @return the primary text content of the list item at index.\n */\n getPrimaryTextAtIndex(index: number): string;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest, matches} from '@material/dom/ponyfill';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, deprecatedClassNameMap, evolutionAttribute, evolutionClassNameMap, numbers, strings} from './constants';\nimport {MDCListFoundation} from './foundation';\nimport {MDCListActionEventDetail, MDCListIndex, MDCListSelectionChangeDetail} from './types';\n\n/** MDC List Factory */\nexport type MDCListFactory =\n (el: HTMLElement, foundation?: MDCListFoundation) => MDCList;\n\n/** MDC List */\nexport class MDCList extends MDCComponent<MDCListFoundation> {\n set vertical(value: boolean) {\n this.foundation.setVerticalOrientation(value);\n }\n\n get listElements() {\n return Array.from(this.root.querySelectorAll<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`));\n }\n\n set wrapFocus(value: boolean) {\n this.foundation.setWrapFocus(value);\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n get typeaheadInProgress(): boolean {\n return this.foundation.isTypeaheadInProgress();\n }\n\n /**\n * Sets whether typeahead functionality is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n set hasTypeahead(hasTypeahead: boolean) {\n this.foundation.setHasTypeahead(hasTypeahead);\n }\n\n set singleSelection(isSingleSelectionList: boolean) {\n this.foundation.setSingleSelection(isSingleSelectionList);\n }\n\n set disabledItemsFocusable(areDisabledItemsFocusable: boolean) {\n this.foundation.setDisabledItemsFocusable(areDisabledItemsFocusable);\n }\n\n get selectedIndex(): MDCListIndex {\n return this.foundation.getSelectedIndex();\n }\n\n set selectedIndex(index: MDCListIndex) {\n this.foundation.setSelectedIndex(index);\n }\n\n static override attachTo(root: HTMLElement) {\n return new MDCList(root);\n }\n\n // The follow are assigned in initialSyncWithDOM().\n private handleKeydown!: SpecificEventListener<'keydown'>;\n private handleClick!: SpecificEventListener<'click'>;\n private focusInEventListener!: SpecificEventListener<'focus'>;\n private focusOutEventListener!: SpecificEventListener<'focus'>;\n\n // This mapping provides a layer of indirection from legacy classes to\n // evolution classes, since there are some inconsistencies between the\n // two.\n // TODO(b/176814973): remove this map when evolution is launched.\n private classNameMap!: {[className: string]: string};\n private isEvolutionEnabled!: boolean;\n private isInteractive!: boolean;\n\n override initialSyncWithDOM() {\n this.isEvolutionEnabled = evolutionAttribute in this.root.dataset;\n\n if (this.isEvolutionEnabled) {\n this.classNameMap = evolutionClassNameMap;\n } else if (matches(this.root, strings.DEPRECATED_SELECTOR)) {\n this.classNameMap = deprecatedClassNameMap;\n } else {\n this.classNameMap =\n Object.values(cssClasses)\n .reduce((obj: {[className: string]: string}, className) => {\n obj[className] = className;\n return obj;\n }, {});\n }\n\n this.handleClick = this.handleClickEvent.bind(this);\n this.handleKeydown = this.handleKeydownEvent.bind(this);\n this.focusInEventListener = this.handleFocusInEvent.bind(this);\n this.focusOutEventListener = this.handleFocusOutEvent.bind(this);\n this.listen('keydown', this.handleKeydown);\n this.listen('click', this.handleClick);\n this.listen('focusin', this.focusInEventListener);\n this.listen('focusout', this.focusOutEventListener);\n this.layout();\n this.initializeListType();\n this.ensureFocusable();\n }\n\n override destroy() {\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten('click', this.handleClick);\n this.unlisten('focusin', this.focusInEventListener);\n this.unlisten('focusout', this.focusOutEventListener);\n }\n\n layout() {\n const direction = this.root.getAttribute(strings.ARIA_ORIENTATION);\n this.vertical = direction !== strings.ARIA_ORIENTATION_HORIZONTAL;\n\n const itemSelector =\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not([tabindex])`;\n const childSelector = strings.FOCUSABLE_CHILD_ELEMENTS;\n\n // List items need to have at least tabindex=-1 to be focusable.\n const itemEls = this.root.querySelectorAll<HTMLElement>(itemSelector);\n if (itemEls.length) {\n Array.prototype.forEach.call(itemEls, (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n }\n\n // Child button/a elements are not tabbable until the list item is focused.\n const focusableChildEls =\n this.root.querySelectorAll<HTMLElement>(childSelector);\n if (focusableChildEls.length) {\n Array.prototype.forEach.call(focusableChildEls, (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n }\n\n if (this.isEvolutionEnabled) {\n this.foundation.setUseSelectedAttribute(true);\n }\n this.foundation.layout();\n }\n\n /**\n * Extracts the primary text from a list item.\n * @param item The list item element.\n * @return The primary text in the element.\n */\n getPrimaryText(item: Element): string {\n const primaryText = item.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS]}`);\n if (this.isEvolutionEnabled || primaryText) {\n return primaryText?.textContent ?? '';\n }\n\n const singleLineText = item.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_TEXT_CLASS]}`);\n return (singleLineText && singleLineText.textContent) || '';\n }\n\n /**\n * Initialize selectedIndex value based on pre-selected list items.\n */\n initializeListType() {\n this.isInteractive =\n matches(this.root, strings.ARIA_INTERACTIVE_ROLES_SELECTOR);\n\n if (this.isEvolutionEnabled && this.isInteractive) {\n const selection = Array.from(\n this.root.querySelectorAll<HTMLElement>(\n strings.SELECTED_ITEM_SELECTOR),\n (listItem) => this.listElements.indexOf(listItem));\n\n if (matches(this.root, strings.ARIA_MULTI_SELECTABLE_SELECTOR)) {\n this.selectedIndex = selection;\n } else if (selection.length > 0) {\n this.selectedIndex = selection[0];\n }\n return;\n }\n\n const checkboxListItems = this.root.querySelectorAll<HTMLElement>(\n strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n const radioSelectedListItem = this.root.querySelector<HTMLElement>(\n strings.ARIA_CHECKED_RADIO_SELECTOR);\n\n if (checkboxListItems.length) {\n const preselectedItems = this.root.querySelectorAll<HTMLElement>(\n strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex = Array.from(\n preselectedItems, (listItem) => this.listElements.indexOf(listItem));\n } else if (radioSelectedListItem) {\n this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);\n }\n }\n\n /**\n * Updates the list item at itemIndex to the desired isEnabled state.\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean) {\n this.foundation.setEnabled(itemIndex, isEnabled);\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Defaults to\n * the currently focused index.\n * @return The index of the matched item.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n return this.foundation.typeaheadMatchItem(\n nextChar, startingIndex, /** skipFocus */ true);\n }\n\n override getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCListAdapter = {\n addClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.add(this.classNameMap[className]);\n }\n },\n focusItemAtIndex: (index) => {\n this.listElements[index]?.focus();\n },\n getAttributeForElementIndex: (index, attr) =>\n this.listElements[index].getAttribute(attr),\n getFocusedElementIndex: () =>\n this.listElements.indexOf(document.activeElement as HTMLElement),\n getListItemCount: () => this.listElements.length,\n getPrimaryTextAtIndex: (index) =>\n this.getPrimaryText(this.listElements[index]),\n hasCheckboxAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector<HTMLElement>(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector<HTMLElement>(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: (index) => {\n const listItem = this.listElements[index];\n const toggleEl =\n listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_SELECTOR);\n return toggleEl!.checked;\n },\n isFocusInsideList: () => {\n return this.root !== document.activeElement &&\n this.root.contains(document.activeElement);\n },\n isRootFocused: () => document.activeElement === this.root,\n listItemAtIndexHasClass: (index, className) =>\n this.listElements[index].classList.contains(\n this.classNameMap[className]),\n notifyAction: (index) => {\n this.emit<MDCListActionEventDetail>(\n strings.ACTION_EVENT, {index}, /** shouldBubble */ true);\n },\n notifySelectionChange: (changedIndices: number[]) => {\n this.emit<MDCListSelectionChangeDetail>(\n strings.SELECTION_CHANGE_EVENT, {changedIndices},\n /** shouldBubble */ true);\n },\n removeClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.remove(this.classNameMap[className]);\n }\n },\n setAttributeForElementIndex: (index, attr, value) => {\n const element = this.listElements[index];\n if (element) {\n this.safeSetAttribute(element, attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: (index, isChecked) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(\n strings.CHECKBOX_RADIO_SELECTOR);\n toggleEl!.checked = isChecked;\n\n const event = document.createEvent('Event');\n event.initEvent('change', true, true);\n toggleEl!.dispatchEvent(event);\n },\n setTabIndexForListItemChildren: (listItemIndex, tabIndexValue) => {\n const element = this.listElements[listItemIndex];\n const selector = strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;\n Array.prototype.forEach.call(\n element.querySelectorAll<HTMLElement>(selector),\n (el: HTMLElement) => {\n el.tabIndex = Number(tabIndexValue);\n });\n },\n };\n return new MDCListFoundation(adapter);\n }\n\n /**\n * Ensures that at least one item is focusable if the list is interactive and\n * doesn't specify a suitable tabindex.\n */\n private ensureFocusable() {\n if (this.isEvolutionEnabled && this.isInteractive) {\n if (!this.root.querySelector(`.${\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]}[tabindex=\"0\"]`)) {\n const index = this.initialFocusIndex();\n if (index !== -1) {\n this.listElements[index].tabIndex = 0;\n }\n }\n }\n }\n\n private initialFocusIndex(): number {\n if (this.selectedIndex instanceof Array && this.selectedIndex.length > 0) {\n return this.selectedIndex[0];\n }\n if (typeof this.selectedIndex === 'number' &&\n this.selectedIndex !== numbers.UNSET_INDEX) {\n return this.selectedIndex;\n }\n const el = this.root.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not(.${\n this.classNameMap[cssClasses.LIST_ITEM_DISABLED_CLASS]})`);\n if (el === null) {\n return -1;\n }\n return this.getListItemIndex(el);\n }\n\n /**\n * Used to figure out which list item this event is targeting. Or returns -1\n * if there is no list item\n */\n private getListItemIndex(el: Element) {\n const nearestParent = closest(\n el,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}, .${\n this.classNameMap[cssClasses.ROOT]}`);\n\n // Get the index of the element if it is a list item.\n if (nearestParent &&\n matches(\n nearestParent,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`)) {\n return this.listElements.indexOf(nearestParent as HTMLElement);\n }\n\n return -1;\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusInEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusIn(index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusOutEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusOut(index);\n }\n\n /**\n * Used to figure out which element was focused when keydown event occurred\n * before sending the event to the foundation.\n */\n private handleKeydownEvent(evt: KeyboardEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n this.foundation.handleKeydown(\n evt,\n target.classList.contains(\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]),\n index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleClickEvent(evt: MouseEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n this.foundation.handleClick(\n index, matches(target, strings.CHECKBOX_RADIO_SELECTOR), evt);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated',\n LIST_ITEM_CLASS: 'mdc-list-item',\n LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled',\n LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',\n LIST_ITEM_TEXT_CLASS: 'mdc-list-item__text',\n LIST_ITEM_PRIMARY_TEXT_CLASS: 'mdc-list-item__primary-text',\n ROOT: 'mdc-list',\n};\n\nconst evolutionClassNameMap = {\n [`${cssClasses.LIST_ITEM_ACTIVATED_CLASS}`]: 'mdc-list-item--activated',\n [`${cssClasses.LIST_ITEM_CLASS}`]: 'mdc-list-item',\n [`${cssClasses.LIST_ITEM_DISABLED_CLASS}`]: 'mdc-list-item--disabled',\n [`${cssClasses.LIST_ITEM_SELECTED_CLASS}`]: 'mdc-list-item--selected',\n [`${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`]: 'mdc-list-item__primary-text',\n [`${cssClasses.ROOT}`]: 'mdc-list',\n};\n\nconst deprecatedClassNameMap = {\n [`${cssClasses.LIST_ITEM_ACTIVATED_CLASS}`]:\n 'mdc-deprecated-list-item--activated',\n [`${cssClasses.LIST_ITEM_CLASS}`]: 'mdc-deprecated-list-item',\n [`${cssClasses.LIST_ITEM_DISABLED_CLASS}`]:\n 'mdc-deprecated-list-item--disabled',\n [`${cssClasses.LIST_ITEM_SELECTED_CLASS}`]:\n 'mdc-deprecated-list-item--selected',\n [`${cssClasses.LIST_ITEM_TEXT_CLASS}`]: 'mdc-deprecated-list-item__text',\n [`${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`]:\n 'mdc-deprecated-list-item__primary-text',\n [`${cssClasses.ROOT}`]: 'mdc-deprecated-list',\n};\n\nconst strings = {\n ACTION_EVENT: 'MDCList:action',\n SELECTION_CHANGE_EVENT: 'MDCList:selectionChange',\n ARIA_CHECKED: 'aria-checked',\n ARIA_CHECKED_CHECKBOX_SELECTOR: '[role=\"checkbox\"][aria-checked=\"true\"]',\n ARIA_CHECKED_RADIO_SELECTOR: '[role=\"radio\"][aria-checked=\"true\"]',\n ARIA_CURRENT: 'aria-current',\n ARIA_DISABLED: 'aria-disabled',\n ARIA_ORIENTATION: 'aria-orientation',\n ARIA_ORIENTATION_HORIZONTAL: 'horizontal',\n ARIA_ROLE_CHECKBOX_SELECTOR: '[role=\"checkbox\"]',\n ARIA_SELECTED: 'aria-selected',\n ARIA_INTERACTIVE_ROLES_SELECTOR: '[role=\"listbox\"], [role=\"menu\"]',\n ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable=\"true\"]',\n CHECKBOX_RADIO_SELECTOR: 'input[type=\"checkbox\"], input[type=\"radio\"]',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a,\n .${\n deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} button:not(:disabled),\n .${deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} a\n `,\n DEPRECATED_SELECTOR: '.mdc-deprecated-list',\n FOCUSABLE_CHILD_ELEMENTS: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a,\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"radio\"]:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"checkbox\"]:not(:disabled),\n .${\n deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} button:not(:disabled),\n .${deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} a,\n .${\n deprecatedClassNameMap\n [cssClasses.LIST_ITEM_CLASS]} input[type=\"radio\"]:not(:disabled),\n .${\n deprecatedClassNameMap\n [cssClasses.LIST_ITEM_CLASS]} input[type=\"checkbox\"]:not(:disabled)\n `,\n RADIO_SELECTOR: 'input[type=\"radio\"]',\n SELECTED_ITEM_SELECTOR: '[aria-selected=\"true\"], [aria-current=\"true\"]',\n};\n\nconst numbers = {\n UNSET_INDEX: -1,\n TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300\n};\n\nconst evolutionAttribute = 'evolution';\n\nexport {\n strings,\n cssClasses,\n numbers,\n deprecatedClassNameMap,\n evolutionAttribute,\n evolutionClassNameMap\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\n\n/**\n * Ensures that preventDefault is only called if the containing element\n * doesn't consume the event, and it will cause an unintended scroll.\n *\n * @param evt keyboard event to be prevented.\n */\nexport const preventDefaultEvent = (evt: KeyboardEvent) => {\n const target = evt.target as Element;\n if (!target) {\n return;\n }\n const tagName = `${target.tagName}`.toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {preventDefaultEvent} from './events';\nimport * as typeahead from './typeahead';\nimport {MDCListIndex, MDCListTextAndIndex} from './types';\n\nfunction isNumberArray(selectedIndex: MDCListIndex): selectedIndex is number[] {\n return selectedIndex instanceof Array;\n}\n\n/**\n * Options for configuring how to update a selectable list item.\n */\ninterface SelectionUpdateOptions {\n /** Whether the update was triggered by a user interaction. */\n isUserInteraction?: boolean;\n /**\n * Whether the UI should be updated regardless of whether the\n * selection would be a noop according to the foundation state.\n * https://github.com/material-components/material-components-web/commit/5d060518804437aa1ae3152562f1bb78b1af4aa6.\n */\n forceUpdate?: boolean;\n /**\n * Whether disabled items should be omitted from updates. This is most\n * relevant when trying to update all the items in a selection list.\n */\n omitDisabledItems?: boolean;\n}\n\n/** List of modifier keys to consider while handling keyboard events. */\nconst handledModifierKeys = ['Alt', 'Control', 'Meta', 'Shift'] as const;\n\n/** Type representing a modifier key we handle. */\ntype ModifierKey = NonNullable<(typeof handledModifierKeys)[number]>;\n\n/** Checks if the event has the given modifier keys. */\nfunction createModifierChecker(event?: KeyboardEvent|MouseEvent) {\n const eventModifiers = new Set(\n event ? handledModifierKeys.filter(m => event.getModifierState(m)) : []);\n return (modifiers: ModifierKey[]) =>\n modifiers.every(m => eventModifiers.has(m)) &&\n modifiers.length === eventModifiers.size;\n}\n\n/** MDC List Foundation */\nexport class MDCListFoundation extends MDCFoundation<MDCListAdapter> {\n static override get strings() {\n return strings;\n }\n\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n static override get defaultAdapter(): MDCListAdapter {\n return {\n addClassForElementIndex: () => undefined,\n focusItemAtIndex: () => undefined,\n getAttributeForElementIndex: () => null,\n getFocusedElementIndex: () => 0,\n getListItemCount: () => 0,\n hasCheckboxAtIndex: () => false,\n hasRadioAtIndex: () => false,\n isCheckboxCheckedAtIndex: () => false,\n isFocusInsideList: () => false,\n isRootFocused: () => false,\n listItemAtIndexHasClass: () => false,\n notifyAction: () => undefined,\n notifySelectionChange: () => {},\n removeClassForElementIndex: () => undefined,\n setAttributeForElementIndex: () => undefined,\n setCheckedCheckboxOrRadioAtIndex: () => undefined,\n setTabIndexForListItemChildren: () => undefined,\n getPrimaryTextAtIndex: () => '',\n };\n }\n\n private wrapFocus = false;\n private isVertical = true;\n private isSingleSelectionList = false;\n private areDisabledItemsFocusable = false;\n private selectedIndex: MDCListIndex = numbers.UNSET_INDEX;\n private focusedItemIndex = numbers.UNSET_INDEX;\n private useActivatedClass = false;\n private useSelectedAttr = false;\n private ariaCurrentAttrValue: string|null = null;\n private isCheckboxList = false;\n private isRadioList = false;\n private lastSelectedIndex: number|null = null;\n\n private hasTypeahead = false;\n // Transiently holds current typeahead prefix from user.\n private readonly typeaheadState = typeahead.initState();\n private sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n constructor(adapter?: Partial<MDCListAdapter>) {\n super({...MDCListFoundation.defaultAdapter, ...adapter});\n }\n\n layout() {\n if (this.adapter.getListItemCount() === 0) {\n return;\n }\n\n // TODO(b/172274142): consider all items when determining the list's type.\n if (this.adapter.hasCheckboxAtIndex(0)) {\n this.isCheckboxList = true;\n this.selectedIndex = [];\n } else if (this.adapter.hasRadioAtIndex(0)) {\n this.isRadioList = true;\n } else {\n this.maybeInitializeSingleSelection();\n }\n\n if (this.hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /** Returns the index of the item that was last focused. */\n getFocusedItemIndex() {\n return this.focusedItemIndex;\n }\n\n /** Toggles focus wrapping with keyboard navigation. */\n setWrapFocus(value: boolean) {\n this.wrapFocus = value;\n }\n\n /**\n * Toggles orientation direction for keyboard navigation (true for vertical,\n * false for horizontal).\n */\n setVerticalOrientation(value: boolean) {\n this.isVertical = value;\n }\n\n /** Toggles single-selection behavior. */\n setSingleSelection(value: boolean) {\n this.isSingleSelectionList = value;\n if (value) {\n this.maybeInitializeSingleSelection();\n this.selectedIndex = this.getSelectedIndexFromDOM();\n }\n }\n\n setDisabledItemsFocusable(value: boolean) {\n this.areDisabledItemsFocusable = value;\n }\n\n /**\n * Automatically determines whether the list is single selection list. If so,\n * initializes the internal state to match the selected item.\n */\n private maybeInitializeSingleSelection() {\n const selectedItemIndex = this.getSelectedIndexFromDOM();\n if (selectedItemIndex === numbers.UNSET_INDEX) return;\n\n const hasActivatedClass = this.adapter.listItemAtIndexHasClass(\n selectedItemIndex, cssClasses.LIST_ITEM_ACTIVATED_CLASS);\n if (hasActivatedClass) {\n this.setUseActivatedClass(true);\n }\n this.isSingleSelectionList = true;\n this.selectedIndex = selectedItemIndex;\n }\n\n /** @return Index of the first selected item based on the DOM state. */\n private getSelectedIndexFromDOM() {\n let selectedIndex = numbers.UNSET_INDEX;\n const listItemsCount = this.adapter.getListItemCount();\n for (let i = 0; i < listItemsCount; i++) {\n const hasSelectedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_SELECTED_CLASS);\n const hasActivatedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_ACTIVATED_CLASS);\n if (!(hasSelectedClass || hasActivatedClass)) {\n continue;\n }\n\n selectedIndex = i;\n break;\n }\n\n return selectedIndex;\n }\n\n /**\n * Sets whether typeahead is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n setHasTypeahead(hasTypeahead: boolean) {\n this.hasTypeahead = hasTypeahead;\n if (hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n isTypeaheadInProgress(): boolean {\n return this.hasTypeahead &&\n typeahead.isTypingInProgress(this.typeaheadState);\n }\n\n /** Toggle use of the \"activated\" CSS class. */\n setUseActivatedClass(useActivated: boolean) {\n this.useActivatedClass = useActivated;\n }\n\n /**\n * Toggles use of the selected attribute (true for aria-selected, false for\n * aria-checked).\n */\n setUseSelectedAttribute(useSelected: boolean) {\n this.useSelectedAttr = useSelected;\n }\n\n getSelectedIndex(): MDCListIndex {\n return this.selectedIndex;\n }\n\n setSelectedIndex(index: MDCListIndex, options: SelectionUpdateOptions = {}) {\n if (!this.isIndexValid(index)) {\n return;\n }\n\n if (this.isCheckboxList) {\n this.setCheckboxAtIndex(index as number[], options);\n } else if (this.isRadioList) {\n this.setRadioAtIndex(index as number, options);\n } else {\n this.setSingleSelectionAtIndex(index as number, options);\n }\n }\n\n /**\n * Focus in handler for the list items.\n */\n handleFocusIn(listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.focusedItemIndex = listItemIndex;\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '0');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n }\n\n /**\n * Focus out handler for the list items.\n */\n handleFocusOut(listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '-1');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n\n /**\n * Between Focusout & Focusin some browsers do not have focus on any\n * element. Setting a delay to wait till the focus is moved to next element.\n */\n setTimeout(() => {\n if (!this.adapter.isFocusInsideList()) {\n this.setTabindexToFirstSelectedOrFocusedItem();\n }\n }, 0);\n }\n\n private isIndexDisabled(index: number) {\n return this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS);\n }\n\n /**\n * Key handler for the list.\n */\n handleKeydown(\n event: KeyboardEvent, isRootListItem: boolean, listItemIndex: number) {\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n // The keys for forward and back differ based on list orientation.\n const isForward =\n (this.isVertical && isArrowDown) || (!this.isVertical && isArrowRight);\n const isBack =\n (this.isVertical && isArrowUp) || (!this.isVertical && isArrowLeft);\n\n // Have to check both upper and lower case, because having caps lock on\n // affects the value.\n const isLetterA = event.key === 'A' || event.key === 'a';\n\n const eventHasModifiers = createModifierChecker(event);\n\n if (this.adapter.isRootFocused()) {\n if ((isBack || isEnd) && eventHasModifiers([])) {\n event.preventDefault();\n this.focusLastElement();\n } else if ((isForward || isHome) && eventHasModifiers([])) {\n event.preventDefault();\n this.focusFirstElement();\n } else if (\n isBack && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n event.preventDefault();\n const focusedIndex = this.focusLastElement();\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (\n isForward && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n event.preventDefault();\n const focusedIndex = this.focusFirstElement();\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: -1,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n\n return;\n }\n\n let currentIndex = this.adapter.getFocusedElementIndex();\n if (currentIndex === -1) {\n currentIndex = listItemIndex;\n if (currentIndex < 0) {\n // If this event doesn't have a mdc-list-item ancestor from the\n // current list (not from a sublist), return early.\n return;\n }\n }\n\n if (isForward && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusNextElement(currentIndex);\n } else if (isBack && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusPrevElement(currentIndex);\n } else if (\n isForward && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n preventDefaultEvent(event);\n const focusedIndex = this.focusNextElement(currentIndex);\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (isBack && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n preventDefaultEvent(event);\n const focusedIndex = this.focusPrevElement(currentIndex);\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (isHome && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusFirstElement();\n } else if (isEnd && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusLastElement();\n } else if (\n isHome && eventHasModifiers(['Control', 'Shift']) &&\n this.isCheckboxList) {\n preventDefaultEvent(event);\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n this.focusFirstElement();\n this.toggleCheckboxRange(0, currentIndex, currentIndex);\n } else if (\n isEnd && eventHasModifiers(['Control', 'Shift']) &&\n this.isCheckboxList) {\n preventDefaultEvent(event);\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n this.focusLastElement();\n this.toggleCheckboxRange(\n currentIndex, this.adapter.getListItemCount() - 1, currentIndex);\n } else if (\n isLetterA && eventHasModifiers(['Control']) && this.isCheckboxList) {\n event.preventDefault();\n this.checkboxListToggleAll(\n this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[],\n true);\n } else if (\n (isEnter || isSpace) &&\n (eventHasModifiers([]) || eventHasModifiers(['Alt']))) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers\n // synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n if (this.isSelectableList()) {\n this.setSelectedIndexOnAction(currentIndex, false);\n }\n this.adapter.notifyAction(currentIndex);\n }\n }\n } else if (\n (isEnter || isSpace) && eventHasModifiers(['Shift']) &&\n this.isCheckboxList) {\n // Return early if enter key is pressed on anchor element which triggers\n // synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n this.toggleCheckboxRange(\n this.lastSelectedIndex ?? currentIndex, currentIndex, currentIndex);\n this.adapter.notifyAction(currentIndex);\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {this.focusItemAtIndex(index)},\n focusedItemIndex: this.focusedItemIndex,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n }\n\n /**\n * Click handler for the list.\n *\n * @param index Index for the item that has been clicked.\n * @param isCheckboxAlreadyUpdatedInAdapter Whether the checkbox for\n * the list item has already been updated in the adapter. This attribute\n * should be set to `true` when e.g. the click event directly landed on\n * the underlying native checkbox element which would cause the checked\n * state to be already toggled within `adapter.isCheckboxCheckedAtIndex`.\n */\n handleClick(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean,\n event?: MouseEvent) {\n const eventHasModifiers = createModifierChecker(event);\n\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n\n if (this.isIndexDisabled(index)) {\n return;\n }\n\n if (eventHasModifiers([])) {\n if (this.isSelectableList()) {\n this.setSelectedIndexOnAction(index, isCheckboxAlreadyUpdatedInAdapter);\n }\n this.adapter.notifyAction(index);\n } else if (this.isCheckboxList && eventHasModifiers(['Shift'])) {\n this.toggleCheckboxRange(this.lastSelectedIndex ?? index, index, index);\n this.adapter.notifyAction(index);\n }\n }\n\n /**\n * Focuses the next element on the list.\n */\n focusNextElement(index: number) {\n const count = this.adapter.getListItemCount();\n let nextIndex = index;\n let firstChecked = null;\n\n do {\n nextIndex++;\n if (nextIndex >= count) {\n if (this.wrapFocus) {\n nextIndex = 0;\n } else {\n // Return early because last item is already focused.\n return index;\n }\n }\n if (nextIndex === firstChecked) {\n return -1;\n }\n firstChecked = firstChecked ?? nextIndex;\n } while (!this.areDisabledItemsFocusable &&\n this.isIndexDisabled(nextIndex));\n\n this.focusItemAtIndex(nextIndex);\n return nextIndex;\n }\n\n /**\n * Focuses the previous element on the list.\n */\n focusPrevElement(index: number) {\n const count = this.adapter.getListItemCount();\n let prevIndex = index;\n let firstChecked = null;\n\n do {\n prevIndex--;\n if (prevIndex < 0) {\n if (this.wrapFocus) {\n prevIndex = count - 1;\n } else {\n // Return early because first item is already focused.\n return index;\n }\n }\n if (prevIndex === firstChecked) {\n return -1;\n }\n firstChecked = firstChecked ?? prevIndex;\n } while (!this.areDisabledItemsFocusable &&\n this.isIndexDisabled(prevIndex));\n\n this.focusItemAtIndex(prevIndex);\n return prevIndex;\n }\n\n focusFirstElement() {\n // Pass -1 to `focusNextElement`, since it will incremement to 0 and focus\n // the first element.\n return this.focusNextElement(-1);\n }\n\n focusLastElement() {\n // Pass the length of the list to `focusNextElement` since it will decrement\n // to length - 1 and focus the last element.\n return this.focusPrevElement(this.adapter.getListItemCount());\n }\n\n focusInitialElement() {\n const initialIndex = this.getFirstSelectedOrFocusedItemIndex();\n if (initialIndex !== numbers.UNSET_INDEX) {\n this.focusItemAtIndex(initialIndex);\n }\n return initialIndex;\n }\n\n /**\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean): void {\n if (!this.isIndexValid(itemIndex, false)) {\n return;\n }\n\n if (isEnabled) {\n this.adapter.removeClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'false');\n } else {\n this.adapter.addClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'true');\n }\n }\n\n private setSingleSelectionAtIndex(\n index: number, options: SelectionUpdateOptions = {}) {\n if (this.selectedIndex === index && !options.forceUpdate) {\n return;\n }\n\n let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;\n if (this.useActivatedClass) {\n selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;\n }\n\n if (this.selectedIndex !== numbers.UNSET_INDEX) {\n this.adapter.removeClassForElementIndex(\n this.selectedIndex as number, selectedClassName);\n }\n\n this.setAriaForSingleSelectionAtIndex(index);\n this.setTabindexAtIndex(index);\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.addClassForElementIndex(index, selectedClassName);\n }\n\n this.selectedIndex = index;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && !options.forceUpdate) {\n this.adapter.notifySelectionChange([index]);\n }\n }\n\n /**\n * Sets aria attribute for single selection at given index.\n */\n private setAriaForSingleSelectionAtIndex(index: number) {\n // Detect the presence of aria-current and get the value only during list\n // initialization when it is in unset state.\n if (this.selectedIndex === numbers.UNSET_INDEX &&\n index !== numbers.UNSET_INDEX) {\n this.ariaCurrentAttrValue =\n this.adapter.getAttributeForElementIndex(index, strings.ARIA_CURRENT);\n }\n\n const isAriaCurrent = this.ariaCurrentAttrValue !== null;\n const ariaAttribute =\n isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n\n if (this.selectedIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex as number, ariaAttribute, 'false');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n const ariaAttributeValue =\n isAriaCurrent ? this.ariaCurrentAttrValue : 'true';\n this.adapter.setAttributeForElementIndex(\n index, ariaAttribute, ariaAttributeValue as string);\n }\n }\n\n /**\n * Returns the attribute to use for indicating selection status.\n */\n private getSelectionAttribute(): string {\n return this.useSelectedAttr ? strings.ARIA_SELECTED : strings.ARIA_CHECKED;\n }\n\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it\n * is already checked.\n */\n private setRadioAtIndex(index: number, options: SelectionUpdateOptions = {}) {\n const selectionAttribute = this.getSelectionAttribute();\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, true);\n\n if (this.selectedIndex === index && !options.forceUpdate) {\n return;\n }\n\n if (this.selectedIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex as number, selectionAttribute, 'false');\n }\n\n this.adapter.setAttributeForElementIndex(index, selectionAttribute, 'true');\n\n this.selectedIndex = index;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && !options.forceUpdate) {\n this.adapter.notifySelectionChange([index]);\n }\n }\n\n private setCheckboxAtIndex(\n indices: number[], options: SelectionUpdateOptions = {}) {\n const currentIndex = this.selectedIndex;\n // If this update is not triggered by a user interaction, we do not\n // need to know about the currently selected indices and can avoid\n // constructing the `Set` for performance reasons.\n const currentlySelected = options.isUserInteraction ?\n new Set(\n currentIndex === numbers.UNSET_INDEX ? [] :\n currentIndex as number[]) :\n null;\n const selectionAttribute = this.getSelectionAttribute();\n const changedIndices = [];\n\n for (let i = 0; i < this.adapter.getListItemCount(); i++) {\n if (options.omitDisabledItems && this.isIndexDisabled(i)) {\n continue;\n }\n const previousIsChecked = currentlySelected?.has(i);\n const newIsChecked = indices.indexOf(i) >= 0;\n\n // If the selection has changed for this item, we keep track of it\n // so that we can notify the adapter.\n if (newIsChecked !== previousIsChecked) {\n changedIndices.push(i);\n }\n\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, newIsChecked);\n this.adapter.setAttributeForElementIndex(\n i, selectionAttribute, newIsChecked ? 'true' : 'false');\n }\n\n this.selectedIndex = options.omitDisabledItems ?\n this.resolveSelectedIndices(indices) :\n indices;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && changedIndices.length) {\n this.adapter.notifySelectionChange(changedIndices);\n }\n }\n\n /**\n * Helper method for ensuring that the list of selected indices remains\n * accurate when calling setCheckboxAtIndex with omitDisabledItems set to\n * true.\n */\n private resolveSelectedIndices(setCheckedItems: number[]): number[] {\n const currentlySelectedItems = this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[];\n\n const currentlySelectedDisabledItems =\n currentlySelectedItems.filter(i => this.isIndexDisabled(i));\n const enabledSetCheckedItems =\n setCheckedItems.filter(i => !this.isIndexDisabled(i));\n\n // Updated selectedIndex should be the enabled setCheckedItems + any missing\n // selected disabled items.\n const updatedSelectedItems = [...new Set(\n [...enabledSetCheckedItems, ...currentlySelectedDisabledItems])];\n return updatedSelectedItems.sort((a, b) => a - b);\n }\n\n /**\n * Toggles the state of all checkboxes in the given range (inclusive) based\n * on the state of the checkbox at the `toggleIndex`. To determine whether\n * to set the given range to checked or unchecked, read the value of the\n * checkbox at the `toggleIndex` and negate it. Then apply that new checked\n * state to all checkboxes in the range.\n * @param fromIndex The start of the range of checkboxes to toggle\n * @param toIndex The end of the range of checkboxes to toggle\n * @param toggleIndex The index that will be used to determine the new state\n * of the given checkbox range.\n */\n private toggleCheckboxRange(\n fromIndex: number, toIndex: number, toggleIndex: number) {\n this.lastSelectedIndex = toggleIndex;\n const currentlySelected = new Set(\n this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[]);\n const newIsChecked = !currentlySelected?.has(toggleIndex);\n\n const [startIndex, endIndex] = [fromIndex, toIndex].sort();\n const selectionAttribute = this.getSelectionAttribute();\n const changedIndices = [];\n\n for (let i = startIndex; i <= endIndex; i++) {\n if (this.isIndexDisabled(i)) {\n continue;\n }\n const previousIsChecked = currentlySelected.has(i);\n\n // If the selection has changed for this item, we keep track of it\n // so that we can notify the adapter.\n if (newIsChecked !== previousIsChecked) {\n changedIndices.push(i);\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, newIsChecked);\n this.adapter.setAttributeForElementIndex(\n i, selectionAttribute, `${newIsChecked}`);\n if (newIsChecked) {\n currentlySelected.add(i);\n } else {\n currentlySelected.delete(i);\n }\n }\n }\n\n // If the selected value has changed, update and notify the selection\n // change to the adapter.\n if (changedIndices.length) {\n this.selectedIndex = [...currentlySelected];\n this.adapter.notifySelectionChange(changedIndices);\n }\n }\n\n private setTabindexAtIndex(index: number) {\n if (this.focusedItemIndex === numbers.UNSET_INDEX && index !== 0 &&\n index !== numbers.UNSET_INDEX) {\n // If some list item was selected set first list item's tabindex to -1.\n // Generally, tabindex is set to 0 on first list item of list that has\n // no preselected items.\n this.adapter.setAttributeForElementIndex(0, 'tabindex', '-1');\n } else if (this.focusedItemIndex >= 0 && this.focusedItemIndex !== index) {\n this.adapter.setAttributeForElementIndex(\n this.focusedItemIndex, 'tabindex', '-1');\n }\n\n // Set the previous selection's tabindex to -1. We need this because\n // in selection menus that are not visible, programmatically setting an\n // option will not change focus but will change where tabindex should be\n // 0.\n if (!(this.selectedIndex instanceof Array) &&\n this.selectedIndex !== index &&\n this.focusedItemIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex, 'tabindex', '-1');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(index, 'tabindex', '0');\n }\n }\n\n /**\n * @return Return true if it is single selectin list, checkbox list or radio\n * list.\n */\n private isSelectableList() {\n return this.isSingleSelectionList || this.isCheckboxList ||\n this.isRadioList;\n }\n\n private setTabindexToFirstSelectedOrFocusedItem() {\n const targetIndex = this.getFirstSelectedOrFocusedItemIndex();\n this.setTabindexAtIndex(targetIndex);\n }\n\n private getFirstSelectedOrFocusedItemIndex(): number {\n const firstFocusableListItem = this.getFirstEnabledItem();\n\n if (this.adapter.getListItemCount() === 0) {\n return numbers.UNSET_INDEX;\n }\n\n // Action lists retain focus on the most recently focused item.\n if (!this.isSelectableList()) {\n return Math.max(this.focusedItemIndex, firstFocusableListItem);\n }\n\n // Single-selection lists focus the selected item.\n if (typeof this.selectedIndex === 'number' &&\n this.selectedIndex !== numbers.UNSET_INDEX) {\n return this.areDisabledItemsFocusable &&\n this.isIndexDisabled(this.selectedIndex) ?\n firstFocusableListItem :\n this.selectedIndex;\n }\n\n // Multiple-selection lists focus the first enabled selected item.\n if (isNumberArray(this.selectedIndex) && this.selectedIndex.length > 0) {\n const sorted = [...this.selectedIndex].sort((a, b) => a - b);\n for (const index of sorted) {\n if (this.isIndexDisabled(index) && !this.areDisabledItemsFocusable) {\n continue;\n } else {\n return index;\n }\n }\n }\n\n // Selection lists without a selection focus the first item.\n return firstFocusableListItem;\n }\n\n\n private getFirstEnabledItem(): number {\n const listSize = this.adapter.getListItemCount();\n let i = 0;\n while (i < listSize) {\n if (!this.isIndexDisabled(i)) {\n break;\n }\n i++;\n }\n return i === listSize ? numbers.UNSET_INDEX : i;\n }\n\n private isIndexValid(index: MDCListIndex, validateListType = true) {\n if (index instanceof Array) {\n if (!this.isCheckboxList && validateListType) {\n throw new Error(\n 'MDCListFoundation: Array of index is only supported for checkbox based list');\n }\n\n if (index.length === 0) {\n return true;\n } else {\n return index.some((i) => this.isIndexInRange(i));\n }\n } else if (typeof index === 'number') {\n if (this.isCheckboxList && validateListType) {\n throw new Error(\n `MDCListFoundation: Expected array of index for checkbox based list but got number: ${\n index}`);\n }\n return this.isIndexInRange(index) ||\n this.isSingleSelectionList && index === numbers.UNSET_INDEX;\n } else {\n return false;\n }\n }\n\n private isIndexInRange(index: number) {\n const listSize = this.adapter.getListItemCount();\n return index >= 0 && index < listSize;\n }\n\n /**\n * Sets selected index on user action, toggles checkboxes in checkbox lists\n * by default, unless `isCheckboxAlreadyUpdatedInAdapter` is set to `true`.\n *\n * In cases where `isCheckboxAlreadyUpdatedInAdapter` is set to `true`, the\n * UI is just updated to reflect the value returned by the adapter.\n *\n * When calling this, make sure user interaction does not toggle disabled\n * list items.\n */\n private setSelectedIndexOnAction(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean) {\n this.lastSelectedIndex = index;\n if (this.isCheckboxList) {\n this.toggleCheckboxAtIndex(index, isCheckboxAlreadyUpdatedInAdapter);\n this.adapter.notifySelectionChange([index]);\n } else {\n this.setSelectedIndex(index, {isUserInteraction: true});\n }\n }\n\n private toggleCheckboxAtIndex(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean) {\n const selectionAttribute = this.getSelectionAttribute();\n const adapterIsChecked = this.adapter.isCheckboxCheckedAtIndex(index);\n\n // By default the checked value from the adapter is toggled unless the\n // checked state in the adapter has already been updated beforehand.\n // This can be happen when the underlying native checkbox has already\n // been updated through the native click event.\n let newCheckedValue;\n if (isCheckboxAlreadyUpdatedInAdapter) {\n newCheckedValue = adapterIsChecked;\n } else {\n newCheckedValue = !adapterIsChecked;\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, newCheckedValue)\n }\n\n this.adapter.setAttributeForElementIndex(\n index, selectionAttribute, newCheckedValue ? 'true' : 'false');\n\n // If none of the checkbox items are selected and selectedIndex is not\n // initialized then provide a default value.\n let selectedIndexes = this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n (this.selectedIndex as number[]).slice();\n\n if (newCheckedValue) {\n selectedIndexes.push(index);\n } else {\n selectedIndexes = selectedIndexes.filter((i) => i !== index);\n }\n\n this.selectedIndex = selectedIndexes;\n }\n\n private focusItemAtIndex(index: number) {\n this.adapter.focusItemAtIndex(index);\n this.focusedItemIndex = index;\n }\n\n private getEnabledListItemCount(): number {\n const listSize = this.adapter.getListItemCount();\n let adjustedCount = 0;\n for (let i = 0; i < listSize; i++) {\n if (!this.isIndexDisabled(i)) {\n adjustedCount++;\n }\n }\n return adjustedCount;\n }\n\n private checkboxListToggleAll(\n currentlySelectedIndices: number[], isUserInteraction: boolean) {\n const enabledListItemCount = this.getEnabledListItemCount();\n const totalListItemCount = this.adapter.getListItemCount();\n const currentlyEnabledSelectedIndices =\n currentlySelectedIndices.filter(i => !this.isIndexDisabled(i));\n\n // If all items are selected, deselect everything.\n // We check >= rather than === to `enabledListItemCount` since a disabled\n // item could be selected, and we don't take that into consideration when\n // toggling the other checkbox values.\n if (currentlyEnabledSelectedIndices.length >= enabledListItemCount) {\n // Use omitDisabledItems option to ensure disabled selected items are not\n // de-selected.\n this.setCheckboxAtIndex([], {isUserInteraction, omitDisabledItems: true});\n } else {\n // Otherwise select all enabled options.\n const allIndexes: number[] = [];\n for (let i = 0; i < totalListItemCount; i++) {\n if (!this.isIndexDisabled(i) ||\n currentlySelectedIndices.indexOf(i) > -1) {\n allIndexes.push(i);\n }\n }\n // Use omitDisabledItems option to ensure disabled selected items are not\n // de-selected.\n this.setCheckboxAtIndex(\n allIndexes, {isUserInteraction, omitDisabledItems: true});\n }\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only\n * relevant when starting a new match sequence. To start a new match\n * sequence, clear the buffer using `clearTypeaheadBuffer`, or wait for\n * the buffer to clear after a set interval defined in list foundation.\n * Defaults to the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(\n nextChar: string, startingIndex?: number, skipFocus = false) {\n const opts: typeahead.TypeaheadMatchItemOpts = {\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: startingIndex ? startingIndex : this.focusedItemIndex,\n nextChar,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n skipFocus,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index)\n };\n return typeahead.matchItem(opts, this.typeaheadState);\n }\n\n /**\n * Initializes the MDCListTextAndIndex data structure by indexing the\n * current list items by primary text.\n *\n * @return The primary texts of all the list items sorted by first\n * character.\n */\n private typeaheadInitSortedIndex() {\n return typeahead.initSortedIndex(\n this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);\n }\n\n /**\n * Clears the typeahead buffer.\n */\n clearTypeaheadBuffer() {\n typeahead.clearBuffer(this.typeaheadState);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCListFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {numbers} from './constants';\nimport {preventDefaultEvent} from './events';\nimport {MDCListTextAndIndex} from './types';\n\n/**\n * State of a typeahead instance.\n */\nexport interface TypeaheadState {\n typeaheadBuffer: string;\n currentFirstChar: string;\n sortedIndexCursor: number;\n bufferClearTimeout: number;\n}\n\n/**\n * Initializes a state object for typeahead. Use the same reference for calls to\n * typeahead functions.\n *\n * @return The current state of the typeahead process. Each state reference\n * represents a typeahead instance as the reference is typically mutated\n * in-place.\n */\nexport function initState(): TypeaheadState {\n const state: TypeaheadState = {\n bufferClearTimeout: 0,\n currentFirstChar: '',\n sortedIndexCursor: 0,\n typeaheadBuffer: '',\n };\n return state;\n}\n\n/**\n * Initializes typeahead state by indexing the current list items by primary\n * text into the sortedIndexByFirstChar data structure.\n *\n * @param listItemCount numer of items in the list\n * @param getPrimaryTextByItemIndex function that returns the primary text at a\n * given index\n *\n * @return Map that maps the first character of the primary text to the full\n * list text and its index\n */\nexport function initSortedIndex(\n listItemCount: number,\n getPrimaryTextByItemIndex: (index: number) =>\n string): Map<string, MDCListTextAndIndex[]> {\n const sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n // Aggregate item text to index mapping\n for (let i = 0; i < listItemCount; i++) {\n const primaryText = getPrimaryTextByItemIndex(i).trim();\n if (!primaryText) {\n continue;\n }\n\n const firstChar = primaryText[0].toLowerCase();\n if (!sortedIndexByFirstChar.has(firstChar)) {\n sortedIndexByFirstChar.set(firstChar, []);\n }\n sortedIndexByFirstChar.get(firstChar)!.push(\n {text: primaryText.toLowerCase(), index: i});\n }\n\n // Sort the mapping\n // TODO(b/157162694): Investigate replacing forEach with Map.values()\n sortedIndexByFirstChar.forEach((values) => {\n values.sort((first: MDCListTextAndIndex, second: MDCListTextAndIndex) => {\n return first.index - second.index;\n });\n });\n\n return sortedIndexByFirstChar;\n}\n\n/**\n * Arguments for matchItem\n */\nexport interface TypeaheadMatchItemOpts {\n focusItemAtIndex: (index: number) => void;\n nextChar: string;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n skipFocus: boolean;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Given the next desired character from the user, it attempts to find the next\n * list option matching the buffer. Wraps around if at the end of options.\n *\n * @param opts Options and accessors\n * - nextChar - the next character to match against items\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - skipFocus - whether or not to focus the matched item\n * - isItemAtIndexDisabled - function that determines whether an item at a\n * given index is disabled\n * @param state The typeahead state instance. See `initState`.\n *\n * @return The index of the matched item, or -1 if no match.\n */\nexport function matchItem(\n opts: TypeaheadMatchItemOpts, state: TypeaheadState): number {\n const {\n nextChar,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n focusedItemIndex,\n skipFocus,\n isItemAtIndexDisabled,\n } = opts;\n\n clearTimeout(state.bufferClearTimeout);\n\n state.bufferClearTimeout = setTimeout(() => {\n clearBuffer(state);\n }, numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS);\n\n state.typeaheadBuffer = state.typeaheadBuffer + nextChar;\n\n let index: number;\n if (state.typeaheadBuffer.length === 1) {\n index = matchFirstChar(\n sortedIndexByFirstChar, focusedItemIndex, isItemAtIndexDisabled, state);\n } else {\n index = matchAllChars(sortedIndexByFirstChar, isItemAtIndexDisabled, state);\n }\n\n if (index !== -1 && !skipFocus) {\n focusItemAtIndex(index);\n }\n return index;\n}\n\n/**\n * Matches the user's single input character in the buffer to the\n * next option that begins with such character. Wraps around if at\n * end of options. Returns -1 if no match is found.\n */\nfunction matchFirstChar(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n focusedItemIndex: number, isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Has the same firstChar been recently matched?\n // Also, did starting index remain the same between key presses?\n // If both hold true, simply increment index.\n if (firstChar === state.currentFirstChar &&\n itemsMatchingFirstChar[state.sortedIndexCursor].index ===\n focusedItemIndex) {\n state.sortedIndexCursor =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n\n const newIndex = itemsMatchingFirstChar[state.sortedIndexCursor].index;\n if (!isItemAtIndexDisabled(newIndex)) {\n return newIndex;\n }\n }\n\n // If we're here, it means one of the following happened:\n // - either firstChar or startingIndex has changed, invalidating the\n // cursor.\n // - The next item of typeahead is disabled, so we have to look further.\n state.currentFirstChar = firstChar;\n\n let newCursorPosition = -1;\n let cursorPosition;\n // Find the first non-disabled item as a fallback.\n for (cursorPosition = 0; cursorPosition < itemsMatchingFirstChar.length;\n cursorPosition++) {\n if (!isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n // Advance cursor to first item matching the firstChar that is positioned\n // after starting item. Cursor is unchanged from fallback if there's no\n // such item.\n for (; cursorPosition < itemsMatchingFirstChar.length; cursorPosition++) {\n if (itemsMatchingFirstChar[cursorPosition].index > focusedItemIndex &&\n !isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n if (newCursorPosition !== -1) {\n state.sortedIndexCursor = newCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Attempts to find the next item that matches all of the typeahead buffer.\n * Wraps around if at end of options. Returns -1 if no match is found.\n */\nfunction matchAllChars(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Do nothing if text already matches\n const startingItem = itemsMatchingFirstChar[state.sortedIndexCursor];\n if (startingItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0 &&\n !isItemAtIndexDisabled(startingItem.index)) {\n return startingItem.index;\n }\n\n // Find next item that matches completely; if no match, we'll eventually\n // loop around to same position\n let cursorPosition =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n let nextCursorPosition = -1;\n while (cursorPosition !== state.sortedIndexCursor) {\n const currentItem = itemsMatchingFirstChar[cursorPosition];\n\n const matches =\n currentItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0;\n const isEnabled = !isItemAtIndexDisabled(currentItem.index);\n if (matches && isEnabled) {\n nextCursorPosition = cursorPosition;\n break;\n }\n\n cursorPosition = (cursorPosition + 1) % itemsMatchingFirstChar.length;\n }\n\n if (nextCursorPosition !== -1) {\n state.sortedIndexCursor = nextCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Whether or not the given typeahead instaance state is currently typing.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function isTypingInProgress(state: TypeaheadState) {\n return state.typeaheadBuffer.length > 0;\n}\n\n/**\n * Options for handleKeydown.\n */\nexport interface HandleKeydownOpts {\n event: KeyboardEvent;\n isTargetListItem: boolean;\n focusItemAtIndex: (index: number) => void;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Clears the typeahaed buffer so that it resets item matching to the first\n * character.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function clearBuffer(state: TypeaheadState) {\n state.typeaheadBuffer = '';\n}\n\n/**\n * Given a keydown event, it calculates whether or not to automatically focus a\n * list item depending on what was typed mimicking the typeahead functionality\n * of a standard <select> element that is open.\n *\n * @param opts Options and accessors\n * - event - the KeyboardEvent to handle and parse\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - isItemAtFocusedIndexDisabled - whether or not the currently focused item\n * is disabled\n * - isTargetListItem - whether or not the event target is a list item\n * @param state The typeahead state instance. See `initState`.\n *\n * @return index of the item matched by the keydown. -1 if not matched.\n */\nexport function handleKeydown(opts: HandleKeydownOpts, state: TypeaheadState) {\n const {\n event,\n isTargetListItem,\n focusedItemIndex,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n isItemAtIndexDisabled,\n } = opts;\n\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n if (event.altKey || event.ctrlKey || event.metaKey || isArrowLeft ||\n isArrowUp || isArrowRight || isArrowDown || isHome || isEnd || isEnter) {\n return -1;\n }\n\n const isCharacterKey = !isSpace && event.key.length === 1;\n\n if (isCharacterKey) {\n preventDefaultEvent(event);\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: event.key.toLowerCase(),\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n return matchItem(matchItemOpts, state);\n }\n\n if (!isSpace) {\n return -1;\n }\n\n if (isTargetListItem) {\n preventDefaultEvent(event);\n }\n\n const typeaheadOnListItem = isTargetListItem && isTypingInProgress(state);\n\n if (typeaheadOnListItem) {\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: ' ',\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n // space participates in typeahead matching if in rapid typing mode\n return matchItem(matchItemOpts, state);\n }\n\n return -1;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport interface MDCListActionEventDetail {\n /**\n * Index of the list item that was activated.\n */\n index: number;\n}\n\nexport interface MDCListActionEvent extends Event {\n detail: MDCListActionEventDetail;\n}\n\n\nexport interface MDCListSelectionChangeDetail {\n /** Indices of the list items for which the selection changed. */\n changedIndices: number[];\n}\n\nexport interface MDCListSelectionChangeEvent extends Event {\n detail: MDCListSelectionChangeDetail;\n}\n\nexport type MDCListIndex = number|number[];\n\n/**\n * Type used by the typeahead mechanism to keep track of the index associated\n * with list item text.\n */\nexport interface MDCListTextAndIndex {\n text: string;\n index: number;\n}\n"],"sourceRoot":""}