Socket
Socket
Sign inDemoInstall

stimulus

Package Overview
Dependencies
0
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.2 to 0.3.3

6

dist/stimulus.d.ts

@@ -8,2 +8,6 @@ // Generated by dts-bundle v0.7.2

export { decorators };
export function on(eventName: string, actionOptions?: ActionOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
export type EventTargetMatcher = (eventTarget: EventTarget) => boolean;

@@ -107,4 +111,2 @@ export class Action {

export function on(eventName: string, actionOptionsOrEventTarget?: ActionOptions | EventTarget): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
export interface ActionOptions {

@@ -111,0 +113,0 @@ targetName: string;

@@ -1,1 +0,5 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Stimulus=e():t.Stimulus=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=18)}([function(t,e,n){"use strict";function r(t){return t.replace(/%/g,"%%")}n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a}),n.d(e,"c",function(){return u});var o;!function(t){t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(o||(o={}));var i="safari"in window,s=/(Trident|Edge)\//.test(navigator.userAgent),c=!s,a=function(){function t(t,e){void 0===t&&(t=o.WARN),void 0===e&&(e=window.console),this.level=t,this.console=e}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.DEBUG&&this.console.log.apply(this.console,this.formatArgs(t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.INFO&&this.console.log.apply(this.console,this.formatArgs(t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.WARN&&this.console.warn.apply(this.console,this.formatArgs(t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.ERROR&&this.console.error.apply(this.console,this.formatArgs(t))},t.prototype.formatArgs=function(t){if(!c)return t;for(var e=[],n=[],r=0,o=[this.loggerTag].concat(t);r<o.length;r++){var s=o[r],a=typeof s;"string"==a||"number"==a||"boolean"==a?(e.push("%c%s "),n.push("font-family: sans-serif; font-size: small; color: #888",s)):s instanceof Node?(e.push("%o"),n.push(s)):s instanceof u?(e.push(s.formatString," "),n.push.apply(n,s.formatValues)):s instanceof Error?(e.push("\n\n%o\n\n"),n.push(s)):(e.push(i?"%O":"%O "),n.push(s))}return[e.join("")].concat(n)},Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new u("Stimulus")},enumerable:!0,configurable:!0}),t}(),u=function(){function t(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#aaa"),this.name=t,this.foregroundColor=e,this.backgroundColor=n}return Object.defineProperty(t.prototype,"formatString",{get:function(){return"%c"+r(this.name)+"%c"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formatValues",{get:function(){return[this.formatValue,""]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formatValue",{get:function(){return"\n color: "+this.foregroundColor+";\n background-color: "+this.backgroundColor+";\n border: 1px solid rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n padding: 1px 6px;\n font-weight: bold;\n font-family: sans-serif;\n font-size: x-small;\n "},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t,e,n,r){this.context=t,this.descriptor=e,this.eventTarget=n,this.delegatedTargetMatcher=r}return Object.defineProperty(t.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventName",{get:function(){return this.descriptor.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"methodName",{get:function(){return this.descriptor.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preventsDefault",{get:function(){return this.descriptor.preventsDefault},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDirect",{get:function(){return null==this.delegatedTargetMatcher},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDelegated",{get:function(){return!this.isDirect},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"method",{get:function(){var t=this.controller[this.methodName];if("function"==typeof t)return t;throw new Error('Action references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),t.prototype.hasSameDescriptorAs=function(t){return null!=t&&t.descriptor.isEqualTo(this.descriptor)},t.prototype.matchDelegatedTarget=function(t){var e=this.delegatedTargetMatcher;return!!e&&e(t)},t.prototype.invokeWithEventAndTarget=function(t,e){this.preventsDefault&&t.preventDefault(),this.debug("Invoking action",this,t);try{this.method.call(this.controller,t,e)}catch(e){this.error(e,"while invoking action",this,t)}},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];(n=this.context).debug.apply(n,[this.descriptor.loggerTag].concat(t));var n},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];(n=this.context).error.apply(n,[this.descriptor.loggerTag].concat(t));var n},t}()},function(t,e,n){"use strict";function r(t){throw new Error(t)}var o=n(0);n.d(e,"a",function(){return i});var i=function(){function t(t,e,n,r,o){this.identifier=t,this.targetName=e,this.eventName=n,this.methodName=r,this.preventsDefault=o}return t.forOptions=function(e){return new t(e.identifier||r("Missing identifier in descriptor"),e.targetName||null,e.eventName||r("Missing event name in descriptor"),e.methodName||r("Missing method name in descriptor"),e.preventsDefault||!1)},t.forElementWithInlineDescriptorString=function(e,n){try{var r=this.parseOptionsFromInlineActionDescriptorString(n);return r.eventName=r.eventName||this.getDefaultEventNameForElement(e),t.forOptions(r)}catch(t){throw new Error('Bad descriptor "'+n+'": '+t.message)}},t.parseOptionsFromInlineActionDescriptorString=function(t){var e=t.trim(),n=e.match(/^(~)?((.+?)->)?(.+?)#(.+)$/)||r("Invalid descriptor syntax");return{identifier:n[4],eventName:n[3],methodName:n[5],preventsDefault:!n[1]}},t.getDefaultEventNameForElement=function(t){return this.defaultEventNames[t.tagName.toLowerCase()](t)},t.prototype.isEqualTo=function(t){return null!=t&&t.identifier==this.identifier&&t.targetName==this.targetName&&t.eventName==this.eventName&&t.methodName==this.methodName&&t.preventsDefault==this.preventsDefault},t.prototype.toString=function(){return(this.preventsDefault?"":"~")+this.eventName+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new o.c(this.toString(),"#000","#fc0")},enumerable:!0,configurable:!0}),t}();i.defaultEventNames={a:function(t){return"click"},button:function(t){return"click"},form:function(t){return"submit"},input:function(t){return"submit"==t.getAttribute("type")?"click":"change"},select:function(t){return"change"},textarea:function(t){return"change"}}},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e){return s.call(t,e)}function n(t){for(var e=new Set,n=0,r=t;n<r.length;n+=1){var o=r[n],i=o.attribute;void 0!=i&&e.add(i)}return e}function r(t,e,n){var r;n.has(t)?r=n.get(t):(r=new Set,n.set(t,r)),r.add(e)}function o(t,e,n){var r=n.get(t);r&&r.delete(e)}var i=Element.prototype,s=i.matches||i.webkitMatchesSelector||i.msMatchesSelector,c=function(t){try{this.source=t,this.tokens=l.readTokens(this.source),this.attributeSet=n(this.tokens)}catch(e){throw new Error("Error in selector '"+t+"': "+e.message)}},a={attributes:{}};c.get=function(t){var e,n=c.selectors;return t=t.toString().trim(),n.has(t)?e=n.get(t):(e=new c(t),n.set(t,e)),e},a.attributes.get=function(){return Array.from(this.attributeSet)},c.prototype.matches=function(t){return e(t,this.source)},c.prototype.toString=function(){return this.source},Object.defineProperties(c.prototype,a),c.selectors=new Map;var u;!function(t){t[t.TAG=0]="TAG",t[t.ID=1]="ID",t[t.CLASS=2]="CLASS",t[t.ATTR=3]="ATTR"}(u||(u={}));var l=function(t,e,n,r){this.type=t,this.value=e,this.data=n||"",this.negated=r},h={attribute:{},length:{}};l.readTokens=function(t){var e=l.readToken(t,u.TAG)||l.readToken(t,u.ID)||l.readToken(t,u.CLASS)||l.readToken(t,u.ATTR);if(e){var n=t.slice(e.length);return[e].concat(l.readTokens(n))}if(0==t.length)return[];throw new Error("Invalid or unsupported syntax near '"+t+"'")},l.readToken=function(t,e){var n=l.PATTERNS[e],r=":not("==t.slice(0,5),o=r?5:0,i=t.slice(o).match(n);if(i){var s=i[0],c=i[1];if(r){if(")"==t.charAt(s.length+o))return new l(e,":not("+s+")",c,!0);throw new Error("Expected close-parenthesis after ':not("+s+"'")}return new l(e,s,c,!1)}},h.attribute.get=function(){switch(this.type){case u.ID:return"id";case u.CLASS:return"class";case u.ATTR:return this.data}},h.length.get=function(){return this.value.length},Object.defineProperties(l.prototype,h),l.PATTERNS=function(){var t="\\\\[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?",e="(?:"+t+")|\\\\[^\\n\\r\\f0-9a-fA-F]",n="\\n|\\r\\n|\\r|\\f",r="[^\\0-\\177]",o="[_a-zA-Z]|(?:"+r+")|(?:"+e+")",i="[_a-zA-Z0-9-]|(?:"+r+")|(?:"+e+")",s="-?(?:"+o+")(?:"+i+")*",c='"(?:[^\\n\\r\\f\\\\"]|\\\\(?:'+n+")|(?:"+e+"))*",a="'(?:[^\\n\\r\\f\\\\']|\\\\(?:"+n+")|(?:"+e+"))*",l="(?:"+c+")|(?:"+a+")",h="(?:"+s+")|(?:"+l+")";return f={},f[u.TAG]=new RegExp("^("+s+")"),f[u.ID]=new RegExp("^#("+s+")"),f[u.CLASS]=new RegExp("^\\.("+s+")"),f[u.ATTR]=new RegExp("^\\[("+s+")(?:(=|~=|\\|=|\\^=|\\$=|\\*=)("+h+"))?\\]"),f;var f}();var f=function(t,e){var n=this;this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver(function(t){return n.processMutations(t)})};f.prototype.start=function(){this.started||(this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.started=!0,this.refresh())},f.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},f.prototype.refresh=function(){var t=this;if(this.started){for(var e=new Set(this.matchElementsInTree()),n=0,r=Array.from(t.elements);n<r.length;n+=1){var o=r[n];e.has(o)||t.removeElement(o)}for(var i=0,s=Array.from(e);i<s.length;i+=1){var c=s[i];t.addElement(c)}}},f.prototype.processMutations=function(t){for(var e=this,n=0,r=t;n<r.length;n+=1){var o=r[n];e.processMutation(o)}},f.prototype.processMutation=function(t){"attributes"==t.type?this.processAttributeChange(t.target,t.attributeName):"childList"==t.type&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))},f.prototype.processAttributeChange=function(t,e){var n=t;this.elements.has(n)?this.matchElement(n)?this.delegate.elementAttributeChanged(n,e):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},f.prototype.processRemovedNodes=function(t){for(var e=this,n=0,r=t;n<r.length;n+=1){var o=r[n];e.processNode(o,e.removeElement)}},f.prototype.processAddedNodes=function(t){for(var e=this,n=0,r=t;n<r.length;n+=1){var o=r[n];e.processNode(o,e.addElement)}},f.prototype.matchElement=function(t){return this.delegate.matchElement(t)},f.prototype.matchElementsInTree=function(t){return void 0===t&&(t=this.element),this.delegate.matchElementsInTree(t)},f.prototype.processNode=function(t,e){var n=this,r=this.elementFromNode(t);if(r)for(var o=0,i=n.matchElementsInTree(r);o<i.length;o+=1){var s=i[o];e.call(n,s)}},f.prototype.elementFromNode=function(t){if(t.nodeType==Node.ELEMENT_NODE)return t},f.prototype.addElement=function(t){this.elements.has(t)||(this.elements.add(t),this.delegate.elementMatched(t))},f.prototype.removeElement=function(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched(t))};var p=function(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new f(t,this)},d={element:{},selector:{}};d.element.get=function(){return this.elementObserver.element},d.selector.get=function(){return"["+this.attributeName+"]"},p.prototype.start=function(){this.elementObserver.start()},p.prototype.stop=function(){this.elementObserver.stop()},p.prototype.matchElement=function(t){return t.hasAttribute(this.attributeName)},p.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)},p.prototype.elementMatched=function(t){this.delegate.elementMatchedAttribute(t,this.attributeName)},p.prototype.elementUnmatched=function(t){this.delegate.elementUnmatchedAttribute(t,this.attributeName)},p.prototype.elementAttributeChanged=function(t,e){e==this.attributeName&&this.delegate.elementAttributeValueChanged(t,e)},Object.defineProperties(p.prototype,d);var m=function(){this.valuesByKey=new Map,this.keysByValue=new Map};m.prototype.add=function(t,e){r(t,e,this.valuesByKey),r(e,t,this.keysByValue)},m.prototype.delete=function(t,e){o(t,e,this.valuesByKey),o(e,t,this.keysByValue)},m.prototype.has=function(t,e){var n=this.valuesByKey.get(t);return!!n&&n.has(e)},m.prototype.getKeysForValue=function(t){var e=this.keysByValue.get(t);return e?Array.from(e):[]},m.prototype.getValuesForKey=function(t){var e=this.valuesByKey.get(t);return e?Array.from(e):[]},m.prototype.getValueCountForKey=function(t){var e=this.valuesByKey.get(t);return e?e.size:0};var g=function(t,e){this.delegate=e,this.elementObserver=new f(t,this),this.selectorSet=new Set,this.elements=new m,this.attributes=new m},v={started:{},element:{},selectors:{},compositeSelector:{}};v.started.get=function(){return this.elementObserver.started},g.prototype.start=function(){this.elementObserver.start()},g.prototype.stop=function(){this.elementObserver.stop()},g.prototype.refresh=function(){this.elementObserver.refresh()},v.element.get=function(){return this.elementObserver.element},v.selectors.get=function(){return Array.from(this.selectorSet)},v.compositeSelector.get=function(){var t=Array.from(this.selectorSet).join(", ");return 0==t.length?":not(*)":t},g.prototype.observeSelector=function(t){var e=this;if(!this.selectorSet.has(t)){this.selectorSet.add(t);for(var n=0,r=t.attributes;n<r.length;n+=1){var o=r[n];e.attributes.add(t,o)}this.refresh()}},g.prototype.stopObservingSelector=function(t){var e=this;if(this.selectorSet.has(t)){this.selectorSet.delete(t);for(var n=0,r=t.attributes;n<r.length;n+=1){var o=r[n];e.attributes.delete(t,o)}this.refresh()}},g.prototype.matchElement=function(t){return e(t,this.compositeSelector)},g.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.compositeSelector));return e.concat(n)},g.prototype.elementMatched=function(t){for(var e=this,n=0,r=e.selectors;n<r.length;n+=1){var o=r[n];e.elements.has(o,t)||o.matches(t)&&e.recordMatch(o,t)}},g.prototype.elementUnmatched=function(t){for(var e=this,n=0,r=e.selectors;n<r.length;n+=1){var o=r[n];e.elements.has(o,t)&&e.recordUnmatch(o,t)}},g.prototype.elementAttributeChanged=function(t,e){for(var n=this,r=0,o=n.attributes.getKeysForValue(e);r<o.length;r+=1){var i=o[r],s=i.matches(t),c=n.elements.has(i,t);s&&!c?n.recordMatch(i,t):c&&!s&&n.recordUnmatch(i,t)}},g.prototype.recordMatch=function(t,e){this.elements.add(t,e),this.delegate.elementMatchedSelector(e,t)},g.prototype.recordUnmatch=function(t,e){this.elements.delete(t,e),this.delegate.elementUnmatchedSelector(e,t)},Object.defineProperties(g.prototype,v);var y=function(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new f(t,this),this.tokensByElement=new m},b={started:{},element:{},selector:{}};b.started.get=function(){return this.elementObserver.started},y.prototype.start=function(){this.elementObserver.start()},y.prototype.stop=function(){this.elementObserver.stop()},y.prototype.refresh=function(){this.elementObserver.refresh()},b.element.get=function(){return this.elementObserver.element},b.selector.get=function(){return"["+this.attributeName+"]"},y.prototype.getElementsMatchingToken=function(t){return this.tokensByElement.getKeysForValue(t)},y.prototype.matchElement=function(t){return t.hasAttribute(this.attributeName)},y.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)},y.prototype.elementMatched=function(t){for(var e=this,n=Array.from(this.readTokenSetForElement(t)),r=0,o=n;r<o.length;r+=1){var i=o[r];e.addTokenForElement(i,t)}},y.prototype.elementUnmatched=function(t){for(var e=this,n=this.getTokensForElement(t),r=0,o=n;r<o.length;r+=1){var i=o[r];e.removeTokenForElement(i,t)}},y.prototype.elementAttributeChanged=function(t){for(var e=this,n=this.readTokenSetForElement(t),r=0,o=Array.from(n);r<o.length;r+=1){var i=o[r];e.addTokenForElement(i,t)}for(var s=0,c=e.getTokensForElement(t);s<c.length;s+=1){var a=c[s];n.has(a)||e.removeTokenForElement(a,t)}},y.prototype.addTokenForElement=function(t,e){this.tokensByElement.has(e,t)||(this.tokensByElement.add(e,t),this.delegate.elementMatchedTokenForAttribute(e,t,this.attributeName))},y.prototype.removeTokenForElement=function(t,e){this.tokensByElement.has(e,t)&&(this.tokensByElement.delete(e,t),this.delegate.elementUnmatchedTokenForAttribute(e,t,this.attributeName))},y.prototype.getTokensForElement=function(t){return this.tokensByElement.getValuesForKey(t)},y.prototype.readTokenSetForElement=function(t){for(var e=new Set,n=t.getAttribute(this.attributeName)||"",r=0,o=n.split(/\s+/);r<o.length;r+=1){var i=o[r];i.length&&e.add(i)}return e},Object.defineProperties(y.prototype,b),t.Selector=c,t.AttributeObserver=p,t.ElementObserver=f,t.SelectorObserver=g,t.TokenListObserver=y,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){"use strict";var r=n(8),o=n(0),i=n(16);n.d(e,"a",function(){return s});var s=function(){function t(t){void 0===t&&(t={}),this.configuration=n.i(r.a)(t),this.logger=new o.a(this.configuration.logLevel),this.router=new i.a(this)}return t.start=function(e){var n=new t(e);return n.start(),n},t.prototype.start=function(){this.router.start()},t.prototype.stop=function(){this.router.stop()},t.prototype.register=function(t,e){this.router.register(t,e)},t.prototype.getControllerForElementAndIdentifier=function(t,e){var n=this.router.getContextForElementAndIdentifier(t,e);return n?n.controller:null},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"application",{get:function(){return this.context.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targets",{get:function(){return this.context.targets},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.context.data},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){},t.prototype.connect=function(){},t.prototype.disconnect=function(){},t.prototype.addAction=function(t,e){this.context.addAction(t,e)},t.prototype.removeAction=function(t){this.context.removeAction(t)},t}()},function(t,e,n){"use strict";function r(t,e){return function(n,r,i){o(n,"initialize",function(){this.addAction(t+"->"+this.identifier+"#"+r,e)})}}function o(t,e,n){var r=t[e];t[e]=function(){n.apply(this,arguments),r.apply(this,arguments)}}e.a=r},function(t,e,n){"use strict";var r=n(15);n.d(e,"a",function(){return o});var o=function(){function t(){this.actionsByEventName=new r.a}return Object.defineProperty(t.prototype,"actions",{get:function(){return this.actionsByEventName.values},enumerable:!0,configurable:!0}),t.prototype.add=function(t){this.actionsByEventName.add(t.eventName,t)},t.prototype.delete=function(t){this.actionsByEventName.delete(t.eventName,t)},t.prototype.has=function(t){return this.actionsByEventName.hasValue(t)},t.prototype.getActionsForEventName=function(t){return this.actionsByEventName.get(t)},t}()},function(t,e,n){"use strict";function r(t){return Object.assign({},i,t)}var o=n(0);e.a=r;var i={logLevel:o.b.WARN,rootElement:document.documentElement,controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"}},function(t,e,n){"use strict";function r(t,e,n){if("function"==typeof t.closest){var r="["+e+"~='"+n+"']";return t.closest(r)}for(var o=t;o;){var i=o.getAttribute(e);if(i&&i.split(" ").indexOf(n)!=-1)return o;o=o.parentElement}return null}function o(t){return!!t&&("undefined"!=typeof EventTarget?t instanceof EventTarget:"function"==typeof t.addEventListener)}var i=n(1),s=n(11),c=n(2),a=n(12),u=n(14),l=n(0),h=n(17);n.d(e,"a",function(){return f});var f=function(){function t(t,e){this.contextSet=t,this.element=e,this.targets=new h.a(this),this.data=new s.a(this),this.dispatcher=new a.a(this),this.inlineActionObserver=new u.a(this,this),this.controller=new t.controllerConstructor(this);try{this.debug("Initializing controller"),this.controller.initialize()}catch(t){this.error(t,"while initializing controller")}}return t.prototype.connect=function(){this.dispatcher.start(),this.inlineActionObserver.start();try{this.debug("Connecting controller"),this.controller.connect()}catch(t){this.error(t,"while connecting controller")}},t.prototype.disconnect=function(){try{this.debug("Disconnecting controller"),this.controller.disconnect()}catch(t){this.error(t,"while disconnecting controller")}this.inlineActionObserver.stop(),this.dispatcher.stop()},t.prototype.canControlElement=function(t){return r(t,this.controllerAttribute,this.identifier)==this.element},Object.defineProperty(t.prototype,"application",{get:function(){return this.contextSet.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.contextSet.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"configuration",{get:function(){return this.application.configuration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.configuration.controllerAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actionAttribute",{get:function(){return this.configuration.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targetAttribute",{get:function(){return this.configuration.targetAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!0,configurable:!0}),t.prototype.addAction=function(t,e){var n,r=this;if(t instanceof i.a)n=t;else if("string"==typeof t){var s=t,a=void 0,u=void 0;if(o(e))a=e;else if(a=this.element,e){var l=e.targetName;u=function(t){return r.targets.matchesElementWithTargetName(t,l)}}var h=c.a.forElementWithInlineDescriptorString(a,s);n=new i.a(this,h,a,u)}n&&(this.debug(n.descriptor.loggerTag,"Adding action",n),this.dispatcher.addAction(n))},t.prototype.removeAction=function(t){this.debug(t.descriptor.loggerTag,"Removing action",t),this.dispatcher.removeAction(t)},t.prototype.inlineActionConnected=function(t){this.addAction(t)},t.prototype.inlineActionDisconnected=function(t){this.removeAction(t)},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(n=this.logger).debug.apply(n,[this.loggerTag].concat(t,[this.controller,this.element]));var n},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(n=this.logger).error.apply(n,[this.loggerTag].concat(t,[this.controller,this.element]));var n},Object.defineProperty(t.prototype,"logger",{get:function(){return this.application.logger},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new l.c(this.identifier,"#fff","#38f")},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";var r=n(9);n.d(e,"a",function(){return o});var o=function(){function t(t,e,n){this.router=t,this.identifier=e,this.controllerConstructor=n,this.contextsByElement=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(t.prototype,"application",{get:function(){return this.router.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.connectedContexts.size},enumerable:!0,configurable:!0}),t.prototype.connect=function(t){var e=this.fetchContextForElement(t);e&&!this.connectedContexts.has(e)&&(this.connectedContexts.add(e),e.connect())},t.prototype.disconnect=function(t){var e=this.fetchContextForElement(t);e&&this.connectedContexts.has(e)&&(this.connectedContexts.delete(e),e.disconnect())},t.prototype.getContextForElement=function(t){return this.contextsByElement.get(t)},t.prototype.fetchContextForElement=function(t){var e=this.contextsByElement.get(t);return e||(e=new r.a(this,t),this.contextsByElement.set(t,e)),e},t}()},function(t,e,n){"use strict";function r(t){return t.toString().replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}n.d(e,"a",function(){return o});var o=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return t=this.getFormattedKey(t),this.element.getAttribute(t)},t.prototype.set=function(t,e){return t=this.getFormattedKey(t),this.element.setAttribute(t,e),this.get(t)},t.prototype.has=function(t){return t=this.getFormattedKey(t),this.element.hasAttribute(t)},t.prototype.delete=function(t){return!!this.has(t)&&(t=this.getFormattedKey(t),this.element.removeAttribute(t),!0)},t.prototype.getFormattedKey=function(t){return"data-"+this.identifier+"-"+r(t)},t}()},function(t,e,n){"use strict";function r(t){var e=t.target;return e instanceof Element?e:e instanceof Node?e.parentElement:null}var o=n(7),i=n(13);n.d(e,"a",function(){return s});var s=function(){function t(t){this.context=t,this.started=!1,this.directActions=new o.a,this.delegatedActions=new o.a,this.events=new i.a,this.handleDirectEvent=this.handleDirectEvent.bind(this),this.handleDelegatedEvent=this.handleDelegatedEvent.bind(this)}return t.prototype.start=function(){this.started||(this.started=!0,this.addEventListeners())},t.prototype.stop=function(){this.started&&(this.removeEventListeners(),this.started=!1)},t.prototype.addAction=function(t){var e=this.getActionSetForAction(t);e.has(t)||(this.addEventListenerForAction(t),e.add(t))},t.prototype.removeAction=function(t){var e=this.getActionSetForAction(t);e.has(t)&&(this.removeEventListenerForAction(t),e.delete(t))},t.prototype.getActionSetForAction=function(t){return t.isDirect?this.directActions:this.delegatedActions},t.prototype.addEventListeners=function(){this.addEventListenersForActionSet(this.directActions),this.addEventListenersForActionSet(this.delegatedActions)},t.prototype.removeEventListeners=function(){this.removeEventListenersForActionSet(this.delegatedActions),this.removeEventListenersForActionSet(this.directActions)},t.prototype.addEventListenersForActionSet=function(t){for(var e=0,n=t.actions;e<n.length;e++){var r=n[e];this.addEventListenerForAction(r)}},t.prototype.removeEventListenersForActionSet=function(t){for(var e=0,n=t.actions;e<n.length;e++){var r=n[e];this.removeEventListenerForAction(r)}},t.prototype.addEventListenerForAction=function(t){if(this.started){var e=this.getEventListenerForAction(t);this.events.add(t.eventName,t.eventTarget,e,!1)}},t.prototype.removeEventListenerForAction=function(t){if(this.started){var e=this.getEventListenerForAction(t);this.events.delete(t.eventName,t.eventTarget,e,!1)}},t.prototype.getEventListenerForAction=function(t){return t.isDirect?this.handleDirectEvent:this.handleDelegatedEvent},t.prototype.handleDirectEvent=function(t){if(this.canHandleEvent(t)){var e=this.findDirectActionInvocationsForEvent(t);this.performActionInvocations(e)}},t.prototype.handleDelegatedEvent=function(t){if(this.canHandleEvent(t)){var e=this.findDelegatedActionInvocationsForEvent(t);this.performActionInvocations(e)}},t.prototype.canHandleEvent=function(t){var e=r(t);return!e||this.context.canControlElement(e)},t.prototype.findDirectActionInvocationsForEvent=function(t){for(var e=this.directActions.getActionsForEventName(t.type),n=t.currentTarget,r=[],o=0,i=e;o<i.length;o++){var s=i[o];s.eventTarget==n&&r.push([s,t,n])}return r},t.prototype.findDelegatedActionInvocationsForEvent=function(t){for(var e=this.delegatedActions.getActionsForEventName(t.type),n=this.getPathForEvent(t),r=[],o=0,i=n;o<i.length;o++)for(var s=i[o],c=0,a=e;c<a.length;c++){var u=a[c];u.matchDelegatedTarget(s)&&r.push([u,t,s])}return r},t.prototype.performActionInvocations=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],o=r[0],i=r[1],s=r[2];o.invokeWithEventAndTarget(i,s)}},t.prototype.getPathForEvent=function(t){for(var e=[],n=r(t);n&&n!=this.parentElement;)e.push(n),n=n.parentElement;return e},Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.context.parentElement},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=function(){function t(t,e,n,r){this.name=t,this.target=e,this.listener=n,this.useCapture=r,this.references=0}return t.prototype.isEqualTo=function(t){return t&&t.name===this.name&&t.target==this.target&&t.listener==this.listener&&t.useCapture==this.useCapture},t.prototype.observe=function(){return 0==this.references&&this.target.addEventListener(this.name,this.listener,this.useCapture),this.references++,1==this.references},t.prototype.stopObserving=function(){return this.references>0&&(1==this.references&&this.target.removeEventListener(this.name,this.listener,this.useCapture),this.references--),0==this.references},t}(),o=function(){function t(){this.observers=new Set}return t.prototype.add=function(t,e,n,o){var i=new r(t,e,n,o);this.addObserver(i)},t.prototype.delete=function(t,e,n,o){var i=new r(t,e,n,o);this.deleteObserver(i)},t.prototype.addObserver=function(t){var e=this.findMatchingObserver(t);e.observe()&&this.observers.add(e)},t.prototype.deleteObserver=function(t){var e=this.findMatchingObserver(t);e.stopObserving()&&this.observers.delete(e)},t.prototype.findMatchingObserver=function(t){for(var e=0,n=Array.from(this.observers);e<n.length;e++){var r=n[e];if(r.isEqualTo(t))return r}return t},t}()},function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(3);n.n(i);n.d(e,"a",function(){return s});var s=function(){function t(t,e){this.context=t,this.delegate=e,this.attributeObserver=new i.AttributeObserver(this.element,this.attributeName,this),this.connectedActions=new Map}return Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.context.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.attributeObserver.start()},t.prototype.stop=function(){this.attributeObserver.stop()},t.prototype.elementMatchedAttribute=function(t,e){this.context.canControlElement(t)&&this.refreshActionForElement(t)},t.prototype.elementAttributeValueChanged=function(t,e){this.context.canControlElement(t)&&this.refreshActionForElement(t)},t.prototype.elementUnmatchedAttribute=function(t,e){this.disconnectActionForElement(t)},t.prototype.refreshActionForElement=function(t){var e=t.getAttribute(this.attributeName);if(null==e||0==e.trim().length)this.disconnectActionForElement(t);else{var n=this.buildActionForElementWithDescriptorString(t,e);if(n){var r=this.getActionForElement(t);n.hasSameDescriptorAs(r)||(this.disconnectActionForElement(t),this.connectActionForElement(n,t))}else this.disconnectActionForElement(t)}},t.prototype.connectActionForElement=function(t,e){this.connectedActions.set(e,t),this.delegate.inlineActionConnected(t)},t.prototype.disconnectActionForElement=function(t){var e=this.getActionForElement(t);e&&(this.connectedActions.delete(t),this.delegate.inlineActionDisconnected(e))},t.prototype.getActionForElement=function(t){return this.connectedActions.get(t)||null},t.prototype.buildActionForElementWithDescriptorString=function(t,e){try{var n=o.a.forElementWithInlineDescriptorString(t,e);if(n.identifier==this.identifier)return new r.a(this.context,n,this.element,function(e){return e==t})}catch(e){this.context.error(e,"while parsing descriptor string for element",t)}},t}()},function(t,e,n){"use strict";function r(t,e,n){var r=t.get(e);return r||(r=new n,t.set(e,r)),r}function o(t,e){var n=t.get(e);null!=n&&0==n.size&&t.delete(e)}n.d(e,"a",function(){return i});var i=function(){function t(){this.map=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t.concat(Array.from(e))},[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t+e.size},0)},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){r(this.map,t,Set).add(e)},t.prototype.delete=function(t,e){r(this.map,t,Set).delete(e),o(this.map,t)},t.prototype.has=function(t,e){var n=this.map.get(t);return null!=n&&n.has(e)},t.prototype.hasKey=function(t){return this.map.has(t)},t.prototype.hasValue=function(t){return Array.from(this.map.values()).some(function(e){return e.has(t)})},t.prototype.get=function(t){var e=this.map.get(t);return e?Array.from(e):[]},t}();!function(){function t(){this.map=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t.concat(e.values)},[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t+e.size},0)},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e,n){r(this.map,t,i).add(e,n)},t.prototype.delete=function(t,e,n){r(this.map,t,i).delete(e,n),o(this.map,t)},t.prototype.has=function(t,e,n){var r=this.map.get(t);return null!=r&&r.has(e,n)},t.prototype.hasKey=function(t,e){if(1==arguments.length)return this.map.has(t);var n=this.map.get(t);return null!=n&&n.hasKey(e)},t.prototype.hasValue=function(t){return Array.from(this.map.values()).some(function(e){return e.hasValue(t)})},t.prototype.get=function(t,e){var n=this.map.get(t);return n?n.get(e):[]},t}()},function(t,e,n){"use strict";var r=n(10),o=n(3);n.n(o);n.d(e,"a",function(){return i});var i=function(){function t(t){this.application=t,this.tokenListObserver=new o.TokenListObserver(this.element,this.controllerAttribute,this),this.contextSets=new Map}return Object.defineProperty(t.prototype,"configuration",{get:function(){return this.application.configuration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.configuration.rootElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.configuration.controllerAttribute},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.tokenListObserver.start()},t.prototype.stop=function(){this.tokenListObserver.stop()},t.prototype.register=function(t,e){if(this.contextSets.has(t))throw new Error("Router already has a controller registered with the identifier '"+t+"'");var n=new r.a(this,t,e);this.contextSets.set(t,n),this.connectContextSet(n)},t.prototype.elementMatchedTokenForAttribute=function(t,e,n){this.connectContextForIdentifierToElement(e,t)},t.prototype.elementUnmatchedTokenForAttribute=function(t,e,n){this.disconnectContextForIdentifierFromElement(e,t)},t.prototype.getContextForElementAndIdentifier=function(t,e){var n=this.contextSets.get(e);if(n)return n.getContextForElement(t)},t.prototype.connectContextSet=function(t){for(var e=this.tokenListObserver.getElementsMatchingToken(t.identifier),n=0,r=e;n<r.length;n++){var o=r[n];t.connect(o)}},t.prototype.connectContextForIdentifierToElement=function(t,e){var n=this.contextSets.get(t);n&&n.connect(e)},t.prototype.disconnectContextForIdentifierFromElement=function(t,e){var n=this.contextSets.get(t);n&&n.disconnect(e)},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.context.targetAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return null!=this.find(t)},t.prototype.find=function(t){var e=this.getSelectorForTargetName(t),n=this.element.querySelector(e);return n&&this.context.canControlElement(n)?n:null},t.prototype.findAll=function(t){var e=this,n=this.getSelectorForTargetName(t);return Array.from(this.element.querySelectorAll(n)).filter(function(t){return e.context.canControlElement(t)})},t.prototype.matchesElementWithTargetName=function(t,e){var n=t.getAttribute(this.attributeName);if(n){var r=n.split(" "),o=this.identifier+"."+e;return r.indexOf(o)>-1&&this.context.canControlElement(t)}return!1},t.prototype.getSelectorForTargetName=function(t){return"["+this.attributeName+"~='"+this.identifier+"."+t+"']"},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);n.d(e,"Action",function(){return r.a});var o=n(4);n.d(e,"Application",function(){return o.a});var i=n(5);n.d(e,"Controller",function(){return i.a});var s=n(2);n.d(e,"Descriptor",function(){return s.a});var c=n(0);n.d(e,"Logger",function(){return c.a}),n.d(e,"LogLevel",function(){return c.b});var a=n(6);n.d(e,"on",function(){return a.a})}])});
/*
Stimulus 0.3.3
Copyright © 2017 Basecamp, LLC
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Stimulus=e():t.Stimulus=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=18)}([function(t,e,n){"use strict";function r(t){return t.replace(/%/g,"%%")}n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a}),n.d(e,"c",function(){return u});var o;!function(t){t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(o||(o={}));var i="safari"in window,s=/(Trident|Edge)\//.test(navigator.userAgent),c=!s,a=function(){function t(t,e){void 0===t&&(t=o.WARN),void 0===e&&(e=window.console),this.level=t,this.console=e}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.DEBUG&&this.console.log.apply(this.console,this.formatArgs(t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.INFO&&this.console.log.apply(this.console,this.formatArgs(t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.WARN&&this.console.warn.apply(this.console,this.formatArgs(t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.level>=o.ERROR&&this.console.error.apply(this.console,this.formatArgs(t))},t.prototype.formatArgs=function(t){if(!c)return t;for(var e=[],n=[],r=0,o=[this.loggerTag].concat(t);r<o.length;r++){var s=o[r],a=typeof s;"string"==a||"number"==a||"boolean"==a?(e.push("%c%s "),n.push("font-family: sans-serif; font-size: small; color: #888",s)):s instanceof Node?(e.push("%o"),n.push(s)):s instanceof u?(e.push(s.formatString," "),n.push.apply(n,s.formatValues)):s instanceof Error?(e.push("\n\n%o\n\n"),n.push(s)):(e.push(i?"%O":"%O "),n.push(s))}return[e.join("")].concat(n)},Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new u("Stimulus")},enumerable:!0,configurable:!0}),t}(),u=function(){function t(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#aaa"),this.name=t,this.foregroundColor=e,this.backgroundColor=n}return Object.defineProperty(t.prototype,"formatString",{get:function(){return"%c"+r(this.name)+"%c"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formatValues",{get:function(){return[this.formatValue,""]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formatValue",{get:function(){return"\n color: "+this.foregroundColor+";\n background-color: "+this.backgroundColor+";\n border: 1px solid rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n padding: 1px 6px;\n font-weight: bold;\n font-family: sans-serif;\n font-size: x-small;\n "},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t,e,n,r){this.context=t,this.descriptor=e,this.eventTarget=n,this.delegatedTargetMatcher=r}return Object.defineProperty(t.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventName",{get:function(){return this.descriptor.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"methodName",{get:function(){return this.descriptor.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preventsDefault",{get:function(){return this.descriptor.preventsDefault},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDirect",{get:function(){return null==this.delegatedTargetMatcher},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDelegated",{get:function(){return!this.isDirect},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"method",{get:function(){var t=this.controller[this.methodName];if("function"==typeof t)return t;throw new Error('Action references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),t.prototype.hasSameDescriptorAs=function(t){return null!=t&&t.descriptor.isEqualTo(this.descriptor)},t.prototype.matchDelegatedTarget=function(t){var e=this.delegatedTargetMatcher;return!!e&&e(t)},t.prototype.invokeWithEventAndTarget=function(t,e){this.preventsDefault&&t.preventDefault(),this.debug("Invoking action",this,t);try{this.method.call(this.controller,t,e)}catch(e){this.error(e,"while invoking action",this,t)}},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];(n=this.context).debug.apply(n,[this.descriptor.loggerTag].concat(t));var n},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];(n=this.context).error.apply(n,[this.descriptor.loggerTag].concat(t));var n},t}()},function(t,e,n){"use strict";function r(t){throw new Error(t)}var o=n(0);n.d(e,"a",function(){return i});var i=function(){function t(t,e,n,r,o){this.identifier=t,this.targetName=e,this.eventName=n,this.methodName=r,this.preventsDefault=o}return t.forOptions=function(e){return new t(e.identifier||r("Missing identifier in descriptor"),e.targetName||null,e.eventName||r("Missing event name in descriptor"),e.methodName||r("Missing method name in descriptor"),e.preventsDefault||!1)},t.forElementWithInlineDescriptorString=function(e,n){try{var r=this.parseOptionsFromInlineActionDescriptorString(n);return r.eventName=r.eventName||this.getDefaultEventNameForElement(e),t.forOptions(r)}catch(t){throw new Error('Bad descriptor "'+n+'": '+t.message)}},t.parseOptionsFromInlineActionDescriptorString=function(t){var e=t.trim(),n=e.match(/^(~)?((.+?)->)?(.+?)#(.+)$/)||r("Invalid descriptor syntax");return{identifier:n[4],eventName:n[3],methodName:n[5],preventsDefault:!n[1]}},t.getDefaultEventNameForElement=function(t){return this.defaultEventNames[t.tagName.toLowerCase()](t)},t.prototype.isEqualTo=function(t){return null!=t&&t.identifier==this.identifier&&t.targetName==this.targetName&&t.eventName==this.eventName&&t.methodName==this.methodName&&t.preventsDefault==this.preventsDefault},t.prototype.toString=function(){return(this.preventsDefault?"":"~")+this.eventName+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new o.c(this.toString(),"#000","#fc0")},enumerable:!0,configurable:!0}),t}();i.defaultEventNames={a:function(t){return"click"},button:function(t){return"click"},form:function(t){return"submit"},input:function(t){return"submit"==t.getAttribute("type")?"click":"change"},select:function(t){return"change"},textarea:function(t){return"change"}}},function(t,e,n){!function(e,n){t.exports=n()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t,e){var n=this;this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver(function(t){return n.processMutations(t)})}return t.prototype.start=function(){this.started||(this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.started=!0,this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started){for(var t=new Set(this.matchElementsInTree()),e=0,n=Array.from(this.elements);e<n.length;e++){var r=n[e];t.has(r)||this.removeElement(r)}for(var o=0,i=Array.from(t);o<i.length;o++){var r=i[o];this.addElement(r)}}},t.prototype.processMutations=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];this.processMutation(r)}},t.prototype.processMutation=function(t){"attributes"==t.type?this.processAttributeChange(t.target,t.attributeName):"childList"==t.type&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))},t.prototype.processAttributeChange=function(t,e){var n=t;this.elements.has(n)?this.matchElement(n)?this.delegate.elementAttributeChanged(n,e):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},t.prototype.processRemovedNodes=function(t){for(var e=0,n=Array.from(t);e<n.length;e++){var r=n[e];this.processNode(r,this.removeElement)}},t.prototype.processAddedNodes=function(t){for(var e=0,n=Array.from(t);e<n.length;e++){var r=n[e];this.processNode(r,this.addElement)}},t.prototype.matchElement=function(t){return this.delegate.matchElement(t)},t.prototype.matchElementsInTree=function(t){return void 0===t&&(t=this.element),this.delegate.matchElementsInTree(t)},t.prototype.processNode=function(t,e){var n=this.elementFromNode(t);if(n)for(var r=0,o=this.matchElementsInTree(n);r<o.length;r++){var i=o[r];e.call(this,i)}},t.prototype.elementFromNode=function(t){if(t.nodeType==Node.ELEMENT_NODE)return t},t.prototype.addElement=function(t){this.elements.has(t)||(this.elements.add(t),this.delegate.elementMatched(t))},t.prototype.removeElement=function(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched(t))},t}()},function(t,e,n){"use strict";function r(t,e){return i.call(t,e)}e.a=r;var o=Element.prototype,i=o.matches||o.webkitMatchesSelector||o.msMatchesSelector},function(t,e,n){"use strict";function r(t,e,n){var r;n.has(t)?r=n.get(t):(r=new Set,n.set(t,r)),r.add(e)}function o(t,e,n){var r=n.get(t);r&&r.delete(e)}n.d(e,"a",function(){return i});var i=function(){function t(){this.valuesByKey=new Map,this.keysByValue=new Map}return t.prototype.add=function(t,e){r(t,e,this.valuesByKey),r(e,t,this.keysByValue)},t.prototype.delete=function(t,e){o(t,e,this.valuesByKey),o(e,t,this.keysByValue)},t.prototype.has=function(t,e){var n=this.valuesByKey.get(t);return!!n&&n.has(e)},t.prototype.getKeysForValue=function(t){var e=this.keysByValue.get(t);return e?Array.from(e):[]},t.prototype.getValuesForKey=function(t){var e=this.valuesByKey.get(t);return e?Array.from(e):[]},t.prototype.getValueCountForKey=function(t){var e=this.valuesByKey.get(t);return e?e.size:0},t}()},function(t,e,n){"use strict";var r=n(0);n.d(e,"a",function(){return o});var o=function(){function t(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new r.a(t,this)}return Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.matchElement=function(t){return t.hasAttribute(this.attributeName)},t.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)},t.prototype.elementMatched=function(t){this.delegate.elementMatchedAttribute(t,this.attributeName)},t.prototype.elementUnmatched=function(t){this.delegate.elementUnmatchedAttribute(t,this.attributeName)},t.prototype.elementAttributeChanged=function(t,e){e==this.attributeName&&this.delegate.elementAttributeValueChanged(t,e)},t}()},function(t,e,n){"use strict";function r(t){for(var e=new Set,n=0,r=t;n<r.length;n++){var o=r[n],i=o.attribute;void 0!=i&&e.add(i)}return e}var o=n(1);n.d(e,"a",function(){return i});var i=function(){function t(t){try{this.source=t,this.tokens=c.readTokens(this.source),this.attributeSet=r(this.tokens)}catch(e){throw new Error("Error in selector '"+t+"': "+e.message)}}return t.get=function(e){var n,r=t.selectors;return e=e.toString().trim(),r.has(e)?n=r.get(e):(n=new t(e),r.set(e,n)),n},Object.defineProperty(t.prototype,"attributes",{get:function(){return Array.from(this.attributeSet)},enumerable:!0,configurable:!0}),t.prototype.matches=function(t){return n.i(o.a)(t,this.source)},t.prototype.toString=function(){return this.source},t}();i.selectors=new Map;var s;!function(t){t[t.TAG=0]="TAG",t[t.ID=1]="ID",t[t.CLASS=2]="CLASS",t[t.ATTR=3]="ATTR"}(s||(s={}));var c=function(){function t(t,e,n,r){this.type=t,this.value=e,this.data=n||"",this.negated=r}return t.readTokens=function(e){var n=t.readToken(e,s.TAG)||t.readToken(e,s.ID)||t.readToken(e,s.CLASS)||t.readToken(e,s.ATTR);if(n){var r=e.slice(n.length);return[n].concat(t.readTokens(r))}if(0==e.length)return[];throw new Error("Invalid or unsupported syntax near '"+e+"'")},t.readToken=function(e,n){var r=t.PATTERNS[n],o=":not("==e.slice(0,5),i=o?5:0,s=e.slice(i).match(r);if(s){var c=s[0],a=s[1];if(o){if(")"==e.charAt(c.length+i))return new t(n,":not("+c+")",a,!0);throw new Error("Expected close-parenthesis after ':not("+c+"'")}return new t(n,c,a,!1)}},Object.defineProperty(t.prototype,"attribute",{get:function(){switch(this.type){case s.ID:return"id";case s.CLASS:return"class";case s.ATTR:return this.data}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.value.length},enumerable:!0,configurable:!0}),t}();c.PATTERNS=function(){var t="(?:\\\\[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)|\\\\[^\\n\\r\\f0-9a-fA-F]",e="\\n|\\r\\n|\\r|\\f",n="-?(?:[_a-zA-Z]|(?:[^\\0-\\177])|(?:"+t+"))(?:[_a-zA-Z0-9-]|(?:[^\\0-\\177])|(?:"+t+"))*";return r={},r[s.TAG]=new RegExp("^("+n+")"),r[s.ID]=new RegExp("^#("+n+")"),r[s.CLASS]=new RegExp("^\\.("+n+")"),r[s.ATTR]=new RegExp("^\\[("+n+")(?:(=|~=|\\|=|\\^=|\\$=|\\*=)((?:"+n+')|(?:(?:"(?:[^\\n\\r\\f\\\\"]|\\\\(?:'+e+")|(?:"+t+"))*)|(?:'(?:[^\\n\\r\\f\\\\']|\\\\(?:"+e+")|(?:"+t+"))*))))?\\]"),r;var r}()},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(1);n.d(e,"a",function(){return s});var s=function(){function t(t,e){this.delegate=e,this.elementObserver=new r.a(t,this),this.selectorSet=new Set,this.elements=new o.a,this.attributes=new o.a}return Object.defineProperty(t.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectors",{get:function(){return Array.from(this.selectorSet)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compositeSelector",{get:function(){var t=Array.from(this.selectorSet).join(", ");return 0==t.length?":not(*)":t},enumerable:!0,configurable:!0}),t.prototype.observeSelector=function(t){if(!this.selectorSet.has(t)){this.selectorSet.add(t);for(var e=0,n=t.attributes;e<n.length;e++){var r=n[e];this.attributes.add(t,r)}this.refresh()}},t.prototype.stopObservingSelector=function(t){if(this.selectorSet.has(t)){this.selectorSet.delete(t);for(var e=0,n=t.attributes;e<n.length;e++){var r=n[e];this.attributes.delete(t,r)}this.refresh()}},t.prototype.matchElement=function(t){return n.i(i.a)(t,this.compositeSelector)},t.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.compositeSelector));return e.concat(n)},t.prototype.elementMatched=function(t){for(var e=0,n=this.selectors;e<n.length;e++){var r=n[e];this.elements.has(r,t)||r.matches(t)&&this.recordMatch(r,t)}},t.prototype.elementUnmatched=function(t){for(var e=0,n=this.selectors;e<n.length;e++){var r=n[e];this.elements.has(r,t)&&this.recordUnmatch(r,t)}},t.prototype.elementAttributeChanged=function(t,e){for(var n=0,r=this.attributes.getKeysForValue(e);n<r.length;n++){var o=r[n],i=o.matches(t),s=this.elements.has(o,t);i&&!s?this.recordMatch(o,t):s&&!i&&this.recordUnmatch(o,t)}},t.prototype.recordMatch=function(t,e){this.elements.add(t,e),this.delegate.elementMatchedSelector(e,t)},t.prototype.recordUnmatch=function(t,e){this.elements.delete(t,e),this.delegate.elementUnmatchedSelector(e,t)},t}()},function(t,e,n){"use strict";var r=n(0),o=n(2);n.d(e,"a",function(){return i});var i=function(){function t(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new r.a(t,this),this.tokensByElement=new o.a}return Object.defineProperty(t.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!0,configurable:!0}),t.prototype.getElementsMatchingToken=function(t){return this.tokensByElement.getKeysForValue(t)},t.prototype.matchElement=function(t){return t.hasAttribute(this.attributeName)},t.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)},t.prototype.elementMatched=function(t){for(var e=Array.from(this.readTokenSetForElement(t)),n=0,r=e;n<r.length;n++){var o=r[n];this.addTokenForElement(o,t)}},t.prototype.elementUnmatched=function(t){for(var e=this.getTokensForElement(t),n=0,r=e;n<r.length;n++){var o=r[n];this.removeTokenForElement(o,t)}},t.prototype.elementAttributeChanged=function(t){for(var e=this.readTokenSetForElement(t),n=0,r=Array.from(e);n<r.length;n++){var o=r[n];this.addTokenForElement(o,t)}for(var i=0,s=this.getTokensForElement(t);i<s.length;i++){var o=s[i];e.has(o)||this.removeTokenForElement(o,t)}},t.prototype.addTokenForElement=function(t,e){this.tokensByElement.has(e,t)||(this.tokensByElement.add(e,t),this.delegate.elementMatchedTokenForAttribute(e,t,this.attributeName))},t.prototype.removeTokenForElement=function(t,e){this.tokensByElement.has(e,t)&&(this.tokensByElement.delete(e,t),this.delegate.elementUnmatchedTokenForAttribute(e,t,this.attributeName))},t.prototype.getTokensForElement=function(t){return this.tokensByElement.getValuesForKey(t)},t.prototype.readTokenSetForElement=function(t){for(var e=new Set,n=t.getAttribute(this.attributeName)||"",r=0,o=n.split(/\s+/);r<o.length;r++){var i=o[r];i.length&&e.add(i)}return e},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4);n.d(e,"Selector",function(){return r.a});var o=n(3);n.d(e,"AttributeObserver",function(){return o.a});var i=n(0);n.d(e,"ElementObserver",function(){return i.a});var s=n(5);n.d(e,"SelectorObserver",function(){return s.a});var c=n(6);n.d(e,"TokenListObserver",function(){return c.a})}])})},function(t,e,n){"use strict";var r=n(8),o=n(0),i=n(16);n.d(e,"a",function(){return s});var s=function(){function t(t){void 0===t&&(t={}),this.configuration=n.i(r.a)(t),this.logger=new o.a(this.configuration.logLevel),this.router=new i.a(this)}return t.start=function(e){var n=new t(e);return n.start(),n},t.prototype.start=function(){this.router.start()},t.prototype.stop=function(){this.router.stop()},t.prototype.register=function(t,e){this.router.register(t,e)},t.prototype.getControllerForElementAndIdentifier=function(t,e){var n=this.router.getContextForElementAndIdentifier(t,e);return n?n.controller:null},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"application",{get:function(){return this.context.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targets",{get:function(){return this.context.targets},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.context.data},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){},t.prototype.connect=function(){},t.prototype.disconnect=function(){},t.prototype.addAction=function(t,e){this.context.addAction(t,e)},t.prototype.removeAction=function(t){this.context.removeAction(t)},t}()},function(t,e,n){"use strict";function r(t,e){return function(n,r,i){o(n,"initialize",function(){this.addAction(t+"->"+this.identifier+"#"+r,e)})}}function o(t,e,n){var r=t[e];t[e]=function(){n.apply(this,arguments),r.apply(this,arguments)}}e.a=r},function(t,e,n){"use strict";var r=n(15);n.d(e,"a",function(){return o});var o=function(){function t(){this.actionsByEventName=new r.a}return Object.defineProperty(t.prototype,"actions",{get:function(){return this.actionsByEventName.values},enumerable:!0,configurable:!0}),t.prototype.add=function(t){this.actionsByEventName.add(t.eventName,t)},t.prototype.delete=function(t){this.actionsByEventName.delete(t.eventName,t)},t.prototype.has=function(t){return this.actionsByEventName.hasValue(t)},t.prototype.getActionsForEventName=function(t){return this.actionsByEventName.get(t)},t}()},function(t,e,n){"use strict";function r(t){return Object.assign({},i,t)}var o=n(0);e.a=r;var i={logLevel:o.b.WARN,rootElement:document.documentElement,controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"}},function(t,e,n){"use strict";function r(t,e,n){if("function"==typeof t.closest){var r="["+e+"~='"+n+"']";return t.closest(r)}for(var o=t;o;){var i=o.getAttribute(e);if(i&&i.split(" ").indexOf(n)!=-1)return o;o=o.parentElement}return null}function o(t){return!!t&&("undefined"!=typeof EventTarget?t instanceof EventTarget:"function"==typeof t.addEventListener)}var i=n(1),s=n(11),c=n(2),a=n(12),u=n(14),l=n(0),f=n(17);n.d(e,"a",function(){return h});var h=function(){function t(t,e){this.contextSet=t,this.element=e,this.targets=new f.a(this),this.data=new s.a(this),this.dispatcher=new a.a(this),this.inlineActionObserver=new u.a(this,this),this.controller=new t.controllerConstructor(this);try{this.debug("Initializing controller"),this.controller.initialize()}catch(t){this.error(t,"while initializing controller")}}return t.prototype.connect=function(){this.dispatcher.start(),this.inlineActionObserver.start();try{this.debug("Connecting controller"),this.controller.connect()}catch(t){this.error(t,"while connecting controller")}},t.prototype.disconnect=function(){try{this.debug("Disconnecting controller"),this.controller.disconnect()}catch(t){this.error(t,"while disconnecting controller")}this.inlineActionObserver.stop(),this.dispatcher.stop()},t.prototype.canControlElement=function(t){return r(t,this.controllerAttribute,this.identifier)==this.element},Object.defineProperty(t.prototype,"application",{get:function(){return this.contextSet.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.contextSet.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"configuration",{get:function(){return this.application.configuration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.configuration.controllerAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actionAttribute",{get:function(){return this.configuration.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targetAttribute",{get:function(){return this.configuration.targetAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!0,configurable:!0}),t.prototype.addAction=function(t,e){var n,r=this;if(t instanceof i.a)n=t;else if("string"==typeof t){var s=t,a=void 0,u=void 0;if(o(e))a=e;else if(a=this.element,e){var l=e.targetName;u=function(t){return r.targets.matchesElementWithTargetName(t,l)}}var f=c.a.forElementWithInlineDescriptorString(a,s);n=new i.a(this,f,a,u)}n&&(this.debug(n.descriptor.loggerTag,"Adding action",n),this.dispatcher.addAction(n))},t.prototype.removeAction=function(t){this.debug(t.descriptor.loggerTag,"Removing action",t),this.dispatcher.removeAction(t)},t.prototype.inlineActionConnected=function(t){this.addAction(t)},t.prototype.inlineActionDisconnected=function(t){this.removeAction(t)},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(n=this.logger).debug.apply(n,[this.loggerTag].concat(t,[this.controller,this.element]));var n},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(n=this.logger).error.apply(n,[this.loggerTag].concat(t,[this.controller,this.element]));var n},Object.defineProperty(t.prototype,"logger",{get:function(){return this.application.logger},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loggerTag",{get:function(){return new l.c(this.identifier,"#fff","#38f")},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";var r=n(9);n.d(e,"a",function(){return o});var o=function(){function t(t,e,n){this.router=t,this.identifier=e,this.controllerConstructor=n,this.contextsByElement=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(t.prototype,"application",{get:function(){return this.router.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.connectedContexts.size},enumerable:!0,configurable:!0}),t.prototype.connect=function(t){var e=this.fetchContextForElement(t);e&&!this.connectedContexts.has(e)&&(this.connectedContexts.add(e),e.connect())},t.prototype.disconnect=function(t){var e=this.fetchContextForElement(t);e&&this.connectedContexts.has(e)&&(this.connectedContexts.delete(e),e.disconnect())},t.prototype.getContextForElement=function(t){return this.contextsByElement.get(t)},t.prototype.fetchContextForElement=function(t){var e=this.contextsByElement.get(t);return e||(e=new r.a(this,t),this.contextsByElement.set(t,e)),e},t}()},function(t,e,n){"use strict";function r(t){return t.toString().replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}n.d(e,"a",function(){return o});var o=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return t=this.getFormattedKey(t),this.element.getAttribute(t)},t.prototype.set=function(t,e){return t=this.getFormattedKey(t),this.element.setAttribute(t,e),this.get(t)},t.prototype.has=function(t){return t=this.getFormattedKey(t),this.element.hasAttribute(t)},t.prototype.delete=function(t){return!!this.has(t)&&(t=this.getFormattedKey(t),this.element.removeAttribute(t),!0)},t.prototype.getFormattedKey=function(t){return"data-"+this.identifier+"-"+r(t)},t}()},function(t,e,n){"use strict";function r(t){var e=t.target;return e instanceof Element?e:e instanceof Node?e.parentElement:null}var o=n(7),i=n(13);n.d(e,"a",function(){return s});var s=function(){function t(t){this.context=t,this.started=!1,this.directActions=new o.a,this.delegatedActions=new o.a,this.events=new i.a,this.handleDirectEvent=this.handleDirectEvent.bind(this),this.handleDelegatedEvent=this.handleDelegatedEvent.bind(this)}return t.prototype.start=function(){this.started||(this.started=!0,this.addEventListeners())},t.prototype.stop=function(){this.started&&(this.removeEventListeners(),this.started=!1)},t.prototype.addAction=function(t){var e=this.getActionSetForAction(t);e.has(t)||(this.addEventListenerForAction(t),e.add(t))},t.prototype.removeAction=function(t){var e=this.getActionSetForAction(t);e.has(t)&&(this.removeEventListenerForAction(t),e.delete(t))},t.prototype.getActionSetForAction=function(t){return t.isDirect?this.directActions:this.delegatedActions},t.prototype.addEventListeners=function(){this.addEventListenersForActionSet(this.directActions),this.addEventListenersForActionSet(this.delegatedActions)},t.prototype.removeEventListeners=function(){this.removeEventListenersForActionSet(this.delegatedActions),this.removeEventListenersForActionSet(this.directActions)},t.prototype.addEventListenersForActionSet=function(t){for(var e=0,n=t.actions;e<n.length;e++){var r=n[e];this.addEventListenerForAction(r)}},t.prototype.removeEventListenersForActionSet=function(t){for(var e=0,n=t.actions;e<n.length;e++){var r=n[e];this.removeEventListenerForAction(r)}},t.prototype.addEventListenerForAction=function(t){if(this.started){var e=this.getEventListenerForAction(t);this.events.add(t.eventName,t.eventTarget,e,!1)}},t.prototype.removeEventListenerForAction=function(t){if(this.started){var e=this.getEventListenerForAction(t);this.events.delete(t.eventName,t.eventTarget,e,!1)}},t.prototype.getEventListenerForAction=function(t){return t.isDirect?this.handleDirectEvent:this.handleDelegatedEvent},t.prototype.handleDirectEvent=function(t){if(this.canHandleEvent(t)){var e=this.findDirectActionInvocationsForEvent(t);this.performActionInvocations(e)}},t.prototype.handleDelegatedEvent=function(t){if(this.canHandleEvent(t)){var e=this.findDelegatedActionInvocationsForEvent(t);this.performActionInvocations(e)}},t.prototype.canHandleEvent=function(t){var e=r(t);return!e||this.context.canControlElement(e)},t.prototype.findDirectActionInvocationsForEvent=function(t){for(var e=this.directActions.getActionsForEventName(t.type),n=t.currentTarget,r=[],o=0,i=e;o<i.length;o++){var s=i[o];s.eventTarget==n&&r.push([s,t,n])}return r},t.prototype.findDelegatedActionInvocationsForEvent=function(t){for(var e=this.delegatedActions.getActionsForEventName(t.type),n=this.getPathForEvent(t),r=[],o=0,i=n;o<i.length;o++)for(var s=i[o],c=0,a=e;c<a.length;c++){var u=a[c];u.matchDelegatedTarget(s)&&r.push([u,t,s])}return r},t.prototype.performActionInvocations=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],o=r[0],i=r[1],s=r[2];o.invokeWithEventAndTarget(i,s)}},t.prototype.getPathForEvent=function(t){for(var e=[],n=r(t);n&&n!=this.parentElement;)e.push(n),n=n.parentElement;return e},Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.context.parentElement},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=function(){function t(t,e,n,r){this.name=t,this.target=e,this.listener=n,this.useCapture=r,this.references=0}return t.prototype.isEqualTo=function(t){return t&&t.name===this.name&&t.target==this.target&&t.listener==this.listener&&t.useCapture==this.useCapture},t.prototype.observe=function(){return 0==this.references&&this.target.addEventListener(this.name,this.listener,this.useCapture),this.references++,1==this.references},t.prototype.stopObserving=function(){return this.references>0&&(1==this.references&&this.target.removeEventListener(this.name,this.listener,this.useCapture),this.references--),0==this.references},t}(),o=function(){function t(){this.observers=new Set}return t.prototype.add=function(t,e,n,o){var i=new r(t,e,n,o);this.addObserver(i)},t.prototype.delete=function(t,e,n,o){var i=new r(t,e,n,o);this.deleteObserver(i)},t.prototype.addObserver=function(t){var e=this.findMatchingObserver(t);e.observe()&&this.observers.add(e)},t.prototype.deleteObserver=function(t){var e=this.findMatchingObserver(t);e.stopObserving()&&this.observers.delete(e)},t.prototype.findMatchingObserver=function(t){for(var e=0,n=Array.from(this.observers);e<n.length;e++){var r=n[e];if(r.isEqualTo(t))return r}return t},t}()},function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(3);n.n(i);n.d(e,"a",function(){return s});var s=function(){function t(t,e){this.context=t,this.delegate=e,this.attributeObserver=new i.AttributeObserver(this.element,this.attributeName,this),this.connectedActions=new Map}return Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.context.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.attributeObserver.start()},t.prototype.stop=function(){this.attributeObserver.stop()},t.prototype.elementMatchedAttribute=function(t,e){this.context.canControlElement(t)&&this.refreshActionForElement(t)},t.prototype.elementAttributeValueChanged=function(t,e){this.context.canControlElement(t)&&this.refreshActionForElement(t)},t.prototype.elementUnmatchedAttribute=function(t,e){this.disconnectActionForElement(t)},t.prototype.refreshActionForElement=function(t){var e=t.getAttribute(this.attributeName);if(null==e||0==e.trim().length)this.disconnectActionForElement(t);else{var n=this.buildActionForElementWithDescriptorString(t,e);if(n){var r=this.getActionForElement(t);n.hasSameDescriptorAs(r)||(this.disconnectActionForElement(t),this.connectActionForElement(n,t))}else this.disconnectActionForElement(t)}},t.prototype.connectActionForElement=function(t,e){this.connectedActions.set(e,t),this.delegate.inlineActionConnected(t)},t.prototype.disconnectActionForElement=function(t){var e=this.getActionForElement(t);e&&(this.connectedActions.delete(t),this.delegate.inlineActionDisconnected(e))},t.prototype.getActionForElement=function(t){return this.connectedActions.get(t)||null},t.prototype.buildActionForElementWithDescriptorString=function(t,e){try{var n=o.a.forElementWithInlineDescriptorString(t,e);if(n.identifier==this.identifier)return new r.a(this.context,n,this.element,function(e){return e==t})}catch(e){this.context.error(e,"while parsing descriptor string for element",t)}},t}()},function(t,e,n){"use strict";function r(t,e,n){var r=t.get(e);return r||(r=new n,t.set(e,r)),r}function o(t,e){var n=t.get(e);null!=n&&0==n.size&&t.delete(e)}n.d(e,"a",function(){return i});var i=function(){function t(){this.map=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t.concat(Array.from(e))},[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t+e.size},0)},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){r(this.map,t,Set).add(e)},t.prototype.delete=function(t,e){r(this.map,t,Set).delete(e),o(this.map,t)},t.prototype.has=function(t,e){var n=this.map.get(t);return null!=n&&n.has(e)},t.prototype.hasKey=function(t){return this.map.has(t)},t.prototype.hasValue=function(t){return Array.from(this.map.values()).some(function(e){return e.has(t)})},t.prototype.get=function(t){var e=this.map.get(t);return e?Array.from(e):[]},t}();!function(){function t(){this.map=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t.concat(e.values)},[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return Array.from(this.map.values()).reduce(function(t,e){return t+e.size},0)},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e,n){r(this.map,t,i).add(e,n)},t.prototype.delete=function(t,e,n){r(this.map,t,i).delete(e,n),o(this.map,t)},t.prototype.has=function(t,e,n){var r=this.map.get(t);return null!=r&&r.has(e,n)},t.prototype.hasKey=function(t,e){if(1==arguments.length)return this.map.has(t);var n=this.map.get(t);return null!=n&&n.hasKey(e)},t.prototype.hasValue=function(t){return Array.from(this.map.values()).some(function(e){return e.hasValue(t)})},t.prototype.get=function(t,e){var n=this.map.get(t);return n?n.get(e):[]},t}()},function(t,e,n){"use strict";var r=n(10),o=n(3);n.n(o);n.d(e,"a",function(){return i});var i=function(){function t(t){this.application=t,this.tokenListObserver=new o.TokenListObserver(this.element,this.controllerAttribute,this),this.contextSets=new Map}return Object.defineProperty(t.prototype,"configuration",{get:function(){return this.application.configuration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.configuration.rootElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.configuration.controllerAttribute},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.tokenListObserver.start()},t.prototype.stop=function(){this.tokenListObserver.stop()},t.prototype.register=function(t,e){if(this.contextSets.has(t))throw new Error("Router already has a controller registered with the identifier '"+t+"'");var n=new r.a(this,t,e);this.contextSets.set(t,n),this.connectContextSet(n)},t.prototype.elementMatchedTokenForAttribute=function(t,e,n){this.connectContextForIdentifierToElement(e,t)},t.prototype.elementUnmatchedTokenForAttribute=function(t,e,n){this.disconnectContextForIdentifierFromElement(e,t)},t.prototype.getContextForElementAndIdentifier=function(t,e){var n=this.contextSets.get(e);if(n)return n.getContextForElement(t)},t.prototype.connectContextSet=function(t){for(var e=this.tokenListObserver.getElementsMatchingToken(t.identifier),n=0,r=e;n<r.length;n++){var o=r[n];t.connect(o)}},t.prototype.connectContextForIdentifierToElement=function(t,e){var n=this.contextSets.get(t);n&&n.connect(e)},t.prototype.disconnectContextForIdentifierFromElement=function(t,e){var n=this.contextSets.get(t);n&&n.disconnect(e)},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t){this.context=t}return Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.context.targetAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return null!=this.find(t)},t.prototype.find=function(t){var e=this.getSelectorForTargetName(t),n=this.element.querySelector(e);return n&&this.context.canControlElement(n)?n:null},t.prototype.findAll=function(t){var e=this,n=this.getSelectorForTargetName(t);return Array.from(this.element.querySelectorAll(n)).filter(function(t){return e.context.canControlElement(t)})},t.prototype.matchesElementWithTargetName=function(t,e){var n=t.getAttribute(this.attributeName);if(n){var r=n.split(" "),o=this.identifier+"."+e;return r.indexOf(o)>-1&&this.context.canControlElement(t)}return!1},t.prototype.getSelectorForTargetName=function(t){return"["+this.attributeName+"~='"+this.identifier+"."+t+"']"},t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);n.d(e,"Action",function(){return r.a});var o=n(4);n.d(e,"Application",function(){return o.a});var i=n(5);n.d(e,"Controller",function(){return i.a});var s=n(2);n.d(e,"Descriptor",function(){return s.a});var c=n(0);n.d(e,"Logger",function(){return c.a}),n.d(e,"LogLevel",function(){return c.b});var a=n(6);n.d(e,"on",function(){return a.a})}])});
{
"name": "stimulus",
"version": "0.3.2",
"version": "0.3.3",
"description": "👉✨",

@@ -41,2 +41,3 @@ "author": "Basecamp, LLC",

"qunitjs": "^2.2.0",
"sentinella": "git+ssh://git@github.com/basecamp/sentinella.git",
"ts-loader": "^2.0.1",

@@ -50,5 +51,3 @@ "tslint": "^4.5.1",

},
"dependencies": {
"sentinella": "git+ssh://git@github.com/basecamp/sentinella.git"
},
"dependencies": {},
"files": [

@@ -55,0 +54,0 @@ "dist/stimulus.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc