diff --git a/assets/index-85b021e0.js b/assets/index-7a479553.js similarity index 99% rename from assets/index-85b021e0.js rename to assets/index-7a479553.js index 02881a7..b1bf62c 100644 --- a/assets/index-85b021e0.js +++ b/assets/index-7a479553.js @@ -3755,4 +3755,4 @@ void main() { `))):Q=J.stylize("[Circular]","special")),w(K)){if(Z&&q.match(/^\d+$/))return Q;K=JSON.stringify(""+q),K.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(K=K.slice(1,-1),K=J.stylize(K,"name")):(K=K.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),K=J.stylize(K,"string"))}return K+": "+Q}function f(J,ne,le){var ve=J.reduce(function(q,Z){return Z.indexOf(` `)>=0,q+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ve>60?le[0]+(ne===""?"":ne+` `)+" "+J.join(`, - `)+" "+le[1]:le[0]+ne+" "+J.join(", ")+" "+le[1]}O.types=e(4936);function m(J){return Array.isArray(J)}O.isArray=m;function v(J){return typeof J=="boolean"}O.isBoolean=v;function l(J){return J===null}O.isNull=l;function y(J){return J==null}O.isNullOrUndefined=y;function E(J){return typeof J=="number"}O.isNumber=E;function A(J){return typeof J=="string"}O.isString=A;function R(J){return typeof J=="symbol"}O.isSymbol=R;function w(J){return J===void 0}O.isUndefined=w;function L(J){return M(J)&&F(J)==="[object RegExp]"}O.isRegExp=L,O.types.isRegExp=L;function M(J){return typeof J=="object"&&J!==null}O.isObject=M;function s(J){return M(J)&&F(J)==="[object Date]"}O.isDate=s,O.types.isDate=s;function _(J){return M(J)&&(F(J)==="[object Error]"||J instanceof Error)}O.isError=_,O.types.isNativeError=_;function T(J){return typeof J=="function"}O.isFunction=T;function B(J){return J===null||typeof J=="boolean"||typeof J=="number"||typeof J=="string"||typeof J=="symbol"||typeof J>"u"}O.isPrimitive=B,O.isBuffer=e(45920);function F(J){return Object.prototype.toString.call(J)}function W(J){return J<10?"0"+J.toString(10):J.toString(10)}var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var J=new Date,ne=[W(J.getHours()),W(J.getMinutes()),W(J.getSeconds())].join(":");return[J.getDate(),N[J.getMonth()],ne].join(" ")}O.log=function(){console.log("%s - %s",V(),O.format.apply(O,arguments))},O.inherits=e(42018),O._extend=function(J,ne){if(!ne||!M(ne))return J;for(var le=Object.keys(ne),ve=le.length;ve--;)J[le[ve]]=ne[le[ve]];return J};function H(J,ne){return Object.prototype.hasOwnProperty.call(J,ne)}var U=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;O.promisify=function(ne){if(typeof ne!="function")throw new TypeError('The "original" argument must be of type Function');if(U&&ne[U]){var le=ne[U];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,U,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var ve,q,Z=new Promise(function(re,ue){ve=re,q=ue}),K=[],Q=0;Q"u"?e.g:globalThis,t=P(),r=a("String.prototype.slice"),o={},i=Object.getPrototypeOf;d&&C&&i&&p(t,function(c){if(typeof g[c]=="function"){var b=new g[c];if(Symbol.toStringTag in b){var f=i(b),m=C(f,Symbol.toStringTag);if(!m){var v=i(f);m=C(v,Symbol.toStringTag)}o[c]=m.get}}});var u=function(b){var f=!1;return p(o,function(m,v){if(!f)try{var l=m.call(b);l===v&&(f=l)}catch{}}),f},h=e(9187);z.exports=function(b){return h(b)?!d||!(Symbol.toStringTag in b)?r(x(b),8,-1):u(b):!1}},3961:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(h){this.local=this.regionalOptions[h||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(h,c){if(typeof h=="string"){var b=h.match(d);return b?b[0]:""}var f=this._validateYear(h),m=h.month(),v=""+this.toChineseMonth(f,m);return c&&v.length<2&&(v="0"+v),this.isIntercalaryMonth(f,m)&&(v+="i"),v},monthNames:function(h){if(typeof h=="string"){var c=h.match(g);return c?c[0]:""}var b=this._validateYear(h),f=h.month(),m=this.toChineseMonth(b,f),v=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][m-1];return this.isIntercalaryMonth(b,f)&&(v="闰"+v),v},monthNamesShort:function(h){if(typeof h=="string"){var c=h.match(t);return c?c[0]:""}var b=this._validateYear(h),f=h.month(),m=this.toChineseMonth(b,f),v=["一","二","三","四","五","六","七","八","九","十","十一","十二"][m-1];return this.isIntercalaryMonth(b,f)&&(v="闰"+v),v},parseMonth:function(h,c){h=this._validateYear(h);var b=parseInt(c),f;if(isNaN(b))c[0]==="闰"&&(f=!0,c=c.substring(1)),c[c.length-1]==="月"&&(c=c.substring(0,c.length-1)),b=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(c);else{var m=c[c.length-1];f=m==="i"||m==="I"}var v=this.toMonthIndex(h,b,f);return v},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(h,c){if(h.year&&(h=h.year()),typeof h!="number"||h<1888||h>2111)throw c.replace(/\{0\}/,this.local.name);return h},toMonthIndex:function(h,c,b){var f=this.intercalaryMonth(h),m=b&&c!==f;if(m||c<1||c>12)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return f?!b&&c<=f?v=c-1:v=c:v=c-1,v},toChineseMonth:function(h,c){h.year&&(h=h.year(),c=h.month());var b=this.intercalaryMonth(h),f=b?12:11;if(c<0||c>f)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return b?c>13;return b},isIntercalaryMonth:function(h,c){h.year&&(h=h.year(),c=h.month());var b=this.intercalaryMonth(h);return!!b&&b===c},leapYear:function(h){return this.intercalaryMonth(h)!==0},weekOfYear:function(h,c,b){var f=this._validateYear(h,p.local.invalidyear),m=o[f-o[0]],v=m>>9&4095,l=m>>5&15,y=m&31,E;E=a.newDate(v,l,y),E.add(4-(E.dayOfWeek()||7),"d");var A=this.toJD(h,c,b)-E.toJD();return 1+Math.floor(A/7)},monthsInYear:function(h){return this.leapYear(h)?13:12},daysInMonth:function(h,c){h.year&&(c=h.month(),h=h.year()),h=this._validateYear(h);var b=r[h-r[0]],f=b>>13,m=f?12:11;if(c>m)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var v=b&1<<12-c?30:29;return v},weekDay:function(h,c,b){return(this.dayOfWeek(h,c,b)||7)<6},toJD:function(h,c,b){var f=this._validate(h,v,b,p.local.invalidDate);h=this._validateYear(f.year()),c=f.month(),b=f.day();var m=this.isIntercalaryMonth(h,c),v=this.toChineseMonth(h,c),l=u(h,v,b,m);return a.toJD(l.year,l.month,l.day)},fromJD:function(h){var c=a.fromJD(h),b=i(c.year(),c.month(),c.day()),f=this.toMonthIndex(b.year,b.month,b.isIntercalary);return this.newDate(b.year,f,b.day)},fromString:function(h){var c=h.match(x),b=this._validateYear(+c[1]),f=+c[2],m=!!c[3],v=this.toMonthIndex(b,f,m),l=+c[4];return this.newDate(b,v,l)},add:function(h,c,b){var f=h.year(),m=h.month(),v=this.isIntercalaryMonth(f,m),l=this.toChineseMonth(f,m),y=Object.getPrototypeOf(C.prototype).add.call(this,h,c,b);if(b==="y"){var E=y.year(),A=y.month(),R=this.isIntercalaryMonth(E,l),w=v&&R?this.toMonthIndex(E,l,!0):this.toMonthIndex(E,l,!1);w!==A&&y.month(w)}return y}});var x=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,d=/^\d?\d[iI]?/m,g=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;p.calendars.chinese=C;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function i(h,c,b,f){var m,v;if(typeof h=="object")m=h,v=c||{};else{var l=typeof h=="number"&&h>=1888&&h<=2111;if(!l)throw new Error("Solar year outside range 1888-2111");var y=typeof c=="number"&&c>=1&&c<=12;if(!y)throw new Error("Solar month outside range 1 - 12");var E=typeof b=="number"&&b>=1&&b<=31;if(!E)throw new Error("Solar day outside range 1 - 31");m={year:h,month:c,day:b},v=f||{}}var A=o[m.year-o[0]],R=m.year<<9|m.month<<5|m.day;v.year=R>=A?m.year:m.year-1,A=o[v.year-o[0]];var w=A>>9&4095,L=A>>5&15,M=A&31,s,_=new Date(w,L-1,M),T=new Date(m.year,m.month-1,m.day);s=Math.round((T-_)/864e5);var B=r[v.year-r[0]],F;for(F=0;F<13;F++){var W=B&1<<12-F?30:29;if(s>13;return!N||F=1888&&h<=2111;if(!y)throw new Error("Lunar year outside range 1888-2111");var E=typeof c=="number"&&c>=1&&c<=12;if(!E)throw new Error("Lunar month outside range 1 - 12");var A=typeof b=="number"&&b>=1&&b<=30;if(!A)throw new Error("Lunar day outside range 1 - 30");var R;typeof f=="object"?(R=!1,v=f):(R=!!f,v=m||{}),l={year:h,month:c,day:b,isIntercalary:R}}var w;w=l.day-1;var L=r[l.year-r[0]],M=L>>13,s;M&&(l.month>M||l.isIntercalary)?s=l.month:s=l.month-1;for(var _=0;_>9&4095,W=B>>5&15,N=B&31,V=new Date(F,W-1,N+w);return v.year=V.getFullYear(),v.month=1+V.getMonth(),v.day=V.getDate(),v}},38751:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()+(x.year()<0?1:0);return d%4===3||d%4===-1},monthsInYear:function(C){return this._validate(C,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear),13},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===13&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),C<0&&C++,g.day()+(g.month()-1)*30+(C-1)*365+Math.floor(C/4)+this.jdEpoch-1},fromJD:function(C){var x=Math.floor(C)+.5-this.jdEpoch,d=Math.floor((x-Math.floor((x+366)/1461))/365)+1;d<=0&&d--,x=Math.floor(C)+.5-this.newDate(d,1,1).toJD();var g=Math.floor(x/30)+1,t=x-(g-1)*30+1;return this.newDate(d,g,t)}}),p.calendars.coptic=a},86825:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),!1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),13},daysInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),400},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return(t.day()+1)%8},weekDay:function(x,d,g){var t=this.dayOfWeek(x,d,g);return t>=2&&t<=6},extraInfo:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return{century:C[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return x=t.year()+(t.year()<0?1:0),d=t.month(),g=t.day(),g+(d>1?16:0)+(d>2?(d-2)*32:0)+(x-1)*400+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x+.5)-Math.floor(this.jdEpoch)-1;var d=Math.floor(x/400)+1;x-=(d-1)*400,x+=x>15?16:0;var g=Math.floor(x/32)+1,t=x-(g-1)*32+1;return this.newDate(d<=0?d-1:d,g,t)}});var C={20:"Fruitbat",21:"Anchovy"};p.calendars.discworld=a},37715:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()+(x.year()<0?1:0);return d%4===3||d%4===-1},monthsInYear:function(C){return this._validate(C,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear),13},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===13&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),C<0&&C++,g.day()+(g.month()-1)*30+(C-1)*365+Math.floor(C/4)+this.jdEpoch-1},fromJD:function(C){var x=Math.floor(C)+.5-this.jdEpoch,d=Math.floor((x-Math.floor((x+366)/1461))/365)+1;d<=0&&d--,x=Math.floor(C)+.5-this.newDate(d,1,1).toJD();var g=Math.floor(x/30)+1,t=x-(g-1)*30+1;return this.newDate(d,g,t)}}),p.calendars.ethiopian=a},99384:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return this._leapYear(d.year())},_leapYear:function(x){return x=x<0?x+1:x,C(x*7+1,19)<7},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),this._leapYear(x.year?x.year():x)?13:12},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return x=d.year(),this.toJD(x===-1?1:x+1,7,1)-this.toJD(x,7,1)},daysInMonth:function(x,d){return x.year&&(d=x.month(),x=x.year()),this._validate(x,d,this.minDay,p.local.invalidMonth),d===12&&this.leapYear(x)||d===8&&C(this.daysInYear(x),10)===5?30:d===9&&C(this.daysInYear(x),10)===3?29:this.daysPerMonth[d-1]},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==6},extraInfo:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);x=t.year(),d=t.month(),g=t.day();var r=x<=0?x+1:x,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+g+1;if(d<7){for(var i=7;i<=this.monthsInYear(x);i++)o+=this.daysInMonth(x,i);for(var i=1;i=this.toJD(d===-1?1:d+1,7,1);)d++;for(var g=xthis.toJD(d,g,this.daysInMonth(d,g));)g++;var t=x-this.toJD(d,g,1)+1;return this.newDate(d,g,t)}});function C(x,d){return x-d*Math.floor(x/d)}p.calendars.hebrew=a},43805:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(C){var x=this._validate(C,this.minMonth,this.minDay,p.local.invalidYear);return(x.year()*11+14)%30<11},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInYear:function(C){return this.leapYear(C)?355:354},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===12&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return this.dayOfWeek(C,x,d)!==5},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),x=g.month(),d=g.day(),C=C<=0?C+1:C,d+Math.ceil(29.5*(x-1))+(C-1)*354+Math.floor((3+11*C)/30)+this.jdEpoch-1},fromJD:function(C){C=Math.floor(C)+.5;var x=Math.floor((30*(C-this.jdEpoch)+10646)/10631);x=x<=0?x-1:x;var d=Math.min(12,Math.ceil((C-29-this.toJD(x,1,1))/29.5)+1),g=C-this.toJD(x,d,1)+1;return this.newDate(x,d,g)}}),p.calendars.islamic=a},88874:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()<0?x.year()+1:x.year();return d%4===0},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(4-(g.dayOfWeek()||7),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===2&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),x=g.month(),d=g.day(),C<0&&C++,x<=2&&(C--,x+=12),Math.floor(365.25*(C+4716))+Math.floor(30.6001*(x+1))+d-1524.5},fromJD:function(C){var x=Math.floor(C+.5),d=x+1524,g=Math.floor((d-122.1)/365.25),t=Math.floor(365.25*g),r=Math.floor((d-t)/30.6001),o=r-Math.floor(r<14?1:13),i=g-Math.floor(o>2?4716:4715),u=d-t-Math.floor(30.6001*r);return i<=0&&i--,this.newDate(i,o,u)}}),p.calendars.julian=a},83290:function(z,O,e){var p=e(63489),P=e(56131);function a(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),!1},formatYear:function(d){var g=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear);d=g.year();var t=Math.floor(d/400);d=d%400,d+=d<0?400:0;var r=Math.floor(d/20);return t+"."+r+"."+d%20},forYear:function(d){if(d=d.split("."),d.length<3)throw"Invalid Mayan year";for(var g=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";g=g*20+r}return g},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),18},weekOfYear:function(d,g,t){return this._validate(d,g,t,p.local.invalidDate),0},daysInYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),360},daysInMonth:function(d,g){return this._validate(d,g,this.minDay,p.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate);return r.day()},weekDay:function(d,g,t){return this._validate(d,g,t,p.local.invalidDate),!0},extraInfo:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate),o=r.toJD(),i=this._toHaab(o),u=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[u[0]-1],tzolkinDay:u[0],tzolkinTrecena:u[1]}},_toHaab:function(d){d-=this.jdEpoch;var g=C(d+8+(18-1)*20,365);return[Math.floor(g/20)+1,C(g,20)]},_toTzolkin:function(d){return d-=this.jdEpoch,[x(d+20,20),x(d+4,13)]},toJD:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(d){d=Math.floor(d)+.5-this.jdEpoch;var g=Math.floor(d/360);d=d%360,d+=d<0?360:0;var t=Math.floor(d/20),r=d%20;return this.newDate(g,t,r)}});function C(d,g){return d-g*Math.floor(d/g)}function x(d,g){return C(d-1,g)+1}p.calendars.mayan=a},29108:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar;var C=p.instance("gregorian");P(a.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear);return C.leapYear(d.year()+(d.year()<1?1:0)+1469)},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===12&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),i=1;i=this.toJD(d+1,1,1);)d++;for(var g=x-Math.floor(this.toJD(d,1,1)+.5)+1,t=1;g>this.daysInMonth(d,t);)g-=this.daysInMonth(d,t),t++;return this.newDate(d,t,g)}}),p.calendars.nanakshahi=a},55422:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(C){return this.daysInYear(C)!==this.daysPerYear},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInYear:function(C){var x=this._validate(C,this.minMonth,this.minDay,p.local.invalidYear);if(C=x.year(),typeof this.NEPALI_CALENDAR_DATA[C]>"u")return this.daysPerYear;for(var d=0,g=this.minMonth;g<=12;g++)d+=this.NEPALI_CALENDAR_DATA[C][g];return d},daysInMonth:function(C,x){return C.year&&(x=C.month(),C=C.year()),this._validate(C,x,this.minDay,p.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[C]>"u"?this.daysPerMonth[x-1]:this.NEPALI_CALENDAR_DATA[C][x]},weekDay:function(C,x,d){return this.dayOfWeek(C,x,d)!==6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);C=g.year(),x=g.month(),d=g.day();var t=p.instance(),r=0,o=x,i=C;this._createMissingCalendarData(C);var u=C-(o>9||o===9&&d>=this.NEPALI_CALENDAR_DATA[i][0]?56:57);for(x!==9&&(r=d,o--);o!==9;)o<=0&&(o=12,i--),r+=this.NEPALI_CALENDAR_DATA[i][o],o--;return x===9?(r+=d-this.NEPALI_CALENDAR_DATA[i][0],r<0&&(r+=t.daysInYear(u))):r+=this.NEPALI_CALENDAR_DATA[i][9]-this.NEPALI_CALENDAR_DATA[i][0],t.newDate(u,1,1).add(r,"d").toJD()},fromJD:function(C){var x=p.instance(),d=x.fromJD(C),g=d.year(),t=d.dayOfYear(),r=g+56;this._createMissingCalendarData(r);for(var o=9,i=this.NEPALI_CALENDAR_DATA[r][0],u=this.NEPALI_CALENDAR_DATA[r][o]-i+1;t>u;)o++,o>12&&(o=1,r++),u+=this.NEPALI_CALENDAR_DATA[r][o];var h=this.NEPALI_CALENDAR_DATA[r][o]-(u-t);return this.newDate(r,o,h)},_createMissingCalendarData:function(C){var x=this.daysPerMonth.slice(0);x.unshift(17);for(var d=C-1;d"u"&&(this.NEPALI_CALENDAR_DATA[d]=x)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),p.calendars.nepali=a},94320:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return((d.year()-(d.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===12&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==5},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);x=t.year(),d=t.month(),g=t.day();var r=x-(x>=0?474:473),o=474+C(r,2820);return g+(d<=7?(d-1)*31:(d-1)*30+6)+Math.floor((o*682-110)/2816)+(o-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var d=x-this.toJD(475,1,1),g=Math.floor(d/1029983),t=C(d,1029983),r=2820;if(t!==1029982){var o=Math.floor(t/366),i=C(t,366);r=Math.floor((2134*o+2816*i+2815)/1028522)+o+1}var u=r+2820*g+474;u=u<=0?u-1:u;var h=x-this.toJD(u,1,1)+1,c=h<=186?Math.ceil(h/31):Math.ceil((h-6)/30),b=x-this.toJD(u,c,1)+1;return this.newDate(u,c,b)}});function C(x,d){return x-d*Math.floor(x/d)}p.calendars.persian=a,p.calendars.jalali=a},31320:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(g){var d=this._validate(g,this.minMonth,this.minDay,p.local.invalidYear),g=this._t2gYear(d.year());return a.leapYear(g)},weekOfYear:function(r,d,g){var t=this._validate(r,this.minMonth,this.minDay,p.local.invalidYear),r=this._t2gYear(t.year());return a.weekOfYear(r,t.month(),t.day())},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===2&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidDate),r=this._t2gYear(t.year());return a.toJD(r,t.month(),t.day())},fromJD:function(x){var d=a.fromJD(x),g=this._g2tYear(d.year());return this.newDate(g,d.month(),d.day())},_t2gYear:function(x){return x+this.yearsOffset+(x>=-this.yearsOffset&&x<=-1?1:0)},_g2tYear:function(x){return x-this.yearsOffset-(x>=1&&x<=this.yearsOffset?1:0)}}),p.calendars.taiwan=C},51367:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(g){var d=this._validate(g,this.minMonth,this.minDay,p.local.invalidYear),g=this._t2gYear(d.year());return a.leapYear(g)},weekOfYear:function(r,d,g){var t=this._validate(r,this.minMonth,this.minDay,p.local.invalidYear),r=this._t2gYear(t.year());return a.weekOfYear(r,t.month(),t.day())},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===2&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidDate),r=this._t2gYear(t.year());return a.toJD(r,t.month(),t.day())},fromJD:function(x){var d=a.fromJD(x),g=this._g2tYear(d.year());return this.newDate(g,d.month(),d.day())},_t2gYear:function(x){return x-this.yearsOffset-(x>=1&&x<=this.yearsOffset?1:0)},_g2tYear:function(x){return x+this.yearsOffset+(x>=-this.yearsOffset&&x<=-1?1:0)}}),p.calendars.thai=C},21457:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return this.daysInYear(d.year())===355},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(x){for(var d=0,g=1;g<=12;g++)d+=this.daysInMonth(x,g);return d},daysInMonth:function(x,d){for(var g=this._validate(x,d,this.minDay,p.local.invalidMonth),t=g.toJD()-24e5+.5,r=0,o=0;ot)return C[r]-C[r-1];r++}return 30},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==5},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+C[r-1]-1;return o+24e5-.5},fromJD:function(x){for(var d=x-24e5+.5,g=0,t=0;td);t++)g++;var r=g+15292,o=Math.floor((r-1)/12),i=o+1,u=r-12*o,h=d-C[g-1]+1;return this.newDate(i,u,h)},isValid:function(x,d,g){var t=p.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(x=x.year!=null?x.year:x,t=x>=1276&&x<=1500),t},_validate:function(x,d,g,t){var r=p.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),p.calendars.ummalqura=a;var C=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},63489:function(z,O,e){var p=e(56131);function P(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}p(P.prototype,{instance:function(t,r){t=(t||"gregorian").toLowerCase(),r=r||"";var o=this._localCals[t+"-"+r];if(!o&&this.calendars[t]&&(o=new this.calendars[t](r),this._localCals[t+"-"+r]=o),!o)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return o},newDate:function(t,r,o,i,u){return i=(t!=null&&t.year?t.calendar():typeof i=="string"?this.instance(i,u):i)||this.instance(),i.newDate(t,r,o)},substituteDigits:function(t){return function(r){return(r+"").replace(/[0-9]/g,function(o){return t[o]})}},substituteChineseDigits:function(t,r){return function(o){for(var i="",u=0;o>0;){var h=o%10;i=(h===0?"":t[h]+r[u])+i,u++,o=Math.floor(o/10)}return i.indexOf(t[1]+r[1])===0&&(i=i.substr(1)),i||t[0]}}});function a(t,r,o,i){if(this._calendar=t,this._year=r,this._month=o,this._day=i,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(g.local.invalidDate||g.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function C(t,r){return t=""+t,"000000".substring(0,r-t.length)+t}p(a.prototype,{newDate:function(t,r,o){return this._calendar.newDate(t??this,r,o)},year:function(t){return arguments.length===0?this._year:this.set(t,"y")},month:function(t){return arguments.length===0?this._month:this.set(t,"m")},day:function(t){return arguments.length===0?this._day:this.set(t,"d")},date:function(t,r,o){if(!this._calendar.isValid(t,r,o))throw(g.local.invalidDate||g.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=r,this._day=o,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,r){return this._calendar.add(this,t,r)},set:function(t,r){return this._calendar.set(this,t,r)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(g.local.differentCalendars||g.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var r=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return r===0?0:r<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+C(Math.abs(this.year()),4)+"-"+C(this.month(),2)+"-"+C(this.day(),2)}});function x(){this.shortYearCutoff="+10"}p(x.prototype,{_validateLevel:0,newDate:function(t,r,o){return t==null?this.today():(t.year&&(this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),o=t.day(),r=t.month(),t=t.year()),new a(this,t,r,o))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return r.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return(r.year()<0?"-":"")+C(Math.abs(r.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear),12},monthOfYear:function(t,r){var o=this._validate(t,r,this.minDay,g.local.invalidMonth||g.regionalOptions[""].invalidMonth);return(o.month()+this.monthsInYear(o)-this.firstMonth)%this.monthsInYear(o)+this.minMonth},fromMonthOfYear:function(t,r){var o=(r+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,o,this.minDay,g.local.invalidMonth||g.regionalOptions[""].invalidMonth),o},daysInYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return this.leapYear(r)?366:365},dayOfYear:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate);return i.toJD()-this.newDate(i.year(),this.fromMonthOfYear(i.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(i))+2)%this.daysInWeek()},extraInfo:function(t,r,o){return this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),{}},add:function(t,r,o){return this._validate(t,this.minMonth,this.minDay,g.local.invalidDate||g.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,r,o),r,o)},_add:function(t,r,o){if(this._validateLevel++,o==="d"||o==="w"){var i=t.toJD()+r*(o==="w"?this.daysInWeek():1),u=t.calendar().fromJD(i);return this._validateLevel--,[u.year(),u.month(),u.day()]}try{var h=t.year()+(o==="y"?r:0),c=t.monthOfYear()+(o==="m"?r:0),u=t.day(),b=function(v){for(;cl-1+v.minMonth;)h++,c-=l,l=v.monthsInYear(h)};o==="y"?(t.month()!==this.fromMonthOfYear(h,c)&&(c=this.newDate(h,t.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(h)),u=Math.min(u,this.daysInMonth(h,this.fromMonthOfYear(h,c)))):o==="m"&&(b(this),u=Math.min(u,this.daysInMonth(h,this.fromMonthOfYear(h,c))));var f=[h,this.fromMonthOfYear(h,c),u];return this._validateLevel--,f}catch(m){throw this._validateLevel--,m}},_correctAdd:function(t,r,o,i){if(!this.hasYearZero&&(i==="y"||i==="m")&&(r[0]===0||t.year()>0!=r[0]>0)){var u={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[i],h=o<0?-1:1;r=this._add(t,o*u[0]+h*u[1],u[2])}return t.date(r[0],r[1],r[2])},set:function(t,r,o){this._validate(t,this.minMonth,this.minDay,g.local.invalidDate||g.regionalOptions[""].invalidDate);var i=o==="y"?r:t.year(),u=o==="m"?r:t.month(),h=o==="d"?r:t.day();return(o==="y"||o==="m")&&(h=Math.min(h,this.daysInMonth(i,u))),t.date(i,u,h)},isValid:function(t,r,o){this._validateLevel++;var i=this.hasYearZero||t!==0;if(i){var u=this.newDate(t,r,this.minDay);i=r>=this.minMonth&&r-this.minMonth=this.minDay&&o-this.minDay13.5?13:1),m=u-(f>2.5?4716:4715);return m<=0&&m--,this.newDate(m,f,b)},toJSDate:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),u=new Date(i.year(),i.month()-1,i.day());return u.setHours(0),u.setMinutes(0),u.setSeconds(0),u.setMilliseconds(0),u.setHours(u.getHours()>12?u.getHours()+2:0),u},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var g=z.exports=new P;g.cdate=a,g.baseCalendar=x,g.calendars.gregorian=d},94338:function(z,O,e){var p=e(56131),P=e(63489);p(P.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),P.local=P.regionalOptions[""],p(P.cdate.prototype,{formatDate:function(a,C){return typeof a!="string"&&(C=a,a=""),this._calendar.formatDate(a||"",this,C)}}),p(P.baseCalendar.prototype,{UNIX_EPOCH:P.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:P.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(a,C,x){if(typeof a!="string"&&(x=C,C=a,a=""),!C)return"";if(C.calendar()!==this)throw P.local.invalidFormat||P.regionalOptions[""].invalidFormat;a=a||this.local.dateFormat,x=x||{};var d=x.dayNamesShort||this.local.dayNamesShort,g=x.dayNames||this.local.dayNames,t=x.monthNumbers||this.local.monthNumbers,r=x.monthNamesShort||this.local.monthNamesShort,o=x.monthNames||this.local.monthNames;x.calculateWeek||this.local.calculateWeek;for(var i=function(A,R){for(var w=1;E+w1},u=function(A,R,w,L){var M=""+R;if(i(A,L))for(;M.length1},E=function(F,W){var N=y(F,W),V=[2,3,N?4:2,N?4:2,10,11,20]["oyYJ@!".indexOf(F)+1],H=new RegExp("^-?\\d{1,"+V+"}"),U=C.substring(s).match(H);if(!U)throw(P.local.missingNumberAt||P.regionalOptions[""].missingNumberAt).replace(/\{0\}/,s);return s+=U[0].length,parseInt(U[0],10)},A=this,R=function(){if(typeof o=="function"){y("m");var F=o.call(A,C.substring(s));return s+=F.length,F}return E("m")},w=function(F,W,N,V){for(var H=y(F,V)?N:W,U=0;U-1){b=1,f=m;for(var B=this.daysInMonth(c,b);f>B;B=this.daysInMonth(c,b))b++,f-=B}return h>-1?this.fromJD(h):this.newDate(c,b,f)},determineDate:function(a,C,x,d,g){x&&typeof x!="object"&&(g=d,d=x,x=null),typeof d!="string"&&(g=d,d="");var t=this,r=function(o){try{return t.parseDate(d,o,g)}catch{}o=o.toLowerCase();for(var i=(o.match(/^c/)&&x?x.newDate():null)||t.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,h=u.exec(o);h;)i.add(parseInt(h[1],10),h[2]||"d"),h=u.exec(o);return i};return C=C?C.newDate():null,a=a==null?C:typeof a=="string"?r(a):typeof a=="number"?isNaN(a)||a===1/0||a===-1/0?C:t.today().add(a,"d"):t.newDate(a),a}})},69862:function(){},40964:function(){},72077:function(z,O,e){var p=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],P=typeof globalThis>"u"?e.g:globalThis;z.exports=function(){for(var C=[],x=0;x>8&15|Pe>>4&240,Pe>>4&15|Pe&240,(Pe&15)<<4|Pe&15,1):Ge===8?R(Pe>>24&255,Pe>>16&255,Pe>>8&255,(Pe&255)/255):Ge===4?R(Pe>>12&15|Pe>>8&240,Pe>>8&15|Pe>>4&240,Pe>>4&15|Pe&240,((Pe&15)<<4|Pe&15)/255):null):(Pe=o.exec(Te))?new M(Pe[1],Pe[2],Pe[3],1):(Pe=i.exec(Te))?new M(Pe[1]*255/100,Pe[2]*255/100,Pe[3]*255/100,1):(Pe=u.exec(Te))?R(Pe[1],Pe[2],Pe[3],Pe[4]):(Pe=h.exec(Te))?R(Pe[1]*255/100,Pe[2]*255/100,Pe[3]*255/100,Pe[4]):(Pe=c.exec(Te))?N(Pe[1],Pe[2]/100,Pe[3]/100,1):(Pe=b.exec(Te))?N(Pe[1],Pe[2]/100,Pe[3]/100,Pe[4]):f.hasOwnProperty(Te)?A(f[Te]):Te==="transparent"?new M(NaN,NaN,NaN,0):null}function A(Te){return new M(Te>>16&255,Te>>8&255,Te&255,1)}function R(Te,Pe,Ge,$e){return $e<=0&&(Te=Pe=Ge=NaN),new M(Te,Pe,Ge,$e)}function w(Te){return Te instanceof a||(Te=E(Te)),Te?(Te=Te.rgb(),new M(Te.r,Te.g,Te.b,Te.opacity)):new M}function L(Te,Pe,Ge,$e){return arguments.length===1?w(Te):new M(Te,Pe,Ge,$e??1)}function M(Te,Pe,Ge,$e){this.r=+Te,this.g=+Pe,this.b=+Ge,this.opacity=+$e}p(M,L,P(a,{brighter:function(Pe){return Pe=Pe==null?x:Math.pow(x,Pe),new M(this.r*Pe,this.g*Pe,this.b*Pe,this.opacity)},darker:function(Pe){return Pe=Pe==null?C:Math.pow(C,Pe),new M(this.r*Pe,this.g*Pe,this.b*Pe,this.opacity)},rgb:function(){return this},clamp:function(){return new M(F(this.r),F(this.g),F(this.b),B(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:s,formatHex:s,formatHex8:_,formatRgb:T,toString:T}));function s(){return"#".concat(W(this.r)).concat(W(this.g)).concat(W(this.b))}function _(){return"#".concat(W(this.r)).concat(W(this.g)).concat(W(this.b)).concat(W((isNaN(this.opacity)?1:this.opacity)*255))}function T(){var Te=B(this.opacity);return"".concat(Te===1?"rgb(":"rgba(").concat(F(this.r),", ").concat(F(this.g),", ").concat(F(this.b)).concat(Te===1?")":", ".concat(Te,")"))}function B(Te){return isNaN(Te)?1:Math.max(0,Math.min(1,Te))}function F(Te){return Math.max(0,Math.min(255,Math.round(Te)||0))}function W(Te){return Te=F(Te),(Te<16?"0":"")+Te.toString(16)}function N(Te,Pe,Ge,$e){return $e<=0?Te=Pe=Ge=NaN:Ge<=0||Ge>=1?Te=Pe=NaN:Pe<=0&&(Te=NaN),new U(Te,Pe,Ge,$e)}function V(Te){if(Te instanceof U)return new U(Te.h,Te.s,Te.l,Te.opacity);if(Te instanceof a||(Te=E(Te)),!Te)return new U;if(Te instanceof U)return Te;Te=Te.rgb();var Pe=Te.r/255,Ge=Te.g/255,$e=Te.b/255,ze=Math.min(Pe,Ge,$e),je=Math.max(Pe,Ge,$e),ut=NaN,at=je-ze,nt=(je+ze)/2;return at?(Pe===je?ut=(Ge-$e)/at+(Ge<$e)*6:Ge===je?ut=($e-Pe)/at+2:ut=(Pe-Ge)/at+4,at/=nt<.5?je+ze:2-je-ze,ut*=60):at=nt>0&&nt<1?0:ut,new U(ut,at,nt,Te.opacity)}function H(Te,Pe,Ge,$e){return arguments.length===1?V(Te):new U(Te,Pe,Ge,$e??1)}function U(Te,Pe,Ge,$e){this.h=+Te,this.s=+Pe,this.l=+Ge,this.opacity=+$e}p(U,H,P(a,{brighter:function(Pe){return Pe=Pe==null?x:Math.pow(x,Pe),new U(this.h,this.s,this.l*Pe,this.opacity)},darker:function(Pe){return Pe=Pe==null?C:Math.pow(C,Pe),new U(this.h,this.s,this.l*Pe,this.opacity)},rgb:function(){var Pe=this.h%360+(this.h<0)*360,Ge=isNaN(Pe)||isNaN(this.s)?0:this.s,$e=this.l,ze=$e+($e<.5?$e:1-$e)*Ge,je=2*$e-ze;return new M(J(Pe>=240?Pe-240:Pe+120,je,ze),J(Pe,je,ze),J(Pe<120?Pe+240:Pe-120,je,ze),this.opacity)},clamp:function(){return new U(G(this.h),Y(this.s),Y(this.l),B(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var Pe=B(this.opacity);return"".concat(Pe===1?"hsl(":"hsla(").concat(G(this.h),", ").concat(Y(this.s)*100,"%, ").concat(Y(this.l)*100,"%").concat(Pe===1?")":", ".concat(Pe,")"))}}));function G(Te){return Te=(Te||0)%360,Te<0?Te+360:Te}function Y(Te){return Math.max(0,Math.min(1,Te||0))}function J(Te,Pe,Ge){return(Te<60?Pe+(Ge-Pe)*Te/60:Te<180?Ge:Te<240?Pe+(Ge-Pe)*(240-Te)/60:Pe)*255}var ne=function(Te){return function(){return Te}};function le(Te,Pe){return function(Ge){return Te+Ge*Pe}}function ve(Te,Pe,Ge){return Te=Math.pow(Te,Ge),Pe=Math.pow(Pe,Ge)-Te,Ge=1/Ge,function($e){return Math.pow(Te+$e*Pe,Ge)}}function q(Te){return(Te=+Te)==1?Z:function(Pe,Ge){return Ge-Pe?ve(Pe,Ge,Te):ne(isNaN(Pe)?Ge:Pe)}}function Z(Te,Pe){var Ge=Pe-Te;return Ge?le(Te,Ge):ne(isNaN(Te)?Pe:Te)}var K=function Te(Pe){var Ge=q(Pe);function $e(ze,je){var ut=Ge((ze=L(ze)).r,(je=L(je)).r),at=Ge(ze.g,je.g),nt=Ge(ze.b,je.b),st=Z(ze.opacity,je.opacity);return function(gt){return ze.r=ut(gt),ze.g=at(gt),ze.b=nt(gt),ze.opacity=st(gt),ze+""}}return $e.gamma=Te,$e}(1);function Q(Te,Pe){var Ge=Pe?Pe.length:0,$e=Te?Math.min(Ge,Te.length):0,ze=new Array($e),je=new Array(Ge),ut;for(ut=0;ut<$e;++ut)ze[ut]=Le(Te[ut],Pe[ut]);for(;utGe&&(je=Pe.slice(Ge,je),at[ut]?at[ut]+=je:at[++ut]=je),($e=$e[0])===(ze=ze[0])?at[ut]?at[ut]+=ze:at[++ut]=ze:(at[++ut]=null,nt.push({i:ut,x:ue($e,ze)})),Ge=oe.lastIndex;return GeD===1).map(([D])=>D)},{type:"histogram",name:"Negative",marker:{color:"red"},opacity:.5,xaxis:"x",yaxis:"y"+S,legendgroup:"negatives",showlegend:S<2,x:n.filter(([,D])=>D===-1).map(([D])=>D)}]}function TP({testPairings:n,trainPairings:S}){return qt.jsx("div",{className:"flex justify-center p-4",children:qt.jsx(wP,{config:{responsive:!0,displayModeBar:!1,displaylogo:!1},layout:{plot_bgcolor:"rgba(255,255,255,0.25)",paper_bgcolor:"transparent",font:{color:"white"},showlegend:!0,height:300,width:400,legend:{},barmode:"overlay",yaxis:{title:"Test Set"},yaxis2:{title:"Train Set"},xaxis:{title:"Cosine Similarity"},margin:{l:50,t:0,r:0,b:50},grid:{rows:2,columns:1,subplots:["x1y","x2y"]}},data:[...YE(n,1),...YE(S,2)]})})}function IU({performanceHistory:n}){const S=U4.range(0,n.length);return qt.jsx("div",{children:qt.jsx(wP,{config:{responsive:!0,displayModeBar:!1,displaylogo:!1},data:[{mode:"lines",type:"scatter",x:S,name:"Test",y:n.map(({test:D})=>D.accuracy)},{mode:"lines",type:"scatter",x:S,name:"Train",y:n.map(({train:D})=>D.accuracy)}],layout:{font:{color:"white"},height:200,width:400,plot_bgcolor:"rgba(255,255,255,0.25)",paper_bgcolor:"transparent",showlegend:!0,margin:{l:50,t:0,r:0,b:50},xaxis:{title:"Epoch"},yaxis:{title:"Accuracy",range:[0,1]}}})})}const Rb=ht.forwardRef((n,S)=>ht.createElement(Ci.span,ga({},n,{ref:S,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}}))),kU=Rb,FU=[" ","Enter","ArrowUp","ArrowDown"],OU=[" ","Enter"],_b="Select",[Db,mS,zU]=bb(_b),[Pg,YV]=Bc(_b,[zU,Cg]),xS=Cg(),[NU,r0]=Pg(_b),[BU,UU]=Pg(_b),HU=n=>{const{__scopeSelect:S,children:D,open:$,defaultOpen:ie,onOpenChange:pe,value:z,defaultValue:O,onValueChange:e,dir:p,name:P,autoComplete:a,disabled:C,required:x}=n,d=xS(S),[g,t]=ht.useState(null),[r,o]=ht.useState(null),[i,u]=ht.useState(!1),h=yb(p),[c=!1,b]=Xv({prop:$,defaultProp:ie,onChange:pe}),[f,m]=Xv({prop:z,defaultProp:O,onChange:e}),v=ht.useRef(null),l=g?!!g.closest("form"):!0,[y,E]=ht.useState(new Set),A=Array.from(y).map(R=>R.props.value).join(";");return ht.createElement(rS,d,ht.createElement(NU,{required:x,scope:S,trigger:g,onTriggerChange:t,valueNode:r,onValueNodeChange:o,valueNodeHasChildren:i,onValueNodeHasChildrenChange:u,contentId:kd(),value:f,onValueChange:m,open:c,onOpenChange:b,dir:h,triggerPointerDownPosRef:v,disabled:C},ht.createElement(Db.Provider,{scope:S},ht.createElement(BU,{scope:n.__scopeSelect,onNativeOptionAdd:ht.useCallback(R=>{E(w=>new Set(w).add(R))},[]),onNativeOptionRemove:ht.useCallback(R=>{E(w=>{const L=new Set(w);return L.delete(R),L})},[])},D)),l?ht.createElement(EP,{key:A,"aria-hidden":!0,required:x,tabIndex:-1,name:P,autoComplete:a,value:f,onChange:R=>m(R.target.value),disabled:C},f===void 0?ht.createElement("option",{value:""}):null,Array.from(y)):null))},VU="SelectTrigger",GU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,disabled:$=!1,...ie}=n,pe=xS(D),z=r0(VU,D),O=z.disabled||$,e=so(S,z.onTriggerChange),p=mS(D),[P,a,C]=CP(d=>{const g=p().filter(o=>!o.disabled),t=g.find(o=>o.value===z.value),r=PP(g,d,t);r!==void 0&&z.onValueChange(r.value)}),x=()=>{O||(z.onOpenChange(!0),C())};return ht.createElement(nS,ga({asChild:!0},pe),ht.createElement(Ci.button,ga({type:"button",role:"combobox","aria-controls":z.contentId,"aria-expanded":z.open,"aria-required":z.required,"aria-autocomplete":"none",dir:z.dir,"data-state":z.open?"open":"closed",disabled:O,"data-disabled":O?"":void 0,"data-placeholder":MP(z.value)?"":void 0},ie,{ref:e,onClick:Ja(ie.onClick,d=>{d.currentTarget.focus()}),onPointerDown:Ja(ie.onPointerDown,d=>{const g=d.target;g.hasPointerCapture(d.pointerId)&&g.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&(x(),z.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)},d.preventDefault())}),onKeyDown:Ja(ie.onKeyDown,d=>{const g=P.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&a(d.key),!(g&&d.key===" ")&&FU.includes(d.key)&&(x(),d.preventDefault())})})))}),WU="SelectValue",$U=ht.forwardRef((n,S)=>{const{__scopeSelect:D,className:$,style:ie,children:pe,placeholder:z="",...O}=n,e=r0(WU,D),{onValueNodeHasChildrenChange:p}=e,P=pe!==void 0,a=so(S,e.onValueNodeChange);return ic(()=>{p(P)},[p,P]),ht.createElement(Ci.span,ga({},O,{ref:a,style:{pointerEvents:"none"}}),MP(e.value)?ht.createElement(ht.Fragment,null,z):pe)}),jU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,children:$,...ie}=n;return ht.createElement(Ci.span,ga({"aria-hidden":!0},ie,{ref:S}),$||"▼")}),YU=n=>ht.createElement(Ab,ga({asChild:!0},n)),pg="SelectContent",ZU=ht.forwardRef((n,S)=>{const D=r0(pg,n.__scopeSelect),[$,ie]=ht.useState();if(ic(()=>{ie(new DocumentFragment)},[]),!D.open){const pe=$;return pe?rp.createPortal(ht.createElement(AP,{scope:n.__scopeSelect},ht.createElement(Db.Slot,{scope:n.__scopeSelect},ht.createElement("div",null,n.children))),pe):null}return ht.createElement(XU,ga({},n,{ref:S}))}),Sd=10,[AP,Ib]=Pg(pg),XU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,position:$="item-aligned",onCloseAutoFocus:ie,onEscapeKeyDown:pe,onPointerDownOutside:z,side:O,sideOffset:e,align:p,alignOffset:P,arrowPadding:a,collisionBoundary:C,collisionPadding:x,sticky:d,hideWhenDetached:g,avoidCollisions:t,...r}=n,o=r0(pg,D),[i,u]=ht.useState(null),[h,c]=ht.useState(null),b=so(S,H=>u(H)),[f,m]=ht.useState(null),[v,l]=ht.useState(null),y=mS(D),[E,A]=ht.useState(!1),R=ht.useRef(!1);ht.useEffect(()=>{if(i)return oS(i)},[i]),Z4();const w=ht.useCallback(H=>{const[U,...G]=y().map(ne=>ne.ref.current),[Y]=G.slice(-1),J=document.activeElement;for(const ne of H)if(ne===J||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===U&&h&&(h.scrollTop=0),ne===Y&&h&&(h.scrollTop=h.scrollHeight),ne==null||ne.focus(),document.activeElement!==J))return},[y,h]),L=ht.useCallback(()=>w([f,i]),[w,f,i]);ht.useEffect(()=>{E&&L()},[E,L]);const{onOpenChange:M,triggerPointerDownPosRef:s}=o;ht.useEffect(()=>{if(i){let H={x:0,y:0};const U=Y=>{var J,ne,le,ve;H={x:Math.abs(Math.round(Y.pageX)-((J=(ne=s.current)===null||ne===void 0?void 0:ne.x)!==null&&J!==void 0?J:0)),y:Math.abs(Math.round(Y.pageY)-((le=(ve=s.current)===null||ve===void 0?void 0:ve.y)!==null&&le!==void 0?le:0))}},G=Y=>{H.x<=10&&H.y<=10?Y.preventDefault():i.contains(Y.target)||M(!1),document.removeEventListener("pointermove",U),s.current=null};return s.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[i,M,s]),ht.useEffect(()=>{const H=()=>M(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[M]);const[_,T]=CP(H=>{const U=y().filter(J=>!J.disabled),G=U.find(J=>J.ref.current===document.activeElement),Y=PP(U,H,G);Y&&setTimeout(()=>Y.ref.current.focus())}),B=ht.useCallback((H,U,G)=>{const Y=!R.current&&!G;(o.value!==void 0&&o.value===U||Y)&&(m(H),Y&&(R.current=!0))},[o.value]),F=ht.useCallback(()=>i==null?void 0:i.focus(),[i]),W=ht.useCallback((H,U,G)=>{const Y=!R.current&&!G;(o.value!==void 0&&o.value===U||Y)&&l(H)},[o.value]),N=$==="popper"?ZE:KU,V=N===ZE?{side:O,sideOffset:e,align:p,alignOffset:P,arrowPadding:a,collisionBoundary:C,collisionPadding:x,sticky:d,hideWhenDetached:g,avoidCollisions:t}:{};return ht.createElement(AP,{scope:D,content:i,viewport:h,onViewportChange:c,itemRefCallback:B,selectedItem:f,onItemLeave:F,itemTextRefCallback:W,focusSelectedItem:L,selectedItemText:v,position:$,isPositioned:E,searchRef:_},ht.createElement(sS,{as:Yv,allowPinchZoom:!0},ht.createElement(X4,{asChild:!0,trapped:o.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:Ja(ie,H=>{var U;(U=o.trigger)===null||U===void 0||U.focus({preventScroll:!0}),H.preventDefault()})},ht.createElement(zm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:pe,onPointerDownOutside:z,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>o.onOpenChange(!1)},ht.createElement(N,ga({role:"listbox",id:o.contentId,"data-state":o.open?"open":"closed",dir:o.dir,onContextMenu:H=>H.preventDefault()},r,V,{onPlaced:()=>A(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...r.style},onKeyDown:Ja(r.onKeyDown,H=>{const U=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!U&&H.key.length===1&&T(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let Y=y().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(H.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const J=H.target,ne=Y.indexOf(J);Y=Y.slice(ne+1)}setTimeout(()=>w(Y)),H.preventDefault()}})}))))))}),KU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,onPlaced:$,...ie}=n,pe=r0(pg,D),z=Ib(pg,D),[O,e]=ht.useState(null),[p,P]=ht.useState(null),a=so(S,b=>P(b)),C=mS(D),x=ht.useRef(!1),d=ht.useRef(!0),{viewport:g,selectedItem:t,selectedItemText:r,focusSelectedItem:o}=z,i=ht.useCallback(()=>{if(pe.trigger&&pe.valueNode&&O&&p&&g&&t&&r){const b=pe.trigger.getBoundingClientRect(),f=p.getBoundingClientRect(),m=pe.valueNode.getBoundingClientRect(),v=r.getBoundingClientRect();if(pe.dir!=="rtl"){const J=v.left-f.left,ne=m.left-J,le=b.left-ne,ve=b.width+le,q=Math.max(ve,f.width),Z=window.innerWidth-Sd,K=pA(ne,[Sd,Z-q]);O.style.minWidth=ve+"px",O.style.left=K+"px"}else{const J=f.right-v.right,ne=window.innerWidth-m.right-J,le=window.innerWidth-b.right-ne,ve=b.width+le,q=Math.max(ve,f.width),Z=window.innerWidth-Sd,K=pA(ne,[Sd,Z-q]);O.style.minWidth=ve+"px",O.style.right=K+"px"}const l=C(),y=window.innerHeight-Sd*2,E=g.scrollHeight,A=window.getComputedStyle(p),R=parseInt(A.borderTopWidth,10),w=parseInt(A.paddingTop,10),L=parseInt(A.borderBottomWidth,10),M=parseInt(A.paddingBottom,10),s=R+w+E+M+L,_=Math.min(t.offsetHeight*5,s),T=window.getComputedStyle(g),B=parseInt(T.paddingTop,10),F=parseInt(T.paddingBottom,10),W=b.top+b.height/2-Sd,N=y-W,V=t.offsetHeight/2,H=t.offsetTop+V,U=R+w+H,G=s-U;if(U<=W){const J=t===l[l.length-1].ref.current;O.style.bottom="0px";const ne=p.clientHeight-g.offsetTop-g.offsetHeight,le=Math.max(N,V+(J?F:0)+ne+L),ve=U+le;O.style.height=ve+"px"}else{const J=t===l[0].ref.current;O.style.top="0px";const le=Math.max(W,R+g.offsetTop+(J?B:0)+V)+G;O.style.height=le+"px",g.scrollTop=U-W+g.offsetTop}O.style.margin=`${Sd}px 0`,O.style.minHeight=_+"px",O.style.maxHeight=y+"px",$==null||$(),requestAnimationFrame(()=>x.current=!0)}},[C,pe.trigger,pe.valueNode,O,p,g,t,r,pe.dir,$]);ic(()=>i(),[i]);const[u,h]=ht.useState();ic(()=>{p&&h(window.getComputedStyle(p).zIndex)},[p]);const c=ht.useCallback(b=>{b&&d.current===!0&&(i(),o==null||o(),d.current=!1)},[i,o]);return ht.createElement(JU,{scope:D,contentWrapper:O,shouldExpandOnScrollRef:x,onScrollButtonChange:c},ht.createElement("div",{ref:e,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:u}},ht.createElement(Ci.div,ga({},ie,{ref:a,style:{boxSizing:"border-box",maxHeight:"100%",...ie.style}}))))}),ZE=ht.forwardRef((n,S)=>{const{__scopeSelect:D,align:$="start",collisionPadding:ie=Sd,...pe}=n,z=xS(D);return ht.createElement(aS,ga({},z,pe,{ref:S,align:$,collisionPadding:ie,style:{boxSizing:"border-box",...pe.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JU,QU]=Pg(pg,{}),XE="SelectViewport",qU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n,ie=Ib(XE,D),pe=QU(XE,D),z=so(S,ie.onViewportChange),O=ht.useRef(0);return ht.createElement(ht.Fragment,null,ht.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),ht.createElement(Db.Slot,{scope:D},ht.createElement(Ci.div,ga({"data-radix-select-viewport":"",role:"presentation"},$,{ref:z,style:{position:"relative",flex:1,overflow:"auto",...$.style},onScroll:Ja($.onScroll,e=>{const p=e.currentTarget,{contentWrapper:P,shouldExpandOnScrollRef:a}=pe;if(a!=null&&a.current&&P){const C=Math.abs(O.current-p.scrollTop);if(C>0){const x=window.innerHeight-Sd*2,d=parseFloat(P.style.minHeight),g=parseFloat(P.style.height),t=Math.max(d,g);if(t0?i:0,P.style.justifyContent="flex-end")}}}O.current=p.scrollTop})}))))}),eH="SelectGroup",[ZV,tH]=Pg(eH),rH="SelectLabel",nH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n,ie=tH(rH,D);return ht.createElement(Ci.div,ga({id:ie.id},$,{ref:S}))}),PA="SelectItem",[aH,SP]=Pg(PA),iH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,value:$,disabled:ie=!1,textValue:pe,...z}=n,O=r0(PA,D),e=Ib(PA,D),p=O.value===$,[P,a]=ht.useState(pe??""),[C,x]=ht.useState(!1),d=so(S,r=>{var o;return(o=e.itemRefCallback)===null||o===void 0?void 0:o.call(e,r,$,ie)}),g=kd(),t=()=>{ie||(O.onValueChange($),O.onOpenChange(!1))};if($==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return ht.createElement(aH,{scope:D,value:$,disabled:ie,textId:g,isSelected:p,onItemTextChange:ht.useCallback(r=>{a(o=>{var i;return o||((i=r==null?void 0:r.textContent)!==null&&i!==void 0?i:"").trim()})},[])},ht.createElement(Db.ItemSlot,{scope:D,value:$,disabled:ie,textValue:P},ht.createElement(Ci.div,ga({role:"option","aria-labelledby":g,"data-highlighted":C?"":void 0,"aria-selected":p&&C,"data-state":p?"checked":"unchecked","aria-disabled":ie||void 0,"data-disabled":ie?"":void 0,tabIndex:ie?void 0:-1},z,{ref:d,onFocus:Ja(z.onFocus,()=>x(!0)),onBlur:Ja(z.onBlur,()=>x(!1)),onPointerUp:Ja(z.onPointerUp,t),onPointerMove:Ja(z.onPointerMove,r=>{if(ie){var o;(o=e.onItemLeave)===null||o===void 0||o.call(e)}else r.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ja(z.onPointerLeave,r=>{if(r.currentTarget===document.activeElement){var o;(o=e.onItemLeave)===null||o===void 0||o.call(e)}}),onKeyDown:Ja(z.onKeyDown,r=>{var o;((o=e.searchRef)===null||o===void 0?void 0:o.current)!==""&&r.key===" "||(OU.includes(r.key)&&t(),r.key===" "&&r.preventDefault())})}))))}),Lx="SelectItemText",oH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,className:$,style:ie,...pe}=n,z=r0(Lx,D),O=Ib(Lx,D),e=SP(Lx,D),p=UU(Lx,D),[P,a]=ht.useState(null),C=so(S,r=>a(r),e.onItemTextChange,r=>{var o;return(o=O.itemTextRefCallback)===null||o===void 0?void 0:o.call(O,r,e.value,e.disabled)}),x=P==null?void 0:P.textContent,d=ht.useMemo(()=>ht.createElement("option",{key:e.value,value:e.value,disabled:e.disabled},x),[e.disabled,e.value,x]),{onNativeOptionAdd:g,onNativeOptionRemove:t}=p;return ic(()=>(g(d),()=>t(d)),[g,t,d]),ht.createElement(ht.Fragment,null,ht.createElement(Ci.span,ga({id:e.textId},pe,{ref:C})),e.isSelected&&z.valueNode&&!z.valueNodeHasChildren?rp.createPortal(pe.children,z.valueNode):null)}),sH="SelectItemIndicator",lH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n;return SP(sH,D).isSelected?ht.createElement(Ci.span,ga({"aria-hidden":!0},$,{ref:S})):null}),uH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n;return ht.createElement(Ci.div,ga({"aria-hidden":!0},$,{ref:S}))});function MP(n){return n===""||n===void 0}const EP=ht.forwardRef((n,S)=>{const{value:D,...$}=n,ie=ht.useRef(null),pe=so(S,ie),z=iP(D);return ht.useEffect(()=>{const O=ie.current,e=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(e,"value").set;if(z!==D&&P){const a=new Event("change",{bubbles:!0});P.call(O,D),O.dispatchEvent(a)}},[z,D]),ht.createElement(Rb,{asChild:!0},ht.createElement("select",ga({},$,{ref:pe,defaultValue:D})))});EP.displayName="BubbleSelect";function CP(n){const S=Ns(n),D=ht.useRef(""),$=ht.useRef(0),ie=ht.useCallback(z=>{const O=D.current+z;S(O),function e(p){D.current=p,window.clearTimeout($.current),p!==""&&($.current=window.setTimeout(()=>e(""),1e3))}(O)},[S]),pe=ht.useCallback(()=>{D.current="",window.clearTimeout($.current)},[]);return ht.useEffect(()=>()=>window.clearTimeout($.current),[]),[D,ie,pe]}function PP(n,S,D){const ie=S.length>1&&Array.from(S).every(p=>p===S[0])?S[0]:S,pe=D?n.indexOf(D):-1;let z=fH(n,Math.max(pe,0));ie.length===1&&(z=z.filter(p=>p!==D));const e=z.find(p=>p.textValue.toLowerCase().startsWith(ie.toLowerCase()));return e!==D?e:void 0}function fH(n,S){return n.map((D,$)=>n[(S+$)%n.length])}const cH=HU,LP=GU,hH=$U,dH=jU,vH=YU,RP=ZU,pH=qU,_P=nH,DP=iH,gH=oH,yH=lH,IP=uH,kP=cH,FP=hH,bS=ht.forwardRef(({className:n,children:S,...D},$)=>qt.jsxs(LP,{ref:$,className:Ni("flex h-9 w-full items-center justify-between rounded-md border border-input bg-slate-700 px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 whitespace-nowrap overflow-hidden",n),...D,children:[S,qt.jsx(dH,{asChild:!0,children:qt.jsx(bB,{className:"h-4 w-4 opacity-50"})})]}));bS.displayName=LP.displayName;const wS=ht.forwardRef(({className:n,children:S,position:D="popper",...$},ie)=>qt.jsx(vH,{children:qt.jsx(RP,{ref:ie,className:Ni("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",D==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:D,...$,children:qt.jsx(pH,{className:Ni("p-1",D==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:S})})}));wS.displayName=RP.displayName;const mH=ht.forwardRef(({className:n,...S},D)=>qt.jsx(_P,{ref:D,className:Ni("px-2 py-1.5 text-sm font-semibold",n),...S}));mH.displayName=_P.displayName;const Z2=ht.forwardRef(({className:n,children:S,...D},$)=>qt.jsxs(DP,{ref:$,className:Ni("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...D,children:[qt.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:qt.jsx(yH,{children:qt.jsx(V9,{className:"h-4 w-4"})})}),qt.jsx(gH,{children:S})]}));Z2.displayName=DP.displayName;const xH=ht.forwardRef(({className:n,...S},D)=>qt.jsx(IP,{ref:D,className:Ni("-mx-1 my-1 h-px bg-muted",n),...S}));xH.displayName=IP.displayName;function I0({children:n,identifier:S,name:D,description:$}){return qt.jsxs(qt.Fragment,{children:[qt.jsx(bh,{htmlFor:S,className:"md:text-right sm:text-left",children:D}),n,qt.jsx("p",{className:"text-sm text-slate-200",children:$})]})}function bH({children:n}){const[S,D]=Pb(),$=ht.useCallback(ie=>{ie==="adamax"?D("learningRate",.01):D("learningRate",10),D("optimizer",ie)},[D]);return qt.jsxs("div",{children:[qt.jsx("p",{className:"text-slate-200",children:"Adjust the following parameters to improve performance."}),qt.jsxs("div",{className:"p-3 grid md:grid-cols-[auto,220px,3fr] sm:grid-cols-1 gap-x-5 gap-y-3 items-center",children:[qt.jsx(I0,{identifier:"targetEmbeddingSize",name:"Target Embedding Size",description:"How big should the embedding be after the matmul. Larger is usually better but more expensive to search over.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.targetEmbeddingSize,onChange:ie=>D("targetEmbeddingSize",Number(ie.target.value)),id:"targetEmbeddingSize"})}),qt.jsx(I0,{name:"Optimizer",identifier:"optimizer",description:"The algorithm to optimize the matrix.",children:qt.jsxs(kP,{value:S.optimizer,onValueChange:$,children:[qt.jsx(bS,{className:"w-[220px]",id:"optimizer",children:qt.jsx(FP,{})}),qt.jsxs(wS,{children:[qt.jsx(Z2,{value:"gradient",children:"Simple Gradient Descent"}),qt.jsx(Z2,{value:"adamax",children:"Adamax"})]})]})}),qt.jsx(I0,{identifier:"learningRate",name:"Learning Rate",description:"How big of a gradient to apply at each step.",children:qt.jsx(Qf,{type:"number",min:0,step:.01,value:S.learningRate,onChange:ie=>D("learningRate",Number(ie.target.value)),id:"learningRate"})}),qt.jsx(I0,{identifier:"batchSize",name:"Batch Size",description:"How many examples to show on each update.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.batchSize,onChange:ie=>D("batchSize",Number(ie.target.value)),id:"batchSize"})}),qt.jsx(I0,{identifier:"epochs",name:"Epochs",description:"How many times all examples should be shown to the model.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.epochs,onChange:ie=>D("epochs",Number(ie.target.value)),id:"epochs"})}),qt.jsx(I0,{identifier:"dropoutFraction",name:"Dropout Fraction",description:"Proportion of weights to randomly ignore. To prevent overfitting.",children:qt.jsx(Qf,{type:"number",min:0,max:1,step:.05,value:S.dropoutFraction,onChange:ie=>D("dropoutFraction",Number(ie.target.value)),id:"dropoutFraction"})})]}),n]})}function wH({state:n}){if(n.type!=="doneTraining"&&n.type!=="training")return null;const S=Math.round(1e4*(n.currentPerformance.trainAccuracyAndSE.accuracy-n.pretrainingPerformance.trainAccuracyAndSE.accuracy))/100,D=Math.round(1e4*(n.currentPerformance.testAccuracyAndSE.accuracy-n.pretrainingPerformance.testAccuracyAndSE.accuracy))/100;return qt.jsxs("p",{className:"text-slate-300 my-4",children:["Currently, test accuracy is"," ",qt.jsx("span",{className:"text-white",children:n.currentPerformance.testAccuracyAndSE.message})," ","(",qt.jsxs("span",{className:D>0?"text-green-300":"text-red-300",children:[D>0?"+":"",D,"%"]}),") and train accuracy is"," ",qt.jsx("span",{className:"text-white",children:n.currentPerformance.trainAccuracyAndSE.message})," ","(",qt.jsxs("span",{className:S>0?"text-green-300":"text-red-300",children:[S>0?"+":"",S,"%"]}),")."]})}function TH({state:n}){return n.type!=="doneTraining"&&n.type!=="training"?null:qt.jsxs("div",{className:"flex flex-row items-center justify-center flex-wrap",children:["(",qt.jsx(IU,{performanceHistory:n.performanceHistory}),")",qt.jsx(TP,{testPairings:n.currentPerformance.testCosinePairings,trainPairings:n.currentPerformance.trainCosinePairings})]})}function AH(){const[n]=Pb(),S=Hm();return S.type==="uninitialized"||S.type==="embeddingProgress"||S.type==="fetchingEmbeddings"?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Training"})}):qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Training"}),(S.type==="doneTraining"||S.type==="pretrained")&&qt.jsx(bH,{children:qt.jsx("div",{className:"flex flex-row p-3",children:qt.jsx(ds,{onClick:()=>S.train(n),className:"w-full",children:"Train"})})}),qt.jsxs("div",{children:[(S.type==="training"||S.type==="trainingStarted")&&qt.jsxs("div",{children:[qt.jsxs("p",{className:"text-slate-300 my-2",children:["Training (epoch ",S.currentEpoch+1,"/",n.epochs,")"]}),qt.jsx(yS,{className:"h-[20px]",value:Math.round(S.currentEpoch/n.epochs*100)})]}),qt.jsx(wH,{state:S}),qt.jsx(TH,{state:S}),qt.jsx("div",{className:"flex flex-row justify-end",children:S.type==="training"?qt.jsx(ds,{variant:"destructive",onClick:S.stop,children:"Stop"}):null})]})]})}function SH(){const n=Hm(),S=Bd(qh),D=gS(),[$]=Pb(),ie=Bd(hb),pe=ht.useCallback(()=>{if(!D)throw new Error("Pairs not loaded");if(n.type!=="uninitialized")throw new Error("Trainer already initialized");S.type==="local"?n.initializeLocal({pairings:D,parameters:$,apiKey:ie||""}):S.type==="example"&&n.initializeExample({pairings:D,parameters:$,cacheUrl:S.embeddingsURL})},[$,D,S,ie,n]),z=D?Sk(D):null;return{initializeDataset:pe,datasetCounts:z}}function MH(){const{initializeDataset:n,datasetCounts:S}=SH(),[D,$]=Pb(),ie=Bd(qh),pe=Bd(tD);if(!S)return qt.jsx("div",{children:"loading..."});const z=S.positives+S.negatives>1;return qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("p",{className:"text-slate-300 text-l my-2",children:["In this step, we prepare the data for training by embedding it and splitting it into a training and test set. Embeddings are retrieved from your browser cache first. If they aren't cached,"," ",qt.jsx("span",{className:"text-white font-bold",children:"this may download 50mb+ of data"}),"."]}),qt.jsxs("p",{className:"text-slate-300 text-l my-2",children:["There are ",qt.jsx("span",{className:"text-white",children:S.positives})," ","positive examples and"," ",qt.jsx("span",{className:"text-white",children:S.negatives})," negative examples."," ",!z&&qt.jsx("span",{className:"text-red-300 font-bold",children:"You need at least 2 examples to train."}),z&&S.negatives0&&qt.jsxs(qt.Fragment,{children:[qt.jsxs(bh,{htmlFor:"augment",className:"md:text-right sm:text-left",children:["Generate"," ",Math.max(S.positives-S.negatives,0)," ","negative examples"]}),qt.jsx(Cb,{id:"augment",checked:D.generateSyntheticNegatives,onCheckedChange:O=>$("generateSyntheticNegatives",O)})]}),qt.jsx(bh,{htmlFor:"split",className:"md:text-right sm:text-left",children:"Fraction of dataset used for testing"}),qt.jsx(Qf,{id:"split",type:"number",className:"max-w-[100px]",max:.95,min:.01,step:.1,value:D.testSplitFraction,onChange:O=>$("testSplitFraction",Number(O.target.value))}),ie.type==="local"&&pe.state==="hasData"&&qt.jsxs(qt.Fragment,{children:[qt.jsx(bh,{htmlFor:"model",className:"md:text-right sm:text-left",children:"Embedding model"}),qt.jsxs(kP,{value:D.embeddingModel,onValueChange:O=>$("embeddingModel",O),children:[qt.jsx(bS,{className:"md:w-[250px] sm:w-[200px]",id:"model",children:qt.jsx(FP,{})}),qt.jsx(wS,{children:pe.data.map((O,e)=>qt.jsx(Z2,{value:O,children:O},e))})]})]})]}),qt.jsx("div",{className:"w-full px-3",children:qt.jsx(ds,{className:"w-full",onClick:n,disabled:!z,children:z?"Prepare Data":"Not enough examples"})})]})}const[kb,XV]=Bc("Tooltip",[Cg]),TS=Cg(),EH="TooltipProvider",CH=700,LA="tooltip.open",[PH,AS]=kb(EH),LH=n=>{const{__scopeTooltip:S,delayDuration:D=CH,skipDelayDuration:$=300,disableHoverableContent:ie=!1,children:pe}=n,[z,O]=ht.useState(!0),e=ht.useRef(!1),p=ht.useRef(0);return ht.useEffect(()=>{const P=p.current;return()=>window.clearTimeout(P)},[]),ht.createElement(PH,{scope:S,isOpenDelayed:z,delayDuration:D,onOpen:ht.useCallback(()=>{window.clearTimeout(p.current),O(!1)},[]),onClose:ht.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>O(!0),$)},[$]),isPointerInTransitRef:e,onPointerInTransitChange:ht.useCallback(P=>{e.current=P},[]),disableHoverableContent:ie},pe)},SS="Tooltip",[RH,Fb]=kb(SS),_H=n=>{const{__scopeTooltip:S,children:D,open:$,defaultOpen:ie=!1,onOpenChange:pe,disableHoverableContent:z,delayDuration:O}=n,e=AS(SS,n.__scopeTooltip),p=TS(S),[P,a]=ht.useState(null),C=kd(),x=ht.useRef(0),d=z??e.disableHoverableContent,g=O??e.delayDuration,t=ht.useRef(!1),[r=!1,o]=Xv({prop:$,defaultProp:ie,onChange:b=>{b?(e.onOpen(),document.dispatchEvent(new CustomEvent(LA))):e.onClose(),pe==null||pe(b)}}),i=ht.useMemo(()=>r?t.current?"delayed-open":"instant-open":"closed",[r]),u=ht.useCallback(()=>{window.clearTimeout(x.current),t.current=!1,o(!0)},[o]),h=ht.useCallback(()=>{window.clearTimeout(x.current),o(!1)},[o]),c=ht.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{t.current=!0,o(!0)},g)},[g,o]);return ht.useEffect(()=>()=>window.clearTimeout(x.current),[]),ht.createElement(rS,p,ht.createElement(RH,{scope:S,contentId:C,open:r,stateAttribute:i,trigger:P,onTriggerChange:a,onTriggerEnter:ht.useCallback(()=>{e.isOpenDelayed?c():u()},[e.isOpenDelayed,c,u]),onTriggerLeave:ht.useCallback(()=>{d?h():window.clearTimeout(x.current)},[h,d]),onOpen:u,onClose:h,disableHoverableContent:d},D))},KE="TooltipTrigger",DH=ht.forwardRef((n,S)=>{const{__scopeTooltip:D,...$}=n,ie=Fb(KE,D),pe=AS(KE,D),z=TS(D),O=ht.useRef(null),e=so(S,O,ie.onTriggerChange),p=ht.useRef(!1),P=ht.useRef(!1),a=ht.useCallback(()=>p.current=!1,[]);return ht.useEffect(()=>()=>document.removeEventListener("pointerup",a),[a]),ht.createElement(nS,ga({asChild:!0},z),ht.createElement(Ci.button,ga({"aria-describedby":ie.open?ie.contentId:void 0,"data-state":ie.stateAttribute},$,{ref:e,onPointerMove:Ja(n.onPointerMove,C=>{C.pointerType!=="touch"&&!P.current&&!pe.isPointerInTransitRef.current&&(ie.onTriggerEnter(),P.current=!0)}),onPointerLeave:Ja(n.onPointerLeave,()=>{ie.onTriggerLeave(),P.current=!1}),onPointerDown:Ja(n.onPointerDown,()=>{p.current=!0,document.addEventListener("pointerup",a,{once:!0})}),onFocus:Ja(n.onFocus,()=>{p.current||ie.onOpen()}),onBlur:Ja(n.onBlur,ie.onClose),onClick:Ja(n.onClick,ie.onClose)})))}),IH="TooltipPortal",[KV,kH]=kb(IH,{forceMount:void 0}),Cm="TooltipContent",FH=ht.forwardRef((n,S)=>{const D=kH(Cm,n.__scopeTooltip),{forceMount:$=D.forceMount,side:ie="top",...pe}=n,z=Fb(Cm,n.__scopeTooltip);return ht.createElement(Mf,{present:$||z.open},z.disableHoverableContent?ht.createElement(OP,ga({side:ie},pe,{ref:S})):ht.createElement(OH,ga({side:ie},pe,{ref:S})))}),OH=ht.forwardRef((n,S)=>{const D=Fb(Cm,n.__scopeTooltip),$=AS(Cm,n.__scopeTooltip),ie=ht.useRef(null),pe=so(S,ie),[z,O]=ht.useState(null),{trigger:e,onClose:p}=D,P=ie.current,{onPointerInTransitChange:a}=$,C=ht.useCallback(()=>{O(null),a(!1)},[a]),x=ht.useCallback((d,g)=>{const t=d.currentTarget,r={x:d.clientX,y:d.clientY},o=NH(r,t.getBoundingClientRect()),i=BH(r,o),u=UH(g.getBoundingClientRect()),h=VH([...i,...u]);O(h),a(!0)},[a]);return ht.useEffect(()=>()=>C(),[C]),ht.useEffect(()=>{if(e&&P){const d=t=>x(t,P),g=t=>x(t,e);return e.addEventListener("pointerleave",d),P.addEventListener("pointerleave",g),()=>{e.removeEventListener("pointerleave",d),P.removeEventListener("pointerleave",g)}}},[e,P,x,C]),ht.useEffect(()=>{if(z){const d=g=>{const t=g.target,r={x:g.clientX,y:g.clientY},o=(e==null?void 0:e.contains(t))||(P==null?void 0:P.contains(t)),i=!HH(r,z);o?C():i&&(C(),p())};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)}},[e,P,z,p,C]),ht.createElement(OP,ga({},n,{ref:pe}))}),[zH,JV]=kb(SS,{isInside:!1}),OP=ht.forwardRef((n,S)=>{const{__scopeTooltip:D,children:$,"aria-label":ie,onEscapeKeyDown:pe,onPointerDownOutside:z,...O}=n,e=Fb(Cm,D),p=TS(D),{onClose:P}=e;return ht.useEffect(()=>(document.addEventListener(LA,P),()=>document.removeEventListener(LA,P)),[P]),ht.useEffect(()=>{if(e.trigger){const a=C=>{const x=C.target;x!=null&&x.contains(e.trigger)&&P()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[e.trigger,P]),ht.createElement(zm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:pe,onPointerDownOutside:z,onFocusOutside:a=>a.preventDefault(),onDismiss:P},ht.createElement(aS,ga({"data-state":e.stateAttribute},p,O,{ref:S,style:{...O.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),ht.createElement(u7,null,$),ht.createElement(zH,{scope:D,isInside:!0},ht.createElement(kU,{id:e.contentId,role:"tooltip"},ie||$))))});function NH(n,S){const D=Math.abs(S.top-n.y),$=Math.abs(S.bottom-n.y),ie=Math.abs(S.right-n.x),pe=Math.abs(S.left-n.x);switch(Math.min(D,$,ie,pe)){case pe:return"left";case ie:return"right";case D:return"top";case $:return"bottom";default:throw new Error("unreachable")}}function BH(n,S,D=5){const $=[];switch(S){case"top":$.push({x:n.x-D,y:n.y+D},{x:n.x+D,y:n.y+D});break;case"bottom":$.push({x:n.x-D,y:n.y-D},{x:n.x+D,y:n.y-D});break;case"left":$.push({x:n.x+D,y:n.y-D},{x:n.x+D,y:n.y+D});break;case"right":$.push({x:n.x-D,y:n.y-D},{x:n.x-D,y:n.y+D});break}return $}function UH(n){const{top:S,right:D,bottom:$,left:ie}=n;return[{x:ie,y:S},{x:D,y:S},{x:D,y:$},{x:ie,y:$}]}function HH(n,S){const{x:D,y:$}=n;let ie=!1;for(let pe=0,z=S.length-1;pe$!=P>$&&D<(p-O)*($-e)/(P-e)+O&&(ie=!ie)}return ie}function VH(n){const S=n.slice();return S.sort((D,$)=>D.x<$.x?-1:D.x>$.x?1:D.y<$.y?-1:D.y>$.y?1:0),GH(S)}function GH(n){if(n.length<=1)return n.slice();const S=[];for(let $=0;$=2;){const pe=S[S.length-1],z=S[S.length-2];if((pe.x-z.x)*(ie.y-z.y)>=(pe.y-z.y)*(ie.x-z.x))S.pop();else break}S.push(ie)}S.pop();const D=[];for(let $=n.length-1;$>=0;$--){const ie=n[$];for(;D.length>=2;){const pe=D[D.length-1],z=D[D.length-2];if((pe.x-z.x)*(ie.y-z.y)>=(pe.y-z.y)*(ie.x-z.x))D.pop();else break}D.push(ie)}return D.pop(),S.length===1&&D.length===1&&S[0].x===D[0].x&&S[0].y===D[0].y?S:S.concat(D)}const WH=LH,$H=_H,jH=DH,zP=FH,YH=WH,ZH=$H,XH=jH,NP=ht.forwardRef(({className:n,sideOffset:S=4,...D},$)=>qt.jsx(zP,{ref:$,sideOffset:S,className:Ni("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...D}));NP.displayName=zP.displayName;function KH({children:n,tooltip:S,asChild:D=!1}){return qt.jsxs(ZH,{children:[qt.jsx(XH,{className:"flex-shrink-0",asChild:D,children:n}),qt.jsx(NP,{children:qt.jsx("p",{className:"max-w-[200px]",children:S})})]})}function JH(){const n=Hm();return gS().length===0?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Embeddings"})}):n.type==="uninitialized"?qt.jsx(MH,{}):n.type==="fetchingEmbeddings"?qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("div",{className:"p-2 w-full flex flex-col justify-center items-center",children:[qt.jsx("p",{className:"py-2 text-slate-300",children:"Fetching precomputed embeddings..."}),qt.jsx(qF,{className:"animate-spin"})]})]}):n.type==="embeddingProgress"?qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("div",{className:"p-2",children:[qt.jsxs("p",{className:"py-2 text-slate-300",children:["embedding & caching (",Math.round(n.progress*100),"%)..."]}),qt.jsx(yS,{value:n.progress*100})]})]}):qt.jsxs("div",{className:Zh,children:[qt.jsxs("div",{className:"flex flex-row justify-between",children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Pretraining"}),qt.jsx(KH,{tooltip:"Download all embeddings",asChild:!0,children:qt.jsx(ds,{variant:"ghost",onClick:n.downloadEmbeddings,"aria-label":"Download all embeddings",children:qt.jsx(Y4,{size:14})})})]}),qt.jsxs("div",{children:[qt.jsxs("div",{className:"py-3",children:[qt.jsxs("p",{className:"text-slate-300 text-l",children:["The test set has"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.testCosinePairings.length})," ","pairs and the train set has"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.trainCosinePairings.length})," ","pairs."]}),qt.jsxs("p",{className:"text-slate-300 text-l",children:["Before training, the test set performance is"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.testAccuracyAndSE.message})," ","and the train set performance is"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.trainAccuracyAndSE.message}),"."]}),qt.jsx("p",{className:"text-slate-300 text-l",children:"Ideally, a red peak will be on the left and a blue peak will be on the right, non-overlapping."})]}),qt.jsx("div",{children:qt.jsx(TP,{trainPairings:n.pretrainingPerformance.trainCosinePairings,testPairings:n.pretrainingPerformance.testCosinePairings})})]})]})}function QH(){const n=Hm(),S=ht.useCallback(()=>{if(n.type==="doneTraining"){const D=new Blob([n.bestMatrix.matrixNpy],{type:"application/octet-stream"}),$=document.createElement("a"),ie=window.URL.createObjectURL(D);$.href=ie,$.download="spaceshifted.npy",$.click(),URL.revokeObjectURL(ie),$.remove()}},[n]);return n.type!=="doneTraining"?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Matrix"})}):qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Matrix"}),qt.jsxs("div",{children:[qt.jsxs("div",{children:[qt.jsxs("p",{className:"text-slate-300",children:["We trained a ",qt.jsx("span",{className:"text-white",children:"bias matrix"})," of size"," ",qt.jsxs("span",{className:"text-white",children:["(",n.bestMatrix.shape[0],", ",n.bestMatrix.shape[1],")"]}),"."]}),qt.jsxs("p",{className:"text-slate-300",children:["You can multiply it with vectors of size"," ",qt.jsx("span",{className:"text-white",children:n.bestMatrix.shape[0]})," to get ",qt.jsx("span",{className:"text-purple-200",children:"Spaceshifted"})," vectors of size"," ",qt.jsx("span",{className:"text-white",children:n.bestMatrix.shape[1]}),"."]})]}),qt.jsxs("div",{className:"flex flex-row flex-wrap my-3",children:[qt.jsxs("div",{children:[qt.jsx("h2",{className:"text-xl",children:"Usage"}),qt.jsxs("div",{className:"max-w-[500px] min-w-[200px] py-3 px-4 mt-1 text-left text-sm bg-slate-900 rounded-md border border-slate-500 font-mono inline-block",children:[qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-blue-300",children:"import"})," ",qt.jsx("span",{className:"text-red-300",children:"numpy"})," ",qt.jsx("span",{className:"text-blue-300",children:"as"})," ",qt.jsx("span",{className:"text-yellow-300",children:"np"})]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ="," ",qt.jsx("span",{className:"text-yellow-300",children:"np"}),".",qt.jsx("span",{className:"text-blue-300",children:"load"}),"(",qt.jsx("span",{className:"text-red-300",children:'"spaceshifted.npy"'}),","," ",qt.jsx("span",{className:"text-blue-300",children:"allow_pickle"}),"=",qt.jsx("span",{className:"text-green-300",children:"True"}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"v"})," ="," ",qt.jsxs("span",{className:"text-gray-300",children:["# vector of size (",n.bestMatrix.shape[0],",)"]})]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"v"})]})]})]}),qt.jsx("div",{className:"flex justify-center items-center flex-1 my-4",children:qt.jsxs(ds,{onClick:S,children:[qt.jsx(Y4,{size:20,className:"mr-2"})," ",qt.jsx("span",{className:"whitespace-nowrap",children:"download matrix"})," ",qt.jsx("span",{className:"font-mono ml-1",children:"spaceshifted.npy"})]})})]})]})]})}function qH(){const[n,S]=Gp(qh),D=Vm.useLiveQuery(async()=>{if(n.type==="local"){const pe=await Th.dataset.get(n.id);return pe==null?void 0:pe.name}else if(n.type==="example")return n.name},[n]),{toast:$}=Sg(),ie=ht.useCallback(async()=>{if(n.type==="local"){const{dismiss:pe}=$({title:"Deleting dataset..."});await Th.deleteDataset(n.id),pe(),S({type:"none"})}},[n,S,$]);return D?qt.jsxs("div",{children:[qt.jsxs("div",{className:"flex flex-row justify-between",children:[qt.jsxs("h1",{className:"text-3xl",children:[qt.jsx("span",{className:"text-slate-500 text-2xl button cursor-pointer",onClick:()=>S({type:"none"}),children:"projects/"}),D]}),qt.jsx("div",{children:n.type==="local"&&qt.jsxs(dg,{children:[qt.jsx(vg,{children:qt.jsx(nO,{size:15,className:"opacity-50"})}),qt.jsxs(Yp,{children:[qt.jsx(Zp,{children:qt.jsxs(Eb,{className:"text-white",children:["Delete ",D,"?"]})}),qt.jsxs(pS,{children:[qt.jsx(ds,{variant:"destructive",onClick:ie,children:"Delete"}),qt.jsx(J9,{asChild:!0,children:qt.jsx(ds,{variant:"outline",type:"submit",className:"text-white",children:"Cancel"})})]})]})]})})]}),qt.jsx(wU,{}),qt.jsx(JH,{}),qt.jsx(AH,{}),qt.jsx(QH,{})]}):qt.jsx("div",{children:"loading..."})}const BP="ToastProvider",[MS,eV,tV]=bb("Toast"),[UP,QV]=Bc("Toast",[tV]),[rV,Ob]=UP(BP),HP=n=>{const{__scopeToast:S,label:D="Notification",duration:$=5e3,swipeDirection:ie="right",swipeThreshold:pe=50,children:z}=n,[O,e]=ht.useState(null),[p,P]=ht.useState(0),a=ht.useRef(!1),C=ht.useRef(!1);return ht.createElement(MS.Provider,{scope:S},ht.createElement(rV,{scope:S,label:D,duration:$,swipeDirection:ie,swipeThreshold:pe,toastCount:p,viewport:O,onViewportChange:e,onToastAdd:ht.useCallback(()=>P(x=>x+1),[]),onToastRemove:ht.useCallback(()=>P(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:a,isClosePausedRef:C},z))};HP.propTypes={label(n){if(n.label&&typeof n.label=="string"&&!n.label.trim()){const S=`Invalid prop \`label\` supplied to \`${BP}\`. Expected non-empty \`string\`.`;return new Error(S)}return null}};const nV="ToastViewport",aV=["F8"],RA="toast.viewportPause",_A="toast.viewportResume",iV=ht.forwardRef((n,S)=>{const{__scopeToast:D,hotkey:$=aV,label:ie="Notifications ({hotkey})",...pe}=n,z=Ob(nV,D),O=eV(D),e=ht.useRef(null),p=ht.useRef(null),P=ht.useRef(null),a=ht.useRef(null),C=so(S,a,z.onViewportChange),x=$.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=z.toastCount>0;ht.useEffect(()=>{const t=r=>{var o;$.every(u=>r[u]||r.code===u)&&((o=a.current)===null||o===void 0||o.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[$]),ht.useEffect(()=>{const t=e.current,r=a.current;if(d&&t&&r){const o=()=>{if(!z.isClosePausedRef.current){const c=new CustomEvent(RA);r.dispatchEvent(c),z.isClosePausedRef.current=!0}},i=()=>{if(z.isClosePausedRef.current){const c=new CustomEvent(_A);r.dispatchEvent(c),z.isClosePausedRef.current=!1}},u=c=>{!t.contains(c.relatedTarget)&&i()},h=()=>{t.contains(document.activeElement)||i()};return t.addEventListener("focusin",o),t.addEventListener("focusout",u),t.addEventListener("pointermove",o),t.addEventListener("pointerleave",h),window.addEventListener("blur",o),window.addEventListener("focus",i),()=>{t.removeEventListener("focusin",o),t.removeEventListener("focusout",u),t.removeEventListener("pointermove",o),t.removeEventListener("pointerleave",h),window.removeEventListener("blur",o),window.removeEventListener("focus",i)}}},[d,z.isClosePausedRef]);const g=ht.useCallback(({tabbingDirection:t})=>{const o=O().map(i=>{const u=i.ref.current,h=[u,...wV(u)];return t==="forwards"?h:h.reverse()});return(t==="forwards"?o.reverse():o).flat()},[O]);return ht.useEffect(()=>{const t=a.current;if(t){const r=o=>{const i=o.altKey||o.ctrlKey||o.metaKey;if(o.key==="Tab"&&!i){const f=document.activeElement,m=o.shiftKey;if(o.target===t&&m){var h;(h=p.current)===null||h===void 0||h.focus();return}const y=g({tabbingDirection:m?"backwards":"forwards"}),E=y.findIndex(A=>A===f);if(FT(y.slice(E+1)))o.preventDefault();else{var c,b;m?(c=p.current)===null||c===void 0||c.focus():(b=P.current)===null||b===void 0||b.focus()}}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}},[O,g]),ht.createElement(hO,{ref:e,role:"region","aria-label":ie.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:d?void 0:"none"}},d&&ht.createElement(JE,{ref:p,onFocusFromOutsideViewport:()=>{const t=g({tabbingDirection:"forwards"});FT(t)}}),ht.createElement(MS.Slot,{scope:D},ht.createElement(Ci.ol,ga({tabIndex:-1},pe,{ref:C}))),d&&ht.createElement(JE,{ref:P,onFocusFromOutsideViewport:()=>{const t=g({tabbingDirection:"backwards"});FT(t)}}))}),oV="ToastFocusProxy",JE=ht.forwardRef((n,S)=>{const{__scopeToast:D,onFocusFromOutsideViewport:$,...ie}=n,pe=Ob(oV,D);return ht.createElement(Rb,ga({"aria-hidden":!0,tabIndex:0},ie,{ref:S,style:{position:"fixed"},onFocus:z=>{var O;const e=z.relatedTarget;!((O=pe.viewport)!==null&&O!==void 0&&O.contains(e))&&$()}}))}),zb="Toast",sV="toast.swipeStart",lV="toast.swipeMove",uV="toast.swipeCancel",fV="toast.swipeEnd",cV=ht.forwardRef((n,S)=>{const{forceMount:D,open:$,defaultOpen:ie,onOpenChange:pe,...z}=n,[O=!0,e]=Xv({prop:$,defaultProp:ie,onChange:pe});return ht.createElement(Mf,{present:D||O},ht.createElement(VP,ga({open:O},z,{ref:S,onClose:()=>e(!1),onPause:Ns(n.onPause),onResume:Ns(n.onResume),onSwipeStart:Ja(n.onSwipeStart,p=>{p.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ja(n.onSwipeMove,p=>{const{x:P,y:a}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","move"),p.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${P}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${a}px`)}),onSwipeCancel:Ja(n.onSwipeCancel,p=>{p.currentTarget.setAttribute("data-swipe","cancel"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ja(n.onSwipeEnd,p=>{const{x:P,y:a}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","end"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${P}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${a}px`),e(!1)})})))}),[hV,dV]=UP(zb,{onClose(){}}),VP=ht.forwardRef((n,S)=>{const{__scopeToast:D,type:$="foreground",duration:ie,open:pe,onClose:z,onEscapeKeyDown:O,onPause:e,onResume:p,onSwipeStart:P,onSwipeMove:a,onSwipeCancel:C,onSwipeEnd:x,...d}=n,g=Ob(zb,D),[t,r]=ht.useState(null),o=so(S,A=>r(A)),i=ht.useRef(null),u=ht.useRef(null),h=ie||g.duration,c=ht.useRef(0),b=ht.useRef(h),f=ht.useRef(0),{onToastAdd:m,onToastRemove:v}=g,l=Ns(()=>{var A;(t==null?void 0:t.contains(document.activeElement))&&((A=g.viewport)===null||A===void 0||A.focus()),z()}),y=ht.useCallback(A=>{!A||A===1/0||(window.clearTimeout(f.current),c.current=new Date().getTime(),f.current=window.setTimeout(l,A))},[l]);ht.useEffect(()=>{const A=g.viewport;if(A){const R=()=>{y(b.current),p==null||p()},w=()=>{const L=new Date().getTime()-c.current;b.current=b.current-L,window.clearTimeout(f.current),e==null||e()};return A.addEventListener(RA,w),A.addEventListener(_A,R),()=>{A.removeEventListener(RA,w),A.removeEventListener(_A,R)}}},[g.viewport,h,e,p,y]),ht.useEffect(()=>{pe&&!g.isClosePausedRef.current&&y(h)},[pe,h,g.isClosePausedRef,y]),ht.useEffect(()=>(m(),()=>v()),[m,v]);const E=ht.useMemo(()=>t?jP(t):null,[t]);return g.viewport?ht.createElement(ht.Fragment,null,E&&ht.createElement(vV,{__scopeToast:D,role:"status","aria-live":$==="foreground"?"assertive":"polite","aria-atomic":!0},E),ht.createElement(hV,{scope:D,onClose:l},rp.createPortal(ht.createElement(MS.ItemSlot,{scope:D},ht.createElement(cO,{asChild:!0,onEscapeKeyDown:Ja(O,()=>{g.isFocusedToastEscapeKeyDownRef.current||l(),g.isFocusedToastEscapeKeyDownRef.current=!1})},ht.createElement(Ci.li,ga({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":pe?"open":"closed","data-swipe-direction":g.swipeDirection},d,{ref:o,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:Ja(n.onKeyDown,A=>{A.key==="Escape"&&(O==null||O(A.nativeEvent),A.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,l()))}),onPointerDown:Ja(n.onPointerDown,A=>{A.button===0&&(i.current={x:A.clientX,y:A.clientY})}),onPointerMove:Ja(n.onPointerMove,A=>{if(!i.current)return;const R=A.clientX-i.current.x,w=A.clientY-i.current.y,L=!!u.current,M=["left","right"].includes(g.swipeDirection),s=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,_=M?s(0,R):0,T=M?0:s(0,w),B=A.pointerType==="touch"?10:2,F={x:_,y:T},W={originalEvent:A,delta:F};L?(u.current=F,Rx(lV,a,W,{discrete:!1})):QE(F,g.swipeDirection,B)?(u.current=F,Rx(sV,P,W,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(R)>B||Math.abs(w)>B)&&(i.current=null)}),onPointerUp:Ja(n.onPointerUp,A=>{const R=u.current,w=A.target;if(w.hasPointerCapture(A.pointerId)&&w.releasePointerCapture(A.pointerId),u.current=null,i.current=null,R){const L=A.currentTarget,M={originalEvent:A,delta:R};QE(R,g.swipeDirection,g.swipeThreshold)?Rx(fV,x,M,{discrete:!0}):Rx(uV,C,M,{discrete:!0}),L.addEventListener("click",s=>s.preventDefault(),{once:!0})}})})))),g.viewport))):null});VP.propTypes={type(n){if(n.type&&!["foreground","background"].includes(n.type)){const S=`Invalid prop \`type\` supplied to \`${zb}\`. Expected \`foreground | background\`.`;return new Error(S)}return null}};const vV=n=>{const{__scopeToast:S,children:D,...$}=n,ie=Ob(zb,S),[pe,z]=ht.useState(!1),[O,e]=ht.useState(!1);return xV(()=>z(!0)),ht.useEffect(()=>{const p=window.setTimeout(()=>e(!0),1e3);return()=>window.clearTimeout(p)},[]),O?null:ht.createElement(Ab,{asChild:!0},ht.createElement(Rb,$,pe&&ht.createElement(ht.Fragment,null,ie.label," ",D)))},pV=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n;return ht.createElement(Ci.div,ga({},$,{ref:S}))}),gV=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n;return ht.createElement(Ci.div,ga({},$,{ref:S}))}),yV="ToastAction",GP=ht.forwardRef((n,S)=>{const{altText:D,...$}=n;return D?ht.createElement($P,{altText:D,asChild:!0},ht.createElement(WP,ga({},$,{ref:S}))):null});GP.propTypes={altText(n){return n.altText?null:new Error(`Missing prop \`altText\` expected on \`${yV}\``)}};const mV="ToastClose",WP=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n,ie=dV(mV,D);return ht.createElement($P,{asChild:!0},ht.createElement(Ci.button,ga({type:"button"},$,{ref:S,onClick:Ja(n.onClick,ie.onClose)})))}),$P=ht.forwardRef((n,S)=>{const{__scopeToast:D,altText:$,...ie}=n;return ht.createElement(Ci.div,ga({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":$||void 0},ie,{ref:S}))});function jP(n){const S=[];return Array.from(n.childNodes).forEach($=>{if($.nodeType===$.TEXT_NODE&&$.textContent&&S.push($.textContent),bV($)){const ie=$.ariaHidden||$.hidden||$.style.display==="none",pe=$.dataset.radixToastAnnounceExclude==="";if(!ie)if(pe){const z=$.dataset.radixToastAnnounceAlt;z&&S.push(z)}else S.push(...jP($))}}),S}function Rx(n,S,D,{discrete:$}){const ie=D.originalEvent.currentTarget,pe=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:D});S&&ie.addEventListener(n,S,{once:!0}),$?$4(ie,pe):ie.dispatchEvent(pe)}const QE=(n,S,D=0)=>{const $=Math.abs(n.x),ie=Math.abs(n.y),pe=$>ie;return S==="left"||S==="right"?pe&&$>D:!pe&&ie>D};function xV(n=()=>{}){const S=Ns(n);ic(()=>{let D=0,$=0;return D=window.requestAnimationFrame(()=>$=window.requestAnimationFrame(S)),()=>{window.cancelAnimationFrame(D),window.cancelAnimationFrame($)}},[S])}function bV(n){return n.nodeType===n.ELEMENT_NODE}function wV(n){const S=[],D=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:$=>{const ie=$.tagName==="INPUT"&&$.type==="hidden";return $.disabled||$.hidden||ie?NodeFilter.FILTER_SKIP:$.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;D.nextNode();)S.push(D.currentNode);return S}function FT(n){const S=document.activeElement;return n.some(D=>D===S?!0:(D.focus(),document.activeElement!==S))}const TV=HP,YP=iV,ZP=cV,XP=pV,KP=gV,JP=GP,QP=WP,AV=TV,qP=ht.forwardRef(({className:n,...S},D)=>qt.jsx(YP,{ref:D,className:Ni("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...S}));qP.displayName=YP.displayName;const SV=B4("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),eL=ht.forwardRef(({className:n,variant:S,...D},$)=>qt.jsx(ZP,{ref:$,className:Ni(SV({variant:S}),n),...D}));eL.displayName=ZP.displayName;const MV=ht.forwardRef(({className:n,...S},D)=>qt.jsx(JP,{ref:D,className:Ni("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...S}));MV.displayName=JP.displayName;const tL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(QP,{ref:D,className:Ni("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...S,children:qt.jsx(G9,{className:"h-4 w-4"})}));tL.displayName=QP.displayName;const rL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(XP,{ref:D,className:Ni("text-sm font-semibold [&+div]:text-xs",n),...S}));rL.displayName=XP.displayName;const nL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(KP,{ref:D,className:Ni("text-sm opacity-90",n),...S}));nL.displayName=KP.displayName;function EV(){const{toasts:n}=Sg();return qt.jsxs(AV,{duration:3e3,children:[n.map(function({id:S,title:D,description:$,action:ie,...pe}){return qt.jsxs(eL,{...pe,children:[qt.jsxs("div",{className:"grid gap-1",children:[D&&qt.jsx(rL,{children:D}),$&&qt.jsx(nL,{children:$})]}),ie,qt.jsx(tL,{})]},S)}),qt.jsx(qP,{})]})}function CV(){return qt.jsxs("div",{className:"p-5 mx-auto max-w-6xl text-center",children:[qt.jsx("h1",{className:"text-5xl font-bold from-purple-100 bg-gradient-to-b to-purple-400 text-transparent bg-clip-text inline-block p-3",children:"Finetune your embeddings"}),qt.jsxs("p",{className:"text-2xl text-slate-200 mt-2",children:["Boost your OpenAI embeddings with a"," ",qt.jsx("span",{className:"font-medium text-slate-100",children:"simple matmul"})," trained ",qt.jsx("span",{className:"font-medium text-slate-100",children:"in your browser"})]}),qt.jsxs("div",{className:"mx-auto py-3 px-4 mt-5 text-left text-sm bg-slate-900 rounded-md border border-slate-500 font-mono inline-block",children:[qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"np.load"}),"(",qt.jsx("span",{className:"text-red-300",children:'"spaceshifted.npy"'}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"u"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"get_embedding"}),"(",qt.jsx("span",{className:"text-red-300",children:`"What's the capital of Peru?"`}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"v"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"get_embedding"}),"(",qt.jsx("span",{className:"text-red-300",children:'"Lima."'}),")"]}),qt.jsx("br",{}),qt.jsx("span",{className:"block",children:"("}),qt.jsxs("span",{className:"block ml-2",children:[qt.jsx("span",{className:"text-blue-300",children:"cosine_similarity"}),"(",qt.jsx("span",{className:"text-yellow-300",children:"u"}),","," ",qt.jsx("span",{className:"text-yellow-300",children:"v"}),"),"," ",qt.jsx("span",{className:"text-gray-300",children:"# far apart"})]}),qt.jsxs("span",{className:"block ml-2",children:[qt.jsx("span",{className:"text-blue-300",children:"cosine_similarity"}),"(",qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"u"}),","," ",qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"v"}),")"," ",qt.jsx("span",{className:"text-gray-300",children:"# closer together!"})]}),qt.jsx("span",{className:"block",children:")"})]}),qt.jsxs("div",{children:[qt.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"(illustration only)"}),qt.jsx("p",{className:"text-xl text-slate-300 mt-2",children:"Improve your RAG without leaving this page."})]})]})}const PV={theme:"system",setTheme:()=>null},LV=ht.createContext(PV);function RV({children:n,defaultTheme:S="system",storageKey:D="vite-ui-theme",...$}){const[ie,pe]=ht.useState(()=>localStorage.getItem(D)||S);ht.useEffect(()=>{const O=window.document.documentElement;if(O.classList.remove("light","dark"),ie==="system"){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";O.classList.add(e);return}O.classList.add(ie)},[ie]);const z={theme:ie,setTheme:O=>{localStorage.setItem(D,O),pe(O)}};return qt.jsx(LV.Provider,{...$,value:z,children:n})}function r2({name:n,locator:S}){const D=cb(qh),{toast:$}=Sg(),ie=ht.useCallback(async()=>{if(S.type==="example"){const{dismiss:pe}=$({title:"Loading example..."}),O=await(await fetch(S.datasetURL)).json();D({type:"example",embeddingsURL:S.embeddingsURL,name:S.name,pairings:O}),pe()}else D({type:"local",id:S.id})},[D,S,$]);return qt.jsx("div",{className:"mt-2",children:qt.jsxs(ds,{variant:"outline",className:"w-full text-left justify-between text-l font-bold",onClick:ie,children:[qt.jsx("div",{children:n}),qt.jsx(QF,{className:"h-4 w-4"})]})})}function _V(){return qt.jsxs("div",{className:dC,children:[qt.jsxs("div",{children:[qt.jsx("h1",{className:"text-xl font-bold mb-2",children:"Example Datasets"}),qt.jsx("hr",{className:"border-0.5 border-slate-700"})]}),qt.jsxs("div",{className:"py-2",children:[qt.jsx(r2,{name:"City Facts JSON",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/33434e8ee941a47e921f6c5b78566d1b/raw/d76524287bcf2446ebd0f290c97090003d184ce8/cities_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/e411a7c77b7af9c81844bb1fbcf9e117/raw/2b897bdc58433d78254de6982140945698eb74bf/cities_embeddings.json",name:"City Facts JSON"}}),qt.jsx(r2,{name:"MNLI Logical Entailment",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/42dd79326c56c1260def996f2f3a26e7/raw/0260dd24e28a171513f86756a3ac0470b4cef8f6/mnli_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/42dd79326c56c1260def996f2f3a26e7/raw/0260dd24e28a171513f86756a3ac0470b4cef8f6/mnli_embeddings.json",name:"MNLI Logical Entailment"}}),qt.jsx(r2,{name:"StackOverflow Title and Question SQL",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/92e177867627e85e75b40c3733fd9ceb/raw/3cee4ff498b71ac8371e2c71bbae9df34fae958e/sql_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/92e177867627e85e75b40c3733fd9ceb/raw/3cee4ff498b71ac8371e2c71bbae9df34fae958e/sql_embeddings.json",name:"StackOverflow Title and Question SQL"}})]})]})}function DV(){const[n,S]=Gp(hb),[D,$]=ht.useState(""),[ie,pe]=ht.useState(null),[z,O]=ht.useState(!1),{toast:e}=Sg(),p=ht.useCallback(()=>{navigator.clipboard.readText().then(a=>{$(a)})},[$]);ht.useEffect(()=>{n!==null&&$(n)},[$,n]);const P=ht.useCallback(async()=>{O(!0);try{const a=await fetch("https://api.openai.com/v1/models",{method:"GET",headers:{Authorization:`Bearer ${D}`}});a.status===200?(pe(null),S(D),e({title:"API Key has been set"})):(pe(`API Key is invalid: ${a.status}`),e({title:"Could not use API key",description:`Error code ${a.status}`,variant:"destructive"}))}catch(a){pe(a.toString())}O(!1)},[S,D,e]);return qt.jsxs(dg,{children:[qt.jsx(vg,{asChild:!0,children:qt.jsx(ds,{children:"Set API Key"})}),qt.jsxs(Yp,{className:"sm:max-w-[425px]",children:[qt.jsxs(Zp,{children:[qt.jsx(Eb,{className:"text-white",children:"Set API Key"}),qt.jsxs(nP,{children:["Get a secret key from"," ",qt.jsx("a",{className:"underline",href:"https://platform.openai.com/account/api-keys",target:"_blank",children:"the OpenAI API Keys page"})," ","and paste it here."," ",qt.jsx("span",{className:"text-slate-300",children:"It is stored locally and never shared with us."})]})]}),qt.jsxs("div",{children:[qt.jsxs("div",{className:"flex items-center",children:[qt.jsx(Qf,{id:"api-key",type:"text",value:D,placeholder:"API Key",className:"text-white",onChange:a=>$(a.target.value),onKeyDown:a=>a.key==="Enter"&&P()}),qt.jsx(ds,{className:"button text-white rounded-md px-2 py-1 m-2",onClick:P,disabled:z,children:z?"Verifying...":"Done"})]}),qt.jsxs("div",{children:[qt.jsx("button",{className:"button underline text-slate-500",onClick:p,children:"paste from clipboard"}),ie&&qt.jsx("p",{className:"text-red-500",children:ie})]})]})]})]})}function IV(){const[n,S]=ht.useState(""),D=cb(qh),$=ht.useCallback(async()=>{const ie=await Th.dataset.add({name:n,dateCreated:new Date,trainingParams:hP});D({type:"local",id:ie}),S("")},[n,D]);return qt.jsxs(dg,{children:[qt.jsx(vg,{asChild:!0,children:qt.jsx(ds,{className:"p-4 my-2 w-full",children:"New Dataset"})}),qt.jsxs(Yp,{className:"sm:max-w-[425px] text-white",children:[qt.jsx(Zp,{children:qt.jsx(Eb,{children:"Create Dataset"})}),qt.jsxs("div",{className:"flex flex-row gap-3",children:[qt.jsx(Qf,{type:"text",placeholder:"Dataset Name",value:n,onChange:ie=>S(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&$()}),qt.jsx(ds,{onClick:$,children:"Create"})]})]})]})}function kV(){const[n,S]=Gp(hb),D=Vm.useLiveQuery(async()=>await Th.dataset.toArray());return qt.jsxs("div",{className:dC,children:[qt.jsxs("div",{className:"flex flex-row justify-between items-center mb-2",children:[qt.jsx("h1",{className:"text-xl font-bold",children:"My Datasets"}),qt.jsxs(W9,{children:[qt.jsx($9,{children:qt.jsx(rO,{size:20,strokeWidth:1})}),qt.jsx(dS,{children:qt.jsx(j2,{onClick:()=>S(null),children:"Reset API Key"})})]})]}),qt.jsx("hr",{className:"border-0.5 border-slate-700"}),n===null?qt.jsxs("div",{className:"text-center m-5",children:[qt.jsx("h1",{className:"text-slate-300 text-xl m-2",children:"No API Key Set"}),qt.jsx(DV,{})]}):qt.jsxs("div",{children:[D===void 0||D.length===0?qt.jsx("div",{className:"text-center",children:qt.jsx("h2",{className:"text-slate-300 text-xl m-2",children:"No datasets yet"})}):U4.sortBy(D,$=>-$.dateCreated.getTime()).map($=>qt.jsx(r2,{name:$.name,locator:{type:"local",id:$.id}},$.id)),qt.jsx(IV,{})]})]})}function FV(){return qt.jsx(RV,{defaultTheme:"dark",children:qt.jsxs("div",{className:"mx-auto my-3 max-w-4xl flex flex-row justify-center flex-wrap",children:[qt.jsx(_V,{}),qt.jsx(kV,{})]})})}function OV(){return qt.jsxs("div",{children:[qt.jsx(CV,{}),qt.jsx(FV,{})]})}function zV(){const[n,S]=Gp(qh);return qt.jsx(YH,{children:qt.jsxs("div",{className:"p-5 text-white",children:[qt.jsx("button",{className:"button",onClick:()=>S({type:"none"}),children:qt.jsxs("div",{className:"flex flex-row align-center py-3 ",children:[qt.jsx("img",{src:nD,width:40}),qt.jsx("img",{className:"ml-2",src:rD,width:200,alt:"Spaceshifter"})]})}),n.type==="none"?qt.jsx(OV,{}):qt.jsx(qH,{}),qt.jsx(EV,{}),qt.jsx("footer",{className:"mt-[100px]",children:qt.jsxs("div",{className:"text-center text-sm text-slate-500",children:["adapted from the"," ",qt.jsx("a",{className:"underline",href:"https://github.com/openai/openai-cookbook/blob/main/examples/Customizing_embeddings.ipynb",target:"_blank",children:'"Customizing embeddings" cookbook'})," ","by OpenAI."," ",qt.jsx("a",{href:"https://github.com/maxkrieger/spaceshifter",target:"_blank",className:"underline",children:"View source on GitHub"})]})})]})})}MA.setLevel(MA.levels.WARN);OT.createRoot(document.getElementById("root")).render(qt.jsx(xf.StrictMode,{children:qt.jsx(zV,{})})); + `)+" "+le[1]:le[0]+ne+" "+J.join(", ")+" "+le[1]}O.types=e(4936);function m(J){return Array.isArray(J)}O.isArray=m;function v(J){return typeof J=="boolean"}O.isBoolean=v;function l(J){return J===null}O.isNull=l;function y(J){return J==null}O.isNullOrUndefined=y;function E(J){return typeof J=="number"}O.isNumber=E;function A(J){return typeof J=="string"}O.isString=A;function R(J){return typeof J=="symbol"}O.isSymbol=R;function w(J){return J===void 0}O.isUndefined=w;function L(J){return M(J)&&F(J)==="[object RegExp]"}O.isRegExp=L,O.types.isRegExp=L;function M(J){return typeof J=="object"&&J!==null}O.isObject=M;function s(J){return M(J)&&F(J)==="[object Date]"}O.isDate=s,O.types.isDate=s;function _(J){return M(J)&&(F(J)==="[object Error]"||J instanceof Error)}O.isError=_,O.types.isNativeError=_;function T(J){return typeof J=="function"}O.isFunction=T;function B(J){return J===null||typeof J=="boolean"||typeof J=="number"||typeof J=="string"||typeof J=="symbol"||typeof J>"u"}O.isPrimitive=B,O.isBuffer=e(45920);function F(J){return Object.prototype.toString.call(J)}function W(J){return J<10?"0"+J.toString(10):J.toString(10)}var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var J=new Date,ne=[W(J.getHours()),W(J.getMinutes()),W(J.getSeconds())].join(":");return[J.getDate(),N[J.getMonth()],ne].join(" ")}O.log=function(){console.log("%s - %s",V(),O.format.apply(O,arguments))},O.inherits=e(42018),O._extend=function(J,ne){if(!ne||!M(ne))return J;for(var le=Object.keys(ne),ve=le.length;ve--;)J[le[ve]]=ne[le[ve]];return J};function H(J,ne){return Object.prototype.hasOwnProperty.call(J,ne)}var U=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;O.promisify=function(ne){if(typeof ne!="function")throw new TypeError('The "original" argument must be of type Function');if(U&&ne[U]){var le=ne[U];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,U,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var ve,q,Z=new Promise(function(re,ue){ve=re,q=ue}),K=[],Q=0;Q"u"?e.g:globalThis,t=P(),r=a("String.prototype.slice"),o={},i=Object.getPrototypeOf;d&&C&&i&&p(t,function(c){if(typeof g[c]=="function"){var b=new g[c];if(Symbol.toStringTag in b){var f=i(b),m=C(f,Symbol.toStringTag);if(!m){var v=i(f);m=C(v,Symbol.toStringTag)}o[c]=m.get}}});var u=function(b){var f=!1;return p(o,function(m,v){if(!f)try{var l=m.call(b);l===v&&(f=l)}catch{}}),f},h=e(9187);z.exports=function(b){return h(b)?!d||!(Symbol.toStringTag in b)?r(x(b),8,-1):u(b):!1}},3961:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(h){this.local=this.regionalOptions[h||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(h,c){if(typeof h=="string"){var b=h.match(d);return b?b[0]:""}var f=this._validateYear(h),m=h.month(),v=""+this.toChineseMonth(f,m);return c&&v.length<2&&(v="0"+v),this.isIntercalaryMonth(f,m)&&(v+="i"),v},monthNames:function(h){if(typeof h=="string"){var c=h.match(g);return c?c[0]:""}var b=this._validateYear(h),f=h.month(),m=this.toChineseMonth(b,f),v=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][m-1];return this.isIntercalaryMonth(b,f)&&(v="闰"+v),v},monthNamesShort:function(h){if(typeof h=="string"){var c=h.match(t);return c?c[0]:""}var b=this._validateYear(h),f=h.month(),m=this.toChineseMonth(b,f),v=["一","二","三","四","五","六","七","八","九","十","十一","十二"][m-1];return this.isIntercalaryMonth(b,f)&&(v="闰"+v),v},parseMonth:function(h,c){h=this._validateYear(h);var b=parseInt(c),f;if(isNaN(b))c[0]==="闰"&&(f=!0,c=c.substring(1)),c[c.length-1]==="月"&&(c=c.substring(0,c.length-1)),b=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(c);else{var m=c[c.length-1];f=m==="i"||m==="I"}var v=this.toMonthIndex(h,b,f);return v},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(h,c){if(h.year&&(h=h.year()),typeof h!="number"||h<1888||h>2111)throw c.replace(/\{0\}/,this.local.name);return h},toMonthIndex:function(h,c,b){var f=this.intercalaryMonth(h),m=b&&c!==f;if(m||c<1||c>12)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return f?!b&&c<=f?v=c-1:v=c:v=c-1,v},toChineseMonth:function(h,c){h.year&&(h=h.year(),c=h.month());var b=this.intercalaryMonth(h),f=b?12:11;if(c<0||c>f)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return b?c>13;return b},isIntercalaryMonth:function(h,c){h.year&&(h=h.year(),c=h.month());var b=this.intercalaryMonth(h);return!!b&&b===c},leapYear:function(h){return this.intercalaryMonth(h)!==0},weekOfYear:function(h,c,b){var f=this._validateYear(h,p.local.invalidyear),m=o[f-o[0]],v=m>>9&4095,l=m>>5&15,y=m&31,E;E=a.newDate(v,l,y),E.add(4-(E.dayOfWeek()||7),"d");var A=this.toJD(h,c,b)-E.toJD();return 1+Math.floor(A/7)},monthsInYear:function(h){return this.leapYear(h)?13:12},daysInMonth:function(h,c){h.year&&(c=h.month(),h=h.year()),h=this._validateYear(h);var b=r[h-r[0]],f=b>>13,m=f?12:11;if(c>m)throw p.local.invalidMonth.replace(/\{0\}/,this.local.name);var v=b&1<<12-c?30:29;return v},weekDay:function(h,c,b){return(this.dayOfWeek(h,c,b)||7)<6},toJD:function(h,c,b){var f=this._validate(h,v,b,p.local.invalidDate);h=this._validateYear(f.year()),c=f.month(),b=f.day();var m=this.isIntercalaryMonth(h,c),v=this.toChineseMonth(h,c),l=u(h,v,b,m);return a.toJD(l.year,l.month,l.day)},fromJD:function(h){var c=a.fromJD(h),b=i(c.year(),c.month(),c.day()),f=this.toMonthIndex(b.year,b.month,b.isIntercalary);return this.newDate(b.year,f,b.day)},fromString:function(h){var c=h.match(x),b=this._validateYear(+c[1]),f=+c[2],m=!!c[3],v=this.toMonthIndex(b,f,m),l=+c[4];return this.newDate(b,v,l)},add:function(h,c,b){var f=h.year(),m=h.month(),v=this.isIntercalaryMonth(f,m),l=this.toChineseMonth(f,m),y=Object.getPrototypeOf(C.prototype).add.call(this,h,c,b);if(b==="y"){var E=y.year(),A=y.month(),R=this.isIntercalaryMonth(E,l),w=v&&R?this.toMonthIndex(E,l,!0):this.toMonthIndex(E,l,!1);w!==A&&y.month(w)}return y}});var x=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,d=/^\d?\d[iI]?/m,g=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;p.calendars.chinese=C;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function i(h,c,b,f){var m,v;if(typeof h=="object")m=h,v=c||{};else{var l=typeof h=="number"&&h>=1888&&h<=2111;if(!l)throw new Error("Solar year outside range 1888-2111");var y=typeof c=="number"&&c>=1&&c<=12;if(!y)throw new Error("Solar month outside range 1 - 12");var E=typeof b=="number"&&b>=1&&b<=31;if(!E)throw new Error("Solar day outside range 1 - 31");m={year:h,month:c,day:b},v=f||{}}var A=o[m.year-o[0]],R=m.year<<9|m.month<<5|m.day;v.year=R>=A?m.year:m.year-1,A=o[v.year-o[0]];var w=A>>9&4095,L=A>>5&15,M=A&31,s,_=new Date(w,L-1,M),T=new Date(m.year,m.month-1,m.day);s=Math.round((T-_)/864e5);var B=r[v.year-r[0]],F;for(F=0;F<13;F++){var W=B&1<<12-F?30:29;if(s>13;return!N||F=1888&&h<=2111;if(!y)throw new Error("Lunar year outside range 1888-2111");var E=typeof c=="number"&&c>=1&&c<=12;if(!E)throw new Error("Lunar month outside range 1 - 12");var A=typeof b=="number"&&b>=1&&b<=30;if(!A)throw new Error("Lunar day outside range 1 - 30");var R;typeof f=="object"?(R=!1,v=f):(R=!!f,v=m||{}),l={year:h,month:c,day:b,isIntercalary:R}}var w;w=l.day-1;var L=r[l.year-r[0]],M=L>>13,s;M&&(l.month>M||l.isIntercalary)?s=l.month:s=l.month-1;for(var _=0;_>9&4095,W=B>>5&15,N=B&31,V=new Date(F,W-1,N+w);return v.year=V.getFullYear(),v.month=1+V.getMonth(),v.day=V.getDate(),v}},38751:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()+(x.year()<0?1:0);return d%4===3||d%4===-1},monthsInYear:function(C){return this._validate(C,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear),13},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===13&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),C<0&&C++,g.day()+(g.month()-1)*30+(C-1)*365+Math.floor(C/4)+this.jdEpoch-1},fromJD:function(C){var x=Math.floor(C)+.5-this.jdEpoch,d=Math.floor((x-Math.floor((x+366)/1461))/365)+1;d<=0&&d--,x=Math.floor(C)+.5-this.newDate(d,1,1).toJD();var g=Math.floor(x/30)+1,t=x-(g-1)*30+1;return this.newDate(d,g,t)}}),p.calendars.coptic=a},86825:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),!1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),13},daysInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),400},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return(t.day()+1)%8},weekDay:function(x,d,g){var t=this.dayOfWeek(x,d,g);return t>=2&&t<=6},extraInfo:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return{century:C[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return x=t.year()+(t.year()<0?1:0),d=t.month(),g=t.day(),g+(d>1?16:0)+(d>2?(d-2)*32:0)+(x-1)*400+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x+.5)-Math.floor(this.jdEpoch)-1;var d=Math.floor(x/400)+1;x-=(d-1)*400,x+=x>15?16:0;var g=Math.floor(x/32)+1,t=x-(g-1)*32+1;return this.newDate(d<=0?d-1:d,g,t)}});var C={20:"Fruitbat",21:"Anchovy"};p.calendars.discworld=a},37715:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()+(x.year()<0?1:0);return d%4===3||d%4===-1},monthsInYear:function(C){return this._validate(C,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear),13},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===13&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),C<0&&C++,g.day()+(g.month()-1)*30+(C-1)*365+Math.floor(C/4)+this.jdEpoch-1},fromJD:function(C){var x=Math.floor(C)+.5-this.jdEpoch,d=Math.floor((x-Math.floor((x+366)/1461))/365)+1;d<=0&&d--,x=Math.floor(C)+.5-this.newDate(d,1,1).toJD();var g=Math.floor(x/30)+1,t=x-(g-1)*30+1;return this.newDate(d,g,t)}}),p.calendars.ethiopian=a},99384:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return this._leapYear(d.year())},_leapYear:function(x){return x=x<0?x+1:x,C(x*7+1,19)<7},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,p.local.invalidYear),this._leapYear(x.year?x.year():x)?13:12},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return x=d.year(),this.toJD(x===-1?1:x+1,7,1)-this.toJD(x,7,1)},daysInMonth:function(x,d){return x.year&&(d=x.month(),x=x.year()),this._validate(x,d,this.minDay,p.local.invalidMonth),d===12&&this.leapYear(x)||d===8&&C(this.daysInYear(x),10)===5?30:d===9&&C(this.daysInYear(x),10)===3?29:this.daysPerMonth[d-1]},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==6},extraInfo:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);x=t.year(),d=t.month(),g=t.day();var r=x<=0?x+1:x,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+g+1;if(d<7){for(var i=7;i<=this.monthsInYear(x);i++)o+=this.daysInMonth(x,i);for(var i=1;i=this.toJD(d===-1?1:d+1,7,1);)d++;for(var g=xthis.toJD(d,g,this.daysInMonth(d,g));)g++;var t=x-this.toJD(d,g,1)+1;return this.newDate(d,g,t)}});function C(x,d){return x-d*Math.floor(x/d)}p.calendars.hebrew=a},43805:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(C){var x=this._validate(C,this.minMonth,this.minDay,p.local.invalidYear);return(x.year()*11+14)%30<11},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInYear:function(C){return this.leapYear(C)?355:354},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===12&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return this.dayOfWeek(C,x,d)!==5},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),x=g.month(),d=g.day(),C=C<=0?C+1:C,d+Math.ceil(29.5*(x-1))+(C-1)*354+Math.floor((3+11*C)/30)+this.jdEpoch-1},fromJD:function(C){C=Math.floor(C)+.5;var x=Math.floor((30*(C-this.jdEpoch)+10646)/10631);x=x<=0?x-1:x;var d=Math.min(12,Math.ceil((C-29-this.toJD(x,1,1))/29.5)+1),g=C-this.toJD(x,d,1)+1;return this.newDate(x,d,g)}}),p.calendars.islamic=a},88874:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(d){var x=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),d=x.year()<0?x.year()+1:x.year();return d%4===0},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(4-(g.dayOfWeek()||7),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInMonth:function(C,x){var d=this._validate(C,x,this.minDay,p.local.invalidMonth);return this.daysPerMonth[d.month()-1]+(d.month()===2&&this.leapYear(d.year())?1:0)},weekDay:function(C,x,d){return(this.dayOfWeek(C,x,d)||7)<6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);return C=g.year(),x=g.month(),d=g.day(),C<0&&C++,x<=2&&(C--,x+=12),Math.floor(365.25*(C+4716))+Math.floor(30.6001*(x+1))+d-1524.5},fromJD:function(C){var x=Math.floor(C+.5),d=x+1524,g=Math.floor((d-122.1)/365.25),t=Math.floor(365.25*g),r=Math.floor((d-t)/30.6001),o=r-Math.floor(r<14?1:13),i=g-Math.floor(o>2?4716:4715),u=d-t-Math.floor(30.6001*r);return i<=0&&i--,this.newDate(i,o,u)}}),p.calendars.julian=a},83290:function(z,O,e){var p=e(63489),P=e(56131);function a(d){this.local=this.regionalOptions[d||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),!1},formatYear:function(d){var g=this._validate(d,this.minMonth,this.minDay,p.local.invalidYear);d=g.year();var t=Math.floor(d/400);d=d%400,d+=d<0?400:0;var r=Math.floor(d/20);return t+"."+r+"."+d%20},forYear:function(d){if(d=d.split("."),d.length<3)throw"Invalid Mayan year";for(var g=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";g=g*20+r}return g},monthsInYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),18},weekOfYear:function(d,g,t){return this._validate(d,g,t,p.local.invalidDate),0},daysInYear:function(d){return this._validate(d,this.minMonth,this.minDay,p.local.invalidYear),360},daysInMonth:function(d,g){return this._validate(d,g,this.minDay,p.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate);return r.day()},weekDay:function(d,g,t){return this._validate(d,g,t,p.local.invalidDate),!0},extraInfo:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate),o=r.toJD(),i=this._toHaab(o),u=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[u[0]-1],tzolkinDay:u[0],tzolkinTrecena:u[1]}},_toHaab:function(d){d-=this.jdEpoch;var g=C(d+8+(18-1)*20,365);return[Math.floor(g/20)+1,C(g,20)]},_toTzolkin:function(d){return d-=this.jdEpoch,[x(d+20,20),x(d+4,13)]},toJD:function(d,g,t){var r=this._validate(d,g,t,p.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(d){d=Math.floor(d)+.5-this.jdEpoch;var g=Math.floor(d/360);d=d%360,d+=d<0?360:0;var t=Math.floor(d/20),r=d%20;return this.newDate(g,t,r)}});function C(d,g){return d-g*Math.floor(d/g)}function x(d,g){return C(d-1,g)+1}p.calendars.mayan=a},29108:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar;var C=p.instance("gregorian");P(a.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear||p.regionalOptions[""].invalidYear);return C.leapYear(d.year()+(d.year()<1?1:0)+1469)},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===12&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),i=1;i=this.toJD(d+1,1,1);)d++;for(var g=x-Math.floor(this.toJD(d,1,1)+.5)+1,t=1;g>this.daysInMonth(d,t);)g-=this.daysInMonth(d,t),t++;return this.newDate(d,t,g)}}),p.calendars.nanakshahi=a},55422:function(z,O,e){var p=e(63489),P=e(56131);function a(C){this.local=this.regionalOptions[C||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(C){return this.daysInYear(C)!==this.daysPerYear},weekOfYear:function(C,x,d){var g=this.newDate(C,x,d);return g.add(-g.dayOfWeek(),"d"),Math.floor((g.dayOfYear()-1)/7)+1},daysInYear:function(C){var x=this._validate(C,this.minMonth,this.minDay,p.local.invalidYear);if(C=x.year(),typeof this.NEPALI_CALENDAR_DATA[C]>"u")return this.daysPerYear;for(var d=0,g=this.minMonth;g<=12;g++)d+=this.NEPALI_CALENDAR_DATA[C][g];return d},daysInMonth:function(C,x){return C.year&&(x=C.month(),C=C.year()),this._validate(C,x,this.minDay,p.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[C]>"u"?this.daysPerMonth[x-1]:this.NEPALI_CALENDAR_DATA[C][x]},weekDay:function(C,x,d){return this.dayOfWeek(C,x,d)!==6},toJD:function(C,x,d){var g=this._validate(C,x,d,p.local.invalidDate);C=g.year(),x=g.month(),d=g.day();var t=p.instance(),r=0,o=x,i=C;this._createMissingCalendarData(C);var u=C-(o>9||o===9&&d>=this.NEPALI_CALENDAR_DATA[i][0]?56:57);for(x!==9&&(r=d,o--);o!==9;)o<=0&&(o=12,i--),r+=this.NEPALI_CALENDAR_DATA[i][o],o--;return x===9?(r+=d-this.NEPALI_CALENDAR_DATA[i][0],r<0&&(r+=t.daysInYear(u))):r+=this.NEPALI_CALENDAR_DATA[i][9]-this.NEPALI_CALENDAR_DATA[i][0],t.newDate(u,1,1).add(r,"d").toJD()},fromJD:function(C){var x=p.instance(),d=x.fromJD(C),g=d.year(),t=d.dayOfYear(),r=g+56;this._createMissingCalendarData(r);for(var o=9,i=this.NEPALI_CALENDAR_DATA[r][0],u=this.NEPALI_CALENDAR_DATA[r][o]-i+1;t>u;)o++,o>12&&(o=1,r++),u+=this.NEPALI_CALENDAR_DATA[r][o];var h=this.NEPALI_CALENDAR_DATA[r][o]-(u-t);return this.newDate(r,o,h)},_createMissingCalendarData:function(C){var x=this.daysPerMonth.slice(0);x.unshift(17);for(var d=C-1;d"u"&&(this.NEPALI_CALENDAR_DATA[d]=x)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),p.calendars.nepali=a},94320:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return((d.year()-(d.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===12&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==5},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate);x=t.year(),d=t.month(),g=t.day();var r=x-(x>=0?474:473),o=474+C(r,2820);return g+(d<=7?(d-1)*31:(d-1)*30+6)+Math.floor((o*682-110)/2816)+(o-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var d=x-this.toJD(475,1,1),g=Math.floor(d/1029983),t=C(d,1029983),r=2820;if(t!==1029982){var o=Math.floor(t/366),i=C(t,366);r=Math.floor((2134*o+2816*i+2815)/1028522)+o+1}var u=r+2820*g+474;u=u<=0?u-1:u;var h=x-this.toJD(u,1,1)+1,c=h<=186?Math.ceil(h/31):Math.ceil((h-6)/30),b=x-this.toJD(u,c,1)+1;return this.newDate(u,c,b)}});function C(x,d){return x-d*Math.floor(x/d)}p.calendars.persian=a,p.calendars.jalali=a},31320:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(g){var d=this._validate(g,this.minMonth,this.minDay,p.local.invalidYear),g=this._t2gYear(d.year());return a.leapYear(g)},weekOfYear:function(r,d,g){var t=this._validate(r,this.minMonth,this.minDay,p.local.invalidYear),r=this._t2gYear(t.year());return a.weekOfYear(r,t.month(),t.day())},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===2&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidDate),r=this._t2gYear(t.year());return a.toJD(r,t.month(),t.day())},fromJD:function(x){var d=a.fromJD(x),g=this._g2tYear(d.year());return this.newDate(g,d.month(),d.day())},_t2gYear:function(x){return x+this.yearsOffset+(x>=-this.yearsOffset&&x<=-1?1:0)},_g2tYear:function(x){return x-this.yearsOffset-(x>=1&&x<=this.yearsOffset?1:0)}}),p.calendars.taiwan=C},51367:function(z,O,e){var p=e(63489),P=e(56131),a=p.instance();function C(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}C.prototype=new p.baseCalendar,P(C.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(g){var d=this._validate(g,this.minMonth,this.minDay,p.local.invalidYear),g=this._t2gYear(d.year());return a.leapYear(g)},weekOfYear:function(r,d,g){var t=this._validate(r,this.minMonth,this.minDay,p.local.invalidYear),r=this._t2gYear(t.year());return a.weekOfYear(r,t.month(),t.day())},daysInMonth:function(x,d){var g=this._validate(x,d,this.minDay,p.local.invalidMonth);return this.daysPerMonth[g.month()-1]+(g.month()===2&&this.leapYear(g.year())?1:0)},weekDay:function(x,d,g){return(this.dayOfWeek(x,d,g)||7)<6},toJD:function(r,d,g){var t=this._validate(r,d,g,p.local.invalidDate),r=this._t2gYear(t.year());return a.toJD(r,t.month(),t.day())},fromJD:function(x){var d=a.fromJD(x),g=this._g2tYear(d.year());return this.newDate(g,d.month(),d.day())},_t2gYear:function(x){return x-this.yearsOffset-(x>=1&&x<=this.yearsOffset?1:0)},_g2tYear:function(x){return x+this.yearsOffset+(x>=-this.yearsOffset&&x<=-1?1:0)}}),p.calendars.thai=C},21457:function(z,O,e){var p=e(63489),P=e(56131);function a(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}a.prototype=new p.baseCalendar,P(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(x){var d=this._validate(x,this.minMonth,this.minDay,p.local.invalidYear);return this.daysInYear(d.year())===355},weekOfYear:function(x,d,g){var t=this.newDate(x,d,g);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(x){for(var d=0,g=1;g<=12;g++)d+=this.daysInMonth(x,g);return d},daysInMonth:function(x,d){for(var g=this._validate(x,d,this.minDay,p.local.invalidMonth),t=g.toJD()-24e5+.5,r=0,o=0;ot)return C[r]-C[r-1];r++}return 30},weekDay:function(x,d,g){return this.dayOfWeek(x,d,g)!==5},toJD:function(x,d,g){var t=this._validate(x,d,g,p.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+C[r-1]-1;return o+24e5-.5},fromJD:function(x){for(var d=x-24e5+.5,g=0,t=0;td);t++)g++;var r=g+15292,o=Math.floor((r-1)/12),i=o+1,u=r-12*o,h=d-C[g-1]+1;return this.newDate(i,u,h)},isValid:function(x,d,g){var t=p.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(x=x.year!=null?x.year:x,t=x>=1276&&x<=1500),t},_validate:function(x,d,g,t){var r=p.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),p.calendars.ummalqura=a;var C=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},63489:function(z,O,e){var p=e(56131);function P(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}p(P.prototype,{instance:function(t,r){t=(t||"gregorian").toLowerCase(),r=r||"";var o=this._localCals[t+"-"+r];if(!o&&this.calendars[t]&&(o=new this.calendars[t](r),this._localCals[t+"-"+r]=o),!o)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return o},newDate:function(t,r,o,i,u){return i=(t!=null&&t.year?t.calendar():typeof i=="string"?this.instance(i,u):i)||this.instance(),i.newDate(t,r,o)},substituteDigits:function(t){return function(r){return(r+"").replace(/[0-9]/g,function(o){return t[o]})}},substituteChineseDigits:function(t,r){return function(o){for(var i="",u=0;o>0;){var h=o%10;i=(h===0?"":t[h]+r[u])+i,u++,o=Math.floor(o/10)}return i.indexOf(t[1]+r[1])===0&&(i=i.substr(1)),i||t[0]}}});function a(t,r,o,i){if(this._calendar=t,this._year=r,this._month=o,this._day=i,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(g.local.invalidDate||g.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function C(t,r){return t=""+t,"000000".substring(0,r-t.length)+t}p(a.prototype,{newDate:function(t,r,o){return this._calendar.newDate(t??this,r,o)},year:function(t){return arguments.length===0?this._year:this.set(t,"y")},month:function(t){return arguments.length===0?this._month:this.set(t,"m")},day:function(t){return arguments.length===0?this._day:this.set(t,"d")},date:function(t,r,o){if(!this._calendar.isValid(t,r,o))throw(g.local.invalidDate||g.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=r,this._day=o,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,r){return this._calendar.add(this,t,r)},set:function(t,r){return this._calendar.set(this,t,r)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(g.local.differentCalendars||g.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var r=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return r===0?0:r<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+C(Math.abs(this.year()),4)+"-"+C(this.month(),2)+"-"+C(this.day(),2)}});function x(){this.shortYearCutoff="+10"}p(x.prototype,{_validateLevel:0,newDate:function(t,r,o){return t==null?this.today():(t.year&&(this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),o=t.day(),r=t.month(),t=t.year()),new a(this,t,r,o))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return r.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return(r.year()<0?"-":"")+C(Math.abs(r.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear),12},monthOfYear:function(t,r){var o=this._validate(t,r,this.minDay,g.local.invalidMonth||g.regionalOptions[""].invalidMonth);return(o.month()+this.monthsInYear(o)-this.firstMonth)%this.monthsInYear(o)+this.minMonth},fromMonthOfYear:function(t,r){var o=(r+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,o,this.minDay,g.local.invalidMonth||g.regionalOptions[""].invalidMonth),o},daysInYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,g.local.invalidYear||g.regionalOptions[""].invalidYear);return this.leapYear(r)?366:365},dayOfYear:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate);return i.toJD()-this.newDate(i.year(),this.fromMonthOfYear(i.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(i))+2)%this.daysInWeek()},extraInfo:function(t,r,o){return this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),{}},add:function(t,r,o){return this._validate(t,this.minMonth,this.minDay,g.local.invalidDate||g.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,r,o),r,o)},_add:function(t,r,o){if(this._validateLevel++,o==="d"||o==="w"){var i=t.toJD()+r*(o==="w"?this.daysInWeek():1),u=t.calendar().fromJD(i);return this._validateLevel--,[u.year(),u.month(),u.day()]}try{var h=t.year()+(o==="y"?r:0),c=t.monthOfYear()+(o==="m"?r:0),u=t.day(),b=function(v){for(;cl-1+v.minMonth;)h++,c-=l,l=v.monthsInYear(h)};o==="y"?(t.month()!==this.fromMonthOfYear(h,c)&&(c=this.newDate(h,t.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(h)),u=Math.min(u,this.daysInMonth(h,this.fromMonthOfYear(h,c)))):o==="m"&&(b(this),u=Math.min(u,this.daysInMonth(h,this.fromMonthOfYear(h,c))));var f=[h,this.fromMonthOfYear(h,c),u];return this._validateLevel--,f}catch(m){throw this._validateLevel--,m}},_correctAdd:function(t,r,o,i){if(!this.hasYearZero&&(i==="y"||i==="m")&&(r[0]===0||t.year()>0!=r[0]>0)){var u={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[i],h=o<0?-1:1;r=this._add(t,o*u[0]+h*u[1],u[2])}return t.date(r[0],r[1],r[2])},set:function(t,r,o){this._validate(t,this.minMonth,this.minDay,g.local.invalidDate||g.regionalOptions[""].invalidDate);var i=o==="y"?r:t.year(),u=o==="m"?r:t.month(),h=o==="d"?r:t.day();return(o==="y"||o==="m")&&(h=Math.min(h,this.daysInMonth(i,u))),t.date(i,u,h)},isValid:function(t,r,o){this._validateLevel++;var i=this.hasYearZero||t!==0;if(i){var u=this.newDate(t,r,this.minDay);i=r>=this.minMonth&&r-this.minMonth=this.minDay&&o-this.minDay13.5?13:1),m=u-(f>2.5?4716:4715);return m<=0&&m--,this.newDate(m,f,b)},toJSDate:function(t,r,o){var i=this._validate(t,r,o,g.local.invalidDate||g.regionalOptions[""].invalidDate),u=new Date(i.year(),i.month()-1,i.day());return u.setHours(0),u.setMinutes(0),u.setSeconds(0),u.setMilliseconds(0),u.setHours(u.getHours()>12?u.getHours()+2:0),u},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var g=z.exports=new P;g.cdate=a,g.baseCalendar=x,g.calendars.gregorian=d},94338:function(z,O,e){var p=e(56131),P=e(63489);p(P.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),P.local=P.regionalOptions[""],p(P.cdate.prototype,{formatDate:function(a,C){return typeof a!="string"&&(C=a,a=""),this._calendar.formatDate(a||"",this,C)}}),p(P.baseCalendar.prototype,{UNIX_EPOCH:P.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:P.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(a,C,x){if(typeof a!="string"&&(x=C,C=a,a=""),!C)return"";if(C.calendar()!==this)throw P.local.invalidFormat||P.regionalOptions[""].invalidFormat;a=a||this.local.dateFormat,x=x||{};var d=x.dayNamesShort||this.local.dayNamesShort,g=x.dayNames||this.local.dayNames,t=x.monthNumbers||this.local.monthNumbers,r=x.monthNamesShort||this.local.monthNamesShort,o=x.monthNames||this.local.monthNames;x.calculateWeek||this.local.calculateWeek;for(var i=function(A,R){for(var w=1;E+w1},u=function(A,R,w,L){var M=""+R;if(i(A,L))for(;M.length1},E=function(F,W){var N=y(F,W),V=[2,3,N?4:2,N?4:2,10,11,20]["oyYJ@!".indexOf(F)+1],H=new RegExp("^-?\\d{1,"+V+"}"),U=C.substring(s).match(H);if(!U)throw(P.local.missingNumberAt||P.regionalOptions[""].missingNumberAt).replace(/\{0\}/,s);return s+=U[0].length,parseInt(U[0],10)},A=this,R=function(){if(typeof o=="function"){y("m");var F=o.call(A,C.substring(s));return s+=F.length,F}return E("m")},w=function(F,W,N,V){for(var H=y(F,V)?N:W,U=0;U-1){b=1,f=m;for(var B=this.daysInMonth(c,b);f>B;B=this.daysInMonth(c,b))b++,f-=B}return h>-1?this.fromJD(h):this.newDate(c,b,f)},determineDate:function(a,C,x,d,g){x&&typeof x!="object"&&(g=d,d=x,x=null),typeof d!="string"&&(g=d,d="");var t=this,r=function(o){try{return t.parseDate(d,o,g)}catch{}o=o.toLowerCase();for(var i=(o.match(/^c/)&&x?x.newDate():null)||t.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,h=u.exec(o);h;)i.add(parseInt(h[1],10),h[2]||"d"),h=u.exec(o);return i};return C=C?C.newDate():null,a=a==null?C:typeof a=="string"?r(a):typeof a=="number"?isNaN(a)||a===1/0||a===-1/0?C:t.today().add(a,"d"):t.newDate(a),a}})},69862:function(){},40964:function(){},72077:function(z,O,e){var p=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],P=typeof globalThis>"u"?e.g:globalThis;z.exports=function(){for(var C=[],x=0;x>8&15|Pe>>4&240,Pe>>4&15|Pe&240,(Pe&15)<<4|Pe&15,1):Ge===8?R(Pe>>24&255,Pe>>16&255,Pe>>8&255,(Pe&255)/255):Ge===4?R(Pe>>12&15|Pe>>8&240,Pe>>8&15|Pe>>4&240,Pe>>4&15|Pe&240,((Pe&15)<<4|Pe&15)/255):null):(Pe=o.exec(Te))?new M(Pe[1],Pe[2],Pe[3],1):(Pe=i.exec(Te))?new M(Pe[1]*255/100,Pe[2]*255/100,Pe[3]*255/100,1):(Pe=u.exec(Te))?R(Pe[1],Pe[2],Pe[3],Pe[4]):(Pe=h.exec(Te))?R(Pe[1]*255/100,Pe[2]*255/100,Pe[3]*255/100,Pe[4]):(Pe=c.exec(Te))?N(Pe[1],Pe[2]/100,Pe[3]/100,1):(Pe=b.exec(Te))?N(Pe[1],Pe[2]/100,Pe[3]/100,Pe[4]):f.hasOwnProperty(Te)?A(f[Te]):Te==="transparent"?new M(NaN,NaN,NaN,0):null}function A(Te){return new M(Te>>16&255,Te>>8&255,Te&255,1)}function R(Te,Pe,Ge,$e){return $e<=0&&(Te=Pe=Ge=NaN),new M(Te,Pe,Ge,$e)}function w(Te){return Te instanceof a||(Te=E(Te)),Te?(Te=Te.rgb(),new M(Te.r,Te.g,Te.b,Te.opacity)):new M}function L(Te,Pe,Ge,$e){return arguments.length===1?w(Te):new M(Te,Pe,Ge,$e??1)}function M(Te,Pe,Ge,$e){this.r=+Te,this.g=+Pe,this.b=+Ge,this.opacity=+$e}p(M,L,P(a,{brighter:function(Pe){return Pe=Pe==null?x:Math.pow(x,Pe),new M(this.r*Pe,this.g*Pe,this.b*Pe,this.opacity)},darker:function(Pe){return Pe=Pe==null?C:Math.pow(C,Pe),new M(this.r*Pe,this.g*Pe,this.b*Pe,this.opacity)},rgb:function(){return this},clamp:function(){return new M(F(this.r),F(this.g),F(this.b),B(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:s,formatHex:s,formatHex8:_,formatRgb:T,toString:T}));function s(){return"#".concat(W(this.r)).concat(W(this.g)).concat(W(this.b))}function _(){return"#".concat(W(this.r)).concat(W(this.g)).concat(W(this.b)).concat(W((isNaN(this.opacity)?1:this.opacity)*255))}function T(){var Te=B(this.opacity);return"".concat(Te===1?"rgb(":"rgba(").concat(F(this.r),", ").concat(F(this.g),", ").concat(F(this.b)).concat(Te===1?")":", ".concat(Te,")"))}function B(Te){return isNaN(Te)?1:Math.max(0,Math.min(1,Te))}function F(Te){return Math.max(0,Math.min(255,Math.round(Te)||0))}function W(Te){return Te=F(Te),(Te<16?"0":"")+Te.toString(16)}function N(Te,Pe,Ge,$e){return $e<=0?Te=Pe=Ge=NaN:Ge<=0||Ge>=1?Te=Pe=NaN:Pe<=0&&(Te=NaN),new U(Te,Pe,Ge,$e)}function V(Te){if(Te instanceof U)return new U(Te.h,Te.s,Te.l,Te.opacity);if(Te instanceof a||(Te=E(Te)),!Te)return new U;if(Te instanceof U)return Te;Te=Te.rgb();var Pe=Te.r/255,Ge=Te.g/255,$e=Te.b/255,ze=Math.min(Pe,Ge,$e),je=Math.max(Pe,Ge,$e),ut=NaN,at=je-ze,nt=(je+ze)/2;return at?(Pe===je?ut=(Ge-$e)/at+(Ge<$e)*6:Ge===je?ut=($e-Pe)/at+2:ut=(Pe-Ge)/at+4,at/=nt<.5?je+ze:2-je-ze,ut*=60):at=nt>0&&nt<1?0:ut,new U(ut,at,nt,Te.opacity)}function H(Te,Pe,Ge,$e){return arguments.length===1?V(Te):new U(Te,Pe,Ge,$e??1)}function U(Te,Pe,Ge,$e){this.h=+Te,this.s=+Pe,this.l=+Ge,this.opacity=+$e}p(U,H,P(a,{brighter:function(Pe){return Pe=Pe==null?x:Math.pow(x,Pe),new U(this.h,this.s,this.l*Pe,this.opacity)},darker:function(Pe){return Pe=Pe==null?C:Math.pow(C,Pe),new U(this.h,this.s,this.l*Pe,this.opacity)},rgb:function(){var Pe=this.h%360+(this.h<0)*360,Ge=isNaN(Pe)||isNaN(this.s)?0:this.s,$e=this.l,ze=$e+($e<.5?$e:1-$e)*Ge,je=2*$e-ze;return new M(J(Pe>=240?Pe-240:Pe+120,je,ze),J(Pe,je,ze),J(Pe<120?Pe+240:Pe-120,je,ze),this.opacity)},clamp:function(){return new U(G(this.h),Y(this.s),Y(this.l),B(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var Pe=B(this.opacity);return"".concat(Pe===1?"hsl(":"hsla(").concat(G(this.h),", ").concat(Y(this.s)*100,"%, ").concat(Y(this.l)*100,"%").concat(Pe===1?")":", ".concat(Pe,")"))}}));function G(Te){return Te=(Te||0)%360,Te<0?Te+360:Te}function Y(Te){return Math.max(0,Math.min(1,Te||0))}function J(Te,Pe,Ge){return(Te<60?Pe+(Ge-Pe)*Te/60:Te<180?Ge:Te<240?Pe+(Ge-Pe)*(240-Te)/60:Pe)*255}var ne=function(Te){return function(){return Te}};function le(Te,Pe){return function(Ge){return Te+Ge*Pe}}function ve(Te,Pe,Ge){return Te=Math.pow(Te,Ge),Pe=Math.pow(Pe,Ge)-Te,Ge=1/Ge,function($e){return Math.pow(Te+$e*Pe,Ge)}}function q(Te){return(Te=+Te)==1?Z:function(Pe,Ge){return Ge-Pe?ve(Pe,Ge,Te):ne(isNaN(Pe)?Ge:Pe)}}function Z(Te,Pe){var Ge=Pe-Te;return Ge?le(Te,Ge):ne(isNaN(Te)?Pe:Te)}var K=function Te(Pe){var Ge=q(Pe);function $e(ze,je){var ut=Ge((ze=L(ze)).r,(je=L(je)).r),at=Ge(ze.g,je.g),nt=Ge(ze.b,je.b),st=Z(ze.opacity,je.opacity);return function(gt){return ze.r=ut(gt),ze.g=at(gt),ze.b=nt(gt),ze.opacity=st(gt),ze+""}}return $e.gamma=Te,$e}(1);function Q(Te,Pe){var Ge=Pe?Pe.length:0,$e=Te?Math.min(Ge,Te.length):0,ze=new Array($e),je=new Array(Ge),ut;for(ut=0;ut<$e;++ut)ze[ut]=Le(Te[ut],Pe[ut]);for(;utGe&&(je=Pe.slice(Ge,je),at[ut]?at[ut]+=je:at[++ut]=je),($e=$e[0])===(ze=ze[0])?at[ut]?at[ut]+=ze:at[++ut]=ze:(at[++ut]=null,nt.push({i:ut,x:ue($e,ze)})),Ge=oe.lastIndex;return GeD===1).map(([D])=>D)},{type:"histogram",name:"Negative",marker:{color:"red"},opacity:.5,xaxis:"x",yaxis:"y"+S,legendgroup:"negatives",showlegend:S<2,x:n.filter(([,D])=>D===-1).map(([D])=>D)}]}function TP({testPairings:n,trainPairings:S}){return qt.jsx("div",{className:"flex justify-center p-4",children:qt.jsx(wP,{config:{responsive:!0,displayModeBar:!1,displaylogo:!1},layout:{plot_bgcolor:"rgba(255,255,255,0.25)",paper_bgcolor:"transparent",font:{color:"white"},showlegend:!0,height:300,width:400,legend:{},barmode:"overlay",yaxis:{title:"Test Set"},yaxis2:{title:"Train Set"},xaxis:{title:"Cosine Similarity"},margin:{l:50,t:0,r:0,b:50},grid:{rows:2,columns:1,subplots:["x1y","x2y"]}},data:[...YE(n,1),...YE(S,2)]})})}function IU({performanceHistory:n}){const S=U4.range(0,n.length);return qt.jsx("div",{children:qt.jsx(wP,{config:{responsive:!0,displayModeBar:!1,displaylogo:!1},data:[{mode:"lines",type:"scatter",x:S,name:"Test",y:n.map(({test:D})=>D.accuracy)},{mode:"lines",type:"scatter",x:S,name:"Train",y:n.map(({train:D})=>D.accuracy)}],layout:{font:{color:"white"},height:200,width:400,plot_bgcolor:"rgba(255,255,255,0.25)",paper_bgcolor:"transparent",showlegend:!0,margin:{l:50,t:0,r:0,b:50},xaxis:{title:"Epoch"},yaxis:{title:"Accuracy",range:[0,1]}}})})}const Rb=ht.forwardRef((n,S)=>ht.createElement(Ci.span,ga({},n,{ref:S,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}}))),kU=Rb,FU=[" ","Enter","ArrowUp","ArrowDown"],OU=[" ","Enter"],_b="Select",[Db,mS,zU]=bb(_b),[Pg,YV]=Bc(_b,[zU,Cg]),xS=Cg(),[NU,r0]=Pg(_b),[BU,UU]=Pg(_b),HU=n=>{const{__scopeSelect:S,children:D,open:$,defaultOpen:ie,onOpenChange:pe,value:z,defaultValue:O,onValueChange:e,dir:p,name:P,autoComplete:a,disabled:C,required:x}=n,d=xS(S),[g,t]=ht.useState(null),[r,o]=ht.useState(null),[i,u]=ht.useState(!1),h=yb(p),[c=!1,b]=Xv({prop:$,defaultProp:ie,onChange:pe}),[f,m]=Xv({prop:z,defaultProp:O,onChange:e}),v=ht.useRef(null),l=g?!!g.closest("form"):!0,[y,E]=ht.useState(new Set),A=Array.from(y).map(R=>R.props.value).join(";");return ht.createElement(rS,d,ht.createElement(NU,{required:x,scope:S,trigger:g,onTriggerChange:t,valueNode:r,onValueNodeChange:o,valueNodeHasChildren:i,onValueNodeHasChildrenChange:u,contentId:kd(),value:f,onValueChange:m,open:c,onOpenChange:b,dir:h,triggerPointerDownPosRef:v,disabled:C},ht.createElement(Db.Provider,{scope:S},ht.createElement(BU,{scope:n.__scopeSelect,onNativeOptionAdd:ht.useCallback(R=>{E(w=>new Set(w).add(R))},[]),onNativeOptionRemove:ht.useCallback(R=>{E(w=>{const L=new Set(w);return L.delete(R),L})},[])},D)),l?ht.createElement(EP,{key:A,"aria-hidden":!0,required:x,tabIndex:-1,name:P,autoComplete:a,value:f,onChange:R=>m(R.target.value),disabled:C},f===void 0?ht.createElement("option",{value:""}):null,Array.from(y)):null))},VU="SelectTrigger",GU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,disabled:$=!1,...ie}=n,pe=xS(D),z=r0(VU,D),O=z.disabled||$,e=so(S,z.onTriggerChange),p=mS(D),[P,a,C]=CP(d=>{const g=p().filter(o=>!o.disabled),t=g.find(o=>o.value===z.value),r=PP(g,d,t);r!==void 0&&z.onValueChange(r.value)}),x=()=>{O||(z.onOpenChange(!0),C())};return ht.createElement(nS,ga({asChild:!0},pe),ht.createElement(Ci.button,ga({type:"button",role:"combobox","aria-controls":z.contentId,"aria-expanded":z.open,"aria-required":z.required,"aria-autocomplete":"none",dir:z.dir,"data-state":z.open?"open":"closed",disabled:O,"data-disabled":O?"":void 0,"data-placeholder":MP(z.value)?"":void 0},ie,{ref:e,onClick:Ja(ie.onClick,d=>{d.currentTarget.focus()}),onPointerDown:Ja(ie.onPointerDown,d=>{const g=d.target;g.hasPointerCapture(d.pointerId)&&g.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&(x(),z.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)},d.preventDefault())}),onKeyDown:Ja(ie.onKeyDown,d=>{const g=P.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&a(d.key),!(g&&d.key===" ")&&FU.includes(d.key)&&(x(),d.preventDefault())})})))}),WU="SelectValue",$U=ht.forwardRef((n,S)=>{const{__scopeSelect:D,className:$,style:ie,children:pe,placeholder:z="",...O}=n,e=r0(WU,D),{onValueNodeHasChildrenChange:p}=e,P=pe!==void 0,a=so(S,e.onValueNodeChange);return ic(()=>{p(P)},[p,P]),ht.createElement(Ci.span,ga({},O,{ref:a,style:{pointerEvents:"none"}}),MP(e.value)?ht.createElement(ht.Fragment,null,z):pe)}),jU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,children:$,...ie}=n;return ht.createElement(Ci.span,ga({"aria-hidden":!0},ie,{ref:S}),$||"▼")}),YU=n=>ht.createElement(Ab,ga({asChild:!0},n)),pg="SelectContent",ZU=ht.forwardRef((n,S)=>{const D=r0(pg,n.__scopeSelect),[$,ie]=ht.useState();if(ic(()=>{ie(new DocumentFragment)},[]),!D.open){const pe=$;return pe?rp.createPortal(ht.createElement(AP,{scope:n.__scopeSelect},ht.createElement(Db.Slot,{scope:n.__scopeSelect},ht.createElement("div",null,n.children))),pe):null}return ht.createElement(XU,ga({},n,{ref:S}))}),Sd=10,[AP,Ib]=Pg(pg),XU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,position:$="item-aligned",onCloseAutoFocus:ie,onEscapeKeyDown:pe,onPointerDownOutside:z,side:O,sideOffset:e,align:p,alignOffset:P,arrowPadding:a,collisionBoundary:C,collisionPadding:x,sticky:d,hideWhenDetached:g,avoidCollisions:t,...r}=n,o=r0(pg,D),[i,u]=ht.useState(null),[h,c]=ht.useState(null),b=so(S,H=>u(H)),[f,m]=ht.useState(null),[v,l]=ht.useState(null),y=mS(D),[E,A]=ht.useState(!1),R=ht.useRef(!1);ht.useEffect(()=>{if(i)return oS(i)},[i]),Z4();const w=ht.useCallback(H=>{const[U,...G]=y().map(ne=>ne.ref.current),[Y]=G.slice(-1),J=document.activeElement;for(const ne of H)if(ne===J||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===U&&h&&(h.scrollTop=0),ne===Y&&h&&(h.scrollTop=h.scrollHeight),ne==null||ne.focus(),document.activeElement!==J))return},[y,h]),L=ht.useCallback(()=>w([f,i]),[w,f,i]);ht.useEffect(()=>{E&&L()},[E,L]);const{onOpenChange:M,triggerPointerDownPosRef:s}=o;ht.useEffect(()=>{if(i){let H={x:0,y:0};const U=Y=>{var J,ne,le,ve;H={x:Math.abs(Math.round(Y.pageX)-((J=(ne=s.current)===null||ne===void 0?void 0:ne.x)!==null&&J!==void 0?J:0)),y:Math.abs(Math.round(Y.pageY)-((le=(ve=s.current)===null||ve===void 0?void 0:ve.y)!==null&&le!==void 0?le:0))}},G=Y=>{H.x<=10&&H.y<=10?Y.preventDefault():i.contains(Y.target)||M(!1),document.removeEventListener("pointermove",U),s.current=null};return s.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",G,{capture:!0})}}},[i,M,s]),ht.useEffect(()=>{const H=()=>M(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[M]);const[_,T]=CP(H=>{const U=y().filter(J=>!J.disabled),G=U.find(J=>J.ref.current===document.activeElement),Y=PP(U,H,G);Y&&setTimeout(()=>Y.ref.current.focus())}),B=ht.useCallback((H,U,G)=>{const Y=!R.current&&!G;(o.value!==void 0&&o.value===U||Y)&&(m(H),Y&&(R.current=!0))},[o.value]),F=ht.useCallback(()=>i==null?void 0:i.focus(),[i]),W=ht.useCallback((H,U,G)=>{const Y=!R.current&&!G;(o.value!==void 0&&o.value===U||Y)&&l(H)},[o.value]),N=$==="popper"?ZE:KU,V=N===ZE?{side:O,sideOffset:e,align:p,alignOffset:P,arrowPadding:a,collisionBoundary:C,collisionPadding:x,sticky:d,hideWhenDetached:g,avoidCollisions:t}:{};return ht.createElement(AP,{scope:D,content:i,viewport:h,onViewportChange:c,itemRefCallback:B,selectedItem:f,onItemLeave:F,itemTextRefCallback:W,focusSelectedItem:L,selectedItemText:v,position:$,isPositioned:E,searchRef:_},ht.createElement(sS,{as:Yv,allowPinchZoom:!0},ht.createElement(X4,{asChild:!0,trapped:o.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:Ja(ie,H=>{var U;(U=o.trigger)===null||U===void 0||U.focus({preventScroll:!0}),H.preventDefault()})},ht.createElement(zm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:pe,onPointerDownOutside:z,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>o.onOpenChange(!1)},ht.createElement(N,ga({role:"listbox",id:o.contentId,"data-state":o.open?"open":"closed",dir:o.dir,onContextMenu:H=>H.preventDefault()},r,V,{onPlaced:()=>A(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...r.style},onKeyDown:Ja(r.onKeyDown,H=>{const U=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!U&&H.key.length===1&&T(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let Y=y().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(H.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const J=H.target,ne=Y.indexOf(J);Y=Y.slice(ne+1)}setTimeout(()=>w(Y)),H.preventDefault()}})}))))))}),KU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,onPlaced:$,...ie}=n,pe=r0(pg,D),z=Ib(pg,D),[O,e]=ht.useState(null),[p,P]=ht.useState(null),a=so(S,b=>P(b)),C=mS(D),x=ht.useRef(!1),d=ht.useRef(!0),{viewport:g,selectedItem:t,selectedItemText:r,focusSelectedItem:o}=z,i=ht.useCallback(()=>{if(pe.trigger&&pe.valueNode&&O&&p&&g&&t&&r){const b=pe.trigger.getBoundingClientRect(),f=p.getBoundingClientRect(),m=pe.valueNode.getBoundingClientRect(),v=r.getBoundingClientRect();if(pe.dir!=="rtl"){const J=v.left-f.left,ne=m.left-J,le=b.left-ne,ve=b.width+le,q=Math.max(ve,f.width),Z=window.innerWidth-Sd,K=pA(ne,[Sd,Z-q]);O.style.minWidth=ve+"px",O.style.left=K+"px"}else{const J=f.right-v.right,ne=window.innerWidth-m.right-J,le=window.innerWidth-b.right-ne,ve=b.width+le,q=Math.max(ve,f.width),Z=window.innerWidth-Sd,K=pA(ne,[Sd,Z-q]);O.style.minWidth=ve+"px",O.style.right=K+"px"}const l=C(),y=window.innerHeight-Sd*2,E=g.scrollHeight,A=window.getComputedStyle(p),R=parseInt(A.borderTopWidth,10),w=parseInt(A.paddingTop,10),L=parseInt(A.borderBottomWidth,10),M=parseInt(A.paddingBottom,10),s=R+w+E+M+L,_=Math.min(t.offsetHeight*5,s),T=window.getComputedStyle(g),B=parseInt(T.paddingTop,10),F=parseInt(T.paddingBottom,10),W=b.top+b.height/2-Sd,N=y-W,V=t.offsetHeight/2,H=t.offsetTop+V,U=R+w+H,G=s-U;if(U<=W){const J=t===l[l.length-1].ref.current;O.style.bottom="0px";const ne=p.clientHeight-g.offsetTop-g.offsetHeight,le=Math.max(N,V+(J?F:0)+ne+L),ve=U+le;O.style.height=ve+"px"}else{const J=t===l[0].ref.current;O.style.top="0px";const le=Math.max(W,R+g.offsetTop+(J?B:0)+V)+G;O.style.height=le+"px",g.scrollTop=U-W+g.offsetTop}O.style.margin=`${Sd}px 0`,O.style.minHeight=_+"px",O.style.maxHeight=y+"px",$==null||$(),requestAnimationFrame(()=>x.current=!0)}},[C,pe.trigger,pe.valueNode,O,p,g,t,r,pe.dir,$]);ic(()=>i(),[i]);const[u,h]=ht.useState();ic(()=>{p&&h(window.getComputedStyle(p).zIndex)},[p]);const c=ht.useCallback(b=>{b&&d.current===!0&&(i(),o==null||o(),d.current=!1)},[i,o]);return ht.createElement(JU,{scope:D,contentWrapper:O,shouldExpandOnScrollRef:x,onScrollButtonChange:c},ht.createElement("div",{ref:e,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:u}},ht.createElement(Ci.div,ga({},ie,{ref:a,style:{boxSizing:"border-box",maxHeight:"100%",...ie.style}}))))}),ZE=ht.forwardRef((n,S)=>{const{__scopeSelect:D,align:$="start",collisionPadding:ie=Sd,...pe}=n,z=xS(D);return ht.createElement(aS,ga({},z,pe,{ref:S,align:$,collisionPadding:ie,style:{boxSizing:"border-box",...pe.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JU,QU]=Pg(pg,{}),XE="SelectViewport",qU=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n,ie=Ib(XE,D),pe=QU(XE,D),z=so(S,ie.onViewportChange),O=ht.useRef(0);return ht.createElement(ht.Fragment,null,ht.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),ht.createElement(Db.Slot,{scope:D},ht.createElement(Ci.div,ga({"data-radix-select-viewport":"",role:"presentation"},$,{ref:z,style:{position:"relative",flex:1,overflow:"auto",...$.style},onScroll:Ja($.onScroll,e=>{const p=e.currentTarget,{contentWrapper:P,shouldExpandOnScrollRef:a}=pe;if(a!=null&&a.current&&P){const C=Math.abs(O.current-p.scrollTop);if(C>0){const x=window.innerHeight-Sd*2,d=parseFloat(P.style.minHeight),g=parseFloat(P.style.height),t=Math.max(d,g);if(t0?i:0,P.style.justifyContent="flex-end")}}}O.current=p.scrollTop})}))))}),eH="SelectGroup",[ZV,tH]=Pg(eH),rH="SelectLabel",nH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n,ie=tH(rH,D);return ht.createElement(Ci.div,ga({id:ie.id},$,{ref:S}))}),PA="SelectItem",[aH,SP]=Pg(PA),iH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,value:$,disabled:ie=!1,textValue:pe,...z}=n,O=r0(PA,D),e=Ib(PA,D),p=O.value===$,[P,a]=ht.useState(pe??""),[C,x]=ht.useState(!1),d=so(S,r=>{var o;return(o=e.itemRefCallback)===null||o===void 0?void 0:o.call(e,r,$,ie)}),g=kd(),t=()=>{ie||(O.onValueChange($),O.onOpenChange(!1))};if($==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return ht.createElement(aH,{scope:D,value:$,disabled:ie,textId:g,isSelected:p,onItemTextChange:ht.useCallback(r=>{a(o=>{var i;return o||((i=r==null?void 0:r.textContent)!==null&&i!==void 0?i:"").trim()})},[])},ht.createElement(Db.ItemSlot,{scope:D,value:$,disabled:ie,textValue:P},ht.createElement(Ci.div,ga({role:"option","aria-labelledby":g,"data-highlighted":C?"":void 0,"aria-selected":p&&C,"data-state":p?"checked":"unchecked","aria-disabled":ie||void 0,"data-disabled":ie?"":void 0,tabIndex:ie?void 0:-1},z,{ref:d,onFocus:Ja(z.onFocus,()=>x(!0)),onBlur:Ja(z.onBlur,()=>x(!1)),onPointerUp:Ja(z.onPointerUp,t),onPointerMove:Ja(z.onPointerMove,r=>{if(ie){var o;(o=e.onItemLeave)===null||o===void 0||o.call(e)}else r.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ja(z.onPointerLeave,r=>{if(r.currentTarget===document.activeElement){var o;(o=e.onItemLeave)===null||o===void 0||o.call(e)}}),onKeyDown:Ja(z.onKeyDown,r=>{var o;((o=e.searchRef)===null||o===void 0?void 0:o.current)!==""&&r.key===" "||(OU.includes(r.key)&&t(),r.key===" "&&r.preventDefault())})}))))}),Lx="SelectItemText",oH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,className:$,style:ie,...pe}=n,z=r0(Lx,D),O=Ib(Lx,D),e=SP(Lx,D),p=UU(Lx,D),[P,a]=ht.useState(null),C=so(S,r=>a(r),e.onItemTextChange,r=>{var o;return(o=O.itemTextRefCallback)===null||o===void 0?void 0:o.call(O,r,e.value,e.disabled)}),x=P==null?void 0:P.textContent,d=ht.useMemo(()=>ht.createElement("option",{key:e.value,value:e.value,disabled:e.disabled},x),[e.disabled,e.value,x]),{onNativeOptionAdd:g,onNativeOptionRemove:t}=p;return ic(()=>(g(d),()=>t(d)),[g,t,d]),ht.createElement(ht.Fragment,null,ht.createElement(Ci.span,ga({id:e.textId},pe,{ref:C})),e.isSelected&&z.valueNode&&!z.valueNodeHasChildren?rp.createPortal(pe.children,z.valueNode):null)}),sH="SelectItemIndicator",lH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n;return SP(sH,D).isSelected?ht.createElement(Ci.span,ga({"aria-hidden":!0},$,{ref:S})):null}),uH=ht.forwardRef((n,S)=>{const{__scopeSelect:D,...$}=n;return ht.createElement(Ci.div,ga({"aria-hidden":!0},$,{ref:S}))});function MP(n){return n===""||n===void 0}const EP=ht.forwardRef((n,S)=>{const{value:D,...$}=n,ie=ht.useRef(null),pe=so(S,ie),z=iP(D);return ht.useEffect(()=>{const O=ie.current,e=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(e,"value").set;if(z!==D&&P){const a=new Event("change",{bubbles:!0});P.call(O,D),O.dispatchEvent(a)}},[z,D]),ht.createElement(Rb,{asChild:!0},ht.createElement("select",ga({},$,{ref:pe,defaultValue:D})))});EP.displayName="BubbleSelect";function CP(n){const S=Ns(n),D=ht.useRef(""),$=ht.useRef(0),ie=ht.useCallback(z=>{const O=D.current+z;S(O),function e(p){D.current=p,window.clearTimeout($.current),p!==""&&($.current=window.setTimeout(()=>e(""),1e3))}(O)},[S]),pe=ht.useCallback(()=>{D.current="",window.clearTimeout($.current)},[]);return ht.useEffect(()=>()=>window.clearTimeout($.current),[]),[D,ie,pe]}function PP(n,S,D){const ie=S.length>1&&Array.from(S).every(p=>p===S[0])?S[0]:S,pe=D?n.indexOf(D):-1;let z=fH(n,Math.max(pe,0));ie.length===1&&(z=z.filter(p=>p!==D));const e=z.find(p=>p.textValue.toLowerCase().startsWith(ie.toLowerCase()));return e!==D?e:void 0}function fH(n,S){return n.map((D,$)=>n[(S+$)%n.length])}const cH=HU,LP=GU,hH=$U,dH=jU,vH=YU,RP=ZU,pH=qU,_P=nH,DP=iH,gH=oH,yH=lH,IP=uH,kP=cH,FP=hH,bS=ht.forwardRef(({className:n,children:S,...D},$)=>qt.jsxs(LP,{ref:$,className:Ni("flex h-9 w-full items-center justify-between rounded-md border border-input bg-slate-700 px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 whitespace-nowrap overflow-hidden",n),...D,children:[S,qt.jsx(dH,{asChild:!0,children:qt.jsx(bB,{className:"h-4 w-4 opacity-50"})})]}));bS.displayName=LP.displayName;const wS=ht.forwardRef(({className:n,children:S,position:D="popper",...$},ie)=>qt.jsx(vH,{children:qt.jsx(RP,{ref:ie,className:Ni("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",D==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:D,...$,children:qt.jsx(pH,{className:Ni("p-1",D==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:S})})}));wS.displayName=RP.displayName;const mH=ht.forwardRef(({className:n,...S},D)=>qt.jsx(_P,{ref:D,className:Ni("px-2 py-1.5 text-sm font-semibold",n),...S}));mH.displayName=_P.displayName;const Z2=ht.forwardRef(({className:n,children:S,...D},$)=>qt.jsxs(DP,{ref:$,className:Ni("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...D,children:[qt.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:qt.jsx(yH,{children:qt.jsx(V9,{className:"h-4 w-4"})})}),qt.jsx(gH,{children:S})]}));Z2.displayName=DP.displayName;const xH=ht.forwardRef(({className:n,...S},D)=>qt.jsx(IP,{ref:D,className:Ni("-mx-1 my-1 h-px bg-muted",n),...S}));xH.displayName=IP.displayName;function I0({children:n,identifier:S,name:D,description:$}){return qt.jsxs(qt.Fragment,{children:[qt.jsx(bh,{htmlFor:S,className:"md:text-right sm:text-left",children:D}),n,qt.jsx("p",{className:"text-sm text-slate-200",children:$})]})}function bH({children:n}){const[S,D]=Pb(),$=ht.useCallback(ie=>{ie==="adamax"?D("learningRate",.01):D("learningRate",10),D("optimizer",ie)},[D]);return qt.jsxs("div",{children:[qt.jsx("p",{className:"text-slate-200",children:"Adjust the following parameters to improve performance."}),qt.jsxs("div",{className:"p-3 grid md:grid-cols-[auto,220px,3fr] sm:grid-cols-1 gap-x-5 gap-y-3 items-center",children:[qt.jsx(I0,{identifier:"targetEmbeddingSize",name:"Target Embedding Size",description:"How big should the embedding be after the matmul. Larger is usually better but more expensive to search over.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.targetEmbeddingSize,onChange:ie=>D("targetEmbeddingSize",Number(ie.target.value)),id:"targetEmbeddingSize"})}),qt.jsx(I0,{name:"Optimizer",identifier:"optimizer",description:"The algorithm to optimize the matrix.",children:qt.jsxs(kP,{value:S.optimizer,onValueChange:$,children:[qt.jsx(bS,{className:"w-[220px]",id:"optimizer",children:qt.jsx(FP,{})}),qt.jsxs(wS,{children:[qt.jsx(Z2,{value:"gradient",children:"Simple Gradient Descent"}),qt.jsx(Z2,{value:"adamax",children:"Adamax"})]})]})}),qt.jsx(I0,{identifier:"learningRate",name:"Learning Rate",description:"How big of a gradient to apply at each step.",children:qt.jsx(Qf,{type:"number",min:0,step:.01,value:S.learningRate,onChange:ie=>D("learningRate",Number(ie.target.value)),id:"learningRate"})}),qt.jsx(I0,{identifier:"batchSize",name:"Batch Size",description:"How many examples to show on each update.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.batchSize,onChange:ie=>D("batchSize",Number(ie.target.value)),id:"batchSize"})}),qt.jsx(I0,{identifier:"epochs",name:"Epochs",description:"How many times all examples should be shown to the model.",children:qt.jsx(Qf,{type:"number",min:1,step:1,value:S.epochs,onChange:ie=>D("epochs",Number(ie.target.value)),id:"epochs"})}),qt.jsx(I0,{identifier:"dropoutFraction",name:"Dropout Fraction",description:"Proportion of weights to randomly ignore. To prevent overfitting.",children:qt.jsx(Qf,{type:"number",min:0,max:1,step:.05,value:S.dropoutFraction,onChange:ie=>D("dropoutFraction",Number(ie.target.value)),id:"dropoutFraction"})})]}),n]})}function wH({state:n}){if(n.type!=="doneTraining"&&n.type!=="training")return null;const S=Math.round(1e4*(n.currentPerformance.trainAccuracyAndSE.accuracy-n.pretrainingPerformance.trainAccuracyAndSE.accuracy))/100,D=Math.round(1e4*(n.currentPerformance.testAccuracyAndSE.accuracy-n.pretrainingPerformance.testAccuracyAndSE.accuracy))/100;return qt.jsxs("p",{className:"text-slate-300 my-4",children:["Currently, test accuracy is"," ",qt.jsx("span",{className:"text-white",children:n.currentPerformance.testAccuracyAndSE.message})," ","(",qt.jsxs("span",{className:D>0?"text-green-300":"text-red-300",children:[D>0?"+":"",D,"%"]}),") and train accuracy is"," ",qt.jsx("span",{className:"text-white",children:n.currentPerformance.trainAccuracyAndSE.message})," ","(",qt.jsxs("span",{className:S>0?"text-green-300":"text-red-300",children:[S>0?"+":"",S,"%"]}),")."]})}function TH({state:n}){return n.type!=="doneTraining"&&n.type!=="training"?null:qt.jsxs("div",{className:"flex flex-row items-center justify-center flex-wrap",children:["(",qt.jsx(IU,{performanceHistory:n.performanceHistory}),")",qt.jsx(TP,{testPairings:n.currentPerformance.testCosinePairings,trainPairings:n.currentPerformance.trainCosinePairings})]})}function AH(){const[n]=Pb(),S=Hm();return S.type==="uninitialized"||S.type==="embeddingProgress"||S.type==="fetchingEmbeddings"?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Training"})}):qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Training"}),(S.type==="doneTraining"||S.type==="pretrained")&&qt.jsx(bH,{children:qt.jsx("div",{className:"flex flex-row p-3",children:qt.jsx(ds,{onClick:()=>S.train(n),className:"w-full",children:"Train"})})}),qt.jsxs("div",{children:[(S.type==="training"||S.type==="trainingStarted")&&qt.jsxs("div",{children:[qt.jsxs("p",{className:"text-slate-300 my-2",children:["Training (epoch ",S.currentEpoch+1,"/",n.epochs,")"]}),qt.jsx(yS,{className:"h-[20px]",value:Math.round(S.currentEpoch/n.epochs*100)})]}),qt.jsx(wH,{state:S}),qt.jsx(TH,{state:S}),qt.jsx("div",{className:"flex flex-row justify-end",children:S.type==="training"?qt.jsx(ds,{variant:"destructive",onClick:S.stop,children:"Stop"}):null})]})]})}function SH(){const n=Hm(),S=Bd(qh),D=gS(),[$]=Pb(),ie=Bd(hb),pe=ht.useCallback(()=>{if(!D)throw new Error("Pairs not loaded");if(n.type!=="uninitialized")throw new Error("Trainer already initialized");S.type==="local"?n.initializeLocal({pairings:D,parameters:$,apiKey:ie||""}):S.type==="example"&&n.initializeExample({pairings:D,parameters:$,cacheUrl:S.embeddingsURL})},[$,D,S,ie,n]),z=D?Sk(D):null;return{initializeDataset:pe,datasetCounts:z}}function MH(){const{initializeDataset:n,datasetCounts:S}=SH(),[D,$]=Pb(),ie=Bd(qh),pe=Bd(tD);if(!S)return qt.jsx("div",{children:"loading..."});const z=S.positives+S.negatives>1;return qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("p",{className:"text-slate-300 text-l my-2",children:["In this step, we prepare the data for training by embedding it and splitting it into a training and test set. Embeddings are retrieved from your browser cache first. If they aren't cached,"," ",qt.jsx("span",{className:"text-white font-bold",children:"this may download 50mb+ of data"}),"."]}),qt.jsxs("p",{className:"text-slate-300 text-l my-2",children:["There are ",qt.jsx("span",{className:"text-white",children:S.positives})," ","positive examples and"," ",qt.jsx("span",{className:"text-white",children:S.negatives})," negative examples."," ",!z&&qt.jsx("span",{className:"text-red-300 font-bold",children:"You need at least 2 examples to train."}),z&&S.negatives0&&qt.jsxs(qt.Fragment,{children:[qt.jsxs(bh,{htmlFor:"augment",className:"md:text-right sm:text-left",children:["Generate"," ",Math.max(S.positives-S.negatives,0)," ","negative examples"]}),qt.jsx(Cb,{id:"augment",checked:D.generateSyntheticNegatives,onCheckedChange:O=>$("generateSyntheticNegatives",O)})]}),qt.jsx(bh,{htmlFor:"split",className:"md:text-right sm:text-left",children:"Fraction of dataset used for testing"}),qt.jsx(Qf,{id:"split",type:"number",className:"max-w-[100px]",max:.95,min:.01,step:.1,value:D.testSplitFraction,onChange:O=>$("testSplitFraction",Number(O.target.value))}),ie.type==="local"&&pe.state==="hasData"&&qt.jsxs(qt.Fragment,{children:[qt.jsx(bh,{htmlFor:"model",className:"md:text-right sm:text-left",children:"Embedding model"}),qt.jsxs(kP,{value:D.embeddingModel,onValueChange:O=>$("embeddingModel",O),children:[qt.jsx(bS,{className:"md:w-[250px] sm:w-[200px]",id:"model",children:qt.jsx(FP,{})}),qt.jsx(wS,{children:pe.data.map((O,e)=>qt.jsx(Z2,{value:O,children:O},e))})]})]})]}),qt.jsx("div",{className:"w-full px-3",children:qt.jsx(ds,{className:"w-full",onClick:n,disabled:!z,children:z?"Prepare Data":"Not enough examples"})})]})}const[kb,XV]=Bc("Tooltip",[Cg]),TS=Cg(),EH="TooltipProvider",CH=700,LA="tooltip.open",[PH,AS]=kb(EH),LH=n=>{const{__scopeTooltip:S,delayDuration:D=CH,skipDelayDuration:$=300,disableHoverableContent:ie=!1,children:pe}=n,[z,O]=ht.useState(!0),e=ht.useRef(!1),p=ht.useRef(0);return ht.useEffect(()=>{const P=p.current;return()=>window.clearTimeout(P)},[]),ht.createElement(PH,{scope:S,isOpenDelayed:z,delayDuration:D,onOpen:ht.useCallback(()=>{window.clearTimeout(p.current),O(!1)},[]),onClose:ht.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>O(!0),$)},[$]),isPointerInTransitRef:e,onPointerInTransitChange:ht.useCallback(P=>{e.current=P},[]),disableHoverableContent:ie},pe)},SS="Tooltip",[RH,Fb]=kb(SS),_H=n=>{const{__scopeTooltip:S,children:D,open:$,defaultOpen:ie=!1,onOpenChange:pe,disableHoverableContent:z,delayDuration:O}=n,e=AS(SS,n.__scopeTooltip),p=TS(S),[P,a]=ht.useState(null),C=kd(),x=ht.useRef(0),d=z??e.disableHoverableContent,g=O??e.delayDuration,t=ht.useRef(!1),[r=!1,o]=Xv({prop:$,defaultProp:ie,onChange:b=>{b?(e.onOpen(),document.dispatchEvent(new CustomEvent(LA))):e.onClose(),pe==null||pe(b)}}),i=ht.useMemo(()=>r?t.current?"delayed-open":"instant-open":"closed",[r]),u=ht.useCallback(()=>{window.clearTimeout(x.current),t.current=!1,o(!0)},[o]),h=ht.useCallback(()=>{window.clearTimeout(x.current),o(!1)},[o]),c=ht.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{t.current=!0,o(!0)},g)},[g,o]);return ht.useEffect(()=>()=>window.clearTimeout(x.current),[]),ht.createElement(rS,p,ht.createElement(RH,{scope:S,contentId:C,open:r,stateAttribute:i,trigger:P,onTriggerChange:a,onTriggerEnter:ht.useCallback(()=>{e.isOpenDelayed?c():u()},[e.isOpenDelayed,c,u]),onTriggerLeave:ht.useCallback(()=>{d?h():window.clearTimeout(x.current)},[h,d]),onOpen:u,onClose:h,disableHoverableContent:d},D))},KE="TooltipTrigger",DH=ht.forwardRef((n,S)=>{const{__scopeTooltip:D,...$}=n,ie=Fb(KE,D),pe=AS(KE,D),z=TS(D),O=ht.useRef(null),e=so(S,O,ie.onTriggerChange),p=ht.useRef(!1),P=ht.useRef(!1),a=ht.useCallback(()=>p.current=!1,[]);return ht.useEffect(()=>()=>document.removeEventListener("pointerup",a),[a]),ht.createElement(nS,ga({asChild:!0},z),ht.createElement(Ci.button,ga({"aria-describedby":ie.open?ie.contentId:void 0,"data-state":ie.stateAttribute},$,{ref:e,onPointerMove:Ja(n.onPointerMove,C=>{C.pointerType!=="touch"&&!P.current&&!pe.isPointerInTransitRef.current&&(ie.onTriggerEnter(),P.current=!0)}),onPointerLeave:Ja(n.onPointerLeave,()=>{ie.onTriggerLeave(),P.current=!1}),onPointerDown:Ja(n.onPointerDown,()=>{p.current=!0,document.addEventListener("pointerup",a,{once:!0})}),onFocus:Ja(n.onFocus,()=>{p.current||ie.onOpen()}),onBlur:Ja(n.onBlur,ie.onClose),onClick:Ja(n.onClick,ie.onClose)})))}),IH="TooltipPortal",[KV,kH]=kb(IH,{forceMount:void 0}),Cm="TooltipContent",FH=ht.forwardRef((n,S)=>{const D=kH(Cm,n.__scopeTooltip),{forceMount:$=D.forceMount,side:ie="top",...pe}=n,z=Fb(Cm,n.__scopeTooltip);return ht.createElement(Mf,{present:$||z.open},z.disableHoverableContent?ht.createElement(OP,ga({side:ie},pe,{ref:S})):ht.createElement(OH,ga({side:ie},pe,{ref:S})))}),OH=ht.forwardRef((n,S)=>{const D=Fb(Cm,n.__scopeTooltip),$=AS(Cm,n.__scopeTooltip),ie=ht.useRef(null),pe=so(S,ie),[z,O]=ht.useState(null),{trigger:e,onClose:p}=D,P=ie.current,{onPointerInTransitChange:a}=$,C=ht.useCallback(()=>{O(null),a(!1)},[a]),x=ht.useCallback((d,g)=>{const t=d.currentTarget,r={x:d.clientX,y:d.clientY},o=NH(r,t.getBoundingClientRect()),i=BH(r,o),u=UH(g.getBoundingClientRect()),h=VH([...i,...u]);O(h),a(!0)},[a]);return ht.useEffect(()=>()=>C(),[C]),ht.useEffect(()=>{if(e&&P){const d=t=>x(t,P),g=t=>x(t,e);return e.addEventListener("pointerleave",d),P.addEventListener("pointerleave",g),()=>{e.removeEventListener("pointerleave",d),P.removeEventListener("pointerleave",g)}}},[e,P,x,C]),ht.useEffect(()=>{if(z){const d=g=>{const t=g.target,r={x:g.clientX,y:g.clientY},o=(e==null?void 0:e.contains(t))||(P==null?void 0:P.contains(t)),i=!HH(r,z);o?C():i&&(C(),p())};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)}},[e,P,z,p,C]),ht.createElement(OP,ga({},n,{ref:pe}))}),[zH,JV]=kb(SS,{isInside:!1}),OP=ht.forwardRef((n,S)=>{const{__scopeTooltip:D,children:$,"aria-label":ie,onEscapeKeyDown:pe,onPointerDownOutside:z,...O}=n,e=Fb(Cm,D),p=TS(D),{onClose:P}=e;return ht.useEffect(()=>(document.addEventListener(LA,P),()=>document.removeEventListener(LA,P)),[P]),ht.useEffect(()=>{if(e.trigger){const a=C=>{const x=C.target;x!=null&&x.contains(e.trigger)&&P()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[e.trigger,P]),ht.createElement(zm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:pe,onPointerDownOutside:z,onFocusOutside:a=>a.preventDefault(),onDismiss:P},ht.createElement(aS,ga({"data-state":e.stateAttribute},p,O,{ref:S,style:{...O.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),ht.createElement(u7,null,$),ht.createElement(zH,{scope:D,isInside:!0},ht.createElement(kU,{id:e.contentId,role:"tooltip"},ie||$))))});function NH(n,S){const D=Math.abs(S.top-n.y),$=Math.abs(S.bottom-n.y),ie=Math.abs(S.right-n.x),pe=Math.abs(S.left-n.x);switch(Math.min(D,$,ie,pe)){case pe:return"left";case ie:return"right";case D:return"top";case $:return"bottom";default:throw new Error("unreachable")}}function BH(n,S,D=5){const $=[];switch(S){case"top":$.push({x:n.x-D,y:n.y+D},{x:n.x+D,y:n.y+D});break;case"bottom":$.push({x:n.x-D,y:n.y-D},{x:n.x+D,y:n.y-D});break;case"left":$.push({x:n.x+D,y:n.y-D},{x:n.x+D,y:n.y+D});break;case"right":$.push({x:n.x-D,y:n.y-D},{x:n.x-D,y:n.y+D});break}return $}function UH(n){const{top:S,right:D,bottom:$,left:ie}=n;return[{x:ie,y:S},{x:D,y:S},{x:D,y:$},{x:ie,y:$}]}function HH(n,S){const{x:D,y:$}=n;let ie=!1;for(let pe=0,z=S.length-1;pe$!=P>$&&D<(p-O)*($-e)/(P-e)+O&&(ie=!ie)}return ie}function VH(n){const S=n.slice();return S.sort((D,$)=>D.x<$.x?-1:D.x>$.x?1:D.y<$.y?-1:D.y>$.y?1:0),GH(S)}function GH(n){if(n.length<=1)return n.slice();const S=[];for(let $=0;$=2;){const pe=S[S.length-1],z=S[S.length-2];if((pe.x-z.x)*(ie.y-z.y)>=(pe.y-z.y)*(ie.x-z.x))S.pop();else break}S.push(ie)}S.pop();const D=[];for(let $=n.length-1;$>=0;$--){const ie=n[$];for(;D.length>=2;){const pe=D[D.length-1],z=D[D.length-2];if((pe.x-z.x)*(ie.y-z.y)>=(pe.y-z.y)*(ie.x-z.x))D.pop();else break}D.push(ie)}return D.pop(),S.length===1&&D.length===1&&S[0].x===D[0].x&&S[0].y===D[0].y?S:S.concat(D)}const WH=LH,$H=_H,jH=DH,zP=FH,YH=WH,ZH=$H,XH=jH,NP=ht.forwardRef(({className:n,sideOffset:S=4,...D},$)=>qt.jsx(zP,{ref:$,sideOffset:S,className:Ni("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...D}));NP.displayName=zP.displayName;function KH({children:n,tooltip:S,asChild:D=!1}){return qt.jsxs(ZH,{children:[qt.jsx(XH,{className:"flex-shrink-0",asChild:D,children:n}),qt.jsx(NP,{children:qt.jsx("p",{className:"max-w-[200px]",children:S})})]})}function JH(){const n=Hm();return gS().length===0?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Embeddings"})}):n.type==="uninitialized"?qt.jsx(MH,{}):n.type==="fetchingEmbeddings"?qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("div",{className:"p-2 w-full flex flex-col justify-center items-center",children:[qt.jsx("p",{className:"py-2 text-slate-300",children:"Fetching precomputed embeddings..."}),qt.jsx(qF,{className:"animate-spin"})]})]}):n.type==="embeddingProgress"?qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl",children:"Pretraining"}),qt.jsxs("div",{className:"p-2",children:[qt.jsxs("p",{className:"py-2 text-slate-300",children:["embedding & caching (",Math.round(n.progress*100),"%)..."]}),qt.jsx(yS,{value:n.progress*100})]})]}):qt.jsxs("div",{className:Zh,children:[qt.jsxs("div",{className:"flex flex-row justify-between",children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Pretraining"}),qt.jsx(KH,{tooltip:"Download all embeddings",asChild:!0,children:qt.jsx(ds,{variant:"ghost",onClick:n.downloadEmbeddings,"aria-label":"Download all embeddings",children:qt.jsx(Y4,{size:14})})})]}),qt.jsxs("div",{children:[qt.jsxs("div",{className:"py-3",children:[qt.jsxs("p",{className:"text-slate-300 text-l",children:["The test set has"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.testCosinePairings.length})," ","pairs and the train set has"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.trainCosinePairings.length})," ","pairs."]}),qt.jsxs("p",{className:"text-slate-300 text-l",children:["Before training, the test set performance is"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.testAccuracyAndSE.message})," ","and the train set performance is"," ",qt.jsx("span",{className:"text-white",children:n.pretrainingPerformance.trainAccuracyAndSE.message}),"."]}),qt.jsx("p",{className:"text-slate-300 text-l",children:"Ideally, a red peak will be on the left and a blue peak will be on the right, non-overlapping."})]}),qt.jsx("div",{children:qt.jsx(TP,{trainPairings:n.pretrainingPerformance.trainCosinePairings,testPairings:n.pretrainingPerformance.testCosinePairings})})]})]})}function QH(){const n=Hm(),S=ht.useCallback(()=>{if(n.type==="doneTraining"){const D=new Blob([n.bestMatrix.matrixNpy],{type:"application/octet-stream"}),$=document.createElement("a"),ie=window.URL.createObjectURL(D);$.href=ie,$.download="spaceshifted.npy",$.click(),URL.revokeObjectURL(ie),$.remove()}},[n]);return n.type!=="doneTraining"?qt.jsx("div",{className:Zh+" opacity-50",children:qt.jsx("h1",{className:"text-2xl",children:"Matrix"})}):qt.jsxs("div",{className:Zh,children:[qt.jsx("h1",{className:"text-2xl mb-3",children:"Matrix"}),qt.jsxs("div",{children:[qt.jsxs("div",{children:[qt.jsxs("p",{className:"text-slate-300",children:["We trained a ",qt.jsx("span",{className:"text-white",children:"bias matrix"})," of size"," ",qt.jsxs("span",{className:"text-white",children:["(",n.bestMatrix.shape[0],", ",n.bestMatrix.shape[1],")"]}),"."]}),qt.jsxs("p",{className:"text-slate-300",children:["You can multiply it with vectors of size"," ",qt.jsx("span",{className:"text-white",children:n.bestMatrix.shape[0]})," to get ",qt.jsx("span",{className:"text-purple-200",children:"Spaceshifted"})," vectors of size"," ",qt.jsx("span",{className:"text-white",children:n.bestMatrix.shape[1]}),"."]})]}),qt.jsxs("div",{className:"flex flex-row flex-wrap my-3",children:[qt.jsxs("div",{children:[qt.jsx("h2",{className:"text-xl my-2",children:"Usage"}),qt.jsxs("div",{className:"max-w-[500px] min-w-[200px] py-3 px-4 mt-1 text-left text-sm bg-slate-900 rounded-md border border-slate-500 font-mono inline-block",children:[qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-blue-300",children:"import"})," ",qt.jsx("span",{className:"text-red-300",children:"numpy"})," ",qt.jsx("span",{className:"text-blue-300",children:"as"})," ",qt.jsx("span",{className:"text-yellow-300",children:"np"})]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ="," ",qt.jsx("span",{className:"text-yellow-300",children:"np"}),".",qt.jsx("span",{className:"text-blue-300",children:"load"}),"(",qt.jsx("span",{className:"text-red-300",children:'"spaceshifted.npy"'}),","," ",qt.jsx("span",{className:"text-blue-300",children:"allow_pickle"}),"=",qt.jsx("span",{className:"text-green-300",children:"True"}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"v"})," ="," ",qt.jsxs("span",{className:"text-gray-300",children:["# vector of size (",n.bestMatrix.shape[0],",)"]})]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"v"})]})]})]}),qt.jsx("div",{className:"flex justify-center items-center flex-1 my-4",children:qt.jsxs(ds,{onClick:S,children:[qt.jsx(Y4,{size:20,className:"mr-2"})," ",qt.jsx("span",{className:"whitespace-nowrap",children:"download matrix"})," ",qt.jsx("span",{className:"font-mono ml-1",children:"spaceshifted.npy"})]})})]})]})]})}function qH(){const[n,S]=Gp(qh),D=Vm.useLiveQuery(async()=>{if(n.type==="local"){const pe=await Th.dataset.get(n.id);return pe==null?void 0:pe.name}else if(n.type==="example")return n.name},[n]),{toast:$}=Sg(),ie=ht.useCallback(async()=>{if(n.type==="local"){const{dismiss:pe}=$({title:"Deleting dataset..."});await Th.deleteDataset(n.id),pe(),S({type:"none"})}},[n,S,$]);return D?qt.jsxs("div",{children:[qt.jsxs("div",{className:"flex flex-row justify-between",children:[qt.jsxs("h1",{className:"text-3xl",children:[qt.jsx("span",{className:"text-slate-500 text-2xl button cursor-pointer",onClick:()=>S({type:"none"}),children:"projects/"}),D]}),qt.jsx("div",{children:n.type==="local"&&qt.jsxs(dg,{children:[qt.jsx(vg,{children:qt.jsx(nO,{size:15,className:"opacity-50"})}),qt.jsxs(Yp,{children:[qt.jsx(Zp,{children:qt.jsxs(Eb,{className:"text-white",children:["Delete ",D,"?"]})}),qt.jsxs(pS,{children:[qt.jsx(ds,{variant:"destructive",onClick:ie,children:"Delete"}),qt.jsx(J9,{asChild:!0,children:qt.jsx(ds,{variant:"outline",type:"submit",className:"text-white",children:"Cancel"})})]})]})]})})]}),qt.jsx(wU,{}),qt.jsx(JH,{}),qt.jsx(AH,{}),qt.jsx(QH,{})]}):qt.jsx("div",{children:"loading..."})}const BP="ToastProvider",[MS,eV,tV]=bb("Toast"),[UP,QV]=Bc("Toast",[tV]),[rV,Ob]=UP(BP),HP=n=>{const{__scopeToast:S,label:D="Notification",duration:$=5e3,swipeDirection:ie="right",swipeThreshold:pe=50,children:z}=n,[O,e]=ht.useState(null),[p,P]=ht.useState(0),a=ht.useRef(!1),C=ht.useRef(!1);return ht.createElement(MS.Provider,{scope:S},ht.createElement(rV,{scope:S,label:D,duration:$,swipeDirection:ie,swipeThreshold:pe,toastCount:p,viewport:O,onViewportChange:e,onToastAdd:ht.useCallback(()=>P(x=>x+1),[]),onToastRemove:ht.useCallback(()=>P(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:a,isClosePausedRef:C},z))};HP.propTypes={label(n){if(n.label&&typeof n.label=="string"&&!n.label.trim()){const S=`Invalid prop \`label\` supplied to \`${BP}\`. Expected non-empty \`string\`.`;return new Error(S)}return null}};const nV="ToastViewport",aV=["F8"],RA="toast.viewportPause",_A="toast.viewportResume",iV=ht.forwardRef((n,S)=>{const{__scopeToast:D,hotkey:$=aV,label:ie="Notifications ({hotkey})",...pe}=n,z=Ob(nV,D),O=eV(D),e=ht.useRef(null),p=ht.useRef(null),P=ht.useRef(null),a=ht.useRef(null),C=so(S,a,z.onViewportChange),x=$.join("+").replace(/Key/g,"").replace(/Digit/g,""),d=z.toastCount>0;ht.useEffect(()=>{const t=r=>{var o;$.every(u=>r[u]||r.code===u)&&((o=a.current)===null||o===void 0||o.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[$]),ht.useEffect(()=>{const t=e.current,r=a.current;if(d&&t&&r){const o=()=>{if(!z.isClosePausedRef.current){const c=new CustomEvent(RA);r.dispatchEvent(c),z.isClosePausedRef.current=!0}},i=()=>{if(z.isClosePausedRef.current){const c=new CustomEvent(_A);r.dispatchEvent(c),z.isClosePausedRef.current=!1}},u=c=>{!t.contains(c.relatedTarget)&&i()},h=()=>{t.contains(document.activeElement)||i()};return t.addEventListener("focusin",o),t.addEventListener("focusout",u),t.addEventListener("pointermove",o),t.addEventListener("pointerleave",h),window.addEventListener("blur",o),window.addEventListener("focus",i),()=>{t.removeEventListener("focusin",o),t.removeEventListener("focusout",u),t.removeEventListener("pointermove",o),t.removeEventListener("pointerleave",h),window.removeEventListener("blur",o),window.removeEventListener("focus",i)}}},[d,z.isClosePausedRef]);const g=ht.useCallback(({tabbingDirection:t})=>{const o=O().map(i=>{const u=i.ref.current,h=[u,...wV(u)];return t==="forwards"?h:h.reverse()});return(t==="forwards"?o.reverse():o).flat()},[O]);return ht.useEffect(()=>{const t=a.current;if(t){const r=o=>{const i=o.altKey||o.ctrlKey||o.metaKey;if(o.key==="Tab"&&!i){const f=document.activeElement,m=o.shiftKey;if(o.target===t&&m){var h;(h=p.current)===null||h===void 0||h.focus();return}const y=g({tabbingDirection:m?"backwards":"forwards"}),E=y.findIndex(A=>A===f);if(FT(y.slice(E+1)))o.preventDefault();else{var c,b;m?(c=p.current)===null||c===void 0||c.focus():(b=P.current)===null||b===void 0||b.focus()}}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}},[O,g]),ht.createElement(hO,{ref:e,role:"region","aria-label":ie.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:d?void 0:"none"}},d&&ht.createElement(JE,{ref:p,onFocusFromOutsideViewport:()=>{const t=g({tabbingDirection:"forwards"});FT(t)}}),ht.createElement(MS.Slot,{scope:D},ht.createElement(Ci.ol,ga({tabIndex:-1},pe,{ref:C}))),d&&ht.createElement(JE,{ref:P,onFocusFromOutsideViewport:()=>{const t=g({tabbingDirection:"backwards"});FT(t)}}))}),oV="ToastFocusProxy",JE=ht.forwardRef((n,S)=>{const{__scopeToast:D,onFocusFromOutsideViewport:$,...ie}=n,pe=Ob(oV,D);return ht.createElement(Rb,ga({"aria-hidden":!0,tabIndex:0},ie,{ref:S,style:{position:"fixed"},onFocus:z=>{var O;const e=z.relatedTarget;!((O=pe.viewport)!==null&&O!==void 0&&O.contains(e))&&$()}}))}),zb="Toast",sV="toast.swipeStart",lV="toast.swipeMove",uV="toast.swipeCancel",fV="toast.swipeEnd",cV=ht.forwardRef((n,S)=>{const{forceMount:D,open:$,defaultOpen:ie,onOpenChange:pe,...z}=n,[O=!0,e]=Xv({prop:$,defaultProp:ie,onChange:pe});return ht.createElement(Mf,{present:D||O},ht.createElement(VP,ga({open:O},z,{ref:S,onClose:()=>e(!1),onPause:Ns(n.onPause),onResume:Ns(n.onResume),onSwipeStart:Ja(n.onSwipeStart,p=>{p.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ja(n.onSwipeMove,p=>{const{x:P,y:a}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","move"),p.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${P}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${a}px`)}),onSwipeCancel:Ja(n.onSwipeCancel,p=>{p.currentTarget.setAttribute("data-swipe","cancel"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ja(n.onSwipeEnd,p=>{const{x:P,y:a}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","end"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${P}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${a}px`),e(!1)})})))}),[hV,dV]=UP(zb,{onClose(){}}),VP=ht.forwardRef((n,S)=>{const{__scopeToast:D,type:$="foreground",duration:ie,open:pe,onClose:z,onEscapeKeyDown:O,onPause:e,onResume:p,onSwipeStart:P,onSwipeMove:a,onSwipeCancel:C,onSwipeEnd:x,...d}=n,g=Ob(zb,D),[t,r]=ht.useState(null),o=so(S,A=>r(A)),i=ht.useRef(null),u=ht.useRef(null),h=ie||g.duration,c=ht.useRef(0),b=ht.useRef(h),f=ht.useRef(0),{onToastAdd:m,onToastRemove:v}=g,l=Ns(()=>{var A;(t==null?void 0:t.contains(document.activeElement))&&((A=g.viewport)===null||A===void 0||A.focus()),z()}),y=ht.useCallback(A=>{!A||A===1/0||(window.clearTimeout(f.current),c.current=new Date().getTime(),f.current=window.setTimeout(l,A))},[l]);ht.useEffect(()=>{const A=g.viewport;if(A){const R=()=>{y(b.current),p==null||p()},w=()=>{const L=new Date().getTime()-c.current;b.current=b.current-L,window.clearTimeout(f.current),e==null||e()};return A.addEventListener(RA,w),A.addEventListener(_A,R),()=>{A.removeEventListener(RA,w),A.removeEventListener(_A,R)}}},[g.viewport,h,e,p,y]),ht.useEffect(()=>{pe&&!g.isClosePausedRef.current&&y(h)},[pe,h,g.isClosePausedRef,y]),ht.useEffect(()=>(m(),()=>v()),[m,v]);const E=ht.useMemo(()=>t?jP(t):null,[t]);return g.viewport?ht.createElement(ht.Fragment,null,E&&ht.createElement(vV,{__scopeToast:D,role:"status","aria-live":$==="foreground"?"assertive":"polite","aria-atomic":!0},E),ht.createElement(hV,{scope:D,onClose:l},rp.createPortal(ht.createElement(MS.ItemSlot,{scope:D},ht.createElement(cO,{asChild:!0,onEscapeKeyDown:Ja(O,()=>{g.isFocusedToastEscapeKeyDownRef.current||l(),g.isFocusedToastEscapeKeyDownRef.current=!1})},ht.createElement(Ci.li,ga({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":pe?"open":"closed","data-swipe-direction":g.swipeDirection},d,{ref:o,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:Ja(n.onKeyDown,A=>{A.key==="Escape"&&(O==null||O(A.nativeEvent),A.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,l()))}),onPointerDown:Ja(n.onPointerDown,A=>{A.button===0&&(i.current={x:A.clientX,y:A.clientY})}),onPointerMove:Ja(n.onPointerMove,A=>{if(!i.current)return;const R=A.clientX-i.current.x,w=A.clientY-i.current.y,L=!!u.current,M=["left","right"].includes(g.swipeDirection),s=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,_=M?s(0,R):0,T=M?0:s(0,w),B=A.pointerType==="touch"?10:2,F={x:_,y:T},W={originalEvent:A,delta:F};L?(u.current=F,Rx(lV,a,W,{discrete:!1})):QE(F,g.swipeDirection,B)?(u.current=F,Rx(sV,P,W,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(R)>B||Math.abs(w)>B)&&(i.current=null)}),onPointerUp:Ja(n.onPointerUp,A=>{const R=u.current,w=A.target;if(w.hasPointerCapture(A.pointerId)&&w.releasePointerCapture(A.pointerId),u.current=null,i.current=null,R){const L=A.currentTarget,M={originalEvent:A,delta:R};QE(R,g.swipeDirection,g.swipeThreshold)?Rx(fV,x,M,{discrete:!0}):Rx(uV,C,M,{discrete:!0}),L.addEventListener("click",s=>s.preventDefault(),{once:!0})}})})))),g.viewport))):null});VP.propTypes={type(n){if(n.type&&!["foreground","background"].includes(n.type)){const S=`Invalid prop \`type\` supplied to \`${zb}\`. Expected \`foreground | background\`.`;return new Error(S)}return null}};const vV=n=>{const{__scopeToast:S,children:D,...$}=n,ie=Ob(zb,S),[pe,z]=ht.useState(!1),[O,e]=ht.useState(!1);return xV(()=>z(!0)),ht.useEffect(()=>{const p=window.setTimeout(()=>e(!0),1e3);return()=>window.clearTimeout(p)},[]),O?null:ht.createElement(Ab,{asChild:!0},ht.createElement(Rb,$,pe&&ht.createElement(ht.Fragment,null,ie.label," ",D)))},pV=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n;return ht.createElement(Ci.div,ga({},$,{ref:S}))}),gV=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n;return ht.createElement(Ci.div,ga({},$,{ref:S}))}),yV="ToastAction",GP=ht.forwardRef((n,S)=>{const{altText:D,...$}=n;return D?ht.createElement($P,{altText:D,asChild:!0},ht.createElement(WP,ga({},$,{ref:S}))):null});GP.propTypes={altText(n){return n.altText?null:new Error(`Missing prop \`altText\` expected on \`${yV}\``)}};const mV="ToastClose",WP=ht.forwardRef((n,S)=>{const{__scopeToast:D,...$}=n,ie=dV(mV,D);return ht.createElement($P,{asChild:!0},ht.createElement(Ci.button,ga({type:"button"},$,{ref:S,onClick:Ja(n.onClick,ie.onClose)})))}),$P=ht.forwardRef((n,S)=>{const{__scopeToast:D,altText:$,...ie}=n;return ht.createElement(Ci.div,ga({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":$||void 0},ie,{ref:S}))});function jP(n){const S=[];return Array.from(n.childNodes).forEach($=>{if($.nodeType===$.TEXT_NODE&&$.textContent&&S.push($.textContent),bV($)){const ie=$.ariaHidden||$.hidden||$.style.display==="none",pe=$.dataset.radixToastAnnounceExclude==="";if(!ie)if(pe){const z=$.dataset.radixToastAnnounceAlt;z&&S.push(z)}else S.push(...jP($))}}),S}function Rx(n,S,D,{discrete:$}){const ie=D.originalEvent.currentTarget,pe=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:D});S&&ie.addEventListener(n,S,{once:!0}),$?$4(ie,pe):ie.dispatchEvent(pe)}const QE=(n,S,D=0)=>{const $=Math.abs(n.x),ie=Math.abs(n.y),pe=$>ie;return S==="left"||S==="right"?pe&&$>D:!pe&&ie>D};function xV(n=()=>{}){const S=Ns(n);ic(()=>{let D=0,$=0;return D=window.requestAnimationFrame(()=>$=window.requestAnimationFrame(S)),()=>{window.cancelAnimationFrame(D),window.cancelAnimationFrame($)}},[S])}function bV(n){return n.nodeType===n.ELEMENT_NODE}function wV(n){const S=[],D=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:$=>{const ie=$.tagName==="INPUT"&&$.type==="hidden";return $.disabled||$.hidden||ie?NodeFilter.FILTER_SKIP:$.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;D.nextNode();)S.push(D.currentNode);return S}function FT(n){const S=document.activeElement;return n.some(D=>D===S?!0:(D.focus(),document.activeElement!==S))}const TV=HP,YP=iV,ZP=cV,XP=pV,KP=gV,JP=GP,QP=WP,AV=TV,qP=ht.forwardRef(({className:n,...S},D)=>qt.jsx(YP,{ref:D,className:Ni("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...S}));qP.displayName=YP.displayName;const SV=B4("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),eL=ht.forwardRef(({className:n,variant:S,...D},$)=>qt.jsx(ZP,{ref:$,className:Ni(SV({variant:S}),n),...D}));eL.displayName=ZP.displayName;const MV=ht.forwardRef(({className:n,...S},D)=>qt.jsx(JP,{ref:D,className:Ni("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...S}));MV.displayName=JP.displayName;const tL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(QP,{ref:D,className:Ni("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...S,children:qt.jsx(G9,{className:"h-4 w-4"})}));tL.displayName=QP.displayName;const rL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(XP,{ref:D,className:Ni("text-sm font-semibold [&+div]:text-xs",n),...S}));rL.displayName=XP.displayName;const nL=ht.forwardRef(({className:n,...S},D)=>qt.jsx(KP,{ref:D,className:Ni("text-sm opacity-90",n),...S}));nL.displayName=KP.displayName;function EV(){const{toasts:n}=Sg();return qt.jsxs(AV,{duration:3e3,children:[n.map(function({id:S,title:D,description:$,action:ie,...pe}){return qt.jsxs(eL,{...pe,children:[qt.jsxs("div",{className:"grid gap-1",children:[D&&qt.jsx(rL,{children:D}),$&&qt.jsx(nL,{children:$})]}),ie,qt.jsx(tL,{})]},S)}),qt.jsx(qP,{})]})}function CV(){return qt.jsxs("div",{className:"p-5 mx-auto max-w-6xl text-center",children:[qt.jsx("h1",{className:"text-5xl font-bold from-purple-100 bg-gradient-to-b to-purple-400 text-transparent bg-clip-text inline-block p-3",children:"Finetune your embeddings"}),qt.jsxs("p",{className:"text-2xl text-slate-200 mt-2",children:["Boost your OpenAI embeddings with a"," ",qt.jsx("span",{className:"font-medium text-slate-100",children:"simple matmul"})," trained ",qt.jsx("span",{className:"font-medium text-slate-100",children:"in your browser"})]}),qt.jsxs("div",{className:"mx-auto py-3 px-4 mt-5 text-left text-sm bg-slate-900 rounded-md border border-slate-500 font-mono inline-block",children:[qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"M"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"np.load"}),"(",qt.jsx("span",{className:"text-red-300",children:'"spaceshifted.npy"'}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"u"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"get_embedding"}),"(",qt.jsx("span",{className:"text-red-300",children:`"What's the capital of Peru?"`}),")"]}),qt.jsxs("span",{className:"block",children:[qt.jsx("span",{className:"text-yellow-300",children:"v"})," ="," ",qt.jsx("span",{className:"text-blue-300",children:"get_embedding"}),"(",qt.jsx("span",{className:"text-red-300",children:'"Lima."'}),")"]}),qt.jsx("br",{}),qt.jsx("span",{className:"block",children:"("}),qt.jsxs("span",{className:"block ml-2",children:[qt.jsx("span",{className:"text-blue-300",children:"cosine_similarity"}),"(",qt.jsx("span",{className:"text-yellow-300",children:"u"}),","," ",qt.jsx("span",{className:"text-yellow-300",children:"v"}),"),"," ",qt.jsx("span",{className:"text-gray-300",children:"# far apart"})]}),qt.jsxs("span",{className:"block ml-2",children:[qt.jsx("span",{className:"text-blue-300",children:"cosine_similarity"}),"(",qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"u"}),","," ",qt.jsx("span",{className:"text-yellow-300",children:"M"})," ",qt.jsx("span",{className:"text-purple-300",children:"@"})," ",qt.jsx("span",{className:"text-yellow-300",children:"v"}),")"," ",qt.jsx("span",{className:"text-gray-300",children:"# closer together!"})]}),qt.jsx("span",{className:"block",children:")"})]}),qt.jsxs("div",{children:[qt.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"(illustration only)"}),qt.jsx("p",{className:"text-xl text-slate-300 mt-2",children:"Improve your RAG without leaving this page."})]})]})}const PV={theme:"system",setTheme:()=>null},LV=ht.createContext(PV);function RV({children:n,defaultTheme:S="system",storageKey:D="vite-ui-theme",...$}){const[ie,pe]=ht.useState(()=>localStorage.getItem(D)||S);ht.useEffect(()=>{const O=window.document.documentElement;if(O.classList.remove("light","dark"),ie==="system"){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";O.classList.add(e);return}O.classList.add(ie)},[ie]);const z={theme:ie,setTheme:O=>{localStorage.setItem(D,O),pe(O)}};return qt.jsx(LV.Provider,{...$,value:z,children:n})}function r2({name:n,locator:S}){const D=cb(qh),{toast:$}=Sg(),ie=ht.useCallback(async()=>{if(S.type==="example"){const{dismiss:pe}=$({title:"Loading example..."}),O=await(await fetch(S.datasetURL)).json();D({type:"example",embeddingsURL:S.embeddingsURL,name:S.name,pairings:O}),pe()}else D({type:"local",id:S.id})},[D,S,$]);return qt.jsx("div",{className:"mt-2",children:qt.jsxs(ds,{variant:"outline",className:"w-full text-left justify-between text-l font-bold",onClick:ie,children:[qt.jsx("div",{children:n}),qt.jsx(QF,{className:"h-4 w-4"})]})})}function _V(){return qt.jsxs("div",{className:dC,children:[qt.jsxs("div",{children:[qt.jsx("h1",{className:"text-xl font-bold mb-2",children:"Example Datasets"}),qt.jsx("hr",{className:"border-0.5 border-slate-700"})]}),qt.jsxs("div",{className:"py-2",children:[qt.jsx(r2,{name:"City Facts JSON",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/33434e8ee941a47e921f6c5b78566d1b/raw/d76524287bcf2446ebd0f290c97090003d184ce8/cities_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/e411a7c77b7af9c81844bb1fbcf9e117/raw/2b897bdc58433d78254de6982140945698eb74bf/cities_embeddings.json",name:"City Facts JSON"}}),qt.jsx(r2,{name:"MNLI Logical Entailment",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/42dd79326c56c1260def996f2f3a26e7/raw/0260dd24e28a171513f86756a3ac0470b4cef8f6/mnli_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/42dd79326c56c1260def996f2f3a26e7/raw/0260dd24e28a171513f86756a3ac0470b4cef8f6/mnli_embeddings.json",name:"MNLI Logical Entailment"}}),qt.jsx(r2,{name:"StackOverflow Title and Question SQL",locator:{type:"example",datasetURL:"https://gistcdn.githack.com/maxkrieger/92e177867627e85e75b40c3733fd9ceb/raw/3cee4ff498b71ac8371e2c71bbae9df34fae958e/sql_dataset.json",embeddingsURL:"https://gistcdn.githack.com/maxkrieger/92e177867627e85e75b40c3733fd9ceb/raw/3cee4ff498b71ac8371e2c71bbae9df34fae958e/sql_embeddings.json",name:"StackOverflow Title and Question SQL"}})]})]})}function DV(){const[n,S]=Gp(hb),[D,$]=ht.useState(""),[ie,pe]=ht.useState(null),[z,O]=ht.useState(!1),{toast:e}=Sg(),p=ht.useCallback(()=>{navigator.clipboard.readText().then(a=>{$(a)})},[$]);ht.useEffect(()=>{n!==null&&$(n)},[$,n]);const P=ht.useCallback(async()=>{O(!0);try{const a=await fetch("https://api.openai.com/v1/models",{method:"GET",headers:{Authorization:`Bearer ${D}`}});a.status===200?(pe(null),S(D),e({title:"API Key has been set"})):(pe(`API Key is invalid: ${a.status}`),e({title:"Could not use API key",description:`Error code ${a.status}`,variant:"destructive"}))}catch(a){pe(a.toString())}O(!1)},[S,D,e]);return qt.jsxs(dg,{children:[qt.jsx(vg,{asChild:!0,children:qt.jsx(ds,{children:"Set API Key"})}),qt.jsxs(Yp,{className:"sm:max-w-[425px]",children:[qt.jsxs(Zp,{children:[qt.jsx(Eb,{className:"text-white",children:"Set API Key"}),qt.jsxs(nP,{children:["Get a secret key from"," ",qt.jsx("a",{className:"underline",href:"https://platform.openai.com/account/api-keys",target:"_blank",children:"the OpenAI API Keys page"})," ","and paste it here."," ",qt.jsx("span",{className:"text-slate-300",children:"It is stored locally and never shared with us."})]})]}),qt.jsxs("div",{children:[qt.jsxs("div",{className:"flex items-center",children:[qt.jsx(Qf,{id:"api-key",type:"text",value:D,placeholder:"API Key",className:"text-white",onChange:a=>$(a.target.value),onKeyDown:a=>a.key==="Enter"&&P()}),qt.jsx(ds,{className:"button text-white rounded-md px-2 py-1 m-2",onClick:P,disabled:z,children:z?"Verifying...":"Done"})]}),qt.jsxs("div",{children:[qt.jsx("button",{className:"button underline text-slate-500",onClick:p,children:"paste from clipboard"}),ie&&qt.jsx("p",{className:"text-red-500",children:ie})]})]})]})]})}function IV(){const[n,S]=ht.useState(""),D=cb(qh),$=ht.useCallback(async()=>{const ie=await Th.dataset.add({name:n,dateCreated:new Date,trainingParams:hP});D({type:"local",id:ie}),S("")},[n,D]);return qt.jsxs(dg,{children:[qt.jsx(vg,{asChild:!0,children:qt.jsx(ds,{className:"p-4 my-2 w-full",children:"New Dataset"})}),qt.jsxs(Yp,{className:"sm:max-w-[425px] text-white",children:[qt.jsx(Zp,{children:qt.jsx(Eb,{children:"Create Dataset"})}),qt.jsxs("div",{className:"flex flex-row gap-3",children:[qt.jsx(Qf,{type:"text",placeholder:"Dataset Name",value:n,onChange:ie=>S(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&$()}),qt.jsx(ds,{onClick:$,children:"Create"})]})]})]})}function kV(){const[n,S]=Gp(hb),D=Vm.useLiveQuery(async()=>await Th.dataset.toArray());return qt.jsxs("div",{className:dC,children:[qt.jsxs("div",{className:"flex flex-row justify-between items-center mb-2",children:[qt.jsx("h1",{className:"text-xl font-bold",children:"My Datasets"}),qt.jsxs(W9,{children:[qt.jsx($9,{children:qt.jsx(rO,{size:20,strokeWidth:1})}),qt.jsx(dS,{children:qt.jsx(j2,{onClick:()=>S(null),children:"Reset API Key"})})]})]}),qt.jsx("hr",{className:"border-0.5 border-slate-700"}),n===null?qt.jsxs("div",{className:"text-center m-5",children:[qt.jsx("h1",{className:"text-slate-300 text-xl m-2",children:"No API Key Set"}),qt.jsx(DV,{})]}):qt.jsxs("div",{children:[D===void 0||D.length===0?qt.jsx("div",{className:"text-center",children:qt.jsx("h2",{className:"text-slate-300 text-xl m-2",children:"No datasets yet"})}):U4.sortBy(D,$=>-$.dateCreated.getTime()).map($=>qt.jsx(r2,{name:$.name,locator:{type:"local",id:$.id}},$.id)),qt.jsx(IV,{})]})]})}function FV(){return qt.jsx(RV,{defaultTheme:"dark",children:qt.jsxs("div",{className:"mx-auto my-3 max-w-4xl flex flex-row justify-center flex-wrap",children:[qt.jsx(_V,{}),qt.jsx(kV,{})]})})}function OV(){return qt.jsxs("div",{children:[qt.jsx(CV,{}),qt.jsx(FV,{})]})}function zV(){const[n,S]=Gp(qh);return qt.jsx(YH,{children:qt.jsxs("div",{className:"p-5 text-white",children:[qt.jsx("button",{className:"button",onClick:()=>S({type:"none"}),children:qt.jsxs("div",{className:"flex flex-row align-center py-3 ",children:[qt.jsx("img",{src:nD,width:40}),qt.jsx("img",{className:"ml-2",src:rD,width:200,alt:"Spaceshifter"})]})}),n.type==="none"?qt.jsx(OV,{}):qt.jsx(qH,{}),qt.jsx(EV,{}),qt.jsx("footer",{className:"mt-[100px]",children:qt.jsxs("div",{className:"text-center text-sm text-slate-500",children:["adapted from the"," ",qt.jsx("a",{className:"underline",href:"https://github.com/openai/openai-cookbook/blob/main/examples/Customizing_embeddings.ipynb",target:"_blank",children:'"Customizing embeddings" cookbook'})," ","by OpenAI."," ",qt.jsx("a",{href:"https://github.com/maxkrieger/spaceshifter",target:"_blank",className:"underline",children:"View source on GitHub"})]})})]})})}MA.setLevel(MA.levels.WARN);OT.createRoot(document.getElementById("root")).render(qt.jsx(xf.StrictMode,{children:qt.jsx(zV,{})})); diff --git a/index.html b/index.html index 7911021..7bcb14f 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ content="https://a9.io/spaceshifter/card.png" /> Spaceshifter - +