7 lines
39 KiB
JavaScript
7 lines
39 KiB
JavaScript
/*!
|
||
* Omi v1.7.4 By dntzhang
|
||
* Github: https://github.com/AlloyTeam/omi
|
||
* MIT Licensed.
|
||
*/
|
||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(11),s=r(a),l=n(5),u=r(l),c=n(10),d=r(c);s["default"].prefix("o"),o["default"].template=s["default"],o["default"].Store=d["default"],o["default"].Component=u["default"],window.Omi?e.exports=window.Omi:(window.Omi=o["default"],e.exports=o["default"])},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s={};s.instances={},s._instanceId=0,s.getInstanceId=function(){return s._instanceId++},s.customTags=[],s.mapping={},s.STYLEPREFIX="omi_style_",s.STYLESCOPEDPREFIX="omi_scoped_",s.style={},s.componentConstructor={},"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,s=t||0;s=s>=0?s:a+s;var l=n?n:a;if(n<0&&(l=a+n),i=l-s,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(s+r);else for(r=0;r<i;r++)o[r]=this[s+r];return o}}}();var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();s.create=function(e,t,a){var u=t,c=s.Component;return arguments.length>2&&(u=a,c=t),s.componentConstructor[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),l(a,o(u)),a}(c),s.customTags.push(e),s.componentConstructor[e]},s.createStore=function(e){var t=function(t){function a(t,i){return n(this,a),this.data=t,e.methods.install&&e.methods.install.call(this),r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),l(a,o(e.methods)),a}(s.Store);return new t(e.data,!0)},s.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},s.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},s.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},s.getClassFromString=function(e){if(e.indexOf(".")!==-1){for(var t=e.split("."),n=t.length,r=window[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return s.componentConstructor[e]},s.makeHTML=function(e,t){s.componentConstructor[e]=t,s.componentConstructor[e.toLowerCase()]=t,s.customTags.push(e,e.toLowerCase()),document.documentMode<9&&document.createElement(e.toLowerCase())},s.tag=s.makeHTML,s.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,"boolean"==typeof n?e._omi_increment=n:n&&(e._omi_increment=n.increment,n.store&&(n.store instanceof s.Store?e.$store=n.store:e.$store=s.createStore(n.store)),e._omi_autoStoreToData=n.autoStoreToData),e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e._execInstalledHandlers(),e},s.get=function(e){return s.mapping[e]},s.plugins={},s.extendPlugin=function(e,t){s.plugins[e]=t},s.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},s.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},s.deletePlugin=function(e){delete s.plugins[e]},e.exports=s},,,function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_omi=__webpack_require__(1),_omi2=_interopRequireDefault(_omi),_style=__webpack_require__(6),_style2=_interopRequireDefault(_style),_event=__webpack_require__(7),_event2=_interopRequireDefault(_event),_morphdom=__webpack_require__(8),_morphdom2=_interopRequireDefault(_morphdom),_html2json=__webpack_require__(9),_html2json2=_interopRequireDefault(_html2json),Component=function(){function Component(e,t){_classCallCheck(this,Component);var n=Object.assign({server:!1,ignoreStoreData:!1,preventSelfUpdate:!1,selfDataFirst:!1,domDiffDisabled:!1,scopedSelfCSS:!1},t);this._omi_scopedSelfCSS=n.scopedSelfCSS,this._omi_preventSelfUpdate=n.preventSelfUpdate,this._omi_domDiffDisabled=n.domDiffDisabled,this._omi_ignoreStoreData=n.ignoreStoreData,this.data=e||{},this._omi_server_rendering=n.server,this.id=this._omi_server_rendering?1e6+_omi2["default"].getInstanceId():_omi2["default"].getInstanceId(),this.refs={},this.children=[],this.HTML=null,_omi2["default"].instances[this.id]=this,this.selfDataFirst=n.selfDataFirst,this._omi_scoped_attr=_omi2["default"].STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},this._omi_installedHandlers=null}return _createClass(Component,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"onInstalled",value:function(e){this._omi_installedHandlers||(this._omi_installedHandlers=[]),this._omi_installedHandlers.push(e)}},{key:"_execInstalledHandlers",value:function(){this._omi_installedHandlers&&this._omi_installedHandlers.forEach(function(e){e()})}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"beforeRender",value:function(){}},{key:"useStore",value:function(e){var t=this;this.$$store=e;var n=!1;e.instances.forEach(function(e){e.id===t.id&&(n=!0)}),n||e.instances.push(this)}},{key:"updateSelf",value:function(){if(this.beforeUpdate(),this.renderTo)this._render(!1,!0);else{if(this._omi_preventSelfUpdate)return;if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,_morphdom2["default"])(this.node,(0,_event2["default"])(this._childRender(this._omiChildStr,!0),this.id),{ignoreAttr:this._getIgnoreAttr()}),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm()}this.afterUpdate()}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this._omiGroupDataCounter={},this.renderTo)this._render(!1,!1,!0);else{if(this._omi_preventSelfUpdate)return;if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else this._omi_domDiffDisabled?this.node.parentNode.replaceChild(_morphdom2["default"].toElement((0,_event2["default"])(this._childRender(this._omiChildStr,!1,!0),this.id)),this.node):(0,_morphdom2["default"])(this.node,(0,_event2["default"])(this._childRender(this._omiChildStr,!1,!0),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm()}this._childrenInstalledAfterUpdate(this),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),e._omiGroupDataCounter={},t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed(),this._execInstalledHandlers()}},{key:"_render",value:function(e,t,n){var r=this;if(this._omi_removed){var i=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(i):(this.node.parentNode.replaceChild(i,this.node),this.node=i))}this._omi_autoStoreToData&&(this._omi_ignoreStoreData||(this.data=this.$store.data)),this.beforeRender(),this._generateHTMLCSS(),t?this._extractChildrenString(this,n):this._extractChildren(this,n),this.children.forEach(function(e){r.HTML=r.HTML.replace(e._omiChildStr,t?e.node.outerHTML:e.HTML)}),this.HTML=(0,_event2["default"])(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?this._omi_domDiffDisabled?this.renderTo.innerHTML=this.HTML:(0,_morphdom2["default"])(this.node,this.HTML,t?{ignoreAttr:this._getIgnoreAttr()}:null):(0,_morphdom2["default"])(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_getIgnoreAttr",value:function(){var e=[];return this.children.forEach(function(t){e.push(t._omi_scoped_attr)}),e}},{key:"_childRender",value:function(e,t,n){var r=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this.parent._omi_autoStoreToData&&(this._omi_autoStoreToData=!0,this._omi_ignoreStoreData||(this.data=this.$store.data)),this.beforeRender(),this._fixSlot(this._generateHTMLCSS()),t?this._extractChildrenString(this,n):this._extractChildren(this,n),this.children.forEach(function(e){r.HTML=r.HTML.replace(e._omiChildStr,t?e.node.outerHTML:e.HTML)}),this.HTML=(0,_event2["default"])(this.HTML,this.id),this.HTML)}},{key:"_fixSlot",value:function(e){var t=this;if(this._omi_slotContent){this._omi_slotContent=this._scopedAttr(this._omi_slotContent,this._omi_scoped_attr,e);var n=_morphdom2["default"].toElements(this._omi_slotContent),r=this.HTML.match(/<slot[\s\S]*?<\/slot>/g);1===n.length&&r&&1===r.length?this.HTML=this.HTML.replace(/<slot[\s\S]*?<\/slot>/,this._omi_slotContent):(n.sort(function(e,t){return parseInt(e.getAttribute("slot-index"))-parseInt(t.getAttribute("slot-index"))}),n.forEach(function(e){t.HTML=t.HTML.replace(/<slot[\s\S]*?<\/slot>/,e.outerHTML)}))}}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+_omi2["default"].STYLESCOPEDPREFIX+t.id+"]"),t.node&&e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=_omi2["default"].$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(_omi2["default"].plugins).forEach(function(t){var n=_omi2["default"].$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&_omi2["default"].plugins[t](n,e)}),e.node.hasAttribute(t)&&_omi2["default"].plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed(),e._execInstalledHandlers()})}},{key:"_childrenInstalledAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){e._omi_needInstalled&&(e._omi_needInstalled=!1,t._childrenInstalled(e),e.installed(),e._execInstalledHandlers())})}},{key:"_fixForm",value:function(){_omi2["default"].$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),_omi2["default"].$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),_omi2["default"].$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)_omi2["default"].$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=_omi2["default"].$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t,n,r){var i=this;if(0!==_omi2["default"].customTags.length){var o=e.join("|"),a=new RegExp("<("+o+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*((\\/>)|>(([\\s\\S]*?)<\\/\\1>))","g"),s=0;return t.replace(a,function(e,t,o,a,l,u,c){if(n){var d=i.children[s];d&&d.___omi_constructor_name===t&&(d._omiChildStr=e)}else i._initComponentByString(t,e,c,s++,i,r)})}}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.selfDataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,"");var e=this.___omi_constructor_name?_omi2["default"].STYLESCOPEDPREFIX+this.___omi_constructor_name.toLowerCase():this._omi_scoped_attr;this.CSS&&(!this._omi_scopedSelfCSS&&_omi2["default"].style[e]||(this.CSS=_style2["default"].scoper(this.CSS,this._omi_scopedSelfCSS?"["+this._omi_scoped_attr+"]":"["+e+"]"),_omi2["default"].style[e]=this.CSS,this.CSS===this._preCSS||this._omi_server_rendering||(_style2["default"].addStyle(this.CSS,this.id),this._preCSS=this.CSS)));var t=this.render();return this.HTML=this._scopedAttr(_omi2["default"].template(t?t:"",this.data),this._omi_scoped_attr,e).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+_omi2["default"].STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+_omi2["default"].STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n"),e}},{key:"_scopedAttr",value:function(e,t,n){var r=this;return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var i=e.split(" ")[0].replace(">","");return r._omi_scopedSelfCSS||!r.___omi_constructor_name?e.replace(i,i+" "+t):e.replace(i,i+" "+t+" "+n)})}},{key:"_getDataset",value:function _getDataset(childStr){var _this13=this,json=(0,_html2json2["default"])(childStr),attr=json.child[0].attr,baseData={};return Object.keys(attr).forEach(function(key){var value=attr[key];if(0===key.indexOf("on")){var handler=_this13.parent[value];handler&&(baseData[_this13._capitalize(key)]=handler.bind(_this13.parent))}else 0===key.indexOf("data-")?_this13._dataset[_this13._capitalize(key.replace("data-",""))]=value:0===key.indexOf(":data-")?_this13._dataset[_this13._capitalize(key.replace(":data-",""))]=eval("("+value+")"):0===key.indexOf("::data-")?_this13._dataset[_this13._capitalize(key.replace("::data-",""))]=_this13._extractPropertyFromString(value,_this13.parent):"data"===key?_this13._dataset=_this13._extractPropertyFromString(value,_this13.parent):":data"===key?_this13._dataset=eval("("+value+")"):"group-data"===key&&(_this13._dataset=_this13._extractPropertyFromString(value,_this13.parent)[_this13._omi_groupDataIndex])}),Object.assign(baseData,this._dataset)}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildrenString",value:function(e,t){this._replaceTags(_omi2["default"].customTags,e.HTML,!0,t)}},{key:"_extractChildren",value:function(e,t){this._replaceTags(_omi2["default"].customTags,e.HTML,!1,t)}},{key:"_initComponentByString",value:function _initComponentByString(name,childStr,slotContent,i,child,fromUpdate){var _this14=this,json=(0,_html2json2["default"])(childStr),attr=json.child[0].attr,cmi=this.children[i];if(cmi&&cmi.___omi_constructor_name===name)cmi._omiChildStr=childStr,cmi._omi_slotContent=slotContent,Object.keys(attr).forEach(function(e){var t=attr[e];"group-data"===e&&(child._omiGroupDataCounter.hasOwnProperty(t)?child._omiGroupDataCounter[t]++:child._omiGroupDataCounter[t]=0,cmi._omi_groupDataIndex=child._omiGroupDataCounter[t])}),cmi._childRender(childStr);else{var baseData={},dataset={},groupDataIndex=null,omiID=null,instanceName=null,_omi_option={};Object.keys(attr).forEach(function(key){var value=attr[key];if(0===key.indexOf("on")){var handler=child[value];handler&&(baseData[_this14._capitalize(key)]=handler.bind(child))}else"omi-id"===key?omiID=value:"name"===key?instanceName=value:"group-data"===key?(child._omiGroupDataCounter.hasOwnProperty(value)?child._omiGroupDataCounter[value]++:child._omiGroupDataCounter[value]=0,groupDataIndex=child._omiGroupDataCounter[value],dataset=_this14._extractPropertyFromString(value,child)[groupDataIndex]):0===key.indexOf("data-")?dataset[_this14._capitalize(key.replace("data-",""))]=value:0===key.indexOf(":data-")?dataset[_this14._capitalize(key.replace(":data-",""))]=eval("("+value+")"):0===key.indexOf("::data-")?dataset[_this14._capitalize(key.replace("::data-",""))]=_this14._extractPropertyFromString(value,child):"data"===key?dataset=_this14._extractPropertyFromString(value,child):":data"===key?dataset=eval("("+value+")"):"preventSelfUpdate"===key||"psu"===key||"preventselfupdate"===key?_omi_option.preventSelfUpdate=!0:"selfDataFirst"===key||"sdf"===key||"selfdatafirst"===key?_omi_option.selfDataFirst=!0:"domDiffDisabled"===key||"ddd"===key||"domdiffdisabled"===key?_omi_option.domDiffDisabled=!0:"ignoreStoreData"===key||"isd"===key||"ignorestoredata"===key?_omi_option.ignoreStoreData=!0:"scopedSelfCSS"!==key&&"ssc"!==key&&"scopedselfcss"!==key||(_omi_option.scopedSelfCSS=!0)});var ChildClass=_omi2["default"].getClassFromString(name);if(!ChildClass)throw"Can't find Class called ["+name+"]";var sub_child=new ChildClass(Object.assign(baseData,dataset),_omi_option);sub_child._omi_groupDataIndex=groupDataIndex,sub_child._omiChildStr=childStr,sub_child._omi_slotContent=slotContent,sub_child.parent=child,sub_child.$store=child.$store,sub_child.___omi_constructor_name=name,sub_child._dataset={},sub_child.install(),omiID&&(_omi2["default"].mapping[omiID]=sub_child),instanceName&&(child[instanceName]=sub_child),cmi?child.children[i]=sub_child:child.children.push(sub_child),sub_child._childRender(childStr),fromUpdate&&(sub_child._omi_needInstalled=!0)}}}]),Component}();exports["default"]=Component},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){e=e.replace(/\/\*[^*]*\*+([^\/][^*]*\*+)*\//g,"");var n=new RegExp("([^\r\n,{}:]+)(:[^\r\n,{}]+)?(,(?=[^{}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r,i){if("undefined"==typeof r&&(r=""),n.match(/^\s*(@media|\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/))return n+r+i;var o=n.replace(/(\s*)$/,"")+t+r,a=t+" "+n.trim()+r;return o+","+a+i})}function o(e,t){var n=document.getElementById(s["default"].STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",s["default"].STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=r(a);t["default"]={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=(('([\s\S]*?)')|("([\s\S]*?)"))/g,function(e,n,r){if(1===r.indexOf("Omi.instances["))return e;if(r.lastIndexOf(")")===r.length-2)return e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].");var i=e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].");return i.substr(0,i.length-1)+"(event)"+i.substr(i.length-1,1)})})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,s){"object"===o(t)&&"undefined"!=typeof e?e.exports=s():(r=s,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!c&&h.createRange&&(c=h.createRange(),c.selectNode(h.body));var t;return c&&c.createContextualFragment?t=c.createContextualFragment(e):(t=h.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e){!c&&h.createRange&&(c=h.createRange(),c.selectNode(h.body));var t;c&&c.createContextualFragment?t=c.createContextualFragment(e):(t=h.createElement("body"),t.innerHTML=e);for(var n=[],r=0,i=t.childNodes.length;r<i;r++){var o=t.childNodes[r];1===o.nodeType&&n.push(o)}return n}function n(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function r(e,t){return t&&t!==f?h.createElementNS(t,e):h.createElement(e)}function i(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function o(e,t){var n,r,i,o,a,s,l=t.attributes;for(n=l.length-1;n>=0;--n)r=l[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,s=e.getAttributeNS(o,i),s!==a&&e.setAttributeNS(o,i,a)):(s=e.getAttribute(i),s!==a&&e.setAttribute(i,a));for(l=e.attributes,n=l.length-1;n>=0;--n)r=l[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,_(t,o,i)||e.removeAttributeNS(o,i)):_(t,null,i)||e.removeAttribute(i))}function a(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function s(){}function l(e){return e.id}function u(t){return function(o,a,u){function c(e){C?C.push(e):C=[e]}function d(e,t){if(e.nodeType===v)for(var n=e.firstChild;n;){var r=void 0;t&&(r=k(n))?c(r):(D(n),n.firstChild&&d(n,t)),n=n.nextSibling}}function f(e,t,n){w(e)!==!1&&(t&&t.removeChild(e),D(e),d(e,n))}function p(e){if(e.nodeType===v)for(var t=e.firstChild;t;){var n=k(t);n&&(N[n]=t),p(t),t=t.nextSibling}}function _(e){T(e);for(var t=e.firstChild;t;){var r=t.nextSibling,i=k(t);if(i){var o=N[i];o&&n(t,o)&&(t.parentNode.replaceChild(o,t),b(o,t))}_(t),t=r}}function b(e,r,i){if(M){for(var s=!1,l=!1,u=null,d=null,p=0,S=M.length;p<S;p++){var C=M[p];if(s||null===e.getAttribute(C)||(s=!0,u=C),l||null===r.getAttribute(C)||(l=!0,d=C),s&&l)break}if(s&&l&&u===d)return}var T,w=k(r);if(w&&delete N[w],!a.isSameNode||!a.isSameNode(o)){if(!i){if(E(e,r)===!1)return;if(t(e,r),A(e),O(e,r)===!1)return}if("TEXTAREA"!==e.nodeName){var D,I,L,H,P=r.firstChild,j=e.firstChild;e:for(;P;){for(L=P.nextSibling,D=k(P);j;){if(I=j.nextSibling,P.isSameNode&&P.isSameNode(j)){P=L,j=I;continue e}T=k(j);var R=j.nodeType,$=void 0;if(R===P.nodeType&&(R===v?(D?D!==T&&((H=N[D])?j.nextSibling===H?$=!1:(e.insertBefore(H,j),I=j.nextSibling,T?c(T):f(j,e,!0),j=H):$=!1):T&&($=!1),$=$!==!1&&n(j,P),$&&b(j,P)):R!==y&&R!=g||($=!0,j.nodeValue=P.nodeValue)),$){P=L,j=I;continue e}T?c(T):f(j,e,!0),j=I}if(D&&(H=N[D])&&n(H,P))e.appendChild(H),b(H,P);else{var U=x(P);U!==!1&&(U&&(P=U),P.actualize&&(P=P.actualize(e.ownerDocument||h)),e.appendChild(P),_(P))}P=L,j=I}for(;j;)I=j.nextSibling,(T=k(j))?c(T):f(j,e,!0),j=I}var F=m[e.nodeName];F&&F(e,r)}}if(u||(u={}),"string"==typeof a)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=a;a=h.createElement("html"),a.innerHTML=S}else a=e(a);var C,k=u.getNodeKey||l,x=u.onBeforeNodeAdded||s,T=u.onNodeAdded||s,E=u.onBeforeElUpdated||s,A=u.onElUpdated||s,w=u.onBeforeNodeDiscarded||s,D=u.onNodeDiscarded||s,O=u.onBeforeElChildrenUpdated||s,I=u.childrenOnly===!0,M=u.ignoreAttr,N={};p(o);var L=o,H=L.nodeType,P=a.nodeType;if(!I)if(H===v)P===v?n(o,a)||(D(o),L=i(o,r(a.nodeName,a.namespaceURI))):L=a;else if(H===y||H===g){if(P===H)return L.nodeValue=a.nodeValue,L;L=a}if(L===a)D(o);else if(b(L,a,I),C)for(var j=0,R=C.length;j<R;j++){var $=N[C[j]];$&&f($,$.parentNode,!1)}return!I&&L!==o&&o.parentNode&&(L.actualize&&(L=L.actualize(o.ownerDocument||h)),o.parentNode.replaceChild(L,o)),L}}var c,d,f="http://www.w3.org/1999/xhtml",h="undefined"==typeof document?void 0:document,p=h?h.body||h.createElement("div"):{};d=p.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:p.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var _=d,m={OPTION:function(e,t){a(e,t,"selected")},INPUT:function(e,t){a(e,t,"checked"),a(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),_(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!_(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(_(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},v=1,y=3,g=8,b=u(o);return b.toElement=e,b.toElements=t,b})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(o=!!o,o||c.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=c.length-1;r>=0&&c[r]!=n;r--);else var r=0;if(r>=0){for(var i=c.length-1;i>=r;i--)t.end&&t.end(c[i]);c.length=r}}var s,l,u,c=[],d=e;for(c.last=function(){return this[this.length-1]};e;){if(l=!0,c.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+c.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",c.last());else if(0==e.indexOf("</")?(u=e.match(r),u&&(e=e.substring(u[0].length),u[0].replace(r,a),l=!1)):0==e.indexOf("<")&&(u=e.match(n),u&&(e=e.substring(u[0].length),u[0].replace(n,o),l=!1)),l){s=e.indexOf("<");var f=s<0?e:e.substring(0,s);e=s<0?"":e.substring(s),t.chars&&t.chars(f)}if(e==d)throw"Parse Error: "+e;d=e}a()},a=!1,s=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var l=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){s(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){s(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){s(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t["default"]=l},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.readyHandlers=[],this.isReady=t,this.instances=[],this.updateSelfInstances=[]}return r(e,[{key:"ready",value:function(e){return this.isReady?void e():void this.readyHandlers.push(e)}},{key:"addSelfView",value:function(e){for(var t=!1,n=0,r=this.updateSelfInstances.length;n<r;n++)if(this.updateSelfInstances[n].id===e.id){t=!0;break}t||this.updateSelfInstances.push(e);
|
||
}},{key:"addView",value:function(e){for(var t=!1,n=0,r=this.instances.length;n<r;n++)if(this.instances[n].id===e.id){t=!0;break}t||this.instances.push(e)}},{key:"beReady",value:function(){this.isReady=!0,this.readyHandlers.forEach(function(e){return e()})}},{key:"update",value:function(){this._mergeInstances(),this._mergeSelfInstances(),this.instances.forEach(function(e){return e.update()}),this.updateSelfInstances.forEach(function(e){return e.updateSelf()})}},{key:"_mergeSelfInstances",value:function(){var e=this,t=[];this.updateSelfInstances.forEach(function(n){e._checkSelfUpdateInstance(n)||t.push(n)}),this.updateSelfInstances=t}},{key:"_mergeInstances",value:function(){var e=this,t=[];this.idArr=[],this.instances.forEach(function(t){e.idArr.push(t.id)}),this.instances.forEach(function(n){n.parent?e._isSubInstance(n)||t.push(n):t.push(n)}),this.instances=t}},{key:"_checkSelfUpdateInstance",value:function(e){return this.idArr.indexOf(e.id)!==-1||(e.parent?this._checkSelfUpdateInstance(e.parent):void 0)}},{key:"_isSubInstance",value:function(e){return this.idArr.indexOf(e.parent.id)!==-1||(e.parent.parent?this._isSubInstance(e.parent):void 0)}}]),e}();t["default"]=i},function(e,t,n){var r,i;(function(e){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){Array.prototype.map||(Array.prototype.map=function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];[].push(e&&e.call(r,r,n))}return t}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"")});var o=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},a=/\{\{([^\}]*)\}\}/g,s="soda",l=new RegExp("^"+s+"-"),u=function(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)","g")},c=function(e,t){return e.className?void(e.className.match(u(t))||(e.className+=" "+t)):void(e.className=t)},d=function(e){return null!==e&&void 0!==e&&""!==e&&"undefined"!=typeof e},f=function(e,t){k.lastIndex=0;var n=t.replace(k,function(t){return"undefined"==typeof e[t]?t:e[t]});if("true"===t)return!0;if("false"===t)return!1;var r=function i(t,r){var o=r.indexOf(".");if(o>-1){var a=r.substr(0,o);if(r=r.substr(o+1),"undefined"!=typeof e[a]&&C.test(a)&&(a=e[a]),"undefined"!=typeof t[a])return i(t[a],r);var s={name:n,data:e};return L("nullvalue",{type:"nullattr",data:s},s),""}"undefined"!=typeof e[r]&&C.test(r)&&(r=e[r]);var l;if("undefined"!=typeof t[r])l=t[r];else{var s={name:n,data:e};L("nullvalue",{type:"nullvalue",data:s},s),l=""}return l};return r(e,t)},h=/"([^"]*)"|'([^']*)'/g,p=/[a-zA-Z_\$]+[\w\$]*(?:\s*\.\s*(?:[a-zA-Z_\$]+[\w\$]*|\d+))*/g,_=/[a-zA-Z_\$]+[\w\$]*(?:\s*\.\s*(?:[a-zA-Z_\$]+[\w\$]*|\d+))*/,m=/\[([^\[\]]*)\]/g,v=/\[([^\[\]]*)\]/,y=/\|\|/g,g="OR_OPERATOR",b=function(){return"$$"+~~(1e6*Math.random())},S="_$C$_",C=/^_\$C\$_/,k=/_\$C\$_[^\.]+/g,x=function(){return S+~~(1e6*Math.random())},T=function H(e,t){e=e.replace(y,g).split("|");for(var n=0;n<e.length;n++)e[n]=(e[n].replace(new RegExp(g,"g"),"||")||"").trim();var r=e[0]||"",i=e.slice(1);for(r=r.replace(h,function(e,n,r){var i=b();return t[i]=n||r,i});v.test(r);)m.lastIndex=0,r=r.replace(m,function(e,n){var r=x(),i=H(n,t);return t[r]=i,"."+r});r=r.replace(p,function(e){return"getValue(scope,'"+e.trim()+"')"});var o=function s(){var e=i.shift();if(e){for(var e=e.split(":"),t=e.slice(1)||[],n=e[0]||"",o=0;o<t.length;o++)_.test(t[o])&&(t[o]="getValue(scope,'"+t[o]+"')");w[n]&&(t.unshift(r),t=t.join(","),r="sodaFilterMap['"+n+"']("+t+")"),s()}};o();var a=new Function("getValue","sodaFilterMap","return function sodaExp(scope){ return "+r+"}")(f,w);return a(t)},E=function P(e,t){3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(a,function(e,n){return T(n,t)})),e.attributes&&(D.map(function(n){var r=n.name,i=n.opt;e.getAttribute(r)&&e.parentNode&&i.link(t,e,e.attributes)}),[].map.call(e.attributes,function(n){if(!A[n.name])if(l.test(n.name)){var r=n.name.replace(l,"");if(r&&n.value){var i=n.value.replace(a,function(e,n){return T(n,t)});d(i)&&e.setAttribute(r,i)}}else n.value&&(n.value=n.value.replace(a,function(e,n){return T(n,t)}))})),o(e.childNodes).map(function(e){P(e,t)})},A={},w={},D=[],O=function(e,t){var e=s+"-"+e;A[e]=t(),D.push({name:e,opt:A[e]})},I=function(e,t){w[e]=t};I.get=function(e){return w[e]},I("date",function(e,t){return t}),O("repeat",function(){return{priority:10,compile:function(e,t,n){},link:function(e,t,n){var r,i,o,a=t.getAttribute(s+"-repeat"),l=/\s+by\s+([^\s]+)$/;a=a.replace(l,function(e,t){return t&&(o=(t||"").trim()),""});var u=/([^\s]+)\s+in\s+([^\s]+)|\(([^,]+)\s*,\s*([^)]+)\)\s+in\s+([^\s]+)/,c=u.exec(a);if(c){if(c[1]&&c[2]){if(r=(c[1]||"").trim(),i=(c[2]||"").trim(),!r||!i)return}else c[3]&&c[4]&&c[5]&&(o=(c[3]||"").trim(),r=(c[4]||"").trim(),i=(c[5]||"").trim());o=o||"$index";var d=f(e,i)||[],h=function(n){var i=t.cloneNode(!0),a={};a[o]=n,a[r]=d[n],a.__proto__=e,i.removeAttribute(s+"-repeat"),t.parentNode.insertBefore(i,t),E(i,a)};if("length"in d)for(var p=0;p<d.length;p++)h(p);else for(var p in d)d.hasOwnProperty(p)&&h(p);t.parentNode.removeChild(t)}}}}),O("if",function(){return{priority:9,link:function(e,t,n){var r=t.getAttribute(s+"-if"),i=T(r,e);i||t.parentNode&&t.parentNode.removeChild(t)}}}),O("class",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-class"),i=T(r,e);i&&c(t,i)}}}),O("src",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-src"),i=r.replace(a,function(t,n){return T(n,e)});i&&t.setAttribute("src",i)}}}),O("bind-html",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-bind-html"),i=T(r,e);if(i)return t.innerHTML=i,{command:"childDone"}}}}),O("html",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-html"),i=T(r,e);if(i)return t.innerHTML=i,{command:"childDone"}}}}),O("replace",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-replace"),i=T(r,e);if(i){var o=document.createElement("div");if(o.innerHTML=i,t.parentNode)for(;o.childNodes[0];)t.parentNode.insertBefore(o.childNodes[0],t)}t.parentNode.removeChild(t)}}}),O("style",function(){return{link:function(e,t,n){var r=t.getAttribute(s+"-style"),i=T(r,e),o=function(e,t){var n=/opacity|z-index/;return n.test(e)?parseFloat(t):isNaN(t)?t:t+"px"};if(i){var a=[];for(var l in i)if(i.hasOwnProperty(l)){var u=o(l,i[l]);a.push([l,u].join(":"))}for(var c=t.style,l=0;l<c.length;l++){var d=c[l];i[d]||a.push([d,c[d]].join(":"))}var f=a.join(";");t.setAttribute("style",f)}}}});var M=function(e,t){D.sort(function(e,t){return Number(t.opt.priority||0)-Number(e.opt.priority||0)});var n=document.createElement("div");document.documentMode<9&&(n.style.display="none",document.body.appendChild(n)),n.innerHTML=e,o(n.childNodes).map(function(e){E(e,t)});var r=n.innerHTML;return document.documentMode<9&&document.body.removeChild(n),r},N={};M.addEventListener=function(e,t){N[e]||(N[e]=[]),N[e].push(t)};var L=function(e,t,n){for(var r=N[e]||[],i=0;i<r.length;i++){var o=r[i];o&&o(t,n)}};M.filter=I,M.prefix=function(e){for(var t in A)A.hasOwnProperty(t)&&(A[t.replace(s,e)]=A[t],delete A[t]);for(var n=0,r=D.length;n<r;n++)D[n].name=D[n].name.replace(s,e);s=e,l=new RegExp("^"+s+"-")},"object"===n(t)&&"object"===n(e)?e.exports=M:(r=[],i=function(){return M}.apply(t,r),!(void 0!==i&&(e.exports=i)))}()}).call(t,n(4)(e))}])}); |