|
|
- var domdiff=function(){"use strict";/*! (c) Andrea Giammarchi - ISC */
- var r={};try{r.Map=Map}catch(Map){r.Map=function(){function r(r){return-1<(e=n.indexOf(r))}var e=0,n=[],t=[];return{"delete":function(o){var f=r(o);return f&&(n.splice(e,1),t.splice(e,1)),f},forEach:function(r,e){n.forEach(function(n,o){r.call(e,t[o],n,this)},this)},get:function(n){return r(n)?t[e]:void 0},has:function(e){return r(e)},set:function(o,f){return t[r(o)?e:n.push(o)-1]=f,this}}}}var e=r.Map,n=[].indexOf,t=function(r,e,t,o,f,i){for(var a=("selectedIndex"in e),u=a;o<f;){var c=r(t[o],1);if(e.insertBefore(c,i),a&&u&&c.selected){u=!u;var v=e.selectedIndex;e.selectedIndex=v<0?o:n.call(e.querySelectorAll("option"),c)}o++}},o=function(r,e){return r==e},f=function(r){return r},i=function(r,e,n,t,o,f,i){var a=f-o;if(a<1)return-1;for(;n-e>=a;){for(var u=e,c=o;u<n&&c<f&&i(r[u],t[c]);)u++,c++;if(c===f)return e;e=u+1}return-1},a=function(r,e,n,t,o,f){for(;t<o&&f(n[t],r[e-1]);)t++,e--;return 0===e},u=function(r,e,n,t,o){return n<t?r(e[n],0):0<n?r(e[n-1],-0).nextSibling:o},c=function(r,e,n,t,o){if(o-t<2)e.removeChild(r(n[t],-1));else{var f=e.ownerDocument.createRange();f.setStartBefore(r(n[t],-1)),f.setEndAfter(r(n[o-1],-1)),f.deleteContents()}},v=function(r,n,t,o,f,i,a,u){var c=0,v=o<u?o:u,l=Array(v++),s=Array(v);s[0]=-1;for(var h=1;h<v;h++)s[h]=a;for(var p=new e,g=i;g<a;g++)p.set(f[g],g);for(var b=n;b<t;b++){var w=p.get(r[b]);null!=w&&-1<(c=d(s,v,w))&&(s[c]=w,l[c]={newi:b,oldi:w,prev:l[c-1]})}for(c=--v,--a;s[c]>a;)--c;v=u+o-c;var x=Array(v),y=l[c];for(--t;y;){for(var A=y,k=A.newi,M=A.oldi;t>k;)x[--v]=1,--t;for(;a>M;)x[--v]=-1,--a;x[--v]=0,--t,--a,y=y.prev}for(;t>=n;)x[--v]=1,--t;for(;a>=i;)x[--v]=-1,--a;return x},l=function(r,e,n,t,o,f,i){var a=n+f,u=[],c=void 0,v=void 0,l=void 0,s=void 0,d=void 0,h=void 0,p=void 0;r:for(c=0;c<=a;c++){if(c>50)return null;for(p=c-1,d=c?u[c-1]:[0,0],h=u[c]=[],v=-c;v<=c;v+=2){for(s=v===-c||v!==c&&d[p+v-1]<d[p+v+1]?d[p+v+1]:d[p+v-1]+1,l=s-v;s<f&&l<n&&i(t[o+s],r[e+l]);)s++,l++;if(s===f&&l===n)break r;h[c+v]=s}}var g=Array(c/2+a/2),b=g.length-1;for(c=u.length-1;c>=0;c--){for(;s>0&&l>0&&i(t[o+s-1],r[e+l-1]);)g[b--]=0,s--,l--;if(!c)break;p=c-1,d=c?u[c-1]:[0,0],v=s-l,v===-c||v!==c&&d[p+v-1]<d[p+v+1]?(l--,g[b--]=1):(s--,g[b--]=-1)}return g},s=function(r,n,o,f,i,a,u,v,l){for(var s=new e,d=r.length,h=u,p=0;p<d;)switch(r[p++]){case 0:i++,h++;break;case 1:s.set(f[i],1),t(n,o,f,i++,i,h<v?n(a[h],0):l);break;case-1:h++}for(p=0;p<d;)switch(r[p++]){case 0:u++;break;case-1:s.has(a[u])?u++:c(n,o,a,u++,u)}},d=function(r,e,n){for(var t=1,o=e;t<o;){var f=(t+o)/2>>>0;n<r[f]?o=f:t=f+1}return t},h=function(r,e,n,t,o,f,i,a,u,c,d,h,p){s(l(n,t,f,i,a,c,h)||v(n,t,o,f,i,a,u,c),r,e,n,t,i,a,d,p)};return function(r,e,n,v){v||(v={});for(var l=v.compare||o,s=v.node||f,d=null==v.before?null:s(v.before,0),p=e.length,g=p,b=0,w=n.length,x=0;b<g&&x<w&&l(e[b],n[x]);)b++,x++;for(;b<g&&x<w&&l(e[g-1],n[w-1]);)g--,w--;var y=b===g,A=x===w;if(y&&A)return n;if(y&&x<w)return t(s,r,n,x,w,u(s,e,b,p,d)),n;if(A&&b<g)return c(s,r,e,b,g),n;var k=g-b,M=w-x,m=-1;if(k<M){if(-1<(m=i(n,x,w,e,b,g,l)))return t(s,r,n,x,m,s(e[b],0)),t(s,r,n,m+k,w,u(s,e,g,p,d)),n}else if(M<k&&-1<(m=i(e,b,g,n,x,w,l)))return c(s,r,e,b,m),c(s,r,e,m+M,g),n;return k<2||M<2?(t(s,r,n,x,w,s(e[b],0)),c(s,r,e,b,g),n):k===M&&a(n,w,e,b,g,l)?(t(s,r,n,x,w,u(s,e,g,p,d)),n):(h(s,r,n,x,w,M,e,b,g,k,p,l,d),n)}}();
|