stimulus-use
Advanced tools
Comparing version 0.40.1-0 to 0.41.0
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hotwired/stimulus"),require("hotkeys-js")):"function"==typeof define&&define.amd?define(["exports","@hotwired/stimulus","hotkeys-js"],t):t((e||self).StimulusUse={},e.Stimulus,e.hotkeysJs)}(this,function(e,t,n){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(n),o=function(e,t){var n=e[t];return"function"==typeof n?n:function(){}},s=function(e,t,n){var r=e;return!0===n?r=t.identifier+":"+e:"string"==typeof n&&(r=n+":"+e),r},c=function(e,t,n){var r=t||{bubbles:!0,cancelable:!0,composed:!0},i=r.bubbles,o=r.cancelable,s=r.composed;return t&&Object.assign(n,{originalEvent:t}),new CustomEvent(e,{bubbles:i,cancelable:o,composed:s,detail:n})};function a(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}var l={dispatchEvent:!0,eventPrefix:!0},u=function(e,t){var n;void 0===t&&(t={});var r=Object.assign({},l,t),i=r.dispatchEvent,a=r.eventPrefix,u=(null==(n=t)?void 0:n.element)||e.element,d=e.disconnect.bind(e),f=new IntersectionObserver(function(t){var n=t[0];n.isIntersecting?function(t){if(e.isVisible=!0,o(e,"appear").call(e,t),i){var n=s("appear",e,a),r=c(n,null,{controller:e,entry:t});u.dispatchEvent(r)}}(n):e.isVisible&&function(t){if(e.isVisible=!1,o(e,"disappear").call(e,t),i){var n=s("disappear",e,a),r=c(n,null,{controller:e,entry:t});u.dispatchEvent(r)}}(n)},t),v=function(){f.observe(u)},h=function(){f.unobserve(u)};return Object.assign(e,{isVisible:!1,disconnect:function(){h(),d()}}),v(),[v,h]};function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=u(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return f(t,e),t}(t.Controller)),g=function(e,t){var n=e.disconnect.bind(e),r=new IntersectionObserver(function(t){t[0].isIntersecting&&!e.isLoaded&&function(t){var n=e.data.get("src");if(n){var r=e.element;e.isLoading=!0,o(e,"loading").call(e,n),r.onload=function(){!function(t){e.isLoading=!1,e.isLoaded=!0,o(e,"loaded").call(e,t)}(n)},r.src=n}}()},t),i=function(){r.observe(e.element)},s=function(){r.unobserve(e.element)};return Object.assign(e,{isVisible:!1,disconnect:function(){s(),n()}}),i(),[i,s]},p=function(e){function t(t){var n;return(n=e.call(this,t)||this).options={rootMargin:"10%"},requestAnimationFrame(function(){var e=g(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isLoading=!1,t.isLoaded=!1,t}return f(t,e),t}(t.Controller)),y={dispatchEvent:!0,eventPrefix:!0},E=function(e,t){var n;void 0===t&&(t={});var r=Object.assign({},y,t),i=r.dispatchEvent,a=r.eventPrefix,l=(null==(n=t)?void 0:n.element)||e.element,u=e.disconnect.bind(e),d=new ResizeObserver(function(t){var n=t[0];if(o(e,"resize").call(e,n.contentRect),i){var r=s("resize",e,a),u=c(r,null,{controller:e,entry:n});l.dispatchEvent(u)}}),f=function(){d.observe(l)},v=function(){d.unobserve(l)};return Object.assign(e,{disconnect:function(){v(),u()}}),f(),[f,v]},C=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=E(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),O={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},w=function(e,t){void 0===t&&(t={});var n=Object.assign({},O,t),r=n.onlyVisible,i=n.dispatchEvent,o=n.events,a=n.eventPrefix,l=function(n){var o,l,u,d,f=(null==(o=t)?void 0:o.element)||e.element;if(!f.contains(n.target)&&(l=f.getBoundingClientRect(),u=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth,l.top<=u&&l.top+l.height>=0&&l.left<=d&&l.left+l.width>=0||!r)&&(e.clickOutside&&e.clickOutside(n),i)){var v=s("click:outside",e,a),h=c(v,n,{controller:e});f.dispatchEvent(h)}},u=function(){null==o||o.forEach(function(e){window.addEventListener(e,l,!1)})},d=function(){null==o||o.forEach(function(e){window.removeEventListener(e,l,!1)})},f=e.disconnect.bind(e);return Object.assign(e,{disconnect:function(){d(),f()}}),u(),[u,d]},j=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=w(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),P={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0},T=function(e,t){var n,r,i,o,s,c,a=this;void 0===t&&(t={}),this.log=function(e,t){a.debug&&(a.logger.groupCollapsed("%c"+a.controller.identifier+" %c#"+e,"color: #3B82F6","color: unset"),a.logger.log(d({controllerId:a.controllerId},t)),a.logger.groupEnd())},this.dispatch=function(e,t){if(void 0===t&&(t={}),a.dispatchEvent){var n=t.event,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(t,["event"]),i=a.extendedEvent(e,n||null,r);a.targetElement.dispatchEvent(i),a.log("dispatchEvent",d({eventName:i.type},r))}},this.call=function(e,t){void 0===t&&(t={});var n=a.controller[e];if("function"==typeof n)return n.call(a.controller,t)},this.extendedEvent=function(e,t,n){var r=t||{bubbles:!0,cancelable:!0,composed:!0},i=r.bubbles,o=r.cancelable,s=r.composed;return t&&Object.assign(n,{originalEvent:t}),new CustomEvent(a.composeEventName(e),{bubbles:i,cancelable:o,composed:s,detail:n})},this.composeEventName=function(e){var t=e;return!0===a.eventPrefix?t=a.controller.identifier+":"+e:"string"==typeof a.eventPrefix&&(t=a.eventPrefix+":"+e),t},this.debug=null!=(n=null!=(r=null==(i=t)?void 0:i.debug)?r:e.application.stimulusUseDebug)?n:P.debug,this.logger=null!=(o=null==(s=t)?void 0:s.logger)?o:P.logger,this.controller=e,this.controllerId=e.element.id||e.element.dataset.id,this.targetElement=(null==(c=t)?void 0:c.element)||e.element;var l=Object.assign({},P,t);Object.assign(this,{dispatchEvent:l.dispatchEvent,eventPrefix:l.eventPrefix}),this.controllerInitialize=e.initialize.bind(e),this.controllerConnect=e.connect.bind(e),this.controllerDisconnect=e.disconnect.bind(e)},x=function(e){function t(t,n){var r,i,o,c,a;return void 0===n&&(n={}),(a=e.call(this,t,n)||this).dispatch=function(e,t){void 0===t&&(t={});var n=h(a),r=n.targetElement,i=n.eventPrefix,o=n.bubbles,c=n.cancelable,l=n.log;Object.assign(t,{controller:n.controller});var u=s(e,a.controller,i),d=new CustomEvent(u,{detail:t,bubbles:o,cancelable:c});return r.dispatchEvent(d),l("dispatch",{eventName:u,detail:t,bubbles:o,cancelable:c}),d},a.targetElement=null!=(r=n.element)?r:t.element,a.eventPrefix=null==(i=n.eventPrefix)||i,a.bubbles=null==(o=n.bubbles)||o,a.cancelable=null==(c=n.cancelable)||c,a.enhanceController(),a}return f(t,e),t.prototype.enhanceController=function(){Object.assign(this.controller,{dispatch:this.dispatch})},t}(T),F=function(e,t){return void 0===t&&(t={}),new x(e,t)},A=function(e,t){void 0===t&&(t={}),Object.defineProperty(e,"isPreview",{get:function(){return document.documentElement.hasAttribute("data-turbolinks-preview")||document.documentElement.hasAttribute("data-turbo-preview")}}),Object.defineProperty(e,"isConnected",{get:function(){var e=this;return!!Array.from(this.context.module.connectedContexts).find(function(t){return t===e.context})}}),Object.defineProperty(e,"csrfToken",{get:function(){return this.metaValue("csrf-token")}}),F(e,t),Object.assign(e,{metaValue:function(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}})},L=function(e){function t(t){var n;return(n=e.call(this,t)||this).isPreview=!1,n.isConnected=!1,n.csrfToken="",A(h(n),n.options),n}return f(t,e),t}(t.Controller),k={ms:6e4,initialState:!1,events:["mousemove","mousedown","resize","keydown","touchstart","wheel"],dispatchEvent:!0,eventPrefix:!0},I=function(e,t){void 0===t&&(t={});var n=Object.assign({},k,t),r=n.ms,i=n.events,a=n.dispatchEvent,l=n.eventPrefix,u=n.initialState,d=setTimeout(function(){u=!0,f()},r),f=function(t){var n=s("away",e,l);if(e.isIdle=!0,o(e,"away").call(e,t),a){var r=c(n,t||null,{controller:e});e.element.dispatchEvent(r)}},v=function(t){var n=s("back",e,l);if(e.isIdle=!1,o(e,"back").call(e,t),a){var r=c(n,t||null,{controller:e});e.element.dispatchEvent(r)}},h=function(e){u&&v(e),u=!1,clearTimeout(d),d=setTimeout(function(){u=!0,f(e)},r)},b=function(e){document.hidden||h(e)};u?f():v();var m=e.disconnect.bind(e),g=function(){i.forEach(function(e){window.addEventListener(e,h)}),document.addEventListener("visibilitychange",b)},p=function(){i.forEach(function(e){window.removeEventListener(e,h)}),document.removeEventListener("visibilitychange",b)};return Object.assign(e,{disconnect:function(){p(),m()}}),g(),[g,p]},N=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=I(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isIdle=!1,t}return f(t,e),t}(t.Controller)),V=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.controller.isVisible=!document.hidden,document.addEventListener("visibilitychange",r.handleVisibilityChange),r.handleVisibilityChange()},r.unobserve=function(){document.removeEventListener("visibilitychange",r.handleVisibilityChange)},r.becomesInvisible=function(e){r.controller.isVisible=!1,r.call("invisible",e),r.log("invisible",{isVisible:!1}),r.dispatch("invisible",{event:e,isVisible:!1})},r.becomesVisible=function(e){r.controller.isVisible=!0,r.call("visible",e),r.log("visible",{isVisible:!0}),r.dispatch("visible",{event:e,isVisible:!0})},r.handleVisibilityChange=function(e){document.hidden?r.becomesInvisible(e):r.becomesVisible(e)},r.controller=t,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controllerDisconnect;Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),M=function(e,t){void 0===t&&(t={});var n=new V(e,t);return[n.observe,n.unobserve]},S=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=M(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return f(t,e),t}(t.Controller)),U=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.targetElement.addEventListener("mouseenter",r.onEnter),r.targetElement.addEventListener("mouseleave",r.onLeave)},r.unobserve=function(){r.targetElement.removeEventListener("mouseenter",r.onEnter),r.targetElement.removeEventListener("mouseleave",r.onLeave)},r.onEnter=function(e){r.call("mouseEnter",e),r.log("mouseEnter",{hover:!0}),r.dispatch("mouseEnter",{hover:!1})},r.onLeave=function(e){r.call("mouseLeave",e),r.log("mouseLeave",{hover:!1}),r.dispatch("mouseLeave",{hover:!1})},r.controller=t,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),q=function(e,t){void 0===t&&(t={});var n=new U(e,t);return[n.observe,n.unobserve]},z=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=q(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),D=function(e){function t(t,n){var r,i;return void 0===n&&(n={}),(i=e.call(this,t,n)||this).observe=function(){try{i.observer.observe(i.targetElement,i.options)}catch(e){i.controller.application.handleError(e,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},i.unobserve=function(){i.observer.disconnect()},i.mutation=function(e){i.call("mutate",e),i.log("mutate",{entries:e}),i.dispatch("mutate",{entries:e})},i.targetElement=(null==(r=n)?void 0:r.element)||t.element,i.controller=t,i.options=n,i.observer=new MutationObserver(i.mutation),i.enhanceController(),i.observe(),i}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),R=function(e,t){void 0===t&&(t={});var n=new D(e,t);return[n.observe,n.unobserve]},B=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=R(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),W=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.observer.observe(r.targetElement,{subtree:!0,characterData:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[r.targetSelector,r.scopedTargetSelector]})},r.unobserve=function(){r.observer.disconnect()},r.mutation=function(e){for(var t,n=function(){var e=t.value;switch(e.type){case"attributes":var n=e.target.getAttribute(e.attributeName);if(e.attributeName===r.targetSelector||e.attributeName===r.scopedTargetSelector){var i=r.targetsUsedByThisController(e.oldValue),o=r.targetsUsedByThisController(n),s=i.filter(function(e){return!o.includes(e)}),c=o.filter(function(e){return!i.includes(e)});s.forEach(function(t){return r.targetRemoved(r.stripIdentifierPrefix(t),e.target,"attributeChange")}),c.forEach(function(t){return r.targetAdded(r.stripIdentifierPrefix(t),e.target,"attributeChange")})}break;case"characterData":var a=r.findTargetInAncestry(e.target);if(null==a)return{v:void 0};r.targetsUsedByThisControllerFromNode(a).forEach(function(e){r.targetChanged(r.stripIdentifierPrefix(e),a,"domMutation")});break;case"childList":var l=e.removedNodes;e.addedNodes.forEach(function(e){return r.processNodeDOMMutation(e,r.targetAdded)}),l.forEach(function(e){return r.processNodeDOMMutation(e,r.targetRemoved)})}},i=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(t=i()).done;){var o=n();if("object"==typeof o)return o.v}},r.controller=t,r.options=n,r.targetElement=t.element,r.identifier=t.scope.identifier,r.identifierPrefix=r.identifier+".",r.targetSelector=t.scope.schema.targetAttribute,r.scopedTargetSelector="data-"+r.identifier+"-target",r.targets=n.targets||t.constructor.targets,r.prefixedTargets=r.targets.map(function(e){return""+r.identifierPrefix+e}),r.observer=new MutationObserver(r.mutation),r.enhanceController(),r.observe(),r}f(t,e);var n=t.prototype;return n.processNodeDOMMutation=function(e,t){var n=this,r=e,i=t,o=[];"#text"==r.nodeName||0==this.targetsUsedByThisControllerFromNode(r).length?(i=this.targetChanged,r=this.findTargetInAncestry(e)):o=this.targetsUsedByThisControllerFromNode(r),null!=r&&(0==o.length&&(o=this.targetsUsedByThisControllerFromNode(r)),o.forEach(function(e){i.call(n,n.stripIdentifierPrefix(e),r,"domMutation")}))},n.findTargetInAncestry=function(e){var t=e,n=[];for("#text"!=t.nodeName&&(n=this.targetsUsedByThisControllerFromNode(t));null!==t.parentNode&&t.parentNode!=this.targetElement&&0==n.length;)if("#text"!==(t=t.parentNode).nodeName&&this.targetsUsedByThisControllerFromNode(t).length>0)return t;return"#text"==t.nodeName||null==t.parentNode?null:t.parentNode==this.targetElement&&this.targetsUsedByThisControllerFromNode(t).length>0?t:null},n.targetAdded=function(e,t,n){var r=e+"TargetAdded";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetAdded",{target:e,node:t,trigger:n})},n.targetRemoved=function(e,t,n){var r=e+"TargetRemoved";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetRemoved",{target:e,node:t,trigger:n})},n.targetChanged=function(e,t,n){var r=e+"TargetChanged";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetChanged",{target:e,node:t,trigger:n})},n.targetsUsedByThisControllerFromNode=function(e){if("#text"==e.nodeName||"#comment"==e.nodeName)return[];var t=e;return this.targetsUsedByThisController(t.getAttribute(this.scopedTargetSelector)||t.getAttribute(this.targetSelector))},n.targetsUsedByThisController=function(e){var t=this.stripIdentifierPrefix(e=e||"").split(" ");return this.targets.filter(function(e){return-1!==t.indexOf(e)})},n.stripIdentifierPrefix=function(e){return e.replace(new RegExp(this.identifierPrefix,"g"),"")},n.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),H=function(e,t){void 0===t&&(t={});var n=new W(e,t);return[n.observe,n.unobserve]},Q=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=H(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),_=function(e){var t=function(t){var n=window,r={height:n.innerHeight||Infinity,width:n.innerWidth||Infinity,event:t};o(e,"windowResize").call(e,r)},n=e.disconnect.bind(e),r=function(){window.addEventListener("resize",t),t()},i=function(){window.removeEventListener("resize",t)};return Object.assign(e,{disconnect:function(){i(),n()}}),r(),[r,i]},J=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=_(h(n)),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),G=function(e,t){void 0===t&&(t=200);var n=null;return function(){var r=arguments,i=this,o=function(){return e.apply(i,r)};n&&clearTimeout(n),n=setTimeout(o,t)}};function $(e,t){var n;return void 0===t&&(t=200),function(){var r=arguments,i=this;n||(n=!0,e.apply(i,r),setTimeout(function(){return n=!1},t))}}function K(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}function X(e){try{return JSON.parse(e)}catch(t){return e}}var Y={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},Z={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},ee=function(e,t){var n,r,i,o,s=function(e,t,n,r,i,o,s){try{var c=[];return o&&(t.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)}),n.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)}),r.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)})),w(e,t),j(e,c),w(e,n),Promise.resolve(function(){try{return Promise.resolve(new Promise(function(e){requestAnimationFrame(function(){requestAnimationFrame(e)})}))}catch(e){return Promise.reject(e)}}()).then(function(){return j(e,t),w(e,r),Promise.resolve(function(e){try{return Promise.resolve(new Promise(function(t){var n=1e3*Number(getComputedStyle(e).transitionDuration.split(",")[0].replace("s",""));setTimeout(function(){t(n)},n)}))}catch(e){return Promise.reject(e)}}(e)).then(function(){j(e,n),s&&j(e,r),w(e,c)})})}catch(e){return Promise.reject(e)}},c=function(n){try{if(!e.transitioned)return Promise.resolve();e.transitioned=!1,E&&E(n);var r=te("leaveFrom",t,f),i=te("leaveActive",t,f),o=te("leaveTo",t,f),c=te("enterTo",t,f);return p||j(d,c),Promise.resolve(s(d,r,i,o,m,g,p)).then(function(){m&&d.classList.add(m)})}catch(e){return Promise.reject(e)}},a=function(n){try{if(e.transitioned)return Promise.resolve();e.transitioned=!0,y&&y(n);var r=te("enterFrom",t,f),i=te("enterActive",t,f),o=te("enterTo",t,f),a=te("leaveTo",t,f);return m&&d.classList.remove(m),p||j(d,a),Promise.resolve(s(d,r,i,o,m,g,p)).then(function(){v>0&&setTimeout(function(){c(n)},v)})}catch(e){return Promise.reject(e)}};void 0===t&&(t={});var l,u=e.element.dataset.transitionTarget;u&&(l=e[u+"Target"]);var d=(null==(n=t)?void 0:n.element)||l||e.element;if(d instanceof HTMLElement||d instanceof SVGElement){var f=d.dataset,v=parseInt(f.leaveAfter||"")||t.leaveAfter||0,h=Object.assign(Z,t),b=h.transitioned,m=h.hiddenClass,g=h.preserveOriginalClass,p=h.removeToClasses,y=null==(r=e.enter)?void 0:r.bind(e),E=null==(i=e.leave)?void 0:i.bind(e),C=null==(o=e.toggleTransition)?void 0:o.bind(e);return e.transitioned=b,b?(m&&d.classList.remove(m),a()):(m&&d.classList.add(m),c()),Object.assign(e,{enter:a,leave:c,toggleTransition:O}),[a,c,O]}function O(t){C&&C(t),e.transitioned?c():a()}function w(e,t){var n;t.length>0&&(n=e.classList).add.apply(n,t)}function j(e,t){var n;t.length>0&&(n=e.classList).remove.apply(n,t)}};function te(e,t,n){var r,i="transition"+e[0].toUpperCase()+e.substr(1),o=t[e]||n[i]||n[Y[e]]||" ";return 0!==(r=o).length&&r.trim()?o.split(" "):[]}var ne=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){ee(h(n),n.options)}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).transitioned=!1,t}return f(t,e),t}(t.Controller)),re=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).bind=function(){for(var e=function(){var e=n[t],o=e[0],s=e[1],c=s.handler.bind(r.controller);i.default(o,s.options,function(e){return c(e,e)})},t=0,n=Object.entries(r.hotkeysOptions.hotkeys);t<n.length;t++)e()},r.unbind=function(){for(var e in r.hotkeysOptions.hotkeys)i.default.unbind(e)},r.controller=t,r.hotkeysOptions=n,r.enhanceController(),r.bind(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this;this.hotkeysOptions.filter&&(i.default.filter=this.hotkeysOptions.filter);var t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unbind(),t()}})},t}(T),ie={mediaQueries:{},dispatchEvent:!0,eventPrefix:!0,debug:!1},oe=function(e){function t(t,n){var r,i,o,s,c;return void 0===n&&(n={}),(c=e.call(this,t,n)||this).matches=[],c.callback=function(e){var t=Object.keys(c.mediaQueries).find(function(t){return c.mediaQueries[t]===e.media});t&&c.changed({name:t,media:e.media,matches:e.matches,event:e})},c.changed=function(e){var t=e.name;e.event&&(c.call(a(t+"_changed"),e),c.dispatch(t+":changed",e),c.log('media query "'+t+'" changed',e)),e.matches?(c.call(a("is_"+t),e),c.dispatch("is:"+t,e)):(c.call(a("not_"+t),e),c.dispatch("not:"+t,e))},c.observe=function(){Object.keys(c.mediaQueries).forEach(function(e){var t=c.mediaQueries[e],n=window.matchMedia(t);n.addListener(c.callback),c.matches.push(n),c.changed({name:e,media:t,matches:n.matches})})},c.unobserve=function(){c.matches.forEach(function(e){return e.removeListener(c.callback)})},c.controller=t,c.mediaQueries=null!=(r=n.mediaQueries)?r:ie.mediaQueries,c.dispatchEvent=null!=(i=n.dispatchEvent)?i:ie.dispatchEvent,c.eventPrefix=null!=(o=n.eventPrefix)?o:ie.eventPrefix,c.debug=null!=(s=n.debug)?s:ie.debug,window.matchMedia?(c.enhanceController(),c.observe(),c):(console.error("window.matchMedia() is not available"),h(c))}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),se=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){document.hasFocus()?r.becomesFocused():(console.log("i should be there"),r.becomesUnfocused()),r.interval=setInterval(function(){r.handleWindowFocusChange()},r.intervalDuration)},r.unobserve=function(){clearInterval(r.interval)},r.becomesUnfocused=function(e){r.controller.hasFocus=!1,r.call("unfocus",e),r.log("unfocus",{hasFocus:!1}),r.dispatch("unfocus",{event:e,hasFocus:!1})},r.becomesFocused=function(e){r.controller.hasFocus=!0,r.call("focus",e),r.log("focus",{hasFocus:!0}),r.dispatch("focus",{event:e,hasFocus:!0})},r.handleWindowFocusChange=function(e){document.hasFocus()&&!r.controller.hasFocus?r.becomesFocused(e):!document.hasFocus()&&r.controller.hasFocus&&r.becomesUnfocused(e)},r.controller=t,r.intervalDuration=n.interval||200,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controllerDisconnect;Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),ce=function(e,t){void 0===t&&(t={});var n=new se(e,t);return[n.observe,n.unobserve]},ae=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=ce(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).hasFocus=!1,t}return f(t,e),t}(t.Controller));e.ApplicationController=L,e.ClickOutsideController=j,e.HoverController=z,e.IdleController=N,e.IntersectionController=m,e.LazyLoadController=p,e.MutationController=B,e.ResizeController=C,e.TargetMutationController=Q,e.TransitionController=ne,e.UseHover=U,e.UseMutation=D,e.UseTargetMutation=W,e.UseVisibility=V,e.VisibilityController=S,e.WindowFocusController=ae,e.WindowResizeController=J,e.useApplication=A,e.useClickOutside=w,e.useDebounce=function(e,t){var n;null==(n=e.constructor.debounces)||n.forEach(function(n){if("string"==typeof n&&(e[n]=G(e[n],null==t?void 0:t.wait)),"object"==typeof n){var r=n.name;if(!r)return;e[r]=G(e[r],n.wait||(null==t?void 0:t.wait))}})},e.useDispatch=F,e.useHotkeys=function(e,t){return new re(e,function(e){if(!e.hotkeys){var t={};Object.entries(e).forEach(function(e){var n;Object.defineProperty(t,e[0],{value:(n=e[1],{handler:n[0],options:{element:n[1]}}),writable:!1,enumerable:!0})}),e={hotkeys:t}}return e}(t))},e.useHover=q,e.useIdle=I,e.useIntersection=u,e.useLazyLoad=g,e.useMatchMedia=function(e,t){void 0===t&&(t={});var n=new oe(e,t);return[n.observe,n.unobserve]},e.useMemo=function(e){var t;null==(t=e.constructor.memos)||t.forEach(function(t){!function(e,t,n){Object.defineProperty(e,t,{value:n})}(e,t,e[t])})},e.useMeta=function(e,t){void 0===t&&(t={suffix:!0});var n=e.constructor.metaNames,r=t.suffix;null==n||n.forEach(function(t){!function(e,t,n){var r=n?a(t)+"Meta":a(t);Object.defineProperty(e,r,{get:function(){return X(K(t))}})}(e,t,r)}),Object.defineProperty(e,"metas",{get:function(){var e={};return null==n||n.forEach(function(t){var n=X(K(t));null!=n&&(e[a(t)]=n)}),e}})},e.useMutation=R,e.useResize=E,e.useTargetMutation=H,e.useThrottle=function(e,t){var n;void 0===t&&(t={}),null==(n=e.constructor.throttles)||n.forEach(function(n){var r;if("string"==typeof n&&(e[n]=$(e[n],null==(r=t)?void 0:r.wait)),"object"==typeof n){var i,o=n.name;if(!o)return;e[o]=$(e[o],n.wait||(null==(i=t)?void 0:i.wait))}})},e.useTransition=ee,e.useVisibility=M,e.useWindowFocus=ce,e.useWindowResize=_}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("stimulus"),require("hotkeys-js")):"function"==typeof define&&define.amd?define(["exports","stimulus","hotkeys-js"],t):t((e||self).StimulusUse={},e.Stimulus,e.hotkeysJs)}(this,function(e,t,n){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(n),o=function(e,t){var n=e[t];return"function"==typeof n?n:function(){}},s=function(e,t,n){var r=e;return!0===n?r=t.identifier+":"+e:"string"==typeof n&&(r=n+":"+e),r},c=function(e,t,n){var r=t||{bubbles:!0,cancelable:!0,composed:!0},i=r.bubbles,o=r.cancelable,s=r.composed;return t&&Object.assign(n,{originalEvent:t}),new CustomEvent(e,{bubbles:i,cancelable:o,composed:s,detail:n})};function a(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}var l={dispatchEvent:!0,eventPrefix:!0},u=function(e,t){var n;void 0===t&&(t={});var r=Object.assign({},l,t),i=r.dispatchEvent,a=r.eventPrefix,u=(null==(n=t)?void 0:n.element)||e.element,d=e.disconnect.bind(e),f=new IntersectionObserver(function(t){var n=t[0];n.isIntersecting?function(t){if(e.isVisible=!0,o(e,"appear").call(e,t),i){var n=s("appear",e,a),r=c(n,null,{controller:e,entry:t});u.dispatchEvent(r)}}(n):e.isVisible&&function(t){if(e.isVisible=!1,o(e,"disappear").call(e,t),i){var n=s("disappear",e,a),r=c(n,null,{controller:e,entry:t});u.dispatchEvent(r)}}(n)},t),v=function(){f.observe(u)},h=function(){f.unobserve(u)};return Object.assign(e,{isVisible:!1,disconnect:function(){h(),d()}}),v(),[v,h]};function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=u(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return f(t,e),t}(t.Controller)),g=function(e,t){var n=e.disconnect.bind(e),r=new IntersectionObserver(function(t){t[0].isIntersecting&&!e.isLoaded&&function(t){var n=e.data.get("src");if(n){var r=e.element;e.isLoading=!0,o(e,"loading").call(e,n),r.onload=function(){!function(t){e.isLoading=!1,e.isLoaded=!0,o(e,"loaded").call(e,t)}(n)},r.src=n}}()},t),i=function(){r.observe(e.element)},s=function(){r.unobserve(e.element)};return Object.assign(e,{isVisible:!1,disconnect:function(){s(),n()}}),i(),[i,s]},p=function(e){function t(t){var n;return(n=e.call(this,t)||this).options={rootMargin:"10%"},requestAnimationFrame(function(){var e=g(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isLoading=!1,t.isLoaded=!1,t}return f(t,e),t}(t.Controller)),y={dispatchEvent:!0,eventPrefix:!0},E=function(e,t){var n;void 0===t&&(t={});var r=Object.assign({},y,t),i=r.dispatchEvent,a=r.eventPrefix,l=(null==(n=t)?void 0:n.element)||e.element,u=e.disconnect.bind(e),d=new ResizeObserver(function(t){var n=t[0];if(o(e,"resize").call(e,n.contentRect),i){var r=s("resize",e,a),u=c(r,null,{controller:e,entry:n});l.dispatchEvent(u)}}),f=function(){d.observe(l)},v=function(){d.unobserve(l)};return Object.assign(e,{disconnect:function(){v(),u()}}),f(),[f,v]},C=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=E(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),O={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},w=function(e,t){void 0===t&&(t={});var n=Object.assign({},O,t),r=n.onlyVisible,i=n.dispatchEvent,o=n.events,a=n.eventPrefix,l=function(n){var o,l,u,d,f=(null==(o=t)?void 0:o.element)||e.element;if(!f.contains(n.target)&&(l=f.getBoundingClientRect(),u=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth,l.top<=u&&l.top+l.height>=0&&l.left<=d&&l.left+l.width>=0||!r)&&(e.clickOutside&&e.clickOutside(n),i)){var v=s("click:outside",e,a),h=c(v,n,{controller:e});f.dispatchEvent(h)}},u=function(){null==o||o.forEach(function(e){window.addEventListener(e,l,!1)})},d=function(){null==o||o.forEach(function(e){window.removeEventListener(e,l,!1)})},f=e.disconnect.bind(e);return Object.assign(e,{disconnect:function(){d(),f()}}),u(),[u,d]},j=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=w(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),P={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0},T=function(e,t){var n,r,i,o,s,c,a=this;void 0===t&&(t={}),this.log=function(e,t){a.debug&&(a.logger.groupCollapsed("%c"+a.controller.identifier+" %c#"+e,"color: #3B82F6","color: unset"),a.logger.log(d({controllerId:a.controllerId},t)),a.logger.groupEnd())},this.dispatch=function(e,t){if(void 0===t&&(t={}),a.dispatchEvent){var n=t.event,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(t,["event"]),i=a.extendedEvent(e,n||null,r);a.targetElement.dispatchEvent(i),a.log("dispatchEvent",d({eventName:i.type},r))}},this.call=function(e,t){void 0===t&&(t={});var n=a.controller[e];if("function"==typeof n)return n.call(a.controller,t)},this.extendedEvent=function(e,t,n){var r=t||{bubbles:!0,cancelable:!0,composed:!0},i=r.bubbles,o=r.cancelable,s=r.composed;return t&&Object.assign(n,{originalEvent:t}),new CustomEvent(a.composeEventName(e),{bubbles:i,cancelable:o,composed:s,detail:n})},this.composeEventName=function(e){var t=e;return!0===a.eventPrefix?t=a.controller.identifier+":"+e:"string"==typeof a.eventPrefix&&(t=a.eventPrefix+":"+e),t},this.debug=null!=(n=null!=(r=null==(i=t)?void 0:i.debug)?r:e.application.stimulusUseDebug)?n:P.debug,this.logger=null!=(o=null==(s=t)?void 0:s.logger)?o:P.logger,this.controller=e,this.controllerId=e.element.id||e.element.dataset.id,this.targetElement=(null==(c=t)?void 0:c.element)||e.element;var l=Object.assign({},P,t);Object.assign(this,{dispatchEvent:l.dispatchEvent,eventPrefix:l.eventPrefix}),this.controllerInitialize=e.initialize.bind(e),this.controllerConnect=e.connect.bind(e),this.controllerDisconnect=e.disconnect.bind(e)},x=function(e){function t(t,n){var r,i,o,c,a;return void 0===n&&(n={}),(a=e.call(this,t,n)||this).dispatch=function(e,t){void 0===t&&(t={});var n=h(a),r=n.targetElement,i=n.eventPrefix,o=n.bubbles,c=n.cancelable,l=n.log;Object.assign(t,{controller:n.controller});var u=s(e,a.controller,i),d=new CustomEvent(u,{detail:t,bubbles:o,cancelable:c});return r.dispatchEvent(d),l("dispatch",{eventName:u,detail:t,bubbles:o,cancelable:c}),d},a.targetElement=null!=(r=n.element)?r:t.element,a.eventPrefix=null==(i=n.eventPrefix)||i,a.bubbles=null==(o=n.bubbles)||o,a.cancelable=null==(c=n.cancelable)||c,a.enhanceController(),a}return f(t,e),t.prototype.enhanceController=function(){Object.assign(this.controller,{dispatch:this.dispatch})},t}(T),F=function(e,t){return void 0===t&&(t={}),new x(e,t)},A=function(e,t){void 0===t&&(t={}),Object.defineProperty(e,"isPreview",{get:function(){return document.documentElement.hasAttribute("data-turbolinks-preview")||document.documentElement.hasAttribute("data-turbo-preview")}}),Object.defineProperty(e,"isConnected",{get:function(){var e=this;return!!Array.from(this.context.module.connectedContexts).find(function(t){return t===e.context})}}),Object.defineProperty(e,"csrfToken",{get:function(){return this.metaValue("csrf-token")}}),F(e,t),Object.assign(e,{metaValue:function(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}})},L=function(e){function t(t){var n;return(n=e.call(this,t)||this).isPreview=!1,n.isConnected=!1,n.csrfToken="",A(h(n),n.options),n}return f(t,e),t}(t.Controller),k={ms:6e4,initialState:!1,events:["mousemove","mousedown","resize","keydown","touchstart","wheel"],dispatchEvent:!0,eventPrefix:!0},I=function(e,t){void 0===t&&(t={});var n=Object.assign({},k,t),r=n.ms,i=n.events,a=n.dispatchEvent,l=n.eventPrefix,u=n.initialState,d=setTimeout(function(){u=!0,f()},r),f=function(t){var n=s("away",e,l);if(e.isIdle=!0,o(e,"away").call(e,t),a){var r=c(n,t||null,{controller:e});e.element.dispatchEvent(r)}},v=function(t){var n=s("back",e,l);if(e.isIdle=!1,o(e,"back").call(e,t),a){var r=c(n,t||null,{controller:e});e.element.dispatchEvent(r)}},h=function(e){u&&v(e),u=!1,clearTimeout(d),d=setTimeout(function(){u=!0,f(e)},r)},b=function(e){document.hidden||h(e)};u?f():v();var m=e.disconnect.bind(e),g=function(){i.forEach(function(e){window.addEventListener(e,h)}),document.addEventListener("visibilitychange",b)},p=function(){i.forEach(function(e){window.removeEventListener(e,h)}),document.removeEventListener("visibilitychange",b)};return Object.assign(e,{disconnect:function(){p(),m()}}),g(),[g,p]},N=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=I(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isIdle=!1,t}return f(t,e),t}(t.Controller)),V=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.controller.isVisible=!document.hidden,document.addEventListener("visibilitychange",r.handleVisibilityChange),r.handleVisibilityChange()},r.unobserve=function(){document.removeEventListener("visibilitychange",r.handleVisibilityChange)},r.becomesInvisible=function(e){r.controller.isVisible=!1,r.call("invisible",e),r.log("invisible",{isVisible:!1}),r.dispatch("invisible",{event:e,isVisible:!1})},r.becomesVisible=function(e){r.controller.isVisible=!0,r.call("visible",e),r.log("visible",{isVisible:!0}),r.dispatch("visible",{event:e,isVisible:!0})},r.handleVisibilityChange=function(e){document.hidden?r.becomesInvisible(e):r.becomesVisible(e)},r.controller=t,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controllerDisconnect;Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),M=function(e,t){void 0===t&&(t={});var n=new V(e,t);return[n.observe,n.unobserve]},S=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=M(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return f(t,e),t}(t.Controller)),U=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.targetElement.addEventListener("mouseenter",r.onEnter),r.targetElement.addEventListener("mouseleave",r.onLeave)},r.unobserve=function(){r.targetElement.removeEventListener("mouseenter",r.onEnter),r.targetElement.removeEventListener("mouseleave",r.onLeave)},r.onEnter=function(e){r.call("mouseEnter",e),r.log("mouseEnter",{hover:!0}),r.dispatch("mouseEnter",{hover:!1})},r.onLeave=function(e){r.call("mouseLeave",e),r.log("mouseLeave",{hover:!1}),r.dispatch("mouseLeave",{hover:!1})},r.controller=t,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),q=function(e,t){void 0===t&&(t={});var n=new U(e,t);return[n.observe,n.unobserve]},z=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=q(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),D=function(e){function t(t,n){var r,i;return void 0===n&&(n={}),(i=e.call(this,t,n)||this).observe=function(){try{i.observer.observe(i.targetElement,i.options)}catch(e){i.controller.application.handleError(e,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},i.unobserve=function(){i.observer.disconnect()},i.mutation=function(e){i.call("mutate",e),i.log("mutate",{entries:e}),i.dispatch("mutate",{entries:e})},i.targetElement=(null==(r=n)?void 0:r.element)||t.element,i.controller=t,i.options=n,i.observer=new MutationObserver(i.mutation),i.enhanceController(),i.observe(),i}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),R=function(e,t){void 0===t&&(t={});var n=new D(e,t);return[n.observe,n.unobserve]},B=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=R(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),W=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.observer.observe(r.targetElement,{subtree:!0,characterData:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[r.targetSelector,r.scopedTargetSelector]})},r.unobserve=function(){r.observer.disconnect()},r.mutation=function(e){for(var t,n=function(){var e=t.value;switch(e.type){case"attributes":var n=e.target.getAttribute(e.attributeName);if(e.attributeName===r.targetSelector||e.attributeName===r.scopedTargetSelector){var i=r.targetsUsedByThisController(e.oldValue),o=r.targetsUsedByThisController(n),s=i.filter(function(e){return!o.includes(e)}),c=o.filter(function(e){return!i.includes(e)});s.forEach(function(t){return r.targetRemoved(r.stripIdentifierPrefix(t),e.target,"attributeChange")}),c.forEach(function(t){return r.targetAdded(r.stripIdentifierPrefix(t),e.target,"attributeChange")})}break;case"characterData":var a=r.findTargetInAncestry(e.target);if(null==a)return{v:void 0};r.targetsUsedByThisControllerFromNode(a).forEach(function(e){r.targetChanged(r.stripIdentifierPrefix(e),a,"domMutation")});break;case"childList":var l=e.removedNodes;e.addedNodes.forEach(function(e){return r.processNodeDOMMutation(e,r.targetAdded)}),l.forEach(function(e){return r.processNodeDOMMutation(e,r.targetRemoved)})}},i=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(t=i()).done;){var o=n();if("object"==typeof o)return o.v}},r.controller=t,r.options=n,r.targetElement=t.element,r.identifier=t.scope.identifier,r.identifierPrefix=r.identifier+".",r.targetSelector=t.scope.schema.targetAttribute,r.scopedTargetSelector="data-"+r.identifier+"-target",r.targets=n.targets||t.constructor.targets,r.prefixedTargets=r.targets.map(function(e){return""+r.identifierPrefix+e}),r.observer=new MutationObserver(r.mutation),r.enhanceController(),r.observe(),r}f(t,e);var n=t.prototype;return n.processNodeDOMMutation=function(e,t){var n=this,r=e,i=t,o=[];"#text"==r.nodeName||0==this.targetsUsedByThisControllerFromNode(r).length?(i=this.targetChanged,r=this.findTargetInAncestry(e)):o=this.targetsUsedByThisControllerFromNode(r),null!=r&&(0==o.length&&(o=this.targetsUsedByThisControllerFromNode(r)),o.forEach(function(e){i.call(n,n.stripIdentifierPrefix(e),r,"domMutation")}))},n.findTargetInAncestry=function(e){var t=e,n=[];for("#text"!=t.nodeName&&(n=this.targetsUsedByThisControllerFromNode(t));null!==t.parentNode&&t.parentNode!=this.targetElement&&0==n.length;)if("#text"!==(t=t.parentNode).nodeName&&this.targetsUsedByThisControllerFromNode(t).length>0)return t;return"#text"==t.nodeName||null==t.parentNode?null:t.parentNode==this.targetElement&&this.targetsUsedByThisControllerFromNode(t).length>0?t:null},n.targetAdded=function(e,t,n){var r=e+"TargetAdded";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetAdded",{target:e,node:t,trigger:n})},n.targetRemoved=function(e,t,n){var r=e+"TargetRemoved";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetRemoved",{target:e,node:t,trigger:n})},n.targetChanged=function(e,t,n){var r=e+"TargetChanged";this.controller[r]&&o(this.controller,r).call(this.controller,t),this.log("targetChanged",{target:e,node:t,trigger:n})},n.targetsUsedByThisControllerFromNode=function(e){if("#text"==e.nodeName||"#comment"==e.nodeName)return[];var t=e;return this.targetsUsedByThisController(t.getAttribute(this.scopedTargetSelector)||t.getAttribute(this.targetSelector))},n.targetsUsedByThisController=function(e){var t=this.stripIdentifierPrefix(e=e||"").split(" ");return this.targets.filter(function(e){return-1!==t.indexOf(e)})},n.stripIdentifierPrefix=function(e){return e.replace(new RegExp(this.identifierPrefix,"g"),"")},n.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),H=function(e,t){void 0===t&&(t={});var n=new W(e,t);return[n.observe,n.unobserve]},Q=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=H(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),_=function(e){var t=function(t){var n=window,r={height:n.innerHeight||Infinity,width:n.innerWidth||Infinity,event:t};o(e,"windowResize").call(e,r)},n=e.disconnect.bind(e),r=function(){window.addEventListener("resize",t),t()},i=function(){window.removeEventListener("resize",t)};return Object.assign(e,{disconnect:function(){i(),n()}}),r(),[r,i]},J=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=_(h(n)),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(t.Controller)),G=function(e,t){void 0===t&&(t=200);var n=null;return function(){var r=arguments,i=this,o=function(){return e.apply(i,r)};n&&clearTimeout(n),n=setTimeout(o,t)}};function $(e,t){var n;return void 0===t&&(t=200),function(){var r=arguments,i=this;n||(n=!0,e.apply(i,r),setTimeout(function(){return n=!1},t))}}function K(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}function X(e){try{return JSON.parse(e)}catch(t){return e}}var Y={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},Z={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},ee=function(e,t){var n,r,i,o,s=function(e,t,n,r,i,o,s){try{var c=[];return o&&(t.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)}),n.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)}),r.forEach(function(t){return e.classList.contains(t)&&t!==i&&c.push(t)})),w(e,t),j(e,c),w(e,n),Promise.resolve(function(){try{return Promise.resolve(new Promise(function(e){requestAnimationFrame(function(){requestAnimationFrame(e)})}))}catch(e){return Promise.reject(e)}}()).then(function(){return j(e,t),w(e,r),Promise.resolve(function(e){try{return Promise.resolve(new Promise(function(t){var n=1e3*Number(getComputedStyle(e).transitionDuration.split(",")[0].replace("s",""));setTimeout(function(){t(n)},n)}))}catch(e){return Promise.reject(e)}}(e)).then(function(){j(e,n),s&&j(e,r),w(e,c)})})}catch(e){return Promise.reject(e)}},c=function(n){try{if(!e.transitioned)return Promise.resolve();e.transitioned=!1,E&&E(n);var r=te("leaveFrom",t,f),i=te("leaveActive",t,f),o=te("leaveTo",t,f),c=te("enterTo",t,f);return p||j(d,c),Promise.resolve(s(d,r,i,o,m,g,p)).then(function(){m&&d.classList.add(m)})}catch(e){return Promise.reject(e)}},a=function(n){try{if(e.transitioned)return Promise.resolve();e.transitioned=!0,y&&y(n);var r=te("enterFrom",t,f),i=te("enterActive",t,f),o=te("enterTo",t,f),a=te("leaveTo",t,f);return m&&d.classList.remove(m),p||j(d,a),Promise.resolve(s(d,r,i,o,m,g,p)).then(function(){v>0&&setTimeout(function(){c(n)},v)})}catch(e){return Promise.reject(e)}};void 0===t&&(t={});var l,u=e.element.dataset.transitionTarget;u&&(l=e[u+"Target"]);var d=(null==(n=t)?void 0:n.element)||l||e.element;if(d instanceof HTMLElement||d instanceof SVGElement){var f=d.dataset,v=parseInt(f.leaveAfter||"")||t.leaveAfter||0,h=Object.assign(Z,t),b=h.transitioned,m=h.hiddenClass,g=h.preserveOriginalClass,p=h.removeToClasses,y=null==(r=e.enter)?void 0:r.bind(e),E=null==(i=e.leave)?void 0:i.bind(e),C=null==(o=e.toggleTransition)?void 0:o.bind(e);return e.transitioned=b,b?(m&&d.classList.remove(m),a()):(m&&d.classList.add(m),c()),Object.assign(e,{enter:a,leave:c,toggleTransition:O}),[a,c,O]}function O(t){C&&C(t),e.transitioned?c():a()}function w(e,t){var n;t.length>0&&(n=e.classList).add.apply(n,t)}function j(e,t){var n;t.length>0&&(n=e.classList).remove.apply(n,t)}};function te(e,t,n){var r,i="transition"+e[0].toUpperCase()+e.substr(1),o=t[e]||n[i]||n[Y[e]]||" ";return 0!==(r=o).length&&r.trim()?o.split(" "):[]}var ne=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){ee(h(n),n.options)}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).transitioned=!1,t}return f(t,e),t}(t.Controller)),re=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).bind=function(){for(var e=function(){var e=n[t],o=e[0],s=e[1],c=s.handler.bind(r.controller);i.default(o,s.options,function(e){return c(e,e)})},t=0,n=Object.entries(r.hotkeysOptions.hotkeys);t<n.length;t++)e()},r.unbind=function(){for(var e in r.hotkeysOptions.hotkeys)i.default.unbind(e)},r.controller=t,r.hotkeysOptions=n,r.enhanceController(),r.bind(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this;this.hotkeysOptions.filter&&(i.default.filter=this.hotkeysOptions.filter);var t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unbind(),t()}})},t}(T),ie={mediaQueries:{},dispatchEvent:!0,eventPrefix:!0,debug:!1},oe=function(e){function t(t,n){var r,i,o,s,c;return void 0===n&&(n={}),(c=e.call(this,t,n)||this).matches=[],c.callback=function(e){var t=Object.keys(c.mediaQueries).find(function(t){return c.mediaQueries[t]===e.media});t&&c.changed({name:t,media:e.media,matches:e.matches,event:e})},c.changed=function(e){var t=e.name;e.event&&(c.call(a(t+"_changed"),e),c.dispatch(t+":changed",e),c.log('media query "'+t+'" changed',e)),e.matches?(c.call(a("is_"+t),e),c.dispatch("is:"+t,e)):(c.call(a("not_"+t),e),c.dispatch("not:"+t,e))},c.observe=function(){Object.keys(c.mediaQueries).forEach(function(e){var t=c.mediaQueries[e],n=window.matchMedia(t);n.addListener(c.callback),c.matches.push(n),c.changed({name:e,media:t,matches:n.matches})})},c.unobserve=function(){c.matches.forEach(function(e){return e.removeListener(c.callback)})},c.controller=t,c.mediaQueries=null!=(r=n.mediaQueries)?r:ie.mediaQueries,c.dispatchEvent=null!=(i=n.dispatchEvent)?i:ie.dispatchEvent,c.eventPrefix=null!=(o=n.eventPrefix)?o:ie.eventPrefix,c.debug=null!=(s=n.debug)?s:ie.debug,window.matchMedia?(c.enhanceController(),c.observe(),c):(console.error("window.matchMedia() is not available"),h(c))}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),se=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){document.hasFocus()?r.becomesFocused():(console.log("i should be there"),r.becomesUnfocused()),r.interval=setInterval(function(){r.handleWindowFocusChange()},r.intervalDuration)},r.unobserve=function(){clearInterval(r.interval)},r.becomesUnfocused=function(e){r.controller.hasFocus=!1,r.call("unfocus",e),r.log("unfocus",{hasFocus:!1}),r.dispatch("unfocus",{event:e,hasFocus:!1})},r.becomesFocused=function(e){r.controller.hasFocus=!0,r.call("focus",e),r.log("focus",{hasFocus:!0}),r.dispatch("focus",{event:e,hasFocus:!0})},r.handleWindowFocusChange=function(e){document.hasFocus()&&!r.controller.hasFocus?r.becomesFocused(e):!document.hasFocus()&&r.controller.hasFocus&&r.becomesUnfocused(e)},r.controller=t,r.intervalDuration=n.interval||200,r.enhanceController(),r.observe(),r}return f(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controllerDisconnect;Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(T),ce=function(e,t){void 0===t&&(t={});var n=new se(e,t);return[n.observe,n.unobserve]},ae=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=ce(h(n),n.options),t=e[0],r=e[1];Object.assign(h(n),{observe:t,unobserve:r})}),n}return f(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).hasFocus=!1,t}return f(t,e),t}(t.Controller));e.ApplicationController=L,e.ClickOutsideController=j,e.HoverController=z,e.IdleController=N,e.IntersectionController=m,e.LazyLoadController=p,e.MutationController=B,e.ResizeController=C,e.TargetMutationController=Q,e.TransitionController=ne,e.UseHover=U,e.UseMutation=D,e.UseTargetMutation=W,e.UseVisibility=V,e.VisibilityController=S,e.WindowFocusController=ae,e.WindowResizeController=J,e.useApplication=A,e.useClickOutside=w,e.useDebounce=function(e,t){var n;null==(n=e.constructor.debounces)||n.forEach(function(n){if("string"==typeof n&&(e[n]=G(e[n],null==t?void 0:t.wait)),"object"==typeof n){var r=n.name;if(!r)return;e[r]=G(e[r],n.wait||(null==t?void 0:t.wait))}})},e.useDispatch=F,e.useHotkeys=function(e,t){return new re(e,function(e){if(!e.hotkeys){var t={};Object.entries(e).forEach(function(e){var n;Object.defineProperty(t,e[0],{value:(n=e[1],{handler:n[0],options:{element:n[1]}}),writable:!1,enumerable:!0})}),e={hotkeys:t}}return e}(t))},e.useHover=q,e.useIdle=I,e.useIntersection=u,e.useLazyLoad=g,e.useMatchMedia=function(e,t){void 0===t&&(t={});var n=new oe(e,t);return[n.observe,n.unobserve]},e.useMemo=function(e){var t;null==(t=e.constructor.memos)||t.forEach(function(t){!function(e,t,n){Object.defineProperty(e,t,{value:n})}(e,t,e[t])})},e.useMeta=function(e,t){void 0===t&&(t={suffix:!0});var n=e.constructor.metaNames,r=t.suffix;null==n||n.forEach(function(t){!function(e,t,n){var r=n?a(t)+"Meta":a(t);Object.defineProperty(e,r,{get:function(){return X(K(t))}})}(e,t,r)}),Object.defineProperty(e,"metas",{get:function(){var e={};return null==n||n.forEach(function(t){var n=X(K(t));null!=n&&(e[a(t)]=n)}),e}})},e.useMutation=R,e.useResize=E,e.useTargetMutation=H,e.useThrottle=function(e,t){var n;void 0===t&&(t={}),null==(n=e.constructor.throttles)||n.forEach(function(n){var r;if("string"==typeof n&&(e[n]=$(e[n],null==(r=t)?void 0:r.wait)),"object"==typeof n){var i,o=n.name;if(!o)return;e[o]=$(e[o],n.wait||(null==(i=t)?void 0:i.wait))}})},e.useTransition=ee,e.useVisibility=M,e.useWindowFocus=ce,e.useWindowResize=_}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { Logger } from './logger'; | ||
@@ -3,0 +3,0 @@ export interface StimulusUseOptions { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
export declare const method: (controller: Controller, methodName: string) => Function; | ||
@@ -3,0 +3,0 @@ export declare const composeEventName: (name: string, controller: Controller, eventPrefix: boolean | string) => string; |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { DispatchOptions } from '../use-dispatch'; | ||
@@ -10,4 +10,4 @@ export declare class ApplicationController extends Controller { | ||
metaValue: (name: string) => string; | ||
dispatch: (eventName: String, detail: any) => CustomEvent; | ||
dispatch: (eventName: String, detail: any) => void; | ||
} | ||
//# sourceMappingURL=application-controller.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useApplication } from './use-application'; | ||
@@ -3,0 +3,0 @@ export class ApplicationController extends Controller { |
@@ -1,4 +0,4 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { DispatchOptions } from '../use-dispatch/index'; | ||
export declare const useApplication: (controller: Controller, options?: DispatchOptions) => void; | ||
//# sourceMappingURL=use-application.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Context, Controller } from '@hotwired/stimulus'; | ||
import { Context, Controller } from 'stimulus'; | ||
import { ClickOutsideOptions } from './use-click-outside'; | ||
@@ -3,0 +3,0 @@ export declare class ClickOutsideComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useClickOutside } from './use-click-outside'; | ||
@@ -3,0 +3,0 @@ export class ClickOutsideComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
export interface DebounceOptions { | ||
@@ -3,0 +3,0 @@ wait?: number; |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
class DebounceController extends Controller { | ||
@@ -3,0 +3,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { StimulusUse, StimulusUseOptions } from '../stimulus-use'; | ||
@@ -3,0 +3,0 @@ export interface DispatchOptions extends StimulusUseOptions { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { KeyHandler } from 'hotkeys-js'; | ||
@@ -3,0 +3,0 @@ import { StimulusUse, StimulusUseOptions } from '../stimulus-use'; |
@@ -1,2 +0,2 @@ | ||
import { Context, Controller } from '@hotwired/stimulus'; | ||
import { Context, Controller } from 'stimulus'; | ||
import { HoverOptions } from './use-hover'; | ||
@@ -3,0 +3,0 @@ export declare class HoverComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useHover } from './use-hover'; | ||
@@ -3,0 +3,0 @@ export class HoverComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { IdleOptions } from './use-idle'; | ||
@@ -3,0 +3,0 @@ export declare class IdleComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useIdle } from './use-idle'; | ||
@@ -3,0 +3,0 @@ export class IdleComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { IntersectionOptions } from './use-intersection'; | ||
@@ -3,0 +3,0 @@ export declare class IntersectionComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useIntersection } from './use-intersection'; | ||
@@ -3,0 +3,0 @@ export class IntersectionComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
export declare class LazyLoadComposableController extends Controller { | ||
@@ -3,0 +3,0 @@ isLoading: boolean; |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useLazyLoad } from './useLazyLoad'; | ||
@@ -3,0 +3,0 @@ export class LazyLoadComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { StimulusUse, StimulusUseOptions } from '../stimulus-use'; | ||
@@ -3,0 +3,0 @@ declare type MediaQueryDefinitions = Record<string, string>; |
@@ -1,3 +0,3 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
export declare const useMemo: (controller: Controller) => void; | ||
//# sourceMappingURL=use-memo.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
export interface MetaOptions { | ||
@@ -3,0 +3,0 @@ suffix: boolean; |
@@ -1,2 +0,2 @@ | ||
import { Context, Controller } from '@hotwired/stimulus'; | ||
import { Context, Controller } from 'stimulus'; | ||
import { MutationOptions } from './use-mutation'; | ||
@@ -3,0 +3,0 @@ export declare class MutationComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useMutation } from './use-mutation'; | ||
@@ -3,0 +3,0 @@ export class MutationComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { ResizeOptions } from './use-resize'; | ||
@@ -3,0 +3,0 @@ export declare class ResizeComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useResize } from './use-resize'; | ||
@@ -3,0 +3,0 @@ export class ResizeComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Context, Controller } from '@hotwired/stimulus'; | ||
import { Context, Controller } from 'stimulus'; | ||
import { TargetMutationOptions } from './use-target-mutation'; | ||
@@ -3,0 +3,0 @@ export declare class TargetMutationComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useTargetMutation } from './use-target-mutation'; | ||
@@ -3,0 +3,0 @@ export class TargetMutationComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
export interface ThrottleOptions { | ||
@@ -3,0 +3,0 @@ wait?: number; |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
class ThrottleController extends Controller { | ||
@@ -3,0 +3,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { TransitionOptions } from './use-transition'; | ||
@@ -3,0 +3,0 @@ export declare class TransitionComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useTransition } from './use-transition'; | ||
@@ -3,0 +3,0 @@ export class TransitionComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { VisibilityOptions } from './use-visibility'; | ||
@@ -3,0 +3,0 @@ export declare class VisibilityComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useVisibility } from './use-visibility'; | ||
@@ -3,0 +3,0 @@ export class VisibilityComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { WindowFocusOptions } from './use-window-focus'; | ||
@@ -3,0 +3,0 @@ export declare class WindowFocusComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useWindowFocus } from './use-window-focus'; | ||
@@ -3,0 +3,0 @@ export class WindowFocusComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller, Context } from '@hotwired/stimulus'; | ||
import { Controller, Context } from 'stimulus'; | ||
import { WindowResizePayload } from './use-window-resize'; | ||
@@ -3,0 +3,0 @@ export declare class WindowResizeComposableController extends Controller { |
@@ -1,2 +0,2 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from 'stimulus'; | ||
import { useWindowResize } from './use-window-resize'; | ||
@@ -3,0 +3,0 @@ export class WindowResizeComposableController extends Controller { |
{ | ||
"name": "stimulus-use", | ||
"version": "0.40.1-0", | ||
"version": "0.41.0", | ||
"description": "A collection of standard controllers and utilities for Stimulus", | ||
@@ -13,7 +13,7 @@ "sideEffects": false, | ||
"license": "MIT", | ||
"external": "@hotwired/stimulus", | ||
"external": "stimulus", | ||
"scripts": { | ||
"start": "webpack-dev-server --mode development --open", | ||
"prebuild": "$npm_execpath run clean", | ||
"build": "tsc -b && microbundle src/index.ts -f umd --globals @hotwired/stimulus=Stimulus", | ||
"build": "tsc -b && microbundle src/index.ts -f umd --globals stimulus=Stimulus", | ||
"test": "NODE_ENV=test karma start", | ||
@@ -71,2 +71,3 @@ "test:watch": "NODE_ENV=test karma start --auto-watch --no-single-run", | ||
"sourcemap": "^0.1.0", | ||
"stimulus": ">=1.1.1 <3", | ||
"style-loader": "^2.0.0", | ||
@@ -84,8 +85,8 @@ "tailwindcss": "^2.0.1", | ||
}, | ||
"peerDependencies": {}, | ||
"peerDependencies": { | ||
"stimulus": ">=1.1.1 <3" | ||
}, | ||
"dependencies": { | ||
"@hotwired/stimulus": "^3.0.0", | ||
"hotkeys-js": ">=3", | ||
"stimulus": ">=3" | ||
"hotkeys-js": ">=3" | ||
} | ||
} |
@@ -33,2 +33,4 @@ <p align="center"> | ||
⚠️ Stimulus 3 has several breaking changes. If you want to use Stimulus-Use with Stimulus 3 you can use the current beta version of Stimulus-Use `yarn add stimulus-use@beta`. All contribution to Stimulus 3 features are now on the [stimulus-3 branch](https://github.com/stimulus-use/stimulus-use/tree/stimulus-3) | ||
npm | ||
@@ -102,3 +104,3 @@ ```bash | ||
```js | ||
import { Controller } from '@hotwired/stimulus' | ||
import { Controller } from 'stimulus' | ||
import { useIntersection, useResize } from 'stimulus-use' | ||
@@ -176,2 +178,3 @@ | ||
<td align="center"><a href="https://github.com/FlxAlbroscheit"><img src="https://avatars.githubusercontent.com/u/2439195?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Felix Albroscheit</b></sub></a><br /><a href="https://github.com/stimulus-use/stimulus-use/issues?q=author%3AFlxAlbroscheit" title="Bug reports">🐛</a></td> | ||
<td align="center"><a href="https://guillaumebriday.fr"><img src="https://avatars.githubusercontent.com/u/8252238?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Guillaume Briday</b></sub></a><br /><a href="https://github.com/stimulus-use/stimulus-use/commits?author=guillaumebriday" title="Code">💻</a></td> | ||
</tr> | ||
@@ -178,0 +181,0 @@ </table> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
193
312388
46
2110
+ Added@stimulus/core@2.0.0(transitive)
+ Added@stimulus/multimap@2.0.0(transitive)
+ Added@stimulus/mutation-observers@2.0.0(transitive)
+ Added@stimulus/webpack-helpers@2.0.0(transitive)
+ Addedstimulus@2.0.0(transitive)
- Removed@hotwired/stimulus@^3.0.0
- Removedstimulus@>=3
- Removed@hotwired/stimulus@3.2.2(transitive)
- Removed@hotwired/stimulus-webpack-helpers@1.0.1(transitive)
- Removedstimulus@3.2.2(transitive)