@mobiscroll/react-lite
Version:
React UI library for progressive web and hybrid apps
11 lines • 156 kB
JavaScript
/* eslint-disable */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-dom"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","react-dom","prop-types"],t):(e=e||self).mobiscroll=t(e.React,e.ReactDOM,e.PropTypes)}(this,function(x,i,e){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}function l(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function v(e,t){if(null==e)return{};var n,s,a={},i=Object.keys(e);for(s=0;s<i.length;s++)n=i[s],0<=t.indexOf(n)||(a[n]=e[n]);return a}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}x=x&&x.hasOwnProperty("default")?x.default:x,i=i&&i.hasOwnProperty("default")?i.default:i,e=e&&e.hasOwnProperty("default")?e.default:e;var t,n,s,a,ne,r,c,u,m,d,p,se=se||{},h={},f=[],y="undefined"!=typeof window,g=y&&window.matchMedia&&window.matchMedia("(prefers-color-scheme:dark)").matches,S=y?navigator.userAgent:"",w=y?navigator.platform:"",M=y?navigator.maxTouchPoints:0,_=/Safari/.test(S),k=S.match(/Android|iPhone|iPad|iPod|Windows Phone|Windows|MSIE/i),ae=y&&window.requestAnimationFrame||function(e){return setTimeout(e,20)};function C(e){var t;for(t in e)if(void 0!==r[e[t]])return 1}function q(e,t){if("touchstart"==e.type)t.__mbscTouched=1;else if(t.__mbscTouched)return delete t.__mbscTouched,!1;return!0}function ie(e,t,n,s){e&&e.addEventListener(t,n,s)}function oe(e,t,n,s){e&&e.removeEventListener(t,n,s)}function N(e,t){return!(!t||!e||1!==e.nodeType)&&(e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector).call(e,t)}function re(e,t,n){for(;t;){if(N(t,n))return t;t=t!==e?t.parentNode:null}return null}function D(e,t,n){var s;try{s=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0})}catch(e){(s=document.createEvent("Event")).initEvent(t,!0,!0),s.detail=n}e.dispatchEvent(s)}/Android/i.test(k)?(t="android",(n=S.match(/Android\s+([\d.]+)/i))&&(f=n[0].replace("Android ","").split("."))):/iPhone|iPad|iPod/i.test(k)||/iPhone|iPad|iPod/i.test(w)||"MacIntel"===w&&1<M?(t="ios",(n=S.match(/OS\s+([\d_]+)/i))&&(f=n[0].replace(/_/g,".").replace("OS ","").split("."))):/Windows Phone/i.test(k)?t="wp":/Windows|MSIE/i.test(k)&&(t="windows"),s=f[0],a=f[1],y&&(p=window,document.createElement("canvas"),r=document.createElement("modernizr").style,function(){var e,t=["Webkit","Moz","O","ms"];for(e in t)if(C([t[e]+"Transform"]))return"-"+t[e].toLowerCase()+"-";return""}().replace(/^-/,"").replace(/-$/,"").replace("moz","Moz"),ne=void 0!==r.animation?"animationend":"webkitAnimationEnd",u=void 0!==r.transition,d=(m="ios"===t&&!_)&&p.webkit&&p.webkit.messageHandlers,c=void 0===r.touchAction||m&&!d);var E={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},O={readonly:"readOnly"},A=[],P=Array.prototype.slice;function F(e){return"function"==typeof e}function L(e){return"object"==typeof e}function H(e){return"number"==typeof e.length}function z(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})}function I(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function V(e,t){return"number"!=typeof t||E[I(e)]?t:t+"px"}var j,U=(j=function e(t,n){var s,a,i,o=[],r=0;if(t&&!n&&t instanceof R)return t;if(F(t))return e(document).ready(t);if(t)if("string"==typeof t)if(t=i=t.trim(),0<=i.indexOf("<")&&0<=i.indexOf(">")){var l="div";for(0===i.indexOf("<li")&&(l="ul"),0===i.indexOf("<tr")&&(l="tbody"),0!==i.indexOf("<td")&&0!==i.indexOf("<th")||(l="tr"),0===i.indexOf("<tbody")&&(l="table"),0===i.indexOf("<option")&&(l="select"),(a=document.createElement(l)).innerHTML=i,r=0;r<a.childNodes.length;r++)o.push(a.childNodes[r])}else for(s=n||"#"!==t[0]||t.match(/[ .<>:~]/)?(n instanceof R&&(n=n[0]),(n||document).querySelectorAll(t)):[document.getElementById(t.split("#")[1])],r=0;r<s.length;r++)s[r]&&o.push(s[r]);else if(t.nodeType||t===window||t===document)o.push(t);else if(0<t.length&&t[0].nodeType)for(r=0;r<t.length;r++)o.push(t[r]);else e.isArray(t)&&(o=t);return new R(o)},R.prototype={ready:function(e){return(document.attachEvent?"complete"==document.readyState:"loading"!=document.readyState)?e(j):document.addEventListener("DOMContentLoaded",function(){e(j)},!1),this},concat:A.concat,empty:function(){return this.each(function(){this.innerHTML=""})},map:function(n){return j(j.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return j(P.apply(this,arguments))},addClass:function(e){if(void 0===e)return this;for(var t=e.split(" "),n=0;n<t.length;n++)for(var s=0;s<this.length;s++)void 0!==this[s].classList&&""!==t[n]&&this[s].classList.add(t[n]);return this},removeClass:function(e){if(void 0===e)return this;for(var t=e.split(" "),n=0;n<t.length;n++)for(var s=0;s<this.length;s++)void 0!==this[s].classList&&""!==t[n]&&this[s].classList.remove(t[n]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},toggleClass:function(e){for(var t=e.split(" "),n=0;n<t.length;n++)for(var s=0;s<this.length;s++)void 0!==this[s].classList&&this[s].classList.toggle(t[n]);return this},closest:function(e,t){var n=this[0],s=!1;for(L(e)&&(s=j(e));n&&!(s?0<=s.indexOf(n):N(n,e));)n=n!==t&&n.nodeType!==n.DOCUMENT_NODE&&n.parentNode;return j(n)},attr:function(e,t){var n;if(1!==arguments.length||"string"!=typeof e){for(var s=0;s<this.length;s++)if(2===arguments.length)this[s].setAttribute(e,t);else for(var a in e)this[s][a]=e[a],this[s].setAttribute(a,e[a]);return this}if(this.length)return n=this[0].getAttribute(e),n||""===n?n:void 0},removeAttr:function(e){for(var t=0;t<this.length;t++)this[t].removeAttribute(e);return this},prop:function(e,t){if(e=O[e]||e,1===arguments.length&&"string"==typeof e)return this[0]?this[0][e]:void 0;for(var n=0;n<this.length;n++)this[n][e]=t;return this},val:function(e){if(void 0===e)return this.length&&this[0].multiple?j.map(this.find("option:checked"),function(e){return e.value}):this[0]?this[0].value:void 0;if(this.length&&this[0].multiple)j.each(this[0].options,function(){this.selected=-1!=e.indexOf(this.value)});else for(var t=0;t<this.length;t++)this[t].value=e;return this},on:function(e,n,s,t){var a,i,o,r,l,c=e.split(" ");function u(e){for(var t=e.target;t;)j(t).is(n)&&s.call(t,e),t=t!==this?t.parentNode:null}function m(e,t,n,s){var a=t.split(".");e.DomNameSpaces||(e.DomNameSpaces=[]),e.DomNameSpaces.push({namespace:a[1],event:a[0],listener:n,capture:s}),e.addEventListener(a[0],n,s)}for(r=0;r<this.length;r++)if(i=this[r],F(n)||!1===n)for(F(n)&&(t=s||!1,s=n),l=0;l<c.length;l++)-1!=(o=c[l]).indexOf(".")?m(i,o,s,t):i.addEventListener(o,s,t);else for(a=u.bind(i),l=0;l<c.length;l++)o=c[l],i.DomLiveListeners||(i.DomLiveListeners=[]),i.DomLiveListeners.push({listener:s,liveListener:a}),-1!=o.indexOf(".")?m(i,o,a,t):i.addEventListener(o,a,t);return this},off:function(e,t,n,s){var a,i,o,r,l,c,u,m=this;function d(e){var t,n,s,a,i,o=e.split("."),r=o[0],l=o[1];for(n=0;n<m.length;++n)if(i=(t=m[n]).DomNameSpaces){for(s=0;s<i.length;++s)(a=i[s]).namespace!=l||a.event!=r&&r||(t.removeEventListener(a.event,a.listener,a.capture),a.removed=!0);for(s=i.length-1;0<=s;--s)i[s].removed&&i.splice(s,1)}}for(o=e.split(" "),r=0;r<o.length;r++)for(i=o[r],l=0;l<this.length;l++)if(u=(a=this[l]).DomLiveListeners,F(t)||!1===t)F(t)&&(s=n||!1,n=t),0===i.indexOf(".")?d(i.substr(1)):a.removeEventListener(i,n,s);else{if(u)for(c=0;c<u.length;c++)u[c].listener===n&&a.removeEventListener(i,u[c].liveListener,s);a.DomNameSpaces&&a.DomNameSpaces.length&&i&&d(i)}return this},trigger:function(e,t){for(var n=e.split(" "),s=0;s<n.length;s++)for(var a=0;a<this.length;a++)D(this[a],n[s],t);return this},width:function(e){return void 0!==e?this.css("width",e):this[0]===window?window.innerWidth:this[0]===document?document.documentElement.scrollWidth:0<this.length?parseFloat(this.css("width")):null},height:function(e){if(void 0!==e)return this.css("height",e);if(this[0]===window)return window.innerHeight;if(this[0]!==document)return 0<this.length?parseFloat(this.css("height")):null;var t=document.body,n=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)},innerWidth:function(){var t=this;if(0<this.length){if(this[0].innerWidth)return this[0].innerWidth;var n=this[0].offsetWidth;return["left","right"].forEach(function(e){n-=parseInt(t.css(z("border-"+e+"-width"))||0,10)}),n}},innerHeight:function(){var t=this;if(0<this.length){if(this[0].innerHeight)return this[0].innerHeight;var n=this[0].offsetHeight;return["top","bottom"].forEach(function(e){n-=parseInt(t.css(z("border-"+e+"-width"))||0,10)}),n}},offset:function(){if(0<this.length){var e=this[0].getBoundingClientRect(),t=document.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}},hide:function(){for(var e=0;e<this.length;e++)this[e].style.display="none";return this},show:function(){for(var e=0;e<this.length;e++)"none"==this[e].style.display&&(this[e].style.display=""),"none"==getComputedStyle(this[e],"").getPropertyValue("display")&&(this[e].style.display="block");return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},styles:function(){return this[0]?window.getComputedStyle(this[0],null):void 0},css:function(e,t){var n,s,a=this[0],i="";if(arguments.length<2){if(!a)return;if("string"==typeof e)return a.style[e]||getComputedStyle(a,"").getPropertyValue(e)}if("string"==typeof e)t||0===t?i=I(e)+":"+V(e,t):this.each(function(){this.style.removeProperty(I(e))});else for(s in e)if(e[s]||0===e[s])i+=I(s)+":"+V(s,e[s])+";";else for(n=0;n<this.length;n++)this[n].style.removeProperty(I(s));return this.each(function(){this.style.cssText+=";"+i})},each:function(e){for(var t=0;t<this.length&&!1!==e.apply(this[t],[t,this[t]]);t++);return this},filter:function(e){for(var t=[],n=0;n<this.length;n++)F(e)?e.call(this[n],n,this[n])&&t.push(this[n]):N(this[n],e)&&t.push(this[n]);return new R(t)},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:void 0;this.empty();for(var t=0;t<this.length;t++)this[t].innerHTML=e;return this},text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t++)this[t].textContent=e;return this},is:function(e){return 0<this.length&&N(this[0],e)},not:function(t){var n=[];if(F(t)&&void 0!==t.call)this.each(function(e){t.call(this,e)||n.push(this)});else{var s="string"==typeof t?this.filter(t):H(t)&&F(t.item)?P.call(t):j(t);L(s)&&(s=j.map(s,function(e){return e})),this.each(function(e,t){s.indexOf(t)<0&&n.push(t)})}return j(n)},indexOf:function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t},index:function(e){return e?this.indexOf(j(e)[0]):this.parent().children().indexOf(this[0])},get:function(e){return void 0===e?P.call(this):this[0<=e?e:e+this.length]},eq:function(e){if(void 0===e)return this;var t,n=this.length;return new R(n-1<e?[]:e<0?(t=n+e)<0?[]:[this[t]]:[this[e]])},append:function(e){var t,n;for(t=0;t<this.length;t++)if("string"==typeof e){var s=document.createElement("div");for(s.innerHTML=e;s.firstChild;)this[t].appendChild(s.firstChild)}else if(e instanceof R)for(n=0;n<e.length;n++)this[t].appendChild(e[n]);else this[t].appendChild(e);return this},appendTo:function(e){return j(e).append(this),this},prepend:function(e){var t,n;for(t=0;t<this.length;t++)if("string"==typeof e){var s=document.createElement("div");for(s.innerHTML=e,n=s.childNodes.length-1;0<=n;n--)this[t].insertBefore(s.childNodes[n],this[t].childNodes[0])}else if(e instanceof R)for(n=0;n<e.length;n++)this[t].insertBefore(e[n],this[t].childNodes[0]);else this[t].insertBefore(e,this[t].childNodes[0]);return this},prependTo:function(e){return j(e).prepend(this),this},insertBefore:function(e){for(var t=j(e),n=0;n<this.length;n++)if(1===t.length)t[0].parentNode.insertBefore(this[n],t[0]);else if(1<t.length)for(var s=0;s<t.length;s++)t[s].parentNode.insertBefore(this[n].cloneNode(!0),t[s]);return this},insertAfter:function(e){for(var t=j(e),n=0;n<this.length;n++)if(1===t.length)t[0].parentNode.insertBefore(this[n],t[0].nextSibling);else if(1<t.length)for(var s=0;s<t.length;s++)t[s].parentNode.insertBefore(this[n].cloneNode(!0),t[s].nextSibling);return this},next:function(e){return 0<this.length?e?this[0].nextElementSibling&&j(this[0].nextElementSibling).is(e)?new R([this[0].nextElementSibling]):new R([]):this[0].nextElementSibling?new R([this[0].nextElementSibling]):new R([]):new R([])},nextAll:function(e){var t=[],n=this[0];if(!n)return new R([]);for(;n.nextElementSibling;){var s=n.nextElementSibling;e?j(s).is(e)&&t.push(s):t.push(s),n=s}return new R(t)},prev:function(e){return 0<this.length?e?this[0].previousElementSibling&&j(this[0].previousElementSibling).is(e)?new R([this[0].previousElementSibling]):new R([]):this[0].previousElementSibling?new R([this[0].previousElementSibling]):new R([]):new R([])},prevAll:function(e){var t=[],n=this[0];if(!n)return new R([]);for(;n.previousElementSibling;){var s=n.previousElementSibling;e?j(s).is(e)&&t.push(s):t.push(s),n=s}return new R(t)},parent:function(e){for(var t=[],n=0;n<this.length;n++)null!==this[n].parentNode&&(e?j(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return j(j.unique(t))},parents:function(e){for(var t=[],n=0;n<this.length;n++)for(var s=this[n].parentNode;s;)e?j(s).is(e)&&t.push(s):t.push(s),s=s.parentNode;return j(j.unique(t))},find:function(e){for(var t=[],n=0;n<this.length;n++)for(var s=this[n].querySelectorAll(e),a=0;a<s.length;a++)t.push(s[a]);return new R(t)},children:function(e){for(var t=[],n=0;n<this.length;n++)for(var s=this[n].childNodes,a=0;a<s.length;a++)e?1===s[a].nodeType&&j(s[a]).is(e)&&t.push(s[a]):1===s[a].nodeType&&t.push(s[a]);return new R(j.unique(t))},remove:function(){for(var e=0;e<this.length;e++)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},add:function(){var e,t;for(e=0;e<arguments.length;e++){var n=j(arguments[e]);for(t=0;t<n.length;t++)this[this.length]=n[t],this.length++}return this},before:function(e){return j(e).insertBefore(this),this},after:function(e){return j(e).insertAfter(this),this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return void 0===e?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return void 0===e?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},contents:function(){return this.map(function(e,t){return P.call(t.childNodes)})},nextUntil:function(e){for(var t=this,n=[];t.length&&!t.filter(e).length;)n.push(t[0]),t=t.next();return j(n)},prevUntil:function(e){for(var t=this,n=[];t.length&&!j(t).filter(e).length;)n.push(t[0]),t=t.prev();return j(n)},detach:function(){return this.remove()}},j.fn=R.prototype,j);function R(e){var t=0;for(t=0;t<e.length;t++)this[t]=e[t];return this.length=e.length,j(this)}var J=U;function le(){}function ce(e){return"string"==typeof e}function ue(e,t,n){return Math.max(t,Math.min(e,n))}function X(e,t,n){return 100*(e-t)/(n-t)}function $(e,t,n){var s=n.attr(e);return void 0===s||""===s?t:"true"===s}se.$=U,J.inArray=function(e,t,n){return A.indexOf.call(t,e,n)},J.extend=function(t){var n,e=P.call(arguments,1);return"boolean"==typeof t&&(n=t,t=e.shift()),t=t||{},e.forEach(function(e){!function e(t,n,s){for(var a in n)s&&(J.isPlainObject(n[a])||J.isArray(n[a]))?((J.isPlainObject(n[a])&&!J.isPlainObject(t[a])||J.isArray(n[a])&&!J.isArray(t[a]))&&(t[a]={}),e(t[a],n[a],s)):void 0!==n[a]&&(t[a]=n[a])}(t,e,n)}),t},J.isFunction=F,J.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},J.isPlainObject=function(e){return L(e)&&null!==e&&e!==e.window&&Object.getPrototypeOf(e)==Object.prototype},J.each=function(e,t){var n,s;if(L(e)&&t){if(J.isArray(e)||e instanceof U)for(n=0;n<e.length&&!1!==t.call(e[n],n,e[n]);n++);else for(s in e)
// eslint-disable-next-line no-prototype-builtins
if(e.hasOwnProperty(s)&&"length"!==s&&!1===t.call(e[s],s,e[s]))break;return this}},J.unique=function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t},J.map=function(e,t){var n,s,a,i=[];if(H(e))for(s=0;s<e.length;s++)null!==(n=t(e[s],s))&&i.push(n);else for(a in e)null!==(n=t(e[a],a))&&i.push(n);return 0<i.length?J.fn.concat.apply([],i):i};var K,B=0;function me(){B++,setTimeout(function(){B--},500)}function W(e,t){if(!t.mbscClick){var n=(e.originalEvent||e).changedTouches[0],s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),s.isMbscTap=!0,s.isIonicTap=!0,K=!0,t.mbscChange=!0,t.mbscClick=!0,t.dispatchEvent(s),K=!1,me(),setTimeout(function(){delete t.mbscClick})}}function de(e,t,n){var s=e.originalEvent||e,a=(n?"page":"client")+t;return s.targetTouches&&s.targetTouches[0]?s.targetTouches[0][a]:s.changedTouches&&s.changedTouches[0]?s.changedTouches[0][a]:e[a]}function Y(e){var t=["switch","range","rating","segmented","stepper"],n=e[0],s=e.attr("data-role"),a=e.attr("type")||n.nodeName.toLowerCase();if(/(switch|range|rating|segmented|stepper|select)/.test(s))a=s;else for(var i=0;i<t.length;i++)e.is("[mbsc-"+t[i]+"]")&&(a=t[i]);return a}function G(n,e,t,s,a,i){var o,r,l,c,u,m=(0,se.$)(e);function d(e){l||(l=this,o=de(e,"X"),r=de(e,"Y"),c=!1,u=new Date)}function p(e){l&&!c&&(Math.abs(de(e,"X")-o)>a||Math.abs(de(e,"Y")-r)>a)&&(c=!0)}function h(e){l&&(i&&new Date-u<100||!c?W(e,e.target):me(),l=!1)}function f(e){s&&e.preventDefault(),t.call(this,e,n)}function T(){l=!1}a=a||9,m.each(function(e,t){n.settings.tap&&(ie(t,"touchstart",d,{passive:!0}),ie(t,"touchcancel",T),ie(t,"touchmove",p,{passive:!0}),ie(t,"touchend",h)),ie(t,"click",f),t.__mbscOff=function(){oe(t,"touchstart",d,{passive:!0}),oe(t,"touchcancel",T),oe(t,"touchmove",p,{passive:!0}),oe(t,"touchend",h),oe(t,"click",f),delete t.__mbscOff}})}function pe(e){e&&e[0]&&e[0].__mbscOff&&e[0].__mbscOff()}function Z(e){if(B&&!K&&!e.isMbscTap&&("TEXTAREA"!=e.target.nodeName||"mousedown"!=e.type))return e.stopPropagation(),e.preventDefault(),!1}function Q(e){var t=e.theme,n=e.themeVariant;return"auto"!=t&&t||(t=te.autoTheme),"default"==t&&(t="mobiscroll"),("dark"===n||g&&"auto"===n)&&te.themes.form[t+"-dark"]?t+="-dark":"light"===n&&/.+-dark$/.test(t)&&(t=t.replace(/-dark$/,"")),t}function ee(n,s,e){y&&he(function(){he(n).each(function(){new s(this,{})}),he(document).on("mbsc-enhance",function(e,t){he(e.target).is(n)?new s(e.target,t||{}):he(n,e.target).each(function(){new s(this,t||{})})}),e&&he(document).on("mbsc-refresh",function(e){var t;he(e.target).is(n)?(t=Te[e.target.id])&&t.refresh():he(n,e.target).each(function(){(t=Te[this.id])&&t.refresh()})})})}y&&(["mouseover","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,Z,!0)}),"android"==t&&s<5&&document.addEventListener("change",function(e){B&&"checkbox"==e.target.type&&!e.target.mbscChange&&(e.stopPropagation(),e.preventDefault()),delete e.target.mbscChange},!0));var te,he=se.$,fe=+new Date,Te={},xe={},be={},ve={xsmall:0,small:576,medium:768,large:992,xlarge:1200},ye=he.extend;ye(h,{getCoord:de,preventClick:me,vibrate:function(e){"vibrate"in navigator&&navigator.vibrate(e||50)}}),te=ye(se,{$:he,version:"4.10.9",autoTheme:"mobiscroll",themes:{form:{},page:{},frame:{},scroller:{},listview:{},navigation:{},progress:{},card:{}},platform:{name:t,majorVersion:s,minorVersion:a},i18n:{},instances:Te,classes:xe,util:h,settings:{},setDefaults:function(e){ye(this.settings,e)},customTheme:function(e,t){var n,s=se.themes,a=["frame","scroller","listview","navigation","form","page","progress","card"];for(n=0;n<a.length;n++)s[a[n]][e]=ye({},s[a[n]][t],{baseTheme:t})}});function ge(o,r){var a,i,l,c,u,m,d,p,h,f=this;function T(e){var n,t,s=be;return u.responsive&&(n=e||((t=a)[0].innerWidth||t.innerWidth()),he.each(u.responsive,function(e,t){n>=(t.breakpoint||ve[e])&&(s=t)})),s}f.settings={},f.element=o,f._init=le,f._destroy=le,f._processSettings=le,f._checkResp=function(e){if(f&&f._responsive){var t=T(e);if(c!==t)return c=t,f.init({}),!0}},f._getRespCont=function(){return he("body"==u.context?window:u.context)},f.init=function(e,t){var n,s;for(n in e&&f.getVal&&(s=f.getVal()),f.settings)delete f.settings[n];u=f.settings,ye(r,e),f._hasDef&&(h=te.settings),ye(u,f._defaults,h,r),a=f._getRespCont(),f._responsive&&(c=c||T(),ye(u,c)),f._hasTheme&&(d=Q(u),r.theme=d,m=te.themes[f._class]?te.themes[f._class][d]:{}),f._hasLang&&(i=te.i18n[u.lang]),ye(u,m,i,h,r,c),f._processSettings(c||{}),f._presets&&(l=f._presets[u.preset])&&(l=l.call(o,f,r,c),ye(u,l,r,c)),f._init(e),e&&f.setVal&&f.setVal(void 0===t?s:t,!0),p("onInit")},f.destroy=function(){f&&(f._destroy(),p("onDestroy"),delete Te[o.id],f=null)},f.tap=function(e,t,n,s,a){G(f,e,t,n,s,a)},f.trigger=function(e,t){var n,s,a,i=[h,m,l,r];for(s=0;s<4;s++)(a=i[s])&&a[e]&&(n=a[e].call(o,t||{},f));return n},f.option=function(e,t,n){var s={},a=["data","invalid","valid","readonly"];/calendar|eventcalendar|range/.test(u.preset)&&a.push("marked","labels","colors"),"object"==typeof e?s=e:s[e]=t,a.forEach(function(e){r[e]=u[e]}),f.init(s,n)},f.getInst=function(){return f},r=r||{},p=f.trigger,f.__ready||(he(o).addClass("mbsc-comp"),o.id?Te[o.id]&&Te[o.id].destroy():o.id="mobiscroll"+ ++fe,(Te[o.id]=f).__ready=!0)}var Se=e.bool,we=e.string,Me=e.func,_e=e.number,ke=e.object,Ce=e.oneOfType([ke,we]),Ne=e.oneOfType([_e,e.arrayOf(_e)]),De={theme:we,themeVariant:e.oneOf(["auto","dark","light"]),lang:we,rtl:Se,responsive:ke,context:e.oneOfType([we,ke])},Ee={anchor:e.oneOfType([we,ke]),animate:e.oneOfType([Se,e.oneOf(["fade","flip","pop","swing","slidevertical","slidehorizontal","slidedown","slideup"])]),buttons:e.array,closeOnOverlayTap:Se,cssClass:we,disabled:Se,display:e.oneOf(["top","bottom","bubble","inline","center"]),focusOnClose:e.oneOfType([Se,we,ke]),focusTrap:Se,headerText:e.oneOfType([Se,we,Me]),layout:e.oneOf(["liquid","fixed"]),scrollLock:Se,showOnFocus:Se,showOnTap:Se,showOnOverlay:Se,touchUi:Se,onBeforeClose:Me,onBeforeShow:Me,onCancel:Me,onClose:Me,onDestroy:Me,onMarkupReady:Me,onPosition:Me,onShow:Me},Oe={circular:e.oneOfType([Se,e.arrayOf(Se)]),height:_e,maxWidth:Ne,minWidth:Ne,multiline:_e,readonly:e.oneOfType([Se,e.arrayOf(Se)]),rows:_e,showLabel:Se,showScrollArrows:Se,wheels:e.array,width:_e,onChange:Me,validate:Me,onSet:Me,onItemTap:Me,onClear:Me,cancelText:we,clearText:we,selectedText:we,setText:we,formatValue:Me,parseValue:Me};e.array,e.oneOf(["iso8601","moment","locale","jsdate"]),e.shape({hour:_e,minute:_e,second:_e,zeroBased:Se}),e.array,e.oneOf(["jalali","hijri","gregorian"]),e.arrayOf(we),e.arrayOf(we),e.arrayOf(we),e.arrayOf(we),e.oneOf(["horizontal","vertical"]),e.oneOfType([Ce,e.array]),e.arrayOf(e.shape({start:Ce,end:Ce,d:e.oneOfType([ke,_e,we]),text:we,color:we,background:we,cssClass:we})),e.arrayOf(e.shape({start:Ce,end:Ce,d:e.oneOfType([ke,_e,we]),text:we,color:we,background:we,cssClass:we})),e.arrayOf(e.oneOfType([ke,_e,we,e.shape({d:e.oneOfType([ke,we,_e]),color:we,background:we,cssClass:we})])),e.arrayOf(e.shape({d:e.oneOfType([ke,we,_e]),background:we,cssClass:we})),e.oneOf(["year","month"]),e.oneOf(["full","short","min"]),e.arrayOf(we),e.arrayOf(we);function Ae(e,t){var n=i.findDOMNode(this),s=e.replace(/\s+/g," ").trim(),a=t.replace(/\s+/g," ").trim();s&&n.classList.remove.apply(n.classList,s.split(" ")),a&&n.classList.add.apply(n.classList,a.split(" "))}function Pe(e,t){var o=[],r=[];return function e(t,n,s){var a;if(isNaN(t)&&isNaN(n)&&"number"==typeof t&&"number"==typeof n)return!0;if(t===n)return!0;if("function"==typeof t&&"function"==typeof n)return!1;if(t instanceof Date&&n instanceof Date||t instanceof RegExp&&n instanceof RegExp||t instanceof String&&n instanceof String||t instanceof Number&&n instanceof Number)return t.toString()===n.toString();if(!(t instanceof Object&&n instanceof Object))return!1;// eslint-disable-next-line no-prototype-builtins
if(t.isPrototypeOf(n)||n.isPrototypeOf(t))return!1;if(t.constructor!==n.constructor)return!1;if(t.prototype!==n.prototype)return!1;if(-1<o.indexOf(t)||-1<r.indexOf(n))return!1;for(a in n){
// eslint-disable-next-line no-prototype-builtins
if(n.hasOwnProperty(a)!==t.hasOwnProperty(a))return!1;if(typeof n[a]!=typeof t[a])return!1}var i=s?{$$typeof:1,key:1,props:1,ref:1,type:1}:t;for(a in i){
// eslint-disable-next-line no-prototype-builtins
if(n.hasOwnProperty(a)!==t.hasOwnProperty(a))return!1;if(typeof n[a]!=typeof t[a])return!1;switch(typeof t[a]){case"object":case"function":if(o.push(t),r.push(n),!e(t[a],n[a],t[a]&&void 0!==t[a].$$typeof))return!1;o.pop(),r.pop();break;default:if(t[a]!==n[a])return!1}}return!0}(e,t)}var Fe=function(n){function e(e){var t;return(t=n.call(this,e)||this).initialCssClass=t.props.className||"",t}l(e,n);var t=e.prototype;return t.render=function(){return null},t.getSettingsFromProps=function(e,t){var n={};if(void 0!==e){
/* eslint-disable no-unused-vars */
var s=e.options,a=(e.children,e.value,e.checked,e.data,e.className,v(e,["options","children","value","checked","data","className"])),i=s||"{}";n=s||{},void 0!==s&&"string"==typeof i&&(n=new Function("return "+i+";")()),n=ye({},n,a,t||{})}return n},t.componentWillUnmount=function(){this.instance.destroy(),delete this.instance},e}(x.Component),Le=function(n){function e(e){var t;return(t=n.call(this,e)||this).updateForIonInput=t.updateForIonInput.bind(T(t)),t}l(e,n);var t=e.prototype;return t.updateForIonInput=function(){this.valueState&&(this.optimizeUpdate=null,this.forceUpdate())},t.isIonInput=function(e){return e&&1==x.Children.count(e)&&e.type&&e.type.render&&"IonInput"===e.type.render.displayName},t.componentDidUpdate=function(){var e=this.getSettingsFromProps(this.props);this.optimizeUpdate?(this.optimizeUpdate.updateOptions&&this.instance.option(e),this.optimizeUpdate.updateValue&&void 0!==this.props.value&&!Pe(this.props.value,this.instance.getVal())&&this.instance.setVal(this.props.value,!0),this.updateForIonInput()):null!==this.optimizeUpdate&&(this.instance.option(e),void 0!==this.props.value&&this.instance.setVal(this.props.value,!0))},e}(Fe),He=function(t){function e(e){return t.call(this,e)||this}return l(e,t),e.prototype.shouldComponentUpdate=function(e){var t=!Pe(this.getSettingsFromProps(e),this.getSettingsFromProps(this.props)),n=!Pe(e.value,this.props.value),s=!Pe(e.children,this.props.children);return this.optimizeUpdate={updateOptions:t,updateValue:n,updateChildren:s},t||n||s},e}(Le),ze=function(a){function e(){for(var t,e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return o(T(t=a.call.apply(a,[this].concat(n))||this),"element",null),o(T(t),"inputCheckCount",0),o(T(t),"startInit",function(){t.element=i.findDOMNode(T(t));var e=he(t.element).find("input");e.length&&(t.element=e[0]),t.inputCheckCount++,!t.isIonInput(t.props.children)||e.length||17<t.inputCheckCount?t.initInstance():setTimeout(t.startInit,30)}),o(T(t),"initInstance",function(){var e=t.getSettingsFromProps(t.props,t.mbscInit);t.instance=new xe[t.mbscInit.component||"Scroller"](t.element,e),void 0!==t.props.value&&(t.instance.setVal(t.props.value,!0),t.updateForIonInput())}),t}l(e,a);var t=e.prototype;return t.render=function(){var e=this.props,t=e.type,n=e.readOnly,s=e.disabled,a=e.placeholder,i=e.children;if(t=t||"text",this.isIonInput(i)){this.valueState=!0;var o=this.instance?this.instance._value:"";return x.cloneElement(i,b({value:o},i.props))}return i?this.props.children:x.createElement("input",{className:this.initialCssClass,type:t,readOnly:n,disabled:s,placeholder:a})},t.componentDidMount=function(){this.startInit()},e}(He);o(ze,"propTypes",b({},De,{},Ee,{type:e.string,placeholder:e.string})),o(function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.render=function(){return x.createElement("ul",{className:this.initialCssClass+" mbsc-cloak"},this.props.children)},n.componentDidMount=function(){var e=this.getSettingsFromProps(this.props,this.mbscInit),t=i.findDOMNode(this);this.instance=new xe[this.mbscInit.component||"Scroller"](t,e),void 0!==this.props.value&&this.instance.setVal(this.props.value,!0),(this.instance._markup||he(t)).on("click",function(e){e.stopPropagation()})},n.componentDidUpdate=function(){!this.optimizeUpdate.updateOptions&&this.optimizeUpdate.updateChildren&&this.instance.option(this.getSettingsFromProps(this.props));var e=i.findDOMNode(this);(this.instance._markup||he(e)).on("click",function(e){e.stopPropagation()})},t}(He),"propTypes",b({},De,{},Ee,{},Oe));var Ie,Ve="mbsc-input-wrap",je=["touchend","touchcancel","mousedown","mousemove","mouseup","mouseleave"],Ue={tap:c};function Re(e,t){var n={},s=e[0],a=e.parent(),i=a.find(".mbsc-err-msg"),o=e.attr("data-icon-align")||"left",r=e.attr("data-icon");a.hasClass(Ve)?a=a.parent():he('<span class="'+Ve+'"></span>').insertAfter(e).append(e),i&&a.find("."+Ve).append(i),r&&(-1!==r.indexOf("{")?n=JSON.parse(r):n[o]=r),"file"==s.type&&(n.right=e.attr("data-icon-upload")||"upload"),(r||t)&&(ye(n,t),a.addClass((n.right?"mbsc-ic-right ":"")+(n.left?" mbsc-ic-left":"")).find("."+Ve).append('<span class="mbsc-input-fill"></span>').append(n.left?'<span class="mbsc-input-ic mbsc-left-ic mbsc-ic mbsc-ic-'+n.left+'"></span>':"").append(n.right?'<span class="mbsc-input-ic mbsc-right-ic mbsc-ic mbsc-ic-'+n.right+'"></span>':""))}function Je(e,t,n,s,a){"segmented"==t?e.closest(".mbsc-segmented").addClass("box"==n?"mbsc-input-box":"").addClass("outline"==n?"mbsc-input-outline":""):"button"!=t&&"submit"!=t&&(e.addClass("mbsc-control-w").addClass("box"==n?"mbsc-input-box":"").addClass("outline"==n?"mbsc-input-outline":"").addClass("inline"==s?"mbsc-label-inline":"").addClass("stacked"==s?"mbsc-label-stacked":"").addClass("floating"==s?"mbsc-label-floating":"").addClass("floating"==s&&a.value?"mbsc-label-floating-active":"").find("label").addClass("mbsc-label").each(function(e,t){he(t).attr("title",he(t).text())}),e.contents().filter(function(){return 3==this.nodeType&&this.nodeValue&&/\S/.test(this.nodeValue)}).each(function(){he('<span class="mbsc-label" title="'+this.textContent.trim()+'"></span>').insertAfter(this).append(this)}))}function $e(e){var t=se.themes.form[e];return t&&t.addRipple?t:null}function Ke(e,t,n){var s=e.attr(t);return void 0===s||""===s?n:s}function Be(e){var t=Q(e),n=se.themes.form[t].baseTheme;return"mbsc-"+t+(n?" mbsc-"+n:"")+(e.rtl?" mbsc-rtl":" mbsc-ltr")}var We=function(){function e(e,t){var n=this,s=ye({},Ue,se.settings,t),a=he(e),i=a.parent(),o=i.hasClass("mbsc-input-wrap")?i.parent():i,r=a.next().hasClass("mbsc-fr")?a.next():null,l=Y(a),c=Ke(a,"data-input-style",s.inputStyle),u=Ke(a,"data-label-style",s.labelStyle);e.mbscInst&&e.mbscInst.destroy(),r&&r.insertAfter(o),s.theme=Q(s),void 0===s.rtl&&s.lang&&se.i18n[s.lang]&&(s.rtl=se.i18n[s.lang].rtl),Je(o,l,c,u,e),a.addClass("mbsc-control"),this._handle=this._handle.bind(this),je.forEach(function(e){a.on(e,n._handle)}),ie(e,"touchstart",this._handle,{passive:!0}),ie(e,"touchmove",this._handle,{passive:!0}),this.settings=s,this._type=l,this._elm=e,this._$elm=a,this._$parent=o,this._$frame=r,this._ripple=$e(s.theme),this._isFloating="floating"==u||o.hasClass("mbsc-label-floating"),this.cssClass=Be(s),this.getClassElm().addClass(this.cssClass),e.mbscInst=this}var t=e.prototype;return t.getClassElm=function(){return this._$parent},t.destroy=function(){var t=this,n=this._$elm,e=this._elm;n.removeClass("mbsc-control"),this.getClassElm().removeClass(this.cssClass),je.forEach(function(e){n.off(e,t._handle)}),oe(e,"touchstart",this._handle,{passive:!0}),oe(e,"touchmove",this._handle,{passive:!0}),delete e.mbscInst},t.option=function(e){ye(this.settings,e);var t=this.getClassElm();this.cssClass&&t.removeClass(this.cssClass),this.cssClass=Be(this.settings),t.addClass(this.cssClass),this._ripple=$e(this.settings.theme)},t._handle=function(e){switch(e.type){case"touchstart":case"mousedown":this._onStart(e);break;case"touchmove":case"mousemove":this._onMove(e);break;case"touchend":case"touchcancel":case"mouseup":case"mouseleave":this._onEnd(e)}},t._addRipple=function(e){this._ripple&&this._$rippleElm&&this._ripple.addRipple(this._$rippleElm,e)},t._removeRipple=function(){this._ripple&&this._$rippleElm&&this._ripple.removeRipple()},t._onStart=function(e){var t=this._elm;q(e,t)&&(this._startX=de(e,"X"),this._startY=de(e,"Y"),Ie&&Ie.removeClass("mbsc-active"),t.disabled||(this._isActive=!0,(Ie=this._$elm).addClass("mbsc-active"),this._addRipple(e))),"touchstart"==e.type&&this._$elm.closest(".mbsc-no-touch").removeClass("mbsc-no-touch")},t._onMove=function(e){(this._isActive&&9<Math.abs(de(e,"X")-this._startX)||9<Math.abs(de(e,"Y")-this._startY))&&(this._$elm.removeClass("mbsc-active"),this._removeRipple(),this._isActive=!1)},t._onEnd=function(e){var t,n,s,a=this,i=this._elm,o=this._type;this._isActive&&this.settings.tap&&"touchend"==e.type&&!i.readOnly&&(n=o,s=e,(t=i).focus(),/(button|submit|checkbox|switch|radio)/.test(n)&&s.preventDefault(),/select/.test(n)||W(s,t)),this._isActive&&setTimeout(function(){a._$elm.removeClass("mbsc-active"),a._removeRipple()},100),this._isActive=!1,Ie=null},e}();se.themes.form.mobiscroll={};var Ye=["focus","change","blur","animationstart"],Ge=function(f){function e(e,t){var n,s,a,i,o,r,l,c,u,m=(n=f.call(this,e,t)||this)._$elm,d=n._$parent,p=d.find(".mbsc-select-input, .mbsc-color-input");if(s=T(n),a=d,o={},r=(i=m)[0],l=i.attr("data-password-toggle"),c=i.attr("data-icon-show")||"eye",u=i.attr("data-icon-hide")||"eye-blocked",l&&(o.right="password"==r.type?c:u),Re(i,o),l&&G(s,a.find(".mbsc-right-ic").addClass("mbsc-input-toggle"),function(){"text"==r.type?(r.type="password",he(this).addClass("mbsc-ic-"+c).removeClass("mbsc-ic-"+u)):(r.type="text",he(this).removeClass("mbsc-ic-"+c).addClass("mbsc-ic-"+u))}),n._checkLabel=n._checkLabel.bind(T(n)),n._mouseDown=n._mouseDown.bind(T(n)),n._setText=n._setText.bind(T(n)),"file"==e.type){var h=d.find(".mbsc-file-input");n._$input=h.length?h:he('<input type="text" class="'+(m.attr("class")||"")+' mbsc-file-input" placeholder="'+(m.attr("placeholder")||"")+'"/>').insertAfter(m),m.on("change",n._setText)}return d.addClass("mbsc-input").on("mousedown",n._mouseDown),Ye.forEach(function(e){m.on(e,n._checkLabel)}),p.length&&(m.after(p),p.hasClass("mbsc-select-input")&&(n._delm=p[0],n.refresh())),n}l(e,f);var t=e.prototype;return t._setText=function(e){for(var t=e.target.files,n=[],s=0;s<t.length;++s)n.push(t[s].name);this._$input.val(n)},t._checkLabel=function(e){if(this._isFloating){var t=this._delm||this._elm;t.value||document.activeElement===t||e&&("focus"==e.type||"animationstart"==e.type&&this._$elm.is("*:-webkit-autofill"))?this._$parent.addClass("mbsc-label-floating-active"):this._$parent.removeClass("mbsc-label-floating-active")}},t._mouseDown=function(e){document.activeElement===this._elm&&e.target!==this._elm&&e.preventDefault()},t.refresh=function(){this._checkLabel()},t.destroy=function(){var t=this;f.prototype.destroy.call(this),this._$parent.off("mousedown",this._mouseDown).removeClass("mbsc-ic-left mbsc-ic-right").find(".mbsc-input-ic").remove(),this._$parent.find(".mbsc-input-fill").remove(),Ye.forEach(function(e){t._$elm.off(e,t._checkLabel)}),this._$elm.off("change",this._setText)},e}(We);ee("[mbsc-input]",Ge);var Ze=function(i){function e(e,t){var n,s=(n=i.call(this,e,t)||this)._$elm,a=s.attr("data-icon");return s.addClass("mbsc-btn mbsc-no-touch").find(".mbsc-btn-ic").remove(),a&&(s.prepend('<span class="mbsc-btn-ic mbsc-ic mbsc-ic-'+a+'"></span>'),""===s.text()&&s.addClass("mbsc-btn-icon-only")),n._$rippleElm=s,n}return l(e,i),e.prototype.getClassElm=function(){return this._$elm},e}(We);ee("[mbsc-button]",Ze);var qe=function(s){function e(e,t){var n;return(n=s.call(this,e,t)||this)._$parent.prepend(n._$elm).addClass("mbsc-checkbox mbsc-control-w").find(".mbsc-checkbox-box").remove(),n._$elm.after('<span class="mbsc-checkbox-box"></span>'),n}return l(e,s),e}(We);ee("[mbsc-checkbox]",qe);var Xe=function(s){function e(e,t){var n;return(n=s.call(this,e,t)||this)._$parent.addClass("mbsc-radio mbsc-control-w").find(".mbsc-radio-box").remove(),n._$elm.after('<span class="mbsc-radio-box"><span></span></span>'),n}return l(e,s),e}(We);ee("[mbsc-radio]",Xe);var Qe=function(r){function e(e,t){var n,s=(n=r.call(this,e,t)||this)._$elm,a=n._$parent,i=a.find(".mbsc-select-input"),o=i.length?i:he('<input tabindex="-1" class="mbsc-select-input mbsc-control" readonly>');return n._$input=o,n._delm=o[0],n._setText=n._setText.bind(T(n)),a.addClass("mbsc-select"+(n._$frame?" mbsc-select-inline":"")),s.after(o),o.after('<span class="mbsc-select-ic mbsc-ic mbsc-ic-arrow-down5"></span>'),s.on("change",n._setText),n._setText(),n}l(e,r);var t=e.prototype;return t.destroy=function(){r.prototype.destroy.call(this),this._$parent.find(".mbsc-select-ic").remove(),this._$elm.off("change",this._setText)},t._setText=function(){var e=this._elm,t=he(e);t.is("select")&&!t.hasClass("mbsc-comp")&&this._$input.val(-1!=e.selectedIndex?e.options[e.selectedIndex].text:""),this.refresh()},e}(Ge);ee("[mbsc-dropdown]",Qe);var et,tt=["change","keydown","input","scroll"];function nt(){clearTimeout(et),et=setTimeout(function(){he("textarea.mbsc-control").each(function(){st(this)})},100)}function st(e){var t,n,s,a=he(e).attr("rows")||6;e.offsetHeight&&(e.style.height="",s=e.scrollHeight-e.offsetHeight,t=e.offsetHeight+(0<s?s:0),a<(n=Math.round(t/24))?(t=24*a+(t-24*n),he(e).addClass("mbsc-textarea-scroll")):he(e).removeClass("mbsc-textarea-scroll"),t&&(e.style.height=t+"px"))}y&&he(window).on("resize orientationchange",nt);var at=function(s){function e(e,t){var n;return(n=s.call(this,e,t)||this)._$parent.addClass("mbsc-textarea"),tt.forEach(function(e){n._$elm.on(e,n._handle)}),st(e),n}l(e,s);var t=e.prototype;return t.destroy=function(){var t=this;s.prototype.destroy.call(this),tt.forEach(function(e){t._$elm.off(e,t._handle)})},t.refresh=function(){s.prototype.refresh.call(this),clearTimeout(this._debounce),st(this._elm)},t._handle=function(e){switch(s.prototype._handle.call(this,e),e.type){case"change":st(this._elm);break;case"keydown":case"input":this._onInput(e);break;case"scroll":!function(e){var t=he(e);if(!t.hasClass("mbsc-textarea-scroll")){var n=e.scrollHeight-e.offsetHeight,s=e.offsetHeight+n;Math.round(s/24)<=(t.attr("rows")||6)&&(e.scrollTop=0,e.style.height=s+"px")}}(this._elm)}},t._onInput=function(){var e=this;clearTimeout(this._debounce),this._debounce=setTimeout(function(){st(e._elm)},100)},e}(Ge);ee("[mbsc-textarea]",at);var it=function(r){function e(e,t){var n,s,a,i=(n=r.call(this,e,t)||this)._$elm,o=n._$parent;return o.hasClass("mbsc-segmented-item-ready")||(s=he('<div class="mbsc-segmented mbsc-segmented-group mbsc-no-touch"></div>'),o.after(s),o.parent().find('input[name="'+i.attr("name")+'"]').each(function(){var e=he(this);a=e.parent().addClass("mbsc-segmented-item mbsc-segmented-item-ready"),he('<span class="mbsc-segmented-content">'+(e.attr("data-icon")?'<span class="mbsc-ic mbsc-ic-'+e.attr("data-icon")+'"></span>':"")+"</span>").append(a.contents()).appendTo(a),a.prepend(e),s.append(a)})),n._$rippleElm=i.next(),n}return l(e,r),e.prototype.getClassElm=function(){return this._$elm.closest(".mbsc-segmented")},e}(We);ee("[mbsc-segmented]",it);function ot(g,S){var w,M,_,k,C,N,D,E,O,A,P,F,L,H,z,I,V="",j=this,U=he(g),s=H;function R(){var e;g.disabled||(e=parseFloat(he(this).val()),a(isNaN(e)?H:e))}function J(){return g.disabled}function $(e,t){a(H+t*A)}function a(e,t,n){s=H,void 0===t&&(t=!0),void 0===n&&(n=t),H=B(e),_.removeClass("mbsc-disabled"),t&&U.val(H),H==N&&M.addClass("mbsc-disabled"),H==C&&w.addClass("mbsc-disabled"),H!==s&&n&&U.trigger("change")}function K(e,t,n){var s=U.attr(e);return void 0===s||""===s?t:n?s:+s}function B(e){return+Math.min(C,Math.max(Math.round(e/A)*A,N)).toFixed(O)}ge.call(this,g,S,!0),j.getVal=function(){var e=parseFloat(U.val());return B(e=isNaN(e)?H:e)},j.setVal=function(e,t,n){e=parseFloat(e),a(isNaN(e)?H:e,t,n)},j._init=function(){function n(e){var t;m=he(e.currentTarget),b=+m.attr("data-step"),p=+m.attr("data-index"),d=!0,c&&e.stopPropagation(),"touchstart"==e.type&&m.closest(".mbsc-no-touch").removeClass("mbsc-no-touch"),"mousedown"==e.type&&e.preventDefault(),t="keydown"!=e.type?(T=de(e,"X"),x=de(e,"Y"),q(e,this)):32===e.keyCode,h||!t||m.hasClass("mbsc-disabled")||(i(p,b,e)&&(m.addClass("mbsc-active"),u&&u.addRipple(m.find(".mbsc-segmented-content"),e)),"mousedown"==e.type&&he(document).on("mousemove",s).on("mouseup",a))}function s(e){(7<Math.abs(T-de(e,"X"))||7<Math.abs(x-de(e,"Y")))&&(d=!0,t())}function a(e){"touchend"==e.type&&e.preventDefault(),t(),"mouseup"==e.type&&he(document).off("mousemove",s).off("mouseup",a)}function t(){h=!1,clearInterval(v),m&&(m.removeClass("mbsc-active"),u&&setTimeout(function(){u.removeRipple()},100))}function i(e,t,n){return h||y(e)||(p=e,b=t,f=n,d=!(h=!0),setTimeout(o,100)),h}function o(){m&&m.hasClass("mbsc-disabled")?t():(!h&&d||(d=!0,r(p,b,f,o)),h&&l&&(clearInterval(v),v=setInterval(function(){r(p,b,f)},l)))}var e,r,l,c,u,m,d,p,h,f,T,x,b,v,y;z=U.parent().hasClass("mbsc-stepper"),I=z?U.closest(".mbsc-stepper-cont"):U.parent(),F=j.settings,N=void 0===S.min?K("min",F.min):S.min,C=void 0===S.max?K("max",F.max):S.max,A=void 0===S.step?K("step",F.step):S.step,O=Math.abs(A)<1?(A+"").split(".")[1].length:0,D=void 0===S.inputStyle?K("data-input-style",F.inputStyle,!0):S.inputStyle,k=U.attr("data-val")||F.val,H=B(+g.value||0),L=se.themes.form[F.theme],E=L&&L.addRipple?L:null,z||I.addClass("mbsc-stepper-cont mbsc-no-touch mbsc-control-w").addClass("box"==D?"mbsc-input-box":"").addClass("outline"==D?"mbsc-input-outline":"").append('<span class="mbsc-segmented mbsc-stepper"></span>').find(".mbsc-stepper").append('<span class="mbsc-segmented-item mbsc-stepper-control mbsc-stepper-minus '+(H==N?"mbsc-disabled":"")+'" data-step="-1" tabindex="0"><span class="mbsc-segmented-content"><span class="mbsc-ic mbsc-ic-minus"></span></span></span>').append('<span class="mbsc-segmented-item mbsc-stepper-control mbsc-stepper-plus '+(H==C?"mbsc-disabled":"")+'" data-step="1" tabindex="0"><span class="mbsc-segmented-content"> <span class="mbsc-ic mbsc-ic-plus"></span></span></span>').prepend(U),V&&I.removeClass(V).find(".mbsc-segmented").removeClass(V),V="mbsc-"+F.theme+(L.baseTheme?" mbsc-"+L.baseTheme:"")+(F.rtl?" mbsc-rtl":" mbsc-ltr"),I.addClass(V).find(".mbsc-segmented").addClass(V),M=he(".mbsc-stepper-minus",I),w=he(".mbsc-stepper-plus",I),_=he(".mbsc-stepper-control",I),z||("left"==k?(I.addClass("mbsc-stepper-val-left"),U.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content"></span></span>')):"right"==k?(I.addClass("mbsc-stepper-val-right"),w.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content"></span></span>')):M.after('<span class="mbsc-segmented-item"><span class="mbsc-segmented-content mbsc-stepper-val"></span></span>')),P||(U.on("change",R),r=$,c=!(l=150),u=E,y=J||le,(e=_).each(function(e,t){ie(t,"touchstart",n,{passive:!0}),ie(t,"mousedown",n),ie(t,"keydown",n),ie(t,"touchmove",s,{passive:!0}),ie(t,"touchend",a),ie(t,"touchcancel",a),ie(t,"keyup",a)}),P={start:i,stop:t,destroy:function(){e.each(function(e,t){oe(t,"touchstart",n,{passive:!0}),oe(t,"mousedown",n),oe(t,"keydown",n),oe(t,"touchmove",s,{passive:!0}),oe(t,"touchend",a),oe(t,"touchcancel",a),oe(t,"keyup",a)})}}),U.val(H).attr("data-role","stepper").attr("min",N).attr("max",C).attr("step",A).addClass("mbsc-control"),g.mbscInst=j},j._destroy=function(){U.removeClass("mbsc-control").off("change",R),P.destroy(),delete g.mbscInst},j.init()}ot.prototype={_class:"stepper",_hasDef:!0,_hasTheme:!0,_hasLang:!0,_defaults:{min:0,max:100,step:1}},ee("[mbsc-stepper]",xe.Stepper=ot);function rt(t,e,n){var s,a,i,o,r=this;ge.call(this,t,e,!0),r.__init=le,r.__destroy=le,r._init=function(){var e;o=r.settings,s=he(t),e=!!a,a=(a=s.parent()).hasClass("mbsc-input-wrap")?a.parent():a,r._$parent=a,i&&a.removeClass(i),i=r._css+" mbsc-progress-w mbsc-control-w "+Be(o),a.addClass(i),s.addClass("mbsc-control"),r.__init(),e||r._attachChange(),r.refresh(),t.mbscInst=r},r._destroy=function(){r.__destroy(),a.removeClass(i),s.removeClass("mbsc-control"),delete t.mbscInst},n||r.init()}function lt(n,e,t){var s,a,i,l,o,r,c,u,m,d,p,h,f,T,x,b,v,y,g,S,w,M,_,k,C,N,D,E,O,A,P,F,L,H,z=this,I=new Date;function V(e){"mousedown"===e.type&&e.preventDefault(),!q(e,this)||u&&!v||n.disabled||n.readOnly||(D.stopProp&&e.stopPropagation(),d=_=!(u=!0),O=de(e,"X"),A=de(e,"Y"),T=O,c.removeClass("mbsc-progress-anim"),a=k?he(".mbsc-slider-handle",this):l,i&&i.removeClass("mbsc-handle-curr"),i=a.parent().addClass("mbsc-active mbsc-handle-curr"),s.addClass("mbsc-active"),b=+a.attr("data-index"),L=c[0].offsetWidth,f=c[0].getBoundingClientRect().left,"mousedown"===e.type&&(y=!0,he(document).on("mousemove",j).on("mouseup",U)),"mouseenter"===e.type&&(v=!0,he(document).on("mousemove",j)))}function j(e){u&&(T=de(e,"X"),x=de(e,"Y"),p=T-O,h=x-A,5<Math.abs(p)&&(_=!0),(_||y||v)&&50<Math.abs(I-new Date)&&(I=new Date,G(T,D.round,S&&(!v||y))),_?e.preventDefault():7<Math.abs(h)&&"touchmove"==e.type&&Y())}function U(e){u&&(e.preventDefault(),k||c.addClass("mbsc-progress-anim"),v&&!y?Z(H[b],b,!1,!1,!0):G(T,!0,!0),_||d||("touchend"==e.type&&me(),z._onTap(H[b])),"mouseup"==e.type&&(y=!1),"mouseleave"==e.type&&(v=!1),v||Y())}function R(){u&&Y()}function J(){var e=z._readValue(he(this)),t=+he(this).attr("data-index");e!==H[t]&&(H[t]=e,Z(C[t]=e,t))}function $(e){e.stopPropagation()}function K(e){e.preventDefault()}function B(e){var t;if(!n.disabled){switch(e.keyCode){case 38:case 39:t=1;break;case 40:case 37:t=-1}t&&(e.preventDefault(),F||(b=+he(this).attr("data-index"),Z(H[b]+N*t,b,!0),F=setInterval(function(){Z(H[b]+N*t,b,!0)},200)))}}function W(e){e.preventDefault(),clearInterval(F),F=null}function Y(){u=!1,i.removeClass("mbsc-active"),s.removeClass("mbsc-active"),he(document).off("mousemove",j).off("mouseup",U)}function G(e,t,n){var s=t?Math.min(Math[z._rounding||"round"](Math.max(100*(e-f)/L,0)/E/N)*N*100/(w-M+m),100):Math.max(0,Math.min(100*(e-f)/L,100));g&&(s=100-s),Z(Math.round((M-m+s/E)*P)/P,b,n,s)}function Z(e,t,n,s,a,i){var o=l.eq(t),r=o.parent();e=Math.min(w,Math.max(e,M)),void 0===i&&(i=n),z._update?e=z._update(e,H,t,s,k,a,r):r.css({left:g?"auto":(s||X(e,M,w))+"%",right:g?(s||X(e,M,w))+"%":"auto"}),M<e?r.removeClass("mbsc-slider-start"):(H[t]>M||a)&&r.addClass("mbsc-slider-start"),n&&(H[t]=e),n&&C[t]!=e&&(d=!0,C[t]=e,z._fillValue(e,t,i)),o.attr("aria-valuenow",e)}rt.call(this,n,e,!0),z._onTap=le,z.___init=le,z.___destroy=le,z._attachChange=function(){s.on(D.changeEvent,J)},z.__init=function(){var e;l&&(e=!0,l.parent().remove()),z.___init(),r=z._$parent,c=z._$track,s=r.find("input"),D=z.settings,M=z._min,w=z._max,m=z._base||0,N=z._step,S=z._live,P=N%1!=0?100/(100*(N%1).toFixed(2)):1,E=100/(w-M+m)||100,k=1<s.length,g=D.rtl,H=[],C=[],s.each(function(e){H[e]=z._readValue(he(this)),he(this).attr("data-index",e)}),l=r.find(".mbsc-slider-handle"),o=r.find(k?".mbsc-slider-handle-cont":".mbsc-progress-cont"),l.on("keydown",B).on("keyup",W).on("blur",W),o.each(function(e,t){ie(t,"touchstart",V,{passive:!0}),ie(t,"mousedown",V),ie(t,"touchend",U),ie(t,"touchcancel",U),ie(t,"pointercancel",R),D.hover&&(ie(t,"mouseenter",V),ie(t,"mouseleave",U))}),e||(s.on("click",$),r.on("click",K),ie(document,"touchmove",j,{passive:!1}))},z.__destroy=function(){r.off("click",K),s.off(D.changeEvent,J).off("click",$),l.off("keydown",B).off("keyup",W).off("blur",W),o.each(function(e,t){oe(t,"touchstart",V,{passive:!0}),oe(t,"mousedown",V),oe(t,"touchend",U),oe(t,"touchcancel",U),oe(t,"pointercancel",R),oe(t,"mouseenter",V),oe(t,"mouseleave",U),oe(document,"touchmove",j,{passive:!1})}),z.___destroy()},z.refresh=function(){s.each(function(e){Z(z._readValue(he(this)),e,!0,!1,!0,!1)})},z.getVal=function(){return k?H.slice(0):H[0]},z.setVal=z._setVal=function(e,t,n){he.isArray(e)||(e=[e]),he.each(e,function(e,t){H[e]=t}),he.each(e,function(e,t){Z(t,e,!0,!1,!0,n)})},t||z.init()}function ct(e,t){var s,n,a,i,o=this;ye(t=t||{},{changeEvent:"click",round:!1}),lt.call(this,e,t,!0),o._readValue=function(){return e.checked?1:0},o._fillValue=function(e,t,n){s.prop("checked",!!e),n&&s.trigger("change")},o._onTap=function(e){o._setVal(e?0:1)},o.___init=function(){a=o.settings,s=he(e),(n=s.parent()).find(".mbsc-switch-track").remove(),n.prepend(s),s.attr("data-role","switch").after('<span class="mbsc-progress-cont mbsc-switch-track"><span class="mbsc-progress-track mbsc-progress-anim"><span class="mbsc-slider-handle-cont"><span class="mbsc-slider-handle mbsc-switch-handle" data-index="0"><span class="mbsc-switch-txt-off">'+a.offText+'</span><span class="mbsc-switch-txt-on">'+a.onText+"</span></span></span></span></span>"),i&&i.destroy(),i=new We(e,a),o._$track=n.find(".mbsc-progress-track"),o._min=0,o._max=1,o._step=1},o.___destroy=function(){i.destroy()},o.getVal=function(){return e.checked},o.setVal=function(e,t,n){o._setVal(e?1:0,t,n)},o.init()}ct.prototype={_class:"switch",_css:"mbsc-switch",_hasTheme:!0,_hasLang:!0,_hasDef:!0,_defaults:{stopProp:!0,offText:"Off",onText:"On"}},ee("[mbsc-switch]",xe.Switch=ct);function ut(a,i,e){var o,r,l,c,u,m,d,p,h,f,T,x,b,t,v=this;function n(){var e=y("value",d);e!==b&&s(e)}function y(e,t,n){var s=r.attr(e);return void 0===s||""===s?t:n?s:+s}function s(e,t,n,s){e=Math.min(p,Math.max(e,d)),c.css