taskkit-analyze
Version:
Analyze output files to see how your bundle is created
3 lines (2 loc) • 14 kB
JavaScript
!function(e){"use strict";function t(e){return e.parentNode?e.parentNode.dataset.module?e.parentNode:t(e.parentNode):e}function n(e,t){var n=i(e,t);return n.length?n[0]:null}function o(e){return null!=e&&e===e.window}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof HTMLElement||o(e))return[e];if(e instanceof NodeList)return[].slice.call(e);if("string"==typeof e){var i=t?n(t):document;return[].slice.call(i.querySelectorAll(e))}return[]}function r(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(e))return void e.forEach(function(e){return r(e,t,n,o)});var s={cb:n,capture:o};window._domassistevents||(window._domassistevents={}),window._domassistevents["_"+t]=s;var u=i(e);u.length&&u.forEach(function(e){e.addEventListener(t,n,o)})}function s(){if(C)return C;var e=window.document.documentElement,t=void 0;return e.scrollTop=1,1===e.scrollTop?(e.scrollTop=0,t=e):t=document.body,C=t,t}function u(e){return e&&e.__esModule?e.default:e}function a(e,t){return t={exports:{}},e(t,t.exports),t.exports}function c(e,t){var n=f(e,t);return n.length?n[0]:null}function l(e){return null!=e&&e===e.window}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof HTMLElement||l(e))return[e];if(e instanceof NodeList)return[].slice.call(e);if("string"==typeof e){var n=t?c(t):document;return[].slice.call(n.querySelectorAll(e))}return[]}function d(e,t){if(Array.isArray(e))return e.forEach(function(e){return d(e,t)});var n=f(e);if(n.length){var o=function(){var e=[].concat(t);return n.forEach(function(t){e.forEach(function(e){t.classList.add(e)})}),{v:n}}();if("object"===("undefined"==typeof o?"undefined":b(o)))return o.v}}function h(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(e))return void e.forEach(function(e){return h(e,t,n,o)});var i={cb:n,capture:o};window._domassistevents||(window._domassistevents={}),window._domassistevents["_"+t]=i;var r=f(e);r.length&&r.forEach(function(e){e.addEventListener(t,n,o)})}function p(e,t){if(Array.isArray(e))return e.forEach(function(e){return p(e,t)});var n=f(e);if(n.length){var o=function(){var e=[].concat(t);return n.forEach(function(t){e.forEach(function(e){t.classList.remove(e)})}),{v:n}}();if("object"===("undefined"==typeof o?"undefined":b(o)))return o.v}}function v(){if(P)return P;var e=window.document.documentElement,t=void 0;return e.scrollTop=1,1===e.scrollTop?(e.scrollTop=0,t=e):t=document.body,P=t,t}function y(){if(M)return M;var e=window.document.documentElement,t=void 0;return e.scrollTop=1,1===e.scrollTop?(e.scrollTop=0,t=e):t=document.body,M=t,t}function m(){return 1}e="default"in e?e.default:e;var g=function(e,t){var n={};return Object.keys(t.dataset).forEach(function(o){if(o.match(new RegExp("^"+e))&&o!==e){var i=o.replace(e,""),r=!1;i.match(/^Global/)&&(i=i.replace("Global",""),r=!0),i=""+i[0].toLowerCase()+i.slice(1),r?n[i]=window[t.dataset[o]]:n[i]=t.dataset[o]}}),n},b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},x=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),E=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},k=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},A=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},O=function e(){var t=Array.prototype.slice.call(arguments),n=t.shift(),o="";return"string"!=typeof n&&"boolean"!=typeof n||(o=n===!0?"deep":n,n=t.shift(),"defaults"===o&&(n=e({},n),o="strict")),t.forEach(function(t){for(var i in t){var r=t[i];if(Array.isArray(r))n[i]=r;else if("deep"===o&&"object"===("undefined"==typeof r?"undefined":b(r))&&"undefined"!=typeof n[i]){if("object"!==b(n[i])){n[i]=r;continue}e(o,n[i],r)}else("strict"!==o||"strict"===o&&"undefined"!=typeof n[i])&&(n[i]=r)}}),n},T=O,C=s(),I="[data-action]",j={find:i,findOne:n,on:r},N=function(){function e(t){return w(this,e),this.log("begin setup"),this.el=t,this.els={},this.options=T({},this.defaults,g("module",this.el)),this.moduleName=this.el.dataset.module,this.setUps={actions:[],named:[],options:[]},this.boundActionRouter=this.actionRouter.bind(this),this.preInit(),this.storeRef(),this.setupActions(),this.setupNamed(),this.verifyRequired(),this.postInit(),this.log("initalized"),this}return x(e,[{key:"preInit",value:function(){}},{key:"postInit",value:function(){}},{key:"verifyRequired",value:function(){var e=this;return this.required==={}?this:("undefined"!=typeof this.required.options&&(this.setUps.options=Object.keys(this.options)),Object.keys(this.required).forEach(function(t){e.required[t].forEach(function(n){if(e.setUps[t].indexOf(n)<0)throw new Error(n+" is required as "+t+" for "+e.moduleName+", but is missing!")})}),this)}},{key:"setupActions",value:function(){var e=this;this.setupAction(this.el),this.find(I).forEach(function(n){var o=t(n);o===e.el&&e.setupAction(n)})}},{key:"setupAction",value:function(t){if(!t.dataset.domoduleActionProcessed){var n=e.parseAction(t),o=n.name,i=n.type;if(o){if("function"!=typeof this[o])return void this.log(o+" was registered, but there is no function set up");this.log(o+" bound"),this.storeSetUp(o,"actions"),j.on(t,i,this.boundActionRouter),t.dataset.domoduleActionProcessed=!0}}}},{key:"actionRouter",value:function(t){var n=t.currentTarget,o=e.parseAction(n),i=o.name,r=g("action",n);this[i].call(this,n,t,r)}},{key:"setupNamed",value:function(){var e=this;this.find("[data-name]").forEach(function(n){var o=t(n);o===e.el&&(n.dataset.domoduleNameProcessed||(e.els[n.dataset.name]=n,e.storeSetUp(n.dataset.name,"named"),n.dataset.domoduleNameProcessed=!0,n.dataset.domoduleOwner=e.id))})}},{key:"storeRef",value:function(){return"undefined"==typeof e.refs&&(e.refs={}),"undefined"==typeof e.refs[this.el.dataset.moduleUid]&&(this.id=this.uuid,this.el.dataset.moduleUid=this.id,void(e.refs[this.el.dataset.moduleUid]=this))}},{key:"find",value:function(e){return j.find(e,this.el)}},{key:"findOne",value:function(e){return j.findOne(e,this.el)}},{key:"findByName",value:function(e){return this.els[e]}},{key:"getOption",value:function(e){return this.options[e]}},{key:"storeSetUp",value:function(e,t){this.setUps[t].indexOf(e)<0&&this.setUps[t].push(e)}},{key:"destroy",value:function(){var t=this;j.find(I,this.el.parentNode).forEach(function(n){if(n.dataset.domoduleActionProcessed){var o=e.parseAction(n),i=o.type;n.removeEventListener(i,t.boundActionRouter),n.dataset.domoduleActionProcessed=!1}})}},{key:"log",value:function(t){e.log(this.constructor.name+": "+t)}},{key:"required",get:function(){return{}}},{key:"defaults",get:function(){return{}}},{key:"uuid",get:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}}],[{key:"parseAction",value:function(e){var t=e.dataset,n=t.action,o=t.actionType,i=void 0===o?"click":o;return{name:n,type:i}}},{key:"getInstance",value:function(t){if(t instanceof Node)return e.refs[t.dataset.moduleUid];throw new Error("getInstance expects a dom node")}},{key:"register",value:function(t,n){"function"==typeof t&&(n=t,t=n.prototype.constructor.name),e.modules||(e.modules={}),e.log("Registering "+t),e.modules[t]=n}},{key:"discover",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"body";if(e.log("Discovering modules..."),!e.modules)return void e.log("No modules found");var n=void 0;n=t instanceof Node?[t]:Array.isArray(t)?t:j.find(t);var o=[];return n.forEach(function(t){var n=j.find("[data-module]",t);n.forEach(function(t){var n=t.dataset.module;if(n&&"function"==typeof e.modules[n]){if("object"===b(e.refs)&&"undefined"!=typeof e.refs[t.dataset.moduleUid])return;e.log(n+" found"),o.push(new e.modules[n](t))}})}),o}},{key:"log",value:function(t){e.debug&&console.log("[DOMODULE] "+t)}}]),e}();N.debug="object"===b(window.localStorage)&&window.localStorage.getItem("DomoduleDebug"),N.autoDiscover=!0,window.addEventListener("DOMContentLoaded",function(){N.autoDiscover&&N.discover()});var L=a(function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(){function e(){n(this,e)}return o(e,null,[{key:"request",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n[0],r=n[1],s=n[2],u=n[3];"function"==typeof i&&(i="GET",u=i,r=null,s={}),"function"==typeof r&&(u=r,r=null,s={}),"function"==typeof s&&(u=s,s={}),null===s&&(s={});var a=i.toUpperCase(),c=["GET","POST","PUT","PATCH","HEAD","DELETE","OPTIONS"];if(c.indexOf(a)===-1){var l=new TypeError("Method must be one of the following: "+c.join(", "));return u(l)}var f=new XMLHttpRequest;return f.open(a,e),f.onreadystatechange=function(){if(f.readyState>3&&f.status>0){var e=f.getResponseHeader("content-type"),t=f.responseText;return e&&e.toLowerCase().indexOf("json")&&(t=JSON.parse(t)),u(null,{statusCode:f.status,data:t})}},Object.keys(s).forEach(function(e){f.setRequestHeader(e,s[e])}),null!==r?(f.setRequestHeader("Content-Type","application/json"),f.send(JSON.stringify(r))):f.send(),f}}]),e}();t.default=i}),S=u(L),_=function(e,t,n){var o=void 0;return function(){var i=this,r=arguments,s=function(){o=null,n||e.apply(i,r)},u=n&&!o;clearTimeout(o),o=setTimeout(s,t),u&&e.apply(i,r)}},P=void 0;P=v();var R=A(['<li data-action="select" data-action-value="','">',"</li>"],['<li data-action="select" data-action-value="','">',"</li>"]),U={on:h,addClass:d,removeClass:p,find:f},q={ENTER:13,UP:38,DOWN:40},D=function(e){function t(){return w(this,t),k(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return E(t,e),x(t,[{key:"postInit",value:function(){var e=this;this.currentIndex=-1,U.on(this.els.input,"keydown",function(t){return e.keydown(t)}),this.fetch=_(this.fetch.bind(this),this.options.delay),this.options.strict=this.options.strict===!0||"true"===this.options.strict}},{key:"search",value:function(e,t,n){var o=(""+e.value).trim();o!==this.selectedTerm&&(this.term=o,this.endpoint=n.endpoint||this.options.endpoint,this.listClass=n.listClass||this.options.listClass,this.fetch())}},{key:"fetch",value:function(){var e=this,t=this.endpoint.replace(/\$\{term\}/g,this.term);S.request(t,"GET",{},function(t,n){return!t&&(e.currentIndex=-1,void e.render(n.data))})}},{key:"render",value:function(e){var t=this;if(!Array.isArray(e))return!1;var n="";this.listClass&&(n+=' class="'+this.listClass+'"');var o="<ul"+n+">";e.forEach(function(e){var n=e;"string"==typeof n&&(n={value:n,name:n}),o+=t.escape(R,n.value,n.name)}),o+="</ul>",this.els.resultsContainer.innerHTML=o,this.setupActions()}},{key:"select",value:function(e,t,n){this.updateValue({value:n.value,name:e.innerHTML}),this.els.resultsContainer.innerHTML=""}},{key:"updateValue",value:function(e){this.selectedTerm=e,this.els.input.value=e.name,this.els.value&&(this.els.value.value=e.value)}},{key:"escape",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i="";return e.forEach(function(e,t){i+=e,"string"==typeof n[t]&&(i+=n[t].replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`"))}),i}},{key:"highlightItem",value:function(){var e=f("li",this.els.resultsContainer);this.currentIndex<0&&(this.currentIndex=0),this.currentIndex>=e.length&&(this.currentIndex=e.length-1),U.removeClass(e,this.options.highlightClass),U.addClass(e[this.currentIndex],this.options.highlightClass)}},{key:"selectItem",value:function(){var e=f("li",this.els.resultsContainer);if(this.currentIndex<0){if(!this.options.strict)return void this.updateValue({value:this.els.input.value,name:this.els.input.value});this.currentIndex=0}this.currentIndex>=e.length&&(this.currentIndex=e.length-1),e[this.currentIndex].click(),U.removeClass(e[this.currentIndex],this.options.highlightClass)}},{key:"keydown",value:function(e){switch(e.keyCode){case q.UP:this.currentIndex>0&&--this.currentIndex,this.highlightItem();break;case q.DOWN:++this.currentIndex,this.highlightItem();break;case q.ENTER:this.selectItem();break;default:return}e.preventDefault()}},{key:"defaults",get:function(){return{delay:500,strict:!0,showClass:"show",highlightClass:"selected"}}},{key:"required",get:function(){return{options:["endpoint"],named:["resultsContainer","input"]}}}]),t}(N);N.register("Complete",D);var M=void 0;M=y();var H=function(e){return function(t){function n(){for(;e.length;){var t=e.shift();"function"==typeof t&&t()}}function o(){document.removeEventListener("DOMContentLoaded",o),n()}return e.push(t),"complete"===document.readyState?n():void document.addEventListener("DOMContentLoaded",o)}},G=H([]),z=42;console.log(z);var V=function e(){w(this,e)},J=(new V,m());console.log(J),G(function(){console.log("ready!"),console.log(D)})}(codemirror);
//# sourceMappingURL=dist.js.map