UNPKG

balm-ui

Version:

A modular and customizable UI library based on Material Design and Vue 3

1 lines 54.4 kB
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define("UiChips",["vue"],e):"object"===typeof exports?exports.UiChips=e(require("vue")):t.UiChips=e(t.Vue)}("undefined"!==typeof self?self:this,(function(t){return function(){"use strict";var e={744:function(t){var e=function(t){return function(t){return!!t&&"object"===typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===i}(t)}(t)};var i="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((i=t,Array.isArray(i)?[]:{}),t,e):t;var i}function o(t,e,i){return t.concat(e).map((function(t){return n(t,i)}))}function r(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function a(t,e){try{return e in t}catch(i){return!1}}function s(t,e,i){var o={};return i.isMergeableObject(t)&&r(t).forEach((function(e){o[e]=n(t[e],i)})),r(e).forEach((function(r){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(a(t,r)&&i.isMergeableObject(e[r])?o[r]=function(t,e){if(!e.customMerge)return c;var i=e.customMerge(t);return"function"===typeof i?i:c}(r,i)(t[r],e[r],i):o[r]=n(e[r],i))})),o}function c(t,i,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(i);return a===Array.isArray(t)?a?r.arrayMerge(t,i,r):s(t,i,r):n(i,r)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,i){return c(t,i,e)}),{})};var u=c;t.exports=u},154:function(e){e.exports=t}},i={};function n(t){var o=i[t];if(void 0!==o)return o.exports;var r=i[t]={exports:{}};return e[t](r,r.exports,n),r.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};n.d(o,{default:function(){return ae}});var r=n(744),a=n.n(r);const s=/(?:^\[object\s(.*?)\]$)/;var c=t=>Object.prototype.toString.call(t).replace(s,"$1").toLowerCase();const u=t=>{let{componentProps:e,propName:i,props:n}=t,o=n[i];if("object"===c(o)){const t=e[i].default;e[i].default=()=>a()(t,o)}else Array.isArray(o)?e[i].default=()=>o:e[i].default=o},d=t=>{let{componentMixins:e,propName:i,props:n}=t;if(e.length){let t=e.length;for(;t--;)if(e[t].props&&void 0!==e[t].props[i]){u({componentProps:e[t].props,propName:i,props:n});break}}};var l=(t,e)=>{for(const i of Object.keys(e))t.props?void 0===t.props[i]?d({componentMixins:t.mixins,propName:i,props:e}):u({componentProps:t.props,propName:i,props:e}):d({componentMixins:t.mixins,propName:i,props:e})};var p=(t,e)=>{for(const i of Object.keys(e))if(/^Ui[A-Z]{1}[A-Za-z]+$/.test(i)){const n=t[i],o=e[i];l(n,o)}};var h=t=>{const e={install(e){p(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});for(let i in t){const n=t[i];e.component(n.name,n)}}};return e},f=n(154),v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},v(t,e)};function y(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var m=function(){return m=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},m.apply(this,arguments)};Object.create;function E(t){var e="function"===typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var i="function"===typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,r=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return a}function C(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var A=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),I=function(){function t(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];this.root=t,this.initialize.apply(this,C([],g(i))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new A({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,i){this.root.addEventListener(t,e,i)},t.prototype.unlisten=function(t,e,i){this.root.removeEventListener(t,e,i)},t.prototype.emit=function(t,e,i){var n;void 0===i&&(i=!1),"function"===typeof CustomEvent?n=new CustomEvent(t,{bubbles:i,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,e),this.root.dispatchEvent(n)},t}();function T(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},n=function(){};t.document.addEventListener("test",n,i),t.document.removeEventListener("test",n,i)}catch(o){e=!1}return e}(t)&&{passive:!0}}function _(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var O,R={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},N={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},b={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};var S,D=["touchstart","pointerdown","mousedown","keydown"],L=["touchend","pointerup","mouseup","contextmenu"],F=[],P=function(t){function e(i){var n=t.call(this,m(m({},e.defaultAdapter),i))||this;return n.activationAnimationHasEnded=!1,n.activationTimer=0,n.fgDeactivationRemovalTimer=0,n.fgScale="0",n.frame={width:0,height:0},n.initialSize=0,n.layoutFrame=0,n.maxRadius=0,n.unboundedCoords={left:0,top:0},n.activationState=n.defaultActivationState(),n.activationTimerCallback=function(){n.activationAnimationHasEnded=!0,n.runDeactivationUXLogicIfReady()},n.activateHandler=function(t){n.activateImpl(t)},n.deactivateHandler=function(){n.deactivateImpl()},n.focusHandler=function(){n.handleFocus()},n.blurHandler=function(){n.handleBlur()},n.resizeHandler=function(){n.layout()},n}return y(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return N},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return b},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple();if(this.registerRootHandlers(i),i){var n=e.cssClasses,o=n.ROOT,r=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(r),t.layoutInternal())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,n=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(n),t.adapter.removeClass(o),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(t){this.activateImpl(t)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var n=E(D),o=n.next();!o.done;o=n.next()){var r=o.value;this.adapter.registerInteractionHandler(r,this.activateHandler)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var n=E(L),o=n.next();!o.done;o=n.next()){var r=o.value;this.adapter.registerDocumentInteractionHandler(r,this.deactivateHandler)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=E(D),n=i.next();!n.done;n=i.next()){var o=n.value;this.adapter.deregisterInteractionHandler(o,this.activateHandler)}}catch(r){t={error:r}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=E(L),n=i.next();!n.done;n=i.next()){var o=n.value;this.adapter.deregisterDocumentInteractionHandler(o,this.deactivateHandler)}}catch(r){t={error:r}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},e.prototype.removeCssVars=function(){var t=this,i=e.strings;Object.keys(i).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)}))},e.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var n=this.previousActivationEvent;if(!(n&&void 0!==t&&n.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&F.length>0&&F.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(F.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){F=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},e.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation=function(){var t=this,i=e.strings,n=i.VAR_FG_TRANSLATE_START,o=i.VAR_FG_TRANSLATE_END,r=e.cssClasses,a=r.FG_DEACTIVATION,s=r.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var u="",d="";if(!this.adapter.isUnbounded()){var l=this.getFgTranslationCoordinates(),p=l.startPoint,h=l.endPoint;u=p.x+"px, "+p.y+"px",d=h.x+"px, "+h.y+"px"}this.adapter.updateCssVariable(n,u),this.adapter.updateCssVariable(o,d),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),c)},e.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,o,r=e.x,a=e.y,s=r+i.left,c=a+i.top;if("touchstart"===t.type){var u=t;n=u.changedTouches[0].pageX-s,o=u.changedTouches[0].pageY-c}else{var d=t;n=d.pageX-s,o=d.pageY-c}return{x:n,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},e.prototype.runDeactivationUXLogicIfReady=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState,o=n.hasDeactivationUXRun,r=n.isActivated;(o||!r)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(i)}),b.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var i=m({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(i)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(i),t.resetActivationState()})))}},e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var i=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?i:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+e.numbers.PADDING;var n=Math.floor(i*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&n%2!==0?this.initialSize=n-1:this.initialSize=n,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,o=t.VAR_TOP,r=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize+"px"),this.adapter.updateCssVariable(r,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(n,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(A),w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return y(e,t),e.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var n=new e(t);return void 0!==i.isUnbounded&&(n.unbounded=i.isUnbounded),n},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var i,n=t.CSS;if("boolean"===typeof O&&!e)return O;if(!n||"function"!==typeof n.supports)return!1;var o=n.supports("--css-vars","yes"),r=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=o||r,e||(O=i),i}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,T())},deregisterInteractionHandler:function(e,i){return t.root.removeEventListener(e,i,T())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return _(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,T())},registerInteractionHandler:function(e,i){return t.root.addEventListener(e,i,T())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,i){return t.root.style.setProperty(e,i)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t),this.setUnbounded()},enumerable:!1,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new P(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))},e}(I);!function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.CLICK=1]="CLICK",t[t.BACKSPACE_KEY=2]="BACKSPACE_KEY",t[t.DELETE_KEY=3]="DELETE_KEY",t[t.SPACEBAR_KEY=4]="SPACEBAR_KEY",t[t.ENTER_KEY=5]="ENTER_KEY"}(S||(S={}));var V={ARIA_HIDDEN:"aria-hidden",INTERACTION_EVENT:"MDCChipTrailingAction:interaction",NAVIGATION_EVENT:"MDCChipTrailingAction:navigation",TAB_INDEX:"tabindex"},k="Unknown",x="Backspace",H="Enter",K="Spacebar",M="PageUp",B="PageDown",U="End",Y="Home",G="ArrowLeft",j="ArrowUp",W="ArrowRight",z="ArrowDown",$="Delete",q="Escape",X="Tab",Z=new Set;Z.add(x),Z.add(H),Z.add(K),Z.add(M),Z.add(B),Z.add(U),Z.add(Y),Z.add(G),Z.add(j),Z.add(W),Z.add(z),Z.add($),Z.add(q),Z.add(X);var J=8,Q=13,tt=32,et=33,it=34,nt=35,ot=36,rt=37,at=38,st=39,ct=40,ut=46,dt=27,lt=9,pt=new Map;pt.set(J,x),pt.set(Q,H),pt.set(tt,K),pt.set(et,M),pt.set(it,B),pt.set(nt,U),pt.set(ot,Y),pt.set(rt,G),pt.set(at,j),pt.set(st,W),pt.set(ct,z),pt.set(ut,$),pt.set(dt,q),pt.set(lt,X);var ht=new Set;function ft(t){var e=t.key;if(Z.has(e))return e;var i=pt.get(t.keyCode);return i||k}ht.add(M),ht.add(B),ht.add(U),ht.add(Y),ht.add(G),ht.add(j),ht.add(W),ht.add(z);var vt,yt,mt=function(t){function e(i){return t.call(this,m(m({},e.defaultAdapter),i))||this}return y(e,t),Object.defineProperty(e,"strings",{get:function(){return V},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{focus:function(){},getAttribute:function(){return null},setAttribute:function(){},notifyInteraction:function(){},notifyNavigation:function(){}}},enumerable:!1,configurable:!0}),e.prototype.handleClick=function(t){t.stopPropagation(),this.adapter.notifyInteraction(S.CLICK)},e.prototype.handleKeydown=function(t){t.stopPropagation();var e=ft(t);if(this.shouldNotifyInteractionFromKey(e)){var i=this.getTriggerFromKey(e);this.adapter.notifyInteraction(i)}else(function(t){return ht.has(ft(t))})(t)&&this.adapter.notifyNavigation(e)},e.prototype.removeFocus=function(){this.adapter.setAttribute(V.TAB_INDEX,"-1")},e.prototype.focus=function(){this.adapter.setAttribute(V.TAB_INDEX,"0"),this.adapter.focus()},e.prototype.isNavigable=function(){return"true"!==this.adapter.getAttribute(V.ARIA_HIDDEN)},e.prototype.shouldNotifyInteractionFromKey=function(t){return t===H||t===K||(t===x||t===$)},e.prototype.getTriggerFromKey=function(t){return t===K?S.SPACEBAR_KEY:t===H?S.ENTER_KEY:t===$?S.DELETE_KEY:t===x?S.BACKSPACE_KEY:S.UNSPECIFIED},e}(A),Et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),Object.defineProperty(e.prototype,"ripple",{get:function(){return this.rippleSurface},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){void 0===t&&(t=function(t,e){return new w(t,e)});var e=w.createAdapter(this);this.rippleSurface=t(this.root,new P(e))},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(e){t.foundation.handleClick(e)},this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.listen("click",this.handleClick),this.listen("keydown",this.handleKeydown)},e.prototype.destroy=function(){this.rippleSurface.destroy(),this.unlisten("click",this.handleClick),this.unlisten("keydown",this.handleKeydown),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new mt({focus:function(){t.root.focus()},getAttribute:function(e){return t.root.getAttribute(e)},notifyInteraction:function(e){return t.emit(V.INTERACTION_EVENT,{trigger:e},!0)},notifyNavigation:function(e){t.emit(V.NAVIGATION_EVENT,{key:e},!0)},setAttribute:function(e,i){t.root.setAttribute(e,i)}})},e.prototype.isNavigable=function(){return this.foundation.isNavigable()},e.prototype.focus=function(){this.foundation.focus()},e.prototype.removeFocus=function(){this.foundation.removeFocus()},e}(I);!function(t){t.LEFT="left",t.RIGHT="right"}(vt||(vt={})),function(t){t.PRIMARY="primary",t.TRAILING="trailing",t.NONE="none"}(yt||(yt={}));var gt={ADDED_ANNOUNCEMENT_ATTRIBUTE:"data-mdc-chip-added-announcement",ARIA_CHECKED:"aria-checked",ARROW_DOWN_KEY:"ArrowDown",ARROW_LEFT_KEY:"ArrowLeft",ARROW_RIGHT_KEY:"ArrowRight",ARROW_UP_KEY:"ArrowUp",BACKSPACE_KEY:"Backspace",CHECKMARK_SELECTOR:".mdc-chip__checkmark",DELETE_KEY:"Delete",END_KEY:"End",ENTER_KEY:"Enter",ENTRY_ANIMATION_NAME:"mdc-chip-entry",HOME_KEY:"Home",IE_ARROW_DOWN_KEY:"Down",IE_ARROW_LEFT_KEY:"Left",IE_ARROW_RIGHT_KEY:"Right",IE_ARROW_UP_KEY:"Up",IE_DELETE_KEY:"Del",INTERACTION_EVENT:"MDCChip:interaction",LEADING_ICON_SELECTOR:".mdc-chip__icon--leading",NAVIGATION_EVENT:"MDCChip:navigation",PRIMARY_ACTION_SELECTOR:".mdc-chip__primary-action",REMOVED_ANNOUNCEMENT_ATTRIBUTE:"data-mdc-chip-removed-announcement",REMOVAL_EVENT:"MDCChip:removal",SELECTION_EVENT:"MDCChip:selection",SPACEBAR_KEY:" ",TAB_INDEX:"tabindex",TRAILING_ACTION_SELECTOR:".mdc-chip-trailing-action",TRAILING_ICON_INTERACTION_EVENT:"MDCChip:trailingIconInteraction",TRAILING_ICON_SELECTOR:".mdc-chip__icon--trailing"},Ct={CHECKMARK:"mdc-chip__checkmark",CHIP_EXIT:"mdc-chip--exit",DELETABLE:"mdc-chip--deletable",EDITABLE:"mdc-chip--editable",EDITING:"mdc-chip--editing",HIDDEN_LEADING_ICON:"mdc-chip__icon--leading-hidden",LEADING_ICON:"mdc-chip__icon--leading",PRIMARY_ACTION:"mdc-chip__primary-action",PRIMARY_ACTION_FOCUSED:"mdc-chip--primary-action-focused",SELECTED:"mdc-chip--selected",TEXT:"mdc-chip__text",TRAILING_ACTION:"mdc-chip__trailing-action",TRAILING_ICON:"mdc-chip__icon--trailing"},At=new Set;At.add(gt.ARROW_LEFT_KEY),At.add(gt.ARROW_RIGHT_KEY),At.add(gt.ARROW_DOWN_KEY),At.add(gt.ARROW_UP_KEY),At.add(gt.END_KEY),At.add(gt.HOME_KEY),At.add(gt.IE_ARROW_LEFT_KEY),At.add(gt.IE_ARROW_RIGHT_KEY),At.add(gt.IE_ARROW_DOWN_KEY),At.add(gt.IE_ARROW_UP_KEY);var It=new Set;It.add(gt.ARROW_UP_KEY),It.add(gt.ARROW_DOWN_KEY),It.add(gt.HOME_KEY),It.add(gt.END_KEY),It.add(gt.IE_ARROW_UP_KEY),It.add(gt.IE_ARROW_DOWN_KEY);var Tt,_t={bottom:0,height:0,left:0,right:0,top:0,width:0};!function(t){t[t.SHOULD_FOCUS=0]="SHOULD_FOCUS",t[t.SHOULD_NOT_FOCUS=1]="SHOULD_NOT_FOCUS"}(Tt||(Tt={}));var Ot,Rt=function(t){function e(i){var n=t.call(this,m(m({},e.defaultAdapter),i))||this;return n.shouldRemoveOnTrailingIconClick=!0,n.shouldFocusPrimaryActionOnClick=!0,n}return y(e,t),Object.defineProperty(e,"strings",{get:function(){return gt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return Ct},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},addClassToLeadingIcon:function(){},eventTargetHasClass:function(){return!1},focusPrimaryAction:function(){},focusTrailingAction:function(){},getAttribute:function(){return null},getCheckmarkBoundingClientRect:function(){return _t},getComputedStyleValue:function(){return""},getRootBoundingClientRect:function(){return _t},hasClass:function(){return!1},hasLeadingIcon:function(){return!1},isRTL:function(){return!1},isTrailingActionNavigable:function(){return!1},notifyEditFinish:function(){},notifyEditStart:function(){},notifyInteraction:function(){},notifyNavigation:function(){},notifyRemoval:function(){},notifySelection:function(){},notifyTrailingIconInteraction:function(){},removeClass:function(){},removeClassFromLeadingIcon:function(){},removeTrailingActionFocus:function(){},setPrimaryActionAttr:function(){},setStyleProperty:function(){}}},enumerable:!1,configurable:!0}),e.prototype.isSelected=function(){return this.adapter.hasClass(Ct.SELECTED)},e.prototype.isEditable=function(){return this.adapter.hasClass(Ct.EDITABLE)},e.prototype.isEditing=function(){return this.adapter.hasClass(Ct.EDITING)},e.prototype.setSelected=function(t){this.setSelectedImpl(t),this.notifySelection(t)},e.prototype.setSelectedFromChipSet=function(t,e){this.setSelectedImpl(t),e&&this.notifyIgnoredSelection(t)},e.prototype.getShouldRemoveOnTrailingIconClick=function(){return this.shouldRemoveOnTrailingIconClick},e.prototype.setShouldRemoveOnTrailingIconClick=function(t){this.shouldRemoveOnTrailingIconClick=t},e.prototype.setShouldFocusPrimaryActionOnClick=function(t){this.shouldFocusPrimaryActionOnClick=t},e.prototype.getDimensions=function(){var t=this,e=function(){return t.adapter.getRootBoundingClientRect()};if(!this.adapter.hasLeadingIcon()){var i=t.adapter.getCheckmarkBoundingClientRect();if(i){var n=e();return{bottom:n.bottom,height:n.height,left:n.left,right:n.right,top:n.top,width:n.width+i.height}}}return e()},e.prototype.beginExit=function(){this.adapter.addClass(Ct.CHIP_EXIT)},e.prototype.handleClick=function(){this.adapter.notifyInteraction(),this.setPrimaryActionFocusable(this.getFocusBehavior())},e.prototype.handleDoubleClick=function(){this.isEditable()&&this.startEditing()},e.prototype.handleTransitionEnd=function(t){var e=this,i=this.adapter.eventTargetHasClass(t.target,Ct.CHIP_EXIT),n="width"===t.propertyName,o="opacity"===t.propertyName;if(i&&o){var r=this.adapter.getComputedStyleValue("width");requestAnimationFrame((function(){e.adapter.setStyleProperty("width",r),e.adapter.setStyleProperty("padding","0"),e.adapter.setStyleProperty("margin","0"),requestAnimationFrame((function(){e.adapter.setStyleProperty("width","0")}))}))}else{if(i&&n){this.removeFocus();var a=this.adapter.getAttribute(gt.REMOVED_ANNOUNCEMENT_ATTRIBUTE);this.adapter.notifyRemoval(a)}if(o){var s=this.adapter.eventTargetHasClass(t.target,Ct.LEADING_ICON)&&this.adapter.hasClass(Ct.SELECTED),c=this.adapter.eventTargetHasClass(t.target,Ct.CHECKMARK)&&!this.adapter.hasClass(Ct.SELECTED);s?this.adapter.addClassToLeadingIcon(Ct.HIDDEN_LEADING_ICON):c&&this.adapter.removeClassFromLeadingIcon(Ct.HIDDEN_LEADING_ICON)}}},e.prototype.handleFocusIn=function(t){this.eventFromPrimaryAction(t)&&this.adapter.addClass(Ct.PRIMARY_ACTION_FOCUSED)},e.prototype.handleFocusOut=function(t){this.eventFromPrimaryAction(t)&&(this.isEditing()&&this.finishEditing(),this.adapter.removeClass(Ct.PRIMARY_ACTION_FOCUSED))},e.prototype.handleTrailingActionInteraction=function(){this.adapter.notifyTrailingIconInteraction(),this.removeChip()},e.prototype.handleKeydown=function(t){if(!this.isEditing())return this.isEditable()&&this.shouldStartEditing(t)&&(t.preventDefault(),this.startEditing()),this.shouldNotifyInteraction(t)?(this.adapter.notifyInteraction(),void this.setPrimaryActionFocusable(this.getFocusBehavior())):this.isDeleteAction(t)?(t.preventDefault(),void this.removeChip()):void(At.has(t.key)&&(t.preventDefault(),this.focusNextAction(t.key,yt.PRIMARY)));this.shouldFinishEditing(t)&&(t.preventDefault(),this.finishEditing())},e.prototype.handleTrailingActionNavigation=function(t){this.focusNextAction(t.detail.key,yt.TRAILING)},e.prototype.removeFocus=function(){this.adapter.setPrimaryActionAttr(gt.TAB_INDEX,"-1"),this.adapter.removeTrailingActionFocus()},e.prototype.focusPrimaryAction=function(){this.setPrimaryActionFocusable(Tt.SHOULD_FOCUS)},e.prototype.focusTrailingAction=function(){if(this.adapter.isTrailingActionNavigable())return this.adapter.setPrimaryActionAttr(gt.TAB_INDEX,"-1"),void this.adapter.focusTrailingAction();this.focusPrimaryAction()},e.prototype.setPrimaryActionFocusable=function(t){this.adapter.setPrimaryActionAttr(gt.TAB_INDEX,"0"),t===Tt.SHOULD_FOCUS&&this.adapter.focusPrimaryAction(),this.adapter.removeTrailingActionFocus()},e.prototype.getFocusBehavior=function(){return this.shouldFocusPrimaryActionOnClick?Tt.SHOULD_FOCUS:Tt.SHOULD_NOT_FOCUS},e.prototype.focusNextAction=function(t,e){var i=this.adapter.isTrailingActionNavigable(),n=this.getDirection(t);!It.has(t)&&i?e!==yt.PRIMARY||n!==vt.RIGHT?e!==yt.TRAILING||n!==vt.LEFT?this.adapter.notifyNavigation(t,yt.NONE):this.focusPrimaryAction():this.focusTrailingAction():this.adapter.notifyNavigation(t,e)},e.prototype.getDirection=function(t){var e=this.adapter.isRTL();return!e&&(t===gt.ARROW_LEFT_KEY||t===gt.IE_ARROW_LEFT_KEY)||e&&(t===gt.ARROW_RIGHT_KEY||t===gt.IE_ARROW_RIGHT_KEY)?vt.LEFT:vt.RIGHT},e.prototype.removeChip=function(){this.shouldRemoveOnTrailingIconClick&&this.beginExit()},e.prototype.shouldStartEditing=function(t){return this.eventFromPrimaryAction(t)&&t.key===gt.ENTER_KEY},e.prototype.shouldFinishEditing=function(t){return t.key===gt.ENTER_KEY},e.prototype.shouldNotifyInteraction=function(t){return t.key===gt.ENTER_KEY||t.key===gt.SPACEBAR_KEY},e.prototype.isDeleteAction=function(t){return this.adapter.hasClass(Ct.DELETABLE)&&(t.key===gt.BACKSPACE_KEY||t.key===gt.DELETE_KEY||t.key===gt.IE_DELETE_KEY)},e.prototype.setSelectedImpl=function(t){t?(this.adapter.addClass(Ct.SELECTED),this.adapter.setPrimaryActionAttr(gt.ARIA_CHECKED,"true")):(this.adapter.removeClass(Ct.SELECTED),this.adapter.setPrimaryActionAttr(gt.ARIA_CHECKED,"false"))},e.prototype.notifySelection=function(t){this.adapter.notifySelection(t,!1)},e.prototype.notifyIgnoredSelection=function(t){this.adapter.notifySelection(t,!0)},e.prototype.eventFromPrimaryAction=function(t){return this.adapter.eventTargetHasClass(t.target,Ct.PRIMARY_ACTION)},e.prototype.startEditing=function(){this.adapter.addClass(Ct.EDITING),this.adapter.notifyEditStart()},e.prototype.finishEditing=function(){this.adapter.removeClass(Ct.EDITING),this.adapter.notifyEditFinish()},e}(A),Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),Object.defineProperty(e.prototype,"selected",{get:function(){return this.foundation.isSelected()},set:function(t){this.foundation.setSelected(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldRemoveOnTrailingIconClick",{get:function(){return this.foundation.getShouldRemoveOnTrailingIconClick()},set:function(t){this.foundation.setShouldRemoveOnTrailingIconClick(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setShouldFocusPrimaryActionOnClick",{set:function(t){this.foundation.setShouldFocusPrimaryActionOnClick(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ripple",{get:function(){return this.rippleSurface},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.root.id},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){var i=this;void 0===t&&(t=function(t,e){return new w(t,e)}),void 0===e&&(e=function(t){return new Et(t)}),this.leadingIcon=this.root.querySelector(gt.LEADING_ICON_SELECTOR),this.checkmark=this.root.querySelector(gt.CHECKMARK_SELECTOR),this.primaryAction=this.root.querySelector(gt.PRIMARY_ACTION_SELECTOR);var n=this.root.querySelector(gt.TRAILING_ACTION_SELECTOR);n&&(this.trailingAction=e(n));var o=m(m({},w.createAdapter(this)),{computeBoundingRect:function(){return i.foundation.getDimensions()}});this.rippleSurface=t(this.root,new P(o))},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleTrailingActionInteraction=function(){t.foundation.handleTrailingActionInteraction()},this.handleTrailingActionNavigation=function(e){t.foundation.handleTrailingActionNavigation(e)},this.handleClick=function(){t.foundation.handleClick()},this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleTransitionEnd=function(e){t.foundation.handleTransitionEnd(e)},this.handleFocusIn=function(e){t.foundation.handleFocusIn(e)},this.handleFocusOut=function(e){t.foundation.handleFocusOut(e)},this.listen("transitionend",this.handleTransitionEnd),this.listen("click",this.handleClick),this.listen("keydown",this.handleKeydown),this.listen("focusin",this.handleFocusIn),this.listen("focusout",this.handleFocusOut),this.trailingAction&&(this.listen(V.INTERACTION_EVENT,this.handleTrailingActionInteraction),this.listen(V.NAVIGATION_EVENT,this.handleTrailingActionNavigation))},e.prototype.destroy=function(){this.rippleSurface.destroy(),this.unlisten("transitionend",this.handleTransitionEnd),this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.handleFocusIn),this.unlisten("focusout",this.handleFocusOut),this.trailingAction&&(this.unlisten(V.INTERACTION_EVENT,this.handleTrailingActionInteraction),this.unlisten(V.NAVIGATION_EVENT,this.handleTrailingActionNavigation)),t.prototype.destroy.call(this)},e.prototype.beginExit=function(){this.foundation.beginExit()},e.prototype.getDefaultFoundation=function(){var t=this;return new Rt({addClass:function(e){return t.root.classList.add(e)},addClassToLeadingIcon:function(e){t.leadingIcon&&t.leadingIcon.classList.add(e)},eventTargetHasClass:function(t,e){return!!t&&t.classList.contains(e)},focusPrimaryAction:function(){t.primaryAction&&t.primaryAction.focus()},focusTrailingAction:function(){t.trailingAction&&t.trailingAction.focus()},getAttribute:function(e){return t.root.getAttribute(e)},getCheckmarkBoundingClientRect:function(){return t.checkmark?t.checkmark.getBoundingClientRect():null},getComputedStyleValue:function(e){return window.getComputedStyle(t.root).getPropertyValue(e)},getRootBoundingClientRect:function(){return t.root.getBoundingClientRect()},hasClass:function(e){return t.root.classList.contains(e)},hasLeadingIcon:function(){return!!t.leadingIcon},isRTL:function(){return"rtl"===window.getComputedStyle(t.root).getPropertyValue("direction")},isTrailingActionNavigable:function(){return!!t.trailingAction&&t.trailingAction.isNavigable()},notifyInteraction:function(){return t.emit(gt.INTERACTION_EVENT,{chipId:t.id},!0)},notifyNavigation:function(e,i){return t.emit(gt.NAVIGATION_EVENT,{chipId:t.id,key:e,source:i},!0)},notifyRemoval:function(e){t.emit(gt.REMOVAL_EVENT,{chipId:t.id,removedAnnouncement:e},!0)},notifySelection:function(e,i){return t.emit(gt.SELECTION_EVENT,{chipId:t.id,selected:e,shouldIgnore:i},!0)},notifyTrailingIconInteraction:function(){return t.emit(gt.TRAILING_ICON_INTERACTION_EVENT,{chipId:t.id},!0)},notifyEditStart:function(){},notifyEditFinish:function(){},removeClass:function(e){return t.root.classList.remove(e)},removeClassFromLeadingIcon:function(e){t.leadingIcon&&t.leadingIcon.classList.remove(e)},removeTrailingActionFocus:function(){t.trailingAction&&t.trailingAction.removeFocus()},setPrimaryActionAttr:function(e,i){t.primaryAction&&t.primaryAction.setAttribute(e,i)},setStyleProperty:function(e,i){return t.root.style.setProperty(e,i)}})},e.prototype.setSelectedFromChipSet=function(t,e){this.foundation.setSelectedFromChipSet(t,e)},e.prototype.focusPrimaryAction=function(){this.foundation.focusPrimaryAction()},e.prototype.focusTrailingAction=function(){this.foundation.focusTrailingAction()},e.prototype.removeFocus=function(){this.foundation.removeFocus()},e.prototype.remove=function(){var t=this.root.parentNode;null!==t&&t.removeChild(this.root)},e}(I);!function(t){t.POLITE="polite",t.ASSERTIVE="assertive"}(Ot||(Ot={}));var bt=function(){function t(){this.liveRegions=new Map}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.say=function(t,e){var i,n,o=null!==(i=null===e||void 0===e?void 0:e.priority)&&void 0!==i?i:Ot.POLITE,r=null!==(n=null===e||void 0===e?void 0:e.ownerDocument)&&void 0!==n?n:document,a=this.getLiveRegion(o,r);function s(){a.textContent="",r.removeEventListener("click",s)}a.textContent="",setTimeout((function(){a.textContent=t,r.addEventListener("click",s)}),1)},t.prototype.getLiveRegion=function(t,e){var i=this.liveRegions.get(e);i||(i=new Map,this.liveRegions.set(e,i));var n=i.get(t);if(n&&e.body.contains(n))return n;var o=this.createLiveRegion(t,e);return i.set(t,o),o},t.prototype.createLiveRegion=function(t,e){var i=e.createElement("div");return i.style.position="absolute",i.style.top="-9999px",i.style.left="-9999px",i.style.height="1px",i.style.overflow="hidden",i.setAttribute("aria-atomic","true"),i.setAttribute("aria-live",t),i.setAttribute("data-mdc-dom-announce","true"),e.body.appendChild(i),i},t}(),St={CHIP_SELECTOR:".mdc-chip"},Dt={CHOICE:"mdc-chip-set--choice",FILTER:"mdc-chip-set--filter"},Lt=function(t){function e(i){var n=t.call(this,m(m({},e.defaultAdapter),i))||this;return n.selectedChipIds=[],n}return y(e,t),Object.defineProperty(e,"strings",{get:function(){return St},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return Dt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{announceMessage:function(){},focusChipPrimaryActionAtIndex:function(){},focusChipTrailingActionAtIndex:function(){},getChipListCount:function(){return-1},getIndexOfChipById:function(){return-1},hasClass:function(){return!1},isRTL:function(){return!1},removeChipAtIndex:function(){},removeFocusFromChipAtIndex:function(){},selectChipAtIndex:function(){}}},enumerable:!1,configurable:!0}),e.prototype.getSelectedChipIds=function(){return this.selectedChipIds.slice()},e.prototype.select=function(t){this.selectImpl(t,!1)},e.prototype.handleChipInteraction=function(t){var e=t.chipId,i=this.adapter.getIndexOfChipById(e);this.removeFocusFromChipsExcept(i),(this.adapter.hasClass(Dt.CHOICE)||this.adapter.hasClass(Dt.FILTER))&&this.toggleSelect(e)},e.prototype.handleChipSelection=function(t){var e=t.chipId,i=t.selected;if(!t.shouldIgnore){var n=this.selectedChipIds.indexOf(e)>=0;i&&!n?this.select(e):!i&&n&&this.deselectImpl(e)}},e.prototype.handleChipRemoval=function(t){var e=t.chipId,i=t.removedAnnouncement;i&&this.adapter.announceMessage(i);var n=this.adapter.getIndexOfChipById(e);this.deselectAndNotifyClients(e),this.adapter.removeChipAtIndex(n);var o=this.adapter.getChipListCount()-1;if(!(o<0)){var r=Math.min(n,o);this.removeFocusFromChipsExcept(r),this.adapter.focusChipTrailingActionAtIndex(r)}},e.prototype.handleChipNavigation=function(t){var e=t.chipId,i=t.key,n=t.source,o=this.adapter.getChipListCount()-1,r=this.adapter.getIndexOfChipById(e);if(-1!==r&&At.has(i)){var a=this.adapter.isRTL();!a&&(i===gt.ARROW_RIGHT_KEY||i===gt.IE_ARROW_RIGHT_KEY)||a&&(i===gt.ARROW_LEFT_KEY||i===gt.IE_ARROW_LEFT_KEY)||(i===gt.ARROW_DOWN_KEY||i===gt.IE_ARROW_DOWN_KEY)?r++:i===gt.HOME_KEY?r=0:i===gt.END_KEY?r=o:r--,r<0||r>o||(this.removeFocusFromChipsExcept(r),this.focusChipAction(r,i,n))}},e.prototype.focusChipAction=function(t,e,i){var n=It.has(e);if(n&&i===yt.PRIMARY)return this.adapter.focusChipPrimaryActionAtIndex(t);if(n&&i===yt.TRAILING)return this.adapter.focusChipTrailingActionAtIndex(t);var o=this.getDirection(e);return o===vt.LEFT?this.adapter.focusChipTrailingActionAtIndex(t):o===vt.RIGHT?this.adapter.focusChipPrimaryActionAtIndex(t):void 0},e.prototype.getDirection=function(t){var e=this.adapter.isRTL();return!e&&(t===gt.ARROW_LEFT_KEY||t===gt.IE_ARROW_LEFT_KEY)||e&&(t===gt.ARROW_RIGHT_KEY||t===gt.IE_ARROW_RIGHT_KEY)?vt.LEFT:vt.RIGHT},e.prototype.deselectImpl=function(t,e){void 0===e&&(e=!1);var i=this.selectedChipIds.indexOf(t);if(i>=0){this.selectedChipIds.splice(i,1);var n=this.adapter.getIndexOfChipById(t);this.adapter.selectChipAtIndex(n,!1,e)}},e.prototype.deselectAndNotifyClients=function(t){this.deselectImpl(t,!0)},e.prototype.toggleSelect=function(t){this.selectedChipIds.indexOf(t)>=0?this.deselectAndNotifyClients(t):this.selectAndNotifyClients(t)},e.prototype.removeFocusFromChipsExcept=function(t){for(var e=this.adapter.getChipListCount(),i=0;i<e;i++)i!==t&&this.adapter.removeFocusFromChipAtIndex(i)},e.prototype.selectAndNotifyClients=function(t){this.selectImpl(t,!0)},e.prototype.selectImpl=function(t,e){if(!(this.selectedChipIds.indexOf(t)>=0)){if(this.adapter.hasClass(Dt.CHOICE)&&this.selectedChipIds.length>0){var i=this.selectedChipIds[0],n=this.adapter.getIndexOfChipById(i);this.selectedChipIds=[],this.adapter.selectChipAtIndex(n,!1,e)}this.selectedChipIds.push(t);var o=this.adapter.getIndexOfChipById(t);this.adapter.selectChipAtIndex(o,!0,e)}},e}(A),Ft=Rt.strings,Pt=Ft.INTERACTION_EVENT,wt=Ft.SELECTION_EVENT,Vt=Ft.REMOVAL_EVENT,kt=Ft.NAVIGATION_EVENT,xt=Lt.strings.CHIP_SELECTOR,Ht=0,Kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"chips",{get:function(){return this.chipsList.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedChipIds",{get:function(){return this.foundation.getSelectedChipIds()},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t){void 0===t&&(t=function(t){return new Nt(t)}),this.chipFactory=t,this.chipsList=this.instantiateChips(this.chipFactory)},e.prototype.initialSyncWithDOM=function(){var t,e,i=this;try{for(var n=E(this.chipsList),o=n.next();!o.done;o=n.next()){var r=o.value;r.id&&r.selected&&this.foundation.select(r.id)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.handleChipInteraction=function(t){return i.foundation.handleChipInteraction(t.detail)},this.handleChipSelection=function(t){return i.foundation.handleChipSelection(t.detail)},this.handleChipRemoval=function(t){return i.foundation.handleChipRemoval(t.detail)},this.handleChipNavigation=function(t){return i.foundation.handleChipNavigation(t.detail)},this.listen(Pt,this.handleChipInteraction),this.listen(wt,this.handleChipSelection),this.listen(Vt,this.handleChipRemoval),this.listen(kt,this.handleChipNavigation)},e.prototype.destroy=function(){var e,i;try{for(var n=E(this.chipsList),o=n.next();!o.done;o=n.next()){o.value.destroy()}}catch(r){e={error:r}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.unlisten(Pt,this.handleChipInteraction),this.unlisten(wt,this.handleChipSelection),this.unlisten(Vt,this.handleChipRemoval),this.unlisten(kt,this.handleChipNavigation),t.prototype.destroy.call(this)},e.prototype.addChip=function(t){t.id=t.id||"mdc-chip-"+ ++Ht,this.chipsList.push(this.chipFactory(t))},e.prototype.getDefaultFoundation=function(){var t=this;return new Lt({announceMessage:function(t){!function(t,e){bt.getInstance().say(t,e)}(t)},focusChipPrimaryActionAtIndex:function(e){t.chipsList[e].focusPrimaryAction()},focusChipTrailingActionAtIndex:function(e){t.chipsList[e].focusTrailingAction()},getChipListCount:function(){return t.chips.length},getIndexOfChipById:function(e){return t.findChipIndex(e)},hasClass:function(e){return t.root.classList.contains(e)},isRTL:function(){return"rtl"===window.getComputedStyle(t.root).getPropertyValue("direction")},removeChipAtIndex:function(e){e>=0&&e<t.chips.length&&(t.chipsList[e].destroy(),t.chipsList[e].remove(),t.chipsList.splice(e,1))},removeFocusFromChipAtIndex:function(e){t.chipsList[e].removeFocus()},selectChipAtIndex:function(e,i,n){e>=0&&e<t.chips.length&&t.chipsList[e].setSelectedFromChipSet(i,n)}})},e.prototype.instantiateChips=function(t){return[].slice.call(this.root.querySelectorAll(xt)).map((function(e){return e.id=e.id||"mdc-chip-"+ ++Ht,t(e)}))},e.prototype.findChipIndex=function(t){for(var e=0;e<this.chips.length;e++)if(this.chipsList[e].id===t)return e;return-1},e}(I);const Mt={icon:{type:String,default:""}};const Bt={cssClasses:{icon:"material-icons"},EVENTS:{CLICK:"click"},getMaterialIconClass:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return[Bt.cssClasses.icon,...e]}};var Ut=Bt;const Yt=(0,f.createElementVNode)("div",{class:"mdc-chip__ripple"},null,-1),Gt={key:0,class:"mdc-chip__checkmark"},jt=[(0,f.createElementVNode)("svg",{class:"mdc-chip__checkmark-svg",viewBox:"-2 -3 30 30"},[(0,f.createElementVNode)("path",{class:"mdc-chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})],-1)],Wt={role:"gridcell"},zt=["role"],$t={class:"mdc-chip__text"},qt={key:0,role:"gridcell"},Xt={cssClasses:{icon:"mdc-chip__icon mdc-chip__icon--leading",removeIcon:"mdc-chip__icon mdc-chip__icon--trailing"},EVENTS:{REMOVE:"remove"}},Zt={name:"UiChip",customOptions:{UI_GLOBAL:Ut,UI_CHIP:Xt}};var Jt=Object.assign(Zt,{props:{...Mt,selected:{type:Boolean,default:!1},deletable:{type:Boolean,default:!1}},emits:[Ut.EVENTS.CLICK,Xt.EVENTS.REMOVE],setup(t,e){let{emit:i}=e;const n=t,o=i,r=(0,f.getCurrentInstance)().parent,a=(0,f.ref)(null),{materialIcon:s}=function(t){return{materialIcon:(0,f.computed)((()=>t.icon||!1))}}(n),c=(0,f.computed)((()=>[Ut.cssClasses.icon,Xt.cssClasses.icon,{"mdc-chip__icon--leading-hidden":n.selected}])),u=(0,f.computed)((()=>{var t,e;let i=null;return i=null!==r&&void 0!==r&&null!==(t=r.exposed)&&void 0!==t&&t.choiceChips.value?"radio":null!==r&&void 0!==r&&null!==(e=r.exposed)&&void 0!==e&&e.filterChips.value?"checkbox":"button",i}));function d(t){(0,f.nextTick)((()=>{var e;(null===r||void 0===r||null===(e=r.exposed)||void 0===e?void 0:e.choiceChips.value)&&(r.exposed.choiceChipId.value=a.value.id),o(Ut.EVENTS.CLICK,t)}))}function l(t){o(Xt.EVENTS.REMOVE,t)}return(e,i)=>((0,f.openBlock)(),(0,f.createElementBlock)("div",{ref_key:"chip",ref:a,class:"mdc-chip",role:"row",onClick:d},[Yt,(0,f.renderSlot)(e.$slots,"before",{iconClass:Xt.cssClasses.icon},(()=>[(0,f.unref)(s)?((0,f.openBlock)(),(0,f.createElementBlock)("i",{key:0,class:(0,f.normalizeClass)(c.value)},(0,f.toDisplayString)((0,f.unref)(s)),3)):(0,f.createCommentVNode)("",!0)])),e.$parent.filterChips?((0,f.openBlock)(),(0,f.createElementBlock)("span",Gt,jt)):(0,f.createCommentVNode)("",!0),(0,f.createElementVNode)("span",Wt,[(0,f.createElementVNode)("span",{role:u.value,class:"mdc-chip__primary-action"},[(0,f.createElementVNode)("span",$t,[(0,f.renderSlot)(e.$slots,"default")])],8,zt)]),(0,f.renderSlot)(e.$slots,"after",{iconClass:Xt.cssClasses.removeIcon},(()=>[e.$parent.inputChips||e.$parent.filterChips?((0,f.openBlock)(),(0,f.createElementBlock)("span",qt,[t.deletable?((0,f.openBlock)(),(0,f.createElementBlock)("i",{key:0,class:(0,f.normalizeClass)((0,f.unref)(Ut).getMaterialIconClass(Xt.cssClasses.removeIcon)),tabindex:"-1","data-mdc-deletable":"true",onClick:l}," cancel ",2)):(0,f.createCommentVNode)("",!0)])):(0,f.createCommentVNode)("",!0)]))],512))}});var Qt=Jt;var te=(t,e,i)=>t[i]||t.type=