diff --git a/docs/909.bundle.js b/docs/909.bundle.js index 1a47b8a..43b3815 100644 --- a/docs/909.bundle.js +++ b/docs/909.bundle.js @@ -1,4 +1,4 @@ -(()=>{var e={887:function(e,t,n){var i,r;i=0,r=function(){"use strict";function t(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){a(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function i(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,n,s){var a=o.URL||o.webkitURL,l=document.createElement("a");n=n||e.name||"download",l.download=n,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):i(l.href)?t(e,n,s):r(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){r(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,o){if(n=n||e.name||"download","string"!=typeof e){var s,a;navigator.msSaveOrOpenBlob((s=e,void 0===(a=o)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s),n)}else if(i(e))t(e,n,o);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){r(l)})}}:function(e,n,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,i);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&l||s)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});o.saveAs=a.saveAs=a,e.exports=a},"function"==typeof define&&define.amd?define([],r):r()},461:function(e,t,n){e=n.nmd(e);var i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function r(e,t){if(!i[e]){i[e]={};for(var n=0;n>>8,n[2*i+1]=s%256}return n},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var n=Array(t.length/2),i=0,r=n.length;ic.charCodeAt(0)){for(i=0;i>=1}else{for(i=0,r=1;i>=1}0==--d&&(d=Math.pow(2,p),p++),delete a[c]}else for(i=0,r=s[c];i>=1;0==--d&&(d=Math.pow(2,p),p++),s[u]=h++,c=String(l)}if(""!==c){if(Object.prototype.hasOwnProperty.call(a,c)){if(256>c.charCodeAt(0)){for(i=0;i>=1}else{for(i=0,r=1;i>=1}0==--d&&(d=Math.pow(2,p),p++),delete a[c]}else for(i=0,r=s[c];i>=1;0==--d&&(d=Math.pow(2,p),p++)}for(i=0,r=2;i>=1;for(;;){if(m<<=1,g==t-1){f.push(n(m));break}g++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(t,n,i){var r,o,s,a,l,u,c,d,h=[],p=4,f=4,m=3,g="",y=[],v={val:i(0),position:n,index:1};for(o=0;o<3;o+=1)h[o]=o;for(a=0,u=4,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;switch(a){case 0:for(a=0,u=256,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;d=e(a);break;case 1:for(a=0,u=65536,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;d=e(a);break;case 2:return""}for(h[3]=d,s=d,y.push(d);;){if(v.index>t)return"";for(a=0,u=Math.pow(2,m),c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;switch(d=a){case 0:for(a=0,u=256,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;h[f++]=e(a),d=f-1,p--;break;case 1:for(a=0,u=65536,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;h[f++]=e(a),d=f-1,p--;break;case 2:return y.join("")}if(0==p&&(p=Math.pow(2,m),m++),h[d])g=h[d];else{if(d!==f)return null;g=s+s.charAt(0)}y.push(g),h[f++]=s+g.charAt(0),p--,s=g,0==p&&(p=Math.pow(2,m),m++)}}};return o}();"function"==typeof define&&define.amd?define(function(){return i}):null!=e?e.exports=i:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return i})},142:function(e,t,n){e=n.nmd(e);var i,r,o,s,a,l,u,c,d,h,p,f,m,g,y,v,w,b,E,T,_,x,A,S,L,I,N,k,D,C,j,O,R,z,P,B,U,F,Y,W,H,Q,V,G,K,q,Z,X,J,ee,et,en,ei,er,eo,es,ea,el,eu,ec,ed,eh,ep,ef,em,eg,ey,ev,ew,eb,eM,eE,eT,e_,ex,eA,eS,eL,eI,eN,ek=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},eD=function(){function e(e,t){for(var n=0;n/,p=/^\w+$/;function f(e,n){return n=n||t,d.test(e)?n.getElementsByClassName(e.slice(1)):p.test(e)?n.getElementsByTagName(e):n.querySelectorAll(e)}function m(n){if(!e){var i=(e=t.implementation.createHTMLDocument(null)).createElement("base");i.href=t.location.href,e.head.appendChild(i)}return e.body.innerHTML=n,e.body.childNodes}function g(e){"loading"!==t.readyState?e():t.addEventListener("DOMContentLoaded",e)}function y(e,i){if(!e)return this;if(e.cash&&e!==n)return e;var r,o=e,s=0;if(u(e))o=c.test(e)?t.getElementById(e.slice(1)):h.test(e)?m(e):f(e,i);else if(l(e))return g(e),this;if(!o)return this;if(o.nodeType||o===n)this[0]=o,this.length=1;else for(r=this.length=o.length;sr.right-n||l+t.width>window.innerWidth-n)&&(i.right=!0),(uo-n||u+t.height>window.innerHeight-n)&&(i.bottom=!0),i},M.checkPossibleAlignments=function(e,t,n,i){var r={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o="visible"===getComputedStyle(t).overflow,s=t.getBoundingClientRect(),a=Math.min(s.height,window.innerHeight),l=Math.min(s.width,window.innerWidth),u=e.getBoundingClientRect(),c=t.scrollLeft,d=t.scrollTop,h=n.left-c,p=n.top-d,f=n.top+u.height-d;return r.spaceOnRight=o?window.innerWidth-(u.left+n.width):l-(h+n.width),r.spaceOnRight<0&&(r.left=!1),r.spaceOnLeft=o?u.right-n.width:h-n.width+u.width,r.spaceOnLeft<0&&(r.right=!1),r.spaceOnBottom=o?window.innerHeight-(u.top+n.height+i):a-(p+n.height+i),r.spaceOnBottom<0&&(r.top=!1),r.spaceOnTop=o?u.bottom-(n.height+i):f-(n.height-i),r.spaceOnTop<0&&(r.bottom=!1),r},M.getOverflowParent=function(e){return null==e?null:e===document.body||"visible"!==getComputedStyle(e).overflow?e:M.getOverflowParent(e.parentElement)},M.getIdFromTrigger=function(e){var t=e.getAttribute("data-target");return t||(t=(t=e.getAttribute("href"))?t.slice(1):""),t},M.getDocumentScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},M.getDocumentScrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};var ez=Date.now||function(){return(new Date).getTime()};M.throttle=function(e,t,n){var i=void 0,r=void 0,o=void 0,s=null,a=0;n||(n={});var l=function(){a=!1===n.leading?0:ez(),s=null,o=e.apply(i,r),i=r=null};return function(){var u=ez();a||!1!==n.leading||(a=u);var c=t-(u-a);return i=this,r=arguments,c<=0?(clearTimeout(s),s=null,a=u,o=e.apply(i,r),i=r=null):s||!1===n.trailing||(s=setTimeout(l,c)),o}};var eP={scope:{}};eP.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){if(n.get||n.set)throw TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},eP.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:void 0!==n.g&&null!=n.g?n.g:e},eP.global=eP.getGlobal(this),eP.SYMBOL_PREFIX="jscomp_symbol_",eP.initSymbol=function(){eP.initSymbol=function(){},eP.global.Symbol||(eP.global.Symbol=eP.Symbol)},eP.symbolCounter_=0,eP.Symbol=function(e){return eP.SYMBOL_PREFIX+(e||"")+eP.symbolCounter_++},eP.initSymbolIterator=function(){eP.initSymbol();var e=eP.global.Symbol.iterator;e||(e=eP.global.Symbol.iterator=eP.global.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&eP.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return eP.arrayIterator(this)}}),eP.initSymbolIterator=function(){}},eP.arrayIterator=function(e){var t=0;return eP.iteratorPrototype(function(){return t=B.currentTime)for(var c=0;cn&&(t.duration=i.duration),t.children.push(i)}),t.seek(0),t.reset(),t.autoplay&&t.restart(),t},t},b.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},b}(),r=cash,o=M.anime,s={accordion:!0,onOpenStart:void 0,onOpenEnd:void 0,onCloseStart:void 0,onCloseEnd:void 0,inDuration:300,outDuration:300},a=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));(i.el.M_Collapsible=i).options=r.extend({},t.defaults,n),i.$headers=i.$el.children("li").children(".collapsible-header"),i.$headers.attr("tabindex",0),i._setupEventHandlers();var o=i.$el.children("li.active").children(".collapsible-body");return i.options.accordion?o.first().css("display","block"):o.css("display","block"),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Collapsible=void 0}},{key:"_setupEventHandlers",value:function(){var e=this;this._handleCollapsibleClickBound=this._handleCollapsibleClick.bind(this),this._handleCollapsibleKeydownBound=this._handleCollapsibleKeydown.bind(this),this.el.addEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.addEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_removeEventHandlers",value:function(){var e=this;this.el.removeEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.removeEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_handleCollapsibleClick",value:function(e){var t=r(e.target).closest(".collapsible-header");if(e.target&&t.length){var n=t.closest(".collapsible");if(n[0]===this.el){var i=t.closest("li"),o=n.children("li"),s=i[0].classList.contains("active"),a=o.index(i);s?this.close(a):this.open(a)}}}},{key:"_handleCollapsibleKeydown",value:function(e){13===e.keyCode&&this._handleCollapsibleClickBound(e)}},{key:"_animateIn",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length){var i=n.children(".collapsible-body");o.remove(i[0]),i.css({display:"block",overflow:"hidden",height:0,paddingTop:"",paddingBottom:""});var r=i.css("padding-top"),s=i.css("padding-bottom"),a=i[0].scrollHeight;i.css({paddingTop:0,paddingBottom:0}),o({targets:i[0],height:a,paddingTop:r,paddingBottom:s,duration:this.options.inDuration,easing:"easeInOutCubic",complete:function(e){i.css({overflow:"",paddingTop:"",paddingBottom:"",height:""}),"function"==typeof t.options.onOpenEnd&&t.options.onOpenEnd.call(t,n[0])}})}}},{key:"_animateOut",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length){var i=n.children(".collapsible-body");o.remove(i[0]),i.css("overflow","hidden"),o({targets:i[0],height:0,paddingTop:0,paddingBottom:0,duration:this.options.outDuration,easing:"easeInOutCubic",complete:function(){i.css({height:"",overflow:"",padding:"",display:""}),"function"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t,n[0])}})}}},{key:"open",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length&&!n[0].classList.contains("active")){if("function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,n[0]),this.options.accordion){var i=this.$el.children("li");this.$el.children("li.active").each(function(e){var n=i.index(r(e));t.close(n)})}n[0].classList.add("active"),this._animateIn(e)}}},{key:"close",value:function(e){var t=this.$el.children("li").eq(e);t.length&&t[0].classList.contains("active")&&("function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,t[0]),t[0].classList.remove("active"),this._animateOut(e))}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Collapsible}},{key:"defaults",get:function(){return s}}]),t}(),M.Collapsible=a,M.jQueryLoaded&&M.initializeJqueryWrapper(a,"collapsible","M_Collapsible"),l=cash,u=M.anime,c={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!0,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},(d=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return i.el.M_Dropdown=i,t._dropdowns.push(i),i.id=M.getIdFromTrigger(e),i.dropdownEl=document.getElementById(i.id),i.$dropdownEl=l(i.dropdownEl),i.options=l.extend({},t.defaults,n),i.isOpen=!1,i.isScrollable=!1,i.isTouchMoving=!1,i.focusedIndex=-1,i.filterQuery=[],i.options.container?l(i.options.container).append(i.dropdownEl):i.$el.after(i.dropdownEl),i._makeDropdownFocusable(),i._resetFilterQueryBound=i._resetFilterQuery.bind(i),i._handleDocumentClickBound=i._handleDocumentClick.bind(i),i._handleDocumentTouchmoveBound=i._handleDocumentTouchmove.bind(i),i._handleDropdownClickBound=i._handleDropdownClick.bind(i),i._handleDropdownKeydownBound=i._handleDropdownKeydown.bind(i),i._handleTriggerKeydownBound=i._handleTriggerKeydown.bind(i),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._resetDropdownStyles(),this._removeEventHandlers(),t._dropdowns.splice(t._dropdowns.indexOf(this),1),this.el.M_Dropdown=void 0}},{key:"_setupEventHandlers",value:function(){this.el.addEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.addEventListener("click",this._handleDropdownClickBound),this.options.hover?(this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.addEventListener("mouseleave",this._handleMouseLeaveBound)):(this._handleClickBound=this._handleClick.bind(this),this.el.addEventListener("click",this._handleClickBound))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.removeEventListener("click",this._handleDropdownClickBound),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.removeEventListener("mouseleave",this._handleMouseLeaveBound)):this.el.removeEventListener("click",this._handleClickBound)}},{key:"_setupTemporaryEventHandlers",value:function(){document.body.addEventListener("click",this._handleDocumentClickBound,!0),document.body.addEventListener("touchend",this._handleDocumentClickBound),document.body.addEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.addEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_removeTemporaryEventHandlers",value:function(){document.body.removeEventListener("click",this._handleDocumentClickBound,!0),document.body.removeEventListener("touchend",this._handleDocumentClickBound),document.body.removeEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.removeEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_handleClick",value:function(e){e.preventDefault(),this.open()}},{key:"_handleMouseEnter",value:function(){this.open()}},{key:"_handleMouseLeave",value:function(e){var t=e.toElement||e.relatedTarget,n=!!l(t).closest(".dropdown-content").length,i=!1,r=l(t).closest(".dropdown-trigger");r.length&&r[0].M_Dropdown&&r[0].M_Dropdown.isOpen&&(i=!0),i||n||this.close()}},{key:"_handleDocumentClick",value:function(e){var t=this,n=l(e.target);this.options.closeOnClick&&n.closest(".dropdown-content").length&&!this.isTouchMoving?setTimeout(function(){t.close()},0):!n.closest(".dropdown-trigger").length&&n.closest(".dropdown-content").length||setTimeout(function(){t.close()},0),this.isTouchMoving=!1}},{key:"_handleTriggerKeydown",value:function(e){e.which!==M.keys.ARROW_DOWN&&e.which!==M.keys.ENTER||this.isOpen||(e.preventDefault(),this.open())}},{key:"_handleDocumentTouchmove",value:function(e){l(e.target).closest(".dropdown-content").length&&(this.isTouchMoving=!0)}},{key:"_handleDropdownClick",value:function(e){if("function"==typeof this.options.onItemClick){var t=l(e.target).closest("li")[0];this.options.onItemClick.call(this,t)}}},{key:"_handleDropdownKeydown",value:function(e){if(e.which===M.keys.TAB)e.preventDefault(),this.close();else if((e.which===M.keys.ARROW_DOWN||e.which===M.keys.ARROW_UP)&&this.isOpen){e.preventDefault();var t=e.which===M.keys.ARROW_DOWN?1:-1,n=this.focusedIndex,i=!1;do if(n+=t,this.dropdownEl.children[n]&&-1!==this.dropdownEl.children[n].tabIndex){i=!0;break}while(nl.spaceOnBottom?(u="bottom",n+=l.spaceOnTop,o-=l.spaceOnTop):n+=l.spaceOnBottom)),!l[c]){var d="left"===c?"right":"left";l[d]?c=d:l.spaceOnLeft>l.spaceOnRight?(c="right",i+=l.spaceOnLeft,r-=l.spaceOnLeft):(c="left",i+=l.spaceOnRight)}return"bottom"===u&&(o=o-t.height+(this.options.coverTrigger?e.height:0)),"right"===c&&(r=r-t.width+e.width),{x:r,y:o,verticalAlignment:u,horizontalAlignment:c,height:n,width:i}}},{key:"_animateIn",value:function(){var e=this;u.remove(this.dropdownEl),u({targets:this.dropdownEl,opacity:{value:[0,1],easing:"easeOutQuad"},scaleX:[.3,1],scaleY:[.3,1],duration:this.options.inDuration,easing:"easeOutQuint",complete:function(t){e.options.autoFocus&&e.dropdownEl.focus(),"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el)}})}},{key:"_animateOut",value:function(){var e=this;u.remove(this.dropdownEl),u({targets:this.dropdownEl,opacity:{value:0,easing:"easeOutQuint"},scaleX:.3,scaleY:.3,duration:this.options.outDuration,easing:"easeOutQuint",complete:function(t){e._resetDropdownStyles(),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}})}},{key:"_placeDropdown",value:function(){var e=this.options.constrainWidth?this.el.getBoundingClientRect().width:this.dropdownEl.getBoundingClientRect().width;this.dropdownEl.style.width=e+"px";var t=this._getDropdownPosition();this.dropdownEl.style.left=t.x+"px",this.dropdownEl.style.top=t.y+"px",this.dropdownEl.style.height=t.height+"px",this.dropdownEl.style.width=t.width+"px",this.dropdownEl.style.transformOrigin=("left"===t.horizontalAlignment?"0":"100%")+" "+("top"===t.verticalAlignment?"0":"100%")}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this._resetDropdownStyles(),this.dropdownEl.style.display="block",this._placeDropdown(),this._animateIn(),this._setupTemporaryEventHandlers())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus())}},{key:"recalculateDimensions",value:function(){this.isOpen&&(this.$dropdownEl.css({width:"",height:"",left:"",top:"","transform-origin":""}),this._placeDropdown())}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Dropdown}},{key:"defaults",get:function(){return c}}]),t}())._dropdowns=[],M.Dropdown=d,M.jQueryLoaded&&M.initializeJqueryWrapper(d,"dropdown","M_Dropdown"),h=cash,p=M.anime,f={opacity:.5,inDuration:250,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,preventScrolling:!0,dismissible:!0,startingTop:"4%",endingTop:"10%"},(m=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Modal=i).options=h.extend({},t.defaults,n),i.isOpen=!1,i.id=i.$el.attr("id"),i._openingTrigger=void 0,i.$overlay=h(''),i.el.tabIndex=0,i._nthModalOpened=0,t._count++,i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){t._count--,this._removeEventHandlers(),this.el.removeAttribute("style"),this.$overlay.remove(),this.el.M_Modal=void 0}},{key:"_setupEventHandlers",value:function(){this._handleOverlayClickBound=this._handleOverlayClick.bind(this),this._handleModalCloseClickBound=this._handleModalCloseClick.bind(this),1===t._count&&document.body.addEventListener("click",this._handleTriggerClick),this.$overlay[0].addEventListener("click",this._handleOverlayClickBound),this.el.addEventListener("click",this._handleModalCloseClickBound)}},{key:"_removeEventHandlers",value:function(){0===t._count&&document.body.removeEventListener("click",this._handleTriggerClick),this.$overlay[0].removeEventListener("click",this._handleOverlayClickBound),this.el.removeEventListener("click",this._handleModalCloseClickBound)}},{key:"_handleTriggerClick",value:function(e){var t=h(e.target).closest(".modal-trigger");if(t.length){var n=M.getIdFromTrigger(t[0]),i=document.getElementById(n).M_Modal;i&&i.open(t),e.preventDefault()}}},{key:"_handleOverlayClick",value:function(){this.options.dismissible&&this.close()}},{key:"_handleModalCloseClick",value:function(e){h(e.target).closest(".modal-close").length&&this.close()}},{key:"_handleKeydown",value:function(e){27===e.keyCode&&this.options.dismissible&&this.close()}},{key:"_handleFocus",value:function(e){this.el.contains(e.target)||this._nthModalOpened!==t._modalsOpen||this.el.focus()}},{key:"_animateIn",value:function(){var e=this;h.extend(this.el.style,{display:"block",opacity:0}),h.extend(this.$overlay[0].style,{display:"block",opacity:0}),p({targets:this.$overlay[0],opacity:this.options.opacity,duration:this.options.inDuration,easing:"easeOutQuad"});var t={targets:this.el,duration:this.options.inDuration,easing:"easeOutCubic",complete:function(){"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el,e._openingTrigger)}};this.el.classList.contains("bottom-sheet")?h.extend(t,{bottom:0,opacity:1}):h.extend(t,{top:[this.options.startingTop,this.options.endingTop],opacity:1,scaleX:[.8,1],scaleY:[.8,1]}),p(t)}},{key:"_animateOut",value:function(){var e=this;p({targets:this.$overlay[0],opacity:0,duration:this.options.outDuration,easing:"easeOutQuart"});var t={targets:this.el,duration:this.options.outDuration,easing:"easeOutCubic",complete:function(){e.el.style.display="none",e.$overlay.remove(),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}};this.el.classList.contains("bottom-sheet")?h.extend(t,{bottom:"-100%",opacity:0}):h.extend(t,{top:[this.options.endingTop,this.options.startingTop],opacity:0,scaleX:.8,scaleY:.8}),p(t)}},{key:"open",value:function(e){if(!this.isOpen)return this.isOpen=!0,t._modalsOpen++,this._nthModalOpened=t._modalsOpen,this.$overlay[0].style.zIndex=1e3+2*t._modalsOpen,this.el.style.zIndex=1e3+2*t._modalsOpen+1,this._openingTrigger=e?e[0]:void 0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el,this._openingTrigger),this.options.preventScrolling&&(document.body.style.overflow="hidden"),this.el.classList.add("open"),this.el.insertAdjacentElement("afterend",this.$overlay[0]),this.options.dismissible&&(this._handleKeydownBound=this._handleKeydown.bind(this),this._handleFocusBound=this._handleFocus.bind(this),document.addEventListener("keydown",this._handleKeydownBound),document.addEventListener("focus",this._handleFocusBound,!0)),p.remove(this.el),p.remove(this.$overlay[0]),this._animateIn(),this.el.focus(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,t._modalsOpen--,this._nthModalOpened=0,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this.el.classList.remove("open"),0===t._modalsOpen&&(document.body.style.overflow=""),this.options.dismissible&&(document.removeEventListener("keydown",this._handleKeydownBound),document.removeEventListener("focus",this._handleFocusBound,!0)),p.remove(this.el),p.remove(this.$overlay[0]),this._animateOut(),this}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Modal}},{key:"defaults",get:function(){return f}}]),t}())._modalsOpen=0,m._count=0,M.Modal=m,M.jQueryLoaded&&M.initializeJqueryWrapper(m,"modal","M_Modal"),g=cash,y=M.anime,v={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},w=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Materialbox=i).options=g.extend({},t.defaults,n),i.overlayActive=!1,i.doneAnimating=!0,i.placeholder=g("
").addClass("material-placeholder"),i.originalWidth=0,i.originalHeight=0,i.originInlineStyles=i.$el.attr("style"),i.caption=i.el.getAttribute("data-caption")||"",i.$el.before(i.placeholder),i.placeholder.append(i.$el),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Materialbox=void 0,g(this.placeholder).after(this.el).remove(),this.$el.removeAttr("style")}},{key:"_setupEventHandlers",value:function(){this._handleMaterialboxClickBound=this._handleMaterialboxClick.bind(this),this.el.addEventListener("click",this._handleMaterialboxClickBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleMaterialboxClickBound)}},{key:"_handleMaterialboxClick",value:function(e){!1===this.doneAnimating||this.overlayActive&&this.doneAnimating?this.close():this.open()}},{key:"_handleWindowScroll",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowResize",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowEscape",value:function(e){27===e.keyCode&&this.doneAnimating&&this.overlayActive&&this.close()}},{key:"_makeAncestorsOverflowVisible",value:function(){this.ancestorsChanged=g();for(var e=this.placeholder[0].parentNode;null!==e&&!g(e).is(document);){var t=g(e);"visible"!==t.css("overflow")&&(t.css("overflow","visible"),void 0===this.ancestorsChanged?this.ancestorsChanged=t:this.ancestorsChanged=this.ancestorsChanged.add(t)),e=e.parentNode}}},{key:"_animateImageIn",value:function(){var e=this,t={targets:this.el,height:[this.originalHeight,this.newHeight],width:[this.originalWidth,this.newWidth],left:M.getDocumentScrollLeft()+this.windowWidth/2-this.placeholder.offset().left-this.newWidth/2,top:M.getDocumentScrollTop()+this.windowHeight/2-this.placeholder.offset().top-this.newHeight/2,duration:this.options.inDuration,easing:"easeOutQuad",complete:function(){e.doneAnimating=!0,"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el)}};this.maxWidth=this.$el.css("max-width"),this.maxHeight=this.$el.css("max-height"),"none"!==this.maxWidth&&(t.maxWidth=this.newWidth),"none"!==this.maxHeight&&(t.maxHeight=this.newHeight),y(t)}},{key:"_animateImageOut",value:function(){var e=this;y({targets:this.el,width:this.originalWidth,height:this.originalHeight,left:0,top:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:function(){e.placeholder.css({height:"",width:"",position:"",top:"",left:""}),e.attrWidth&&e.$el.attr("width",e.attrWidth),e.attrHeight&&e.$el.attr("height",e.attrHeight),e.$el.removeAttr("style"),e.originInlineStyles&&e.$el.attr("style",e.originInlineStyles),e.$el.removeClass("active"),e.doneAnimating=!0,e.ancestorsChanged.length&&e.ancestorsChanged.css("overflow",""),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}})}},{key:"_updateVars",value:function(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}},{key:"open",value:function(){var e=this;this._updateVars(),this.originalWidth=this.el.getBoundingClientRect().width,this.originalHeight=this.el.getBoundingClientRect().height,this.doneAnimating=!1,this.$el.addClass("active"),this.overlayActive=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this.placeholder.css({width:this.placeholder[0].getBoundingClientRect().width+"px",height:this.placeholder[0].getBoundingClientRect().height+"px",position:"relative",top:0,left:0}),this._makeAncestorsOverflowVisible(),this.$el.css({position:"absolute","z-index":1e3,"will-change":"left, top, width, height"}),this.attrWidth=this.$el.attr("width"),this.attrHeight=this.$el.attr("height"),this.attrWidth&&(this.$el.css("width",this.attrWidth+"px"),this.$el.removeAttr("width")),this.attrHeight&&(this.$el.css("width",this.attrHeight+"px"),this.$el.removeAttr("height")),this.$overlay=g('
').css({opacity:0}).one("click",function(){e.doneAnimating&&e.close()}),this.$el.before(this.$overlay);var t=this.$overlay[0].getBoundingClientRect();this.$overlay.css({width:this.windowWidth+"px",height:this.windowHeight+"px",left:-1*t.left+"px",top:-1*t.top+"px"}),y.remove(this.el),y.remove(this.$overlay[0]),y({targets:this.$overlay[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}),""!==this.caption&&(this.$photocaption&&y.remove(this.$photoCaption[0]),this.$photoCaption=g('
'),this.$photoCaption.text(this.caption),g("body").append(this.$photoCaption),this.$photoCaption.css({display:"inline"}),y({targets:this.$photoCaption[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}));var n=0,i=this.originalWidth/this.windowWidth,r=this.originalHeight/this.windowHeight;this.newWidth=0,this.newHeight=0,ri.options.responsiveThreshold,i.$img=i.$el.find("img").first(),i.$img.each(function(){this.complete&&b(this).trigger("load")}),i._updateParallax(),i._setupEventHandlers(),i._setupStyles(),t._parallaxes.push(i),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){t._parallaxes.splice(t._parallaxes.indexOf(this),1),this.$img[0].style.transform="",this._removeEventHandlers(),this.$el[0].M_Parallax=void 0}},{key:"_setupEventHandlers",value:function(){this._handleImageLoadBound=this._handleImageLoad.bind(this),this.$img[0].addEventListener("load",this._handleImageLoadBound),0===t._parallaxes.length&&(t._handleScrollThrottled=M.throttle(t._handleScroll,5),window.addEventListener("scroll",t._handleScrollThrottled),t._handleWindowResizeThrottled=M.throttle(t._handleWindowResize,5),window.addEventListener("resize",t._handleWindowResizeThrottled))}},{key:"_removeEventHandlers",value:function(){this.$img[0].removeEventListener("load",this._handleImageLoadBound),0===t._parallaxes.length&&(window.removeEventListener("scroll",t._handleScrollThrottled),window.removeEventListener("resize",t._handleWindowResizeThrottled))}},{key:"_setupStyles",value:function(){this.$img[0].style.opacity=1}},{key:"_handleImageLoad",value:function(){this._updateParallax()}},{key:"_updateParallax",value:function(){var e=0n.options.responsiveThreshold}}},{key:"defaults",get:function(){return E}}]),t}())._parallaxes=[],M.Parallax=T,M.jQueryLoaded&&M.initializeJqueryWrapper(T,"parallax","M_Parallax"),_=cash,x=M.anime,A={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},S=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Tabs=i).options=_.extend({},t.defaults,n),i.$tabLinks=i.$el.children("li.tab").children("a"),i.index=0,i._setupActiveTabLink(),i.options.swipeable?i._setupSwipeableTabs():i._setupNormalTabs(),i._setTabsAndTabWidth(),i._createIndicator(),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.$el[0].M_Tabs=void 0}},{key:"_setupEventHandlers",value:function(){this._handleWindowResizeBound=this._handleWindowResize.bind(this),window.addEventListener("resize",this._handleWindowResizeBound),this._handleTabClickBound=this._handleTabClick.bind(this),this.el.addEventListener("click",this._handleTabClickBound)}},{key:"_removeEventHandlers",value:function(){window.removeEventListener("resize",this._handleWindowResizeBound),this.el.removeEventListener("click",this._handleTabClickBound)}},{key:"_handleWindowResize",value:function(){this._setTabsAndTabWidth(),0!==this.tabWidth&&0!==this.tabsWidth&&(this._indicator.style.left=this._calcLeftPos(this.$activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this.$activeTabLink)+"px")}},{key:"_handleTabClick",value:function(e){var t=this,n=_(e.target).closest("li.tab"),i=_(e.target).closest("a");if(i.length&&i.parent().hasClass("tab")){if(n.hasClass("disabled"))e.preventDefault();else if(!i.attr("target")){this.$activeTabLink.removeClass("active");var r=this.$content;this.$activeTabLink=i,this.$content=_(M.escapeHash(i[0].hash)),this.$tabLinks=this.$el.children("li.tab").children("a"),this.$activeTabLink.addClass("active");var o=this.index;this.index=Math.max(this.$tabLinks.index(i),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this.index,function(){"function"==typeof t.options.onShow&&t.options.onShow.call(t,t.$content[0])}):this.$content.length&&(this.$content[0].style.display="block",this.$content.addClass("active"),"function"==typeof this.options.onShow&&this.options.onShow.call(this,this.$content[0]),r.length&&!r.is(this.$content)&&(r[0].style.display="none",r.removeClass("active"))),this._setTabsAndTabWidth(),this._animateIndicator(o),e.preventDefault()}}}},{key:"_createIndicator",value:function(){var e=this,t=document.createElement("li");t.classList.add("indicator"),this.el.appendChild(t),this._indicator=t,setTimeout(function(){e._indicator.style.left=e._calcLeftPos(e.$activeTabLink)+"px",e._indicator.style.right=e._calcRightPos(e.$activeTabLink)+"px"},0)}},{key:"_setupActiveTabLink",value:function(){this.$activeTabLink=_(this.$tabLinks.filter('[href="'+location.hash+'"]')),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a.active").first()),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a").first()),this.$tabLinks.removeClass("active"),this.$activeTabLink[0].classList.add("active"),this.index=Math.max(this.$tabLinks.index(this.$activeTabLink),0),this.$activeTabLink.length&&(this.$content=_(M.escapeHash(this.$activeTabLink[0].hash)),this.$content.addClass("active"))}},{key:"_setupSwipeableTabs",value:function(){var e=this;window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);var t=_();this.$tabLinks.each(function(e){var n=_(M.escapeHash(e.hash));n.addClass("carousel-item"),t=t.add(n)});var n=_('');t.first().before(n),n.append(t),t[0].style.display="";var i=this.$activeTabLink.closest(".tab").index();this._tabsCarousel=M.Carousel.init(n[0],{fullWidth:!0,noWrap:!0,onCycleTo:function(t){var n=e.index;e.index=_(t).index(),e.$activeTabLink.removeClass("active"),e.$activeTabLink=e.$tabLinks.eq(e.index),e.$activeTabLink.addClass("active"),e._animateIndicator(n),"function"==typeof e.options.onShow&&e.options.onShow.call(e,e.$content[0])}}),this._tabsCarousel.set(i)}},{key:"_teardownSwipeableTabs",value:function(){var e=this._tabsCarousel.$el;this._tabsCarousel.destroy(),e.after(e.children()),e.remove()}},{key:"_setupNormalTabs",value:function(){this.$tabLinks.not(this.$activeTabLink).each(function(e){if(e.hash){var t=_(M.escapeHash(e.hash));t.length&&(t[0].style.display="none")}})}},{key:"_teardownNormalTabs",value:function(){this.$tabLinks.each(function(e){if(e.hash){var t=_(M.escapeHash(e.hash));t.length&&(t[0].style.display="")}})}},{key:"_setTabsAndTabWidth",value:function(){this.tabsWidth=this.$el.width(),this.tabWidth=Math.max(this.tabsWidth,this.el.scrollWidth)/this.$tabLinks.length}},{key:"_calcRightPos",value:function(e){return Math.ceil(this.tabsWidth-e.position().left-e[0].getBoundingClientRect().width)}},{key:"_calcLeftPos",value:function(e){return Math.floor(e.position().left)}},{key:"updateTabIndicator",value:function(){this._setTabsAndTabWidth(),this._animateIndicator(this.index)}},{key:"_animateIndicator",value:function(e){var t=0,n=0;0<=this.index-e?t=90:n=90;var i={targets:this._indicator,left:{value:this._calcLeftPos(this.$activeTabLink),delay:t},right:{value:this._calcRightPos(this.$activeTabLink),delay:n},duration:this.options.duration,easing:"easeOutQuad"};x.remove(this._indicator),x(i)}},{key:"select",value:function(e){var t=this.$tabLinks.filter('[href="#'+e+'"]');t.length&&t.trigger("click")}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Tabs}},{key:"defaults",get:function(){return A}}]),t}(),M.Tabs=S,M.jQueryLoaded&&M.initializeJqueryWrapper(S,"tabs","M_Tabs"),L=cash,I=M.anime,N={exitDelay:200,enterDelay:0,html:null,margin:5,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10},k=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Tooltip=i).options=L.extend({},t.defaults,n),i.isOpen=!1,i.isHovered=!1,i.isFocused=!1,i._appendTooltipEl(),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){L(this.tooltipEl).remove(),this._removeEventHandlers(),this.el.M_Tooltip=void 0}},{key:"_appendTooltipEl",value:function(){var e=document.createElement("div");e.classList.add("material-tooltip"),this.tooltipEl=e;var t=document.createElement("div");t.classList.add("tooltip-content"),t.innerHTML=this.options.html,e.appendChild(t),document.body.appendChild(e)}},{key:"_updateTooltipContent",value:function(){this.tooltipEl.querySelector(".tooltip-content").innerHTML=this.options.html}},{key:"_setupEventHandlers",value:function(){this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this._handleFocusBound=this._handleFocus.bind(this),this._handleBlurBound=this._handleBlur.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.el.addEventListener("focus",this._handleFocusBound,!0),this.el.addEventListener("blur",this._handleBlurBound,!0)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.el.removeEventListener("focus",this._handleFocusBound,!0),this.el.removeEventListener("blur",this._handleBlurBound,!0)}},{key:"open",value:function(e){this.isOpen||(e=void 0===e||void 0,this.isOpen=!0,this.options=L.extend({},this.options,this._getAttributeOptions()),this._updateTooltipContent(),this._setEnterDelayTimeout(e))}},{key:"close",value:function(){this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this._setExitDelayTimeout())}},{key:"_setExitDelayTimeout",value:function(){var e=this;clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(function(){e.isHovered||e.isFocused||e._animateOut()},this.options.exitDelay)}},{key:"_setEnterDelayTimeout",value:function(e){var t=this;clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(function(){(t.isHovered||t.isFocused||e)&&t._animateIn()},this.options.enterDelay)}},{key:"_positionTooltip",value:function(){var e,t=this.el,n=this.tooltipEl,i=t.offsetHeight,r=t.offsetWidth,o=n.offsetHeight,s=n.offsetWidth,a=this.options.margin,l=void 0,u=void 0;this.xMovement=0,this.yMovement=0,l=t.getBoundingClientRect().top+M.getDocumentScrollTop(),u=t.getBoundingClientRect().left+M.getDocumentScrollLeft(),"top"===this.options.position?(l+=-o-a,u+=r/2-s/2,this.yMovement=-this.options.transitionMovement):"right"===this.options.position?(l+=i/2-o/2,u+=r+a,this.xMovement=this.options.transitionMovement):"left"===this.options.position?(l+=i/2-o/2,u+=-s-a,this.xMovement=-this.options.transitionMovement):(l+=i+a,u+=r/2-s/2,this.yMovement=this.options.transitionMovement),e=this._repositionWithinScreen(u,l,s,o),L(n).css({top:e.y+"px",left:e.x+"px"})}},{key:"_repositionWithinScreen",value:function(e,t,n,i){var r=M.getDocumentScrollLeft(),o=M.getDocumentScrollTop(),s=e-r,a=t-o,l={left:s,top:a,width:n,height:i},u=this.options.margin+this.options.transitionMovement,c=M.checkWithinContainer(document.body,l,u);return c.left?s=u:c.right&&(s-=s+n-window.innerWidth),c.top?a=u:c.bottom&&(a-=a+i-window.innerHeight),{x:s+r,y:a+o}}},{key:"_animateIn",value:function(){this._positionTooltip(),this.tooltipEl.style.visibility="visible",I.remove(this.tooltipEl),I({targets:this.tooltipEl,opacity:1,translateX:this.xMovement,translateY:this.yMovement,duration:this.options.inDuration,easing:"easeOutCubic"})}},{key:"_animateOut",value:function(){I.remove(this.tooltipEl),I({targets:this.tooltipEl,opacity:0,translateX:0,translateY:0,duration:this.options.outDuration,easing:"easeOutCubic"})}},{key:"_handleMouseEnter",value:function(){this.isHovered=!0,this.isFocused=!1,this.open(!1)}},{key:"_handleMouseLeave",value:function(){this.isHovered=!1,this.isFocused=!1,this.close()}},{key:"_handleFocus",value:function(){M.tabPressed&&(this.isFocused=!0,this.open(!1))}},{key:"_handleBlur",value:function(){this.isFocused=!1,this.close()}},{key:"_getAttributeOptions",value:function(){var e={},t=this.el.getAttribute("data-tooltip"),n=this.el.getAttribute("data-position");return t&&(e.html=t),n&&(e.position=n),e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Tooltip}},{key:"defaults",get:function(){return N}}]),t}(),M.Tooltip=k,M.jQueryLoaded&&M.initializeJqueryWrapper(k,"tooltip","M_Tooltip"),function(e){"use strict";var t=t||{},n=document.querySelectorAll.bind(document);function i(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+=n+":"+e[n]+";");return t}var r={duration:750,show:function(e,t){if(2===e.button)return!1;var n=t||this,o=document.createElement("div");o.className="waves-ripple",n.appendChild(o);var s,a,l,u,c=(l={top:0,left:0},s=(u=n&&n.ownerDocument).documentElement,void 0!==n.getBoundingClientRect&&(l=n.getBoundingClientRect()),a=null!==u&&u===u.window?u:9===u.nodeType&&u.defaultView,{top:l.top+a.pageYOffset-s.clientTop,left:l.left+a.pageXOffset-s.clientLeft}),d=e.pageY-c.top,h=e.pageX-c.left,p="scale("+n.clientWidth/100*10+")";"touches"in e&&(d=e.touches[0].pageY-c.top,h=e.touches[0].pageX-c.left),o.setAttribute("data-hold",Date.now()),o.setAttribute("data-scale",p),o.setAttribute("data-x",h),o.setAttribute("data-y",d);var f={top:d+"px",left:h+"px"};o.className=o.className+" waves-notransition",o.setAttribute("style",i(f)),o.className=o.className.replace("waves-notransition",""),f["-webkit-transform"]=p,f["-moz-transform"]=p,f["-ms-transform"]=p,f["-o-transform"]=p,f.transform=p,f.opacity="1",f["-webkit-transition-duration"]=r.duration+"ms",f["-moz-transition-duration"]=r.duration+"ms",f["-o-transition-duration"]=r.duration+"ms",f["transition-duration"]=r.duration+"ms",f["-webkit-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-moz-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-o-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",o.setAttribute("style",i(f))},hide:function(e){o.touchup(e);var t=this,n=(t.clientWidth,null),s=t.getElementsByClassName("waves-ripple");if(!(0t.el.offsetWidth*t.options.activationPercent||1"+o+""+s+""+a+""),n.length&&t.prepend(n)}},{key:"_resetCurrentElement",value:function(){this.activeIndex=-1,this.$active.removeClass("active")}},{key:"_resetAutocomplete",value:function(){H(this.container).empty(),this._resetCurrentElement(),this.oldVal=null,this.isOpen=!1,this._mousedown=!1}},{key:"selectOption",value:function(e){var t=e.text().trim();this.el.value=t,this.$el.trigger("change"),this._resetAutocomplete(),this.close(),"function"==typeof this.options.onAutocomplete&&this.options.onAutocomplete.call(this,t)}},{key:"_renderDropdown",value:function(e,t){var n=this;this._resetAutocomplete();var i=[];for(var r in e)if(e.hasOwnProperty(r)&&-1!==r.toLowerCase().indexOf(t)){if(this.count>=this.options.limit)break;var o={data:e[r],key:r};i.push(o),this.count++}this.options.sortFunction&&i.sort(function(e,i){return n.options.sortFunction(e.key.toLowerCase(),i.key.toLowerCase(),t.toLowerCase())});for(var s=0;s");a.data?l.append(''+a.key+""):l.append(""+a.key+""),H(this.container).append(l),this._highlight(t,l)}}},{key:"open",value:function(){var e=this.el.value.toLowerCase();this._resetAutocomplete(),e.length>=this.options.minLength&&(this.isOpen=!0,this._renderDropdown(this.options.data,e)),this.dropdown.isOpen?this.dropdown.recalculateDimensions():this.dropdown.open()}},{key:"close",value:function(){this.dropdown.close()}},{key:"updateData",value:function(e){var t=this.el.value.toLowerCase();this.options.data=e,this.isOpen&&this._renderDropdown(e,t)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Autocomplete}},{key:"defaults",get:function(){return Q}}]),t}())._keydown=!1,M.Autocomplete=V,M.jQueryLoaded&&M.initializeJqueryWrapper(V,"autocomplete","M_Autocomplete"),G=cash,M.updateTextFields=function(){G("input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea").each(function(e,t){var n=G(this);0'),G("body").append(t));var n=e.css("font-family"),i=e.css("font-size"),r=e.css("line-height"),o=e.css("padding-top"),s=e.css("padding-right"),a=e.css("padding-bottom"),l=e.css("padding-left");i&&t.css("font-size",i),n&&t.css("font-family",n),r&&t.css("line-height",r),o&&t.css("padding-top",o),s&&t.css("padding-right",s),a&&t.css("padding-bottom",a),l&&t.css("padding-left",l),e.data("original-height")||e.data("original-height",e.height()),"off"===e.attr("wrap")&&t.css("overflow-wrap","normal").css("white-space","pre"),t.text(e[0].value+"\n");var u=t.html().replace(/\n/g,"
");t.html(u),0'),this.$slides.each(function(t,n){var i=K('
  • ');e.$indicators.append(i[0])}),this.$el.append(this.$indicators[0]),this.$indicators=this.$indicators.children("li.indicator-item"))}},{key:"_removeIndicators",value:function(){this.$el.find("ul.indicators").remove()}},{key:"set",value:function(e){var t=this;if(e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.activeIndex!=e){this.$active=this.$slides.eq(this.activeIndex);var n=this.$active.find(".caption");this.$active.removeClass("active"),q({targets:this.$active[0],opacity:0,duration:this.options.duration,easing:"easeOutQuad",complete:function(){t.$slides.not(".active").each(function(e){q({targets:e,opacity:0,translateX:0,translateY:0,duration:0,easing:"easeOutQuad"})})}}),this._animateCaptionIn(n[0],this.options.duration),this.options.indicators&&(this.$indicators.eq(this.activeIndex).removeClass("active"),this.$indicators.eq(e).addClass("active")),q({targets:this.$slides.eq(e)[0],opacity:1,duration:this.options.duration,easing:"easeOutQuad"}),q({targets:this.$slides.eq(e).find(".caption")[0],opacity:1,translateX:0,translateY:0,duration:this.options.duration,delay:this.options.duration,easing:"easeOutQuad"}),this.$slides.eq(e).addClass("active"),this.activeIndex=e,this.start()}}},{key:"pause",value:function(){clearInterval(this.interval)}},{key:"start",value:function(){clearInterval(this.interval),this.interval=setInterval(this._handleIntervalBound,this.options.duration+this.options.interval)}},{key:"next",value:function(){var e=this.activeIndex+1;e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.set(e)}},{key:"prev",value:function(){var e=this.activeIndex-1;e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.set(e)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Slider}},{key:"defaults",get:function(){return Z}}]),t}(),M.Slider=X,M.jQueryLoaded&&M.initializeJqueryWrapper(X,"slider","M_Slider"),function(e,t){e(document).on("click",".card",function(n){if(e(this).children(".card-reveal").length){var i=e(n.target).closest(".card");void 0===i.data("initialOverflow")&&i.data("initialOverflow",void 0===i.css("overflow")?"":i.css("overflow"));var r=e(this).find(".card-reveal");e(n.target).is(e(".card-reveal .card-title"))||e(n.target).is(e(".card-reveal .card-title i"))?t({targets:r[0],translateY:0,duration:225,easing:"easeInOutQuad",complete:function(t){e(t.animatables[0].target).css({display:"none"}),i.css("overflow",i.data("initialOverflow"))}}):(e(n.target).is(e(".card .activator"))||e(n.target).is(e(".card .activator i")))&&(i.css("overflow","hidden"),r.css({display:"block"}),t({targets:r[0],translateY:"-100%",duration:300,easing:"easeInOutQuad"}))}})}(cash,M.anime),J=cash,ee={data:[],placeholder:"",secondaryPlaceholder:"",autocompleteOptions:{},limit:1/0,onChipAdd:null,onChipSelect:null,onChipDelete:null},(et=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Chips=i).options=J.extend({},t.defaults,n),i.$el.addClass("chips input-field"),i.chipsData=[],i.$chips=J(),i._setupInput(),i.hasAutocomplete=0"),this.$el.append(this.$input)),this.$input.addClass("input")}},{key:"_setupLabel",value:function(){this.$label=this.$el.find("label"),this.$label.length&&this.$label.setAttribute("for",this.$input.attr("id"))}},{key:"_setPlaceholder",value:function(){void 0!==this.chipsData&&!this.chipsData.length&&this.options.placeholder?J(this.$input).prop("placeholder",this.options.placeholder):(void 0===this.chipsData||this.chipsData.length)&&this.options.secondaryPlaceholder&&J(this.$input).prop("placeholder",this.options.secondaryPlaceholder)}},{key:"_isValid",value:function(e){if(e.hasOwnProperty("tag")&&""!==e.tag){for(var t=!1,n=0;n=this.options.limit)){var t=this._renderChip(e);this.$chips.add(t),this.chipsData.push(e),J(this.$input).before(t),this._setPlaceholder(),"function"==typeof this.options.onChipAdd&&this.options.onChipAdd.call(this,this.$el,t)}}},{key:"deleteChip",value:function(e){var t=this.$chips.eq(e);this.$chips.eq(e).remove(),this.$chips=this.$chips.filter(function(e){return 0<=J(e).index()}),this.chipsData.splice(e,1),this._setPlaceholder(),"function"==typeof this.options.onChipDelete&&this.options.onChipDelete.call(this,this.$el,t[0])}},{key:"selectChip",value:function(e){var t=this.$chips.eq(e);(this._selectedChip=t)[0].focus(),"function"==typeof this.options.onChipSelect&&this.options.onChipSelect.call(this,this.$el,t[0])}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Chips}},{key:"_handleChipsKeydown",value:function(e){t._keydown=!0;var n=J(e.target).closest(".chips"),i=e.target&&n.length;if(!J(e.target).is("input, textarea")&&i){var r=n[0].M_Chips;if(8===e.keyCode||46===e.keyCode){e.preventDefault();var o=r.chipsData.length;if(r._selectedChip){var s=r._selectedChip.index();r.deleteChip(s),r._selectedChip=null,o=Math.max(s-1,0)}r.chipsData.length&&r.selectChip(o)}else if(37===e.keyCode){if(r._selectedChip){var a=r._selectedChip.index()-1;if(a<0)return;r.selectChip(a)}}else if(39===e.keyCode&&r._selectedChip){var l=r._selectedChip.index()+1;l>=r.chipsData.length?r.$input[0].focus():r.selectChip(l)}}}},{key:"_handleChipsKeyup",value:function(e){t._keydown=!1}},{key:"_handleChipsBlur",value:function(e){t._keydown||(J(e.target).closest(".chips")[0].M_Chips._selectedChip=null)}},{key:"defaults",get:function(){return ee}}]),t}())._keydown=!1,M.Chips=et,M.jQueryLoaded&&M.initializeJqueryWrapper(et,"chips","M_Chips"),J(document).ready(function(){J(document.body).on("click",".chip .close",function(){var e=J(this).closest(".chips");e.length&&e[0].M_Chips||J(this).closest(".chip").remove()})}),en=cash,ei={top:0,bottom:1/0,offset:0,onPositionChange:null},(er=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Pushpin=i).options=en.extend({},t.defaults,n),i.originalOffset=i.el.offsetTop,t._pushpins.push(i),i._setupEventHandlers(),i._updatePosition(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this.el.style.top=null,this._removePinClasses(),this._removeEventHandlers();var e=t._pushpins.indexOf(this);t._pushpins.splice(e,1)}},{key:"_setupEventHandlers",value:function(){document.addEventListener("scroll",t._updateElements)}},{key:"_removeEventHandlers",value:function(){document.removeEventListener("scroll",t._updateElements)}},{key:"_updatePosition",value:function(){var e=M.getDocumentScrollTop()+this.options.offset;this.options.top<=e&&this.options.bottom>=e&&!this.el.classList.contains("pinned")&&(this._removePinClasses(),this.el.style.top=this.options.offset+"px",this.el.classList.add("pinned"),"function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pinned")),ethis.options.bottom&&!this.el.classList.contains("pin-bottom")&&(this._removePinClasses(),this.el.classList.add("pin-bottom"),this.el.style.top=this.options.bottom-this.originalOffset+"px","function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pin-bottom"))}},{key:"_removePinClasses",value:function(){this.el.classList.remove("pin-top"),this.el.classList.remove("pinned"),this.el.classList.remove("pin-bottom")}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Pushpin}},{key:"_updateElements",value:function(){for(var e in t._pushpins)t._pushpins[e]._updatePosition()}},{key:"defaults",get:function(){return ei}}]),t}())._pushpins=[],M.Pushpin=er,M.jQueryLoaded&&M.initializeJqueryWrapper(er,"pushpin","M_Pushpin"),eo=cash,es=M.anime,ea={direction:"top",hoverEnabled:!0,toolbarEnabled:!1},eo.fn.reverse=[].reverse,el=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_FloatingActionButton=i).options=eo.extend({},t.defaults,n),i.isOpen=!1,i.$anchor=i.$el.children("a").first(),i.$menu=i.$el.children("ul").first(),i.$floatingBtns=i.$el.find("ul .btn-floating"),i.$floatingBtnsReverse=i.$el.find("ul .btn-floating").reverse(),i.offsetY=0,i.offsetX=0,i.$el.addClass("direction-"+i.options.direction),"top"===i.options.direction?i.offsetY=40:"right"===i.options.direction?i.offsetX=-40:"bottom"===i.options.direction?i.offsetY=-40:i.offsetX=40,i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_FloatingActionButton=void 0}},{key:"_setupEventHandlers",value:function(){this._handleFABClickBound=this._handleFABClick.bind(this),this._handleOpenBound=this.open.bind(this),this._handleCloseBound=this.close.bind(this),this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.addEventListener("mouseenter",this._handleOpenBound),this.el.addEventListener("mouseleave",this._handleCloseBound)):this.el.addEventListener("click",this._handleFABClickBound)}},{key:"_removeEventHandlers",value:function(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.removeEventListener("mouseenter",this._handleOpenBound),this.el.removeEventListener("mouseleave",this._handleCloseBound)):this.el.removeEventListener("click",this._handleFABClickBound)}},{key:"_handleFABClick",value:function(){this.isOpen?this.close():this.open()}},{key:"_handleDocumentClick",value:function(e){eo(e.target).closest(this.$menu).length||this.close()}},{key:"open",value:function(){this.isOpen||(this.options.toolbarEnabled?this._animateInToolbar():this._animateInFAB(),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.options.toolbarEnabled?(window.removeEventListener("scroll",this._handleCloseBound,!0),document.body.removeEventListener("click",this._handleDocumentClickBound,!0),this._animateOutToolbar()):this._animateOutFAB(),this.isOpen=!1)}},{key:"_animateInFAB",value:function(){var e=this;this.$el.addClass("active");var t=0;this.$floatingBtnsReverse.each(function(n){es({targets:n,opacity:1,scale:[.4,1],translateY:[e.offsetY,0],translateX:[e.offsetX,0],duration:275,delay:t,easing:"easeInOutQuad"}),t+=40})}},{key:"_animateOutFAB",value:function(){var e=this;this.$floatingBtnsReverse.each(function(t){es.remove(t),es({targets:t,opacity:0,scale:.4,translateY:e.offsetY,translateX:e.offsetX,duration:175,easing:"easeOutQuad",complete:function(){e.$el.removeClass("active")}})})}},{key:"_animateInToolbar",value:function(){var e,t=this,n=window.innerWidth,i=window.innerHeight,r=this.el.getBoundingClientRect(),o=eo('
    '),s=this.$anchor.css("background-color");this.$anchor.append(o),this.offsetX=r.left-n/2+r.width/2,this.offsetY=i-r.bottom,e=n/o[0].clientWidth,this.btnBottom=r.bottom,this.btnLeft=r.left,this.btnWidth=r.width,this.$el.addClass("active"),this.$el.css({"text-align":"center",width:"100%",bottom:0,left:0,transform:"translateX("+this.offsetX+"px)",transition:"none"}),this.$anchor.css({transform:"translateY("+-this.offsetY+"px)",transition:"none"}),o.css({"background-color":s}),setTimeout(function(){t.$el.css({transform:"",transition:"transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s"}),t.$anchor.css({overflow:"visible",transform:"",transition:"transform .2s"}),setTimeout(function(){t.$el.css({overflow:"hidden","background-color":s}),o.css({transform:"scale("+e+")",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"}),t.$menu.children("li").children("a").css({opacity:1}),t._handleDocumentClickBound=t._handleDocumentClick.bind(t),window.addEventListener("scroll",t._handleCloseBound,!0),document.body.addEventListener("click",t._handleDocumentClickBound,!0)},100)},0)}},{key:"_animateOutToolbar",value:function(){var e=this,t=window.innerWidth,n=window.innerHeight,i=this.$el.find(".fab-backdrop"),r=this.$anchor.css("background-color");this.offsetX=this.btnLeft-t/2+this.btnWidth/2,this.offsetY=n-this.btnBottom,this.$el.removeClass("active"),this.$el.css({"background-color":"transparent",transition:"none"}),this.$anchor.css({transition:"none"}),i.css({transform:"scale(0)","background-color":r}),this.$menu.children("li").children("a").css({opacity:""}),setTimeout(function(){i.remove(),e.$el.css({"text-align":"",width:"",bottom:"",left:"",overflow:"","background-color":"",transform:"translate3d("+-e.offsetX+"px,0,0)"}),e.$anchor.css({overflow:"",transform:"translate3d(0,"+e.offsetY+"px,0)"}),setTimeout(function(){e.$el.css({transform:"translate3d(0,0,0)",transition:"transform .2s"}),e.$anchor.css({transform:"translate3d(0,0,0)",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"})},20)},200)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_FloatingActionButton}},{key:"defaults",get:function(){return ea}}]),t}(),M.FloatingActionButton=el,M.jQueryLoaded&&M.initializeJqueryWrapper(el,"floatingActionButton","M_FloatingActionButton"),eu=cash,ec={autoClose:!1,format:"mmm dd, yyyy",parse:null,defaultDate:null,setDefaultDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,container:null,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"‹",nextMonth:"›",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},(ed=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));(i.el.M_Datepicker=i).options=eu.extend({},t.defaults,n),n&&n.hasOwnProperty("i18n")&&"object"==typeof n.i18n&&(i.options.i18n=eu.extend({},t.defaults.i18n,n.i18n)),i.options.minDate&&i.options.minDate.setHours(0,0,0,0),i.options.maxDate&&i.options.maxDate.setHours(0,0,0,0),i.id=M.guid(),i._setupVariables(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupEventHandlers(),i.options.defaultDate||(i.options.defaultDate=new Date(Date.parse(i.el.value)));var r=i.options.defaultDate;return t._isDate(r)?i.options.setDefaultDate?(i.setDate(r,!0),i.setInputValue()):i.gotoDate(r):i.gotoDate(new Date),i.isOpen=!1,i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),eu(this.modalEl).remove(),this.destroySelects(),this.el.M_Datepicker=void 0}},{key:"destroySelects",value:function(){var e=this.calendarEl.querySelector(".orig-select-year");e&&M.FormSelect.getInstance(e).destroy();var t=this.calendarEl.querySelector(".orig-select-month");t&&M.FormSelect.getInstance(t).destroy()}},{key:"_insertHTMLIntoDOM",value:function(){this.options.showClearBtn&&(eu(this.clearBtn).css({visibility:""}),this.clearBtn.innerHTML=this.options.i18n.clear),this.doneBtn.innerHTML=this.options.i18n.done,this.cancelBtn.innerHTML=this.options.i18n.cancel,this.options.container?this.$modalEl.appendTo(this.options.container):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var e=this;this.modalEl.id="modal-"+this.id,this.modal=M.Modal.init(this.modalEl,{onCloseEnd:function(){e.isOpen=!1}})}},{key:"toString",value:function(e){var n=this;return e=e||this.options.format,t._isDate(this.date)?e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(function(e){return n.formats[e]?n.formats[e]():e}).join(""):""}},{key:"setDate",value:function(e,n){if(!e)return this.date=null,this._renderDateDisplay(),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),t._isDate(e)){var i=this.options.minDate,r=this.options.maxDate;t._isDate(i)&&er.maxDate||r.disableWeekends&&t._isWeekend(b)||r.disableDayFn&&r.disableDayFn(b),isEmpty:x,isStartRange:I,isEndRange:N,isInRange:k,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};u.push(this.renderDay(D)),7==++w&&(l.push(this.renderRow(u,r.isRTL,y)),w=0,u=[],y=!1)}return this.renderTable(r,l,i)}},{key:"renderDay",value:function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"}},{key:"renderRow",value:function(e,t,n){return''+(t?e.reverse():e).join("")+""}},{key:"renderTable",value:function(e,t,n){return'
    '+this.renderHead(e)+this.renderBody(t)+"
    "}},{key:"renderHead",value:function(e){var t=void 0,n=[];for(t=0;t<7;t++)n.push(''+this.renderDayName(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""}},{key:"renderBody",value:function(e){return""+e.join("")+""}},{key:"renderTitle",value:function(e,t,n,i,r,o){var s,a,l=void 0,u=void 0,c=void 0,d=this.options,h=n===d.minYear,p=n===d.maxYear,f='
    ',m=!0,g=!0;for(c=[],l=0;l<12;l++)c.push('");for(s='",eu.isArray(d.yearRange)?(l=d.yearRange[0],u=d.yearRange[1]+1):(l=n-d.yearRange,u=1+n+d.yearRange),c=[];l=d.minYear&&c.push('");return a='",f+='
    ',d.showMonthAfterYear?f+=a+s:f+=s+a,f+="
    ",h&&(0===i||d.minMonth>=i)&&(m=!1),p&&(11===i||d.maxMonth<=i)&&(g=!1),(f+='')+"
    "}},{key:"draw",value:function(e){if(this.isOpen||e){var t,n=this.options,i=n.minYear,r=n.maxYear,o=n.minMonth,s=n.maxMonth,a="";this._y<=i&&(this._y=i,!isNaN(o)&&this._m=r&&(this._y=r,!isNaN(s)&&this._m>s&&(this._m=s)),t="datepicker-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var l=0;l<1;l++)this._renderDateDisplay(),a+=this.renderTitle(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,t)+this.render(this.calendars[l].year,this.calendars[l].month,t);this.destroySelects(),this.calendarEl.innerHTML=a;var u=this.calendarEl.querySelector(".orig-select-year"),c=this.calendarEl.querySelector(".orig-select-month");M.FormSelect.init(u,{classes:"select-year",dropdownOptions:{container:document.body,constrainWidth:!1}}),M.FormSelect.init(c,{classes:"select-month",dropdownOptions:{container:document.body,constrainWidth:!1}}),u.addEventListener("change",this._handleYearChange.bind(this)),c.addEventListener("change",this._handleMonthChange.bind(this)),"function"==typeof this.options.onDraw&&this.options.onDraw(this)}}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleInputChangeBound=this._handleInputChange.bind(this),this._handleCalendarClickBound=this._handleCalendarClick.bind(this),this._finishSelectionBound=this._finishSelection.bind(this),this._handleMonthChange=this._handleMonthChange.bind(this),this._closeBound=this.close.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.el.addEventListener("change",this._handleInputChangeBound),this.calendarEl.addEventListener("click",this._handleCalendarClickBound),this.doneBtn.addEventListener("click",this._finishSelectionBound),this.cancelBtn.addEventListener("click",this._closeBound),this.options.showClearBtn&&(this._handleClearClickBound=this._handleClearClick.bind(this),this.clearBtn.addEventListener("click",this._handleClearClickBound))}},{key:"_setupVariables",value:function(){var e=this;this.$modalEl=eu(t._template),this.modalEl=this.$modalEl[0],this.calendarEl=this.modalEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.modalEl.querySelector(".year-text"),this.dateTextEl=this.modalEl.querySelector(".date-text"),this.options.showClearBtn&&(this.clearBtn=this.modalEl.querySelector(".datepicker-clear")),this.doneBtn=this.modalEl.querySelector(".datepicker-done"),this.cancelBtn=this.modalEl.querySelector(".datepicker-cancel"),this.formats={d:function(){return e.date.getDate()},dd:function(){var t=e.date.getDate();return(t<10?"0":"")+t},ddd:function(){return e.options.i18n.weekdaysShort[e.date.getDay()]},dddd:function(){return e.options.i18n.weekdays[e.date.getDay()]},m:function(){return e.date.getMonth()+1},mm:function(){var t=e.date.getMonth()+1;return(t<10?"0":"")+t},mmm:function(){return e.options.i18n.monthsShort[e.date.getMonth()]},mmmm:function(){return e.options.i18n.months[e.date.getMonth()]},yy:function(){return(""+e.date.getFullYear()).slice(2)},yyyy:function(){return e.date.getFullYear()}}}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound),this.el.removeEventListener("change",this._handleInputChangeBound),this.calendarEl.removeEventListener("click",this._handleCalendarClickBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(e){e.which===M.keys.ENTER&&(e.preventDefault(),this.open())}},{key:"_handleCalendarClick",value:function(e){if(this.isOpen){var t=eu(e.target);t.hasClass("is-disabled")||(!t.hasClass("datepicker-day-button")||t.hasClass("is-empty")||t.parent().hasClass("is-disabled")?t.closest(".month-prev").length?this.prevMonth():t.closest(".month-next").length&&this.nextMonth():(this.setDate(new Date(e.target.getAttribute("data-year"),e.target.getAttribute("data-month"),e.target.getAttribute("data-day"))),this.options.autoClose&&this._finishSelection()))}}},{key:"_handleClearClick",value:function(){this.date=null,this.setInputValue(),this.close()}},{key:"_handleMonthChange",value:function(e){this.gotoMonth(e.target.value)}},{key:"_handleYearChange",value:function(e){this.gotoYear(e.target.value)}},{key:"gotoMonth",value:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())}},{key:"gotoYear",value:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())}},{key:"_handleInputChange",value:function(e){var n=void 0;e.firedBy!==this&&(n=this.options.parse?this.options.parse(this.el.value,this.options.format):new Date(Date.parse(this.el.value)),t._isDate(n)&&this.setDate(n))}},{key:"renderDayName",value:function(e,t,n){for(t+=e.firstDay;7<=t;)t-=7;return n?e.i18n.weekdaysAbbrev[t]:e.i18n.weekdays[t]}},{key:"_finishSelection",value:function(){this.setInputValue(),this.close()}},{key:"open",value:function(){if(!this.isOpen)return this.isOpen=!0,"function"==typeof this.options.onOpen&&this.options.onOpen.call(this),this.draw(),this.modal.open(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,"function"==typeof this.options.onClose&&this.options.onClose.call(this),this.modal.close(),this}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"_isDate",value:function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())}},{key:"_isWeekend",value:function(e){var t=e.getDay();return 0===t||6===t}},{key:"_setToStartOfDay",value:function(e){t._isDate(e)&&e.setHours(0,0,0,0)}},{key:"_getDaysInMonth",value:function(e,n){return[31,t._isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][n]}},{key:"_isLeapYear",value:function(e){return e%4==0&&e%100!=0||e%400==0}},{key:"_compareDates",value:function(e,t){return e.getTime()===t.getTime()}},{key:"_setToStartOfDay",value:function(e){t._isDate(e)&&e.setHours(0,0,0,0)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Datepicker}},{key:"defaults",get:function(){return ec}}]),t}())._template='',M.Datepicker=ed,M.jQueryLoaded&&M.initializeJqueryWrapper(ed,"datepicker","M_Datepicker"),eh=cash,ep={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},autoClose:!1,twelveHour:!0,vibrate:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onSelect:null},(ef=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Timepicker=i).options=eh.extend({},t.defaults,n),i.id=M.guid(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupVariables(),i._setupEventHandlers(),i._clockSetup(),i._pickerSetup(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),eh(this.modalEl).remove(),this.el.M_Timepicker=void 0}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleClockClickStartBound=this._handleClockClickStart.bind(this),this._handleDocumentClickMoveBound=this._handleDocumentClickMove.bind(this),this._handleDocumentClickEndBound=this._handleDocumentClickEnd.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.plate.addEventListener("mousedown",this._handleClockClickStartBound),this.plate.addEventListener("touchstart",this._handleClockClickStartBound),eh(this.spanHours).on("click",this.showView.bind(this,"hours")),eh(this.spanMinutes).on("click",this.showView.bind(this,"minutes"))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(e){e.which===M.keys.ENTER&&(e.preventDefault(),this.open())}},{key:"_handleClockClickStart",value:function(e){e.preventDefault();var n=this.plate.getBoundingClientRect(),i=n.left,r=n.top;this.x0=i+this.options.dialRadius,this.y0=r+this.options.dialRadius,this.moved=!1;var o=t._Pos(e);this.dx=o.x-this.x0,this.dy=o.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("mousemove",this._handleDocumentClickMoveBound),document.addEventListener("touchmove",this._handleDocumentClickMoveBound),document.addEventListener("mouseup",this._handleDocumentClickEndBound),document.addEventListener("touchend",this._handleDocumentClickEndBound)}},{key:"_handleDocumentClickMove",value:function(e){e.preventDefault();var n=t._Pos(e),i=n.x-this.x0,r=n.y-this.y0;this.moved=!0,this.setHand(i,r,!1,!0)}},{key:"_handleDocumentClickEnd",value:function(e){var n=this;e.preventDefault(),document.removeEventListener("mouseup",this._handleDocumentClickEndBound),document.removeEventListener("touchend",this._handleDocumentClickEndBound);var i=t._Pos(e),r=i.x-this.x0,o=i.y-this.y0;this.moved&&r===this.dx&&o===this.dy&&this.setHand(r,o),"hours"===this.currentView?this.showView("minutes",this.options.duration/2):this.options.autoClose&&(eh(this.minutesView).addClass("timepicker-dial-out"),setTimeout(function(){n.done()},this.options.duration/2)),"function"==typeof this.options.onSelect&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("mousemove",this._handleDocumentClickMoveBound),document.removeEventListener("touchmove",this._handleDocumentClickMoveBound)}},{key:"_insertHTMLIntoDOM",value:function(){this.$modalEl=eh(t._template),this.modalEl=this.$modalEl[0],this.modalEl.id="modal-"+this.id;var e=document.querySelector(this.options.container);this.options.container&&e?this.$modalEl.appendTo(e):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var e=this;this.modal=M.Modal.init(this.modalEl,{onOpenStart:this.options.onOpenStart,onOpenEnd:this.options.onOpenEnd,onCloseStart:this.options.onCloseStart,onCloseEnd:function(){"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e),e.isOpen=!1}})}},{key:"_setupVariables",value:function(){this.currentView="hours",this.vibrate=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,this._canvas=this.modalEl.querySelector(".timepicker-canvas"),this.plate=this.modalEl.querySelector(".timepicker-plate"),this.hoursView=this.modalEl.querySelector(".timepicker-hours"),this.minutesView=this.modalEl.querySelector(".timepicker-minutes"),this.spanHours=this.modalEl.querySelector(".timepicker-span-hours"),this.spanMinutes=this.modalEl.querySelector(".timepicker-span-minutes"),this.spanAmPm=this.modalEl.querySelector(".timepicker-span-am-pm"),this.footer=this.modalEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}},{key:"_pickerSetup",value:function(){var e=eh('").appendTo(this.footer).on("click",this.clear.bind(this));this.options.showClearBtn&&e.css({visibility:""});var t=eh('
    ');eh('").appendTo(t).on("click",this.close.bind(this)),eh('").appendTo(t).on("click",this.done.bind(this)),t.appendTo(this.footer)}},{key:"_clockSetup",value:function(){this.options.twelveHour&&(this.$amBtn=eh('
    AM
    '),this.$pmBtn=eh('
    PM
    '),this.$amBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm),this.$pmBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}},{key:"_buildSVGClock",value:function(){var e=this.options.dialRadius,n=this.options.tickRadius,i=2*e,r=t._createSVGEl("svg");r.setAttribute("class","timepicker-svg"),r.setAttribute("width",i),r.setAttribute("height",i);var o=t._createSVGEl("g");o.setAttribute("transform","translate("+e+","+e+")");var s=t._createSVGEl("circle");s.setAttribute("class","timepicker-canvas-bearing"),s.setAttribute("cx",0),s.setAttribute("cy",0),s.setAttribute("r",4);var a=t._createSVGEl("line");a.setAttribute("x1",0),a.setAttribute("y1",0);var l=t._createSVGEl("circle");l.setAttribute("class","timepicker-canvas-bg"),l.setAttribute("r",n),o.appendChild(a),o.appendChild(l),o.appendChild(s),r.appendChild(o),this._canvas.appendChild(r),this.hand=a,this.bg=l,this.bearing=s,this.g=o}},{key:"_buildHoursView",value:function(){var e=eh('
    ');if(this.options.twelveHour)for(var t=1;t<13;t+=1){var n=e.clone(),i=t/6*Math.PI,r=this.options.outerRadius;n.css({left:this.options.dialRadius+Math.sin(i)*r-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(i)*r-this.options.tickRadius+"px"}),n.html(0===t?"00":t),this.hoursView.appendChild(n[0])}else for(var o=0;o<24;o+=1){var s=e.clone(),a=o/6*Math.PI,l=0'),n=0;n<60;n+=5){var i=e.clone(),r=n/30*Math.PI;i.css({left:this.options.dialRadius+Math.sin(r)*this.options.outerRadius-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(r)*this.options.outerRadius-this.options.tickRadius+"px"}),i.html(t._addLeadingZero(n)),this.minutesView.appendChild(i[0])}}},{key:"_handleAmPmClick",value:function(e){var t=eh(e.target);this.amOrPm=t.hasClass("am-btn")?"AM":"PM",this._updateAmPmView()}},{key:"_updateAmPmView",value:function(){this.options.twelveHour&&(this.$amBtn.toggleClass("text-primary","AM"===this.amOrPm),this.$pmBtn.toggleClass("text-primary","PM"===this.amOrPm))}},{key:"_updateTimeFromInput",value:function(){var e=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&void 0!==e[1]&&(0'),i.$el.find(".carousel-item").each(function(e,t){if(i.images.push(e),i.showIndicators){var n=ev('
  • ');0===t&&n[0].classList.add("active"),i.$indicators.append(n)}}),i.showIndicators&&i.$el.append(i.$indicators),i.count=i.images.length,i.options.numVisible=Math.min(i.count,i.options.numVisible),i.xform="transform",["webkit","Moz","O","ms"].every(function(e){var t=e+"Transform";return void 0===document.body.style[t]||(i.xform=t,!1)}),i._setupEventHandlers(),i._scroll(i.offset),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Carousel=void 0}},{key:"_setupEventHandlers",value:function(){var e=this;this._handleCarouselTapBound=this._handleCarouselTap.bind(this),this._handleCarouselDragBound=this._handleCarouselDrag.bind(this),this._handleCarouselReleaseBound=this._handleCarouselRelease.bind(this),this._handleCarouselClickBound=this._handleCarouselClick.bind(this),void 0!==window.ontouchstart&&(this.el.addEventListener("touchstart",this._handleCarouselTapBound),this.el.addEventListener("touchmove",this._handleCarouselDragBound),this.el.addEventListener("touchend",this._handleCarouselReleaseBound)),this.el.addEventListener("mousedown",this._handleCarouselTapBound),this.el.addEventListener("mousemove",this._handleCarouselDragBound),this.el.addEventListener("mouseup",this._handleCarouselReleaseBound),this.el.addEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.addEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&(this._handleIndicatorClickBound=this._handleIndicatorClick.bind(this),this.$indicators.find(".indicator-item").each(function(t,n){t.addEventListener("click",e._handleIndicatorClickBound)}));var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){var e=this;void 0!==window.ontouchstart&&(this.el.removeEventListener("touchstart",this._handleCarouselTapBound),this.el.removeEventListener("touchmove",this._handleCarouselDragBound),this.el.removeEventListener("touchend",this._handleCarouselReleaseBound)),this.el.removeEventListener("mousedown",this._handleCarouselTapBound),this.el.removeEventListener("mousemove",this._handleCarouselDragBound),this.el.removeEventListener("mouseup",this._handleCarouselReleaseBound),this.el.removeEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.removeEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&this.$indicators.find(".indicator-item").each(function(t,n){t.removeEventListener("click",e._handleIndicatorClickBound)}),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleCarouselTap",value:function(e){"mousedown"===e.type&&ev(e.target).is("img")&&e.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(e),this.referenceY=this._ypos(e),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._trackBound,100)}},{key:"_handleCarouselDrag",value:function(e){var t=void 0,n=void 0,i=void 0;if(this.pressed){if(t=this._xpos(e),n=this._ypos(e),i=this.reference-t,30>Math.abs(this.referenceY-n)&&!this.verticalDragged)(2=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScrollBound),this.dragged&&(e.preventDefault(),e.stopPropagation()),!1}},{key:"_handleCarouselClick",value:function(e){if(this.dragged)return e.preventDefault(),e.stopPropagation(),!1;if(!this.options.fullWidth){var t=ev(e.target).closest(".carousel-item").index();0!=this._wrap(this.center)-t&&(e.preventDefault(),e.stopPropagation()),this._cycleTo(t)}}},{key:"_handleIndicatorClick",value:function(e){e.stopPropagation();var t=ev(e.target).closest(".indicator-item");t.length&&this._cycleTo(t.index())}},{key:"_handleResize",value:function(e){this.options.fullWidth?(this.itemWidth=this.$el.find(".carousel-item").first().innerWidth(),this.imageHeight=this.$el.find(".carousel-item.active").height(),this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()}},{key:"_setCarouselHeight",value:function(e){var t=this,n=this.$el.find(".carousel-item.active").length?this.$el.find(".carousel-item.active").first():this.$el.find(".carousel-item").first(),i=n.find("img").first();if(i.length){if(i[0].complete){var r=i.height();if(0=this.count?e%this.count:e<0?this._wrap(this.count+e%this.count):e}},{key:"_track",value:function(){var e,t,n,i;t=(e=Date.now())-this.timestamp,this.timestamp=e,n=this.offset-this.frame,this.frame=this.offset,i=1e3*n/(1+t),this.velocity=.8*i+.2*this.velocity}},{key:"_autoScroll",value:function(){var e=void 0,t=void 0;this.amplitude&&(e=Date.now()-this.timestamp,2<(t=this.amplitude*Math.exp(-e/this.options.duration))||t<-2?(this._scroll(this.target-t),requestAnimationFrame(this._autoScrollBound)):this._scroll(this.target))}},{key:"_scroll",value:function(e){var t=this;this.$el.hasClass("scrolling")||this.el.classList.add("scrolling"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout(function(){t.$el.removeClass("scrolling")},this.options.duration);var n,i,r,o,s=void 0,a=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=this.center,p=1/this.options.numVisible;if(this.offset="number"==typeof e?e:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),o=-(r=(i=this.offset-this.center*this.dim)<0?1:-1)*i*2/this.dim,n=this.count>>1,this.options.fullWidth?(l="translateX(0)",d=1):(l="translateX("+(this.el.clientWidth-this.itemWidth)/2+"px) "+("translateY("+(this.el.clientHeight-this.itemHeight)/2+"px)"),d=1-p*o),this.showIndicators){var f=this.center%this.count,m=this.$indicators.find(".indicator-item.active");m.index()!==f&&(m.removeClass("active"),this.$indicators.find(".indicator-item").eq(f)[0].classList.add("active"))}if(!this.noWrap||0<=this.center&&this.center=this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t)}},{key:"prev",value:function(e){(void 0===e||isNaN(e))&&(e=1);var t=this.center-e;if(t>=this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t)}},{key:"set",value:function(e,t){if((void 0===e||isNaN(e))&&(e=0),e>this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e,t)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Carousel}},{key:"defaults",get:function(){return ew}}]),t}(),M.Carousel=eb,M.jQueryLoaded&&M.initializeJqueryWrapper(eb,"carousel","M_Carousel"),eM=cash,eE={onOpen:void 0,onClose:void 0},eT=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_TapTarget=i).options=eM.extend({},t.defaults,n),i.isOpen=!1,i.$origin=eM("#"+i.$el.attr("data-target")),i._setup(),i._calculatePositioning(),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.TapTarget=void 0}},{key:"_setupEventHandlers",value:function(){this._handleDocumentClickBound=this._handleDocumentClick.bind(this),this._handleTargetClickBound=this._handleTargetClick.bind(this),this._handleOriginClickBound=this._handleOriginClick.bind(this),this.el.addEventListener("click",this._handleTargetClickBound),this.originEl.addEventListener("click",this._handleOriginClickBound);var e=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=e.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleTargetClickBound),this.originEl.removeEventListener("click",this._handleOriginClickBound),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleTargetClick",value:function(e){this.open()}},{key:"_handleOriginClick",value:function(e){this.close()}},{key:"_handleResize",value:function(e){this._calculatePositioning()}},{key:"_handleDocumentClick",value:function(e){eM(e.target).closest(".tap-target-wrapper").length||(this.close(),e.preventDefault(),e.stopPropagation())}},{key:"_setup",value:function(){this.wrapper=this.$el.parent()[0],this.waveEl=eM(this.wrapper).find(".tap-target-wave")[0],this.originEl=eM(this.wrapper).find(".tap-target-origin")[0],this.contentEl=this.$el.find(".tap-target-content")[0],eM(this.wrapper).hasClass(".tap-target-wrapper")||(this.wrapper=document.createElement("div"),this.wrapper.classList.add("tap-target-wrapper"),this.$el.before(eM(this.wrapper)),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.classList.add("tap-target-content"),this.$el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement("div"),this.waveEl.classList.add("tap-target-wave"),this.originEl||(this.originEl=this.$origin.clone(!0,!0),this.originEl.addClass("tap-target-origin"),this.originEl.removeAttr("id"),this.originEl.removeAttr("style"),this.originEl=this.originEl[0],this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}},{key:"_calculatePositioning",value:function(){var e="fixed"===this.$origin.css("position");if(!e)for(var t=this.$origin.parents(),n=0;n'+t.getAttribute("label")+"")[0]),i.each(function(t){var n=e._appendOptionWithIcon(e.$el,t,"optgroup-option");e._addOptionToValueDict(t,n)})}}),this.$el.after(this.dropdownOptions),this.input=document.createElement("input"),e_(this.input).addClass("select-dropdown dropdown-trigger"),this.input.setAttribute("type","text"),this.input.setAttribute("readonly","true"),this.input.setAttribute("data-target",this.dropdownOptions.id),this.el.disabled&&e_(this.input).prop("disabled","true"),this.$el.before(this.input),this._setValueToInput();var t=e_('');if(this.$el.before(t[0]),!this.el.disabled){var n=e_.extend({},this.options.dropdownOptions);n.onOpenEnd=function(t){var n=e_(e.dropdownOptions).find(".selected").first();if(n.length&&(M.keyDown=!0,e.dropdown.focusedIndex=n.index(),e.dropdown._focusFocusedItem(),M.keyDown=!1,e.dropdown.isScrollable)){var i=n[0].getBoundingClientRect().top-e.dropdownOptions.getBoundingClientRect().top;i-=e.dropdownOptions.clientHeight/2,e.dropdownOptions.scrollTop=i}},this.isMultiple&&(n.closeOnClick=!1),this.dropdown=M.Dropdown.init(this.input,n)}this._setSelectedStates()}},{key:"_addOptionToValueDict",value:function(e,t){var n=Object.keys(this._valueDict).length,i=this.dropdownOptions.id+n,r={};t.id=i,r.el=e,r.optionEl=t,this._valueDict[i]=r}},{key:"_removeDropdown",value:function(){e_(this.wrapper).find(".caret").remove(),e_(this.input).remove(),e_(this.dropdownOptions).remove(),e_(this.wrapper).before(this.$el),e_(this.wrapper).remove()}},{key:"_appendOptionWithIcon",value:function(e,t,n){var i=t.disabled?"disabled ":"",r=this.isMultiple?'":t.innerHTML,o=e_("
  • "),s=e_("");s.html(r),o.addClass(i+" "+("optgroup-option"===n?"optgroup-option ":"")),o.append(s);var a=t.getAttribute("data-icon");if(a){var l=e_('');o.prepend(l)}return e_(this.dropdownOptions).append(o[0]),o[0]}},{key:"_toggleEntryFromArray",value:function(e){var t=!this._keysSelected.hasOwnProperty(e),n=e_(this._valueDict[e].optionEl);return t?this._keysSelected[e]=!0:delete this._keysSelected[e],n.toggleClass("selected",t),n.find('input[type="checkbox"]').prop("checked",t),n.prop("selected",t),t}},{key:"_setValueToInput",value:function(){var e=[];if(this.$el.find("option").each(function(t){if(e_(t).prop("selected")){var n=e_(t).text();e.push(n)}}),!e.length){var t=this.$el.find("option:disabled").eq(0);t.length&&""===t[0].value&&e.push(t.text())}this.input.value=e.join(", ")}},{key:"_setSelectedStates",value:function(){for(var e in this._keysSelected={},this._valueDict){var t=this._valueDict[e],n=e_(t.el).prop("selected");e_(t.optionEl).find('input[type="checkbox"]').prop("checked",n),n?(this._activateOption(e_(this.dropdownOptions),e_(t.optionEl)),this._keysSelected[e]=!0):e_(t.optionEl).removeClass("selected")}}},{key:"_activateOption",value:function(e,t){t&&(this.isMultiple||e.find("li.selected").removeClass("selected"),e_(t).addClass("selected"))}},{key:"getSelectedValues",value:function(){var e=[];for(var t in this._keysSelected)e.push(this._valueDict[t].el.value);return e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_FormSelect}},{key:"defaults",get:function(){return ex}}]),t}(),M.FormSelect=eA,M.jQueryLoaded&&M.initializeJqueryWrapper(eA,"formSelect","M_FormSelect"),eS=cash,eL=M.anime,eI={},eN=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Range=i).options=eS.extend({},t.defaults,n),i._mousedown=!1,i._setupThumb(),i._setupEventHandlers(),i}return ej(t,eR),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}},{key:"_setupEventHandlers",value:function(){this._handleRangeChangeBound=this._handleRangeChange.bind(this),this._handleRangeMousedownTouchstartBound=this._handleRangeMousedownTouchstart.bind(this),this._handleRangeInputMousemoveTouchmoveBound=this._handleRangeInputMousemoveTouchmove.bind(this),this._handleRangeMouseupTouchendBound=this._handleRangeMouseupTouchend.bind(this),this._handleRangeBlurMouseoutTouchleaveBound=this._handleRangeBlurMouseoutTouchleave.bind(this),this.el.addEventListener("change",this._handleRangeChangeBound),this.el.addEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.addEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.addEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("change",this._handleRangeChangeBound),this.el.removeEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_handleRangeChange",value:function(){eS(this.value).html(this.$el.val()),eS(this.thumb).hasClass("active")||this._showRangeBubble();var e=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",e+"px")}},{key:"_handleRangeMousedownTouchstart",value:function(e){if(eS(this.value).html(this.$el.val()),this._mousedown=!0,this.$el.addClass("active"),eS(this.thumb).hasClass("active")||this._showRangeBubble(),"input"!==e.type){var t=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",t+"px")}}},{key:"_handleRangeInputMousemoveTouchmove",value:function(){if(this._mousedown){eS(this.thumb).hasClass("active")||this._showRangeBubble();var e=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",e+"px"),eS(this.value).html(this.$el.val())}}},{key:"_handleRangeMouseupTouchend",value:function(){this._mousedown=!1,this.$el.removeClass("active")}},{key:"_handleRangeBlurMouseoutTouchleave",value:function(){if(!this._mousedown){var e=7+parseInt(this.$el.css("padding-left"))+"px";eS(this.thumb).hasClass("active")&&(eL.remove(this.thumb),eL({targets:this.thumb,height:0,width:0,top:10,easing:"easeOutQuad",marginLeft:e,duration:100})),eS(this.thumb).removeClass("active")}}},{key:"_setupThumb",value:function(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),eS(this.thumb).addClass("thumb"),eS(this.value).addClass("value"),eS(this.thumb).append(this.value),this.$el.after(this.thumb)}},{key:"_removeThumb",value:function(){eS(this.thumb).remove()}},{key:"_showRangeBubble",value:function(){var e=-7+parseInt(eS(this.thumb).parent().css("padding-left"))+"px";eL.remove(this.thumb),eL({targets:this.thumb,height:30,width:30,top:-30,marginLeft:e,duration:300,easing:"easeOutQuint"})}},{key:"_calcRangeOffset",value:function(){var e=this.$el.width()-15,t=parseFloat(this.$el.attr("max"))||100,n=parseFloat(this.$el.attr("min"))||0;return(parseFloat(this.$el.val())-n)/(t-n)*e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Range}},{key:"defaults",get:function(){return eI}}]),t}(),M.Range=eN,M.jQueryLoaded&&M.initializeJqueryWrapper(eN,"range","M_Range"),eN.init(eS("input[type=range]"))},363:function(e,t,n){"use strict";t.meiosisSetup=void 0;var i=n(977);Object.defineProperty(t,"meiosisSetup",{enumerable:!0,get:function(){return i.meiosisSetup}})},977:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.meiosisSetup=void 0;let r=n(125),o=n(264),s=i(n(388)),a=(e,t,n)=>(n[e]=t,n),l=(e,t)=>t?e.concat(t):e,u=e=>e?Object.keys(e).reduce((t,n)=>a(n,Object.assign({},e[n].initial,u(e[n].nested)),t),{}):{},c=e=>Object.assign({},e.initial,u(e.nested)),d=e=>e?Object.keys(e).reduce((t,n)=>{let i=e[n];if(void 0!==i.view){let e=i.view;return a(n,{view:(t,...i)=>e(t.nest(n),...i),nested:d(i.nested)},t)}return t},{}):{},h=e=>d(e.nested),p=(e,t=e=>e,n=e=>e)=>e?Object.keys(e).reduce((i,r)=>{var o;let s=e=>t(e).nest(r),a=e=>n(e)[r],u=e[r];return l(i,null===(o=u.services)||void 0===o?void 0:o.map(e=>({onchange:t=>e.onchange?e.onchange(a(t)):t,run:t=>e.run(s(t))}))).concat(p(u.nested,s,a))},[]):[],f=e=>l([],e.services).concat(p(e.nested)),m=({stream:e,app:t})=>{!e&&(e=r.simpleStream);let n=t||{},i=c(n),o=h(n),a="function"==typeof e?e:e.stream,l=e.scan,u=a();return{states:l((e,t)=>(0,s.default)(e,t),i,u),update:u,view:o}},g=(e,t)=>({[t]:e}),y=(e,t)=>n=>e(g(n,t)),v=(e,t,n)=>i=>{let r=e.map(e=>e[i]),s=()=>e()[i],a=y(t,i),l=(0,o.get)(n,[i,"nested"]);return{states:r,state:s(),getState:s,update:a,nest:v(r,a,l),nested:l}};t.meiosisSetup=e=>{let t=null==e?void 0:e.stream,n=null==e?void 0:e.app,{states:i,update:o,view:s}=m({stream:t,app:n}),a=v(i,o,s),l=()=>i(),u=e=>({states:i,state:e,getState:l,update:o,nest:a,nested:s}),c=(0,r.createDropRepeats)(t);return n&&f(n).forEach(e=>{c(i,e.onchange).map(t=>e.run(u(t)))}),c(i).map(u)}},125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dropRepeats=t.createDropRepeats=t.simpleStream=t.scan=t.stream=void 0;t.stream=e=>{let n=[],i=e,r=function(e){if(arguments.length>0&&!r.ended)for(let t in i=e,n)n[t](i);return i};return r.map=e=>{let r=(0,t.stream)(),o=t=>{r(e(t))};return n.push(o),r.end=e=>{let t=n.indexOf(o);r.ended=!0,n.splice(t,1)},void 0!==i&&r(e(i)),r},r.end=e=>{r.ended=!0},r};t.scan=(e,n,i)=>{let r=(0,t.stream)(n),o=n;return i.map(t=>{r(o=e(o,t))}),r},t.simpleStream={stream:t.stream,scan:t.scan};t.createDropRepeats=(e=t.simpleStream)=>(t,n=e=>e)=>{let i;let r=("function"==typeof e?e:e.stream)();return t.map(e=>{let t=n(e);t!==i&&(i=t,r(e))}),r},t.dropRepeats=(0,t.createDropRepeats)()},264:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateFormFloatValue=t.updateFormIntValue=t.updateFormValue=t.get=void 0;t.get=(e,t)=>t.reduce((e,t)=>void 0==e?void 0:e[t],e);let n=(e,t)=>({[e[0]]:1===e.length?t:n(e.slice(1),t)}),i=e=>Array.isArray(e)?e:[e],r=(e,t,r)=>o=>{let s=e(o.currentTarget.value);!isNaN(s)&&t.update(n(i(r),s))};t.updateFormValue=(e,t,r=e=>e)=>o=>e.update(n(i(t),r(o.currentTarget.value)));t.updateFormIntValue=(e,t)=>n=>r(parseInt,e,t)(n);t.updateFormFloatValue=(e,t)=>n=>r(parseFloat,e,t)(n)},388:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});let i=Object.assign||((e,t)=>(t&&Object.keys(t).forEach(n=>e[n]=t[n]),e)),r=(e,t,n)=>{let i=typeof n;if(n&&"object"===i){if(Array.isArray(n))for(let i of n)t=r(e,t,i);else for(let i of Object.keys(n)){let s=n[i];"function"==typeof s?t[i]=s(t[i],o):void 0===s?e&&!isNaN(i)?t.splice(i,1):delete t[i]:null===s||"object"!=typeof s||Array.isArray(s)?t[i]=s:"object"==typeof t[i]?t[i]=s===t[i]?s:o(t[i],s):t[i]=r(!1,{},s)}}else"function"===i&&(t=n(t,o));return t},o=(e,...t)=>{let n=Array.isArray(e);return r(n,n?e.slice():i({},e),t)},s=o},862:function(e,t,n){"use strict";var i=n(230);e.exports=function(e,t,n){var r=[],o=!1,s=-1;function a(){for(s=0;s=0&&(r.splice(o,2),o<=s&&(s-=2),e(t,[])),null!=n&&(r.push(t,n),e(t,i(n),l))},redraw:l}}},236:function(e,t,n){"use strict";var i=n(230),r=n(326),o=n(31),s=n(578),a=n(376),l=n(819),u=n(427),c=n(750),d={};function h(e){try{return decodeURIComponent(e)}catch(t){return e}}e.exports=function(e,t){var n=null==e?null:"function"==typeof e.setImmediate?e.setImmediate:e.setTimeout,p=o.resolve(),f=!1,m=!1,g=0,y,v,w,b,E,T,_=d,x={onbeforeupdate:function(){return!(!(g=g?2:1)||d===_)},onremove:function(){e.removeEventListener("popstate",L,!1),e.removeEventListener("hashchange",S,!1)},view:function(){if(g&&d!==_){var e=[i(w,b.key,b)];return _&&(e=_.render(e[0])),e}}},A=N.SKIP={};function S(){f=!1;var n=e.location.hash;"#"!==N.prefix[0]&&(n=e.location.search+n,"?"!==N.prefix[0]&&"/"!==(n=e.location.pathname+n)[0]&&(n="/"+n));var i=n.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,h).slice(N.prefix.length),r=a(i);function o(e){console.error(e),I(v,null,{replace:!0})}u(r.params,e.history.state),function e(n){for(;n=0&&(m+=e.slice(n,s)),d>=0&&(m+=(n<0?"?":"&")+c.slice(d,p));var g=i(u);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=e.slice(o)),h>=0&&(m+=(o<0?"":"&")+c.slice(h)),m}},819:function(e,t,n){"use strict";var i=n(376);e.exports=function(e){var t=i(e),n=Object.keys(t.params),r=[],o=RegExp("^"+t.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(r.push({k:t,r:"..."===n}),"..."===n)?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||"")})+"$");return function(e){for(var i=0;i1&&"/"===s[s.length-1]&&(s=s.slice(0,-1))):s="/",{path:s,params:t<0?{}:i(e.slice(t+1,r))}}},657:function(e){"use strict";var t=function(e){if(!(this instanceof t))throw Error("Promise must be called with 'new'.");if("function"!=typeof e)throw TypeError("executor must be a function.");var n=this,i=[],r=[],o=u(i,!0),s=u(r,!1),a=n._instance={resolvers:i,rejectors:r},l="function"==typeof setImmediate?setImmediate:setTimeout;function u(e,t){return function o(u){var d;try{if(t&&null!=u&&("object"==typeof u||"function"==typeof u)&&"function"==typeof(d=u.then)){if(u===n)throw TypeError("Promise can't be resolved with itself.");c(d.bind(u))}else l(function(){!t&&0===e.length&&console.error("Possible unhandled promise rejection:",u);for(var n=0;n0)&&e(n)}}var i=n(s);try{e(n(o),i)}catch(e){i(e)}}c(e)};t.prototype.then=function(e,n){var i,r,o=this._instance;function s(e,t,n,s){t.push(function(t){if("function"!=typeof e)n(t);else try{i(e(t))}catch(e){r&&r(e)}}),"function"==typeof o.retry&&s===o.state&&o.retry()}var a=new t(function(e,t){i=e,r=t});return s(e,o.resolvers,i,!0),s(n,o.rejectors,r,!1),a},t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(e){return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},t.resolve=function(e){return e instanceof t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.all=function(e){return new t(function(t,n){var i=e.length,r=0,o=[];if(0===e.length)t([]);else for(var s=0;s-1&&u.pop();for(var d=0;d0&&(r.className=i.join(" ")),a[e]={tag:n,attrs:r}}(e),t):(t.tag=e,t)}},933:function(e,t,n){"use strict";var i=n(230);e.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:("object"!=typeof t||null!=t.tag||Array.isArray(t))&&(t={},n=this),arguments.length===n+1)e=arguments[n],!Array.isArray(e)&&(e=[e]);else for(e=[];n'+t.children+"",a=a.firstChild):a.innerHTML=t.children,t.dom=a.firstChild,t.domSize=a.childNodes.length,t.instance=[];for(var l=r.createDocumentFragment();o=a.firstChild;)t.instance.push(o),l.appendChild(o);w(e,l,i)}function f(e,t,n,i,r,o){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)c(e,n,0,n.length,i,r,o);else if(null==n||0===n.length)E(e,t,0,t.length);else{var s=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,l=0,u=0;if(!s)for(;u=u&&A>=l&&(w=t[x],b=n[A],w.key===b.key);){;w!==b&&m(e,w,b,i,r,o),null!=b.dom&&(r=b.dom),x--,A--}for(;x>=u&&A>=l&&(p=t[u],f=n[l],p.key===f.key);){;u++,l++,p!==f&&m(e,p,f,i,y(t,u,r),o)}for(;x>=u&&A>=l&&l!==A&&p.key===b.key&&w.key===f.key;){;v(e,w,_=y(t,u,r)),w!==f&&m(e,w,f,i,_,o),++l<=--A&&v(e,p,r),p!==b&&m(e,p,b,i,r,o),null!=b.dom&&(r=b.dom),u++,w=t[--x],b=n[A],p=t[u],f=n[l]}for(;x>=u&&A>=l&&w.key===b.key;){;w!==b&&m(e,w,b,i,r,o),null!=b.dom&&(r=b.dom),x--,A--,w=t[x],b=n[A]}if(l>A)E(e,t,u,x+1);else if(u>x)c(e,n,l,A+1,i,r,o);else{var h,S,L=r,I=A-l+1,N=Array(I),k=0,D=0,C=2147483647,j=0;for(D=0;D=l;D--){null==h&&(h=function(e,t,n){for(var i=Object.create(null);t>>1)+(i>>>1)+(n&i&1);e[t[a]]0&&(g[r]=t[n-1]),t[n]=r)}for(n=t.length,i=t[n-1];n-- >0;)t[n]=i,i=g[i];return g.length=0,t}(N)).length-1,D=A;D>=l;D--)f=n[D],-1===N[D-l]?d(e,f,i,o,r):S[k]===D-l?k--:v(e,f,r),null!=f.dom&&(r=n[D].dom);else for(D=A;D>=l;D--)f=n[D],-1===N[D-l]&&d(e,f,i,o,r),null!=f.dom&&(r=n[D].dom)}}else{var R=t.lengthR&&E(e,t,l,t.length),n.length>R&&c(e,n,l,n.length,i,r,o)}}}function m(e,t,n,r,o,a){var c=t.tag;if(c===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate){var n=l.call(e.attrs.onbeforeupdate,e,t);if(void 0!==n&&!n)break}if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate){var n=l.call(e.state.onbeforeupdate,e,t);if(void 0!==n&&!n)break}return!1}while(!1);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof c)switch(null!=n.attrs&&z(n.attrs,n,r),c){case"#":(function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children),t.dom=e.dom})(t,n);break;case"<":(function(e,t,n,i,r){t.children!==n.children?(_(e,t),p(e,n,i,r)):(n.dom=t.dom,n.domSize=t.domSize,n.instance=t.instance)})(e,t,n,a,o);break;case"[":(function(e,t,n,i,r,o){f(e,t.children,n.children,i,r,o);var s=0,a=n.children;if(n.dom=null,null!=a){for(var l=0;l-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var N=/[A-Z]/g;function k(e){return"-"+e.toLowerCase()}function D(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(N,k)}function C(e,t,n){if(t===n);else if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var i in e.style.cssText="",n){var r=n[i];null!=r&&e.style.setProperty(D(i),String(r))}else{for(var i in n){var r=n[i];null!=r&&(r=String(r))!==String(t[i])&&e.style.setProperty(D(i),r)}for(var i in t)null!=t[i]&&null==n[i]&&e.style.removeProperty(D(i))}}function j(){this._=t}function O(e,n,i){null!=e.events?(e.events._=t,e.events[n]!==i&&(null!=i&&("function"==typeof i||"object"==typeof i)?(null==e.events[n]&&e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i):(null!=e.events[n]&&e.dom.removeEventListener(n.slice(2),e.events,!1),e.events[n]=void 0))):null!=i&&("function"==typeof i||"object"==typeof i)&&(e.events=new j,e.dom.addEventListener(n.slice(2),e.events,!1),e.events[n]=i)}function R(e,t,n){"function"==typeof e.oninit&&l.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(l.bind(e.oncreate,t))}function z(e,t,n){"function"==typeof e.onupdate&&n.push(l.bind(e.onupdate,t))}return j.prototype=Object.create(null),j.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,r,o){if(!e)throw TypeError("DOM element being rendered to does not exist.");if(null!=n&&e.contains(n))throw TypeError("Node is currently being rendered to and thus is locked.");var s=t,a=n,l=[],c=u(),d=e.namespaceURI;n=e,t="function"==typeof o?o:void 0;try{null==e.vnodes&&(e.textContent=""),r=i.normalizeChildren(Array.isArray(r)?r:[r]),f(e,e.vnodes,r,l,null,"http://www.w3.org/1999/xhtml"===d?void 0:d),e.vnodes=r,null!=c&&u()!==c&&"function"==typeof c.focus&&c.focus();for(var h=0;h=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(t),a=e.target.response;if("json"===c){if(!e.target.responseType&&"function"!=typeof n.extract)try{a=JSON.parse(e.target.responseText)}catch(e){a=null}}else(!c||"text"===c)&&null==a&&(a=e.target.responseText);if("function"==typeof n.extract?(a=n.extract(e.target,n),s=!0):"function"==typeof n.deserialize&&(a=n.deserialize(a)),s)i(a);else{var l=function(){try{r=e.target.responseText}catch(e){r=a}var t=Error(r);t.code=e.target.status,t.response=a,o(t)};0===d.status?setTimeout(function(){!p&&l()}):l()}}catch(e){o(e)}},d.ontimeout=function(e){p=!0;var t=Error("Request timed out");t.code=e.target.status,o(t)},"function"==typeof n.config&&(d=n.config(d,n,t)||d)!==m&&(f=d.abort,d.abort=function(){h=!0,f.call(this)}),null==a?d.send():"function"==typeof n.serialize?d.send(n.serialize(a)):a instanceof e.FormData||a instanceof e.URLSearchParams?d.send(a):d.send(JSON.stringify(a))}),jsonp:a(function(t,n,i,r){var s=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+o++,a=e.document.createElement("script");e[s]=function(t){delete e[s],a.parentNode.removeChild(a),i(t)},a.onerror=function(){delete e[s],a.parentNode.removeChild(a),r(Error("JSONP request failed"))},a.src=t+(0>t.indexOf("?")?"?":"&")+encodeURIComponent(n.callbackKey||"callback")+"="+encodeURIComponent(s),e.document.documentElement.appendChild(a)})}}},483:function(e,t,n){"use strict";var i=n(10);e.exports=n(236)("undefined"!=typeof window?window:null,i)},427:function(e,t,n){"use strict";var i=n(729);e.exports=Object.assign||function(e,t){for(var n in t)i.call(t,n)&&(e[n]=t[n])}},750:function(e,t,n){"use strict";var i=n(729),r=RegExp("^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$");e.exports=function(e,t){var n={};if(null!=t)for(var o in e)i.call(e,o)&&!r.test(o)&&0>t.indexOf(o)&&(n[o]=e[o]);else for(var o in e)i.call(e,o)&&!r.test(o)&&(n[o]=e[o]);return n}},729:function(e){"use strict";e.exports=({}).hasOwnProperty},512:function(e,t){var n;function i(e){return 1!==e?"p":"s"}t.plural_EN=i},949:function(e){"use strict";e.exports="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23949ba3' viewBox='0 0 16 16'%3E%3Cpath d='M8 13.1l-8-8 2.1-2.2 5.9 5.9 5.9-5.9 2.1 2.2z'/%3E%3C/svg%3E"},876:function(e,t,n){"use strict";e.exports=n.p+"4d73cb90e394b34b7670.woff"},550:function(e,t,n){"use strict";e.exports=n.p+"0c35d18bf06992036b69.woff2"},718:function(e,t,n){"use strict";var i,r,o,s,a,l,u,c,d,h,p,f,m,g,y,v,w,b,E,T,_,x,A,S,L,I,N,k,D,C,j,O,R,z,P,B,U,F,Y,W,H,Q,V,G,K,q,Z,X,J,ee,et,en,ei,er,eo,es,ea,el,eu,ec,ed,eh,ep,ef,em,eg,ey,ev,ew,eb,eM,eE,eT,e_,ex,eA,eS,eL,eI,eN,ek,eD,eC,ej,eO,eR,ez,eP,eB,eU,eF,eY,e$,eW,eH,eQ,eV,eG,eK,eq,eZ,eX,eJ,e0,e1,e2,e4,e3,e5,e6,e8,e9,e7,te,tt,tn,ti,tr,to=n("898"),ts=n.n(to);n("473"),n("514"),n("142"),n("784"),(i=x||(x={})).LANDING="LANDING",i.LOGIN="LOGIN",i.HOME="HOME",i.CRIME_SCRIPT="CRIME_SCRIPT",i.SETTINGS="SETTINGS",i.ABOUT="ABOUT",i.CASE="CASE";var ta=n("363");let tl=()=>"idxxxxxxxx".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),tu=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),tc=e=>t=>Array.prototype.map.call(t,e),td=e=>t=>Array.prototype.join.call(t,e),th=e=>e.replace(/([A-Z])/g,e=>"-"+e.toLowerCase()),tp=e=>e?tu(td(""),tc(t=>`[${th(t)}="${((e="")=>e.toString().replace(/"/g,"""))(e[t])}"]`),Object.keys)(e):"",tf=["min","max","minLength","maxLength","rows","cols","placeholder","autocomplete","pattern","readOnly","step"],tm=e=>tf.indexOf(e)>=0,tg=({disabled:e})=>e?"[disabled]":"",ty=({required:e,isMandatory:t})=>e||t?"[required][aria-required=true]":"",tv=e=>{let t;return(e=>Object.keys(e).filter(tm).filter(t=>void 0!==e[t]).reduce((t,n)=>{let i=e[n];return t.push(`[${n.toLowerCase()}=${i}]`),t},[]).join(""))(e)+((t=e).maxLength?`[data-length=${t.maxLength}]`:"")+tg(e)+ty(e)+(({autofocus:e})=>"boolean"==typeof e&&e||e&&e()?"[autofocus]":"")(e)},tw=e=>!isNaN(parseFloat(e))&&isFinite(e),tb=(e,t=2,n="0")=>(e+="").length>=t?e:Array(t-e.length+1).join(n)+e;function tM(){return(tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}let tT=["label","id","isMandatory","isActive"],t_={view:({attrs:e})=>ts()("span.mandatory",e,"*")},tx=()=>({view:e=>{let{attrs:{label:t,id:n,isMandatory:i,isActive:r}}=e,o=tE(e.attrs,tT);return t?ts()(`label${r?".active":""}${n?`[for=${n}]`:""}`,o,[ts().trust(t),i?ts()(t_):void 0]):void 0}}),tA=()=>({view:({attrs:{helperText:e,dataError:t,dataSuccess:n,className:i}})=>e||t||n?ts()("span.helper-text",{className:i,dataError:t,dataSuccess:n},e?ts().trust(e):""):void 0}),tS=["iconName"],tL=()=>({view:e=>{let{attrs:{iconName:t}}=e,n=tE(e.attrs,tS);return ts()("i.material-icons",n,t)}}),tI=["modalId","tooltip","tooltipPostion","iconName","iconClass","label","attr"],tN=(e,t="")=>()=>{let n=`${e}${t}`;return{view:({attrs:e})=>{let{modalId:t,tooltip:i,tooltipPostion:r,iconName:o,iconClass:s,label:a,attr:l}=e,u=tE(e,tI);return ts()(`${n}${t?`.modal-trigger[href=#${t}]`:""}${i?`.tooltipped[data-position=${r||"top"}][data-tooltip=${i}]`:""}${tp(l)}`,u,o?ts()(tL,{iconName:o,className:s||"left"}):void 0,a||void 0)}}},tk=(tN("a.waves-effect.waves-light.btn","[type=button]"),tN("a.waves-effect.waves-light.btn-large","[type=button]"),tN("a.waves-effect.waves-light.btn-small","[type=button]"),tN("a.waves-effect.waves-teal.btn-flat","[type=button]")),tD=(tN("button.btn-floating.btn-large.waves-effect.waves-light","[type=button]"),tN("button.btn.waves-effect.waves-light","[type=submit]"),()=>({oncreate:({attrs:e,dom:t})=>{let{onchange:n,onChipAdd:i,onChipDelete:r}=e,o=M.Chips.getInstance(t.children[0]),s=i?i.bind(o):void 0;e.onChipAdd=function(e,t){n&&n(this.chipsData),s&&s(e,t)};let a=r?r.bind(o):void 0;e.onChipDelete=function(e,t){n&&n(this.chipsData),a&&a(e,t)},M.Chips.init(t.children[0],e)},onupdate:({dom:e,attrs:{data:t}})=>{if(!t||0===t.length)return;let n=M.Chips.getInstance(e.children[0]);t.forEach(e=>n.addChip(e))},view:({attrs:{placeholder:e,required:t,isMandatory:n=t,data:i,className:r="col s12",label:o,helperText:s}})=>ts()(".input-field",{className:r},[ts()(`.chips.chips-autocomplete${e?".chips-placeholder":""}${i?".chips-initial":""}`),o?ts()(tx,{label:o,isMandatory:n,className:"active"}):void 0,s?ts()(tA,{helperText:s}):void 0])})),tC=()=>({view:({attrs:{header:e,body:t,active:n,iconName:i}})=>ts()(n?"li.active":"li",[e||i?ts()(".collapsible-header",[i?ts()("i.material-icons",i):void 0,e?"string"==typeof e?ts()("span",e):e:void 0]):void 0,t?ts()(".collapsible-body",t):void 0])}),tj=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:e})=>{let{items:t,class:n,className:i,style:r,id:o}=e;return t&&t.length>0?ts()("ul.collapsible",{class:n||i,style:r,id:o},t.map(e=>ts()(tC,e))):void 0}});(r=A||(A={}))[r.BASIC=0]="BASIC",r[r.LINKS=1]="LINKS",r[r.AVATAR=2]="AVATAR";let tO=["className","helperText","iconName","id","initialValue","isMandatory","label","onchange","onkeydown","onkeypress","onkeyup","onblur","style"],tR=["className","dataError","dataSuccess","helperText","iconName","id","initialValue","isMandatory","label","maxLength","newRow","onchange","onkeydown","onkeypress","onkeyup","onblur","style","validate"],tz=()=>{let e={id:tl()};return{view:({attrs:t})=>{let{className:n="col s12",helperText:i,iconName:r,id:o=e.id,initialValue:s,isMandatory:a,label:l,onchange:u,onkeydown:c,onkeypress:d,onkeyup:h,onblur:p,style:f}=t,m=tv(tE(t,tO));return ts()(".input-field",{className:n,style:f},[r?ts()("i.material-icons.prefix",r):"",ts()(`textarea.materialize-textarea[tabindex=0][id=${o}]${m}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),t.maxLength&&M.CharacterCounter.init(e)},onchange:u?e=>{let t=e.target;u(t&&"string"==typeof t.value?t.value:"")}:void 0,value:s,onkeyup:h?e=>{h(e,e.target.value)}:void 0,onkeydown:c?e=>{c(e,e.target.value)}:void 0,onkeypress:d?e=>{d(e,e.target.value)}:void 0,onblur:p}),ts()(tx,{label:l,id:o,isMandatory:a,isActive:s||t.placeholder}),ts()(tA,{helperText:i})])}}},tP=(e,t="")=>()=>{let n={id:tl()},i=t=>{let n=t.value;return n&&("number"===e||"range"===e)?+n:n},r=(e,t)=>{e.setCustomValidity("boolean"==typeof t?t?"":"Custom validation failed":t)};return{view:({attrs:o})=>{let{className:s="col s12",dataError:a,dataSuccess:l,helperText:u,iconName:c,id:d=n.id,initialValue:h,isMandatory:p,label:f,maxLength:m,newRow:g,onchange:y,onkeydown:v,onkeypress:w,onkeyup:b,onblur:E,style:T,validate:_}=o,x=tv(tE(o,tR));return ts()(`.input-field${g?".clear":""}${t}`,{className:s,style:T},[c?ts()("i.material-icons.prefix",c):void 0,ts()(`input.validate[type=${e}][tabindex=0][id=${d}]${x}`,{oncreate:({dom:t})=>{(({autofocus:e})=>!!e&&("boolean"==typeof e?e:e()))(o)&&t.focus(),m&&M.CharacterCounter.init(t),"range"===e&&M.Range.init(t)},onkeyup:b?e=>{b(e,i(e.target))}:void 0,onkeydown:v?e=>{v(e,i(e.target))}:void 0,onkeypress:w?e=>{w(e,i(e.target))}:void 0,onblur:E,onupdate:_?({dom:e})=>{r(e,_(i(e),e))}:void 0,onchange:e=>{let t=e.target;if(t){let e=i(t);y&&y(e),_&&r(t,_(e,t))}},value:h}),ts()(tx,{label:f,id:d,isMandatory:p,isActive:!(void 0===h&&!o.placeholder&&"number"!==e&&"color"!==e&&"range"!==e)}),ts()(tA,{helperText:u,dataError:a,dataSuccess:l})])}}},tB=(tP("text"),tP("password"),tP("number"),tP("url"),tP("color"),tP("range",".range-field"),tP("email"),()=>({oncreate:({dom:e,attrs:{options:t,onCreate:n}})=>{let i=M.Modal.init(e,t);n&&n(i)},view:({attrs:{id:e,title:t,description:n,fixedFooter:i,bottomSheet:r,buttons:o,richContent:s}})=>ts()(`.modal${i?".modal-fixed-footer":""}${r?".bottom-sheet":""}[id=${e}]`,[ts()(".modal-content",[ts()("h4",t),s&&"string"==typeof n?ts().trust(n||""):"string"==typeof n?ts()("p",n):n]),o?ts()(".modal-footer",o.map(e=>ts()(tk,tM({},e,{className:"modal-close"})))):void 0])})),tU=()=>{let e={},t=e=>e.map(e=>e.id).join(""),n=(e,t,n=!1)=>n||(t instanceof Array&&(e||"number"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:n,initialValue:i,options:r}})=>{e.ids=t(r);let o=n||i;e.checkedId=n instanceof Array?[...n]:n,e.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:i,newRow:r,className:o="col s12",checkedId:s,key:a,options:l,multiple:u,label:c,helperText:d,placeholder:h="",isMandatory:p,iconName:f,disabled:m,classes:g="",dropdownOptions:y,onchange:v}})=>{e.checkedId!==s&&(e.initialValue=s?s instanceof Array?s:[s]:void 0);let{initialValue:w}=e,b=v?u?()=>{let t=e.instance&&e.instance.getSelectedValues(),n=t?t.length>0&&tw(t[0])?t.map(e=>+e):t.filter(e=>null!==e||void 0!==e):void 0;e.initialValue=n||[],v(e.initialValue)}:t=>{if(t&&t.currentTarget){let n=t.currentTarget,i=tw(n.value)?+n.value:n.value;e.initialValue=[i]}e.initialValue&&v(e.initialValue)}:void 0;r&&(o+=" clear");let E=!l.some(e=>n(e.id,w)),T=l.reduce((e,t)=>(t.group&&0>e.indexOf(t.group)&&e.push(t.group),e),[]);return ts()(".input-field.select-space",{className:o,key:a,oncreate:u?({dom:t})=>e.wrapper=t:void 0},[f&&ts()("i.material-icons.prefix",f),ts()("select",{id:i,title:c,disabled:m,multiple:u,oncreate:({dom:t})=>{e.instance=M.FormSelect.init(t,{classes:g,dropdownOptions:y})},onupdate:({dom:n})=>{if(u){let t=f?1:0;!e.inputEl&&e.wrapper&&e.wrapper.childNodes&&e.wrapper.childNodes.length>0&&e.wrapper.childNodes[t].childNodes&&e.wrapper.childNodes[t].childNodes[0]&&(e.inputEl=e.wrapper.childNodes[t].childNodes[0]),e.inputEl&&e.inputEl.value&&e.inputEl.value.startsWith(`${h}, `)&&(e.inputEl.value=e.inputEl.value.replace(`${h}, `,""))}let i=t(l),r=s&&e.checkedId!==s.toString();e.ids!==i&&(e.ids=i,r=!0),(e.checkedId instanceof Array&&s instanceof Array?e.checkedId.join()!==s.join():e.checkedId!==s)&&(e.checkedId=s,r=!0),r&&(e.instance=M.FormSelect.init(n,{classes:g,dropdownOptions:y}))},onchange:b},ts()("option",{value:"",disabled:!0,selected:!!E||void 0},h),0===T.length?l.map((e,t)=>{var i;return ts()("option",{value:e.id,title:e.title||void 0,disabled:e.disabled?"true":void 0,"data-icon":e.img||void 0,selected:n(e.id,w,0===t&&E&&!h)},null==(i=e.label)?void 0:i.replace("&","&"))}):T.map(e=>ts()("optgroup",{label:e},l.filter(t=>t.group===e).map((e,t)=>{var i;return ts()("option",{value:e.id,title:e.title||void 0,disabled:e.disabled?"true":void 0,"data-icon":e.img||void 0,selected:n(e.id,w,0===t&&E&&!h)},null==(i=e.label)?void 0:i.replace("&","&"))})))),ts()(tx,{label:c,isMandatory:p}),d&&ts()(tA,{helperText:d})])}}},tF=()=>{let e={},t=(e,t)=>t||e.replace(/ /g,"").toLowerCase();return{view:({attrs:{tabWidth:n,selectedTabId:i,tabs:r,className:o,style:s,duration:a,onShow:l,swipeable:u,responsiveThreshold:c}})=>{let d=r.filter(e=>e.active).shift(),h=i||(d?t(d.title,d.id):"");return ts()(".row",[ts()(".col.s12",ts()("ul.tabs"+("fill"===n?".tabs-fixed-width":""),{className:o,style:s,oncreate:({dom:t})=>{e.instance=M.Tabs.init(t,{duration:a,onShow:l,responsiveThreshold:c,swipeable:u})},onupdate:()=>{if(h){let e=document.getElementById(`tab_${h}`);e&&e.click()}},onremove:()=>e.instance.destroy()},r.map(({className:e,title:i,id:o,active:s,disabled:a,target:l,href:u})=>ts()(`li.tab${a?".disabled":""}${"fixed"===n?`.col.s${Math.floor(12/r.length)}`:""}`,{className:e},ts()(`a[id=tab_${t(i,o)}]${s?".active":""}`,{target:l,href:u||`#${t(i,o)}`},i))))),r.filter(({href:e})=>void 0===e).map(({id:e,title:n,vnode:i,contentClass:r})=>ts()(`.col.s12[id=${t(n,e)}]`,{className:r},i))])}}};function tY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n=new Date(e);return"".concat(n.getFullYear()).concat(t).concat(tb(n.getMonth()+1)).concat(t).concat(tb(n.getDate()))},tV=function(){window.scrollTo({top:0,behavior:"smooth"})},tG=function(e,t){return" ".repeat(t)+e},tK=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(function(n){var i,r=n.id,o=n.label,s=n.parents;return{id:r,label:o,group:t?void 0:s&&s.length>0?null===(i=e.find(function(e){return e.id===s[0]}))||void 0===i?void 0:i.label:nh("OTHER")}})},tq=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t=Array.isArray(t)?t:[t],e.filter(function(e){return t.includes(e.id)})},tZ=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return tq(e,t).map(function(e){return"- ".concat(e.label)}).join("\n")},tX=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return tq(e,t).map(function(e,t){return"".concat(t+1,". ").concat(e.label)}).join("\n")},tJ=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return tq(e,t).map(function(e,t){return e.label}).join(", ")};function t0(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(i,r)}function t1(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){t0(o,i,r,s,a,"next",e)}function a(e){t0(o,i,r,s,a,"throw",e)}s(void 0)})}}function t2(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]1?s:s[0],i[e]=o}return o=o.pop?function(e,t,n,i){for(var r=i.array?e.slice():e[0],o=e.length,s=1;s- Stuursloten en startonderbrekers
    - Anti-overval schermen
    - Manipulatiebestendige verpakking | 6. Breid toezicht uit
    - Ga \'s nachts in groep uit
    - Laat tekenen van bewoning achter
    - Draag een mobiele telefoon | 11. Verberg doelen
    - Parkeren buiten de straat
    - Genderneutrale telefoongidsen
    - Ongemarkeerde gepantserde vrachtwagens | 16. Verminder frustraties en stress
    - Effici\xebnte rijen
    - Beleefde service
    - Uitgebreide zitplaatsen
    - Rustgevende muziek/gedempte verlichting | 21. Stel regels op
    - Huurovereenkomsten
    - Intimidatiecodes
    - Hotelregistratie |\n| 2. Controleer toegang tot faciliteiten
    - Deurtelefoons
    - Elektronische kaart toegang
    - Bagagecontrole | 7. Ondersteun natuurlijk toezicht
    - Verbeterde straatverlichting
    - Verdedigbaar ruimteontwerp
    - Ondersteuning van klokkenluiders | 12. Verwijder doelen
    - Verwijderbare autoradio
    - Vrouwenopvang
    - Prepaidkaarten voor openbare telefoons | 17. Vermijd geschillen
    - Gescheiden zitplaatsen voor rivaliserende voetbalfans
    - Verminder drukte in bars
    - Vaste taxitarieven | 22. Plaats instructies
    - "Parkeren verboden"
    - "Priv\xe9-eigendom"
    - "Doof kampvuren" |\n| 3. Controleer uitgangen
    - Ticket nodig voor vertrek
    - Exportdocumenten
    - Elektronische artikelbeveiliging | 8. Verminder anonimiteit
    - Taxichauffeur ID\'s
    - "Hoe is mijn rijgedrag?" stickers
    - Schooluniformen | 13. Identificeer eigendom
    - Eigendomsmarkering
    - Voertuigregistratie en onderdelenmarkering
    - Veemerken | 18. Verminder verleiding en opwinding
    - Controles op gewelddadige pornografie
    - Handhaaf goed gedrag op voetbalveld
    - Verbied racistische opmerkingen | 23. Activeer geweten
    - Snelheidsweergaveborden langs de weg
    - Handtekeningen voor douaneaangiften
    - "Winkeldiefstal is stelen" |\n| 4. Leid overtreders af
    - Straatafsluitingen
    - Aparte toiletten voor vrouwen
    - Verspreid pubs | 9. Gebruik plaatsmanagers
    - CCTV voor dubbeldekkers
    - Twee bedienden voor gemakswinkels
    - Beloon waakzaamheid | 14. Verstoor markten
    - Monitor pandjeshuis
    - Controles op rubrieksadvertenties
    - Vergunning voor straatverkopers | 19. Neutraliseer groepsdruk
    - "Idioten drinken en rijden"
    - "Het is OK om Nee te zeggen"
    - Verspreid onruststokers op school | 24. Help bij naleving
    - Eenvoudige bibliotheekuitleen
    - Openbare toiletten
    - Afvalbakken |\n| 5. Beheers gereedschappen/wapens
    - "Slimme" wapens
    - Beperk verkoop spuitverf aan jongeren
    - Geharde bierglazen | 10. Versterk formeel toezicht
    - Roodlichtcamera\'s
    - Inbraakalarm
    - Beveiligingspersoneel | 15. Ontzeg voordelen
    - Inktlabels op artikelen
    - Graffiti reiniging
    - Uitschakelen gestolen mobiele telefoons | 20. Ontmoedig imitatie
    - Snelle reparatie van vandalisme
    - V-chips in TV\'s
    - Censureer details van modus operandi | 25. Beheers drugs en alcohol
    - Ademanalysers in bars
    - Interventie programma\'s voor barpersoneel
    - Alcoholvrije evenementen |\n'},CRIME_SCRIPT:{TITLE:"Crime script",ROUTE:"/crime_script"},SETTINGS:{TITLE:"Instellingen",ROUTE:"/instellingen"},LANDING:{TITLE:"Introductie",ROUTE:"/"},CASE:{TITLE:"Casus",ROUTE:"/casus"},USER:"Gebruiker",EDITOR:"Redacteur",ADMIN:"Beheerder",CANCEL:"Annuleren",DELETE:"Verwijderen",YES:"Ja",NO:"Nee",OK:"Ok",NAME:"Naam",MISC:"Overig",DESCRIPTION:"Beschrijving",DELETE_ITEM:{TITLE:"{item} verwijderen",DESCRIPTION:"Weet je zeker dat je dit {item} wilt verwijderen? Dit kan niet ongedaan worden gemaakt."},EDIT_BUTTON:{LABEL:"Bewerken",TOOLTIP:"Bewerken"},SAVE_BUTTON:{LABEL:"Opslaan",TOOLTIP:"Wijzigingen opslaan"},MODEL:"Model",TITLE:"Titel",AUTHORS:"Auteurs",LINK:"Link",TYPE:"Type",CAST_TYPE:"Roltype",SAVE_SCRIPT:"Script opslaan",EDIT_SCRIPT:"Script bewerken",DELETE_SCRIPT:"Script verwijderen",NEW_SCRIPT:"Nieuw script",DELETE_SCRIPT_CONFIRM:'Weet je zeker dat je het script "{name}" wilt verwijderen?',ACTIVITIES:"Activiteiten",CAST:"Rollen",CONDITIONS:"Voorwaarden",ATTRIBUTES:"Attributen",MEASURES:"Maatregelen",NEW_ACT:"Nieuwe handeling",PREPARATION_PHASE:"Voorbereidingsfase",PRE_ACTIVITY_PHASE:"Voor-activiteitsfase",ACTIVITY_PHASE:"Activiteitsfase",POST_ACTIVITY_PHASE:"Na-activiteitsfase",SUMMARY:"Samenvatting",IMAGE:"Afbeelding",ACTIVITY:"Activiteit",SPECIFY:"Specificeer",CONDITION:"Voorwaarde",CATEGORY:"Categorie",SELECT:"Selecteren",CREATE:"Maken",STAGES:"Fasen",STAGE:"Fase",SCENES:"Scenes",SCENE:"Scene",ACTS:"Actes",ACT:"Acte",SELECT_ACT_TO_EDIT:"Selecteer handeling om te bewerken",CREATE_NEW_ACT:"Nieuwe handeling maken",REFERENCES:"Referenties",DETAILS:"Details",LANGUAGE:"Taal",CLEAR:"Wis model",UPLOAD:"Lees model in als JSON",DOWNLOAD:"Sla model op als JSON",PERMALINK:"Maak permanente link",ROLE:"Rol",SELECT_ACT:"Selecteer act om te bewerken",SELECT_ACT_N:"Selecteer een of meerdere acts in deze stage",INCREASE_EFFORT:"Verhoog de inspanning",TARGET_HARDEN:{TITLE:"Doelversteviging",DESC:"Stuursloten en startonderbrekers, Anti-overval schermen, Manipulatiebestendige verpakking"},CONTROL_ACCESS:{TITLE:"Controleer toegang tot faciliteiten",DESC:"Deurtelefoons, Elektronische kaart toegang, Bagagecontrole"},SCREEN_EXITS:{TITLE:"Controleer uitgangen",DESC:"Ticket nodig voor vertrek, Exportdocumenten, Elektronische artikelbeveiliging"},DEFLECT_OFFENDERS:{TITLE:"Leid overtreders af",DESC:"Straatafsluitingen, Aparte toiletten voor vrouwen, Verspreid pubs"},CONTROL_TOOLS:{TITLE:"Beheers gereedschappen/wapens",DESC:'"Slimme" wapens, Beperk verkoop spuitverf aan jongeren, Geharde bierglazen'},INCREASE_RISKS:"Verhoog de risico's",EXTEND_GUARDIANSHIP:{TITLE:"Breid toezicht uit",DESC:"Ga 's nachts in groep uit, Laat tekenen van bewoning achter, Draag een mobiele telefoon"},ASSIST_SURVEILLANCE:{TITLE:"Ondersteun natuurlijk toezicht",DESC:"Verbeterde straatverlichting, Verdedigbaar ruimteontwerp, Ondersteuning van klokkenluiders"},REDUCE_ANONYMITY:{TITLE:"Verminder anonimiteit",DESC:'Taxichauffeur ID\'s, "Hoe is mijn rijgedrag?" stickers, Schooluniformen'},USE_PLACE_MANAGERS:{TITLE:"Gebruik plaatsmanagers",DESC:"CCTV voor dubbeldekkers, Twee bedienden voor gemakswinkels, Beloon waakzaamheid"},STRENGTHEN_SURVEILLANCE:{TITLE:"Versterk formeel toezicht",DESC:"Roodlichtcamera's, Inbraakalarm, Beveiligingspersoneel"},REDUCE_REWARDS:"Verminder de beloningen",CONCEAL_TARGETS:{TITLE:"Verberg doelen",DESC:"Parkeren buiten de straat, Genderneutrale telefoongidsen, Ongemarkeerde gepantserde vrachtwagens"},REMOVE_TARGETS:{TITLE:"Verwijder doelen",DESC:"Verwijderbare autoradio, Vrouwenopvang, Prepaidkaarten voor openbare telefoons"},IDENTIFY_PROPERTY:{TITLE:"Identificeer eigendom",DESC:"Eigendomsmarkering, Voertuigregistratie en onderdelenmarkering, Veemerken"},DISRUPT_MARKETS:{TITLE:"Verstoor markten",DESC:"Monitor pandjeshuis, Controles op rubrieksadvertenties, Vergunning voor straatverkopers"},DENY_BENEFITS:{TITLE:"Ontzeg voordelen",DESC:"Inktlabels op artikelen, Graffiti reiniging, Uitschakelen gestolen mobiele telefoons"},REDUCE_PROVOCATIONS:"Verminder provocaties",REDUCE_FRUSTRATIONS:{TITLE:"Verminder frustraties en stress",DESC:"Effici\xebnte rijen, Beleefde service, Uitgebreide zitplaatsen, Rustgevende muziek/gedempte verlichting"},AVOID_DISPUTES:{TITLE:"Vermijd geschillen",DESC:"Gescheiden zitplaatsen voor rivaliserende voetbalfans, Verminder drukte in bars, Vaste taxitarieven"},REDUCE_TEMPTATION:{TITLE:"Verminder verleiding en opwinding",DESC:"Controles op gewelddadige pornografie, Handhaaf goed gedrag op voetbalveld, Verbied racistische opmerkingen"},NEUTRALIZE_PRESSURE:{TITLE:"Neutraliseer groepsdruk",DESC:'"Idioten drinken en rijden", "Het is OK om Nee te zeggen", Verspreid onruststokers op school'},DISCOURAGE_IMITATION:{TITLE:"Ontmoedig imitatie",DESC:"Snelle reparatie van vandalisme, V-chips in TV's, Censureer details van modus operandi"},REMOVE_EXCUSES:"Verwijder excuses",SET_RULES:{TITLE:"Stel regels op",DESC:"Huurovereenkomsten, Intimidatiecodes, Hotelregistratie"},POST_INSTRUCTIONS:{TITLE:"Plaats instructies",DESC:'"Parkeren verboden", "Priv\xe9-eigendom", "Doof kampvuren"'},ALERT_CONSCIENCE:{TITLE:"Activeer geweten",DESC:'Snelheidsweergaveborden langs de weg, Handtekeningen voor douaneaangiften, "Winkeldiefstal is stelen"'},ASSIST_COMPLIANCE:{TITLE:"Help bij naleving",DESC:"Eenvoudige bibliotheekuitleen, Openbare toiletten, Afvalbakken"},CONTROL_DRUGS:{TITLE:"Beheers drugs en alcohol",DESC:"Ademanalysers in bars, Interventie programma's voor barpersoneel, Alcoholvrije evenementen"},EXPORT_TO_WORD:"Exporteer naar Word",INTRODUCTION:"Introductie",SEARCH:"Zoek...",SEARCH_TOOLTIP:"Type / om te zoeken",HITS:{0:"Geen resultaten gevonden",1:"1 resultaat gevonden",n:"{n} resultaten gevonden"},SYNONYMS:"Synoniemen",PARENTS:"Ouders",CATEGORIES:"Categorie\xebn",BELONGS_TO:"Behoort tot",LOCATIONS:{0:"Locaties",1:"Locatie",n:"Locaties"},PRODUCTS:{0:"Producten",1:"Product",n:"Producten"},GEOLOCATIONS:{0:"Kaartlocatie",1:"Kaartlocatie",n:"Kaartlocaties"},TRANSPORTS:"Transportmiddelen",I18n:{editRepeat:"Bewerk item",createRepeat:"Maak een nieuw item",deleteItem:"Verwijder een item",agree:"Ja",disagree:"Nee",pickOne:"Kies \xe9\xe9n",pickOneOrMore:"Kies \xe9\xe9n of meer",cancel:"Opheffen",save:"Bewaren"},OTHER:"Overig"},nr={HOME:{TITLE:"Home",ROUTE:"/home"},ABOUT:{TITLE:"About the app",ROUTE:"/about",TEXT:'\n\n#### Situational Crime Prevention techniques\n\n| Increase the effort | Increase the risks | Reduce the rewards | Reduce provocations | Remove excuses |\n|---------------------|---------------------|---------------------|----------------------|-----------------|\n| 1. Target harden
    - Steering column locks and ignition immobilizers
    - Anti-robbery screens
    - Tamper-proof packaging | 6. Extend guardianship
    - Go out in group at night
    - Leave signs of occupancy
    - Carry cell phone | 11. Conceal targets
    - Off-street parking
    - Gender-neutral phone directories
    - Unmarked armored trucks | 16. Reduce frustrations and stress
    - Efficient lines
    - Polite service
    - Expanded seating
    - Soothing music/muted lights | 21. Set rules
    - Rental agreements
    - Harassment codes
    - Hotel registration |\n| 2. Control access to facilities
    - Entry phones
    - Electronic card access
    - Baggage screening | 7. Assist natural surveillance
    - Improved street lighting
    - Defensible space design
    - Support whistleblowers | 12. Remove targets
    - Removable car radio
    - Women\'s shelters
    - Pre-paid cards for pay phones | 17. Avoid disputes
    - Separate seating for rival soccer fans
    - Reduce crowding in bars
    - Fixed cab fares | 22. Post instructions
    - "No parking"
    - "Private property"
    - "Extinguish camp fires" |\n| 3. Screen exits
    - Ticket needed for exit
    - Export documents
    - Electronic merchandise tags | 8. Reduce anonymity
    - Taxi driver IDs
    - "How\'s my driving?" decals
    - School uniforms | 13. Identify property
    - Property marking
    - Vehicle licensing and parts marking
    - Cattle branding | 18. Reduce temptation and arousal
    - Controls on violent pornography
    - Enforce good behavior on soccer field
    - Prohibit racial slurs | 23. Alert conscience
    - Roadside speed display boards
    - Signatures for customs declarations
    - "Shoplifting is stealing" |\n| 4. Deflect offenders
    - Street closures
    - Separate bathrooms for women
    - Disperse pubs | 9. Use place managers
    - CCTV for double-deck buses
    - Two clerks for convenience stores
    - Reward vigilance | 14. Disrupt markets
    - Monitor pawn shops
    - Controls on classified ads
    - License street vendors | 19. Neutralize peer pressure
    - "Idiots drink and drive"
    - "It\'s OK to say No"
    - Disperse troublemakers at school | 24. Assist compliance
    - Easy library checkout
    - Public lavatories
    - Litter receptacles |\n| 5. Control tools/weapons
    - "Smart" guns
    - Restrict spray paint sales to juveniles
    - Toughened beer glasses | 10. Strengthen formal surveillance
    - Red light cameras
    - Burglar alarms
    - Security guards | 15. Deny benefits
    - Ink merchandise tags
    - Graffiti cleaning
    - Disabling stolen cell phones | 20. Discourage imitation
    - Rapid repair of vandalism
    - V-chips in TVs
    - Censor details of modus operandi | 25. Control drugs and alcohol
    - Breathalyzers in bars
    - Server intervention programs
    - Alcohol-free events |\n'},CRIME_SCRIPT:{TITLE:"Crime script",ROUTE:"/crime_script"},SETTINGS:{TITLE:"Settings",ROUTE:"/settings"},LANDING:{TITLE:"Introduction",ROUTE:"/"},CASE:{TITLE:"Case file",ROUTE:"/case"},USER:"User",EDITOR:"Editor",ADMIN:"Administrator",CANCEL:"Cancel",DELETE:"Delete",YES:"Yes",NO:"No",OK:"Ok",NAME:"Name",MISC:"Miscellaneous",DESCRIPTION:"Description",DELETE_ITEM:{TITLE:"Delete {item}",DESCRIPTION:"Are you certain you want to delete this {item}. There is no turning back?"},EDIT_BUTTON:{LABEL:"Edit",TOOLTIP:"Edit"},SAVE_BUTTON:{LABEL:"Save",TOOLTIP:"Save unsaved changes"},MODEL:"Model",TITLE:"Title",AUTHORS:"Authors",LINK:"Link",TYPE:"Type",CAST_TYPE:"Role type",SAVE_SCRIPT:"Save Script",EDIT_SCRIPT:"Edit Script",DELETE_SCRIPT:"Delete Script",NEW_SCRIPT:"New Script",DELETE_SCRIPT_CONFIRM:'Are you certain you want to delete the script "{name}"?',ACTIVITIES:"Activities",CAST:"Cast",CONDITIONS:"Conditions",ATTRIBUTES:"Attributes",MEASURES:"Measures",NEW_ACT:"New Act",PREPARATION_PHASE:"Preparation Phase",PRE_ACTIVITY_PHASE:"Pre-Activity Phase",ACTIVITY_PHASE:"Activity Phase",POST_ACTIVITY_PHASE:"Post-Activity Phase",SUMMARY:"Summary",IMAGE:"Image",ACTIVITY:"Activity",SPECIFY:"Specify",CONDITION:"Condition",CATEGORY:"Category",SELECT:"Select",CREATE:"Create",STAGES:"Stages",STAGE:"Stage",SCENES:"Scenes",SCENE:"Scene",ACTS:"Acts",ACT:"Act",SELECT_ACT_TO_EDIT:"Select act to edit",CREATE_NEW_ACT:"Create new act",REFERENCES:"References",DETAILS:"Details",LANGUAGE:"Language",CLEAR:"Clear model",UPLOAD:"Upload model as JSON",DOWNLOAD:"Download model as JSON",PERMALINK:"Create permanent link",ROLE:"Role",SELECT_ACT:"Select act to edit",SELECT_ACT_N:"Select one or more acts for this step",INCREASE_EFFORT:"Increase the effort",TARGET_HARDEN:{TITLE:"Target harden",DESC:"Steering column locks and ignition immobilizers, Anti-robbery screens, Tamper-proof packaging"},CONTROL_ACCESS:{TITLE:"Control access to facilities",DESC:"Entry phones, Electronic card access, Baggage screening"},SCREEN_EXITS:{TITLE:"Screen exits",DESC:"Ticket needed for exit, Export documents, Electronic merchandise tags"},DEFLECT_OFFENDERS:{TITLE:"Deflect offenders",DESC:"Street closures, Separate bathrooms for women, Disperse pubs"},CONTROL_TOOLS:{TITLE:"Control tools/weapons",DESC:'"Smart" guns, Restrict spray paint sales to juveniles, Toughened beer glasses'},INCREASE_RISKS:"Increase the risks",EXTEND_GUARDIANSHIP:{TITLE:"Extend guardianship",DESC:"Go out in group at night, Leave signs of occupancy, Carry cell phone"},ASSIST_SURVEILLANCE:{TITLE:"Assist natural surveillance",DESC:"Improved street lighting, Defensible space design, Support whistleblowers"},REDUCE_ANONYMITY:{TITLE:"Reduce anonymity",DESC:'Taxi driver IDs, "How\'s my driving?" decals, School uniforms'},USE_PLACE_MANAGERS:{TITLE:"Use place managers",DESC:"CCTV for double-deck buses, Two clerks for convenience stores, Reward vigilance"},STRENGTHEN_SURVEILLANCE:{TITLE:"Strengthen formal surveillance",DESC:"Red light cameras, Burglar alarms, Security guards"},REDUCE_REWARDS:"Reduce the rewards",CONCEAL_TARGETS:{TITLE:"Conceal targets",DESC:"Off-street parking, Gender-neutral phone directories, Unmarked armored trucks"},REMOVE_TARGETS:{TITLE:"Remove targets",DESC:"Removable car radio, Women's shelters, Pre-paid cards for pay phones"},IDENTIFY_PROPERTY:{TITLE:"Identify property",DESC:"Property marking, Vehicle licensing and parts marking, Cattle branding"},DISRUPT_MARKETS:{TITLE:"Disrupt markets",DESC:"Monitor pawn shops, Controls on classified ads, License street vendors"},DENY_BENEFITS:{TITLE:"Deny benefits",DESC:"Ink merchandise tags, Graffiti cleaning, Disabling stolen cell phones"},REDUCE_PROVOCATIONS:"Reduce provocations",REDUCE_FRUSTRATIONS:{TITLE:"Reduce frustrations and stress",DESC:"Efficient lines, Polite service, Expanded seating, Soothing music/muted lights"},AVOID_DISPUTES:{TITLE:"Avoid disputes",DESC:"Separate seating for rival soccer fans, Reduce crowding in bars, Fixed cab fares"},REDUCE_TEMPTATION:{TITLE:"Reduce temptation and arousal",DESC:"Controls on violent pornography, Enforce good behavior on soccer field, Prohibit racial slurs"},NEUTRALIZE_PRESSURE:{TITLE:"Neutralize peer pressure",DESC:'"Idiots drink and drive", "It\'s OK to say No", Disperse troublemakers at school'},DISCOURAGE_IMITATION:{TITLE:"Discourage imitation",DESC:"Rapid repair of vandalism, V-chips in TVs, Censor details of modus operandi"},REMOVE_EXCUSES:"Remove excuses",SET_RULES:{TITLE:"Set rules",DESC:"Rental agreements, Harassment codes, Hotel registration"},POST_INSTRUCTIONS:{TITLE:"Post instructions",DESC:'"No parking", "Private property", "Extinguish camp fires"'},ALERT_CONSCIENCE:{TITLE:"Alert conscience",DESC:'Roadside speed display boards, Signatures for customs declarations, "Shoplifting is stealing"'},ASSIST_COMPLIANCE:{TITLE:"Assist compliance",DESC:"Easy library checkout, Public lavatories, Litter receptacles"},CONTROL_DRUGS:{TITLE:"Control drugs and alcohol",DESC:"Breathalyzers in bars, Server intervention programs, Alcohol-free events"},EXPORT_TO_WORD:"Export to Word",INTRODUCTION:"Introduction",SEARCH:"Search...",SEARCH_TOOLTIP:"Type / to search",HITS:{0:"No results found",1:"1 result found",n:"{n} results found"},SYNONYMS:"Synonyms",PARENTS:"Parents",CATEGORIES:"Categories",BELONGS_TO:"Belongs to",PRODUCTS:{0:"Products",1:"Product",n:"Products"},LOCATIONS:{0:"Locations",1:"Location",n:"Locations"},GEOLOCATIONS:{0:"Geographic Locations",1:"Geographic Location",n:"Geographic Locations"},TRANSPORTS:"Transports",I18n:{editRepeat:"",createRepeat:"",deleteItem:"",agree:"",disagree:"",pickOne:"",pickOneOrMore:"",cancel:"",save:""},OTHER:"Other"};function no(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(i,r)}function ns(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){no(o,i,r,s,a,"next",e)}function a(e){no(o,i,r,s,a,"throw",e)}s(void 0)})}}function na(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=0}(e)?e:nc.defaultLocale,nc.currentLocale=t,nh=nl(e),nd.agree=nh("I18n","agree"),nd.disagree=nh("I18n","disagree"),nd.cancel=nh("I18n","cancel"),nd.save=nh("I18n","save"),nd.editRepeat=nh("I18n","editRepeat"),nd.createRepeat=nh("I18n","createRepeat"),nd.deleteItem=nh("I18n","deleteItem"),nd.pickOne=nh("I18n","pickOne"),nd.pickOneOrMore=nh("I18n","pickOneOrMore"),nu.forEach(function(e){return e(nc.currentLocale,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nc.currentLocale;return nc.locales[e].dir||"ltr"}())}),[2])})})).apply(this,arguments)}let ng=[[/\r\n/g,"\n"],[/\n(#+)(.*)/g,(e,t,n="")=>{let i=t.length;return`${n.trim()}`}],[/!\[([^\[]+)\]\((?:javascript:)?([^\)]+)\)/g,'$1'],[/\[([^\[]+)\]\((?:javascript:)?([^\)]+)\)/g,'$1'],[/([^\\])(\*\*|__)(.*?(_|\*)?)\2/g,"$1$3"],[/([^\\])(\*|_)(.*?)\2/g,"$1$3"],[/\\_/g,"_"],[/\~\~(.*?)\~\~/g,"$1"],[/\:\"(.*?)\"\:/g,"$1"],[/\n\s*```\n([^]*?)\n\s*```\s*\n/g,"\n
    $1
    "],[/`(.*?)`/g,(e,t)=>`${(e=>{e=e.replace(/\&/g,"&");let t="'#<>`*-~_=:\"![]()nt",n=t.length;for(let i=0;i`&#${e.charCodeAt(0)};`);return e})(t)}`],[/\n(\*|\-|\+)(.*)/g,(e,t,n="")=>`
      +(()=>{var e={887:function(e,t,n){var i,r;i=0,r=function(){"use strict";function t(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){a(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function i(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,n,s){var a=o.URL||o.webkitURL,l=document.createElement("a");n=n||e.name||"download",l.download=n,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):i(l.href)?t(e,n,s):r(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){r(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,o){if(n=n||e.name||"download","string"!=typeof e){var s,a;navigator.msSaveOrOpenBlob((s=e,void 0===(a=o)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s),n)}else if(i(e))t(e,n,o);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){r(l)})}}:function(e,n,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,i);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&l||s)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});o.saveAs=a.saveAs=a,e.exports=a},"function"==typeof define&&define.amd?define([],r):r()},461:function(e,t,n){e=n.nmd(e);var i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function r(e,t){if(!i[e]){i[e]={};for(var n=0;n>>8,n[2*i+1]=s%256}return n},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var n=Array(t.length/2),i=0,r=n.length;ic.charCodeAt(0)){for(i=0;i>=1}else{for(i=0,r=1;i>=1}0==--d&&(d=Math.pow(2,p),p++),delete a[c]}else for(i=0,r=s[c];i>=1;0==--d&&(d=Math.pow(2,p),p++),s[u]=h++,c=String(l)}if(""!==c){if(Object.prototype.hasOwnProperty.call(a,c)){if(256>c.charCodeAt(0)){for(i=0;i>=1}else{for(i=0,r=1;i>=1}0==--d&&(d=Math.pow(2,p),p++),delete a[c]}else for(i=0,r=s[c];i>=1;0==--d&&(d=Math.pow(2,p),p++)}for(i=0,r=2;i>=1;for(;;){if(m<<=1,g==t-1){f.push(n(m));break}g++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(t,n,i){var r,o,s,a,l,u,c,d,h=[],p=4,f=4,m=3,g="",y=[],v={val:i(0),position:n,index:1};for(o=0;o<3;o+=1)h[o]=o;for(a=0,u=4,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;switch(a){case 0:for(a=0,u=256,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;d=e(a);break;case 1:for(a=0,u=65536,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;d=e(a);break;case 2:return""}for(h[3]=d,s=d,y.push(d);;){if(v.index>t)return"";for(a=0,u=Math.pow(2,m),c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;switch(d=a){case 0:for(a=0,u=256,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;h[f++]=e(a),d=f-1,p--;break;case 1:for(a=0,u=65536,c=1;c!=u;)l=v.val&v.position,v.position>>=1,0==v.position&&(v.position=n,v.val=i(v.index++)),a|=(l>0?1:0)*c,c<<=1;h[f++]=e(a),d=f-1,p--;break;case 2:return y.join("")}if(0==p&&(p=Math.pow(2,m),m++),h[d])g=h[d];else{if(d!==f)return null;g=s+s.charAt(0)}y.push(g),h[f++]=s+g.charAt(0),p--,s=g,0==p&&(p=Math.pow(2,m),m++)}}};return o}();"function"==typeof define&&define.amd?define(function(){return i}):null!=e?e.exports=i:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return i})},142:function(e,t,n){e=n.nmd(e);var i,r,o,s,a,l,u,c,d,h,p,f,m,g,y,v,w,b,E,T,_,x,A,S,L,N,I,k,D,C,j,O,z,R,P,B,U,F,Y,H,W,Q,V,G,K,q,Z,X,J,ee,et,en,ei,er,eo,es,ea,el,eu,ec,ed,eh,ep,ef,em,eg,ey,ev,ew,eb,eM,eE,eT,e_,ex,eA,eS,eL,eN,eI,ek=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},eD=function(){function e(e,t){for(var n=0;n/,p=/^\w+$/;function f(e,n){return n=n||t,d.test(e)?n.getElementsByClassName(e.slice(1)):p.test(e)?n.getElementsByTagName(e):n.querySelectorAll(e)}function m(n){if(!e){var i=(e=t.implementation.createHTMLDocument(null)).createElement("base");i.href=t.location.href,e.head.appendChild(i)}return e.body.innerHTML=n,e.body.childNodes}function g(e){"loading"!==t.readyState?e():t.addEventListener("DOMContentLoaded",e)}function y(e,i){if(!e)return this;if(e.cash&&e!==n)return e;var r,o=e,s=0;if(u(e))o=c.test(e)?t.getElementById(e.slice(1)):h.test(e)?m(e):f(e,i);else if(l(e))return g(e),this;if(!o)return this;if(o.nodeType||o===n)this[0]=o,this.length=1;else for(r=this.length=o.length;sr.right-n||l+t.width>window.innerWidth-n)&&(i.right=!0),(uo-n||u+t.height>window.innerHeight-n)&&(i.bottom=!0),i},M.checkPossibleAlignments=function(e,t,n,i){var r={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o="visible"===getComputedStyle(t).overflow,s=t.getBoundingClientRect(),a=Math.min(s.height,window.innerHeight),l=Math.min(s.width,window.innerWidth),u=e.getBoundingClientRect(),c=t.scrollLeft,d=t.scrollTop,h=n.left-c,p=n.top-d,f=n.top+u.height-d;return r.spaceOnRight=o?window.innerWidth-(u.left+n.width):l-(h+n.width),r.spaceOnRight<0&&(r.left=!1),r.spaceOnLeft=o?u.right-n.width:h-n.width+u.width,r.spaceOnLeft<0&&(r.right=!1),r.spaceOnBottom=o?window.innerHeight-(u.top+n.height+i):a-(p+n.height+i),r.spaceOnBottom<0&&(r.top=!1),r.spaceOnTop=o?u.bottom-(n.height+i):f-(n.height-i),r.spaceOnTop<0&&(r.bottom=!1),r},M.getOverflowParent=function(e){return null==e?null:e===document.body||"visible"!==getComputedStyle(e).overflow?e:M.getOverflowParent(e.parentElement)},M.getIdFromTrigger=function(e){var t=e.getAttribute("data-target");return t||(t=(t=e.getAttribute("href"))?t.slice(1):""),t},M.getDocumentScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},M.getDocumentScrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};var eR=Date.now||function(){return(new Date).getTime()};M.throttle=function(e,t,n){var i=void 0,r=void 0,o=void 0,s=null,a=0;n||(n={});var l=function(){a=!1===n.leading?0:eR(),s=null,o=e.apply(i,r),i=r=null};return function(){var u=eR();a||!1!==n.leading||(a=u);var c=t-(u-a);return i=this,r=arguments,c<=0?(clearTimeout(s),s=null,a=u,o=e.apply(i,r),i=r=null):s||!1===n.trailing||(s=setTimeout(l,c)),o}};var eP={scope:{}};eP.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){if(n.get||n.set)throw TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},eP.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:void 0!==n.g&&null!=n.g?n.g:e},eP.global=eP.getGlobal(this),eP.SYMBOL_PREFIX="jscomp_symbol_",eP.initSymbol=function(){eP.initSymbol=function(){},eP.global.Symbol||(eP.global.Symbol=eP.Symbol)},eP.symbolCounter_=0,eP.Symbol=function(e){return eP.SYMBOL_PREFIX+(e||"")+eP.symbolCounter_++},eP.initSymbolIterator=function(){eP.initSymbol();var e=eP.global.Symbol.iterator;e||(e=eP.global.Symbol.iterator=eP.global.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&eP.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return eP.arrayIterator(this)}}),eP.initSymbolIterator=function(){}},eP.arrayIterator=function(e){var t=0;return eP.iteratorPrototype(function(){return t=B.currentTime)for(var c=0;cn&&(t.duration=i.duration),t.children.push(i)}),t.seek(0),t.reset(),t.autoplay&&t.restart(),t},t},b.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},b}(),r=cash,o=M.anime,s={accordion:!0,onOpenStart:void 0,onOpenEnd:void 0,onCloseStart:void 0,onCloseEnd:void 0,inDuration:300,outDuration:300},a=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));(i.el.M_Collapsible=i).options=r.extend({},t.defaults,n),i.$headers=i.$el.children("li").children(".collapsible-header"),i.$headers.attr("tabindex",0),i._setupEventHandlers();var o=i.$el.children("li.active").children(".collapsible-body");return i.options.accordion?o.first().css("display","block"):o.css("display","block"),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Collapsible=void 0}},{key:"_setupEventHandlers",value:function(){var e=this;this._handleCollapsibleClickBound=this._handleCollapsibleClick.bind(this),this._handleCollapsibleKeydownBound=this._handleCollapsibleKeydown.bind(this),this.el.addEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.addEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_removeEventHandlers",value:function(){var e=this;this.el.removeEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.removeEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_handleCollapsibleClick",value:function(e){var t=r(e.target).closest(".collapsible-header");if(e.target&&t.length){var n=t.closest(".collapsible");if(n[0]===this.el){var i=t.closest("li"),o=n.children("li"),s=i[0].classList.contains("active"),a=o.index(i);s?this.close(a):this.open(a)}}}},{key:"_handleCollapsibleKeydown",value:function(e){13===e.keyCode&&this._handleCollapsibleClickBound(e)}},{key:"_animateIn",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length){var i=n.children(".collapsible-body");o.remove(i[0]),i.css({display:"block",overflow:"hidden",height:0,paddingTop:"",paddingBottom:""});var r=i.css("padding-top"),s=i.css("padding-bottom"),a=i[0].scrollHeight;i.css({paddingTop:0,paddingBottom:0}),o({targets:i[0],height:a,paddingTop:r,paddingBottom:s,duration:this.options.inDuration,easing:"easeInOutCubic",complete:function(e){i.css({overflow:"",paddingTop:"",paddingBottom:"",height:""}),"function"==typeof t.options.onOpenEnd&&t.options.onOpenEnd.call(t,n[0])}})}}},{key:"_animateOut",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length){var i=n.children(".collapsible-body");o.remove(i[0]),i.css("overflow","hidden"),o({targets:i[0],height:0,paddingTop:0,paddingBottom:0,duration:this.options.outDuration,easing:"easeInOutCubic",complete:function(){i.css({height:"",overflow:"",padding:"",display:""}),"function"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t,n[0])}})}}},{key:"open",value:function(e){var t=this,n=this.$el.children("li").eq(e);if(n.length&&!n[0].classList.contains("active")){if("function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,n[0]),this.options.accordion){var i=this.$el.children("li");this.$el.children("li.active").each(function(e){var n=i.index(r(e));t.close(n)})}n[0].classList.add("active"),this._animateIn(e)}}},{key:"close",value:function(e){var t=this.$el.children("li").eq(e);t.length&&t[0].classList.contains("active")&&("function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,t[0]),t[0].classList.remove("active"),this._animateOut(e))}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Collapsible}},{key:"defaults",get:function(){return s}}]),t}(),M.Collapsible=a,M.jQueryLoaded&&M.initializeJqueryWrapper(a,"collapsible","M_Collapsible"),l=cash,u=M.anime,c={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!0,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},(d=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return i.el.M_Dropdown=i,t._dropdowns.push(i),i.id=M.getIdFromTrigger(e),i.dropdownEl=document.getElementById(i.id),i.$dropdownEl=l(i.dropdownEl),i.options=l.extend({},t.defaults,n),i.isOpen=!1,i.isScrollable=!1,i.isTouchMoving=!1,i.focusedIndex=-1,i.filterQuery=[],i.options.container?l(i.options.container).append(i.dropdownEl):i.$el.after(i.dropdownEl),i._makeDropdownFocusable(),i._resetFilterQueryBound=i._resetFilterQuery.bind(i),i._handleDocumentClickBound=i._handleDocumentClick.bind(i),i._handleDocumentTouchmoveBound=i._handleDocumentTouchmove.bind(i),i._handleDropdownClickBound=i._handleDropdownClick.bind(i),i._handleDropdownKeydownBound=i._handleDropdownKeydown.bind(i),i._handleTriggerKeydownBound=i._handleTriggerKeydown.bind(i),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._resetDropdownStyles(),this._removeEventHandlers(),t._dropdowns.splice(t._dropdowns.indexOf(this),1),this.el.M_Dropdown=void 0}},{key:"_setupEventHandlers",value:function(){this.el.addEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.addEventListener("click",this._handleDropdownClickBound),this.options.hover?(this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.addEventListener("mouseleave",this._handleMouseLeaveBound)):(this._handleClickBound=this._handleClick.bind(this),this.el.addEventListener("click",this._handleClickBound))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.removeEventListener("click",this._handleDropdownClickBound),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.removeEventListener("mouseleave",this._handleMouseLeaveBound)):this.el.removeEventListener("click",this._handleClickBound)}},{key:"_setupTemporaryEventHandlers",value:function(){document.body.addEventListener("click",this._handleDocumentClickBound,!0),document.body.addEventListener("touchend",this._handleDocumentClickBound),document.body.addEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.addEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_removeTemporaryEventHandlers",value:function(){document.body.removeEventListener("click",this._handleDocumentClickBound,!0),document.body.removeEventListener("touchend",this._handleDocumentClickBound),document.body.removeEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.removeEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_handleClick",value:function(e){e.preventDefault(),this.open()}},{key:"_handleMouseEnter",value:function(){this.open()}},{key:"_handleMouseLeave",value:function(e){var t=e.toElement||e.relatedTarget,n=!!l(t).closest(".dropdown-content").length,i=!1,r=l(t).closest(".dropdown-trigger");r.length&&r[0].M_Dropdown&&r[0].M_Dropdown.isOpen&&(i=!0),i||n||this.close()}},{key:"_handleDocumentClick",value:function(e){var t=this,n=l(e.target);this.options.closeOnClick&&n.closest(".dropdown-content").length&&!this.isTouchMoving?setTimeout(function(){t.close()},0):!n.closest(".dropdown-trigger").length&&n.closest(".dropdown-content").length||setTimeout(function(){t.close()},0),this.isTouchMoving=!1}},{key:"_handleTriggerKeydown",value:function(e){e.which!==M.keys.ARROW_DOWN&&e.which!==M.keys.ENTER||this.isOpen||(e.preventDefault(),this.open())}},{key:"_handleDocumentTouchmove",value:function(e){l(e.target).closest(".dropdown-content").length&&(this.isTouchMoving=!0)}},{key:"_handleDropdownClick",value:function(e){if("function"==typeof this.options.onItemClick){var t=l(e.target).closest("li")[0];this.options.onItemClick.call(this,t)}}},{key:"_handleDropdownKeydown",value:function(e){if(e.which===M.keys.TAB)e.preventDefault(),this.close();else if((e.which===M.keys.ARROW_DOWN||e.which===M.keys.ARROW_UP)&&this.isOpen){e.preventDefault();var t=e.which===M.keys.ARROW_DOWN?1:-1,n=this.focusedIndex,i=!1;do if(n+=t,this.dropdownEl.children[n]&&-1!==this.dropdownEl.children[n].tabIndex){i=!0;break}while(nl.spaceOnBottom?(u="bottom",n+=l.spaceOnTop,o-=l.spaceOnTop):n+=l.spaceOnBottom)),!l[c]){var d="left"===c?"right":"left";l[d]?c=d:l.spaceOnLeft>l.spaceOnRight?(c="right",i+=l.spaceOnLeft,r-=l.spaceOnLeft):(c="left",i+=l.spaceOnRight)}return"bottom"===u&&(o=o-t.height+(this.options.coverTrigger?e.height:0)),"right"===c&&(r=r-t.width+e.width),{x:r,y:o,verticalAlignment:u,horizontalAlignment:c,height:n,width:i}}},{key:"_animateIn",value:function(){var e=this;u.remove(this.dropdownEl),u({targets:this.dropdownEl,opacity:{value:[0,1],easing:"easeOutQuad"},scaleX:[.3,1],scaleY:[.3,1],duration:this.options.inDuration,easing:"easeOutQuint",complete:function(t){e.options.autoFocus&&e.dropdownEl.focus(),"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el)}})}},{key:"_animateOut",value:function(){var e=this;u.remove(this.dropdownEl),u({targets:this.dropdownEl,opacity:{value:0,easing:"easeOutQuint"},scaleX:.3,scaleY:.3,duration:this.options.outDuration,easing:"easeOutQuint",complete:function(t){e._resetDropdownStyles(),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}})}},{key:"_placeDropdown",value:function(){var e=this.options.constrainWidth?this.el.getBoundingClientRect().width:this.dropdownEl.getBoundingClientRect().width;this.dropdownEl.style.width=e+"px";var t=this._getDropdownPosition();this.dropdownEl.style.left=t.x+"px",this.dropdownEl.style.top=t.y+"px",this.dropdownEl.style.height=t.height+"px",this.dropdownEl.style.width=t.width+"px",this.dropdownEl.style.transformOrigin=("left"===t.horizontalAlignment?"0":"100%")+" "+("top"===t.verticalAlignment?"0":"100%")}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this._resetDropdownStyles(),this.dropdownEl.style.display="block",this._placeDropdown(),this._animateIn(),this._setupTemporaryEventHandlers())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus())}},{key:"recalculateDimensions",value:function(){this.isOpen&&(this.$dropdownEl.css({width:"",height:"",left:"",top:"","transform-origin":""}),this._placeDropdown())}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Dropdown}},{key:"defaults",get:function(){return c}}]),t}())._dropdowns=[],M.Dropdown=d,M.jQueryLoaded&&M.initializeJqueryWrapper(d,"dropdown","M_Dropdown"),h=cash,p=M.anime,f={opacity:.5,inDuration:250,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,preventScrolling:!0,dismissible:!0,startingTop:"4%",endingTop:"10%"},(m=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Modal=i).options=h.extend({},t.defaults,n),i.isOpen=!1,i.id=i.$el.attr("id"),i._openingTrigger=void 0,i.$overlay=h(''),i.el.tabIndex=0,i._nthModalOpened=0,t._count++,i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){t._count--,this._removeEventHandlers(),this.el.removeAttribute("style"),this.$overlay.remove(),this.el.M_Modal=void 0}},{key:"_setupEventHandlers",value:function(){this._handleOverlayClickBound=this._handleOverlayClick.bind(this),this._handleModalCloseClickBound=this._handleModalCloseClick.bind(this),1===t._count&&document.body.addEventListener("click",this._handleTriggerClick),this.$overlay[0].addEventListener("click",this._handleOverlayClickBound),this.el.addEventListener("click",this._handleModalCloseClickBound)}},{key:"_removeEventHandlers",value:function(){0===t._count&&document.body.removeEventListener("click",this._handleTriggerClick),this.$overlay[0].removeEventListener("click",this._handleOverlayClickBound),this.el.removeEventListener("click",this._handleModalCloseClickBound)}},{key:"_handleTriggerClick",value:function(e){var t=h(e.target).closest(".modal-trigger");if(t.length){var n=M.getIdFromTrigger(t[0]),i=document.getElementById(n).M_Modal;i&&i.open(t),e.preventDefault()}}},{key:"_handleOverlayClick",value:function(){this.options.dismissible&&this.close()}},{key:"_handleModalCloseClick",value:function(e){h(e.target).closest(".modal-close").length&&this.close()}},{key:"_handleKeydown",value:function(e){27===e.keyCode&&this.options.dismissible&&this.close()}},{key:"_handleFocus",value:function(e){this.el.contains(e.target)||this._nthModalOpened!==t._modalsOpen||this.el.focus()}},{key:"_animateIn",value:function(){var e=this;h.extend(this.el.style,{display:"block",opacity:0}),h.extend(this.$overlay[0].style,{display:"block",opacity:0}),p({targets:this.$overlay[0],opacity:this.options.opacity,duration:this.options.inDuration,easing:"easeOutQuad"});var t={targets:this.el,duration:this.options.inDuration,easing:"easeOutCubic",complete:function(){"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el,e._openingTrigger)}};this.el.classList.contains("bottom-sheet")?h.extend(t,{bottom:0,opacity:1}):h.extend(t,{top:[this.options.startingTop,this.options.endingTop],opacity:1,scaleX:[.8,1],scaleY:[.8,1]}),p(t)}},{key:"_animateOut",value:function(){var e=this;p({targets:this.$overlay[0],opacity:0,duration:this.options.outDuration,easing:"easeOutQuart"});var t={targets:this.el,duration:this.options.outDuration,easing:"easeOutCubic",complete:function(){e.el.style.display="none",e.$overlay.remove(),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}};this.el.classList.contains("bottom-sheet")?h.extend(t,{bottom:"-100%",opacity:0}):h.extend(t,{top:[this.options.endingTop,this.options.startingTop],opacity:0,scaleX:.8,scaleY:.8}),p(t)}},{key:"open",value:function(e){if(!this.isOpen)return this.isOpen=!0,t._modalsOpen++,this._nthModalOpened=t._modalsOpen,this.$overlay[0].style.zIndex=1e3+2*t._modalsOpen,this.el.style.zIndex=1e3+2*t._modalsOpen+1,this._openingTrigger=e?e[0]:void 0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el,this._openingTrigger),this.options.preventScrolling&&(document.body.style.overflow="hidden"),this.el.classList.add("open"),this.el.insertAdjacentElement("afterend",this.$overlay[0]),this.options.dismissible&&(this._handleKeydownBound=this._handleKeydown.bind(this),this._handleFocusBound=this._handleFocus.bind(this),document.addEventListener("keydown",this._handleKeydownBound),document.addEventListener("focus",this._handleFocusBound,!0)),p.remove(this.el),p.remove(this.$overlay[0]),this._animateIn(),this.el.focus(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,t._modalsOpen--,this._nthModalOpened=0,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this.el.classList.remove("open"),0===t._modalsOpen&&(document.body.style.overflow=""),this.options.dismissible&&(document.removeEventListener("keydown",this._handleKeydownBound),document.removeEventListener("focus",this._handleFocusBound,!0)),p.remove(this.el),p.remove(this.$overlay[0]),this._animateOut(),this}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Modal}},{key:"defaults",get:function(){return f}}]),t}())._modalsOpen=0,m._count=0,M.Modal=m,M.jQueryLoaded&&M.initializeJqueryWrapper(m,"modal","M_Modal"),g=cash,y=M.anime,v={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},w=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Materialbox=i).options=g.extend({},t.defaults,n),i.overlayActive=!1,i.doneAnimating=!0,i.placeholder=g("
      ").addClass("material-placeholder"),i.originalWidth=0,i.originalHeight=0,i.originInlineStyles=i.$el.attr("style"),i.caption=i.el.getAttribute("data-caption")||"",i.$el.before(i.placeholder),i.placeholder.append(i.$el),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Materialbox=void 0,g(this.placeholder).after(this.el).remove(),this.$el.removeAttr("style")}},{key:"_setupEventHandlers",value:function(){this._handleMaterialboxClickBound=this._handleMaterialboxClick.bind(this),this.el.addEventListener("click",this._handleMaterialboxClickBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleMaterialboxClickBound)}},{key:"_handleMaterialboxClick",value:function(e){!1===this.doneAnimating||this.overlayActive&&this.doneAnimating?this.close():this.open()}},{key:"_handleWindowScroll",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowResize",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowEscape",value:function(e){27===e.keyCode&&this.doneAnimating&&this.overlayActive&&this.close()}},{key:"_makeAncestorsOverflowVisible",value:function(){this.ancestorsChanged=g();for(var e=this.placeholder[0].parentNode;null!==e&&!g(e).is(document);){var t=g(e);"visible"!==t.css("overflow")&&(t.css("overflow","visible"),void 0===this.ancestorsChanged?this.ancestorsChanged=t:this.ancestorsChanged=this.ancestorsChanged.add(t)),e=e.parentNode}}},{key:"_animateImageIn",value:function(){var e=this,t={targets:this.el,height:[this.originalHeight,this.newHeight],width:[this.originalWidth,this.newWidth],left:M.getDocumentScrollLeft()+this.windowWidth/2-this.placeholder.offset().left-this.newWidth/2,top:M.getDocumentScrollTop()+this.windowHeight/2-this.placeholder.offset().top-this.newHeight/2,duration:this.options.inDuration,easing:"easeOutQuad",complete:function(){e.doneAnimating=!0,"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el)}};this.maxWidth=this.$el.css("max-width"),this.maxHeight=this.$el.css("max-height"),"none"!==this.maxWidth&&(t.maxWidth=this.newWidth),"none"!==this.maxHeight&&(t.maxHeight=this.newHeight),y(t)}},{key:"_animateImageOut",value:function(){var e=this;y({targets:this.el,width:this.originalWidth,height:this.originalHeight,left:0,top:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:function(){e.placeholder.css({height:"",width:"",position:"",top:"",left:""}),e.attrWidth&&e.$el.attr("width",e.attrWidth),e.attrHeight&&e.$el.attr("height",e.attrHeight),e.$el.removeAttr("style"),e.originInlineStyles&&e.$el.attr("style",e.originInlineStyles),e.$el.removeClass("active"),e.doneAnimating=!0,e.ancestorsChanged.length&&e.ancestorsChanged.css("overflow",""),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}})}},{key:"_updateVars",value:function(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}},{key:"open",value:function(){var e=this;this._updateVars(),this.originalWidth=this.el.getBoundingClientRect().width,this.originalHeight=this.el.getBoundingClientRect().height,this.doneAnimating=!1,this.$el.addClass("active"),this.overlayActive=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this.placeholder.css({width:this.placeholder[0].getBoundingClientRect().width+"px",height:this.placeholder[0].getBoundingClientRect().height+"px",position:"relative",top:0,left:0}),this._makeAncestorsOverflowVisible(),this.$el.css({position:"absolute","z-index":1e3,"will-change":"left, top, width, height"}),this.attrWidth=this.$el.attr("width"),this.attrHeight=this.$el.attr("height"),this.attrWidth&&(this.$el.css("width",this.attrWidth+"px"),this.$el.removeAttr("width")),this.attrHeight&&(this.$el.css("width",this.attrHeight+"px"),this.$el.removeAttr("height")),this.$overlay=g('
      ').css({opacity:0}).one("click",function(){e.doneAnimating&&e.close()}),this.$el.before(this.$overlay);var t=this.$overlay[0].getBoundingClientRect();this.$overlay.css({width:this.windowWidth+"px",height:this.windowHeight+"px",left:-1*t.left+"px",top:-1*t.top+"px"}),y.remove(this.el),y.remove(this.$overlay[0]),y({targets:this.$overlay[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}),""!==this.caption&&(this.$photocaption&&y.remove(this.$photoCaption[0]),this.$photoCaption=g('
      '),this.$photoCaption.text(this.caption),g("body").append(this.$photoCaption),this.$photoCaption.css({display:"inline"}),y({targets:this.$photoCaption[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}));var n=0,i=this.originalWidth/this.windowWidth,r=this.originalHeight/this.windowHeight;this.newWidth=0,this.newHeight=0,ri.options.responsiveThreshold,i.$img=i.$el.find("img").first(),i.$img.each(function(){this.complete&&b(this).trigger("load")}),i._updateParallax(),i._setupEventHandlers(),i._setupStyles(),t._parallaxes.push(i),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){t._parallaxes.splice(t._parallaxes.indexOf(this),1),this.$img[0].style.transform="",this._removeEventHandlers(),this.$el[0].M_Parallax=void 0}},{key:"_setupEventHandlers",value:function(){this._handleImageLoadBound=this._handleImageLoad.bind(this),this.$img[0].addEventListener("load",this._handleImageLoadBound),0===t._parallaxes.length&&(t._handleScrollThrottled=M.throttle(t._handleScroll,5),window.addEventListener("scroll",t._handleScrollThrottled),t._handleWindowResizeThrottled=M.throttle(t._handleWindowResize,5),window.addEventListener("resize",t._handleWindowResizeThrottled))}},{key:"_removeEventHandlers",value:function(){this.$img[0].removeEventListener("load",this._handleImageLoadBound),0===t._parallaxes.length&&(window.removeEventListener("scroll",t._handleScrollThrottled),window.removeEventListener("resize",t._handleWindowResizeThrottled))}},{key:"_setupStyles",value:function(){this.$img[0].style.opacity=1}},{key:"_handleImageLoad",value:function(){this._updateParallax()}},{key:"_updateParallax",value:function(){var e=0n.options.responsiveThreshold}}},{key:"defaults",get:function(){return E}}]),t}())._parallaxes=[],M.Parallax=T,M.jQueryLoaded&&M.initializeJqueryWrapper(T,"parallax","M_Parallax"),_=cash,x=M.anime,A={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},S=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Tabs=i).options=_.extend({},t.defaults,n),i.$tabLinks=i.$el.children("li.tab").children("a"),i.index=0,i._setupActiveTabLink(),i.options.swipeable?i._setupSwipeableTabs():i._setupNormalTabs(),i._setTabsAndTabWidth(),i._createIndicator(),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.$el[0].M_Tabs=void 0}},{key:"_setupEventHandlers",value:function(){this._handleWindowResizeBound=this._handleWindowResize.bind(this),window.addEventListener("resize",this._handleWindowResizeBound),this._handleTabClickBound=this._handleTabClick.bind(this),this.el.addEventListener("click",this._handleTabClickBound)}},{key:"_removeEventHandlers",value:function(){window.removeEventListener("resize",this._handleWindowResizeBound),this.el.removeEventListener("click",this._handleTabClickBound)}},{key:"_handleWindowResize",value:function(){this._setTabsAndTabWidth(),0!==this.tabWidth&&0!==this.tabsWidth&&(this._indicator.style.left=this._calcLeftPos(this.$activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this.$activeTabLink)+"px")}},{key:"_handleTabClick",value:function(e){var t=this,n=_(e.target).closest("li.tab"),i=_(e.target).closest("a");if(i.length&&i.parent().hasClass("tab")){if(n.hasClass("disabled"))e.preventDefault();else if(!i.attr("target")){this.$activeTabLink.removeClass("active");var r=this.$content;this.$activeTabLink=i,this.$content=_(M.escapeHash(i[0].hash)),this.$tabLinks=this.$el.children("li.tab").children("a"),this.$activeTabLink.addClass("active");var o=this.index;this.index=Math.max(this.$tabLinks.index(i),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this.index,function(){"function"==typeof t.options.onShow&&t.options.onShow.call(t,t.$content[0])}):this.$content.length&&(this.$content[0].style.display="block",this.$content.addClass("active"),"function"==typeof this.options.onShow&&this.options.onShow.call(this,this.$content[0]),r.length&&!r.is(this.$content)&&(r[0].style.display="none",r.removeClass("active"))),this._setTabsAndTabWidth(),this._animateIndicator(o),e.preventDefault()}}}},{key:"_createIndicator",value:function(){var e=this,t=document.createElement("li");t.classList.add("indicator"),this.el.appendChild(t),this._indicator=t,setTimeout(function(){e._indicator.style.left=e._calcLeftPos(e.$activeTabLink)+"px",e._indicator.style.right=e._calcRightPos(e.$activeTabLink)+"px"},0)}},{key:"_setupActiveTabLink",value:function(){this.$activeTabLink=_(this.$tabLinks.filter('[href="'+location.hash+'"]')),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a.active").first()),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a").first()),this.$tabLinks.removeClass("active"),this.$activeTabLink[0].classList.add("active"),this.index=Math.max(this.$tabLinks.index(this.$activeTabLink),0),this.$activeTabLink.length&&(this.$content=_(M.escapeHash(this.$activeTabLink[0].hash)),this.$content.addClass("active"))}},{key:"_setupSwipeableTabs",value:function(){var e=this;window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);var t=_();this.$tabLinks.each(function(e){var n=_(M.escapeHash(e.hash));n.addClass("carousel-item"),t=t.add(n)});var n=_('');t.first().before(n),n.append(t),t[0].style.display="";var i=this.$activeTabLink.closest(".tab").index();this._tabsCarousel=M.Carousel.init(n[0],{fullWidth:!0,noWrap:!0,onCycleTo:function(t){var n=e.index;e.index=_(t).index(),e.$activeTabLink.removeClass("active"),e.$activeTabLink=e.$tabLinks.eq(e.index),e.$activeTabLink.addClass("active"),e._animateIndicator(n),"function"==typeof e.options.onShow&&e.options.onShow.call(e,e.$content[0])}}),this._tabsCarousel.set(i)}},{key:"_teardownSwipeableTabs",value:function(){var e=this._tabsCarousel.$el;this._tabsCarousel.destroy(),e.after(e.children()),e.remove()}},{key:"_setupNormalTabs",value:function(){this.$tabLinks.not(this.$activeTabLink).each(function(e){if(e.hash){var t=_(M.escapeHash(e.hash));t.length&&(t[0].style.display="none")}})}},{key:"_teardownNormalTabs",value:function(){this.$tabLinks.each(function(e){if(e.hash){var t=_(M.escapeHash(e.hash));t.length&&(t[0].style.display="")}})}},{key:"_setTabsAndTabWidth",value:function(){this.tabsWidth=this.$el.width(),this.tabWidth=Math.max(this.tabsWidth,this.el.scrollWidth)/this.$tabLinks.length}},{key:"_calcRightPos",value:function(e){return Math.ceil(this.tabsWidth-e.position().left-e[0].getBoundingClientRect().width)}},{key:"_calcLeftPos",value:function(e){return Math.floor(e.position().left)}},{key:"updateTabIndicator",value:function(){this._setTabsAndTabWidth(),this._animateIndicator(this.index)}},{key:"_animateIndicator",value:function(e){var t=0,n=0;0<=this.index-e?t=90:n=90;var i={targets:this._indicator,left:{value:this._calcLeftPos(this.$activeTabLink),delay:t},right:{value:this._calcRightPos(this.$activeTabLink),delay:n},duration:this.options.duration,easing:"easeOutQuad"};x.remove(this._indicator),x(i)}},{key:"select",value:function(e){var t=this.$tabLinks.filter('[href="#'+e+'"]');t.length&&t.trigger("click")}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Tabs}},{key:"defaults",get:function(){return A}}]),t}(),M.Tabs=S,M.jQueryLoaded&&M.initializeJqueryWrapper(S,"tabs","M_Tabs"),L=cash,N=M.anime,I={exitDelay:200,enterDelay:0,html:null,margin:5,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10},k=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Tooltip=i).options=L.extend({},t.defaults,n),i.isOpen=!1,i.isHovered=!1,i.isFocused=!1,i._appendTooltipEl(),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){L(this.tooltipEl).remove(),this._removeEventHandlers(),this.el.M_Tooltip=void 0}},{key:"_appendTooltipEl",value:function(){var e=document.createElement("div");e.classList.add("material-tooltip"),this.tooltipEl=e;var t=document.createElement("div");t.classList.add("tooltip-content"),t.innerHTML=this.options.html,e.appendChild(t),document.body.appendChild(e)}},{key:"_updateTooltipContent",value:function(){this.tooltipEl.querySelector(".tooltip-content").innerHTML=this.options.html}},{key:"_setupEventHandlers",value:function(){this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this._handleFocusBound=this._handleFocus.bind(this),this._handleBlurBound=this._handleBlur.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.el.addEventListener("focus",this._handleFocusBound,!0),this.el.addEventListener("blur",this._handleBlurBound,!0)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.el.removeEventListener("focus",this._handleFocusBound,!0),this.el.removeEventListener("blur",this._handleBlurBound,!0)}},{key:"open",value:function(e){this.isOpen||(e=void 0===e||void 0,this.isOpen=!0,this.options=L.extend({},this.options,this._getAttributeOptions()),this._updateTooltipContent(),this._setEnterDelayTimeout(e))}},{key:"close",value:function(){this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this._setExitDelayTimeout())}},{key:"_setExitDelayTimeout",value:function(){var e=this;clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(function(){e.isHovered||e.isFocused||e._animateOut()},this.options.exitDelay)}},{key:"_setEnterDelayTimeout",value:function(e){var t=this;clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(function(){(t.isHovered||t.isFocused||e)&&t._animateIn()},this.options.enterDelay)}},{key:"_positionTooltip",value:function(){var e,t=this.el,n=this.tooltipEl,i=t.offsetHeight,r=t.offsetWidth,o=n.offsetHeight,s=n.offsetWidth,a=this.options.margin,l=void 0,u=void 0;this.xMovement=0,this.yMovement=0,l=t.getBoundingClientRect().top+M.getDocumentScrollTop(),u=t.getBoundingClientRect().left+M.getDocumentScrollLeft(),"top"===this.options.position?(l+=-o-a,u+=r/2-s/2,this.yMovement=-this.options.transitionMovement):"right"===this.options.position?(l+=i/2-o/2,u+=r+a,this.xMovement=this.options.transitionMovement):"left"===this.options.position?(l+=i/2-o/2,u+=-s-a,this.xMovement=-this.options.transitionMovement):(l+=i+a,u+=r/2-s/2,this.yMovement=this.options.transitionMovement),e=this._repositionWithinScreen(u,l,s,o),L(n).css({top:e.y+"px",left:e.x+"px"})}},{key:"_repositionWithinScreen",value:function(e,t,n,i){var r=M.getDocumentScrollLeft(),o=M.getDocumentScrollTop(),s=e-r,a=t-o,l={left:s,top:a,width:n,height:i},u=this.options.margin+this.options.transitionMovement,c=M.checkWithinContainer(document.body,l,u);return c.left?s=u:c.right&&(s-=s+n-window.innerWidth),c.top?a=u:c.bottom&&(a-=a+i-window.innerHeight),{x:s+r,y:a+o}}},{key:"_animateIn",value:function(){this._positionTooltip(),this.tooltipEl.style.visibility="visible",N.remove(this.tooltipEl),N({targets:this.tooltipEl,opacity:1,translateX:this.xMovement,translateY:this.yMovement,duration:this.options.inDuration,easing:"easeOutCubic"})}},{key:"_animateOut",value:function(){N.remove(this.tooltipEl),N({targets:this.tooltipEl,opacity:0,translateX:0,translateY:0,duration:this.options.outDuration,easing:"easeOutCubic"})}},{key:"_handleMouseEnter",value:function(){this.isHovered=!0,this.isFocused=!1,this.open(!1)}},{key:"_handleMouseLeave",value:function(){this.isHovered=!1,this.isFocused=!1,this.close()}},{key:"_handleFocus",value:function(){M.tabPressed&&(this.isFocused=!0,this.open(!1))}},{key:"_handleBlur",value:function(){this.isFocused=!1,this.close()}},{key:"_getAttributeOptions",value:function(){var e={},t=this.el.getAttribute("data-tooltip"),n=this.el.getAttribute("data-position");return t&&(e.html=t),n&&(e.position=n),e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Tooltip}},{key:"defaults",get:function(){return I}}]),t}(),M.Tooltip=k,M.jQueryLoaded&&M.initializeJqueryWrapper(k,"tooltip","M_Tooltip"),function(e){"use strict";var t=t||{},n=document.querySelectorAll.bind(document);function i(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+=n+":"+e[n]+";");return t}var r={duration:750,show:function(e,t){if(2===e.button)return!1;var n=t||this,o=document.createElement("div");o.className="waves-ripple",n.appendChild(o);var s,a,l,u,c=(l={top:0,left:0},s=(u=n&&n.ownerDocument).documentElement,void 0!==n.getBoundingClientRect&&(l=n.getBoundingClientRect()),a=null!==u&&u===u.window?u:9===u.nodeType&&u.defaultView,{top:l.top+a.pageYOffset-s.clientTop,left:l.left+a.pageXOffset-s.clientLeft}),d=e.pageY-c.top,h=e.pageX-c.left,p="scale("+n.clientWidth/100*10+")";"touches"in e&&(d=e.touches[0].pageY-c.top,h=e.touches[0].pageX-c.left),o.setAttribute("data-hold",Date.now()),o.setAttribute("data-scale",p),o.setAttribute("data-x",h),o.setAttribute("data-y",d);var f={top:d+"px",left:h+"px"};o.className=o.className+" waves-notransition",o.setAttribute("style",i(f)),o.className=o.className.replace("waves-notransition",""),f["-webkit-transform"]=p,f["-moz-transform"]=p,f["-ms-transform"]=p,f["-o-transform"]=p,f.transform=p,f.opacity="1",f["-webkit-transition-duration"]=r.duration+"ms",f["-moz-transition-duration"]=r.duration+"ms",f["-o-transition-duration"]=r.duration+"ms",f["transition-duration"]=r.duration+"ms",f["-webkit-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-moz-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-o-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",o.setAttribute("style",i(f))},hide:function(e){o.touchup(e);var t=this,n=(t.clientWidth,null),s=t.getElementsByClassName("waves-ripple");if(!(0t.el.offsetWidth*t.options.activationPercent||1"+o+""+s+""+a+""),n.length&&t.prepend(n)}},{key:"_resetCurrentElement",value:function(){this.activeIndex=-1,this.$active.removeClass("active")}},{key:"_resetAutocomplete",value:function(){W(this.container).empty(),this._resetCurrentElement(),this.oldVal=null,this.isOpen=!1,this._mousedown=!1}},{key:"selectOption",value:function(e){var t=e.text().trim();this.el.value=t,this.$el.trigger("change"),this._resetAutocomplete(),this.close(),"function"==typeof this.options.onAutocomplete&&this.options.onAutocomplete.call(this,t)}},{key:"_renderDropdown",value:function(e,t){var n=this;this._resetAutocomplete();var i=[];for(var r in e)if(e.hasOwnProperty(r)&&-1!==r.toLowerCase().indexOf(t)){if(this.count>=this.options.limit)break;var o={data:e[r],key:r};i.push(o),this.count++}this.options.sortFunction&&i.sort(function(e,i){return n.options.sortFunction(e.key.toLowerCase(),i.key.toLowerCase(),t.toLowerCase())});for(var s=0;s");a.data?l.append(''+a.key+""):l.append(""+a.key+""),W(this.container).append(l),this._highlight(t,l)}}},{key:"open",value:function(){var e=this.el.value.toLowerCase();this._resetAutocomplete(),e.length>=this.options.minLength&&(this.isOpen=!0,this._renderDropdown(this.options.data,e)),this.dropdown.isOpen?this.dropdown.recalculateDimensions():this.dropdown.open()}},{key:"close",value:function(){this.dropdown.close()}},{key:"updateData",value:function(e){var t=this.el.value.toLowerCase();this.options.data=e,this.isOpen&&this._renderDropdown(e,t)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Autocomplete}},{key:"defaults",get:function(){return Q}}]),t}())._keydown=!1,M.Autocomplete=V,M.jQueryLoaded&&M.initializeJqueryWrapper(V,"autocomplete","M_Autocomplete"),G=cash,M.updateTextFields=function(){G("input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea").each(function(e,t){var n=G(this);0'),G("body").append(t));var n=e.css("font-family"),i=e.css("font-size"),r=e.css("line-height"),o=e.css("padding-top"),s=e.css("padding-right"),a=e.css("padding-bottom"),l=e.css("padding-left");i&&t.css("font-size",i),n&&t.css("font-family",n),r&&t.css("line-height",r),o&&t.css("padding-top",o),s&&t.css("padding-right",s),a&&t.css("padding-bottom",a),l&&t.css("padding-left",l),e.data("original-height")||e.data("original-height",e.height()),"off"===e.attr("wrap")&&t.css("overflow-wrap","normal").css("white-space","pre"),t.text(e[0].value+"\n");var u=t.html().replace(/\n/g,"
      ");t.html(u),0
    '),this.$slides.each(function(t,n){var i=K('
  • ');e.$indicators.append(i[0])}),this.$el.append(this.$indicators[0]),this.$indicators=this.$indicators.children("li.indicator-item"))}},{key:"_removeIndicators",value:function(){this.$el.find("ul.indicators").remove()}},{key:"set",value:function(e){var t=this;if(e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.activeIndex!=e){this.$active=this.$slides.eq(this.activeIndex);var n=this.$active.find(".caption");this.$active.removeClass("active"),q({targets:this.$active[0],opacity:0,duration:this.options.duration,easing:"easeOutQuad",complete:function(){t.$slides.not(".active").each(function(e){q({targets:e,opacity:0,translateX:0,translateY:0,duration:0,easing:"easeOutQuad"})})}}),this._animateCaptionIn(n[0],this.options.duration),this.options.indicators&&(this.$indicators.eq(this.activeIndex).removeClass("active"),this.$indicators.eq(e).addClass("active")),q({targets:this.$slides.eq(e)[0],opacity:1,duration:this.options.duration,easing:"easeOutQuad"}),q({targets:this.$slides.eq(e).find(".caption")[0],opacity:1,translateX:0,translateY:0,duration:this.options.duration,delay:this.options.duration,easing:"easeOutQuad"}),this.$slides.eq(e).addClass("active"),this.activeIndex=e,this.start()}}},{key:"pause",value:function(){clearInterval(this.interval)}},{key:"start",value:function(){clearInterval(this.interval),this.interval=setInterval(this._handleIntervalBound,this.options.duration+this.options.interval)}},{key:"next",value:function(){var e=this.activeIndex+1;e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.set(e)}},{key:"prev",value:function(){var e=this.activeIndex-1;e>=this.$slides.length?e=0:e<0&&(e=this.$slides.length-1),this.set(e)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Slider}},{key:"defaults",get:function(){return Z}}]),t}(),M.Slider=X,M.jQueryLoaded&&M.initializeJqueryWrapper(X,"slider","M_Slider"),function(e,t){e(document).on("click",".card",function(n){if(e(this).children(".card-reveal").length){var i=e(n.target).closest(".card");void 0===i.data("initialOverflow")&&i.data("initialOverflow",void 0===i.css("overflow")?"":i.css("overflow"));var r=e(this).find(".card-reveal");e(n.target).is(e(".card-reveal .card-title"))||e(n.target).is(e(".card-reveal .card-title i"))?t({targets:r[0],translateY:0,duration:225,easing:"easeInOutQuad",complete:function(t){e(t.animatables[0].target).css({display:"none"}),i.css("overflow",i.data("initialOverflow"))}}):(e(n.target).is(e(".card .activator"))||e(n.target).is(e(".card .activator i")))&&(i.css("overflow","hidden"),r.css({display:"block"}),t({targets:r[0],translateY:"-100%",duration:300,easing:"easeInOutQuad"}))}})}(cash,M.anime),J=cash,ee={data:[],placeholder:"",secondaryPlaceholder:"",autocompleteOptions:{},limit:1/0,onChipAdd:null,onChipSelect:null,onChipDelete:null},(et=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Chips=i).options=J.extend({},t.defaults,n),i.$el.addClass("chips input-field"),i.chipsData=[],i.$chips=J(),i._setupInput(),i.hasAutocomplete=0"),this.$el.append(this.$input)),this.$input.addClass("input")}},{key:"_setupLabel",value:function(){this.$label=this.$el.find("label"),this.$label.length&&this.$label.setAttribute("for",this.$input.attr("id"))}},{key:"_setPlaceholder",value:function(){void 0!==this.chipsData&&!this.chipsData.length&&this.options.placeholder?J(this.$input).prop("placeholder",this.options.placeholder):(void 0===this.chipsData||this.chipsData.length)&&this.options.secondaryPlaceholder&&J(this.$input).prop("placeholder",this.options.secondaryPlaceholder)}},{key:"_isValid",value:function(e){if(e.hasOwnProperty("tag")&&""!==e.tag){for(var t=!1,n=0;n=this.options.limit)){var t=this._renderChip(e);this.$chips.add(t),this.chipsData.push(e),J(this.$input).before(t),this._setPlaceholder(),"function"==typeof this.options.onChipAdd&&this.options.onChipAdd.call(this,this.$el,t)}}},{key:"deleteChip",value:function(e){var t=this.$chips.eq(e);this.$chips.eq(e).remove(),this.$chips=this.$chips.filter(function(e){return 0<=J(e).index()}),this.chipsData.splice(e,1),this._setPlaceholder(),"function"==typeof this.options.onChipDelete&&this.options.onChipDelete.call(this,this.$el,t[0])}},{key:"selectChip",value:function(e){var t=this.$chips.eq(e);(this._selectedChip=t)[0].focus(),"function"==typeof this.options.onChipSelect&&this.options.onChipSelect.call(this,this.$el,t[0])}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Chips}},{key:"_handleChipsKeydown",value:function(e){t._keydown=!0;var n=J(e.target).closest(".chips"),i=e.target&&n.length;if(!J(e.target).is("input, textarea")&&i){var r=n[0].M_Chips;if(8===e.keyCode||46===e.keyCode){e.preventDefault();var o=r.chipsData.length;if(r._selectedChip){var s=r._selectedChip.index();r.deleteChip(s),r._selectedChip=null,o=Math.max(s-1,0)}r.chipsData.length&&r.selectChip(o)}else if(37===e.keyCode){if(r._selectedChip){var a=r._selectedChip.index()-1;if(a<0)return;r.selectChip(a)}}else if(39===e.keyCode&&r._selectedChip){var l=r._selectedChip.index()+1;l>=r.chipsData.length?r.$input[0].focus():r.selectChip(l)}}}},{key:"_handleChipsKeyup",value:function(e){t._keydown=!1}},{key:"_handleChipsBlur",value:function(e){t._keydown||(J(e.target).closest(".chips")[0].M_Chips._selectedChip=null)}},{key:"defaults",get:function(){return ee}}]),t}())._keydown=!1,M.Chips=et,M.jQueryLoaded&&M.initializeJqueryWrapper(et,"chips","M_Chips"),J(document).ready(function(){J(document.body).on("click",".chip .close",function(){var e=J(this).closest(".chips");e.length&&e[0].M_Chips||J(this).closest(".chip").remove()})}),en=cash,ei={top:0,bottom:1/0,offset:0,onPositionChange:null},(er=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Pushpin=i).options=en.extend({},t.defaults,n),i.originalOffset=i.el.offsetTop,t._pushpins.push(i),i._setupEventHandlers(),i._updatePosition(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this.el.style.top=null,this._removePinClasses(),this._removeEventHandlers();var e=t._pushpins.indexOf(this);t._pushpins.splice(e,1)}},{key:"_setupEventHandlers",value:function(){document.addEventListener("scroll",t._updateElements)}},{key:"_removeEventHandlers",value:function(){document.removeEventListener("scroll",t._updateElements)}},{key:"_updatePosition",value:function(){var e=M.getDocumentScrollTop()+this.options.offset;this.options.top<=e&&this.options.bottom>=e&&!this.el.classList.contains("pinned")&&(this._removePinClasses(),this.el.style.top=this.options.offset+"px",this.el.classList.add("pinned"),"function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pinned")),ethis.options.bottom&&!this.el.classList.contains("pin-bottom")&&(this._removePinClasses(),this.el.classList.add("pin-bottom"),this.el.style.top=this.options.bottom-this.originalOffset+"px","function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pin-bottom"))}},{key:"_removePinClasses",value:function(){this.el.classList.remove("pin-top"),this.el.classList.remove("pinned"),this.el.classList.remove("pin-bottom")}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Pushpin}},{key:"_updateElements",value:function(){for(var e in t._pushpins)t._pushpins[e]._updatePosition()}},{key:"defaults",get:function(){return ei}}]),t}())._pushpins=[],M.Pushpin=er,M.jQueryLoaded&&M.initializeJqueryWrapper(er,"pushpin","M_Pushpin"),eo=cash,es=M.anime,ea={direction:"top",hoverEnabled:!0,toolbarEnabled:!1},eo.fn.reverse=[].reverse,el=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_FloatingActionButton=i).options=eo.extend({},t.defaults,n),i.isOpen=!1,i.$anchor=i.$el.children("a").first(),i.$menu=i.$el.children("ul").first(),i.$floatingBtns=i.$el.find("ul .btn-floating"),i.$floatingBtnsReverse=i.$el.find("ul .btn-floating").reverse(),i.offsetY=0,i.offsetX=0,i.$el.addClass("direction-"+i.options.direction),"top"===i.options.direction?i.offsetY=40:"right"===i.options.direction?i.offsetX=-40:"bottom"===i.options.direction?i.offsetY=-40:i.offsetX=40,i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_FloatingActionButton=void 0}},{key:"_setupEventHandlers",value:function(){this._handleFABClickBound=this._handleFABClick.bind(this),this._handleOpenBound=this.open.bind(this),this._handleCloseBound=this.close.bind(this),this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.addEventListener("mouseenter",this._handleOpenBound),this.el.addEventListener("mouseleave",this._handleCloseBound)):this.el.addEventListener("click",this._handleFABClickBound)}},{key:"_removeEventHandlers",value:function(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.removeEventListener("mouseenter",this._handleOpenBound),this.el.removeEventListener("mouseleave",this._handleCloseBound)):this.el.removeEventListener("click",this._handleFABClickBound)}},{key:"_handleFABClick",value:function(){this.isOpen?this.close():this.open()}},{key:"_handleDocumentClick",value:function(e){eo(e.target).closest(this.$menu).length||this.close()}},{key:"open",value:function(){this.isOpen||(this.options.toolbarEnabled?this._animateInToolbar():this._animateInFAB(),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.options.toolbarEnabled?(window.removeEventListener("scroll",this._handleCloseBound,!0),document.body.removeEventListener("click",this._handleDocumentClickBound,!0),this._animateOutToolbar()):this._animateOutFAB(),this.isOpen=!1)}},{key:"_animateInFAB",value:function(){var e=this;this.$el.addClass("active");var t=0;this.$floatingBtnsReverse.each(function(n){es({targets:n,opacity:1,scale:[.4,1],translateY:[e.offsetY,0],translateX:[e.offsetX,0],duration:275,delay:t,easing:"easeInOutQuad"}),t+=40})}},{key:"_animateOutFAB",value:function(){var e=this;this.$floatingBtnsReverse.each(function(t){es.remove(t),es({targets:t,opacity:0,scale:.4,translateY:e.offsetY,translateX:e.offsetX,duration:175,easing:"easeOutQuad",complete:function(){e.$el.removeClass("active")}})})}},{key:"_animateInToolbar",value:function(){var e,t=this,n=window.innerWidth,i=window.innerHeight,r=this.el.getBoundingClientRect(),o=eo('
    '),s=this.$anchor.css("background-color");this.$anchor.append(o),this.offsetX=r.left-n/2+r.width/2,this.offsetY=i-r.bottom,e=n/o[0].clientWidth,this.btnBottom=r.bottom,this.btnLeft=r.left,this.btnWidth=r.width,this.$el.addClass("active"),this.$el.css({"text-align":"center",width:"100%",bottom:0,left:0,transform:"translateX("+this.offsetX+"px)",transition:"none"}),this.$anchor.css({transform:"translateY("+-this.offsetY+"px)",transition:"none"}),o.css({"background-color":s}),setTimeout(function(){t.$el.css({transform:"",transition:"transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s"}),t.$anchor.css({overflow:"visible",transform:"",transition:"transform .2s"}),setTimeout(function(){t.$el.css({overflow:"hidden","background-color":s}),o.css({transform:"scale("+e+")",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"}),t.$menu.children("li").children("a").css({opacity:1}),t._handleDocumentClickBound=t._handleDocumentClick.bind(t),window.addEventListener("scroll",t._handleCloseBound,!0),document.body.addEventListener("click",t._handleDocumentClickBound,!0)},100)},0)}},{key:"_animateOutToolbar",value:function(){var e=this,t=window.innerWidth,n=window.innerHeight,i=this.$el.find(".fab-backdrop"),r=this.$anchor.css("background-color");this.offsetX=this.btnLeft-t/2+this.btnWidth/2,this.offsetY=n-this.btnBottom,this.$el.removeClass("active"),this.$el.css({"background-color":"transparent",transition:"none"}),this.$anchor.css({transition:"none"}),i.css({transform:"scale(0)","background-color":r}),this.$menu.children("li").children("a").css({opacity:""}),setTimeout(function(){i.remove(),e.$el.css({"text-align":"",width:"",bottom:"",left:"",overflow:"","background-color":"",transform:"translate3d("+-e.offsetX+"px,0,0)"}),e.$anchor.css({overflow:"",transform:"translate3d(0,"+e.offsetY+"px,0)"}),setTimeout(function(){e.$el.css({transform:"translate3d(0,0,0)",transition:"transform .2s"}),e.$anchor.css({transform:"translate3d(0,0,0)",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"})},20)},200)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_FloatingActionButton}},{key:"defaults",get:function(){return ea}}]),t}(),M.FloatingActionButton=el,M.jQueryLoaded&&M.initializeJqueryWrapper(el,"floatingActionButton","M_FloatingActionButton"),eu=cash,ec={autoClose:!1,format:"mmm dd, yyyy",parse:null,defaultDate:null,setDefaultDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,container:null,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"‹",nextMonth:"›",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},(ed=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));(i.el.M_Datepicker=i).options=eu.extend({},t.defaults,n),n&&n.hasOwnProperty("i18n")&&"object"==typeof n.i18n&&(i.options.i18n=eu.extend({},t.defaults.i18n,n.i18n)),i.options.minDate&&i.options.minDate.setHours(0,0,0,0),i.options.maxDate&&i.options.maxDate.setHours(0,0,0,0),i.id=M.guid(),i._setupVariables(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupEventHandlers(),i.options.defaultDate||(i.options.defaultDate=new Date(Date.parse(i.el.value)));var r=i.options.defaultDate;return t._isDate(r)?i.options.setDefaultDate?(i.setDate(r,!0),i.setInputValue()):i.gotoDate(r):i.gotoDate(new Date),i.isOpen=!1,i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),eu(this.modalEl).remove(),this.destroySelects(),this.el.M_Datepicker=void 0}},{key:"destroySelects",value:function(){var e=this.calendarEl.querySelector(".orig-select-year");e&&M.FormSelect.getInstance(e).destroy();var t=this.calendarEl.querySelector(".orig-select-month");t&&M.FormSelect.getInstance(t).destroy()}},{key:"_insertHTMLIntoDOM",value:function(){this.options.showClearBtn&&(eu(this.clearBtn).css({visibility:""}),this.clearBtn.innerHTML=this.options.i18n.clear),this.doneBtn.innerHTML=this.options.i18n.done,this.cancelBtn.innerHTML=this.options.i18n.cancel,this.options.container?this.$modalEl.appendTo(this.options.container):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var e=this;this.modalEl.id="modal-"+this.id,this.modal=M.Modal.init(this.modalEl,{onCloseEnd:function(){e.isOpen=!1}})}},{key:"toString",value:function(e){var n=this;return e=e||this.options.format,t._isDate(this.date)?e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(function(e){return n.formats[e]?n.formats[e]():e}).join(""):""}},{key:"setDate",value:function(e,n){if(!e)return this.date=null,this._renderDateDisplay(),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),t._isDate(e)){var i=this.options.minDate,r=this.options.maxDate;t._isDate(i)&&er.maxDate||r.disableWeekends&&t._isWeekend(b)||r.disableDayFn&&r.disableDayFn(b),isEmpty:x,isStartRange:N,isEndRange:I,isInRange:k,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};u.push(this.renderDay(D)),7==++w&&(l.push(this.renderRow(u,r.isRTL,y)),w=0,u=[],y=!1)}return this.renderTable(r,l,i)}},{key:"renderDay",value:function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"}},{key:"renderRow",value:function(e,t,n){return''+(t?e.reverse():e).join("")+""}},{key:"renderTable",value:function(e,t,n){return'
    '+this.renderHead(e)+this.renderBody(t)+"
    "}},{key:"renderHead",value:function(e){var t=void 0,n=[];for(t=0;t<7;t++)n.push(''+this.renderDayName(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""}},{key:"renderBody",value:function(e){return""+e.join("")+""}},{key:"renderTitle",value:function(e,t,n,i,r,o){var s,a,l=void 0,u=void 0,c=void 0,d=this.options,h=n===d.minYear,p=n===d.maxYear,f='
    ',m=!0,g=!0;for(c=[],l=0;l<12;l++)c.push('");for(s='",eu.isArray(d.yearRange)?(l=d.yearRange[0],u=d.yearRange[1]+1):(l=n-d.yearRange,u=1+n+d.yearRange),c=[];l=d.minYear&&c.push('");return a='",f+='
    ',d.showMonthAfterYear?f+=a+s:f+=s+a,f+="
    ",h&&(0===i||d.minMonth>=i)&&(m=!1),p&&(11===i||d.maxMonth<=i)&&(g=!1),(f+='')+"
    "}},{key:"draw",value:function(e){if(this.isOpen||e){var t,n=this.options,i=n.minYear,r=n.maxYear,o=n.minMonth,s=n.maxMonth,a="";this._y<=i&&(this._y=i,!isNaN(o)&&this._m=r&&(this._y=r,!isNaN(s)&&this._m>s&&(this._m=s)),t="datepicker-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var l=0;l<1;l++)this._renderDateDisplay(),a+=this.renderTitle(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,t)+this.render(this.calendars[l].year,this.calendars[l].month,t);this.destroySelects(),this.calendarEl.innerHTML=a;var u=this.calendarEl.querySelector(".orig-select-year"),c=this.calendarEl.querySelector(".orig-select-month");M.FormSelect.init(u,{classes:"select-year",dropdownOptions:{container:document.body,constrainWidth:!1}}),M.FormSelect.init(c,{classes:"select-month",dropdownOptions:{container:document.body,constrainWidth:!1}}),u.addEventListener("change",this._handleYearChange.bind(this)),c.addEventListener("change",this._handleMonthChange.bind(this)),"function"==typeof this.options.onDraw&&this.options.onDraw(this)}}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleInputChangeBound=this._handleInputChange.bind(this),this._handleCalendarClickBound=this._handleCalendarClick.bind(this),this._finishSelectionBound=this._finishSelection.bind(this),this._handleMonthChange=this._handleMonthChange.bind(this),this._closeBound=this.close.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.el.addEventListener("change",this._handleInputChangeBound),this.calendarEl.addEventListener("click",this._handleCalendarClickBound),this.doneBtn.addEventListener("click",this._finishSelectionBound),this.cancelBtn.addEventListener("click",this._closeBound),this.options.showClearBtn&&(this._handleClearClickBound=this._handleClearClick.bind(this),this.clearBtn.addEventListener("click",this._handleClearClickBound))}},{key:"_setupVariables",value:function(){var e=this;this.$modalEl=eu(t._template),this.modalEl=this.$modalEl[0],this.calendarEl=this.modalEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.modalEl.querySelector(".year-text"),this.dateTextEl=this.modalEl.querySelector(".date-text"),this.options.showClearBtn&&(this.clearBtn=this.modalEl.querySelector(".datepicker-clear")),this.doneBtn=this.modalEl.querySelector(".datepicker-done"),this.cancelBtn=this.modalEl.querySelector(".datepicker-cancel"),this.formats={d:function(){return e.date.getDate()},dd:function(){var t=e.date.getDate();return(t<10?"0":"")+t},ddd:function(){return e.options.i18n.weekdaysShort[e.date.getDay()]},dddd:function(){return e.options.i18n.weekdays[e.date.getDay()]},m:function(){return e.date.getMonth()+1},mm:function(){var t=e.date.getMonth()+1;return(t<10?"0":"")+t},mmm:function(){return e.options.i18n.monthsShort[e.date.getMonth()]},mmmm:function(){return e.options.i18n.months[e.date.getMonth()]},yy:function(){return(""+e.date.getFullYear()).slice(2)},yyyy:function(){return e.date.getFullYear()}}}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound),this.el.removeEventListener("change",this._handleInputChangeBound),this.calendarEl.removeEventListener("click",this._handleCalendarClickBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(e){e.which===M.keys.ENTER&&(e.preventDefault(),this.open())}},{key:"_handleCalendarClick",value:function(e){if(this.isOpen){var t=eu(e.target);t.hasClass("is-disabled")||(!t.hasClass("datepicker-day-button")||t.hasClass("is-empty")||t.parent().hasClass("is-disabled")?t.closest(".month-prev").length?this.prevMonth():t.closest(".month-next").length&&this.nextMonth():(this.setDate(new Date(e.target.getAttribute("data-year"),e.target.getAttribute("data-month"),e.target.getAttribute("data-day"))),this.options.autoClose&&this._finishSelection()))}}},{key:"_handleClearClick",value:function(){this.date=null,this.setInputValue(),this.close()}},{key:"_handleMonthChange",value:function(e){this.gotoMonth(e.target.value)}},{key:"_handleYearChange",value:function(e){this.gotoYear(e.target.value)}},{key:"gotoMonth",value:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())}},{key:"gotoYear",value:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())}},{key:"_handleInputChange",value:function(e){var n=void 0;e.firedBy!==this&&(n=this.options.parse?this.options.parse(this.el.value,this.options.format):new Date(Date.parse(this.el.value)),t._isDate(n)&&this.setDate(n))}},{key:"renderDayName",value:function(e,t,n){for(t+=e.firstDay;7<=t;)t-=7;return n?e.i18n.weekdaysAbbrev[t]:e.i18n.weekdays[t]}},{key:"_finishSelection",value:function(){this.setInputValue(),this.close()}},{key:"open",value:function(){if(!this.isOpen)return this.isOpen=!0,"function"==typeof this.options.onOpen&&this.options.onOpen.call(this),this.draw(),this.modal.open(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,"function"==typeof this.options.onClose&&this.options.onClose.call(this),this.modal.close(),this}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"_isDate",value:function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())}},{key:"_isWeekend",value:function(e){var t=e.getDay();return 0===t||6===t}},{key:"_setToStartOfDay",value:function(e){t._isDate(e)&&e.setHours(0,0,0,0)}},{key:"_getDaysInMonth",value:function(e,n){return[31,t._isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][n]}},{key:"_isLeapYear",value:function(e){return e%4==0&&e%100!=0||e%400==0}},{key:"_compareDates",value:function(e,t){return e.getTime()===t.getTime()}},{key:"_setToStartOfDay",value:function(e){t._isDate(e)&&e.setHours(0,0,0,0)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Datepicker}},{key:"defaults",get:function(){return ec}}]),t}())._template='',M.Datepicker=ed,M.jQueryLoaded&&M.initializeJqueryWrapper(ed,"datepicker","M_Datepicker"),eh=cash,ep={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},autoClose:!1,twelveHour:!0,vibrate:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onSelect:null},(ef=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Timepicker=i).options=eh.extend({},t.defaults,n),i.id=M.guid(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupVariables(),i._setupEventHandlers(),i._clockSetup(),i._pickerSetup(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),eh(this.modalEl).remove(),this.el.M_Timepicker=void 0}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleClockClickStartBound=this._handleClockClickStart.bind(this),this._handleDocumentClickMoveBound=this._handleDocumentClickMove.bind(this),this._handleDocumentClickEndBound=this._handleDocumentClickEnd.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.plate.addEventListener("mousedown",this._handleClockClickStartBound),this.plate.addEventListener("touchstart",this._handleClockClickStartBound),eh(this.spanHours).on("click",this.showView.bind(this,"hours")),eh(this.spanMinutes).on("click",this.showView.bind(this,"minutes"))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(e){e.which===M.keys.ENTER&&(e.preventDefault(),this.open())}},{key:"_handleClockClickStart",value:function(e){e.preventDefault();var n=this.plate.getBoundingClientRect(),i=n.left,r=n.top;this.x0=i+this.options.dialRadius,this.y0=r+this.options.dialRadius,this.moved=!1;var o=t._Pos(e);this.dx=o.x-this.x0,this.dy=o.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("mousemove",this._handleDocumentClickMoveBound),document.addEventListener("touchmove",this._handleDocumentClickMoveBound),document.addEventListener("mouseup",this._handleDocumentClickEndBound),document.addEventListener("touchend",this._handleDocumentClickEndBound)}},{key:"_handleDocumentClickMove",value:function(e){e.preventDefault();var n=t._Pos(e),i=n.x-this.x0,r=n.y-this.y0;this.moved=!0,this.setHand(i,r,!1,!0)}},{key:"_handleDocumentClickEnd",value:function(e){var n=this;e.preventDefault(),document.removeEventListener("mouseup",this._handleDocumentClickEndBound),document.removeEventListener("touchend",this._handleDocumentClickEndBound);var i=t._Pos(e),r=i.x-this.x0,o=i.y-this.y0;this.moved&&r===this.dx&&o===this.dy&&this.setHand(r,o),"hours"===this.currentView?this.showView("minutes",this.options.duration/2):this.options.autoClose&&(eh(this.minutesView).addClass("timepicker-dial-out"),setTimeout(function(){n.done()},this.options.duration/2)),"function"==typeof this.options.onSelect&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("mousemove",this._handleDocumentClickMoveBound),document.removeEventListener("touchmove",this._handleDocumentClickMoveBound)}},{key:"_insertHTMLIntoDOM",value:function(){this.$modalEl=eh(t._template),this.modalEl=this.$modalEl[0],this.modalEl.id="modal-"+this.id;var e=document.querySelector(this.options.container);this.options.container&&e?this.$modalEl.appendTo(e):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var e=this;this.modal=M.Modal.init(this.modalEl,{onOpenStart:this.options.onOpenStart,onOpenEnd:this.options.onOpenEnd,onCloseStart:this.options.onCloseStart,onCloseEnd:function(){"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e),e.isOpen=!1}})}},{key:"_setupVariables",value:function(){this.currentView="hours",this.vibrate=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,this._canvas=this.modalEl.querySelector(".timepicker-canvas"),this.plate=this.modalEl.querySelector(".timepicker-plate"),this.hoursView=this.modalEl.querySelector(".timepicker-hours"),this.minutesView=this.modalEl.querySelector(".timepicker-minutes"),this.spanHours=this.modalEl.querySelector(".timepicker-span-hours"),this.spanMinutes=this.modalEl.querySelector(".timepicker-span-minutes"),this.spanAmPm=this.modalEl.querySelector(".timepicker-span-am-pm"),this.footer=this.modalEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}},{key:"_pickerSetup",value:function(){var e=eh('").appendTo(this.footer).on("click",this.clear.bind(this));this.options.showClearBtn&&e.css({visibility:""});var t=eh('
    ');eh('").appendTo(t).on("click",this.close.bind(this)),eh('").appendTo(t).on("click",this.done.bind(this)),t.appendTo(this.footer)}},{key:"_clockSetup",value:function(){this.options.twelveHour&&(this.$amBtn=eh('
    AM
    '),this.$pmBtn=eh('
    PM
    '),this.$amBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm),this.$pmBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}},{key:"_buildSVGClock",value:function(){var e=this.options.dialRadius,n=this.options.tickRadius,i=2*e,r=t._createSVGEl("svg");r.setAttribute("class","timepicker-svg"),r.setAttribute("width",i),r.setAttribute("height",i);var o=t._createSVGEl("g");o.setAttribute("transform","translate("+e+","+e+")");var s=t._createSVGEl("circle");s.setAttribute("class","timepicker-canvas-bearing"),s.setAttribute("cx",0),s.setAttribute("cy",0),s.setAttribute("r",4);var a=t._createSVGEl("line");a.setAttribute("x1",0),a.setAttribute("y1",0);var l=t._createSVGEl("circle");l.setAttribute("class","timepicker-canvas-bg"),l.setAttribute("r",n),o.appendChild(a),o.appendChild(l),o.appendChild(s),r.appendChild(o),this._canvas.appendChild(r),this.hand=a,this.bg=l,this.bearing=s,this.g=o}},{key:"_buildHoursView",value:function(){var e=eh('
    ');if(this.options.twelveHour)for(var t=1;t<13;t+=1){var n=e.clone(),i=t/6*Math.PI,r=this.options.outerRadius;n.css({left:this.options.dialRadius+Math.sin(i)*r-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(i)*r-this.options.tickRadius+"px"}),n.html(0===t?"00":t),this.hoursView.appendChild(n[0])}else for(var o=0;o<24;o+=1){var s=e.clone(),a=o/6*Math.PI,l=0'),n=0;n<60;n+=5){var i=e.clone(),r=n/30*Math.PI;i.css({left:this.options.dialRadius+Math.sin(r)*this.options.outerRadius-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(r)*this.options.outerRadius-this.options.tickRadius+"px"}),i.html(t._addLeadingZero(n)),this.minutesView.appendChild(i[0])}}},{key:"_handleAmPmClick",value:function(e){var t=eh(e.target);this.amOrPm=t.hasClass("am-btn")?"AM":"PM",this._updateAmPmView()}},{key:"_updateAmPmView",value:function(){this.options.twelveHour&&(this.$amBtn.toggleClass("text-primary","AM"===this.amOrPm),this.$pmBtn.toggleClass("text-primary","PM"===this.amOrPm))}},{key:"_updateTimeFromInput",value:function(){var e=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&void 0!==e[1]&&(0'),i.$el.find(".carousel-item").each(function(e,t){if(i.images.push(e),i.showIndicators){var n=ev('
  • ');0===t&&n[0].classList.add("active"),i.$indicators.append(n)}}),i.showIndicators&&i.$el.append(i.$indicators),i.count=i.images.length,i.options.numVisible=Math.min(i.count,i.options.numVisible),i.xform="transform",["webkit","Moz","O","ms"].every(function(e){var t=e+"Transform";return void 0===document.body.style[t]||(i.xform=t,!1)}),i._setupEventHandlers(),i._scroll(i.offset),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Carousel=void 0}},{key:"_setupEventHandlers",value:function(){var e=this;this._handleCarouselTapBound=this._handleCarouselTap.bind(this),this._handleCarouselDragBound=this._handleCarouselDrag.bind(this),this._handleCarouselReleaseBound=this._handleCarouselRelease.bind(this),this._handleCarouselClickBound=this._handleCarouselClick.bind(this),void 0!==window.ontouchstart&&(this.el.addEventListener("touchstart",this._handleCarouselTapBound),this.el.addEventListener("touchmove",this._handleCarouselDragBound),this.el.addEventListener("touchend",this._handleCarouselReleaseBound)),this.el.addEventListener("mousedown",this._handleCarouselTapBound),this.el.addEventListener("mousemove",this._handleCarouselDragBound),this.el.addEventListener("mouseup",this._handleCarouselReleaseBound),this.el.addEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.addEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&(this._handleIndicatorClickBound=this._handleIndicatorClick.bind(this),this.$indicators.find(".indicator-item").each(function(t,n){t.addEventListener("click",e._handleIndicatorClickBound)}));var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){var e=this;void 0!==window.ontouchstart&&(this.el.removeEventListener("touchstart",this._handleCarouselTapBound),this.el.removeEventListener("touchmove",this._handleCarouselDragBound),this.el.removeEventListener("touchend",this._handleCarouselReleaseBound)),this.el.removeEventListener("mousedown",this._handleCarouselTapBound),this.el.removeEventListener("mousemove",this._handleCarouselDragBound),this.el.removeEventListener("mouseup",this._handleCarouselReleaseBound),this.el.removeEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.removeEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&this.$indicators.find(".indicator-item").each(function(t,n){t.removeEventListener("click",e._handleIndicatorClickBound)}),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleCarouselTap",value:function(e){"mousedown"===e.type&&ev(e.target).is("img")&&e.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(e),this.referenceY=this._ypos(e),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._trackBound,100)}},{key:"_handleCarouselDrag",value:function(e){var t=void 0,n=void 0,i=void 0;if(this.pressed){if(t=this._xpos(e),n=this._ypos(e),i=this.reference-t,30>Math.abs(this.referenceY-n)&&!this.verticalDragged)(2=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScrollBound),this.dragged&&(e.preventDefault(),e.stopPropagation()),!1}},{key:"_handleCarouselClick",value:function(e){if(this.dragged)return e.preventDefault(),e.stopPropagation(),!1;if(!this.options.fullWidth){var t=ev(e.target).closest(".carousel-item").index();0!=this._wrap(this.center)-t&&(e.preventDefault(),e.stopPropagation()),this._cycleTo(t)}}},{key:"_handleIndicatorClick",value:function(e){e.stopPropagation();var t=ev(e.target).closest(".indicator-item");t.length&&this._cycleTo(t.index())}},{key:"_handleResize",value:function(e){this.options.fullWidth?(this.itemWidth=this.$el.find(".carousel-item").first().innerWidth(),this.imageHeight=this.$el.find(".carousel-item.active").height(),this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()}},{key:"_setCarouselHeight",value:function(e){var t=this,n=this.$el.find(".carousel-item.active").length?this.$el.find(".carousel-item.active").first():this.$el.find(".carousel-item").first(),i=n.find("img").first();if(i.length){if(i[0].complete){var r=i.height();if(0=this.count?e%this.count:e<0?this._wrap(this.count+e%this.count):e}},{key:"_track",value:function(){var e,t,n,i;t=(e=Date.now())-this.timestamp,this.timestamp=e,n=this.offset-this.frame,this.frame=this.offset,i=1e3*n/(1+t),this.velocity=.8*i+.2*this.velocity}},{key:"_autoScroll",value:function(){var e=void 0,t=void 0;this.amplitude&&(e=Date.now()-this.timestamp,2<(t=this.amplitude*Math.exp(-e/this.options.duration))||t<-2?(this._scroll(this.target-t),requestAnimationFrame(this._autoScrollBound)):this._scroll(this.target))}},{key:"_scroll",value:function(e){var t=this;this.$el.hasClass("scrolling")||this.el.classList.add("scrolling"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout(function(){t.$el.removeClass("scrolling")},this.options.duration);var n,i,r,o,s=void 0,a=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=this.center,p=1/this.options.numVisible;if(this.offset="number"==typeof e?e:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),o=-(r=(i=this.offset-this.center*this.dim)<0?1:-1)*i*2/this.dim,n=this.count>>1,this.options.fullWidth?(l="translateX(0)",d=1):(l="translateX("+(this.el.clientWidth-this.itemWidth)/2+"px) "+("translateY("+(this.el.clientHeight-this.itemHeight)/2+"px)"),d=1-p*o),this.showIndicators){var f=this.center%this.count,m=this.$indicators.find(".indicator-item.active");m.index()!==f&&(m.removeClass("active"),this.$indicators.find(".indicator-item").eq(f)[0].classList.add("active"))}if(!this.noWrap||0<=this.center&&this.center=this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t)}},{key:"prev",value:function(e){(void 0===e||isNaN(e))&&(e=1);var t=this.center-e;if(t>=this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t)}},{key:"set",value:function(e,t){if((void 0===e||isNaN(e))&&(e=0),e>this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e,t)}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Carousel}},{key:"defaults",get:function(){return ew}}]),t}(),M.Carousel=eb,M.jQueryLoaded&&M.initializeJqueryWrapper(eb,"carousel","M_Carousel"),eM=cash,eE={onOpen:void 0,onClose:void 0},eT=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_TapTarget=i).options=eM.extend({},t.defaults,n),i.isOpen=!1,i.$origin=eM("#"+i.$el.attr("data-target")),i._setup(),i._calculatePositioning(),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.TapTarget=void 0}},{key:"_setupEventHandlers",value:function(){this._handleDocumentClickBound=this._handleDocumentClick.bind(this),this._handleTargetClickBound=this._handleTargetClick.bind(this),this._handleOriginClickBound=this._handleOriginClick.bind(this),this.el.addEventListener("click",this._handleTargetClickBound),this.originEl.addEventListener("click",this._handleOriginClickBound);var e=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=e.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleTargetClickBound),this.originEl.removeEventListener("click",this._handleOriginClickBound),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleTargetClick",value:function(e){this.open()}},{key:"_handleOriginClick",value:function(e){this.close()}},{key:"_handleResize",value:function(e){this._calculatePositioning()}},{key:"_handleDocumentClick",value:function(e){eM(e.target).closest(".tap-target-wrapper").length||(this.close(),e.preventDefault(),e.stopPropagation())}},{key:"_setup",value:function(){this.wrapper=this.$el.parent()[0],this.waveEl=eM(this.wrapper).find(".tap-target-wave")[0],this.originEl=eM(this.wrapper).find(".tap-target-origin")[0],this.contentEl=this.$el.find(".tap-target-content")[0],eM(this.wrapper).hasClass(".tap-target-wrapper")||(this.wrapper=document.createElement("div"),this.wrapper.classList.add("tap-target-wrapper"),this.$el.before(eM(this.wrapper)),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.classList.add("tap-target-content"),this.$el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement("div"),this.waveEl.classList.add("tap-target-wave"),this.originEl||(this.originEl=this.$origin.clone(!0,!0),this.originEl.addClass("tap-target-origin"),this.originEl.removeAttr("id"),this.originEl.removeAttr("style"),this.originEl=this.originEl[0],this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}},{key:"_calculatePositioning",value:function(){var e="fixed"===this.$origin.css("position");if(!e)for(var t=this.$origin.parents(),n=0;n'+t.getAttribute("label")+"")[0]),i.each(function(t){var n=e._appendOptionWithIcon(e.$el,t,"optgroup-option");e._addOptionToValueDict(t,n)})}}),this.$el.after(this.dropdownOptions),this.input=document.createElement("input"),e_(this.input).addClass("select-dropdown dropdown-trigger"),this.input.setAttribute("type","text"),this.input.setAttribute("readonly","true"),this.input.setAttribute("data-target",this.dropdownOptions.id),this.el.disabled&&e_(this.input).prop("disabled","true"),this.$el.before(this.input),this._setValueToInput();var t=e_('');if(this.$el.before(t[0]),!this.el.disabled){var n=e_.extend({},this.options.dropdownOptions);n.onOpenEnd=function(t){var n=e_(e.dropdownOptions).find(".selected").first();if(n.length&&(M.keyDown=!0,e.dropdown.focusedIndex=n.index(),e.dropdown._focusFocusedItem(),M.keyDown=!1,e.dropdown.isScrollable)){var i=n[0].getBoundingClientRect().top-e.dropdownOptions.getBoundingClientRect().top;i-=e.dropdownOptions.clientHeight/2,e.dropdownOptions.scrollTop=i}},this.isMultiple&&(n.closeOnClick=!1),this.dropdown=M.Dropdown.init(this.input,n)}this._setSelectedStates()}},{key:"_addOptionToValueDict",value:function(e,t){var n=Object.keys(this._valueDict).length,i=this.dropdownOptions.id+n,r={};t.id=i,r.el=e,r.optionEl=t,this._valueDict[i]=r}},{key:"_removeDropdown",value:function(){e_(this.wrapper).find(".caret").remove(),e_(this.input).remove(),e_(this.dropdownOptions).remove(),e_(this.wrapper).before(this.$el),e_(this.wrapper).remove()}},{key:"_appendOptionWithIcon",value:function(e,t,n){var i=t.disabled?"disabled ":"",r=this.isMultiple?'":t.innerHTML,o=e_("
  • "),s=e_("");s.html(r),o.addClass(i+" "+("optgroup-option"===n?"optgroup-option ":"")),o.append(s);var a=t.getAttribute("data-icon");if(a){var l=e_('');o.prepend(l)}return e_(this.dropdownOptions).append(o[0]),o[0]}},{key:"_toggleEntryFromArray",value:function(e){var t=!this._keysSelected.hasOwnProperty(e),n=e_(this._valueDict[e].optionEl);return t?this._keysSelected[e]=!0:delete this._keysSelected[e],n.toggleClass("selected",t),n.find('input[type="checkbox"]').prop("checked",t),n.prop("selected",t),t}},{key:"_setValueToInput",value:function(){var e=[];if(this.$el.find("option").each(function(t){if(e_(t).prop("selected")){var n=e_(t).text();e.push(n)}}),!e.length){var t=this.$el.find("option:disabled").eq(0);t.length&&""===t[0].value&&e.push(t.text())}this.input.value=e.join(", ")}},{key:"_setSelectedStates",value:function(){for(var e in this._keysSelected={},this._valueDict){var t=this._valueDict[e],n=e_(t.el).prop("selected");e_(t.optionEl).find('input[type="checkbox"]').prop("checked",n),n?(this._activateOption(e_(this.dropdownOptions),e_(t.optionEl)),this._keysSelected[e]=!0):e_(t.optionEl).removeClass("selected")}}},{key:"_activateOption",value:function(e,t){t&&(this.isMultiple||e.find("li.selected").removeClass("selected"),e_(t).addClass("selected"))}},{key:"getSelectedValues",value:function(){var e=[];for(var t in this._keysSelected)e.push(this._valueDict[t].el.value);return e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_FormSelect}},{key:"defaults",get:function(){return ex}}]),t}(),M.FormSelect=eA,M.jQueryLoaded&&M.initializeJqueryWrapper(eA,"formSelect","M_FormSelect"),eS=cash,eL=M.anime,eN={},eI=function(e){function t(e,n){eO(this,t);var i=eC(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,t,e,n));return(i.el.M_Range=i).options=eS.extend({},t.defaults,n),i._mousedown=!1,i._setupThumb(),i._setupEventHandlers(),i}return ej(t,ez),eD(t,[{key:"destroy",value:function(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}},{key:"_setupEventHandlers",value:function(){this._handleRangeChangeBound=this._handleRangeChange.bind(this),this._handleRangeMousedownTouchstartBound=this._handleRangeMousedownTouchstart.bind(this),this._handleRangeInputMousemoveTouchmoveBound=this._handleRangeInputMousemoveTouchmove.bind(this),this._handleRangeMouseupTouchendBound=this._handleRangeMouseupTouchend.bind(this),this._handleRangeBlurMouseoutTouchleaveBound=this._handleRangeBlurMouseoutTouchleave.bind(this),this.el.addEventListener("change",this._handleRangeChangeBound),this.el.addEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.addEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.addEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("change",this._handleRangeChangeBound),this.el.removeEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_handleRangeChange",value:function(){eS(this.value).html(this.$el.val()),eS(this.thumb).hasClass("active")||this._showRangeBubble();var e=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",e+"px")}},{key:"_handleRangeMousedownTouchstart",value:function(e){if(eS(this.value).html(this.$el.val()),this._mousedown=!0,this.$el.addClass("active"),eS(this.thumb).hasClass("active")||this._showRangeBubble(),"input"!==e.type){var t=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",t+"px")}}},{key:"_handleRangeInputMousemoveTouchmove",value:function(){if(this._mousedown){eS(this.thumb).hasClass("active")||this._showRangeBubble();var e=this._calcRangeOffset();eS(this.thumb).addClass("active").css("left",e+"px"),eS(this.value).html(this.$el.val())}}},{key:"_handleRangeMouseupTouchend",value:function(){this._mousedown=!1,this.$el.removeClass("active")}},{key:"_handleRangeBlurMouseoutTouchleave",value:function(){if(!this._mousedown){var e=7+parseInt(this.$el.css("padding-left"))+"px";eS(this.thumb).hasClass("active")&&(eL.remove(this.thumb),eL({targets:this.thumb,height:0,width:0,top:10,easing:"easeOutQuad",marginLeft:e,duration:100})),eS(this.thumb).removeClass("active")}}},{key:"_setupThumb",value:function(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),eS(this.thumb).addClass("thumb"),eS(this.value).addClass("value"),eS(this.thumb).append(this.value),this.$el.after(this.thumb)}},{key:"_removeThumb",value:function(){eS(this.thumb).remove()}},{key:"_showRangeBubble",value:function(){var e=-7+parseInt(eS(this.thumb).parent().css("padding-left"))+"px";eL.remove(this.thumb),eL({targets:this.thumb,height:30,width:30,top:-30,marginLeft:e,duration:300,easing:"easeOutQuint"})}},{key:"_calcRangeOffset",value:function(){var e=this.$el.width()-15,t=parseFloat(this.$el.attr("max"))||100,n=parseFloat(this.$el.attr("min"))||0;return(parseFloat(this.$el.val())-n)/(t-n)*e}}],[{key:"init",value:function(e,n){return ek(t.__proto__||Object.getPrototypeOf(t),"init",this).call(this,this,e,n)}},{key:"getInstance",value:function(e){return(e.jquery?e[0]:e).M_Range}},{key:"defaults",get:function(){return eN}}]),t}(),M.Range=eI,M.jQueryLoaded&&M.initializeJqueryWrapper(eI,"range","M_Range"),eI.init(eS("input[type=range]"))},363:function(e,t,n){"use strict";t.meiosisSetup=void 0;var i=n(977);Object.defineProperty(t,"meiosisSetup",{enumerable:!0,get:function(){return i.meiosisSetup}})},977:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.meiosisSetup=void 0;let r=n(125),o=n(264),s=i(n(388)),a=(e,t,n)=>(n[e]=t,n),l=(e,t)=>t?e.concat(t):e,u=e=>e?Object.keys(e).reduce((t,n)=>a(n,Object.assign({},e[n].initial,u(e[n].nested)),t),{}):{},c=e=>Object.assign({},e.initial,u(e.nested)),d=e=>e?Object.keys(e).reduce((t,n)=>{let i=e[n];if(void 0!==i.view){let e=i.view;return a(n,{view:(t,...i)=>e(t.nest(n),...i),nested:d(i.nested)},t)}return t},{}):{},h=e=>d(e.nested),p=(e,t=e=>e,n=e=>e)=>e?Object.keys(e).reduce((i,r)=>{var o;let s=e=>t(e).nest(r),a=e=>n(e)[r],u=e[r];return l(i,null===(o=u.services)||void 0===o?void 0:o.map(e=>({onchange:t=>e.onchange?e.onchange(a(t)):t,run:t=>e.run(s(t))}))).concat(p(u.nested,s,a))},[]):[],f=e=>l([],e.services).concat(p(e.nested)),m=({stream:e,app:t})=>{!e&&(e=r.simpleStream);let n=t||{},i=c(n),o=h(n),a="function"==typeof e?e:e.stream,l=e.scan,u=a();return{states:l((e,t)=>(0,s.default)(e,t),i,u),update:u,view:o}},g=(e,t)=>({[t]:e}),y=(e,t)=>n=>e(g(n,t)),v=(e,t,n)=>i=>{let r=e.map(e=>e[i]),s=()=>e()[i],a=y(t,i),l=(0,o.get)(n,[i,"nested"]);return{states:r,state:s(),getState:s,update:a,nest:v(r,a,l),nested:l}};t.meiosisSetup=e=>{let t=null==e?void 0:e.stream,n=null==e?void 0:e.app,{states:i,update:o,view:s}=m({stream:t,app:n}),a=v(i,o,s),l=()=>i(),u=e=>({states:i,state:e,getState:l,update:o,nest:a,nested:s}),c=(0,r.createDropRepeats)(t);return n&&f(n).forEach(e=>{c(i,e.onchange).map(t=>e.run(u(t)))}),c(i).map(u)}},125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dropRepeats=t.createDropRepeats=t.simpleStream=t.scan=t.stream=void 0;t.stream=e=>{let n=[],i=e,r=function(e){if(arguments.length>0&&!r.ended)for(let t in i=e,n)n[t](i);return i};return r.map=e=>{let r=(0,t.stream)(),o=t=>{r(e(t))};return n.push(o),r.end=e=>{let t=n.indexOf(o);r.ended=!0,n.splice(t,1)},void 0!==i&&r(e(i)),r},r.end=e=>{r.ended=!0},r};t.scan=(e,n,i)=>{let r=(0,t.stream)(n),o=n;return i.map(t=>{r(o=e(o,t))}),r},t.simpleStream={stream:t.stream,scan:t.scan};t.createDropRepeats=(e=t.simpleStream)=>(t,n=e=>e)=>{let i;let r=("function"==typeof e?e:e.stream)();return t.map(e=>{let t=n(e);t!==i&&(i=t,r(e))}),r},t.dropRepeats=(0,t.createDropRepeats)()},264:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateFormFloatValue=t.updateFormIntValue=t.updateFormValue=t.get=void 0;t.get=(e,t)=>t.reduce((e,t)=>void 0==e?void 0:e[t],e);let n=(e,t)=>({[e[0]]:1===e.length?t:n(e.slice(1),t)}),i=e=>Array.isArray(e)?e:[e],r=(e,t,r)=>o=>{let s=e(o.currentTarget.value);!isNaN(s)&&t.update(n(i(r),s))};t.updateFormValue=(e,t,r=e=>e)=>o=>e.update(n(i(t),r(o.currentTarget.value)));t.updateFormIntValue=(e,t)=>n=>r(parseInt,e,t)(n);t.updateFormFloatValue=(e,t)=>n=>r(parseFloat,e,t)(n)},388:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});let i=Object.assign||((e,t)=>(t&&Object.keys(t).forEach(n=>e[n]=t[n]),e)),r=(e,t,n)=>{let i=typeof n;if(n&&"object"===i){if(Array.isArray(n))for(let i of n)t=r(e,t,i);else for(let i of Object.keys(n)){let s=n[i];"function"==typeof s?t[i]=s(t[i],o):void 0===s?e&&!isNaN(i)?t.splice(i,1):delete t[i]:null===s||"object"!=typeof s||Array.isArray(s)?t[i]=s:"object"==typeof t[i]?t[i]=s===t[i]?s:o(t[i],s):t[i]=r(!1,{},s)}}else"function"===i&&(t=n(t,o));return t},o=(e,...t)=>{let n=Array.isArray(e);return r(n,n?e.slice():i({},e),t)},s=o},415:function(e,t,n){"use strict";var i=n(67);e.exports=function(e,t,n){var r=[],o=!1,s=-1;function a(){for(s=0;s=0&&(r.splice(o,2),o<=s&&(s-=2),e(t,[])),null!=n&&(r.push(t,n),e(t,i(n),l))},redraw:l}}},216:function(e,t,n){"use strict";var i=n(67),r=n(873),o=n(604),s=n(282),a=n(45),l=n(81),u=n(160),c={};function d(e){try{return decodeURIComponent(e)}catch(t){return e}}e.exports=function(e,t){var n=null==e?null:"function"==typeof e.setImmediate?e.setImmediate:e.setTimeout,h=Promise.resolve(),p=!1,f=!1,m=0,g,y,v,w,b,E,T=c,_={onbeforeupdate:function(){return!(!(m=m?2:1)||c===T)},onremove:function(){e.removeEventListener("popstate",S,!1),e.removeEventListener("hashchange",A,!1)},view:function(){if(m&&c!==T){var e=[i(v,w.key,w)];return T&&(e=T.render(e[0])),e}}},x=N.SKIP={};function A(){p=!1;var n=e.location.hash;"#"!==N.prefix[0]&&(n=e.location.search+n,"?"!==N.prefix[0]&&"/"!==(n=e.location.pathname+n)[0]&&(n="/"+n));var i=n.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,d).slice(N.prefix.length),r=s(i);function o(e){console.error(e),L(y,null,{replace:!0})}l(r.params,e.history.state),function e(n){for(;n=0&&(m+=e.slice(n,s)),d>=0&&(m+=(n<0?"?":"&")+c.slice(d,p));var g=i(u);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=e.slice(o)),h>=0&&(m+=(o<0?"":"&")+c.slice(h)),m}},45:function(e,t,n){"use strict";var i=n(282);e.exports=function(e){var t=i(e),n=Object.keys(t.params),r=[],o=RegExp("^"+t.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(r.push({k:t,r:"..."===n}),"..."===n)?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||"")})+"$");return function(e){for(var i=0;i-1&&u.pop();for(var d=0;d0&&(r.className=i.join(" ")),a[e]={tag:n,attrs:r}}(e),t):(t.tag=e,t)}},364:function(e,t,n){"use strict";var i=n(67);e.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:("object"!=typeof t||null!=t.tag||Array.isArray(t))&&(t={},n=this),arguments.length===n+1)e=arguments[n],!Array.isArray(e)&&(e=[e]);else for(e=[];n'+t.children+"",s=s.firstChild):s.innerHTML=t.children,t.dom=s.firstChild,t.domSize=s.childNodes.length;for(var l=a(e).createDocumentFragment();r=s.firstChild;)l.appendChild(r);E(e,l,i)}function g(e,t,n,i,r,o){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)h(e,n,0,n.length,i,r,o);else if(null==n||0===n.length)_(e,t,0,t.length);else{var s=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,l=0,u=0;if(!s)for(;u=u&&A>=l&&(m=t[T],g=n[A],m.key===g.key);){;m!==g&&y(e,m,g,i,r,o),null!=g.dom&&(r=g.dom),T--,A--}for(;T>=u&&A>=l&&(d=t[u],f=n[l],d.key===f.key);){;u++,l++,d!==f&&y(e,d,f,i,w(t,u,r),o)}for(;T>=u&&A>=l&&l!==A&&d.key===g.key&&m.key===f.key;){;b(e,m,E=w(t,u,r)),m!==f&&y(e,m,f,i,E,o),++l<=--A&&b(e,d,r),d!==g&&y(e,d,g,i,r,o),null!=g.dom&&(r=g.dom),u++,m=t[--T],g=n[A],d=t[u],f=n[l]}for(;T>=u&&A>=l&&m.key===g.key;){;m!==g&&y(e,m,g,i,r,o),null!=g.dom&&(r=g.dom),T--,A--,m=t[T],g=n[A]}if(l>A)_(e,t,u,T+1);else if(u>T)h(e,n,l,A+1,i,r,o);else{var c,S,L=r,N=A-l+1,I=Array(N),k=0,D=0,C=2147483647,j=0;for(D=0;D=l;D--){null==c&&(c=function(e,t,n){for(var i=Object.create(null);t>>1)+(i>>>1)+(n&i&1);e[t[a]]0&&(v[r]=t[n-1]),t[n]=r)}for(n=t.length,i=t[n-1];n-- >0;)t[n]=i,i=v[i];return v.length=0,t}(I)).length-1,D=A;D>=l;D--)f=n[D],-1===I[D-l]?p(e,f,i,o,r):S[k]===D-l?k--:b(e,f,r),null!=f.dom&&(r=n[D].dom);else for(D=A;D>=l;D--)f=n[D],-1===I[D-l]&&p(e,f,i,o,r),null!=f.dom&&(r=n[D].dom)}}else{var z=t.lengthz&&_(e,t,l,t.length),n.length>z&&h(e,n,l,n.length,i,r,o)}}}function y(e,t,n,r,o,s){var a=t.tag;if(a===n.tag){if(n.state=t.state,n.events=t.events,function(e,t){do{if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate){var n=c.call(e.attrs.onbeforeupdate,e,t);if(void 0!==n&&!n)break}if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate){var n=c.call(e.state.onbeforeupdate,e,t);if(void 0!==n&&!n)break}return!1}while(!1);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))return;if("string"==typeof a)switch(null!=n.attrs&&P(n.attrs,n,r),a){case"#":(function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children),t.dom=e.dom})(t,n);break;case"<":(function(e,t,n,i,r){t.children!==n.children?(A(e,t,void 0),m(e,n,i,r)):(n.dom=t.dom,n.domSize=t.domSize)})(e,t,n,s,o);break;case"[":(function(e,t,n,i,r,o){g(e,t.children,n.children,i,r,o);var s=0,a=n.children;if(n.dom=null,null!=a){for(var l=0;l-1||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var k=/[A-Z]/g;function D(e){return"-"+e.toLowerCase()}function C(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(k,D)}function j(e,t,n){if(t===n);else if(null==n)e.style="";else if("object"!=typeof n)e.style=n;else if(null==t||"object"!=typeof t)for(var i in e.style.cssText="",n){var r=n[i];null!=r&&e.style.setProperty(C(i),String(r))}else{for(var i in n){var r=n[i];null!=r&&(r=String(r))!==String(t[i])&&e.style.setProperty(C(i),r)}for(var i in t)null!=t[i]&&null==n[i]&&e.style.removeProperty(C(i))}}function O(){this._=e}function z(t,n,i){null!=t.events?(t.events._=e,t.events[n]!==i&&(null!=i&&("function"==typeof i||"object"==typeof i)?(null==t.events[n]&&t.dom.addEventListener(n.slice(2),t.events,!1),t.events[n]=i):(null!=t.events[n]&&t.dom.removeEventListener(n.slice(2),t.events,!1),t.events[n]=void 0))):null!=i&&("function"==typeof i||"object"==typeof i)&&(t.events=new O,t.dom.addEventListener(n.slice(2),t.events,!1),t.events[n]=i)}function R(e,t,n){"function"==typeof e.oninit&&c.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(c.bind(e.oncreate,t))}function P(e,t,n){"function"==typeof e.onupdate&&n.push(c.bind(e.onupdate,t))}return O.prototype=Object.create(null),O.prototype.handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(r,o,s){if(!r)throw TypeError("DOM element being rendered to does not exist.");if(null!=n&&r.contains(n))throw TypeError("Node is currently being rendered to and thus is locked.");var a=e,l=n,u=[],c=d(r),h=r.namespaceURI;n=r,e="function"==typeof s?s:void 0,t={};try{null==r.vnodes&&(r.textContent=""),o=i.normalizeChildren(Array.isArray(o)?o:[o]),g(r,r.vnodes,o,u,null,"http://www.w3.org/1999/xhtml"===h?void 0:h),r.vnodes=o,null!=c&&d(r)!==c&&"function"==typeof c.focus&&c.focus();for(var p=0;p=200&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(l),o=e.target.response;if("json"===d){if(!e.target.responseType&&"function"!=typeof u.extract)try{o=JSON.parse(e.target.responseText)}catch(e){o=null}}else(!d||"text"===d)&&null==o&&(o=e.target.responseText);if("function"==typeof u.extract?(o=u.extract(e.target,u),r=!0):"function"==typeof u.deserialize&&(o=u.deserialize(o)),r){if("function"==typeof u.type){if(Array.isArray(o))for(var s=0;st.indexOf(o)&&(n[o]=e[o]);else for(var o in e)i.call(e,o)&&!r.test(o)&&(n[o]=e[o]);return n}},895:function(e){"use strict";e.exports=({}).hasOwnProperty},512:function(e,t){var n;function i(e){return 1!==e?"p":"s"}t.plural_EN=i},949:function(e){"use strict";e.exports="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23949ba3' viewBox='0 0 16 16'%3E%3Cpath d='M8 13.1l-8-8 2.1-2.2 5.9 5.9 5.9-5.9 2.1 2.2z'/%3E%3C/svg%3E"},876:function(e,t,n){"use strict";e.exports=n.p+"4d73cb90e394b34b7670.woff"},31:function(e,t,n){"use strict";e.exports=n.p+"0c35d18bf06992036b69.woff2"},826:function(e,t,n){"use strict";var i,r,o,s,a,l,u,c,d,h,p,f,m,g,y,v,w,b,E,T,_,x,A,S,L,N,I,k,D,C,j,O,z,R,P,B,U,F,Y,H,W,Q,V,G,K,q,Z,X,J,ee,et,en,ei,er,eo,es,ea,el,eu,ec,ed,eh,ep,ef,em,eg,ey,ev,ew,eb,eM,eE,eT,e_,ex,eA,eS,eL,eN,eI,ek,eD,eC,ej,eO,ez,eR,eP,eB,eU,eF,eY,e$,eH,eW,eQ,eV,eG,eK,eq,eZ,eX,eJ,e0,e1,e2,e4,e3,e5,e6,e8,e9,e7,te,tt,tn,ti,tr,to,ts,ta=n("749"),tl=n.n(ta);n("473"),n("514"),n("142"),n("784"),(i=A||(A={})).LANDING="LANDING",i.LOGIN="LOGIN",i.HOME="HOME",i.CRIME_SCRIPT="CRIME_SCRIPT",i.SETTINGS="SETTINGS",i.ABOUT="ABOUT",i.CASE="CASE";var tu=n("363");let tc=()=>"idxxxxxxxx".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),td=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),th=e=>t=>Array.prototype.map.call(t,e),tp=e=>t=>Array.prototype.join.call(t,e),tf=e=>e.replace(/([A-Z])/g,e=>"-"+e.toLowerCase()),tm=e=>e?td(tp(""),th(t=>`[${tf(t)}="${((e="")=>e.toString().replace(/"/g,"""))(e[t])}"]`),Object.keys)(e):"",tg=["min","max","minLength","maxLength","rows","cols","placeholder","autocomplete","pattern","readOnly","step"],ty=e=>tg.indexOf(e)>=0,tv=({disabled:e})=>e?"[disabled]":"",tw=({required:e,isMandatory:t})=>e||t?"[required][aria-required=true]":"",tb=e=>{let t;return(e=>Object.keys(e).filter(ty).filter(t=>void 0!==e[t]).reduce((t,n)=>{let i=e[n];return t.push(`[${n.toLowerCase()}=${i}]`),t},[]).join(""))(e)+((t=e).maxLength?`[data-length=${t.maxLength}]`:"")+tv(e)+tw(e)+(({autofocus:e})=>"boolean"==typeof e&&e||e&&e()?"[autofocus]":"")(e)},tM=e=>!isNaN(parseFloat(e))&&isFinite(e),tE=(e,t=2,n="0")=>(e+="").length>=t?e:Array(t-e.length+1).join(n)+e;function tT(){return(tT=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}let tx=["label","id","isMandatory","isActive"],tA={view:({attrs:e})=>tl()("span.mandatory",e,"*")},tS=()=>({view:e=>{let{attrs:{label:t,id:n,isMandatory:i,isActive:r}}=e,o=t_(e.attrs,tx);return t?tl()(`label${r?".active":""}${n?`[for=${n}]`:""}`,o,[tl().trust(t),i?tl()(tA):void 0]):void 0}}),tL=()=>({view:({attrs:{helperText:e,dataError:t,dataSuccess:n,className:i}})=>e||t||n?tl()("span.helper-text",{className:i,dataError:t,dataSuccess:n},e?tl().trust(e):""):void 0}),tN=["iconName"],tI=()=>({view:e=>{let{attrs:{iconName:t}}=e,n=t_(e.attrs,tN);return tl()("i.material-icons",n,t)}}),tk=["modalId","tooltip","tooltipPostion","iconName","iconClass","label","attr"],tD=(e,t="")=>()=>{let n=`${e}${t}`;return{view:({attrs:e})=>{let{modalId:t,tooltip:i,tooltipPostion:r,iconName:o,iconClass:s,label:a,attr:l}=e,u=t_(e,tk);return tl()(`${n}${t?`.modal-trigger[href=#${t}]`:""}${i?`.tooltipped[data-position=${r||"top"}][data-tooltip=${i}]`:""}${tm(l)}`,u,o?tl()(tI,{iconName:o,className:s||"left"}):void 0,a||void 0)}}},tC=(tD("a.waves-effect.waves-light.btn","[type=button]"),tD("a.waves-effect.waves-light.btn-large","[type=button]"),tD("a.waves-effect.waves-light.btn-small","[type=button]"),tD("a.waves-effect.waves-teal.btn-flat","[type=button]")),tj=(tD("button.btn-floating.btn-large.waves-effect.waves-light","[type=button]"),tD("button.btn.waves-effect.waves-light","[type=submit]"),()=>({view:({attrs:{header:e,body:t,active:n,iconName:i}})=>tl()(n?"li.active":"li",[e||i?tl()(".collapsible-header",[i?tl()("i.material-icons",i):void 0,e?"string"==typeof e?tl()("span",e):e:void 0]):void 0,t?tl()(".collapsible-body",t):void 0])})),tO=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:e})=>{let{items:t,class:n,className:i,style:r,id:o}=e;return t&&t.length>0?tl()("ul.collapsible",{class:n||i,style:r,id:o},t.map(e=>tl()(tj,e))):void 0}});(r=S||(S={}))[r.BASIC=0]="BASIC",r[r.LINKS=1]="LINKS",r[r.AVATAR=2]="AVATAR";let tz=["className","helperText","iconName","id","initialValue","isMandatory","label","onchange","onkeydown","onkeypress","onkeyup","onblur","style"],tR=["className","dataError","dataSuccess","helperText","iconName","id","initialValue","isMandatory","label","maxLength","newRow","onchange","onkeydown","onkeypress","onkeyup","onblur","style","validate"],tP=()=>{let e={id:tc()};return{view:({attrs:t})=>{let{className:n="col s12",helperText:i,iconName:r,id:o=e.id,initialValue:s,isMandatory:a,label:l,onchange:u,onkeydown:c,onkeypress:d,onkeyup:h,onblur:p,style:f}=t,m=tb(t_(t,tz));return tl()(".input-field",{className:n,style:f},[r?tl()("i.material-icons.prefix",r):"",tl()(`textarea.materialize-textarea[tabindex=0][id=${o}]${m}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),t.maxLength&&M.CharacterCounter.init(e)},onchange:u?e=>{let t=e.target;u(t&&"string"==typeof t.value?t.value:"")}:void 0,value:s,onkeyup:h?e=>{h(e,e.target.value)}:void 0,onkeydown:c?e=>{c(e,e.target.value)}:void 0,onkeypress:d?e=>{d(e,e.target.value)}:void 0,onblur:p}),tl()(tS,{label:l,id:o,isMandatory:a,isActive:s||t.placeholder}),tl()(tL,{helperText:i})])}}},tB=(e,t="")=>()=>{let n={id:tc()},i=t=>{let n=t.value;return n&&("number"===e||"range"===e)?+n:n},r=(e,t)=>{e.setCustomValidity("boolean"==typeof t?t?"":"Custom validation failed":t)};return{view:({attrs:o})=>{let{className:s="col s12",dataError:a,dataSuccess:l,helperText:u,iconName:c,id:d=n.id,initialValue:h,isMandatory:p,label:f,maxLength:m,newRow:g,onchange:y,onkeydown:v,onkeypress:w,onkeyup:b,onblur:E,style:T,validate:_}=o,x=tb(t_(o,tR));return tl()(`.input-field${g?".clear":""}${t}`,{className:s,style:T},[c?tl()("i.material-icons.prefix",c):void 0,tl()(`input.validate[type=${e}][tabindex=0][id=${d}]${x}`,{oncreate:({dom:t})=>{(({autofocus:e})=>!!e&&("boolean"==typeof e?e:e()))(o)&&t.focus(),m&&M.CharacterCounter.init(t),"range"===e&&M.Range.init(t)},onkeyup:b?e=>{b(e,i(e.target))}:void 0,onkeydown:v?e=>{v(e,i(e.target))}:void 0,onkeypress:w?e=>{w(e,i(e.target))}:void 0,onblur:E,onupdate:_?({dom:e})=>{r(e,_(i(e),e))}:void 0,onchange:e=>{let t=e.target;if(t){let e=i(t);y&&y(e),_&&r(t,_(e,t))}},value:h}),tl()(tS,{label:f,id:d,isMandatory:p,isActive:!(void 0===h&&!o.placeholder&&"number"!==e&&"color"!==e&&"range"!==e)}),tl()(tL,{helperText:u,dataError:a,dataSuccess:l})])}}},tU=tB("text"),tF=(tB("password"),tB("number"),tB("url"),tB("color"),tB("range",".range-field"),tB("email"),()=>({oncreate:({dom:e,attrs:{options:t,onCreate:n}})=>{let i=M.Modal.init(e,t);n&&n(i)},view:({attrs:{id:e,title:t,description:n,fixedFooter:i,bottomSheet:r,buttons:o,richContent:s}})=>tl()(`.modal${i?".modal-fixed-footer":""}${r?".bottom-sheet":""}[id=${e}]`,[tl()(".modal-content",[tl()("h4",t),s&&"string"==typeof n?tl().trust(n||""):"string"==typeof n?tl()("p",n):n]),o?tl()(".modal-footer",o.map(e=>tl()(tC,tT({},e,{className:"modal-close"})))):void 0])})),tY=()=>{let e={},t=e=>e.map(e=>e.id).join(""),n=(e,t,n=!1)=>n||(t instanceof Array&&(e||"number"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:n,initialValue:i,options:r}})=>{e.ids=t(r);let o=n||i;e.checkedId=n instanceof Array?[...n]:n,e.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:i,newRow:r,className:o="col s12",checkedId:s,key:a,options:l,multiple:u,label:c,helperText:d,placeholder:h="",isMandatory:p,iconName:f,disabled:m,classes:g="",dropdownOptions:y,onchange:v}})=>{e.checkedId!==s&&(e.initialValue=s?s instanceof Array?s:[s]:void 0);let{initialValue:w}=e,b=v?u?()=>{let t=e.instance&&e.instance.getSelectedValues(),n=t?t.length>0&&tM(t[0])?t.map(e=>+e):t.filter(e=>null!==e||void 0!==e):void 0;e.initialValue=n||[],v(e.initialValue)}:t=>{if(t&&t.currentTarget){let n=t.currentTarget,i=tM(n.value)?+n.value:n.value;e.initialValue=[i]}e.initialValue&&v(e.initialValue)}:void 0;r&&(o+=" clear");let E=!l.some(e=>n(e.id,w)),T=l.reduce((e,t)=>(t.group&&0>e.indexOf(t.group)&&e.push(t.group),e),[]);return tl()(".input-field.select-space",{className:o,key:a,oncreate:u?({dom:t})=>e.wrapper=t:void 0},[f&&tl()("i.material-icons.prefix",f),tl()("select",{id:i,title:c,disabled:m,multiple:u,oncreate:({dom:t})=>{e.instance=M.FormSelect.init(t,{classes:g,dropdownOptions:y})},onupdate:({dom:n})=>{if(u){let t=f?1:0;!e.inputEl&&e.wrapper&&e.wrapper.childNodes&&e.wrapper.childNodes.length>0&&e.wrapper.childNodes[t].childNodes&&e.wrapper.childNodes[t].childNodes[0]&&(e.inputEl=e.wrapper.childNodes[t].childNodes[0]),e.inputEl&&e.inputEl.value&&e.inputEl.value.startsWith(`${h}, `)&&(e.inputEl.value=e.inputEl.value.replace(`${h}, `,""))}let i=t(l),r=s&&e.checkedId!==s.toString();e.ids!==i&&(e.ids=i,r=!0),(e.checkedId instanceof Array&&s instanceof Array?e.checkedId.join()!==s.join():e.checkedId!==s)&&(e.checkedId=s,r=!0),r&&(e.instance=M.FormSelect.init(n,{classes:g,dropdownOptions:y}))},onchange:b},tl()("option",{value:"",disabled:!0,selected:!!E||void 0},h),0===T.length?l.map((e,t)=>{var i;return tl()("option",{value:e.id,title:e.title||void 0,disabled:e.disabled?"true":void 0,"data-icon":e.img||void 0,selected:n(e.id,w,0===t&&E&&!h)},null==(i=e.label)?void 0:i.replace("&","&"))}):T.map(e=>tl()("optgroup",{label:e},l.filter(t=>t.group===e).map((e,t)=>{var i;return tl()("option",{value:e.id,title:e.title||void 0,disabled:e.disabled?"true":void 0,"data-icon":e.img||void 0,selected:n(e.id,w,0===t&&E&&!h)},null==(i=e.label)?void 0:i.replace("&","&"))})))),tl()(tS,{label:c,isMandatory:p}),d&&tl()(tL,{helperText:d})])}}},t$=()=>{let e={},t=(e,t)=>t||e.replace(/ /g,"").toLowerCase();return{view:({attrs:{tabWidth:n,selectedTabId:i,tabs:r,className:o,style:s,duration:a,onShow:l,swipeable:u,responsiveThreshold:c}})=>{let d=r.filter(e=>e.active).shift(),h=i||(d?t(d.title,d.id):"");return tl()(".row",[tl()(".col.s12",tl()("ul.tabs"+("fill"===n?".tabs-fixed-width":""),{className:o,style:s,oncreate:({dom:t})=>{e.instance=M.Tabs.init(t,{duration:a,onShow:l,responsiveThreshold:c,swipeable:u})},onupdate:()=>{if(h){let e=document.getElementById(`tab_${h}`);e&&e.click()}},onremove:()=>e.instance.destroy()},r.map(({className:e,title:i,id:o,active:s,disabled:a,target:l,href:u})=>tl()(`li.tab${a?".disabled":""}${"fixed"===n?`.col.s${Math.floor(12/r.length)}`:""}`,{className:e},tl()(`a[id=tab_${t(i,o)}]${s?".active":""}`,{target:l,href:u||`#${t(i,o)}`},i))))),r.filter(({href:e})=>void 0===e).map(({id:e,title:n,vnode:i,contentClass:r})=>tl()(`.col.s12[id=${t(n,e)}]`,{className:r},i))])}}};function tH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n=new Date(e);return"".concat(n.getFullYear()).concat(t).concat(tE(n.getMonth()+1)).concat(t).concat(tE(n.getDate()))},tZ=function(){window.scrollTo({top:0,behavior:"smooth"})},tX=function(e,t){return" ".repeat(t)+e},tJ=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(function(n){var i,r=n.id,o=n.label,s=n.parents;return{id:r,label:o,group:t?void 0:s&&s.length>0?null===(i=e.find(function(e){return e.id===s[0]}))||void 0===i?void 0:i.label:nh("OTHER")}})},t0=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t=Array.isArray(t)?t:[t],e.filter(function(e){return t.includes(e.id)})},t1=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t0(e,t).map(function(e){return"- ".concat(e.label)}).join("\n")},t2=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t0(e,t).map(function(e,t){return"".concat(t+1,". ").concat(e.label)}).join("\n")},t4=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t0(e,t).map(function(e,t){return e.label}).join(", ")},t3=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.productIds,i=t.geoLocationIds,r=t.locationIds,o=t.roleIds,s=t.attributeIds,a=t.transportIds;return t4(e,tQ(void 0===n?[]:n).concat(tQ(void 0===i?[]:i),tQ(void 0===r?[]:r),tQ(void 0===o?[]:o),tQ(void 0===s?[]:s),tQ(void 0===a?[]:a)))},t5=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e.replace(/[^\w\s]/g,"").split(/\s+/).map(function(e){return e.toLowerCase()}).filter(function(e){return e.length>2&&!t.includes(e)})},t6=function(e){var t=new Map,n=!0,i=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)!function(){var e,n,i=(e=o.value,n=4,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,i,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{!s&&null!=r.return&&r.return()}finally{if(a)throw i}}return o}}(e,4)||tV(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r=i[0],s=i[1],a=i[2],l=i[3];!t.has(r)&&t.set(r,{crimeScriptIdx:r,totalScore:0,acts:[]});var u=t.get(r);u.totalScore+=l;var c=u.acts.find(function(e){return e.actIdx===s});c?c.score+=l:u.acts.push({actIdx:s,phaseIdx:a,score:l})}()}catch(e){i=!0,r=e}finally{try{!n&&null!=s.return&&s.return()}finally{if(i)throw r}}var a=Array.from(t.values()).sort(function(e,t){if(t.totalScore!==e.totalScore)return t.totalScore-e.totalScore;var n,i,r=(n=Math).max.apply(n,tQ(e.acts.map(function(e){return e.score})));return(i=Math).max.apply(i,tQ(t.acts.map(function(e){return e.score})))-r});return a.forEach(function(e){e.acts.sort(function(e,t){return t.score-e.score})}),a},t8=function(e){return e&&"object"==typeof e};function t9(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this.opts,i=n.array;n.array=!0;var r=this.apply(null,e);return n.array=i,r}function t7(e,t){e=e||{},(t=t||{}).resolveAliases&&(e=t7.resolveAliases(e));var n={};function i(e,t,r){return function(e,t,n,i,r,o){r=r||{};var s=i[e],a=t8(s),l=a||null!=t||null!=n;if(l){if(t8(t)){var u=n;n=t,t=u}if(n=n||{},a){var c=null!=t&&s[t]||s["*"];if(null!=c)s=c;else if("number"==typeof t){var d,h,p,f,m=r.pluralize;d=s,h=t,p=m,f=Math.abs(h),s=null!=d[f=p?p(f):f]?d[f]:null!=d.n?d.n:void 0}}}if("string"!=typeof s){if(!1===r.useKeyForMissingTranslation)return;s=e,r.debug&&(null!=t?(s="@@"+e+"."+t+"@@",console.warn('No translation or pluralization form found for "'+t+'" in'+e)):(s="@@"+s+"@@",console.warn('Translation for "'+e+'" not found.')))}return l?function(e,t,n,i,r){var o=i[e];if(null==o){var s=e.replace(/\{(\w+)\}/g,"{x}$1{x}").split("{x}");o=s.length>1?s:s[0],i[e]=o}return o=o.pop?function(e,t,n,i){for(var r=i.array?e.slice():e[0],o=e.length,s=1;s- Stuursloten en startonderbrekers
    - Anti-overval schermen
    - Manipulatiebestendige verpakking | 6. Breid toezicht uit
    - Ga \'s nachts in groep uit
    - Laat tekenen van bewoning achter
    - Draag een mobiele telefoon | 11. Verberg doelen
    - Parkeren buiten de straat
    - Genderneutrale telefoongidsen
    - Ongemarkeerde gepantserde vrachtwagens | 16. Verminder frustraties en stress
    - Effici\xebnte rijen
    - Beleefde service
    - Uitgebreide zitplaatsen
    - Rustgevende muziek/gedempte verlichting | 21. Stel regels op
    - Huurovereenkomsten
    - Intimidatiecodes
    - Hotelregistratie |\n| 2. Controleer toegang tot faciliteiten
    - Deurtelefoons
    - Elektronische kaart toegang
    - Bagagecontrole | 7. Ondersteun natuurlijk toezicht
    - Verbeterde straatverlichting
    - Verdedigbaar ruimteontwerp
    - Ondersteuning van klokkenluiders | 12. Verwijder doelen
    - Verwijderbare autoradio
    - Vrouwenopvang
    - Prepaidkaarten voor openbare telefoons | 17. Vermijd geschillen
    - Gescheiden zitplaatsen voor rivaliserende voetbalfans
    - Verminder drukte in bars
    - Vaste taxitarieven | 22. Plaats instructies
    - "Parkeren verboden"
    - "Priv\xe9-eigendom"
    - "Doof kampvuren" |\n| 3. Controleer uitgangen
    - Ticket nodig voor vertrek
    - Exportdocumenten
    - Elektronische artikelbeveiliging | 8. Verminder anonimiteit
    - Taxichauffeur ID\'s
    - "Hoe is mijn rijgedrag?" stickers
    - Schooluniformen | 13. Identificeer eigendom
    - Eigendomsmarkering
    - Voertuigregistratie en onderdelenmarkering
    - Veemerken | 18. Verminder verleiding en opwinding
    - Controles op gewelddadige pornografie
    - Handhaaf goed gedrag op voetbalveld
    - Verbied racistische opmerkingen | 23. Activeer geweten
    - Snelheidsweergaveborden langs de weg
    - Handtekeningen voor douaneaangiften
    - "Winkeldiefstal is stelen" |\n| 4. Leid overtreders af
    - Straatafsluitingen
    - Aparte toiletten voor vrouwen
    - Verspreid pubs | 9. Gebruik plaatsmanagers
    - CCTV voor dubbeldekkers
    - Twee bedienden voor gemakswinkels
    - Beloon waakzaamheid | 14. Verstoor markten
    - Monitor pandjeshuis
    - Controles op rubrieksadvertenties
    - Vergunning voor straatverkopers | 19. Neutraliseer groepsdruk
    - "Idioten drinken en rijden"
    - "Het is OK om Nee te zeggen"
    - Verspreid onruststokers op school | 24. Help bij naleving
    - Eenvoudige bibliotheekuitleen
    - Openbare toiletten
    - Afvalbakken |\n| 5. Beheers gereedschappen/wapens
    - "Slimme" wapens
    - Beperk verkoop spuitverf aan jongeren
    - Geharde bierglazen | 10. Versterk formeel toezicht
    - Roodlichtcamera\'s
    - Inbraakalarm
    - Beveiligingspersoneel | 15. Ontzeg voordelen
    - Inktlabels op artikelen
    - Graffiti reiniging
    - Uitschakelen gestolen mobiele telefoons | 20. Ontmoedig imitatie
    - Snelle reparatie van vandalisme
    - V-chips in TV\'s
    - Censureer details van modus operandi | 25. Beheers drugs en alcohol
    - Ademanalysers in bars
    - Interventie programma\'s voor barpersoneel
    - Alcoholvrije evenementen |\n'},CRIME_SCRIPT:{TITLE:"Crime script",ROUTE:"/crime_script"},SETTINGS:{TITLE:"Instellingen",ROUTE:"/instellingen"},LANDING:{TITLE:"Introductie",ROUTE:"/"},CASE:{TITLE:"Casus",ROUTE:"/casus"},USER:"Gebruiker",EDITOR:"Redacteur",ADMIN:"Beheerder",CANCEL:"Annuleren",DELETE:"Verwijderen",YES:"Ja",NO:"Nee",OK:"Ok",NAME:"Naam",MISC:"Overig",DESCRIPTION:"Beschrijving",DELETE_ITEM:{TITLE:"{item} verwijderen",DESCRIPTION:"Weet je zeker dat je dit {item} wilt verwijderen? Dit kan niet ongedaan worden gemaakt."},EDIT_BUTTON:{LABEL:"Bewerken",TOOLTIP:"Bewerken"},SAVE_BUTTON:{LABEL:"Opslaan",TOOLTIP:"Wijzigingen opslaan"},MODEL:"Model",TITLE:"Titel",AUTHORS:"Auteurs",LINK:"Link",TYPE:"Type",CAST_TYPE:"Roltype",SAVE_SCRIPT:"Script opslaan",EDIT_SCRIPT:"Script bewerken",DELETE_SCRIPT:"Script verwijderen",NEW_SCRIPT:"Nieuw script",DELETE_SCRIPT_CONFIRM:'Weet je zeker dat je het script "{name}" wilt verwijderen?',ACTIVITIES:"Activiteiten",CAST:"Rollen",CONDITIONS:"Voorwaarden",ATTRIBUTES:"Attributen",MEASURES:"Maatregelen",NEW_ACT:"Nieuwe handeling",PREPARATION_PHASE:"Voorbereidingsfase",PRE_ACTIVITY_PHASE:"Voor-activiteitsfase",ACTIVITY_PHASE:"Activiteitsfase",POST_ACTIVITY_PHASE:"Na-activiteitsfase",SUMMARY:"Samenvatting",IMAGE:"Afbeelding",ACTIVITY:"Activiteit",SPECIFY:"Specificeer",CONDITION:"Voorwaarde",CATEGORY:"Categorie",SELECT:"Selecteren",CREATE:"Maken",STAGES:"Fasen",STAGE:"Fase",SCENES:"Scenes",SCENE:"Scene",ACTS:"Actes",ACT:"Acte",SELECT_ACT_TO_EDIT:"Selecteer handeling om te bewerken",CREATE_NEW_ACT:"Nieuwe handeling maken",REFERENCES:"Referenties",DETAILS:"Details",LANGUAGE:"Taal",CLEAR:"Wis model",UPLOAD:"Lees model in als JSON",DOWNLOAD:"Sla model op als JSON",PERMALINK:"Maak permanente link",ROLE:"Rol",SELECT_ACT:"Selecteer act om te bewerken",SELECT_ACT_N:"Selecteer een of meerdere acts in deze stage",INCREASE_EFFORT:"Verhoog de inspanning",TARGET_HARDEN:{TITLE:"Doelversteviging",DESC:"Stuursloten en startonderbrekers, Anti-overval schermen, Manipulatiebestendige verpakking"},CONTROL_ACCESS:{TITLE:"Controleer toegang tot faciliteiten",DESC:"Deurtelefoons, Elektronische kaart toegang, Bagagecontrole"},SCREEN_EXITS:{TITLE:"Controleer uitgangen",DESC:"Ticket nodig voor vertrek, Exportdocumenten, Elektronische artikelbeveiliging"},DEFLECT_OFFENDERS:{TITLE:"Leid overtreders af",DESC:"Straatafsluitingen, Aparte toiletten voor vrouwen, Verspreid pubs"},CONTROL_TOOLS:{TITLE:"Beheers gereedschappen/wapens",DESC:'"Slimme" wapens, Beperk verkoop spuitverf aan jongeren, Geharde bierglazen'},INCREASE_RISKS:"Verhoog de risico's",EXTEND_GUARDIANSHIP:{TITLE:"Breid toezicht uit",DESC:"Ga 's nachts in groep uit, Laat tekenen van bewoning achter, Draag een mobiele telefoon"},ASSIST_SURVEILLANCE:{TITLE:"Ondersteun natuurlijk toezicht",DESC:"Verbeterde straatverlichting, Verdedigbaar ruimteontwerp, Ondersteuning van klokkenluiders"},REDUCE_ANONYMITY:{TITLE:"Verminder anonimiteit",DESC:'Taxichauffeur ID\'s, "Hoe is mijn rijgedrag?" stickers, Schooluniformen'},USE_PLACE_MANAGERS:{TITLE:"Gebruik plaatsmanagers",DESC:"CCTV voor dubbeldekkers, Twee bedienden voor gemakswinkels, Beloon waakzaamheid"},STRENGTHEN_SURVEILLANCE:{TITLE:"Versterk formeel toezicht",DESC:"Roodlichtcamera's, Inbraakalarm, Beveiligingspersoneel"},REDUCE_REWARDS:"Verminder de beloningen",CONCEAL_TARGETS:{TITLE:"Verberg doelen",DESC:"Parkeren buiten de straat, Genderneutrale telefoongidsen, Ongemarkeerde gepantserde vrachtwagens"},REMOVE_TARGETS:{TITLE:"Verwijder doelen",DESC:"Verwijderbare autoradio, Vrouwenopvang, Prepaidkaarten voor openbare telefoons"},IDENTIFY_PROPERTY:{TITLE:"Identificeer eigendom",DESC:"Eigendomsmarkering, Voertuigregistratie en onderdelenmarkering, Veemerken"},DISRUPT_MARKETS:{TITLE:"Verstoor markten",DESC:"Monitor pandjeshuis, Controles op rubrieksadvertenties, Vergunning voor straatverkopers"},DENY_BENEFITS:{TITLE:"Ontzeg voordelen",DESC:"Inktlabels op artikelen, Graffiti reiniging, Uitschakelen gestolen mobiele telefoons"},REDUCE_PROVOCATIONS:"Verminder provocaties",REDUCE_FRUSTRATIONS:{TITLE:"Verminder frustraties en stress",DESC:"Effici\xebnte rijen, Beleefde service, Uitgebreide zitplaatsen, Rustgevende muziek/gedempte verlichting"},AVOID_DISPUTES:{TITLE:"Vermijd geschillen",DESC:"Gescheiden zitplaatsen voor rivaliserende voetbalfans, Verminder drukte in bars, Vaste taxitarieven"},REDUCE_TEMPTATION:{TITLE:"Verminder verleiding en opwinding",DESC:"Controles op gewelddadige pornografie, Handhaaf goed gedrag op voetbalveld, Verbied racistische opmerkingen"},NEUTRALIZE_PRESSURE:{TITLE:"Neutraliseer groepsdruk",DESC:'"Idioten drinken en rijden", "Het is OK om Nee te zeggen", Verspreid onruststokers op school'},DISCOURAGE_IMITATION:{TITLE:"Ontmoedig imitatie",DESC:"Snelle reparatie van vandalisme, V-chips in TV's, Censureer details van modus operandi"},REMOVE_EXCUSES:"Verwijder excuses",SET_RULES:{TITLE:"Stel regels op",DESC:"Huurovereenkomsten, Intimidatiecodes, Hotelregistratie"},POST_INSTRUCTIONS:{TITLE:"Plaats instructies",DESC:'"Parkeren verboden", "Priv\xe9-eigendom", "Doof kampvuren"'},ALERT_CONSCIENCE:{TITLE:"Activeer geweten",DESC:'Snelheidsweergaveborden langs de weg, Handtekeningen voor douaneaangiften, "Winkeldiefstal is stelen"'},ASSIST_COMPLIANCE:{TITLE:"Help bij naleving",DESC:"Eenvoudige bibliotheekuitleen, Openbare toiletten, Afvalbakken"},CONTROL_DRUGS:{TITLE:"Beheers drugs en alcohol",DESC:"Ademanalysers in bars, Interventie programma's voor barpersoneel, Alcoholvrije evenementen"},EXPORT_TO_WORD:"Exporteer naar Word",INTRODUCTION:"Introductie",SEARCH:"Zoek...",SEARCH_TOOLTIP:"Type / om te zoeken",HITS:{0:"Geen resultaten gevonden.",1:"1 resultaat gevonden:",n:"{n} resultaten gevonden:"},SYNONYMS:"Synoniemen",PARENTS:"Ouders",CATEGORIES:"Categorie\xebn",BELONGS_TO:"Behoort tot",LOCATIONS:{0:"Locaties",1:"Locatie",n:"Locaties"},PRODUCTS:{0:"Producten",1:"Product",n:"Producten"},GEOLOCATIONS:{0:"Kaartlocatie",1:"Kaartlocatie",n:"Kaartlocaties"},TRANSPORTS:"Transportmiddelen",I18n:{editRepeat:"Bewerk item",createRepeat:"Maak een nieuw item",deleteItem:"Verwijder een item",agree:"Ja",disagree:"Nee",pickOne:"Kies \xe9\xe9n",pickOneOrMore:"Kies \xe9\xe9n of meer",cancel:"Opheffen",save:"Bewaren"},OTHER:"Overig",TEXT:"Tekst"},nn={HOME:{TITLE:"Home",ROUTE:"/home"},ABOUT:{TITLE:"About the app",ROUTE:"/about",TEXT:'\n\n#### Situational Crime Prevention techniques\n\n| Increase the effort | Increase the risks | Reduce the rewards | Reduce provocations | Remove excuses |\n|---------------------|---------------------|---------------------|----------------------|-----------------|\n| 1. Target harden
    - Steering column locks and ignition immobilizers
    - Anti-robbery screens
    - Tamper-proof packaging | 6. Extend guardianship
    - Go out in group at night
    - Leave signs of occupancy
    - Carry cell phone | 11. Conceal targets
    - Off-street parking
    - Gender-neutral phone directories
    - Unmarked armored trucks | 16. Reduce frustrations and stress
    - Efficient lines
    - Polite service
    - Expanded seating
    - Soothing music/muted lights | 21. Set rules
    - Rental agreements
    - Harassment codes
    - Hotel registration |\n| 2. Control access to facilities
    - Entry phones
    - Electronic card access
    - Baggage screening | 7. Assist natural surveillance
    - Improved street lighting
    - Defensible space design
    - Support whistleblowers | 12. Remove targets
    - Removable car radio
    - Women\'s shelters
    - Pre-paid cards for pay phones | 17. Avoid disputes
    - Separate seating for rival soccer fans
    - Reduce crowding in bars
    - Fixed cab fares | 22. Post instructions
    - "No parking"
    - "Private property"
    - "Extinguish camp fires" |\n| 3. Screen exits
    - Ticket needed for exit
    - Export documents
    - Electronic merchandise tags | 8. Reduce anonymity
    - Taxi driver IDs
    - "How\'s my driving?" decals
    - School uniforms | 13. Identify property
    - Property marking
    - Vehicle licensing and parts marking
    - Cattle branding | 18. Reduce temptation and arousal
    - Controls on violent pornography
    - Enforce good behavior on soccer field
    - Prohibit racial slurs | 23. Alert conscience
    - Roadside speed display boards
    - Signatures for customs declarations
    - "Shoplifting is stealing" |\n| 4. Deflect offenders
    - Street closures
    - Separate bathrooms for women
    - Disperse pubs | 9. Use place managers
    - CCTV for double-deck buses
    - Two clerks for convenience stores
    - Reward vigilance | 14. Disrupt markets
    - Monitor pawn shops
    - Controls on classified ads
    - License street vendors | 19. Neutralize peer pressure
    - "Idiots drink and drive"
    - "It\'s OK to say No"
    - Disperse troublemakers at school | 24. Assist compliance
    - Easy library checkout
    - Public lavatories
    - Litter receptacles |\n| 5. Control tools/weapons
    - "Smart" guns
    - Restrict spray paint sales to juveniles
    - Toughened beer glasses | 10. Strengthen formal surveillance
    - Red light cameras
    - Burglar alarms
    - Security guards | 15. Deny benefits
    - Ink merchandise tags
    - Graffiti cleaning
    - Disabling stolen cell phones | 20. Discourage imitation
    - Rapid repair of vandalism
    - V-chips in TVs
    - Censor details of modus operandi | 25. Control drugs and alcohol
    - Breathalyzers in bars
    - Server intervention programs
    - Alcohol-free events |\n'},CRIME_SCRIPT:{TITLE:"Crime script",ROUTE:"/crime_script"},SETTINGS:{TITLE:"Settings",ROUTE:"/settings"},LANDING:{TITLE:"Introduction",ROUTE:"/"},CASE:{TITLE:"Case file",ROUTE:"/case"},USER:"User",EDITOR:"Editor",ADMIN:"Administrator",CANCEL:"Cancel",DELETE:"Delete",YES:"Yes",NO:"No",OK:"Ok",NAME:"Name",MISC:"Miscellaneous",DESCRIPTION:"Description",DELETE_ITEM:{TITLE:"Delete {item}",DESCRIPTION:"Are you certain you want to delete this {item}. There is no turning back?"},EDIT_BUTTON:{LABEL:"Edit",TOOLTIP:"Edit"},SAVE_BUTTON:{LABEL:"Save",TOOLTIP:"Save unsaved changes"},MODEL:"Model",TITLE:"Title",AUTHORS:"Authors",LINK:"Link",TYPE:"Type",CAST_TYPE:"Role type",SAVE_SCRIPT:"Save Script",EDIT_SCRIPT:"Edit Script",DELETE_SCRIPT:"Delete Script",NEW_SCRIPT:"New Script",DELETE_SCRIPT_CONFIRM:'Are you certain you want to delete the script "{name}"?',ACTIVITIES:"Activities",CAST:"Cast",CONDITIONS:"Conditions",ATTRIBUTES:"Attributes",MEASURES:"Measures",NEW_ACT:"New Act",PREPARATION_PHASE:"Preparation Phase",PRE_ACTIVITY_PHASE:"Pre-Activity Phase",ACTIVITY_PHASE:"Activity Phase",POST_ACTIVITY_PHASE:"Post-Activity Phase",SUMMARY:"Summary",IMAGE:"Image",ACTIVITY:"Activity",SPECIFY:"Specify",CONDITION:"Condition",CATEGORY:"Category",SELECT:"Select",CREATE:"Create",STAGES:"Stages",STAGE:"Stage",SCENES:"Scenes",SCENE:"Scene",ACTS:"Acts",ACT:"Act",SELECT_ACT_TO_EDIT:"Select act to edit",CREATE_NEW_ACT:"Create new act",REFERENCES:"References",DETAILS:"Details",LANGUAGE:"Language",CLEAR:"Clear model",UPLOAD:"Upload model as JSON",DOWNLOAD:"Download model as JSON",PERMALINK:"Create permanent link",ROLE:"Role",SELECT_ACT:"Select act to edit",SELECT_ACT_N:"Select one or more acts for this step",INCREASE_EFFORT:"Increase the effort",TARGET_HARDEN:{TITLE:"Target harden",DESC:"Steering column locks and ignition immobilizers, Anti-robbery screens, Tamper-proof packaging"},CONTROL_ACCESS:{TITLE:"Control access to facilities",DESC:"Entry phones, Electronic card access, Baggage screening"},SCREEN_EXITS:{TITLE:"Screen exits",DESC:"Ticket needed for exit, Export documents, Electronic merchandise tags"},DEFLECT_OFFENDERS:{TITLE:"Deflect offenders",DESC:"Street closures, Separate bathrooms for women, Disperse pubs"},CONTROL_TOOLS:{TITLE:"Control tools/weapons",DESC:'"Smart" guns, Restrict spray paint sales to juveniles, Toughened beer glasses'},INCREASE_RISKS:"Increase the risks",EXTEND_GUARDIANSHIP:{TITLE:"Extend guardianship",DESC:"Go out in group at night, Leave signs of occupancy, Carry cell phone"},ASSIST_SURVEILLANCE:{TITLE:"Assist natural surveillance",DESC:"Improved street lighting, Defensible space design, Support whistleblowers"},REDUCE_ANONYMITY:{TITLE:"Reduce anonymity",DESC:'Taxi driver IDs, "How\'s my driving?" decals, School uniforms'},USE_PLACE_MANAGERS:{TITLE:"Use place managers",DESC:"CCTV for double-deck buses, Two clerks for convenience stores, Reward vigilance"},STRENGTHEN_SURVEILLANCE:{TITLE:"Strengthen formal surveillance",DESC:"Red light cameras, Burglar alarms, Security guards"},REDUCE_REWARDS:"Reduce the rewards",CONCEAL_TARGETS:{TITLE:"Conceal targets",DESC:"Off-street parking, Gender-neutral phone directories, Unmarked armored trucks"},REMOVE_TARGETS:{TITLE:"Remove targets",DESC:"Removable car radio, Women's shelters, Pre-paid cards for pay phones"},IDENTIFY_PROPERTY:{TITLE:"Identify property",DESC:"Property marking, Vehicle licensing and parts marking, Cattle branding"},DISRUPT_MARKETS:{TITLE:"Disrupt markets",DESC:"Monitor pawn shops, Controls on classified ads, License street vendors"},DENY_BENEFITS:{TITLE:"Deny benefits",DESC:"Ink merchandise tags, Graffiti cleaning, Disabling stolen cell phones"},REDUCE_PROVOCATIONS:"Reduce provocations",REDUCE_FRUSTRATIONS:{TITLE:"Reduce frustrations and stress",DESC:"Efficient lines, Polite service, Expanded seating, Soothing music/muted lights"},AVOID_DISPUTES:{TITLE:"Avoid disputes",DESC:"Separate seating for rival soccer fans, Reduce crowding in bars, Fixed cab fares"},REDUCE_TEMPTATION:{TITLE:"Reduce temptation and arousal",DESC:"Controls on violent pornography, Enforce good behavior on soccer field, Prohibit racial slurs"},NEUTRALIZE_PRESSURE:{TITLE:"Neutralize peer pressure",DESC:'"Idiots drink and drive", "It\'s OK to say No", Disperse troublemakers at school'},DISCOURAGE_IMITATION:{TITLE:"Discourage imitation",DESC:"Rapid repair of vandalism, V-chips in TVs, Censor details of modus operandi"},REMOVE_EXCUSES:"Remove excuses",SET_RULES:{TITLE:"Set rules",DESC:"Rental agreements, Harassment codes, Hotel registration"},POST_INSTRUCTIONS:{TITLE:"Post instructions",DESC:'"No parking", "Private property", "Extinguish camp fires"'},ALERT_CONSCIENCE:{TITLE:"Alert conscience",DESC:'Roadside speed display boards, Signatures for customs declarations, "Shoplifting is stealing"'},ASSIST_COMPLIANCE:{TITLE:"Assist compliance",DESC:"Easy library checkout, Public lavatories, Litter receptacles"},CONTROL_DRUGS:{TITLE:"Control drugs and alcohol",DESC:"Breathalyzers in bars, Server intervention programs, Alcohol-free events"},EXPORT_TO_WORD:"Export to Word",INTRODUCTION:"Introduction",SEARCH:"Search...",SEARCH_TOOLTIP:"Type / to search",HITS:{0:"No results found.",1:"1 result found:",n:"{n} results found:"},SYNONYMS:"Synonyms",PARENTS:"Parents",CATEGORIES:"Categories",BELONGS_TO:"Belongs to",PRODUCTS:{0:"Products",1:"Product",n:"Products"},LOCATIONS:{0:"Locations",1:"Location",n:"Locations"},GEOLOCATIONS:{0:"Geographic Locations",1:"Geographic Location",n:"Geographic Locations"},TRANSPORTS:"Transports",I18n:{editRepeat:"",createRepeat:"",deleteItem:"",agree:"",disagree:"",pickOne:"",pickOneOrMore:"",cancel:"",save:""},OTHER:"Other",TEXT:"Text"},ni=JSON.parse('["aan","aangaande","aangezien","achte","achter","achterna","af","afgelopen","al","aldaar","aldus","alhoewel","alias","alle","allebei","alleen","alles","als","alsnog","altijd","altoos","ander","andere","anders","anderszins","beetje","behalve","behoudens","beide","beiden","ben","beneden","bent","bepaald","betreffende","bij","bijna","bijv","binnen","binnenin","blijkbaar","blijken","boven","bovenal","bovendien","bovengenoemd","bovenstaand","bovenvermeld","buiten","bv","daar","daardoor","daarheen","daarin","daarna","daarnet","daarom","daarop","daaruit","daarvanlangs","dan","dat","de","deden","deed","der","derde","derhalve","dertig","deze","dhr","die","dikwijls","dit","doch","doe","doen","doet","door","doorgaand","drie","duizend","dus","echter","een","eens","eer","eerdat","eerder","eerlang","eerst","eerste","eigen","eigenlijk","elk","elke","en","enig","enige","enigszins","enkel","er","erdoor","erg","ergens","etc","etcetera","even","eveneens","evenwel","gauw","ge","gedurende","geen","gehad","gekund","geleden","gelijk","gemoeten","gemogen","genoeg","geweest","gewoon","gewoonweg","haar","haarzelf","had","hadden","hare","heb","hebben","hebt","hedden","heeft","heel","hem","hemzelf","hen","het","hetzelfde","hier","hierbeneden","hierboven","hierin","hierna","hierom","hij","hijzelf","hoe","hoewel","honderd","hun","hunne","ieder","iedere","iedereen","iemand","iets","ik","ikzelf","in","inderdaad","inmiddels","intussen","inzake","is","ja","je","jezelf","jij","jijzelf","jou","jouw","jouwe","juist","jullie","kan","klaar","kon","konden","krachtens","kun","kunnen","kunt","laatst","later","liever","lijken","lijkt","maak","maakt","maakte","maakten","maar","mag","maken","me","meer","meest","meestal","men","met","mevr","mezelf","mij","mijn","mijnent","mijner","mijzelf","minder","miss","misschien","missen","mits","mocht","mochten","moest","moesten","moet","moeten","mogen","mr","mrs","mw","na","naar","nadat","nam","namelijk","nee","neem","negen","nemen","nergens","net","niemand","niet","niets","niks","noch","nochtans","nog","nogal","nooit","nu","nv","of","ofschoon","om","omdat","omhoog","omlaag","omstreeks","omtrent","omver","ondanks","onder","ondertussen","ongeveer","ons","onszelf","onze","onzeker","ooit","ook","op","opnieuw","opzij","over","overal","overeind","overige","overigens","paar","pas","per","precies","recent","redelijk","reeds","rond","rondom","samen","sedert","sinds","sindsdien","slechts","sommige","spoedig","steeds","tamelijk","te","tegen","tegenover","tenzij","terwijl","thans","tien","tiende","tijdens","tja","toch","toe","toen","toenmaals","toenmalig","tot","totdat","tussen","twee","tweede","u","uit","uitgezonderd","uw","vaak","vaakwat","van","vanaf","vandaan","vanuit","vanwege","veel","veeleer","veertig","verder","verscheidene","verschillende","vervolgens","via","vier","vierde","vijf","vijfde","vijftig","vol","volgend","volgens","voor","vooraf","vooral","vooralsnog","voorbij","voordat","voordezen","voordien","voorheen","voorop","voorts","vooruit","vrij","vroeg","waar","waarom","waarschijnlijk","wanneer","want","waren","was","wat","we","wederom","weer","weg","wegens","weinig","wel","weldra","welk","welke","werd","werden","werder","wezen","whatever","wie","wiens","wier","wij","wijzelf","wil","wilden","willen","word","worden","wordt","zal","ze","zei","zeker","zelf","zelfde","zelfs","zes","zeven","zich","zichzelf","zij","zijn","zijne","zijzelf","zo","zoals","zodat","zodra","zonder","zou","zouden","zowat","zulk","zulke","zullen","zult"]'),nr=JSON.parse('["\'ll","\'tis","\'twas","\'ve","10","39","a","a\'s","able","ableabout","about","above","abroad","abst","accordance","according","accordingly","across","act","actually","ad","added","adj","adopted","ae","af","affected","affecting","affects","after","afterwards","ag","again","against","ago","ah","ahead","ai","ain\'t","aint","al","all","allow","allows","almost","alone","along","alongside","already","also","although","always","am","amid","amidst","among","amongst","amoungst","amount","an","and","announce","another","any","anybody","anyhow","anymore","anyone","anything","anyway","anyways","anywhere","ao","apart","apparently","appear","appreciate","appropriate","approximately","aq","ar","are","area","areas","aren","aren\'t","arent","arise","around","arpa","as","aside","ask","asked","asking","asks","associated","at","au","auth","available","aw","away","awfully","az","b","ba","back","backed","backing","backs","backward","backwards","bb","bd","be","became","because","become","becomes","becoming","been","before","beforehand","began","begin","beginning","beginnings","begins","behind","being","beings","believe","below","beside","besides","best","better","between","beyond","bf","bg","bh","bi","big","bill","billion","biol","bj","bm","bn","bo","both","bottom","br","brief","briefly","bs","bt","but","buy","bv","bw","by","bz","c","c\'mon","c\'s","ca","call","came","can","can\'t","cannot","cant","caption","case","cases","cause","causes","cc","cd","certain","certainly","cf","cg","ch","changes","ci","ck","cl","clear","clearly","click","cm","cmon","cn","co","co.","com","come","comes","computer","con","concerning","consequently","consider","considering","contain","containing","contains","copy","corresponding","could","could\'ve","couldn","couldn\'t","couldnt","course","cr","cry","cs","cu","currently","cv","cx","cy","cz","d","dare","daren\'t","darent","date","de","dear","definitely","describe","described","despite","detail","did","didn","didn\'t","didnt","differ","different","differently","directly","dj","dk","dm","do","does","doesn","doesn\'t","doesnt","doing","don","don\'t","done","dont","doubtful","down","downed","downing","downs","downwards","due","during","dz","e","each","early","ec","ed","edu","ee","effect","eg","eh","eight","eighty","either","eleven","else","elsewhere","empty","end","ended","ending","ends","enough","entirely","er","es","especially","et","et-al","etc","even","evenly","ever","evermore","every","everybody","everyone","everything","everywhere","ex","exactly","example","except","f","face","faces","fact","facts","fairly","far","farther","felt","few","fewer","ff","fi","fifteen","fifth","fifty","fify","fill","find","finds","fire","first","five","fix","fj","fk","fm","fo","followed","following","follows","for","forever","former","formerly","forth","forty","forward","found","four","fr","free","from","front","full","fully","further","furthered","furthering","furthermore","furthers","fx","g","ga","gave","gb","gd","ge","general","generally","get","gets","getting","gf","gg","gh","gi","give","given","gives","giving","gl","gm","gmt","gn","go","goes","going","gone","good","goods","got","gotten","gov","gp","gq","gr","great","greater","greatest","greetings","group","grouped","grouping","groups","gs","gt","gu","gw","gy","h","had","hadn\'t","hadnt","half","happens","hardly","has","hasn","hasn\'t","hasnt","have","haven","haven\'t","havent","having","he","he\'d","he\'ll","he\'s","hed","hell","hello","help","hence","her","here","here\'s","hereafter","hereby","herein","heres","hereupon","hers","herself","herse”","hes","hi","hid","high","higher","highest","him","himself","himse”","his","hither","hk","hm","hn","home","homepage","hopefully","how","how\'d","how\'ll","how\'s","howbeit","however","hr","ht","htm","html","http","hu","hundred","i","i\'d","i\'ll","i\'m","i\'ve","i.e.","id","ie","if","ignored","ii","il","ill","im","immediate","immediately","importance","important","in","inasmuch","inc","inc.","indeed","index","indicate","indicated","indicates","information","inner","inside","insofar","instead","int","interest","interested","interesting","interests","into","invention","inward","io","iq","ir","is","isn","isn\'t","isnt","it","it\'d","it\'ll","it\'s","itd","itll","its","itself","itse”","ive","j","je","jm","jo","join","jp","just","k","ke","keep","keeps","kept","keys","kg","kh","ki","kind","km","kn","knew","know","known","knows","kp","kr","kw","ky","kz","l","la","large","largely","last","lately","later","latest","latter","latterly","lb","lc","least","length","less","lest","let","let\'s","lets","li","like","liked","likely","likewise","line","little","lk","ll","long","longer","longest","look","looking","looks","low","lower","lr","ls","lt","ltd","lu","lv","ly","m","ma","made","mainly","make","makes","making","man","many","may","maybe","mayn\'t","maynt","mc","md","me","mean","means","meantime","meanwhile","member","members","men","merely","mg","mh","microsoft","might","might\'ve","mightn\'t","mightnt","mil","mill","million","mine","minus","miss","mk","ml","mm","mn","mo","more","moreover","most","mostly","move","mp","mq","mr","mrs","ms","msie","mt","mu","much","mug","must","must\'ve","mustn\'t","mustnt","mv","mw","mx","my","myself","myse”","mz","n","na","name","namely","nay","nc","nd","ne","near","nearly","necessarily","necessary","need","needed","needing","needn\'t","neednt","needs","neither","net","netscape","never","neverf","neverless","nevertheless","new","newer","newest","next","nf","ng","ni","nine","ninety","nl","no","no-one","nobody","non","none","nonetheless","noone","nor","normally","nos","not","noted","nothing","notwithstanding","novel","now","nowhere","np","nr","nu","null","number","numbers","nz","o","obtain","obtained","obviously","of","off","often","oh","ok","okay","old","older","oldest","om","omitted","on","once","one","one\'s","ones","only","onto","open","opened","opening","opens","opposite","or","ord","order","ordered","ordering","orders","org","other","others","otherwise","ought","oughtn\'t","oughtnt","our","ours","ourselves","out","outside","over","overall","owing","own","p","pa","page","pages","part","parted","particular","particularly","parting","parts","past","pe","per","perhaps","pf","pg","ph","pk","pl","place","placed","places","please","plus","pm","pmid","pn","point","pointed","pointing","points","poorly","possible","possibly","potentially","pp","pr","predominantly","present","presented","presenting","presents","presumably","previously","primarily","probably","problem","problems","promptly","proud","provided","provides","pt","put","puts","pw","py","q","qa","que","quickly","quite","qv","r","ran","rather","rd","re","readily","really","reasonably","recent","recently","ref","refs","regarding","regardless","regards","related","relatively","research","reserved","respectively","resulted","resulting","results","right","ring","ro","room","rooms","round","ru","run","rw","s","sa","said","same","saw","say","saying","says","sb","sc","sd","se","sec","second","secondly","seconds","section","see","seeing","seem","seemed","seeming","seems","seen","sees","self","selves","sensible","sent","serious","seriously","seven","seventy","several","sg","sh","shall","shan\'t","shant","she","she\'d","she\'ll","she\'s","shed","shell","shes","should","should\'ve","shouldn","shouldn\'t","shouldnt","show","showed","showing","shown","showns","shows","si","side","sides","significant","significantly","similar","similarly","since","sincere","site","six","sixty","sj","sk","sl","slightly","sm","small","smaller","smallest","sn","so","some","somebody","someday","somehow","someone","somethan","something","sometime","sometimes","somewhat","somewhere","soon","sorry","specifically","specified","specify","specifying","sr","st","state","states","still","stop","strongly","su","sub","substantially","successfully","such","sufficiently","suggest","sup","sure","sv","sy","system","sz","t","t\'s","take","taken","taking","tc","td","tell","ten","tends","test","text","tf","tg","th","than","thank","thanks","thanx","that","that\'ll","that\'s","that\'ve","thatll","thats","thatve","the","their","theirs","them","themselves","then","thence","there","there\'d","there\'ll","there\'re","there\'s","there\'ve","thereafter","thereby","thered","therefore","therein","therell","thereof","therere","theres","thereto","thereupon","thereve","these","they","they\'d","they\'ll","they\'re","they\'ve","theyd","theyll","theyre","theyve","thick","thin","thing","things","think","thinks","third","thirty","this","thorough","thoroughly","those","thou","though","thoughh","thought","thoughts","thousand","three","throug","through","throughout","thru","thus","til","till","tip","tis","tj","tk","tm","tn","to","today","together","too","took","top","toward","towards","tp","tr","tried","tries","trillion","truly","try","trying","ts","tt","turn","turned","turning","turns","tv","tw","twas","twelve","twenty","twice","two","tz","u","ua","ug","uk","um","un","under","underneath","undoing","unfortunately","unless","unlike","unlikely","until","unto","up","upon","ups","upwards","us","use","used","useful","usefully","usefulness","uses","using","usually","uucp","uy","uz","v","va","value","various","vc","ve","versus","very","vg","vi","via","viz","vn","vol","vols","vs","vu","w","want","wanted","wanting","wants","was","wasn","wasn\'t","wasnt","way","ways","we","we\'d","we\'ll","we\'re","we\'ve","web","webpage","website","wed","welcome","well","wells","went","were","weren","weren\'t","werent","weve","wf","what","what\'d","what\'ll","what\'s","what\'ve","whatever","whatll","whats","whatve","when","when\'d","when\'ll","when\'s","whence","whenever","where","where\'d","where\'ll","where\'s","whereafter","whereas","whereby","wherein","wheres","whereupon","wherever","whether","which","whichever","while","whilst","whim","whither","who","who\'d","who\'ll","who\'s","whod","whoever","whole","wholl","whom","whomever","whos","whose","why","why\'d","why\'ll","why\'s","widely","width","will","willing","wish","with","within","without","won","won\'t","wonder","wont","words","work","worked","working","works","world","would","would\'ve","wouldn","wouldn\'t","wouldnt","ws","www","x","y","ye","year","years","yes","yet","you","you\'d","you\'ll","you\'re","you\'ve","youd","youll","young","younger","youngest","your","youre","yours","yourself","yourselves","youve","yt","yu","z","za","zero","zm","zr"]');function no(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){n(e);return}a.done?t(l):Promise.resolve(l).then(i,r)}function ns(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){no(o,i,r,s,a,"next",e)}function a(e){no(o,i,r,s,a,"throw",e)}s(void 0)})}}function na(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=0}(e)?e:nc.defaultLocale,nc.currentLocale=t,nc.stopwords="nl"===e?ni:nr,nh=nl(e),nd.agree=nh("I18n","agree"),nd.disagree=nh("I18n","disagree"),nd.cancel=nh("I18n","cancel"),nd.save=nh("I18n","save"),nd.editRepeat=nh("I18n","editRepeat"),nd.createRepeat=nh("I18n","createRepeat"),nd.deleteItem=nh("I18n","deleteItem"),nd.pickOne=nh("I18n","pickOne"),nd.pickOneOrMore=nh("I18n","pickOneOrMore"),nu.forEach(function(e){return e(nc.currentLocale,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nc.currentLocale;return nc.locales[e].dir||"ltr"}())}),[2])})})).apply(this,arguments)}function ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);ne.length)&&(t=e.length);for(var n=0,i=Array(t);n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]2)||void 0===arguments[2]||arguments[2];e.map(function(e){return d.get(e)}).filter(function(e){return void 0!==e}).forEach(function(e){var i;p(e.label,t),null===(i=e.synonyms)||void 0===i||i.forEach(function(e){return p(e,t)}),n&&e.parents&&f(e.parents,[t[0],t[1],t[2],tt.PARENT_MATCH],!1)})};(void 0===r?[]:r).forEach(function(e,t){var n=e.label,i=e.description,r=e.stages,o=[t,-1,-1,tt.OTHER_MATCH];t5((void 0===n?"":n)+" "+(void 0===i?"":i),nc.stopwords).forEach(function(e){return p(e,o)}),(void 0===r?[]:r).forEach(function(e){e.ids.forEach(function(e){var n=l.findIndex(function(t){return t.id===e});if(!(n<0)){var i=l[n];[i.preparation,i.preactivity,i.activity,i.postactivity].forEach(function(e,i){e.locationIds&&Array.isArray(e.locationIds)&&f(e.locationIds,[t,n,i,tt.EXACT_MATCH]);var r,o,s=[t,n,i,tt.OTHER_MATCH];null===(r=e.activities)||void 0===r||r.forEach(function(e){var r=e.label,o=e.description,a=e.cast,l=e.attributes,u=e.transports;t5((void 0===r?"":r)+" "+(void 0===o?"":o),nc.stopwords).forEach(function(e){return p(e,s)});var c=[t,n,i,tt.EXACT_MATCH];f(ny(void 0===a?[]:a).concat(ny(void 0===l?[]:l),ny(void 0===u?[]:u)),c)}),null===(o=e.conditions)||void 0===o||o.forEach(function(e){var t=e.label,n=e.description;t5((void 0===t?"":t)+" "+(void 0===n?"":n),nc.stopwords).forEach(function(e){return p(e,s)})})})}})})}),e.update({lookup:function(){return h}})}}}]}},nL=(0,tu.meiosisSetup)(nS);nL.map(function(){tl().redraw()}),(o=nb(function(){var e,t,n;return nE(this,function(i){return t=(e=localStorage.getItem(nT))?JSON.parse(e):{crimeScripts:[]},n=localStorage.getItem(n_)||"user",nL().update({role:n,model:function(){return t}}),[2]})}),function(){return o.apply(this,arguments)})();let nN=[[/\r\n/g,"\n"],[/\n(#+)(.*)/g,(e,t,n="")=>{let i=t.length;return`${n.trim()}`}],[/!\[([^\[]+)\]\((?:javascript:)?([^\)]+)\)/g,'$1'],[/\[([^\[]+)\]\((?:javascript:)?([^\)]+)\)/g,'$1'],[/([^\\])(\*\*|__)(.*?(_|\*)?)\2/g,"$1$3"],[/([^\\])(\*|_)(.*?)\2/g,"$1$3"],[/\\_/g,"_"],[/\~\~(.*?)\~\~/g,"$1"],[/\:\"(.*?)\"\:/g,"$1"],[/\n\s*```\n([^]*?)\n\s*```\s*\n/g,"\n
    $1
    "],[/`(.*?)`/g,(e,t)=>`${(e=>{e=e.replace(/\&/g,"&");let t="'#<>`*-~_=:\"![]()nt",n=t.length;for(let i=0;i`&#${e.charCodeAt(0)};`);return e})(t)}`],[/\n(\*|\-|\+)(.*)/g,(e,t,n="")=>`
    • ${n.trim()}
    `],[/\n[0-9]+\.(.*)/g,(e,t="")=>`
    1. ${t.trim()}
    2. @@ -11,7 +11,7 @@ ${t}

      ${n}

      -`}],[/\s?<\/ul>\s?'),n.$el.find(\".carousel-item\").each(function(t,e){if(n.images.push(t),n.showIndicators){var i=b('
    3. ');0===e&&i[0].classList.add(\"active\"),n.$indicators.append(i)}}),n.showIndicators&&n.$el.append(n.$indicators),n.count=n.images.length,n.options.numVisible=Math.min(n.count,n.options.numVisible),n.xform=\"transform\",[\"webkit\",\"Moz\",\"O\",\"ms\"].every(function(t){var e=t+\"Transform\";return void 0===document.body.style[e]||(n.xform=e,!1)}),n._setupEventHandlers(),n._scroll(n.offset),n}return _inherits(i,Component),_createClass(i,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.M_Carousel=void 0}},{key:\"_setupEventHandlers\",value:function(){var i=this;this._handleCarouselTapBound=this._handleCarouselTap.bind(this),this._handleCarouselDragBound=this._handleCarouselDrag.bind(this),this._handleCarouselReleaseBound=this._handleCarouselRelease.bind(this),this._handleCarouselClickBound=this._handleCarouselClick.bind(this),void 0!==window.ontouchstart&&(this.el.addEventListener(\"touchstart\",this._handleCarouselTapBound),this.el.addEventListener(\"touchmove\",this._handleCarouselDragBound),this.el.addEventListener(\"touchend\",this._handleCarouselReleaseBound)),this.el.addEventListener(\"mousedown\",this._handleCarouselTapBound),this.el.addEventListener(\"mousemove\",this._handleCarouselDragBound),this.el.addEventListener(\"mouseup\",this._handleCarouselReleaseBound),this.el.addEventListener(\"mouseleave\",this._handleCarouselReleaseBound),this.el.addEventListener(\"click\",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&(this._handleIndicatorClickBound=this._handleIndicatorClick.bind(this),this.$indicators.find(\".indicator-item\").each(function(t,e){t.addEventListener(\"click\",i._handleIndicatorClickBound)}));var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_removeEventHandlers\",value:function(){var i=this;void 0!==window.ontouchstart&&(this.el.removeEventListener(\"touchstart\",this._handleCarouselTapBound),this.el.removeEventListener(\"touchmove\",this._handleCarouselDragBound),this.el.removeEventListener(\"touchend\",this._handleCarouselReleaseBound)),this.el.removeEventListener(\"mousedown\",this._handleCarouselTapBound),this.el.removeEventListener(\"mousemove\",this._handleCarouselDragBound),this.el.removeEventListener(\"mouseup\",this._handleCarouselReleaseBound),this.el.removeEventListener(\"mouseleave\",this._handleCarouselReleaseBound),this.el.removeEventListener(\"click\",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&this.$indicators.find(\".indicator-item\").each(function(t,e){t.removeEventListener(\"click\",i._handleIndicatorClickBound)}),window.removeEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_handleCarouselTap\",value:function(t){\"mousedown\"===t.type&&b(t.target).is(\"img\")&&t.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(t),this.referenceY=this._ypos(t),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._trackBound,100)}},{key:\"_handleCarouselDrag\",value:function(t){var e=void 0,i=void 0,n=void 0;if(this.pressed)if(e=this._xpos(t),i=this._ypos(t),n=this.reference-e,Math.abs(this.referenceY-i)<30&&!this.verticalDragged)(2=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScrollBound),this.dragged&&(t.preventDefault(),t.stopPropagation()),!1}},{key:\"_handleCarouselClick\",value:function(t){if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1;if(!this.options.fullWidth){var e=b(t.target).closest(\".carousel-item\").index();0!==this._wrap(this.center)-e&&(t.preventDefault(),t.stopPropagation()),this._cycleTo(e)}}},{key:\"_handleIndicatorClick\",value:function(t){t.stopPropagation();var e=b(t.target).closest(\".indicator-item\");e.length&&this._cycleTo(e.index())}},{key:\"_handleResize\",value:function(t){this.options.fullWidth?(this.itemWidth=this.$el.find(\".carousel-item\").first().innerWidth(),this.imageHeight=this.$el.find(\".carousel-item.active\").height(),this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()}},{key:\"_setCarouselHeight\",value:function(t){var i=this,e=this.$el.find(\".carousel-item.active\").length?this.$el.find(\".carousel-item.active\").first():this.$el.find(\".carousel-item\").first(),n=e.find(\"img\").first();if(n.length)if(n[0].complete){var s=n.height();if(0=this.count?t%this.count:t<0?this._wrap(this.count+t%this.count):t}},{key:\"_track\",value:function(){var t,e,i,n;e=(t=Date.now())-this.timestamp,this.timestamp=t,i=this.offset-this.frame,this.frame=this.offset,n=1e3*i/(1+e),this.velocity=.8*n+.2*this.velocity}},{key:\"_autoScroll\",value:function(){var t=void 0,e=void 0;this.amplitude&&(t=Date.now()-this.timestamp,2<(e=this.amplitude*Math.exp(-t/this.options.duration))||e<-2?(this._scroll(this.target-e),requestAnimationFrame(this._autoScrollBound)):this._scroll(this.target))}},{key:\"_scroll\",value:function(t){var e=this;this.$el.hasClass(\"scrolling\")||this.el.classList.add(\"scrolling\"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout(function(){e.$el.removeClass(\"scrolling\")},this.options.duration);var i,n,s,o,a=void 0,r=void 0,l=void 0,h=void 0,d=void 0,u=void 0,c=this.center,p=1/this.options.numVisible;if(this.offset=\"number\"==typeof t?t:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),o=-(s=(n=this.offset-this.center*this.dim)<0?1:-1)*n*2/this.dim,i=this.count>>1,this.options.fullWidth?(l=\"translateX(0)\",u=1):(l=\"translateX(\"+(this.el.clientWidth-this.itemWidth)/2+\"px) \",l+=\"translateY(\"+(this.el.clientHeight-this.itemHeight)/2+\"px)\",u=1-p*o),this.showIndicators){var v=this.center%this.count,f=this.$indicators.find(\".indicator-item.active\");f.index()!==v&&(f.removeClass(\"active\"),this.$indicators.find(\".indicator-item\").eq(v)[0].classList.add(\"active\"))}if(!this.noWrap||0<=this.center&&this.center=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:\"prev\",value:function(t){(void 0===t||isNaN(t))&&(t=1);var e=this.center-t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:\"set\",value:function(t,e){if((void 0===t||isNaN(t))&&(t=0),t>this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t,e)}}],[{key:\"init\",value:function(t,e){return _get(i.__proto__||Object.getPrototypeOf(i),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Carousel}},{key:\"defaults\",get:function(){return e}}]),i}();M.Carousel=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"carousel\",\"M_Carousel\")}(cash),function(S){\"use strict\";var e={onOpen:void 0,onClose:void 0},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_TapTarget=i).options=S.extend({},n.defaults,e),i.isOpen=!1,i.$origin=S(\"#\"+i.$el.attr(\"data-target\")),i._setup(),i._calculatePositioning(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.TapTarget=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleDocumentClickBound=this._handleDocumentClick.bind(this),this._handleTargetClickBound=this._handleTargetClick.bind(this),this._handleOriginClickBound=this._handleOriginClick.bind(this),this.el.addEventListener(\"click\",this._handleTargetClickBound),this.originEl.addEventListener(\"click\",this._handleOriginClickBound);var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"click\",this._handleTargetClickBound),this.originEl.removeEventListener(\"click\",this._handleOriginClickBound),window.removeEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_handleTargetClick\",value:function(t){this.open()}},{key:\"_handleOriginClick\",value:function(t){this.close()}},{key:\"_handleResize\",value:function(t){this._calculatePositioning()}},{key:\"_handleDocumentClick\",value:function(t){S(t.target).closest(\".tap-target-wrapper\").length||(this.close(),t.preventDefault(),t.stopPropagation())}},{key:\"_setup\",value:function(){this.wrapper=this.$el.parent()[0],this.waveEl=S(this.wrapper).find(\".tap-target-wave\")[0],this.originEl=S(this.wrapper).find(\".tap-target-origin\")[0],this.contentEl=this.$el.find(\".tap-target-content\")[0],S(this.wrapper).hasClass(\".tap-target-wrapper\")||(this.wrapper=document.createElement(\"div\"),this.wrapper.classList.add(\"tap-target-wrapper\"),this.$el.before(S(this.wrapper)),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement(\"div\"),this.contentEl.classList.add(\"tap-target-content\"),this.$el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement(\"div\"),this.waveEl.classList.add(\"tap-target-wave\"),this.originEl||(this.originEl=this.$origin.clone(!0,!0),this.originEl.addClass(\"tap-target-origin\"),this.originEl.removeAttr(\"id\"),this.originEl.removeAttr(\"style\"),this.originEl=this.originEl[0],this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}},{key:\"_calculatePositioning\",value:function(){var t=\"fixed\"===this.$origin.css(\"position\");if(!t)for(var e=this.$origin.parents(),i=0;i'+t.getAttribute(\"label\")+\"\")[0]),i.each(function(t){var e=n._appendOptionWithIcon(n.$el,t,\"optgroup-option\");n._addOptionToValueDict(t,e)})}}),this.$el.after(this.dropdownOptions),this.input=document.createElement(\"input\"),d(this.input).addClass(\"select-dropdown dropdown-trigger\"),this.input.setAttribute(\"type\",\"text\"),this.input.setAttribute(\"readonly\",\"true\"),this.input.setAttribute(\"data-target\",this.dropdownOptions.id),this.el.disabled&&d(this.input).prop(\"disabled\",\"true\"),this.$el.before(this.input),this._setValueToInput();var t=d('');if(this.$el.before(t[0]),!this.el.disabled){var e=d.extend({},this.options.dropdownOptions);e.onOpenEnd=function(t){var e=d(n.dropdownOptions).find(\".selected\").first();if(e.length&&(M.keyDown=!0,n.dropdown.focusedIndex=e.index(),n.dropdown._focusFocusedItem(),M.keyDown=!1,n.dropdown.isScrollable)){var i=e[0].getBoundingClientRect().top-n.dropdownOptions.getBoundingClientRect().top;i-=n.dropdownOptions.clientHeight/2,n.dropdownOptions.scrollTop=i}},this.isMultiple&&(e.closeOnClick=!1),this.dropdown=M.Dropdown.init(this.input,e)}this._setSelectedStates()}},{key:\"_addOptionToValueDict\",value:function(t,e){var i=Object.keys(this._valueDict).length,n=this.dropdownOptions.id+i,s={};e.id=n,s.el=t,s.optionEl=e,this._valueDict[n]=s}},{key:\"_removeDropdown\",value:function(){d(this.wrapper).find(\".caret\").remove(),d(this.input).remove(),d(this.dropdownOptions).remove(),d(this.wrapper).before(this.$el),d(this.wrapper).remove()}},{key:\"_appendOptionWithIcon\",value:function(t,e,i){var n=e.disabled?\"disabled \":\"\",s=\"optgroup-option\"===i?\"optgroup-option \":\"\",o=this.isMultiple?'\":e.innerHTML,a=d(\"
    4. \"),r=d(\"\");r.html(o),a.addClass(n+\" \"+s),a.append(r);var l=e.getAttribute(\"data-icon\");if(l){var h=d('\"\"');a.prepend(h)}return d(this.dropdownOptions).append(a[0]),a[0]}},{key:\"_toggleEntryFromArray\",value:function(t){var e=!this._keysSelected.hasOwnProperty(t),i=d(this._valueDict[t].optionEl);return e?this._keysSelected[t]=!0:delete this._keysSelected[t],i.toggleClass(\"selected\",e),i.find('input[type=\"checkbox\"]').prop(\"checked\",e),i.prop(\"selected\",e),e}},{key:\"_setValueToInput\",value:function(){var i=[];if(this.$el.find(\"option\").each(function(t){if(d(t).prop(\"selected\")){var e=d(t).text();i.push(e)}}),!i.length){var t=this.$el.find(\"option:disabled\").eq(0);t.length&&\"\"===t[0].value&&i.push(t.text())}this.input.value=i.join(\", \")}},{key:\"_setSelectedStates\",value:function(){for(var t in this._keysSelected={},this._valueDict){var e=this._valueDict[t],i=d(e.el).prop(\"selected\");d(e.optionEl).find('input[type=\"checkbox\"]').prop(\"checked\",i),i?(this._activateOption(d(this.dropdownOptions),d(e.optionEl)),this._keysSelected[t]=!0):d(e.optionEl).removeClass(\"selected\")}}},{key:\"_activateOption\",value:function(t,e){e&&(this.isMultiple||t.find(\"li.selected\").removeClass(\"selected\"),d(e).addClass(\"selected\"))}},{key:\"getSelectedValues\",value:function(){var t=[];for(var e in this._keysSelected)t.push(this._valueDict[e].el.value);return t}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_FormSelect}},{key:\"defaults\",get:function(){return e}}]),n}();M.FormSelect=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"formSelect\",\"M_FormSelect\")}(cash),function(s,e){\"use strict\";var i={},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Range=i).options=s.extend({},n.defaults,e),i._mousedown=!1,i._setupThumb(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleRangeChangeBound=this._handleRangeChange.bind(this),this._handleRangeMousedownTouchstartBound=this._handleRangeMousedownTouchstart.bind(this),this._handleRangeInputMousemoveTouchmoveBound=this._handleRangeInputMousemoveTouchmove.bind(this),this._handleRangeMouseupTouchendBound=this._handleRangeMouseupTouchend.bind(this),this._handleRangeBlurMouseoutTouchleaveBound=this._handleRangeBlurMouseoutTouchleave.bind(this),this.el.addEventListener(\"change\",this._handleRangeChangeBound),this.el.addEventListener(\"mousedown\",this._handleRangeMousedownTouchstartBound),this.el.addEventListener(\"touchstart\",this._handleRangeMousedownTouchstartBound),this.el.addEventListener(\"input\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"mousemove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"touchmove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"mouseup\",this._handleRangeMouseupTouchendBound),this.el.addEventListener(\"touchend\",this._handleRangeMouseupTouchendBound),this.el.addEventListener(\"blur\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener(\"mouseout\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener(\"touchleave\",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"change\",this._handleRangeChangeBound),this.el.removeEventListener(\"mousedown\",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener(\"touchstart\",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener(\"input\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"mousemove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"touchmove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"mouseup\",this._handleRangeMouseupTouchendBound),this.el.removeEventListener(\"touchend\",this._handleRangeMouseupTouchendBound),this.el.removeEventListener(\"blur\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener(\"mouseout\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener(\"touchleave\",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:\"_handleRangeChange\",value:function(){s(this.value).html(this.$el.val()),s(this.thumb).hasClass(\"active\")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",t+\"px\")}},{key:\"_handleRangeMousedownTouchstart\",value:function(t){if(s(this.value).html(this.$el.val()),this._mousedown=!0,this.$el.addClass(\"active\"),s(this.thumb).hasClass(\"active\")||this._showRangeBubble(),\"input\"!==t.type){var e=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",e+\"px\")}}},{key:\"_handleRangeInputMousemoveTouchmove\",value:function(){if(this._mousedown){s(this.thumb).hasClass(\"active\")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",t+\"px\"),s(this.value).html(this.$el.val())}}},{key:\"_handleRangeMouseupTouchend\",value:function(){this._mousedown=!1,this.$el.removeClass(\"active\")}},{key:\"_handleRangeBlurMouseoutTouchleave\",value:function(){if(!this._mousedown){var t=7+parseInt(this.$el.css(\"padding-left\"))+\"px\";s(this.thumb).hasClass(\"active\")&&(e.remove(this.thumb),e({targets:this.thumb,height:0,width:0,top:10,easing:\"easeOutQuad\",marginLeft:t,duration:100})),s(this.thumb).removeClass(\"active\")}}},{key:\"_setupThumb\",value:function(){this.thumb=document.createElement(\"span\"),this.value=document.createElement(\"span\"),s(this.thumb).addClass(\"thumb\"),s(this.value).addClass(\"value\"),s(this.thumb).append(this.value),this.$el.after(this.thumb)}},{key:\"_removeThumb\",value:function(){s(this.thumb).remove()}},{key:\"_showRangeBubble\",value:function(){var t=-7+parseInt(s(this.thumb).parent().css(\"padding-left\"))+\"px\";e.remove(this.thumb),e({targets:this.thumb,height:30,width:30,top:-30,marginLeft:t,duration:300,easing:\"easeOutQuint\"})}},{key:\"_calcRangeOffset\",value:function(){var t=this.$el.width()-15,e=parseFloat(this.$el.attr(\"max\"))||100,i=parseFloat(this.$el.attr(\"min\"))||0;return(parseFloat(this.$el.val())-i)/(e-i)*t}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Range}},{key:\"defaults\",get:function(){return i}}]),n}();M.Range=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"range\",\"M_Range\"),t.init(s(\"input[type=range]\"))}(cash,M.anime);","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meiosisSetup = void 0;\nvar setup_1 = require(\"./setup\");\nObject.defineProperty(exports, \"meiosisSetup\", { enumerable: true, get: function () { return setup_1.meiosisSetup; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meiosisSetup = void 0;\nconst simple_stream_1 = require(\"./simple-stream\");\nconst util_1 = require(\"./util\");\nconst mergerino_1 = __importDefault(require(\"mergerino\"));\nconst assoc = (prop, value, target) => {\n target[prop] = value;\n return target;\n};\nconst concatIfPresent = (target, source) => source ? target.concat(source) : target;\nconst assembleInitialState = (nestedComponents) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => assoc(key, Object.assign({}, nestedComponents[key].initial, assembleInitialState(nestedComponents[key].nested)), result), {})\n : {};\nconst getInitialState = (app) => Object.assign({}, app.initial, assembleInitialState(app.nested));\nconst assembleView = (nestedComponents) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => {\n const nestedApp = nestedComponents[key];\n if (nestedApp.view !== undefined) {\n const view = nestedApp.view;\n return assoc(key, {\n view: (cell, ...args) => view(cell.nest(key), ...args),\n nested: assembleView(nestedApp.nested)\n }, result);\n }\n return result;\n }, {})\n : {};\nconst getView = (app) => assembleView(app.nested);\nconst assembleServices = (nestedComponents, getCell = (cell) => cell, getState = (state) => state) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => {\n var _a;\n const nextGetCell = (cell) => getCell(cell).nest(key);\n const nextGetState = (state) => getState(state)[key];\n const nestedApp = nestedComponents[key];\n return concatIfPresent(result, (_a = nestedApp.services) === null || _a === void 0 ? void 0 : _a.map((service) => ({\n onchange: (state) => (service.onchange ? service.onchange(nextGetState(state)) : state),\n run: (cell) => service.run(nextGetCell(cell))\n }))).concat(assembleServices(nestedApp.nested, nextGetCell, nextGetState));\n }, [])\n : [];\nconst getServices = (app) => concatIfPresent([], app.services).concat(assembleServices(app.nested));\nconst baseSetup = ({ stream, app }) => {\n if (!stream) {\n stream = simple_stream_1.simpleStream;\n }\n const safeApp = app || {};\n const initial = getInitialState(safeApp);\n const view = getView(safeApp);\n const createStream = typeof stream === 'function' ? stream : stream.stream;\n const scan = stream.scan;\n const update = createStream();\n const states = scan((state, patch) => (0, mergerino_1.default)(state, patch), initial, update);\n return {\n states,\n update,\n view\n };\n};\nconst nestPatch = (patch, prop) => ({ [prop]: patch });\nconst nestUpdate = (parentUpdate, prop) => (patch) => parentUpdate(nestPatch(patch, prop));\nconst nestCell = (states, parentUpdate, components) => (prop) => {\n const nestedStates = states.map((state) => state[prop]);\n const getNestedState = () => states()[prop];\n const nestedUpdate = nestUpdate(parentUpdate, prop);\n const nestedComponents = (0, util_1.get)(components, [prop, 'nested']);\n return {\n states: nestedStates,\n state: getNestedState(),\n getState: getNestedState,\n update: nestedUpdate,\n nest: nestCell(nestedStates, nestedUpdate, nestedComponents),\n nested: nestedComponents\n };\n};\n/**\n * Helper to setup the Meiosis pattern with [Mergerino](https://github.com/fuzetsu/mergerino).\n *\n * @template S the State type.\n *\n * @param config the Meiosis config for use with Mergerino\n *\n * @returns a stream of Meiosis cells.\n */\nconst meiosisSetup = (config) => {\n const stream = config === null || config === void 0 ? void 0 : config.stream;\n const app = config === null || config === void 0 ? void 0 : config.app;\n const { states, update, view } = baseSetup({\n stream,\n app\n });\n const nest = nestCell(states, update, view);\n const getState = () => states();\n const getCell = (state) => ({ states, state, getState, update, nest, nested: view });\n const dropRepeats = (0, simple_stream_1.createDropRepeats)(stream);\n if (app) {\n getServices(app).forEach((service) => {\n dropRepeats(states, service.onchange).map((state) => service.run(getCell(state)));\n });\n }\n const cells = dropRepeats(states).map(getCell);\n return cells;\n};\nexports.meiosisSetup = meiosisSetup;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dropRepeats = exports.createDropRepeats = exports.simpleStream = exports.scan = exports.stream = void 0;\n/**\n * Creates a stream.\n *\n * @template T the type of the stream's values.\n *\n * @param initial the stream's initial value.\n *\n * @returns the created stream.\n */\nconst stream = (initial) => {\n const mapFunctions = [];\n let latestValue = initial;\n const createdStream = function (value) {\n if (arguments.length > 0 && !createdStream.ended) {\n latestValue = value;\n for (const i in mapFunctions) {\n // credit @cmnstmntmn for discovering this bug.\n // Make sure to send the latest value.\n // Otherwise, if f1 triggers another update, f2 will be called with value2 and\n // then value1 (old value).\n mapFunctions[i](latestValue);\n }\n }\n return latestValue;\n };\n createdStream.map = (mapFunction) => {\n const newStream = (0, exports.stream)();\n const mappedFunction = (value) => {\n newStream(mapFunction(value));\n };\n mapFunctions.push(mappedFunction);\n newStream.end = (_value) => {\n const idx = mapFunctions.indexOf(mappedFunction);\n newStream.ended = true;\n mapFunctions.splice(idx, 1);\n };\n if (latestValue !== undefined) {\n newStream(mapFunction(latestValue));\n }\n return newStream;\n };\n createdStream.end = (_value) => {\n createdStream.ended = true;\n };\n return createdStream;\n};\nexports.stream = stream;\n/**\n * Creates a new stream that starts with the initial value and, for each value arriving onto the\n * source stream, emits the result of calling the accumulator function with the latest result and\n * the source stream value.\n */\nconst scan = (accumulator, initial, sourceStream) => {\n const newStream = (0, exports.stream)(initial);\n let accumulated = initial;\n sourceStream.map((value) => {\n accumulated = accumulator(accumulated, value);\n newStream(accumulated);\n });\n return newStream;\n};\nexports.scan = scan;\nexports.simpleStream = {\n stream: exports.stream,\n scan: exports.scan\n};\n/**\n * Credit: James Forbes (https://james-forbes.com/)\n *\n * Creates a `dropRepeats` function, which returns new stream that drops repeated values from the\n * source stream.\n *\n * @param stream the stream library, defaults to simpleStream.\n */\nconst createDropRepeats = (stream = exports.simpleStream) => \n/**\n * @param source the source stream.\n * @param onchange function that receives the current state of the source stream and returns the\n * value for which changes will emit onto the returned stream.\n * @returns a stream that does not emit repeated values.\n */\n(source, onchange = (state) => state) => {\n const createStream = typeof stream === 'function' ? stream : stream.stream;\n let prev = undefined;\n const result = createStream();\n source.map((state) => {\n const next = onchange(state);\n if (next !== prev) {\n prev = next;\n result(state);\n }\n });\n return result;\n};\nexports.createDropRepeats = createDropRepeats;\n/**\n * `dropRepeats` function that uses `simpleStream`.\n */\nexports.dropRepeats = (0, exports.createDropRepeats)();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateFormFloatValue = exports.updateFormIntValue = exports.updateFormValue = exports.get = void 0;\n/**\n * Safely gets a property path from an object. The path is an array. If any property along the path\n * is `undefined`, the function returns `undefined`.\n *\n * @param object the object on which to get the property.\n * @param path the property path.\n *\n * @returns the property value, or `undefined` if any property along the path is `undefined`.\n */\nconst get = (object, path) => path.reduce((obj, key) => (obj == undefined ? undefined : obj[key]), object);\nexports.get = get;\nconst intoPath = (path, value) => ({\n [path[0]]: path.length === 1 ? value : intoPath(path.slice(1), value)\n});\nconst toPath = (pathOrProp) => Array.isArray(pathOrProp) ? pathOrProp : [pathOrProp];\nconst updateParseValue = (parseFn, cell, path) => (evt) => {\n const value = parseFn(evt.currentTarget.value);\n if (!isNaN(value)) {\n cell.update(intoPath(toPath(path), value));\n }\n};\n/**\n * Convenience function to update a form value. Pass the Meiosis cell and the state property (such\n * as `'firstName'`) or path (such as `['person', 'firstName']`) into which to update the value.\n * Returns a function that you can pass to a DOM handler, such as `oninput` (Mithril) or `onInput`\n * (Preact, React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormValue(cell, 'firstName') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n * @param fn (optional) a function to modify the value before updating it.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormValue = (cell, path, fn = (value) => value) => (evt) => cell.update(intoPath(toPath(path), fn(evt.currentTarget.value)));\nexports.updateFormValue = updateFormValue;\n/**\n * Convenience function to update a form value with an Integer value. If the user input does not\n * return a number with `parseInt`, no state change occurs. Pass the Meiosis cell and the state\n * property (such as `'counter'`) or path (such as `['book', 'counter']`) into which to update the\n * value. Returns a function that you can pass to a DOM handler, such as `oninput` (Mithril) or\n * `onInput` (Preact, React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormIntValue(cell, 'counter') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormIntValue = (cell, path) => (evt) => updateParseValue(parseInt, cell, path)(evt);\nexports.updateFormIntValue = updateFormIntValue;\n/**\n * Convenience function to update a form value with a Float value. If the user input does not return\n * a number with `parseFloat`, no state change occurs. Pass the Meiosis cell and the state property\n * (such as `'pH'`) or path (such as `['water', 'pH']`) into which to update the value. Returns a\n * function that you can pass to a DOM handler, such as `oninput` (Mithril) or `onInput` (Preact,\n * React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormFloatValue(cell, 'pH') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormFloatValue = (cell, path) => (evt) => updateParseValue(parseFloat, cell, path)(evt);\nexports.updateFormFloatValue = updateFormFloatValue;\n","const e=Object.assign||((e,t)=>(t&&Object.keys(t).forEach(o=>e[o]=t[o]),e)),t=(e,r,s)=>{const c=typeof s;if(s&&\"object\"===c)if(Array.isArray(s))for(const o of s)r=t(e,r,o);else for(const c of Object.keys(s)){const f=s[c];\"function\"==typeof f?r[c]=f(r[c],o):void 0===f?e&&!isNaN(c)?r.splice(c,1):delete r[c]:null===f||\"object\"!=typeof f||Array.isArray(f)?r[c]=f:\"object\"==typeof r[c]?r[c]=f===r[c]?f:o(r[c],f):r[c]=t(!1,{},f)}else\"function\"===c&&(r=s(r,o));return r},o=(o,...r)=>{const s=Array.isArray(o);return t(s,s?o.slice():e({},o),r)};export default o;\n//# sourceMappingURL=mergerino.min.js.map","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(render, schedule, console) {\n\tvar subscriptions = []\n\tvar pending = false\n\tvar offset = -1\n\n\tfunction sync() {\n\t\tfor (offset = 0; offset < subscriptions.length; offset += 2) {\n\t\t\ttry { render(subscriptions[offset], Vnode(subscriptions[offset + 1]), redraw) }\n\t\t\tcatch (e) { console.error(e) }\n\t\t}\n\t\toffset = -1\n\t}\n\n\tfunction redraw() {\n\t\tif (!pending) {\n\t\t\tpending = true\n\t\t\tschedule(function() {\n\t\t\t\tpending = false\n\t\t\t\tsync()\n\t\t\t})\n\t\t}\n\t}\n\n\tredraw.sync = sync\n\n\tfunction mount(root, component) {\n\t\tif (component != null && component.view == null && typeof component !== \"function\") {\n\t\t\tthrow new TypeError(\"m.mount expects a component, not a vnode.\")\n\t\t}\n\n\t\tvar index = subscriptions.indexOf(root)\n\t\tif (index >= 0) {\n\t\t\tsubscriptions.splice(index, 2)\n\t\t\tif (index <= offset) offset -= 2\n\t\t\trender(root, [])\n\t\t}\n\n\t\tif (component != null) {\n\t\t\tsubscriptions.push(root, component)\n\t\t\trender(root, Vnode(component), redraw)\n\t\t}\n\t}\n\n\treturn {mount: mount, redraw: redraw}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar m = require(\"../render/hyperscript\")\nvar Promise = require(\"../promise/promise\")\n\nvar buildPathname = require(\"../pathname/build\")\nvar parsePathname = require(\"../pathname/parse\")\nvar compileTemplate = require(\"../pathname/compileTemplate\")\nvar assign = require(\"../util/assign\")\nvar censor = require(\"../util/censor\")\n\nvar sentinel = {}\n\nfunction decodeURIComponentSave(component) {\n\ttry {\n\t\treturn decodeURIComponent(component)\n\t} catch(e) {\n\t\treturn component\n\t}\n}\n\nmodule.exports = function($window, mountRedraw) {\n\tvar callAsync = $window == null\n\t\t// In case Mithril.js' loaded globally without the DOM, let's not break\n\t\t? null\n\t\t: typeof $window.setImmediate === \"function\" ? $window.setImmediate : $window.setTimeout\n\tvar p = Promise.resolve()\n\n\tvar scheduled = false\n\n\t// state === 0: init\n\t// state === 1: scheduled\n\t// state === 2: done\n\tvar ready = false\n\tvar state = 0\n\n\tvar compiled, fallbackRoute\n\n\tvar currentResolver = sentinel, component, attrs, currentPath, lastUpdate\n\n\tvar RouterRoot = {\n\t\tonbeforeupdate: function() {\n\t\t\tstate = state ? 2 : 1\n\t\t\treturn !(!state || sentinel === currentResolver)\n\t\t},\n\t\tonremove: function() {\n\t\t\t$window.removeEventListener(\"popstate\", fireAsync, false)\n\t\t\t$window.removeEventListener(\"hashchange\", resolveRoute, false)\n\t\t},\n\t\tview: function() {\n\t\t\tif (!state || sentinel === currentResolver) return\n\t\t\t// Wrap in a fragment to preserve existing key semantics\n\t\t\tvar vnode = [Vnode(component, attrs.key, attrs)]\n\t\t\tif (currentResolver) vnode = currentResolver.render(vnode[0])\n\t\t\treturn vnode\n\t\t},\n\t}\n\n\tvar SKIP = route.SKIP = {}\n\n\tfunction resolveRoute() {\n\t\tscheduled = false\n\t\t// Consider the pathname holistically. The prefix might even be invalid,\n\t\t// but that's not our problem.\n\t\tvar prefix = $window.location.hash\n\t\tif (route.prefix[0] !== \"#\") {\n\t\t\tprefix = $window.location.search + prefix\n\t\t\tif (route.prefix[0] !== \"?\") {\n\t\t\t\tprefix = $window.location.pathname + prefix\n\t\t\t\tif (prefix[0] !== \"/\") prefix = \"/\" + prefix\n\t\t\t}\n\t\t}\n\t\t// This seemingly useless `.concat()` speeds up the tests quite a bit,\n\t\t// since the representation is consistently a relatively poorly\n\t\t// optimized cons string.\n\t\tvar path = prefix.concat()\n\t\t\t.replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponentSave)\n\t\t\t.slice(route.prefix.length)\n\t\tvar data = parsePathname(path)\n\n\t\tassign(data.params, $window.history.state)\n\n\t\tfunction reject(e) {\n\t\t\tconsole.error(e)\n\t\t\tsetPath(fallbackRoute, null, {replace: true})\n\t\t}\n\n\t\tloop(0)\n\t\tfunction loop(i) {\n\t\t\t// state === 0: init\n\t\t\t// state === 1: scheduled\n\t\t\t// state === 2: done\n\t\t\tfor (; i < compiled.length; i++) {\n\t\t\t\tif (compiled[i].check(data)) {\n\t\t\t\t\tvar payload = compiled[i].component\n\t\t\t\t\tvar matchedRoute = compiled[i].route\n\t\t\t\t\tvar localComp = payload\n\t\t\t\t\tvar update = lastUpdate = function(comp) {\n\t\t\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\t\t\tif (comp === SKIP) return loop(i + 1)\n\t\t\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\t\t\tattrs = data.params, currentPath = path, lastUpdate = null\n\t\t\t\t\t\tcurrentResolver = payload.render ? payload : null\n\t\t\t\t\t\tif (state === 2) mountRedraw.redraw()\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tstate = 2\n\t\t\t\t\t\t\tmountRedraw.redraw.sync()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// There's no understating how much I *wish* I could\n\t\t\t\t\t// use `async`/`await` here...\n\t\t\t\t\tif (payload.view || typeof payload === \"function\") {\n\t\t\t\t\t\tpayload = {}\n\t\t\t\t\t\tupdate(localComp)\n\t\t\t\t\t}\n\t\t\t\t\telse if (payload.onmatch) {\n\t\t\t\t\t\tp.then(function () {\n\t\t\t\t\t\t\treturn payload.onmatch(data.params, path, matchedRoute)\n\t\t\t\t\t\t}).then(update, path === fallbackRoute ? null : reject)\n\t\t\t\t\t}\n\t\t\t\t\telse update(\"div\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (path === fallbackRoute) {\n\t\t\t\tthrow new Error(\"Could not resolve default route \" + fallbackRoute + \".\")\n\t\t\t}\n\t\t\tsetPath(fallbackRoute, null, {replace: true})\n\t\t}\n\t}\n\n\t// Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n\t// even if neither `pushState` nor `hashchange` are supported. It's\n\t// cleared if `hashchange` is used, since that makes it automatically\n\t// async.\n\tfunction fireAsync() {\n\t\tif (!scheduled) {\n\t\t\tscheduled = true\n\t\t\t// TODO: just do `mountRedraw.redraw()` here and elide the timer\n\t\t\t// dependency. Note that this will muck with tests a *lot*, so it's\n\t\t\t// not as easy of a change as it sounds.\n\t\t\tcallAsync(resolveRoute)\n\t\t}\n\t}\n\n\tfunction setPath(path, data, options) {\n\t\tpath = buildPathname(path, data)\n\t\tif (ready) {\n\t\t\tfireAsync()\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, route.prefix + path)\n\t\t\telse $window.history.pushState(state, title, route.prefix + path)\n\t\t}\n\t\telse {\n\t\t\t$window.location.href = route.prefix + path\n\t\t}\n\t}\n\n\tfunction route(root, defaultRoute, routes) {\n\t\tif (!root) throw new TypeError(\"DOM element being rendered to does not exist.\")\n\n\t\tcompiled = Object.keys(routes).map(function(route) {\n\t\t\tif (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a '/'.\")\n\t\t\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(route)) {\n\t\t\t\tthrow new SyntaxError(\"Route parameter names must be separated with either '/', '.', or '-'.\")\n\t\t\t}\n\t\t\treturn {\n\t\t\t\troute: route,\n\t\t\t\tcomponent: routes[route],\n\t\t\t\tcheck: compileTemplate(route),\n\t\t\t}\n\t\t})\n\t\tfallbackRoute = defaultRoute\n\t\tif (defaultRoute != null) {\n\t\t\tvar defaultData = parsePathname(defaultRoute)\n\n\t\t\tif (!compiled.some(function (i) { return i.check(defaultData) })) {\n\t\t\t\tthrow new ReferenceError(\"Default route doesn't match any known routes.\")\n\t\t\t}\n\t\t}\n\n\t\tif (typeof $window.history.pushState === \"function\") {\n\t\t\t$window.addEventListener(\"popstate\", fireAsync, false)\n\t\t} else if (route.prefix[0] === \"#\") {\n\t\t\t$window.addEventListener(\"hashchange\", resolveRoute, false)\n\t\t}\n\n\t\tready = true\n\t\tmountRedraw.mount(root, RouterRoot)\n\t\tresolveRoute()\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\tsetPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = \"#!\"\n\troute.Link = {\n\t\tview: function(vnode) {\n\t\t\t// Omit the used parameters from the rendered element - they are\n\t\t\t// internal. Also, censor the various lifecycle methods.\n\t\t\t//\n\t\t\t// We don't strip the other parameters because for convenience we\n\t\t\t// let them be specified in the selector as well.\n\t\t\tvar child = m(\n\t\t\t\tvnode.attrs.selector || \"a\",\n\t\t\t\tcensor(vnode.attrs, [\"options\", \"params\", \"selector\", \"onclick\"]),\n\t\t\t\tvnode.children\n\t\t\t)\n\t\t\tvar options, onclick, href\n\n\t\t\t// Let's provide a *right* way to disable a route link, rather than\n\t\t\t// letting people screw up accessibility on accident.\n\t\t\t//\n\t\t\t// The attribute is coerced so users don't get surprised over\n\t\t\t// `disabled: 0` resulting in a button that's somehow routable\n\t\t\t// despite being visibly disabled.\n\t\t\tif (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n\t\t\t\tchild.attrs.href = null\n\t\t\t\tchild.attrs[\"aria-disabled\"] = \"true\"\n\t\t\t\t// If you *really* do want add `onclick` on a disabled link, use\n\t\t\t\t// an `oncreate` hook to add it.\n\t\t\t} else {\n\t\t\t\toptions = vnode.attrs.options\n\t\t\t\tonclick = vnode.attrs.onclick\n\t\t\t\t// Easier to build it now to keep it isomorphic.\n\t\t\t\thref = buildPathname(child.attrs.href, vnode.attrs.params)\n\t\t\t\tchild.attrs.href = route.prefix + href\n\t\t\t\tchild.attrs.onclick = function(e) {\n\t\t\t\t\tvar result\n\t\t\t\t\tif (typeof onclick === \"function\") {\n\t\t\t\t\t\tresult = onclick.call(e.currentTarget, e)\n\t\t\t\t\t} else if (onclick == null || typeof onclick !== \"object\") {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t} else if (typeof onclick.handleEvent === \"function\") {\n\t\t\t\t\t\tonclick.handleEvent(e)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Adapted from React Router's implementation:\n\t\t\t\t\t// https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n\t\t\t\t\t//\n\t\t\t\t\t// Try to be flexible and intuitive in how we handle links.\n\t\t\t\t\t// Fun fact: links aren't as obvious to get right as you\n\t\t\t\t\t// would expect. There's a lot more valid ways to click a\n\t\t\t\t\t// link than this, and one might want to not simply click a\n\t\t\t\t\t// link, but right click or command-click it to copy the\n\t\t\t\t\t// link target, etc. Nope, this isn't just for blind people.\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip if `onclick` prevented default\n\t\t\t\t\t\tresult !== false && !e.defaultPrevented &&\n\t\t\t\t\t\t// Ignore everything but left clicks\n\t\t\t\t\t\t(e.button === 0 || e.which === 0 || e.which === 1) &&\n\t\t\t\t\t\t// Let the browser handle `target=_blank`, etc.\n\t\t\t\t\t\t(!e.currentTarget.target || e.currentTarget.target === \"_self\") &&\n\t\t\t\t\t\t// No modifier keys\n\t\t\t\t\t\t!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey\n\t\t\t\t\t) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\te.redraw = false\n\t\t\t\t\t\troute.set(href, null, options)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child\n\t\t},\n\t}\n\troute.param = function(key) {\n\t\treturn attrs && key != null ? attrs[key] : attrs\n\t}\n\n\treturn route\n}\n","\"use strict\"\n\nvar hyperscript = require(\"./render/hyperscript\")\n\nhyperscript.trust = require(\"./render/trust\")\nhyperscript.fragment = require(\"./render/fragment\")\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar hyperscript = require(\"./hyperscript\")\nvar request = require(\"./request\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nvar m = function m() { return hyperscript.apply(this, arguments) }\nm.m = hyperscript\nm.trust = hyperscript.trust\nm.fragment = hyperscript.fragment\nm.Fragment = \"[\"\nm.mount = mountRedraw.mount\nm.route = require(\"./route\")\nm.render = require(\"./render\")\nm.redraw = mountRedraw.redraw\nm.request = request.request\nm.jsonp = request.jsonp\nm.parseQueryString = require(\"./querystring/parse\")\nm.buildQueryString = require(\"./querystring/build\")\nm.parsePathname = require(\"./pathname/parse\")\nm.buildPathname = require(\"./pathname/build\")\nm.vnode = require(\"./render/vnode\")\nm.PromisePolyfill = require(\"./promise/polyfill\")\nm.censor = require(\"./util/censor\")\n\nmodule.exports = m\n","\"use strict\"\n\nvar render = require(\"./render\")\n\nmodule.exports = require(\"./api/mount-redraw\")(render, typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : null, typeof console !== \"undefined\" ? console : null)\n","\"use strict\"\n\nvar buildQueryString = require(\"../querystring/build\")\nvar assign = require(\"../util/assign\")\n\n// Returns `path` from `template` + `params`\nmodule.exports = function(template, params) {\n\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(template)) {\n\t\tthrow new SyntaxError(\"Template parameter names must be separated by either a '/', '-', or '.'.\")\n\t}\n\tif (params == null) return template\n\tvar queryIndex = template.indexOf(\"?\")\n\tvar hashIndex = template.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? template.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = template.slice(0, pathEnd)\n\tvar query = {}\n\n\tassign(query, params)\n\n\tvar resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function(m, key, variadic) {\n\t\tdelete query[key]\n\t\t// If no such parameter exists, don't interpolate it.\n\t\tif (params[key] == null) return m\n\t\t// Escape normal parameters, but not variadic ones.\n\t\treturn variadic ? params[key] : encodeURIComponent(String(params[key]))\n\t})\n\n\t// In case the template substitution adds new query/hash parameters.\n\tvar newQueryIndex = resolved.indexOf(\"?\")\n\tvar newHashIndex = resolved.indexOf(\"#\")\n\tvar newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex\n\tvar newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex\n\tvar result = resolved.slice(0, newPathEnd)\n\n\tif (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)\n\tif (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd)\n\tvar querystring = buildQueryString(query)\n\tif (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring\n\tif (hashIndex >= 0) result += template.slice(hashIndex)\n\tif (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex)\n\treturn result\n}\n","\"use strict\"\n\nvar parsePathname = require(\"./parse\")\n\n// Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\nmodule.exports = function(template) {\n\tvar templateData = parsePathname(template)\n\tvar templateKeys = Object.keys(templateData.params)\n\tvar keys = []\n\tvar regexp = new RegExp(\"^\" + templateData.path.replace(\n\t\t// I escape literal text so people can use things like `:file.:ext` or\n\t\t// `:lang-:locale` in routes. This is all merged into one pass so I\n\t\t// don't also accidentally escape `-` and make it harder to detect it to\n\t\t// ban it from template parameters.\n\t\t/:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g,\n\t\tfunction(m, key, extra) {\n\t\t\tif (key == null) return \"\\\\\" + m\n\t\t\tkeys.push({k: key, r: extra === \"...\"})\n\t\t\tif (extra === \"...\") return \"(.*)\"\n\t\t\tif (extra === \".\") return \"([^/]+)\\\\.\"\n\t\t\treturn \"([^/]+)\" + (extra || \"\")\n\t\t}\n\t) + \"$\")\n\treturn function(data) {\n\t\t// First, check the params. Usually, there isn't any, and it's just\n\t\t// checking a static set.\n\t\tfor (var i = 0; i < templateKeys.length; i++) {\n\t\t\tif (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false\n\t\t}\n\t\t// If no interpolations exist, let's skip all the ceremony\n\t\tif (!keys.length) return regexp.test(data.path)\n\t\tvar values = regexp.exec(data.path)\n\t\tif (values == null) return false\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tdata.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])\n\t\t}\n\t\treturn true\n\t}\n}\n","\"use strict\"\n\nvar parseQueryString = require(\"../querystring/parse\")\n\n// Returns `{path, params}` from `url`\nmodule.exports = function(url) {\n\tvar queryIndex = url.indexOf(\"?\")\n\tvar hashIndex = url.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? url.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\")\n\n\tif (!path) path = \"/\"\n\telse {\n\t\tif (path[0] !== \"/\") path = \"/\" + path\n\t\tif (path.length > 1 && path[path.length - 1] === \"/\") path = path.slice(0, -1)\n\t}\n\treturn {\n\t\tpath: path,\n\t\tparams: queryIndex < 0\n\t\t\t? {}\n\t\t\t: parseQueryString(url.slice(queryIndex + 1, queryEnd)),\n\t}\n}\n","\"use strict\"\n/** @constructor */\nvar PromisePolyfill = function(executor) {\n\tif (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with 'new'.\")\n\tif (typeof executor !== \"function\") throw new TypeError(\"executor must be a function.\")\n\n\tvar self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)\n\tvar instance = self._instance = {resolvers: resolvers, rejectors: rejectors}\n\tvar callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout\n\tfunction handler(list, shouldAbsorb) {\n\t\treturn function execute(value) {\n\t\t\tvar then\n\t\t\ttry {\n\t\t\t\tif (shouldAbsorb && value != null && (typeof value === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n\t\t\t\t\tif (value === self) throw new TypeError(\"Promise can't be resolved with itself.\")\n\t\t\t\t\texecuteOnce(then.bind(value))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallAsync(function() {\n\t\t\t\t\t\tif (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value)\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) list[i](value)\n\t\t\t\t\t\tresolvers.length = 0, rejectors.length = 0\n\t\t\t\t\t\tinstance.state = shouldAbsorb\n\t\t\t\t\t\tinstance.retry = function() {execute(value)}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\trejectCurrent(e)\n\t\t\t}\n\t\t}\n\t}\n\tfunction executeOnce(then) {\n\t\tvar runs = 0\n\t\tfunction run(fn) {\n\t\t\treturn function(value) {\n\t\t\t\tif (runs++ > 0) return\n\t\t\t\tfn(value)\n\t\t\t}\n\t\t}\n\t\tvar onerror = run(rejectCurrent)\n\t\ttry {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}\n\t}\n\n\texecuteOnce(executor)\n}\nPromisePolyfill.prototype.then = function(onFulfilled, onRejection) {\n\tvar self = this, instance = self._instance\n\tfunction handle(callback, list, next, state) {\n\t\tlist.push(function(value) {\n\t\t\tif (typeof callback !== \"function\") next(value)\n\t\t\telse try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}\n\t\t})\n\t\tif (typeof instance.retry === \"function\" && state === instance.state) instance.retry()\n\t}\n\tvar resolveNext, rejectNext\n\tvar promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})\n\thandle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)\n\treturn promise\n}\nPromisePolyfill.prototype.catch = function(onRejection) {\n\treturn this.then(null, onRejection)\n}\nPromisePolyfill.prototype.finally = function(callback) {\n\treturn this.then(\n\t\tfunction(value) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn value\n\t\t\t})\n\t\t},\n\t\tfunction(reason) {\n\t\t\treturn PromisePolyfill.resolve(callback()).then(function() {\n\t\t\t\treturn PromisePolyfill.reject(reason);\n\t\t\t})\n\t\t}\n\t)\n}\nPromisePolyfill.resolve = function(value) {\n\tif (value instanceof PromisePolyfill) return value\n\treturn new PromisePolyfill(function(resolve) {resolve(value)})\n}\nPromisePolyfill.reject = function(value) {\n\treturn new PromisePolyfill(function(resolve, reject) {reject(value)})\n}\nPromisePolyfill.all = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tvar total = list.length, count = 0, values = []\n\t\tif (list.length === 0) resolve([])\n\t\telse for (var i = 0; i < list.length; i++) {\n\t\t\t(function(i) {\n\t\t\t\tfunction consume(value) {\n\t\t\t\t\tcount++\n\t\t\t\t\tvalues[i] = value\n\t\t\t\t\tif (count === total) resolve(values)\n\t\t\t\t}\n\t\t\t\tif (list[i] != null && (typeof list[i] === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n\t\t\t\t\tlist[i].then(consume, reject)\n\t\t\t\t}\n\t\t\t\telse consume(list[i])\n\t\t\t})(i)\n\t\t}\n\t})\n}\nPromisePolyfill.race = function(list) {\n\treturn new PromisePolyfill(function(resolve, reject) {\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tlist[i].then(resolve, reject)\n\t\t}\n\t})\n}\n\nmodule.exports = PromisePolyfill\n","/* global window */\n\"use strict\"\n\nvar PromisePolyfill = require(\"./polyfill\")\n\nif (typeof window !== \"undefined\") {\n\tif (typeof window.Promise === \"undefined\") {\n\t\twindow.Promise = PromisePolyfill\n\t} else if (!window.Promise.prototype.finally) {\n\t\twindow.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = window.Promise\n} else if (typeof global !== \"undefined\") {\n\tif (typeof global.Promise === \"undefined\") {\n\t\tglobal.Promise = PromisePolyfill\n\t} else if (!global.Promise.prototype.finally) {\n\t\tglobal.Promise.prototype.finally = PromisePolyfill.prototype.finally\n\t}\n\tmodule.exports = global.Promise\n} else {\n\tmodule.exports = PromisePolyfill\n}\n","\"use strict\"\n\nmodule.exports = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\n\tvar args = []\n\tfor (var key in object) {\n\t\tdestructure(key, object[key])\n\t}\n\n\treturn args.join(\"&\")\n\n\tfunction destructure(key, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\n","\"use strict\"\n\nfunction decodeURIComponentSave(str) {\n\ttry {\n\t\treturn decodeURIComponent(str)\n\t} catch(err) {\n\t\treturn str\n\t}\n}\n\nmodule.exports = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\n\tvar entries = string.split(\"&\"), counters = {}, data = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key = decodeURIComponentSave(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponentSave(entry[1]) : \"\"\n\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\n\t\tvar levels = key.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data\n\t\tif (key.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key = levels.slice(0, j).join()\n\t\t\t\tif (counters[key] == null) {\n\t\t\t\t\tcounters[key] = Array.isArray(cursor) ? cursor.length : 0\n\t\t\t\t}\n\t\t\t\tlevel = counters[key]++\n\t\t\t}\n\t\t\t// Disallow direct prototype pollution\n\t\t\telse if (level === \"__proto__\") break\n\t\t\tif (j === levels.length - 1) cursor[level] = value\n\t\t\telse {\n\t\t\t\t// Read own properties exclusively to disallow indirect\n\t\t\t\t// prototype pollution\n\t\t\t\tvar desc = Object.getOwnPropertyDescriptor(cursor, level)\n\t\t\t\tif (desc != null) desc = desc.value\n\t\t\t\tif (desc == null) cursor[level] = desc = isNumber ? [] : {}\n\t\t\t\tcursor = desc\n\t\t\t}\n\t\t}\n\t}\n\treturn data\n}\n","\"use strict\"\n\nmodule.exports = require(\"./render/render\")(typeof window !== \"undefined\" ? window : null)\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nmodule.exports = function() {\n\tvar vnode = hyperscriptVnode.apply(0, arguments)\n\n\tvnode.tag = \"[\"\n\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\treturn vnode\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\nvar hasOwn = require(\"../util/hasOwn\")\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\n\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\n\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\n\nfunction execSelector(state, vnode) {\n\tvar attrs = vnode.attrs\n\tvar hasClass = hasOwn.call(attrs, \"class\")\n\tvar className = hasClass ? attrs.class : attrs.className\n\n\tvnode.tag = state.tag\n\tvnode.attrs = {}\n\n\tif (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n\t\tvar newAttrs = {}\n\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]\n\t\t}\n\n\t\tattrs = newAttrs\n\t}\n\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)){\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className != null || state.attrs.className != null) attrs.className =\n\t\tclassName != null\n\t\t\t? state.attrs.className != null\n\t\t\t\t? String(state.attrs.className) + \" \" + String(className)\n\t\t\t\t: className\n\t\t\t: state.attrs.className != null\n\t\t\t\t? state.attrs.className\n\t\t\t\t: null\n\n\tif (hasClass) attrs.class = null\n\n\tfor (var key in attrs) {\n\t\tif (hasOwn.call(attrs, key) && key !== \"key\") {\n\t\t\tvnode.attrs = attrs\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn vnode\n}\n\nfunction hyperscript(selector) {\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\n\tvar vnode = hyperscriptVnode.apply(1, arguments)\n\n\tif (typeof selector === \"string\") {\n\t\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\t\tif (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)\n\t}\n\n\tvnode.tag = selector\n\treturn vnode\n}\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\n// Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril.js requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n// another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n// than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n// if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n// if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n// } else {\n// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n// attrs = undefined\n// }\n//\n// if (attrs == null) attrs = {}\n// return Vnode(\"\", attrs.key, attrs, children)\n// }\nmodule.exports = function() {\n\tvar attrs = arguments[this], start = this + 1, children\n\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = this\n\t}\n\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\n\treturn Vnode(\"\", attrs.key, attrs, children)\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function($window) {\n\tvar $doc = $window && $window.document\n\tvar currentRedraw\n\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\n\t//sanity check to discourage people from doing `vnode.state = ...`\n\tfunction checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"'vnode.state' must not be modified.\")\n\t}\n\n\t//Note: the hook is passed as the `this` argument to allow proxying the\n\t//arguments without requiring a full array allocation to do so. It also\n\t//takes advantage of the fact the current `vnode` is the first argument in\n\t//all lifecycle methods.\n\tfunction callHook(vnode) {\n\t\tvar original = vnode.state\n\t\ttry {\n\t\t\treturn this.apply(original, arguments)\n\t\t} finally {\n\t\t\tcheckState(vnode, original)\n\t\t}\n\t}\n\n\t// IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n\t// inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\tfunction activeElement() {\n\t\ttry {\n\t\t\treturn $doc.activeElement\n\t\t} catch (e) {\n\t\t\treturn null\n\t\t}\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": createText(parent, vnode, nextSibling); break\n\t\t\t\tcase \"<\": createHTML(parent, vnode, ns, nextSibling); break\n\t\t\t\tcase \"[\": createFragment(parent, vnode, hooks, ns, nextSibling); break\n\t\t\t\tdefault: createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = $doc.createTextNode(vnode.children)\n\t\tinsertNode(parent, vnode.dom, nextSibling)\n\t}\n\tvar possibleParents = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}\n\tfunction createHTML(parent, vnode, ns, nextSibling) {\n\t\tvar match = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\t// not using the proper parent makes the child element(s) vanish.\n\t\t// var div = document.createElement(\"div\")\n\t\t// div.innerHTML = \"ij\"\n\t\t// console.log(div.innerHTML)\n\t\t// --> \"ij\", no in sight.\n\t\tvar temp = $doc.createElement(possibleParents[match[1]] || \"div\")\n\t\tif (ns === \"http://www.w3.org/2000/svg\") {\n\t\t\ttemp.innerHTML = \"\" + vnode.children + \"\"\n\t\t\ttemp = temp.firstChild\n\t\t} else {\n\t\t\ttemp.innerHTML = vnode.children\n\t\t}\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\t// Capture nodes to remove, so we don't confuse them.\n\t\tvnode.instance = []\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tvnode.instance.push(child)\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertNode(parent, fragment, nextSibling)\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = $doc.createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertNode(parent, fragment, nextSibling)\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs = vnode.attrs\n\t\tvar is = attrs && attrs.is\n\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tvar element = ns ?\n\t\t\tis ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :\n\t\t\tis ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)\n\t\tvnode.dom = element\n\n\t\tif (attrs != null) {\n\t\t\tsetAttrs(vnode, attrs, ns)\n\t\t}\n\n\t\tinsertNode(parent, element, nextSibling)\n\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tif (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs)\n\t\t\t}\n\t\t}\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tinitLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tcreateNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t}\n\t}\n\n\t//update\n\t/**\n\t * @param {Element|Fragment} parent - the parent element\n\t * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n\t * this part of the tree\n\t * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n\t * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n\t * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n\t * fragment that is not the last item in its\n\t * parent\n\t * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n\t * @returns void\n\t */\n\t// This function diffs and patches lists of vnodes, both keyed and unkeyed.\n\t//\n\t// We will:\n\t//\n\t// 1. describe its general structure\n\t// 2. focus on the diff algorithm optimizations\n\t// 3. discuss DOM node operations.\n\n\t// ## Overview:\n\t//\n\t// The updateNodes() function:\n\t// - deals with trivial cases\n\t// - determines whether the lists are keyed or unkeyed based on the first non-null node\n\t// of each list.\n\t// - diffs them and patches the DOM if needed (that's the brunt of the code)\n\t// - manages the leftovers: after diffing, are there:\n\t// - old nodes left to remove?\n\t// \t - new nodes to insert?\n\t// \t deal with them!\n\t//\n\t// The lists are only iterated over once, with an exception for the nodes in `old` that\n\t// are visited in the fourth part of the diff and in the `removeNodes` loop.\n\n\t// ## Diffing\n\t//\n\t// Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n\t// may be good for context on longest increasing subsequence-based logic for moving nodes.\n\t//\n\t// In order to diff keyed lists, one has to\n\t//\n\t// 1) match nodes in both lists, per key, and update them accordingly\n\t// 2) create the nodes present in the new list, but absent in the old one\n\t// 3) remove the nodes present in the old list, but absent in the new one\n\t// 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n\t//\n\t// To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n\t// over the new list and for each new vnode, find the corresponding vnode in the old list using\n\t// the map.\n\t// 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n\t// and must be created.\n\t// For the removals, we actually remove the nodes that have been updated from the old list.\n\t// The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n\t// The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n\t// algorithm.\n\t//\n\t// the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n\t// from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n\t// corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n\t// match the above lists, for example).\n\t//\n\t// In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n\t// can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n\t//\n\t// @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n\t// the longest increasing subsequence *of old nodes still present in the new list*).\n\t//\n\t// It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n\t// and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n\t// the `LIS` and a temporary one to create the LIS).\n\t//\n\t// So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n\t// the LIS and can be updated without moving them.\n\t//\n\t// If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n\t// the exception of the last node if the list is fully reversed).\n\t//\n\t// ## Finding the next sibling.\n\t//\n\t// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n\t// When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n\t// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n\t// list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n\t//\n\t// In the other scenarios (swaps, upwards traversal, map-based diff),\n\t// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n\t// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node\n\t// as the next sibling (cached in the `nextSibling` variable).\n\n\n\t// ## DOM node moves\n\t//\n\t// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n\t// this is not the case if the node moved (second and fourth part of the diff algo). We move\n\t// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n\t// variable rather than fetching it using `getNextSibling()`.\n\t//\n\t// The fourth part of the diff currently inserts nodes unconditionally, leading to issues\n\t// like #1791 and #1999. We need to be smarter about those situations where adjascent old\n\t// nodes remain together in the new list in a way that isn't covered by parts one and\n\t// three of the diff algo.\n\n\tfunction updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)\n\t\telse {\n\t\t\tvar isOldKeyed = old[0] != null && old[0].key != null\n\t\t\tvar isKeyed = vnodes[0] != null && vnodes[0].key != null\n\t\t\tvar start = 0, oldStart = 0\n\t\t\tif (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) oldStart++\n\t\t\tif (!isKeyed) while (start < vnodes.length && vnodes[start] == null) start++\n\t\t\tif (isOldKeyed !== isKeyed) {\n\t\t\t\tremoveNodes(parent, old, oldStart, old.length)\n\t\t\t\tcreateNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else if (!isKeyed) {\n\t\t\t\t// Don't index past the end of either list (causes deopts).\n\t\t\t\tvar commonLength = old.length < vnodes.length ? old.length : vnodes.length\n\t\t\t\t// Rewind if necessary to the first non-null index on either side.\n\t\t\t\t// We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n\t\t\t\t// but that would be optimizing for sparse lists which are more rare than dense ones.\n\t\t\t\tstart = start < oldStart ? start : oldStart\n\t\t\t\tfor (; start < commonLength; start++) {\n\t\t\t\t\to = old[start]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o === v || o == null && v == null) continue\n\t\t\t\t\telse if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))\n\t\t\t\t\telse if (v == null) removeNode(parent, o)\n\t\t\t\t\telse updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\tif (old.length > commonLength) removeNodes(parent, old, start, old.length)\n\t\t\t\tif (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else {\n\t\t\t\t// keyed diff\n\t\t\t\tvar oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling\n\n\t\t\t\t// bottom-up\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\t// top-down\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o.key !== v.key) break\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tif (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\t// swaps and list reversals\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (start === end) break\n\t\t\t\t\tif (o.key !== ve.key || oe.key !== v.key) break\n\t\t\t\t\ttopSibling = getNextSibling(old, oldStart, nextSibling)\n\t\t\t\t\tmoveNodes(parent, oe, topSibling)\n\t\t\t\t\tif (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)\n\t\t\t\t\tif (++start <= --end) moveNodes(parent, o, nextSibling)\n\t\t\t\t\tif (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldStart++; oldEnd--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t}\n\t\t\t\t// bottom up once again\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t}\n\t\t\t\tif (start > end) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\telse if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\telse {\n\t\t\t\t\t// inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n\t\t\t\t\tvar originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li=0, i=0, pos = 2147483647, matched = 0, map, lisIndices\n\t\t\t\t\tfor (i = 0; i < vnodesLength; i++) oldIndices[i] = -1\n\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\tif (map == null) map = getKeyMap(old, oldStart, oldEnd + 1)\n\t\t\t\t\t\tve = vnodes[i]\n\t\t\t\t\t\tvar oldIndex = map[ve.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tpos = (oldIndex < pos) ? oldIndex : -1 // becomes -1 if nodes were re-ordered\n\t\t\t\t\t\t\toldIndices[i-start] = oldIndex\n\t\t\t\t\t\t\toe = old[oldIndex]\n\t\t\t\t\t\t\told[oldIndex] = null\n\t\t\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\t\t\tmatched++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnextSibling = originalNextSibling\n\t\t\t\t\tif (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\t\tif (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (pos === -1) {\n\t\t\t\t\t\t\t// the indices of the indices of the items that are part of the\n\t\t\t\t\t\t\t// longest increasing subsequence in the oldIndices list\n\t\t\t\t\t\t\tlisIndices = makeLisIndices(oldIndices)\n\t\t\t\t\t\t\tli = lisIndices.length - 1\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (lisIndices[li] === i - start) li--\n\t\t\t\t\t\t\t\t\telse moveNodes(parent, v, nextSibling)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode.events = old.events\n\t\t\tif (shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tupdateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, ns, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(parent, old)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, ns, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\tremoveHTML(parent, old)\n\t\t\tcreateHTML(parent, vnode, ns, nextSibling)\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t\tvnode.instance = old.instance\n\t\t}\n\t}\n\tfunction updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tif (vnode.tag === \"textarea\") {\n\t\t\tif (vnode.attrs == null) vnode.attrs = {}\n\t\t}\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tupdateNodes(element, old.children, vnode.children, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tupdateLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(parent, old.instance)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction getKeyMap(vnodes, start, end) {\n\t\tvar map = Object.create(null)\n\t\tfor (; start < end; start++) {\n\t\t\tvar vnode = vnodes[start]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key = vnode.key\n\t\t\t\tif (key != null) map[key] = start\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\t// Lifted from ivi https://github.com/ivijs/ivi/\n\t// takes a list of unique numbers (-1 is special and can\n\t// occur multiple times) and returns an array with the indices\n\t// of the items that are part of the longest increasing\n\t// subsequence\n\tvar lisTemp = []\n\tfunction makeLisIndices(a) {\n\t\tvar result = [0]\n\t\tvar u = 0, v = 0, i = 0\n\t\tvar il = lisTemp.length = a.length\n\t\tfor (var i = 0; i < il; i++) lisTemp[i] = a[i]\n\t\tfor (var i = 0; i < il; ++i) {\n\t\t\tif (a[i] === -1) continue\n\t\t\tvar j = result[result.length - 1]\n\t\t\tif (a[j] < a[i]) {\n\t\t\t\tlisTemp[i] = j\n\t\t\t\tresult.push(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu = 0\n\t\t\tv = result.length - 1\n\t\t\twhile (u < v) {\n\t\t\t\t// Fast integer average without overflow.\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tvar c = (u >>> 1) + (v >>> 1) + (u & v & 1)\n\t\t\t\tif (a[result[c]] < a[i]) {\n\t\t\t\t\tu = c + 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tv = c\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a[i] < a[result[u]]) {\n\t\t\t\tif (u > 0) lisTemp[i] = result[u - 1]\n\t\t\t\tresult[u] = i\n\t\t\t}\n\t\t}\n\t\tu = result.length\n\t\tv = result[u - 1]\n\t\twhile (u-- > 0) {\n\t\t\tresult[u] = v\n\t\t\tv = lisTemp[v]\n\t\t}\n\t\tlisTemp.length = 0\n\t\treturn result\n\t}\n\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\n\t// This covers a really specific edge case:\n\t// - Parent node is keyed and contains child\n\t// - Child is removed, returns unresolved promise in `onbeforeremove`\n\t// - Parent node is moved in keyed diff\n\t// - Remaining children still need moved appropriately\n\t//\n\t// Ideally, I'd track removed nodes as well, but that introduces a lot more\n\t// complexity and I'm not exactly interested in doing that.\n\tfunction moveNodes(parent, vnode, nextSibling) {\n\t\tvar frag = $doc.createDocumentFragment()\n\t\tmoveChildToFrag(parent, frag, vnode)\n\t\tinsertNode(parent, frag, nextSibling)\n\t}\n\tfunction moveChildToFrag(parent, frag, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\t\t\tfrag.appendChild(vnode.instance[i])\n\t\t\t\t}\n\t\t\t} else if (vnode.tag !== \"[\") {\n\t\t\t\t// Don't recurse for text nodes *or* elements, just fragments\n\t\t\t\tfrag.appendChild(vnode.dom)\n\t\t\t} else if (vnode.children.length === 1) {\n\t\t\t\tvnode = vnode.children[0]\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\tif (child != null) moveChildToFrag(parent, frag, child)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfunction insertNode(parent, dom, nextSibling) {\n\t\tif (nextSibling != null) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\n\tfunction maybeSetContentEditable(vnode) {\n\t\tif (vnode.attrs == null || (\n\t\t\tvnode.attrs.contenteditable == null && // attribute\n\t\t\tvnode.attrs.contentEditable == null // property\n\t\t)) return false\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted.\")\n\t\treturn true\n\t}\n\n\t//remove\n\tfunction removeNodes(parent, vnodes, start, end) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) removeNode(parent, vnode)\n\t\t}\n\t}\n\tfunction removeNode(parent, vnode) {\n\t\tvar mask = 0\n\t\tvar original = vnode.state\n\t\tvar stateResult, attrsResult\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.state.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\tmask = 1\n\t\t\t\tstateResult = result\n\t\t\t}\n\t\t}\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.attrs.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tmask |= 2\n\t\t\t\tattrsResult = result\n\t\t\t}\n\t\t}\n\t\tcheckState(vnode, original)\n\n\t\t// If we can, try to fast-path it and avoid all the overhead of awaiting\n\t\tif (!mask) {\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t} else {\n\t\t\tif (stateResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 1) { mask &= 2; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tstateResult.then(next, next)\n\t\t\t}\n\t\t\tif (attrsResult != null) {\n\t\t\t\tvar next = function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 2) { mask &= 1; if (!mask) reallyRemove() }\n\t\t\t\t}\n\t\t\t\tattrsResult.then(next, next)\n\t\t\t}\n\t\t}\n\n\t\tfunction reallyRemove() {\n\t\t\tcheckState(vnode, original)\n\t\t\tonremove(vnode)\n\t\t\tremoveChild(parent, vnode)\n\t\t}\n\t}\n\tfunction removeHTML(parent, vnode) {\n\t\tfor (var i = 0; i < vnode.instance.length; i++) {\n\t\t\tparent.removeChild(vnode.instance[i])\n\t\t}\n\t}\n\tfunction removeChild(parent, vnode) {\n\t\t// Dodge the recursion overhead in a few of the most common cases.\n\t\twhile (vnode.dom != null && vnode.dom.parentNode === parent) {\n\t\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\t\tvnode = vnode.instance\n\t\t\t\tif (vnode != null) continue\n\t\t\t} else if (vnode.tag === \"<\") {\n\t\t\t\tremoveHTML(parent, vnode)\n\t\t\t} else {\n\t\t\t\tif (vnode.tag !== \"[\") {\n\t\t\t\t\tparent.removeChild(vnode.dom)\n\t\t\t\t\tif (!Array.isArray(vnode.children)) break\n\t\t\t\t}\n\t\t\t\tif (vnode.children.length === 1) {\n\t\t\t\t\tvnode = vnode.children[0]\n\t\t\t\t\tif (vnode != null) continue\n\t\t\t\t} else {\n\t\t\t\t\tfor (var i = 0; i < vnode.children.length; i++) {\n\t\t\t\t\t\tvar child = vnode.children[i]\n\t\t\t\t\t\tif (child != null) removeChild(parent, child)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tfunction onremove(vnode) {\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode)\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//attrs\n\tfunction setAttrs(vnode, attrs, ns) {\n\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t//\n\t\t// Also, the DOM does things to inputs based on the value, so it needs set first.\n\t\t// See: https://github.com/MithrilJS/mithril.js/issues/2622\n\t\tif (vnode.tag === \"input\" && attrs.type != null) vnode.dom.setAttribute(\"type\", attrs.type)\n\t\tvar isFileInput = attrs != null && vnode.tag === \"input\" && attrs.type === \"file\"\n\t\tfor (var key in attrs) {\n\t\t\tsetAttr(vnode, key, null, attrs[key], ns, isFileInput)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key, old, value, ns, isFileInput) {\n\t\tif (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || (old === value && !isFormAttribute(vnode, key)) && typeof value !== \"object\" || key === \"type\" && vnode.tag === \"input\") return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value)\n\t\tif (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, value)\n\t\telse if (hasPropertyKey(vnode, key, ns)) {\n\t\t\tif (key === \"value\") {\n\t\t\t\t// Only do the coercion if we're actually going to check the value.\n\t\t\t\t/* eslint-disable no-implicit-coercion */\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\t//setting input[type=file][value] to same value causes an error to be generated if it's non-empty\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === \"\" + value && (isFileInput || vnode.dom === activeElement())) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t//setting input[type=file][value] to different value is an error if it's non-empty\n\t\t\t\t// Not ideal, but it at least works around the most common source of uncaught exceptions for now.\n\t\t\t\tif (isFileInput && \"\" + value !== \"\") { console.error(\"`value` is read-only on file inputs!\"); return }\n\t\t\t\t/* eslint-enable no-implicit-coercion */\n\t\t\t}\n\t\t\tvnode.dom[key] = value\n\t\t} else {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) vnode.dom.setAttribute(key, \"\")\n\t\t\t\telse vnode.dom.removeAttribute(key)\n\t\t\t}\n\t\t\telse vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value)\n\t\t}\n\t}\n\tfunction removeAttr(vnode, key, old, ns) {\n\t\tif (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") updateEvent(vnode, key, undefined)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, null)\n\t\telse if (\n\t\t\thasPropertyKey(vnode, key, ns)\n\t\t\t&& key !== \"className\"\n\t\t\t&& key !== \"title\" // creates \"null\" as title\n\t\t\t&& !(key === \"value\" && (\n\t\t\t\tvnode.tag === \"option\"\n\t\t\t\t|| vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement()\n\t\t\t))\n\t\t\t&& !(vnode.tag === \"input\" && key === \"type\")\n\t\t) {\n\t\t\tvnode.dom[key] = null\n\t\t} else {\n\t\t\tvar nsLastIndex = key.indexOf(\":\")\n\t\t\tif (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1)\n\t\t\tif (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key)\n\t\t}\n\t}\n\tfunction setLateSelectAttrs(vnode, attrs) {\n\t\tif (\"value\" in attrs) {\n\t\t\tif(attrs.value === null) {\n\t\t\t\tif (vnode.dom.selectedIndex !== -1) vnode.dom.value = null\n\t\t\t} else {\n\t\t\t\tvar normalized = \"\" + attrs.value // eslint-disable-line no-implicit-coercion\n\t\t\t\tif (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n\t\t\t\t\tvnode.dom.value = normalized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined)\n\t}\n\tfunction updateAttrs(vnode, old, attrs, ns) {\n\t\tif (old && old === attrs) {\n\t\t\tconsole.warn(\"Don't reuse attrs object, use new object for every redraw, this will throw in next major\")\n\t\t}\n\t\tif (attrs != null) {\n\t\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t\t//\n\t\t\t// Also, the DOM does things to inputs based on the value, so it needs set first.\n\t\t\t// See: https://github.com/MithrilJS/mithril.js/issues/2622\n\t\t\tif (vnode.tag === \"input\" && attrs.type != null) vnode.dom.setAttribute(\"type\", attrs.type)\n\t\t\tvar isFileInput = vnode.tag === \"input\" && attrs.type === \"file\"\n\t\t\tfor (var key in attrs) {\n\t\t\t\tsetAttr(vnode, key, old && old[key], attrs[key], ns, isFileInput)\n\t\t\t}\n\t\t}\n\t\tvar val\n\t\tif (old != null) {\n\t\t\tfor (var key in old) {\n\t\t\t\tif (((val = old[key]) != null) && (attrs == null || attrs[key] == null)) {\n\t\t\t\t\tremoveAttr(vnode, key, val, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === activeElement() || vnode.tag === \"option\" && vnode.dom.parentNode === $doc.activeElement\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction hasPropertyKey(vnode, key, ns) {\n\t\t// Filter out namespaced keys\n\t\treturn ns === undefined && (\n\t\t\t// If it's a custom element, just keep it.\n\t\t\tvnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is ||\n\t\t\t// If it's a normal element, let's try to avoid a few browser bugs.\n\t\t\tkey !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\"// && key !== \"type\"\n\t\t\t// Defer the property check until *after* we check everything.\n\t\t) && key in vnode.dom\n\t}\n\n\t//style\n\tvar uppercaseRegex = /[A-Z]/g\n\tfunction toLowerCase(capital) { return \"-\" + capital.toLowerCase() }\n\tfunction normalizeKey(key) {\n\t\treturn key[0] === \"-\" && key[1] === \"-\" ? key :\n\t\t\tkey === \"cssFloat\" ? \"float\" :\n\t\t\t\tkey.replace(uppercaseRegex, toLowerCase)\n\t}\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) {\n\t\t\t// Styles are equivalent, do nothing.\n\t\t} else if (style == null) {\n\t\t\t// New style is missing, just clear it.\n\t\t\telement.style.cssText = \"\"\n\t\t} else if (typeof style !== \"object\") {\n\t\t\t// New style is a string, let engine deal with patching.\n\t\t\telement.style.cssText = style\n\t\t} else if (old == null || typeof old !== \"object\") {\n\t\t\t// `old` is missing or a string, `style` is an object.\n\t\t\telement.style.cssText = \"\"\n\t\t\t// Add new style properties\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null) element.style.setProperty(normalizeKey(key), String(value))\n\t\t\t}\n\t\t} else {\n\t\t\t// Both old & new are (different) objects.\n\t\t\t// Update style properties that have changed\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null && (value = String(value)) !== String(old[key])) {\n\t\t\t\t\telement.style.setProperty(normalizeKey(key), value)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove style properties that no longer exist\n\t\t\tfor (var key in old) {\n\t\t\t\tif (old[key] != null && style[key] == null) {\n\t\t\t\t\telement.style.removeProperty(normalizeKey(key))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Here's an explanation of how this works:\n\t// 1. The event names are always (by design) prefixed by `on`.\n\t// 2. The EventListener interface accepts either a function or an object\n\t// with a `handleEvent` method.\n\t// 3. The object does not inherit from `Object.prototype`, to avoid\n\t// any potential interference with that (e.g. setters).\n\t// 4. The event name is remapped to the handler before calling it.\n\t// 5. In function-based event handlers, `ev.target === this`. We replicate\n\t// that below.\n\t// 6. In function-based event handlers, `return false` prevents the default\n\t// action and stops event propagation. We replicate that below.\n\tfunction EventDict() {\n\t\t// Save this, so the current redraw is correctly tracked.\n\t\tthis._ = currentRedraw\n\t}\n\tEventDict.prototype = Object.create(null)\n\tEventDict.prototype.handleEvent = function (ev) {\n\t\tvar handler = this[\"on\" + ev.type]\n\t\tvar result\n\t\tif (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev)\n\t\telse if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev)\n\t\tif (this._ && ev.redraw !== false) (0, this._)()\n\t\tif (result === false) {\n\t\t\tev.preventDefault()\n\t\t\tev.stopPropagation()\n\t\t}\n\t}\n\n\t//event\n\tfunction updateEvent(vnode, key, value) {\n\t\tif (vnode.events != null) {\n\t\t\tvnode.events._ = currentRedraw\n\t\t\tif (vnode.events[key] === value) return\n\t\t\tif (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\t\tif (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = value\n\t\t\t} else {\n\t\t\t\tif (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = undefined\n\t\t\t}\n\t\t} else if (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\tvnode.events = new EventDict()\n\t\t\tvnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\tvnode.events[key] = value\n\t\t}\n\t}\n\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tdo {\n\t\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.state.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\treturn false\n\t\t} while (false); // eslint-disable-line no-constant-condition\n\t\tvnode.dom = old.dom\n\t\tvnode.domSize = old.domSize\n\t\tvnode.instance = old.instance\n\t\t// One would think having the actual latest attributes would be ideal,\n\t\t// but it doesn't let us properly diff based on our current internal\n\t\t// representation. We have to save not only the old DOM info, but also\n\t\t// the attributes used to create it, as we diff *that*, not against the\n\t\t// DOM directly (with a few exceptions in `setAttr`). And, of course, we\n\t\t// need to save the children and text as they are conceptually not\n\t\t// unlike special \"attributes\" internally.\n\t\tvnode.attrs = old.attrs\n\t\tvnode.children = old.children\n\t\tvnode.text = old.text\n\t\treturn true\n\t}\n\n\tvar currentDOM\n\n\treturn function(dom, vnodes, redraw) {\n\t\tif (!dom) throw new TypeError(\"DOM element being rendered to does not exist.\")\n\t\tif (currentDOM != null && dom.contains(currentDOM)) {\n\t\t\tthrow new TypeError(\"Node is currently being rendered to and thus is locked.\")\n\t\t}\n\t\tvar prevRedraw = currentRedraw\n\t\tvar prevDOM = currentDOM\n\t\tvar hooks = []\n\t\tvar active = activeElement()\n\t\tvar namespace = dom.namespaceURI\n\n\t\tcurrentDOM = dom\n\t\tcurrentRedraw = typeof redraw === \"function\" ? redraw : undefined\n\t\ttry {\n\t\t\t// First time rendering into a node clears it out\n\t\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\t\tvnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes])\n\t\t\tupdateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\t\tdom.vnodes = vnodes\n\t\t\t// `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\t\t\tif (active != null && activeElement() !== active && typeof active.focus === \"function\") active.focus()\n\t\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t\t} finally {\n\t\t\tcurrentRedraw = prevRedraw\n\t\t\tcurrentDOM = prevDOM\n\t\t}\n\t}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\n","\"use strict\"\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node == null || typeof node === \"boolean\") return null\n\tif (typeof node === \"object\") return node\n\treturn Vnode(\"#\", undefined, undefined, String(node), undefined, undefined)\n}\nVnode.normalizeChildren = function(input) {\n\tvar children = []\n\tif (input.length) {\n\t\tvar isKeyed = input[0] != null && input[0].key != null\n\t\t// Note: this is a *very* perf-sensitive check.\n\t\t// Fun fact: merging the loop like this is somehow faster than splitting\n\t\t// it, noticeably so.\n\t\tfor (var i = 1; i < input.length; i++) {\n\t\t\tif ((input[i] != null && input[i].key != null) !== isKeyed) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\tisKeyed && (input[i] != null || typeof input[i] === \"boolean\")\n\t\t\t\t\t\t? \"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.\"\n\t\t\t\t\t\t: \"In fragments, vnodes must either all have keys or none have keys.\"\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\tchildren[i] = Vnode.normalize(input[i])\n\t\t}\n\t}\n\treturn children\n}\n\nmodule.exports = Vnode\n","\"use strict\"\n\nvar PromisePolyfill = require(\"./promise/promise\")\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./request/request\")(typeof window !== \"undefined\" ? window : null, PromisePolyfill, mountRedraw.redraw)\n","\"use strict\"\n\nvar buildPathname = require(\"../pathname/build\")\nvar hasOwn = require(\"../util/hasOwn\")\n\nmodule.exports = function($window, Promise, oncompletion) {\n\tvar callbackCount = 0\n\n\tfunction PromiseProxy(executor) {\n\t\treturn new Promise(executor)\n\t}\n\n\t// In case the global Promise is some userland library's where they rely on\n\t// `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n\t// similar. Let's *not* break them.\n\tPromiseProxy.prototype = Promise.prototype\n\tPromiseProxy.__proto__ = Promise // eslint-disable-line no-proto\n\n\tfunction makeRequest(factory) {\n\t\treturn function(url, args) {\n\t\t\tif (typeof url !== \"string\") { args = url; url = url.url }\n\t\t\telse if (args == null) args = {}\n\t\t\tvar promise = new Promise(function(resolve, reject) {\n\t\t\t\tfactory(buildPathname(url, args.params), args, function (data) {\n\t\t\t\t\tif (typeof args.type === \"function\") {\n\t\t\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tdata[i] = new args.type(data[i])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse data = new args.type(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(data)\n\t\t\t\t}, reject)\n\t\t\t})\n\t\t\tif (args.background === true) return promise\n\t\t\tvar count = 0\n\t\t\tfunction complete() {\n\t\t\t\tif (--count === 0 && typeof oncompletion === \"function\") oncompletion()\n\t\t\t}\n\n\t\t\treturn wrap(promise)\n\n\t\t\tfunction wrap(promise) {\n\t\t\t\tvar then = promise.then\n\t\t\t\t// Set the constructor, so engines know to not await or resolve\n\t\t\t\t// this as a native promise. At the time of writing, this is\n\t\t\t\t// only necessary for V8, but their behavior is the correct\n\t\t\t\t// behavior per spec. See this spec issue for more details:\n\t\t\t\t// https://github.com/tc39/ecma262/issues/1577. Also, see the\n\t\t\t\t// corresponding comment in `request/tests/test-request.js` for\n\t\t\t\t// a bit more background on the issue at hand.\n\t\t\t\tpromise.constructor = PromiseProxy\n\t\t\t\tpromise.then = function() {\n\t\t\t\t\tcount++\n\t\t\t\t\tvar next = then.apply(promise, arguments)\n\t\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\t\tcomplete()\n\t\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t\t})\n\t\t\t\t\treturn wrap(next)\n\t\t\t\t}\n\t\t\t\treturn promise\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction hasHeader(args, name) {\n\t\tfor (var key in args.headers) {\n\t\t\tif (hasOwn.call(args.headers, key) && key.toLowerCase() === name) return true\n\t\t}\n\t\treturn false\n\t}\n\n\treturn {\n\t\trequest: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar method = args.method != null ? args.method.toUpperCase() : \"GET\"\n\t\t\tvar body = args.body\n\t\t\tvar assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData || body instanceof $window.URLSearchParams)\n\t\t\tvar responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\")\n\n\t\t\tvar xhr = new $window.XMLHttpRequest(), aborted = false, isTimeout = false\n\t\t\tvar original = xhr, replacedAbort\n\t\t\tvar abort = xhr.abort\n\n\t\t\txhr.abort = function() {\n\t\t\t\taborted = true\n\t\t\t\tabort.call(this)\n\t\t\t}\n\n\t\t\txhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\n\t\t\tif (assumeJSON && body != null && !hasHeader(args, \"content-type\")) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (typeof args.deserialize !== \"function\" && !hasHeader(args, \"accept\")) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tif (args.timeout) xhr.timeout = args.timeout\n\t\t\txhr.responseType = responseType\n\n\t\t\tfor (var key in args.headers) {\n\t\t\t\tif (hasOwn.call(args.headers, key)) {\n\t\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.onreadystatechange = function(ev) {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif (aborted) return\n\n\t\t\t\tif (ev.target.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar success = (ev.target.status >= 200 && ev.target.status < 300) || ev.target.status === 304 || (/^file:\\/\\//i).test(url)\n\t\t\t\t\t\t// When the response type isn't \"\" or \"text\",\n\t\t\t\t\t\t// `xhr.responseText` is the wrong thing to use.\n\t\t\t\t\t\t// Browsers do the right thing and throw here, and we\n\t\t\t\t\t\t// should honor that and do the right thing by\n\t\t\t\t\t\t// preferring `xhr.response` where possible/practical.\n\t\t\t\t\t\tvar response = ev.target.response, message\n\n\t\t\t\t\t\tif (responseType === \"json\") {\n\t\t\t\t\t\t\t// For IE and Edge, which don't implement\n\t\t\t\t\t\t\t// `responseType: \"json\"`.\n\t\t\t\t\t\t\tif (!ev.target.responseType && typeof args.extract !== \"function\") {\n\t\t\t\t\t\t\t\t// Handle no-content which will not parse.\n\t\t\t\t\t\t\t\ttry { response = JSON.parse(ev.target.responseText) }\n\t\t\t\t\t\t\t\tcatch (e) { response = null }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!responseType || responseType === \"text\") {\n\t\t\t\t\t\t\t// Only use this default if it's text. If a parsed\n\t\t\t\t\t\t\t// document is needed on old IE and friends (all\n\t\t\t\t\t\t\t// unsupported), the user should use a custom\n\t\t\t\t\t\t\t// `config` instead. They're already using this at\n\t\t\t\t\t\t\t// their own risk.\n\t\t\t\t\t\t\tif (response == null) response = ev.target.responseText\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof args.extract === \"function\") {\n\t\t\t\t\t\t\tresponse = args.extract(ev.target, args)\n\t\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\t} else if (typeof args.deserialize === \"function\") {\n\t\t\t\t\t\t\tresponse = args.deserialize(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (success) resolve(response)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar completeErrorResponse = function() {\n\t\t\t\t\t\t\t\ttry { message = ev.target.responseText }\n\t\t\t\t\t\t\t\tcatch (e) { message = response }\n\t\t\t\t\t\t\t\tvar error = new Error(message)\n\t\t\t\t\t\t\t\terror.code = ev.target.status\n\t\t\t\t\t\t\t\terror.response = response\n\t\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (xhr.status === 0) {\n\t\t\t\t\t\t\t\t// Use setTimeout to push this code block onto the event queue\n\t\t\t\t\t\t\t\t// This allows `xhr.ontimeout` to run in the case that there is a timeout\n\t\t\t\t\t\t\t\t// Without this setTimeout, `xhr.ontimeout` doesn't have a chance to reject\n\t\t\t\t\t\t\t\t// as `xhr.onreadystatechange` will run before it\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tif (isTimeout) return\n\t\t\t\t\t\t\t\t\tcompleteErrorResponse()\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t} else completeErrorResponse()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.ontimeout = function (ev) {\n\t\t\t\tisTimeout = true\n\t\t\t\tvar error = new Error(\"Request timed out\")\n\t\t\t\terror.code = ev.target.status\n\t\t\t\treject(error)\n\t\t\t}\n\n\t\t\tif (typeof args.config === \"function\") {\n\t\t\t\txhr = args.config(xhr, args, url) || xhr\n\n\t\t\t\t// Propagate the `abort` to any replacement XHR as well.\n\t\t\t\tif (xhr !== original) {\n\t\t\t\t\treplacedAbort = xhr.abort\n\t\t\t\t\txhr.abort = function() {\n\t\t\t\t\t\taborted = true\n\t\t\t\t\t\treplacedAbort.call(this)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body == null) xhr.send()\n\t\t\telse if (typeof args.serialize === \"function\") xhr.send(args.serialize(body))\n\t\t\telse if (body instanceof $window.FormData || body instanceof $window.URLSearchParams) xhr.send(body)\n\t\t\telse xhr.send(JSON.stringify(body))\n\t\t}),\n\t\tjsonp: makeRequest(function(url, args, resolve, reject) {\n\t\t\tvar callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++\n\t\t\tvar script = $window.document.createElement(\"script\")\n\t\t\t$window[callbackName] = function(data) {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\tresolve(data)\n\t\t\t}\n\t\t\tscript.onerror = function() {\n\t\t\t\tdelete $window[callbackName]\n\t\t\t\tscript.parentNode.removeChild(script)\n\t\t\t\treject(new Error(\"JSONP request failed\"))\n\t\t\t}\n\t\t\tscript.src = url + (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") +\n\t\t\t\tencodeURIComponent(args.callbackKey || \"callback\") + \"=\" +\n\t\t\t\tencodeURIComponent(callbackName)\n\t\t\t$window.document.documentElement.appendChild(script)\n\t\t}),\n\t}\n}\n","\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./api/router\")(typeof window !== \"undefined\" ? window : null, mountRedraw)\n","// This exists so I'm only saving it once.\n\"use strict\"\n\nvar hasOwn = require(\"./hasOwn\")\n\nmodule.exports = Object.assign || function(target, source) {\n\tfor (var key in source) {\n\t\tif (hasOwn.call(source, key)) target[key] = source[key]\n\t}\n}\n","\"use strict\"\n\n// Note: this is mildly perf-sensitive.\n//\n// It does *not* use `delete` - dynamic `delete`s usually cause objects to bail\n// out into dictionary mode and just generally cause a bunch of optimization\n// issues within engines.\n//\n// Ideally, I would've preferred to do this, if it weren't for the optimization\n// issues:\n//\n// ```js\n// const hasOwn = require(\"./hasOwn\")\n// const magic = [\n// \"key\", \"oninit\", \"oncreate\", \"onbeforeupdate\", \"onupdate\",\n// \"onbeforeremove\", \"onremove\",\n// ]\n// module.exports = (attrs, extras) => {\n// const result = Object.assign(Object.create(null), attrs)\n// for (const key of magic) delete result[key]\n// if (extras != null) for (const key of extras) delete result[key]\n// return result\n// }\n// ```\n\nvar hasOwn = require(\"./hasOwn\")\n// Words in RegExp literals are sometimes mangled incorrectly by the internal bundler, so use RegExp().\nvar magic = new RegExp(\"^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$\")\n\nmodule.exports = function(attrs, extras) {\n\tvar result = {}\n\n\tif (extras != null) {\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key) && !magic.test(key) && extras.indexOf(key) < 0) {\n\t\t\t\tresult[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key) && !magic.test(key)) {\n\t\t\t\tresult[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result\n}\n","// This exists so I'm only saving it once.\n\"use strict\"\n\nmodule.exports = {}.hasOwnProperty\n","function none(n) {\n return 'n'\n}\nfunction p_ne_1(n) {\n return n !== 1 ? 'p' : 's'\n}\nfunction p_gt_1(n) {\n return n > 1 ? 'p' : 's'\n}\n\n// ---------------------------------------------------------------------------\n\nexports.plural_CS = function(n) {\n return n == 1 ? 's' : n >= 2 && n <= 4 ? 'p' : 'n'\n}\nexports.plural_DA = p_ne_1\nexports.plural_DE = p_ne_1\nexports.plural_EN = p_ne_1\nexports.plural_ES = p_ne_1\nexports.plural_FR = p_gt_1\nexports.plural_IS = function(n) {\n return n % 10 !== 1 || n % 100 === 11 ? 'p' : 's'\n}\nexports.plural_IT = p_ne_1\nexports.plural_JA = none\nexports.plural_PT = p_ne_1\nexports.plural_SE = p_ne_1\n","import { ComponentTypes } from 'mithril';\nimport { State } from '../services';\n\ntype IconResolver = string | (() => string);\n\nexport enum Pages {\n LANDING = 'LANDING',\n LOGIN = 'LOGIN',\n HOME = 'HOME',\n CRIME_SCRIPT = 'CRIME_SCRIPT',\n SETTINGS = 'SETTINGS',\n ABOUT = 'ABOUT',\n CASE = 'CASE',\n}\n\nexport type VisibilityResolver = (s: State) => boolean;\n\nexport interface Page {\n id: Pages;\n default?: boolean;\n hasNavBar?: boolean;\n title: string;\n icon?: IconResolver;\n iconClass?: string;\n route: string;\n visible: boolean | VisibilityResolver;\n component: ComponentTypes;\n sidebar?: ComponentTypes;\n hasSidebar?: boolean;\n}\n","import e from\"mithril\";const t=()=>\"idxxxxxxxx\".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),a=()=>\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return(\"x\"===e?t:3&t|8).toString(16)}),i=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),l=e=>t=>Array.prototype.map.call(t,e),o=e=>t=>Array.prototype.join.call(t,e),n=e=>e.replace(/([A-Z])/g,e=>\"-\"+e.toLowerCase()),s=e=>e?i(o(\"\"),l(t=>`[${n(t)}=\"${((e=\"\")=>e.toString().replace(/\"/g,\""\"))(e[t])}\"]`),Object.keys)(e):\"\",r=[\"min\",\"max\",\"minLength\",\"maxLength\",\"rows\",\"cols\",\"placeholder\",\"autocomplete\",\"pattern\",\"readOnly\",\"step\"],c=e=>r.indexOf(e)>=0,d=({disabled:e})=>e?\"[disabled]\":\"\",p=({required:e,isMandatory:t})=>e||t?\"[required][aria-required=true]\":\"\",m=e=>(e=>{const t=(a=e,e=>void 0!==a[e]);var a;return Object.keys(e).filter(c).filter(t).reduce((t,a)=>{const i=e[a];return t.push(`[${a.toLowerCase()}=${i}]`),t},[]).join(\"\")})(e)+(e=>e.maxLength?`[data-length=${e.maxLength}]`:\"\")(e)+d(e)+p(e)+(({autofocus:e})=>\"boolean\"==typeof e&&e||e&&e()?\"[autofocus]\":\"\")(e),u=e=>!isNaN(parseFloat(e))&&isFinite(e),h=(...e)=>t=>e.reduce((e,t)=>t(e),t),v=(e,t=2,a=\"0\")=>(e+=\"\").length>=t?e:new Array(t-e.length+1).join(a)+e,b=(e,t,a)=>{const i=e[t];e[t]=e[a],e[a]=i},y=(e,t,a)=>{const i=e[t];e.splice(t,1),e.splice(a,0,i)};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(l[a]=e[a]);return l}const x=[\"label\",\"id\",\"isMandatory\",\"isActive\"],w={view:({attrs:t})=>e(\"span.mandatory\",t,\"*\")},k=()=>({view:t=>{let{attrs:{label:a,id:i,isMandatory:l,isActive:o}}=t,n=f(t.attrs,x);return a?e(`label${o?\".active\":\"\"}${i?`[for=${i}]`:\"\"}`,n,[e.trust(a),l?e(w):void 0]):void 0}}),N=()=>({view:({attrs:{helperText:t,dataError:a,dataSuccess:i,className:l}})=>t||a||i?e(\"span.helper-text\",{className:l,dataError:a,dataSuccess:i},t?e.trust(t):\"\"):void 0}),$=()=>{const a={id:t()};return{view:({attrs:t})=>{const i=t.id||a.id,l=m(t),{label:o,helperText:n,initialValue:s,onchange:r,newRow:c,className:d=\"col s12\",style:p,iconName:u,isMandatory:h}=t;return e(\".input-field\"+(c?\".clear\":\"\"),{className:c?d+\" clear\":d,style:p},[u?e(\"i.material-icons.prefix\",u):\"\",e(`input.autocomplete[type=text][tabindex=0]${l}`,{id:i,oncreate:({dom:e})=>{M.Autocomplete.init(e,t)},onchange:r?e=>{e.target&&e.target.value&&r(e.target.value)}:void 0,value:s}),e(k,{label:o,id:i,isMandatory:h,isActive:s}),e(N,{helperText:n})])}}},C=[\"iconName\"],I=()=>({view:t=>{let{attrs:{iconName:a}}=t,i=f(t.attrs,C);return e(\"i.material-icons\",i,a)}}),A=[\"modalId\",\"tooltip\",\"tooltipPostion\",\"iconName\",\"iconClass\",\"label\",\"attr\"],T=(t,a=\"\")=>()=>{const i=`${t}${a}`;return{view:({attrs:t})=>{const{modalId:a,tooltip:l,tooltipPostion:o,iconName:n,iconClass:r,label:c,attr:d}=t,p=f(t,A);return e(`${i}${a?`.modal-trigger[href=#${a}]`:\"\"}${l?`.tooltipped[data-position=${o||\"top\"}][data-tooltip=${l}]`:\"\"}${s(d)}`,p,n?e(I,{iconName:n,className:r||\"left\"}):void 0,c||void 0)}}},V=T(\"a.waves-effect.waves-light.btn\",\"[type=button]\"),S=T(\"a.waves-effect.waves-light.btn-large\",\"[type=button]\"),O=T(\"a.waves-effect.waves-light.btn-small\",\"[type=button]\"),R=T(\"a.waves-effect.waves-teal.btn-flat\",\"[type=button]\"),j=T(\"button.btn-floating.btn-large.waves-effect.waves-light\",\"[type=button]\"),L=T(\"button.btn.waves-effect.waves-light\",\"[type=submit]\"),E=()=>({view:({attrs:{href:t,src:a}})=>e(\"a.carousel-item\",{href:t},e(`img[src=${a}]`))}),F=()=>({view:({attrs:t})=>{const{items:a}=t;return a&&a.length>0?e(\".carousel\",{oncreate:({dom:e})=>{M.Carousel.init(e,t)}},a.map(t=>e(E,t))):void 0}}),D=()=>({oncreate:({attrs:e,dom:t})=>{const{onchange:a,onChipAdd:i,onChipDelete:l}=e,o=M.Chips.getInstance(t.children[0]),n=i?i.bind(o):void 0;e.onChipAdd=function(e,t){a&&a(this.chipsData),n&&n(e,t)};const s=l?l.bind(o):void 0;e.onChipDelete=function(e,t){a&&a(this.chipsData),s&&s(e,t)},M.Chips.init(t.children[0],e)},onupdate:({dom:e,attrs:{data:t}})=>{if(!t||0===t.length)return;const a=M.Chips.getInstance(e.children[0]);t.forEach(e=>a.addChip(e))},view:({attrs:{placeholder:t,required:a,isMandatory:i=a,data:l,className:o=\"col s12\",label:n,helperText:s}})=>e(\".input-field\",{className:o},[e(`.chips.chips-autocomplete${t?\".chips-placeholder\":\"\"}${l?\".chips-initial\":\"\"}`),n?e(k,{label:n,isMandatory:i,className:\"active\"}):void 0,s?e(N,{helperText:s}):void 0])}),K=()=>({view:({attrs:t})=>{const{newRow:a,code:i,language:l}=t,o=l||\"lang-TypeScript\",n=o.replace(\"lang-\",\"\"),s=i instanceof Array?i.join(\"\\n\"):i;return e(\"pre.codeblock\"+(a?\".clear\":\"\"),t,[e(\"div\",e(\"label\",n)),e(`code.${o}`,s)])}}),_=()=>({view:({attrs:{header:t,body:a,active:i,iconName:l}})=>e(i?\"li.active\":\"li\",[t||l?e(\".collapsible-header\",[l?e(\"i.material-icons\",l):void 0,t?\"string\"==typeof t?e(\"span\",t):t:void 0]):void 0,a?e(\".collapsible-body\",a):void 0])}),B=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:t})=>{const{items:a,class:i,className:l,style:o,id:n}=t;return a&&a.length>0?e(\"ul.collapsible\",{class:i||l,style:o,id:n},a.map(t=>e(_,t))):void 0}}),q=[\"header\",\"items\",\"mode\"],P=[\"title\",\"active\",\"href\"],U=[\"items\",\"header\"],z=[\"items\",\"header\",\"mode\"];var H;!function(e){e[e.BASIC=0]=\"BASIC\",e[e.LINKS=1]=\"LINKS\",e[e.AVATAR=2]=\"AVATAR\"}(H||(H={}));const W=e=>e&&/https?:\\/\\//.test(e),Y=()=>({view:({attrs:t})=>{const{href:a,iconName:i=\"send\",onclick:l,style:o={cursor:\"pointer\"}}=t,n={href:a,style:o,className:\"secondary-content\",onclick:l?()=>l(t):void 0};return W(a)||!a?e(\"a[target=_]\",n,e(I,{iconName:i})):e(e.route.Link,n,e(I,{iconName:i}))}}),Z=(e=\"\")=>/\\./.test(e),G=()=>({view:({attrs:{item:t,mode:a}})=>{const{title:i,content:l=\"\",active:o,iconName:n,avatar:s,className:r,onclick:c}=t;return a===H.AVATAR?e(\"li.collection-item.avatar\"+(o?\".active\":\"\"),{onclick:c?()=>c(t):void 0},[Z(s)?e(\"img.circle\",{src:s}):e(\"i.material-icons.circle\",{className:r},s),e(\"span.title\",i),e(\"p\",e.trust(l)),e(Y,t)]):e(\"li.collection-item\"+(o?\".active\":\"\"),n?e(\"div\",[i,e(Y,t)]):i)}}),J=()=>({view:t=>{let{attrs:{header:a,items:i,mode:l=H.BASIC}}=t,o=f(t.attrs,q);const n=i.map(t=>e(G,{key:t.id,item:t,mode:l}));return a?e(\"ul.collection.with-header\",o,[e(\"li.collection-header\",e(\"h4\",a)),n]):e(\"ul.collection\",o,n)}}),Q=()=>({view:({attrs:{item:t}})=>{const{title:a,active:i,href:l}=t,o=g({},f(t,P),{className:\"collection-item \"+(i?\"active\":\"\"),href:l});return W(l)||!l?e(\"a[target=_]\",o,a):e(e.route.Link,o,a)}}),X=()=>({view:t=>{let{attrs:{items:a,header:i}}=t,l=f(t.attrs,U);return i?e(\".collection.with-header\",l,[e(\".collection-header\",e(\"h4\",i)),a.map(t=>e(Q,{key:t.id,item:t}))]):e(\".collection\",l,a.map(t=>e(Q,{key:t.id,item:t})))}}),ee=()=>({view:t=>{let{attrs:{items:a,header:i,mode:l=H.BASIC}}=t,o=f(t.attrs,z);return i||a&&a.length>0?l===H.LINKS?e(X,g({header:i,items:a},o)):e(J,g({header:i,items:a,mode:l},o)):void 0}}),te=[\"key\",\"label\",\"onchange\",\"disabled\",\"items\",\"iconName\",\"helperText\",\"style\",\"className\"],ae=()=>{const a={};return{oninit:({attrs:{id:e=t(),initialValue:i,checkedId:l}})=>{a.id=e,a.initialValue=i||l},view:t=>{let{attrs:{key:i,label:l,onchange:o,disabled:n=!1,items:s,iconName:r,helperText:c,style:d,className:p=\"col s12\"}}=t,m=f(t.attrs,te);const{id:u,initialValue:h}=a,v=h?s.filter(e=>e.id?e.id===h:e.label===h).shift():void 0,b=v?v.label:l||\"Select\";return e(\".input-field\",{className:p,key:i,style:d},[r?e(\"i.material-icons.prefix\",r):void 0,e(N,{helperText:c}),e(`a.dropdown-trigger.btn.truncate[href=#][data-target=${u}]${n?\"[disabled]\":\"\"}`,{className:\"col s12\",style:d||(r?\"margin: 0.2em 0 0 3em;\":void 0),oncreate:({dom:e})=>{M.Dropdown.init(e,m)}},b),e(`ul.dropdown-content[id=${u}]`,s.map(t=>e(\"li\"+(t.divider?\".divider[tabindex=-1]\":\"\"),t.divider?void 0:e(\"a\",{onclick:o?()=>{a.initialValue=t.id||t.label,o(a.initialValue)}:void 0},[t.iconName?e(\"i.material-icons\",t.iconName):void 0,t.label]))))])}}},ie=[\"className\",\"iconName\",\"iconClass\",\"position\",\"style\",\"buttons\"],le=()=>({view:t=>{let{attrs:{className:a,iconName:i,iconClass:l=\"large\",position:o,style:n=(\"left\"===o||\"inline-left\"===o?\"position: absolute; display: inline-block; left: 24px;\":\"right\"===o||\"inline-right\"===o?\"position: absolute; display: inline-block; right: 24px;\":void 0),buttons:s}}=t,r=f(t.attrs,ie);const c=e(\".fixed-action-btn\",{style:n,oncreate:({dom:e})=>M.FloatingActionButton.init(e,r)},[e(\"a.btn-floating.btn-large\",{className:a},e(\"i.material-icons\",{classNames:l},i)),s?e(\"ul\",s.map(t=>e(\"li\",e(\"a.btn-floating\",{className:t.className,onclick:e=>t.onClick&&t.onClick(e)},e(\"i.material-icons\",{className:t.iconClass},t.iconName))))):void 0]);return\"inline-right\"===o||\"inline-left\"===o?e(\"div\",{style:\"position: relative; height: 70px;\"},c):c}}),oe=[\"className\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\"],ne=[\"className\",\"dataError\",\"dataSuccess\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"maxLength\",\"newRow\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\",\"validate\"],se=()=>{const a={id:t()};return{view:({attrs:t})=>{const{className:i=\"col s12\",helperText:l,iconName:o,id:n=a.id,initialValue:s,isMandatory:r,label:c,onchange:d,onkeydown:p,onkeypress:u,onkeyup:h,onblur:v,style:b}=t,y=f(t,oe),g=m(y);return e(\".input-field\",{className:i,style:b},[o?e(\"i.material-icons.prefix\",o):\"\",e(`textarea.materialize-textarea[tabindex=0][id=${n}]${g}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),t.maxLength&&M.CharacterCounter.init(e)},onchange:d?e=>{const t=e.target;d(t&&\"string\"==typeof t.value?t.value:\"\")}:void 0,value:s,onkeyup:h?e=>{h(e,e.target.value)}:void 0,onkeydown:p?e=>{p(e,e.target.value)}:void 0,onkeypress:u?e=>{u(e,e.target.value)}:void 0,onblur:v}),e(k,{label:c,id:n,isMandatory:r,isActive:s||t.placeholder}),e(N,{helperText:l})])}}},re=(a,i=\"\")=>()=>{const l={id:t()},o=e=>{const t=e.value;return!t||\"number\"!==a&&\"range\"!==a?t:+t},n=(e,t)=>{e.setCustomValidity(\"boolean\"==typeof t?t?\"\":\"Custom validation failed\":t)};return{view:({attrs:t})=>{const{className:s=\"col s12\",dataError:r,dataSuccess:c,helperText:d,iconName:p,id:u=l.id,initialValue:h,isMandatory:v,label:b,maxLength:y,newRow:g,onchange:x,onkeydown:w,onkeypress:$,onkeyup:C,onblur:I,style:A,validate:T}=t,V=f(t,ne),S=m(V);return e(`.input-field${g?\".clear\":\"\"}${i}`,{className:s,style:A},[p?e(\"i.material-icons.prefix\",p):void 0,e(`input.validate[type=${a}][tabindex=0][id=${u}]${S}`,{oncreate:({dom:e})=>{(({autofocus:e})=>!!e&&(\"boolean\"==typeof e?e:e()))(t)&&e.focus(),y&&M.CharacterCounter.init(e),\"range\"===a&&M.Range.init(e)},onkeyup:C?e=>{C(e,o(e.target))}:void 0,onkeydown:w?e=>{w(e,o(e.target))}:void 0,onkeypress:$?e=>{$(e,o(e.target))}:void 0,onblur:I,onupdate:T?({dom:e})=>{const t=e;n(t,T(o(t),t))}:void 0,onchange:e=>{const t=e.target;if(t){const e=o(t);x&&x(e),T&&n(t,T(e,t))}},value:h}),e(k,{label:b,id:u,isMandatory:v,isActive:!(void 0===h&&!t.placeholder&&\"number\"!==a&&\"color\"!==a&&\"range\"!==a)}),e(N,{helperText:d,dataError:r,dataSuccess:c})])}}},ce=re(\"text\"),de=re(\"password\"),pe=re(\"number\"),me=re(\"url\"),ue=re(\"color\"),he=re(\"range\",\".range-field\"),ve=re(\"email\"),be=()=>{let t,a=!1;return{view:({attrs:i})=>{const{multiple:l,disabled:o,initialValue:n,placeholder:s,onchange:r,className:c=\"col s12\",accept:d,label:p=\"File\"}=i,m=d?d instanceof Array?d.join(\", \"):d:void 0,u=m?`[accept=${m}]`:\"\",h=l?\"[multiple]\":\"\",v=o?\"[disabled]\":\"\",b=s?`[placeholder=${s}]`:\"\";return e(\".file-field.input-field\",{className:i.class||c},[e(\".btn\",[e(\"span\",p),e(`input[type=file]${h}${v}${u}`,{onchange:r?e=>{const t=e.target;t&&t.files&&r&&(a=!0,r(t.files))}:void 0})]),e(\".file-path-wrapper\",e(`input.file-path.validate${b}[type=text]`,{oncreate:({dom:e})=>{t=e,n&&(t.value=n)}})),(a||n)&&e(\"a.waves-effect.waves-teal.btn-flat\",{style:\"float: right;position: relative;top: -3rem; padding: 0\",onclick:()=>{a=!1,t.value=\"\",r&&r({})}},e(\"i.material-icons\",\"clear\"))])}}},ye=()=>({view:({attrs:{className:t=\"col s12\",onchange:a,label:i,checked:l,disabled:o,description:n}})=>e(\"div\",{className:t},e(\"label\",[e(\"input[type=checkbox][tabindex=0]\",{checked:l,disabled:o,onclick:a?e=>{e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),i?\"string\"==typeof i?e(\"span\",i):i:void 0]),n&&e(N,{className:\"input-checkbox-desc\",helperText:n}))}),ge=()=>{const t={},a=e=>t.checkedIds.indexOf(e)>=0;return{oninit:({attrs:{initialValue:e,checkedId:a}})=>{const i=a||e;t.checkedId=a,t.checkedIds=i?i instanceof Array?[...i]:[i]:[]},view:({attrs:{label:i,id:l,options:o,checkedId:n,description:s,className:r=\"col s12\",disabled:c,checkboxClass:d,newRow:p,isMandatory:m,onchange:u}})=>{n&&t.checkedId!==n&&(t.checkedId=n,t.checkedIds=n instanceof Array?n:[n]);const h=u?(e,a)=>{const i=t.checkedIds.filter(t=>t!==e);a&&i.push(e),t.checkedIds=i,u(i)}:void 0;return e(\"div\"+(p?\".clear\":\"\"),{className:r},[e(\"div\",{className:\"input-field options\"},e(k,{id:l,label:i,isMandatory:m})),e(N,{helperText:s}),...o.map(t=>e(ye,{disabled:c||t.disabled,label:t.label,onchange:h?e=>h(t.id,e):void 0,className:t.className||d,checked:a(t.id),description:t.description}))])}}},fe=()=>{const a=e=>i.curKey=i.id=e,i={elementId:t(),id:\"\",curKey:\"\",kvc:(t,a,i)=>{const{keyClass:l=\".col.s4\",valueClass:o=\".col.s8\"}=i,n=a instanceof Array?a.join(\", \"):\"boolean\"==typeof a?e(ye,{label:\" \",checked:a,disabled:!0,className:\"checkbox-in-collection\"}):a.toString();return{title:e(\".row\",{style:\"margin-bottom: 0\"},[e(l,e(\"b\",t)),e(o,n)])}}},l=()=>{i.id=\"\",i.curKey=\"\"};return{oninit:({attrs:{keyValueConverter:e,id:t}})=>{e&&(i.kvc=e),t&&(i.elementId=t)},view:({attrs:{className:t=\"col s12\",disabled:o,disallowArrays:n,header:s,iconName:r,iconNameKey:c=(r?\"label\":void 0),isMandatory:d,label:p,labelKey:m=\"Key\",labelValue:u=\"Value\",properties:h,keyClass:v,valueClass:b,onchange:y,falsy:g=[\"false\"],truthy:f=[\"true\"]}})=>{const x=()=>y?y(h):void 0,w=((e,t)=>Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>((e,t)=>{const l=t.onclick;return t.id=t.id||e,t.active=e===i.curKey,t.onclick=l?()=>a(e)&&l(t):()=>a(e),t})(e.key,i.kvc(e.key,e.value,{keyClass:t.keyClass,valueClass:t.valueClass}))))(h,{keyClass:v,valueClass:b}),N=i.curKey,$=h[N],M=\"boolean\"==typeof $||\"number\"==typeof $?$:$?$ instanceof Array?`[${$.join(\", \")}]`:$:\"\",C=i.elementId;return[e(\".map-editor\",e(\".input-field\",{className:t,style:\"min-height: 1.5em;\"},[r?e(\"i.material-icons.prefix\",r):\"\",e(k,{label:p,isMandatory:d,isActive:w.length>0}),e(ee,{id:C,items:w,mode:H.LINKS,header:s})])),o?void 0:[e(ce,{label:m,iconName:c,className:\"col s5\",initialValue:N,onchange:e=>{i.curKey=e,i.id&&(delete h[i.id],h[e]=$,i.id=e),x()}}),\"string\"==typeof M?e(se,{label:u,initialValue:M,className:\"col s7\",onchange:e=>{const t=(i=g,f.indexOf(a=e)>=0||!(i.indexOf(a)>=0)&&void 0);var a,i;const l=void 0===t&&/^\\s*\\d+\\s*$/i.test(e)?+e:void 0;h[N]=\"boolean\"==typeof t?t:\"number\"==typeof l?l:((e,t=!1)=>{if(t)return e;if(!e)return;const a=/\\s*\\[(.*)\\]\\s*/gi.exec(e);return a&&2===a.length?a[1].split(\",\").map(e=>e.trim()).map(e=>/^\\d+$/g.test(e)?+e:e):void 0})(e,n)||e,x()}}):\"number\"==typeof M?e(pe,{label:u,initialValue:M,className:\"col s7\",onchange:e=>{h[N]=e,x()}}):e(ye,{label:u,checked:M,className:\"input-field col s7\",onchange:e=>{h[N]=e,x()}}),e(\".col.s12.right-align\",[e(R,{iconName:\"add\",onclick:l}),e(R,{iconName:\"delete\",disabled:!N,onclick:()=>{delete h[N],l(),x()}})])]]}}},xe=()=>({oncreate:({dom:e,attrs:t})=>{M.Materialbox.init(e,t)},view:({attrs:t})=>{const{src:a,width:i,height:l}=t;return e(`img.materialboxed[src=${a}]${i?`[width=${i}]`:\"\"}${l?`[height=${l}]`:\"\"}`,t)}}),we=()=>({oncreate:({dom:e,attrs:{options:t,onCreate:a}})=>{const i=M.Modal.init(e,t);a&&a(i)},view:({attrs:{id:t,title:a,description:i,fixedFooter:l,bottomSheet:o,buttons:n,richContent:s}})=>e(`.modal${l?\".modal-fixed-footer\":\"\"}${o?\".bottom-sheet\":\"\"}[id=${t}]`,[e(\".modal-content\",[e(\"h4\",a),s&&\"string\"==typeof i?e.trust(i||\"\"):\"string\"==typeof i?e(\"p\",i):i]),n?e(\".modal-footer\",n.map(t=>e(R,g({},t,{className:\"modal-close\"})))):void 0])}),ke=()=>({view:({attrs:{title:t,href:a,active:i,disabled:l}})=>e(\"li\",{className:i?\"active\":l?\"disabled\":\"waves-effect\"},\"number\"==typeof t?e(e.route.Link,{href:a},t):t)}),Ne=()=>{const t={pagIndex:0};return{view:({attrs:{items:a,curPage:i=1,size:l=Math.min(9,a.length)}})=>{const{pagIndex:o}=t,n=o*l,s=n+l,r=o>0,c=sr&&t.pagIndex--},e(\"i.material-icons\",\"chevron_left\")),disabled:!r},...a.filter((e,t)=>n<=t&&tc&&t.pagIndex++},e(\"i.material-icons\",\"chevron_right\")),disabled:!c}];return e(\"ul.pagination\",d.map((t,a)=>e(ke,g({title:n+a},t,{active:n+a===i}))))}}},$e=()=>({oncreate:({dom:e,attrs:t})=>{M.Parallax.init(e,t)},view:({attrs:{src:t}})=>t?e(\".parallax-container\",e(\".parallax\",e(`img[src=${t}]`))):void 0}),Me=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],Ce=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],Ie=()=>{const a={id:t()};return{view:t=>{let{attrs:{label:i,helperText:l,initialValue:o,newRow:n,className:s=\"col s12\",iconName:r,isMandatory:c,onchange:d,disabled:p}}=t,u=f(t.attrs,Me);const h=a.id,v=m(u),b=d?()=>a.dp&&d(a.dp.date):void 0;return e(\".input-field\"+(n?\".clear\":\"\"),{className:s,onremove:()=>a.dp&&a.dp.destroy()},[r?e(\"i.material-icons.prefix\",r):\"\",e(`input.datepicker[type=text][tabindex=0][id=${h}]${v}${p?\"[disabled]\":\"\"}`,{oncreate:({dom:e})=>{a.dp=M.Datepicker.init(e,g({format:\"yyyy/mm/dd\",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},u,{onClose:b}))}}),e(k,{label:i,id:h,isMandatory:c,isActive:!!o}),e(N,{helperText:l})])}}},Ae=()=>{const a={id:t()};return{view:t=>{let{attrs:{label:i,helperText:l,initialValue:o,newRow:n,className:s=\"col s12\",iconName:r,isMandatory:c,onchange:d,disabled:p}}=t,u=f(t.attrs,Ce);const h=a.id,v=m(u),b=n?\".clear\":\"\",y=new Date,x=d?()=>a.tp&&d(a.tp.time||o||`${y.getHours()}:${y.getMinutes()}`):void 0;return e(`.input-field.timepicker${b}`,{className:s,onremove:()=>a.tp&&a.tp.destroy()},[r?e(\"i.material-icons.prefix\",r):\"\",e(`input[type=text][tabindex=0][id=${h}]${v}${p?\"[disabled]\":\"\"}`,{value:o,oncreate:({dom:e})=>{a.tp=M.Timepicker.init(e,g({twelveHour:!1,showClearBtn:!0,defaultTime:o},u,{onCloseEnd:x}))}}),e(k,{label:i,id:h,isMandatory:c,isActive:o}),e(N,{helperText:l})])}}},Te=()=>({view:({attrs:{id:t,groupId:a,label:i,onchange:l,className:o=\"col s12\",checked:n,disabled:s}})=>e(\"div\",{className:o},e(\"label\",[e(`input[type=radio][tabindex=0][name=${a}]${n?\"[checked=checked]\":\"\"}${s?\"[disabled]\":\"\"}`,{onclick:l?()=>l(t):void 0}),e(\"span\",e.trust(i))]))}),Ve=()=>{const a={groupId:t()};return{oninit:({attrs:{checkedId:e,initialValue:t}})=>{a.oldCheckedId=e,a.checkedId=e||t},view:({attrs:{id:t,checkedId:i,newRow:l,className:o=\"col s12\",label:n=\"\",disabled:s,description:r,options:c,isMandatory:d,checkboxClass:p,onchange:m}})=>{a.oldCheckedId!==i&&(a.oldCheckedId=a.checkedId=i);const{groupId:u,checkedId:h}=a,v=e=>{a.checkedId=e,m&&m(e)};return l&&(o+=\" clear\"),e(\"div\",{id:t,className:o},[e(\"div\",{className:\"input-field options\"},e(k,{id:t,label:n,isMandatory:d})),r?e(\"p.helper-text\",e.trust(r)):\"\",...c.map(t=>e(Te,g({},t,{onchange:v,groupId:u,disabled:s,className:p,checked:t.id===h})))])}}},Se=()=>{const t={},a=e=>e.map(e=>e.id).join(\"\"),i=(e,t,a=!1)=>a||(t instanceof Array&&(e||\"number\"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:e,initialValue:i,options:l}})=>{t.ids=a(l);const o=e||i;t.checkedId=e instanceof Array?[...e]:e,t.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:l,newRow:o,className:n=\"col s12\",checkedId:s,key:r,options:c,multiple:d,label:p,helperText:m,placeholder:h=\"\",isMandatory:v,iconName:b,disabled:y,classes:g=\"\",dropdownOptions:f,onchange:x}})=>{t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);const{initialValue:w}=t,$=x?d?()=>{const e=t.instance&&t.instance.getSelectedValues(),a=e?e.length>0&&u(e[0])?e.map(e=>+e):e.filter(e=>null!==e||void 0!==e):void 0;t.initialValue=a||[],x(t.initialValue)}:e=>{if(e&&e.currentTarget){const a=e.currentTarget,i=u(a.value)?+a.value:a.value;t.initialValue=void 0!==typeof i?[i]:[]}t.initialValue&&x(t.initialValue)}:void 0;o&&(n+=\" clear\");const C=!c.some(e=>i(e.id,w)),I=c.reduce((e,t)=>(t.group&&e.indexOf(t.group)<0&&e.push(t.group),e),[]);return e(\".input-field.select-space\",{className:n,key:r,oncreate:d?({dom:e})=>t.wrapper=e:void 0},[b&&e(\"i.material-icons.prefix\",b),e(\"select\",{id:l,title:p,disabled:y,multiple:d,oncreate:({dom:e})=>{t.instance=M.FormSelect.init(e,{classes:g,dropdownOptions:f})},onupdate:({dom:e})=>{if(d){const e=b?1:0;!t.inputEl&&t.wrapper&&t.wrapper.childNodes&&t.wrapper.childNodes.length>0&&t.wrapper.childNodes[e].childNodes&&t.wrapper.childNodes[e].childNodes[0]&&(t.inputEl=t.wrapper.childNodes[e].childNodes[0]),t.inputEl&&t.inputEl.value&&t.inputEl.value.startsWith(`${h}, `)&&(t.inputEl.value=t.inputEl.value.replace(`${h}, `,\"\"))}const i=a(c);let l=s&&t.checkedId!==s.toString();t.ids!==i&&(t.ids=i,l=!0),(t.checkedId instanceof Array&&s instanceof Array?t.checkedId.join()!==s.join():t.checkedId!==s)&&(t.checkedId=s,l=!0),l&&(t.instance=M.FormSelect.init(e,{classes:g,dropdownOptions:f}))},onchange:$},e(\"option\",{value:\"\",disabled:!0,selected:!!C||void 0},h),0===I.length?c.map((t,a)=>{var l;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,w,0===a&&C&&!h)},null==(l=t.label)?void 0:l.replace(\"&\",\"&\"))}):I.map(t=>e(\"optgroup\",{label:t},c.filter(e=>e.group===t).map((t,a)=>{var l;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,w,0===a&&C&&!h)},null==(l=t.label)?void 0:l.replace(\"&\",\"&\"))})))),e(k,{label:p,isMandatory:v}),m&&e(N,{helperText:m})])}}},Oe=[\"label\",\"left\",\"right\",\"disabled\",\"newRow\",\"onchange\",\"checked\",\"isMandatory\",\"className\"],Re=()=>{const a={id:t()};return{view:({attrs:t})=>{const i=t.id||a.id,{label:l,left:o,right:n,disabled:s,newRow:r,onchange:c,checked:p,isMandatory:m,className:u=\"col s12\"}=t,h=f(t,Oe);return e(\"div\"+(r?\".clear\":\"\"),{className:u},[l?e(k,{label:l||\"\",id:i,isMandatory:m}):void 0,e(\".switch\",h,e(\"label\",[o||\"Off\",e(`input[id=${i}][type=checkbox]${d({disabled:s})}${p?\"[checked]\":\"\"}`,{onclick:c?e=>{e.target&&void 0!==e.target.checked&&c(e.target.checked)}:void 0}),e(\"span.lever\"),n||\"On\"]))])}}},je=()=>{const t={},a=(e,t)=>t||e.replace(/ /g,\"\").toLowerCase();return{view:({attrs:{tabWidth:i,selectedTabId:l,tabs:o,className:n,style:s,duration:r,onShow:c,swipeable:d,responsiveThreshold:p}})=>{const m=o.filter(e=>e.active).shift(),u=l||(m?a(m.title,m.id):\"\");return e(\".row\",[e(\".col.s12\",e(\"ul.tabs\"+(\"fill\"===i?\".tabs-fixed-width\":\"\"),{className:n,style:s,oncreate:({dom:e})=>{t.instance=M.Tabs.init(e,{duration:r,onShow:c,responsiveThreshold:p,swipeable:d})},onupdate:()=>{if(u){const e=document.getElementById(`tab_${u}`);e&&e.click()}},onremove:()=>t.instance.destroy()},o.map(({className:t,title:l,id:n,active:s,disabled:r,target:c,href:d})=>e(`li.tab${r?\".disabled\":\"\"}${\"fixed\"===i?`.col.s${Math.floor(12/o.length)}`:\"\"}`,{className:t},e(`a[id=tab_${a(l,n)}]${s?\".active\":\"\"}`,{target:c,href:d||`#${a(l,n)}`},l))))),o.filter(({href:e})=>void 0===e).map(({id:t,title:i,vnode:l,contentClass:o})=>e(`.col.s12[id=${a(i,t)}]`,{className:o},l))])}}},Le=()=>({view:({attrs:{id:t,title:a,datetime:i,active:l,content:o,iconName:n,dateFormatter:s,timeFormatter:r,onSelect:c}})=>e(`li${l?\".active\":\"\"}${t?`[id=${t}]`:\"\"}`,{onclick:c?()=>c({id:t,title:a,datetime:i,active:l,content:o}):void 0,style:c?\"cursor: pointer;\":void 0},[e(\".mm_time\",{datetime:i},[e(\"span\",s(i)),e(\"span\",r(i))]),n?e(\".mm_icon\",e(\"i.material-icons\",n)):void 0,e(\".mm_label\",[a?\"string\"==typeof a?e(\"h5\",a):a:void 0,o?\"string\"==typeof o?e(\"p\",o):o:void 0])])}),Ee=()=>{const t=e=>`${e.getUTCDate()}/${e.getUTCMonth()+1}/${e.getUTCFullYear()}`,a=e=>`${v(e.getUTCHours())}:${v(e.getUTCMinutes())}`;return{view:({attrs:{items:i,onSelect:l,timeFormatter:o=a,dateFormatter:n=t}})=>e(\"ul.mm_timeline\",i.map(t=>e(Le,g({onSelect:l,dateFormatter:n,timeFormatter:o},t))))}};export{Q as AnchorItem,$ as Autocomplete,V as Button,T as ButtonFactory,F as Carousel,E as CarouselItem,D as Chips,K as CodeBlock,B as Collapsible,_ as CollapsibleItem,ee as Collection,H as CollectionMode,ue as ColorInput,Ie as DatePicker,ae as Dropdown,ve as EmailInput,be as FileInput,R as FlatButton,le as FloatingActionButton,N as HelperText,I as Icon,ye as InputCheckbox,k as Label,S as LargeButton,G as ListItem,w as Mandatory,fe as MapEditor,xe as MaterialBox,we as ModalPanel,pe as NumberInput,ge as Options,Ne as Pagination,$e as Parallax,de as PasswordInput,Te as RadioButton,Ve as RadioButtons,he as RangeInput,j as RoundIconButton,Y as SecondaryContent,Se as Select,O as SmallButton,L as SubmitButton,Re as Switch,je as Tabs,se as TextArea,ce as TextInput,Ae as TimePicker,Ee as Timeline,me as UrlInput,n as camelToSnake,i as compose,d as disable,u as isNumeric,o as join,l as map,y as move,v as padLeft,h as pipe,p as req,b as swap,s as toAttributeString,m as toAttrs,t as uniqueId,a as uuid4};\n//# sourceMappingURL=index.modern.js.map\n","import e from\"mithril\";import{render as t}from\"slimdown-js\";export*from\"slimdown-js\";const a=()=>\"idxxxxxxxx\".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),i=[\"min\",\"max\",\"minLength\",\"maxLength\",\"rows\",\"cols\",\"placeholder\",\"autocomplete\",\"pattern\",\"readOnly\",\"step\"],n=e=>i.indexOf(e)>=0,o=({disabled:e})=>e?\"[disabled]\":\"\",l=e=>(e=>{const t=(a=e,e=>void 0!==a[e]);var a;return Object.keys(e).filter(n).filter(t).reduce((t,a)=>{const i=e[a];return t.push(`[${a.toLowerCase()}=${i}]`),t},[]).join(\"\")})(e)+(e=>e.maxLength?`[data-length=${e.maxLength}]`:\"\")(e)+o(e)+(({required:e,isMandatory:t})=>e||t?\"[required][aria-required=true]\":\"\")(e)+(({autofocus:e})=>\"boolean\"==typeof e&&e||e&&e()?\"[autofocus]\":\"\")(e),r=e=>!isNaN(parseFloat(e))&&isFinite(e);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(n[a]=e[a]);return n}const d=[\"label\",\"id\",\"isMandatory\",\"isActive\"],p={view:({attrs:t})=>e(\"span.mandatory\",t,\"*\")},u=()=>({view:t=>{let{attrs:{label:a,id:i,isMandatory:n,isActive:o}}=t,l=c(t.attrs,d);return a?e(`label${o?\".active\":\"\"}${i?`[for=${i}]`:\"\"}`,l,[e.trust(a),n?e(p):void 0]):void 0}}),m=()=>({view:({attrs:{helperText:t,dataError:a,dataSuccess:i,className:n}})=>t||a||i?e(\"span.helper-text\",{className:n,dataError:a,dataSuccess:i},t?e.trust(t):\"\"):void 0}),h=()=>{const t={id:a()};return{view:({attrs:a})=>{const i=a.id||t.id,n=l(a),{label:o,helperText:r,initialValue:s,onchange:c,newRow:d,className:p=\"col s12\",style:h,iconName:f,isMandatory:g}=a;return e(\".input-field\"+(d?\".clear\":\"\"),{className:d?p+\" clear\":p,style:h},[f?e(\"i.material-icons.prefix\",f):\"\",e(`input.autocomplete[type=text][tabindex=0]${n}`,{id:i,oncreate:({dom:e})=>{M.Autocomplete.init(e,a)},onchange:c?e=>{e.target&&e.target.value&&c(e.target.value)}:void 0,value:s}),e(u,{label:o,id:i,isMandatory:g,isActive:s}),e(m,{helperText:r})])}}},f=[\"iconName\"],g=()=>({view:t=>{let{attrs:{iconName:a}}=t,i=c(t.attrs,f);return e(\"i.material-icons\",i,a)}}),b=[\"modalId\",\"tooltip\",\"tooltipPostion\",\"iconName\",\"iconClass\",\"label\",\"attr\"],y=(t,a=\"\")=>()=>{const i=`${t}${a}`;return{view:({attrs:t})=>{const{modalId:a,tooltip:n,tooltipPostion:o,iconName:l,iconClass:r,label:s,attr:d}=t,p=c(t,b);return e(`${i}${a?`.modal-trigger[href=#${a}]`:\"\"}${n?`.tooltipped[data-position=${o||\"top\"}][data-tooltip=${n}]`:\"\"}${(e=>e?((...e)=>t=>e.reduceRight((e,t)=>t(e),t))(e=>Array.prototype.join.call(e,\"\"),(e=>t=>Array.prototype.map.call(t,e))(t=>`[${(e=>e.replace(/([A-Z])/g,e=>\"-\"+e.toLowerCase()))(t)}=\"${((e=\"\")=>e.toString().replace(/\"/g,\""\"))(e[t])}\"]`),Object.keys)(e):\"\")(d)}`,p,l?e(g,{iconName:l,className:r||\"left\"}):void 0,s||void 0)}}},v=y(\"a.waves-effect.waves-teal.btn-flat\",\"[type=button]\"),w=y(\"button.btn-floating.btn-large.waves-effect.waves-light\",\"[type=button]\"),x=()=>({oncreate:({attrs:e,dom:t})=>{const{onchange:a,onChipAdd:i,onChipDelete:n}=e,o=M.Chips.getInstance(t.children[0]),l=i?i.bind(o):void 0;e.onChipAdd=function(e,t){a&&a(this.chipsData),l&&l(e,t)};const r=n?n.bind(o):void 0;e.onChipDelete=function(e,t){a&&a(this.chipsData),r&&r(e,t)},M.Chips.init(t.children[0],e)},onupdate:({dom:e,attrs:{data:t}})=>{if(!t||0===t.length)return;const a=M.Chips.getInstance(e.children[0]);t.forEach(e=>a.addChip(e))},view:({attrs:{placeholder:t,required:a,isMandatory:i=a,data:n,className:o=\"col s12\",label:l,helperText:r}})=>e(\".input-field\",{className:o},[e(`.chips.chips-autocomplete${t?\".chips-placeholder\":\"\"}${n?\".chips-initial\":\"\"}`),l?e(u,{label:l,isMandatory:i,className:\"active\"}):void 0,r?e(m,{helperText:r}):void 0])}),k=()=>({view:({attrs:{header:t,body:a,active:i,iconName:n}})=>e(i?\"li.active\":\"li\",[t||n?e(\".collapsible-header\",[n?e(\"i.material-icons\",n):void 0,t?\"string\"==typeof t?e(\"span\",t):t:void 0]):void 0,a?e(\".collapsible-body\",a):void 0])}),N=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:t})=>{const{items:a,class:i,className:n,style:o,id:l}=t;return a&&a.length>0?e(\"ul.collapsible\",{class:i||n,style:o,id:l},a.map(t=>e(k,t))):void 0}});var $;!function(e){e[e.BASIC=0]=\"BASIC\",e[e.LINKS=1]=\"LINKS\",e[e.AVATAR=2]=\"AVATAR\"}($||($={}));const I=[\"className\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\"],O=[\"className\",\"dataError\",\"dataSuccess\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"maxLength\",\"newRow\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\",\"validate\"],A=()=>{const t={id:a()};return{view:({attrs:a})=>{const{className:i=\"col s12\",helperText:n,iconName:o,id:r=t.id,initialValue:s,isMandatory:d,label:p,onchange:h,onkeydown:f,onkeypress:g,onkeyup:b,onblur:y,style:v}=a,w=c(a,I),x=l(w);return e(\".input-field\",{className:i,style:v},[o?e(\"i.material-icons.prefix\",o):\"\",e(`textarea.materialize-textarea[tabindex=0][id=${r}]${x}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),a.maxLength&&M.CharacterCounter.init(e)},onchange:h?e=>{const t=e.target;h(t&&\"string\"==typeof t.value?t.value:\"\")}:void 0,value:s,onkeyup:b?e=>{b(e,e.target.value)}:void 0,onkeydown:f?e=>{f(e,e.target.value)}:void 0,onkeypress:g?e=>{g(e,e.target.value)}:void 0,onblur:y}),e(u,{label:p,id:r,isMandatory:d,isActive:s||a.placeholder}),e(m,{helperText:n})])}}},D=(t,i=\"\")=>()=>{const n={id:a()},o=e=>{const a=e.value;return!a||\"number\"!==t&&\"range\"!==t?a:+a},r=(e,t)=>{e.setCustomValidity(\"boolean\"==typeof t?t?\"\":\"Custom validation failed\":t)};return{view:({attrs:a})=>{const{className:s=\"col s12\",dataError:d,dataSuccess:p,helperText:h,iconName:f,id:g=n.id,initialValue:b,isMandatory:y,label:v,maxLength:w,newRow:x,onchange:k,onkeydown:N,onkeypress:$,onkeyup:I,onblur:A,style:D,validate:S}=a,T=c(a,O),C=l(T);return e(`.input-field${x?\".clear\":\"\"}${i}`,{className:s,style:D},[f?e(\"i.material-icons.prefix\",f):void 0,e(`input.validate[type=${t}][tabindex=0][id=${g}]${C}`,{oncreate:({dom:e})=>{(({autofocus:e})=>!!e&&(\"boolean\"==typeof e?e:e()))(a)&&e.focus(),w&&M.CharacterCounter.init(e),\"range\"===t&&M.Range.init(e)},onkeyup:I?e=>{I(e,o(e.target))}:void 0,onkeydown:N?e=>{N(e,o(e.target))}:void 0,onkeypress:$?e=>{$(e,o(e.target))}:void 0,onblur:A,onupdate:S?({dom:e})=>{const t=e;r(t,S(o(t),t))}:void 0,onchange:e=>{const t=e.target;if(t){const e=o(t);k&&k(e),S&&r(t,S(e,t))}},value:b}),e(u,{label:v,id:g,isMandatory:y,isActive:!(void 0===b&&!a.placeholder&&\"number\"!==t&&\"color\"!==t&&\"range\"!==t)}),e(m,{helperText:h,dataError:d,dataSuccess:p})])}}},S=D(\"text\"),T=D(\"number\"),C=D(\"url\"),V=D(\"color\"),j=D(\"email\"),L=()=>{let t,a=!1;return{view:({attrs:i})=>{const{multiple:n,disabled:o,initialValue:l,placeholder:r,onchange:s,className:c=\"col s12\",accept:d,label:p=\"File\"}=i,u=d?d instanceof Array?d.join(\", \"):d:void 0,m=u?`[accept=${u}]`:\"\",h=n?\"[multiple]\":\"\",f=o?\"[disabled]\":\"\",g=r?`[placeholder=${r}]`:\"\";return e(\".file-field.input-field\",{className:i.class||c},[e(\".btn\",[e(\"span\",p),e(`input[type=file]${h}${f}${m}`,{onchange:s?e=>{const t=e.target;t&&t.files&&s&&(a=!0,s(t.files))}:void 0})]),e(\".file-path-wrapper\",e(`input.file-path.validate${g}[type=text]`,{oncreate:({dom:e})=>{t=e,l&&(t.value=l)}})),(a||l)&&e(\"a.waves-effect.waves-teal.btn-flat\",{style:\"float: right;position: relative;top: -3rem; padding: 0\",onclick:()=>{a=!1,t.value=\"\",s&&s({})}},e(\"i.material-icons\",\"clear\"))])}}},P=()=>({view:({attrs:{className:t=\"col s12\",onchange:a,label:i,checked:n,disabled:o,description:l}})=>e(\"div\",{className:t},e(\"label\",[e(\"input[type=checkbox][tabindex=0]\",{checked:n,disabled:o,onclick:a?e=>{e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),i?\"string\"==typeof i?e(\"span\",i):i:void 0]),l&&e(m,{className:\"input-checkbox-desc\",helperText:l}))}),R=()=>{const t={},a=e=>t.checkedIds.indexOf(e)>=0;return{oninit:({attrs:{initialValue:e,checkedId:a}})=>{const i=a||e;t.checkedId=a,t.checkedIds=i?i instanceof Array?[...i]:[i]:[]},view:({attrs:{label:i,id:n,options:o,checkedId:l,description:r,className:s=\"col s12\",disabled:c,checkboxClass:d,newRow:p,isMandatory:h,onchange:f}})=>{l&&t.checkedId!==l&&(t.checkedId=l,t.checkedIds=l instanceof Array?l:[l]);const g=f?(e,a)=>{const i=t.checkedIds.filter(t=>t!==e);a&&i.push(e),t.checkedIds=i,f(i)}:void 0;return e(\"div\"+(p?\".clear\":\"\"),{className:s},[e(\"div\",{className:\"input-field options\"},e(u,{id:n,label:i,isMandatory:h})),e(m,{helperText:r}),...o.map(t=>e(P,{disabled:c||t.disabled,label:t.label,onchange:g?e=>g(t.id,e):void 0,className:t.className||d,checked:a(t.id),description:t.description}))])}}},E=()=>({oncreate:({dom:e,attrs:{options:t,onCreate:a}})=>{const i=M.Modal.init(e,t);a&&a(i)},view:({attrs:{id:t,title:a,description:i,fixedFooter:n,bottomSheet:o,buttons:l,richContent:r}})=>e(`.modal${n?\".modal-fixed-footer\":\"\"}${o?\".bottom-sheet\":\"\"}[id=${t}]`,[e(\".modal-content\",[e(\"h4\",a),r&&\"string\"==typeof i?e.trust(i||\"\"):\"string\"==typeof i?e(\"p\",i):i]),l?e(\".modal-footer\",l.map(t=>e(v,s({},t,{className:\"modal-close\"})))):void 0])}),F=()=>({view:({attrs:{title:t,href:a,active:i,disabled:n}})=>e(\"li\",{className:i?\"active\":n?\"disabled\":\"waves-effect\"},\"number\"==typeof t?e(e.route.Link,{href:a},t):t)}),_=()=>{const t={pagIndex:0};return{view:({attrs:{items:a,curPage:i=1,size:n=Math.min(9,a.length)}})=>{const{pagIndex:o}=t,l=o*n,r=l+n,c=o>0,d=rc&&t.pagIndex--},e(\"i.material-icons\",\"chevron_left\")),disabled:!c},...a.filter((e,t)=>l<=t&&td&&t.pagIndex++},e(\"i.material-icons\",\"chevron_right\")),disabled:!d}];return e(\"ul.pagination\",p.map((t,a)=>e(F,s({title:l+a},t,{active:l+a===i}))))}}},H=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],U=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],q=()=>{const t={id:a()};return{view:a=>{let{attrs:{label:i,helperText:n,initialValue:o,newRow:r,className:d=\"col s12\",iconName:p,isMandatory:h,onchange:f,disabled:g}}=a,b=c(a.attrs,H);const y=t.id,v=l(b),w=f?()=>t.dp&&f(t.dp.date):void 0;return e(\".input-field\"+(r?\".clear\":\"\"),{className:d,onremove:()=>t.dp&&t.dp.destroy()},[p?e(\"i.material-icons.prefix\",p):\"\",e(`input.datepicker[type=text][tabindex=0][id=${y}]${v}${g?\"[disabled]\":\"\"}`,{oncreate:({dom:e})=>{t.dp=M.Datepicker.init(e,s({format:\"yyyy/mm/dd\",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},b,{onClose:w}))}}),e(u,{label:i,id:y,isMandatory:h,isActive:!!o}),e(m,{helperText:n})])}}},B=()=>{const t={id:a()};return{view:a=>{let{attrs:{label:i,helperText:n,initialValue:o,newRow:r,className:d=\"col s12\",iconName:p,isMandatory:h,onchange:f,disabled:g}}=a,b=c(a.attrs,U);const y=t.id,v=l(b),w=r?\".clear\":\"\",x=new Date,k=f?()=>t.tp&&f(t.tp.time||o||`${x.getHours()}:${x.getMinutes()}`):void 0;return e(`.input-field.timepicker${w}`,{className:d,onremove:()=>t.tp&&t.tp.destroy()},[p?e(\"i.material-icons.prefix\",p):\"\",e(`input[type=text][tabindex=0][id=${y}]${v}${g?\"[disabled]\":\"\"}`,{value:o,oncreate:({dom:e})=>{t.tp=M.Timepicker.init(e,s({twelveHour:!1,showClearBtn:!0,defaultTime:o},b,{onCloseEnd:k}))}}),e(u,{label:i,id:y,isMandatory:h,isActive:o}),e(m,{helperText:n})])}}},J=()=>({view:({attrs:{id:t,groupId:a,label:i,onchange:n,className:o=\"col s12\",checked:l,disabled:r}})=>e(\"div\",{className:o},e(\"label\",[e(`input[type=radio][tabindex=0][name=${a}]${l?\"[checked=checked]\":\"\"}${r?\"[disabled]\":\"\"}`,{onclick:n?()=>n(t):void 0}),e(\"span\",e.trust(i))]))}),z=()=>{const t={groupId:a()};return{oninit:({attrs:{checkedId:e,initialValue:a}})=>{t.oldCheckedId=e,t.checkedId=e||a},view:({attrs:{id:a,checkedId:i,newRow:n,className:o=\"col s12\",label:l=\"\",disabled:r,description:c,options:d,isMandatory:p,checkboxClass:m,onchange:h}})=>{t.oldCheckedId!==i&&(t.oldCheckedId=t.checkedId=i);const{groupId:f,checkedId:g}=t,b=e=>{t.checkedId=e,h&&h(e)};return n&&(o+=\" clear\"),e(\"div\",{id:a,className:o},[e(\"div\",{className:\"input-field options\"},e(u,{id:a,label:l,isMandatory:p})),c?e(\"p.helper-text\",e.trust(c)):\"\",...d.map(t=>e(J,s({},t,{onchange:b,groupId:f,disabled:r,className:m,checked:t.id===g})))])}}},W=()=>{const t={},a=e=>e.map(e=>e.id).join(\"\"),i=(e,t,a=!1)=>a||(t instanceof Array&&(e||\"number\"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:e,initialValue:i,options:n}})=>{t.ids=a(n);const o=e||i;t.checkedId=e instanceof Array?[...e]:e,t.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:n,newRow:o,className:l=\"col s12\",checkedId:s,key:c,options:d,multiple:p,label:h,helperText:f,placeholder:g=\"\",isMandatory:b,iconName:y,disabled:v,classes:w=\"\",dropdownOptions:x,onchange:k}})=>{t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);const{initialValue:N}=t,$=k?p?()=>{const e=t.instance&&t.instance.getSelectedValues(),a=e?e.length>0&&r(e[0])?e.map(e=>+e):e.filter(e=>null!==e||void 0!==e):void 0;t.initialValue=a||[],k(t.initialValue)}:e=>{if(e&&e.currentTarget){const a=e.currentTarget,i=r(a.value)?+a.value:a.value;t.initialValue=void 0!==typeof i?[i]:[]}t.initialValue&&k(t.initialValue)}:void 0;o&&(l+=\" clear\");const I=!d.some(e=>i(e.id,N)),O=d.reduce((e,t)=>(t.group&&e.indexOf(t.group)<0&&e.push(t.group),e),[]);return e(\".input-field.select-space\",{className:l,key:c,oncreate:p?({dom:e})=>t.wrapper=e:void 0},[y&&e(\"i.material-icons.prefix\",y),e(\"select\",{id:n,title:h,disabled:v,multiple:p,oncreate:({dom:e})=>{t.instance=M.FormSelect.init(e,{classes:w,dropdownOptions:x})},onupdate:({dom:e})=>{if(p){const e=y?1:0;!t.inputEl&&t.wrapper&&t.wrapper.childNodes&&t.wrapper.childNodes.length>0&&t.wrapper.childNodes[e].childNodes&&t.wrapper.childNodes[e].childNodes[0]&&(t.inputEl=t.wrapper.childNodes[e].childNodes[0]),t.inputEl&&t.inputEl.value&&t.inputEl.value.startsWith(`${g}, `)&&(t.inputEl.value=t.inputEl.value.replace(`${g}, `,\"\"))}const i=a(d);let n=s&&t.checkedId!==s.toString();t.ids!==i&&(t.ids=i,n=!0),(t.checkedId instanceof Array&&s instanceof Array?t.checkedId.join()!==s.join():t.checkedId!==s)&&(t.checkedId=s,n=!0),n&&(t.instance=M.FormSelect.init(e,{classes:w,dropdownOptions:x}))},onchange:$},e(\"option\",{value:\"\",disabled:!0,selected:!!I||void 0},g),0===O.length?d.map((t,a)=>{var n;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,N,0===a&&I&&!g)},null==(n=t.label)?void 0:n.replace(\"&\",\"&\"))}):O.map(t=>e(\"optgroup\",{label:t},d.filter(e=>e.group===t).map((t,a)=>{var n;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,N,0===a&&I&&!g)},null==(n=t.label)?void 0:n.replace(\"&\",\"&\"))})))),e(u,{label:h,isMandatory:b}),f&&e(m,{helperText:f})])}}},K=[\"label\",\"left\",\"right\",\"disabled\",\"newRow\",\"onchange\",\"checked\",\"isMandatory\",\"className\"],Y=()=>{const t={id:a()};return{view:({attrs:a})=>{const i=a.id||t.id,{label:n,left:l,right:r,disabled:s,newRow:d,onchange:p,checked:m,isMandatory:h,className:f=\"col s12\"}=a,g=c(a,K);return e(\"div\"+(d?\".clear\":\"\"),{className:f},[n?e(u,{label:n||\"\",id:i,isMandatory:h}):void 0,e(\".switch\",g,e(\"label\",[l||\"Off\",e(`input[id=${i}][type=checkbox]${o({disabled:s})}${m?\"[checked]\":\"\"}`,{onclick:p?e=>{e.target&&void 0!==e.target.checked&&p(e.target.checked)}:void 0}),e(\"span.lever\"),r||\"On\"]))])}}},Z=()=>{const t={},a=(e,t)=>t||e.replace(/ /g,\"\").toLowerCase();return{view:({attrs:{tabWidth:i,selectedTabId:n,tabs:o,className:l,style:r,duration:s,onShow:c,swipeable:d,responsiveThreshold:p}})=>{const u=o.filter(e=>e.active).shift(),m=n||(u?a(u.title,u.id):\"\");return e(\".row\",[e(\".col.s12\",e(\"ul.tabs\"+(\"fill\"===i?\".tabs-fixed-width\":\"\"),{className:l,style:r,oncreate:({dom:e})=>{t.instance=M.Tabs.init(e,{duration:s,onShow:c,responsiveThreshold:p,swipeable:d})},onupdate:()=>{if(m){const e=document.getElementById(`tab_${m}`);e&&e.click()}},onremove:()=>t.instance.destroy()},o.map(({className:t,title:n,id:l,active:r,disabled:s,target:c,href:d})=>e(`li.tab${s?\".disabled\":\"\"}${\"fixed\"===i?`.col.s${Math.floor(12/o.length)}`:\"\"}`,{className:t},e(`a[id=tab_${a(n,l)}]${r?\".active\":\"\"}`,{target:c,href:d||`#${a(n,l)}`},n))))),o.filter(({href:e})=>void 0===e).map(({id:t,title:i,vnode:n,contentClass:o})=>e(`.col.s12[id=${a(i,t)}]`,{className:o},n))])}}},G=e=>e.charAt(0).toUpperCase()+e.slice(1),Q=e=>\"string\"==typeof e,X=(e,t=2,a=\"0\")=>e.toString().length>=t?e.toString():X(a+e,t,a),ee=e=>e?`${X(e.getHours())}:${X(e.getMinutes())}`:\"00:00\",te=(e,t)=>{const a=(t=(t=t.replace(/\\[(\\w+)\\]/g,\".$1\")).replace(/^\\./,\"\")).split(\".\");let i={...e};for(let t=0,n=a.length;te[o]===t).shift();if(!l)return;i=l}}}return i},ae=e=>e.reduce((e,t)=>t instanceof Array?[...e,...t]:[...e,t],[]),ie=/([^ =><]*)\\s*([=><]*)\\s*(\\S*)/i,ne=/^\\s*!\\s*/,oe=/===?|[^<>=]/i,le=function(e){var t=[].slice.call(arguments,1);return 0===e.length||(e instanceof Array?e:[e]).some(e=>((e,t)=>e.split(\"&\").reduce((e,a)=>{const i=ne.test(a),n=i?a.replace(ne,\"\"):a;return e=e&&t.filter(Boolean).reduce((e,t)=>e||((e,t)=>{if(!t||0===Object.keys(t).length)return!1;const a=ie.exec(e);if(a){const[e,i,n,o]=a,l=te(t,i.trim());if(void 0===l||\"string\"==typeof l&&0===l.length)return!1;if(!n||!o)return!0;{const t=isNaN(+o)?\"true\"===o||\"false\"!==o&&o:+o;switch(n){case\"=\":case\"==\":case\"===\":return l instanceof Array?l.indexOf(t)>=0:l===t;case\"<=\":return l<=t;case\">=\":return l>=t;case\"<\":return l\":return l>t;default:return console.error(`Unrecognized operand (${n}) in expression: ${e}`),!1}}}return!0})(n.trim(),t),!1),i?!e:e},!0))(e,oe.test(e)?[t[0]]:ae(t)))},re=(e,t)=>te(t.filter(Boolean).reduceRight((e,t)=>({...t,...e})),e.trim()),se=(e,t)=>void 0!==re(e,t),ce=/{{\\s*([^\\s\"'`:]*):?([^\\s]*)\\s*}}/g,de=function(e){if(!ce.test(e))return!0;let t;ce.lastIndex=0;let a=!0;do{t=ce.exec(e),t&&(t.index===ce.lastIndex&&ce.lastIndex++,t.forEach((e,t,[,i])=>{a=a&&se(i,[].slice.call(arguments,1))}))}while(a&&null!==t);return a},pe=(e,t)=>{if(void 0===e)return\"\";if(e instanceof Array)return e.map(e=>pe(e,t)).join(\", \");if(!t)return e.toString();if(\"boolean\"==typeof e){const a=t.indexOf(\":\");return e?t.substring(0,a):t.substring(a+1)}switch(t){default:return e.toString();case\"date\":return new Date(e).toLocaleDateString();case\"time\":return new Date(e).toLocaleTimeString();case\"iso\":return new Date(e).toISOString();case\"utc\":return new Date(e).toUTCString()}},ue=function(e){if(!ce.test(e))return e;let t;ce.lastIndex=0;do{t=ce.exec(e),t&&(t.index===ce.lastIndex&&ce.lastIndex++,t.forEach((t,a,[i,n,o])=>{const l=re(n,[].slice.call(arguments,1));!l||l instanceof Array||(e=e.replace(i,pe(l,o)))}))}while(null!==t);return e},me=e=>{if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){const t=[];return e.forEach(e=>{t.push(e)}),t.map(e=>me(e))}if(\"object\"==typeof e){const t={...e};return Object.keys(t).forEach(e=>{t[e]=me(t[e])}),t}return e},he=e=>{const t=(e,a=\"\")=>{const i=e.filter(e=>\"section\"!==e.type&&\"md\"!==e.type).reduce((e,i)=>{const n=(a?`${a}.`:\"\")+String(i.id),o=i.type||(i.options&&i.options.length>0?\"select\":\"text\");return\"string\"==typeof o?e[n]=i:e={...e,...t(o,n)},e},{});return i},a=t(e),i=(e,t)=>{if(!a.hasOwnProperty(e)||void 0===t)return t;const i=a[e],n=t instanceof Array?t.filter(e=>null!=e):[t];switch(i.type||(i.options?\"options\":\"none\")){default:return t;case\"radio\":case\"select\":case\"options\":const e=\"string\"==typeof i.options?re(i.options,[a]):i.options;return n.map(t=>e.filter(e=>e.id===t).map(e=>e.label||G(e.id)).shift()).filter(e=>void 0!==e)}},n=(e,t=\"\")=>{if(e&&(\"object\"!=typeof e||0!==Object.keys(e).length)){if(e instanceof Array)return e.map(e=>n(e,t));{const a={};return Object.keys(e).forEach(o=>{const l=t?`${t}.${o}`:o,r=e[o];if(\"boolean\"==typeof r)a[o]=r;else if(\"number\"==typeof r||\"string\"==typeof r){const e=i(l,r);e&&(a[o]=e instanceof Array&&1===e.length?e[0]:e)}else if(r instanceof Array)if(\"string\"==typeof r[0]||null===r[0]){const e=i(l,r);e&&(a[o]=e)}else a[o]=n(r,o);else\"object\"==typeof r&&(a[o]=r)}),a}}};return n},fe=(e=\"\")=>e.replace(/\\s|,|\\./g,\"\").toLowerCase(),ge=(e,t,a=1)=>{const i=[];for(let n=e;n<=t;n+=a)i.push(n);return i},be=e=>{\"string\"!=typeof e&&(e=JSON.stringify(e));let t=0;if(0===e.length)return t;for(var a=0;a{const i=Object.assign({},t,a);return`${e}?${Object.keys(i).map(e=>`${e}=${i[e]}`).join(\"&\")}`},ve=()=>({view:({attrs:{md:a=\"\",removeParagraphs:i=!1,externalLinks:n=!1,...o}})=>e(\".slimdown-view.markdown\",o,e.trust(t(a,i,n)))}),we=()=>({view:({attrs:{type:t,props:a,label:i=\"\",initialValue:n,inline:o=!1}})=>{const l={className:a.className||\"col s12\"};if(n instanceof Array&&n.length>3)return e(\".readonly\",l,[e(\"label\",i),e(ve,{md:\"\\n- \"+n.join(\"\\n- \")})]);if(\"string\"==typeof n)return e(\".readonly\",l,\"url\"===t?[e(\"label\",`${i.trim()}: `),e(\"a[target=_blank]\",{href:n},n)]:\"color\"===t?[e(\"label\",`${i.trim()}: `),e(\".color\",{style:`height: 1rem; width: 40px; border-radius: 4px; background-color: ${n}`})]:[e(\"label\",i),e(ve,{md:n})]);const r=n instanceof Array?n.join(\", \"):n;return e(\".readonly\",l,[i&&e(\"label\",i),o?e(\"span\",r?`: ${r}`:e.trust(\" \")):e(\"p\",r||e.trust(\" \"))])}}),xe=(i={},n={})=>()=>{const o={key:Date.now()};return{view:({attrs:{i18n:l,field:r,obj:s,autofocus:c,onchange:d,context:p=[],containerId:u,disabled:m,readonly:f}})=>{const{id:g=\"\",type:b,disabled:y=m,readonly:w=f,value:k,required:N,autogenerate:$,show:I,label:O,description:D,i18n:M=l||{},checkAllOptions:E,transform:F,effect:_,onkeyup:H,onkeydown:U,onblur:J}=r;if(I&&!le(I,s,p)||O&&!de(O,s,p)||D&&!de(D,s,p))return;const K=\"string\"==typeof r.options?re(r.options,[s,...p]):r.options,Z=K&&K instanceof Array?K.filter(e=>void 0!==e.id&&(e.label||!/[0-9]/.test(e.id))&&(!e.show||le(e.show,s,p))).map(e=>e.label?e:{...e,label:G(e.id)}):[],Q=\"boolean\"==typeof m&&m,X=((e,i=!1,n=!1)=>{const{id:o=\"\",label:l,description:r,required:s,multiple:c,className:d,checkboxClass:p,icon:u,iconClass:m,placeholder:h,maxLength:f,minLength:g,max:b,min:y,step:v,dateTimeOutput:w,dateTimeSeconds:x,dateFormat:k,twelveHour:N}=e,$={id:`mui_${String(o)}-${a()}`,label:l};return void 0===l&&o&&($.label=G(String(o))),r&&($.helperText=t(r,!0)),d&&($.className=d),u&&($.iconName=u),m&&($.iconClass=m),p&&($.checkboxClass=p),h&&($.placeholder=h),s&&($.isMandatory=!0),c&&($.multiple=c),n&&($.disabled=!0),i&&($.autofocus=!0),void 0!==f&&($.maxLength=f),void 0!==g&&($.minLength=g),void 0!==b&&($.max=b),void 0!==y&&($.min=y),void 0!==v&&($.step=v),w&&($.dateTimeOutput=w),x&&($.dateTimeSeconds=x),k&&($.dateFormat=k),N&&($.twelveHour=N),$})(r,c,\"boolean\"==typeof y||void 0===y?Q||y:Q||le(y,s,p));O&&(X.label=t(ue(X.label||O,s,p),!0)),D&&(X.description=t(ue(X.description||D,s,p),!0));const te=N?e=>e instanceof Array?e&&e.length>0:void 0!==typeof e:void 0;if(s instanceof Array)return void console.warn(\"Only a repeat list can deal with arrays!\");const ae=function(e){try{return void 0===e||\"undefined\"===e?(delete s[g],d(s),Promise.resolve()):(s[g]=F?F(\"to\",e):e,_?Promise.resolve(_(s,s[g],p)).then(function(e){d(void 0!==e?e:s)}):Promise.resolve(d(s)))}catch(e){return Promise.reject(e)}};if(b instanceof Array)return g?(s.hasOwnProperty(g)||(s[g]={}),e(\".muf-form\",{className:r.className},[e(\".muf-form-header\",e.trust(t(X.label||G(String(g)),!0))),X.description&&e(\"div\",e.trust(t(X.description))),e(\".row\",e(De,{...X,i18n:M,readonly:w,form:b,obj:s[g],context:p instanceof Array?[s,...p]:[s,p],onchange:()=>d&&d(s),containerId:u}))])):void console.warn(\"Missing ID for type \"+JSON.stringify(b));$&&!s[g]&&(s[g]=\"guid\"===$?\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return(\"x\"===e?t:3&t|8).toString(16)}):\"id\"===$?a():Date.now());const ie=s.hasOwnProperty(g)&&void 0!==s[g]?F?F(\"from\",s[g]):s[g]:k;g&&void 0!==k&&void 0!==ie&&(s[g]=F?F(\"to\",ie):ie);const[ne,oe]=E?E.split(\"|\"):[\"\",\"\"];if(w&&b&&[\"md\",\"none\"].indexOf(b)<0){if(n.hasOwnProperty(b))return e(n[b],{iv:ie,field:r,props:X,label:X.label,obj:s,context:p});if(b&&i.hasOwnProperty(b))return e(i[b],{iv:ie,field:r,props:X,label:X.label,onchange:ae,obj:s,context:p});switch(b){case\"time\":{const t=M.dateTimeOptions?{hour:\"2-digit\",minute:\"2-digit\",second:void 0,...M.dateTimeOptions,weekday:void 0,month:void 0,day:void 0,year:void 0}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleTimeString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"date\":{const t=M.dateTimeOptions?{...M.dateTimeOptions,hour:void 0,hour12:void 0,minute:void 0,second:void 0}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleDateString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"datetime\":{const t=M.dateTimeOptions?{hour:\"2-digit\",minute:\"2-digit\",month:\"numeric\",day:\"numeric\",...M.dateTimeOptions}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleTimeString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"switch\":case\"checkbox\":return e(we,{props:X,label:X.label,initialValue:ie?\"✔\":\"✘\",inline:!0});case\"tags\":return e(we,{props:X,label:X.label,initialValue:ie||[]});case\"options\":case\"select\":{const t=void 0!==ie?ie instanceof Array?ie:[ie]:[],a=Z.filter(e=>t.indexOf(e.id)>=0),i=a&&0===a.length?\"?\":1===a.length?a[0].label:a.map(e=>e.label);return e(we,{props:X,label:X.label,initialValue:i})}case\"radio\":{const t=ie,a=Z.filter(e=>e.id===t);return e(we,{props:X,label:X.label,initialValue:a&&a.length?a[0].label:\"?\"})}case\"base64\":{const t=ie;return!(!t||!/data:image/i.test(t))&&e(\"div\",e(\"img.responsive-img\",{src:t,alt:s.title||s.alt||s.name||\"\",style:`max-height: ${r.max||50}px`}))}case\"file\":return e(\"div\",X,(ie instanceof Array?ie:[ie]).map((t=\"\")=>{const a=/data:image|.jpg$|.jpeg$|.png$|.gif$|.svg$|.bmp$|.tif$|.tiff$/i.test(t),i=`${new URL(r.url).origin}${t}`;return e(\"a[target=_blank]\",{href:i},a?e(\"img\",{src:i,alt:i,style:`max-height: ${r.max||50}`}):e(we,{props:X,label:r.placeholder||\"File\",initialValue:t}))}));case\"md\":case\"markdown\":{const a=\"string\"==typeof ie&&ie?t(ie):\"\";return e(we,{props:X,label:X.label,initialValue:a})}default:return e(we,{props:X,type:b,label:X.label,initialValue:ie})}}else{if(b&&i.hasOwnProperty(b))return e(i[b],{iv:ie,field:r,props:X,label:X.label,onchange:ae,obj:s,context:p});switch(b){case\"colour\":case\"color\":{const t=ie;return e(V,{...X,initialValue:t,onchange:ae,onblur:J})}case\"time\":{const{twelveHour:t=!1}=X,a=ie?\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie:new Date,i=ee(a);return s[g]=F?F(\"to\",a):a,e(B,{...X,twelveHour:t,initialValue:i,onchange:e=>{const t=e.split(\":\").map(e=>+e);a.setHours(t[0],t[1]),ae(a)},container:u})}case\"date\":{const{format:t=\"mmmm d, yyyy\"}=X,a=\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie;s[g]=a?F?F(\"to\",a.valueOf()):a.valueOf():a;const{min:i,max:n}=X,o=i?!a||ia.valueOf()?new Date(n):a:void 0;return e(q,{...X,minDate:o,maxDate:l,setDefaultDate:!!a,format:t,initialValue:a,onchange:e=>{ae(new Date(e))},container:u})}case\"datetime\":{const{label:t,className:a=\"col s12\",dateTimeSeconds:i=!1,twelveHour:n=!1,format:o=\"mmmm d, yyyy\",...l}=X,r=\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie,s={initialDateTime:r},c=r||void 0,d=r?ee(r):\"\",{min:p,max:m}=X,h=p?!r||pr.valueOf()?new Date(m):r:void 0,g=X.dateTimeOutput||\"UTC\",b=e=>{s.initialDateTime=e,ae(\"UTC\"===g?e.toUTCString():\"ISO\"===g?e.toISOString():e.valueOf())};return e(\"div\",{className:a},e(\".row\",[e(i?\".col.s6\":\".col.s8\",{style:\"padding: 0\"},e(q,{...l,label:t,minDate:h,maxDate:f,setDefaultDate:!!r,format:o,initialValue:c,container:u,onchange:e=>{const t=new Date(s.initialDateTime);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(e.getDate()),b(t)}})),e(\".col.s4\",{style:\"min-width: 6rem; padding-right: 0; padding-left: 0\"},e(B,{...l,label:\"\",helperText:\"\",twelveHour:n,initialValue:d,container:u,onchange:e=>{const t=e.split(\":\").map(e=>+e),a=s.initialDateTime||new Date((new Date).setSeconds(0,0));a.setHours(t[0],t[1]),b(a)}})),i&&e(T,{style:\"min-width: 4rem; padding-right: 0; padding-left: 0\",className:\"col s2\",min:0,max:59,onchange:e=>{const t=s.initialDateTime||new Date((new Date).setSeconds(0,0));t.setSeconds(e,0),b(t)}})]))}case\"email\":{const t=ie;return e(j,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"number\":{const t=ie;return e(T,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"radio\":{const t=ie;return e(z,{label:\"\",...X,options:Z,checkedId:t,onchange:ae})}case\"checkbox\":{const t=ie;return e(P,{...X,checked:t,onchange:ae})}case\"options\":{const t=ie;return[[e(R,{key:o.key,checkboxClass:\"col s6 m4 l3\",className:\"input-field col s12\",...X,disabled:X.disabled||!Z||0===Z.length,options:Z,checkedId:t,onchange:e=>ae(1===e.length?e[0]:e.filter(e=>null!==e))})],void 0!==E&&e(\".col.s12.option-buttons\",[e(v,{disabled:X.disabled,label:ne,iconName:\"check\",onclick:()=>{o.key=Date.now(),ae(Z.map(e=>e.id))}}),oe&&e(v,{disabled:X.disabled,label:oe,iconName:\"check_box_outline_blank\",onclick:()=>{const e=s[g]||[];e.length=0,o.key=Date.now(),ae(e)}})])]}case\"select\":{const t=ie;return e(W,{placeholder:X.multiple?M.pickOneOrMore||\"Pick one or more\":M.pickOne||\"Pick one\",...X,disabled:X.disabled||!Z||0===Z.length,options:Z,initialValue:t,onchange:e=>ae(1!==e.length||X.multiple?e.filter(e=>null!==e||void 0!==e):e[0])})}case\"markdown\":case\"md\":{const{label:t,className:a=\"col s12\"}=X,i=ue((g?ie:k||t)||\"\",s,p);return e(ve,{md:i,className:a})}case\"section\":return e(\".divider\");case\"switch\":{const t=ie,a=Z&&Z.length>0?Z[0].label:\"\",i=Z&&Z.length>1?Z[1].label:\"\";return e(Y,{...X,left:a,right:i,checked:t,onchange:ae})}case\"tags\":{const t=(ie?ie instanceof Array?ie:[ie]:[]).map(e=>({tag:e})),a=Z&&Z.length>0?{data:Z.reduce((e,t)=>(e[t.id]=null,e),{}),limit:r.maxLength||Infinity,minLength:r.minLength||1}:{},{label:i,isMandatory:n,className:o,helperText:l}=X;return e(x,{className:o,label:i,isMandatory:n,helperText:l,onchange:e=>ae(e.map(e=>e.tag)),placeholder:r.placeholder||\"Add a tag\",secondaryPlaceholder:r.secondaryPlaceholder||\"+tag\",data:t,autocompleteOptions:a,onblur:J})}case\"autocomplete\":{const t=ie,a=Z&&Z.length>0?{data:Z.reduce((e,t)=>(e[t.id]=null,e),{}),limit:r.maxLength||Infinity,minLength:r.minLength||1}:{data:{}},{label:i,isMandatory:n,className:o,helperText:l}=X;return e(h,{initialValue:t,className:o,label:i,isMandatory:n,helperText:l,onchange:ae,onblur:J,placeholder:r.placeholder||\"...\",...a})}case\"textarea\":{const t=ie;return e(A,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeyup:H,onkeydown:U,onblur:J})}case\"file\":{const t=ie,{url:a,placeholder:i}=r;if(!a)throw Error('Input field \"url\" not defined, which indicates the URL to the upload folder.');const n=Z?Z.map(e=>e.id):void 0,o=t=>{if(!t||t.length<1)return void ae(\"\");const i=new FormData;i.append(\"file\",t[0]),e.request({method:\"POST\",url:a,body:i}).then(e=>ae(e)).catch(console.error)};return e(L,{...X,accept:n,placeholder:i,onchange:o,initialValue:t})}case\"base64\":{const t=ie,a=!(!t||!/data:image/i.test(t)),{placeholder:i}=r,n=Z?Z.map(e=>e.id).join(\",\"):void 0,o=t=>{if(!t||t.length<1)return void ae(\"\");const a=new FileReader;a.onloadend=()=>{\"string\"==typeof a.result&&ae(a.result),e.redraw()},a.readAsDataURL(t[0])};return a?e(\"div\",[e(\"img.responsive-img\",{src:t,alt:s.title||s.alt||s.name||\"\",style:`max-height: ${r.max||50}px`}),e(v,{iconName:\"clear\",onclick:()=>ae(\"\")})]):e(L,{...X,accept:n,placeholder:i,onchange:o,initialValue:t})}case\"url\":{const t=ie;return e(C,{placeholder:\"http(s)://www.example.com\",...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"text\":{const t=ie;return e(S,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}default:return}}}}},ke=()=>{const t={},a=(e,a)=>{const i=e instanceof Array?e.length:e.hasOwnProperty(a)?e[a].length:0,n=t.onNewItem?t.onNewItem(e,a,i):{};e instanceof Array?e.push(n):e.hasOwnProperty(a)?e[a].push(n):e[a]=[n]};let i;const n=e=>{e.preventDefault()};return{oninit:({attrs:{i18n:e={},field:{id:a=\"\",sortProperty:n,onNewItem:o}}})=>{t.editLabel=e.editRepeat||`Edit ${String(a)}`,t.createLabel=e.createRepeat||`Create new ${String(a)}`,t.onNewItem=o,i=(e=>{if(!e)return(e,t)=>0;const t=\"!\"===e[0],a=t?e.substring(1):e;return t?(e,t)=>e[a]>t[a]?-1:e[a]e[a]>t[a]?1:e[a]{const{filterValue:f}=t,{id:g,label:b,type:y,min:x,max:k,pageSize:N,propertyFilter:$,filterLabel:I,readonly:O=u,repeatItemClass:A=\"\"}=o,D=((e,t)=>e instanceof Array?e:(e.hasOwnProperty(t)||(e[t]=[]),e[t]))(l,g),T=f?fe(f):void 0,M=$&&T&&T.length>2?D.filter(e=>fe(`${e[$]}`).indexOf(T)>=0):D,C=(e=>{const t=window.location.hash.split(\"?\")[1];return t?new URLSearchParams(t).get(e):null})(String(g)),V=C?Math.min(M.length,+C):1,j=N&&M&&(V-1)*N(j-1)*N<=t&&t!0,P=e.route.get()||location.href.replace(location.origin,\"\").replace(\"/#!\",\"\"),R=N?Math.ceil(M.length/N):0,F=!!(k&&M.length>=k),H=!p&&!O&&(!x||M.length>x),U=P?P.split(\"?\")[0]:\"\",q=(e=>{const t=e?e.split(\"?\")[1]:window.location.search.slice(1),a={};if(t){const e=t.split(\"&\");for(var i=0;i{a(l,String(g)),g&&e.route.set(U,Object.assign(q,{[g]:M.length})),h&&h(l)},style:{padding:0},className:\"left\",disabled:p||F,readonly:O}),R>1&&e(\".right\",e(_,{curPage:j,items:ge(1,R).map(e=>({href:ye(U,q,{[g]:e})}))})),(M.length>1||f)&&$&&!p&&e(S,{style:\"margin-top: -6px; margin-bottom: -1rem;\",iconName:\"filter_list\",iconClass:\"small\",placeholder:I,onkeyup:(e,a)=>t.filterValue=a,className:\"right\",disabled:p,readonly:O})])),M&&M.length>0&&\"string\"!=typeof y&&M.sort(i).filter(L).map((a,i)=>e(\".mui-repeat-item\",{key:i,draggable:J,ondragstart:J?e=>((e,t)=>{e.dataTransfer?.setData(\"text/plain\",t.toString())})(e,i):void 0,ondragover:J?n:void 0,ondrop:J?e=>((e,t,a,i,n)=>{const o=parseInt(e.dataTransfer?.getData(\"text\")||\"0\",10),l=[...a[i]],[r]=l.splice(o,1);l.splice(t,0,r),a[i]=l,n&&n(a),e.preventDefault()})(e,i,l,g,h):void 0,style:{display:\"flex\",cursor:J?\"move\":void 0}},[H&&[(!N||N>1)&&e(\"span.mui-show-item-number left\",{style:`flex: 0 0 ${B}px;`},`[${(N?(j-1)*N+i:i)+1}]`)],[e(\".row.repeat-item\",{className:A,key:V+be(a),style:\"flex: 1;\"},[y&&e(De,{form:y,obj:a,i18n:m,context:r instanceof Array?[l,...r]:[l,r],section:c,containerId:d,disabled:p,readonly:O,onchange:()=>h&&h(l)})])],H&&[e(v,{iconName:\"delete\",className:\"mui-delete-item\",iconClass:\"mui-delete-icon\",style:{flex:\"0 0 20px\",padding:0},disabled:p,readonly:O,onclick:()=>{t.curItemIdx=N?(j-1)*N+i:i}})]])),!(p||F||O||!M||0===M.length||1===N)&&e(w,{iconName:\"add\",className:\"row mui-add-new-item btn-small right\",title:b,style:\"padding: 0; margin-top: -10px; margin-right: -25px\",onclick:()=>{a(l,String(g)),e.route.set(U,Object.assign(q,{[g]:M.length})),h&&h(l)}})])],void 0!==t.curItemIdx&&e(E,{id:\"deleteItem\",onCreate:e=>e.open(),options:{onCloseStart:()=>{t.curItemIdx=void 0,e.redraw()}},fixedFooter:!0,title:m.deleteItem||\"Delete item\",description:e(De,{form:y,obj:M[t.curItemIdx],context:r instanceof Array?[l,...r]:[l,r],section:c,containerId:d,readonly:!0,i18n:m}),buttons:[{label:m.disagree||\"Disagree\"},{label:m.agree||\"Agree\",onclick:()=>{void 0!==t.curItemIdx&&(M.splice(t.curItemIdx,1),l instanceof Array?l=[...M]:l[g]=[...M],h&&h(l))}}]})]}}},Ne=()=>{const t={};return{oninit:({attrs:{i18n:e={}}})=>{const{raw:a=\"RAW\",view:i=\"VIEW\"}=e;t.raw=a,t.view=i},view:({attrs:{field:{id:a=\"\",type:i,onSelect:n},obj:o,context:l,containerId:r,disabled:s,readonly:c,i18n:d,onchange:p}})=>{if(o instanceof Array)return;const u=o[a],m=u?JSON.parse(u):void 0,h=m&&m.features||[],f=[],g={title:t.raw,vnode:e(A,{class:\"col s12\",initialValue:m?JSON.stringify(m,null,2):void 0,placeholder:\"Enter GeoJSON\",onchange:e=>o[a]=e})};if(!i||\"string\"==typeof i)return;const b=i,y=b.length>0?b[0].id:void 0,v={title:t.view,vnode:h.length?e(N,{oncreate:({dom:e})=>t.dom=e,onOpenStart:n?e=>{const a=t.dom.children||[];for(let t=0;t(t.properties||(t.properties={}),{id:\"erik_\"+i,key:i,header:y&&t.properties[y]||t.geometry.type,body:e(\".row\",e(De,{class:\"col s12\",form:b,obj:t.properties,i18n:d,context:l instanceof Array?[o,...l]:[o,l],containerId:r,disabled:s,readonly:c,onchange:(e,t)=>{t&&(h[i].properties=t),o[a]=JSON.stringify(m,null,2),p&&p(o)}}))}))}):e(\"span\",\"...\")};return f.push(v),f.push(g),e(Z,{tabs:f,tabWidth:\"fill\"})}}},$e={},Ie={},Oe=(e,t,a)=>{$e[e]=t,a&&(Ie[e]=a)},Ae=xe($e,Ie),De=()=>({view:({attrs:{i18n:t,form:a,obj:i,onchange:n,disabled:o,readonly:l,context:r,section:s}})=>{const c=e=>n&&n(((e,t)=>t.filter(e=>e.required&&void 0!==typeof e.id).reduce((t,a)=>t&&!(a.id&&(void 0===e[a.id]||e[a.id]instanceof Array&&0===e[a.id].length||\"string\"==typeof e[a.id]&&0===e[a.id].length)),!0))(e,a),e);return a.filter((e=>{if(!e)return e=>!0;let t=!1;return({type:a,id:i})=>\"section\"===a?(t=i===e,!1):t})(s)).filter(e=>!e.show||le(e.show,i,...r||[])).reduce((a,n)=>(n.type||(n.type=(e=>{const{autogenerate:t,value:a,options:i}=e;return t?\"none\":a?\"string\"==typeof a?\"md\":\"number\"==typeof a?\"number\":\"boolean\"==typeof a?\"checkbox\":\"none\":i&&i.length>0?\"select\":\"none\"})(n)),[...a,void 0===n.repeat||!1===n.repeat?e(Ae,{i18n:t,field:n,obj:i,onchange:c,disabled:o,readonly:l,context:r,section:s,containerId:\"body\"}):e(\"geojson\"===n.repeat?Ne:ke,{obj:i,field:n,onchange:c,context:r,i18n:t,containerId:\"body\",disabled:o,readonly:l})]),[])}});export{xe as FormFieldFactory,De as LayoutForm,we as ReadonlyComponent,ke as RepeatList,ve as SlimdownView,G as capitalizeFirstLetter,me as deepCopy,ae as flatten,pe as formatExpression,te as getPath,Q as isComponentType,he as labelResolver,X as padLeft,ge as range,Oe as registerPlugin,re as resolveExpression,fe as stripSpaces,ee as toHourMin};\n//# sourceMappingURL=index.esm.js.map\n","import { padLeft } from 'mithril-materialized';\nimport { Hierarchical, ID, Labeled } from '../models';\nimport { t } from '../services';\n\nexport const LANGUAGE = 'CSS_LANGUAGE';\nexport const SAVED = 'CSS_MODEL_SAVED';\n\nconst supRegex = /\\^([^_ ]+)(_|$|\\s)/g;\nconst subRegex = /\\_([^\\^ ]+)(\\^|$|\\s)/g;\n\n/** Expand markdown notation by converting A_1 to subscript and x^2 to superscript. */\nexport const subSup = (s: string) => (s ? s.replace(supRegex, `$1`).replace(subRegex, `$1`) : s);\n\nexport const capitalize = (s?: string) => s && s.charAt(0).toUpperCase() + s.slice(1);\n\n/**\n * Debounce function wrapper, i.e. between consecutive calls of the wrapped function,\n * there will be at least TIMEOUT milliseconds.\n * @param func Function to execute\n * @param timeout Timeout in milliseconds\n * @returns\n */\nexport const debounce = (func: (...args: any) => void, timeout: number) => {\n let timer: number;\n return (...args: any) => {\n clearTimeout(timer);\n timer = window.setTimeout(() => {\n func(...args);\n }, timeout);\n };\n};\n\nexport const formatDate = (date: number | Date = new Date(), separator = '-') => {\n const d = new Date(date);\n return `${d.getFullYear()}${separator}${padLeft(d.getMonth() + 1)}${separator}${padLeft(d.getDate())}`;\n};\n\n/**\n * Get a color that is clearly visible against a background color\n * @param backgroundColor Background color, e.g. #99AABB\n * @returns\n */\nexport const getTextColorFromBackground = (backgroundColor?: string) => {\n if (!backgroundColor) {\n return 'black-text';\n }\n const c = backgroundColor.substring(1); // strip #\n const rgb = parseInt(c, 16); // convert rrggbb to decimal\n const r = (rgb >> 16) & 0xff; // extract red\n const g = (rgb >> 8) & 0xff; // extract green\n const b = (rgb >> 0) & 0xff; // extract blue\n\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709\n\n return luma < 105 ? 'white-text' : 'black-text';\n};\n\ntype Option = {\n id: T;\n label: string;\n title?: string;\n};\n\nexport const getOptionsLabel = (options: Array>, id?: T | T[], showTitle = true) => {\n if (!id) {\n return '';\n }\n const print = (o: Option) =>\n showTitle ? `${o.label}${o.title ? ` (${o.title.replace(/\\.\\s*$/, '')})` : ''}` : o.label;\n if (id instanceof Array) {\n return options\n .filter((o) => id.indexOf(o.id) >= 0)\n .map((o) => print(o))\n .join(', ');\n }\n const found = options.filter((o) => o.id === id).shift();\n return found ? print(found) : '';\n};\n\n/** Join a list of items with a comma, and use AND for the last item in the list. */\nexport const joinListWithAnd = (arr: string[] = [], and = 'and', prefix = '') => {\n const terms = arr.filter((term) => term);\n return terms.length === 0\n ? ''\n : prefix +\n (terms.length === 1\n ? terms[0]\n : `${terms\n .slice(0, terms.length - 1)\n .map((t, i) => (i === 0 || typeof t === 'undefined' ? t : t.toLowerCase()))\n .join(', ')} ${and} ${terms[terms.length - 1].toLowerCase()}`);\n};\n\n/** Convert markdown text to HTML */\n// export const markdown2html = (markdown = '') =>\n// m.trust(render(markdown, true, true));\n\nexport const isUnique = (item: T, pos: number, arr: T[]) => arr.indexOf(item) == pos;\n\n/** Generate an array of numbers, from start till end, with optional step size. */\nexport const generateNumbers = (start: number, end: number, step: number = 1): number[] => {\n if (start > end) {\n throw new Error('Start number must be less than or equal to the end number.');\n }\n\n if (step <= 0) {\n throw new Error('Step size must be a positive number.');\n }\n\n const length = Math.floor((end - start) / step) + 1;\n return Array.from({ length }, (_, index) => start + index * step);\n};\n\nexport const getRandomValue = (array: T[]): T | undefined => {\n if (array.length === 0) {\n return undefined;\n }\n\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n};\n\n/**\n * Deep copy function for TypeScript.\n * @param T Generic type of target/copied value.\n * @param target Target value to be copied.\n * @see Source project, ts-deepcopy https://github.com/ykdr2017/ts-deepcopy\n * @see Code pen https://codepen.io/ErikVullings/pen/ejyBYg\n */\nexport const deepCopy = (target: T): T => {\n if (target === null) {\n return target;\n }\n if (target instanceof Date) {\n return new Date(target.getTime()) as any;\n }\n if (target instanceof Array) {\n const cp = [] as any[];\n (target as any[]).forEach((v) => {\n cp.push(v);\n });\n return cp.map((n: any) => deepCopy(n)) as any;\n }\n if (typeof target === 'object') {\n const cp = { ...(target as { [key: string]: any }) } as {\n [key: string]: any;\n };\n Object.keys(cp).forEach((k) => {\n cp[k] = deepCopy(cp[k]);\n });\n return cp as T;\n }\n return target;\n};\n\n/** Compute a contrasting background color */\nexport const contrastingColor = (backgroundColor: string) => {\n const backgroundRgb = [\n parseInt(backgroundColor[1] + backgroundColor[2], 16),\n parseInt(backgroundColor[3] + backgroundColor[4], 16),\n parseInt(backgroundColor[5] + backgroundColor[6], 16),\n ];\n const luminance = 0.2126 * backgroundRgb[0] + 0.7152 * backgroundRgb[1] + 0.0722 * backgroundRgb[2];\n\n // If the background is dark, use white text.\n if (luminance < 20) {\n return '#ffffff';\n }\n\n // If the background is light, use black text.\n return '#000000';\n};\n\nexport const scrollToSection = (e: MouseEvent, id: string): void => {\n e.preventDefault();\n const element = document.getElementById(id);\n\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' });\n } else {\n console.log(`Element with id ${id} not found.`);\n }\n};\n\nexport const scrollToTop = (): void => {\n window.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n};\n\nexport const addLeadingSpaces = (str: string, numSpaces: number): string => {\n // Create a string with the specified number of spaces\n const spaces = ' '.repeat(numSpaces);\n // Concatenate the spaces with the original string\n return spaces + str;\n};\n\nexport type InputOptions = {\n id: string;\n label?: string;\n group?: string;\n icon?: string;\n};\n\nexport const toOptions = (arr: Array, noGroup = false): InputOptions[] =>\n arr.map(({ id, label, parents }) => ({\n id,\n label,\n group: noGroup\n ? undefined\n : parents && parents.length > 0\n ? arr.find((l) => l.id === parents[0])?.label\n : t('OTHER'),\n }));\n\nexport const resolveOptions = (arr: Array = [], ids: ID | ID[] = []) => {\n ids = Array.isArray(ids) ? ids : [ids];\n return arr.filter((a) => ids.includes(a.id));\n};\n\n/** Convert to markdown unsorted list */\nexport const toMarkdownUl = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a) => `- ${a.label}`)\n .join('\\n');\n\n/** Convert to markdown sorted list */\nexport const toMarkdownOl = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a, i) => `${i + 1}. ${a.label}`)\n .join('\\n');\n\n/** Convert to comma-separated sorted list */\nexport const toCommaSeparatedList = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a, i) => a.label)\n .join(', ');\n","import { meiosisSetup } from 'meiosis-setup';\nimport { MeiosisCell, MeiosisConfig, Patch, Service } from 'meiosis-setup/types';\nimport m, { FactoryComponent } from 'mithril';\nimport { routingSvc, t } from '.';\nimport { Cast, CrimeLocation, CrimeScriptAttributes, DataModel, ID, Pages, SearchResult, Settings } from '../models';\nimport { User, UserRole } from './login-service';\nimport { scrollToTop } from '../utils';\n\n// const settingsSvc = restServiceFactory('settings');\nconst MODEL_KEY = 'CSS_MODEL';\nconst USER_ROLE = 'USER_ROLE';\nexport const APP_TITLE = 'PAX - Crime Scripting';\n\nexport type CrimeScriptFilter = {\n productIds: ID[];\n geoLocationIds: ID[];\n locationIds: ID[];\n attributeIds: ID[];\n roleIds: ID[];\n};\n\nexport interface State {\n page: Pages;\n model: DataModel;\n loggedInUser?: User;\n role: UserRole;\n settings: Settings;\n currentCrimeScriptId?: ID;\n curActIdx?: number;\n curPhaseIdx?: number;\n searchFilter: string;\n attributeFilter: string;\n searchResults: SearchResult[];\n caseTags: string[];\n caseResults: SearchResult[];\n crimeScriptFilter: CrimeScriptFilter;\n}\n\nexport interface Actions {\n setPage: (page: Pages, info?: string) => void;\n changePage: (\n page: Pages,\n params?: Record,\n query?: Record\n ) => void;\n saveModel: (ds: DataModel) => void;\n saveSettings: (settings: Settings) => Promise;\n setRole: (role: UserRole) => void;\n login: () => void;\n update: (patch: Patch) => void;\n setSearchFilter: (searchFilter?: string) => Promise;\n setAttributeFilter: (searchFilter?: string) => Promise;\n setLocation: (currentCrimeScriptId: ID, actIdx: number, phaseIdx: number) => void;\n}\n\nexport type MeiosisComponent = FactoryComponent<{\n state: State;\n actions: Actions;\n options?: T;\n}>;\n\nexport const appActions: (cell: MeiosisCell) => Actions = ({ update /* states */ }) => ({\n // addDucks: (cell, amount) => {\n // cell.update({ ducks: (value) => value + amount });\n // },\n setPage: (page, info) => {\n document.title = `${APP_TITLE} | ${t(page as any, 'TITLE').replace('_', ' ')}${info ? ` | ${info}` : ''}`;\n // const curPage = states().page;\n // if (curPage === page) return;\n update({\n page: () => {\n scrollToTop();\n return page;\n },\n });\n },\n changePage: (page, params, query) => {\n routingSvc && routingSvc.switchTo(page, params, query);\n document.title = `${APP_TITLE} | ${page.replace('_', ' ')}`;\n update({ page });\n },\n saveModel: (model) => {\n model.lastUpdate = Date.now();\n model.version = model.version ? model.version++ : 1;\n localStorage.setItem(MODEL_KEY, JSON.stringify(model));\n console.log(JSON.stringify(model, null, 2));\n update({ model: () => model });\n },\n saveSettings: async (settings: Settings) => {\n // await settingsSvc.save(settings);\n update({\n settings: () => settings,\n });\n },\n setRole: (role) => {\n localStorage.setItem(USER_ROLE, role);\n update({ role });\n },\n login: () => {},\n update: (state) => update(state),\n setSearchFilter: async (searchFilter?: string) => {\n if (searchFilter) {\n // localStorage.setItem(SEARCH_FILTER_KEY, searchFilter);\n update({ searchFilter });\n } else {\n update({ searchFilter: undefined });\n }\n },\n setAttributeFilter: async (attributeFilter?: string) => {\n if (attributeFilter) {\n update({ attributeFilter });\n } else {\n update({ attributeFilter: undefined });\n }\n },\n setLocation: (currentCrimeScriptId, curActIdx, curPhaseIdx) => {\n update({ currentCrimeScriptId, curActIdx, curPhaseIdx });\n },\n});\n\nexport const setSearchResults: Service = {\n onchange: (state) => state.searchFilter,\n run: (cell) => {\n const state = cell.getState();\n const { model = {} as DataModel } = state;\n const { crimeScripts = [], cast = [], attributes = [], acts = [], locations = [] } = model;\n const searchResults: SearchResult[] = [];\n if (state.searchFilter) {\n const searchFilter = state.searchFilter.toLowerCase();\n const highlighter = (text: string) => {\n return text.replace(new RegExp(searchFilter, 'gi'), (match) => `**${match}**`);\n };\n const matchingCast = cast\n .filter((role) => role.label?.toLowerCase().includes(searchFilter))\n .reduce((acc, cur) => acc.set(cur.id, cur), new Map());\n const matchingAttr = attributes\n .filter((attr) => attr.label?.toLowerCase().includes(searchFilter))\n .reduce((acc, cur) => acc.set(cur.id, cur), new Map());\n const matchingLoc = locations\n .filter((loc) => loc.label?.toLowerCase().includes(searchFilter))\n .reduce((acc, cur) => acc.set(cur.id, cur), new Map());\n crimeScripts.forEach((crimeScript, crimeScriptIdx) => {\n const { label, description, stages: actVariants = [] } = crimeScript;\n if (label.toLowerCase().includes(searchFilter) || description?.toLowerCase().includes(searchFilter)) {\n searchResults.push({\n crimeScriptIdx,\n actIdx: -1,\n phaseIdx: -1,\n activityIdx: -1,\n conditionIdx: -1,\n type: 'crimeScript',\n resultMd: highlighter(label.toLowerCase().includes(searchFilter) ? label : description!),\n });\n }\n actVariants.forEach(({ ids }) => {\n ids.forEach((actId) => {\n const actIdx = acts.findIndex((a) => a.id === actId);\n if (actIdx < 0) return;\n const act = acts[actIdx];\n [act.preparation, act.preactivity, act.activity, act.postactivity].forEach((phase, phaseIdx) => {\n if (phase.locationIds && Array.isArray(phase.locationIds)) {\n phase.locationIds.forEach((id) => {\n const include = matchingLoc.get(id);\n if (include) {\n searchResults.push({\n crimeScriptIdx: crimeScriptIdx,\n actIdx,\n phaseIdx,\n activityIdx: -1,\n conditionIdx: -1,\n type: 'cast',\n resultMd: highlighter(include.label),\n });\n }\n });\n }\n phase.activities?.forEach((activity, activityIdx) => {\n const { label = '', description, conditions = [], cast = [], attributes = [] } = activity;\n cast.forEach((id) => {\n const include = matchingCast.get(id);\n if (include) {\n searchResults.push({\n crimeScriptIdx: crimeScriptIdx,\n actIdx,\n phaseIdx,\n activityIdx,\n conditionIdx: -1,\n type: 'cast',\n resultMd: highlighter(include.label),\n });\n }\n });\n attributes.forEach((id) => {\n const include = matchingAttr.get(id);\n if (include) {\n searchResults.push({\n crimeScriptIdx: crimeScriptIdx,\n actIdx,\n phaseIdx,\n activityIdx,\n conditionIdx: -1,\n type: 'attribute',\n resultMd: highlighter(include.label),\n });\n }\n });\n if (label.toLowerCase().includes(searchFilter) || description?.toLowerCase().includes(searchFilter)) {\n searchResults.push({\n crimeScriptIdx: crimeScriptIdx,\n actIdx,\n phaseIdx,\n activityIdx,\n conditionIdx: -1,\n type: 'activity',\n resultMd: highlighter(label.toLowerCase().includes(searchFilter) ? label : description!),\n });\n }\n conditions?.forEach((condition, conditionIdx) => {\n const { label } = condition;\n if (label?.toLowerCase().includes(searchFilter)) {\n searchResults.push({\n crimeScriptIdx: crimeScriptIdx,\n actIdx,\n phaseIdx,\n activityIdx,\n conditionIdx,\n type: 'condition',\n resultMd: highlighter(label),\n });\n }\n });\n });\n });\n });\n });\n });\n }\n searchResults.sort((a, b) => {\n // Compare by crimeScriptIdx\n if (a.crimeScriptIdx !== b.crimeScriptIdx) {\n return a.crimeScriptIdx - b.crimeScriptIdx;\n }\n // Compare by actIdx\n if (a.actIdx !== b.actIdx) {\n return a.actIdx - b.actIdx;\n }\n // Compare by type (lexicographically)\n if (a.type !== b.type) {\n return a.type.localeCompare(b.type);\n }\n // If all compared fields are equal, return 0\n return 0;\n });\n cell.update({ searchResults });\n },\n};\n\nconst config: MeiosisConfig = {\n app: {\n initial: {\n page: Pages.HOME,\n loggedInUser: undefined,\n role: 'user',\n settings: {} as Settings,\n model: {} as DataModel,\n } as State,\n services: [setSearchResults],\n },\n};\nexport const cells = meiosisSetup(config);\n\ncells.map(() => {\n // console.log('...redrawing');\n m.redraw();\n});\n\nconst loadData = async () => {\n const ds = localStorage.getItem(MODEL_KEY);\n const model: DataModel = ds ? JSON.parse(ds) : { crimeScripts: [] };\n const role = (localStorage.getItem(USER_ROLE) || 'user') as UserRole;\n // const settings = (await settingsSvc.loadList()).shift() || ({} as Settings);\n\n cells().update({\n role,\n model: () => model,\n // settings: () => settings,\n });\n};\nloadData();\n","var isObject = function (obj) { return obj && typeof obj === 'object'; };\n\nfunction assemble(parts, replacements, count, opts) {\n var result = opts.array ? parts.slice() : parts[0];\n var len = parts.length;\n for (var i = 1; i < len; i += 2) {\n var part = parts[i];\n var val = replacements[part];\n if (val == null) {\n if (part === 'n' && count != null) {\n val = count;\n } else {\n opts.debug &&\n console.warn('No \"' + part + '\" in placeholder object:', replacements);\n val = '{' + part + '}';\n }\n }\n if (opts.array) {\n result[i] = val;\n } else {\n result += val + parts[i + 1];\n }\n }\n return result\n}\n\nfunction getPluralValue(translation, count, plFunc) {\n // Opinionated assumption: Pluralization rules are the same for negative and positive values.\n // By normalizing all values to positive, pluralization functions become simpler, and less error-prone by accident.\n var mappedCount = Math.abs(count);\n\n mappedCount = plFunc ? plFunc(mappedCount) : mappedCount;\n if (translation[mappedCount] != null) {\n return translation[mappedCount]\n }\n if (translation.n != null) {\n return translation.n\n }\n}\n\nfunction replacePlaceholders(\n translation,\n replacements,\n count,\n replCache,\n opts\n) {\n var result = replCache[translation];\n if (result == null) {\n var parts = translation\n // turn both curly braces around tokens into the a unified\n // (and now unique/safe) token `{x}` signifying boundry between\n // replacement variables and static text.\n .replace(/\\{(\\w+)\\}/g, '{x}$1{x}')\n // Adjacent placeholders will always have an empty string between them.\n // The array will also always start with a static string (at least a '').\n .split('{x}'); // stupid but works™\n\n // NOTE: parts no consists of alternating [text,replacement,text,replacement,text]\n // Cache a function that loops over the parts array - unless there's only text\n // (i.e. parts.length === 1) - then we simply cache the string.\n result = parts.length > 1 ? parts : parts[0];\n replCache[translation] = result;\n }\n result = result.pop ? assemble(result, replacements, count, opts) : result;\n return result\n}\n\nfunction translate(\n translationKey,\n subKey,\n replacements,\n keys,\n opts,\n replCache\n) {\n opts = opts || {};\n var translation = keys[translationKey];\n var translationIsObject = isObject(translation);\n var complex = translationIsObject || subKey != null || replacements != null;\n\n if (complex) {\n if (isObject(subKey)) {\n var tmp = replacements;\n replacements = subKey;\n subKey = tmp;\n }\n replacements = replacements || {};\n\n if (translationIsObject) {\n var propValue =\n (subKey != null && translation[subKey]) || translation['*'];\n if (propValue != null) {\n translation = propValue;\n } else if (typeof subKey === 'number') {\n // get appropriate plural translation string\n var plFunc = opts.pluralize;\n translation = getPluralValue(translation, subKey, plFunc);\n }\n }\n }\n\n if (typeof translation !== 'string') {\n if (opts.useKeyForMissingTranslation === false) {\n return\n }\n translation = translationKey;\n if (opts.debug) {\n if (subKey != null) {\n translation = '@@' + translationKey + '.' + subKey + '@@';\n console.warn(\n 'No translation or pluralization form found for \"' +\n subKey +\n '\" in' +\n translationKey\n );\n } else {\n translation = '@@' + translation + '@@';\n console.warn('Translation for \"' + translationKey + '\" not found.');\n }\n }\n }\n\n if (complex) {\n return replacePlaceholders(\n translation,\n replacements,\n subKey,\n replCache,\n opts\n )\n }\n return translation\n}\n\nfunction translateToArray() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var opts = this.opts;\n var normalArrayOption = opts.array;\n opts.array = true;\n var result = this.apply(null, args);\n opts.array = normalArrayOption;\n return result\n}\n\nfunction translatejs(messageObject, options) {\n messageObject = messageObject || {};\n options = options || {};\n\n if (options.resolveAliases) {\n messageObject = translatejs.resolveAliases(messageObject);\n }\n\n var replCache = {};\n\n function tFunc(translationKey, subKey, replacements) {\n return translate(\n translationKey,\n subKey,\n replacements,\n tFunc.keys,\n tFunc.opts,\n replCache\n )\n }\n\n tFunc.arr = translateToArray; // Convenience function.\n\n tFunc.keys = messageObject || {};\n tFunc.opts = options;\n\n return tFunc\n}\n\nfunction mapValues(obj, fn) {\n return Object.keys(obj).reduce(function (res, key) {\n res[key] = fn(obj[key], key);\n return res\n }, {})\n}\n\ntranslatejs.resolveAliases = function resolveAliases(translations) {\n var keysInProcess = {};\n function resolveAliases(translation) {\n if (isObject(translation)) {\n return mapValues(translation, resolveAliases)\n }\n return translation.replace(/{{(.*?)}}/g, function (_, token) {\n if (keysInProcess[token]) {\n throw new Error('Circular reference for \"' + token + '\" detected')\n }\n keysInProcess[token] = true;\n var key = token;\n var subKey = '';\n var keyParts = token.match(/^(.+)\\[(.+)\\]$/);\n if (keyParts) {\n key = keyParts[1];\n subKey = keyParts[2];\n }\n var target = translations[key];\n if (isObject(target)) {\n if (subKey) {\n target = target[subKey];\n } else {\n throw new Error(\"You can't alias objects\")\n }\n }\n if (target == null) {\n throw new Error('No translation for alias \"' + token + '\"')\n }\n var translation = resolveAliases(target);\n keysInProcess[token] = false;\n return translation\n })\n }\n return resolveAliases(translations)\n};\n\nexport default translatejs;\n","import { situationCrimePreventionClassificationTableNL } from '../abstract';\nimport { messages } from './en';\n\nexport const messagesNL: typeof messages = {\n HOME: { TITLE: 'Home', ROUTE: '/home' },\n ABOUT: { TITLE: 'Over de app', ROUTE: '/over', TEXT: situationCrimePreventionClassificationTableNL },\n CRIME_SCRIPT: { TITLE: 'Crime script', ROUTE: '/crime_script' },\n SETTINGS: { TITLE: 'Instellingen', ROUTE: '/instellingen' },\n LANDING: { TITLE: 'Introductie', ROUTE: '/' },\n CASE: { TITLE: 'Casus', ROUTE: '/casus' },\n USER: 'Gebruiker',\n EDITOR: 'Redacteur',\n ADMIN: 'Beheerder',\n CANCEL: 'Annuleren',\n DELETE: 'Verwijderen',\n YES: 'Ja',\n NO: 'Nee',\n OK: 'Ok',\n NAME: 'Naam',\n MISC: 'Overig',\n DESCRIPTION: 'Beschrijving',\n DELETE_ITEM: {\n TITLE: '{item} verwijderen',\n DESCRIPTION: 'Weet je zeker dat je dit {item} wilt verwijderen? Dit kan niet ongedaan worden gemaakt.',\n },\n EDIT_BUTTON: {\n LABEL: 'Bewerken',\n TOOLTIP: 'Bewerken',\n },\n SAVE_BUTTON: {\n LABEL: 'Opslaan',\n TOOLTIP: 'Wijzigingen opslaan',\n },\n MODEL: 'Model',\n TITLE: 'Titel',\n AUTHORS: 'Auteurs',\n LINK: 'Link',\n TYPE: 'Type',\n CAST_TYPE: 'Roltype',\n SAVE_SCRIPT: 'Script opslaan',\n EDIT_SCRIPT: 'Script bewerken',\n DELETE_SCRIPT: 'Script verwijderen',\n NEW_SCRIPT: 'Nieuw script',\n DELETE_SCRIPT_CONFIRM: 'Weet je zeker dat je het script \"{name}\" wilt verwijderen?',\n ACTIVITIES: 'Activiteiten',\n CAST: 'Rollen',\n CONDITIONS: 'Voorwaarden',\n ATTRIBUTES: 'Attributen',\n MEASURES: 'Maatregelen',\n NEW_ACT: 'Nieuwe handeling',\n PREPARATION_PHASE: 'Voorbereidingsfase',\n PRE_ACTIVITY_PHASE: 'Voor-activiteitsfase',\n ACTIVITY_PHASE: 'Activiteitsfase',\n POST_ACTIVITY_PHASE: 'Na-activiteitsfase',\n SUMMARY: 'Samenvatting',\n IMAGE: 'Afbeelding',\n ACTIVITY: 'Activiteit',\n SPECIFY: 'Specificeer',\n CONDITION: 'Voorwaarde',\n CATEGORY: 'Categorie',\n SELECT: 'Selecteren',\n CREATE: 'Maken',\n STAGES: 'Fasen',\n STAGE: 'Fase',\n SCENES: 'Scenes',\n SCENE: 'Scene',\n ACTS: 'Actes',\n ACT: 'Acte',\n SELECT_ACT_TO_EDIT: 'Selecteer handeling om te bewerken',\n CREATE_NEW_ACT: 'Nieuwe handeling maken',\n REFERENCES: 'Referenties',\n DETAILS: 'Details',\n LANGUAGE: 'Taal',\n CLEAR: 'Wis model',\n UPLOAD: 'Lees model in als JSON',\n DOWNLOAD: 'Sla model op als JSON',\n PERMALINK: 'Maak permanente link',\n ROLE: 'Rol',\n SELECT_ACT: 'Selecteer act om te bewerken',\n SELECT_ACT_N: 'Selecteer een of meerdere acts in deze stage',\n\n /** Crime Prevention Techniques */\n INCREASE_EFFORT: 'Verhoog de inspanning',\n TARGET_HARDEN: {\n TITLE: 'Doelversteviging',\n DESC: 'Stuursloten en startonderbrekers, Anti-overval schermen, Manipulatiebestendige verpakking',\n },\n CONTROL_ACCESS: {\n TITLE: 'Controleer toegang tot faciliteiten',\n DESC: 'Deurtelefoons, Elektronische kaart toegang, Bagagecontrole',\n },\n SCREEN_EXITS: {\n TITLE: 'Controleer uitgangen',\n DESC: 'Ticket nodig voor vertrek, Exportdocumenten, Elektronische artikelbeveiliging',\n },\n DEFLECT_OFFENDERS: {\n TITLE: 'Leid overtreders af',\n DESC: 'Straatafsluitingen, Aparte toiletten voor vrouwen, Verspreid pubs',\n },\n CONTROL_TOOLS: {\n TITLE: 'Beheers gereedschappen/wapens',\n DESC: '\"Slimme\" wapens, Beperk verkoop spuitverf aan jongeren, Geharde bierglazen',\n },\n INCREASE_RISKS: \"Verhoog de risico's\",\n EXTEND_GUARDIANSHIP: {\n TITLE: 'Breid toezicht uit',\n DESC: \"Ga 's nachts in groep uit, Laat tekenen van bewoning achter, Draag een mobiele telefoon\",\n },\n ASSIST_SURVEILLANCE: {\n TITLE: 'Ondersteun natuurlijk toezicht',\n DESC: 'Verbeterde straatverlichting, Verdedigbaar ruimteontwerp, Ondersteuning van klokkenluiders',\n },\n REDUCE_ANONYMITY: {\n TITLE: 'Verminder anonimiteit',\n DESC: 'Taxichauffeur ID\\'s, \"Hoe is mijn rijgedrag?\" stickers, Schooluniformen',\n },\n USE_PLACE_MANAGERS: {\n TITLE: 'Gebruik plaatsmanagers',\n DESC: 'CCTV voor dubbeldekkers, Twee bedienden voor gemakswinkels, Beloon waakzaamheid',\n },\n STRENGTHEN_SURVEILLANCE: {\n TITLE: 'Versterk formeel toezicht',\n DESC: \"Roodlichtcamera's, Inbraakalarm, Beveiligingspersoneel\",\n },\n REDUCE_REWARDS: 'Verminder de beloningen',\n CONCEAL_TARGETS: {\n TITLE: 'Verberg doelen',\n DESC: 'Parkeren buiten de straat, Genderneutrale telefoongidsen, Ongemarkeerde gepantserde vrachtwagens',\n },\n REMOVE_TARGETS: {\n TITLE: 'Verwijder doelen',\n DESC: 'Verwijderbare autoradio, Vrouwenopvang, Prepaidkaarten voor openbare telefoons',\n },\n IDENTIFY_PROPERTY: {\n TITLE: 'Identificeer eigendom',\n DESC: 'Eigendomsmarkering, Voertuigregistratie en onderdelenmarkering, Veemerken',\n },\n DISRUPT_MARKETS: {\n TITLE: 'Verstoor markten',\n DESC: 'Monitor pandjeshuis, Controles op rubrieksadvertenties, Vergunning voor straatverkopers',\n },\n DENY_BENEFITS: {\n TITLE: 'Ontzeg voordelen',\n DESC: 'Inktlabels op artikelen, Graffiti reiniging, Uitschakelen gestolen mobiele telefoons',\n },\n REDUCE_PROVOCATIONS: 'Verminder provocaties',\n REDUCE_FRUSTRATIONS: {\n TITLE: 'Verminder frustraties en stress',\n DESC: 'Efficiënte rijen, Beleefde service, Uitgebreide zitplaatsen, Rustgevende muziek/gedempte verlichting',\n },\n AVOID_DISPUTES: {\n TITLE: 'Vermijd geschillen',\n DESC: 'Gescheiden zitplaatsen voor rivaliserende voetbalfans, Verminder drukte in bars, Vaste taxitarieven',\n },\n REDUCE_TEMPTATION: {\n TITLE: 'Verminder verleiding en opwinding',\n DESC: 'Controles op gewelddadige pornografie, Handhaaf goed gedrag op voetbalveld, Verbied racistische opmerkingen',\n },\n NEUTRALIZE_PRESSURE: {\n TITLE: 'Neutraliseer groepsdruk',\n DESC: '\"Idioten drinken en rijden\", \"Het is OK om Nee te zeggen\", Verspreid onruststokers op school',\n },\n DISCOURAGE_IMITATION: {\n TITLE: 'Ontmoedig imitatie',\n DESC: \"Snelle reparatie van vandalisme, V-chips in TV's, Censureer details van modus operandi\",\n },\n REMOVE_EXCUSES: 'Verwijder excuses',\n SET_RULES: {\n TITLE: 'Stel regels op',\n DESC: 'Huurovereenkomsten, Intimidatiecodes, Hotelregistratie',\n },\n POST_INSTRUCTIONS: {\n TITLE: 'Plaats instructies',\n DESC: '\"Parkeren verboden\", \"Privé-eigendom\", \"Doof kampvuren\"',\n },\n ALERT_CONSCIENCE: {\n TITLE: 'Activeer geweten',\n DESC: 'Snelheidsweergaveborden langs de weg, Handtekeningen voor douaneaangiften, \"Winkeldiefstal is stelen\"',\n },\n ASSIST_COMPLIANCE: {\n TITLE: 'Help bij naleving',\n DESC: 'Eenvoudige bibliotheekuitleen, Openbare toiletten, Afvalbakken',\n },\n CONTROL_DRUGS: {\n TITLE: 'Beheers drugs en alcohol',\n DESC: \"Ademanalysers in bars, Interventie programma's voor barpersoneel, Alcoholvrije evenementen\",\n },\n EXPORT_TO_WORD: 'Exporteer naar Word',\n INTRODUCTION: 'Introductie',\n SEARCH: 'Zoek...',\n SEARCH_TOOLTIP: 'Type / om te zoeken',\n HITS: {\n 0: 'Geen resultaten gevonden',\n 1: '1 resultaat gevonden',\n n: '{n} resultaten gevonden',\n },\n SYNONYMS: 'Synoniemen',\n PARENTS: 'Ouders',\n CATEGORIES: 'Categorieën',\n BELONGS_TO: 'Behoort tot',\n LOCATIONS: { 0: 'Locaties', 1: 'Locatie', n: 'Locaties' },\n PRODUCTS: { 0: 'Producten', 1: 'Product', n: 'Producten' },\n GEOLOCATIONS: { 0: 'Kaartlocatie', 1: 'Kaartlocatie', n: 'Kaartlocaties' },\n TRANSPORTS: 'Transportmiddelen',\n I18n: {\n editRepeat: 'Bewerk item',\n createRepeat: 'Maak een nieuw item',\n deleteItem: 'Verwijder een item',\n agree: 'Ja',\n disagree: 'Nee',\n pickOne: 'Kies één',\n pickOneOrMore: 'Kies één of meer',\n cancel: 'Opheffen',\n save: 'Bewaren',\n },\n OTHER: 'Overig',\n};\n","export const situationCrimePreventionClassificationTable = `\n\n#### Situational Crime Prevention techniques\n\n| Increase the effort | Increase the risks | Reduce the rewards | Reduce provocations | Remove excuses |\n|---------------------|---------------------|---------------------|----------------------|-----------------|\n| 1. Target harden
      - Steering column locks and ignition immobilizers
      - Anti-robbery screens
      - Tamper-proof packaging | 6. Extend guardianship
      - Go out in group at night
      - Leave signs of occupancy
      - Carry cell phone | 11. Conceal targets
      - Off-street parking
      - Gender-neutral phone directories
      - Unmarked armored trucks | 16. Reduce frustrations and stress
      - Efficient lines
      - Polite service
      - Expanded seating
      - Soothing music/muted lights | 21. Set rules
      - Rental agreements
      - Harassment codes
      - Hotel registration |\n| 2. Control access to facilities
      - Entry phones
      - Electronic card access
      - Baggage screening | 7. Assist natural surveillance
      - Improved street lighting
      - Defensible space design
      - Support whistleblowers | 12. Remove targets
      - Removable car radio
      - Women's shelters
      - Pre-paid cards for pay phones | 17. Avoid disputes
      - Separate seating for rival soccer fans
      - Reduce crowding in bars
      - Fixed cab fares | 22. Post instructions
      - \"No parking\"
      - \"Private property\"
      - \"Extinguish camp fires\" |\n| 3. Screen exits
      - Ticket needed for exit
      - Export documents
      - Electronic merchandise tags | 8. Reduce anonymity
      - Taxi driver IDs
      - \"How's my driving?\" decals
      - School uniforms | 13. Identify property
      - Property marking
      - Vehicle licensing and parts marking
      - Cattle branding | 18. Reduce temptation and arousal
      - Controls on violent pornography
      - Enforce good behavior on soccer field
      - Prohibit racial slurs | 23. Alert conscience
      - Roadside speed display boards
      - Signatures for customs declarations
      - \"Shoplifting is stealing\" |\n| 4. Deflect offenders
      - Street closures
      - Separate bathrooms for women
      - Disperse pubs | 9. Use place managers
      - CCTV for double-deck buses
      - Two clerks for convenience stores
      - Reward vigilance | 14. Disrupt markets
      - Monitor pawn shops
      - Controls on classified ads
      - License street vendors | 19. Neutralize peer pressure
      - \"Idiots drink and drive\"
      - \"It's OK to say No\"
      - Disperse troublemakers at school | 24. Assist compliance
      - Easy library checkout
      - Public lavatories
      - Litter receptacles |\n| 5. Control tools/weapons
      - \"Smart\" guns
      - Restrict spray paint sales to juveniles
      - Toughened beer glasses | 10. Strengthen formal surveillance
      - Red light cameras
      - Burglar alarms
      - Security guards | 15. Deny benefits
      - Ink merchandise tags
      - Graffiti cleaning
      - Disabling stolen cell phones | 20. Discourage imitation
      - Rapid repair of vandalism
      - V-chips in TVs
      - Censor details of modus operandi | 25. Control drugs and alcohol
      - Breathalyzers in bars
      - Server intervention programs
      - Alcohol-free events |\n`;\n\nexport const situationCrimePreventionClassificationTableNL = `\n\n#### Situational Crime Prevention technieken\n\n| Verhoog de inspanning | Verhoog de risico's | Verminder de beloningen | Verminder provocaties | Verwijder excuses |\n|------------------------|----------------------|--------------------------|-------------------------|---------------------|\n| 1. Doelversteviging
      - Stuursloten en startonderbrekers
      - Anti-overval schermen
      - Manipulatiebestendige verpakking | 6. Breid toezicht uit
      - Ga 's nachts in groep uit
      - Laat tekenen van bewoning achter
      - Draag een mobiele telefoon | 11. Verberg doelen
      - Parkeren buiten de straat
      - Genderneutrale telefoongidsen
      - Ongemarkeerde gepantserde vrachtwagens | 16. Verminder frustraties en stress
      - Efficiënte rijen
      - Beleefde service
      - Uitgebreide zitplaatsen
      - Rustgevende muziek/gedempte verlichting | 21. Stel regels op
      - Huurovereenkomsten
      - Intimidatiecodes
      - Hotelregistratie |\n| 2. Controleer toegang tot faciliteiten
      - Deurtelefoons
      - Elektronische kaart toegang
      - Bagagecontrole | 7. Ondersteun natuurlijk toezicht
      - Verbeterde straatverlichting
      - Verdedigbaar ruimteontwerp
      - Ondersteuning van klokkenluiders | 12. Verwijder doelen
      - Verwijderbare autoradio
      - Vrouwenopvang
      - Prepaidkaarten voor openbare telefoons | 17. Vermijd geschillen
      - Gescheiden zitplaatsen voor rivaliserende voetbalfans
      - Verminder drukte in bars
      - Vaste taxitarieven | 22. Plaats instructies
      - \"Parkeren verboden\"
      - \"Privé-eigendom\"
      - \"Doof kampvuren\" |\n| 3. Controleer uitgangen
      - Ticket nodig voor vertrek
      - Exportdocumenten
      - Elektronische artikelbeveiliging | 8. Verminder anonimiteit
      - Taxichauffeur ID's
      - \"Hoe is mijn rijgedrag?\" stickers
      - Schooluniformen | 13. Identificeer eigendom
      - Eigendomsmarkering
      - Voertuigregistratie en onderdelenmarkering
      - Veemerken | 18. Verminder verleiding en opwinding
      - Controles op gewelddadige pornografie
      - Handhaaf goed gedrag op voetbalveld
      - Verbied racistische opmerkingen | 23. Activeer geweten
      - Snelheidsweergaveborden langs de weg
      - Handtekeningen voor douaneaangiften
      - \"Winkeldiefstal is stelen\" |\n| 4. Leid overtreders af
      - Straatafsluitingen
      - Aparte toiletten voor vrouwen
      - Verspreid pubs | 9. Gebruik plaatsmanagers
      - CCTV voor dubbeldekkers
      - Twee bedienden voor gemakswinkels
      - Beloon waakzaamheid | 14. Verstoor markten
      - Monitor pandjeshuis
      - Controles op rubrieksadvertenties
      - Vergunning voor straatverkopers | 19. Neutraliseer groepsdruk
      - \"Idioten drinken en rijden\"
      - \"Het is OK om Nee te zeggen\"
      - Verspreid onruststokers op school | 24. Help bij naleving
      - Eenvoudige bibliotheekuitleen
      - Openbare toiletten
      - Afvalbakken |\n| 5. Beheers gereedschappen/wapens
      - \"Slimme\" wapens
      - Beperk verkoop spuitverf aan jongeren
      - Geharde bierglazen | 10. Versterk formeel toezicht
      - Roodlichtcamera's
      - Inbraakalarm
      - Beveiligingspersoneel | 15. Ontzeg voordelen
      - Inktlabels op artikelen
      - Graffiti reiniging
      - Uitschakelen gestolen mobiele telefoons | 20. Ontmoedig imitatie
      - Snelle reparatie van vandalisme
      - V-chips in TV's
      - Censureer details van modus operandi | 25. Beheers drugs en alcohol
      - Ademanalysers in bars
      - Interventie programma's voor barpersoneel
      - Alcoholvrije evenementen |\n`;\n","import { situationCrimePreventionClassificationTable } from '../abstract';\n\nexport const messages = {\n HOME: { TITLE: 'Home', ROUTE: '/home' },\n ABOUT: { TITLE: 'About the app', ROUTE: '/about', TEXT: situationCrimePreventionClassificationTable },\n CRIME_SCRIPT: { TITLE: 'Crime script', ROUTE: '/crime_script' },\n SETTINGS: { TITLE: 'Settings', ROUTE: '/settings' },\n LANDING: { TITLE: 'Introduction', ROUTE: '/' },\n CASE: { TITLE: 'Case file', ROUTE: '/case' },\n USER: 'User',\n EDITOR: 'Editor',\n ADMIN: 'Administrator',\n CANCEL: 'Cancel',\n DELETE: 'Delete',\n YES: 'Yes',\n NO: 'No',\n OK: 'Ok',\n NAME: 'Name',\n MISC: 'Miscellaneous',\n DESCRIPTION: 'Description',\n DELETE_ITEM: {\n TITLE: 'Delete {item}',\n DESCRIPTION: 'Are you certain you want to delete this {item}. There is no turning back?',\n },\n EDIT_BUTTON: {\n LABEL: 'Edit',\n TOOLTIP: 'Edit',\n },\n SAVE_BUTTON: {\n LABEL: 'Save',\n TOOLTIP: 'Save unsaved changes',\n },\n MODEL: 'Model',\n TITLE: 'Title',\n AUTHORS: 'Authors',\n LINK: 'Link',\n TYPE: 'Type',\n CAST_TYPE: 'Role type',\n SAVE_SCRIPT: 'Save Script',\n EDIT_SCRIPT: 'Edit Script',\n DELETE_SCRIPT: 'Delete Script',\n NEW_SCRIPT: 'New Script',\n DELETE_SCRIPT_CONFIRM: 'Are you certain you want to delete the script \"{name}\"?',\n ACTIVITIES: 'Activities',\n CAST: 'Cast',\n CONDITIONS: 'Conditions',\n ATTRIBUTES: 'Attributes',\n MEASURES: 'Measures',\n NEW_ACT: 'New Act',\n PREPARATION_PHASE: 'Preparation Phase',\n PRE_ACTIVITY_PHASE: 'Pre-Activity Phase',\n ACTIVITY_PHASE: 'Activity Phase',\n POST_ACTIVITY_PHASE: 'Post-Activity Phase',\n SUMMARY: 'Summary',\n IMAGE: 'Image',\n ACTIVITY: 'Activity',\n SPECIFY: 'Specify',\n CONDITION: 'Condition',\n CATEGORY: 'Category',\n SELECT: 'Select',\n CREATE: 'Create',\n STAGES: 'Stages',\n STAGE: 'Stage',\n SCENES: 'Scenes',\n SCENE: 'Scene',\n ACTS: 'Acts',\n ACT: 'Act',\n SELECT_ACT_TO_EDIT: 'Select act to edit',\n CREATE_NEW_ACT: 'Create new act',\n REFERENCES: 'References',\n DETAILS: 'Details',\n LANGUAGE: 'Language',\n CLEAR: 'Clear model',\n UPLOAD: 'Upload model as JSON',\n DOWNLOAD: 'Download model as JSON',\n PERMALINK: 'Create permanent link',\n ROLE: 'Role',\n SELECT_ACT: 'Select act to edit',\n SELECT_ACT_N: 'Select one or more acts for this step',\n /** Crime Prevention Techniques */\n INCREASE_EFFORT: 'Increase the effort',\n TARGET_HARDEN: {\n TITLE: 'Target harden',\n DESC: 'Steering column locks and ignition immobilizers, Anti-robbery screens, Tamper-proof packaging',\n },\n CONTROL_ACCESS: {\n TITLE: 'Control access to facilities',\n DESC: 'Entry phones, Electronic card access, Baggage screening',\n },\n SCREEN_EXITS: {\n TITLE: 'Screen exits',\n DESC: 'Ticket needed for exit, Export documents, Electronic merchandise tags',\n },\n DEFLECT_OFFENDERS: {\n TITLE: 'Deflect offenders',\n DESC: 'Street closures, Separate bathrooms for women, Disperse pubs',\n },\n CONTROL_TOOLS: {\n TITLE: 'Control tools/weapons',\n DESC: '\"Smart\" guns, Restrict spray paint sales to juveniles, Toughened beer glasses',\n },\n INCREASE_RISKS: 'Increase the risks',\n EXTEND_GUARDIANSHIP: {\n TITLE: 'Extend guardianship',\n DESC: 'Go out in group at night, Leave signs of occupancy, Carry cell phone',\n },\n ASSIST_SURVEILLANCE: {\n TITLE: 'Assist natural surveillance',\n DESC: 'Improved street lighting, Defensible space design, Support whistleblowers',\n },\n REDUCE_ANONYMITY: {\n TITLE: 'Reduce anonymity',\n DESC: 'Taxi driver IDs, \"How\\'s my driving?\" decals, School uniforms',\n },\n USE_PLACE_MANAGERS: {\n TITLE: 'Use place managers',\n DESC: 'CCTV for double-deck buses, Two clerks for convenience stores, Reward vigilance',\n },\n STRENGTHEN_SURVEILLANCE: {\n TITLE: 'Strengthen formal surveillance',\n DESC: 'Red light cameras, Burglar alarms, Security guards',\n },\n REDUCE_REWARDS: 'Reduce the rewards',\n CONCEAL_TARGETS: {\n TITLE: 'Conceal targets',\n DESC: 'Off-street parking, Gender-neutral phone directories, Unmarked armored trucks',\n },\n REMOVE_TARGETS: {\n TITLE: 'Remove targets',\n DESC: \"Removable car radio, Women's shelters, Pre-paid cards for pay phones\",\n },\n IDENTIFY_PROPERTY: {\n TITLE: 'Identify property',\n DESC: 'Property marking, Vehicle licensing and parts marking, Cattle branding',\n },\n DISRUPT_MARKETS: {\n TITLE: 'Disrupt markets',\n DESC: 'Monitor pawn shops, Controls on classified ads, License street vendors',\n },\n DENY_BENEFITS: {\n TITLE: 'Deny benefits',\n DESC: 'Ink merchandise tags, Graffiti cleaning, Disabling stolen cell phones',\n },\n REDUCE_PROVOCATIONS: 'Reduce provocations',\n REDUCE_FRUSTRATIONS: {\n TITLE: 'Reduce frustrations and stress',\n DESC: 'Efficient lines, Polite service, Expanded seating, Soothing music/muted lights',\n },\n AVOID_DISPUTES: {\n TITLE: 'Avoid disputes',\n DESC: 'Separate seating for rival soccer fans, Reduce crowding in bars, Fixed cab fares',\n },\n REDUCE_TEMPTATION: {\n TITLE: 'Reduce temptation and arousal',\n DESC: 'Controls on violent pornography, Enforce good behavior on soccer field, Prohibit racial slurs',\n },\n NEUTRALIZE_PRESSURE: {\n TITLE: 'Neutralize peer pressure',\n DESC: '\"Idiots drink and drive\", \"It\\'s OK to say No\", Disperse troublemakers at school',\n },\n DISCOURAGE_IMITATION: {\n TITLE: 'Discourage imitation',\n DESC: 'Rapid repair of vandalism, V-chips in TVs, Censor details of modus operandi',\n },\n REMOVE_EXCUSES: 'Remove excuses',\n SET_RULES: {\n TITLE: 'Set rules',\n DESC: 'Rental agreements, Harassment codes, Hotel registration',\n },\n POST_INSTRUCTIONS: {\n TITLE: 'Post instructions',\n DESC: '\"No parking\", \"Private property\", \"Extinguish camp fires\"',\n },\n ALERT_CONSCIENCE: {\n TITLE: 'Alert conscience',\n DESC: 'Roadside speed display boards, Signatures for customs declarations, \"Shoplifting is stealing\"',\n },\n ASSIST_COMPLIANCE: {\n TITLE: 'Assist compliance',\n DESC: 'Easy library checkout, Public lavatories, Litter receptacles',\n },\n CONTROL_DRUGS: {\n TITLE: 'Control drugs and alcohol',\n DESC: 'Breathalyzers in bars, Server intervention programs, Alcohol-free events',\n },\n EXPORT_TO_WORD: 'Export to Word',\n INTRODUCTION: 'Introduction',\n SEARCH: 'Search...',\n SEARCH_TOOLTIP: 'Type / to search',\n HITS: {\n 0: 'No results found',\n 1: '1 result found',\n n: '{n} results found',\n },\n SYNONYMS: 'Synonyms',\n PARENTS: 'Parents',\n CATEGORIES: 'Categories',\n BELONGS_TO: 'Belongs to',\n PRODUCTS: { 0: 'Products', 1: 'Product', n: 'Products' },\n LOCATIONS: { 0: 'Locations', 1: 'Location', n: 'Locations' },\n GEOLOCATIONS: { 0: 'Geographic Locations', 1: 'Geographic Location', n: 'Geographic Locations' },\n TRANSPORTS: 'Transports',\n I18n: {\n editRepeat: '',\n createRepeat: '',\n deleteItem: '',\n agree: '',\n disagree: '',\n pickOne: '',\n pickOneOrMore: '',\n cancel: '',\n save: '',\n },\n OTHER: 'Other',\n};\n","import translate, { Options, Translate } from 'translate.js';\nimport { plural_EN } from 'translate.js/pluralize';\nimport { messages, messagesNL } from './lang';\nimport { I18n } from 'mithril-ui-form';\n\nexport type Languages = 'nl' | 'en';\n\nconst setGuiLanguage = (language: Languages) => {\n const options = {\n // These are the defaults:\n debug: true, //[Boolean]: Logs missing translations to console and add \"@@\" around output, if `true`.\n array: true, //[Boolean]: Returns translations with placeholder-replacements as Arrays, if `true`.\n resolveAliases: true, //[Boolean]: Parses all translations for aliases and replaces them, if `true`.\n pluralize: plural_EN, //[Function(count)]: Provides a custom pluralization mapping function, should return a string (or number)\n useKeyForMissingTranslation: true, //[Boolean]: If there is no translation found for given key, the key is used as translation, when set to false, it returns undefiend in this case\n };\n return translate(language === 'nl' ? messagesNL : messages, options) as Translate;\n};\n\nexport type TextDirection = 'rtl' | 'ltr';\n\nexport type Locale = {\n /** Friendly name */\n name: string;\n /** Fully qualified name, e.g. 'en-UK' */\n fqn: string;\n /** Text direction: Left to right or right to left */\n dir?: TextDirection;\n /** Is the default language */\n default?: boolean;\n};\n\nexport type Locales = Record;\n\nexport type Listener = (locale: string, dir: TextDirection) => void;\n\nconst onChangeLocale: Listener[] = [];\n\nexport const i18n = {\n defaultLocale: 'en' as Languages,\n currentLocale: 'en' as Languages,\n locales: {} as Locales,\n init,\n addOnChangeListener,\n loadAndSetLocale,\n};\n\nexport const I18N: I18n = {};\n\nexport let t: Translate = setGuiLanguage(i18n.currentLocale);\n\nasync function init(locales: Locales, selectedLocale: Languages) {\n i18n.locales = locales;\n const defaultLocale = (Object.keys(locales) as Languages[]).filter((l) => (locales[l] as Locale).default).shift();\n if (defaultLocale) {\n i18n.defaultLocale = defaultLocale || selectedLocale;\n }\n document.documentElement.setAttribute('lang', selectedLocale);\n await loadAndSetLocale(selectedLocale);\n}\n\nfunction addOnChangeListener(listener: Listener) {\n onChangeLocale.push(listener);\n}\n\nasync function loadAndSetLocale(newLocale: Languages) {\n if (i18n.currentLocale === newLocale) {\n return;\n }\n\n const resolvedLocale = supported(newLocale) ? newLocale : i18n.defaultLocale;\n i18n.currentLocale = resolvedLocale;\n t = setGuiLanguage(newLocale);\n I18N.agree = t('I18n', 'agree');\n I18N.disagree = t('I18n', 'disagree');\n I18N.cancel = t('I18n', 'cancel');\n I18N.save = t('I18n', 'save');\n I18N.editRepeat = t('I18n', 'editRepeat');\n I18N.createRepeat = t('I18n', 'createRepeat');\n I18N.deleteItem = t('I18n', 'deleteItem');\n I18N.pickOne = t('I18n', 'pickOne');\n I18N.pickOneOrMore = t('I18n', 'pickOneOrMore');\n onChangeLocale.forEach((listener) => listener(i18n.currentLocale, dir()));\n}\n\nfunction supported(locale: Languages) {\n return Object.keys(i18n.locales).indexOf(locale) >= 0;\n}\n\nfunction dir(locale = i18n.currentLocale) {\n return (i18n.locales[locale] as Locale).dir || 'ltr';\n}\n","const t=[[/\\r\\n/g,\"\\n\"],[/\\n(#+)(.*)/g,(t,n,e=\"\")=>{const r=n.length;return`${e.trim()}`}],[/!\\[([^\\[]+)\\]\\((?:javascript:)?([^\\)]+)\\)/g,'\"$1\"'],[/\\[([^\\[]+)\\]\\((?:javascript:)?([^\\)]+)\\)/g,'
      $1'],[/([^\\\\])(\\*\\*|__)(.*?(_|\\*)?)\\2/g,\"$1$3\"],[/([^\\\\])(\\*|_)(.*?)\\2/g,\"$1$3\"],[/\\\\_/g,\"_\"],[/\\~\\~(.*?)\\~\\~/g,\"$1\"],[/\\:\\\"(.*?)\\\"\\:/g,\"$1\"],[/\\n\\s*```\\n([^]*?)\\n\\s*```\\s*\\n/g,\"\\n
      $1
      \"],[/`(.*?)`/g,(t,n)=>`${(t=>{t=t.replace(/\\&/g,\"&\");const n=\"'#<>`*-~_=:\\\"![]()nt\",e=n.length;for(let r=0;r`&#${t.charCodeAt(0)};`);return t})(n)}`],[/\\n(\\*|\\-|\\+)(.*)/g,(t,n,e=\"\")=>`
        \\n\\t
      • ${e.trim()}
      • \\n
      `],[/\\n[0-9]+\\.(.*)/g,(t,n=\"\")=>`
        \\n\\t
      1. ${n.trim()}
      2. \\n
      `],[/\\n(>|\\>)(.*)/g,(t,n,e=\"\")=>`\\n
      ${e.trim()}
      `],[/(\\^)(.*?)\\1/g,\"$2\"],[/(\\~)(.*?)\\1/g,\"$2\"],[/\\n-{5,}/g,\"\\n
      \"],[/( *\\|[^\\n]+\\|\\r?\\n)((?: *\\|:?[ -]+:?)+ *\\|)(\\n(?: *\\|[^\\n]+\\|\\r?\\n?)*)?/g,(t,n,e,r)=>{const l=e.split(\"|\").filter((t,n,e)=>n>0&&n/:-+:/g.test(t)?\"center\":/-+:/g.test(t)?\"right\":/:-+/.test(t)?\"left\":\"\"),g=t=>{const n=l[t];return n?` align=\"${n}\"`:\"\"};return`\\n${n.split(\"|\").map(t=>t.trim()).filter(t=>t&&t.length).map((t,n)=>`${t}`).join(\"\")}${r.split(\"\\n\").map(t=>t.trim()).filter(t=>t&&t.length).map(t=>`${t.split(\"|\").filter((t,n,e)=>n>0&&n`${t.trim()}`).join(\"\")}`).join(\"\")}
      \\n`}],[/\\n([^\\n]+)\\n/g,(t,n)=>{const e=n.trim();return/^<\\/?(ul|ol|li|h|p|bl|table|tr|td)/i.test(e)?`\\n${n}\\n`:`\\n

      \\n${e}\\n

      \\n`}],[/\\s?<\\/ul>\\s?'),this.$slides.each(function(t,e){var i=s('
    5. ');n.$indicators.append(i[0])}),this.$el.append(this.$indicators[0]),this.$indicators=this.$indicators.children(\"li.indicator-item\"))}},{key:\"_removeIndicators\",value:function(){this.$el.find(\"ul.indicators\").remove()}},{key:\"set\",value:function(t){var e=this;if(t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.activeIndex!=t){this.$active=this.$slides.eq(this.activeIndex);var i=this.$active.find(\".caption\");this.$active.removeClass(\"active\"),o({targets:this.$active[0],opacity:0,duration:this.options.duration,easing:\"easeOutQuad\",complete:function(){e.$slides.not(\".active\").each(function(t){o({targets:t,opacity:0,translateX:0,translateY:0,duration:0,easing:\"easeOutQuad\"})})}}),this._animateCaptionIn(i[0],this.options.duration),this.options.indicators&&(this.$indicators.eq(this.activeIndex).removeClass(\"active\"),this.$indicators.eq(t).addClass(\"active\")),o({targets:this.$slides.eq(t)[0],opacity:1,duration:this.options.duration,easing:\"easeOutQuad\"}),o({targets:this.$slides.eq(t).find(\".caption\")[0],opacity:1,translateX:0,translateY:0,duration:this.options.duration,delay:this.options.duration,easing:\"easeOutQuad\"}),this.$slides.eq(t).addClass(\"active\"),this.activeIndex=t,this.start()}}},{key:\"pause\",value:function(){clearInterval(this.interval)}},{key:\"start\",value:function(){clearInterval(this.interval),this.interval=setInterval(this._handleIntervalBound,this.options.duration+this.options.interval)}},{key:\"next\",value:function(){var t=this.activeIndex+1;t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.set(t)}},{key:\"prev\",value:function(){var t=this.activeIndex-1;t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.set(t)}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Slider}},{key:\"defaults\",get:function(){return e}}]),n}();M.Slider=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"slider\",\"M_Slider\")}(cash,M.anime),function(n,s){n(document).on(\"click\",\".card\",function(t){if(n(this).children(\".card-reveal\").length){var i=n(t.target).closest(\".card\");void 0===i.data(\"initialOverflow\")&&i.data(\"initialOverflow\",void 0===i.css(\"overflow\")?\"\":i.css(\"overflow\"));var e=n(this).find(\".card-reveal\");n(t.target).is(n(\".card-reveal .card-title\"))||n(t.target).is(n(\".card-reveal .card-title i\"))?s({targets:e[0],translateY:0,duration:225,easing:\"easeInOutQuad\",complete:function(t){var e=t.animatables[0].target;n(e).css({display:\"none\"}),i.css(\"overflow\",i.data(\"initialOverflow\"))}}):(n(t.target).is(n(\".card .activator\"))||n(t.target).is(n(\".card .activator i\")))&&(i.css(\"overflow\",\"hidden\"),e.css({display:\"block\"}),s({targets:e[0],translateY:\"-100%\",duration:300,easing:\"easeInOutQuad\"}))}})}(cash,M.anime),function(h){\"use strict\";var e={data:[],placeholder:\"\",secondaryPlaceholder:\"\",autocompleteOptions:{},limit:1/0,onChipAdd:null,onChipSelect:null,onChipDelete:null},t=function(t){function l(t,e){_classCallCheck(this,l);var i=_possibleConstructorReturn(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l,t,e));return(i.el.M_Chips=i).options=h.extend({},l.defaults,e),i.$el.addClass(\"chips input-field\"),i.chipsData=[],i.$chips=h(),i._setupInput(),i.hasAutocomplete=0\"),this.$el.append(this.$input)),this.$input.addClass(\"input\")}},{key:\"_setupLabel\",value:function(){this.$label=this.$el.find(\"label\"),this.$label.length&&this.$label.setAttribute(\"for\",this.$input.attr(\"id\"))}},{key:\"_setPlaceholder\",value:function(){void 0!==this.chipsData&&!this.chipsData.length&&this.options.placeholder?h(this.$input).prop(\"placeholder\",this.options.placeholder):(void 0===this.chipsData||this.chipsData.length)&&this.options.secondaryPlaceholder&&h(this.$input).prop(\"placeholder\",this.options.secondaryPlaceholder)}},{key:\"_isValid\",value:function(t){if(t.hasOwnProperty(\"tag\")&&\"\"!==t.tag){for(var e=!1,i=0;i=this.options.limit)){var e=this._renderChip(t);this.$chips.add(e),this.chipsData.push(t),h(this.$input).before(e),this._setPlaceholder(),\"function\"==typeof this.options.onChipAdd&&this.options.onChipAdd.call(this,this.$el,e)}}},{key:\"deleteChip\",value:function(t){var e=this.$chips.eq(t);this.$chips.eq(t).remove(),this.$chips=this.$chips.filter(function(t){return 0<=h(t).index()}),this.chipsData.splice(t,1),this._setPlaceholder(),\"function\"==typeof this.options.onChipDelete&&this.options.onChipDelete.call(this,this.$el,e[0])}},{key:\"selectChip\",value:function(t){var e=this.$chips.eq(t);(this._selectedChip=e)[0].focus(),\"function\"==typeof this.options.onChipSelect&&this.options.onChipSelect.call(this,this.$el,e[0])}}],[{key:\"init\",value:function(t,e){return _get(l.__proto__||Object.getPrototypeOf(l),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Chips}},{key:\"_handleChipsKeydown\",value:function(t){l._keydown=!0;var e=h(t.target).closest(\".chips\"),i=t.target&&e.length;if(!h(t.target).is(\"input, textarea\")&&i){var n=e[0].M_Chips;if(8===t.keyCode||46===t.keyCode){t.preventDefault();var s=n.chipsData.length;if(n._selectedChip){var o=n._selectedChip.index();n.deleteChip(o),n._selectedChip=null,s=Math.max(o-1,0)}n.chipsData.length&&n.selectChip(s)}else if(37===t.keyCode){if(n._selectedChip){var a=n._selectedChip.index()-1;if(a<0)return;n.selectChip(a)}}else if(39===t.keyCode&&n._selectedChip){var r=n._selectedChip.index()+1;r>=n.chipsData.length?n.$input[0].focus():n.selectChip(r)}}}},{key:\"_handleChipsKeyup\",value:function(t){l._keydown=!1}},{key:\"_handleChipsBlur\",value:function(t){l._keydown||(h(t.target).closest(\".chips\")[0].M_Chips._selectedChip=null)}},{key:\"defaults\",get:function(){return e}}]),l}();t._keydown=!1,M.Chips=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"chips\",\"M_Chips\"),h(document).ready(function(){h(document.body).on(\"click\",\".chip .close\",function(){var t=h(this).closest(\".chips\");t.length&&t[0].M_Chips||h(this).closest(\".chip\").remove()})})}(cash),function(s){\"use strict\";var e={top:0,bottom:1/0,offset:0,onPositionChange:null},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Pushpin=i).options=s.extend({},n.defaults,e),i.originalOffset=i.el.offsetTop,n._pushpins.push(i),i._setupEventHandlers(),i._updatePosition(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this.el.style.top=null,this._removePinClasses(),this._removeEventHandlers();var t=n._pushpins.indexOf(this);n._pushpins.splice(t,1)}},{key:\"_setupEventHandlers\",value:function(){document.addEventListener(\"scroll\",n._updateElements)}},{key:\"_removeEventHandlers\",value:function(){document.removeEventListener(\"scroll\",n._updateElements)}},{key:\"_updatePosition\",value:function(){var t=M.getDocumentScrollTop()+this.options.offset;this.options.top<=t&&this.options.bottom>=t&&!this.el.classList.contains(\"pinned\")&&(this._removePinClasses(),this.el.style.top=this.options.offset+\"px\",this.el.classList.add(\"pinned\"),\"function\"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,\"pinned\")),tthis.options.bottom&&!this.el.classList.contains(\"pin-bottom\")&&(this._removePinClasses(),this.el.classList.add(\"pin-bottom\"),this.el.style.top=this.options.bottom-this.originalOffset+\"px\",\"function\"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,\"pin-bottom\"))}},{key:\"_removePinClasses\",value:function(){this.el.classList.remove(\"pin-top\"),this.el.classList.remove(\"pinned\"),this.el.classList.remove(\"pin-bottom\")}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Pushpin}},{key:\"_updateElements\",value:function(){for(var t in n._pushpins){n._pushpins[t]._updatePosition()}}},{key:\"defaults\",get:function(){return e}}]),n}();t._pushpins=[],M.Pushpin=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"pushpin\",\"M_Pushpin\")}(cash),function(r,s){\"use strict\";var e={direction:\"top\",hoverEnabled:!0,toolbarEnabled:!1};r.fn.reverse=[].reverse;var t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_FloatingActionButton=i).options=r.extend({},n.defaults,e),i.isOpen=!1,i.$anchor=i.$el.children(\"a\").first(),i.$menu=i.$el.children(\"ul\").first(),i.$floatingBtns=i.$el.find(\"ul .btn-floating\"),i.$floatingBtnsReverse=i.$el.find(\"ul .btn-floating\").reverse(),i.offsetY=0,i.offsetX=0,i.$el.addClass(\"direction-\"+i.options.direction),\"top\"===i.options.direction?i.offsetY=40:\"right\"===i.options.direction?i.offsetX=-40:\"bottom\"===i.options.direction?i.offsetY=-40:i.offsetX=40,i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.M_FloatingActionButton=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleFABClickBound=this._handleFABClick.bind(this),this._handleOpenBound=this.open.bind(this),this._handleCloseBound=this.close.bind(this),this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.addEventListener(\"mouseenter\",this._handleOpenBound),this.el.addEventListener(\"mouseleave\",this._handleCloseBound)):this.el.addEventListener(\"click\",this._handleFABClickBound)}},{key:\"_removeEventHandlers\",value:function(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.removeEventListener(\"mouseenter\",this._handleOpenBound),this.el.removeEventListener(\"mouseleave\",this._handleCloseBound)):this.el.removeEventListener(\"click\",this._handleFABClickBound)}},{key:\"_handleFABClick\",value:function(){this.isOpen?this.close():this.open()}},{key:\"_handleDocumentClick\",value:function(t){r(t.target).closest(this.$menu).length||this.close()}},{key:\"open\",value:function(){this.isOpen||(this.options.toolbarEnabled?this._animateInToolbar():this._animateInFAB(),this.isOpen=!0)}},{key:\"close\",value:function(){this.isOpen&&(this.options.toolbarEnabled?(window.removeEventListener(\"scroll\",this._handleCloseBound,!0),document.body.removeEventListener(\"click\",this._handleDocumentClickBound,!0),this._animateOutToolbar()):this._animateOutFAB(),this.isOpen=!1)}},{key:\"_animateInFAB\",value:function(){var e=this;this.$el.addClass(\"active\");var i=0;this.$floatingBtnsReverse.each(function(t){s({targets:t,opacity:1,scale:[.4,1],translateY:[e.offsetY,0],translateX:[e.offsetX,0],duration:275,delay:i,easing:\"easeInOutQuad\"}),i+=40})}},{key:\"_animateOutFAB\",value:function(){var e=this;this.$floatingBtnsReverse.each(function(t){s.remove(t),s({targets:t,opacity:0,scale:.4,translateY:e.offsetY,translateX:e.offsetX,duration:175,easing:\"easeOutQuad\",complete:function(){e.$el.removeClass(\"active\")}})})}},{key:\"_animateInToolbar\",value:function(){var t,e=this,i=window.innerWidth,n=window.innerHeight,s=this.el.getBoundingClientRect(),o=r('
      '),a=this.$anchor.css(\"background-color\");this.$anchor.append(o),this.offsetX=s.left-i/2+s.width/2,this.offsetY=n-s.bottom,t=i/o[0].clientWidth,this.btnBottom=s.bottom,this.btnLeft=s.left,this.btnWidth=s.width,this.$el.addClass(\"active\"),this.$el.css({\"text-align\":\"center\",width:\"100%\",bottom:0,left:0,transform:\"translateX(\"+this.offsetX+\"px)\",transition:\"none\"}),this.$anchor.css({transform:\"translateY(\"+-this.offsetY+\"px)\",transition:\"none\"}),o.css({\"background-color\":a}),setTimeout(function(){e.$el.css({transform:\"\",transition:\"transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s\"}),e.$anchor.css({overflow:\"visible\",transform:\"\",transition:\"transform .2s\"}),setTimeout(function(){e.$el.css({overflow:\"hidden\",\"background-color\":a}),o.css({transform:\"scale(\"+t+\")\",transition:\"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)\"}),e.$menu.children(\"li\").children(\"a\").css({opacity:1}),e._handleDocumentClickBound=e._handleDocumentClick.bind(e),window.addEventListener(\"scroll\",e._handleCloseBound,!0),document.body.addEventListener(\"click\",e._handleDocumentClickBound,!0)},100)},0)}},{key:\"_animateOutToolbar\",value:function(){var t=this,e=window.innerWidth,i=window.innerHeight,n=this.$el.find(\".fab-backdrop\"),s=this.$anchor.css(\"background-color\");this.offsetX=this.btnLeft-e/2+this.btnWidth/2,this.offsetY=i-this.btnBottom,this.$el.removeClass(\"active\"),this.$el.css({\"background-color\":\"transparent\",transition:\"none\"}),this.$anchor.css({transition:\"none\"}),n.css({transform:\"scale(0)\",\"background-color\":s}),this.$menu.children(\"li\").children(\"a\").css({opacity:\"\"}),setTimeout(function(){n.remove(),t.$el.css({\"text-align\":\"\",width:\"\",bottom:\"\",left:\"\",overflow:\"\",\"background-color\":\"\",transform:\"translate3d(\"+-t.offsetX+\"px,0,0)\"}),t.$anchor.css({overflow:\"\",transform:\"translate3d(0,\"+t.offsetY+\"px,0)\"}),setTimeout(function(){t.$el.css({transform:\"translate3d(0,0,0)\",transition:\"transform .2s\"}),t.$anchor.css({transform:\"translate3d(0,0,0)\",transition:\"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)\"})},20)},200)}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_FloatingActionButton}},{key:\"defaults\",get:function(){return e}}]),n}();M.FloatingActionButton=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"floatingActionButton\",\"M_FloatingActionButton\")}(cash,M.anime),function(g){\"use strict\";var e={autoClose:!1,format:\"mmm dd, yyyy\",parse:null,defaultDate:null,setDefaultDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,container:null,showClearBtn:!1,i18n:{cancel:\"Cancel\",clear:\"Clear\",done:\"Ok\",previousMonth:\"‹\",nextMonth:\"›\",months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthsShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],weekdays:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],weekdaysShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],weekdaysAbbrev:[\"S\",\"M\",\"T\",\"W\",\"T\",\"F\",\"S\"]},events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},t=function(t){function B(t,e){_classCallCheck(this,B);var i=_possibleConstructorReturn(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,B,t,e));(i.el.M_Datepicker=i).options=g.extend({},B.defaults,e),e&&e.hasOwnProperty(\"i18n\")&&\"object\"==typeof e.i18n&&(i.options.i18n=g.extend({},B.defaults.i18n,e.i18n)),i.options.minDate&&i.options.minDate.setHours(0,0,0,0),i.options.maxDate&&i.options.maxDate.setHours(0,0,0,0),i.id=M.guid(),i._setupVariables(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupEventHandlers(),i.options.defaultDate||(i.options.defaultDate=new Date(Date.parse(i.el.value)));var n=i.options.defaultDate;return B._isDate(n)?i.options.setDefaultDate?(i.setDate(n,!0),i.setInputValue()):i.gotoDate(n):i.gotoDate(new Date),i.isOpen=!1,i}return _inherits(B,Component),_createClass(B,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.modal.destroy(),g(this.modalEl).remove(),this.destroySelects(),this.el.M_Datepicker=void 0}},{key:\"destroySelects\",value:function(){var t=this.calendarEl.querySelector(\".orig-select-year\");t&&M.FormSelect.getInstance(t).destroy();var e=this.calendarEl.querySelector(\".orig-select-month\");e&&M.FormSelect.getInstance(e).destroy()}},{key:\"_insertHTMLIntoDOM\",value:function(){this.options.showClearBtn&&(g(this.clearBtn).css({visibility:\"\"}),this.clearBtn.innerHTML=this.options.i18n.clear),this.doneBtn.innerHTML=this.options.i18n.done,this.cancelBtn.innerHTML=this.options.i18n.cancel,this.options.container?this.$modalEl.appendTo(this.options.container):this.$modalEl.insertBefore(this.el)}},{key:\"_setupModal\",value:function(){var t=this;this.modalEl.id=\"modal-\"+this.id,this.modal=M.Modal.init(this.modalEl,{onCloseEnd:function(){t.isOpen=!1}})}},{key:\"toString\",value:function(t){var e=this;return t=t||this.options.format,B._isDate(this.date)?t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(function(t){return e.formats[t]?e.formats[t]():t}).join(\"\"):\"\"}},{key:\"setDate\",value:function(t,e){if(!t)return this.date=null,this._renderDateDisplay(),this.draw();if(\"string\"==typeof t&&(t=new Date(Date.parse(t))),B._isDate(t)){var i=this.options.minDate,n=this.options.maxDate;B._isDate(i)&&tn.maxDate||n.disableWeekends&&B._isWeekend(y)||n.disableDayFn&&n.disableDayFn(y),isEmpty:C,isStartRange:x,isEndRange:L,isInRange:T,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths};l.push(this.renderDay($)),7==++_&&(r.push(this.renderRow(l,n.isRTL,m)),_=0,m=!(l=[]))}return this.renderTable(n,r,i)}},{key:\"renderDay\",value:function(t){var e=[],i=\"false\";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'';e.push(\"is-outside-current-month\"),e.push(\"is-selection-disabled\")}return t.isDisabled&&e.push(\"is-disabled\"),t.isToday&&e.push(\"is-today\"),t.isSelected&&(e.push(\"is-selected\"),i=\"true\"),t.hasEvent&&e.push(\"has-event\"),t.isInRange&&e.push(\"is-inrange\"),t.isStartRange&&e.push(\"is-startrange\"),t.isEndRange&&e.push(\"is-endrange\"),'\"}},{key:\"renderRow\",value:function(t,e,i){return''+(e?t.reverse():t).join(\"\")+\"\"}},{key:\"renderTable\",value:function(t,e,i){return'
      '+this.renderHead(t)+this.renderBody(e)+\"
      \"}},{key:\"renderHead\",value:function(t){var e=void 0,i=[];for(e=0;e<7;e++)i.push(''+this.renderDayName(t,e,!0)+\"\");return\"\"+(t.isRTL?i.reverse():i).join(\"\")+\"\"}},{key:\"renderBody\",value:function(t){return\"\"+t.join(\"\")+\"\"}},{key:\"renderTitle\",value:function(t,e,i,n,s,o){var a,r,l=void 0,h=void 0,d=void 0,u=this.options,c=i===u.minYear,p=i===u.maxYear,v='
      ',f=!0,m=!0;for(d=[],l=0;l<12;l++)d.push('\");for(a='\",g.isArray(u.yearRange)?(l=u.yearRange[0],h=u.yearRange[1]+1):(l=i-u.yearRange,h=1+i+u.yearRange),d=[];l=u.minYear&&d.push('\");r='\";v+='',v+='
      ',u.showMonthAfterYear?v+=r+a:v+=a+r,v+=\"
      \",c&&(0===n||u.minMonth>=n)&&(f=!1),p&&(11===n||u.maxMonth<=n)&&(m=!1);return(v+='')+\"
      \"}},{key:\"draw\",value:function(t){if(this.isOpen||t){var e,i=this.options,n=i.minYear,s=i.maxYear,o=i.minMonth,a=i.maxMonth,r=\"\";this._y<=n&&(this._y=n,!isNaN(o)&&this._m=s&&(this._y=s,!isNaN(a)&&this._m>a&&(this._m=a)),e=\"datepicker-title-\"+Math.random().toString(36).replace(/[^a-z]+/g,\"\").substr(0,2);for(var l=0;l<1;l++)this._renderDateDisplay(),r+=this.renderTitle(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,e)+this.render(this.calendars[l].year,this.calendars[l].month,e);this.destroySelects(),this.calendarEl.innerHTML=r;var h=this.calendarEl.querySelector(\".orig-select-year\"),d=this.calendarEl.querySelector(\".orig-select-month\");M.FormSelect.init(h,{classes:\"select-year\",dropdownOptions:{container:document.body,constrainWidth:!1}}),M.FormSelect.init(d,{classes:\"select-month\",dropdownOptions:{container:document.body,constrainWidth:!1}}),h.addEventListener(\"change\",this._handleYearChange.bind(this)),d.addEventListener(\"change\",this._handleMonthChange.bind(this)),\"function\"==typeof this.options.onDraw&&this.options.onDraw(this)}}},{key:\"_setupEventHandlers\",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleInputChangeBound=this._handleInputChange.bind(this),this._handleCalendarClickBound=this._handleCalendarClick.bind(this),this._finishSelectionBound=this._finishSelection.bind(this),this._handleMonthChange=this._handleMonthChange.bind(this),this._closeBound=this.close.bind(this),this.el.addEventListener(\"click\",this._handleInputClickBound),this.el.addEventListener(\"keydown\",this._handleInputKeydownBound),this.el.addEventListener(\"change\",this._handleInputChangeBound),this.calendarEl.addEventListener(\"click\",this._handleCalendarClickBound),this.doneBtn.addEventListener(\"click\",this._finishSelectionBound),this.cancelBtn.addEventListener(\"click\",this._closeBound),this.options.showClearBtn&&(this._handleClearClickBound=this._handleClearClick.bind(this),this.clearBtn.addEventListener(\"click\",this._handleClearClickBound))}},{key:\"_setupVariables\",value:function(){var e=this;this.$modalEl=g(B._template),this.modalEl=this.$modalEl[0],this.calendarEl=this.modalEl.querySelector(\".datepicker-calendar\"),this.yearTextEl=this.modalEl.querySelector(\".year-text\"),this.dateTextEl=this.modalEl.querySelector(\".date-text\"),this.options.showClearBtn&&(this.clearBtn=this.modalEl.querySelector(\".datepicker-clear\")),this.doneBtn=this.modalEl.querySelector(\".datepicker-done\"),this.cancelBtn=this.modalEl.querySelector(\".datepicker-cancel\"),this.formats={d:function(){return e.date.getDate()},dd:function(){var t=e.date.getDate();return(t<10?\"0\":\"\")+t},ddd:function(){return e.options.i18n.weekdaysShort[e.date.getDay()]},dddd:function(){return e.options.i18n.weekdays[e.date.getDay()]},m:function(){return e.date.getMonth()+1},mm:function(){var t=e.date.getMonth()+1;return(t<10?\"0\":\"\")+t},mmm:function(){return e.options.i18n.monthsShort[e.date.getMonth()]},mmmm:function(){return e.options.i18n.months[e.date.getMonth()]},yy:function(){return(\"\"+e.date.getFullYear()).slice(2)},yyyy:function(){return e.date.getFullYear()}}}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"click\",this._handleInputClickBound),this.el.removeEventListener(\"keydown\",this._handleInputKeydownBound),this.el.removeEventListener(\"change\",this._handleInputChangeBound),this.calendarEl.removeEventListener(\"click\",this._handleCalendarClickBound)}},{key:\"_handleInputClick\",value:function(){this.open()}},{key:\"_handleInputKeydown\",value:function(t){t.which===M.keys.ENTER&&(t.preventDefault(),this.open())}},{key:\"_handleCalendarClick\",value:function(t){if(this.isOpen){var e=g(t.target);e.hasClass(\"is-disabled\")||(!e.hasClass(\"datepicker-day-button\")||e.hasClass(\"is-empty\")||e.parent().hasClass(\"is-disabled\")?e.closest(\".month-prev\").length?this.prevMonth():e.closest(\".month-next\").length&&this.nextMonth():(this.setDate(new Date(t.target.getAttribute(\"data-year\"),t.target.getAttribute(\"data-month\"),t.target.getAttribute(\"data-day\"))),this.options.autoClose&&this._finishSelection()))}}},{key:\"_handleClearClick\",value:function(){this.date=null,this.setInputValue(),this.close()}},{key:\"_handleMonthChange\",value:function(t){this.gotoMonth(t.target.value)}},{key:\"_handleYearChange\",value:function(t){this.gotoYear(t.target.value)}},{key:\"gotoMonth\",value:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}},{key:\"gotoYear\",value:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}},{key:\"_handleInputChange\",value:function(t){var e=void 0;t.firedBy!==this&&(e=this.options.parse?this.options.parse(this.el.value,this.options.format):new Date(Date.parse(this.el.value)),B._isDate(e)&&this.setDate(e))}},{key:\"renderDayName\",value:function(t,e,i){for(e+=t.firstDay;7<=e;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}},{key:\"_finishSelection\",value:function(){this.setInputValue(),this.close()}},{key:\"open\",value:function(){if(!this.isOpen)return this.isOpen=!0,\"function\"==typeof this.options.onOpen&&this.options.onOpen.call(this),this.draw(),this.modal.open(),this}},{key:\"close\",value:function(){if(this.isOpen)return this.isOpen=!1,\"function\"==typeof this.options.onClose&&this.options.onClose.call(this),this.modal.close(),this}}],[{key:\"init\",value:function(t,e){return _get(B.__proto__||Object.getPrototypeOf(B),\"init\",this).call(this,this,t,e)}},{key:\"_isDate\",value:function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}},{key:\"_isWeekend\",value:function(t){var e=t.getDay();return 0===e||6===e}},{key:\"_setToStartOfDay\",value:function(t){B._isDate(t)&&t.setHours(0,0,0,0)}},{key:\"_getDaysInMonth\",value:function(t,e){return[31,B._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}},{key:\"_isLeapYear\",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:\"_compareDates\",value:function(t,e){return t.getTime()===e.getTime()}},{key:\"_setToStartOfDay\",value:function(t){B._isDate(t)&&t.setHours(0,0,0,0)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Datepicker}},{key:\"defaults\",get:function(){return e}}]),B}();t._template=['
      ','
      ','
      ','','',\"
      \",'
      ','
      ','
      ','','
      ','','',\"
      \",\"
      \",\"
      \",\"
      \",\"
      \"].join(\"\"),M.Datepicker=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"datepicker\",\"M_Datepicker\")}(cash),function(h){\"use strict\";var e={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:\"now\",fromNow:0,showClearBtn:!1,i18n:{cancel:\"Cancel\",clear:\"Clear\",done:\"Ok\"},autoClose:!1,twelveHour:!0,vibrate:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onSelect:null},t=function(t){function f(t,e){_classCallCheck(this,f);var i=_possibleConstructorReturn(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,f,t,e));return(i.el.M_Timepicker=i).options=h.extend({},f.defaults,e),i.id=M.guid(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupVariables(),i._setupEventHandlers(),i._clockSetup(),i._pickerSetup(),i}return _inherits(f,Component),_createClass(f,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.modal.destroy(),h(this.modalEl).remove(),this.el.M_Timepicker=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleClockClickStartBound=this._handleClockClickStart.bind(this),this._handleDocumentClickMoveBound=this._handleDocumentClickMove.bind(this),this._handleDocumentClickEndBound=this._handleDocumentClickEnd.bind(this),this.el.addEventListener(\"click\",this._handleInputClickBound),this.el.addEventListener(\"keydown\",this._handleInputKeydownBound),this.plate.addEventListener(\"mousedown\",this._handleClockClickStartBound),this.plate.addEventListener(\"touchstart\",this._handleClockClickStartBound),h(this.spanHours).on(\"click\",this.showView.bind(this,\"hours\")),h(this.spanMinutes).on(\"click\",this.showView.bind(this,\"minutes\"))}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"click\",this._handleInputClickBound),this.el.removeEventListener(\"keydown\",this._handleInputKeydownBound)}},{key:\"_handleInputClick\",value:function(){this.open()}},{key:\"_handleInputKeydown\",value:function(t){t.which===M.keys.ENTER&&(t.preventDefault(),this.open())}},{key:\"_handleClockClickStart\",value:function(t){t.preventDefault();var e=this.plate.getBoundingClientRect(),i=e.left,n=e.top;this.x0=i+this.options.dialRadius,this.y0=n+this.options.dialRadius,this.moved=!1;var s=f._Pos(t);this.dx=s.x-this.x0,this.dy=s.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener(\"mousemove\",this._handleDocumentClickMoveBound),document.addEventListener(\"touchmove\",this._handleDocumentClickMoveBound),document.addEventListener(\"mouseup\",this._handleDocumentClickEndBound),document.addEventListener(\"touchend\",this._handleDocumentClickEndBound)}},{key:\"_handleDocumentClickMove\",value:function(t){t.preventDefault();var e=f._Pos(t),i=e.x-this.x0,n=e.y-this.y0;this.moved=!0,this.setHand(i,n,!1,!0)}},{key:\"_handleDocumentClickEnd\",value:function(t){var e=this;t.preventDefault(),document.removeEventListener(\"mouseup\",this._handleDocumentClickEndBound),document.removeEventListener(\"touchend\",this._handleDocumentClickEndBound);var i=f._Pos(t),n=i.x-this.x0,s=i.y-this.y0;this.moved&&n===this.dx&&s===this.dy&&this.setHand(n,s),\"hours\"===this.currentView?this.showView(\"minutes\",this.options.duration/2):this.options.autoClose&&(h(this.minutesView).addClass(\"timepicker-dial-out\"),setTimeout(function(){e.done()},this.options.duration/2)),\"function\"==typeof this.options.onSelect&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener(\"mousemove\",this._handleDocumentClickMoveBound),document.removeEventListener(\"touchmove\",this._handleDocumentClickMoveBound)}},{key:\"_insertHTMLIntoDOM\",value:function(){this.$modalEl=h(f._template),this.modalEl=this.$modalEl[0],this.modalEl.id=\"modal-\"+this.id;var t=document.querySelector(this.options.container);this.options.container&&t?this.$modalEl.appendTo(t):this.$modalEl.insertBefore(this.el)}},{key:\"_setupModal\",value:function(){var t=this;this.modal=M.Modal.init(this.modalEl,{onOpenStart:this.options.onOpenStart,onOpenEnd:this.options.onOpenEnd,onCloseStart:this.options.onCloseStart,onCloseEnd:function(){\"function\"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t),t.isOpen=!1}})}},{key:\"_setupVariables\",value:function(){this.currentView=\"hours\",this.vibrate=navigator.vibrate?\"vibrate\":navigator.webkitVibrate?\"webkitVibrate\":null,this._canvas=this.modalEl.querySelector(\".timepicker-canvas\"),this.plate=this.modalEl.querySelector(\".timepicker-plate\"),this.hoursView=this.modalEl.querySelector(\".timepicker-hours\"),this.minutesView=this.modalEl.querySelector(\".timepicker-minutes\"),this.spanHours=this.modalEl.querySelector(\".timepicker-span-hours\"),this.spanMinutes=this.modalEl.querySelector(\".timepicker-span-minutes\"),this.spanAmPm=this.modalEl.querySelector(\".timepicker-span-am-pm\"),this.footer=this.modalEl.querySelector(\".timepicker-footer\"),this.amOrPm=\"PM\"}},{key:\"_pickerSetup\",value:function(){var t=h('\").appendTo(this.footer).on(\"click\",this.clear.bind(this));this.options.showClearBtn&&t.css({visibility:\"\"});var e=h('
      ');h('\").appendTo(e).on(\"click\",this.close.bind(this)),h('\").appendTo(e).on(\"click\",this.done.bind(this)),e.appendTo(this.footer)}},{key:\"_clockSetup\",value:function(){this.options.twelveHour&&(this.$amBtn=h('
      AM
      '),this.$pmBtn=h('
      PM
      '),this.$amBtn.on(\"click\",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm),this.$pmBtn.on(\"click\",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}},{key:\"_buildSVGClock\",value:function(){var t=this.options.dialRadius,e=this.options.tickRadius,i=2*t,n=f._createSVGEl(\"svg\");n.setAttribute(\"class\",\"timepicker-svg\"),n.setAttribute(\"width\",i),n.setAttribute(\"height\",i);var s=f._createSVGEl(\"g\");s.setAttribute(\"transform\",\"translate(\"+t+\",\"+t+\")\");var o=f._createSVGEl(\"circle\");o.setAttribute(\"class\",\"timepicker-canvas-bearing\"),o.setAttribute(\"cx\",0),o.setAttribute(\"cy\",0),o.setAttribute(\"r\",4);var a=f._createSVGEl(\"line\");a.setAttribute(\"x1\",0),a.setAttribute(\"y1\",0);var r=f._createSVGEl(\"circle\");r.setAttribute(\"class\",\"timepicker-canvas-bg\"),r.setAttribute(\"r\",e),s.appendChild(a),s.appendChild(r),s.appendChild(o),n.appendChild(s),this._canvas.appendChild(n),this.hand=a,this.bg=r,this.bearing=o,this.g=s}},{key:\"_buildHoursView\",value:function(){var t=h('
      ');if(this.options.twelveHour)for(var e=1;e<13;e+=1){var i=t.clone(),n=e/6*Math.PI,s=this.options.outerRadius;i.css({left:this.options.dialRadius+Math.sin(n)*s-this.options.tickRadius+\"px\",top:this.options.dialRadius-Math.cos(n)*s-this.options.tickRadius+\"px\"}),i.html(0===e?\"00\":e),this.hoursView.appendChild(i[0])}else for(var o=0;o<24;o+=1){var a=t.clone(),r=o/6*Math.PI,l=0'),e=0;e<60;e+=5){var i=t.clone(),n=e/30*Math.PI;i.css({left:this.options.dialRadius+Math.sin(n)*this.options.outerRadius-this.options.tickRadius+\"px\",top:this.options.dialRadius-Math.cos(n)*this.options.outerRadius-this.options.tickRadius+\"px\"}),i.html(f._addLeadingZero(e)),this.minutesView.appendChild(i[0])}}},{key:\"_handleAmPmClick\",value:function(t){var e=h(t.target);this.amOrPm=e.hasClass(\"am-btn\")?\"AM\":\"PM\",this._updateAmPmView()}},{key:\"_updateAmPmView\",value:function(){this.options.twelveHour&&(this.$amBtn.toggleClass(\"text-primary\",\"AM\"===this.amOrPm),this.$pmBtn.toggleClass(\"text-primary\",\"PM\"===this.amOrPm))}},{key:\"_updateTimeFromInput\",value:function(){var t=((this.el.value||this.options.defaultTime||\"\")+\"\").split(\":\");if(this.options.twelveHour&&void 0!==t[1]&&(0','
      ','
      ','
      ','
      ','',\":\",'',\"
      \",'
      ','
      ',\"
      \",\"
      \",\"
      \",'
      ','
      ','
      ','
      ','
      ',\"
      \",'
      ',\"
      \",\"
      \",\"\"].join(\"\"),M.Timepicker=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"timepicker\",\"M_Timepicker\")}(cash),function(s){\"use strict\";var e={},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_CharacterCounter=i).options=s.extend({},n.defaults,e),i.isInvalid=!1,i.isValidLength=!1,i._setupCounter(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.CharacterCounter=void 0,this._removeCounter()}},{key:\"_setupEventHandlers\",value:function(){this._handleUpdateCounterBound=this.updateCounter.bind(this),this.el.addEventListener(\"focus\",this._handleUpdateCounterBound,!0),this.el.addEventListener(\"input\",this._handleUpdateCounterBound,!0)}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"focus\",this._handleUpdateCounterBound,!0),this.el.removeEventListener(\"input\",this._handleUpdateCounterBound,!0)}},{key:\"_setupCounter\",value:function(){this.counterEl=document.createElement(\"span\"),s(this.counterEl).addClass(\"character-counter\").css({float:\"right\",\"font-size\":\"12px\",height:1}),this.$el.parent().append(this.counterEl)}},{key:\"_removeCounter\",value:function(){s(this.counterEl).remove()}},{key:\"updateCounter\",value:function(){var t=+this.$el.attr(\"data-length\"),e=this.el.value.length;this.isValidLength=e<=t;var i=e;t&&(i+=\"/\"+t,this._validateInput()),s(this.counterEl).html(i)}},{key:\"_validateInput\",value:function(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.$el.removeClass(\"invalid\")):this.isValidLength||this.isInvalid||(this.isInvalid=!0,this.$el.removeClass(\"valid\"),this.$el.addClass(\"invalid\"))}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_CharacterCounter}},{key:\"defaults\",get:function(){return e}}]),n}();M.CharacterCounter=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"characterCounter\",\"M_CharacterCounter\")}(cash),function(b){\"use strict\";var e={duration:200,dist:-100,shift:0,padding:0,numVisible:5,fullWidth:!1,indicators:!1,noWrap:!1,onCycleTo:null},t=function(t){function i(t,e){_classCallCheck(this,i);var n=_possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i,t,e));return(n.el.M_Carousel=n).options=b.extend({},i.defaults,e),n.hasMultipleSlides=1'),n.$el.find(\".carousel-item\").each(function(t,e){if(n.images.push(t),n.showIndicators){var i=b('
    6. ');0===e&&i[0].classList.add(\"active\"),n.$indicators.append(i)}}),n.showIndicators&&n.$el.append(n.$indicators),n.count=n.images.length,n.options.numVisible=Math.min(n.count,n.options.numVisible),n.xform=\"transform\",[\"webkit\",\"Moz\",\"O\",\"ms\"].every(function(t){var e=t+\"Transform\";return void 0===document.body.style[e]||(n.xform=e,!1)}),n._setupEventHandlers(),n._scroll(n.offset),n}return _inherits(i,Component),_createClass(i,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.M_Carousel=void 0}},{key:\"_setupEventHandlers\",value:function(){var i=this;this._handleCarouselTapBound=this._handleCarouselTap.bind(this),this._handleCarouselDragBound=this._handleCarouselDrag.bind(this),this._handleCarouselReleaseBound=this._handleCarouselRelease.bind(this),this._handleCarouselClickBound=this._handleCarouselClick.bind(this),void 0!==window.ontouchstart&&(this.el.addEventListener(\"touchstart\",this._handleCarouselTapBound),this.el.addEventListener(\"touchmove\",this._handleCarouselDragBound),this.el.addEventListener(\"touchend\",this._handleCarouselReleaseBound)),this.el.addEventListener(\"mousedown\",this._handleCarouselTapBound),this.el.addEventListener(\"mousemove\",this._handleCarouselDragBound),this.el.addEventListener(\"mouseup\",this._handleCarouselReleaseBound),this.el.addEventListener(\"mouseleave\",this._handleCarouselReleaseBound),this.el.addEventListener(\"click\",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&(this._handleIndicatorClickBound=this._handleIndicatorClick.bind(this),this.$indicators.find(\".indicator-item\").each(function(t,e){t.addEventListener(\"click\",i._handleIndicatorClickBound)}));var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_removeEventHandlers\",value:function(){var i=this;void 0!==window.ontouchstart&&(this.el.removeEventListener(\"touchstart\",this._handleCarouselTapBound),this.el.removeEventListener(\"touchmove\",this._handleCarouselDragBound),this.el.removeEventListener(\"touchend\",this._handleCarouselReleaseBound)),this.el.removeEventListener(\"mousedown\",this._handleCarouselTapBound),this.el.removeEventListener(\"mousemove\",this._handleCarouselDragBound),this.el.removeEventListener(\"mouseup\",this._handleCarouselReleaseBound),this.el.removeEventListener(\"mouseleave\",this._handleCarouselReleaseBound),this.el.removeEventListener(\"click\",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&this.$indicators.find(\".indicator-item\").each(function(t,e){t.removeEventListener(\"click\",i._handleIndicatorClickBound)}),window.removeEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_handleCarouselTap\",value:function(t){\"mousedown\"===t.type&&b(t.target).is(\"img\")&&t.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(t),this.referenceY=this._ypos(t),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._trackBound,100)}},{key:\"_handleCarouselDrag\",value:function(t){var e=void 0,i=void 0,n=void 0;if(this.pressed)if(e=this._xpos(t),i=this._ypos(t),n=this.reference-e,Math.abs(this.referenceY-i)<30&&!this.verticalDragged)(2=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScrollBound),this.dragged&&(t.preventDefault(),t.stopPropagation()),!1}},{key:\"_handleCarouselClick\",value:function(t){if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1;if(!this.options.fullWidth){var e=b(t.target).closest(\".carousel-item\").index();0!==this._wrap(this.center)-e&&(t.preventDefault(),t.stopPropagation()),this._cycleTo(e)}}},{key:\"_handleIndicatorClick\",value:function(t){t.stopPropagation();var e=b(t.target).closest(\".indicator-item\");e.length&&this._cycleTo(e.index())}},{key:\"_handleResize\",value:function(t){this.options.fullWidth?(this.itemWidth=this.$el.find(\".carousel-item\").first().innerWidth(),this.imageHeight=this.$el.find(\".carousel-item.active\").height(),this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()}},{key:\"_setCarouselHeight\",value:function(t){var i=this,e=this.$el.find(\".carousel-item.active\").length?this.$el.find(\".carousel-item.active\").first():this.$el.find(\".carousel-item\").first(),n=e.find(\"img\").first();if(n.length)if(n[0].complete){var s=n.height();if(0=this.count?t%this.count:t<0?this._wrap(this.count+t%this.count):t}},{key:\"_track\",value:function(){var t,e,i,n;e=(t=Date.now())-this.timestamp,this.timestamp=t,i=this.offset-this.frame,this.frame=this.offset,n=1e3*i/(1+e),this.velocity=.8*n+.2*this.velocity}},{key:\"_autoScroll\",value:function(){var t=void 0,e=void 0;this.amplitude&&(t=Date.now()-this.timestamp,2<(e=this.amplitude*Math.exp(-t/this.options.duration))||e<-2?(this._scroll(this.target-e),requestAnimationFrame(this._autoScrollBound)):this._scroll(this.target))}},{key:\"_scroll\",value:function(t){var e=this;this.$el.hasClass(\"scrolling\")||this.el.classList.add(\"scrolling\"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout(function(){e.$el.removeClass(\"scrolling\")},this.options.duration);var i,n,s,o,a=void 0,r=void 0,l=void 0,h=void 0,d=void 0,u=void 0,c=this.center,p=1/this.options.numVisible;if(this.offset=\"number\"==typeof t?t:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),o=-(s=(n=this.offset-this.center*this.dim)<0?1:-1)*n*2/this.dim,i=this.count>>1,this.options.fullWidth?(l=\"translateX(0)\",u=1):(l=\"translateX(\"+(this.el.clientWidth-this.itemWidth)/2+\"px) \",l+=\"translateY(\"+(this.el.clientHeight-this.itemHeight)/2+\"px)\",u=1-p*o),this.showIndicators){var v=this.center%this.count,f=this.$indicators.find(\".indicator-item.active\");f.index()!==v&&(f.removeClass(\"active\"),this.$indicators.find(\".indicator-item\").eq(v)[0].classList.add(\"active\"))}if(!this.noWrap||0<=this.center&&this.center=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:\"prev\",value:function(t){(void 0===t||isNaN(t))&&(t=1);var e=this.center-t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:\"set\",value:function(t,e){if((void 0===t||isNaN(t))&&(t=0),t>this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t,e)}}],[{key:\"init\",value:function(t,e){return _get(i.__proto__||Object.getPrototypeOf(i),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Carousel}},{key:\"defaults\",get:function(){return e}}]),i}();M.Carousel=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"carousel\",\"M_Carousel\")}(cash),function(S){\"use strict\";var e={onOpen:void 0,onClose:void 0},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_TapTarget=i).options=S.extend({},n.defaults,e),i.isOpen=!1,i.$origin=S(\"#\"+i.$el.attr(\"data-target\")),i._setup(),i._calculatePositioning(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this.el.TapTarget=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleDocumentClickBound=this._handleDocumentClick.bind(this),this._handleTargetClickBound=this._handleTargetClick.bind(this),this._handleOriginClickBound=this._handleOriginClick.bind(this),this.el.addEventListener(\"click\",this._handleTargetClickBound),this.originEl.addEventListener(\"click\",this._handleOriginClickBound);var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"click\",this._handleTargetClickBound),this.originEl.removeEventListener(\"click\",this._handleOriginClickBound),window.removeEventListener(\"resize\",this._handleThrottledResizeBound)}},{key:\"_handleTargetClick\",value:function(t){this.open()}},{key:\"_handleOriginClick\",value:function(t){this.close()}},{key:\"_handleResize\",value:function(t){this._calculatePositioning()}},{key:\"_handleDocumentClick\",value:function(t){S(t.target).closest(\".tap-target-wrapper\").length||(this.close(),t.preventDefault(),t.stopPropagation())}},{key:\"_setup\",value:function(){this.wrapper=this.$el.parent()[0],this.waveEl=S(this.wrapper).find(\".tap-target-wave\")[0],this.originEl=S(this.wrapper).find(\".tap-target-origin\")[0],this.contentEl=this.$el.find(\".tap-target-content\")[0],S(this.wrapper).hasClass(\".tap-target-wrapper\")||(this.wrapper=document.createElement(\"div\"),this.wrapper.classList.add(\"tap-target-wrapper\"),this.$el.before(S(this.wrapper)),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement(\"div\"),this.contentEl.classList.add(\"tap-target-content\"),this.$el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement(\"div\"),this.waveEl.classList.add(\"tap-target-wave\"),this.originEl||(this.originEl=this.$origin.clone(!0,!0),this.originEl.addClass(\"tap-target-origin\"),this.originEl.removeAttr(\"id\"),this.originEl.removeAttr(\"style\"),this.originEl=this.originEl[0],this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}},{key:\"_calculatePositioning\",value:function(){var t=\"fixed\"===this.$origin.css(\"position\");if(!t)for(var e=this.$origin.parents(),i=0;i'+t.getAttribute(\"label\")+\"\")[0]),i.each(function(t){var e=n._appendOptionWithIcon(n.$el,t,\"optgroup-option\");n._addOptionToValueDict(t,e)})}}),this.$el.after(this.dropdownOptions),this.input=document.createElement(\"input\"),d(this.input).addClass(\"select-dropdown dropdown-trigger\"),this.input.setAttribute(\"type\",\"text\"),this.input.setAttribute(\"readonly\",\"true\"),this.input.setAttribute(\"data-target\",this.dropdownOptions.id),this.el.disabled&&d(this.input).prop(\"disabled\",\"true\"),this.$el.before(this.input),this._setValueToInput();var t=d('');if(this.$el.before(t[0]),!this.el.disabled){var e=d.extend({},this.options.dropdownOptions);e.onOpenEnd=function(t){var e=d(n.dropdownOptions).find(\".selected\").first();if(e.length&&(M.keyDown=!0,n.dropdown.focusedIndex=e.index(),n.dropdown._focusFocusedItem(),M.keyDown=!1,n.dropdown.isScrollable)){var i=e[0].getBoundingClientRect().top-n.dropdownOptions.getBoundingClientRect().top;i-=n.dropdownOptions.clientHeight/2,n.dropdownOptions.scrollTop=i}},this.isMultiple&&(e.closeOnClick=!1),this.dropdown=M.Dropdown.init(this.input,e)}this._setSelectedStates()}},{key:\"_addOptionToValueDict\",value:function(t,e){var i=Object.keys(this._valueDict).length,n=this.dropdownOptions.id+i,s={};e.id=n,s.el=t,s.optionEl=e,this._valueDict[n]=s}},{key:\"_removeDropdown\",value:function(){d(this.wrapper).find(\".caret\").remove(),d(this.input).remove(),d(this.dropdownOptions).remove(),d(this.wrapper).before(this.$el),d(this.wrapper).remove()}},{key:\"_appendOptionWithIcon\",value:function(t,e,i){var n=e.disabled?\"disabled \":\"\",s=\"optgroup-option\"===i?\"optgroup-option \":\"\",o=this.isMultiple?'\":e.innerHTML,a=d(\"
    7. \"),r=d(\"\");r.html(o),a.addClass(n+\" \"+s),a.append(r);var l=e.getAttribute(\"data-icon\");if(l){var h=d('\"\"');a.prepend(h)}return d(this.dropdownOptions).append(a[0]),a[0]}},{key:\"_toggleEntryFromArray\",value:function(t){var e=!this._keysSelected.hasOwnProperty(t),i=d(this._valueDict[t].optionEl);return e?this._keysSelected[t]=!0:delete this._keysSelected[t],i.toggleClass(\"selected\",e),i.find('input[type=\"checkbox\"]').prop(\"checked\",e),i.prop(\"selected\",e),e}},{key:\"_setValueToInput\",value:function(){var i=[];if(this.$el.find(\"option\").each(function(t){if(d(t).prop(\"selected\")){var e=d(t).text();i.push(e)}}),!i.length){var t=this.$el.find(\"option:disabled\").eq(0);t.length&&\"\"===t[0].value&&i.push(t.text())}this.input.value=i.join(\", \")}},{key:\"_setSelectedStates\",value:function(){for(var t in this._keysSelected={},this._valueDict){var e=this._valueDict[t],i=d(e.el).prop(\"selected\");d(e.optionEl).find('input[type=\"checkbox\"]').prop(\"checked\",i),i?(this._activateOption(d(this.dropdownOptions),d(e.optionEl)),this._keysSelected[t]=!0):d(e.optionEl).removeClass(\"selected\")}}},{key:\"_activateOption\",value:function(t,e){e&&(this.isMultiple||t.find(\"li.selected\").removeClass(\"selected\"),d(e).addClass(\"selected\"))}},{key:\"getSelectedValues\",value:function(){var t=[];for(var e in this._keysSelected)t.push(this._valueDict[e].el.value);return t}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_FormSelect}},{key:\"defaults\",get:function(){return e}}]),n}();M.FormSelect=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"formSelect\",\"M_FormSelect\")}(cash),function(s,e){\"use strict\";var i={},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Range=i).options=s.extend({},n.defaults,e),i._mousedown=!1,i._setupThumb(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:\"destroy\",value:function(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}},{key:\"_setupEventHandlers\",value:function(){this._handleRangeChangeBound=this._handleRangeChange.bind(this),this._handleRangeMousedownTouchstartBound=this._handleRangeMousedownTouchstart.bind(this),this._handleRangeInputMousemoveTouchmoveBound=this._handleRangeInputMousemoveTouchmove.bind(this),this._handleRangeMouseupTouchendBound=this._handleRangeMouseupTouchend.bind(this),this._handleRangeBlurMouseoutTouchleaveBound=this._handleRangeBlurMouseoutTouchleave.bind(this),this.el.addEventListener(\"change\",this._handleRangeChangeBound),this.el.addEventListener(\"mousedown\",this._handleRangeMousedownTouchstartBound),this.el.addEventListener(\"touchstart\",this._handleRangeMousedownTouchstartBound),this.el.addEventListener(\"input\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"mousemove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"touchmove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener(\"mouseup\",this._handleRangeMouseupTouchendBound),this.el.addEventListener(\"touchend\",this._handleRangeMouseupTouchendBound),this.el.addEventListener(\"blur\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener(\"mouseout\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener(\"touchleave\",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:\"_removeEventHandlers\",value:function(){this.el.removeEventListener(\"change\",this._handleRangeChangeBound),this.el.removeEventListener(\"mousedown\",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener(\"touchstart\",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener(\"input\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"mousemove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"touchmove\",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener(\"mouseup\",this._handleRangeMouseupTouchendBound),this.el.removeEventListener(\"touchend\",this._handleRangeMouseupTouchendBound),this.el.removeEventListener(\"blur\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener(\"mouseout\",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener(\"touchleave\",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:\"_handleRangeChange\",value:function(){s(this.value).html(this.$el.val()),s(this.thumb).hasClass(\"active\")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",t+\"px\")}},{key:\"_handleRangeMousedownTouchstart\",value:function(t){if(s(this.value).html(this.$el.val()),this._mousedown=!0,this.$el.addClass(\"active\"),s(this.thumb).hasClass(\"active\")||this._showRangeBubble(),\"input\"!==t.type){var e=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",e+\"px\")}}},{key:\"_handleRangeInputMousemoveTouchmove\",value:function(){if(this._mousedown){s(this.thumb).hasClass(\"active\")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass(\"active\").css(\"left\",t+\"px\"),s(this.value).html(this.$el.val())}}},{key:\"_handleRangeMouseupTouchend\",value:function(){this._mousedown=!1,this.$el.removeClass(\"active\")}},{key:\"_handleRangeBlurMouseoutTouchleave\",value:function(){if(!this._mousedown){var t=7+parseInt(this.$el.css(\"padding-left\"))+\"px\";s(this.thumb).hasClass(\"active\")&&(e.remove(this.thumb),e({targets:this.thumb,height:0,width:0,top:10,easing:\"easeOutQuad\",marginLeft:t,duration:100})),s(this.thumb).removeClass(\"active\")}}},{key:\"_setupThumb\",value:function(){this.thumb=document.createElement(\"span\"),this.value=document.createElement(\"span\"),s(this.thumb).addClass(\"thumb\"),s(this.value).addClass(\"value\"),s(this.thumb).append(this.value),this.$el.after(this.thumb)}},{key:\"_removeThumb\",value:function(){s(this.thumb).remove()}},{key:\"_showRangeBubble\",value:function(){var t=-7+parseInt(s(this.thumb).parent().css(\"padding-left\"))+\"px\";e.remove(this.thumb),e({targets:this.thumb,height:30,width:30,top:-30,marginLeft:t,duration:300,easing:\"easeOutQuint\"})}},{key:\"_calcRangeOffset\",value:function(){var t=this.$el.width()-15,e=parseFloat(this.$el.attr(\"max\"))||100,i=parseFloat(this.$el.attr(\"min\"))||0;return(parseFloat(this.$el.val())-i)/(e-i)*t}}],[{key:\"init\",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),\"init\",this).call(this,this,t,e)}},{key:\"getInstance\",value:function(t){return(t.jquery?t[0]:t).M_Range}},{key:\"defaults\",get:function(){return i}}]),n}();M.Range=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,\"range\",\"M_Range\"),t.init(s(\"input[type=range]\"))}(cash,M.anime);","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meiosisSetup = void 0;\nvar setup_1 = require(\"./setup\");\nObject.defineProperty(exports, \"meiosisSetup\", { enumerable: true, get: function () { return setup_1.meiosisSetup; } });\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meiosisSetup = void 0;\nconst simple_stream_1 = require(\"./simple-stream\");\nconst util_1 = require(\"./util\");\nconst mergerino_1 = __importDefault(require(\"mergerino\"));\nconst assoc = (prop, value, target) => {\n target[prop] = value;\n return target;\n};\nconst concatIfPresent = (target, source) => source ? target.concat(source) : target;\nconst assembleInitialState = (nestedComponents) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => assoc(key, Object.assign({}, nestedComponents[key].initial, assembleInitialState(nestedComponents[key].nested)), result), {})\n : {};\nconst getInitialState = (app) => Object.assign({}, app.initial, assembleInitialState(app.nested));\nconst assembleView = (nestedComponents) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => {\n const nestedApp = nestedComponents[key];\n if (nestedApp.view !== undefined) {\n const view = nestedApp.view;\n return assoc(key, {\n view: (cell, ...args) => view(cell.nest(key), ...args),\n nested: assembleView(nestedApp.nested)\n }, result);\n }\n return result;\n }, {})\n : {};\nconst getView = (app) => assembleView(app.nested);\nconst assembleServices = (nestedComponents, getCell = (cell) => cell, getState = (state) => state) => nestedComponents\n ? Object.keys(nestedComponents).reduce((result, key) => {\n var _a;\n const nextGetCell = (cell) => getCell(cell).nest(key);\n const nextGetState = (state) => getState(state)[key];\n const nestedApp = nestedComponents[key];\n return concatIfPresent(result, (_a = nestedApp.services) === null || _a === void 0 ? void 0 : _a.map((service) => ({\n onchange: (state) => (service.onchange ? service.onchange(nextGetState(state)) : state),\n run: (cell) => service.run(nextGetCell(cell))\n }))).concat(assembleServices(nestedApp.nested, nextGetCell, nextGetState));\n }, [])\n : [];\nconst getServices = (app) => concatIfPresent([], app.services).concat(assembleServices(app.nested));\nconst baseSetup = ({ stream, app }) => {\n if (!stream) {\n stream = simple_stream_1.simpleStream;\n }\n const safeApp = app || {};\n const initial = getInitialState(safeApp);\n const view = getView(safeApp);\n const createStream = typeof stream === 'function' ? stream : stream.stream;\n const scan = stream.scan;\n const update = createStream();\n const states = scan((state, patch) => (0, mergerino_1.default)(state, patch), initial, update);\n return {\n states,\n update,\n view\n };\n};\nconst nestPatch = (patch, prop) => ({ [prop]: patch });\nconst nestUpdate = (parentUpdate, prop) => (patch) => parentUpdate(nestPatch(patch, prop));\nconst nestCell = (states, parentUpdate, components) => (prop) => {\n const nestedStates = states.map((state) => state[prop]);\n const getNestedState = () => states()[prop];\n const nestedUpdate = nestUpdate(parentUpdate, prop);\n const nestedComponents = (0, util_1.get)(components, [prop, 'nested']);\n return {\n states: nestedStates,\n state: getNestedState(),\n getState: getNestedState,\n update: nestedUpdate,\n nest: nestCell(nestedStates, nestedUpdate, nestedComponents),\n nested: nestedComponents\n };\n};\n/**\n * Helper to setup the Meiosis pattern with [Mergerino](https://github.com/fuzetsu/mergerino).\n *\n * @template S the State type.\n *\n * @param config the Meiosis config for use with Mergerino\n *\n * @returns a stream of Meiosis cells.\n */\nconst meiosisSetup = (config) => {\n const stream = config === null || config === void 0 ? void 0 : config.stream;\n const app = config === null || config === void 0 ? void 0 : config.app;\n const { states, update, view } = baseSetup({\n stream,\n app\n });\n const nest = nestCell(states, update, view);\n const getState = () => states();\n const getCell = (state) => ({ states, state, getState, update, nest, nested: view });\n const dropRepeats = (0, simple_stream_1.createDropRepeats)(stream);\n if (app) {\n getServices(app).forEach((service) => {\n dropRepeats(states, service.onchange).map((state) => service.run(getCell(state)));\n });\n }\n const cells = dropRepeats(states).map(getCell);\n return cells;\n};\nexports.meiosisSetup = meiosisSetup;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dropRepeats = exports.createDropRepeats = exports.simpleStream = exports.scan = exports.stream = void 0;\n/**\n * Creates a stream.\n *\n * @template T the type of the stream's values.\n *\n * @param initial the stream's initial value.\n *\n * @returns the created stream.\n */\nconst stream = (initial) => {\n const mapFunctions = [];\n let latestValue = initial;\n const createdStream = function (value) {\n if (arguments.length > 0 && !createdStream.ended) {\n latestValue = value;\n for (const i in mapFunctions) {\n // credit @cmnstmntmn for discovering this bug.\n // Make sure to send the latest value.\n // Otherwise, if f1 triggers another update, f2 will be called with value2 and\n // then value1 (old value).\n mapFunctions[i](latestValue);\n }\n }\n return latestValue;\n };\n createdStream.map = (mapFunction) => {\n const newStream = (0, exports.stream)();\n const mappedFunction = (value) => {\n newStream(mapFunction(value));\n };\n mapFunctions.push(mappedFunction);\n newStream.end = (_value) => {\n const idx = mapFunctions.indexOf(mappedFunction);\n newStream.ended = true;\n mapFunctions.splice(idx, 1);\n };\n if (latestValue !== undefined) {\n newStream(mapFunction(latestValue));\n }\n return newStream;\n };\n createdStream.end = (_value) => {\n createdStream.ended = true;\n };\n return createdStream;\n};\nexports.stream = stream;\n/**\n * Creates a new stream that starts with the initial value and, for each value arriving onto the\n * source stream, emits the result of calling the accumulator function with the latest result and\n * the source stream value.\n */\nconst scan = (accumulator, initial, sourceStream) => {\n const newStream = (0, exports.stream)(initial);\n let accumulated = initial;\n sourceStream.map((value) => {\n accumulated = accumulator(accumulated, value);\n newStream(accumulated);\n });\n return newStream;\n};\nexports.scan = scan;\nexports.simpleStream = {\n stream: exports.stream,\n scan: exports.scan\n};\n/**\n * Credit: James Forbes (https://james-forbes.com/)\n *\n * Creates a `dropRepeats` function, which returns new stream that drops repeated values from the\n * source stream.\n *\n * @param stream the stream library, defaults to simpleStream.\n */\nconst createDropRepeats = (stream = exports.simpleStream) => \n/**\n * @param source the source stream.\n * @param onchange function that receives the current state of the source stream and returns the\n * value for which changes will emit onto the returned stream.\n * @returns a stream that does not emit repeated values.\n */\n(source, onchange = (state) => state) => {\n const createStream = typeof stream === 'function' ? stream : stream.stream;\n let prev = undefined;\n const result = createStream();\n source.map((state) => {\n const next = onchange(state);\n if (next !== prev) {\n prev = next;\n result(state);\n }\n });\n return result;\n};\nexports.createDropRepeats = createDropRepeats;\n/**\n * `dropRepeats` function that uses `simpleStream`.\n */\nexports.dropRepeats = (0, exports.createDropRepeats)();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateFormFloatValue = exports.updateFormIntValue = exports.updateFormValue = exports.get = void 0;\n/**\n * Safely gets a property path from an object. The path is an array. If any property along the path\n * is `undefined`, the function returns `undefined`.\n *\n * @param object the object on which to get the property.\n * @param path the property path.\n *\n * @returns the property value, or `undefined` if any property along the path is `undefined`.\n */\nconst get = (object, path) => path.reduce((obj, key) => (obj == undefined ? undefined : obj[key]), object);\nexports.get = get;\nconst intoPath = (path, value) => ({\n [path[0]]: path.length === 1 ? value : intoPath(path.slice(1), value)\n});\nconst toPath = (pathOrProp) => Array.isArray(pathOrProp) ? pathOrProp : [pathOrProp];\nconst updateParseValue = (parseFn, cell, path) => (evt) => {\n const value = parseFn(evt.currentTarget.value);\n if (!isNaN(value)) {\n cell.update(intoPath(toPath(path), value));\n }\n};\n/**\n * Convenience function to update a form value. Pass the Meiosis cell and the state property (such\n * as `'firstName'`) or path (such as `['person', 'firstName']`) into which to update the value.\n * Returns a function that you can pass to a DOM handler, such as `oninput` (Mithril) or `onInput`\n * (Preact, React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormValue(cell, 'firstName') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n * @param fn (optional) a function to modify the value before updating it.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormValue = (cell, path, fn = (value) => value) => (evt) => cell.update(intoPath(toPath(path), fn(evt.currentTarget.value)));\nexports.updateFormValue = updateFormValue;\n/**\n * Convenience function to update a form value with an Integer value. If the user input does not\n * return a number with `parseInt`, no state change occurs. Pass the Meiosis cell and the state\n * property (such as `'counter'`) or path (such as `['book', 'counter']`) into which to update the\n * value. Returns a function that you can pass to a DOM handler, such as `oninput` (Mithril) or\n * `onInput` (Preact, React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormIntValue(cell, 'counter') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormIntValue = (cell, path) => (evt) => updateParseValue(parseInt, cell, path)(evt);\nexports.updateFormIntValue = updateFormIntValue;\n/**\n * Convenience function to update a form value with a Float value. If the user input does not return\n * a number with `parseFloat`, no state change occurs. Pass the Meiosis cell and the state property\n * (such as `'pH'`) or path (such as `['water', 'pH']`) into which to update the value. Returns a\n * function that you can pass to a DOM handler, such as `oninput` (Mithril) or `onInput` (Preact,\n * React). For example:\n *\n * ```js\n * // Using Mithil\n * m('input[type=text]', { oninput: updateFormFloatValue(cell, 'pH') })\n *\n * // Using Preact/React\n * \n * ```\n *\n * @param cell the Meiosis cell.\n * @param path the property or path into which to update the value.\n *\n * @returns a function that accepts a DOM event and updates the value on the Meiosis state.\n */\nconst updateFormFloatValue = (cell, path) => (evt) => updateParseValue(parseFloat, cell, path)(evt);\nexports.updateFormFloatValue = updateFormFloatValue;\n","const e=Object.assign||((e,t)=>(t&&Object.keys(t).forEach(o=>e[o]=t[o]),e)),t=(e,r,s)=>{const c=typeof s;if(s&&\"object\"===c)if(Array.isArray(s))for(const o of s)r=t(e,r,o);else for(const c of Object.keys(s)){const f=s[c];\"function\"==typeof f?r[c]=f(r[c],o):void 0===f?e&&!isNaN(c)?r.splice(c,1):delete r[c]:null===f||\"object\"!=typeof f||Array.isArray(f)?r[c]=f:\"object\"==typeof r[c]?r[c]=f===r[c]?f:o(r[c],f):r[c]=t(!1,{},f)}else\"function\"===c&&(r=s(r,o));return r},o=(o,...r)=>{const s=Array.isArray(o);return t(s,s?o.slice():e({},o),r)};export default o;\n//# sourceMappingURL=mergerino.min.js.map","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(render, schedule, console) {\n\tvar subscriptions = []\n\tvar pending = false\n\tvar offset = -1\n\n\tfunction sync() {\n\t\tfor (offset = 0; offset < subscriptions.length; offset += 2) {\n\t\t\ttry { render(subscriptions[offset], Vnode(subscriptions[offset + 1]), redraw) }\n\t\t\tcatch (e) { console.error(e) }\n\t\t}\n\t\toffset = -1\n\t}\n\n\tfunction redraw() {\n\t\tif (!pending) {\n\t\t\tpending = true\n\t\t\tschedule(function() {\n\t\t\t\tpending = false\n\t\t\t\tsync()\n\t\t\t})\n\t\t}\n\t}\n\n\tredraw.sync = sync\n\n\tfunction mount(root, component) {\n\t\tif (component != null && component.view == null && typeof component !== \"function\") {\n\t\t\tthrow new TypeError(\"m.mount expects a component, not a vnode.\")\n\t\t}\n\n\t\tvar index = subscriptions.indexOf(root)\n\t\tif (index >= 0) {\n\t\t\tsubscriptions.splice(index, 2)\n\t\t\tif (index <= offset) offset -= 2\n\t\t\trender(root, [])\n\t\t}\n\n\t\tif (component != null) {\n\t\t\tsubscriptions.push(root, component)\n\t\t\trender(root, Vnode(component), redraw)\n\t\t}\n\t}\n\n\treturn {mount: mount, redraw: redraw}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar m = require(\"../render/hyperscript\")\n\nvar buildPathname = require(\"../pathname/build\")\nvar parsePathname = require(\"../pathname/parse\")\nvar compileTemplate = require(\"../pathname/compileTemplate\")\nvar assign = require(\"../util/assign\")\nvar censor = require(\"../util/censor\")\n\nvar sentinel = {}\n\nfunction decodeURIComponentSave(component) {\n\ttry {\n\t\treturn decodeURIComponent(component)\n\t} catch(e) {\n\t\treturn component\n\t}\n}\n\nmodule.exports = function($window, mountRedraw) {\n\tvar callAsync = $window == null\n\t\t// In case Mithril.js' loaded globally without the DOM, let's not break\n\t\t? null\n\t\t: typeof $window.setImmediate === \"function\" ? $window.setImmediate : $window.setTimeout\n\tvar p = Promise.resolve()\n\n\tvar scheduled = false\n\n\t// state === 0: init\n\t// state === 1: scheduled\n\t// state === 2: done\n\tvar ready = false\n\tvar state = 0\n\n\tvar compiled, fallbackRoute\n\n\tvar currentResolver = sentinel, component, attrs, currentPath, lastUpdate\n\n\tvar RouterRoot = {\n\t\tonbeforeupdate: function() {\n\t\t\tstate = state ? 2 : 1\n\t\t\treturn !(!state || sentinel === currentResolver)\n\t\t},\n\t\tonremove: function() {\n\t\t\t$window.removeEventListener(\"popstate\", fireAsync, false)\n\t\t\t$window.removeEventListener(\"hashchange\", resolveRoute, false)\n\t\t},\n\t\tview: function() {\n\t\t\tif (!state || sentinel === currentResolver) return\n\t\t\t// Wrap in a fragment to preserve existing key semantics\n\t\t\tvar vnode = [Vnode(component, attrs.key, attrs)]\n\t\t\tif (currentResolver) vnode = currentResolver.render(vnode[0])\n\t\t\treturn vnode\n\t\t},\n\t}\n\n\tvar SKIP = route.SKIP = {}\n\n\tfunction resolveRoute() {\n\t\tscheduled = false\n\t\t// Consider the pathname holistically. The prefix might even be invalid,\n\t\t// but that's not our problem.\n\t\tvar prefix = $window.location.hash\n\t\tif (route.prefix[0] !== \"#\") {\n\t\t\tprefix = $window.location.search + prefix\n\t\t\tif (route.prefix[0] !== \"?\") {\n\t\t\t\tprefix = $window.location.pathname + prefix\n\t\t\t\tif (prefix[0] !== \"/\") prefix = \"/\" + prefix\n\t\t\t}\n\t\t}\n\t\t// This seemingly useless `.concat()` speeds up the tests quite a bit,\n\t\t// since the representation is consistently a relatively poorly\n\t\t// optimized cons string.\n\t\tvar path = prefix.concat()\n\t\t\t.replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponentSave)\n\t\t\t.slice(route.prefix.length)\n\t\tvar data = parsePathname(path)\n\n\t\tassign(data.params, $window.history.state)\n\n\t\tfunction reject(e) {\n\t\t\tconsole.error(e)\n\t\t\tsetPath(fallbackRoute, null, {replace: true})\n\t\t}\n\n\t\tloop(0)\n\t\tfunction loop(i) {\n\t\t\t// state === 0: init\n\t\t\t// state === 1: scheduled\n\t\t\t// state === 2: done\n\t\t\tfor (; i < compiled.length; i++) {\n\t\t\t\tif (compiled[i].check(data)) {\n\t\t\t\t\tvar payload = compiled[i].component\n\t\t\t\t\tvar matchedRoute = compiled[i].route\n\t\t\t\t\tvar localComp = payload\n\t\t\t\t\tvar update = lastUpdate = function(comp) {\n\t\t\t\t\t\tif (update !== lastUpdate) return\n\t\t\t\t\t\tif (comp === SKIP) return loop(i + 1)\n\t\t\t\t\t\tcomponent = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\")? comp : \"div\"\n\t\t\t\t\t\tattrs = data.params, currentPath = path, lastUpdate = null\n\t\t\t\t\t\tcurrentResolver = payload.render ? payload : null\n\t\t\t\t\t\tif (state === 2) mountRedraw.redraw()\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tstate = 2\n\t\t\t\t\t\t\tmountRedraw.redraw.sync()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// There's no understating how much I *wish* I could\n\t\t\t\t\t// use `async`/`await` here...\n\t\t\t\t\tif (payload.view || typeof payload === \"function\") {\n\t\t\t\t\t\tpayload = {}\n\t\t\t\t\t\tupdate(localComp)\n\t\t\t\t\t}\n\t\t\t\t\telse if (payload.onmatch) {\n\t\t\t\t\t\tp.then(function () {\n\t\t\t\t\t\t\treturn payload.onmatch(data.params, path, matchedRoute)\n\t\t\t\t\t\t}).then(update, path === fallbackRoute ? null : reject)\n\t\t\t\t\t}\n\t\t\t\t\telse update(\"div\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (path === fallbackRoute) {\n\t\t\t\tthrow new Error(\"Could not resolve default route \" + fallbackRoute + \".\")\n\t\t\t}\n\t\t\tsetPath(fallbackRoute, null, {replace: true})\n\t\t}\n\t}\n\n\t// Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n\t// even if neither `pushState` nor `hashchange` are supported. It's\n\t// cleared if `hashchange` is used, since that makes it automatically\n\t// async.\n\tfunction fireAsync() {\n\t\tif (!scheduled) {\n\t\t\tscheduled = true\n\t\t\t// TODO: just do `mountRedraw.redraw()` here and elide the timer\n\t\t\t// dependency. Note that this will muck with tests a *lot*, so it's\n\t\t\t// not as easy of a change as it sounds.\n\t\t\tcallAsync(resolveRoute)\n\t\t}\n\t}\n\n\tfunction setPath(path, data, options) {\n\t\tpath = buildPathname(path, data)\n\t\tif (ready) {\n\t\t\tfireAsync()\n\t\t\tvar state = options ? options.state : null\n\t\t\tvar title = options ? options.title : null\n\t\t\tif (options && options.replace) $window.history.replaceState(state, title, route.prefix + path)\n\t\t\telse $window.history.pushState(state, title, route.prefix + path)\n\t\t}\n\t\telse {\n\t\t\t$window.location.href = route.prefix + path\n\t\t}\n\t}\n\n\tfunction route(root, defaultRoute, routes) {\n\t\tif (!root) throw new TypeError(\"DOM element being rendered to does not exist.\")\n\n\t\tcompiled = Object.keys(routes).map(function(route) {\n\t\t\tif (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a '/'.\")\n\t\t\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(route)) {\n\t\t\t\tthrow new SyntaxError(\"Route parameter names must be separated with either '/', '.', or '-'.\")\n\t\t\t}\n\t\t\treturn {\n\t\t\t\troute: route,\n\t\t\t\tcomponent: routes[route],\n\t\t\t\tcheck: compileTemplate(route),\n\t\t\t}\n\t\t})\n\t\tfallbackRoute = defaultRoute\n\t\tif (defaultRoute != null) {\n\t\t\tvar defaultData = parsePathname(defaultRoute)\n\n\t\t\tif (!compiled.some(function (i) { return i.check(defaultData) })) {\n\t\t\t\tthrow new ReferenceError(\"Default route doesn't match any known routes.\")\n\t\t\t}\n\t\t}\n\n\t\tif (typeof $window.history.pushState === \"function\") {\n\t\t\t$window.addEventListener(\"popstate\", fireAsync, false)\n\t\t} else if (route.prefix[0] === \"#\") {\n\t\t\t$window.addEventListener(\"hashchange\", resolveRoute, false)\n\t\t}\n\n\t\tready = true\n\t\tmountRedraw.mount(root, RouterRoot)\n\t\tresolveRoute()\n\t}\n\troute.set = function(path, data, options) {\n\t\tif (lastUpdate != null) {\n\t\t\toptions = options || {}\n\t\t\toptions.replace = true\n\t\t}\n\t\tlastUpdate = null\n\t\tsetPath(path, data, options)\n\t}\n\troute.get = function() {return currentPath}\n\troute.prefix = \"#!\"\n\troute.Link = {\n\t\tview: function(vnode) {\n\t\t\t// Omit the used parameters from the rendered element - they are\n\t\t\t// internal. Also, censor the various lifecycle methods.\n\t\t\t//\n\t\t\t// We don't strip the other parameters because for convenience we\n\t\t\t// let them be specified in the selector as well.\n\t\t\tvar child = m(\n\t\t\t\tvnode.attrs.selector || \"a\",\n\t\t\t\tcensor(vnode.attrs, [\"options\", \"params\", \"selector\", \"onclick\"]),\n\t\t\t\tvnode.children\n\t\t\t)\n\t\t\tvar options, onclick, href\n\n\t\t\t// Let's provide a *right* way to disable a route link, rather than\n\t\t\t// letting people screw up accessibility on accident.\n\t\t\t//\n\t\t\t// The attribute is coerced so users don't get surprised over\n\t\t\t// `disabled: 0` resulting in a button that's somehow routable\n\t\t\t// despite being visibly disabled.\n\t\t\tif (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n\t\t\t\tchild.attrs.href = null\n\t\t\t\tchild.attrs[\"aria-disabled\"] = \"true\"\n\t\t\t\t// If you *really* do want add `onclick` on a disabled link, use\n\t\t\t\t// an `oncreate` hook to add it.\n\t\t\t} else {\n\t\t\t\toptions = vnode.attrs.options\n\t\t\t\tonclick = vnode.attrs.onclick\n\t\t\t\t// Easier to build it now to keep it isomorphic.\n\t\t\t\thref = buildPathname(child.attrs.href, vnode.attrs.params)\n\t\t\t\tchild.attrs.href = route.prefix + href\n\t\t\t\tchild.attrs.onclick = function(e) {\n\t\t\t\t\tvar result\n\t\t\t\t\tif (typeof onclick === \"function\") {\n\t\t\t\t\t\tresult = onclick.call(e.currentTarget, e)\n\t\t\t\t\t} else if (onclick == null || typeof onclick !== \"object\") {\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t} else if (typeof onclick.handleEvent === \"function\") {\n\t\t\t\t\t\tonclick.handleEvent(e)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Adapted from React Router's implementation:\n\t\t\t\t\t// https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n\t\t\t\t\t//\n\t\t\t\t\t// Try to be flexible and intuitive in how we handle links.\n\t\t\t\t\t// Fun fact: links aren't as obvious to get right as you\n\t\t\t\t\t// would expect. There's a lot more valid ways to click a\n\t\t\t\t\t// link than this, and one might want to not simply click a\n\t\t\t\t\t// link, but right click or command-click it to copy the\n\t\t\t\t\t// link target, etc. Nope, this isn't just for blind people.\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip if `onclick` prevented default\n\t\t\t\t\t\tresult !== false && !e.defaultPrevented &&\n\t\t\t\t\t\t// Ignore everything but left clicks\n\t\t\t\t\t\t(e.button === 0 || e.which === 0 || e.which === 1) &&\n\t\t\t\t\t\t// Let the browser handle `target=_blank`, etc.\n\t\t\t\t\t\t(!e.currentTarget.target || e.currentTarget.target === \"_self\") &&\n\t\t\t\t\t\t// No modifier keys\n\t\t\t\t\t\t!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey\n\t\t\t\t\t) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\te.redraw = false\n\t\t\t\t\t\troute.set(href, null, options)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn child\n\t\t},\n\t}\n\troute.param = function(key) {\n\t\treturn attrs && key != null ? attrs[key] : attrs\n\t}\n\n\treturn route\n}\n","\"use strict\"\n\nvar hyperscript = require(\"./render/hyperscript\")\n\nhyperscript.trust = require(\"./render/trust\")\nhyperscript.fragment = require(\"./render/fragment\")\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar hyperscript = require(\"./hyperscript\")\nvar request = require(\"./request\")\nvar mountRedraw = require(\"./mount-redraw\")\nvar domFor = require(\"./render/domFor\")\n\nvar m = function m() { return hyperscript.apply(this, arguments) }\nm.m = hyperscript\nm.trust = hyperscript.trust\nm.fragment = hyperscript.fragment\nm.Fragment = \"[\"\nm.mount = mountRedraw.mount\nm.route = require(\"./route\")\nm.render = require(\"./render\")\nm.redraw = mountRedraw.redraw\nm.request = request.request\nm.parseQueryString = require(\"./querystring/parse\")\nm.buildQueryString = require(\"./querystring/build\")\nm.parsePathname = require(\"./pathname/parse\")\nm.buildPathname = require(\"./pathname/build\")\nm.vnode = require(\"./render/vnode\")\nm.censor = require(\"./util/censor\")\nm.domFor = domFor.domFor\n\nmodule.exports = m\n","\"use strict\"\n\nvar render = require(\"./render\")\n\nmodule.exports = require(\"./api/mount-redraw\")(render, typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : null, typeof console !== \"undefined\" ? console : null)\n","\"use strict\"\n\nvar buildQueryString = require(\"../querystring/build\")\nvar assign = require(\"../util/assign\")\n\n// Returns `path` from `template` + `params`\nmodule.exports = function(template, params) {\n\tif ((/:([^\\/\\.-]+)(\\.{3})?:/).test(template)) {\n\t\tthrow new SyntaxError(\"Template parameter names must be separated by either a '/', '-', or '.'.\")\n\t}\n\tif (params == null) return template\n\tvar queryIndex = template.indexOf(\"?\")\n\tvar hashIndex = template.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? template.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = template.slice(0, pathEnd)\n\tvar query = {}\n\n\tassign(query, params)\n\n\tvar resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function(m, key, variadic) {\n\t\tdelete query[key]\n\t\t// If no such parameter exists, don't interpolate it.\n\t\tif (params[key] == null) return m\n\t\t// Escape normal parameters, but not variadic ones.\n\t\treturn variadic ? params[key] : encodeURIComponent(String(params[key]))\n\t})\n\n\t// In case the template substitution adds new query/hash parameters.\n\tvar newQueryIndex = resolved.indexOf(\"?\")\n\tvar newHashIndex = resolved.indexOf(\"#\")\n\tvar newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex\n\tvar newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex\n\tvar result = resolved.slice(0, newPathEnd)\n\n\tif (queryIndex >= 0) result += template.slice(queryIndex, queryEnd)\n\tif (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd)\n\tvar querystring = buildQueryString(query)\n\tif (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring\n\tif (hashIndex >= 0) result += template.slice(hashIndex)\n\tif (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex)\n\treturn result\n}\n","\"use strict\"\n\nvar parsePathname = require(\"./parse\")\n\n// Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\nmodule.exports = function(template) {\n\tvar templateData = parsePathname(template)\n\tvar templateKeys = Object.keys(templateData.params)\n\tvar keys = []\n\tvar regexp = new RegExp(\"^\" + templateData.path.replace(\n\t\t// I escape literal text so people can use things like `:file.:ext` or\n\t\t// `:lang-:locale` in routes. This is all merged into one pass so I\n\t\t// don't also accidentally escape `-` and make it harder to detect it to\n\t\t// ban it from template parameters.\n\t\t/:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g,\n\t\tfunction(m, key, extra) {\n\t\t\tif (key == null) return \"\\\\\" + m\n\t\t\tkeys.push({k: key, r: extra === \"...\"})\n\t\t\tif (extra === \"...\") return \"(.*)\"\n\t\t\tif (extra === \".\") return \"([^/]+)\\\\.\"\n\t\t\treturn \"([^/]+)\" + (extra || \"\")\n\t\t}\n\t) + \"$\")\n\treturn function(data) {\n\t\t// First, check the params. Usually, there isn't any, and it's just\n\t\t// checking a static set.\n\t\tfor (var i = 0; i < templateKeys.length; i++) {\n\t\t\tif (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false\n\t\t}\n\t\t// If no interpolations exist, let's skip all the ceremony\n\t\tif (!keys.length) return regexp.test(data.path)\n\t\tvar values = regexp.exec(data.path)\n\t\tif (values == null) return false\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tdata.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1])\n\t\t}\n\t\treturn true\n\t}\n}\n","\"use strict\"\n\nvar parseQueryString = require(\"../querystring/parse\")\n\n// Returns `{path, params}` from `url`\nmodule.exports = function(url) {\n\tvar queryIndex = url.indexOf(\"?\")\n\tvar hashIndex = url.indexOf(\"#\")\n\tvar queryEnd = hashIndex < 0 ? url.length : hashIndex\n\tvar pathEnd = queryIndex < 0 ? queryEnd : queryIndex\n\tvar path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\")\n\n\tif (!path) path = \"/\"\n\telse {\n\t\tif (path[0] !== \"/\") path = \"/\" + path\n\t}\n\treturn {\n\t\tpath: path,\n\t\tparams: queryIndex < 0\n\t\t\t? {}\n\t\t\t: parseQueryString(url.slice(queryIndex + 1, queryEnd)),\n\t}\n}\n","\"use strict\"\n\nmodule.exports = function(object) {\n\tif (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\"\n\n\tvar args = []\n\tfor (var key in object) {\n\t\tdestructure(key, object[key])\n\t}\n\n\treturn args.join(\"&\")\n\n\tfunction destructure(key, value) {\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse if (Object.prototype.toString.call(value) === \"[object Object]\") {\n\t\t\tfor (var i in value) {\n\t\t\t\tdestructure(key + \"[\" + i + \"]\", value[i])\n\t\t\t}\n\t\t}\n\t\telse args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"))\n\t}\n}\n","\"use strict\"\n\nfunction decodeURIComponentSave(str) {\n\ttry {\n\t\treturn decodeURIComponent(str)\n\t} catch(err) {\n\t\treturn str\n\t}\n}\n\nmodule.exports = function(string) {\n\tif (string === \"\" || string == null) return {}\n\tif (string.charAt(0) === \"?\") string = string.slice(1)\n\n\tvar entries = string.split(\"&\"), counters = {}, data = {}\n\tfor (var i = 0; i < entries.length; i++) {\n\t\tvar entry = entries[i].split(\"=\")\n\t\tvar key = decodeURIComponentSave(entry[0])\n\t\tvar value = entry.length === 2 ? decodeURIComponentSave(entry[1]) : \"\"\n\n\t\tif (value === \"true\") value = true\n\t\telse if (value === \"false\") value = false\n\n\t\tvar levels = key.split(/\\]\\[?|\\[/)\n\t\tvar cursor = data\n\t\tif (key.indexOf(\"[\") > -1) levels.pop()\n\t\tfor (var j = 0; j < levels.length; j++) {\n\t\t\tvar level = levels[j], nextLevel = levels[j + 1]\n\t\t\tvar isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10))\n\t\t\tif (level === \"\") {\n\t\t\t\tvar key = levels.slice(0, j).join()\n\t\t\t\tif (counters[key] == null) {\n\t\t\t\t\tcounters[key] = Array.isArray(cursor) ? cursor.length : 0\n\t\t\t\t}\n\t\t\t\tlevel = counters[key]++\n\t\t\t}\n\t\t\t// Disallow direct prototype pollution\n\t\t\telse if (level === \"__proto__\") break\n\t\t\tif (j === levels.length - 1) cursor[level] = value\n\t\t\telse {\n\t\t\t\t// Read own properties exclusively to disallow indirect\n\t\t\t\t// prototype pollution\n\t\t\t\tvar desc = Object.getOwnPropertyDescriptor(cursor, level)\n\t\t\t\tif (desc != null) desc = desc.value\n\t\t\t\tif (desc == null) cursor[level] = desc = isNumber ? [] : {}\n\t\t\t\tcursor = desc\n\t\t\t}\n\t\t}\n\t}\n\treturn data\n}\n","\"use strict\"\n\nmodule.exports = require(\"./render/render\")(typeof window !== \"undefined\" ? window : null)\n","\"use strict\"\n\nvar delayedRemoval = new WeakMap\n\nfunction *domFor({dom, domSize}, {generation} = {}) {\n\tif (dom != null) do {\n\t\tconst {nextSibling} = dom\n\n\t\tif (delayedRemoval.get(dom) === generation) {\n\t\t\tyield dom\n\t\t\tdomSize--\n\t\t}\n\n\t\tdom = nextSibling\n\t}\n\twhile (domSize)\n}\n\nmodule.exports = {\n\tdelayedRemoval: delayedRemoval,\n\tdomFor: domFor,\n}","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\n\nmodule.exports = function() {\n\tvar vnode = hyperscriptVnode.apply(0, arguments)\n\n\tvnode.tag = \"[\"\n\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\treturn vnode\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar hyperscriptVnode = require(\"./hyperscriptVnode\")\nvar hasOwn = require(\"../util/hasOwn\")\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g\nvar selectorCache = {}\n\nfunction isEmpty(object) {\n\tfor (var key in object) if (hasOwn.call(object, key)) return false\n\treturn true\n}\n\nfunction compileSelector(selector) {\n\tvar match, tag = \"div\", classes = [], attrs = {}\n\twhile (match = selectorParser.exec(selector)) {\n\t\tvar type = match[1], value = match[2]\n\t\tif (type === \"\" && value !== \"\") tag = value\n\t\telse if (type === \"#\") attrs.id = value\n\t\telse if (type === \".\") classes.push(value)\n\t\telse if (match[3][0] === \"[\") {\n\t\t\tvar attrValue = match[6]\n\t\t\tif (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\")\n\t\t\tif (match[4] === \"class\") classes.push(attrValue)\n\t\t\telse attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true\n\t\t}\n\t}\n\tif (classes.length > 0) attrs.className = classes.join(\" \")\n\treturn selectorCache[selector] = {tag: tag, attrs: attrs}\n}\n\nfunction execSelector(state, vnode) {\n\tvar attrs = vnode.attrs\n\tvar hasClass = hasOwn.call(attrs, \"class\")\n\tvar className = hasClass ? attrs.class : attrs.className\n\n\tvnode.tag = state.tag\n\n\tif (!isEmpty(state.attrs)) {\n\t\tvar newAttrs = {}\n\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key]\n\t\t}\n\n\t\tattrs = newAttrs\n\t}\n\n\tfor (var key in state.attrs) {\n\t\tif (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)){\n\t\t\tattrs[key] = state.attrs[key]\n\t\t}\n\t}\n\tif (className != null || state.attrs.className != null) attrs.className =\n\t\tclassName != null\n\t\t\t? state.attrs.className != null\n\t\t\t\t? String(state.attrs.className) + \" \" + String(className)\n\t\t\t\t: className\n\t\t\t: state.attrs.className != null\n\t\t\t\t? state.attrs.className\n\t\t\t\t: null\n\n\tif (hasClass) attrs.class = null\n\n\tvnode.attrs = attrs\n\n\treturn vnode\n}\n\nfunction hyperscript(selector) {\n\tif (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n\t\tthrow Error(\"The selector must be either a string or a component.\");\n\t}\n\n\tvar vnode = hyperscriptVnode.apply(1, arguments)\n\n\tif (typeof selector === \"string\") {\n\t\tvnode.children = Vnode.normalizeChildren(vnode.children)\n\t\tif (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)\n\t}\n\n\tvnode.tag = selector\n\treturn vnode\n}\n\nmodule.exports = hyperscript\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\n// Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril.js requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n// another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n// than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n// if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n// if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n// } else {\n// children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n// attrs = undefined\n// }\n//\n// if (attrs == null) attrs = {}\n// return Vnode(\"\", attrs.key, attrs, children)\n// }\nmodule.exports = function() {\n\tvar attrs = arguments[this], start = this + 1, children\n\n\tif (attrs == null) {\n\t\tattrs = {}\n\t} else if (typeof attrs !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n\t\tattrs = {}\n\t\tstart = this\n\t}\n\n\tif (arguments.length === start + 1) {\n\t\tchildren = arguments[start]\n\t\tif (!Array.isArray(children)) children = [children]\n\t} else {\n\t\tchildren = []\n\t\twhile (start < arguments.length) children.push(arguments[start++])\n\t}\n\n\treturn Vnode(\"\", attrs.key, attrs, children)\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\nvar df = require(\"../render/domFor\")\nvar delayedRemoval = df.delayedRemoval\nvar domFor = df.domFor\n\nmodule.exports = function() {\n\tvar nameSpace = {\n\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\tmath: \"http://www.w3.org/1998/Math/MathML\"\n\t}\n\n\tvar currentRedraw\n\tvar currentRender\n\n\tfunction getDocument(dom) {\n\t\treturn dom.ownerDocument;\n\t}\n\n\tfunction getNameSpace(vnode) {\n\t\treturn vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag]\n\t}\n\n\t//sanity check to discourage people from doing `vnode.state = ...`\n\tfunction checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"'vnode.state' must not be modified.\")\n\t}\n\n\t//Note: the hook is passed as the `this` argument to allow proxying the\n\t//arguments without requiring a full array allocation to do so. It also\n\t//takes advantage of the fact the current `vnode` is the first argument in\n\t//all lifecycle methods.\n\tfunction callHook(vnode) {\n\t\tvar original = vnode.state\n\t\ttry {\n\t\t\treturn this.apply(original, arguments)\n\t\t} finally {\n\t\t\tcheckState(vnode, original)\n\t\t}\n\t}\n\n\t// IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n\t// inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\tfunction activeElement(dom) {\n\t\ttry {\n\t\t\treturn getDocument(dom).activeElement\n\t\t} catch (e) {\n\t\t\treturn null\n\t\t}\n\t}\n\t//create\n\tfunction createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) {\n\t\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t}\n\tfunction createNode(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tif (typeof tag === \"string\") {\n\t\t\tvnode.state = {}\n\t\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\t\tswitch (tag) {\n\t\t\t\tcase \"#\": createText(parent, vnode, nextSibling); break\n\t\t\t\tcase \"<\": createHTML(parent, vnode, ns, nextSibling); break\n\t\t\t\tcase \"[\": createFragment(parent, vnode, hooks, ns, nextSibling); break\n\t\t\t\tdefault: createElement(parent, vnode, hooks, ns, nextSibling)\n\t\t\t}\n\t\t}\n\t\telse createComponent(parent, vnode, hooks, ns, nextSibling)\n\t}\n\tfunction createText(parent, vnode, nextSibling) {\n\t\tvnode.dom = getDocument(parent).createTextNode(vnode.children)\n\t\tinsertDOM(parent, vnode.dom, nextSibling)\n\t}\n\tvar possibleParents = {caption: \"table\", thead: \"table\", tbody: \"table\", tfoot: \"table\", tr: \"tbody\", th: \"tr\", td: \"tr\", colgroup: \"table\", col: \"colgroup\"}\n\tfunction createHTML(parent, vnode, ns, nextSibling) {\n\t\tvar match = vnode.children.match(/^\\s*?<(\\w+)/im) || []\n\t\t// not using the proper parent makes the child element(s) vanish.\n\t\t// var div = document.createElement(\"div\")\n\t\t// div.innerHTML = \"ij\"\n\t\t// console.log(div.innerHTML)\n\t\t// --> \"ij\", no in sight.\n\t\tvar temp = getDocument(parent).createElement(possibleParents[match[1]] || \"div\")\n\t\tif (ns === \"http://www.w3.org/2000/svg\") {\n\t\t\ttemp.innerHTML = \"\" + vnode.children + \"\"\n\t\t\ttemp = temp.firstChild\n\t\t} else {\n\t\t\ttemp.innerHTML = vnode.children\n\t\t}\n\t\tvnode.dom = temp.firstChild\n\t\tvnode.domSize = temp.childNodes.length\n\t\t// Capture nodes to remove, so we don't confuse them.\n\t\tvar fragment = getDocument(parent).createDocumentFragment()\n\t\tvar child\n\t\twhile (child = temp.firstChild) {\n\t\t\tfragment.appendChild(child)\n\t\t}\n\t\tinsertDOM(parent, fragment, nextSibling)\n\t}\n\tfunction createFragment(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar fragment = getDocument(parent).createDocumentFragment()\n\t\tif (vnode.children != null) {\n\t\t\tvar children = vnode.children\n\t\t\tcreateNodes(fragment, children, 0, children.length, hooks, null, ns)\n\t\t}\n\t\tvnode.dom = fragment.firstChild\n\t\tvnode.domSize = fragment.childNodes.length\n\t\tinsertDOM(parent, fragment, nextSibling)\n\t}\n\tfunction createElement(parent, vnode, hooks, ns, nextSibling) {\n\t\tvar tag = vnode.tag\n\t\tvar attrs = vnode.attrs\n\t\tvar is = attrs && attrs.is\n\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tvar element = ns ?\n\t\t\tis ? getDocument(parent).createElementNS(ns, tag, {is: is}) : getDocument(parent).createElementNS(ns, tag) :\n\t\t\tis ? getDocument(parent).createElement(tag, {is: is}) : getDocument(parent).createElement(tag)\n\t\tvnode.dom = element\n\n\t\tif (attrs != null) {\n\t\t\tsetAttrs(vnode, attrs, ns)\n\t\t}\n\n\t\tinsertDOM(parent, element, nextSibling)\n\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tif (vnode.children != null) {\n\t\t\t\tvar children = vnode.children\n\t\t\t\tcreateNodes(element, children, 0, children.length, hooks, null, ns)\n\t\t\t\tif (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs)\n\t\t\t}\n\t\t}\n\t}\n\tfunction initComponent(vnode, hooks) {\n\t\tvar sentinel\n\t\tif (typeof vnode.tag.view === \"function\") {\n\t\t\tvnode.state = Object.create(vnode.tag)\n\t\t\tsentinel = vnode.state.view\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t} else {\n\t\t\tvnode.state = void 0\n\t\t\tsentinel = vnode.tag\n\t\t\tif (sentinel.$$reentrantLock$$ != null) return\n\t\t\tsentinel.$$reentrantLock$$ = true\n\t\t\tvnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\") ? new vnode.tag(vnode) : vnode.tag(vnode)\n\t\t}\n\t\tinitLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tsentinel.$$reentrantLock$$ = null\n\t}\n\tfunction createComponent(parent, vnode, hooks, ns, nextSibling) {\n\t\tinitComponent(vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tcreateNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0\n\t\t}\n\t\telse {\n\t\t\tvnode.domSize = 0\n\t\t}\n\t}\n\n\t//update\n\t/**\n\t * @param {Element|Fragment} parent - the parent element\n\t * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n\t * this part of the tree\n\t * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n\t * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n\t * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n\t * fragment that is not the last item in its\n\t * parent\n\t * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n\t * @returns void\n\t */\n\t// This function diffs and patches lists of vnodes, both keyed and unkeyed.\n\t//\n\t// We will:\n\t//\n\t// 1. describe its general structure\n\t// 2. focus on the diff algorithm optimizations\n\t// 3. discuss DOM node operations.\n\n\t// ## Overview:\n\t//\n\t// The updateNodes() function:\n\t// - deals with trivial cases\n\t// - determines whether the lists are keyed or unkeyed based on the first non-null node\n\t// of each list.\n\t// - diffs them and patches the DOM if needed (that's the brunt of the code)\n\t// - manages the leftovers: after diffing, are there:\n\t// - old nodes left to remove?\n\t// \t - new nodes to insert?\n\t// \t deal with them!\n\t//\n\t// The lists are only iterated over once, with an exception for the nodes in `old` that\n\t// are visited in the fourth part of the diff and in the `removeNodes` loop.\n\n\t// ## Diffing\n\t//\n\t// Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n\t// may be good for context on longest increasing subsequence-based logic for moving nodes.\n\t//\n\t// In order to diff keyed lists, one has to\n\t//\n\t// 1) match nodes in both lists, per key, and update them accordingly\n\t// 2) create the nodes present in the new list, but absent in the old one\n\t// 3) remove the nodes present in the old list, but absent in the new one\n\t// 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n\t//\n\t// To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n\t// over the new list and for each new vnode, find the corresponding vnode in the old list using\n\t// the map.\n\t// 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n\t// and must be created.\n\t// For the removals, we actually remove the nodes that have been updated from the old list.\n\t// The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n\t// The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n\t// algorithm.\n\t//\n\t// the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n\t// from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n\t// corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n\t// match the above lists, for example).\n\t//\n\t// In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n\t// can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n\t//\n\t// @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n\t// the longest increasing subsequence *of old nodes still present in the new list*).\n\t//\n\t// It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n\t// and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n\t// the `LIS` and a temporary one to create the LIS).\n\t//\n\t// So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n\t// the LIS and can be updated without moving them.\n\t//\n\t// If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n\t// the exception of the last node if the list is fully reversed).\n\t//\n\t// ## Finding the next sibling.\n\t//\n\t// `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n\t// When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n\t// vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n\t// list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n\t//\n\t// In the other scenarios (swaps, upwards traversal, map-based diff),\n\t// the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n\t// bottom part of the new vnodes list, and we can use the `v.dom` value of the previous node\n\t// as the next sibling (cached in the `nextSibling` variable).\n\n\n\t// ## DOM node moves\n\t//\n\t// In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n\t// this is not the case if the node moved (second and fourth part of the diff algo). We move\n\t// the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n\t// variable rather than fetching it using `getNextSibling()`.\n\n\tfunction updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n\t\tif (old === vnodes || old == null && vnodes == null) return\n\t\telse if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)\n\t\telse if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length)\n\t\telse {\n\t\t\tvar isOldKeyed = old[0] != null && old[0].key != null\n\t\t\tvar isKeyed = vnodes[0] != null && vnodes[0].key != null\n\t\t\tvar start = 0, oldStart = 0\n\t\t\tif (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) oldStart++\n\t\t\tif (!isKeyed) while (start < vnodes.length && vnodes[start] == null) start++\n\t\t\tif (isOldKeyed !== isKeyed) {\n\t\t\t\tremoveNodes(parent, old, oldStart, old.length)\n\t\t\t\tcreateNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else if (!isKeyed) {\n\t\t\t\t// Don't index past the end of either list (causes deopts).\n\t\t\t\tvar commonLength = old.length < vnodes.length ? old.length : vnodes.length\n\t\t\t\t// Rewind if necessary to the first non-null index on either side.\n\t\t\t\t// We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n\t\t\t\t// but that would be optimizing for sparse lists which are more rare than dense ones.\n\t\t\t\tstart = start < oldStart ? start : oldStart\n\t\t\t\tfor (; start < commonLength; start++) {\n\t\t\t\t\to = old[start]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o === v || o == null && v == null) continue\n\t\t\t\t\telse if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling))\n\t\t\t\t\telse if (v == null) removeNode(parent, o)\n\t\t\t\t\telse updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\tif (old.length > commonLength) removeNodes(parent, old, start, old.length)\n\t\t\t\tif (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns)\n\t\t\t} else {\n\t\t\t\t// keyed diff\n\t\t\t\tvar oldEnd = old.length - 1, end = vnodes.length - 1, map, o, v, oe, ve, topSibling\n\n\t\t\t\t// bottom-up\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t}\n\t\t\t\t// top-down\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t\tif (o.key !== v.key) break\n\t\t\t\t\toldStart++, start++\n\t\t\t\t\tif (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns)\n\t\t\t\t}\n\t\t\t\t// swaps and list reversals\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (start === end) break\n\t\t\t\t\tif (o.key !== ve.key || oe.key !== v.key) break\n\t\t\t\t\ttopSibling = getNextSibling(old, oldStart, nextSibling)\n\t\t\t\t\tmoveDOM(parent, oe, topSibling)\n\t\t\t\t\tif (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns)\n\t\t\t\t\tif (++start <= --end) moveDOM(parent, o, nextSibling)\n\t\t\t\t\tif (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldStart++; oldEnd--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t\to = old[oldStart]\n\t\t\t\t\tv = vnodes[start]\n\t\t\t\t}\n\t\t\t\t// bottom up once again\n\t\t\t\twhile (oldEnd >= oldStart && end >= start) {\n\t\t\t\t\tif (oe.key !== ve.key) break\n\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\toldEnd--, end--\n\t\t\t\t\toe = old[oldEnd]\n\t\t\t\t\tve = vnodes[end]\n\t\t\t\t}\n\t\t\t\tif (start > end) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\telse if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\telse {\n\t\t\t\t\t// inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n\t\t\t\t\tvar originalNextSibling = nextSibling, vnodesLength = end - start + 1, oldIndices = new Array(vnodesLength), li=0, i=0, pos = 2147483647, matched = 0, map, lisIndices\n\t\t\t\t\tfor (i = 0; i < vnodesLength; i++) oldIndices[i] = -1\n\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\tif (map == null) map = getKeyMap(old, oldStart, oldEnd + 1)\n\t\t\t\t\t\tve = vnodes[i]\n\t\t\t\t\t\tvar oldIndex = map[ve.key]\n\t\t\t\t\t\tif (oldIndex != null) {\n\t\t\t\t\t\t\tpos = (oldIndex < pos) ? oldIndex : -1 // becomes -1 if nodes were re-ordered\n\t\t\t\t\t\t\toldIndices[i-start] = oldIndex\n\t\t\t\t\t\t\toe = old[oldIndex]\n\t\t\t\t\t\t\told[oldIndex] = null\n\t\t\t\t\t\t\tif (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns)\n\t\t\t\t\t\t\tif (ve.dom != null) nextSibling = ve.dom\n\t\t\t\t\t\t\tmatched++\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnextSibling = originalNextSibling\n\t\t\t\t\tif (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1)\n\t\t\t\t\tif (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (pos === -1) {\n\t\t\t\t\t\t\t// the indices of the indices of the items that are part of the\n\t\t\t\t\t\t\t// longest increasing subsequence in the oldIndices list\n\t\t\t\t\t\t\tlisIndices = makeLisIndices(oldIndices)\n\t\t\t\t\t\t\tli = lisIndices.length - 1\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif (lisIndices[li] === i - start) li--\n\t\t\t\t\t\t\t\t\telse moveDOM(parent, v, nextSibling)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (i = end; i >= start; i--) {\n\t\t\t\t\t\t\t\tv = vnodes[i]\n\t\t\t\t\t\t\t\tif (oldIndices[i-start] === -1) createNode(parent, v, hooks, ns, nextSibling)\n\t\t\t\t\t\t\t\tif (v.dom != null) nextSibling = vnodes[i].dom\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction updateNode(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvar oldTag = old.tag, tag = vnode.tag\n\t\tif (oldTag === tag) {\n\t\t\tvnode.state = old.state\n\t\t\tvnode.events = old.events\n\t\t\tif (shouldNotUpdate(vnode, old)) return\n\t\t\tif (typeof oldTag === \"string\") {\n\t\t\t\tif (vnode.attrs != null) {\n\t\t\t\t\tupdateLifecycle(vnode.attrs, vnode, hooks)\n\t\t\t\t}\n\t\t\t\tswitch (oldTag) {\n\t\t\t\t\tcase \"#\": updateText(old, vnode); break\n\t\t\t\t\tcase \"<\": updateHTML(parent, old, vnode, ns, nextSibling); break\n\t\t\t\t\tcase \"[\": updateFragment(parent, old, vnode, hooks, nextSibling, ns); break\n\t\t\t\t\tdefault: updateElement(old, vnode, hooks, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse updateComponent(parent, old, vnode, hooks, nextSibling, ns)\n\t\t}\n\t\telse {\n\t\t\tremoveNode(parent, old)\n\t\t\tcreateNode(parent, vnode, hooks, ns, nextSibling)\n\t\t}\n\t}\n\tfunction updateText(old, vnode) {\n\t\tif (old.children.toString() !== vnode.children.toString()) {\n\t\t\told.dom.nodeValue = vnode.children\n\t\t}\n\t\tvnode.dom = old.dom\n\t}\n\tfunction updateHTML(parent, old, vnode, ns, nextSibling) {\n\t\tif (old.children !== vnode.children) {\n\t\t\tremoveDOM(parent, old, undefined)\n\t\t\tcreateHTML(parent, vnode, ns, nextSibling)\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tupdateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns)\n\t\tvar domSize = 0, children = vnode.children\n\t\tvnode.dom = null\n\t\tif (children != null) {\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tvar child = children[i]\n\t\t\t\tif (child != null && child.dom != null) {\n\t\t\t\t\tif (vnode.dom == null) vnode.dom = child.dom\n\t\t\t\t\tdomSize += child.domSize || 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (domSize !== 1) vnode.domSize = domSize\n\t\t}\n\t}\n\tfunction updateElement(old, vnode, hooks, ns) {\n\t\tvar element = vnode.dom = old.dom\n\t\tns = getNameSpace(vnode) || ns\n\n\t\tupdateAttrs(vnode, old.attrs, vnode.attrs, ns)\n\t\tif (!maybeSetContentEditable(vnode)) {\n\t\t\tupdateNodes(element, old.children, vnode.children, hooks, null, ns)\n\t\t}\n\t}\n\tfunction updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n\t\tvnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode))\n\t\tif (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\")\n\t\tupdateLifecycle(vnode.state, vnode, hooks)\n\t\tif (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)\n\t\tif (vnode.instance != null) {\n\t\t\tif (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)\n\t\t\telse updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, ns)\n\t\t\tvnode.dom = vnode.instance.dom\n\t\t\tvnode.domSize = vnode.instance.domSize\n\t\t}\n\t\telse if (old.instance != null) {\n\t\t\tremoveNode(parent, old.instance)\n\t\t\tvnode.dom = undefined\n\t\t\tvnode.domSize = 0\n\t\t}\n\t\telse {\n\t\t\tvnode.dom = old.dom\n\t\t\tvnode.domSize = old.domSize\n\t\t}\n\t}\n\tfunction getKeyMap(vnodes, start, end) {\n\t\tvar map = Object.create(null)\n\t\tfor (; start < end; start++) {\n\t\t\tvar vnode = vnodes[start]\n\t\t\tif (vnode != null) {\n\t\t\t\tvar key = vnode.key\n\t\t\t\tif (key != null) map[key] = start\n\t\t\t}\n\t\t}\n\t\treturn map\n\t}\n\t// Lifted from ivi https://github.com/ivijs/ivi/\n\t// takes a list of unique numbers (-1 is special and can\n\t// occur multiple times) and returns an array with the indices\n\t// of the items that are part of the longest increasing\n\t// subsequence\n\tvar lisTemp = []\n\tfunction makeLisIndices(a) {\n\t\tvar result = [0]\n\t\tvar u = 0, v = 0, i = 0\n\t\tvar il = lisTemp.length = a.length\n\t\tfor (var i = 0; i < il; i++) lisTemp[i] = a[i]\n\t\tfor (var i = 0; i < il; ++i) {\n\t\t\tif (a[i] === -1) continue\n\t\t\tvar j = result[result.length - 1]\n\t\t\tif (a[j] < a[i]) {\n\t\t\t\tlisTemp[i] = j\n\t\t\t\tresult.push(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu = 0\n\t\t\tv = result.length - 1\n\t\t\twhile (u < v) {\n\t\t\t\t// Fast integer average without overflow.\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tvar c = (u >>> 1) + (v >>> 1) + (u & v & 1)\n\t\t\t\tif (a[result[c]] < a[i]) {\n\t\t\t\t\tu = c + 1\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tv = c\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a[i] < a[result[u]]) {\n\t\t\t\tif (u > 0) lisTemp[i] = result[u - 1]\n\t\t\t\tresult[u] = i\n\t\t\t}\n\t\t}\n\t\tu = result.length\n\t\tv = result[u - 1]\n\t\twhile (u-- > 0) {\n\t\t\tresult[u] = v\n\t\t\tv = lisTemp[v]\n\t\t}\n\t\tlisTemp.length = 0\n\t\treturn result\n\t}\n\n\tfunction getNextSibling(vnodes, i, nextSibling) {\n\t\tfor (; i < vnodes.length; i++) {\n\t\t\tif (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom\n\t\t}\n\t\treturn nextSibling\n\t}\n\n\t// This handles fragments with zombie children (removed from vdom, but persisted in DOM through onbeforeremove)\n\tfunction moveDOM(parent, vnode, nextSibling) {\n\t\tif (vnode.dom != null) {\n\t\t\tvar target\n\t\t\tif (vnode.domSize == null) {\n\t\t\t\t// don't allocate for the common case\n\t\t\t\ttarget = vnode.dom\n\t\t\t} else {\n\t\t\t\ttarget = getDocument(parent).createDocumentFragment()\n\t\t\t\tfor (var dom of domFor(vnode)) target.appendChild(dom)\n\t\t\t}\n\t\t\tinsertDOM(parent, target, nextSibling)\n\t\t}\n\t}\n\n\tfunction insertDOM(parent, dom, nextSibling) {\n\t\tif (nextSibling != null) parent.insertBefore(dom, nextSibling)\n\t\telse parent.appendChild(dom)\n\t}\n\n\tfunction maybeSetContentEditable(vnode) {\n\t\tif (vnode.attrs == null || (\n\t\t\tvnode.attrs.contenteditable == null && // attribute\n\t\t\tvnode.attrs.contentEditable == null // property\n\t\t)) return false\n\t\tvar children = vnode.children\n\t\tif (children != null && children.length === 1 && children[0].tag === \"<\") {\n\t\t\tvar content = children[0].children\n\t\t\tif (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content\n\t\t}\n\t\telse if (children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted.\")\n\t\treturn true\n\t}\n\n\t//remove\n\tfunction removeNodes(parent, vnodes, start, end) {\n\t\tfor (var i = start; i < end; i++) {\n\t\t\tvar vnode = vnodes[i]\n\t\t\tif (vnode != null) removeNode(parent, vnode)\n\t\t}\n\t}\n\tfunction removeNode(parent, vnode) {\n\t\tvar mask = 0\n\t\tvar original = vnode.state\n\t\tvar stateResult, attrsResult\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.state.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\tmask = 1\n\t\t\t\tstateResult = result\n\t\t\t}\n\t\t}\n\t\tif (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n\t\t\tvar result = callHook.call(vnode.attrs.onbeforeremove, vnode)\n\t\t\tif (result != null && typeof result.then === \"function\") {\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tmask |= 2\n\t\t\t\tattrsResult = result\n\t\t\t}\n\t\t}\n\t\tcheckState(vnode, original)\n\t\tvar generation\n\t\t// If we can, try to fast-path it and avoid all the overhead of awaiting\n\t\tif (!mask) {\n\t\t\tonremove(vnode)\n\t\t\tremoveDOM(parent, vnode, generation)\n\t\t} else {\n\t\t\tgeneration = currentRender\n\t\t\tfor (var dom of domFor(vnode)) delayedRemoval.set(dom, generation)\n\t\t\tif (stateResult != null) {\n\t\t\t\tstateResult.finally(function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 1) {\n\t\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\t\tmask &= 2\n\t\t\t\t\t\tif (!mask) {\n\t\t\t\t\t\t\tcheckState(vnode, original)\n\t\t\t\t\t\t\tonremove(vnode)\n\t\t\t\t\t\t\tremoveDOM(parent, vnode, generation)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (attrsResult != null) {\n\t\t\t\tattrsResult.finally(function () {\n\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\tif (mask & 2) {\n\t\t\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\t\t\tmask &= 1\n\t\t\t\t\t\tif (!mask) {\n\t\t\t\t\t\t\tcheckState(vnode, original)\n\t\t\t\t\t\t\tonremove(vnode)\n\t\t\t\t\t\t\tremoveDOM(parent, vnode, generation)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\tfunction removeDOM(parent, vnode, generation) {\n\t\tif (vnode.dom == null) return\n\t\tif (vnode.domSize == null) {\n\t\t\t// don't allocate for the common case\n\t\t\tif (delayedRemoval.get(vnode.dom) === generation) parent.removeChild(vnode.dom)\n\t\t} else {\n\t\t\tfor (var dom of domFor(vnode, {generation})) parent.removeChild(dom)\n\t\t}\n\t}\n\n\tfunction onremove(vnode) {\n\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode)\n\t\tif (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode)\n\t\tif (typeof vnode.tag !== \"string\") {\n\t\t\tif (vnode.instance != null) onremove(vnode.instance)\n\t\t} else {\n\t\t\tvar children = vnode.children\n\t\t\tif (Array.isArray(children)) {\n\t\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\t\tvar child = children[i]\n\t\t\t\t\tif (child != null) onremove(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//attrs\n\tfunction setAttrs(vnode, attrs, ns) {\n\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t//\n\t\t// Also, the DOM does things to inputs based on the value, so it needs set first.\n\t\t// See: https://github.com/MithrilJS/mithril.js/issues/2622\n\t\tif (vnode.tag === \"input\" && attrs.type != null) vnode.dom.setAttribute(\"type\", attrs.type)\n\t\tvar isFileInput = attrs != null && vnode.tag === \"input\" && attrs.type === \"file\"\n\t\tfor (var key in attrs) {\n\t\t\tsetAttr(vnode, key, null, attrs[key], ns, isFileInput)\n\t\t}\n\t}\n\tfunction setAttr(vnode, key, old, value, ns, isFileInput) {\n\t\tif (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || (old === value && !isFormAttribute(vnode, key)) && typeof value !== \"object\" || key === \"type\" && vnode.tag === \"input\") return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value)\n\t\tif (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, value)\n\t\telse if (hasPropertyKey(vnode, key, ns)) {\n\t\t\tif (key === \"value\") {\n\t\t\t\t// Only do the coercion if we're actually going to check the value.\n\t\t\t\t/* eslint-disable no-implicit-coercion */\n\t\t\t\t//setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n\t\t\t\t//setting input[type=file][value] to same value causes an error to be generated if it's non-empty\n\t\t\t\tif ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === \"\" + value && (isFileInput || vnode.dom === activeElement(vnode.dom))) return\n\t\t\t\t//setting select[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"select\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t//setting option[value] to same value while having select open blinks select dropdown in Chrome\n\t\t\t\tif (vnode.tag === \"option\" && old !== null && vnode.dom.value === \"\" + value) return\n\t\t\t\t//setting input[type=file][value] to different value is an error if it's non-empty\n\t\t\t\t// Not ideal, but it at least works around the most common source of uncaught exceptions for now.\n\t\t\t\tif (isFileInput && \"\" + value !== \"\") { console.error(\"`value` is read-only on file inputs!\"); return }\n\t\t\t\t/* eslint-enable no-implicit-coercion */\n\t\t\t}\n\t\t\tvnode.dom[key] = value\n\t\t} else {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tif (value) vnode.dom.setAttribute(key, \"\")\n\t\t\t\telse vnode.dom.removeAttribute(key)\n\t\t\t}\n\t\t\telse vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value)\n\t\t}\n\t}\n\tfunction removeAttr(vnode, key, old, ns) {\n\t\tif (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return\n\t\tif (key[0] === \"o\" && key[1] === \"n\") updateEvent(vnode, key, undefined)\n\t\telse if (key === \"style\") updateStyle(vnode.dom, old, null)\n\t\telse if (\n\t\t\thasPropertyKey(vnode, key, ns)\n\t\t\t&& key !== \"className\"\n\t\t\t&& key !== \"title\" // creates \"null\" as title\n\t\t\t&& !(key === \"value\" && (\n\t\t\t\tvnode.tag === \"option\"\n\t\t\t\t|| vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement(vnode.dom)\n\t\t\t))\n\t\t\t&& !(vnode.tag === \"input\" && key === \"type\")\n\t\t) {\n\t\t\tvnode.dom[key] = null\n\t\t} else {\n\t\t\tvar nsLastIndex = key.indexOf(\":\")\n\t\t\tif (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1)\n\t\t\tif (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key)\n\t\t}\n\t}\n\tfunction setLateSelectAttrs(vnode, attrs) {\n\t\tif (\"value\" in attrs) {\n\t\t\tif(attrs.value === null) {\n\t\t\t\tif (vnode.dom.selectedIndex !== -1) vnode.dom.value = null\n\t\t\t} else {\n\t\t\t\tvar normalized = \"\" + attrs.value // eslint-disable-line no-implicit-coercion\n\t\t\t\tif (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n\t\t\t\t\tvnode.dom.value = normalized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined)\n\t}\n\tfunction updateAttrs(vnode, old, attrs, ns) {\n\t\tif (old && old === attrs) {\n\t\t\tconsole.warn(\"Don't reuse attrs object, use new object for every redraw, this will throw in next major\")\n\t\t}\n\t\tif (attrs != null) {\n\t\t\t// If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\t\t\t//\n\t\t\t// Also, the DOM does things to inputs based on the value, so it needs set first.\n\t\t\t// See: https://github.com/MithrilJS/mithril.js/issues/2622\n\t\t\tif (vnode.tag === \"input\" && attrs.type != null) vnode.dom.setAttribute(\"type\", attrs.type)\n\t\t\tvar isFileInput = vnode.tag === \"input\" && attrs.type === \"file\"\n\t\t\tfor (var key in attrs) {\n\t\t\t\tsetAttr(vnode, key, old && old[key], attrs[key], ns, isFileInput)\n\t\t\t}\n\t\t}\n\t\tvar val\n\t\tif (old != null) {\n\t\t\tfor (var key in old) {\n\t\t\t\tif (((val = old[key]) != null) && (attrs == null || attrs[key] == null)) {\n\t\t\t\t\tremoveAttr(vnode, key, val, ns)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction isFormAttribute(vnode, attr) {\n\t\treturn attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === activeElement(vnode.dom) || vnode.tag === \"option\" && vnode.dom.parentNode === activeElement(vnode.dom)\n\t}\n\tfunction isLifecycleMethod(attr) {\n\t\treturn attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\"\n\t}\n\tfunction hasPropertyKey(vnode, key, ns) {\n\t\t// Filter out namespaced keys\n\t\treturn ns === undefined && (\n\t\t\t// If it's a custom element, just keep it.\n\t\t\tvnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is ||\n\t\t\t// If it's a normal element, let's try to avoid a few browser bugs.\n\t\t\tkey !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\"// && key !== \"type\"\n\t\t\t// Defer the property check until *after* we check everything.\n\t\t) && key in vnode.dom\n\t}\n\n\t//style\n\tvar uppercaseRegex = /[A-Z]/g\n\tfunction toLowerCase(capital) { return \"-\" + capital.toLowerCase() }\n\tfunction normalizeKey(key) {\n\t\treturn key[0] === \"-\" && key[1] === \"-\" ? key :\n\t\t\tkey === \"cssFloat\" ? \"float\" :\n\t\t\t\tkey.replace(uppercaseRegex, toLowerCase)\n\t}\n\tfunction updateStyle(element, old, style) {\n\t\tif (old === style) {\n\t\t\t// Styles are equivalent, do nothing.\n\t\t} else if (style == null) {\n\t\t\t// New style is missing, just clear it.\n\t\t\telement.style = \"\"\n\t\t} else if (typeof style !== \"object\") {\n\t\t\t// New style is a string, let engine deal with patching.\n\t\t\telement.style = style\n\t\t} else if (old == null || typeof old !== \"object\") {\n\t\t\t// `old` is missing or a string, `style` is an object.\n\t\t\telement.style.cssText = \"\"\n\t\t\t// Add new style properties\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null) element.style.setProperty(normalizeKey(key), String(value))\n\t\t\t}\n\t\t} else {\n\t\t\t// Both old & new are (different) objects.\n\t\t\t// Update style properties that have changed\n\t\t\tfor (var key in style) {\n\t\t\t\tvar value = style[key]\n\t\t\t\tif (value != null && (value = String(value)) !== String(old[key])) {\n\t\t\t\t\telement.style.setProperty(normalizeKey(key), value)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove style properties that no longer exist\n\t\t\tfor (var key in old) {\n\t\t\t\tif (old[key] != null && style[key] == null) {\n\t\t\t\t\telement.style.removeProperty(normalizeKey(key))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Here's an explanation of how this works:\n\t// 1. The event names are always (by design) prefixed by `on`.\n\t// 2. The EventListener interface accepts either a function or an object\n\t// with a `handleEvent` method.\n\t// 3. The object does not inherit from `Object.prototype`, to avoid\n\t// any potential interference with that (e.g. setters).\n\t// 4. The event name is remapped to the handler before calling it.\n\t// 5. In function-based event handlers, `ev.target === this`. We replicate\n\t// that below.\n\t// 6. In function-based event handlers, `return false` prevents the default\n\t// action and stops event propagation. We replicate that below.\n\tfunction EventDict() {\n\t\t// Save this, so the current redraw is correctly tracked.\n\t\tthis._ = currentRedraw\n\t}\n\tEventDict.prototype = Object.create(null)\n\tEventDict.prototype.handleEvent = function (ev) {\n\t\tvar handler = this[\"on\" + ev.type]\n\t\tvar result\n\t\tif (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev)\n\t\telse if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev)\n\t\tif (this._ && ev.redraw !== false) (0, this._)()\n\t\tif (result === false) {\n\t\t\tev.preventDefault()\n\t\t\tev.stopPropagation()\n\t\t}\n\t}\n\n\t//event\n\tfunction updateEvent(vnode, key, value) {\n\t\tif (vnode.events != null) {\n\t\t\tvnode.events._ = currentRedraw\n\t\t\tif (vnode.events[key] === value) return\n\t\t\tif (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\t\tif (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = value\n\t\t\t} else {\n\t\t\t\tif (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false)\n\t\t\t\tvnode.events[key] = undefined\n\t\t\t}\n\t\t} else if (value != null && (typeof value === \"function\" || typeof value === \"object\")) {\n\t\t\tvnode.events = new EventDict()\n\t\t\tvnode.dom.addEventListener(key.slice(2), vnode.events, false)\n\t\t\tvnode.events[key] = value\n\t\t}\n\t}\n\n\t//lifecycle\n\tfunction initLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode)\n\t\tif (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode))\n\t}\n\tfunction updateLifecycle(source, vnode, hooks) {\n\t\tif (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode))\n\t}\n\tfunction shouldNotUpdate(vnode, old) {\n\t\tdo {\n\t\t\tif (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\tif (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n\t\t\t\tvar force = callHook.call(vnode.state.onbeforeupdate, vnode, old)\n\t\t\t\tif (force !== undefined && !force) break\n\t\t\t}\n\t\t\treturn false\n\t\t} while (false); // eslint-disable-line no-constant-condition\n\t\tvnode.dom = old.dom\n\t\tvnode.domSize = old.domSize\n\t\tvnode.instance = old.instance\n\t\t// One would think having the actual latest attributes would be ideal,\n\t\t// but it doesn't let us properly diff based on our current internal\n\t\t// representation. We have to save not only the old DOM info, but also\n\t\t// the attributes used to create it, as we diff *that*, not against the\n\t\t// DOM directly (with a few exceptions in `setAttr`). And, of course, we\n\t\t// need to save the children and text as they are conceptually not\n\t\t// unlike special \"attributes\" internally.\n\t\tvnode.attrs = old.attrs\n\t\tvnode.children = old.children\n\t\tvnode.text = old.text\n\t\treturn true\n\t}\n\n\tvar currentDOM\n\n\treturn function(dom, vnodes, redraw) {\n\t\tif (!dom) throw new TypeError(\"DOM element being rendered to does not exist.\")\n\t\tif (currentDOM != null && dom.contains(currentDOM)) {\n\t\t\tthrow new TypeError(\"Node is currently being rendered to and thus is locked.\")\n\t\t}\n\t\tvar prevRedraw = currentRedraw\n\t\tvar prevDOM = currentDOM\n\t\tvar hooks = []\n\t\tvar active = activeElement(dom)\n\t\tvar namespace = dom.namespaceURI\n\n\t\tcurrentDOM = dom\n\t\tcurrentRedraw = typeof redraw === \"function\" ? redraw : undefined\n\t\tcurrentRender = {}\n\t\ttry {\n\t\t\t// First time rendering into a node clears it out\n\t\t\tif (dom.vnodes == null) dom.textContent = \"\"\n\t\t\tvnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes])\n\t\t\tupdateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace)\n\t\t\tdom.vnodes = vnodes\n\t\t\t// `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\t\t\tif (active != null && activeElement(dom) !== active && typeof active.focus === \"function\") active.focus()\n\t\t\tfor (var i = 0; i < hooks.length; i++) hooks[i]()\n\t\t} finally {\n\t\t\tcurrentRedraw = prevRedraw\n\t\t\tcurrentDOM = prevDOM\n\t\t}\n\t}\n}\n","\"use strict\"\n\nvar Vnode = require(\"../render/vnode\")\n\nmodule.exports = function(html) {\n\tif (html == null) html = \"\"\n\treturn Vnode(\"<\", undefined, undefined, html, undefined, undefined)\n}\n","\"use strict\"\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n\treturn {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}\n}\nVnode.normalize = function(node) {\n\tif (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)\n\tif (node == null || typeof node === \"boolean\") return null\n\tif (typeof node === \"object\") return node\n\treturn Vnode(\"#\", undefined, undefined, String(node), undefined, undefined)\n}\nVnode.normalizeChildren = function(input) {\n\tvar children = []\n\tif (input.length) {\n\t\tvar isKeyed = input[0] != null && input[0].key != null\n\t\t// Note: this is a *very* perf-sensitive check.\n\t\t// Fun fact: merging the loop like this is somehow faster than splitting\n\t\t// it, noticeably so.\n\t\tfor (var i = 1; i < input.length; i++) {\n\t\t\tif ((input[i] != null && input[i].key != null) !== isKeyed) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\tisKeyed && (input[i] != null || typeof input[i] === \"boolean\")\n\t\t\t\t\t\t? \"In fragments, vnodes must either all have keys or none have keys. You may wish to consider using an explicit keyed empty fragment, m.fragment({key: ...}), instead of a hole.\"\n\t\t\t\t\t\t: \"In fragments, vnodes must either all have keys or none have keys.\"\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\tchildren[i] = Vnode.normalize(input[i])\n\t\t}\n\t}\n\treturn children\n}\n\nmodule.exports = Vnode\n","\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./request/request\")(typeof window !== \"undefined\" ? window : null, mountRedraw.redraw)\n","\"use strict\"\n\nvar buildPathname = require(\"../pathname/build\")\nvar hasOwn = require(\"../util/hasOwn\")\n\nmodule.exports = function($window, oncompletion) {\n\tfunction PromiseProxy(executor) {\n\t\treturn new Promise(executor)\n\t}\n\n\tfunction makeRequest(url, args) {\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\turl = buildPathname(url, args.params)\n\t\t\tvar method = args.method != null ? args.method.toUpperCase() : \"GET\"\n\t\t\tvar body = args.body\n\t\t\tvar assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData || body instanceof $window.URLSearchParams)\n\t\t\tvar responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\")\n\n\t\t\tvar xhr = new $window.XMLHttpRequest(), aborted = false, isTimeout = false\n\t\t\tvar original = xhr, replacedAbort\n\t\t\tvar abort = xhr.abort\n\n\t\t\txhr.abort = function() {\n\t\t\t\taborted = true\n\t\t\t\tabort.call(this)\n\t\t\t}\n\n\t\t\txhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined)\n\n\t\t\tif (assumeJSON && body != null && !hasHeader(args, \"content-type\")) {\n\t\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\t}\n\t\t\tif (typeof args.deserialize !== \"function\" && !hasHeader(args, \"accept\")) {\n\t\t\t\txhr.setRequestHeader(\"Accept\", \"application/json, text/*\")\n\t\t\t}\n\t\t\tif (args.withCredentials) xhr.withCredentials = args.withCredentials\n\t\t\tif (args.timeout) xhr.timeout = args.timeout\n\t\t\txhr.responseType = responseType\n\n\t\t\tfor (var key in args.headers) {\n\t\t\t\tif (hasOwn.call(args.headers, key)) {\n\t\t\t\t\txhr.setRequestHeader(key, args.headers[key])\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.onreadystatechange = function(ev) {\n\t\t\t\t// Don't throw errors on xhr.abort().\n\t\t\t\tif (aborted) return\n\n\t\t\t\tif (ev.target.readyState === 4) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar success = (ev.target.status >= 200 && ev.target.status < 300) || ev.target.status === 304 || (/^file:\\/\\//i).test(url)\n\t\t\t\t\t\t// When the response type isn't \"\" or \"text\",\n\t\t\t\t\t\t// `xhr.responseText` is the wrong thing to use.\n\t\t\t\t\t\t// Browsers do the right thing and throw here, and we\n\t\t\t\t\t\t// should honor that and do the right thing by\n\t\t\t\t\t\t// preferring `xhr.response` where possible/practical.\n\t\t\t\t\t\tvar response = ev.target.response, message\n\n\t\t\t\t\t\tif (responseType === \"json\") {\n\t\t\t\t\t\t\t// For IE and Edge, which don't implement\n\t\t\t\t\t\t\t// `responseType: \"json\"`.\n\t\t\t\t\t\t\tif (!ev.target.responseType && typeof args.extract !== \"function\") {\n\t\t\t\t\t\t\t\t// Handle no-content which will not parse.\n\t\t\t\t\t\t\t\ttry { response = JSON.parse(ev.target.responseText) }\n\t\t\t\t\t\t\t\tcatch (e) { response = null }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!responseType || responseType === \"text\") {\n\t\t\t\t\t\t\t// Only use this default if it's text. If a parsed\n\t\t\t\t\t\t\t// document is needed on old IE and friends (all\n\t\t\t\t\t\t\t// unsupported), the user should use a custom\n\t\t\t\t\t\t\t// `config` instead. They're already using this at\n\t\t\t\t\t\t\t// their own risk.\n\t\t\t\t\t\t\tif (response == null) response = ev.target.responseText\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof args.extract === \"function\") {\n\t\t\t\t\t\t\tresponse = args.extract(ev.target, args)\n\t\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\t} else if (typeof args.deserialize === \"function\") {\n\t\t\t\t\t\t\tresponse = args.deserialize(response)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tif (typeof args.type === \"function\") {\n\t\t\t\t\t\t\t\tif (Array.isArray(response)) {\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\t\t\t\t\t\t\t\tresponse[i] = new args.type(response[i])\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse response = new args.type(response)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresolve(response)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar completeErrorResponse = function() {\n\t\t\t\t\t\t\t\ttry { message = ev.target.responseText }\n\t\t\t\t\t\t\t\tcatch (e) { message = response }\n\t\t\t\t\t\t\t\tvar error = new Error(message)\n\t\t\t\t\t\t\t\terror.code = ev.target.status\n\t\t\t\t\t\t\t\terror.response = response\n\t\t\t\t\t\t\t\treject(error)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (xhr.status === 0) {\n\t\t\t\t\t\t\t\t// Use setTimeout to push this code block onto the event queue\n\t\t\t\t\t\t\t\t// This allows `xhr.ontimeout` to run in the case that there is a timeout\n\t\t\t\t\t\t\t\t// Without this setTimeout, `xhr.ontimeout` doesn't have a chance to reject\n\t\t\t\t\t\t\t\t// as `xhr.onreadystatechange` will run before it\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tif (isTimeout) return\n\t\t\t\t\t\t\t\t\tcompleteErrorResponse()\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t} else completeErrorResponse()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\treject(e)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\txhr.ontimeout = function (ev) {\n\t\t\t\tisTimeout = true\n\t\t\t\tvar error = new Error(\"Request timed out\")\n\t\t\t\terror.code = ev.target.status\n\t\t\t\treject(error)\n\t\t\t}\n\n\t\t\tif (typeof args.config === \"function\") {\n\t\t\t\txhr = args.config(xhr, args, url) || xhr\n\n\t\t\t\t// Propagate the `abort` to any replacement XHR as well.\n\t\t\t\tif (xhr !== original) {\n\t\t\t\t\treplacedAbort = xhr.abort\n\t\t\t\t\txhr.abort = function() {\n\t\t\t\t\t\taborted = true\n\t\t\t\t\t\treplacedAbort.call(this)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (body == null) xhr.send()\n\t\t\telse if (typeof args.serialize === \"function\") xhr.send(args.serialize(body))\n\t\t\telse if (body instanceof $window.FormData || body instanceof $window.URLSearchParams) xhr.send(body)\n\t\t\telse xhr.send(JSON.stringify(body))\n\t\t})\n\t}\n\n\t// In case the global Promise is some userland library's where they rely on\n\t// `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n\t// similar. Let's *not* break them.\n\tPromiseProxy.prototype = Promise.prototype\n\tPromiseProxy.__proto__ = Promise // eslint-disable-line no-proto\n\n\tfunction hasHeader(args, name) {\n\t\tfor (var key in args.headers) {\n\t\t\tif (hasOwn.call(args.headers, key) && key.toLowerCase() === name) return true\n\t\t}\n\t\treturn false\n\t}\n\n\treturn {\n\t\trequest: function(url, args) {\n\t\t\tif (typeof url !== \"string\") { args = url; url = url.url }\n\t\t\telse if (args == null) args = {}\n\t\t\tvar promise = makeRequest(url, args)\n\t\t\tif (args.background === true) return promise\n\t\t\tvar count = 0\n\t\t\tfunction complete() {\n\t\t\t\tif (--count === 0 && typeof oncompletion === \"function\") oncompletion()\n\t\t\t}\n\n\t\t\treturn wrap(promise)\n\n\t\t\tfunction wrap(promise) {\n\t\t\t\tvar then = promise.then\n\t\t\t\t// Set the constructor, so engines know to not await or resolve\n\t\t\t\t// this as a native promise. At the time of writing, this is\n\t\t\t\t// only necessary for V8, but their behavior is the correct\n\t\t\t\t// behavior per spec. See this spec issue for more details:\n\t\t\t\t// https://github.com/tc39/ecma262/issues/1577. Also, see the\n\t\t\t\t// corresponding comment in `request/tests/test-request.js` for\n\t\t\t\t// a bit more background on the issue at hand.\n\t\t\t\tpromise.constructor = PromiseProxy\n\t\t\t\tpromise.then = function() {\n\t\t\t\t\tcount++\n\t\t\t\t\tvar next = then.apply(promise, arguments)\n\t\t\t\t\tnext.then(complete, function(e) {\n\t\t\t\t\t\tcomplete()\n\t\t\t\t\t\tif (count === 0) throw e\n\t\t\t\t\t})\n\t\t\t\t\treturn wrap(next)\n\t\t\t\t}\n\t\t\t\treturn promise\n\t\t\t}\n\t\t}\n\t}\n}\n","\"use strict\"\n\nvar mountRedraw = require(\"./mount-redraw\")\n\nmodule.exports = require(\"./api/router\")(typeof window !== \"undefined\" ? window : null, mountRedraw)\n","// This exists so I'm only saving it once.\n\"use strict\"\n\nvar hasOwn = require(\"./hasOwn\")\n\nmodule.exports = Object.assign || function(target, source) {\n\tfor (var key in source) {\n\t\tif (hasOwn.call(source, key)) target[key] = source[key]\n\t}\n}\n","\"use strict\"\n\n// Note: this is mildly perf-sensitive.\n//\n// It does *not* use `delete` - dynamic `delete`s usually cause objects to bail\n// out into dictionary mode and just generally cause a bunch of optimization\n// issues within engines.\n//\n// Ideally, I would've preferred to do this, if it weren't for the optimization\n// issues:\n//\n// ```js\n// const hasOwn = require(\"./hasOwn\")\n// const magic = [\n// \"key\", \"oninit\", \"oncreate\", \"onbeforeupdate\", \"onupdate\",\n// \"onbeforeremove\", \"onremove\",\n// ]\n// module.exports = (attrs, extras) => {\n// const result = Object.assign(Object.create(null), attrs)\n// for (const key of magic) delete result[key]\n// if (extras != null) for (const key of extras) delete result[key]\n// return result\n// }\n// ```\n\nvar hasOwn = require(\"./hasOwn\")\n// Words in RegExp literals are sometimes mangled incorrectly by the internal bundler, so use RegExp().\nvar magic = new RegExp(\"^(?:key|oninit|oncreate|onbeforeupdate|onupdate|onbeforeremove|onremove)$\")\n\nmodule.exports = function(attrs, extras) {\n\tvar result = {}\n\n\tif (extras != null) {\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key) && !magic.test(key) && extras.indexOf(key) < 0) {\n\t\t\t\tresult[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var key in attrs) {\n\t\t\tif (hasOwn.call(attrs, key) && !magic.test(key)) {\n\t\t\t\tresult[key] = attrs[key]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result\n}\n","// This exists so I'm only saving it once.\n\"use strict\"\n\nmodule.exports = {}.hasOwnProperty\n","function none(n) {\n return 'n'\n}\nfunction p_ne_1(n) {\n return n !== 1 ? 'p' : 's'\n}\nfunction p_gt_1(n) {\n return n > 1 ? 'p' : 's'\n}\n\n// ---------------------------------------------------------------------------\n\nexports.plural_CS = function(n) {\n return n == 1 ? 's' : n >= 2 && n <= 4 ? 'p' : 'n'\n}\nexports.plural_DA = p_ne_1\nexports.plural_DE = p_ne_1\nexports.plural_EN = p_ne_1\nexports.plural_ES = p_ne_1\nexports.plural_FR = p_gt_1\nexports.plural_IS = function(n) {\n return n % 10 !== 1 || n % 100 === 11 ? 'p' : 's'\n}\nexports.plural_IT = p_ne_1\nexports.plural_JA = none\nexports.plural_PT = p_ne_1\nexports.plural_SE = p_ne_1\n","import { ComponentTypes } from 'mithril';\nimport { State } from '../services';\n\ntype IconResolver = string | (() => string);\n\nexport enum Pages {\n LANDING = 'LANDING',\n LOGIN = 'LOGIN',\n HOME = 'HOME',\n CRIME_SCRIPT = 'CRIME_SCRIPT',\n SETTINGS = 'SETTINGS',\n ABOUT = 'ABOUT',\n CASE = 'CASE',\n}\n\nexport type VisibilityResolver = (s: State) => boolean;\n\nexport interface Page {\n id: Pages;\n default?: boolean;\n hasNavBar?: boolean;\n title: string;\n icon?: IconResolver;\n iconClass?: string;\n route: string;\n visible: boolean | VisibilityResolver;\n component: ComponentTypes;\n sidebar?: ComponentTypes;\n hasSidebar?: boolean;\n}\n","import e from\"mithril\";const t=()=>\"idxxxxxxxx\".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),a=()=>\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return(\"x\"===e?t:3&t|8).toString(16)}),i=(...e)=>t=>e.reduceRight((e,t)=>t(e),t),l=e=>t=>Array.prototype.map.call(t,e),o=e=>t=>Array.prototype.join.call(t,e),n=e=>e.replace(/([A-Z])/g,e=>\"-\"+e.toLowerCase()),s=e=>e?i(o(\"\"),l(t=>`[${n(t)}=\"${((e=\"\")=>e.toString().replace(/\"/g,\""\"))(e[t])}\"]`),Object.keys)(e):\"\",r=[\"min\",\"max\",\"minLength\",\"maxLength\",\"rows\",\"cols\",\"placeholder\",\"autocomplete\",\"pattern\",\"readOnly\",\"step\"],c=e=>r.indexOf(e)>=0,d=({disabled:e})=>e?\"[disabled]\":\"\",p=({required:e,isMandatory:t})=>e||t?\"[required][aria-required=true]\":\"\",m=e=>(e=>{const t=(a=e,e=>void 0!==a[e]);var a;return Object.keys(e).filter(c).filter(t).reduce((t,a)=>{const i=e[a];return t.push(`[${a.toLowerCase()}=${i}]`),t},[]).join(\"\")})(e)+(e=>e.maxLength?`[data-length=${e.maxLength}]`:\"\")(e)+d(e)+p(e)+(({autofocus:e})=>\"boolean\"==typeof e&&e||e&&e()?\"[autofocus]\":\"\")(e),u=e=>!isNaN(parseFloat(e))&&isFinite(e),h=(...e)=>t=>e.reduce((e,t)=>t(e),t),v=(e,t=2,a=\"0\")=>(e+=\"\").length>=t?e:new Array(t-e.length+1).join(a)+e,b=(e,t,a)=>{const i=e[t];e[t]=e[a],e[a]=i},y=(e,t,a)=>{const i=e[t];e.splice(t,1),e.splice(a,0,i)};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(l[a]=e[a]);return l}const x=[\"label\",\"id\",\"isMandatory\",\"isActive\"],w={view:({attrs:t})=>e(\"span.mandatory\",t,\"*\")},k=()=>({view:t=>{let{attrs:{label:a,id:i,isMandatory:l,isActive:o}}=t,n=f(t.attrs,x);return a?e(`label${o?\".active\":\"\"}${i?`[for=${i}]`:\"\"}`,n,[e.trust(a),l?e(w):void 0]):void 0}}),N=()=>({view:({attrs:{helperText:t,dataError:a,dataSuccess:i,className:l}})=>t||a||i?e(\"span.helper-text\",{className:l,dataError:a,dataSuccess:i},t?e.trust(t):\"\"):void 0}),$=()=>{const a={id:t()};return{view:({attrs:t})=>{const i=t.id||a.id,l=m(t),{label:o,helperText:n,initialValue:s,onchange:r,newRow:c,className:d=\"col s12\",style:p,iconName:u,isMandatory:h}=t;return e(\".input-field\"+(c?\".clear\":\"\"),{className:c?d+\" clear\":d,style:p},[u?e(\"i.material-icons.prefix\",u):\"\",e(`input.autocomplete[type=text][tabindex=0]${l}`,{id:i,oncreate:({dom:e})=>{M.Autocomplete.init(e,t)},onchange:r?e=>{e.target&&e.target.value&&r(e.target.value)}:void 0,value:s}),e(k,{label:o,id:i,isMandatory:h,isActive:s}),e(N,{helperText:n})])}}},C=[\"iconName\"],I=()=>({view:t=>{let{attrs:{iconName:a}}=t,i=f(t.attrs,C);return e(\"i.material-icons\",i,a)}}),A=[\"modalId\",\"tooltip\",\"tooltipPostion\",\"iconName\",\"iconClass\",\"label\",\"attr\"],T=(t,a=\"\")=>()=>{const i=`${t}${a}`;return{view:({attrs:t})=>{const{modalId:a,tooltip:l,tooltipPostion:o,iconName:n,iconClass:r,label:c,attr:d}=t,p=f(t,A);return e(`${i}${a?`.modal-trigger[href=#${a}]`:\"\"}${l?`.tooltipped[data-position=${o||\"top\"}][data-tooltip=${l}]`:\"\"}${s(d)}`,p,n?e(I,{iconName:n,className:r||\"left\"}):void 0,c||void 0)}}},V=T(\"a.waves-effect.waves-light.btn\",\"[type=button]\"),S=T(\"a.waves-effect.waves-light.btn-large\",\"[type=button]\"),O=T(\"a.waves-effect.waves-light.btn-small\",\"[type=button]\"),R=T(\"a.waves-effect.waves-teal.btn-flat\",\"[type=button]\"),j=T(\"button.btn-floating.btn-large.waves-effect.waves-light\",\"[type=button]\"),L=T(\"button.btn.waves-effect.waves-light\",\"[type=submit]\"),E=()=>({view:({attrs:{href:t,src:a}})=>e(\"a.carousel-item\",{href:t},e(`img[src=${a}]`))}),F=()=>({view:({attrs:t})=>{const{items:a}=t;return a&&a.length>0?e(\".carousel\",{oncreate:({dom:e})=>{M.Carousel.init(e,t)}},a.map(t=>e(E,t))):void 0}}),D=()=>({oncreate:({attrs:e,dom:t})=>{const{onchange:a,onChipAdd:i,onChipDelete:l}=e,o=M.Chips.getInstance(t.children[0]),n=i?i.bind(o):void 0;e.onChipAdd=function(e,t){a&&a(this.chipsData),n&&n(e,t)};const s=l?l.bind(o):void 0;e.onChipDelete=function(e,t){a&&a(this.chipsData),s&&s(e,t)},M.Chips.init(t.children[0],e)},onupdate:({dom:e,attrs:{data:t}})=>{if(!t||0===t.length)return;const a=M.Chips.getInstance(e.children[0]);t.forEach(e=>a.addChip(e))},view:({attrs:{placeholder:t,required:a,isMandatory:i=a,data:l,className:o=\"col s12\",label:n,helperText:s}})=>e(\".input-field\",{className:o},[e(`.chips.chips-autocomplete${t?\".chips-placeholder\":\"\"}${l?\".chips-initial\":\"\"}`),n?e(k,{label:n,isMandatory:i,className:\"active\"}):void 0,s?e(N,{helperText:s}):void 0])}),K=()=>({view:({attrs:t})=>{const{newRow:a,code:i,language:l}=t,o=l||\"lang-TypeScript\",n=o.replace(\"lang-\",\"\"),s=i instanceof Array?i.join(\"\\n\"):i;return e(\"pre.codeblock\"+(a?\".clear\":\"\"),t,[e(\"div\",e(\"label\",n)),e(`code.${o}`,s)])}}),_=()=>({view:({attrs:{header:t,body:a,active:i,iconName:l}})=>e(i?\"li.active\":\"li\",[t||l?e(\".collapsible-header\",[l?e(\"i.material-icons\",l):void 0,t?\"string\"==typeof t?e(\"span\",t):t:void 0]):void 0,a?e(\".collapsible-body\",a):void 0])}),B=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:t})=>{const{items:a,class:i,className:l,style:o,id:n}=t;return a&&a.length>0?e(\"ul.collapsible\",{class:i||l,style:o,id:n},a.map(t=>e(_,t))):void 0}}),q=[\"header\",\"items\",\"mode\"],P=[\"title\",\"active\",\"href\"],U=[\"items\",\"header\"],z=[\"items\",\"header\",\"mode\"];var H;!function(e){e[e.BASIC=0]=\"BASIC\",e[e.LINKS=1]=\"LINKS\",e[e.AVATAR=2]=\"AVATAR\"}(H||(H={}));const W=e=>e&&/https?:\\/\\//.test(e),Y=()=>({view:({attrs:t})=>{const{href:a,iconName:i=\"send\",onclick:l,style:o={cursor:\"pointer\"}}=t,n={href:a,style:o,className:\"secondary-content\",onclick:l?()=>l(t):void 0};return W(a)||!a?e(\"a[target=_]\",n,e(I,{iconName:i})):e(e.route.Link,n,e(I,{iconName:i}))}}),Z=(e=\"\")=>/\\./.test(e),G=()=>({view:({attrs:{item:t,mode:a}})=>{const{title:i,content:l=\"\",active:o,iconName:n,avatar:s,className:r,onclick:c}=t;return a===H.AVATAR?e(\"li.collection-item.avatar\"+(o?\".active\":\"\"),{onclick:c?()=>c(t):void 0},[Z(s)?e(\"img.circle\",{src:s}):e(\"i.material-icons.circle\",{className:r},s),e(\"span.title\",i),e(\"p\",e.trust(l)),e(Y,t)]):e(\"li.collection-item\"+(o?\".active\":\"\"),n?e(\"div\",[i,e(Y,t)]):i)}}),J=()=>({view:t=>{let{attrs:{header:a,items:i,mode:l=H.BASIC}}=t,o=f(t.attrs,q);const n=i.map(t=>e(G,{key:t.id,item:t,mode:l}));return a?e(\"ul.collection.with-header\",o,[e(\"li.collection-header\",e(\"h4\",a)),n]):e(\"ul.collection\",o,n)}}),Q=()=>({view:({attrs:{item:t}})=>{const{title:a,active:i,href:l}=t,o=g({},f(t,P),{className:\"collection-item \"+(i?\"active\":\"\"),href:l});return W(l)||!l?e(\"a[target=_]\",o,a):e(e.route.Link,o,a)}}),X=()=>({view:t=>{let{attrs:{items:a,header:i}}=t,l=f(t.attrs,U);return i?e(\".collection.with-header\",l,[e(\".collection-header\",e(\"h4\",i)),a.map(t=>e(Q,{key:t.id,item:t}))]):e(\".collection\",l,a.map(t=>e(Q,{key:t.id,item:t})))}}),ee=()=>({view:t=>{let{attrs:{items:a,header:i,mode:l=H.BASIC}}=t,o=f(t.attrs,z);return i||a&&a.length>0?l===H.LINKS?e(X,g({header:i,items:a},o)):e(J,g({header:i,items:a,mode:l},o)):void 0}}),te=[\"key\",\"label\",\"onchange\",\"disabled\",\"items\",\"iconName\",\"helperText\",\"style\",\"className\"],ae=()=>{const a={};return{oninit:({attrs:{id:e=t(),initialValue:i,checkedId:l}})=>{a.id=e,a.initialValue=i||l},view:t=>{let{attrs:{key:i,label:l,onchange:o,disabled:n=!1,items:s,iconName:r,helperText:c,style:d,className:p=\"col s12\"}}=t,m=f(t.attrs,te);const{id:u,initialValue:h}=a,v=h?s.filter(e=>e.id?e.id===h:e.label===h).shift():void 0,b=v?v.label:l||\"Select\";return e(\".input-field\",{className:p,key:i,style:d},[r?e(\"i.material-icons.prefix\",r):void 0,e(N,{helperText:c}),e(`a.dropdown-trigger.btn.truncate[href=#][data-target=${u}]${n?\"[disabled]\":\"\"}`,{className:\"col s12\",style:d||(r?\"margin: 0.2em 0 0 3em;\":void 0),oncreate:({dom:e})=>{M.Dropdown.init(e,m)}},b),e(`ul.dropdown-content[id=${u}]`,s.map(t=>e(\"li\"+(t.divider?\".divider[tabindex=-1]\":\"\"),t.divider?void 0:e(\"a\",{onclick:o?()=>{a.initialValue=t.id||t.label,o(a.initialValue)}:void 0},[t.iconName?e(\"i.material-icons\",t.iconName):void 0,t.label]))))])}}},ie=[\"className\",\"iconName\",\"iconClass\",\"position\",\"style\",\"buttons\"],le=()=>({view:t=>{let{attrs:{className:a,iconName:i,iconClass:l=\"large\",position:o,style:n=(\"left\"===o||\"inline-left\"===o?\"position: absolute; display: inline-block; left: 24px;\":\"right\"===o||\"inline-right\"===o?\"position: absolute; display: inline-block; right: 24px;\":void 0),buttons:s}}=t,r=f(t.attrs,ie);const c=e(\".fixed-action-btn\",{style:n,oncreate:({dom:e})=>M.FloatingActionButton.init(e,r)},[e(\"a.btn-floating.btn-large\",{className:a},e(\"i.material-icons\",{classNames:l},i)),s?e(\"ul\",s.map(t=>e(\"li\",e(\"a.btn-floating\",{className:t.className,onclick:e=>t.onClick&&t.onClick(e)},e(\"i.material-icons\",{className:t.iconClass},t.iconName))))):void 0]);return\"inline-right\"===o||\"inline-left\"===o?e(\"div\",{style:\"position: relative; height: 70px;\"},c):c}}),oe=[\"className\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\"],ne=[\"className\",\"dataError\",\"dataSuccess\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"maxLength\",\"newRow\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\",\"validate\"],se=()=>{const a={id:t()};return{view:({attrs:t})=>{const{className:i=\"col s12\",helperText:l,iconName:o,id:n=a.id,initialValue:s,isMandatory:r,label:c,onchange:d,onkeydown:p,onkeypress:u,onkeyup:h,onblur:v,style:b}=t,y=f(t,oe),g=m(y);return e(\".input-field\",{className:i,style:b},[o?e(\"i.material-icons.prefix\",o):\"\",e(`textarea.materialize-textarea[tabindex=0][id=${n}]${g}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),t.maxLength&&M.CharacterCounter.init(e)},onchange:d?e=>{const t=e.target;d(t&&\"string\"==typeof t.value?t.value:\"\")}:void 0,value:s,onkeyup:h?e=>{h(e,e.target.value)}:void 0,onkeydown:p?e=>{p(e,e.target.value)}:void 0,onkeypress:u?e=>{u(e,e.target.value)}:void 0,onblur:v}),e(k,{label:c,id:n,isMandatory:r,isActive:s||t.placeholder}),e(N,{helperText:l})])}}},re=(a,i=\"\")=>()=>{const l={id:t()},o=e=>{const t=e.value;return!t||\"number\"!==a&&\"range\"!==a?t:+t},n=(e,t)=>{e.setCustomValidity(\"boolean\"==typeof t?t?\"\":\"Custom validation failed\":t)};return{view:({attrs:t})=>{const{className:s=\"col s12\",dataError:r,dataSuccess:c,helperText:d,iconName:p,id:u=l.id,initialValue:h,isMandatory:v,label:b,maxLength:y,newRow:g,onchange:x,onkeydown:w,onkeypress:$,onkeyup:C,onblur:I,style:A,validate:T}=t,V=f(t,ne),S=m(V);return e(`.input-field${g?\".clear\":\"\"}${i}`,{className:s,style:A},[p?e(\"i.material-icons.prefix\",p):void 0,e(`input.validate[type=${a}][tabindex=0][id=${u}]${S}`,{oncreate:({dom:e})=>{(({autofocus:e})=>!!e&&(\"boolean\"==typeof e?e:e()))(t)&&e.focus(),y&&M.CharacterCounter.init(e),\"range\"===a&&M.Range.init(e)},onkeyup:C?e=>{C(e,o(e.target))}:void 0,onkeydown:w?e=>{w(e,o(e.target))}:void 0,onkeypress:$?e=>{$(e,o(e.target))}:void 0,onblur:I,onupdate:T?({dom:e})=>{const t=e;n(t,T(o(t),t))}:void 0,onchange:e=>{const t=e.target;if(t){const e=o(t);x&&x(e),T&&n(t,T(e,t))}},value:h}),e(k,{label:b,id:u,isMandatory:v,isActive:!(void 0===h&&!t.placeholder&&\"number\"!==a&&\"color\"!==a&&\"range\"!==a)}),e(N,{helperText:d,dataError:r,dataSuccess:c})])}}},ce=re(\"text\"),de=re(\"password\"),pe=re(\"number\"),me=re(\"url\"),ue=re(\"color\"),he=re(\"range\",\".range-field\"),ve=re(\"email\"),be=()=>{let t,a=!1;return{view:({attrs:i})=>{const{multiple:l,disabled:o,initialValue:n,placeholder:s,onchange:r,className:c=\"col s12\",accept:d,label:p=\"File\"}=i,m=d?d instanceof Array?d.join(\", \"):d:void 0,u=m?`[accept=${m}]`:\"\",h=l?\"[multiple]\":\"\",v=o?\"[disabled]\":\"\",b=s?`[placeholder=${s}]`:\"\";return e(\".file-field.input-field\",{className:i.class||c},[e(\".btn\",[e(\"span\",p),e(`input[type=file]${h}${v}${u}`,{onchange:r?e=>{const t=e.target;t&&t.files&&r&&(a=!0,r(t.files))}:void 0})]),e(\".file-path-wrapper\",e(`input.file-path.validate${b}[type=text]`,{oncreate:({dom:e})=>{t=e,n&&(t.value=n)}})),(a||n)&&e(\"a.waves-effect.waves-teal.btn-flat\",{style:\"float: right;position: relative;top: -3rem; padding: 0\",onclick:()=>{a=!1,t.value=\"\",r&&r({})}},e(\"i.material-icons\",\"clear\"))])}}},ye=()=>({view:({attrs:{className:t=\"col s12\",onchange:a,label:i,checked:l,disabled:o,description:n}})=>e(\"div\",{className:t},e(\"label\",[e(\"input[type=checkbox][tabindex=0]\",{checked:l,disabled:o,onclick:a?e=>{e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),i?\"string\"==typeof i?e(\"span\",i):i:void 0]),n&&e(N,{className:\"input-checkbox-desc\",helperText:n}))}),ge=()=>{const t={},a=e=>t.checkedIds.indexOf(e)>=0;return{oninit:({attrs:{initialValue:e,checkedId:a}})=>{const i=a||e;t.checkedId=a,t.checkedIds=i?i instanceof Array?[...i]:[i]:[]},view:({attrs:{label:i,id:l,options:o,checkedId:n,description:s,className:r=\"col s12\",disabled:c,checkboxClass:d,newRow:p,isMandatory:m,onchange:u}})=>{n&&t.checkedId!==n&&(t.checkedId=n,t.checkedIds=n instanceof Array?n:[n]);const h=u?(e,a)=>{const i=t.checkedIds.filter(t=>t!==e);a&&i.push(e),t.checkedIds=i,u(i)}:void 0;return e(\"div\"+(p?\".clear\":\"\"),{className:r},[e(\"div\",{className:\"input-field options\"},e(k,{id:l,label:i,isMandatory:m})),e(N,{helperText:s}),...o.map(t=>e(ye,{disabled:c||t.disabled,label:t.label,onchange:h?e=>h(t.id,e):void 0,className:t.className||d,checked:a(t.id),description:t.description}))])}}},fe=()=>{const a=e=>i.curKey=i.id=e,i={elementId:t(),id:\"\",curKey:\"\",kvc:(t,a,i)=>{const{keyClass:l=\".col.s4\",valueClass:o=\".col.s8\"}=i,n=a instanceof Array?a.join(\", \"):\"boolean\"==typeof a?e(ye,{label:\" \",checked:a,disabled:!0,className:\"checkbox-in-collection\"}):a.toString();return{title:e(\".row\",{style:\"margin-bottom: 0\"},[e(l,e(\"b\",t)),e(o,n)])}}},l=()=>{i.id=\"\",i.curKey=\"\"};return{oninit:({attrs:{keyValueConverter:e,id:t}})=>{e&&(i.kvc=e),t&&(i.elementId=t)},view:({attrs:{className:t=\"col s12\",disabled:o,disallowArrays:n,header:s,iconName:r,iconNameKey:c=(r?\"label\":void 0),isMandatory:d,label:p,labelKey:m=\"Key\",labelValue:u=\"Value\",properties:h,keyClass:v,valueClass:b,onchange:y,falsy:g=[\"false\"],truthy:f=[\"true\"]}})=>{const x=()=>y?y(h):void 0,w=((e,t)=>Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>((e,t)=>{const l=t.onclick;return t.id=t.id||e,t.active=e===i.curKey,t.onclick=l?()=>a(e)&&l(t):()=>a(e),t})(e.key,i.kvc(e.key,e.value,{keyClass:t.keyClass,valueClass:t.valueClass}))))(h,{keyClass:v,valueClass:b}),N=i.curKey,$=h[N],M=\"boolean\"==typeof $||\"number\"==typeof $?$:$?$ instanceof Array?`[${$.join(\", \")}]`:$:\"\",C=i.elementId;return[e(\".map-editor\",e(\".input-field\",{className:t,style:\"min-height: 1.5em;\"},[r?e(\"i.material-icons.prefix\",r):\"\",e(k,{label:p,isMandatory:d,isActive:w.length>0}),e(ee,{id:C,items:w,mode:H.LINKS,header:s})])),o?void 0:[e(ce,{label:m,iconName:c,className:\"col s5\",initialValue:N,onchange:e=>{i.curKey=e,i.id&&(delete h[i.id],h[e]=$,i.id=e),x()}}),\"string\"==typeof M?e(se,{label:u,initialValue:M,className:\"col s7\",onchange:e=>{const t=(i=g,f.indexOf(a=e)>=0||!(i.indexOf(a)>=0)&&void 0);var a,i;const l=void 0===t&&/^\\s*\\d+\\s*$/i.test(e)?+e:void 0;h[N]=\"boolean\"==typeof t?t:\"number\"==typeof l?l:((e,t=!1)=>{if(t)return e;if(!e)return;const a=/\\s*\\[(.*)\\]\\s*/gi.exec(e);return a&&2===a.length?a[1].split(\",\").map(e=>e.trim()).map(e=>/^\\d+$/g.test(e)?+e:e):void 0})(e,n)||e,x()}}):\"number\"==typeof M?e(pe,{label:u,initialValue:M,className:\"col s7\",onchange:e=>{h[N]=e,x()}}):e(ye,{label:u,checked:M,className:\"input-field col s7\",onchange:e=>{h[N]=e,x()}}),e(\".col.s12.right-align\",[e(R,{iconName:\"add\",onclick:l}),e(R,{iconName:\"delete\",disabled:!N,onclick:()=>{delete h[N],l(),x()}})])]]}}},xe=()=>({oncreate:({dom:e,attrs:t})=>{M.Materialbox.init(e,t)},view:({attrs:t})=>{const{src:a,width:i,height:l}=t;return e(`img.materialboxed[src=${a}]${i?`[width=${i}]`:\"\"}${l?`[height=${l}]`:\"\"}`,t)}}),we=()=>({oncreate:({dom:e,attrs:{options:t,onCreate:a}})=>{const i=M.Modal.init(e,t);a&&a(i)},view:({attrs:{id:t,title:a,description:i,fixedFooter:l,bottomSheet:o,buttons:n,richContent:s}})=>e(`.modal${l?\".modal-fixed-footer\":\"\"}${o?\".bottom-sheet\":\"\"}[id=${t}]`,[e(\".modal-content\",[e(\"h4\",a),s&&\"string\"==typeof i?e.trust(i||\"\"):\"string\"==typeof i?e(\"p\",i):i]),n?e(\".modal-footer\",n.map(t=>e(R,g({},t,{className:\"modal-close\"})))):void 0])}),ke=()=>({view:({attrs:{title:t,href:a,active:i,disabled:l}})=>e(\"li\",{className:i?\"active\":l?\"disabled\":\"waves-effect\"},\"number\"==typeof t?e(e.route.Link,{href:a},t):t)}),Ne=()=>{const t={pagIndex:0};return{view:({attrs:{items:a,curPage:i=1,size:l=Math.min(9,a.length)}})=>{const{pagIndex:o}=t,n=o*l,s=n+l,r=o>0,c=sr&&t.pagIndex--},e(\"i.material-icons\",\"chevron_left\")),disabled:!r},...a.filter((e,t)=>n<=t&&tc&&t.pagIndex++},e(\"i.material-icons\",\"chevron_right\")),disabled:!c}];return e(\"ul.pagination\",d.map((t,a)=>e(ke,g({title:n+a},t,{active:n+a===i}))))}}},$e=()=>({oncreate:({dom:e,attrs:t})=>{M.Parallax.init(e,t)},view:({attrs:{src:t}})=>t?e(\".parallax-container\",e(\".parallax\",e(`img[src=${t}]`))):void 0}),Me=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],Ce=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],Ie=()=>{const a={id:t()};return{view:t=>{let{attrs:{label:i,helperText:l,initialValue:o,newRow:n,className:s=\"col s12\",iconName:r,isMandatory:c,onchange:d,disabled:p}}=t,u=f(t.attrs,Me);const h=a.id,v=m(u),b=d?()=>a.dp&&d(a.dp.date):void 0;return e(\".input-field\"+(n?\".clear\":\"\"),{className:s,onremove:()=>a.dp&&a.dp.destroy()},[r?e(\"i.material-icons.prefix\",r):\"\",e(`input.datepicker[type=text][tabindex=0][id=${h}]${v}${p?\"[disabled]\":\"\"}`,{oncreate:({dom:e})=>{a.dp=M.Datepicker.init(e,g({format:\"yyyy/mm/dd\",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},u,{onClose:b}))}}),e(k,{label:i,id:h,isMandatory:c,isActive:!!o}),e(N,{helperText:l})])}}},Ae=()=>{const a={id:t()};return{view:t=>{let{attrs:{label:i,helperText:l,initialValue:o,newRow:n,className:s=\"col s12\",iconName:r,isMandatory:c,onchange:d,disabled:p}}=t,u=f(t.attrs,Ce);const h=a.id,v=m(u),b=n?\".clear\":\"\",y=new Date,x=d?()=>a.tp&&d(a.tp.time||o||`${y.getHours()}:${y.getMinutes()}`):void 0;return e(`.input-field.timepicker${b}`,{className:s,onremove:()=>a.tp&&a.tp.destroy()},[r?e(\"i.material-icons.prefix\",r):\"\",e(`input[type=text][tabindex=0][id=${h}]${v}${p?\"[disabled]\":\"\"}`,{value:o,oncreate:({dom:e})=>{a.tp=M.Timepicker.init(e,g({twelveHour:!1,showClearBtn:!0,defaultTime:o},u,{onCloseEnd:x}))}}),e(k,{label:i,id:h,isMandatory:c,isActive:o}),e(N,{helperText:l})])}}},Te=()=>({view:({attrs:{id:t,groupId:a,label:i,onchange:l,className:o=\"col s12\",checked:n,disabled:s}})=>e(\"div\",{className:o},e(\"label\",[e(`input[type=radio][tabindex=0][name=${a}]${n?\"[checked=checked]\":\"\"}${s?\"[disabled]\":\"\"}`,{onclick:l?()=>l(t):void 0}),e(\"span\",e.trust(i))]))}),Ve=()=>{const a={groupId:t()};return{oninit:({attrs:{checkedId:e,initialValue:t}})=>{a.oldCheckedId=e,a.checkedId=e||t},view:({attrs:{id:t,checkedId:i,newRow:l,className:o=\"col s12\",label:n=\"\",disabled:s,description:r,options:c,isMandatory:d,checkboxClass:p,onchange:m}})=>{a.oldCheckedId!==i&&(a.oldCheckedId=a.checkedId=i);const{groupId:u,checkedId:h}=a,v=e=>{a.checkedId=e,m&&m(e)};return l&&(o+=\" clear\"),e(\"div\",{id:t,className:o},[e(\"div\",{className:\"input-field options\"},e(k,{id:t,label:n,isMandatory:d})),r?e(\"p.helper-text\",e.trust(r)):\"\",...c.map(t=>e(Te,g({},t,{onchange:v,groupId:u,disabled:s,className:p,checked:t.id===h})))])}}},Se=()=>{const t={},a=e=>e.map(e=>e.id).join(\"\"),i=(e,t,a=!1)=>a||(t instanceof Array&&(e||\"number\"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:e,initialValue:i,options:l}})=>{t.ids=a(l);const o=e||i;t.checkedId=e instanceof Array?[...e]:e,t.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:l,newRow:o,className:n=\"col s12\",checkedId:s,key:r,options:c,multiple:d,label:p,helperText:m,placeholder:h=\"\",isMandatory:v,iconName:b,disabled:y,classes:g=\"\",dropdownOptions:f,onchange:x}})=>{t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);const{initialValue:w}=t,$=x?d?()=>{const e=t.instance&&t.instance.getSelectedValues(),a=e?e.length>0&&u(e[0])?e.map(e=>+e):e.filter(e=>null!==e||void 0!==e):void 0;t.initialValue=a||[],x(t.initialValue)}:e=>{if(e&&e.currentTarget){const a=e.currentTarget,i=u(a.value)?+a.value:a.value;t.initialValue=void 0!==typeof i?[i]:[]}t.initialValue&&x(t.initialValue)}:void 0;o&&(n+=\" clear\");const C=!c.some(e=>i(e.id,w)),I=c.reduce((e,t)=>(t.group&&e.indexOf(t.group)<0&&e.push(t.group),e),[]);return e(\".input-field.select-space\",{className:n,key:r,oncreate:d?({dom:e})=>t.wrapper=e:void 0},[b&&e(\"i.material-icons.prefix\",b),e(\"select\",{id:l,title:p,disabled:y,multiple:d,oncreate:({dom:e})=>{t.instance=M.FormSelect.init(e,{classes:g,dropdownOptions:f})},onupdate:({dom:e})=>{if(d){const e=b?1:0;!t.inputEl&&t.wrapper&&t.wrapper.childNodes&&t.wrapper.childNodes.length>0&&t.wrapper.childNodes[e].childNodes&&t.wrapper.childNodes[e].childNodes[0]&&(t.inputEl=t.wrapper.childNodes[e].childNodes[0]),t.inputEl&&t.inputEl.value&&t.inputEl.value.startsWith(`${h}, `)&&(t.inputEl.value=t.inputEl.value.replace(`${h}, `,\"\"))}const i=a(c);let l=s&&t.checkedId!==s.toString();t.ids!==i&&(t.ids=i,l=!0),(t.checkedId instanceof Array&&s instanceof Array?t.checkedId.join()!==s.join():t.checkedId!==s)&&(t.checkedId=s,l=!0),l&&(t.instance=M.FormSelect.init(e,{classes:g,dropdownOptions:f}))},onchange:$},e(\"option\",{value:\"\",disabled:!0,selected:!!C||void 0},h),0===I.length?c.map((t,a)=>{var l;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,w,0===a&&C&&!h)},null==(l=t.label)?void 0:l.replace(\"&\",\"&\"))}):I.map(t=>e(\"optgroup\",{label:t},c.filter(e=>e.group===t).map((t,a)=>{var l;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,w,0===a&&C&&!h)},null==(l=t.label)?void 0:l.replace(\"&\",\"&\"))})))),e(k,{label:p,isMandatory:v}),m&&e(N,{helperText:m})])}}},Oe=[\"label\",\"left\",\"right\",\"disabled\",\"newRow\",\"onchange\",\"checked\",\"isMandatory\",\"className\"],Re=()=>{const a={id:t()};return{view:({attrs:t})=>{const i=t.id||a.id,{label:l,left:o,right:n,disabled:s,newRow:r,onchange:c,checked:p,isMandatory:m,className:u=\"col s12\"}=t,h=f(t,Oe);return e(\"div\"+(r?\".clear\":\"\"),{className:u},[l?e(k,{label:l||\"\",id:i,isMandatory:m}):void 0,e(\".switch\",h,e(\"label\",[o||\"Off\",e(`input[id=${i}][type=checkbox]${d({disabled:s})}${p?\"[checked]\":\"\"}`,{onclick:c?e=>{e.target&&void 0!==e.target.checked&&c(e.target.checked)}:void 0}),e(\"span.lever\"),n||\"On\"]))])}}},je=()=>{const t={},a=(e,t)=>t||e.replace(/ /g,\"\").toLowerCase();return{view:({attrs:{tabWidth:i,selectedTabId:l,tabs:o,className:n,style:s,duration:r,onShow:c,swipeable:d,responsiveThreshold:p}})=>{const m=o.filter(e=>e.active).shift(),u=l||(m?a(m.title,m.id):\"\");return e(\".row\",[e(\".col.s12\",e(\"ul.tabs\"+(\"fill\"===i?\".tabs-fixed-width\":\"\"),{className:n,style:s,oncreate:({dom:e})=>{t.instance=M.Tabs.init(e,{duration:r,onShow:c,responsiveThreshold:p,swipeable:d})},onupdate:()=>{if(u){const e=document.getElementById(`tab_${u}`);e&&e.click()}},onremove:()=>t.instance.destroy()},o.map(({className:t,title:l,id:n,active:s,disabled:r,target:c,href:d})=>e(`li.tab${r?\".disabled\":\"\"}${\"fixed\"===i?`.col.s${Math.floor(12/o.length)}`:\"\"}`,{className:t},e(`a[id=tab_${a(l,n)}]${s?\".active\":\"\"}`,{target:c,href:d||`#${a(l,n)}`},l))))),o.filter(({href:e})=>void 0===e).map(({id:t,title:i,vnode:l,contentClass:o})=>e(`.col.s12[id=${a(i,t)}]`,{className:o},l))])}}},Le=()=>({view:({attrs:{id:t,title:a,datetime:i,active:l,content:o,iconName:n,dateFormatter:s,timeFormatter:r,onSelect:c}})=>e(`li${l?\".active\":\"\"}${t?`[id=${t}]`:\"\"}`,{onclick:c?()=>c({id:t,title:a,datetime:i,active:l,content:o}):void 0,style:c?\"cursor: pointer;\":void 0},[e(\".mm_time\",{datetime:i},[e(\"span\",s(i)),e(\"span\",r(i))]),n?e(\".mm_icon\",e(\"i.material-icons\",n)):void 0,e(\".mm_label\",[a?\"string\"==typeof a?e(\"h5\",a):a:void 0,o?\"string\"==typeof o?e(\"p\",o):o:void 0])])}),Ee=()=>{const t=e=>`${e.getUTCDate()}/${e.getUTCMonth()+1}/${e.getUTCFullYear()}`,a=e=>`${v(e.getUTCHours())}:${v(e.getUTCMinutes())}`;return{view:({attrs:{items:i,onSelect:l,timeFormatter:o=a,dateFormatter:n=t}})=>e(\"ul.mm_timeline\",i.map(t=>e(Le,g({onSelect:l,dateFormatter:n,timeFormatter:o},t))))}};export{Q as AnchorItem,$ as Autocomplete,V as Button,T as ButtonFactory,F as Carousel,E as CarouselItem,D as Chips,K as CodeBlock,B as Collapsible,_ as CollapsibleItem,ee as Collection,H as CollectionMode,ue as ColorInput,Ie as DatePicker,ae as Dropdown,ve as EmailInput,be as FileInput,R as FlatButton,le as FloatingActionButton,N as HelperText,I as Icon,ye as InputCheckbox,k as Label,S as LargeButton,G as ListItem,w as Mandatory,fe as MapEditor,xe as MaterialBox,we as ModalPanel,pe as NumberInput,ge as Options,Ne as Pagination,$e as Parallax,de as PasswordInput,Te as RadioButton,Ve as RadioButtons,he as RangeInput,j as RoundIconButton,Y as SecondaryContent,Se as Select,O as SmallButton,L as SubmitButton,Re as Switch,je as Tabs,se as TextArea,ce as TextInput,Ae as TimePicker,Ee as Timeline,me as UrlInput,n as camelToSnake,i as compose,d as disable,u as isNumeric,o as join,l as map,y as move,v as padLeft,h as pipe,p as req,b as swap,s as toAttributeString,m as toAttrs,t as uniqueId,a as uuid4};\n//# sourceMappingURL=index.modern.js.map\n","import e from\"mithril\";import{render as t}from\"slimdown-js\";export*from\"slimdown-js\";const a=()=>\"idxxxxxxxx\".replace(/[x]/g,()=>(16*Math.random()|0).toString(16)),i=[\"min\",\"max\",\"minLength\",\"maxLength\",\"rows\",\"cols\",\"placeholder\",\"autocomplete\",\"pattern\",\"readOnly\",\"step\"],n=e=>i.indexOf(e)>=0,o=({disabled:e})=>e?\"[disabled]\":\"\",l=e=>(e=>{const t=(a=e,e=>void 0!==a[e]);var a;return Object.keys(e).filter(n).filter(t).reduce((t,a)=>{const i=e[a];return t.push(`[${a.toLowerCase()}=${i}]`),t},[]).join(\"\")})(e)+(e=>e.maxLength?`[data-length=${e.maxLength}]`:\"\")(e)+o(e)+(({required:e,isMandatory:t})=>e||t?\"[required][aria-required=true]\":\"\")(e)+(({autofocus:e})=>\"boolean\"==typeof e&&e||e&&e()?\"[autofocus]\":\"\")(e),r=e=>!isNaN(parseFloat(e))&&isFinite(e);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(n[a]=e[a]);return n}const d=[\"label\",\"id\",\"isMandatory\",\"isActive\"],p={view:({attrs:t})=>e(\"span.mandatory\",t,\"*\")},u=()=>({view:t=>{let{attrs:{label:a,id:i,isMandatory:n,isActive:o}}=t,l=c(t.attrs,d);return a?e(`label${o?\".active\":\"\"}${i?`[for=${i}]`:\"\"}`,l,[e.trust(a),n?e(p):void 0]):void 0}}),m=()=>({view:({attrs:{helperText:t,dataError:a,dataSuccess:i,className:n}})=>t||a||i?e(\"span.helper-text\",{className:n,dataError:a,dataSuccess:i},t?e.trust(t):\"\"):void 0}),h=()=>{const t={id:a()};return{view:({attrs:a})=>{const i=a.id||t.id,n=l(a),{label:o,helperText:r,initialValue:s,onchange:c,newRow:d,className:p=\"col s12\",style:h,iconName:f,isMandatory:g}=a;return e(\".input-field\"+(d?\".clear\":\"\"),{className:d?p+\" clear\":p,style:h},[f?e(\"i.material-icons.prefix\",f):\"\",e(`input.autocomplete[type=text][tabindex=0]${n}`,{id:i,oncreate:({dom:e})=>{M.Autocomplete.init(e,a)},onchange:c?e=>{e.target&&e.target.value&&c(e.target.value)}:void 0,value:s}),e(u,{label:o,id:i,isMandatory:g,isActive:s}),e(m,{helperText:r})])}}},f=[\"iconName\"],g=()=>({view:t=>{let{attrs:{iconName:a}}=t,i=c(t.attrs,f);return e(\"i.material-icons\",i,a)}}),b=[\"modalId\",\"tooltip\",\"tooltipPostion\",\"iconName\",\"iconClass\",\"label\",\"attr\"],y=(t,a=\"\")=>()=>{const i=`${t}${a}`;return{view:({attrs:t})=>{const{modalId:a,tooltip:n,tooltipPostion:o,iconName:l,iconClass:r,label:s,attr:d}=t,p=c(t,b);return e(`${i}${a?`.modal-trigger[href=#${a}]`:\"\"}${n?`.tooltipped[data-position=${o||\"top\"}][data-tooltip=${n}]`:\"\"}${(e=>e?((...e)=>t=>e.reduceRight((e,t)=>t(e),t))(e=>Array.prototype.join.call(e,\"\"),(e=>t=>Array.prototype.map.call(t,e))(t=>`[${(e=>e.replace(/([A-Z])/g,e=>\"-\"+e.toLowerCase()))(t)}=\"${((e=\"\")=>e.toString().replace(/\"/g,\""\"))(e[t])}\"]`),Object.keys)(e):\"\")(d)}`,p,l?e(g,{iconName:l,className:r||\"left\"}):void 0,s||void 0)}}},v=y(\"a.waves-effect.waves-teal.btn-flat\",\"[type=button]\"),w=y(\"button.btn-floating.btn-large.waves-effect.waves-light\",\"[type=button]\"),x=()=>({oncreate:({attrs:e,dom:t})=>{const{onchange:a,onChipAdd:i,onChipDelete:n}=e,o=M.Chips.getInstance(t.children[0]),l=i?i.bind(o):void 0;e.onChipAdd=function(e,t){a&&a(this.chipsData),l&&l(e,t)};const r=n?n.bind(o):void 0;e.onChipDelete=function(e,t){a&&a(this.chipsData),r&&r(e,t)},M.Chips.init(t.children[0],e)},onupdate:({dom:e,attrs:{data:t}})=>{if(!t||0===t.length)return;const a=M.Chips.getInstance(e.children[0]);t.forEach(e=>a.addChip(e))},view:({attrs:{placeholder:t,required:a,isMandatory:i=a,data:n,className:o=\"col s12\",label:l,helperText:r}})=>e(\".input-field\",{className:o},[e(`.chips.chips-autocomplete${t?\".chips-placeholder\":\"\"}${n?\".chips-initial\":\"\"}`),l?e(u,{label:l,isMandatory:i,className:\"active\"}):void 0,r?e(m,{helperText:r}):void 0])}),k=()=>({view:({attrs:{header:t,body:a,active:i,iconName:n}})=>e(i?\"li.active\":\"li\",[t||n?e(\".collapsible-header\",[n?e(\"i.material-icons\",n):void 0,t?\"string\"==typeof t?e(\"span\",t):t:void 0]):void 0,a?e(\".collapsible-body\",a):void 0])}),N=()=>({oncreate:({dom:e,attrs:t})=>{M.Collapsible.init(e,t)},view:({attrs:t})=>{const{items:a,class:i,className:n,style:o,id:l}=t;return a&&a.length>0?e(\"ul.collapsible\",{class:i||n,style:o,id:l},a.map(t=>e(k,t))):void 0}});var $;!function(e){e[e.BASIC=0]=\"BASIC\",e[e.LINKS=1]=\"LINKS\",e[e.AVATAR=2]=\"AVATAR\"}($||($={}));const I=[\"className\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\"],O=[\"className\",\"dataError\",\"dataSuccess\",\"helperText\",\"iconName\",\"id\",\"initialValue\",\"isMandatory\",\"label\",\"maxLength\",\"newRow\",\"onchange\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"onblur\",\"style\",\"validate\"],A=()=>{const t={id:a()};return{view:({attrs:a})=>{const{className:i=\"col s12\",helperText:n,iconName:o,id:r=t.id,initialValue:s,isMandatory:d,label:p,onchange:h,onkeydown:f,onkeypress:g,onkeyup:b,onblur:y,style:v}=a,w=c(a,I),x=l(w);return e(\".input-field\",{className:i,style:v},[o?e(\"i.material-icons.prefix\",o):\"\",e(`textarea.materialize-textarea[tabindex=0][id=${r}]${x}`,{oncreate:({dom:e})=>{M.textareaAutoResize(e),a.maxLength&&M.CharacterCounter.init(e)},onchange:h?e=>{const t=e.target;h(t&&\"string\"==typeof t.value?t.value:\"\")}:void 0,value:s,onkeyup:b?e=>{b(e,e.target.value)}:void 0,onkeydown:f?e=>{f(e,e.target.value)}:void 0,onkeypress:g?e=>{g(e,e.target.value)}:void 0,onblur:y}),e(u,{label:p,id:r,isMandatory:d,isActive:s||a.placeholder}),e(m,{helperText:n})])}}},D=(t,i=\"\")=>()=>{const n={id:a()},o=e=>{const a=e.value;return!a||\"number\"!==t&&\"range\"!==t?a:+a},r=(e,t)=>{e.setCustomValidity(\"boolean\"==typeof t?t?\"\":\"Custom validation failed\":t)};return{view:({attrs:a})=>{const{className:s=\"col s12\",dataError:d,dataSuccess:p,helperText:h,iconName:f,id:g=n.id,initialValue:b,isMandatory:y,label:v,maxLength:w,newRow:x,onchange:k,onkeydown:N,onkeypress:$,onkeyup:I,onblur:A,style:D,validate:S}=a,T=c(a,O),C=l(T);return e(`.input-field${x?\".clear\":\"\"}${i}`,{className:s,style:D},[f?e(\"i.material-icons.prefix\",f):void 0,e(`input.validate[type=${t}][tabindex=0][id=${g}]${C}`,{oncreate:({dom:e})=>{(({autofocus:e})=>!!e&&(\"boolean\"==typeof e?e:e()))(a)&&e.focus(),w&&M.CharacterCounter.init(e),\"range\"===t&&M.Range.init(e)},onkeyup:I?e=>{I(e,o(e.target))}:void 0,onkeydown:N?e=>{N(e,o(e.target))}:void 0,onkeypress:$?e=>{$(e,o(e.target))}:void 0,onblur:A,onupdate:S?({dom:e})=>{const t=e;r(t,S(o(t),t))}:void 0,onchange:e=>{const t=e.target;if(t){const e=o(t);k&&k(e),S&&r(t,S(e,t))}},value:b}),e(u,{label:v,id:g,isMandatory:y,isActive:!(void 0===b&&!a.placeholder&&\"number\"!==t&&\"color\"!==t&&\"range\"!==t)}),e(m,{helperText:h,dataError:d,dataSuccess:p})])}}},S=D(\"text\"),T=D(\"number\"),C=D(\"url\"),V=D(\"color\"),j=D(\"email\"),L=()=>{let t,a=!1;return{view:({attrs:i})=>{const{multiple:n,disabled:o,initialValue:l,placeholder:r,onchange:s,className:c=\"col s12\",accept:d,label:p=\"File\"}=i,u=d?d instanceof Array?d.join(\", \"):d:void 0,m=u?`[accept=${u}]`:\"\",h=n?\"[multiple]\":\"\",f=o?\"[disabled]\":\"\",g=r?`[placeholder=${r}]`:\"\";return e(\".file-field.input-field\",{className:i.class||c},[e(\".btn\",[e(\"span\",p),e(`input[type=file]${h}${f}${m}`,{onchange:s?e=>{const t=e.target;t&&t.files&&s&&(a=!0,s(t.files))}:void 0})]),e(\".file-path-wrapper\",e(`input.file-path.validate${g}[type=text]`,{oncreate:({dom:e})=>{t=e,l&&(t.value=l)}})),(a||l)&&e(\"a.waves-effect.waves-teal.btn-flat\",{style:\"float: right;position: relative;top: -3rem; padding: 0\",onclick:()=>{a=!1,t.value=\"\",s&&s({})}},e(\"i.material-icons\",\"clear\"))])}}},P=()=>({view:({attrs:{className:t=\"col s12\",onchange:a,label:i,checked:n,disabled:o,description:l}})=>e(\"div\",{className:t},e(\"label\",[e(\"input[type=checkbox][tabindex=0]\",{checked:n,disabled:o,onclick:a?e=>{e.target&&void 0!==e.target.checked&&a(e.target.checked)}:void 0}),i?\"string\"==typeof i?e(\"span\",i):i:void 0]),l&&e(m,{className:\"input-checkbox-desc\",helperText:l}))}),R=()=>{const t={},a=e=>t.checkedIds.indexOf(e)>=0;return{oninit:({attrs:{initialValue:e,checkedId:a}})=>{const i=a||e;t.checkedId=a,t.checkedIds=i?i instanceof Array?[...i]:[i]:[]},view:({attrs:{label:i,id:n,options:o,checkedId:l,description:r,className:s=\"col s12\",disabled:c,checkboxClass:d,newRow:p,isMandatory:h,onchange:f}})=>{l&&t.checkedId!==l&&(t.checkedId=l,t.checkedIds=l instanceof Array?l:[l]);const g=f?(e,a)=>{const i=t.checkedIds.filter(t=>t!==e);a&&i.push(e),t.checkedIds=i,f(i)}:void 0;return e(\"div\"+(p?\".clear\":\"\"),{className:s},[e(\"div\",{className:\"input-field options\"},e(u,{id:n,label:i,isMandatory:h})),e(m,{helperText:r}),...o.map(t=>e(P,{disabled:c||t.disabled,label:t.label,onchange:g?e=>g(t.id,e):void 0,className:t.className||d,checked:a(t.id),description:t.description}))])}}},E=()=>({oncreate:({dom:e,attrs:{options:t,onCreate:a}})=>{const i=M.Modal.init(e,t);a&&a(i)},view:({attrs:{id:t,title:a,description:i,fixedFooter:n,bottomSheet:o,buttons:l,richContent:r}})=>e(`.modal${n?\".modal-fixed-footer\":\"\"}${o?\".bottom-sheet\":\"\"}[id=${t}]`,[e(\".modal-content\",[e(\"h4\",a),r&&\"string\"==typeof i?e.trust(i||\"\"):\"string\"==typeof i?e(\"p\",i):i]),l?e(\".modal-footer\",l.map(t=>e(v,s({},t,{className:\"modal-close\"})))):void 0])}),F=()=>({view:({attrs:{title:t,href:a,active:i,disabled:n}})=>e(\"li\",{className:i?\"active\":n?\"disabled\":\"waves-effect\"},\"number\"==typeof t?e(e.route.Link,{href:a},t):t)}),_=()=>{const t={pagIndex:0};return{view:({attrs:{items:a,curPage:i=1,size:n=Math.min(9,a.length)}})=>{const{pagIndex:o}=t,l=o*n,r=l+n,c=o>0,d=rc&&t.pagIndex--},e(\"i.material-icons\",\"chevron_left\")),disabled:!c},...a.filter((e,t)=>l<=t&&td&&t.pagIndex++},e(\"i.material-icons\",\"chevron_right\")),disabled:!d}];return e(\"ul.pagination\",p.map((t,a)=>e(F,s({title:l+a},t,{active:l+a===i}))))}}},H=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],U=[\"label\",\"helperText\",\"initialValue\",\"newRow\",\"className\",\"iconName\",\"isMandatory\",\"onchange\",\"disabled\"],q=()=>{const t={id:a()};return{view:a=>{let{attrs:{label:i,helperText:n,initialValue:o,newRow:r,className:d=\"col s12\",iconName:p,isMandatory:h,onchange:f,disabled:g}}=a,b=c(a.attrs,H);const y=t.id,v=l(b),w=f?()=>t.dp&&f(t.dp.date):void 0;return e(\".input-field\"+(r?\".clear\":\"\"),{className:d,onremove:()=>t.dp&&t.dp.destroy()},[p?e(\"i.material-icons.prefix\",p):\"\",e(`input.datepicker[type=text][tabindex=0][id=${y}]${v}${g?\"[disabled]\":\"\"}`,{oncreate:({dom:e})=>{t.dp=M.Datepicker.init(e,s({format:\"yyyy/mm/dd\",showClearBtn:!0,setDefaultDate:!0,defaultDate:o?new Date(o):new Date},b,{onClose:w}))}}),e(u,{label:i,id:y,isMandatory:h,isActive:!!o}),e(m,{helperText:n})])}}},B=()=>{const t={id:a()};return{view:a=>{let{attrs:{label:i,helperText:n,initialValue:o,newRow:r,className:d=\"col s12\",iconName:p,isMandatory:h,onchange:f,disabled:g}}=a,b=c(a.attrs,U);const y=t.id,v=l(b),w=r?\".clear\":\"\",x=new Date,k=f?()=>t.tp&&f(t.tp.time||o||`${x.getHours()}:${x.getMinutes()}`):void 0;return e(`.input-field.timepicker${w}`,{className:d,onremove:()=>t.tp&&t.tp.destroy()},[p?e(\"i.material-icons.prefix\",p):\"\",e(`input[type=text][tabindex=0][id=${y}]${v}${g?\"[disabled]\":\"\"}`,{value:o,oncreate:({dom:e})=>{t.tp=M.Timepicker.init(e,s({twelveHour:!1,showClearBtn:!0,defaultTime:o},b,{onCloseEnd:k}))}}),e(u,{label:i,id:y,isMandatory:h,isActive:o}),e(m,{helperText:n})])}}},J=()=>({view:({attrs:{id:t,groupId:a,label:i,onchange:n,className:o=\"col s12\",checked:l,disabled:r}})=>e(\"div\",{className:o},e(\"label\",[e(`input[type=radio][tabindex=0][name=${a}]${l?\"[checked=checked]\":\"\"}${r?\"[disabled]\":\"\"}`,{onclick:n?()=>n(t):void 0}),e(\"span\",e.trust(i))]))}),z=()=>{const t={groupId:a()};return{oninit:({attrs:{checkedId:e,initialValue:a}})=>{t.oldCheckedId=e,t.checkedId=e||a},view:({attrs:{id:a,checkedId:i,newRow:n,className:o=\"col s12\",label:l=\"\",disabled:r,description:c,options:d,isMandatory:p,checkboxClass:m,onchange:h}})=>{t.oldCheckedId!==i&&(t.oldCheckedId=t.checkedId=i);const{groupId:f,checkedId:g}=t,b=e=>{t.checkedId=e,h&&h(e)};return n&&(o+=\" clear\"),e(\"div\",{id:a,className:o},[e(\"div\",{className:\"input-field options\"},e(u,{id:a,label:l,isMandatory:p})),c?e(\"p.helper-text\",e.trust(c)):\"\",...d.map(t=>e(J,s({},t,{onchange:b,groupId:f,disabled:r,className:m,checked:t.id===g})))])}}},W=()=>{const t={},a=e=>e.map(e=>e.id).join(\"\"),i=(e,t,a=!1)=>a||(t instanceof Array&&(e||\"number\"==typeof e)?t.indexOf(e)>=0:t===e);return{oninit:({attrs:{checkedId:e,initialValue:i,options:n}})=>{t.ids=a(n);const o=e||i;t.checkedId=e instanceof Array?[...e]:e,t.initialValue=null!=o?o instanceof Array?o.filter(e=>null!=e):[o]:[]},view:({attrs:{id:n,newRow:o,className:l=\"col s12\",checkedId:s,key:c,options:d,multiple:p,label:h,helperText:f,placeholder:g=\"\",isMandatory:b,iconName:y,disabled:v,classes:w=\"\",dropdownOptions:x,onchange:k}})=>{t.checkedId!==s&&(t.initialValue=s?s instanceof Array?s:[s]:void 0);const{initialValue:N}=t,$=k?p?()=>{const e=t.instance&&t.instance.getSelectedValues(),a=e?e.length>0&&r(e[0])?e.map(e=>+e):e.filter(e=>null!==e||void 0!==e):void 0;t.initialValue=a||[],k(t.initialValue)}:e=>{if(e&&e.currentTarget){const a=e.currentTarget,i=r(a.value)?+a.value:a.value;t.initialValue=void 0!==typeof i?[i]:[]}t.initialValue&&k(t.initialValue)}:void 0;o&&(l+=\" clear\");const I=!d.some(e=>i(e.id,N)),O=d.reduce((e,t)=>(t.group&&e.indexOf(t.group)<0&&e.push(t.group),e),[]);return e(\".input-field.select-space\",{className:l,key:c,oncreate:p?({dom:e})=>t.wrapper=e:void 0},[y&&e(\"i.material-icons.prefix\",y),e(\"select\",{id:n,title:h,disabled:v,multiple:p,oncreate:({dom:e})=>{t.instance=M.FormSelect.init(e,{classes:w,dropdownOptions:x})},onupdate:({dom:e})=>{if(p){const e=y?1:0;!t.inputEl&&t.wrapper&&t.wrapper.childNodes&&t.wrapper.childNodes.length>0&&t.wrapper.childNodes[e].childNodes&&t.wrapper.childNodes[e].childNodes[0]&&(t.inputEl=t.wrapper.childNodes[e].childNodes[0]),t.inputEl&&t.inputEl.value&&t.inputEl.value.startsWith(`${g}, `)&&(t.inputEl.value=t.inputEl.value.replace(`${g}, `,\"\"))}const i=a(d);let n=s&&t.checkedId!==s.toString();t.ids!==i&&(t.ids=i,n=!0),(t.checkedId instanceof Array&&s instanceof Array?t.checkedId.join()!==s.join():t.checkedId!==s)&&(t.checkedId=s,n=!0),n&&(t.instance=M.FormSelect.init(e,{classes:w,dropdownOptions:x}))},onchange:$},e(\"option\",{value:\"\",disabled:!0,selected:!!I||void 0},g),0===O.length?d.map((t,a)=>{var n;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,N,0===a&&I&&!g)},null==(n=t.label)?void 0:n.replace(\"&\",\"&\"))}):O.map(t=>e(\"optgroup\",{label:t},d.filter(e=>e.group===t).map((t,a)=>{var n;return e(\"option\",{value:t.id,title:t.title||void 0,disabled:t.disabled?\"true\":void 0,\"data-icon\":t.img||void 0,selected:i(t.id,N,0===a&&I&&!g)},null==(n=t.label)?void 0:n.replace(\"&\",\"&\"))})))),e(u,{label:h,isMandatory:b}),f&&e(m,{helperText:f})])}}},K=[\"label\",\"left\",\"right\",\"disabled\",\"newRow\",\"onchange\",\"checked\",\"isMandatory\",\"className\"],Y=()=>{const t={id:a()};return{view:({attrs:a})=>{const i=a.id||t.id,{label:n,left:l,right:r,disabled:s,newRow:d,onchange:p,checked:m,isMandatory:h,className:f=\"col s12\"}=a,g=c(a,K);return e(\"div\"+(d?\".clear\":\"\"),{className:f},[n?e(u,{label:n||\"\",id:i,isMandatory:h}):void 0,e(\".switch\",g,e(\"label\",[l||\"Off\",e(`input[id=${i}][type=checkbox]${o({disabled:s})}${m?\"[checked]\":\"\"}`,{onclick:p?e=>{e.target&&void 0!==e.target.checked&&p(e.target.checked)}:void 0}),e(\"span.lever\"),r||\"On\"]))])}}},Z=()=>{const t={},a=(e,t)=>t||e.replace(/ /g,\"\").toLowerCase();return{view:({attrs:{tabWidth:i,selectedTabId:n,tabs:o,className:l,style:r,duration:s,onShow:c,swipeable:d,responsiveThreshold:p}})=>{const u=o.filter(e=>e.active).shift(),m=n||(u?a(u.title,u.id):\"\");return e(\".row\",[e(\".col.s12\",e(\"ul.tabs\"+(\"fill\"===i?\".tabs-fixed-width\":\"\"),{className:l,style:r,oncreate:({dom:e})=>{t.instance=M.Tabs.init(e,{duration:s,onShow:c,responsiveThreshold:p,swipeable:d})},onupdate:()=>{if(m){const e=document.getElementById(`tab_${m}`);e&&e.click()}},onremove:()=>t.instance.destroy()},o.map(({className:t,title:n,id:l,active:r,disabled:s,target:c,href:d})=>e(`li.tab${s?\".disabled\":\"\"}${\"fixed\"===i?`.col.s${Math.floor(12/o.length)}`:\"\"}`,{className:t},e(`a[id=tab_${a(n,l)}]${r?\".active\":\"\"}`,{target:c,href:d||`#${a(n,l)}`},n))))),o.filter(({href:e})=>void 0===e).map(({id:t,title:i,vnode:n,contentClass:o})=>e(`.col.s12[id=${a(i,t)}]`,{className:o},n))])}}},G=e=>e.charAt(0).toUpperCase()+e.slice(1),Q=e=>\"string\"==typeof e,X=(e,t=2,a=\"0\")=>e.toString().length>=t?e.toString():X(a+e,t,a),ee=e=>e?`${X(e.getHours())}:${X(e.getMinutes())}`:\"00:00\",te=(e,t)=>{const a=(t=(t=t.replace(/\\[(\\w+)\\]/g,\".$1\")).replace(/^\\./,\"\")).split(\".\");let i={...e};for(let t=0,n=a.length;te[o]===t).shift();if(!l)return;i=l}}}return i},ae=e=>e.reduce((e,t)=>t instanceof Array?[...e,...t]:[...e,t],[]),ie=/([^ =><]*)\\s*([=><]*)\\s*(\\S*)/i,ne=/^\\s*!\\s*/,oe=/===?|[^<>=]/i,le=function(e){var t=[].slice.call(arguments,1);return 0===e.length||(e instanceof Array?e:[e]).some(e=>((e,t)=>e.split(\"&\").reduce((e,a)=>{const i=ne.test(a),n=i?a.replace(ne,\"\"):a;return e=e&&t.filter(Boolean).reduce((e,t)=>e||((e,t)=>{if(!t||0===Object.keys(t).length)return!1;const a=ie.exec(e);if(a){const[e,i,n,o]=a,l=te(t,i.trim());if(void 0===l||\"string\"==typeof l&&0===l.length)return!1;if(!n||!o)return!0;{const t=isNaN(+o)?\"true\"===o||\"false\"!==o&&o:+o;switch(n){case\"=\":case\"==\":case\"===\":return l instanceof Array?l.indexOf(t)>=0:l===t;case\"<=\":return l<=t;case\">=\":return l>=t;case\"<\":return l\":return l>t;default:return console.error(`Unrecognized operand (${n}) in expression: ${e}`),!1}}}return!0})(n.trim(),t),!1),i?!e:e},!0))(e,oe.test(e)?[t[0]]:ae(t)))},re=(e,t)=>te(t.filter(Boolean).reduceRight((e,t)=>({...t,...e})),e.trim()),se=(e,t)=>void 0!==re(e,t),ce=/{{\\s*([^\\s\"'`:]*):?([^\\s]*)\\s*}}/g,de=function(e){if(!ce.test(e))return!0;let t;ce.lastIndex=0;let a=!0;do{t=ce.exec(e),t&&(t.index===ce.lastIndex&&ce.lastIndex++,t.forEach((e,t,[,i])=>{a=a&&se(i,[].slice.call(arguments,1))}))}while(a&&null!==t);return a},pe=(e,t)=>{if(void 0===e)return\"\";if(e instanceof Array)return e.map(e=>pe(e,t)).join(\", \");if(!t)return e.toString();if(\"boolean\"==typeof e){const a=t.indexOf(\":\");return e?t.substring(0,a):t.substring(a+1)}switch(t){default:return e.toString();case\"date\":return new Date(e).toLocaleDateString();case\"time\":return new Date(e).toLocaleTimeString();case\"iso\":return new Date(e).toISOString();case\"utc\":return new Date(e).toUTCString()}},ue=function(e){if(!ce.test(e))return e;let t;ce.lastIndex=0;do{t=ce.exec(e),t&&(t.index===ce.lastIndex&&ce.lastIndex++,t.forEach((t,a,[i,n,o])=>{const l=re(n,[].slice.call(arguments,1));!l||l instanceof Array||(e=e.replace(i,pe(l,o)))}))}while(null!==t);return e},me=e=>{if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){const t=[];return e.forEach(e=>{t.push(e)}),t.map(e=>me(e))}if(\"object\"==typeof e){const t={...e};return Object.keys(t).forEach(e=>{t[e]=me(t[e])}),t}return e},he=e=>{const t=(e,a=\"\")=>{const i=e.filter(e=>\"section\"!==e.type&&\"md\"!==e.type).reduce((e,i)=>{const n=(a?`${a}.`:\"\")+String(i.id),o=i.type||(i.options&&i.options.length>0?\"select\":\"text\");return\"string\"==typeof o?e[n]=i:e={...e,...t(o,n)},e},{});return i},a=t(e),i=(e,t)=>{if(!a.hasOwnProperty(e)||void 0===t)return t;const i=a[e],n=t instanceof Array?t.filter(e=>null!=e):[t];switch(i.type||(i.options?\"options\":\"none\")){default:return t;case\"radio\":case\"select\":case\"options\":const e=\"string\"==typeof i.options?re(i.options,[a]):i.options;return n.map(t=>e.filter(e=>e.id===t).map(e=>e.label||G(e.id)).shift()).filter(e=>void 0!==e)}},n=(e,t=\"\")=>{if(e&&(\"object\"!=typeof e||0!==Object.keys(e).length)){if(e instanceof Array)return e.map(e=>n(e,t));{const a={};return Object.keys(e).forEach(o=>{const l=t?`${t}.${o}`:o,r=e[o];if(\"boolean\"==typeof r)a[o]=r;else if(\"number\"==typeof r||\"string\"==typeof r){const e=i(l,r);e&&(a[o]=e instanceof Array&&1===e.length?e[0]:e)}else if(r instanceof Array)if(\"string\"==typeof r[0]||null===r[0]){const e=i(l,r);e&&(a[o]=e)}else a[o]=n(r,o);else\"object\"==typeof r&&(a[o]=r)}),a}}};return n},fe=(e=\"\")=>e.replace(/\\s|,|\\./g,\"\").toLowerCase(),ge=(e,t,a=1)=>{const i=[];for(let n=e;n<=t;n+=a)i.push(n);return i},be=e=>{\"string\"!=typeof e&&(e=JSON.stringify(e));let t=0;if(0===e.length)return t;for(var a=0;a{const i=Object.assign({},t,a);return`${e}?${Object.keys(i).map(e=>`${e}=${i[e]}`).join(\"&\")}`},ve=()=>({view:({attrs:{md:a=\"\",removeParagraphs:i=!1,externalLinks:n=!1,...o}})=>e(\".slimdown-view.markdown\",o,e.trust(t(a,i,n)))}),we=()=>({view:({attrs:{type:t,props:a,label:i=\"\",initialValue:n,inline:o=!1}})=>{const l={className:a.className||\"col s12\"};if(n instanceof Array&&n.length>3)return e(\".readonly\",l,[e(\"label\",i),e(ve,{md:\"\\n- \"+n.join(\"\\n- \")})]);if(\"string\"==typeof n)return e(\".readonly\",l,\"url\"===t?[e(\"label\",`${i.trim()}: `),e(\"a[target=_blank]\",{href:n},n)]:\"color\"===t?[e(\"label\",`${i.trim()}: `),e(\".color\",{style:`height: 1rem; width: 40px; border-radius: 4px; background-color: ${n}`})]:[e(\"label\",i),e(ve,{md:n})]);const r=n instanceof Array?n.join(\", \"):n;return e(\".readonly\",l,[i&&e(\"label\",i),o?e(\"span\",r?`: ${r}`:e.trust(\" \")):e(\"p\",r||e.trust(\" \"))])}}),xe=(i={},n={})=>()=>{const o={key:Date.now()};return{view:({attrs:{i18n:l,field:r,obj:s,autofocus:c,onchange:d,context:p=[],containerId:u,disabled:m,readonly:f}})=>{const{id:g=\"\",type:b,disabled:y=m,readonly:w=f,value:k,required:N,autogenerate:$,show:I,label:O,description:D,i18n:M=l||{},checkAllOptions:E,transform:F,effect:_,onkeyup:H,onkeydown:U,onblur:J}=r;if(I&&!le(I,s,p)||O&&!de(O,s,p)||D&&!de(D,s,p))return;const K=\"string\"==typeof r.options?re(r.options,[s,...p]):r.options,Z=K&&K instanceof Array?K.filter(e=>void 0!==e.id&&(e.label||!/[0-9]/.test(e.id))&&(!e.show||le(e.show,s,p))).map(e=>e.label?e:{...e,label:G(e.id)}):[],Q=\"boolean\"==typeof m&&m,X=((e,i=!1,n=!1)=>{const{id:o=\"\",label:l,description:r,required:s,multiple:c,className:d,checkboxClass:p,icon:u,iconClass:m,placeholder:h,maxLength:f,minLength:g,max:b,min:y,step:v,dateTimeOutput:w,dateTimeSeconds:x,dateFormat:k,twelveHour:N}=e,$={id:`mui_${String(o)}-${a()}`,label:l};return void 0===l&&o&&($.label=G(String(o))),r&&($.helperText=t(r,!0)),d&&($.className=d),u&&($.iconName=u),m&&($.iconClass=m),p&&($.checkboxClass=p),h&&($.placeholder=h),s&&($.isMandatory=!0),c&&($.multiple=c),n&&($.disabled=!0),i&&($.autofocus=!0),void 0!==f&&($.maxLength=f),void 0!==g&&($.minLength=g),void 0!==b&&($.max=b),void 0!==y&&($.min=y),void 0!==v&&($.step=v),w&&($.dateTimeOutput=w),x&&($.dateTimeSeconds=x),k&&($.dateFormat=k),N&&($.twelveHour=N),$})(r,c,\"boolean\"==typeof y||void 0===y?Q||y:Q||le(y,s,p));O&&(X.label=t(ue(X.label||O,s,p),!0)),D&&(X.description=t(ue(X.description||D,s,p),!0));const te=N?e=>e instanceof Array?e&&e.length>0:void 0!==typeof e:void 0;if(s instanceof Array)return void console.warn(\"Only a repeat list can deal with arrays!\");const ae=function(e){try{return void 0===e||\"undefined\"===e?(delete s[g],d(s),Promise.resolve()):(s[g]=F?F(\"to\",e):e,_?Promise.resolve(_(s,s[g],p)).then(function(e){d(void 0!==e?e:s)}):Promise.resolve(d(s)))}catch(e){return Promise.reject(e)}};if(b instanceof Array)return g?(s.hasOwnProperty(g)||(s[g]={}),e(\".muf-form\",{className:r.className},[e(\".muf-form-header\",e.trust(t(X.label||G(String(g)),!0))),X.description&&e(\"div\",e.trust(t(X.description))),e(\".row\",e(De,{...X,i18n:M,readonly:w,form:b,obj:s[g],context:p instanceof Array?[s,...p]:[s,p],onchange:()=>d&&d(s),containerId:u}))])):void console.warn(\"Missing ID for type \"+JSON.stringify(b));$&&!s[g]&&(s[g]=\"guid\"===$?\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return(\"x\"===e?t:3&t|8).toString(16)}):\"id\"===$?a():Date.now());const ie=s.hasOwnProperty(g)&&void 0!==s[g]?F?F(\"from\",s[g]):s[g]:k;g&&void 0!==k&&void 0!==ie&&(s[g]=F?F(\"to\",ie):ie);const[ne,oe]=E?E.split(\"|\"):[\"\",\"\"];if(w&&b&&[\"md\",\"none\"].indexOf(b)<0){if(n.hasOwnProperty(b))return e(n[b],{iv:ie,field:r,props:X,label:X.label,obj:s,context:p});if(b&&i.hasOwnProperty(b))return e(i[b],{iv:ie,field:r,props:X,label:X.label,onchange:ae,obj:s,context:p});switch(b){case\"time\":{const t=M.dateTimeOptions?{hour:\"2-digit\",minute:\"2-digit\",second:void 0,...M.dateTimeOptions,weekday:void 0,month:void 0,day:void 0,year:void 0}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleTimeString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"date\":{const t=M.dateTimeOptions?{...M.dateTimeOptions,hour:void 0,hour12:void 0,minute:void 0,second:void 0}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleDateString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"datetime\":{const t=M.dateTimeOptions?{hour:\"2-digit\",minute:\"2-digit\",month:\"numeric\",day:\"numeric\",...M.dateTimeOptions}:void 0,a=\"number\"==typeof ie||\"string\"==typeof ie||ie instanceof Date?new Date(ie):void 0,i=a?a.toLocaleTimeString(M.locales,t):\"\";return e(we,{props:X,label:X.label,initialValue:i})}case\"switch\":case\"checkbox\":return e(we,{props:X,label:X.label,initialValue:ie?\"✔\":\"✘\",inline:!0});case\"tags\":return e(we,{props:X,label:X.label,initialValue:ie||[]});case\"options\":case\"select\":{const t=void 0!==ie?ie instanceof Array?ie:[ie]:[],a=Z.filter(e=>t.indexOf(e.id)>=0),i=a&&0===a.length?\"?\":1===a.length?a[0].label:a.map(e=>e.label);return e(we,{props:X,label:X.label,initialValue:i})}case\"radio\":{const t=ie,a=Z.filter(e=>e.id===t);return e(we,{props:X,label:X.label,initialValue:a&&a.length?a[0].label:\"?\"})}case\"base64\":{const t=ie;return!(!t||!/data:image/i.test(t))&&e(\"div\",e(\"img.responsive-img\",{src:t,alt:s.title||s.alt||s.name||\"\",style:`max-height: ${r.max||50}px`}))}case\"file\":return e(\"div\",X,(ie instanceof Array?ie:[ie]).map((t=\"\")=>{const a=/data:image|.jpg$|.jpeg$|.png$|.gif$|.svg$|.bmp$|.tif$|.tiff$/i.test(t),i=`${new URL(r.url).origin}${t}`;return e(\"a[target=_blank]\",{href:i},a?e(\"img\",{src:i,alt:i,style:`max-height: ${r.max||50}`}):e(we,{props:X,label:r.placeholder||\"File\",initialValue:t}))}));case\"md\":case\"markdown\":{const a=\"string\"==typeof ie&&ie?t(ie):\"\";return e(we,{props:X,label:X.label,initialValue:a})}default:return e(we,{props:X,type:b,label:X.label,initialValue:ie})}}else{if(b&&i.hasOwnProperty(b))return e(i[b],{iv:ie,field:r,props:X,label:X.label,onchange:ae,obj:s,context:p});switch(b){case\"colour\":case\"color\":{const t=ie;return e(V,{...X,initialValue:t,onchange:ae,onblur:J})}case\"time\":{const{twelveHour:t=!1}=X,a=ie?\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie:new Date,i=ee(a);return s[g]=F?F(\"to\",a):a,e(B,{...X,twelveHour:t,initialValue:i,onchange:e=>{const t=e.split(\":\").map(e=>+e);a.setHours(t[0],t[1]),ae(a)},container:u})}case\"date\":{const{format:t=\"mmmm d, yyyy\"}=X,a=\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie;s[g]=a?F?F(\"to\",a.valueOf()):a.valueOf():a;const{min:i,max:n}=X,o=i?!a||ia.valueOf()?new Date(n):a:void 0;return e(q,{...X,minDate:o,maxDate:l,setDefaultDate:!!a,format:t,initialValue:a,onchange:e=>{ae(new Date(e))},container:u})}case\"datetime\":{const{label:t,className:a=\"col s12\",dateTimeSeconds:i=!1,twelveHour:n=!1,format:o=\"mmmm d, yyyy\",...l}=X,r=\"number\"==typeof ie||\"string\"==typeof ie?new Date(ie):ie,s={initialDateTime:r},c=r||void 0,d=r?ee(r):\"\",{min:p,max:m}=X,h=p?!r||pr.valueOf()?new Date(m):r:void 0,g=X.dateTimeOutput||\"UTC\",b=e=>{s.initialDateTime=e,ae(\"UTC\"===g?e.toUTCString():\"ISO\"===g?e.toISOString():e.valueOf())};return e(\"div\",{className:a},e(\".row\",[e(i?\".col.s6\":\".col.s8\",{style:\"padding: 0\"},e(q,{...l,label:t,minDate:h,maxDate:f,setDefaultDate:!!r,format:o,initialValue:c,container:u,onchange:e=>{const t=new Date(s.initialDateTime);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(e.getDate()),b(t)}})),e(\".col.s4\",{style:\"min-width: 6rem; padding-right: 0; padding-left: 0\"},e(B,{...l,label:\"\",helperText:\"\",twelveHour:n,initialValue:d,container:u,onchange:e=>{const t=e.split(\":\").map(e=>+e),a=s.initialDateTime||new Date((new Date).setSeconds(0,0));a.setHours(t[0],t[1]),b(a)}})),i&&e(T,{style:\"min-width: 4rem; padding-right: 0; padding-left: 0\",className:\"col s2\",min:0,max:59,onchange:e=>{const t=s.initialDateTime||new Date((new Date).setSeconds(0,0));t.setSeconds(e,0),b(t)}})]))}case\"email\":{const t=ie;return e(j,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"number\":{const t=ie;return e(T,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"radio\":{const t=ie;return e(z,{label:\"\",...X,options:Z,checkedId:t,onchange:ae})}case\"checkbox\":{const t=ie;return e(P,{...X,checked:t,onchange:ae})}case\"options\":{const t=ie;return[[e(R,{key:o.key,checkboxClass:\"col s6 m4 l3\",className:\"input-field col s12\",...X,disabled:X.disabled||!Z||0===Z.length,options:Z,checkedId:t,onchange:e=>ae(1===e.length?e[0]:e.filter(e=>null!==e))})],void 0!==E&&e(\".col.s12.option-buttons\",[e(v,{disabled:X.disabled,label:ne,iconName:\"check\",onclick:()=>{o.key=Date.now(),ae(Z.map(e=>e.id))}}),oe&&e(v,{disabled:X.disabled,label:oe,iconName:\"check_box_outline_blank\",onclick:()=>{const e=s[g]||[];e.length=0,o.key=Date.now(),ae(e)}})])]}case\"select\":{const t=ie;return e(W,{placeholder:X.multiple?M.pickOneOrMore||\"Pick one or more\":M.pickOne||\"Pick one\",...X,disabled:X.disabled||!Z||0===Z.length,options:Z,initialValue:t,onchange:e=>ae(1!==e.length||X.multiple?e.filter(e=>null!==e||void 0!==e):e[0])})}case\"markdown\":case\"md\":{const{label:t,className:a=\"col s12\"}=X,i=ue((g?ie:k||t)||\"\",s,p);return e(ve,{md:i,className:a})}case\"section\":return e(\".divider\");case\"switch\":{const t=ie,a=Z&&Z.length>0?Z[0].label:\"\",i=Z&&Z.length>1?Z[1].label:\"\";return e(Y,{...X,left:a,right:i,checked:t,onchange:ae})}case\"tags\":{const t=(ie?ie instanceof Array?ie:[ie]:[]).map(e=>({tag:e})),a=Z&&Z.length>0?{data:Z.reduce((e,t)=>(e[t.id]=null,e),{}),limit:r.maxLength||Infinity,minLength:r.minLength||1}:{},{label:i,isMandatory:n,className:o,helperText:l}=X;return e(x,{className:o,label:i,isMandatory:n,helperText:l,onchange:e=>ae(e.map(e=>e.tag)),placeholder:r.placeholder||\"Add a tag\",secondaryPlaceholder:r.secondaryPlaceholder||\"+tag\",data:t,autocompleteOptions:a,onblur:J})}case\"autocomplete\":{const t=ie,a=Z&&Z.length>0?{data:Z.reduce((e,t)=>(e[t.id]=null,e),{}),limit:r.maxLength||Infinity,minLength:r.minLength||1}:{data:{}},{label:i,isMandatory:n,className:o,helperText:l}=X;return e(h,{initialValue:t,className:o,label:i,isMandatory:n,helperText:l,onchange:ae,onblur:J,placeholder:r.placeholder||\"...\",...a})}case\"textarea\":{const t=ie;return e(A,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeyup:H,onkeydown:U,onblur:J})}case\"file\":{const t=ie,{url:a,placeholder:i}=r;if(!a)throw Error('Input field \"url\" not defined, which indicates the URL to the upload folder.');const n=Z?Z.map(e=>e.id):void 0,o=t=>{if(!t||t.length<1)return void ae(\"\");const i=new FormData;i.append(\"file\",t[0]),e.request({method:\"POST\",url:a,body:i}).then(e=>ae(e)).catch(console.error)};return e(L,{...X,accept:n,placeholder:i,onchange:o,initialValue:t})}case\"base64\":{const t=ie,a=!(!t||!/data:image/i.test(t)),{placeholder:i}=r,n=Z?Z.map(e=>e.id).join(\",\"):void 0,o=t=>{if(!t||t.length<1)return void ae(\"\");const a=new FileReader;a.onloadend=()=>{\"string\"==typeof a.result&&ae(a.result),e.redraw()},a.readAsDataURL(t[0])};return a?e(\"div\",[e(\"img.responsive-img\",{src:t,alt:s.title||s.alt||s.name||\"\",style:`max-height: ${r.max||50}px`}),e(v,{iconName:\"clear\",onclick:()=>ae(\"\")})]):e(L,{...X,accept:n,placeholder:i,onchange:o,initialValue:t})}case\"url\":{const t=ie;return e(C,{placeholder:\"http(s)://www.example.com\",...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}case\"text\":{const t=ie;return e(S,{...X,validate:te,autofocus:c,onchange:ae,initialValue:t,onkeydown:U,onkeyup:H,onblur:J})}default:return}}}}},ke=()=>{const t={},a=(e,a)=>{const i=e instanceof Array?e.length:e.hasOwnProperty(a)?e[a].length:0,n=t.onNewItem?t.onNewItem(e,a,i):{};e instanceof Array?e.push(n):e.hasOwnProperty(a)?e[a].push(n):e[a]=[n]};let i;const n=e=>{e.preventDefault()};return{oninit:({attrs:{i18n:e={},field:{id:a=\"\",sortProperty:n,onNewItem:o}}})=>{t.editLabel=e.editRepeat||`Edit ${String(a)}`,t.createLabel=e.createRepeat||`Create new ${String(a)}`,t.onNewItem=o,i=(e=>{if(!e)return(e,t)=>0;const t=\"!\"===e[0],a=t?e.substring(1):e;return t?(e,t)=>e[a]>t[a]?-1:e[a]e[a]>t[a]?1:e[a]{const{filterValue:f}=t,{id:g,label:b,type:y,min:x,max:k,pageSize:N,propertyFilter:$,filterLabel:I,readonly:O=u,repeatItemClass:A=\"\"}=o,D=((e,t)=>e instanceof Array?e:(e.hasOwnProperty(t)||(e[t]=[]),e[t]))(l,g),T=f?fe(f):void 0,M=$&&T&&T.length>2?D.filter(e=>fe(`${e[$]}`).indexOf(T)>=0):D,C=(e=>{const t=window.location.hash.split(\"?\")[1];return t?new URLSearchParams(t).get(e):null})(String(g)),V=C?Math.min(M.length,+C):1,j=N&&M&&(V-1)*N(j-1)*N<=t&&t!0,P=e.route.get()||location.href.replace(location.origin,\"\").replace(\"/#!\",\"\"),R=N?Math.ceil(M.length/N):0,F=!!(k&&M.length>=k),H=!p&&!O&&(!x||M.length>x),U=P?P.split(\"?\")[0]:\"\",q=(e=>{const t=e?e.split(\"?\")[1]:window.location.search.slice(1),a={};if(t){const e=t.split(\"&\");for(var i=0;i{a(l,String(g)),g&&e.route.set(U,Object.assign(q,{[g]:M.length})),h&&h(l)},style:{padding:0},className:\"left\",disabled:p||F,readonly:O}),R>1&&e(\".right\",e(_,{curPage:j,items:ge(1,R).map(e=>({href:ye(U,q,{[g]:e})}))})),(M.length>1||f)&&$&&!p&&e(S,{style:\"margin-top: -6px; margin-bottom: -1rem;\",iconName:\"filter_list\",iconClass:\"small\",placeholder:I,onkeyup:(e,a)=>t.filterValue=a,className:\"right\",disabled:p,readonly:O})])),M&&M.length>0&&\"string\"!=typeof y&&M.sort(i).filter(L).map((a,i)=>e(\".mui-repeat-item\",{key:i,draggable:J,ondragstart:J?e=>((e,t)=>{e.dataTransfer?.setData(\"text/plain\",t.toString())})(e,i):void 0,ondragover:J?n:void 0,ondrop:J?e=>((e,t,a,i,n)=>{const o=parseInt(e.dataTransfer?.getData(\"text\")||\"0\",10),l=[...a[i]],[r]=l.splice(o,1);l.splice(t,0,r),a[i]=l,n&&n(a),e.preventDefault()})(e,i,l,g,h):void 0,style:{display:\"flex\",cursor:J?\"move\":void 0}},[H&&[(!N||N>1)&&e(\"span.mui-show-item-number left\",{style:`flex: 0 0 ${B}px;`},`[${(N?(j-1)*N+i:i)+1}]`)],[e(\".row.repeat-item\",{className:A,key:V+be(a),style:\"flex: 1;\"},[y&&e(De,{form:y,obj:a,i18n:m,context:r instanceof Array?[l,...r]:[l,r],section:c,containerId:d,disabled:p,readonly:O,onchange:()=>h&&h(l)})])],H&&[e(v,{iconName:\"delete\",className:\"mui-delete-item\",iconClass:\"mui-delete-icon\",style:{flex:\"0 0 20px\",padding:0},disabled:p,readonly:O,onclick:()=>{t.curItemIdx=N?(j-1)*N+i:i}})]])),!(p||F||O||!M||0===M.length||1===N)&&e(w,{iconName:\"add\",className:\"row mui-add-new-item btn-small right\",title:b,style:\"padding: 0; margin-top: -10px; margin-right: -25px\",onclick:()=>{a(l,String(g)),e.route.set(U,Object.assign(q,{[g]:M.length})),h&&h(l)}})])],void 0!==t.curItemIdx&&e(E,{id:\"deleteItem\",onCreate:e=>e.open(),options:{onCloseStart:()=>{t.curItemIdx=void 0,e.redraw()}},fixedFooter:!0,title:m.deleteItem||\"Delete item\",description:e(De,{form:y,obj:M[t.curItemIdx],context:r instanceof Array?[l,...r]:[l,r],section:c,containerId:d,readonly:!0,i18n:m}),buttons:[{label:m.disagree||\"Disagree\"},{label:m.agree||\"Agree\",onclick:()=>{void 0!==t.curItemIdx&&(M.splice(t.curItemIdx,1),l instanceof Array?l=[...M]:l[g]=[...M],h&&h(l))}}]})]}}},Ne=()=>{const t={};return{oninit:({attrs:{i18n:e={}}})=>{const{raw:a=\"RAW\",view:i=\"VIEW\"}=e;t.raw=a,t.view=i},view:({attrs:{field:{id:a=\"\",type:i,onSelect:n},obj:o,context:l,containerId:r,disabled:s,readonly:c,i18n:d,onchange:p}})=>{if(o instanceof Array)return;const u=o[a],m=u?JSON.parse(u):void 0,h=m&&m.features||[],f=[],g={title:t.raw,vnode:e(A,{class:\"col s12\",initialValue:m?JSON.stringify(m,null,2):void 0,placeholder:\"Enter GeoJSON\",onchange:e=>o[a]=e})};if(!i||\"string\"==typeof i)return;const b=i,y=b.length>0?b[0].id:void 0,v={title:t.view,vnode:h.length?e(N,{oncreate:({dom:e})=>t.dom=e,onOpenStart:n?e=>{const a=t.dom.children||[];for(let t=0;t(t.properties||(t.properties={}),{id:\"erik_\"+i,key:i,header:y&&t.properties[y]||t.geometry.type,body:e(\".row\",e(De,{class:\"col s12\",form:b,obj:t.properties,i18n:d,context:l instanceof Array?[o,...l]:[o,l],containerId:r,disabled:s,readonly:c,onchange:(e,t)=>{t&&(h[i].properties=t),o[a]=JSON.stringify(m,null,2),p&&p(o)}}))}))}):e(\"span\",\"...\")};return f.push(v),f.push(g),e(Z,{tabs:f,tabWidth:\"fill\"})}}},$e={},Ie={},Oe=(e,t,a)=>{$e[e]=t,a&&(Ie[e]=a)},Ae=xe($e,Ie),De=()=>({view:({attrs:{i18n:t,form:a,obj:i,onchange:n,disabled:o,readonly:l,context:r,section:s}})=>{const c=e=>n&&n(((e,t)=>t.filter(e=>e.required&&void 0!==typeof e.id).reduce((t,a)=>t&&!(a.id&&(void 0===e[a.id]||e[a.id]instanceof Array&&0===e[a.id].length||\"string\"==typeof e[a.id]&&0===e[a.id].length)),!0))(e,a),e);return a.filter((e=>{if(!e)return e=>!0;let t=!1;return({type:a,id:i})=>\"section\"===a?(t=i===e,!1):t})(s)).filter(e=>!e.show||le(e.show,i,...r||[])).reduce((a,n)=>(n.type||(n.type=(e=>{const{autogenerate:t,value:a,options:i}=e;return t?\"none\":a?\"string\"==typeof a?\"md\":\"number\"==typeof a?\"number\":\"boolean\"==typeof a?\"checkbox\":\"none\":i&&i.length>0?\"select\":\"none\"})(n)),[...a,void 0===n.repeat||!1===n.repeat?e(Ae,{i18n:t,field:n,obj:i,onchange:c,disabled:o,readonly:l,context:r,section:s,containerId:\"body\"}):e(\"geojson\"===n.repeat?Ne:ke,{obj:i,field:n,onchange:c,context:r,i18n:t,containerId:\"body\",disabled:o,readonly:l})]),[])}});export{xe as FormFieldFactory,De as LayoutForm,we as ReadonlyComponent,ke as RepeatList,ve as SlimdownView,G as capitalizeFirstLetter,me as deepCopy,ae as flatten,pe as formatExpression,te as getPath,Q as isComponentType,he as labelResolver,X as padLeft,ge as range,Oe as registerPlugin,re as resolveExpression,fe as stripSpaces,ee as toHourMin};\n//# sourceMappingURL=index.esm.js.map\n","import { padLeft } from 'mithril-materialized';\nimport { CrimeScriptFilter, FlexSearchResult, Hierarchical, ID, Labeled, SearchResult } from '../models';\nimport { t } from '../services';\n\nexport const LANGUAGE = 'CSS_LANGUAGE';\nexport const SAVED = 'CSS_MODEL_SAVED';\n\nconst supRegex = /\\^([^_ ]+)(_|$|\\s)/g;\nconst subRegex = /\\_([^\\^ ]+)(\\^|$|\\s)/g;\n\n/** Expand markdown notation by converting A_1 to subscript and x^2 to superscript. */\nexport const subSup = (s: string) => (s ? s.replace(supRegex, `$1`).replace(subRegex, `$1`) : s);\n\nexport const capitalize = (s?: string) => s && s.charAt(0).toUpperCase() + s.slice(1);\n\n/**\n * Debounce function wrapper, i.e. between consecutive calls of the wrapped function,\n * there will be at least TIMEOUT milliseconds.\n * @param func Function to execute\n * @param timeout Timeout in milliseconds\n * @returns\n */\nexport const debounce = (func: (...args: any) => void, timeout: number) => {\n let timer: number;\n return (...args: any) => {\n clearTimeout(timer);\n timer = window.setTimeout(() => {\n func(...args);\n }, timeout);\n };\n};\n\nexport const formatDate = (date: number | Date = new Date(), separator = '-') => {\n const d = new Date(date);\n return `${d.getFullYear()}${separator}${padLeft(d.getMonth() + 1)}${separator}${padLeft(d.getDate())}`;\n};\n\n/**\n * Get a color that is clearly visible against a background color\n * @param backgroundColor Background color, e.g. #99AABB\n * @returns\n */\nexport const getTextColorFromBackground = (backgroundColor?: string) => {\n if (!backgroundColor) {\n return 'black-text';\n }\n const c = backgroundColor.substring(1); // strip #\n const rgb = parseInt(c, 16); // convert rrggbb to decimal\n const r = (rgb >> 16) & 0xff; // extract red\n const g = (rgb >> 8) & 0xff; // extract green\n const b = (rgb >> 0) & 0xff; // extract blue\n\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709\n\n return luma < 105 ? 'white-text' : 'black-text';\n};\n\ntype Option = {\n id: T;\n label: string;\n title?: string;\n};\n\nexport const getOptionsLabel = (options: Array>, id?: T | T[], showTitle = true) => {\n if (!id) {\n return '';\n }\n const print = (o: Option) =>\n showTitle ? `${o.label}${o.title ? ` (${o.title.replace(/\\.\\s*$/, '')})` : ''}` : o.label;\n if (id instanceof Array) {\n return options\n .filter((o) => id.indexOf(o.id) >= 0)\n .map((o) => print(o))\n .join(', ');\n }\n const found = options.filter((o) => o.id === id).shift();\n return found ? print(found) : '';\n};\n\n/** Join a list of items with a comma, and use AND for the last item in the list. */\nexport const joinListWithAnd = (arr: string[] = [], and = 'and', prefix = '') => {\n const terms = arr.filter((term) => term);\n return terms.length === 0\n ? ''\n : prefix +\n (terms.length === 1\n ? terms[0]\n : `${terms\n .slice(0, terms.length - 1)\n .map((t, i) => (i === 0 || typeof t === 'undefined' ? t : t.toLowerCase()))\n .join(', ')} ${and} ${terms[terms.length - 1].toLowerCase()}`);\n};\n\n/** Convert markdown text to HTML */\n// export const markdown2html = (markdown = '') =>\n// m.trust(render(markdown, true, true));\n\nexport const isUnique = (item: T, pos: number, arr: T[]) => arr.indexOf(item) == pos;\n\n/** Generate an array of numbers, from start till end, with optional step size. */\nexport const generateNumbers = (start: number, end: number, step: number = 1): number[] => {\n if (start > end) {\n throw new Error('Start number must be less than or equal to the end number.');\n }\n\n if (step <= 0) {\n throw new Error('Step size must be a positive number.');\n }\n\n const length = Math.floor((end - start) / step) + 1;\n return Array.from({ length }, (_, index) => start + index * step);\n};\n\nexport const getRandomValue = (array: T[]): T | undefined => {\n if (array.length === 0) {\n return undefined;\n }\n\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n};\n\n/**\n * Deep copy function for TypeScript.\n * @param T Generic type of target/copied value.\n * @param target Target value to be copied.\n * @see Source project, ts-deepcopy https://github.com/ykdr2017/ts-deepcopy\n * @see Code pen https://codepen.io/ErikVullings/pen/ejyBYg\n */\nexport const deepCopy = (target: T): T => {\n if (target === null) {\n return target;\n }\n if (target instanceof Date) {\n return new Date(target.getTime()) as any;\n }\n if (target instanceof Array) {\n const cp = [] as any[];\n (target as any[]).forEach((v) => {\n cp.push(v);\n });\n return cp.map((n: any) => deepCopy(n)) as any;\n }\n if (typeof target === 'object') {\n const cp = { ...(target as { [key: string]: any }) } as {\n [key: string]: any;\n };\n Object.keys(cp).forEach((k) => {\n cp[k] = deepCopy(cp[k]);\n });\n return cp as T;\n }\n return target;\n};\n\n/** Compute a contrasting background color */\nexport const contrastingColor = (backgroundColor: string) => {\n const backgroundRgb = [\n parseInt(backgroundColor[1] + backgroundColor[2], 16),\n parseInt(backgroundColor[3] + backgroundColor[4], 16),\n parseInt(backgroundColor[5] + backgroundColor[6], 16),\n ];\n const luminance = 0.2126 * backgroundRgb[0] + 0.7152 * backgroundRgb[1] + 0.0722 * backgroundRgb[2];\n\n // If the background is dark, use white text.\n if (luminance < 20) {\n return '#ffffff';\n }\n\n // If the background is light, use black text.\n return '#000000';\n};\n\nexport const scrollToSection = (e: MouseEvent, id: string): void => {\n e.preventDefault();\n const element = document.getElementById(id);\n\n if (element) {\n element.scrollIntoView({ behavior: 'smooth' });\n } else {\n console.log(`Element with id ${id} not found.`);\n }\n};\n\nexport const scrollToTop = (): void => {\n window.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n};\n\nexport const addLeadingSpaces = (str: string, numSpaces: number): string => {\n // Create a string with the specified number of spaces\n const spaces = ' '.repeat(numSpaces);\n // Concatenate the spaces with the original string\n return spaces + str;\n};\n\nexport type InputOptions = {\n id: string;\n label?: string;\n group?: string;\n icon?: string;\n};\n\nexport const toOptions = (arr: Array, noGroup = false): InputOptions[] =>\n arr.map(({ id, label, parents }) => ({\n id,\n label,\n group: noGroup\n ? undefined\n : parents && parents.length > 0\n ? arr.find((l) => l.id === parents[0])?.label\n : t('OTHER'),\n }));\n\nexport const resolveOptions = (arr: Array = [], ids: ID | ID[] = []) => {\n ids = Array.isArray(ids) ? ids : [ids];\n return arr.filter((a) => ids.includes(a.id));\n};\n\n/** Convert to markdown unsorted list */\nexport const toMarkdownUl = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a) => `- ${a.label}`)\n .join('\\n');\n\n/** Convert to markdown sorted list */\nexport const toMarkdownOl = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a, i) => `${i + 1}. ${a.label}`)\n .join('\\n');\n\n/** Convert to comma-separated sorted list */\nexport const toCommaSeparatedList = (arr: Array = [], ids: ID | ID[] = []) =>\n resolveOptions(arr, ids)\n .map((a, i) => a.label)\n .join(', ');\n\nexport const crimeScriptFilterToText = (arr: Array = [], filter = {} as CrimeScriptFilter) => {\n const {\n productIds = [],\n geoLocationIds = [],\n locationIds = [],\n roleIds = [],\n attributeIds = [],\n transportIds = [],\n } = filter;\n return toCommaSeparatedList(arr, [\n ...productIds,\n ...geoLocationIds,\n ...locationIds,\n ...roleIds,\n ...attributeIds,\n ...transportIds,\n ]);\n};\n\n/** Tokenize a text by removing punctuation, splitting the text into words, lowercasing and removing stopwords and (almost) empty strings */\nexport const tokenize = (text: string = '', stopwords: string[]): string[] => {\n return text\n .replace(/[^\\w\\s]/g, '') // Remove punctuation\n .split(/\\s+/) // Split into words\n .map((word) => word.toLowerCase()) // Convert to lowercase\n .filter((word) => word.length > 2 && !stopwords.includes(word)); // Exclude stopwords and empty strings\n};\n\n/** Aggregate all search results to determine the most relevant crimescript (and act of that crimescript) */\nexport const aggregateFlexSearchResults = (results: FlexSearchResult[]): SearchResult[] => {\n // Step 1: Aggregate by crimeScriptIdx\n const crimeScriptMap = new Map();\n\n for (const [crimeScriptIdx, actIdx, phaseIdx, score] of results) {\n if (!crimeScriptMap.has(crimeScriptIdx)) {\n crimeScriptMap.set(crimeScriptIdx, {\n crimeScriptIdx,\n totalScore: 0,\n acts: [],\n });\n }\n\n const crimeScript = crimeScriptMap.get(crimeScriptIdx)!;\n crimeScript.totalScore += score;\n\n const existingAct = crimeScript.acts.find((act) => act.actIdx === actIdx);\n if (existingAct) {\n existingAct.score += score;\n } else {\n crimeScript.acts.push({ actIdx, phaseIdx, score });\n }\n }\n\n // Step 2: Sort the results\n const sortedResults = Array.from(crimeScriptMap.values()).sort((a, b) => {\n // Sort by total score of crimeScript\n if (b.totalScore !== a.totalScore) {\n return b.totalScore - a.totalScore;\n }\n\n // If total scores are equal, sort by the highest scoring act\n const maxScoreA = Math.max(...a.acts.map((act) => act.score));\n const maxScoreB = Math.max(...b.acts.map((act) => act.score));\n return maxScoreB - maxScoreA;\n });\n\n // Sort acts within each crimeScript\n sortedResults.forEach((crimeScript) => {\n crimeScript.acts.sort((a, b) => b.score - a.score);\n });\n\n return sortedResults;\n};\n","var isObject = function (obj) { return obj && typeof obj === 'object'; };\n\nfunction assemble(parts, replacements, count, opts) {\n var result = opts.array ? parts.slice() : parts[0];\n var len = parts.length;\n for (var i = 1; i < len; i += 2) {\n var part = parts[i];\n var val = replacements[part];\n if (val == null) {\n if (part === 'n' && count != null) {\n val = count;\n } else {\n opts.debug &&\n console.warn('No \"' + part + '\" in placeholder object:', replacements);\n val = '{' + part + '}';\n }\n }\n if (opts.array) {\n result[i] = val;\n } else {\n result += val + parts[i + 1];\n }\n }\n return result\n}\n\nfunction getPluralValue(translation, count, plFunc) {\n // Opinionated assumption: Pluralization rules are the same for negative and positive values.\n // By normalizing all values to positive, pluralization functions become simpler, and less error-prone by accident.\n var mappedCount = Math.abs(count);\n\n mappedCount = plFunc ? plFunc(mappedCount) : mappedCount;\n if (translation[mappedCount] != null) {\n return translation[mappedCount]\n }\n if (translation.n != null) {\n return translation.n\n }\n}\n\nfunction replacePlaceholders(\n translation,\n replacements,\n count,\n replCache,\n opts\n) {\n var result = replCache[translation];\n if (result == null) {\n var parts = translation\n // turn both curly braces around tokens into the a unified\n // (and now unique/safe) token `{x}` signifying boundry between\n // replacement variables and static text.\n .replace(/\\{(\\w+)\\}/g, '{x}$1{x}')\n // Adjacent placeholders will always have an empty string between them.\n // The array will also always start with a static string (at least a '').\n .split('{x}'); // stupid but works™\n\n // NOTE: parts no consists of alternating [text,replacement,text,replacement,text]\n // Cache a function that loops over the parts array - unless there's only text\n // (i.e. parts.length === 1) - then we simply cache the string.\n result = parts.length > 1 ? parts : parts[0];\n replCache[translation] = result;\n }\n result = result.pop ? assemble(result, replacements, count, opts) : result;\n return result\n}\n\nfunction translate(\n translationKey,\n subKey,\n replacements,\n keys,\n opts,\n replCache\n) {\n opts = opts || {};\n var translation = keys[translationKey];\n var translationIsObject = isObject(translation);\n var complex = translationIsObject || subKey != null || replacements != null;\n\n if (complex) {\n if (isObject(subKey)) {\n var tmp = replacements;\n replacements = subKey;\n subKey = tmp;\n }\n replacements = replacements || {};\n\n if (translationIsObject) {\n var propValue =\n (subKey != null && translation[subKey]) || translation['*'];\n if (propValue != null) {\n translation = propValue;\n } else if (typeof subKey === 'number') {\n // get appropriate plural translation string\n var plFunc = opts.pluralize;\n translation = getPluralValue(translation, subKey, plFunc);\n }\n }\n }\n\n if (typeof translation !== 'string') {\n if (opts.useKeyForMissingTranslation === false) {\n return\n }\n translation = translationKey;\n if (opts.debug) {\n if (subKey != null) {\n translation = '@@' + translationKey + '.' + subKey + '@@';\n console.warn(\n 'No translation or pluralization form found for \"' +\n subKey +\n '\" in' +\n translationKey\n );\n } else {\n translation = '@@' + translation + '@@';\n console.warn('Translation for \"' + translationKey + '\" not found.');\n }\n }\n }\n\n if (complex) {\n return replacePlaceholders(\n translation,\n replacements,\n subKey,\n replCache,\n opts\n )\n }\n return translation\n}\n\nfunction translateToArray() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var opts = this.opts;\n var normalArrayOption = opts.array;\n opts.array = true;\n var result = this.apply(null, args);\n opts.array = normalArrayOption;\n return result\n}\n\nfunction translatejs(messageObject, options) {\n messageObject = messageObject || {};\n options = options || {};\n\n if (options.resolveAliases) {\n messageObject = translatejs.resolveAliases(messageObject);\n }\n\n var replCache = {};\n\n function tFunc(translationKey, subKey, replacements) {\n return translate(\n translationKey,\n subKey,\n replacements,\n tFunc.keys,\n tFunc.opts,\n replCache\n )\n }\n\n tFunc.arr = translateToArray; // Convenience function.\n\n tFunc.keys = messageObject || {};\n tFunc.opts = options;\n\n return tFunc\n}\n\nfunction mapValues(obj, fn) {\n return Object.keys(obj).reduce(function (res, key) {\n res[key] = fn(obj[key], key);\n return res\n }, {})\n}\n\ntranslatejs.resolveAliases = function resolveAliases(translations) {\n var keysInProcess = {};\n function resolveAliases(translation) {\n if (isObject(translation)) {\n return mapValues(translation, resolveAliases)\n }\n return translation.replace(/{{(.*?)}}/g, function (_, token) {\n if (keysInProcess[token]) {\n throw new Error('Circular reference for \"' + token + '\" detected')\n }\n keysInProcess[token] = true;\n var key = token;\n var subKey = '';\n var keyParts = token.match(/^(.+)\\[(.+)\\]$/);\n if (keyParts) {\n key = keyParts[1];\n subKey = keyParts[2];\n }\n var target = translations[key];\n if (isObject(target)) {\n if (subKey) {\n target = target[subKey];\n } else {\n throw new Error(\"You can't alias objects\")\n }\n }\n if (target == null) {\n throw new Error('No translation for alias \"' + token + '\"')\n }\n var translation = resolveAliases(target);\n keysInProcess[token] = false;\n return translation\n })\n }\n return resolveAliases(translations)\n};\n\nexport default translatejs;\n","import { situationCrimePreventionClassificationTableNL } from '../abstract';\nimport { messages } from './en';\n\nexport const messagesNL: typeof messages = {\n HOME: { TITLE: 'Home', ROUTE: '/home' },\n ABOUT: { TITLE: 'Over de app', ROUTE: '/over', TEXT: situationCrimePreventionClassificationTableNL },\n CRIME_SCRIPT: { TITLE: 'Crime script', ROUTE: '/crime_script' },\n SETTINGS: { TITLE: 'Instellingen', ROUTE: '/instellingen' },\n LANDING: { TITLE: 'Introductie', ROUTE: '/' },\n CASE: { TITLE: 'Casus', ROUTE: '/casus' },\n USER: 'Gebruiker',\n EDITOR: 'Redacteur',\n ADMIN: 'Beheerder',\n CANCEL: 'Annuleren',\n DELETE: 'Verwijderen',\n YES: 'Ja',\n NO: 'Nee',\n OK: 'Ok',\n NAME: 'Naam',\n MISC: 'Overig',\n DESCRIPTION: 'Beschrijving',\n DELETE_ITEM: {\n TITLE: '{item} verwijderen',\n DESCRIPTION: 'Weet je zeker dat je dit {item} wilt verwijderen? Dit kan niet ongedaan worden gemaakt.',\n },\n EDIT_BUTTON: {\n LABEL: 'Bewerken',\n TOOLTIP: 'Bewerken',\n },\n SAVE_BUTTON: {\n LABEL: 'Opslaan',\n TOOLTIP: 'Wijzigingen opslaan',\n },\n MODEL: 'Model',\n TITLE: 'Titel',\n AUTHORS: 'Auteurs',\n LINK: 'Link',\n TYPE: 'Type',\n CAST_TYPE: 'Roltype',\n SAVE_SCRIPT: 'Script opslaan',\n EDIT_SCRIPT: 'Script bewerken',\n DELETE_SCRIPT: 'Script verwijderen',\n NEW_SCRIPT: 'Nieuw script',\n DELETE_SCRIPT_CONFIRM: 'Weet je zeker dat je het script \"{name}\" wilt verwijderen?',\n ACTIVITIES: 'Activiteiten',\n CAST: 'Rollen',\n CONDITIONS: 'Voorwaarden',\n ATTRIBUTES: 'Attributen',\n MEASURES: 'Maatregelen',\n NEW_ACT: 'Nieuwe handeling',\n PREPARATION_PHASE: 'Voorbereidingsfase',\n PRE_ACTIVITY_PHASE: 'Voor-activiteitsfase',\n ACTIVITY_PHASE: 'Activiteitsfase',\n POST_ACTIVITY_PHASE: 'Na-activiteitsfase',\n SUMMARY: 'Samenvatting',\n IMAGE: 'Afbeelding',\n ACTIVITY: 'Activiteit',\n SPECIFY: 'Specificeer',\n CONDITION: 'Voorwaarde',\n CATEGORY: 'Categorie',\n SELECT: 'Selecteren',\n CREATE: 'Maken',\n STAGES: 'Fasen',\n STAGE: 'Fase',\n SCENES: 'Scenes',\n SCENE: 'Scene',\n ACTS: 'Actes',\n ACT: 'Acte',\n SELECT_ACT_TO_EDIT: 'Selecteer handeling om te bewerken',\n CREATE_NEW_ACT: 'Nieuwe handeling maken',\n REFERENCES: 'Referenties',\n DETAILS: 'Details',\n LANGUAGE: 'Taal',\n CLEAR: 'Wis model',\n UPLOAD: 'Lees model in als JSON',\n DOWNLOAD: 'Sla model op als JSON',\n PERMALINK: 'Maak permanente link',\n ROLE: 'Rol',\n SELECT_ACT: 'Selecteer act om te bewerken',\n SELECT_ACT_N: 'Selecteer een of meerdere acts in deze stage',\n\n /** Crime Prevention Techniques */\n INCREASE_EFFORT: 'Verhoog de inspanning',\n TARGET_HARDEN: {\n TITLE: 'Doelversteviging',\n DESC: 'Stuursloten en startonderbrekers, Anti-overval schermen, Manipulatiebestendige verpakking',\n },\n CONTROL_ACCESS: {\n TITLE: 'Controleer toegang tot faciliteiten',\n DESC: 'Deurtelefoons, Elektronische kaart toegang, Bagagecontrole',\n },\n SCREEN_EXITS: {\n TITLE: 'Controleer uitgangen',\n DESC: 'Ticket nodig voor vertrek, Exportdocumenten, Elektronische artikelbeveiliging',\n },\n DEFLECT_OFFENDERS: {\n TITLE: 'Leid overtreders af',\n DESC: 'Straatafsluitingen, Aparte toiletten voor vrouwen, Verspreid pubs',\n },\n CONTROL_TOOLS: {\n TITLE: 'Beheers gereedschappen/wapens',\n DESC: '\"Slimme\" wapens, Beperk verkoop spuitverf aan jongeren, Geharde bierglazen',\n },\n INCREASE_RISKS: \"Verhoog de risico's\",\n EXTEND_GUARDIANSHIP: {\n TITLE: 'Breid toezicht uit',\n DESC: \"Ga 's nachts in groep uit, Laat tekenen van bewoning achter, Draag een mobiele telefoon\",\n },\n ASSIST_SURVEILLANCE: {\n TITLE: 'Ondersteun natuurlijk toezicht',\n DESC: 'Verbeterde straatverlichting, Verdedigbaar ruimteontwerp, Ondersteuning van klokkenluiders',\n },\n REDUCE_ANONYMITY: {\n TITLE: 'Verminder anonimiteit',\n DESC: 'Taxichauffeur ID\\'s, \"Hoe is mijn rijgedrag?\" stickers, Schooluniformen',\n },\n USE_PLACE_MANAGERS: {\n TITLE: 'Gebruik plaatsmanagers',\n DESC: 'CCTV voor dubbeldekkers, Twee bedienden voor gemakswinkels, Beloon waakzaamheid',\n },\n STRENGTHEN_SURVEILLANCE: {\n TITLE: 'Versterk formeel toezicht',\n DESC: \"Roodlichtcamera's, Inbraakalarm, Beveiligingspersoneel\",\n },\n REDUCE_REWARDS: 'Verminder de beloningen',\n CONCEAL_TARGETS: {\n TITLE: 'Verberg doelen',\n DESC: 'Parkeren buiten de straat, Genderneutrale telefoongidsen, Ongemarkeerde gepantserde vrachtwagens',\n },\n REMOVE_TARGETS: {\n TITLE: 'Verwijder doelen',\n DESC: 'Verwijderbare autoradio, Vrouwenopvang, Prepaidkaarten voor openbare telefoons',\n },\n IDENTIFY_PROPERTY: {\n TITLE: 'Identificeer eigendom',\n DESC: 'Eigendomsmarkering, Voertuigregistratie en onderdelenmarkering, Veemerken',\n },\n DISRUPT_MARKETS: {\n TITLE: 'Verstoor markten',\n DESC: 'Monitor pandjeshuis, Controles op rubrieksadvertenties, Vergunning voor straatverkopers',\n },\n DENY_BENEFITS: {\n TITLE: 'Ontzeg voordelen',\n DESC: 'Inktlabels op artikelen, Graffiti reiniging, Uitschakelen gestolen mobiele telefoons',\n },\n REDUCE_PROVOCATIONS: 'Verminder provocaties',\n REDUCE_FRUSTRATIONS: {\n TITLE: 'Verminder frustraties en stress',\n DESC: 'Efficiënte rijen, Beleefde service, Uitgebreide zitplaatsen, Rustgevende muziek/gedempte verlichting',\n },\n AVOID_DISPUTES: {\n TITLE: 'Vermijd geschillen',\n DESC: 'Gescheiden zitplaatsen voor rivaliserende voetbalfans, Verminder drukte in bars, Vaste taxitarieven',\n },\n REDUCE_TEMPTATION: {\n TITLE: 'Verminder verleiding en opwinding',\n DESC: 'Controles op gewelddadige pornografie, Handhaaf goed gedrag op voetbalveld, Verbied racistische opmerkingen',\n },\n NEUTRALIZE_PRESSURE: {\n TITLE: 'Neutraliseer groepsdruk',\n DESC: '\"Idioten drinken en rijden\", \"Het is OK om Nee te zeggen\", Verspreid onruststokers op school',\n },\n DISCOURAGE_IMITATION: {\n TITLE: 'Ontmoedig imitatie',\n DESC: \"Snelle reparatie van vandalisme, V-chips in TV's, Censureer details van modus operandi\",\n },\n REMOVE_EXCUSES: 'Verwijder excuses',\n SET_RULES: {\n TITLE: 'Stel regels op',\n DESC: 'Huurovereenkomsten, Intimidatiecodes, Hotelregistratie',\n },\n POST_INSTRUCTIONS: {\n TITLE: 'Plaats instructies',\n DESC: '\"Parkeren verboden\", \"Privé-eigendom\", \"Doof kampvuren\"',\n },\n ALERT_CONSCIENCE: {\n TITLE: 'Activeer geweten',\n DESC: 'Snelheidsweergaveborden langs de weg, Handtekeningen voor douaneaangiften, \"Winkeldiefstal is stelen\"',\n },\n ASSIST_COMPLIANCE: {\n TITLE: 'Help bij naleving',\n DESC: 'Eenvoudige bibliotheekuitleen, Openbare toiletten, Afvalbakken',\n },\n CONTROL_DRUGS: {\n TITLE: 'Beheers drugs en alcohol',\n DESC: \"Ademanalysers in bars, Interventie programma's voor barpersoneel, Alcoholvrije evenementen\",\n },\n EXPORT_TO_WORD: 'Exporteer naar Word',\n INTRODUCTION: 'Introductie',\n SEARCH: 'Zoek...',\n SEARCH_TOOLTIP: 'Type / om te zoeken',\n HITS: {\n 0: 'Geen resultaten gevonden.',\n 1: '1 resultaat gevonden:',\n n: '{n} resultaten gevonden:',\n },\n SYNONYMS: 'Synoniemen',\n PARENTS: 'Ouders',\n CATEGORIES: 'Categorieën',\n BELONGS_TO: 'Behoort tot',\n LOCATIONS: { 0: 'Locaties', 1: 'Locatie', n: 'Locaties' },\n PRODUCTS: { 0: 'Producten', 1: 'Product', n: 'Producten' },\n GEOLOCATIONS: { 0: 'Kaartlocatie', 1: 'Kaartlocatie', n: 'Kaartlocaties' },\n TRANSPORTS: 'Transportmiddelen',\n I18n: {\n editRepeat: 'Bewerk item',\n createRepeat: 'Maak een nieuw item',\n deleteItem: 'Verwijder een item',\n agree: 'Ja',\n disagree: 'Nee',\n pickOne: 'Kies één',\n pickOneOrMore: 'Kies één of meer',\n cancel: 'Opheffen',\n save: 'Bewaren',\n },\n OTHER: 'Overig',\n TEXT: 'Tekst',\n};\n","export const situationCrimePreventionClassificationTable = `\n\n#### Situational Crime Prevention techniques\n\n| Increase the effort | Increase the risks | Reduce the rewards | Reduce provocations | Remove excuses |\n|---------------------|---------------------|---------------------|----------------------|-----------------|\n| 1. Target harden
      - Steering column locks and ignition immobilizers
      - Anti-robbery screens
      - Tamper-proof packaging | 6. Extend guardianship
      - Go out in group at night
      - Leave signs of occupancy
      - Carry cell phone | 11. Conceal targets
      - Off-street parking
      - Gender-neutral phone directories
      - Unmarked armored trucks | 16. Reduce frustrations and stress
      - Efficient lines
      - Polite service
      - Expanded seating
      - Soothing music/muted lights | 21. Set rules
      - Rental agreements
      - Harassment codes
      - Hotel registration |\n| 2. Control access to facilities
      - Entry phones
      - Electronic card access
      - Baggage screening | 7. Assist natural surveillance
      - Improved street lighting
      - Defensible space design
      - Support whistleblowers | 12. Remove targets
      - Removable car radio
      - Women's shelters
      - Pre-paid cards for pay phones | 17. Avoid disputes
      - Separate seating for rival soccer fans
      - Reduce crowding in bars
      - Fixed cab fares | 22. Post instructions
      - \"No parking\"
      - \"Private property\"
      - \"Extinguish camp fires\" |\n| 3. Screen exits
      - Ticket needed for exit
      - Export documents
      - Electronic merchandise tags | 8. Reduce anonymity
      - Taxi driver IDs
      - \"How's my driving?\" decals
      - School uniforms | 13. Identify property
      - Property marking
      - Vehicle licensing and parts marking
      - Cattle branding | 18. Reduce temptation and arousal
      - Controls on violent pornography
      - Enforce good behavior on soccer field
      - Prohibit racial slurs | 23. Alert conscience
      - Roadside speed display boards
      - Signatures for customs declarations
      - \"Shoplifting is stealing\" |\n| 4. Deflect offenders
      - Street closures
      - Separate bathrooms for women
      - Disperse pubs | 9. Use place managers
      - CCTV for double-deck buses
      - Two clerks for convenience stores
      - Reward vigilance | 14. Disrupt markets
      - Monitor pawn shops
      - Controls on classified ads
      - License street vendors | 19. Neutralize peer pressure
      - \"Idiots drink and drive\"
      - \"It's OK to say No\"
      - Disperse troublemakers at school | 24. Assist compliance
      - Easy library checkout
      - Public lavatories
      - Litter receptacles |\n| 5. Control tools/weapons
      - \"Smart\" guns
      - Restrict spray paint sales to juveniles
      - Toughened beer glasses | 10. Strengthen formal surveillance
      - Red light cameras
      - Burglar alarms
      - Security guards | 15. Deny benefits
      - Ink merchandise tags
      - Graffiti cleaning
      - Disabling stolen cell phones | 20. Discourage imitation
      - Rapid repair of vandalism
      - V-chips in TVs
      - Censor details of modus operandi | 25. Control drugs and alcohol
      - Breathalyzers in bars
      - Server intervention programs
      - Alcohol-free events |\n`;\n\nexport const situationCrimePreventionClassificationTableNL = `\n\n#### Situational Crime Prevention technieken\n\n| Verhoog de inspanning | Verhoog de risico's | Verminder de beloningen | Verminder provocaties | Verwijder excuses |\n|------------------------|----------------------|--------------------------|-------------------------|---------------------|\n| 1. Doelversteviging
      - Stuursloten en startonderbrekers
      - Anti-overval schermen
      - Manipulatiebestendige verpakking | 6. Breid toezicht uit
      - Ga 's nachts in groep uit
      - Laat tekenen van bewoning achter
      - Draag een mobiele telefoon | 11. Verberg doelen
      - Parkeren buiten de straat
      - Genderneutrale telefoongidsen
      - Ongemarkeerde gepantserde vrachtwagens | 16. Verminder frustraties en stress
      - Efficiënte rijen
      - Beleefde service
      - Uitgebreide zitplaatsen
      - Rustgevende muziek/gedempte verlichting | 21. Stel regels op
      - Huurovereenkomsten
      - Intimidatiecodes
      - Hotelregistratie |\n| 2. Controleer toegang tot faciliteiten
      - Deurtelefoons
      - Elektronische kaart toegang
      - Bagagecontrole | 7. Ondersteun natuurlijk toezicht
      - Verbeterde straatverlichting
      - Verdedigbaar ruimteontwerp
      - Ondersteuning van klokkenluiders | 12. Verwijder doelen
      - Verwijderbare autoradio
      - Vrouwenopvang
      - Prepaidkaarten voor openbare telefoons | 17. Vermijd geschillen
      - Gescheiden zitplaatsen voor rivaliserende voetbalfans
      - Verminder drukte in bars
      - Vaste taxitarieven | 22. Plaats instructies
      - \"Parkeren verboden\"
      - \"Privé-eigendom\"
      - \"Doof kampvuren\" |\n| 3. Controleer uitgangen
      - Ticket nodig voor vertrek
      - Exportdocumenten
      - Elektronische artikelbeveiliging | 8. Verminder anonimiteit
      - Taxichauffeur ID's
      - \"Hoe is mijn rijgedrag?\" stickers
      - Schooluniformen | 13. Identificeer eigendom
      - Eigendomsmarkering
      - Voertuigregistratie en onderdelenmarkering
      - Veemerken | 18. Verminder verleiding en opwinding
      - Controles op gewelddadige pornografie
      - Handhaaf goed gedrag op voetbalveld
      - Verbied racistische opmerkingen | 23. Activeer geweten
      - Snelheidsweergaveborden langs de weg
      - Handtekeningen voor douaneaangiften
      - \"Winkeldiefstal is stelen\" |\n| 4. Leid overtreders af
      - Straatafsluitingen
      - Aparte toiletten voor vrouwen
      - Verspreid pubs | 9. Gebruik plaatsmanagers
      - CCTV voor dubbeldekkers
      - Twee bedienden voor gemakswinkels
      - Beloon waakzaamheid | 14. Verstoor markten
      - Monitor pandjeshuis
      - Controles op rubrieksadvertenties
      - Vergunning voor straatverkopers | 19. Neutraliseer groepsdruk
      - \"Idioten drinken en rijden\"
      - \"Het is OK om Nee te zeggen\"
      - Verspreid onruststokers op school | 24. Help bij naleving
      - Eenvoudige bibliotheekuitleen
      - Openbare toiletten
      - Afvalbakken |\n| 5. Beheers gereedschappen/wapens
      - \"Slimme\" wapens
      - Beperk verkoop spuitverf aan jongeren
      - Geharde bierglazen | 10. Versterk formeel toezicht
      - Roodlichtcamera's
      - Inbraakalarm
      - Beveiligingspersoneel | 15. Ontzeg voordelen
      - Inktlabels op artikelen
      - Graffiti reiniging
      - Uitschakelen gestolen mobiele telefoons | 20. Ontmoedig imitatie
      - Snelle reparatie van vandalisme
      - V-chips in TV's
      - Censureer details van modus operandi | 25. Beheers drugs en alcohol
      - Ademanalysers in bars
      - Interventie programma's voor barpersoneel
      - Alcoholvrije evenementen |\n`;\n","import { situationCrimePreventionClassificationTable } from '../abstract';\n\nexport const messages = {\n HOME: { TITLE: 'Home', ROUTE: '/home' },\n ABOUT: { TITLE: 'About the app', ROUTE: '/about', TEXT: situationCrimePreventionClassificationTable },\n CRIME_SCRIPT: { TITLE: 'Crime script', ROUTE: '/crime_script' },\n SETTINGS: { TITLE: 'Settings', ROUTE: '/settings' },\n LANDING: { TITLE: 'Introduction', ROUTE: '/' },\n CASE: { TITLE: 'Case file', ROUTE: '/case' },\n USER: 'User',\n EDITOR: 'Editor',\n ADMIN: 'Administrator',\n CANCEL: 'Cancel',\n DELETE: 'Delete',\n YES: 'Yes',\n NO: 'No',\n OK: 'Ok',\n NAME: 'Name',\n MISC: 'Miscellaneous',\n DESCRIPTION: 'Description',\n DELETE_ITEM: {\n TITLE: 'Delete {item}',\n DESCRIPTION: 'Are you certain you want to delete this {item}. There is no turning back?',\n },\n EDIT_BUTTON: {\n LABEL: 'Edit',\n TOOLTIP: 'Edit',\n },\n SAVE_BUTTON: {\n LABEL: 'Save',\n TOOLTIP: 'Save unsaved changes',\n },\n MODEL: 'Model',\n TITLE: 'Title',\n AUTHORS: 'Authors',\n LINK: 'Link',\n TYPE: 'Type',\n CAST_TYPE: 'Role type',\n SAVE_SCRIPT: 'Save Script',\n EDIT_SCRIPT: 'Edit Script',\n DELETE_SCRIPT: 'Delete Script',\n NEW_SCRIPT: 'New Script',\n DELETE_SCRIPT_CONFIRM: 'Are you certain you want to delete the script \"{name}\"?',\n ACTIVITIES: 'Activities',\n CAST: 'Cast',\n CONDITIONS: 'Conditions',\n ATTRIBUTES: 'Attributes',\n MEASURES: 'Measures',\n NEW_ACT: 'New Act',\n PREPARATION_PHASE: 'Preparation Phase',\n PRE_ACTIVITY_PHASE: 'Pre-Activity Phase',\n ACTIVITY_PHASE: 'Activity Phase',\n POST_ACTIVITY_PHASE: 'Post-Activity Phase',\n SUMMARY: 'Summary',\n IMAGE: 'Image',\n ACTIVITY: 'Activity',\n SPECIFY: 'Specify',\n CONDITION: 'Condition',\n CATEGORY: 'Category',\n SELECT: 'Select',\n CREATE: 'Create',\n STAGES: 'Stages',\n STAGE: 'Stage',\n SCENES: 'Scenes',\n SCENE: 'Scene',\n ACTS: 'Acts',\n ACT: 'Act',\n SELECT_ACT_TO_EDIT: 'Select act to edit',\n CREATE_NEW_ACT: 'Create new act',\n REFERENCES: 'References',\n DETAILS: 'Details',\n LANGUAGE: 'Language',\n CLEAR: 'Clear model',\n UPLOAD: 'Upload model as JSON',\n DOWNLOAD: 'Download model as JSON',\n PERMALINK: 'Create permanent link',\n ROLE: 'Role',\n SELECT_ACT: 'Select act to edit',\n SELECT_ACT_N: 'Select one or more acts for this step',\n /** Crime Prevention Techniques */\n INCREASE_EFFORT: 'Increase the effort',\n TARGET_HARDEN: {\n TITLE: 'Target harden',\n DESC: 'Steering column locks and ignition immobilizers, Anti-robbery screens, Tamper-proof packaging',\n },\n CONTROL_ACCESS: {\n TITLE: 'Control access to facilities',\n DESC: 'Entry phones, Electronic card access, Baggage screening',\n },\n SCREEN_EXITS: {\n TITLE: 'Screen exits',\n DESC: 'Ticket needed for exit, Export documents, Electronic merchandise tags',\n },\n DEFLECT_OFFENDERS: {\n TITLE: 'Deflect offenders',\n DESC: 'Street closures, Separate bathrooms for women, Disperse pubs',\n },\n CONTROL_TOOLS: {\n TITLE: 'Control tools/weapons',\n DESC: '\"Smart\" guns, Restrict spray paint sales to juveniles, Toughened beer glasses',\n },\n INCREASE_RISKS: 'Increase the risks',\n EXTEND_GUARDIANSHIP: {\n TITLE: 'Extend guardianship',\n DESC: 'Go out in group at night, Leave signs of occupancy, Carry cell phone',\n },\n ASSIST_SURVEILLANCE: {\n TITLE: 'Assist natural surveillance',\n DESC: 'Improved street lighting, Defensible space design, Support whistleblowers',\n },\n REDUCE_ANONYMITY: {\n TITLE: 'Reduce anonymity',\n DESC: 'Taxi driver IDs, \"How\\'s my driving?\" decals, School uniforms',\n },\n USE_PLACE_MANAGERS: {\n TITLE: 'Use place managers',\n DESC: 'CCTV for double-deck buses, Two clerks for convenience stores, Reward vigilance',\n },\n STRENGTHEN_SURVEILLANCE: {\n TITLE: 'Strengthen formal surveillance',\n DESC: 'Red light cameras, Burglar alarms, Security guards',\n },\n REDUCE_REWARDS: 'Reduce the rewards',\n CONCEAL_TARGETS: {\n TITLE: 'Conceal targets',\n DESC: 'Off-street parking, Gender-neutral phone directories, Unmarked armored trucks',\n },\n REMOVE_TARGETS: {\n TITLE: 'Remove targets',\n DESC: \"Removable car radio, Women's shelters, Pre-paid cards for pay phones\",\n },\n IDENTIFY_PROPERTY: {\n TITLE: 'Identify property',\n DESC: 'Property marking, Vehicle licensing and parts marking, Cattle branding',\n },\n DISRUPT_MARKETS: {\n TITLE: 'Disrupt markets',\n DESC: 'Monitor pawn shops, Controls on classified ads, License street vendors',\n },\n DENY_BENEFITS: {\n TITLE: 'Deny benefits',\n DESC: 'Ink merchandise tags, Graffiti cleaning, Disabling stolen cell phones',\n },\n REDUCE_PROVOCATIONS: 'Reduce provocations',\n REDUCE_FRUSTRATIONS: {\n TITLE: 'Reduce frustrations and stress',\n DESC: 'Efficient lines, Polite service, Expanded seating, Soothing music/muted lights',\n },\n AVOID_DISPUTES: {\n TITLE: 'Avoid disputes',\n DESC: 'Separate seating for rival soccer fans, Reduce crowding in bars, Fixed cab fares',\n },\n REDUCE_TEMPTATION: {\n TITLE: 'Reduce temptation and arousal',\n DESC: 'Controls on violent pornography, Enforce good behavior on soccer field, Prohibit racial slurs',\n },\n NEUTRALIZE_PRESSURE: {\n TITLE: 'Neutralize peer pressure',\n DESC: '\"Idiots drink and drive\", \"It\\'s OK to say No\", Disperse troublemakers at school',\n },\n DISCOURAGE_IMITATION: {\n TITLE: 'Discourage imitation',\n DESC: 'Rapid repair of vandalism, V-chips in TVs, Censor details of modus operandi',\n },\n REMOVE_EXCUSES: 'Remove excuses',\n SET_RULES: {\n TITLE: 'Set rules',\n DESC: 'Rental agreements, Harassment codes, Hotel registration',\n },\n POST_INSTRUCTIONS: {\n TITLE: 'Post instructions',\n DESC: '\"No parking\", \"Private property\", \"Extinguish camp fires\"',\n },\n ALERT_CONSCIENCE: {\n TITLE: 'Alert conscience',\n DESC: 'Roadside speed display boards, Signatures for customs declarations, \"Shoplifting is stealing\"',\n },\n ASSIST_COMPLIANCE: {\n TITLE: 'Assist compliance',\n DESC: 'Easy library checkout, Public lavatories, Litter receptacles',\n },\n CONTROL_DRUGS: {\n TITLE: 'Control drugs and alcohol',\n DESC: 'Breathalyzers in bars, Server intervention programs, Alcohol-free events',\n },\n EXPORT_TO_WORD: 'Export to Word',\n INTRODUCTION: 'Introduction',\n SEARCH: 'Search...',\n SEARCH_TOOLTIP: 'Type / to search',\n HITS: {\n 0: 'No results found.',\n 1: '1 result found:',\n n: '{n} results found:',\n },\n SYNONYMS: 'Synonyms',\n PARENTS: 'Parents',\n CATEGORIES: 'Categories',\n BELONGS_TO: 'Belongs to',\n PRODUCTS: { 0: 'Products', 1: 'Product', n: 'Products' },\n LOCATIONS: { 0: 'Locations', 1: 'Location', n: 'Locations' },\n GEOLOCATIONS: { 0: 'Geographic Locations', 1: 'Geographic Location', n: 'Geographic Locations' },\n TRANSPORTS: 'Transports',\n I18n: {\n editRepeat: '',\n createRepeat: '',\n deleteItem: '',\n agree: '',\n disagree: '',\n pickOne: '',\n pickOneOrMore: '',\n cancel: '',\n save: '',\n },\n OTHER: 'Other',\n TEXT: 'Text',\n};\n","import translate, { Options, Translate } from 'translate.js';\nimport { plural_EN } from 'translate.js/pluralize';\nimport { messages, messagesNL } from './lang';\nimport { I18n } from 'mithril-ui-form';\nimport stopwordsNl from 'stopwords-nl';\nimport stopwordsEn from 'stopwords-en';\n\nexport type Languages = 'nl' | 'en';\n\nconst setGuiLanguage = (language: Languages) => {\n const options = {\n // These are the defaults:\n debug: true, //[Boolean]: Logs missing translations to console and add \"@@\" around output, if `true`.\n array: true, //[Boolean]: Returns translations with placeholder-replacements as Arrays, if `true`.\n resolveAliases: true, //[Boolean]: Parses all translations for aliases and replaces them, if `true`.\n pluralize: plural_EN, //[Function(count)]: Provides a custom pluralization mapping function, should return a string (or number)\n useKeyForMissingTranslation: true, //[Boolean]: If there is no translation found for given key, the key is used as translation, when set to false, it returns undefiend in this case\n };\n return translate(language === 'nl' ? messagesNL : messages, options) as Translate;\n};\n\nexport type TextDirection = 'rtl' | 'ltr';\n\nexport type Locale = {\n /** Friendly name */\n name: string;\n /** Fully qualified name, e.g. 'en-UK' */\n fqn: string;\n /** Text direction: Left to right or right to left */\n dir?: TextDirection;\n /** Is the default language */\n default?: boolean;\n};\n\nexport type Locales = Record;\n\nexport type Listener = (locale: string, dir: TextDirection) => void;\n\nconst onChangeLocale: Listener[] = [];\n\nexport const i18n = {\n defaultLocale: 'en' as Languages,\n currentLocale: 'en' as Languages,\n locales: {} as Locales,\n init,\n addOnChangeListener,\n loadAndSetLocale,\n stopwords: [] as string[],\n};\n\nexport const I18N: I18n = {};\n\nexport let t: Translate = setGuiLanguage(i18n.currentLocale);\n\nasync function init(locales: Locales, selectedLocale: Languages) {\n i18n.locales = locales;\n const defaultLocale = (Object.keys(locales) as Languages[]).filter((l) => (locales[l] as Locale).default).shift();\n if (defaultLocale) {\n i18n.defaultLocale = defaultLocale || selectedLocale;\n }\n document.documentElement.setAttribute('lang', selectedLocale);\n await loadAndSetLocale(selectedLocale);\n}\n\nfunction addOnChangeListener(listener: Listener) {\n onChangeLocale.push(listener);\n}\n\nasync function loadAndSetLocale(newLocale: Languages) {\n if (i18n.currentLocale === newLocale) {\n return;\n }\n\n const resolvedLocale = supported(newLocale) ? newLocale : i18n.defaultLocale;\n i18n.currentLocale = resolvedLocale;\n i18n.stopwords = newLocale === 'nl' ? stopwordsNl : stopwordsEn;\n t = setGuiLanguage(newLocale);\n I18N.agree = t('I18n', 'agree');\n I18N.disagree = t('I18n', 'disagree');\n I18N.cancel = t('I18n', 'cancel');\n I18N.save = t('I18n', 'save');\n I18N.editRepeat = t('I18n', 'editRepeat');\n I18N.createRepeat = t('I18n', 'createRepeat');\n I18N.deleteItem = t('I18n', 'deleteItem');\n I18N.pickOne = t('I18n', 'pickOne');\n I18N.pickOneOrMore = t('I18n', 'pickOneOrMore');\n onChangeLocale.forEach((listener) => listener(i18n.currentLocale, dir()));\n}\n\nfunction supported(locale: Languages) {\n return Object.keys(i18n.locales).indexOf(locale) >= 0;\n}\n\nfunction dir(locale = i18n.currentLocale) {\n return (i18n.locales[locale] as Locale).dir || 'ltr';\n}\n","import { meiosisSetup } from 'meiosis-setup';\nimport { MeiosisCell, MeiosisConfig, Patch, Service } from 'meiosis-setup/types';\nimport m, { FactoryComponent } from 'mithril';\nimport { i18n, routingSvc, t } from '.';\nimport { CrimeScriptFilter, DataModel, FlexSearchResult, ID, Pages, SearchResult, Settings } from '../models';\nimport { User, UserRole } from './login-service';\nimport { aggregateFlexSearchResults, crimeScriptFilterToText, scrollToTop, tokenize } from '../utils';\nimport { flexSearchLookupUpdater } from './flex-search';\n\n// const settingsSvc = restServiceFactory('settings');\nconst MODEL_KEY = 'CSS_MODEL';\nconst USER_ROLE = 'USER_ROLE';\nexport const APP_TITLE = 'PAX - Crime Scripting';\n\nexport interface State {\n page: Pages;\n model: DataModel;\n locale: string;\n loggedInUser?: User;\n role: UserRole;\n settings: Settings;\n currentCrimeScriptId?: ID;\n curActIdx?: number;\n curPhaseIdx?: number;\n attributeFilter: string;\n searchFilter: string;\n searchResults: SearchResult[];\n caseFilter: string;\n caseResults: SearchResult[];\n crimeScriptFilter: CrimeScriptFilter;\n /** For finding search results */\n lookup: Map;\n}\n\nexport interface Actions {\n setPage: (page: Pages, info?: string) => void;\n changePage: (\n page: Pages,\n params?: Record,\n query?: Record\n ) => void;\n saveModel: (ds: DataModel) => void;\n saveSettings: (settings: Settings) => Promise;\n setRole: (role: UserRole) => void;\n login: () => void;\n update: (patch: Patch) => void;\n setSearchFilter: (searchFilter?: string) => Promise;\n setAttributeFilter: (searchFilter?: string) => Promise;\n setLocation: (currentCrimeScriptId: ID, actIdx: number, phaseIdx: number) => void;\n}\n\nexport type MeiosisComponent = FactoryComponent<{\n state: State;\n actions: Actions;\n options?: T;\n}>;\n\nexport const appActions: (cell: MeiosisCell) => Actions = ({ update /* states */ }) => ({\n // addDucks: (cell, amount) => {\n // cell.update({ ducks: (value) => value + amount });\n // },\n setPage: (page, info) => {\n document.title = `${APP_TITLE} | ${t(page as any, 'TITLE').replace('_', ' ')}${info ? ` | ${info}` : ''}`;\n // const curPage = states().page;\n // if (curPage === page) return;\n update({\n page: () => {\n scrollToTop();\n return page;\n },\n });\n },\n changePage: (page, params, query) => {\n routingSvc && routingSvc.switchTo(page, params, query);\n document.title = `${APP_TITLE} | ${page.replace('_', ' ')}`;\n update({ page });\n },\n saveModel: (model) => {\n model.lastUpdate = Date.now();\n model.version = model.version ? model.version++ : 1;\n localStorage.setItem(MODEL_KEY, JSON.stringify(model));\n console.log(JSON.stringify(model, null, 2));\n update({ model: () => model });\n },\n saveSettings: async (settings: Settings) => {\n // await settingsSvc.save(settings);\n update({\n settings: () => settings,\n });\n },\n setRole: (role) => {\n localStorage.setItem(USER_ROLE, role);\n update({ role });\n },\n login: () => {},\n update: (state) => update(state),\n setSearchFilter: async (searchFilter?: string) => {\n if (searchFilter) {\n // localStorage.setItem(SEARCH_FILTER_KEY, searchFilter);\n update({ searchFilter });\n } else {\n update({ searchFilter: undefined });\n }\n },\n setAttributeFilter: async (attributeFilter?: string) => {\n if (attributeFilter) {\n update({ attributeFilter });\n } else {\n update({ attributeFilter: undefined });\n }\n },\n setLocation: (currentCrimeScriptId, curActIdx, curPhaseIdx) => {\n update({ currentCrimeScriptId, curActIdx, curPhaseIdx });\n },\n});\n\nexport const setSearchResults: Service = {\n onchange: (state) => state.searchFilter,\n run: (cell) => {\n const state = cell.getState();\n const { lookup, searchFilter } = state;\n const allFlexResults: FlexSearchResult[] = [];\n if (searchFilter) {\n const searchWords = searchFilter.trim().toLowerCase().split(/\\s+/);\n searchWords\n .map((word) => lookup.get(word))\n .filter((results) => typeof results !== 'undefined')\n .forEach((results) => {\n results.forEach((res) => allFlexResults.push(res));\n });\n }\n const searchResults = aggregateFlexSearchResults(allFlexResults);\n\n cell.update({ searchResults });\n },\n};\n\nexport const setCaseSearchResults: Service = {\n onchange: (state) => state.caseFilter + JSON.stringify(state.crimeScriptFilter || {}),\n run: (cell) => {\n const state = cell.getState();\n const { lookup, caseFilter, crimeScriptFilter, model } = state;\n const { products = [], transports = [], attributes = [], geoLocations = [], locations = [], cast = [] } = model;\n const crimeScriptLabels = crimeScriptFilterToText(\n [...products, ...transports, ...attributes, ...geoLocations, ...locations, ...cast],\n crimeScriptFilter\n );\n console.log(`${crimeScriptLabels || ''} ${caseFilter || ''}`);\n const allFlexResults: FlexSearchResult[] = [];\n if (crimeScriptLabels || caseFilter) {\n const searchWords = tokenize(`${crimeScriptLabels || ''} ${caseFilter || ''}`, i18n.stopwords);\n searchWords\n .map((word) => lookup.get(word))\n .filter((results) => typeof results !== 'undefined')\n .forEach((results) => {\n results.forEach((res) => allFlexResults.push(res));\n });\n }\n const caseResults = aggregateFlexSearchResults(allFlexResults);\n\n cell.update({ caseResults });\n },\n};\n\nconst config: MeiosisConfig = {\n app: {\n initial: {\n page: Pages.HOME,\n loggedInUser: undefined,\n role: 'user',\n settings: {} as Settings,\n model: {} as DataModel,\n crimeScriptFilter: {} as CrimeScriptFilter,\n } as State,\n services: [setSearchResults, setCaseSearchResults, flexSearchLookupUpdater],\n },\n};\nexport const cells = meiosisSetup(config);\n\ncells.map(() => {\n // console.log('...redrawing');\n m.redraw();\n});\n\nconst loadData = async () => {\n const ds = localStorage.getItem(MODEL_KEY);\n const model: DataModel = ds ? JSON.parse(ds) : { crimeScripts: [] };\n const role = (localStorage.getItem(USER_ROLE) || 'user') as UserRole;\n // const settings = (await settingsSvc.loadList()).shift() || ({} as Settings);\n\n cells().update({\n role,\n model: () => model,\n // settings: () => settings,\n });\n};\nloadData();\n","import { Service } from 'meiosis-setup/types';\nimport { State } from './meiosis';\nimport { DataModel, FlexSearchResult, Hierarchical, ID, Labeled, SearchScore } from '../models';\nimport { i18n } from './translations';\nimport { tokenize } from '../utils';\n\n/**\n * A flexible search solution:\n *\n * Build an index where each word refers to one or more locations in a crime script. The locations are encoded with an array of tuples,\n * where each tuple represents a document location, and contains the following properties:\n * crime script idx (index), phase idx, act idx, score.\n *\n * The score represents the quality of the match:\n * - 3: for exact matching of any attribute or one of its synonyms (transport, product, crime attribute, location)\n * - 2: for exact matching of the parent of any attribute or one of its synonyms\n * - 1: for other matches, e.g. in the label or description.\n *\n * Every time the model is updated, recreate/update this index (depending on the speed).\n *\n * When labels or descriptions are added, first remove the stopwords for the current language model.\n *\n * For each crime script, add the label and description and map location(s).\n * For each stage, add each act\n * For each act, add the label and description, and the location(s)\n * For each activity, add the label, cast, transport, attributes.\n * If cast, transport, attributes have synonyms, add them too.\n * If cast, transport, attributes have parents, add them too, but with a lower score.\n * For each condition, add the label.\n *\n * When searching for words or a casus description, remove stopwords. Next.\n * For each word, look them up in the index and add them to the search result array.\n * The search result array is sorted;\n * - Highest scoring crime script idx\n * - Highest scoring stage/act idx\n */\nexport const flexSearchLookupUpdater: Service = {\n onchange: (state) => `${state.locale} - ${state.model.lastUpdate}`,\n run: (cell) => {\n const state = cell.getState();\n if (!state.locale) return;\n const { model = {} as DataModel } = state;\n const { crimeScripts = [], cast = [], attributes = [], acts = [], locations = [], transports = [] } = model;\n\n const itemLookup = [...cast, ...attributes, ...transports, ...locations].reduce(\n (acc, cur) => acc.set(cur.id, cur),\n new Map()\n );\n\n const lookup = new Map();\n\n const updateLookup = (word: string, res: FlexSearchResult) => {\n word = word.trim().toLowerCase();\n const found = lookup.get(word);\n if (found) {\n lookup.set(word, [...found, res]);\n } else {\n lookup.set(word, [res]);\n }\n };\n\n const processItemIds = (itemIds: ID[], res: FlexSearchResult, includeParents = true) => {\n itemIds\n .map((id) => itemLookup.get(id))\n .filter((item) => typeof item !== 'undefined')\n .forEach((item) => {\n updateLookup(item.label, res);\n item.synonyms?.forEach((syn) => updateLookup(syn, res));\n if (includeParents && item.parents)\n processItemIds(item.parents, [res[0], res[1], res[2], SearchScore.PARENT_MATCH] as FlexSearchResult, false);\n });\n };\n\n crimeScripts.forEach((crimeScript, crimeScriptIdx) => {\n const { label = '', description = '', stages: actVariants = [] } = crimeScript;\n const flexLoc: FlexSearchResult = [crimeScriptIdx, -1, -1, SearchScore.OTHER_MATCH];\n tokenize(label + ' ' + description, i18n.stopwords).forEach((word) => updateLookup(word, flexLoc));\n actVariants.forEach(({ ids }) => {\n ids.forEach((actId) => {\n const actIdx = acts.findIndex((a) => a.id === actId);\n if (actIdx < 0) return;\n const act = acts[actIdx];\n [act.preparation, act.preactivity, act.activity, act.postactivity].forEach((phase, phaseIdx) => {\n if (phase.locationIds && Array.isArray(phase.locationIds)) {\n processItemIds(phase.locationIds, [\n crimeScriptIdx,\n actIdx,\n phaseIdx,\n SearchScore.EXACT_MATCH,\n ] as FlexSearchResult);\n }\n const res: FlexSearchResult = [crimeScriptIdx, actIdx, phaseIdx, SearchScore.OTHER_MATCH];\n phase.activities?.forEach((activity) => {\n const { label = '', description = '', cast = [], attributes = [], transports = [] } = activity;\n tokenize(label + ' ' + description, i18n.stopwords).forEach((word) => updateLookup(word, res));\n const exactRes: FlexSearchResult = [crimeScriptIdx, actIdx, phaseIdx, SearchScore.EXACT_MATCH];\n processItemIds([...cast, ...attributes, ...transports], exactRes);\n });\n phase.conditions?.forEach((condition) => {\n const { label = '', description = '' } = condition;\n tokenize(label + ' ' + description, i18n.stopwords).forEach((word) => updateLookup(word, res));\n });\n });\n });\n });\n });\n cell.update({ lookup: () => lookup });\n },\n};\n","const t=[[/\\r\\n/g,\"\\n\"],[/\\n(#+)(.*)/g,(t,n,e=\"\")=>{const r=n.length;return`${e.trim()}`}],[/!\\[([^\\[]+)\\]\\((?:javascript:)?([^\\)]+)\\)/g,'\"$1\"'],[/\\[([^\\[]+)\\]\\((?:javascript:)?([^\\)]+)\\)/g,'
      $1'],[/([^\\\\])(\\*\\*|__)(.*?(_|\\*)?)\\2/g,\"$1$3\"],[/([^\\\\])(\\*|_)(.*?)\\2/g,\"$1$3\"],[/\\\\_/g,\"_\"],[/\\~\\~(.*?)\\~\\~/g,\"$1\"],[/\\:\\\"(.*?)\\\"\\:/g,\"$1\"],[/\\n\\s*```\\n([^]*?)\\n\\s*```\\s*\\n/g,\"\\n
      $1
      \"],[/`(.*?)`/g,(t,n)=>`${(t=>{t=t.replace(/\\&/g,\"&\");const n=\"'#<>`*-~_=:\\\"![]()nt\",e=n.length;for(let r=0;r`&#${t.charCodeAt(0)};`);return t})(n)}`],[/\\n(\\*|\\-|\\+)(.*)/g,(t,n,e=\"\")=>`
        \\n\\t
      • ${e.trim()}
      • \\n
      `],[/\\n[0-9]+\\.(.*)/g,(t,n=\"\")=>`
        \\n\\t
      1. ${n.trim()}
      2. \\n
      `],[/\\n(>|\\>)(.*)/g,(t,n,e=\"\")=>`\\n
      ${e.trim()}
      `],[/(\\^)(.*?)\\1/g,\"$2\"],[/(\\~)(.*?)\\1/g,\"$2\"],[/\\n-{5,}/g,\"\\n
      \"],[/( *\\|[^\\n]+\\|\\r?\\n)((?: *\\|:?[ -]+:?)+ *\\|)(\\n(?: *\\|[^\\n]+\\|\\r?\\n?)*)?/g,(t,n,e,r)=>{const l=e.split(\"|\").filter((t,n,e)=>n>0&&n/:-+:/g.test(t)?\"center\":/-+:/g.test(t)?\"right\":/:-+/.test(t)?\"left\":\"\"),g=t=>{const n=l[t];return n?` align=\"${n}\"`:\"\"};return`\\n${n.split(\"|\").map(t=>t.trim()).filter(t=>t&&t.length).map((t,n)=>`${t}`).join(\"\")}${r.split(\"\\n\").map(t=>t.trim()).filter(t=>t&&t.length).map(t=>`${t.split(\"|\").filter((t,n,e)=>n>0&&n`${t.trim()}`).join(\"\")}`).join(\"\")}
      \\n`}],[/\\n([^\\n]+)\\n/g,(t,n)=>{const e=n.trim();return/^<\\/?(ul|ol|li|h|p|bl|table|tr|td)/i.test(e)?`\\n${n}\\n`:`\\n

      \\n${e}\\n

      \\n`}],[/\\s?<\\/ul>\\s?