>>1,$n=[["ary",mn],["bind",_n],["bindKey",vn],["curry",yn],["curryRight",dn],["flip",jn],["partial",bn],["partialRight",wn],["rearg",xn]],Dn="[object Arguments]",Mn="[object Array]",Fn="[object AsyncFunction]",Nn="[object Boolean]",Pn="[object Date]",qn="[object DOMException]",Zn="[object Error]",Kn="[object Function]",Vn="[object GeneratorFunction]",Gn="[object Map]",Hn="[object Number]",Jn="[object Null]",Yn="[object Object]",Qn="[object Promise]",Xn="[object Proxy]",nt="[object RegExp]",tt="[object Set]",rt="[object String]",et="[object Symbol]",ut="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",ft="[object ArrayBuffer]",ct="[object DataView]",at="[object Float32Array]",lt="[object Float64Array]",st="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",_t="[object Uint8Array]",vt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",dt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,jt=RegExp(mt.source),At=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+/,Ct=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dt=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",Qt="\\u0300-\\u036f",Xt="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",tr=Qt+Xt+nr,rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",or="\\u2000-\\u206f",fr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",lr=ur+ir+or+fr,sr="['\u2019]",hr="["+Yt+"]",pr="["+lr+"]",_r="["+tr+"]",vr="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+vr+rr+er+cr+"]",br="\\ud83c[\\udffb-\\udfff]",wr="(?:"+_r+"|"+br+")",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+cr+"]",kr="\\u200d",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",zr="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Er=wr+"?",Sr="["+ar+"]?",Wr="(?:"+kr+"(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*",Lr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ur=Sr+Er+Wr,Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+_r+"?",_r,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(_r,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,Cr,Lr,vr,Br].join("|"),"g"),Nr=RegExp("["+kr+Yt+tr+ar+"]"),Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={};
+Kr[at]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=!0,Kr[Dn]=Kr[Mn]=Kr[ft]=Kr[Nn]=Kr[ct]=Kr[Pn]=Kr[Zn]=Kr[Kn]=Kr[Gn]=Kr[Hn]=Kr[Yn]=Kr[nt]=Kr[tt]=Kr[rt]=Kr[it]=!1;var Vr={};Vr[Dn]=Vr[Mn]=Vr[ft]=Vr[ct]=Vr[Nn]=Vr[Pn]=Vr[at]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[Gn]=Vr[Hn]=Vr[Yn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[et]=Vr[_t]=Vr[vt]=Vr[gt]=Vr[yt]=!0,Vr[Zn]=Vr[Kn]=Vr[it]=!1;var Gr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a",
+"\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae",
+"\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g",
+"\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O",
+"\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w",
+"\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof global&&global&&global.Object===Object&&global,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ee&&"object"==typeof module&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){
+try{var n=ue&&ue.require&&ue.require("util").types;return n?n:oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x(Gr),ge=x(Hr),ye=x(Jr),de=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ct)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,
+this.__index__=0,this.__values__=X}function Ct(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Un,this.__views__=[]}function $t(){var n=new Ct(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n}function Yt(){if(this.__filtered__){var n=new Ct(this);n.__dir__=-1,
+n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Qt(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=Oi(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h-1}function lr(n,t){var r=this.__data__,e=Wr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function sr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Fr(n,t,e,u,i,o){var f,c=t&an,a=t&ln,l=t&sn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=zi(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Kn||h==Vn;if(mh(n))return Iu(n,c);if(h==Yn||h==Dn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?Mu(n,Ur(f,n)):Du(n,Cr(f,n))}else{if(!Vr[h])return i?n:{};f=Si(n,h,c)}}o||(o=new wr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach(function(r){f.add(Fr(r,t,e,r,n,o))}):jh(n)&&n.forEach(function(r,u){
+f.set(u,Fr(r,t,e,u,n,o))});var v=l?a?di:yi:a?qc:Pc,g=s?X:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),Sr(f,u,Fr(r,t,e,u,n,o))}),f}function Nr(n){var t=Pc(n);return function(r){return Pr(r,n,t)}}function Pr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Gr(n,t,r){if("function"!=typeof n)throw new pl(en);return Ws(function(){n.apply(X,r)},t)}function Hr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length;
+if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=!1):t.length>=tn&&(i=S,a=!1,t=new yr(t));n:for(;++uu?0:u+r),
+e=e===X||e>u?u:kc(e),e<0&&(e+=u),e=r>e?0:Oc(e);r0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,function(t){return uc(n[t])})}function _e(n,t){t=ku(t,n);for(var r=0,e=t.length;null!=n&&rt}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function Ae(n,t,r){return n>=Hl(t,r)&&n=120&&p.length>=120)?new yr(a&&p):X}p=n[0];
+var _=-1,v=l[0];n:for(;++_-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){
+var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function ru(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}function eu(n,t){var r="";if(!n||t<1||t>Wn)return r;do t%2&&(r+=n),t=Nl(t/2),t&&(n+=n);while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Ir(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Mr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;t=ku(t,n);
+for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++uu?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o=tn){var s=t?null:ks(n);if(s)return P(s);c=!1,u=S,l=new yr}else l=t?[]:a;n:for(;++e=e?n:au(n,t,r)}function Iu(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r);
+return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function zu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Eu(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}function Su(n){return _s?ll(_s.call(n)):{}}function Wu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=bc(n),o=t!==X,f=null===t,c=t===t,a=bc(t);
+if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e-1?u[i?t[o]:o]:X}}function Yu(n){return gi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],!0)}for(e=o?e:r;++e1&&d.reverse(),s&&cf))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&pn?new yr:X;for(i.set(n,t),i.set(t,n);++s1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Ut,"{\n/* [wrapped with "+t+"] */\n")}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n;
+return t=null==t?Wn:t,!!t&&("number"==r||"symbol"!=r&&Vt.test(n))&&n>-1&&n%1==0&&n0){if(++t>=On)return arguments[0]}else t=0;
+return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}}function uf(){return this}function of(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function ff(){var n=this.__wrapped__;if(n instanceof Ct){var t=n;return this.__actions__.length&&(t=new Ct(this)),t=t.reverse(),t.__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo);
+}function cf(){return wu(this.__wrapped__,this.__actions__)}function af(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function lf(n,t){return(bh(n)?i:te)(n,mi(t,3))}function sf(n,t){return ee(yf(n,t),1)}function hf(n,t){return ee(yf(n,t),Sn)}function pf(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function gf(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)),
+dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function df(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),r=e?X:r,bh(r)||(r=null==r?[]:[r]),He(n,t,r))}function bf(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)}function wf(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)}function mf(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))}function xf(n){return(bh(n)?Ir:iu)(n)}function jf(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),
+(bh(n)?Rr:ou)(n,t)}function Af(n){return(bh(n)?zr:cu)(n)}function kf(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Gn||t==tt?n.size:Me(n).length}function Of(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function If(n,t){if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,mn,X,X,X,X,t)}function zf(n,t){var r;if("function"!=typeof t)throw new pl(en);
+return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Ef(n,t,r){t=r?X:t;var e=ai(n,yn,X,X,X,X,X,t);return e.placeholder=Ef.placeholder,e}function Sf(n,t,r){t=r?X:t;var e=ai(n,dn,X,X,X,X,X,t);return e.placeholder=Sf.placeholder,e}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Ws(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Hl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=_;
+}function f(){var n=fh();return o(n)?c(n):(g=Ws(f,i(n)),X)}function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function a(){g!==X&&As(g),d=0,h=y=p=g=X}function l(){return g===X?v:c(fh())}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new pl(en);return t=Ic(t)||0,fc(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Gl(Ic(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m),
+s.cancel=a,s.flush=l,s}function Lf(n){return ai(n,jn)}function Cf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||sr),r}function Uf(n){if("function"!=typeof n)throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:
+return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Bf(n){return zf(2,n)}function Tf(n,t){if("function"!=typeof n)throw new pl(en);return t=t===X?t:kc(t),uu(n,t)}function $f(t,r){if("function"!=typeof t)throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu(function(e){var u=e[r],i=Ou(e,0,r);return u&&a(i,u),n(t,this,i)})}function Df(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),
+Wf(n,t,{leading:e,maxWait:t,trailing:u})}function Mf(n){return Rf(n,1)}function Ff(n,t){return ph(Au(t),n)}function Nf(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]}function Pf(n){return Fr(n,sn)}function qf(n,t){return t="function"==typeof t?t:X,Fr(n,sn,t)}function Zf(n){return Fr(n,an|sn)}function Kf(n,t){return t="function"==typeof t?t:X,Fr(n,an|sn,t)}function Vf(n,t){return null==t||Pr(n,t,Pc(t))}function Gf(n,t){return n===t||n!==n&&t!==t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n);
+}function Jf(n){return cc(n)&&Hf(n)}function Yf(n){return n===!0||n===!1||cc(n)&&we(n)==Nn}function Qf(n){return cc(n)&&1===n.nodeType&&!gc(n)}function Xf(n){if(null==n)return!0;if(Hf(n)&&(bh(n)||"string"==typeof n||"function"==typeof n.splice||mh(n)||Oh(n)||dh(n)))return!n.length;var t=zs(n);if(t==Gn||t==tt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return!1;return!0}function nc(n,t){return Se(n,t)}function tc(n,t,r){r="function"==typeof r?r:X;var e=r?r(n,t):X;return e===X?Se(n,t,X,r):!!e;
+}function rc(n){if(!cc(n))return!1;var t=we(n);return t==Zn||t==qn||"string"==typeof n.message&&"string"==typeof n.name&&!gc(n)}function ec(n){return"number"==typeof n&&Zl(n)}function uc(n){if(!fc(n))return!1;var t=we(n);return t==Kn||t==Vn||t==Fn||t==Xn}function ic(n){return"number"==typeof n&&n==kc(n)}function oc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Wn}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&"object"==typeof n}function ac(n,t){
+return n===t||Ce(n,t,ji(t))}function lc(n,t,r){return r="function"==typeof r?r:X,Ce(n,t,ji(t),r)}function sc(n){return vc(n)&&n!=+n}function hc(n){if(Es(n))throw new fl(rn);return Ue(n)}function pc(n){return null===n}function _c(n){return null==n}function vc(n){return"number"==typeof n||cc(n)&&we(n)==Hn}function gc(n){if(!cc(n)||we(n)!=Yn)return!1;var t=El(n);if(null===t)return!0;var r=bl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&dl.call(r)==jl}function yc(n){
+return ic(n)&&n>=-Wn&&n<=Wn}function dc(n){return"string"==typeof n||!bh(n)&&cc(n)&&we(n)==rt}function bc(n){return"symbol"==typeof n||cc(n)&&we(n)==et}function wc(n){return n===X}function mc(n){return cc(n)&&zs(n)==it}function xc(n){return cc(n)&&we(n)==ot}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return D(n[Ul]());var t=zs(n);return(t==Gn?M:t==tt?P:ra)(n)}function Ac(n){if(!n)return 0===n?n:0;if(n=Ic(n),n===Sn||n===-Sn){return(n<0?-1:1)*Ln}return n===n?n:0}function kc(n){
+var t=Ac(n),r=t%1;return t===t?r?t-r:t:0}function Oc(n){return n?Mr(kc(n),0,Un):0}function Ic(n){if("number"==typeof n)return n;if(bc(n))return Cn;if(fc(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=fc(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=R(n);var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Cn:+n}function Rc(n){return $u(n,qc(n))}function zc(n){return n?Mr(kc(n),-Wn,Wn):0===n?n:0}function Ec(n){return null==n?"":vu(n)}function Sc(n,t){var r=gs(n);return null==t?r:Cr(r,t);
+}function Wc(n,t){return v(n,mi(t,3),ue)}function Lc(n,t){return v(n,mi(t,3),oe)}function Cc(n,t){return null==n?n:bs(n,mi(t,3),qc)}function Uc(n,t){return null==n?n:ws(n,mi(t,3),qc)}function Bc(n,t){return n&&ue(n,mi(t,3))}function Tc(n,t){return n&&oe(n,mi(t,3))}function $c(n){return null==n?[]:fe(n,Pc(n))}function Dc(n){return null==n?[]:fe(n,qc(n))}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Fc(n,t){return null!=n&&Ri(n,t,xe)}function Nc(n,t){return null!=n&&Ri(n,t,je);
+}function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,!0):Fe(n)}function Zc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,t(n,e,u),n)}),r}function Kc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,e,t(n,e,u))}),r}function Vc(n,t){return Gc(n,Uf(mi(t)))}function Gc(n,t){if(null==n)return{};var r=c(di(n),function(n){return[n]});return t=mi(t),Ye(n,r,function(n,r){return t(n,r[0])})}function Hc(n,t,r){t=ku(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++et){
+var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return n=Ec(n),n&&n.replace(Gt,ve).replace(Dr,"")}function aa(n,t,r){n=Ec(n),t=vu(t);var e=n.length;r=r===X?e:Mr(kc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function la(n){return n=Ec(n),n&&At.test(n)?n.replace(xt,ge):n}function sa(n){return n=Ec(n),n&&Wt.test(n)?n.replace(St,"\\$&"):n}function ha(n,t,r){n=Ec(n),t=kc(t);
+var e=t?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)}function pa(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e>>0)?(n=Ec(n),n&&("string"==typeof t||null!=t&&!Ah(t))&&(t=vu(t),!t&&T(n))?Ou(G(n),0,r):n.split(t,r)):[]}function ba(n,t,r){return n=Ec(n),r=null==r?0:Mr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t}function wa(n,t,r){var e=Z.templateSettings;r&&Ui(n,t,r)&&(t=X),n=Ec(n),t=Sh({},t,e,li);var u,i,o=Sh({},t.imports,e.imports,li),f=Pc(o),c=E(o,f),a=0,l=t.interpolate||Ht,s="__p += '",h=sl((t.escape||Ht).source+"|"+l.source+"|"+(l===It?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+(bl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zr+"]")+"\n";
+n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Jt,U),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=bl.call(t,"variable")&&t.variable;if(_){if(Dt.test(_))throw new fl(un)}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(dt,""):s).replace(bt,"$1").replace(wt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";
+var v=Xh(function(){return cl(f,p+"return "+s).apply(X,c)});if(v.source=s,rc(v))throw v;return v}function ma(n){return Ec(n).toLowerCase()}function xa(n){return Ec(n).toUpperCase()}function ja(n,t,r){if(n=Ec(n),n&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Ou(e,W(e,u),L(e,u)+1).join("")}function Aa(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,0,L(e,G(t))+1).join("")}function ka(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.replace(Lt,"");
+if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,W(e,G(t))).join("")}function Oa(n,t){var r=An,e=kn;if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}n=Ec(n);var i=n.length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Ou(o,0,f).join(""):n.slice(0,f);if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Nt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index;
+c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function Ia(n){return n=Ec(n),n&&jt.test(n)?n.replace(mt,ye):n}function Ra(n,t,r){return n=Ec(n),t=r?X:t,t===X?$(n)?Q(n):_(n):n.match(t)||[]}function za(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]}):[],uu(function(e){for(var u=-1;++uWn)return[];var r=Un,e=Hl(n,Un);t=mi(t),n-=Un;for(var u=O(e,t);++r1?n[t-1]:X;return r="function"==typeof r?(n.pop(),
+r):X,Ho(n,r)}),Qs=gi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ct&&Ci(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),Xs=Fu(function(n,t,r){bl.call(n,r)?++n[r]:Br(n,r,1)}),nh=Ju(ho),th=Ju(po),rh=Fu(function(n,t,r){bl.call(n,r)?n[r].push(t):Br(n,r,[t])}),eh=uu(function(t,r,e){var u=-1,i="function"==typeof r,o=Hf(t)?il(t.length):[];
+return ys(t,function(t){o[++u]=i?n(r,t,e):Ie(t,r,e)}),o}),uh=Fu(function(n,t,r){Br(n,r,t)}),ih=Fu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),oh=uu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])}),fh=Dl||function(){return re.Date.now()},ch=uu(function(n,t,r){var e=_n;if(r.length){var u=N(r,wi(ch));e|=bn}return ai(n,e,t,r,u)}),ah=uu(function(n,t,r){var e=_n|vn;if(r.length){var u=N(r,wi(ah));e|=bn;
+}return ai(t,e,n,r,u)}),lh=uu(function(n,t){return Gr(n,1,t)}),sh=uu(function(n,t,r){return Gr(n,Ic(t)||0,r)});Cf.Cache=sr;var hh=js(function(t,r){r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()));var e=r.length;return uu(function(u){for(var i=-1,o=Hl(u.length,e);++i=t}),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):ze,mh=ql||qa,xh=ae?z(ae):Ee,jh=le?z(le):Le,Ah=se?z(se):Be,kh=he?z(he):Te,Oh=pe?z(pe):$e,Ih=ii(Ne),Rh=ii(function(n,t){return n<=t}),zh=Nu(function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Sr(n,r,t[r])}),Eh=Nu(function(n,t){$u(t,qc(t),n)}),Sh=Nu(function(n,t,r,e){$u(t,qc(t),n,e)}),Wh=Nu(function(n,t,r,e){$u(t,Pc(t),n,e);
+}),Lh=gi(Tr),Ch=uu(function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r1),t}),$u(n,di(n),r),e&&(r=Fr(r,an|ln|sn,hi));for(var u=t.length;u--;)yu(r,t[u]);return r}),Nh=gi(function(n,t){return null==n?{}:Je(n,t)}),Ph=ci(Pc),qh=ci(qc),Zh=Vu(function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)}),Kh=Vu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vh=Vu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gh=Ku("toLowerCase"),Hh=Vu(function(n,t,r){
+return n+(r?"_":"")+t.toLowerCase()}),Jh=Vu(function(n,t,r){return n+(r?" ":"")+Qh(t)}),Yh=Vu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qh=Ku("toUpperCase"),Xh=uu(function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}}),np=gi(function(n,t){return r(t,function(t){t=no(t),Br(n,t,ch(n[t],n))}),n}),tp=Yu(),rp=Yu(!0),ep=uu(function(n,t){return function(r){return Ie(r,n,t)}}),up=uu(function(n,t){return function(r){return Ie(n,r,t)}}),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(!0),lp=ni(function(n,t){
+return n+t},0),sp=fi("ceil"),hp=ni(function(n,t){return n/t},1),pp=fi("floor"),_p=ni(function(n,t){return n*t},1),vp=fi("round"),gp=ni(function(n,t){return n-t},0);return Z.after=If,Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=Nf,Z.chain=Qo,Z.chunk=uo,Z.compact=io,Z.concat=oo,Z.cond=za,Z.conforms=Ea,Z.constant=Sa,Z.countBy=Xs,Z.create=Sc,Z.curry=Ef,Z.curryRight=Sf,Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh,
+Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=fo,Z.dropRight=co,Z.dropRightWhile=ao,Z.dropWhile=lo,Z.fill=so,Z.filter=lf,Z.flatMap=sf,Z.flatMapDeep=hf,Z.flatMapDepth=pf,Z.flatten=_o,Z.flattenDeep=vo,Z.flattenDepth=go,Z.flip=Lf,Z.flow=tp,Z.flowRight=rp,Z.fromPairs=yo,Z.functions=$c,Z.functionsIn=Dc,Z.groupBy=rh,Z.initial=mo,Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc,
+Z.map=yf,Z.mapKeys=Zc,Z.mapValues=Kc,Z.matches=Ua,Z.matchesProperty=Ba,Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=Ma,Z.omit=Fh,Z.omitBy=Vc,Z.once=Bf,Z.orderBy=df,Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=Na,Z.pull=Fs,Z.pullAll=Oo,Z.pullAllBy=Io,Z.pullAllWith=Ro,Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=mf,Z.remove=zo,Z.rest=Tf,
+Z.reverse=Eo,Z.sampleSize=jf,Z.set=Jc,Z.setWith=Yc,Z.shuffle=Af,Z.slice=So,Z.sortBy=oh,Z.sortedUniq=$o,Z.sortedUniqBy=Do,Z.split=da,Z.spread=$f,Z.tail=Mo,Z.take=Fo,Z.takeRight=No,Z.takeRightWhile=Po,Z.takeWhile=qo,Z.tap=Xo,Z.throttle=Df,Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=Ha,Z.toPlainObject=Rc,Z.transform=Qc,Z.unary=Mf,Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=Zo,Z.uniqBy=Ko,Z.uniqWith=Vo,Z.unset=Xc,Z.unzip=Go,Z.unzipWith=Ho,Z.update=na,Z.updateWith=ta,Z.values=ra,Z.valuesIn=ea,
+Z.without=Ks,Z.words=Ra,Z.wrap=Ff,Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=Jo,Z.zipObjectDeep=Yo,Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=ua,Z.clone=Pf,Z.cloneDeep=Zf,Z.cloneDeepWith=Kf,Z.cloneWith=qf,Z.conformsTo=Vf,Z.deburr=ca,Z.defaultTo=Wa,Z.divide=hp,Z.endsWith=aa,Z.eq=Gf,Z.escape=la,Z.escapeRegExp=sa,Z.every=af,Z.find=nh,Z.findIndex=ho,Z.findKey=Wc,Z.findLast=th,Z.findLastIndex=po,
+Z.findLastKey=Lc,Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=Cc,Z.forInRight=Uc,Z.forOwn=Bc,Z.forOwnRight=Tc,Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=Fc,Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=gf,Z.indexOf=wo,Z.inRange=ia,Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=Yf,Z.isBuffer=mh,Z.isDate=xh,Z.isElement=Qf,Z.isEmpty=Xf,Z.isEqual=nc,Z.isEqualWith=tc,Z.isError=rc,Z.isFinite=ec,Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh,
+Z.isMatch=ac,Z.isMatchWith=lc,Z.isNaN=sc,Z.isNative=hc,Z.isNil=_c,Z.isNull=pc,Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=yc,Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Oh,Z.isUndefined=wc,Z.isWeakMap=mc,Z.isWeakSet=xc,Z.join=xo,Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=Ao,Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Ih,Z.lte=Rh,Z.max=Ya,Z.maxBy=Qa,Z.mean=Xa,Z.meanBy=nl,Z.min=tl,Z.minBy=rl,Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=Za,Z.stubString=Ka,
+Z.stubTrue=Va,Z.multiply=_p,Z.nth=ko,Z.noConflict=$a,Z.noop=Da,Z.now=fh,Z.pad=ha,Z.padEnd=pa,Z.padStart=_a,Z.parseInt=va,Z.random=oa,Z.reduce=bf,Z.reduceRight=wf,Z.repeat=ga,Z.replace=ya,Z.result=Hc,Z.round=vp,Z.runInContext=p,Z.sample=xf,Z.size=kf,Z.snakeCase=Hh,Z.some=Of,Z.sortedIndex=Wo,Z.sortedIndexBy=Lo,Z.sortedIndexOf=Co,Z.sortedLastIndex=Uo,Z.sortedLastIndexBy=Bo,Z.sortedLastIndexOf=To,Z.startCase=Jh,Z.startsWith=ba,Z.subtract=gp,Z.sum=el,Z.sumBy=ul,Z.template=wa,Z.times=Ga,Z.toFinite=Ac,Z.toInteger=kc,
+Z.toLength=Oc,Z.toLower=ma,Z.toNumber=Ic,Z.toSafeInteger=zc,Z.toString=Ec,Z.toUpper=xa,Z.trim=ja,Z.trimEnd=Aa,Z.trimStart=ka,Z.truncate=Oa,Z.unescape=Ia,Z.uniqueId=Ja,Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,function(t,r){bl.call(Z.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),Z.VERSION=nn,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Z[n].placeholder=Z}),r(["drop","take"],function(n,t){Ct.prototype[n]=function(r){
+r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ct(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Un),type:n+(e.__dir__<0?"Right":"")}),e},Ct.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==Rn||r==En;Ct.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){
+var r="take"+(t?"Right":"");Ct.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[r](1)}}),Ct.prototype.compact=function(){return this.filter(La)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=uu(function(n,t){return"function"==typeof n?new Ct(this):this.map(function(r){
+return Ie(r,n,t)})}),Ct.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ct.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ct(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=kc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(Un)},ue(Ct.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);
+u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ct,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ct(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){
+var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r](function(r){return t.apply(bh(r)?r:[],n)})}}),ue(Ct.prototype,function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}}),fs[Qu(X,vn).name]=[{name:"wrapper",func:X}],Ct.prototype.clone=$t,Ct.prototype.reverse=Yt,Ct.prototype.value=Qt,Z.prototype.at=Qs,
+Z.prototype.chain=tf,Z.prototype.commit=rf,Z.prototype.next=ef,Z.prototype.plant=of,Z.prototype.reverse=ff,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=cf,Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=uf),Z},be=de();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=be,define(function(){return be})):ue?((ue.exports=be)._=be,ee._=be):re._=be}).call(this);
\ No newline at end of file
diff --git a/src/main/java/com/yutou/biliapi/api/LoginApi.java b/src/main/java/com/yutou/biliapi/api/LoginApi.java
index 0512835..270bd0c 100644
--- a/src/main/java/com/yutou/biliapi/api/LoginApi.java
+++ b/src/main/java/com/yutou/biliapi/api/LoginApi.java
@@ -33,9 +33,9 @@ public interface LoginApi {
Call> getCorrespond(@Path("correspondPath") String correspondPath);
@GET("/x/passport-login/web/cookie/refresh")
- Call> refreshCookie(@Query("csrf") String csrf
+ Call> refreshCookie(@Query("csrf") String bili_jct
, @Query("refresh_csrf") String refresh_csrf
, @Query("source") String source
- , @Query("refresh_token") String ac_time_value
+ , @Query("refresh_token") String refresh_token
);
}
diff --git a/src/main/java/com/yutou/biliapi/bean/live/database/LiveSuperChatDatabaseBean.java b/src/main/java/com/yutou/biliapi/bean/live/database/LiveSuperChatDatabaseBean.java
index 91863cf..3c6e457 100644
--- a/src/main/java/com/yutou/biliapi/bean/live/database/LiveSuperChatDatabaseBean.java
+++ b/src/main/java/com/yutou/biliapi/bean/live/database/LiveSuperChatDatabaseBean.java
@@ -25,6 +25,10 @@ public class LiveSuperChatDatabaseBean extends AbsDatabasesBean {
private String message_trans;
@JSONField(name = "message_font_color")
private String message_font_color;
+ @JSONField(name = "background_bottom_color")
+ private String backgroundBottomColor;
+ @JSONField(name = "user_name_color")
+ private String userNameColor;
@JSONField(name ="user_name")
private String userName;
@JSONField(name ="user_avatar")
@@ -40,9 +44,13 @@ public class LiveSuperChatDatabaseBean extends AbsDatabasesBean {
uid = bean.getUid();
start_time = bean.getStart_time();
end_time = bean.getEnd_time();
+ userName= bean.getUserName();
+ userAvatar = bean.getUserAvatar();
message = bean.getMessage();
message_trans = bean.getMessage_trans();
message_font_color = bean.getMessage_font_color();
+ backgroundBottomColor=bean.getBackground_bottom_color();
+ userNameColor=bean.getUserNameColor();
}
diff --git a/src/main/java/com/yutou/biliapi/bean/websocket/live/WSSuperChatMessage.java b/src/main/java/com/yutou/biliapi/bean/websocket/live/WSSuperChatMessage.java
index d917308..0307981 100644
--- a/src/main/java/com/yutou/biliapi/bean/websocket/live/WSSuperChatMessage.java
+++ b/src/main/java/com/yutou/biliapi/bean/websocket/live/WSSuperChatMessage.java
@@ -21,7 +21,10 @@ public class WSSuperChatMessage extends WSData{
private String message_trans;
private String message_font_color;
private String userName;
+ private String userNameColor;
private String userAvatar;
+ private String background_bottom_color;
+
public static void main(String[] args) {
@@ -42,5 +45,7 @@ public class WSSuperChatMessage extends WSData{
setMessage_font_color(data.getString("message_font_color"));
setUserName(data.getJSONObject("user_info").getString("uname"));
setUserAvatar(data.getJSONObject("user_info").getString("face"));
+ setUserNameColor(data.getJSONObject("user_info").getString("name_color"));
+ setBackground_bottom_color(data.getString("background_bottom_color"));
}
}
diff --git a/src/main/java/com/yutou/biliapi/databases/BiliBiliLoginDatabase.java b/src/main/java/com/yutou/biliapi/databases/BiliBiliLoginDatabase.java
index d4ca398..f64f289 100644
--- a/src/main/java/com/yutou/biliapi/databases/BiliBiliLoginDatabase.java
+++ b/src/main/java/com/yutou/biliapi/databases/BiliBiliLoginDatabase.java
@@ -36,8 +36,17 @@ public class BiliBiliLoginDatabase extends SQLiteManager {
public BiliBiliLoginDatabase initData(LoginCookieDatabaseBean cookie, LoginUserDatabaseBean user) {
this.cookie = cookie;
cookie.setTableName(getDataBean().get(0).getTableName());
- add(cookie);
- add(user);
+ LoginCookieDatabaseBean old = getCookie(cookie.getDedeUserID());
+ if (old == null) {
+ add(cookie);
+ add(user);
+ }else{
+ cookie.setSql_time(old.getSql_time());
+ LoginUserDatabaseBean oldUser = getUser(cookie.getDedeUserID());
+ user.setSql_time(oldUser.getSql_time());
+ update(cookie);
+ update(user);
+ }
return this;
}
@@ -54,7 +63,8 @@ public class BiliBiliLoginDatabase extends SQLiteManager {
return null;
}
- public List getAllCookies(){
+
+ public List getAllCookies() {
return super.get(cookie.getTableName(), LoginCookieDatabaseBean.class);
}
@@ -75,7 +85,7 @@ public class BiliBiliLoginDatabase extends SQLiteManager {
JSONArray jsonArray = super.getJSONArray(new LoginUserDatabaseBean(null).getTableName());
List list = new ArrayList<>();
for (Object o : jsonArray) {
- JSONObject json= (JSONObject) o;
+ JSONObject json = (JSONObject) o;
list.add(new LoginUserDatabaseBean(json.to(UserInfoBean.class)));
}
return list;
diff --git a/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java b/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java
index 661c364..6f9481c 100644
--- a/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java
+++ b/src/main/java/com/yutou/biliapi/databases/BiliLiveDatabase.java
@@ -86,21 +86,32 @@ public class BiliLiveDatabase extends SQLiteManager {
}
private void addData(WSData bean) {
+ addData(bean, null);
+ }
+
+ private void addData(WSData bean, Long saveTime) {
+ AbsDatabasesBean data = null;
if (bean instanceof WSDanmuData) {
- add(new LiveDanmuDatabaseBean((WSDanmuData) bean));
+ data = new LiveDanmuDatabaseBean((WSDanmuData) bean);
} else if (bean instanceof WSInteractWord) {
- add(new LiveInteractWordDatabaseBean((WSInteractWord) bean));
+ data = new LiveInteractWordDatabaseBean((WSInteractWord) bean);
} else if (bean instanceof WSSendGift) {
- add(new LiveGiftDatabaseBean((WSSendGift) bean));
+ data = new LiveGiftDatabaseBean((WSSendGift) bean);
} else if (bean instanceof WSSuperChatMessage) {
- add(new LiveSuperChatDatabaseBean((WSSuperChatMessage) bean));
+ data = new LiveSuperChatDatabaseBean((WSSuperChatMessage) bean);
} else if (bean instanceof WSGuardBuy) {
- add(new LiveGuardBuyBean((WSGuardBuy) bean));
+ data = new LiveGuardBuyBean((WSGuardBuy) bean);
+ }
+ if (saveTime != null && data != null) {
+ data.setSql_time(new Date(saveTime));
+ }
+ if (data != null) {
+ add(data);
}
}
public void addSource(WSData bean) {
- Log.i("BiliLiveDatabase.addSource",config.getRoomId());
+ Log.i("BiliLiveDatabase.addSource", config.getRoomId());
add(new LiveSourceDatabaseBean(bean));
addData(bean);
}
@@ -138,7 +149,8 @@ public class BiliLiveDatabase extends SQLiteManager {
}
return super.get(tableName, where, clazz);
}
- public void resetSQL(){
+
+ public void resetSQL() {
List list = List.of(
new LiveInfoDatabaseBean(),
new LiveDanmuDatabaseBean(),
@@ -152,16 +164,18 @@ public class BiliLiveDatabase extends SQLiteManager {
}
recreateSql(list);
}
- public void resetData(){
+
+ public void resetData() {
List list = get(new LiveSourceDatabaseBean().getTableName(), LiveSourceDatabaseBean.class);
for (LiveSourceDatabaseBean item : list) {
WSData data = WSData.parse(JSONObject.parseObject(item.getJson()));
- addData(data);
+ addData(data, item.getSql_time().getTime());
}
}
+
public static void main(String[] args) {
- BiliLiveDatabase biliLiveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig("5265"));
- // biliLiveDatabase.resetSQL();
+ BiliLiveDatabase biliLiveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig("7688602"));
+ biliLiveDatabase.resetSQL();
biliLiveDatabase.resetData();
}
diff --git a/src/main/java/com/yutou/biliapi/net/BiliCookieManager.java b/src/main/java/com/yutou/biliapi/net/BiliCookieManager.java
index 788e1ab..a5cd613 100644
--- a/src/main/java/com/yutou/biliapi/net/BiliCookieManager.java
+++ b/src/main/java/com/yutou/biliapi/net/BiliCookieManager.java
@@ -2,7 +2,9 @@ package com.yutou.biliapi.net;
import com.yutou.biliapi.api.LoginApi;
import com.yutou.biliapi.bean.login.LoginCookieDatabaseBean;
+import com.yutou.biliapi.bean.login.LoginInfoBean;
import com.yutou.common.okhttp.FileBody;
+import com.yutou.common.okhttp.HttpBody;
import com.yutou.common.utils.Log;
import com.yutou.common.utils.WebClient;
import org.apache.commons.io.FileUtils;
@@ -73,18 +75,26 @@ public class BiliCookieManager {
return htmlContent;
}
- public static void resetCookie(LoginCookieDatabaseBean cookie) {
+ public static boolean resetCookie(LoginCookieDatabaseBean cookie) {
try {
LoginApi api = BiliLoginNetApiManager.getInstance().getLoginApi(cookie.getDedeUserID());
String correspondPath = getCorrespondPath(String.format("refresh_%d", System.currentTimeMillis()));
System.out.println("correspondPath = " + correspondPath);
Response> body = api.getCorrespond(correspondPath).execute();
+ if(body.code()==404){
+ return false;
+ }
+ System.out.println("body.code() = " + body.code());
String string = IOUtils.toString(body.body().getInputStream(), StandardCharsets.UTF_8);
String refreshCsrf = getRefreshCsrf(string);
System.out.println("body = " + refreshCsrf);
-
+ Response> newCookie = api.refreshCookie(cookie.getBiliJct(), refreshCsrf, "main_web", cookie.getRefreshToken()).execute();
+ LoginCookieDatabaseBean nc = BiliLoginNetApiManager.getInstance().getCookie(newCookie.headers(), newCookie.body());
+ nc.setGourl(cookie.getGourl());
+ return true;
} catch (Exception e) {
- e.printStackTrace();
+ Log.e(e);
+ return false;
}
}
}
diff --git a/src/main/java/com/yutou/biliapi/net/BiliLoginNetApiManager.java b/src/main/java/com/yutou/biliapi/net/BiliLoginNetApiManager.java
index 04dbe51..bb4249c 100644
--- a/src/main/java/com/yutou/biliapi/net/BiliLoginNetApiManager.java
+++ b/src/main/java/com/yutou/biliapi/net/BiliLoginNetApiManager.java
@@ -82,46 +82,48 @@ public class BiliLoginNetApiManager extends BaseApi {
try {
Response> response = loginApi.loginQRCode(oauthKey).execute();
- Headers headers = response.headers();
- HttpBody httpBody = response.body();
- if (httpBody.getData().getCode() == 0) {
- JSONObject ck = new JSONObject();
- List list = headers.values("set-cookie");
- for (String cookie : list) {
- String[] split = cookie.split(";");
- for (String string : split) {
- if (!ck.containsKey(string) && StringUtils.hasText(string) && string.contains("=")) {
- String key = string.split("=")[0].trim();
- String value = string.split("=")[1].trim();
- if (key.contains("Expires")) {
- SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMMM yyyy HH:mm:ss z", Locale.ENGLISH);
- sdf.setTimeZone(TimeZone.getDefault());
- Date date = sdf.parse(value, new ParsePosition(0));
- value = String.valueOf(date.getTime() / 1000);
- }
- ck.put(key, value);
- }
- }
- }
- if (!list.isEmpty()) {
- ck.put("gourl", bd);
- LoginCookieDatabaseBean cookie = JSONObject.parseObject(ck.toString(), LoginCookieDatabaseBean.class);
- cookie.setRefreshToken(httpBody.getData().getRefresh_token());
- cancel();
- callback.onResponse(headers, LOGIN_SUCCESS, "ok", cookie, ck.toString());
+ LoginCookieDatabaseBean cookie = getCookie(response.headers(), response.body());
+ if (cookie != null) {
+ cookie.setGourl(bd);
+ cancel();
+ callback.onResponse(response.headers(), LOGIN_SUCCESS, "ok", cookie, JSONObject.toJSONString(cookie));
- } else {
- callback.onFailure(new RuntimeException("cookie为空"));
- cancel();
- }
}
- } catch (IOException e) {
+ } catch (
+ IOException e) {
cancel();
throw new RuntimeException(e);
}
-
}
}, 1000, 3000);
}
-}
+ public LoginCookieDatabaseBean getCookie(Headers headers, HttpBody httpBody) {
+ if (httpBody.getData().getCode() == 0) {
+ JSONObject ck = new JSONObject();
+ List list = headers.values("set-cookie");
+ for (String cookie : list) {
+ String[] split = cookie.split(";");
+ for (String string : split) {
+ if (!ck.containsKey(string) && StringUtils.hasText(string) && string.contains("=")) {
+ String key = string.split("=")[0].trim();
+ String value = string.split("=")[1].trim();
+ if (key.contains("Expires")) {
+ SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMMM yyyy HH:mm:ss z", Locale.ENGLISH);
+ sdf.setTimeZone(TimeZone.getDefault());
+ Date date = sdf.parse(value, new ParsePosition(0));
+ value = String.valueOf(date.getTime() / 1000);
+ }
+ ck.put(key, value);
+ }
+ }
+ }
+
+ LoginCookieDatabaseBean cookie = JSONObject.parseObject(ck.toString(), LoginCookieDatabaseBean.class);
+ cookie.setRefreshToken(httpBody.getData().getRefresh_token());
+ return cookie;
+ } else {
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/yutou/bilibili/Controllers/BiliUserController.java b/src/main/java/com/yutou/bilibili/Controllers/BiliUserController.java
index f639f45..26ce84d 100644
--- a/src/main/java/com/yutou/bilibili/Controllers/BiliUserController.java
+++ b/src/main/java/com/yutou/bilibili/Controllers/BiliUserController.java
@@ -12,6 +12,7 @@ import com.yutou.biliapi.net.BiliCookieManager;
import com.yutou.biliapi.net.BiliLoginNetApiManager;
import com.yutou.biliapi.net.BiliUserNetApiManager;
import com.yutou.bilibili.datas.ResultData;
+import com.yutou.bilibili.datas.ReturnCode;
import com.yutou.bilibili.services.LiveLoginService;
import com.yutou.common.okhttp.HttpBody;
import com.yutou.common.okhttp.HttpCallback;
@@ -49,14 +50,14 @@ public class BiliUserController {
JSONObject json = new JSONObject();
json.put("uid", bean.getUserInfo().getMid());
json.put("uname", bean.getUserInfo().getUname());
- json.put("face",bean.getUserInfo().getFace());
- json.put("sql_time",bean.getSql_time());
+ json.put("face", bean.getUserInfo().getFace());
+ json.put("sql_time", bean.getSql_time());
try {
CheckCookieBean cookie = api.checkCookie().execute().body().getData();
if (cookie == null) {
json.put("status", "无效");
} else {
- json.put("status", cookie.isRefresh()?"待刷新":"正常");
+ json.put("status", cookie.isRefresh() ? "待刷新" : "正常");
}
} catch (IOException e) {
Log.e(e);
@@ -72,11 +73,23 @@ public class BiliUserController {
public JSONObject login(HttpServletRequest request) {
HttpSession session = request.getSession();
Object loginToken = session.getAttribute("loginToken");
+ ReturnCode returnCode;
if (loginToken == null) {
loginToken = UUID.randomUUID().toString();
+ returnCode = ReturnCode.RC301;
session.setAttribute("loginToken", loginToken);
+ return ResultData.success(loginToken.toString(), -1, returnCode);
+ } else {
+ returnCode = ReturnCode.RC300;
}
- return ResultData.success(login(loginToken.toString()));
+ JSONObject login = login(loginToken.toString());
+ if (login != null && login.containsKey("qrcode")) {
+ return ResultData.success(login, -1, returnCode);
+ } else if (login != null) {
+ return ResultData.success(ReturnCode.RC302);
+ }
+ returnCode = ReturnCode.RC301;
+ return ResultData.success(loginToken.toString(), -1, returnCode);
}
@@ -112,7 +125,7 @@ public class BiliUserController {
throw new RuntimeException(e);
}
}
- RedisTools.set(loginToken, json.toString(), 60 * 60);
+ RedisTools.set(loginToken, json.toString(), 60);
}
@Override
@@ -124,7 +137,7 @@ public class BiliUserController {
}
public static void main(String[] args) {
- LiveLoginService loginService = new LiveLoginService();
+// LiveLoginService loginService = new LiveLoginService();
/* List allUser = loginService.getAllUser();
for (LoginUserDatabaseBean user : allUser) {
System.out.println(user.getUserInfo().getMid());
@@ -141,7 +154,9 @@ public class BiliUserController {
return;
}
}*/
- HttpLoggingInterceptor.setLog(true);
- BiliCookieManager.resetCookie(loginService.getCookie("96300"));
+// HttpLoggingInterceptor.setLog(true);
+// BiliCookieManager.resetCookie(loginService.getCookie("3493115839121644"));
+ RedisTools.set("test", "test", 10000);
+ System.out.println(RedisTools.get("test"));
}
}
diff --git a/src/main/java/com/yutou/bilibili/Controllers/LiveDanmuController.java b/src/main/java/com/yutou/bilibili/Controllers/LiveDanmuController.java
index ab5451c..36b905d 100644
--- a/src/main/java/com/yutou/bilibili/Controllers/LiveDanmuController.java
+++ b/src/main/java/com/yutou/bilibili/Controllers/LiveDanmuController.java
@@ -25,7 +25,7 @@ public class LiveDanmuController {
@ResponseBody
@RequestMapping("/live/danmu/stop")
public JSONObject stopLiveDanmu(String roomId) {
- service.stop(roomId,true);
+ service.stop(roomId, true);
return ResultData.success(ReturnCode.RC100);
}
@@ -41,9 +41,10 @@ public class LiveDanmuController {
public JSONObject getDanmuList(String roomId) {
return ResultData.success(ReturnCode.RC100);
}
+
@ResponseBody
@RequestMapping("/live/danmu/get")
- public JSONObject getDanmu(String roomId,String videoId,String startTimer,long step) {
- return ResultData.success(ReturnCode.RC100);
+ public JSONObject getDanmu(String roomId, String videoId) {
+ return ResultData.success(service.getDanmu(roomId, videoId));
}
}
diff --git a/src/main/java/com/yutou/bilibili/datas/ResultData.java b/src/main/java/com/yutou/bilibili/datas/ResultData.java
index 7cea906..4eb9bec 100644
--- a/src/main/java/com/yutou/bilibili/datas/ResultData.java
+++ b/src/main/java/com/yutou/bilibili/datas/ResultData.java
@@ -22,11 +22,14 @@ public class ResultData {
public static JSONObject success(T data) {
return success(data, -1);
}
-
public static JSONObject success(T data, int count) {
+ return success(data, count, ReturnCode.RC100);
+ }
+
+ public static JSONObject success(T data, int count,ReturnCode returnCode) {
ResultData resultData = new ResultData<>();
- resultData.setStatus(ReturnCode.RC100.getCode());
- resultData.setMessage(ReturnCode.RC100.getMessage());
+ resultData.setStatus(returnCode.getCode());
+ resultData.setMessage(returnCode.getMessage());
resultData.setData(data);
if (data instanceof Collection>) {
resultData.count = ((Collection>) data).size();
diff --git a/src/main/java/com/yutou/bilibili/datas/ReturnCode.java b/src/main/java/com/yutou/bilibili/datas/ReturnCode.java
index bb1413b..dd34ca2 100644
--- a/src/main/java/com/yutou/bilibili/datas/ReturnCode.java
+++ b/src/main/java/com/yutou/bilibili/datas/ReturnCode.java
@@ -24,6 +24,13 @@ public enum ReturnCode {
RC401(401,"匿名用户访问无权限资源时的异常"),
/**服务异常**/
RC500(500,"系统异常,请稍后重试"),
+ /**B站扫码**/
+ RC300(300,"获取二维码成功"),
+ /**B站扫码**/
+ RC301(301,"扫码中"),
+ /**B站扫码登陆成功**/
+ RC302(302,"登录成功"),
+ RC303(303,"登录失败"),
INVALID_TOKEN(2001,"访问令牌不合法"),
ACCESS_DENIED(2003,"没有权限访问该资源"),
diff --git a/src/main/java/com/yutou/bilibili/datas/web/LiveVideoDanmu.java b/src/main/java/com/yutou/bilibili/datas/web/LiveVideoDanmu.java
new file mode 100644
index 0000000..79593df
--- /dev/null
+++ b/src/main/java/com/yutou/bilibili/datas/web/LiveVideoDanmu.java
@@ -0,0 +1,66 @@
+package com.yutou.bilibili.datas.web;
+
+import com.yutou.biliapi.bean.live.database.LiveSuperChatDatabaseBean;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class LiveVideoDanmu {
+
+ List danmu = new ArrayList<>();
+ List superChat = new ArrayList<>();
+
+
+ @Data
+ public static class Addition {
+ private int grade = 2;
+ }
+
+ @Data
+ public static class Danmu {
+ public static final String DANMU_TYPE_SCROLL = "scroll";
+ public static final String DANMU_TYPE_TOP = "top";
+ public static final String DANMU_TYPE_BOTTOM = "bottom";
+ private String id;
+ private String barrageType = DANMU_TYPE_SCROLL;
+ private long time;
+ private String text;
+ private int fontSize = 25;
+ private int lineHeight = 1;
+ private String color = "#ffffff";
+ private Addition addition = new Addition();
+ }
+
+ @Data
+ public static class SuperChat {
+ private int id;
+ private long price;
+ private String uid;
+ private long start_time;
+ private long duration;
+ private String message;
+ private String message_trans;
+ private String message_font_color;
+ private String backgroundBottomColor;
+ private String userName;
+ private String userNameColor;
+ private String userAvatar;
+
+ public SuperChat(long videoTime, LiveSuperChatDatabaseBean bean) {
+ this.id = bean.getId();
+ this.price = bean.getPrice();
+ this.uid = bean.getUid();
+ this.start_time = (bean.getSql_time().getTime() - videoTime) / 1000;
+ this.duration = bean.getEnd_time() - bean.getStart_time();
+ this.message = bean.getMessage();
+ this.message_trans = bean.getMessage_trans();
+ this.message_font_color = bean.getMessage_font_color();
+ this.backgroundBottomColor = bean.getBackgroundBottomColor();
+ this.userName = bean.getUserName();
+ this.userAvatar = bean.getUserAvatar();
+ this.userNameColor=bean.getUserNameColor();
+ }
+ }
+}
diff --git a/src/main/java/com/yutou/bilibili/services/LiveDanmuService.java b/src/main/java/com/yutou/bilibili/services/LiveDanmuService.java
index cf7610c..97e0345 100644
--- a/src/main/java/com/yutou/bilibili/services/LiveDanmuService.java
+++ b/src/main/java/com/yutou/bilibili/services/LiveDanmuService.java
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.yutou.biliapi.bean.live.LiveRoomConfig;
import com.yutou.biliapi.bean.live.database.LiveConfigDatabaseBean;
import com.yutou.biliapi.bean.live.database.LiveDanmuDatabaseBean;
+import com.yutou.biliapi.bean.live.database.LiveSuperChatDatabaseBean;
import com.yutou.biliapi.bean.live.database.LiveVideoDatabaseBean;
import com.yutou.biliapi.bean.websocket.live.WSData;
import com.yutou.biliapi.databases.BiliLiveConfigDatabase;
@@ -13,39 +14,44 @@ import com.yutou.biliapi.net.WebSocketManager;
import com.yutou.bilibili.Tools.AssTools;
import com.yutou.bilibili.Tools.DateFormatUtils;
import com.yutou.bilibili.Tools.Tools;
+import com.yutou.bilibili.datas.web.LiveVideoDanmu;
import com.yutou.common.utils.FFmpegUtils;
import com.yutou.common.utils.Log;
+import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import java.io.File;
import java.math.BigInteger;
+import java.util.ArrayList;
import java.util.List;
@Service
public class LiveDanmuService {
- public void start(String roomId,boolean isUser) {
+ public void start(String roomId, boolean isUser) {
WebSocketManager.getInstance().addRoom(LiveRoomConfig.buildConfig(roomId), isUser);
}
+
public boolean check(String roomId) {
LiveRoomConfig roomConfig = new LiveRoomConfig();
roomConfig.setRoomId(roomId);
return WebSocketManager.getInstance().checkRoom(roomConfig);
}
- public void stop(String roomId,boolean isUser) {
+ public void stop(String roomId, boolean isUser) {
WebSocketManager.getInstance().stopRoom(roomId, isUser);
}
public JSONArray getLiveRoomList() {
return WebSocketManager.getInstance().getLiveRoomList();
}
- public void clearUserList(){
+
+ public void clearUserList() {
WebSocketManager.getInstance().clearUserStopList();
}
- public List getDanmuFileList(String roomId) {
- BiliLiveConfigDatabase configDatabase=new BiliLiveConfigDatabase();
+ public List getDanmuFileList(String roomId) {
+ BiliLiveConfigDatabase configDatabase = new BiliLiveConfigDatabase();
LiveConfigDatabaseBean bean = configDatabase.getConfig(roomId);
configDatabase.close();
return Tools.scanFile(new File(bean.getRecordPath() + File.separator + bean.getAnchorName()));
@@ -77,8 +83,62 @@ public class LiveDanmuService {
return String.format("%d小时%d分钟%d秒", hours, minutes, finalRemainingSeconds);
}
+ public LiveVideoDanmu getDanmu(String roomId, String videoId) {
+ LiveVideoDanmu danmus = new LiveVideoDanmu();
+ BiliLiveDatabase liveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig(roomId));
+ LiveVideoDatabaseBean videoBean = null;
+ for (LiveVideoDatabaseBean info : liveDatabase.getLiveInfos()) {
+ System.out.println(videoId + " " + info.getSql_time().getTime());
+ if (videoId.trim().equals(String.valueOf(info.getSql_time().getTime()))) {
+ videoBean = info;
+ break;
+ }
+ }
+ if (videoBean == null) {
+ return new LiveVideoDanmu();
+ }
+ File videoFile = new File(videoBean.getPath().replace(".flv", ".mp4"));
+ if (!videoFile.exists()) {
+ videoFile = new File(videoBean.getPath());
+ }
+ long videoTime = FFmpegUtils.getVideoTime(videoFile);
+ long startTime = Long.parseLong(videoId);
+ long endTime = Long.parseLong(videoId) + videoTime;
+ List danmuList = liveDatabase.getOfTime(DateFormatUtils.format(startTime), DateFormatUtils.format(endTime), LiveDanmuDatabaseBean.class);
+ List superChatList = liveDatabase.getOfTime(DateFormatUtils.format(startTime), DateFormatUtils.format(endTime), LiveSuperChatDatabaseBean.class);
+ for (LiveDanmuDatabaseBean bean : danmuList) {
+ LiveVideoDanmu.Danmu danmu = createDanmu(bean, startTime);
+ danmus.getDanmu().add(danmu);
+ }
+ for (LiveSuperChatDatabaseBean bean : superChatList) {
+ LiveVideoDanmu.SuperChat superChat = new LiveVideoDanmu.SuperChat(startTime,bean);
+ danmus.getSuperChat().add(superChat);
+ }
+
+ liveDatabase.close();
+ return danmus;
+ }
+
+ @NotNull
+ private static LiveVideoDanmu.Danmu createDanmu(LiveDanmuDatabaseBean bean, long startTime) {
+ LiveVideoDanmu.Danmu danmu = new LiveVideoDanmu.Danmu();
+ danmu.setId(bean.getId() + "");
+ danmu.setText(bean.getDanmu());
+ danmu.setColor("#" + bean.getFontColor());
+ danmu.setFontSize(bean.getFontSize());
+ danmu.setTime(bean.getTime() - startTime);
+ if (bean.getModel() < 4) {
+ danmu.setBarrageType(LiveVideoDanmu.Danmu.DANMU_TYPE_SCROLL);
+ } else if (bean.getModel() == 4) {
+ danmu.setBarrageType(LiveVideoDanmu.Danmu.DANMU_TYPE_BOTTOM);
+ } else if (bean.getModel() == 5) {
+ danmu.setBarrageType(LiveVideoDanmu.Danmu.DANMU_TYPE_TOP);
+ }
+ return danmu;
+ }
+
public static void main(String[] args) {
- BiliLiveDatabase database = new BiliLiveDatabase(LiveRoomConfig.buildConfig("17961"));
+ BiliLiveDatabase database = new BiliLiveDatabase(LiveRoomConfig.buildConfig("17961"));
for (LiveVideoDatabaseBean info : database.getLiveInfos()) {
System.out.println(info);
}
diff --git a/src/main/java/com/yutou/bilibili/services/LiveVideoDanmuService.java b/src/main/java/com/yutou/bilibili/services/LiveVideoDanmuService.java
new file mode 100644
index 0000000..c1344f6
--- /dev/null
+++ b/src/main/java/com/yutou/bilibili/services/LiveVideoDanmuService.java
@@ -0,0 +1,21 @@
+package com.yutou.bilibili.services;
+
+import com.yutou.biliapi.bean.live.LiveRoomConfig;
+import com.yutou.biliapi.bean.live.database.LiveDanmuDatabaseBean;
+import com.yutou.biliapi.bean.live.database.LiveVideoDatabaseBean;
+import com.yutou.biliapi.databases.BiliLiveDatabase;
+import com.yutou.bilibili.datas.web.LiveVideoDanmu;
+import com.yutou.common.utils.FFmpegUtils;
+import jakarta.annotation.Resource;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class LiveVideoDanmuService {
+
+
+}
diff --git a/src/main/java/com/yutou/bilibili/services/LiveVideoDownloadService.java b/src/main/java/com/yutou/bilibili/services/LiveVideoDownloadService.java
index eb0346d..adffffe 100644
--- a/src/main/java/com/yutou/bilibili/services/LiveVideoDownloadService.java
+++ b/src/main/java/com/yutou/bilibili/services/LiveVideoDownloadService.java
@@ -376,7 +376,11 @@ public class LiveVideoDownloadService {
}
liveDatabase.close();
if(videoInfo != null) {
- FFmpegUtils ffmpeg = FFmpegUtils.segment(videoId, ffmpegPath, new File(videoInfo.getPath()), ConfigTools.load(ConfigTools.CONFIG, "outVideoPath", String.class));
+ File videoFile = new File(videoInfo.getPath().replace(".flv", ".mp4"));
+ if(!videoFile.exists()){
+ videoFile=new File(videoInfo.getPath());
+ }
+ FFmpegUtils ffmpeg = FFmpegUtils.segment(videoId, ffmpegPath,videoFile , ConfigTools.load(ConfigTools.CONFIG, "outVideoPath", String.class));
System.out.println(ffmpeg.getCommand());
ffmpeg.start(new DownloadInterface() {
@Override
diff --git a/src/main/java/com/yutou/common/okhttp/HttpDownloadUtils.java b/src/main/java/com/yutou/common/okhttp/HttpDownloadUtils.java
index 42774e6..310bc7b 100644
--- a/src/main/java/com/yutou/common/okhttp/HttpDownloadUtils.java
+++ b/src/main/java/com/yutou/common/okhttp/HttpDownloadUtils.java
@@ -105,6 +105,7 @@ public class HttpDownloadUtils {
.url(builder.url);
if (StringUtils.hasText(builder.cookie)) {
rb.addHeader("Set-Cookie", builder.cookie);
+ rb.addHeader("Cookie", builder.cookie);
}
Request request = rb.build();
return okHttpClient.newCall(request);
diff --git a/src/main/java/com/yutou/common/utils/RedisTools.java b/src/main/java/com/yutou/common/utils/RedisTools.java
index c36012f..bc84331 100644
--- a/src/main/java/com/yutou/common/utils/RedisTools.java
+++ b/src/main/java/com/yutou/common/utils/RedisTools.java
@@ -27,7 +27,7 @@ public class RedisTools {
//Properties properties = PropertyUtil.loadProperties("jedis.properties");
//host = properties.getProperty("redis.host");
//port = Integer.valueOf(properties.getProperty("redis.port"));
- host = "127.0.0.1";
+ host = "172.21.35.118";
port = 6379;
}
@@ -52,6 +52,12 @@ public class RedisTools {
return set(0, key.toString(), value);
}
+ /**
+ *
+ * @param key key
+ * @param value value
+ * @param timeout 过期时间,单位秒
+ */
public static boolean set(String key, String value, int timeout) {
try {
if (isNotInstallRedis) {