<commit_before>/*
Mag.JS v0.22.11
http://github.com/magnumjs/mag.js
(c) <NAME>
License: MIT
*/
!function(e,t,n){function i(e,n){if(o[e]&&!n)return o[e];var i=t.getElementById(e);return i&&(o[e]=i),o[e]}var r={values:[],attributes:[],elementMatcher:[]},o=[];e.create=function(t,n,i){return function(r,o){return"string"!=typeof r&&(o=r,r=0),e.module(r||t,n,e.utils.merge(i||{},o||{}))}},e.module=function(t,n,r){r=r||{},t instanceof HTMLElement&&(t.id||(t.id=performance.now()),o[t.id]=t,t=t.id);var a;if(!(a=!e.utils.items.isItem(t))){a=e.utils.items.getItem(t);var u=i(t);a=!e.utils.callLCEvent("onreload",e.mod.getState(a),u,a)}return a&&(a=r.key&&e.utils.items.isItem(t+"."+r.key)?e.utils.items.getItem(t+"."+r.key):e.utils.getItemInstanceId(r.key?t+"."+r.key:t),r.retain||e.mod.clear(a),e.mod.submodule(t,a,n,r),u=i(t),v(a,t),!e.utils.callLCEvent("willload",e.mod.getState(a),u,a,1))?(t=e.mod.getState(a),e.utils.unloaders[a]=e.utils.unloaders[a]||[],t.onunload&&e.utils.unloaders[a].push({controller:t,handler:t.onunload}),e.redraw(u,a,1),e.utils.callLCEvent("didload",e.mod.getState(a),u,a,1),m(a,u,n,e.utils.copy(r))):void 0};var a=function(t,n){return 0>n||n!=e.utils.items.getItem(t)?t==e.mod.getId(n)?!0:!1:!0},u=[];e.begin=function(e){n===u[e]?u[e]=1:u[e]++},e.end=function(t){if(1<u[t])u[t]--;else{u[t]=0;var n=e.utils.items.getItemVal(t);e.redraw(i(n),t)}};var l=[];e.redraw=function(t,i,r){if(!u[i]){if(!t||n===i)throw Error("Mag.JS - Id or node invalid: "+e.utils.items.getItemVal(i));a(t.id,i)&&(r&&e.fill.configs.splice(0,e.fill.configs.length),r&&e.mod.clear(i),t=p(t,i,r),cancelAnimationFrame(l[i]),l[i]=requestAnimationFrame(t))}},e.hookin=function(e,t,n){r[e].push({context:{},handler:n,key:t})},e.hook=function(t,n,i){for(var o=0,a=r[t].length;a>o;o++)e.utils.callHook(r,n,t,o,i)};var d={},c=[],f=function(t,n){e.utils.onLCEvent("didupdate",t,function(r,o){var a=e.utils.merge(e.utils.copy(o),e.utils.copy(r));JSON.stringify(a)!==JSON.stringify(c[t])&&(c[t]=a,n(r,o,i(e.mod.getId(t)),c[t]))})},s=[],g=function(t,n,i,r,o){e.mod.submodule(t.id,e.utils.items.getItem(n),r,i),v(e.utils.items.getItem(n),t.id),e.redraw(t,e.utils.items.getItem(n),o)},m=function(t,n,i,r){return s[t]=s[t]||[],i=function(t,n,i,r,o){"object"==typeof o&&(r=e.utils.merge(e.utils.copy(r)||{},o),e.utils.callLCEvent("willgetprops",e.mod.getState(t),n,t,0,r),o=0),o=n.id+(r.key?"."+r.key:"")+"."+(o||0);var a=d[o]||{};return a.id=o,e.utils.items.isItem(o)?(g(a,o,r,i),a):(d[o]=a=n.cloneNode(1),a.id=o,a instanceof HTMLElement?(n=e.utils.getItemInstanceId(a.id),s[t].push({instanceId:n,subscribe:f.bind({},n)}),g(a,o,r,i,1),a):void 0)}.bind({},t,n,i,r),i.clones=function(e){return s[e]}.bind({},t),i.getId=function(e){return e}.bind({},t),i.draw=function(t,n,i){e.redraw(t,n,i)}.bind({},n,t),i.getState=function(t,n){return e.mod.getState(n||t)}.bind({},t),i.getProps=function(t,n){return e.mod.getProps(n||t)}.bind({},t),i.subscribe=f.bind({},t),i},v=function(t,n){var r=function(t,n){i(n)?e.redraw(i(n),t):e.utils.items.isItem(n)&&e.clear(t)}.bind({},t,n);e.mod.setFrameId(t,r)};e.clear=function(t){cancelAnimationFrame(l[t]),e.utils.items.removeItem(t),e.mod.clear(t),e.fill.clearCache(e.mod.getId(t))};var p=function(t,n,r){return function(t,n,r){if(i(t.id,1),a(t.id,n)&&t){var o=e.mod.getState(n);if(!e.utils.callLCEvent("isupdate",o,t,n)){var u=e.mod.getProps(n),u=e.utils.merge(e.utils.copy(u),e.utils.copy(o));if(e.mod.iscached(n,u)&&!r)return 0;if(r=!e.utils.callLCEvent("willupdate",o,t,n)){e.mod.callView(t,n),e.fill.setId(t.id),e.fill.run(t,o),r=t.id;var l,u=e.fill.configs;for(l in u)-1<l.indexOf('id("'+r+'")/')&&u[l]();l=t.id;for(var d in e.fill.cached)-1<d.indexOf('id("'+l+'")/')&&-1<d.indexOf("-config")&&e.fill.cached[d].configContext&&(e.utils.unloaders[n]=e.utils.unloaders[n]||[],e.utils.unloaders[n].push({controller:e.fill.cached[d].configContext,handler:e.fill.cached[d].configContext.onunload}));e.utils.callLCEvent("didupdate",o,t,n),r=t&&t.parentNode}r&&(t=h(t.parentNode))&&e.redraw(t,e.utils.items.getItem(t.id))}}}.bind({},t,n,r)},h=function(e){return e.id?e:e.parentNode?h(e.parentNode):n};e.getNode=i,window.mag=e}(window.mag||{},document),function(e,t){function n(t,n){var i=t.name;if(void 0===t.object[t.name]){var r,o=e.fill.find(n,i),i="$"===i[0],a=[];return o.reverse().forEach(function(e){e&&(e.value&&0<e.value.length?(r=e.value,!e.type||"checkbox"!=e.type&&"radio"!=e.type||(r={_value:r},e.checked&&(r._checked=!0),a.push(r))):e.innerText&&0<e.innerText.length?r=e.innerText:e.innerHTML&&0<e.innerHTML.length?r=e.innerHTML:e.value||"INPUT"!=e.tagName||(r=""))}),0<a.length&&i?a:r}}function i(i,r){var d;if("undefined"!=typeof Proxy){d=function(i,r,d){var c=JSON.stringify(d.object),f=String(d.name);if(c!==u[r+f]){if(u[r+f]=c,"get"!=d.type||"props"==i||~e.fill.ignorekeys.indexOf(String(d.name))||void 0!==d.oldValue||0!==Object.keys(d.object).length)"set"==d.type&&d.oldValue&&"function"==typeof d.oldValue.draw&&d.object[d.name]&&!d.object[d.name].draw&&(i=d.oldValue.getId(),e.utils.callLCEvent("onunload",e.mod.getState(i),e.getNode(e.mod.getId(i)),i),e.clear(i),d.oldValue.clones().length=0);else if(i=n(d,t.getElementById(o.getId(r))),void 0!==i)return l[r]=0,i;i=o.getFrameId(r),"function"==typeof i&&"set"==d.type&&(cancelAnimationFrame(a[r]),a[r]=requestAnimationFrame(i))}};var c=o.getProps(r),c=e.proxy(c,d.bind({},"props",r));o.setProps(r,c),d=e.proxy({},d.bind({},"state",r)),d=new i(d)}else d=new i({});return d}var r=[],o={cache:[],getState:function(e){return r[e][1]},setState:function(e,t){r[e][1]=t},getView:function(e){return r[e][0]},getProps:function(e){return r[e][2]},setProps:function(e,t){return r[e][2]=t},remove:function(e){r.splice(e,1)},getId:function(e){return r[e]&&r[e][3]},exists:function(e){return void 0!==r[e]?!0:!1},setFrameId:function(e,t){r[e][4]=t},getFrameId:function(e){return r[e][4]},submodule:function(e,t,n,a){return r[t]?(o.setProps(t,a),r[t]):(r[t]=[0,0,0,0,0],o.setProps(t,a),a=function(e,t,i){n.view.call(n,t,o.getProps(e),i)}.bind({},t),r[t][0]=a,r[t][3]=e,r[t][1]=i(function(e){return(n.controller||function(){}).call(e,o.getProps(t))||e},t,e),r[t])}},a=[],u=[];o.iscached=function(e,t){return o.cache[e]&&o.cache[e]===JSON.stringify(t)?!0:void(o.cache[e]=JSON.stringify(t))},o.clear=function(e){e>-1&&o.cache[e]&&o.cache.splice(e,1)};var l=[];o.callView=function(t,n){var i=o.getView(n);l[n]||(e.props.attachToArgs(n,o.getState(n),t),l[n]=1),i(o.getState(n),t)},e.mod=o}(window.mag||{},document),function(e){function t(e){for(var t in e)if(e[t]&&-1!==["INPUT","SELECT","TEXTAREA"].indexOf(e[t].tagName))return e[t];return!1}var n={},i=function(t,n){for(var i=1;i<t.length;i+=2){var r=t[i+1];n=e.fill.find(n,t[i]),n=n[r]}return n},r=function(n,r,o,a){return o=(""+o).split("."),3>o.length?(o=parseInt(o.pop()),o=isNaN(o)?0:o,r=e.fill.find(a[o]?a[o]:a,r)):(a=i(o,a),r=e.fill.find(a,r)),(r=t(r))&&!r.eventOnFocus&&(o=-1<["radio","checkbox"].indexOf(r.type),a=function(t,i){this.__magnum__=this.__magnum__||{},this.__magnum__.dirty||(this.__magnum__.dirty=1),i&&(n._checked=this.checked,e.redraw(t,e.utils.items.getItem(t.id),1))}.bind(r,a,o),o?r.addEventListener("click",a,!1):r.addEventListener("focus",a,!1),r.eventOnFocus=1),r},o=function(n,i,o,a){var u=o[i];"_value"===i&&(i=n.split(".").pop());var l=e.fill.find(a,i),l=t(l);if("function"!=typeof u&&l){var d=r.bind({},o,i,n,a);d(),Object.defineProperty(o,i,{configurable:!0,get:function(){var t=d();return t&&"undefined"!==t.value&&t.__magnum__&&t.__magnum__.dirty&&t.value!==u?(u=t.value,e.redraw(a,n,1),t.value):u},set:function(e){var t=d();t&&"undefined"!==t.value&&t.value!==e&&e!==u&&(t.value=e,u=e)}})}},a=function(e,t,n){for(var i in t){var r=t[i];"object"==typeof r?a(e+"."+i,r,n):o.bind({},e,i,t,n)()}};n.attachToArgs=a,e.props=n}(window.mag||{},window),function(e){var t={callHook:function(e,t,n,i,r,o){r.change=!1,e[n][i].key==t&&(o=JSON.stringify({v:r.value,k:r.key}),e[n][i].handler.call(e[n][i].context,r),o!==JSON.stringify({v:r.value,k:r.key})&&(r.change=!0))},unloaders:[]},n=[];t.onLCEvent=function(e,t,i){n[e+"-"+t]=i},t.callLCEvent=function(i,r,o,a,u,l){var d=!1,c={preventDefault:function(){d=!0}};if(r&&r[i]&&(r[i].call(r,c,o,e.mod.getProps(a),l),u&&(r[i]=0)),n[i+"-"+a]&&n[i+"-"+a](e.mod.getState(a),e.mod.getProps(a)),d)for(i=0,r=t.unloaders[a];a=r&&r[i];i++)a.controller.onunload&&(a.handler.call(a.controller,o),a.controller.onunload=0);return d},t.copy=function(e){return Object.assign({},e)},t.merge=function(e,t){return Object.assign(e,t)};var i={i:[],isItem:function(e){return-1<i.i.indexOf(e)},setItem:function(e){i.i[i.i.length]=e},getItem:function(e){return i.i.indexOf(e)},getItemVal:function(e){return i.i[e]},removeItem:function(e){i.i.splice(i.i.indexOf(e),1)}};t.items=i,t.getItemInstanceIdAll=function(){return i.i},t.getItemInstanceId=function(e){return i.isItem(e)?i.getItem(e):(i.setItem(e),i.getItem(e))},e.utils=t}(window.mag||{}),function(e,t,n,i){function r(e){return Array.isArray&&Array.isArray(e)||"[object Array]"==={}.toString.call(e)}function o(e,t){return e[C]=e[C]||{},(!e[C].uid||t)&&(e[C].uid=performance.now()),e[C].uid}function a(e,t){var n=o(e,t);if(S[n])n=S[n];else{var i,r=S,a="";i=l(e);var u=e.parentNode&&[].indexOf.call(e.parentNode.children,e);i&&(a+='id("'+i.id+'")'),i=a+("/"+e.tagName+"["+(u+1)+"]"),n=r[n]=i}return n}function u(e,t,n){return e=o(e,n),T[x.id]=T[x.id]||[],T[x.id][e]&&T[x.id][e]==t?1:(T[x.id][e]=t,i)}function l(e){return e.id?e:e.parentNode?l(e.parentNode):i}function d(e){if(""!==e.id)return'id("'+e.id+'")';if(e===n.body)return e.tagName;var t=0;if(e.parentNode)for(var i=e.parentNode.childNodes,r=0;r<i.length;r++){var o=i[r];if(o===e)return d(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===o.nodeType&&o.tagName===e.tagName&&t++}}function c(e){var t=d(e);e.parentNode.removeChild(e),_[t+"-config"]&&_[t+"-config"].configContext&&typeof _[t+"-config"].configContext.onunload===O&&_[t+"-config"].configContext.onunload(_[t+"-config"].configContext,e,t)}function f(e){return(e=e&&parseInt(e.split("[").pop().slice(0,-1)))?parseInt(e)-1:0}function s(e){return e&&e[C]&&e[C].isChildOfArray?e:e.parentNode?s(e.parentNode):i}function g(e,t,i){if(!u(e,t.outerHTML,i)&&!n.getElementById(t.id)){for(;e.lastChild;)e.removeChild(e.lastChild);e.appendChild(t)}}function m(t,n,o){var a,u=f(o);if(n&&n.nodeType==k)return g(t,n),i;if("function"==typeof n){var l=(a=s(t.parentNode))&&a.getAttribute("key");return a&&l&&(u=+l.split(C)[1]),(n=n(u))&&n.nodeType&&n.nodeType==k?(g(t,n),t[C]=t[C]||{},t[C].isChildOfArray=!0,t[C].dataPass={index:u},i):(l=/<[a-z][\s\S]*>/i.test(n)?"_html":"_text",u={},u[l]=n,m(t,u,o))}if("object"!=typeof n)return m(t,{_text:n},o);for(l in n)u=n[l],u===i?u="":null===u&&-1===["onunload"].indexOf(l)?(t[C].detached=t[C].detached||[],t[C].detached[l]=1,p(t,l)):t[C].detached&&t[C].detached[l]&&(v(t,l),t[C].detached[l]=0),"_"===l[0]&&(a=a||{},a[l.substr(1)]=u);a&&b(t,a,o);for(l in n)if(u=n[l],!~x.ignorekeys.indexOf(l)&&"_"!==l[0]){a=N(t,l);var d={key:l,value:u,node:t};e.hook("values","*",d),d.change&&(u=d.value),r(u)&&(a=N(t,"$"+l)),x.run(a,u,o+"/"+l)}}function v(e,t){N(e,t).forEach(function(e){var t=o(e);if(L[t]){for(var n in L[t])e.appendChild(L[t][n]);delete L[t]}})}function p(e,t){N(e,t).forEach(function(e){var t=o(e);for(e.children.length&&(L[t]=h(e.children));e.lastChild;)c(e.lastChild)})}function h(e){var t;if(null==e.length&&(e=[e]),!r(e)){t=[];for(var n=0;n<e.length;n+=1)e[n]&&t.push(e[n]);e=t}return e}function y(t,i,r){return function(t,i,r){var o=s(i),u=o&&d(o),l=f(u),c=a(i),g=f(c),o={path:u,data:((o||{})[C]||[]).dataPass,node:o,index:l},c=c&&-1<c.indexOf("id(")&&c.split('id("')[1].split('")')[0],u=n.getElementById(c);return t=t.call(i,r,g,i,o),e.redraw(u,e.utils.items.getItem(c),1),t}.bind({},i[r],t)}function b(n,i,r){var o,a=f(r);for(o in i)if("text"!==o&&"html"!==o)if(0==o.indexOf("on"))n[o.toLowerCase()]=y(n,i,o);else if("config"==o){r=d(n);var a=f(r),u=!0;_[r+"-config"]?u=!1:_[r+"-config"]={};var l=_[r+"-config"].configContext=_[r+"-config"].configContext||{};t[r]=function(e,t){return function(){return e.apply(e,t)}}(i[o],[n,u,l,a])}else r={key:o,value:i[o],node:n},e.hook("attributes",o,r),r.change&&(o=r.key,i[o]=r.value),null===i[o]?n.removeAttribute(o):(o in n&&(n[o]=i[o]),n.setAttribute(o,""+i[o]));I(n,i.text),w(n,i.html)}function I(e,t){var n,i;if(e&&null!=t&&!u(e,t)){if(!i){i=[];for(var r=0;r<e.childNodes.length;r+=1)n=e.childNodes[r],n.nodeType===k&&i.push(n)}for(;e.lastChild;)e.removeChild(e.lastChild);for("INPUT"===e.nodeName?e.value=""+t:e.appendChild(e.ownerDocument.createTextNode(""+t)),r=0;r<i.length;r+=1)e.appendChild(i[r]);"SELECT"===e.nodeName&&(e.value=""+t)}}function w(e,t){e&&null!=t&&!u(e,t)&&(e.innerHTML=t)}function N(t,n,i){var r=[];if(t){var o=t.childNodes;if(o)for(var a=0;a<o.length;a+=1)o[a].nodeType===k&&r.push(o[a])}var o=[],a=n,u="$"===n[0];"$"===a[0]&&(a=a.substr(1));for(var l=0;l<r.length;l+=1){var d=r[l],c=a,f=" "+d.className+" ";(d.id===c||-1<f.indexOf(" "+c+" ")||d.name===c||d.nodeName.toLowerCase()===c.toLowerCase()||d.getAttribute("data-bind")===c)&&o.push(r[l])}if(!o.length||u)for(l=0;l<r.length&&(o=o.concat(N(r[l],n,!0)),!o.length||u);l++);return i||o.length||(t={key:n,value:o,node:t},e.hook("elementMatcher",n,t),t.change&&(o=t.value)),o}var x={ignorekeys:"willgetprops Symbol(Symbol.toStringTag) nodeType toJSON onunload onreload willupdate didupdate didload willload isupdate".split(" ")},k=1,_=[],C="__magnum__",O="function",S=[],T=[],E={};x.run=function(e,t,n){var o,u,l;if(e){null==t&&(t={_text:""});var d=h(e);if(l=r(t)){if(E[n]&&0===d.length&&(E[n].parent.insertAdjacentHTML("beforeend",E[n].node),d=h(E[n].parent.children)),0===d.length)return;for(u=d[0].parentNode,E[n]||(E[n]={node:d[0].cloneNode(1).outerHTML,parent:u});d.length<t.length;)E[n]?(u.insertAdjacentHTML("beforeend",E[n].node),o=u.lastChild):o=d[0].cloneNode(1),d.push(o),u&&u.appendChild(o);if(d.map(function(e){return e.__key}),n=t.map(function(e){return e&&e._key}),(d.length==t.length||-1!==n.indexOf(i))&&(t=t.map(function(e,t){if("object"==typeof e){if(d[t].__key&&void 0===e._key)return e._key=d[t].__key,e;void 0===e._key&&(e._key=C+t),d[t].__key=e._key}return e})),d.length>t.length)if(0===t.length||"object"!=typeof t[0])for(;d.length>t.length;)o=d.pop(),(u=o.parentNode)&&c(o);else var f=[],s=t.map(function(e){return e._key}),d=(d.map(function(e){return e.__key}),d.filter(function(e){return-1===s.indexOf(e.__key)||-1!==f.indexOf(e.__key)?(f.push(e.__key),c(e),!1):(f.push(e.__key),!0)}))}for(n=0;n<d.length;n++)l?d[n]&&x.run(d[n],t[n]):(t&&"object"==typeof t&&-1!==Object.keys(t).indexOf("_key")&&(d[n][C]=d[n][C]||{},d[n][C].isChildOfArray=!0,d[n][C].dataPass=t),o=a(d[n]),m(d[n],t,o));return e}};var L=[];x.configs=t,x.find=N,x.setId=function(e){x.id=e},x.clearCache=function(e){T[e]&&delete T[e]},e.fill=x}(window.mag||{},[],document),function(e,t){function n(t,n){var i=[];return new Proxy(t,{get:function(t,r){var o=t[r],a=n({type:"get",object:e.utils.copy(t[r]),name:r,oldValue:i[r]});return void 0!==a&&(o=t[r]=a),o},deleteProperty:function(e,t){return n({type:"delete",name:t,object:e,oldValue:i[t]}),delete e[t]},set:function(t,r,o){return JSON.stringify(o)!==JSON.stringify(t[r])&&(i[r]=e.utils.copy(t[r])),n({type:"set",name:r,object:t,oldValue:i[r]}),t[r]=o,!0}})}function i(e,t){for(var i in e)Array.isArray(e[i])&&101>e[i].length&&(e[i]=n(e[i],t));return n(e,t)}e.proxy=function(n,r){return n&&t.Proxy?i(n,function(t){return"object"==typeof t.object[t.name]&&(t.object[t.name]=e.proxy(t.object[t.name],r)),r(t)}):void 0}}(window.mag||{},window);<commit_msg>Update mag.0.22.11.min.js<commit_after>/*
Mag.JS v0.22.11
http://github.com/magnumjs/mag.js
(c) <NAME>
License: MIT
*/
!function(e,t,n){function i(e,n){if(o[e]&&!n)return o[e];var i=t.getElementById(e);return i&&(o[e]=i),o[e]}var r={values:[],attributes:[],elementMatcher:[]},o=[];e.create=function(t,n,i){return function(r,o){return"string"!=typeof r&&(o=r,r=0),e.module(r||t,n,e.utils.merge(i||{},o||{}))}},e.module=function(t,n,r){r=r||{},t instanceof HTMLElement&&(t.id||(t.id=performance.now()),o[t.id]=t,t=t.id);var a;if(!(a=!e.utils.items.isItem(t))){a=e.utils.items.getItem(t);var u=i(t);a=!e.utils.callLCEvent("onreload",e.mod.getState(a),u,a)}return a&&(a=r.key&&e.utils.items.isItem(t+"."+r.key)?e.utils.items.getItem(t+"."+r.key):e.utils.getItemInstanceId(r.key?t+"."+r.key:t),r.retain||e.mod.clear(a),e.mod.submodule(t,a,n,r),u=i(t),v(a,t),!e.utils.callLCEvent("willload",e.mod.getState(a),u,a,1))?(t=e.mod.getState(a),e.utils.unloaders[a]=e.utils.unloaders[a]||[],t.onunload&&e.utils.unloaders[a].push({controller:t,handler:t.onunload}),e.redraw(u,a,1),e.utils.callLCEvent("didload",e.mod.getState(a),u,a,1),m(a,u,n,e.utils.copy(r))):void 0};var a=function(t,n){return 0>n||n!=e.utils.items.getItem(t)?t==e.mod.getId(n)?!0:!1:!0},u=[];e.begin=function(e){n===u[e]?u[e]=1:u[e]++},e.end=function(t){if(1<u[t])u[t]--;else{u[t]=0;var n=e.utils.items.getItemVal(t);e.redraw(i(n),t)}};var l=[];e.redraw=function(t,i,r){if(!u[i]){if(!t||n===i)throw Error("Mag.JS - Id or node invalid: "+e.utils.items.getItemVal(i));a(t.id,i)&&(r&&e.fill.configs.splice(0,e.fill.configs.length),r&&e.mod.clear(i),t=p(t,i,r),cancelAnimationFrame(l[i]),l[i]=requestAnimationFrame(t))}},e.hookin=function(e,t,n){r[e].push({context:{},handler:n,key:t})},e.hook=function(t,n,i){for(var o=0,a=r[t].length;a>o;o++)e.utils.callHook(r,n,t,o,i)};var d={},c=[],f=function(t,n){e.utils.onLCEvent("didupdate",t,function(r,o){var a=e.utils.merge(e.utils.copy(o),e.utils.copy(r));JSON.stringify(a)!==JSON.stringify(c[t])&&(n(r,o,i(e.mod.getId(t)),c[t]),c[t]=a)})},s=[],g=function(t,n,i,r,o){e.mod.submodule(t.id,e.utils.items.getItem(n),r,i),v(e.utils.items.getItem(n),t.id),e.redraw(t,e.utils.items.getItem(n),o)},m=function(t,n,i,r){return s[t]=s[t]||[],i=function(t,n,i,r,o){"object"==typeof o&&(r=e.utils.merge(e.utils.copy(r)||{},o),e.utils.callLCEvent("willgetprops",e.mod.getState(t),n,t,0,r),o=0),o=n.id+(r.key?"."+r.key:"")+"."+(o||0);var a=d[o]||{};return a.id=o,e.utils.items.isItem(o)?(g(a,o,r,i),a):(d[o]=a=n.cloneNode(1),a.id=o,a instanceof HTMLElement?(n=e.utils.getItemInstanceId(a.id),s[t].push({instanceId:n,subscribe:f.bind({},n)}),g(a,o,r,i,1),a):void 0)}.bind({},t,n,i,r),i.clones=function(e){return s[e]}.bind({},t),i.getId=function(e){return e}.bind({},t),i.draw=function(t,n,i){e.redraw(t,n,i)}.bind({},n,t),i.getState=function(t,n){return e.mod.getState(n||t)}.bind({},t),i.getProps=function(t,n){return e.mod.getProps(n||t)}.bind({},t),i.subscribe=f.bind({},t),i},v=function(t,n){var r=function(t,n){i(n)?e.redraw(i(n),t):e.utils.items.isItem(n)&&e.clear(t)}.bind({},t,n);e.mod.setFrameId(t,r)};e.clear=function(t){cancelAnimationFrame(l[t]),e.utils.items.removeItem(t),e.mod.clear(t),e.fill.clearCache(e.mod.getId(t))};var p=function(t,n,r){return function(t,n,r){if(i(t.id,1),a(t.id,n)&&t){var o=e.mod.getState(n);if(!e.utils.callLCEvent("isupdate",o,t,n)){var u=e.mod.getProps(n),u=e.utils.merge(e.utils.copy(u),e.utils.copy(o));if(e.mod.iscached(n,u)&&!r)return 0;if(r=!e.utils.callLCEvent("willupdate",o,t,n)){e.mod.callView(t,n),e.fill.setId(t.id),e.fill.run(t,o),r=t.id;var l,u=e.fill.configs;for(l in u)-1<l.indexOf('id("'+r+'")/')&&u[l]();l=t.id;for(var d in e.fill.cached)-1<d.indexOf('id("'+l+'")/')&&-1<d.indexOf("-config")&&e.fill.cached[d].configContext&&(e.utils.unloaders[n]=e.utils.unloaders[n]||[],e.utils.unloaders[n].push({controller:e.fill.cached[d].configContext,handler:e.fill.cached[d].configContext.onunload}));e.utils.callLCEvent("didupdate",o,t,n),r=t&&t.parentNode}r&&(t=h(t.parentNode))&&e.redraw(t,e.utils.items.getItem(t.id))}}}.bind({},t,n,r)},h=function(e){return e.id?e:e.parentNode?h(e.parentNode):n};e.getNode=i,window.mag=e}(window.mag||{},document),function(e,t){function n(t,n){var i=t.name;if(void 0===t.object[t.name]){var r,o=e.fill.find(n,i),i="$"===i[0],a=[];return o.reverse().forEach(function(e){e&&(e.value&&0<e.value.length?(r=e.value,!e.type||"checkbox"!=e.type&&"radio"!=e.type||(r={_value:r},e.checked&&(r._checked=!0),a.push(r))):e.innerText&&0<e.innerText.length?r=e.innerText:e.innerHTML&&0<e.innerHTML.length?r=e.innerHTML:e.value||"INPUT"!=e.tagName||(r=""))}),0<a.length&&i?a:r}}function i(i,r){var d;if("undefined"!=typeof Proxy){d=function(i,r,d){var c=JSON.stringify(d.object),f=String(d.name);if(c!==u[r+f]){if(u[r+f]=c,"get"!=d.type||"props"==i||~e.fill.ignorekeys.indexOf(String(d.name))||void 0!==d.oldValue||0!==Object.keys(d.object).length)"set"==d.type&&d.oldValue&&"function"==typeof d.oldValue.draw&&d.object[d.name]&&!d.object[d.name].draw&&(i=d.oldValue.getId(),e.utils.callLCEvent("onunload",e.mod.getState(i),e.getNode(e.mod.getId(i)),i),e.clear(i),d.oldValue.clones().length=0);else if(i=n(d,t.getElementById(o.getId(r))),void 0!==i)return l[r]=0,i;i=o.getFrameId(r),"function"==typeof i&&"set"==d.type&&(cancelAnimationFrame(a[r]),a[r]=requestAnimationFrame(i))}};var c=o.getProps(r),c=e.proxy(c,d.bind({},"props",r));o.setProps(r,c),d=e.proxy({},d.bind({},"state",r)),d=new i(d)}else d=new i({});return d}var r=[],o={cache:[],getState:function(e){return r[e][1]},setState:function(e,t){r[e][1]=t},getView:function(e){return r[e][0]},getProps:function(e){return r[e][2]},setProps:function(e,t){return r[e][2]=t},remove:function(e){r.splice(e,1)},getId:function(e){return r[e]&&r[e][3]},exists:function(e){return void 0!==r[e]?!0:!1},setFrameId:function(e,t){r[e][4]=t},getFrameId:function(e){return r[e][4]},submodule:function(e,t,n,a){return r[t]?(o.setProps(t,a),r[t]):(r[t]=[0,0,0,0,0],o.setProps(t,a),a=function(e,t,i){n.view.call(n,t,o.getProps(e),i)}.bind({},t),r[t][0]=a,r[t][3]=e,r[t][1]=i(function(e){return(n.controller||function(){}).call(e,o.getProps(t))||e},t,e),r[t])}},a=[],u=[];o.iscached=function(e,t){return o.cache[e]&&o.cache[e]===JSON.stringify(t)?!0:void(o.cache[e]=JSON.stringify(t))},o.clear=function(e){e>-1&&o.cache[e]&&o.cache.splice(e,1)};var l=[];o.callView=function(t,n){var i=o.getView(n);l[n]||(e.props.attachToArgs(n,o.getState(n),t),l[n]=1),i(o.getState(n),t)},e.mod=o}(window.mag||{},document),function(e){function t(e){for(var t in e)if(e[t]&&-1!==["INPUT","SELECT","TEXTAREA"].indexOf(e[t].tagName))return e[t];return!1}var n={},i=function(t,n){for(var i=1;i<t.length;i+=2){var r=t[i+1];n=e.fill.find(n,t[i]),n=n[r]}return n},r=function(n,r,o,a){return o=(""+o).split("."),3>o.length?(o=parseInt(o.pop()),o=isNaN(o)?0:o,r=e.fill.find(a[o]?a[o]:a,r)):(a=i(o,a),r=e.fill.find(a,r)),(r=t(r))&&!r.eventOnFocus&&(o=-1<["radio","checkbox"].indexOf(r.type),a=function(t,i){this.__magnum__=this.__magnum__||{},this.__magnum__.dirty||(this.__magnum__.dirty=1),i&&(n._checked=this.checked,e.redraw(t,e.utils.items.getItem(t.id),1))}.bind(r,a,o),o?r.addEventListener("click",a,!1):r.addEventListener("focus",a,!1),r.eventOnFocus=1),r},o=function(n,i,o,a){var u=o[i];"_value"===i&&(i=n.split(".").pop());var l=e.fill.find(a,i),l=t(l);if("function"!=typeof u&&l){var d=r.bind({},o,i,n,a);d(),Object.defineProperty(o,i,{configurable:!0,get:function(){var t=d();return t&&"undefined"!==t.value&&t.__magnum__&&t.__magnum__.dirty&&t.value!==u?(u=t.value,e.redraw(a,n,1),t.value):u},set:function(e){var t=d();t&&"undefined"!==t.value&&t.value!==e&&e!==u&&(t.value=e,u=e)}})}},a=function(e,t,n){for(var i in t){var r=t[i];"object"==typeof r?a(e+"."+i,r,n):o.bind({},e,i,t,n)()}};n.attachToArgs=a,e.props=n}(window.mag||{},window),function(e){var t={callHook:function(e,t,n,i,r,o){r.change=!1,e[n][i].key==t&&(o=JSON.stringify({v:r.value,k:r.key}),e[n][i].handler.call(e[n][i].context,r),o!==JSON.stringify({v:r.value,k:r.key})&&(r.change=!0))},unloaders:[]},n=[];t.onLCEvent=function(e,t,i){n[e+"-"+t]=i},t.callLCEvent=function(i,r,o,a,u,l){var d=!1,c={preventDefault:function(){d=!0}};if(r&&r[i]&&(r[i].call(r,c,o,e.mod.getProps(a),l),u&&(r[i]=0)),n[i+"-"+a]&&n[i+"-"+a](e.mod.getState(a),e.mod.getProps(a)),d)for(i=0,r=t.unloaders[a];a=r&&r[i];i++)a.controller.onunload&&(a.handler.call(a.controller,o),a.controller.onunload=0);return d},t.copy=function(e){return Object.assign({},e)},t.merge=function(e,t){return Object.assign(e,t)};var i={i:[],isItem:function(e){return-1<i.i.indexOf(e)},setItem:function(e){i.i[i.i.length]=e},getItem:function(e){return i.i.indexOf(e)},getItemVal:function(e){return i.i[e]},removeItem:function(e){i.i.splice(i.i.indexOf(e),1)}};t.items=i,t.getItemInstanceIdAll=function(){return i.i},t.getItemInstanceId=function(e){return i.isItem(e)?i.getItem(e):(i.setItem(e),i.getItem(e))},e.utils=t}(window.mag||{}),function(e,t,n,i){function r(e){return Array.isArray&&Array.isArray(e)||"[object Array]"==={}.toString.call(e)}function o(e,t){return e[C]=e[C]||{},(!e[C].uid||t)&&(e[C].uid=performance.now()),e[C].uid}function a(e,t){var n=o(e,t);if(S[n])n=S[n];else{var i,r=S,a="";i=l(e);var u=e.parentNode&&[].indexOf.call(e.parentNode.children,e);i&&(a+='id("'+i.id+'")'),i=a+("/"+e.tagName+"["+(u+1)+"]"),n=r[n]=i}return n}function u(e,t,n){return e=o(e,n),T[x.id]=T[x.id]||[],T[x.id][e]&&T[x.id][e]==t?1:(T[x.id][e]=t,i)}function l(e){return e.id?e:e.parentNode?l(e.parentNode):i}function d(e){if(""!==e.id)return'id("'+e.id+'")';if(e===n.body)return e.tagName;var t=0;if(e.parentNode)for(var i=e.parentNode.childNodes,r=0;r<i.length;r++){var o=i[r];if(o===e)return d(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===o.nodeType&&o.tagName===e.tagName&&t++}}function c(e){var t=d(e);e.parentNode.removeChild(e),_[t+"-config"]&&_[t+"-config"].configContext&&typeof _[t+"-config"].configContext.onunload===O&&_[t+"-config"].configContext.onunload(_[t+"-config"].configContext,e,t)}function f(e){return(e=e&&parseInt(e.split("[").pop().slice(0,-1)))?parseInt(e)-1:0}function s(e){return e&&e[C]&&e[C].isChildOfArray?e:e.parentNode?s(e.parentNode):i}function g(e,t,i){if(!u(e,t.outerHTML,i)&&!n.getElementById(t.id)){for(;e.lastChild;)e.removeChild(e.lastChild);e.appendChild(t)}}function m(t,n,o){var a,u=f(o);if(n&&n.nodeType==k)return g(t,n),i;if("function"==typeof n){var l=(a=s(t.parentNode))&&a.getAttribute("key");return a&&l&&(u=+l.split(C)[1]),(n=n(u))&&n.nodeType&&n.nodeType==k?(g(t,n),t[C]=t[C]||{},t[C].isChildOfArray=!0,t[C].dataPass={index:u},i):(l=/<[a-z][\s\S]*>/i.test(n)?"_html":"_text",u={},u[l]=n,m(t,u,o))}if("object"!=typeof n)return m(t,{_text:n},o);for(l in n)u=n[l],u===i?u="":null===u&&-1===["onunload"].indexOf(l)?(t[C].detached=t[C].detached||[],t[C].detached[l]=1,p(t,l)):t[C].detached&&t[C].detached[l]&&(v(t,l),t[C].detached[l]=0),"_"===l[0]&&(a=a||{},a[l.substr(1)]=u);a&&b(t,a,o);for(l in n)if(u=n[l],!~x.ignorekeys.indexOf(l)&&"_"!==l[0]){a=N(t,l);var d={key:l,value:u,node:t};e.hook("values","*",d),d.change&&(u=d.value),r(u)&&(a=N(t,"$"+l)),x.run(a,u,o+"/"+l)}}function v(e,t){N(e,t).forEach(function(e){var t=o(e);if(L[t]){for(var n in L[t])e.appendChild(L[t][n]);delete L[t]}})}function p(e,t){N(e,t).forEach(function(e){var t=o(e);for(e.children.length&&(L[t]=h(e.children));e.lastChild;)c(e.lastChild)})}function h(e){var t;if(null==e.length&&(e=[e]),!r(e)){t=[];for(var n=0;n<e.length;n+=1)e[n]&&t.push(e[n]);e=t}return e}function y(t,i,r){return function(t,i,r){var o=s(i),u=o&&d(o),l=f(u),c=a(i),g=f(c),o={path:u,data:((o||{})[C]||[]).dataPass,node:o,index:l},c=c&&-1<c.indexOf("id(")&&c.split('id("')[1].split('")')[0],u=n.getElementById(c);return t=t.call(i,r,g,i,o),e.redraw(u,e.utils.items.getItem(c),1),t}.bind({},i[r],t)}function b(n,i,r){var o,a=f(r);for(o in i)if("text"!==o&&"html"!==o)if(0==o.indexOf("on"))n[o.toLowerCase()]=y(n,i,o);else if("config"==o){r=d(n);var a=f(r),u=!0;_[r+"-config"]?u=!1:_[r+"-config"]={};var l=_[r+"-config"].configContext=_[r+"-config"].configContext||{};t[r]=function(e,t){return function(){return e.apply(e,t)}}(i[o],[n,u,l,a])}else r={key:o,value:i[o],node:n},e.hook("attributes",o,r),r.change&&(o=r.key,i[o]=r.value),null===i[o]?n.removeAttribute(o):(o in n&&(n[o]=i[o]),n.setAttribute(o,""+i[o]));I(n,i.text),w(n,i.html)}function I(e,t){var n,i;if(e&&null!=t&&!u(e,t)){if(!i){i=[];for(var r=0;r<e.childNodes.length;r+=1)n=e.childNodes[r],n.nodeType===k&&i.push(n)}for(;e.lastChild;)e.removeChild(e.lastChild);for("INPUT"===e.nodeName?e.value=""+t:e.appendChild(e.ownerDocument.createTextNode(""+t)),r=0;r<i.length;r+=1)e.appendChild(i[r]);"SELECT"===e.nodeName&&(e.value=""+t)}}function w(e,t){e&&null!=t&&!u(e,t)&&(e.innerHTML=t)}function N(t,n,i){var r=[];if(t){var o=t.childNodes;if(o)for(var a=0;a<o.length;a+=1)o[a].nodeType===k&&r.push(o[a])}var o=[],a=n,u="$"===n[0];"$"===a[0]&&(a=a.substr(1));for(var l=0;l<r.length;l+=1){var d=r[l],c=a,f=" "+d.className+" ";(d.id===c||-1<f.indexOf(" "+c+" ")||d.name===c||d.nodeName.toLowerCase()===c.toLowerCase()||d.getAttribute("data-bind")===c)&&o.push(r[l])}if(!o.length||u)for(l=0;l<r.length&&(o=o.concat(N(r[l],n,!0)),!o.length||u);l++);return i||o.length||(t={key:n,value:o,node:t},e.hook("elementMatcher",n,t),t.change&&(o=t.value)),o}var x={ignorekeys:"willgetprops Symbol(Symbol.toStringTag) nodeType toJSON onunload onreload willupdate didupdate didload willload isupdate".split(" ")},k=1,_=[],C="__magnum__",O="function",S=[],T=[],E={};x.run=function(e,t,n){var o,u,l;if(e){null==t&&(t={_text:""});var d=h(e);if(l=r(t)){if(E[n]&&0===d.length&&(E[n].parent.insertAdjacentHTML("beforeend",E[n].node),d=h(E[n].parent.children)),0===d.length)return;for(u=d[0].parentNode,E[n]||(E[n]={node:d[0].cloneNode(1).outerHTML,parent:u});d.length<t.length;)E[n]?(u.insertAdjacentHTML("beforeend",E[n].node),o=u.lastChild):o=d[0].cloneNode(1),d.push(o),u&&u.appendChild(o);if(d.map(function(e){return e.__key}),n=t.map(function(e){return e&&e._key}),(d.length==t.length||-1!==n.indexOf(i))&&(t=t.map(function(e,t){if("object"==typeof e){if(d[t].__key&&void 0===e._key)return e._key=d[t].__key,e;void 0===e._key&&(e._key=C+t),d[t].__key=e._key}return e})),d.length>t.length)if(0===t.length||"object"!=typeof t[0])for(;d.length>t.length;)o=d.pop(),(u=o.parentNode)&&c(o);else var f=[],s=t.map(function(e){return e._key}),d=(d.map(function(e){return e.__key}),d.filter(function(e){return-1===s.indexOf(e.__key)||-1!==f.indexOf(e.__key)?(f.push(e.__key),c(e),!1):(f.push(e.__key),!0)}))}for(n=0;n<d.length;n++)l?d[n]&&x.run(d[n],t[n]):(t&&"object"==typeof t&&-1!==Object.keys(t).indexOf("_key")&&(d[n][C]=d[n][C]||{},d[n][C].isChildOfArray=!0,d[n][C].dataPass=t),o=a(d[n]),m(d[n],t,o));return e}};var L=[];x.configs=t,x.find=N,x.setId=function(e){x.id=e},x.clearCache=function(e){T[e]&&delete T[e]},e.fill=x}(window.mag||{},[],document),function(e,t){function n(t,n){var i=[];return new Proxy(t,{get:function(t,r){var o=t[r],a=n({type:"get",object:e.utils.copy(t[r]),name:r,oldValue:i[r]});return void 0!==a&&(o=t[r]=a),o},deleteProperty:function(e,t){return n({type:"delete",name:t,object:e,oldValue:i[t]}),delete e[t]},set:function(t,r,o){return JSON.stringify(o)!==JSON.stringify(t[r])&&(i[r]=e.utils.copy(t[r])),n({type:"set",name:r,object:t,oldValue:i[r]}),t[r]=o,!0}})}function i(e,t){for(var i in e)Array.isArray(e[i])&&101>e[i].length&&(e[i]=n(e[i],t));return n(e,t)}e.proxy=function(n,r){return n&&t.Proxy?i(n,function(t){return"object"==typeof t.object[t.name]&&(t.object[t.name]=e.proxy(t.object[t.name],r)),r(t)}):void 0}}(window.mag||{},window);
{'fraction_non_alphanumeric': 0.34319697358296997, 'fraction_numerical': 0.010226981277250576, 'mean_word_length': 14.328255528255529, 'pattern_counts': {'":': 4, '<': 51, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '735292', 'n_tokens_mistral': 15184, 'n_tokens_neox': 15288, 'n_words': 512}