text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).rem={})}(this,(function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};var n=function(e){function n(t){return e.call(this,t,"number")||this}return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}(n,e),n.prototype.validate=function(e){return"number"==typeof e},n}(function(){function e(e,t){this.key=e,this.type=t}return e.prototype.gerErrorMessage=function(e){return'The option "'+this.key+'" expect type: "'+this.type+'", but got "'+e+'"'},e}()),o=function(e,t){this.defaultValue=t,this.name=e.key,this.validator=e,this.value=t},i=new(function(){function e(){this.definedOptions={}}return e.prototype.defineOption=function(e){return this.definedOptions[e.name]=e,this},e.prototype.assertOption=function(e){if(!Object.prototype.hasOwnProperty.call(this.definedOptions,e))throw new Error('Unsupported option: "'+e+'"')},e.prototype.getOption=function(e){return this.assertOption(e),this.definedOptions[e]},e.prototype.getValue=function(e){return this.getOption(e).value},e.prototype.getDefaultValue=function(e){return this.getOption(e).defaultValue},e.prototype.setValue=function(e,t){var n=this.getOption(e),o=n.validator;if(!o.validate(t))throw new TypeError(o.gerErrorMessage(typeof t));n.value=t},e}());i.defineOption(new o(new n("baseFontSize"),30)).defineOption(new o(new n("baseWidth"),750)).defineOption(new o(new n("defaultWidth"),375)).defineOption(new o(new n("maxWidth"),750));var r=!1;function a(){var e,t,n=null!==(t=null!==(e=window.document.documentElement.clientWidth)&&void 0!==e?e:window.innerWidth)&&void 0!==t?t:i.getValue("defaultWidth"),o=i.getValue("maxWidth");0!==o&&n>o&&(n=o);var r=i.getValue("baseFontSize"),a=i.getValue("baseWidth")/r;window.document.documentElement.style.fontSize=(n/a).toString()+"px"}var d=a;function p(e,t){if("string"==typeof e){if(t===undefined)throw new Error("Missing the second argument of changeOption().");var n={};n[e]=t,p(n)}else{if("object"!=typeof e||null===e)throw new TypeError("The first argument of changeOption() must be a string or an object.");var o={};for(var r in i.definedOptions)Object.prototype.hasOwnProperty.call(i.definedOptions,r)&&(o[r]=i.definedOptions[r].value);try{for(var d in e)Object.prototype.hasOwnProperty.call(e,d)&&i.setValue(d,e[d])}catch(s){for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&i.setValue(u,o[u]);throw s}try{a()}catch(f){}}}e.changeOption=p,e.disable=function(){r&&("function"!=typeof window.document.addEventListener?(window.detachEvent("onresize",d),window.detachEvent("onload",d)):(window.removeEventListener("resize",d,!1),window.document.removeEventListener("DOMContentLoaded",d,!1)),window.document.documentElement.style.fontSize="",r=!1)},e.enable=function(e){if(void 0===e&&(e={}),r)p(e);else{for(var t in i.definedOptions){var n=t;Object.prototype.hasOwnProperty.call(i.definedOptions,n)&&i.setValue(n,n in e&&Object.prototype.hasOwnProperty.call(e,n)?e[n]:i.getDefaultValue(n))}"function"!=typeof window.document.addEventListener?(window.attachEvent("onresize",d),window.attachEvent("onload",d)):(window.addEventListener("resize",d,!1),window.document.addEventListener("DOMContentLoaded",d,!1)),r=!0;try{a()}catch(o){}}},e.getOption=function(){var e={};for(var t in i.definedOptions)Object.prototype.hasOwnProperty.call(i.definedOptions,t)&&(e[t]=i.definedOptions[t].value);return e},(function(){try{return Object.defineProperty(e,"__esModule",{value:!0})}catch(_){return e.__esModule=!0,e}})()}));
  