1mpacto-react-ui 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var yI=Object.defineProperty;var xI=(e,t,n)=>t in e?yI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>xI(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),I=require("react"),cu=require("react-dom");function Kx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=Kx(I),qx=Kx(cu);function Lr(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ho(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Jx=6048e5,CI=864e5;let EI={};function Kd(){return EI}function go(e,t){var s,l,u,c;const n=Kd(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=Lr(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Zc(e){return go(e,{weekStartsOn:1})}function Qx(e){const t=Lr(e),n=t.getFullYear(),r=ho(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Zc(r),a=ho(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Zc(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function a1(e){const t=Lr(e);return t.setHours(0,0,0,0),t}function o1(e){const t=Lr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function SI(e,t){const n=a1(e),r=a1(t),i=+n-o1(n),a=+r-o1(r);return Math.round((i-a)/CI)}function wI(e){const t=Qx(e),n=ho(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Zc(n)}function II(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _I(e){if(!II(e)&&typeof e!="number")return!1;const t=Lr(e);return!isNaN(Number(t))}function DI(e){const t=Lr(e),n=ho(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const AI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},TI=(e,t,n)=>{let r;const i=AI[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Er(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const RI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$I={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kI={date:Er({formats:RI,defaultWidth:"full"}),time:Er({formats:BI,defaultWidth:"full"}),dateTime:Er({formats:$I,defaultWidth:"full"})},PI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},FI=(e,t,n,r)=>PI[e];function Ut(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const NI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},LI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},OI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},VI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},HI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jI=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},WI={ordinalNumber:jI,era:Ut({values:NI,defaultWidth:"wide"}),quarter:Ut({values:MI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:LI,defaultWidth:"wide"}),day:Ut({values:OI,defaultWidth:"wide"}),dayPeriod:Ut({values:VI,defaultWidth:"wide",formattingValues:HI,defaultFormattingWidth:"wide"})};function Xt(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?GI(s,d=>d.test(o)):zI(s,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function zI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function GI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qd(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const UI=/^(\d+)(th|st|nd|rd)?/i,XI=/\d+/i,ZI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},YI={any:[/^b/i,/^(a|c)/i]},KI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qI={any:[/1/i,/2/i,/3/i,/4/i]},JI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},QI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},e_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},t_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},n_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},r_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},i_={ordinalNumber:qd({matchPattern:UI,parsePattern:XI,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:ZI,defaultMatchWidth:"wide",parsePatterns:YI,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:KI,defaultMatchWidth:"wide",parsePatterns:qI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:JI,defaultMatchWidth:"wide",parsePatterns:QI,defaultParseWidth:"any"}),day:Xt({matchPatterns:e_,defaultMatchWidth:"wide",parsePatterns:t_,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:n_,defaultMatchWidth:"any",parsePatterns:r_,defaultParseWidth:"any"})},Yg={code:"en-US",formatDistance:TI,formatLong:kI,formatRelative:FI,localize:WI,match:i_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function a_(e){const t=Lr(e);return SI(t,DI(t))+1}function o_(e){const t=Lr(e),n=+Zc(t)-+wI(t);return Math.round(n/Jx)+1}function eC(e,t){var c,d,h,f;const n=Lr(e),r=n.getFullYear(),i=Kd(),a=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=ho(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const s=go(o,t),l=ho(e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const u=go(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function s_(e,t){var s,l,u,c;const n=Kd(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=eC(e,t),a=ho(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),go(a,t)}function l_(e,t){const n=Lr(e),r=+go(n,t)-+s_(n,t);return Math.round(r/Jx)+1}function gt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Gi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return gt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):gt(n+1,2)},d(e,t){return gt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return gt(e.getHours()%12||12,t.length)},H(e,t){return gt(e.getHours(),t.length)},m(e,t){return gt(e.getMinutes(),t.length)},s(e,t){return gt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return gt(i,t.length)}},Bo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},s1={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Gi.y(e,t)},Y:function(e,t,n,r){const i=eC(e,r),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return gt(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):gt(a,t.length)},R:function(e,t){const n=Qx(e);return gt(n,t.length)},u:function(e,t){const n=e.getFullYear();return gt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Gi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return gt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=l_(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},I:function(e,t,n){const r=o_(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):gt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Gi.d(e,t)},D:function(e,t,n){const r=a_(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return gt(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return gt(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return gt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Bo.noon:r===0?i=Bo.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Bo.evening:r>=12?i=Bo.afternoon:r>=4?i=Bo.morning:i=Bo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Gi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Gi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Gi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Gi.s(e,t)},S:function(e,t){return Gi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return u1(r);case"XXXX":case"XX":return Va(r);case"XXXXX":case"XXX":default:return Va(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return u1(r);case"xxxx":case"xx":return Va(r);case"xxxxx":case"xxx":default:return Va(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+l1(r,":");case"OOOO":default:return"GMT"+Va(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+l1(r,":");case"zzzz":default:return"GMT"+Va(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return gt(r,t.length)},T:function(e,t,n){const r=e.getTime();return gt(r,t.length)}};function l1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+gt(a,2)}function u1(e,t){return e%60===0?(e>0?"-":"+")+gt(Math.abs(e)/60,2):Va(e,t)}function Va(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=gt(Math.trunc(r/60),2),a=gt(r%60,2);return n+i+t+a}const c1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},tC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},u_=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return c1(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",c1(r,t)).replace("{{time}}",tC(i,t))},c_={p:tC,P:u_},d_=/^D+$/,f_=/^Y+$/,h_=["D","DD","YY","YYYY"];function g_(e){return d_.test(e)}function p_(e){return f_.test(e)}function m_(e,t,n){const r=b_(e,t,n);if(console.warn(r),h_.includes(e))throw new RangeError(r)}function b_(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const v_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x_=/^'([^]*?)'?$/,C_=/''/g,E_=/[a-zA-Z]/;function wl(e,t,n){var c,d,h,f,g,p,m,b;const r=Kd(),i=(n==null?void 0:n.locale)??r.locale??Yg,a=(n==null?void 0:n.firstWeekContainsDate)??((d=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((p=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((b=(m=r.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??0,s=Lr(e);if(!_I(s))throw new RangeError("Invalid time value");let l=t.match(y_).map(v=>{const x=v[0];if(x==="p"||x==="P"){const C=c_[x];return C(v,i.formatLong)}return v}).join("").match(v_).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const x=v[0];if(x==="'")return{isToken:!1,value:S_(v)};if(s1[x])return{isToken:!0,value:v};if(x.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(l=i.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return l.map(v=>{if(!v.isToken)return v.value;const x=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&p_(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&g_(x))&&m_(x,t,String(e));const C=s1[x[0]];return C(s,x,i.localize,u)}).join("")}function S_(e){const t=e.match(x_);return t?t[1].replace(C_,"'"):e}function w_(e,t,n){const r=go(e,n),i=go(t,n);return+r==+i}const I_={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},__=(e,t,n)=>{let r;const i=I_[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},D_={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},A_={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},T_={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},R_={date:Er({formats:D_,defaultWidth:"full"}),time:Er({formats:A_,defaultWidth:"full"}),dateTime:Er({formats:T_,defaultWidth:"full"})},B_={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},$_=(e,t,n,r)=>B_[e],k_={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},P_={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},F_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},N_={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},M_={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},L_={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},O_=(e,t)=>"ke-"+Number(e),V_={ordinalNumber:O_,era:Ut({values:k_,defaultWidth:"wide"}),quarter:Ut({values:P_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:F_,defaultWidth:"wide"}),day:Ut({values:N_,defaultWidth:"wide"}),dayPeriod:Ut({values:M_,defaultWidth:"wide",formattingValues:L_,defaultFormattingWidth:"wide"})},H_=/^ke-(\d+)?/i,j_=/\d+/i,W_={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},z_={any:[/^s/i,/^(m|e)/i]},G_={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},U_={any:[/1/i,/2/i,/3/i,/4/i]},X_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Z_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Y_={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},K_={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},q_={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},J_={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Q_={ordinalNumber:qd({matchPattern:H_,parsePattern:j_,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:z_,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:G_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:Xt({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:q_,defaultMatchWidth:"any",parsePatterns:J_,defaultParseWidth:"any"})},Yc={code:"id",formatDistance:__,formatLong:R_,formatRelative:$_,localize:V_,match:Q_,options:{weekStartsOn:1,firstWeekContainsDate:1}},eD={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},tD=(e,t,n)=>{let r;const i=eD[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"over "+r:r+" geleden":r},nD={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},rD={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},iD={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},aD={date:Er({formats:nD,defaultWidth:"full"}),time:Er({formats:rD,defaultWidth:"full"}),dateTime:Er({formats:iD,defaultWidth:"full"})},oD={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},sD=(e,t,n,r)=>oD[e],lD={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},uD={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},cD={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},dD={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},fD={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},hD=(e,t)=>Number(e)+"e",gD={ordinalNumber:hD,era:Ut({values:lD,defaultWidth:"wide"}),quarter:Ut({values:uD,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:cD,defaultWidth:"wide"}),day:Ut({values:dD,defaultWidth:"wide"}),dayPeriod:Ut({values:fD,defaultWidth:"wide"})},pD=/^(\d+)e?/i,mD=/\d+/i,bD={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},vD={any:[/^v/,/^n/]},yD={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},xD={any:[/1/i,/2/i,/3/i,/4/i]},CD={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},ED={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},SD={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},wD={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},ID={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},_D={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},DD={ordinalNumber:qd({matchPattern:pD,parsePattern:mD,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:bD,defaultMatchWidth:"wide",parsePatterns:vD,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:yD,defaultMatchWidth:"wide",parsePatterns:xD,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:CD,defaultMatchWidth:"wide",parsePatterns:ED,defaultParseWidth:"any"}),day:Xt({matchPatterns:SD,defaultMatchWidth:"wide",parsePatterns:wD,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:ID,defaultMatchWidth:"any",parsePatterns:_D,defaultParseWidth:"any"})},nC={code:"nl",formatDistance:tD,formatLong:aD,formatRelative:sD,localize:gD,match:DD,options:{weekStartsOn:1,firstWeekContainsDate:4}},AD={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},TD=(e,t,n)=>{let r;const i=AD[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},RD={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},BD={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},$D={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},kD={date:Er({formats:RD,defaultWidth:"full"}),time:Er({formats:BD,defaultWidth:"full"}),dateTime:Er({formats:$D,defaultWidth:"full"})};function d1(e,t,n){const r="eeee p";return w_(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const PD={lastWeek:d1,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:d1,other:"PP p"},FD=(e,t,n,r)=>{const i=PD[e];return typeof i=="function"?i(t,n,r):i},ND={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},MD={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},LD={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},OD={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},VD={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},HD={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},jD=(e,t)=>{const n=Number(e);switch(t==null?void 0:t.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},WD={ordinalNumber:jD,era:Ut({values:ND,defaultWidth:"wide"}),quarter:Ut({values:MD,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:LD,defaultWidth:"wide"}),day:Ut({values:OD,defaultWidth:"wide"}),dayPeriod:Ut({values:VD,defaultWidth:"wide",formattingValues:HD,defaultFormattingWidth:"wide"})},zD=/^(第\s*)?\d+(日|时|分|秒)?/i,GD=/\d+/i,UD={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},XD={any:[/^(前)/i,/^(公元)/i]},ZD={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},YD={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},KD={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},qD={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},JD={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},QD={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},e6={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},t6={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},n6={ordinalNumber:qd({matchPattern:zD,parsePattern:GD,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:UD,defaultMatchWidth:"wide",parsePatterns:XD,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:ZD,defaultMatchWidth:"wide",parsePatterns:YD,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:KD,defaultMatchWidth:"wide",parsePatterns:qD,defaultParseWidth:"any"}),day:Xt({matchPatterns:JD,defaultMatchWidth:"wide",parsePatterns:QD,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:e6,defaultMatchWidth:"any",parsePatterns:t6,defaultParseWidth:"any"})},rC={code:"zh-CN",formatDistance:TD,formatLong:kD,formatRelative:FD,localize:WD,match:n6,options:{weekStartsOn:1,firstWeekContainsDate:4}};var r6=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Uf=Math.ceil,cr=Math.floor,Pn="[BigNumber Error] ",f1=Pn+"Number primitive has more than 15 significant digits: ",_r=1e14,Le=14,h1=9007199254740991,Xf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ui=1e7,Un=1e9;function iC(e){var t,n,r,i=v.prototype={constructor:v,toString:null,valueOf:null},a=new v(1),o=20,s=4,l=-7,u=21,c=-1e7,d=1e7,h=!1,f=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function v(y,S){var D,A,T,F,k,P,$,R,O=this;if(!(O instanceof v))return new v(y,S);if(S==null){if(y&&y._isBigNumber===!0){O.s=y.s,!y.c||y.e>d?O.c=O.e=null:y.e<c?O.c=[O.e=0]:(O.e=y.e,O.c=y.c.slice());return}if((P=typeof y=="number")&&y*0==0){if(O.s=1/y<0?(y=-y,-1):1,y===~~y){for(F=0,k=y;k>=10;k/=10,F++);F>d?O.c=O.e=null:(O.e=F,O.c=[y]);return}R=String(y)}else{if(!r6.test(R=String(y)))return r(O,R,P);O.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(F=R.indexOf("."))>-1&&(R=R.replace(".","")),(k=R.search(/e/i))>0?(F<0&&(F=k),F+=+R.slice(k+1),R=R.substring(0,k)):F<0&&(F=R.length)}else{if(Tt(S,2,m.length,"Base"),S==10&&b)return O=new v(y),w(O,o+O.e+1,s);if(R=String(y),P=typeof y=="number"){if(y*0!=0)return r(O,R,P,S);if(O.s=1/y<0?(R=R.slice(1),-1):1,v.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(f1+y)}else O.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(D=m.slice(0,S),F=k=0,$=R.length;k<$;k++)if(D.indexOf(A=R.charAt(k))<0){if(A=="."){if(k>F){F=$;continue}}else if(!T&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){T=!0,k=-1,F=0;continue}return r(O,String(y),P,S)}P=!1,R=n(R,S,10,O.s),(F=R.indexOf("."))>-1?R=R.replace(".",""):F=R.length}for(k=0;R.charCodeAt(k)===48;k++);for($=R.length;R.charCodeAt(--$)===48;);if(R=R.slice(k,++$)){if($-=k,P&&v.DEBUG&&$>15&&(y>h1||y!==cr(y)))throw Error(f1+O.s*y);if((F=F-k-1)>d)O.c=O.e=null;else if(F<c)O.c=[O.e=0];else{if(O.e=F,O.c=[],k=(F+1)%Le,F<0&&(k+=Le),k<$){for(k&&O.c.push(+R.slice(0,k)),$-=Le;k<$;)O.c.push(+R.slice(k,k+=Le));k=Le-(R=R.slice(k)).length}else k-=$;for(;k--;R+="0");O.c.push(+R)}}else O.c=[O.e=0]}v.clone=iC,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(y){var S,D;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(S="DECIMAL_PLACES")&&(D=y[S],Tt(D,0,Un,S),o=D),y.hasOwnProperty(S="ROUNDING_MODE")&&(D=y[S],Tt(D,0,8,S),s=D),y.hasOwnProperty(S="EXPONENTIAL_AT")&&(D=y[S],D&&D.pop?(Tt(D[0],-1e9,0,S),Tt(D[1],0,Un,S),l=D[0],u=D[1]):(Tt(D,-1e9,Un,S),l=-(u=D<0?-D:D))),y.hasOwnProperty(S="RANGE"))if(D=y[S],D&&D.pop)Tt(D[0],-1e9,-1,S),Tt(D[1],1,Un,S),c=D[0],d=D[1];else if(Tt(D,-1e9,Un,S),D)c=-(d=D<0?-D:D);else throw Error(Pn+S+" cannot be zero: "+D);if(y.hasOwnProperty(S="CRYPTO"))if(D=y[S],D===!!D)if(D)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=D;else throw h=!D,Error(Pn+"crypto unavailable");else h=D;else throw Error(Pn+S+" not true or false: "+D);if(y.hasOwnProperty(S="MODULO_MODE")&&(D=y[S],Tt(D,0,9,S),f=D),y.hasOwnProperty(S="POW_PRECISION")&&(D=y[S],Tt(D,0,Un,S),g=D),y.hasOwnProperty(S="FORMAT"))if(D=y[S],typeof D=="object")p=D;else throw Error(Pn+S+" not an object: "+D);if(y.hasOwnProperty(S="ALPHABET"))if(D=y[S],typeof D=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(D))b=D.slice(0,10)=="0123456789",m=D;else throw Error(Pn+S+" invalid: "+D)}else throw Error(Pn+"Object expected: "+y);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,u],RANGE:[c,d],CRYPTO:h,MODULO_MODE:f,POW_PRECISION:g,FORMAT:p,ALPHABET:m}},v.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var S,D,A=y.c,T=y.e,F=y.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&T>=-1e9&&T<=Un&&T===cr(T)){if(A[0]===0){if(T===0&&A.length===1)return!0;break e}if(S=(T+1)%Le,S<1&&(S+=Le),String(A[0]).length==S){for(S=0;S<A.length;S++)if(D=A[S],D<0||D>=_r||D!==cr(D))break e;if(D!==0)return!0}}}else if(A===null&&T===null&&(F===null||F===1||F===-1))return!0;throw Error(Pn+"Invalid BigNumber: "+y)},v.maximum=v.max=function(){return C(arguments,-1)},v.minimum=v.min=function(){return C(arguments,1)},v.random=function(){var y=9007199254740992,S=Math.random()*y&2097151?function(){return cr(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(D){var A,T,F,k,P,$=0,R=[],O=new v(a);if(D==null?D=o:Tt(D,0,Un),k=Uf(D/Le),h)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(k*=2));$<k;)P=A[$]*131072+(A[$+1]>>>11),P>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),A[$]=T[0],A[$+1]=T[1]):(R.push(P%1e14),$+=2);$=k/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(k*=7);$<k;)P=(A[$]&31)*281474976710656+A[$+1]*1099511627776+A[$+2]*4294967296+A[$+3]*16777216+(A[$+4]<<16)+(A[$+5]<<8)+A[$+6],P>=9e15?crypto.randomBytes(7).copy(A,$):(R.push(P%1e14),$+=7);$=k/7}else throw h=!1,Error(Pn+"crypto unavailable");if(!h)for(;$<k;)P=S(),P<9e15&&(R[$++]=P%1e14);for(k=R[--$],D%=Le,k&&D&&(P=Xf[Le-D],R[$]=cr(k/P)*P);R[$]===0;R.pop(),$--);if($<0)R=[F=0];else{for(F=-1;R[0]===0;R.splice(0,1),F-=Le);for($=1,P=R[0];P>=10;P/=10,$++);$<Le&&(F-=Le-$)}return O.e=F,O.c=R,O}}(),v.sum=function(){for(var y=1,S=arguments,D=new v(S[0]);y<S.length;)D=D.plus(S[y++]);return D},n=function(){var y="0123456789";function S(D,A,T,F){for(var k,P=[0],$,R=0,O=D.length;R<O;){for($=P.length;$--;P[$]*=A);for(P[0]+=F.indexOf(D.charAt(R++)),k=0;k<P.length;k++)P[k]>T-1&&(P[k+1]==null&&(P[k+1]=0),P[k+1]+=P[k]/T|0,P[k]%=T)}return P.reverse()}return function(D,A,T,F,k){var P,$,R,O,j,V,W,U,K=D.indexOf("."),ee=o,z=s;for(K>=0&&(O=g,g=0,D=D.replace(".",""),U=new v(A),V=U.pow(D.length-K),g=O,U.c=S(mi(sr(V.c),V.e,"0"),10,T,y),U.e=U.c.length),W=S(D,A,T,k?(P=m,y):(P=y,m)),R=O=W.length;W[--O]==0;W.pop());if(!W[0])return P.charAt(0);if(K<0?--R:(V.c=W,V.e=R,V.s=F,V=t(V,U,ee,z,T),W=V.c,j=V.r,R=V.e),$=R+ee+1,K=W[$],O=T/2,j=j||$<0||W[$+1]!=null,j=z<4?(K!=null||j)&&(z==0||z==(V.s<0?3:2)):K>O||K==O&&(z==4||j||z==6&&W[$-1]&1||z==(V.s<0?8:7)),$<1||!W[0])D=j?mi(P.charAt(1),-ee,P.charAt(0)):P.charAt(0);else{if(W.length=$,j)for(--T;++W[--$]>T;)W[$]=0,$||(++R,W=[1].concat(W));for(O=W.length;!W[--O];);for(K=0,D="";K<=O;D+=P.charAt(W[K++]));D=mi(D,R,P.charAt(0))}return D}}(),t=function(){function y(A,T,F){var k,P,$,R,O=0,j=A.length,V=T%Ui,W=T/Ui|0;for(A=A.slice();j--;)$=A[j]%Ui,R=A[j]/Ui|0,k=W*$+R*V,P=V*$+k%Ui*Ui+O,O=(P/F|0)+(k/Ui|0)+W*R,A[j]=P%F;return O&&(A=[O].concat(A)),A}function S(A,T,F,k){var P,$;if(F!=k)$=F>k?1:-1;else for(P=$=0;P<F;P++)if(A[P]!=T[P]){$=A[P]>T[P]?1:-1;break}return $}function D(A,T,F,k){for(var P=0;F--;)A[F]-=P,P=A[F]<T[F]?1:0,A[F]=P*k+A[F]-T[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,T,F,k,P){var $,R,O,j,V,W,U,K,ee,z,H,X,te,ie,le,ce,Q,be=A.s==T.s?1:-1,Ce=A.c,Se=T.c;if(!Ce||!Ce[0]||!Se||!Se[0])return new v(!A.s||!T.s||(Ce?Se&&Ce[0]==Se[0]:!Se)?NaN:Ce&&Ce[0]==0||!Se?be*0:be/0);for(K=new v(be),ee=K.c=[],R=A.e-T.e,be=F+R+1,P||(P=_r,R=dr(A.e/Le)-dr(T.e/Le),be=be/Le|0),O=0;Se[O]==(Ce[O]||0);O++);if(Se[O]>(Ce[O]||0)&&R--,be<0)ee.push(1),j=!0;else{for(ie=Ce.length,ce=Se.length,O=0,be+=2,V=cr(P/(Se[0]+1)),V>1&&(Se=y(Se,V,P),Ce=y(Ce,V,P),ce=Se.length,ie=Ce.length),te=ce,z=Ce.slice(0,ce),H=z.length;H<ce;z[H++]=0);Q=Se.slice(),Q=[0].concat(Q),le=Se[0],Se[1]>=P/2&&le++;do{if(V=0,$=S(Se,z,ce,H),$<0){if(X=z[0],ce!=H&&(X=X*P+(z[1]||0)),V=cr(X/le),V>1)for(V>=P&&(V=P-1),W=y(Se,V,P),U=W.length,H=z.length;S(W,z,U,H)==1;)V--,D(W,ce<U?Q:Se,U,P),U=W.length,$=1;else V==0&&($=V=1),W=Se.slice(),U=W.length;if(U<H&&(W=[0].concat(W)),D(z,W,H,P),H=z.length,$==-1)for(;S(Se,z,ce,H)<1;)V++,D(z,ce<H?Q:Se,H,P),H=z.length}else $===0&&(V++,z=[0]);ee[O++]=V,z[0]?z[H++]=Ce[te]||0:(z=[Ce[te]],H=1)}while((te++<ie||z[0]!=null)&&be--);j=z[0]!=null,ee[0]||ee.splice(0,1)}if(P==_r){for(O=1,be=ee[0];be>=10;be/=10,O++);w(K,F+(K.e=O+R*Le-1)+1,k,j)}else K.e=R,K.r=+j;return K}}();function x(y,S,D,A){var T,F,k,P,$;if(D==null?D=s:Tt(D,0,8),!y.c)return y.toString();if(T=y.c[0],k=y.e,S==null)$=sr(y.c),$=A==1||A==2&&(k<=l||k>=u)?Ru($,k):mi($,k,"0");else if(y=w(new v(y),S,D),F=y.e,$=sr(y.c),P=$.length,A==1||A==2&&(S<=F||F<=l)){for(;P<S;$+="0",P++);$=Ru($,F)}else if(S-=k,$=mi($,F,"0"),F+1>P){if(--S>0)for($+=".";S--;$+="0");}else if(S+=F-P,S>0)for(F+1==P&&($+=".");S--;$+="0");return y.s<0&&T?"-"+$:$}function C(y,S){for(var D,A,T=1,F=new v(y[0]);T<y.length;T++)A=new v(y[T]),(!A.s||(D=$a(F,A))===S||D===0&&F.s===S)&&(F=A);return F}function E(y,S,D){for(var A=1,T=S.length;!S[--T];S.pop());for(T=S[0];T>=10;T/=10,A++);return(D=A+D*Le-1)>d?y.c=y.e=null:D<c?y.c=[y.e=0]:(y.e=D,y.c=S),y}r=function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,D=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,k,P,$){var R,O=P?k:k.replace(T,"");if(A.test(O))F.s=isNaN(O)?null:O<0?-1:1;else{if(!P&&(O=O.replace(y,function(j,V,W){return R=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!$||$==R?V:j}),$&&(R=$,O=O.replace(S,"$1").replace(D,"0.$1")),k!=O))return new v(O,R);if(v.DEBUG)throw Error(Pn+"Not a"+($?" base "+$:"")+" number: "+k);F.s=null}F.c=F.e=null}}();function w(y,S,D,A){var T,F,k,P,$,R,O,j=y.c,V=Xf;if(j){e:{for(T=1,P=j[0];P>=10;P/=10,T++);if(F=S-T,F<0)F+=Le,k=S,$=j[R=0],O=cr($/V[T-k-1]%10);else if(R=Uf((F+1)/Le),R>=j.length)if(A){for(;j.length<=R;j.push(0));$=O=0,T=1,F%=Le,k=F-Le+1}else break e;else{for($=P=j[R],T=1;P>=10;P/=10,T++);F%=Le,k=F-Le+T,O=k<0?0:cr($/V[T-k-1]%10)}if(A=A||S<0||j[R+1]!=null||(k<0?$:$%V[T-k-1]),A=D<4?(O||A)&&(D==0||D==(y.s<0?3:2)):O>5||O==5&&(D==4||A||D==6&&(F>0?k>0?$/V[T-k]:0:j[R-1])%10&1||D==(y.s<0?8:7)),S<1||!j[0])return j.length=0,A?(S-=y.e+1,j[0]=V[(Le-S%Le)%Le],y.e=-S||0):j[0]=y.e=0,y;if(F==0?(j.length=R,P=1,R--):(j.length=R+1,P=V[Le-F],j[R]=k>0?cr($/V[T-k]%V[k])*P:0),A)for(;;)if(R==0){for(F=1,k=j[0];k>=10;k/=10,F++);for(k=j[0]+=P,P=1;k>=10;k/=10,P++);F!=P&&(y.e++,j[0]==_r&&(j[0]=1));break}else{if(j[R]+=P,j[R]!=_r)break;j[R--]=0,P=1}for(F=j.length;j[--F]===0;j.pop());}y.e>d?y.c=y.e=null:y.e<c&&(y.c=[y.e=0])}return y}function B(y){var S,D=y.e;return D===null?y.toString():(S=sr(y.c),S=D<=l||D>=u?Ru(S,D):mi(S,D,"0"),y.s<0?"-"+S:S)}return i.absoluteValue=i.abs=function(){var y=new v(this);return y.s<0&&(y.s=1),y},i.comparedTo=function(y,S){return $a(this,new v(y,S))},i.decimalPlaces=i.dp=function(y,S){var D,A,T,F=this;if(y!=null)return Tt(y,0,Un),S==null?S=s:Tt(S,0,8),w(new v(F),y+F.e+1,S);if(!(D=F.c))return null;if(A=((T=D.length-1)-dr(this.e/Le))*Le,T=D[T])for(;T%10==0;T/=10,A--);return A<0&&(A=0),A},i.dividedBy=i.div=function(y,S){return t(this,new v(y,S),o,s)},i.dividedToIntegerBy=i.idiv=function(y,S){return t(this,new v(y,S),0,1)},i.exponentiatedBy=i.pow=function(y,S){var D,A,T,F,k,P,$,R,O,j=this;if(y=new v(y),y.c&&!y.isInteger())throw Error(Pn+"Exponent not an integer: "+B(y));if(S!=null&&(S=new v(S)),P=y.e>14,!j.c||!j.c[0]||j.c[0]==1&&!j.e&&j.c.length==1||!y.c||!y.c[0])return O=new v(Math.pow(+B(j),P?y.s*(2-Tu(y)):+B(y))),S?O.mod(S):O;if($=y.s<0,S){if(S.c?!S.c[0]:!S.s)return new v(NaN);A=!$&&j.isInteger()&&S.isInteger(),A&&(j=j.mod(S))}else{if(y.e>9&&(j.e>0||j.e<-1||(j.e==0?j.c[0]>1||P&&j.c[1]>=24e7:j.c[0]<8e13||P&&j.c[0]<=9999975e7)))return F=j.s<0&&Tu(y)?-0:0,j.e>-1&&(F=1/F),new v($?1/F:F);g&&(F=Uf(g/Le+2))}for(P?(D=new v(.5),$&&(y.s=1),R=Tu(y)):(T=Math.abs(+B(y)),R=T%2),O=new v(a);;){if(R){if(O=O.times(j),!O.c)break;F?O.c.length>F&&(O.c.length=F):A&&(O=O.mod(S))}if(T){if(T=cr(T/2),T===0)break;R=T%2}else if(y=y.times(D),w(y,y.e+1,1),y.e>14)R=Tu(y);else{if(T=+B(y),T===0)break;R=T%2}j=j.times(j),F?j.c&&j.c.length>F&&(j.c.length=F):A&&(j=j.mod(S))}return A?O:($&&(O=a.div(O)),S?O.mod(S):F?w(O,g,s,k):O)},i.integerValue=function(y){var S=new v(this);return y==null?y=s:Tt(y,0,8),w(S,S.e+1,y)},i.isEqualTo=i.eq=function(y,S){return $a(this,new v(y,S))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(y,S){return $a(this,new v(y,S))>0},i.isGreaterThanOrEqualTo=i.gte=function(y,S){return(S=$a(this,new v(y,S)))===1||S===0},i.isInteger=function(){return!!this.c&&dr(this.e/Le)>this.c.length-2},i.isLessThan=i.lt=function(y,S){return $a(this,new v(y,S))<0},i.isLessThanOrEqualTo=i.lte=function(y,S){return(S=$a(this,new v(y,S)))===-1||S===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(y,S){var D,A,T,F,k=this,P=k.s;if(y=new v(y,S),S=y.s,!P||!S)return new v(NaN);if(P!=S)return y.s=-S,k.plus(y);var $=k.e/Le,R=y.e/Le,O=k.c,j=y.c;if(!$||!R){if(!O||!j)return O?(y.s=-S,y):new v(j?k:NaN);if(!O[0]||!j[0])return j[0]?(y.s=-S,y):new v(O[0]?k:s==3?-0:0)}if($=dr($),R=dr(R),O=O.slice(),P=$-R){for((F=P<0)?(P=-P,T=O):(R=$,T=j),T.reverse(),S=P;S--;T.push(0));T.reverse()}else for(A=(F=(P=O.length)<(S=j.length))?P:S,P=S=0;S<A;S++)if(O[S]!=j[S]){F=O[S]<j[S];break}if(F&&(T=O,O=j,j=T,y.s=-y.s),S=(A=j.length)-(D=O.length),S>0)for(;S--;O[D++]=0);for(S=_r-1;A>P;){if(O[--A]<j[A]){for(D=A;D&&!O[--D];O[D]=S);--O[D],O[A]+=_r}O[A]-=j[A]}for(;O[0]==0;O.splice(0,1),--R);return O[0]?E(y,O,R):(y.s=s==3?-1:1,y.c=[y.e=0],y)},i.modulo=i.mod=function(y,S){var D,A,T=this;return y=new v(y,S),!T.c||!y.s||y.c&&!y.c[0]?new v(NaN):!y.c||T.c&&!T.c[0]?new v(T):(f==9?(A=y.s,y.s=1,D=t(T,y,0,3),y.s=A,D.s*=A):D=t(T,y,0,f),y=T.minus(D.times(y)),!y.c[0]&&f==1&&(y.s=T.s),y)},i.multipliedBy=i.times=function(y,S){var D,A,T,F,k,P,$,R,O,j,V,W,U,K,ee,z=this,H=z.c,X=(y=new v(y,S)).c;if(!H||!X||!H[0]||!X[0])return!z.s||!y.s||H&&!H[0]&&!X||X&&!X[0]&&!H?y.c=y.e=y.s=null:(y.s*=z.s,!H||!X?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(A=dr(z.e/Le)+dr(y.e/Le),y.s*=z.s,$=H.length,j=X.length,$<j&&(U=H,H=X,X=U,T=$,$=j,j=T),T=$+j,U=[];T--;U.push(0));for(K=_r,ee=Ui,T=j;--T>=0;){for(D=0,V=X[T]%ee,W=X[T]/ee|0,k=$,F=T+k;F>T;)R=H[--k]%ee,O=H[k]/ee|0,P=W*R+O*V,R=V*R+P%ee*ee+U[F]+D,D=(R/K|0)+(P/ee|0)+W*O,U[F--]=R%K;U[F]=D}return D?++A:U.splice(0,1),E(y,U,A)},i.negated=function(){var y=new v(this);return y.s=-y.s||null,y},i.plus=function(y,S){var D,A=this,T=A.s;if(y=new v(y,S),S=y.s,!T||!S)return new v(NaN);if(T!=S)return y.s=-S,A.minus(y);var F=A.e/Le,k=y.e/Le,P=A.c,$=y.c;if(!F||!k){if(!P||!$)return new v(T/0);if(!P[0]||!$[0])return $[0]?y:new v(P[0]?A:T*0)}if(F=dr(F),k=dr(k),P=P.slice(),T=F-k){for(T>0?(k=F,D=$):(T=-T,D=P),D.reverse();T--;D.push(0));D.reverse()}for(T=P.length,S=$.length,T-S<0&&(D=$,$=P,P=D,S=T),T=0;S;)T=(P[--S]=P[S]+$[S]+T)/_r|0,P[S]=_r===P[S]?0:P[S]%_r;return T&&(P=[T].concat(P),++k),E(y,P,k)},i.precision=i.sd=function(y,S){var D,A,T,F=this;if(y!=null&&y!==!!y)return Tt(y,1,Un),S==null?S=s:Tt(S,0,8),w(new v(F),y,S);if(!(D=F.c))return null;if(T=D.length-1,A=T*Le+1,T=D[T]){for(;T%10==0;T/=10,A--);for(T=D[0];T>=10;T/=10,A++);}return y&&F.e+1>A&&(A=F.e+1),A},i.shiftedBy=function(y){return Tt(y,-9007199254740991,h1),this.times("1e"+y)},i.squareRoot=i.sqrt=function(){var y,S,D,A,T,F=this,k=F.c,P=F.s,$=F.e,R=o+4,O=new v("0.5");if(P!==1||!k||!k[0])return new v(!P||P<0&&(!k||k[0])?NaN:k?F:1/0);if(P=Math.sqrt(+B(F)),P==0||P==1/0?(S=sr(k),(S.length+$)%2==0&&(S+="0"),P=Math.sqrt(+S),$=dr(($+1)/2)-($<0||$%2),P==1/0?S="5e"+$:(S=P.toExponential(),S=S.slice(0,S.indexOf("e")+1)+$),D=new v(S)):D=new v(P+""),D.c[0]){for($=D.e,P=$+R,P<3&&(P=0);;)if(T=D,D=O.times(T.plus(t(F,T,R,1))),sr(T.c).slice(0,P)===(S=sr(D.c)).slice(0,P))if(D.e<$&&--P,S=S.slice(P-3,P+1),S=="9999"||!A&&S=="4999"){if(!A&&(w(T,T.e+o+2,0),T.times(T).eq(F))){D=T;break}R+=4,P+=4,A=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(w(D,D.e+o+2,1),y=!D.times(D).eq(F));break}}return w(D,D.e+o+1,s,y)},i.toExponential=function(y,S){return y!=null&&(Tt(y,0,Un),y++),x(this,y,S,1)},i.toFixed=function(y,S){return y!=null&&(Tt(y,0,Un),y=y+this.e+1),x(this,y,S)},i.toFormat=function(y,S,D){var A,T=this;if(D==null)y!=null&&S&&typeof S=="object"?(D=S,S=null):y&&typeof y=="object"?(D=y,y=S=null):D=p;else if(typeof D!="object")throw Error(Pn+"Argument not an object: "+D);if(A=T.toFixed(y,S),T.c){var F,k=A.split("."),P=+D.groupSize,$=+D.secondaryGroupSize,R=D.groupSeparator||"",O=k[0],j=k[1],V=T.s<0,W=V?O.slice(1):O,U=W.length;if($&&(F=P,P=$,$=F,U-=F),P>0&&U>0){for(F=U%P||P,O=W.substr(0,F);F<U;F+=P)O+=R+W.substr(F,P);$>0&&(O+=R+W.slice(F)),V&&(O="-"+O)}A=j?O+(D.decimalSeparator||"")+(($=+D.fractionGroupSize)?j.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(D.fractionGroupSeparator||"")):j):O}return(D.prefix||"")+A+(D.suffix||"")},i.toFraction=function(y){var S,D,A,T,F,k,P,$,R,O,j,V,W=this,U=W.c;if(y!=null&&(P=new v(y),!P.isInteger()&&(P.c||P.s!==1)||P.lt(a)))throw Error(Pn+"Argument "+(P.isInteger()?"out of range: ":"not an integer: ")+B(P));if(!U)return new v(W);for(S=new v(a),R=D=new v(a),A=$=new v(a),V=sr(U),F=S.e=V.length-W.e-1,S.c[0]=Xf[(k=F%Le)<0?Le+k:k],y=!y||P.comparedTo(S)>0?F>0?S:R:P,k=d,d=1/0,P=new v(V),$.c[0]=0;O=t(P,S,0,1),T=D.plus(O.times(A)),T.comparedTo(y)!=1;)D=A,A=T,R=$.plus(O.times(T=R)),$=T,S=P.minus(O.times(T=S)),P=T;return T=t(y.minus(D),A,0,1),$=$.plus(T.times(R)),D=D.plus(T.times(A)),$.s=R.s=W.s,F=F*2,j=t(R,A,F,s).minus(W).abs().comparedTo(t($,D,F,s).minus(W).abs())<1?[R,A]:[$,D],d=k,j},i.toNumber=function(){return+B(this)},i.toPrecision=function(y,S){return y!=null&&Tt(y,1,Un),x(this,y,S,2)},i.toString=function(y){var S,D=this,A=D.s,T=D.e;return T===null?A?(S="Infinity",A<0&&(S="-"+S)):S="NaN":(y==null?S=T<=l||T>=u?Ru(sr(D.c),T):mi(sr(D.c),T,"0"):y===10&&b?(D=w(new v(D),o+T+1,s),S=mi(sr(D.c),D.e,"0")):(Tt(y,2,m.length,"Base"),S=n(mi(sr(D.c),T,"0"),10,y,A,!0)),A<0&&D.c[0]&&(S="-"+S)),S},i.valueOf=i.toJSON=function(){return B(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&v.set(e),v}function dr(e){var t=e|0;return e>0||e===t?t:t-1}function sr(e){for(var t,n,r=1,i=e.length,a=e[0]+"";r<i;){for(t=e[r++]+"",n=Le-t.length;n--;t="0"+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function $a(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!i||!a)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(s=(l=i.length)<(u=a.length)?l:u,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return l==u?0:l>u^n?1:-1}function Tt(e,t,n,r){if(e<t||e>n||e!==cr(e))throw Error(Pn+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Tu(e){var t=e.c.length-1;return dr(e.e/Le)==t&&e.c[t]%2!=0}function Ru(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function mi(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Jd=iC();const aC={ROUNDING_MODE:Jd.ROUND_HALF_UP,EXPONENTIAL_AT:[-1e9,1e9]};let x0=!1;const i6=(e=aC)=>{x0||(Jd.config(e),x0=!0)},$t=(e,t)=>(x0||i6(),new Jd(e,t));var a6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o6(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ze={options:{usePureJavaScript:!1}},Kg={},l6=Kg,g1={};Kg.encode=function(e,t,n){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(n!==void 0&&typeof n!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=u6(e,t);else{var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var l=0,u=e[i];l<s.length;++l)u+=s[l]<<8,s[l]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(i=0;e[i]===0&&i<e.length-1;++i)r+=o;for(i=s.length-1;i>=0;--i)r+=t[s[i]]}if(n){var c=new RegExp(".{1,"+n+"}","g");r=r.match(c).join(`\r
1
+ "use strict";var yI=Object.defineProperty;var xI=(e,t,n)=>t in e?yI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>xI(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),I=require("react"),cu=require("react-dom");function Kx(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=Kx(I),qx=Kx(cu);function Lr(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ho(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Jx=6048e5,CI=864e5;let EI={};function Kd(){return EI}function go(e,t){var s,l,u,c;const n=Kd(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=Lr(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Zc(e){return go(e,{weekStartsOn:1})}function Qx(e){const t=Lr(e),n=t.getFullYear(),r=ho(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Zc(r),a=ho(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Zc(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function a1(e){const t=Lr(e);return t.setHours(0,0,0,0),t}function o1(e){const t=Lr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function SI(e,t){const n=a1(e),r=a1(t),i=+n-o1(n),a=+r-o1(r);return Math.round((i-a)/CI)}function wI(e){const t=Qx(e),n=ho(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Zc(n)}function II(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _I(e){if(!II(e)&&typeof e!="number")return!1;const t=Lr(e);return!isNaN(Number(t))}function DI(e){const t=Lr(e),n=ho(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const AI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},TI=(e,t,n)=>{let r;const i=AI[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Er(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const RI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$I={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kI={date:Er({formats:RI,defaultWidth:"full"}),time:Er({formats:BI,defaultWidth:"full"}),dateTime:Er({formats:$I,defaultWidth:"full"})},PI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},FI=(e,t,n,r)=>PI[e];function Ut(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const NI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},LI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},OI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},VI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},HI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jI=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},WI={ordinalNumber:jI,era:Ut({values:NI,defaultWidth:"wide"}),quarter:Ut({values:MI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:LI,defaultWidth:"wide"}),day:Ut({values:OI,defaultWidth:"wide"}),dayPeriod:Ut({values:VI,defaultWidth:"wide",formattingValues:HI,defaultFormattingWidth:"wide"})};function Xt(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?GI(s,d=>d.test(o)):zI(s,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function zI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function GI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qd(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const UI=/^(\d+)(th|st|nd|rd)?/i,XI=/\d+/i,ZI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},YI={any:[/^b/i,/^(a|c)/i]},KI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qI={any:[/1/i,/2/i,/3/i,/4/i]},JI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},QI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},e_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},t_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},n_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},r_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},i_={ordinalNumber:qd({matchPattern:UI,parsePattern:XI,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:ZI,defaultMatchWidth:"wide",parsePatterns:YI,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:KI,defaultMatchWidth:"wide",parsePatterns:qI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:JI,defaultMatchWidth:"wide",parsePatterns:QI,defaultParseWidth:"any"}),day:Xt({matchPatterns:e_,defaultMatchWidth:"wide",parsePatterns:t_,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:n_,defaultMatchWidth:"any",parsePatterns:r_,defaultParseWidth:"any"})},Yg={code:"en-US",formatDistance:TI,formatLong:kI,formatRelative:FI,localize:WI,match:i_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function a_(e){const t=Lr(e);return SI(t,DI(t))+1}function o_(e){const t=Lr(e),n=+Zc(t)-+wI(t);return Math.round(n/Jx)+1}function eC(e,t){var c,d,h,f;const n=Lr(e),r=n.getFullYear(),i=Kd(),a=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=ho(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const s=go(o,t),l=ho(e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const u=go(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function s_(e,t){var s,l,u,c;const n=Kd(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=eC(e,t),a=ho(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),go(a,t)}function l_(e,t){const n=Lr(e),r=+go(n,t)-+s_(n,t);return Math.round(r/Jx)+1}function gt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Gi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return gt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):gt(n+1,2)},d(e,t){return gt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return gt(e.getHours()%12||12,t.length)},H(e,t){return gt(e.getHours(),t.length)},m(e,t){return gt(e.getMinutes(),t.length)},s(e,t){return gt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return gt(i,t.length)}},Bo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},s1={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Gi.y(e,t)},Y:function(e,t,n,r){const i=eC(e,r),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return gt(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):gt(a,t.length)},R:function(e,t){const n=Qx(e);return gt(n,t.length)},u:function(e,t){const n=e.getFullYear();return gt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Gi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return gt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=l_(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},I:function(e,t,n){const r=o_(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):gt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Gi.d(e,t)},D:function(e,t,n){const r=a_(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return gt(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return gt(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return gt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Bo.noon:r===0?i=Bo.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Bo.evening:r>=12?i=Bo.afternoon:r>=4?i=Bo.morning:i=Bo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Gi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Gi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Gi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Gi.s(e,t)},S:function(e,t){return Gi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return u1(r);case"XXXX":case"XX":return Va(r);case"XXXXX":case"XXX":default:return Va(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return u1(r);case"xxxx":case"xx":return Va(r);case"xxxxx":case"xxx":default:return Va(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+l1(r,":");case"OOOO":default:return"GMT"+Va(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+l1(r,":");case"zzzz":default:return"GMT"+Va(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return gt(r,t.length)},T:function(e,t,n){const r=e.getTime();return gt(r,t.length)}};function l1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+gt(a,2)}function u1(e,t){return e%60===0?(e>0?"-":"+")+gt(Math.abs(e)/60,2):Va(e,t)}function Va(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=gt(Math.trunc(r/60),2),a=gt(r%60,2);return n+i+t+a}const c1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},tC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},u_=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return c1(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",c1(r,t)).replace("{{time}}",tC(i,t))},c_={p:tC,P:u_},d_=/^D+$/,f_=/^Y+$/,h_=["D","DD","YY","YYYY"];function g_(e){return d_.test(e)}function p_(e){return f_.test(e)}function m_(e,t,n){const r=b_(e,t,n);if(console.warn(r),h_.includes(e))throw new RangeError(r)}function b_(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const v_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x_=/^'([^]*?)'?$/,C_=/''/g,E_=/[a-zA-Z]/;function wl(e,t,n){var c,d,h,f,g,p,m,b;const r=Kd(),i=(n==null?void 0:n.locale)??r.locale??Yg,a=(n==null?void 0:n.firstWeekContainsDate)??((d=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((p=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((b=(m=r.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??0,s=Lr(e);if(!_I(s))throw new RangeError("Invalid time value");let l=t.match(y_).map(v=>{const x=v[0];if(x==="p"||x==="P"){const C=c_[x];return C(v,i.formatLong)}return v}).join("").match(v_).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const x=v[0];if(x==="'")return{isToken:!1,value:S_(v)};if(s1[x])return{isToken:!0,value:v};if(x.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(l=i.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return l.map(v=>{if(!v.isToken)return v.value;const x=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&p_(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&g_(x))&&m_(x,t,String(e));const C=s1[x[0]];return C(s,x,i.localize,u)}).join("")}function S_(e){const t=e.match(x_);return t?t[1].replace(C_,"'"):e}function w_(e,t,n){const r=go(e,n),i=go(t,n);return+r==+i}const I_={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},__=(e,t,n)=>{let r;const i=I_[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},D_={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},A_={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},T_={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},R_={date:Er({formats:D_,defaultWidth:"full"}),time:Er({formats:A_,defaultWidth:"full"}),dateTime:Er({formats:T_,defaultWidth:"full"})},B_={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},$_=(e,t,n,r)=>B_[e],k_={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},P_={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},F_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},N_={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},M_={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},L_={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},O_=(e,t)=>"ke-"+Number(e),V_={ordinalNumber:O_,era:Ut({values:k_,defaultWidth:"wide"}),quarter:Ut({values:P_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:F_,defaultWidth:"wide"}),day:Ut({values:N_,defaultWidth:"wide"}),dayPeriod:Ut({values:M_,defaultWidth:"wide",formattingValues:L_,defaultFormattingWidth:"wide"})},H_=/^ke-(\d+)?/i,j_=/\d+/i,W_={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},z_={any:[/^s/i,/^(m|e)/i]},G_={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},U_={any:[/1/i,/2/i,/3/i,/4/i]},X_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Z_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Y_={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},K_={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},q_={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},J_={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Q_={ordinalNumber:qd({matchPattern:H_,parsePattern:j_,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:z_,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:G_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Z_,defaultParseWidth:"any"}),day:Xt({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:q_,defaultMatchWidth:"any",parsePatterns:J_,defaultParseWidth:"any"})},Yc={code:"id",formatDistance:__,formatLong:R_,formatRelative:$_,localize:V_,match:Q_,options:{weekStartsOn:1,firstWeekContainsDate:1}},eD={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},tD=(e,t,n)=>{let r;const i=eD[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"over "+r:r+" geleden":r},nD={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},rD={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},iD={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},aD={date:Er({formats:nD,defaultWidth:"full"}),time:Er({formats:rD,defaultWidth:"full"}),dateTime:Er({formats:iD,defaultWidth:"full"})},oD={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},sD=(e,t,n,r)=>oD[e],lD={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},uD={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},cD={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},dD={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},fD={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},hD=(e,t)=>Number(e)+"e",gD={ordinalNumber:hD,era:Ut({values:lD,defaultWidth:"wide"}),quarter:Ut({values:uD,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:cD,defaultWidth:"wide"}),day:Ut({values:dD,defaultWidth:"wide"}),dayPeriod:Ut({values:fD,defaultWidth:"wide"})},pD=/^(\d+)e?/i,mD=/\d+/i,bD={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},vD={any:[/^v/,/^n/]},yD={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},xD={any:[/1/i,/2/i,/3/i,/4/i]},CD={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},ED={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},SD={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},wD={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},ID={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},_D={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},DD={ordinalNumber:qd({matchPattern:pD,parsePattern:mD,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:bD,defaultMatchWidth:"wide",parsePatterns:vD,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:yD,defaultMatchWidth:"wide",parsePatterns:xD,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:CD,defaultMatchWidth:"wide",parsePatterns:ED,defaultParseWidth:"any"}),day:Xt({matchPatterns:SD,defaultMatchWidth:"wide",parsePatterns:wD,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:ID,defaultMatchWidth:"any",parsePatterns:_D,defaultParseWidth:"any"})},nC={code:"nl",formatDistance:tD,formatLong:aD,formatRelative:sD,localize:gD,match:DD,options:{weekStartsOn:1,firstWeekContainsDate:4}},AD={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},TD=(e,t,n)=>{let r;const i=AD[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},RD={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},BD={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},$D={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},kD={date:Er({formats:RD,defaultWidth:"full"}),time:Er({formats:BD,defaultWidth:"full"}),dateTime:Er({formats:$D,defaultWidth:"full"})};function d1(e,t,n){const r="eeee p";return w_(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const PD={lastWeek:d1,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:d1,other:"PP p"},FD=(e,t,n,r)=>{const i=PD[e];return typeof i=="function"?i(t,n,r):i},ND={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},MD={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},LD={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},OD={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},VD={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},HD={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},jD=(e,t)=>{const n=Number(e);switch(t==null?void 0:t.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},WD={ordinalNumber:jD,era:Ut({values:ND,defaultWidth:"wide"}),quarter:Ut({values:MD,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ut({values:LD,defaultWidth:"wide"}),day:Ut({values:OD,defaultWidth:"wide"}),dayPeriod:Ut({values:VD,defaultWidth:"wide",formattingValues:HD,defaultFormattingWidth:"wide"})},zD=/^(第\s*)?\d+(日|时|分|秒)?/i,GD=/\d+/i,UD={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},XD={any:[/^(前)/i,/^(公元)/i]},ZD={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},YD={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},KD={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},qD={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},JD={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},QD={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},e6={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},t6={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},n6={ordinalNumber:qd({matchPattern:zD,parsePattern:GD,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:UD,defaultMatchWidth:"wide",parsePatterns:XD,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:ZD,defaultMatchWidth:"wide",parsePatterns:YD,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:KD,defaultMatchWidth:"wide",parsePatterns:qD,defaultParseWidth:"any"}),day:Xt({matchPatterns:JD,defaultMatchWidth:"wide",parsePatterns:QD,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:e6,defaultMatchWidth:"any",parsePatterns:t6,defaultParseWidth:"any"})},rC={code:"zh-CN",formatDistance:TD,formatLong:kD,formatRelative:FD,localize:WD,match:n6,options:{weekStartsOn:1,firstWeekContainsDate:4}};var r6=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Uf=Math.ceil,cr=Math.floor,Pn="[BigNumber Error] ",f1=Pn+"Number primitive has more than 15 significant digits: ",_r=1e14,Le=14,h1=9007199254740991,Xf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ui=1e7,Un=1e9;function iC(e){var t,n,r,i=v.prototype={constructor:v,toString:null,valueOf:null},a=new v(1),o=20,s=4,l=-7,u=21,c=-1e7,d=1e7,h=!1,f=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function v(y,S){var D,A,T,F,k,P,$,R,O=this;if(!(O instanceof v))return new v(y,S);if(S==null){if(y&&y._isBigNumber===!0){O.s=y.s,!y.c||y.e>d?O.c=O.e=null:y.e<c?O.c=[O.e=0]:(O.e=y.e,O.c=y.c.slice());return}if((P=typeof y=="number")&&y*0==0){if(O.s=1/y<0?(y=-y,-1):1,y===~~y){for(F=0,k=y;k>=10;k/=10,F++);F>d?O.c=O.e=null:(O.e=F,O.c=[y]);return}R=String(y)}else{if(!r6.test(R=String(y)))return r(O,R,P);O.s=R.charCodeAt(0)==45?(R=R.slice(1),-1):1}(F=R.indexOf("."))>-1&&(R=R.replace(".","")),(k=R.search(/e/i))>0?(F<0&&(F=k),F+=+R.slice(k+1),R=R.substring(0,k)):F<0&&(F=R.length)}else{if(Rt(S,2,m.length,"Base"),S==10&&b)return O=new v(y),w(O,o+O.e+1,s);if(R=String(y),P=typeof y=="number"){if(y*0!=0)return r(O,R,P,S);if(O.s=1/y<0?(R=R.slice(1),-1):1,v.DEBUG&&R.replace(/^0\.0*|\./,"").length>15)throw Error(f1+y)}else O.s=R.charCodeAt(0)===45?(R=R.slice(1),-1):1;for(D=m.slice(0,S),F=k=0,$=R.length;k<$;k++)if(D.indexOf(A=R.charAt(k))<0){if(A=="."){if(k>F){F=$;continue}}else if(!T&&(R==R.toUpperCase()&&(R=R.toLowerCase())||R==R.toLowerCase()&&(R=R.toUpperCase()))){T=!0,k=-1,F=0;continue}return r(O,String(y),P,S)}P=!1,R=n(R,S,10,O.s),(F=R.indexOf("."))>-1?R=R.replace(".",""):F=R.length}for(k=0;R.charCodeAt(k)===48;k++);for($=R.length;R.charCodeAt(--$)===48;);if(R=R.slice(k,++$)){if($-=k,P&&v.DEBUG&&$>15&&(y>h1||y!==cr(y)))throw Error(f1+O.s*y);if((F=F-k-1)>d)O.c=O.e=null;else if(F<c)O.c=[O.e=0];else{if(O.e=F,O.c=[],k=(F+1)%Le,F<0&&(k+=Le),k<$){for(k&&O.c.push(+R.slice(0,k)),$-=Le;k<$;)O.c.push(+R.slice(k,k+=Le));k=Le-(R=R.slice(k)).length}else k-=$;for(;k--;R+="0");O.c.push(+R)}}else O.c=[O.e=0]}v.clone=iC,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(y){var S,D;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(S="DECIMAL_PLACES")&&(D=y[S],Rt(D,0,Un,S),o=D),y.hasOwnProperty(S="ROUNDING_MODE")&&(D=y[S],Rt(D,0,8,S),s=D),y.hasOwnProperty(S="EXPONENTIAL_AT")&&(D=y[S],D&&D.pop?(Rt(D[0],-1e9,0,S),Rt(D[1],0,Un,S),l=D[0],u=D[1]):(Rt(D,-1e9,Un,S),l=-(u=D<0?-D:D))),y.hasOwnProperty(S="RANGE"))if(D=y[S],D&&D.pop)Rt(D[0],-1e9,-1,S),Rt(D[1],1,Un,S),c=D[0],d=D[1];else if(Rt(D,-1e9,Un,S),D)c=-(d=D<0?-D:D);else throw Error(Pn+S+" cannot be zero: "+D);if(y.hasOwnProperty(S="CRYPTO"))if(D=y[S],D===!!D)if(D)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=D;else throw h=!D,Error(Pn+"crypto unavailable");else h=D;else throw Error(Pn+S+" not true or false: "+D);if(y.hasOwnProperty(S="MODULO_MODE")&&(D=y[S],Rt(D,0,9,S),f=D),y.hasOwnProperty(S="POW_PRECISION")&&(D=y[S],Rt(D,0,Un,S),g=D),y.hasOwnProperty(S="FORMAT"))if(D=y[S],typeof D=="object")p=D;else throw Error(Pn+S+" not an object: "+D);if(y.hasOwnProperty(S="ALPHABET"))if(D=y[S],typeof D=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(D))b=D.slice(0,10)=="0123456789",m=D;else throw Error(Pn+S+" invalid: "+D)}else throw Error(Pn+"Object expected: "+y);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,u],RANGE:[c,d],CRYPTO:h,MODULO_MODE:f,POW_PRECISION:g,FORMAT:p,ALPHABET:m}},v.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var S,D,A=y.c,T=y.e,F=y.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&T>=-1e9&&T<=Un&&T===cr(T)){if(A[0]===0){if(T===0&&A.length===1)return!0;break e}if(S=(T+1)%Le,S<1&&(S+=Le),String(A[0]).length==S){for(S=0;S<A.length;S++)if(D=A[S],D<0||D>=_r||D!==cr(D))break e;if(D!==0)return!0}}}else if(A===null&&T===null&&(F===null||F===1||F===-1))return!0;throw Error(Pn+"Invalid BigNumber: "+y)},v.maximum=v.max=function(){return C(arguments,-1)},v.minimum=v.min=function(){return C(arguments,1)},v.random=function(){var y=9007199254740992,S=Math.random()*y&2097151?function(){return cr(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(D){var A,T,F,k,P,$=0,R=[],O=new v(a);if(D==null?D=o:Rt(D,0,Un),k=Uf(D/Le),h)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(k*=2));$<k;)P=A[$]*131072+(A[$+1]>>>11),P>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),A[$]=T[0],A[$+1]=T[1]):(R.push(P%1e14),$+=2);$=k/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(k*=7);$<k;)P=(A[$]&31)*281474976710656+A[$+1]*1099511627776+A[$+2]*4294967296+A[$+3]*16777216+(A[$+4]<<16)+(A[$+5]<<8)+A[$+6],P>=9e15?crypto.randomBytes(7).copy(A,$):(R.push(P%1e14),$+=7);$=k/7}else throw h=!1,Error(Pn+"crypto unavailable");if(!h)for(;$<k;)P=S(),P<9e15&&(R[$++]=P%1e14);for(k=R[--$],D%=Le,k&&D&&(P=Xf[Le-D],R[$]=cr(k/P)*P);R[$]===0;R.pop(),$--);if($<0)R=[F=0];else{for(F=-1;R[0]===0;R.splice(0,1),F-=Le);for($=1,P=R[0];P>=10;P/=10,$++);$<Le&&(F-=Le-$)}return O.e=F,O.c=R,O}}(),v.sum=function(){for(var y=1,S=arguments,D=new v(S[0]);y<S.length;)D=D.plus(S[y++]);return D},n=function(){var y="0123456789";function S(D,A,T,F){for(var k,P=[0],$,R=0,O=D.length;R<O;){for($=P.length;$--;P[$]*=A);for(P[0]+=F.indexOf(D.charAt(R++)),k=0;k<P.length;k++)P[k]>T-1&&(P[k+1]==null&&(P[k+1]=0),P[k+1]+=P[k]/T|0,P[k]%=T)}return P.reverse()}return function(D,A,T,F,k){var P,$,R,O,j,V,W,U,K=D.indexOf("."),ee=o,z=s;for(K>=0&&(O=g,g=0,D=D.replace(".",""),U=new v(A),V=U.pow(D.length-K),g=O,U.c=S(mi(sr(V.c),V.e,"0"),10,T,y),U.e=U.c.length),W=S(D,A,T,k?(P=m,y):(P=y,m)),R=O=W.length;W[--O]==0;W.pop());if(!W[0])return P.charAt(0);if(K<0?--R:(V.c=W,V.e=R,V.s=F,V=t(V,U,ee,z,T),W=V.c,j=V.r,R=V.e),$=R+ee+1,K=W[$],O=T/2,j=j||$<0||W[$+1]!=null,j=z<4?(K!=null||j)&&(z==0||z==(V.s<0?3:2)):K>O||K==O&&(z==4||j||z==6&&W[$-1]&1||z==(V.s<0?8:7)),$<1||!W[0])D=j?mi(P.charAt(1),-ee,P.charAt(0)):P.charAt(0);else{if(W.length=$,j)for(--T;++W[--$]>T;)W[$]=0,$||(++R,W=[1].concat(W));for(O=W.length;!W[--O];);for(K=0,D="";K<=O;D+=P.charAt(W[K++]));D=mi(D,R,P.charAt(0))}return D}}(),t=function(){function y(A,T,F){var k,P,$,R,O=0,j=A.length,V=T%Ui,W=T/Ui|0;for(A=A.slice();j--;)$=A[j]%Ui,R=A[j]/Ui|0,k=W*$+R*V,P=V*$+k%Ui*Ui+O,O=(P/F|0)+(k/Ui|0)+W*R,A[j]=P%F;return O&&(A=[O].concat(A)),A}function S(A,T,F,k){var P,$;if(F!=k)$=F>k?1:-1;else for(P=$=0;P<F;P++)if(A[P]!=T[P]){$=A[P]>T[P]?1:-1;break}return $}function D(A,T,F,k){for(var P=0;F--;)A[F]-=P,P=A[F]<T[F]?1:0,A[F]=P*k+A[F]-T[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,T,F,k,P){var $,R,O,j,V,W,U,K,ee,z,H,X,te,ie,le,ce,Q,be=A.s==T.s?1:-1,Ce=A.c,Se=T.c;if(!Ce||!Ce[0]||!Se||!Se[0])return new v(!A.s||!T.s||(Ce?Se&&Ce[0]==Se[0]:!Se)?NaN:Ce&&Ce[0]==0||!Se?be*0:be/0);for(K=new v(be),ee=K.c=[],R=A.e-T.e,be=F+R+1,P||(P=_r,R=dr(A.e/Le)-dr(T.e/Le),be=be/Le|0),O=0;Se[O]==(Ce[O]||0);O++);if(Se[O]>(Ce[O]||0)&&R--,be<0)ee.push(1),j=!0;else{for(ie=Ce.length,ce=Se.length,O=0,be+=2,V=cr(P/(Se[0]+1)),V>1&&(Se=y(Se,V,P),Ce=y(Ce,V,P),ce=Se.length,ie=Ce.length),te=ce,z=Ce.slice(0,ce),H=z.length;H<ce;z[H++]=0);Q=Se.slice(),Q=[0].concat(Q),le=Se[0],Se[1]>=P/2&&le++;do{if(V=0,$=S(Se,z,ce,H),$<0){if(X=z[0],ce!=H&&(X=X*P+(z[1]||0)),V=cr(X/le),V>1)for(V>=P&&(V=P-1),W=y(Se,V,P),U=W.length,H=z.length;S(W,z,U,H)==1;)V--,D(W,ce<U?Q:Se,U,P),U=W.length,$=1;else V==0&&($=V=1),W=Se.slice(),U=W.length;if(U<H&&(W=[0].concat(W)),D(z,W,H,P),H=z.length,$==-1)for(;S(Se,z,ce,H)<1;)V++,D(z,ce<H?Q:Se,H,P),H=z.length}else $===0&&(V++,z=[0]);ee[O++]=V,z[0]?z[H++]=Ce[te]||0:(z=[Ce[te]],H=1)}while((te++<ie||z[0]!=null)&&be--);j=z[0]!=null,ee[0]||ee.splice(0,1)}if(P==_r){for(O=1,be=ee[0];be>=10;be/=10,O++);w(K,F+(K.e=O+R*Le-1)+1,k,j)}else K.e=R,K.r=+j;return K}}();function x(y,S,D,A){var T,F,k,P,$;if(D==null?D=s:Rt(D,0,8),!y.c)return y.toString();if(T=y.c[0],k=y.e,S==null)$=sr(y.c),$=A==1||A==2&&(k<=l||k>=u)?Ru($,k):mi($,k,"0");else if(y=w(new v(y),S,D),F=y.e,$=sr(y.c),P=$.length,A==1||A==2&&(S<=F||F<=l)){for(;P<S;$+="0",P++);$=Ru($,F)}else if(S-=k,$=mi($,F,"0"),F+1>P){if(--S>0)for($+=".";S--;$+="0");}else if(S+=F-P,S>0)for(F+1==P&&($+=".");S--;$+="0");return y.s<0&&T?"-"+$:$}function C(y,S){for(var D,A,T=1,F=new v(y[0]);T<y.length;T++)A=new v(y[T]),(!A.s||(D=$a(F,A))===S||D===0&&F.s===S)&&(F=A);return F}function E(y,S,D){for(var A=1,T=S.length;!S[--T];S.pop());for(T=S[0];T>=10;T/=10,A++);return(D=A+D*Le-1)>d?y.c=y.e=null:D<c?y.c=[y.e=0]:(y.e=D,y.c=S),y}r=function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,D=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,k,P,$){var R,O=P?k:k.replace(T,"");if(A.test(O))F.s=isNaN(O)?null:O<0?-1:1;else{if(!P&&(O=O.replace(y,function(j,V,W){return R=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,!$||$==R?V:j}),$&&(R=$,O=O.replace(S,"$1").replace(D,"0.$1")),k!=O))return new v(O,R);if(v.DEBUG)throw Error(Pn+"Not a"+($?" base "+$:"")+" number: "+k);F.s=null}F.c=F.e=null}}();function w(y,S,D,A){var T,F,k,P,$,R,O,j=y.c,V=Xf;if(j){e:{for(T=1,P=j[0];P>=10;P/=10,T++);if(F=S-T,F<0)F+=Le,k=S,$=j[R=0],O=cr($/V[T-k-1]%10);else if(R=Uf((F+1)/Le),R>=j.length)if(A){for(;j.length<=R;j.push(0));$=O=0,T=1,F%=Le,k=F-Le+1}else break e;else{for($=P=j[R],T=1;P>=10;P/=10,T++);F%=Le,k=F-Le+T,O=k<0?0:cr($/V[T-k-1]%10)}if(A=A||S<0||j[R+1]!=null||(k<0?$:$%V[T-k-1]),A=D<4?(O||A)&&(D==0||D==(y.s<0?3:2)):O>5||O==5&&(D==4||A||D==6&&(F>0?k>0?$/V[T-k]:0:j[R-1])%10&1||D==(y.s<0?8:7)),S<1||!j[0])return j.length=0,A?(S-=y.e+1,j[0]=V[(Le-S%Le)%Le],y.e=-S||0):j[0]=y.e=0,y;if(F==0?(j.length=R,P=1,R--):(j.length=R+1,P=V[Le-F],j[R]=k>0?cr($/V[T-k]%V[k])*P:0),A)for(;;)if(R==0){for(F=1,k=j[0];k>=10;k/=10,F++);for(k=j[0]+=P,P=1;k>=10;k/=10,P++);F!=P&&(y.e++,j[0]==_r&&(j[0]=1));break}else{if(j[R]+=P,j[R]!=_r)break;j[R--]=0,P=1}for(F=j.length;j[--F]===0;j.pop());}y.e>d?y.c=y.e=null:y.e<c&&(y.c=[y.e=0])}return y}function B(y){var S,D=y.e;return D===null?y.toString():(S=sr(y.c),S=D<=l||D>=u?Ru(S,D):mi(S,D,"0"),y.s<0?"-"+S:S)}return i.absoluteValue=i.abs=function(){var y=new v(this);return y.s<0&&(y.s=1),y},i.comparedTo=function(y,S){return $a(this,new v(y,S))},i.decimalPlaces=i.dp=function(y,S){var D,A,T,F=this;if(y!=null)return Rt(y,0,Un),S==null?S=s:Rt(S,0,8),w(new v(F),y+F.e+1,S);if(!(D=F.c))return null;if(A=((T=D.length-1)-dr(this.e/Le))*Le,T=D[T])for(;T%10==0;T/=10,A--);return A<0&&(A=0),A},i.dividedBy=i.div=function(y,S){return t(this,new v(y,S),o,s)},i.dividedToIntegerBy=i.idiv=function(y,S){return t(this,new v(y,S),0,1)},i.exponentiatedBy=i.pow=function(y,S){var D,A,T,F,k,P,$,R,O,j=this;if(y=new v(y),y.c&&!y.isInteger())throw Error(Pn+"Exponent not an integer: "+B(y));if(S!=null&&(S=new v(S)),P=y.e>14,!j.c||!j.c[0]||j.c[0]==1&&!j.e&&j.c.length==1||!y.c||!y.c[0])return O=new v(Math.pow(+B(j),P?y.s*(2-Tu(y)):+B(y))),S?O.mod(S):O;if($=y.s<0,S){if(S.c?!S.c[0]:!S.s)return new v(NaN);A=!$&&j.isInteger()&&S.isInteger(),A&&(j=j.mod(S))}else{if(y.e>9&&(j.e>0||j.e<-1||(j.e==0?j.c[0]>1||P&&j.c[1]>=24e7:j.c[0]<8e13||P&&j.c[0]<=9999975e7)))return F=j.s<0&&Tu(y)?-0:0,j.e>-1&&(F=1/F),new v($?1/F:F);g&&(F=Uf(g/Le+2))}for(P?(D=new v(.5),$&&(y.s=1),R=Tu(y)):(T=Math.abs(+B(y)),R=T%2),O=new v(a);;){if(R){if(O=O.times(j),!O.c)break;F?O.c.length>F&&(O.c.length=F):A&&(O=O.mod(S))}if(T){if(T=cr(T/2),T===0)break;R=T%2}else if(y=y.times(D),w(y,y.e+1,1),y.e>14)R=Tu(y);else{if(T=+B(y),T===0)break;R=T%2}j=j.times(j),F?j.c&&j.c.length>F&&(j.c.length=F):A&&(j=j.mod(S))}return A?O:($&&(O=a.div(O)),S?O.mod(S):F?w(O,g,s,k):O)},i.integerValue=function(y){var S=new v(this);return y==null?y=s:Rt(y,0,8),w(S,S.e+1,y)},i.isEqualTo=i.eq=function(y,S){return $a(this,new v(y,S))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(y,S){return $a(this,new v(y,S))>0},i.isGreaterThanOrEqualTo=i.gte=function(y,S){return(S=$a(this,new v(y,S)))===1||S===0},i.isInteger=function(){return!!this.c&&dr(this.e/Le)>this.c.length-2},i.isLessThan=i.lt=function(y,S){return $a(this,new v(y,S))<0},i.isLessThanOrEqualTo=i.lte=function(y,S){return(S=$a(this,new v(y,S)))===-1||S===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(y,S){var D,A,T,F,k=this,P=k.s;if(y=new v(y,S),S=y.s,!P||!S)return new v(NaN);if(P!=S)return y.s=-S,k.plus(y);var $=k.e/Le,R=y.e/Le,O=k.c,j=y.c;if(!$||!R){if(!O||!j)return O?(y.s=-S,y):new v(j?k:NaN);if(!O[0]||!j[0])return j[0]?(y.s=-S,y):new v(O[0]?k:s==3?-0:0)}if($=dr($),R=dr(R),O=O.slice(),P=$-R){for((F=P<0)?(P=-P,T=O):(R=$,T=j),T.reverse(),S=P;S--;T.push(0));T.reverse()}else for(A=(F=(P=O.length)<(S=j.length))?P:S,P=S=0;S<A;S++)if(O[S]!=j[S]){F=O[S]<j[S];break}if(F&&(T=O,O=j,j=T,y.s=-y.s),S=(A=j.length)-(D=O.length),S>0)for(;S--;O[D++]=0);for(S=_r-1;A>P;){if(O[--A]<j[A]){for(D=A;D&&!O[--D];O[D]=S);--O[D],O[A]+=_r}O[A]-=j[A]}for(;O[0]==0;O.splice(0,1),--R);return O[0]?E(y,O,R):(y.s=s==3?-1:1,y.c=[y.e=0],y)},i.modulo=i.mod=function(y,S){var D,A,T=this;return y=new v(y,S),!T.c||!y.s||y.c&&!y.c[0]?new v(NaN):!y.c||T.c&&!T.c[0]?new v(T):(f==9?(A=y.s,y.s=1,D=t(T,y,0,3),y.s=A,D.s*=A):D=t(T,y,0,f),y=T.minus(D.times(y)),!y.c[0]&&f==1&&(y.s=T.s),y)},i.multipliedBy=i.times=function(y,S){var D,A,T,F,k,P,$,R,O,j,V,W,U,K,ee,z=this,H=z.c,X=(y=new v(y,S)).c;if(!H||!X||!H[0]||!X[0])return!z.s||!y.s||H&&!H[0]&&!X||X&&!X[0]&&!H?y.c=y.e=y.s=null:(y.s*=z.s,!H||!X?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(A=dr(z.e/Le)+dr(y.e/Le),y.s*=z.s,$=H.length,j=X.length,$<j&&(U=H,H=X,X=U,T=$,$=j,j=T),T=$+j,U=[];T--;U.push(0));for(K=_r,ee=Ui,T=j;--T>=0;){for(D=0,V=X[T]%ee,W=X[T]/ee|0,k=$,F=T+k;F>T;)R=H[--k]%ee,O=H[k]/ee|0,P=W*R+O*V,R=V*R+P%ee*ee+U[F]+D,D=(R/K|0)+(P/ee|0)+W*O,U[F--]=R%K;U[F]=D}return D?++A:U.splice(0,1),E(y,U,A)},i.negated=function(){var y=new v(this);return y.s=-y.s||null,y},i.plus=function(y,S){var D,A=this,T=A.s;if(y=new v(y,S),S=y.s,!T||!S)return new v(NaN);if(T!=S)return y.s=-S,A.minus(y);var F=A.e/Le,k=y.e/Le,P=A.c,$=y.c;if(!F||!k){if(!P||!$)return new v(T/0);if(!P[0]||!$[0])return $[0]?y:new v(P[0]?A:T*0)}if(F=dr(F),k=dr(k),P=P.slice(),T=F-k){for(T>0?(k=F,D=$):(T=-T,D=P),D.reverse();T--;D.push(0));D.reverse()}for(T=P.length,S=$.length,T-S<0&&(D=$,$=P,P=D,S=T),T=0;S;)T=(P[--S]=P[S]+$[S]+T)/_r|0,P[S]=_r===P[S]?0:P[S]%_r;return T&&(P=[T].concat(P),++k),E(y,P,k)},i.precision=i.sd=function(y,S){var D,A,T,F=this;if(y!=null&&y!==!!y)return Rt(y,1,Un),S==null?S=s:Rt(S,0,8),w(new v(F),y,S);if(!(D=F.c))return null;if(T=D.length-1,A=T*Le+1,T=D[T]){for(;T%10==0;T/=10,A--);for(T=D[0];T>=10;T/=10,A++);}return y&&F.e+1>A&&(A=F.e+1),A},i.shiftedBy=function(y){return Rt(y,-9007199254740991,h1),this.times("1e"+y)},i.squareRoot=i.sqrt=function(){var y,S,D,A,T,F=this,k=F.c,P=F.s,$=F.e,R=o+4,O=new v("0.5");if(P!==1||!k||!k[0])return new v(!P||P<0&&(!k||k[0])?NaN:k?F:1/0);if(P=Math.sqrt(+B(F)),P==0||P==1/0?(S=sr(k),(S.length+$)%2==0&&(S+="0"),P=Math.sqrt(+S),$=dr(($+1)/2)-($<0||$%2),P==1/0?S="5e"+$:(S=P.toExponential(),S=S.slice(0,S.indexOf("e")+1)+$),D=new v(S)):D=new v(P+""),D.c[0]){for($=D.e,P=$+R,P<3&&(P=0);;)if(T=D,D=O.times(T.plus(t(F,T,R,1))),sr(T.c).slice(0,P)===(S=sr(D.c)).slice(0,P))if(D.e<$&&--P,S=S.slice(P-3,P+1),S=="9999"||!A&&S=="4999"){if(!A&&(w(T,T.e+o+2,0),T.times(T).eq(F))){D=T;break}R+=4,P+=4,A=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(w(D,D.e+o+2,1),y=!D.times(D).eq(F));break}}return w(D,D.e+o+1,s,y)},i.toExponential=function(y,S){return y!=null&&(Rt(y,0,Un),y++),x(this,y,S,1)},i.toFixed=function(y,S){return y!=null&&(Rt(y,0,Un),y=y+this.e+1),x(this,y,S)},i.toFormat=function(y,S,D){var A,T=this;if(D==null)y!=null&&S&&typeof S=="object"?(D=S,S=null):y&&typeof y=="object"?(D=y,y=S=null):D=p;else if(typeof D!="object")throw Error(Pn+"Argument not an object: "+D);if(A=T.toFixed(y,S),T.c){var F,k=A.split("."),P=+D.groupSize,$=+D.secondaryGroupSize,R=D.groupSeparator||"",O=k[0],j=k[1],V=T.s<0,W=V?O.slice(1):O,U=W.length;if($&&(F=P,P=$,$=F,U-=F),P>0&&U>0){for(F=U%P||P,O=W.substr(0,F);F<U;F+=P)O+=R+W.substr(F,P);$>0&&(O+=R+W.slice(F)),V&&(O="-"+O)}A=j?O+(D.decimalSeparator||"")+(($=+D.fractionGroupSize)?j.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(D.fractionGroupSeparator||"")):j):O}return(D.prefix||"")+A+(D.suffix||"")},i.toFraction=function(y){var S,D,A,T,F,k,P,$,R,O,j,V,W=this,U=W.c;if(y!=null&&(P=new v(y),!P.isInteger()&&(P.c||P.s!==1)||P.lt(a)))throw Error(Pn+"Argument "+(P.isInteger()?"out of range: ":"not an integer: ")+B(P));if(!U)return new v(W);for(S=new v(a),R=D=new v(a),A=$=new v(a),V=sr(U),F=S.e=V.length-W.e-1,S.c[0]=Xf[(k=F%Le)<0?Le+k:k],y=!y||P.comparedTo(S)>0?F>0?S:R:P,k=d,d=1/0,P=new v(V),$.c[0]=0;O=t(P,S,0,1),T=D.plus(O.times(A)),T.comparedTo(y)!=1;)D=A,A=T,R=$.plus(O.times(T=R)),$=T,S=P.minus(O.times(T=S)),P=T;return T=t(y.minus(D),A,0,1),$=$.plus(T.times(R)),D=D.plus(T.times(A)),$.s=R.s=W.s,F=F*2,j=t(R,A,F,s).minus(W).abs().comparedTo(t($,D,F,s).minus(W).abs())<1?[R,A]:[$,D],d=k,j},i.toNumber=function(){return+B(this)},i.toPrecision=function(y,S){return y!=null&&Rt(y,1,Un),x(this,y,S,2)},i.toString=function(y){var S,D=this,A=D.s,T=D.e;return T===null?A?(S="Infinity",A<0&&(S="-"+S)):S="NaN":(y==null?S=T<=l||T>=u?Ru(sr(D.c),T):mi(sr(D.c),T,"0"):y===10&&b?(D=w(new v(D),o+T+1,s),S=mi(sr(D.c),D.e,"0")):(Rt(y,2,m.length,"Base"),S=n(mi(sr(D.c),T,"0"),10,y,A,!0)),A<0&&D.c[0]&&(S="-"+S)),S},i.valueOf=i.toJSON=function(){return B(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&v.set(e),v}function dr(e){var t=e|0;return e>0||e===t?t:t-1}function sr(e){for(var t,n,r=1,i=e.length,a=e[0]+"";r<i;){for(t=e[r++]+"",n=Le-t.length;n--;t="0"+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function $a(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!i||!a)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(s=(l=i.length)<(u=a.length)?l:u,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return l==u?0:l>u^n?1:-1}function Rt(e,t,n,r){if(e<t||e>n||e!==cr(e))throw Error(Pn+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Tu(e){var t=e.c.length-1;return dr(e.e/Le)==t&&e.c[t]%2!=0}function Ru(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function mi(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Jd=iC();const aC={ROUNDING_MODE:Jd.ROUND_HALF_UP,EXPONENTIAL_AT:[-1e9,1e9]};let x0=!1;const i6=(e=aC)=>{x0||(Jd.config(e),x0=!0)},At=(e,t)=>(x0||i6(),new Jd(e,t));var a6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o6(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ze={options:{usePureJavaScript:!1}},Kg={},l6=Kg,g1={};Kg.encode=function(e,t,n){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(n!==void 0&&typeof n!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=u6(e,t);else{var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var l=0,u=e[i];l<s.length;++l)u+=s[l]<<8,s[l]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(i=0;e[i]===0&&i<e.length-1;++i)r+=o;for(i=s.length-1;i>=0;--i)r+=t[s[i]]}if(n){var c=new RegExp(".{1,"+n+"}","g");r=r.match(c).join(`\r
2
2
  `)}return r};Kg.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var n=g1[t];if(!n){n=g1[t]=[];for(var r=0;r<t.length;++r)n[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var i=t.length,a=t.charAt(0),o=[0],r=0;r<e.length;r++){var s=n[e.charCodeAt(r)];if(s===void 0)return;for(var l=0,u=s;l<o.length;++l)u+=o[l]*i,o[l]=u&255,u>>=8;for(;u>0;)o.push(u&255),u>>=8}for(var c=0;e[c]===a&&c<e.length-1;++c)o.push(0);return typeof Buffer<"u"?Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function u6(e,t){var n=0,r=t.length,i=t.charAt(0),a=[0];for(n=0;n<e.length();++n){for(var o=0,s=e.at(n);o<a.length;++o)s+=a[o]<<8,a[o]=s%r,s=s/r|0;for(;s>0;)a.push(s%r),s=s/r|0}var l="";for(n=0;e.at(n)===0&&n<e.length()-1;++n)l+=i;for(n=a.length-1;n>=0;--n)l+=t[a[n]];return l}var p1=ze,m1=l6,Y=p1.util=p1.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){Y.nextTick=process.nextTick,typeof setImmediate=="function"?Y.setImmediate=setImmediate:Y.setImmediate=Y.nextTick;return}if(typeof setImmediate=="function"){Y.setImmediate=function(){return setImmediate.apply(void 0,arguments)},Y.nextTick=function(o){return setImmediate(o)};return}if(Y.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(s){if(s.source===window&&s.data===e){s.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(u){u()})}};var e="forge.setImmediate",t=[];Y.setImmediate=function(s){t.push(s),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var n=Date.now(),r=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var s=t.slice();t.length=0,s.forEach(function(l){l()})}).observe(i,{attributes:!0});var a=Y.setImmediate;Y.setImmediate=function(s){Date.now()-n>15?(n=Date.now(),a(s)):(t.push(s),t.length===1&&i.setAttribute("a",r=!r))}}Y.nextTick=Y.setImmediate})();Y.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;Y.globalScope=function(){return Y.isNodejs?a6:typeof self>"u"?window:self}();Y.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};Y.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};Y.isArrayBufferView=function(e){return e&&Y.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function du(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}Y.ByteBuffer=qg;function qg(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(Y.isArrayBuffer(e)||Y.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var n=0;n<t.length;++n)this.putByte(t[n])}}else(e instanceof qg||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}Y.ByteStringBuffer=qg;var c6=4096;Y.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>c6&&(this.data.substr(0,1),this._constructedStringLength=0)};Y.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};Y.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};Y.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};Y.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)t&1&&(n+=e),t>>>=1,t>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this};Y.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};Y.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(Y.encodeUtf8(e))};Y.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};Y.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};Y.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};Y.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};Y.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};Y.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};Y.ByteStringBuffer.prototype.putInt=function(e,t){du(t);var n="";do t-=8,n+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(n)};Y.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};Y.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};Y.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};Y.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};Y.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};Y.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};Y.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};Y.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};Y.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};Y.ByteStringBuffer.prototype.getInt=function(e){du(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};Y.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<<e-2;return t>=n&&(t-=n<<1),t};Y.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};Y.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};Y.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};Y.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};Y.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};Y.ByteStringBuffer.prototype.copy=function(){var e=Y.createBuffer(this.data);return e.read=this.read,e};Y.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};Y.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};Y.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};Y.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var n=this.data.charCodeAt(t);n<16&&(e+="0"),e+=n.toString(16)}return e};Y.ByteStringBuffer.prototype.toString=function(){return Y.decodeUtf8(this.bytes())};function d6(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var n=Y.isArrayBuffer(e),r=Y.isArrayBufferView(e);if(n||r){n?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}Y.DataBuffer=d6;Y.DataBuffer.prototype.length=function(){return this.write-this.read};Y.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};Y.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(n),this.data=new DataView(r.buffer),this};Y.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};Y.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var n=0;n<t;++n)this.data.setUint8(e);return this};Y.DataBuffer.prototype.putBytes=function(e,t){if(Y.isArrayBufferView(e)){var n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n.byteLength-n.byteOffset;this.accommodate(r);var i=new Uint8Array(this.data.buffer,this.write);return i.set(n),this.write+=r,this}if(Y.isArrayBuffer(e)){var n=new Uint8Array(e);this.accommodate(n.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(n,this.write),this.write+=n.byteLength,this}if(e instanceof Y.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&Y.isArrayBufferView(e.data)){var n=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(n.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(n),this.write+=n.byteLength,this}if(e instanceof Y.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var a;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=Y.binary.hex.decode(e,a,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=Y.binary.base64.decode(e,a,this.write),this;if(t==="utf8"&&(e=Y.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=Y.binary.raw.decode(a),this;if(t==="utf16")return this.accommodate(e.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=Y.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};Y.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};Y.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};Y.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};Y.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};Y.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};Y.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};Y.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};Y.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};Y.DataBuffer.prototype.putInt=function(e,t){du(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};Y.DataBuffer.prototype.putSignedInt=function(e,t){return du(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};Y.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};Y.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};Y.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};Y.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};Y.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};Y.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};Y.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};Y.DataBuffer.prototype.getInt=function(e){du(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};Y.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<<e-2;return t>=n&&(t-=n<<1),t};Y.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};Y.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};Y.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};Y.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};Y.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};Y.DataBuffer.prototype.copy=function(){return new Y.DataBuffer(this)};Y.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};Y.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};Y.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};Y.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var n=this.data.getUint8(t);n<16&&(e+="0"),e+=n.toString(16)}return e};Y.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return Y.binary.raw.encode(t);if(e==="hex")return Y.binary.hex.encode(t);if(e==="base64")return Y.binary.base64.encode(t);if(e==="utf8")return Y.text.utf8.decode(t);if(e==="utf16")return Y.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};Y.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=Y.encodeUtf8(e)),new Y.ByteBuffer(e)};Y.fillString=function(e,t){for(var n="";t>0;)t&1&&(n+=e),t>>>=1,t>0&&(e+=e);return n};Y.xorBytes=function(e,t,n){for(var r="",i="",a="",o=0,s=0;n>0;--n,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(r+=a,a="",s=0),a+=String.fromCharCode(i),++s;return r+=a,r};Y.hexToBytes=function(e){var t="",n=0;for(e.length&!0&&(n=1,t+=String.fromCharCode(parseInt(e[0],16)));n<e.length;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t};Y.bytesToHex=function(e){return Y.createBuffer(e).toHex()};Y.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var ia="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",aa=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],oC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Y.encode64=function(e,t){for(var n="",r="",i,a,o,s=0;s<e.length;)i=e.charCodeAt(s++),a=e.charCodeAt(s++),o=e.charCodeAt(s++),n+=ia.charAt(i>>2),n+=ia.charAt((i&3)<<4|a>>4),isNaN(a)?n+="==":(n+=ia.charAt((a&15)<<2|o>>6),n+=isNaN(o)?"=":ia.charAt(o&63)),t&&n.length>t&&(r+=n.substr(0,t)+`\r
3
3
  `,n=n.substr(t));return r+=n,r};Y.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",n,r,i,a,o=0;o<e.length;)n=aa[e.charCodeAt(o++)-43],r=aa[e.charCodeAt(o++)-43],i=aa[e.charCodeAt(o++)-43],a=aa[e.charCodeAt(o++)-43],t+=String.fromCharCode(n<<2|r>>4),i!==64&&(t+=String.fromCharCode((r&15)<<4|i>>2),a!==64&&(t+=String.fromCharCode((i&3)<<6|a)));return t};Y.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};Y.decodeUtf8=function(e){return decodeURIComponent(escape(e))};Y.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:m1.encode,decode:m1.decode}};Y.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};Y.binary.raw.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length)),n=n||0;for(var i=n,a=0;a<e.length;++a)r[i++]=e.charCodeAt(a);return t?i-n:r};Y.binary.hex.encode=Y.bytesToHex;Y.binary.hex.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),n=n||0;var i=0,a=n;for(e.length&1&&(i=1,r[a++]=parseInt(e[0],16));i<e.length;i+=2)r[a++]=parseInt(e.substr(i,2),16);return t?a-n:r};Y.binary.base64.encode=function(e,t){for(var n="",r="",i,a,o,s=0;s<e.byteLength;)i=e[s++],a=e[s++],o=e[s++],n+=ia.charAt(i>>2),n+=ia.charAt((i&3)<<4|a>>4),isNaN(a)?n+="==":(n+=ia.charAt((a&15)<<2|o>>6),n+=isNaN(o)?"=":ia.charAt(o&63)),t&&n.length>t&&(r+=n.substr(0,t)+`\r
4
4
  `,n=n.substr(t));return r+=n,r};Y.binary.base64.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=n||0;for(var i,a,o,s,l=0,u=n;l<e.length;)i=aa[e.charCodeAt(l++)-43],a=aa[e.charCodeAt(l++)-43],o=aa[e.charCodeAt(l++)-43],s=aa[e.charCodeAt(l++)-43],r[u++]=i<<2|a>>4,o!==64&&(r[u++]=(a&15)<<4|o>>2,s!==64&&(r[u++]=(o&3)<<6|s));return t?u-n:r.subarray(0,u)};Y.binary.base58.encode=function(e,t){return Y.binary.baseN.encode(e,oC,t)};Y.binary.base58.decode=function(e,t){return Y.binary.baseN.decode(e,oC,t)};Y.text={utf8:{},utf16:{}};Y.text.utf8.encode=function(e,t,n){e=Y.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),n=n||0;for(var i=n,a=0;a<e.length;++a)r[i++]=e.charCodeAt(a);return t?i-n:r};Y.text.utf8.decode=function(e){return Y.decodeUtf8(String.fromCharCode.apply(null,e))};Y.text.utf16.encode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length*2));var i=new Uint16Array(r.buffer);n=n||0;for(var a=n,o=n,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-n:r};Y.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};Y.deflate=function(e,t,n){if(t=Y.decode64(e.deflate(Y.encode64(t)).rval),n){var r=2,i=t.charCodeAt(1);i&32&&(r=6),t=t.substring(r,t.length-4)}return t};Y.inflate=function(e,t,n){var r=e.inflate(Y.encode64(t)).rval;return r===null?null:Y.decode64(r)};var Jg=function(e,t,n){if(!e)throw new Error("WebStorage not available.");var r;if(n===null?r=e.removeItem(t):(n=Y.encode64(JSON.stringify(n)),r=e.setItem(t,n)),typeof r<"u"&&r.rval!==!0){var i=new Error(r.error.message);throw i.id=r.error.id,i.name=r.error.name,i}},Qg=function(e,t){if(!e)throw new Error("WebStorage not available.");var n=e.getItem(t);if(e.init)if(n.rval===null){if(n.error){var r=new Error(n.error.message);throw r.id=n.error.id,r.name=n.error.name,r}n=null}else n=n.rval;return n!==null&&(n=JSON.parse(Y.decode64(n))),n},f6=function(e,t,n,r){var i=Qg(e,t);i===null&&(i={}),i[n]=r,Jg(e,t,i)},h6=function(e,t,n){var r=Qg(e,t);return r!==null&&(r=n in r?r[n]:null),r},g6=function(e,t,n){var r=Qg(e,t);if(r!==null&&n in r){delete r[n];var i=!0;for(var a in r){i=!1;break}i&&(r=null),Jg(e,t,r)}},p6=function(e,t){Jg(e,t,null)},Qd=function(e,t,n){var r=null;typeof n>"u"&&(n=["web","flash"]);var i,a=!1,o=null;for(var s in n){i=n[s];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),a=i==="flash"}(i==="web"||i==="both")&&(t[0]=localStorage,r=e.apply(this,t),a=!0)}catch(l){o=l}if(a)break}if(!a)throw o;return r};Y.setItem=function(e,t,n,r,i){Qd(f6,arguments,i)};Y.getItem=function(e,t,n,r){return Qd(h6,arguments,r)};Y.removeItem=function(e,t,n,r){Qd(g6,arguments,r)};Y.clearItems=function(e,t,n){Qd(p6,arguments,n)};Y.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};Y.format=function(e){for(var t=/%./g,n,r,i=0,a=[],o=0;n=t.exec(e);){r=e.substring(o,t.lastIndex-2),r.length>0&&a.push(r),o=t.lastIndex;var s=n[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")};Y.formatNumber=function(e,t,n,r){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=n===void 0?",":n,s=r===void 0?".":r,l=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=u.length>3?u.length%3:0;return l+(c?u.substr(0,c)+s:"")+u.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-u).toFixed(a).slice(2):"")};Y.formatSize=function(e){return e>=1073741824?e=Y.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=Y.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=Y.formatNumber(e/1024,0)+" KiB":e=Y.formatNumber(e,0)+" bytes",e};Y.bytesFromIP=function(e){return e.indexOf(".")!==-1?Y.bytesFromIPv4(e):e.indexOf(":")!==-1?Y.bytesFromIPv6(e):null};Y.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=Y.createBuffer(),n=0;n<e.length;++n){var r=parseInt(e[n],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()};Y.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(o){return o.length===0&&++t,!0});for(var n=(8-e.length+t)*2,r=Y.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){r.fillWithByte(0,n),n=0;continue}var a=Y.hexToBytes(e[i]);a.length<2&&r.putByte(0),r.putBytes(a)}return r.getBytes()};Y.bytesToIP=function(e){return e.length===4?Y.bytesToIPv4(e):e.length===16?Y.bytesToIPv6(e):null};Y.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t.join(".")};Y.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],n=[],r=0,i=0;i<e.length;i+=2){for(var a=Y.bytesToHex(e[i]+e[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var o=n[n.length-1],s=t.length;!o||s!==o.end+1?n.push({start:s,end:s}):(o.end=s,o.end-o.start>n[r].end-n[r].start&&(r=n.length-1))}t.push(a)}if(n.length>0){var l=n[r];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,""),l.start===0&&t.unshift(""),l.end===7&&t.push(""))}return t.join(":")};Y.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in Y&&!e.update)return t(null,Y.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return Y.cores=navigator.hardwareConcurrency,t(null,Y.cores);if(typeof Worker>"u")return Y.cores=1,t(null,Y.cores);if(typeof Blob>"u")return Y.cores=2,t(null,Y.cores);var n=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(o){var s=Date.now(),l=s+4;self.postMessage({st:s,et:l})})}).toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(o,s,l){if(s===0){var u=Math.floor(o.reduce(function(c,d){return c+d},0)/o.length);return Y.cores=Math.max(1,u),URL.revokeObjectURL(n),t(null,Y.cores)}i(l,function(c,d){o.push(a(l,d)),r(o,s-1,l)})}function i(o,s){for(var l=[],u=[],c=0;c<o;++c){var d=new Worker(n);d.addEventListener("message",function(h){if(u.push(h.data),u.length===o){for(var f=0;f<o;++f)l[f].terminate();s(null,u)}}),l.push(d)}for(var c=0;c<o;++c)l[c].postMessage(c)}function a(o,s){for(var l=[],u=0;u<o;++u)for(var c=s[u],d=l[u]=[],h=0;h<o;++h)if(u!==h){var f=s[h];(c.st>f.st&&c.st<f.et||f.st>c.st&&f.st<c.et)&&d.push(h)}return l.reduce(function(g,p){return Math.max(g,p.length)},0)}};var ln=ze;ln.cipher=ln.cipher||{};ln.cipher.algorithms=ln.cipher.algorithms||{};ln.cipher.createCipher=function(e,t){var n=e;if(typeof n=="string"&&(n=ln.cipher.getAlgorithm(n),n&&(n=n())),!n)throw new Error("Unsupported algorithm: "+e);return new ln.cipher.BlockCipher({algorithm:n,key:t,decrypt:!1})};ln.cipher.createDecipher=function(e,t){var n=e;if(typeof n=="string"&&(n=ln.cipher.getAlgorithm(n),n&&(n=n())),!n)throw new Error("Unsupported algorithm: "+e);return new ln.cipher.BlockCipher({algorithm:n,key:t,decrypt:!0})};ln.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),ln.cipher.algorithms[e]=t};ln.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in ln.cipher.algorithms?ln.cipher.algorithms[e]:null};var ep=ln.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};ep.prototype.start=function(e){e=e||{};var t={};for(var n in e)t[n]=e[n];t.decrypt=this._decrypt,this._finish=!1,this._input=ln.util.createBuffer(),this.output=e.output||ln.util.createBuffer(),this.mode.start(t)};ep.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};ep.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(n){return e(this.blockSize,n,!1)},this.mode.unpad=function(n){return e(this.blockSize,n,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))};var an=ze;an.cipher=an.cipher||{};var Ye=an.cipher.modes=an.cipher.modes||{};Ye.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ye.ecb.prototype.start=function(e){};Ye.ecb.prototype.encrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};Ye.ecb.prototype.decrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};Ye.ecb.prototype.pad=function(e,t){var n=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(n,n),!0};Ye.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var n=e.length(),r=e.at(n-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};Ye.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ye.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=ef(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Ye.cbc.prototype.encrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock};Ye.cbc.prototype.decrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};Ye.cbc.prototype.pad=function(e,t){var n=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(n,n),!0};Ye.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var n=e.length(),r=e.at(n-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};Ye.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=an.util.createBuffer(),this._partialBytes=0};Ye.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ef(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ye.cfb.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Ye.cfb.prototype.decrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Ye.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=an.util.createBuffer(),this._partialBytes=0};Ye.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ef(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ye.ofb.prototype.encrypt=function(e,t,n){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Ye.ofb.prototype.decrypt=Ye.ofb.prototype.encrypt;Ye.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=an.util.createBuffer(),this._partialBytes=0};Ye.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ef(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ye.ctr.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}tf(this._inBlock)};Ye.ctr.prototype.decrypt=Ye.ctr.prototype.encrypt;Ye.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=an.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Ye.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=an.util.createBuffer(e.iv);this._cipherLength=0;var n;if("additionalData"in e?n=an.util.createBuffer(e.additionalData):n=an.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=an.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(C0(r*8)))}this._inBlock=this._j0.slice(0),tf(this._inBlock),this._partialBytes=0,n=an.util.createBuffer(n),this._aDataLength=C0(n.length()*8);var i=n.length()%this.blockSize;for(i&&n.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];n.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[n.getInt32(),n.getInt32(),n.getInt32(),n.getInt32()])};Ye.gcm.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||n){if(n){var o=r%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),tf(this._inBlock)};Ye.gcm.prototype.decrypt=function(e,t,n){var r=e.length();if(r<this.blockSize&&!(n&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),tf(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};Ye.gcm.prototype.afterFinish=function(e,t){var n=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=an.util.createBuffer();var r=this._aDataLength.concat(C0(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(n=!1),n};Ye.gcm.prototype.multiply=function(e,t){for(var n=[0,0,0,0],r=t.slice(0),i=0;i<128;++i){var a=e[i/32|0]&1<<31-i%32;a&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),this.pow(r,r)}return n};Ye.gcm.prototype.pow=function(e,t){for(var n=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,n&&(t[0]^=this._R)};Ye.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],n=0;n<32;++n){var r=n/8|0,i=e[r]>>>(7-n%8)*4&15,a=this._m[n][i];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t};Ye.gcm.prototype.ghash=function(e,t,n){return t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3],this.tableMultiply(t)};Ye.gcm.prototype.generateHashTable=function(e,t){for(var n=8/t,r=4*n,i=16*n,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],l=o/r|0,u=(r-1-o%r)*t;s[l]=1<<t-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a};Ye.gcm.prototype.generateSubHashTable=function(e,t){var n=1<<t,r=n>>>1,i=new Array(n);i[r]=e.slice(0);for(var a=r>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<r;){for(var o=1;o<a;++o){var s=i[a],l=i[o];i[a+o]=[s[0]^l[0],s[1]^l[1],s[2]^l[2],s[3]^l[3]]}a*=2}for(i[0]=[0,0,0,0],a=r+1;a<n;++a){var u=i[a^r];i[a]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i};function ef(e,t){if(typeof e=="string"&&(e=an.util.createBuffer(e)),an.util.isArray(e)&&e.length>4){var n=e;e=an.util.createBuffer();for(var r=0;r<n.length;++r)e.putByte(n[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!an.util.isArray(e)){for(var i=[],a=t/4,r=0;r<a;++r)i.push(e.getInt32());e=i}return e}function tf(e){e[e.length-1]=e[e.length-1]+1&4294967295}function C0(e){return[e/4294967296|0,e&4294967295]}var Ct=ze;Ct.aes=Ct.aes||{};Ct.aes.startEncrypting=function(e,t,n,r){var i=nf({key:e,output:n,decrypt:!1,mode:r});return i.start(t),i};Ct.aes.createEncryptionCipher=function(e,t){return nf({key:e,output:null,decrypt:!1,mode:t})};Ct.aes.startDecrypting=function(e,t,n,r){var i=nf({key:e,output:n,decrypt:!0,mode:r});return i.start(t),i};Ct.aes.createDecryptionCipher=function(e,t){return nf({key:e,output:null,decrypt:!0,mode:t})};Ct.aes.Algorithm=function(e,t){tp||lC();var n=this;n.name=e,n.mode=new t({blockSize:16,cipher:{encrypt:function(r,i){return S0(n._w,r,i,!1)},decrypt:function(r,i){return S0(n._w,r,i,!0)}}}),n._init=!1};Ct.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,n;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Ct.util.createBuffer(t);else if(Ct.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){n=t,t=Ct.util.createBuffer();for(var r=0;r<n.length;++r)t.putByte(n[r])}if(!Ct.util.isArray(t)){n=t,t=[];var i=n.length();if(i===16||i===24||i===32){i=i>>>2;for(var r=0;r<i;++r)t.push(n.getInt32())}}if(!Ct.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,o=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=uC(t,e.decrypt&&!o),this._init=!0}};Ct.aes._expandKey=function(e,t){return tp||lC(),uC(e,t)};Ct.aes._updateBlock=S0;_s("AES-ECB",Ct.cipher.modes.ecb);_s("AES-CBC",Ct.cipher.modes.cbc);_s("AES-CFB",Ct.cipher.modes.cfb);_s("AES-OFB",Ct.cipher.modes.ofb);_s("AES-CTR",Ct.cipher.modes.ctr);_s("AES-GCM",Ct.cipher.modes.gcm);function _s(e,t){var n=function(){return new Ct.aes.Algorithm(e,t)};Ct.cipher.registerAlgorithm(e,n)}var tp=!1,$o=4,In,E0,sC,qa,Rr;function lC(){tp=!0,sC=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;In=new Array(256),E0=new Array(256),qa=new Array(4),Rr=new Array(4);for(var t=0;t<4;++t)qa[t]=new Array(256),Rr[t]=new Array(256);for(var n=0,r=0,i,a,o,s,l,u,c,t=0;t<256;++t){s=r^r<<1^r<<2^r<<3^r<<4,s=s>>8^s&255^99,In[n]=s,E0[s]=n,l=e[s],i=e[n],a=e[i],o=e[a],u=l<<24^s<<16^s<<8^(s^l),c=(i^a^o)<<24^(n^o)<<16^(n^a^o)<<8^(n^i^o);for(var d=0;d<4;++d)qa[d][n]=u,Rr[d][s]=c,u=u<<24|u>>>8,c=c<<24|c>>>8;n===0?n=r=1:(n=i^e[e[e[i^o]]],r^=e[e[r]])}}function uC(e,t){for(var n=e.slice(0),r,i=1,a=n.length,o=a+6+1,s=$o*o,l=a;l<s;++l)r=n[l-1],l%a===0?(r=In[r>>>16&255]<<24^In[r>>>8&255]<<16^In[r&255]<<8^In[r>>>24]^sC[i]<<24,i++):a>6&&l%a===4&&(r=In[r>>>24]<<24^In[r>>>16&255]<<16^In[r>>>8&255]<<8^In[r&255]),n[l]=n[l-a]^r;if(t){var u,c=Rr[0],d=Rr[1],h=Rr[2],f=Rr[3],g=n.slice(0);s=n.length;for(var l=0,p=s-$o;l<s;l+=$o,p-=$o)if(l===0||l===s-$o)g[l]=n[p],g[l+1]=n[p+3],g[l+2]=n[p+2],g[l+3]=n[p+1];else for(var m=0;m<$o;++m)u=n[p+m],g[l+(3&-m)]=c[In[u>>>24]]^d[In[u>>>16&255]]^h[In[u>>>8&255]]^f[In[u&255]];n=g}return n}function S0(e,t,n,r){var i=e.length/4-1,a,o,s,l,u;r?(a=Rr[0],o=Rr[1],s=Rr[2],l=Rr[3],u=E0):(a=qa[0],o=qa[1],s=qa[2],l=qa[3],u=In);var c,d,h,f,g,p,m;c=t[0]^e[0],d=t[r?3:1]^e[1],h=t[2]^e[2],f=t[r?1:3]^e[3];for(var b=3,v=1;v<i;++v)g=a[c>>>24]^o[d>>>16&255]^s[h>>>8&255]^l[f&255]^e[++b],p=a[d>>>24]^o[h>>>16&255]^s[f>>>8&255]^l[c&255]^e[++b],m=a[h>>>24]^o[f>>>16&255]^s[c>>>8&255]^l[d&255]^e[++b],f=a[f>>>24]^o[c>>>16&255]^s[d>>>8&255]^l[h&255]^e[++b],c=g,d=p,h=m;n[0]=u[c>>>24]<<24^u[d>>>16&255]<<16^u[h>>>8&255]<<8^u[f&255]^e[++b],n[r?3:1]=u[d>>>24]<<24^u[h>>>16&255]<<16^u[f>>>8&255]<<8^u[c&255]^e[++b],n[2]=u[h>>>24]<<24^u[f>>>16&255]<<16^u[c>>>8&255]<<8^u[d&255]^e[++b],n[r?1:3]=u[f>>>24]<<24^u[c>>>16&255]<<16^u[d>>>8&255]<<8^u[h&255]^e[++b]}function nf(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),n="AES-"+t,r;e.decrypt?r=Ct.cipher.createDecipher(n,e.key):r=Ct.cipher.createCipher(n,e.key);var i=r.start;return r.start=function(a,o){var s=null;o instanceof Ct.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(r,o)},r}var ul=ze;ul.pki=ul.pki||{};var w0=ul.pki.oids=ul.oids=ul.oids||{};function se(e,t){w0[e]=t,w0[t]=e}function dt(e,t){w0[e]=t}se("1.2.840.113549.1.1.1","rsaEncryption");se("1.2.840.113549.1.1.4","md5WithRSAEncryption");se("1.2.840.113549.1.1.5","sha1WithRSAEncryption");se("1.2.840.113549.1.1.7","RSAES-OAEP");se("1.2.840.113549.1.1.8","mgf1");se("1.2.840.113549.1.1.9","pSpecified");se("1.2.840.113549.1.1.10","RSASSA-PSS");se("1.2.840.113549.1.1.11","sha256WithRSAEncryption");se("1.2.840.113549.1.1.12","sha384WithRSAEncryption");se("1.2.840.113549.1.1.13","sha512WithRSAEncryption");se("1.3.101.112","EdDSA25519");se("1.2.840.10040.4.3","dsa-with-sha1");se("1.3.14.3.2.7","desCBC");se("1.3.14.3.2.26","sha1");se("1.3.14.3.2.29","sha1WithRSASignature");se("2.16.840.1.101.3.4.2.1","sha256");se("2.16.840.1.101.3.4.2.2","sha384");se("2.16.840.1.101.3.4.2.3","sha512");se("2.16.840.1.101.3.4.2.4","sha224");se("2.16.840.1.101.3.4.2.5","sha512-224");se("2.16.840.1.101.3.4.2.6","sha512-256");se("1.2.840.113549.2.2","md2");se("1.2.840.113549.2.5","md5");se("1.2.840.113549.1.7.1","data");se("1.2.840.113549.1.7.2","signedData");se("1.2.840.113549.1.7.3","envelopedData");se("1.2.840.113549.1.7.4","signedAndEnvelopedData");se("1.2.840.113549.1.7.5","digestedData");se("1.2.840.113549.1.7.6","encryptedData");se("1.2.840.113549.1.9.1","emailAddress");se("1.2.840.113549.1.9.2","unstructuredName");se("1.2.840.113549.1.9.3","contentType");se("1.2.840.113549.1.9.4","messageDigest");se("1.2.840.113549.1.9.5","signingTime");se("1.2.840.113549.1.9.6","counterSignature");se("1.2.840.113549.1.9.7","challengePassword");se("1.2.840.113549.1.9.8","unstructuredAddress");se("1.2.840.113549.1.9.14","extensionRequest");se("1.2.840.113549.1.9.20","friendlyName");se("1.2.840.113549.1.9.21","localKeyId");se("1.2.840.113549.1.9.22.1","x509Certificate");se("1.2.840.113549.1.12.10.1.1","keyBag");se("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");se("1.2.840.113549.1.12.10.1.3","certBag");se("1.2.840.113549.1.12.10.1.4","crlBag");se("1.2.840.113549.1.12.10.1.5","secretBag");se("1.2.840.113549.1.12.10.1.6","safeContentsBag");se("1.2.840.113549.1.5.13","pkcs5PBES2");se("1.2.840.113549.1.5.12","pkcs5PBKDF2");se("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");se("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");se("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");se("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");se("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");se("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");se("1.2.840.113549.2.7","hmacWithSHA1");se("1.2.840.113549.2.8","hmacWithSHA224");se("1.2.840.113549.2.9","hmacWithSHA256");se("1.2.840.113549.2.10","hmacWithSHA384");se("1.2.840.113549.2.11","hmacWithSHA512");se("1.2.840.113549.3.7","des-EDE3-CBC");se("2.16.840.1.101.3.4.1.2","aes128-CBC");se("2.16.840.1.101.3.4.1.22","aes192-CBC");se("2.16.840.1.101.3.4.1.42","aes256-CBC");se("2.5.4.3","commonName");se("2.5.4.4","surname");se("2.5.4.5","serialNumber");se("2.5.4.6","countryName");se("2.5.4.7","localityName");se("2.5.4.8","stateOrProvinceName");se("2.5.4.9","streetAddress");se("2.5.4.10","organizationName");se("2.5.4.11","organizationalUnitName");se("2.5.4.12","title");se("2.5.4.13","description");se("2.5.4.15","businessCategory");se("2.5.4.17","postalCode");se("2.5.4.42","givenName");se("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");se("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");se("2.16.840.1.113730.1.1","nsCertType");se("2.16.840.1.113730.1.13","nsComment");dt("2.5.29.1","authorityKeyIdentifier");dt("2.5.29.2","keyAttributes");dt("2.5.29.3","certificatePolicies");dt("2.5.29.4","keyUsageRestriction");dt("2.5.29.5","policyMapping");dt("2.5.29.6","subtreesConstraint");dt("2.5.29.7","subjectAltName");dt("2.5.29.8","issuerAltName");dt("2.5.29.9","subjectDirectoryAttributes");dt("2.5.29.10","basicConstraints");dt("2.5.29.11","nameConstraints");dt("2.5.29.12","policyConstraints");dt("2.5.29.13","basicConstraints");se("2.5.29.14","subjectKeyIdentifier");se("2.5.29.15","keyUsage");dt("2.5.29.16","privateKeyUsagePeriod");se("2.5.29.17","subjectAltName");se("2.5.29.18","issuerAltName");se("2.5.29.19","basicConstraints");dt("2.5.29.20","cRLNumber");dt("2.5.29.21","cRLReason");dt("2.5.29.22","expirationDate");dt("2.5.29.23","instructionCode");dt("2.5.29.24","invalidityDate");dt("2.5.29.25","cRLDistributionPoints");dt("2.5.29.26","issuingDistributionPoint");dt("2.5.29.27","deltaCRLIndicator");dt("2.5.29.28","issuingDistributionPoint");dt("2.5.29.29","certificateIssuer");dt("2.5.29.30","nameConstraints");se("2.5.29.31","cRLDistributionPoints");se("2.5.29.32","certificatePolicies");dt("2.5.29.33","policyMappings");dt("2.5.29.34","policyConstraints");se("2.5.29.35","authorityKeyIdentifier");dt("2.5.29.36","policyConstraints");se("2.5.29.37","extKeyUsage");dt("2.5.29.46","freshestCRL");dt("2.5.29.54","inhibitAnyPolicy");se("1.3.6.1.4.1.11129.2.4.2","timestampList");se("1.3.6.1.5.5.7.1.1","authorityInfoAccess");se("1.3.6.1.5.5.7.3.1","serverAuth");se("1.3.6.1.5.5.7.3.2","clientAuth");se("1.3.6.1.5.5.7.3.3","codeSigning");se("1.3.6.1.5.5.7.3.4","emailProtection");se("1.3.6.1.5.5.7.3.8","timeStamping");var wt=ze,ge=wt.asn1=wt.asn1||{};ge.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};ge.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};ge.create=function(e,t,n,r,i){if(wt.util.isArray(r)){for(var a=[],o=0;o<r.length;++o)r[o]!==void 0&&a.push(r[o]);r=a}var s={tagClass:e,type:t,constructed:n,composed:n||wt.util.isArray(r),value:r};return i&&"bitStringContents"in i&&(s.bitStringContents=i.bitStringContents,s.original=ge.copy(s)),s};ge.copy=function(e,t){var n;if(wt.util.isArray(e)){n=[];for(var r=0;r<e.length;++r)n.push(ge.copy(e[r],t));return n}return typeof e=="string"?e:(n={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:ge.copy(e.value,t)},t&&!t.excludeBitStringContents&&(n.bitStringContents=e.bitStringContents),n)};ge.equals=function(e,t,n){if(wt.util.isArray(e)){if(!wt.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!ge.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var i=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&ge.equals(e.value,t.value);return n&&n.includeBitStringContents&&(i=i&&e.bitStringContents===t.bitStringContents),i};ge.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var n,r=t&128;return r?n=e.getInt((t&127)<<3):n=t,n}};function Ys(e,t,n){if(n>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=n,r}}var m6=function(e,t){var n=e.getByte();if(t--,n!==128){var r,i=n&128;if(!i)r=n;else{var a=n&127;Ys(e,t,a),r=e.getInt(a<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};ge.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=wt.util.createBuffer(e));var n=e.length(),r=Ic(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var i=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw i.byteCount=n,i.remaining=e.length(),i}return r};function Ic(e,t,n,r){var i;Ys(e,t,2);var a=e.getByte();t--;var o=a&192,s=a&31;i=e.length();var l=m6(e,t);if(t-=i-e.length(),l!==void 0&&l>t){if(r.strict){var u=new Error("Too few bytes to read ASN.1 value.");throw u.available=e.length(),u.remaining=t,u.requested=l,u}l=t}var c,d,h=(a&32)===32;if(h)if(c=[],l===void 0)for(;;){if(Ys(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}i=e.length(),c.push(Ic(e,t,n+1,r)),t-=i-e.length()}else for(;l>0;)i=e.length(),c.push(Ic(e,l,n+1,r)),t-=i-e.length(),l-=i-e.length();if(c===void 0&&o===ge.Class.UNIVERSAL&&s===ge.Type.BITSTRING&&(d=e.bytes(l)),c===void 0&&r.decodeBitStrings&&o===ge.Class.UNIVERSAL&&s===ge.Type.BITSTRING&&l>1){var f=e.read,g=t,p=0;if(s===ge.Type.BITSTRING&&(Ys(e,t,1),p=e.getByte(),t--),p===0)try{i=e.length();var m={strict:!0,decodeBitStrings:!0},b=Ic(e,t,n+1,m),v=i-e.length();t-=v,s==ge.Type.BITSTRING&&v++;var x=b.tagClass;v===l&&(x===ge.Class.UNIVERSAL||x===ge.Class.CONTEXT_SPECIFIC)&&(c=[b])}catch{}c===void 0&&(e.read=f,t=g)}if(c===void 0){if(l===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=t}if(s===ge.Type.BMPSTRING)for(c="";l>0;l-=2)Ys(e,t,2),c+=String.fromCharCode(e.getInt16()),t-=2;else c=e.getBytes(l),t-=l}var C=d===void 0?null:{bitStringContents:d};return ge.create(o,s,h,c,C)}ge.toDer=function(e){var t=wt.util.createBuffer(),n=e.tagClass|e.type,r=wt.util.createBuffer(),i=!1;if("bitStringContents"in e&&(i=!0,e.original&&(i=ge.equals(e,e.original))),i)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?n|=32:r.putByte(0);for(var a=0;a<e.value.length;++a)e.value[a]!==void 0&&r.putBuffer(ge.toDer(e.value[a]))}else if(e.type===ge.Type.BMPSTRING)for(var a=0;a<e.value.length;++a)r.putInt16(e.value.charCodeAt(a));else e.type===ge.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(n),r.length()<=127)t.putByte(r.length()&127);else{var o=r.length(),s="";do s+=String.fromCharCode(o&255),o=o>>>8;while(o>0);t.putByte(s.length|128);for(var a=s.length-1;a>=0;--a)t.putByte(s.charCodeAt(a))}return t.putBuffer(r),t};ge.oidToDer=function(e){var t=e.split("."),n=wt.util.createBuffer();n.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,i,a,o,s=2;s<t.length;++s){r=!0,i=[],a=parseInt(t[s],10);do o=a&127,a=a>>>7,r||(o|=128),i.push(o),r=!1;while(a>0);for(var l=i.length-1;l>=0;--l)n.putByte(i[l])}return n};ge.derToOid=function(e){var t;typeof e=="string"&&(e=wt.util.createBuffer(e));var n=e.getByte();t=Math.floor(n/40)+"."+n%40;for(var r=0;e.length()>0;)n=e.getByte(),r=r<<7,n&128?r+=n&127:(t+="."+(r+n),r=0);return t};ge.utcTimeToDate=function(e){var t=new Date,n=parseInt(e.substr(0,2),10);n=n>=50?1900+n:2e3+n;var r=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var l=e.charAt(10),u=10;l!=="+"&&l!=="-"&&(s=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(n,r,i),t.setUTCHours(a,o,s,0),u&&(l=e.charAt(u),l==="+"||l==="-")){var c=parseInt(e.substr(u+1,2),10),d=parseInt(e.substr(u+4,2),10),h=c*60+d;h*=6e4,l==="+"?t.setTime(+t-h):t.setTime(+t+h)}return t};ge.generalizedTimeToDate=function(e){var t=new Date,n=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),l=0,u=0,c=!1;e.charAt(e.length-1)==="Z"&&(c=!0);var d=e.length-5,h=e.charAt(d);if(h==="+"||h==="-"){var f=parseInt(e.substr(d+1,2),10),g=parseInt(e.substr(d+4,2),10);u=f*60+g,u*=6e4,h==="+"&&(u*=-1),c=!0}return e.charAt(14)==="."&&(l=parseFloat(e.substr(14),10)*1e3),c?(t.setUTCFullYear(n,r,i),t.setUTCHours(a,o,s,l),t.setTime(+t+u)):(t.setFullYear(n,r,i),t.setHours(a,o,s,l)),t};ge.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",n=[];n.push((""+e.getUTCFullYear()).substr(2)),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(t+="0"),t+=n[r];return t+="Z",t};ge.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",n=[];n.push(""+e.getUTCFullYear()),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(t+="0"),t+=n[r];return t+="Z",t};ge.integerToDer=function(e){var t=wt.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var n=new Error("Integer too large; max is 32-bits.");throw n.integer=e,n};ge.derToInteger=function(e){typeof e=="string"&&(e=wt.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};ge.validate=function(e,t,n,r){var i=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(i=!0,t.value&&wt.util.isArray(t.value))for(var a=0,o=0;i&&o<t.value.length;++o)i=t.value[o].optional||!1,e.value[a]&&(i=ge.validate(e.value[a],t.value[o],n,r),i?++a:t.value[o].optional&&(i=!0)),!i&&r&&r.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(i&&n&&(t.capture&&(n[t.capture]=e.value),t.captureAsn1&&(n[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(n[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)n[t.captureBitStringValue]="";else{var s=e.bitStringContents.charCodeAt(0);if(s!==0)throw new Error("captureBitStringValue only supported for zero unused bits");n[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return i};var b1=/[^\\u0000-\\u00ff]/;ge.prettyPrint=function(e,t,n){var r="";t=t||0,n=n||2,t>0&&(r+=`
@@ -11,7 +11,7 @@
11
11
  `,n};fC.decode=function(e){for(var t=[],n=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=n.exec(e),!!a;){var o=a[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var s={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:qc.util.decode64(a[3])};if(t.push(s),!!a[2]){for(var l=a[2].split(i),u=0;a&&u<l.length;){for(var c=l[u].replace(/\s+$/,""),d=u+1;d<l.length;++d){var h=l[d];if(!/\s/.test(h[0]))break;c+=h,u=d}if(a=c.match(r),a){for(var f={name:a[1],values:[]},g=a[2].split(","),p=0;p<g.length;++p)f.values.push(y6(g[p]));if(s.procType)if(!s.contentDomain&&f.name==="Content-Domain")s.contentDomain=g[0]||"";else if(!s.dekInfo&&f.name==="DEK-Info"){if(f.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:g[0],parameters:g[1]||null}}else s.headers.push(f);else{if(f.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(f.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:g[0],type:g[1]}}}++u}if(s.procType==="ENCRYPTED"&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Bu(e){for(var t=e.name+": ",n=[],r=function(l,u){return" "+u},i=0;i<e.values.length;++i)n.push(e.values[i].replace(/^(\S+\r\n)/,r));t+=n.join(",")+`\r
12
12
  `;for(var a=0,o=-1,i=0;i<t.length;++i,++a)if(a>65&&o!==-1){var s=t[o];s===","?(++o,t=t.substr(0,o)+`\r
13
13
  `+t.substr(o)):t=t.substr(0,o)+`\r
14
- `+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function y6(e){return e.replace(/^\s+/,"")}var At=ze;At.des=At.des||{};At.des.startEncrypting=function(e,t,n,r){var i=rf({key:e,output:n,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};At.des.createEncryptionCipher=function(e,t){return rf({key:e,output:null,decrypt:!1,mode:t})};At.des.startDecrypting=function(e,t,n,r){var i=rf({key:e,output:n,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};At.des.createDecryptionCipher=function(e,t){return rf({key:e,output:null,decrypt:!0,mode:t})};At.des.Algorithm=function(e,t){var n=this;n.name=e,n.mode=new t({blockSize:8,cipher:{encrypt:function(r,i){return y1(n._keys,r,i,!1)},decrypt:function(r,i){return y1(n._keys,r,i,!0)}}}),n._init=!1};At.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=At.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=A6(t),this._init=!0}};hi("DES-ECB",At.cipher.modes.ecb);hi("DES-CBC",At.cipher.modes.cbc);hi("DES-CFB",At.cipher.modes.cfb);hi("DES-OFB",At.cipher.modes.ofb);hi("DES-CTR",At.cipher.modes.ctr);hi("3DES-ECB",At.cipher.modes.ecb);hi("3DES-CBC",At.cipher.modes.cbc);hi("3DES-CFB",At.cipher.modes.cfb);hi("3DES-OFB",At.cipher.modes.ofb);hi("3DES-CTR",At.cipher.modes.ctr);function hi(e,t){var n=function(){return new At.des.Algorithm(e,t)};At.cipher.registerAlgorithm(e,n)}var x6=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],C6=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],E6=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],S6=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],w6=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],I6=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],_6=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],D6=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function A6(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],f=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,x,C=0;C<p;C++){var E=e.getInt32(),w=e.getInt32();x=(E>>>4^w)&252645135,w^=x,E^=x<<4,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>2^w)&858993459,w^=x,E^=x<<2,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=(w>>>8^E)&16711935,E^=x,w^=x<<8,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=E<<8|w>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=x;for(var B=0;B<b.length;++B){b[B]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27),E&=-15,w&=-15;var y=t[E>>>28]|n[E>>>24&15]|r[E>>>20&15]|i[E>>>16&15]|a[E>>>12&15]|o[E>>>8&15]|s[E>>>4&15],S=l[w>>>28]|u[w>>>24&15]|c[w>>>20&15]|d[w>>>16&15]|h[w>>>12&15]|f[w>>>8&15]|g[w>>>4&15];x=(S>>>16^y)&65535,m[v++]=y^x,m[v++]=S^x<<16}}return m}function y1(e,t,n,r){var i=e.length===32?3:9,a;i===3?a=r?[30,-2,-2]:[0,32,2]:a=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],l=t[1];o=(s>>>4^l)&252645135,l^=o,s^=o<<4,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,s=s<<1|s>>>31,l=l<<1|l>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],d=a[u+2],h=a[u];h!=c;h+=d){var f=l^e[h],g=(l>>>4|l<<28)^e[h+1];o=s,s=l,l=o^(C6[f>>>24&63]|S6[f>>>16&63]|I6[f>>>8&63]|D6[f&63]|x6[g>>>24&63]|E6[g>>>16&63]|w6[g>>>8&63]|_6[g&63])}o=s,s=l,l=o}s=s>>>1|s<<31,l=l>>>1|l<<31,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(s>>>4^l)&252645135,l^=o,s^=o<<4,n[0]=s,n[1]=l}function rf(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),n="DES-"+t,r;e.decrypt?r=At.cipher.createDecipher(n,e.key):r=At.cipher.createCipher(n,e.key);var i=r.start;return r.start=function(a,o){var s=null;o instanceof At.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(r,o)},r}const T6={},R6=Object.freeze(Object.defineProperty({__proto__:null,default:T6},Symbol.toStringTag,{value:"Module"})),np=s6(R6);var _n=ze,B6=_n.pkcs5=_n.pkcs5||{},Si;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(Si=np);_n.pbkdf2=B6.pbkdf2=function(e,t,n,r,i,a){if(typeof i=="function"&&(a=i,i=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&Si.pbkdf2&&(i===null||typeof i!="object")&&(Si.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?Si.pbkdf2Sync.length===4?Si.pbkdf2(e,t,n,r,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):Si.pbkdf2(e,t,n,r,i,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):Si.pbkdf2Sync.length===4?Si.pbkdf2Sync(e,t,n,r).toString("binary"):Si.pbkdf2Sync(e,t,n,r,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=_n.md[i].create()}var o=i.digestLength;if(r>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var l=Math.ceil(r/o),u=r-(l-1)*o,c=_n.hmac.create();c.start(i,e);var d="",h,f,g;if(!a){for(var p=1;p<=l;++p){c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes();for(var m=2;m<=n;++m)c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f;d+=p<l?h:h.substr(0,u)}return d}var p=1,m;function b(){if(p>l)return a(null,d);c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes(),m=2,v()}function v(){if(m<=n)return c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f,++m,_n.util.setImmediate(v);d+=p<l?h:h.substr(0,u),++p,b()}b()};var ei=ze,hC=ei.sha256=ei.sha256||{};ei.md.sha256=ei.md.algorithms.sha256=hC;hC.create=function(){gC||$6();var e=null,t=ei.util.createBuffer(),n=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ei.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ei.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),x1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ei.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(_0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};x1(d,n,i);var h=ei.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h.putInt32(d.h5),h.putInt32(d.h6),h.putInt32(d.h7),h},r};var _0=null,gC=!1,pC=null;function $6(){_0="€",_0+=ei.util.fillString("\0",64),pC=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],gC=!0}function x1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v=n.length();v>=64;){for(u=0;u<16;++u)t[u]=n.getInt32();for(;u<64;++u)r=t[u-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=r+t[u-7]+i+t[u-16]|0;for(c=e.h0,d=e.h1,h=e.h2,f=e.h3,g=e.h4,p=e.h5,m=e.h6,b=e.h7,u=0;u<64;++u)o=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=m^g&(p^m),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),l=c&d|h&(c^d),r=b+o+s+pC[u]+t[u],i=a+l,b=m,m=p,p=g,g=f+r>>>0,f=h,h=d,d=c,c=r+i>>>0;e.h0=e.h0+c|0,e.h1=e.h1+d|0,e.h2=e.h2+h|0,e.h3=e.h3+f|0,e.h4=e.h4+g|0,e.h5=e.h5+p|0,e.h6=e.h6+m|0,e.h7=e.h7+b|0,v-=64}}var Yr=ze,Dc=null;Yr.util.isNodejs&&!Yr.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Dc=np);var k6=Yr.prng=Yr.prng||{};k6.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,r=new Array(32),i=0;i<32;++i)r[i]=n.create();t.pools=r,t.pool=0,t.generate=function(u,c){if(!c)return t.generateSync(u);var d=t.plugin.cipher,h=t.plugin.increment,f=t.plugin.formatKey,g=t.plugin.formatSeed,p=Yr.util.createBuffer();t.key=null,m();function m(b){if(b)return c(b);if(p.length()>=u)return c(null,p.getBytes(u));if(t.generated>1048575&&(t.key=null),t.key===null)return Yr.util.nextTick(function(){a(m)});var v=d(t.key,t.seed);t.generated+=v.length,p.putBytes(v),t.key=f(d(t.key,h(t.seed))),t.seed=g(d(t.key,t.seed)),Yr.util.setImmediate(m)}},t.generateSync=function(u){var c=t.plugin.cipher,d=t.plugin.increment,h=t.plugin.formatKey,f=t.plugin.formatSeed;t.key=null;for(var g=Yr.util.createBuffer();g.length()<u;){t.generated>1048575&&(t.key=null),t.key===null&&o();var p=c(t.key,t.seed);t.generated+=p.length,g.putBytes(p),t.key=h(c(t.key,d(t.seed))),t.seed=f(c(t.key,t.seed))}return g.getBytes(u)};function a(u){if(t.pools[0].messageLength>=32)return s(),u();var c=32-t.pools[0].messageLength<<5;t.seedFile(c,function(d,h){if(d)return u(d);t.collect(h),s(),u()})}function o(){if(t.pools[0].messageLength>=32)return s();var u=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(u)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var u=t.plugin.md.create();u.update(t.keyBytes);for(var c=1,d=0;d<32;++d)t.reseeds%c===0&&(u.update(t.pools[d].digest().getBytes()),t.pools[d].start()),c=c<<1;t.keyBytes=u.digest().getBytes(),u.start(),u.update(t.keyBytes);var h=u.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(h),t.generated=0}function l(u){var c=null,d=Yr.util.globalScope,h=d.crypto||d.msCrypto;h&&h.getRandomValues&&(c=function(E){return h.getRandomValues(E)});var f=Yr.util.createBuffer();if(c)for(;f.length()<u;){var g=Math.max(1,Math.min(u-f.length(),65536)/4),p=new Uint32Array(Math.floor(g));try{c(p);for(var m=0;m<p.length;++m)f.putInt32(p[m])}catch(E){if(!(typeof QuotaExceededError<"u"&&E instanceof QuotaExceededError))throw E}}if(f.length()<u)for(var b,v,x,C=Math.floor(Math.random()*65536);f.length()<u;){v=16807*(C&65535),b=16807*(C>>16),v+=(b&32767)<<16,v+=b>>15,v=(v&2147483647)+(v>>31),C=v&4294967295;for(var m=0;m<3;++m)x=C>>>(m<<3),x^=Math.floor(Math.random()*256),f.putByte(x&255)}return f.getBytes(u)}return Dc?(t.seedFile=function(u,c){Dc.randomBytes(u,function(d,h){if(d)return c(d);c(null,h.toString())})},t.seedFileSync=function(u){return Dc.randomBytes(u).toString()}):(t.seedFile=function(u,c){try{c(null,l(u))}catch(d){c(d)}},t.seedFileSync=l),t.collect=function(u){for(var c=u.length,d=0;d<c;++d)t.pools[t.pool].update(u.substr(d,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(u,c){for(var d="",h=0;h<c;h+=8)d+=String.fromCharCode(u>>h&255);t.collect(d)},t.registerWorker=function(u){if(u===self)t.seedFile=function(d,h){function f(g){var p=g.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",f),h(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",f),self.postMessage({forge:{prng:{needed:d}}})};else{var c=function(d){var h=d.data;h.forge&&h.forge.prng&&t.seedFile(h.forge.prng.needed,function(f,g){u.postMessage({forge:{prng:{err:f,bytes:g}}})})};u.addEventListener("message",c)}},t};var Qt=ze;(function(){if(Qt.random&&Qt.random.getBytes){Qt.random;return}(function(e){var t={},n=new Array(4),r=Qt.util.createBuffer();t.formatKey=function(d){var h=Qt.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),Qt.aes._expandKey(d,!1)},t.formatSeed=function(d){var h=Qt.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),d},t.cipher=function(d,h){return Qt.aes._updateBlock(d,h,n,!1),r.putInt32(n[0]),r.putInt32(n[1]),r.putInt32(n[2]),r.putInt32(n[3]),r.getBytes()},t.increment=function(d){return++d[3],d},t.md=Qt.md.sha256;function i(){var d=Qt.prng.create(t);return d.getBytes=function(h,f){return d.generate(h,f)},d.getBytesSync=function(h){return d.generate(h)},d}var a=i(),o=null,s=Qt.util.globalScope,l=s.crypto||s.msCrypto;if(l&&l.getRandomValues&&(o=function(d){return l.getRandomValues(d)}),Qt.options.usePureJavaScript||!Qt.util.isNodejs&&!o){if(a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}e&&(e().mousemove(function(d){a.collectInt(d.clientX,16),a.collectInt(d.clientY,16)}),e().keypress(function(d){a.collectInt(d.charCode,8)}))}if(!Qt.random)Qt.random=a;else for(var c in a)Qt.random[c]=a[c];Qt.random.createInstance=i,Qt.random})(typeof jQuery<"u"?jQuery:null)})();var Vn=ze,Zf=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],C1=[1,2,3,5],P6=function(e,t){return e<<t&65535|(e&65535)>>16-t},F6=function(e,t){return(e&65535)>>t|e<<16-t&65535};Vn.rc2=Vn.rc2||{};Vn.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Vn.util.createBuffer(e)),t=t||128;var n=e,r=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=r;s<128;s++)n.putByte(Zf[n.at(s-1)+n.at(s-r)&255]);for(n.setAt(128-a,Zf[n.at(128-a)&o]),s=127-a;s>=0;s--)n.setAt(s,Zf[n.at(s+1)^n.at(s+a)]);return n};var mC=function(e,t,n){var r=!1,i=null,a=null,o=null,s,l,u,c,d=[];for(e=Vn.rc2.expandKey(e,t),u=0;u<64;u++)d.push(e.getInt16Le());n?(s=function(g){for(u=0;u<4;u++)g[u]+=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),g[u]=P6(g[u],C1[u]),c++},l=function(g){for(u=0;u<4;u++)g[u]+=d[g[(u+3)%4]&63]}):(s=function(g){for(u=3;u>=0;u--)g[u]=F6(g[u],C1[u]),g[u]-=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),c--},l=function(g){for(u=3;u>=0;u--)g[u]-=d[g[(u+3)%4]&63]});var h=function(g){var p=[];for(u=0;u<4;u++){var m=i.getInt16Le();o!==null&&(n?m^=o.getInt16Le():o.putInt16Le(m)),p.push(m&65535)}c=n?0:63;for(var b=0;b<g.length;b++)for(var v=0;v<g[b][0];v++)g[b][1](p);for(u=0;u<4;u++)o!==null&&(n?o.putInt16Le(p[u]):p[u]^=o.getInt16Le()),a.putInt16Le(p[u])},f=null;return f={start:function(g,p){g&&typeof g=="string"&&(g=Vn.util.createBuffer(g)),r=!1,i=Vn.util.createBuffer(),a=p||new Vn.util.createBuffer,o=g,f.output=a},update:function(g){for(r||i.putBuffer(g);i.length()>=8;)h([[5,s],[1,l],[6,s],[1,l],[5,s]])},finish:function(g){var p=!0;if(n)if(g)p=g(8,i,!n);else{var m=i.length()===8?8:8-i.length();i.fillWithByte(m,m)}if(p&&(r=!0,f.update()),!n&&(p=i.length()===0,p))if(g)p=g(8,a,!n);else{var b=a.length(),v=a.at(b-1);v>b?p=!1:a.truncate(v)}return p}},f};Vn.rc2.startEncrypting=function(e,t,n){var r=Vn.rc2.createEncryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createEncryptionCipher=function(e,t){return mC(e,t,!0)};Vn.rc2.startDecrypting=function(e,t,n){var r=Vn.rc2.createDecryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createDecryptionCipher=function(e,t){return mC(e,t,!1)};var D0=ze;D0.jsbn=D0.jsbn||{};var $i;function oe(e,t,n){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,n):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}D0.jsbn.BigInteger=oe;function it(){return new oe(null)}function N6(e,t,n,r,i,a){for(;--a>=0;){var o=t*this.data[e++]+n.data[r]+i;i=Math.floor(o/67108864),n.data[r++]=o&67108863}return i}function M6(e,t,n,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this.data[e]&32767,u=this.data[e++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+n.data[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),n.data[r++]=l&1073741823}return i}function E1(e,t,n,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this.data[e]&16383,u=this.data[e++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+n.data[r]+i,i=(l>>28)+(c>>14)+s*u,n.data[r++]=l&268435455}return i}typeof navigator>"u"?(oe.prototype.am=E1,$i=28):navigator.appName=="Microsoft Internet Explorer"?(oe.prototype.am=M6,$i=30):navigator.appName!="Netscape"?(oe.prototype.am=N6,$i=26):(oe.prototype.am=E1,$i=28);oe.prototype.DB=$i;oe.prototype.DM=(1<<$i)-1;oe.prototype.DV=1<<$i;var rp=52;oe.prototype.FV=Math.pow(2,rp);oe.prototype.F1=rp-$i;oe.prototype.F2=2*$i-rp;var L6="0123456789abcdefghijklmnopqrstuvwxyz",af=new Array,Ds,mr;Ds=48;for(mr=0;mr<=9;++mr)af[Ds++]=mr;Ds=97;for(mr=10;mr<36;++mr)af[Ds++]=mr;Ds=65;for(mr=10;mr<36;++mr)af[Ds++]=mr;function S1(e){return L6.charAt(e)}function bC(e,t){var n=af[e.charCodeAt(t)];return n??-1}function O6(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function V6(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function oa(e){var t=it();return t.fromInt(e),t}function H6(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,a=0;--r>=0;){var o=n==8?e[r]&255:bC(e,r);if(o<0){e.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+n>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=n,a>=this.DB&&(a-=this.DB)}n==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&oe.ZERO.subTo(this,this)}function j6(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function W6(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=S1(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=S1(r));return i?a:"0"}function z6(){var e=it();return oe.ZERO.subTo(this,e),e}function G6(){return this.s<0?this.negate():this}function U6(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this.data[n]-e.data[n])!=0)return t;return 0}function of(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}function X6(){return this.t<=0?0:this.DB*(this.t-1)+of(this.data[this.t-1]^this.s&this.DM)}function Z6(e,t){var n;for(n=this.t-1;n>=0;--n)t.data[n+e]=this.data[n];for(n=e-1;n>=0;--n)t.data[n]=0;t.t=this.t+e,t.s=this.s}function Y6(e,t){for(var n=e;n<this.t;++n)t.data[n-e]=this.data[n];t.t=Math.max(this.t-e,0),t.s=this.s}function K6(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>r|o,o=(this.data[s]&i)<<n;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function q6(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,a=(1<<r)-1;t.data[0]=this.data[n]>>r;for(var o=n+1;o<this.t;++o)t.data[o-n-1]|=(this.data[o]&a)<<i,t.data[o-n]=this.data[o]>>r;r>0&&(t.data[this.t-n-1]|=(this.s&a)<<i),t.t=this.t-n,t.clamp()}function J6(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]-e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[n++]=this.DV+r:r>0&&(t.data[n++]=r),t.t=n,t.clamp()}function Q6(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+n.t]=n.am(0,r.data[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&oe.ZERO.subTo(t,t)}function eA(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e.data[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t.data[n],e,2*n,0,1);(e.data[n+t.t]+=t.am(n+1,2*t.data[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e.data[n+t.t]-=t.DV,e.data[n+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(n,t.data[n],e,2*n,0,1)),e.s=0,e.clamp()}function tA(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=it());var a=it(),o=this.s,s=e.s,l=this.DB-of(r.data[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,n)):(r.copyTo(a),i.copyTo(n));var u=a.t,c=a.data[u-1];if(c!=0){var d=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),h=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,p=n.t,m=p-u,b=t??it();for(a.dlShiftTo(m,b),n.compareTo(b)>=0&&(n.data[n.t++]=1,n.subTo(b,n)),oe.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=n.data[--p]==c?this.DM:Math.floor(n.data[p]*h+(n.data[p-1]+g)*f);if((n.data[p]+=a.am(0,v,n,m,0,u))<v)for(a.dlShiftTo(m,b),n.subTo(b,n);n.data[p]<--v;)n.subTo(b,n)}t!=null&&(n.drShiftTo(u,t),o!=s&&oe.ZERO.subTo(t,t)),n.t=u,n.clamp(),l>0&&n.rShiftTo(l,n),o<0&&oe.ZERO.subTo(n,n)}}}function nA(e){var t=it();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(oe.ZERO)>0&&e.subTo(t,t),t}function Eo(e){this.m=e}function rA(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function iA(e){return e}function aA(e){e.divRemTo(this.m,null,e)}function oA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function sA(e,t){e.squareTo(t),this.reduce(t)}Eo.prototype.convert=rA;Eo.prototype.revert=iA;Eo.prototype.reduce=aA;Eo.prototype.mulTo=oA;Eo.prototype.sqrTo=sA;function lA(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function So(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function uA(e){var t=it();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(oe.ZERO)>0&&this.m.subTo(t,t),t}function cA(e){var t=it();return e.copyTo(t),this.reduce(t),t}function dA(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e.data[t]&32767,r=n*this.mpl+((n*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e.data[n]+=this.m.am(0,r,e,t,0,this.m.t);e.data[n]>=e.DV;)e.data[n]-=e.DV,e.data[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function fA(e,t){e.squareTo(t),this.reduce(t)}function hA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}So.prototype.convert=uA;So.prototype.revert=cA;So.prototype.reduce=dA;So.prototype.mulTo=hA;So.prototype.sqrTo=fA;function gA(){return(this.t>0?this.data[0]&1:this.s)==0}function pA(e,t){if(e>4294967295||e<1)return oe.ONE;var n=it(),r=it(),i=t.convert(this),a=of(e)-1;for(i.copyTo(n);--a>=0;)if(t.sqrTo(n,r),(e&1<<a)>0)t.mulTo(r,i,n);else{var o=n;n=r,r=o}return t.revert(n)}function mA(e,t){var n;return e<256||t.isEven()?n=new Eo(t):n=new So(t),this.exp(e,n)}oe.prototype.copyTo=O6;oe.prototype.fromInt=V6;oe.prototype.fromString=H6;oe.prototype.clamp=j6;oe.prototype.dlShiftTo=Z6;oe.prototype.drShiftTo=Y6;oe.prototype.lShiftTo=K6;oe.prototype.rShiftTo=q6;oe.prototype.subTo=J6;oe.prototype.multiplyTo=Q6;oe.prototype.squareTo=eA;oe.prototype.divRemTo=tA;oe.prototype.invDigit=lA;oe.prototype.isEven=gA;oe.prototype.exp=pA;oe.prototype.toString=W6;oe.prototype.negate=z6;oe.prototype.abs=G6;oe.prototype.compareTo=U6;oe.prototype.bitLength=X6;oe.prototype.mod=nA;oe.prototype.modPowInt=mA;oe.ZERO=oa(0);oe.ONE=oa(1);function bA(){var e=it();return this.copyTo(e),e}function vA(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function yA(){return this.t==0?this.s:this.data[0]<<24>>24}function xA(){return this.t==0?this.s:this.data[0]<<16>>16}function CA(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function EA(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function SA(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=oa(n),i=it(),a=it(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o}function wA(e,t){this.fromInt(0),t==null&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,a=0,o=0,s=0;s<e.length;++s){var l=bC(e,s);if(l<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&oe.ZERO.subTo(this,this)}function IA(e,t,n){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(oe.ONE.shiftLeft(e-1),ip,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(oe.ONE.shiftLeft(e-1),this);else{var r=new Array,i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function _A(){var e=this.t,t=new Array;t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function DA(e){return this.compareTo(e)==0}function AA(e){return this.compareTo(e)<0?this:e}function TA(e){return this.compareTo(e)>0?this:e}function RA(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n.data[r]=t(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;r<e.t;++r)n.data[r]=t(i,e.data[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function BA(e,t){return e&t}function $A(e){var t=it();return this.bitwiseTo(e,BA,t),t}function ip(e,t){return e|t}function kA(e){var t=it();return this.bitwiseTo(e,ip,t),t}function vC(e,t){return e^t}function PA(e){var t=it();return this.bitwiseTo(e,vC,t),t}function yC(e,t){return e&~t}function FA(e){var t=it();return this.bitwiseTo(e,yC,t),t}function NA(){for(var e=it(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function MA(e){var t=it();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function LA(e){var t=it();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function OA(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function VA(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+OA(this.data[e]);return this.s<0?this.t*this.DB:-1}function HA(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function jA(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=HA(this.data[n]^t);return e}function WA(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function zA(e,t){var n=oe.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function GA(e){return this.changeBit(e,ip)}function UA(e){return this.changeBit(e,yC)}function XA(e){return this.changeBit(e,vC)}function ZA(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]+e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[n++]=r:r<-1&&(t.data[n++]=this.DV+r),t.t=n,t.clamp()}function YA(e){var t=it();return this.addTo(e,t),t}function KA(e){var t=it();return this.subTo(e,t),t}function qA(e){var t=it();return this.multiplyTo(e,t),t}function JA(e){var t=it();return this.divRemTo(e,t,null),t}function QA(e){var t=it();return this.divRemTo(e,null,t),t}function eT(e){var t=it(),n=it();return this.divRemTo(e,t,n),new Array(t,n)}function tT(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function nT(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function fu(){}function xC(e){return e}function rT(e,t,n){e.multiplyTo(t,n)}function iT(e,t){e.squareTo(t)}fu.prototype.convert=xC;fu.prototype.revert=xC;fu.prototype.mulTo=rT;fu.prototype.sqrTo=iT;function aT(e){return this.exp(e,new fu)}function oT(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n.data[r+this.t]=this.am(0,e.data[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],n,r,0,t-r);n.clamp()}function sT(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n.data[this.t+r-t]=this.am(t-r,e.data[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function As(e){this.r2=it(),this.q3=it(),oe.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function lT(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=it();return e.copyTo(t),this.reduce(t),t}function uT(e){return e}function cT(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function dT(e,t){e.squareTo(t),this.reduce(t)}function fT(e,t,n){e.multiplyTo(t,n),this.reduce(n)}As.prototype.convert=lT;As.prototype.revert=uT;As.prototype.reduce=cT;As.prototype.mulTo=fT;As.prototype.sqrTo=dT;function hT(e,t){var n=e.bitLength(),r,i=oa(1),a;if(n<=0)return i;n<18?r=1:n<48?r=3:n<144?r=4:n<768?r=5:r=6,n<8?a=new Eo(t):t.isEven()?a=new As(t):a=new So(t);var o=new Array,s=3,l=r-1,u=(1<<r)-1;if(o[1]=a.convert(this),r>1){var c=it();for(a.sqrTo(o[1],c);s<=u;)o[s]=it(),a.mulTo(c,o[s-2],o[s]),s+=2}var d=e.t-1,h,f=!0,g=it(),p;for(n=of(e.data[d])-1;d>=0;){for(n>=l?h=e.data[d]>>n-l&u:(h=(e.data[d]&(1<<n+1)-1)<<l-n,d>0&&(h|=e.data[d-1]>>this.DB+n-l)),s=r;!(h&1);)h>>=1,--s;if((n-=s)<0&&(n+=this.DB,--d),f)o[h].copyTo(i),f=!1;else{for(;s>1;)a.sqrTo(i,g),a.sqrTo(g,i),s-=2;s>0?a.sqrTo(i,g):(p=i,i=g,g=p),a.mulTo(g,o[h],i)}for(;d>=0&&!(e.data[d]&1<<n);)a.sqrTo(i,g),p=i,i=g,g=p,--n<0&&(n=this.DB-1,--d)}return a.revert(i)}function gT(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return a>0&&n.lShiftTo(a,n),n}function pT(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this.data[r])%e;return n}function mT(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return oe.ZERO;for(var n=e.clone(),r=this.clone(),i=oa(1),a=oa(0),o=oa(0),s=oa(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(o,i),a.subTo(s,a)):(r.subTo(n,r),t&&o.subTo(i,o),s.subTo(a,s))}if(r.compareTo(oe.ONE)!=0)return oe.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var Dr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],bT=(1<<26)/Dr[Dr.length-1];function vT(e){var t,n=this.abs();if(n.t==1&&n.data[0]<=Dr[Dr.length-1]){for(t=0;t<Dr.length;++t)if(n.data[0]==Dr[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<Dr.length;){for(var r=Dr[t],i=t+1;i<Dr.length&&r<bT;)r*=Dr[i++];for(r=n.modInt(r);t<i;)if(r%Dr[t++]==0)return!1}return n.millerRabin(e)}function yT(e){var t=this.subtract(oe.ONE),n=t.getLowestSetBit();if(n<=0)return!1;for(var r=t.shiftRight(n),i=xT(),a,o=0;o<e;++o){do a=new oe(this.bitLength(),i);while(a.compareTo(oe.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(r,this);if(s.compareTo(oe.ONE)!=0&&s.compareTo(t)!=0){for(var l=1;l++<n&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(oe.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function xT(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}oe.prototype.chunkSize=CA;oe.prototype.toRadix=SA;oe.prototype.fromRadix=wA;oe.prototype.fromNumber=IA;oe.prototype.bitwiseTo=RA;oe.prototype.changeBit=zA;oe.prototype.addTo=ZA;oe.prototype.dMultiply=tT;oe.prototype.dAddOffset=nT;oe.prototype.multiplyLowerTo=oT;oe.prototype.multiplyUpperTo=sT;oe.prototype.modInt=pT;oe.prototype.millerRabin=yT;oe.prototype.clone=bA;oe.prototype.intValue=vA;oe.prototype.byteValue=yA;oe.prototype.shortValue=xA;oe.prototype.signum=EA;oe.prototype.toByteArray=_A;oe.prototype.equals=DA;oe.prototype.min=AA;oe.prototype.max=TA;oe.prototype.and=$A;oe.prototype.or=kA;oe.prototype.xor=PA;oe.prototype.andNot=FA;oe.prototype.not=NA;oe.prototype.shiftLeft=MA;oe.prototype.shiftRight=LA;oe.prototype.getLowestSetBit=VA;oe.prototype.bitCount=jA;oe.prototype.testBit=WA;oe.prototype.setBit=GA;oe.prototype.clearBit=UA;oe.prototype.flipBit=XA;oe.prototype.add=YA;oe.prototype.subtract=KA;oe.prototype.multiply=qA;oe.prototype.divide=JA;oe.prototype.remainder=QA;oe.prototype.divideAndRemainder=eT;oe.prototype.modPow=hT;oe.prototype.modInverse=mT;oe.prototype.pow=aT;oe.prototype.gcd=gT;oe.prototype.isProbablePrime=vT;var ti=ze,CC=ti.sha1=ti.sha1||{};ti.md.sha1=ti.md.algorithms.sha1=CC;CC.create=function(){EC||CT();var e=null,t=ti.util.createBuffer(),n=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ti.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ti.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),w1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ti.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(A0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};w1(d,n,i);var h=ti.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h},r};var A0=null,EC=!1;function CT(){A0="€",A0+=ti.util.fillString("\0",64),EC=!0}function w1(e,t,n){for(var r,i,a,o,s,l,u,c,d=n.length();d>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,l=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<20;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<32;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<40;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<60;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a&o|s&(a^o),r=(i<<5|i>>>27)+u+l+2400959708+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<80;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+3395469782+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+l|0,d-=64}}var ni=ze,SC=ni.pkcs1=ni.pkcs1||{};SC.encode_rsa_oaep=function(e,t,n){var r,i,a,o;typeof n=="string"?(r=n,i=arguments[3]||void 0,a=arguments[4]||void 0):n&&(r=n.label||void 0,i=n.seed||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md)),a?a.start():a=ni.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),l=s-2*a.digestLength-2;if(t.length>l){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=t.length,u.maxLength=l,u}r||(r=""),a.update(r,"raw");for(var c=a.digest(),d="",h=l-t.length,f=0;f<h;f++)d+="\0";var g=c.getBytes()+d+""+t;if(!i)i=ni.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var p=Jc(i,s-a.digestLength-1,o),m=ni.util.xorBytes(g,p,g.length),b=Jc(m,a.digestLength,o),v=ni.util.xorBytes(i,b,i.length);return"\0"+v+m};SC.decode_rsa_oaep=function(e,t,n){var r,i,a;typeof n=="string"?(r=n,i=arguments[3]||void 0):n&&(r=n.label||void 0,i=n.md||void 0,n.mgf1&&n.mgf1.md&&(a=n.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var m=new Error("RSAES-OAEP encoded message length is invalid.");throw m.length=t.length,m.expectedLength=o,m}if(i===void 0?i=ni.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var s=i.digest().getBytes(),l=t.charAt(0),u=t.substring(1,i.digestLength+1),c=t.substring(1+i.digestLength),d=Jc(c,i.digestLength,a),h=ni.util.xorBytes(u,d,u.length),f=Jc(h,o-i.digestLength-1,a),g=ni.util.xorBytes(c,f,c.length),p=g.substring(0,i.digestLength),m=l!=="\0",b=0;b<i.digestLength;++b)m|=s.charAt(b)!==p.charAt(b);for(var v=1,x=i.digestLength,C=i.digestLength;C<g.length;C++){var E=g.charCodeAt(C),w=E&1^1,B=v?65534:0;m|=E&B,v=v&w,x+=v}if(m||g.charCodeAt(x)!==1)throw new Error("Invalid RSAES-OAEP padding.");return g.substring(x+1)};function Jc(e,t,n){n||(n=ni.md.sha1.create());for(var r="",i=Math.ceil(t/n.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);n.start(),n.update(e+o),r+=n.digest().getBytes()}return r.substring(0,t)}var Xi=ze;(function(){if(Xi.prime){Xi.prime;return}var e=Xi.prime=Xi.prime||{},t=Xi.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(d,h){return d|h};e.generateProbablePrime=function(d,h,f){typeof h=="function"&&(f=h,h={}),h=h||{};var g=h.algorithm||"PRIMEINC";typeof g=="string"&&(g={name:g}),g.options=g.options||{};var p=h.prng||Xi.random,m={nextBytes:function(b){for(var v=p.getBytesSync(b.length),x=0;x<b.length;++x)b[x]=v.charCodeAt(x)}};if(g.name==="PRIMEINC")return a(d,m,g.options,f);throw new Error("Invalid prime generation algorithm: "+g.name)};function a(d,h,f,g){return"workers"in f?l(d,h,f,g):o(d,h,f,g)}function o(d,h,f,g){var p=u(d,h),m=0,b=c(p.bitLength());"millerRabinTests"in f&&(b=f.millerRabinTests);var v=10;"maxBlockTime"in f&&(v=f.maxBlockTime),s(p,d,h,m,b,v,g)}function s(d,h,f,g,p,m,b){var v=+new Date;do{if(d.bitLength()>h&&(d=u(h,f)),d.isProbablePrime(p))return b(null,d);d.dAddOffset(n[g++%8],0)}while(m<0||+new Date-v<m);Xi.util.setImmediate(function(){s(d,h,f,g,p,m,b)})}function l(d,h,f,g){if(typeof Worker>"u")return o(d,h,f,g);var p=u(d,h),m=f.workers,b=f.workLoad||100,v=b*30/8,x=f.workerScript||"forge/prime.worker.js";if(m===-1)return Xi.util.estimateCores(function(E,w){E&&(w=2),m=w-1,C()});C();function C(){m=Math.max(1,m);for(var E=[],w=0;w<m;++w)E[w]=new Worker(x);for(var w=0;w<m;++w)E[w].addEventListener("message",y);var B=!1;function y(S){if(!B){var D=S.data;if(D.found){for(var A=0;A<E.length;++A)E[A].terminate();return B=!0,g(null,new t(D.prime,16))}p.bitLength()>d&&(p=u(d,h));var T=p.toString(16);S.target.postMessage({hex:T,workLoad:b}),p.dAddOffset(v,0)}}}}function u(d,h){var f=new t(d,h),g=d-1;return f.testBit(g)||f.bitwiseTo(t.ONE.shiftLeft(g),i,f),f.dAddOffset(31-f.mod(r).byteValue(),0),f}function c(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})();var De=ze;if(typeof rt>"u")var rt=De.jsbn.BigInteger;var T0=De.util.isNodejs?np:null,q=De.asn1,br=De.util;De.pki=De.pki||{};De.pki.rsa=De.rsa=De.rsa||{};var Ve=De.pki,ET=[6,4,2,4,2,4,6,2],ST={name:"PrivateKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},wT={name:"RSAPrivateKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},IT={name:"RSAPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},_T=De.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},DT={name:"DigestInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:q.Class.UNIVERSAL,type:q.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},AT=function(e){var t;if(e.algorithm in Ve.oids)t=Ve.oids[e.algorithm];else{var n=new Error("Unknown message digest algorithm.");throw n.algorithm=e.algorithm,n}var r=q.oidToDer(t).getBytes(),i=q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[]),a=q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[]);a.value.push(q.create(q.Class.UNIVERSAL,q.Type.OID,!1,r)),a.value.push(q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,""));var o=q.create(q.Class.UNIVERSAL,q.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),q.toDer(i).getBytes()},wC=function(e,t,n){if(n)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(rt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(rt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new rt(De.util.bytesToHex(De.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(rt.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(r.modInverse(t.n)).mod(t.n),o};Ve.rsa.encrypt=function(e,t,n){var r=n,i,a=Math.ceil(t.n.bitLength()/8);n!==!1&&n!==!0?(r=n===2,i=IC(e,t,n)):(i=De.util.createBuffer(),i.putBytes(e));for(var o=new rt(i.toHex(),16),s=wC(o,t,r),l=s.toString(16),u=De.util.createBuffer(),c=a-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),u.getBytes()};Ve.rsa.decrypt=function(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new rt(De.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=wC(o,t,n),l=s.toString(16),u=De.util.createBuffer(),c=i-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),r!==!1?Qc(u.getBytes(),t,n):u.getBytes()};Ve.rsa.createKeyPairGenerationState=function(e,t,n){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,n=n||{};var r=n.prng||De.random,i={nextBytes:function(s){for(var l=r.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=l.charCodeAt(u)}},a=n.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new rt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};Ve.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var n=new rt(null);n.fromInt(30);for(var r=0,i=function(d,h){return d|h},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var l=e.p===null?e.pBits:e.qBits,u=l-1;e.pqState===0?(e.num=new rt(l,e.rng),e.num.testBit(u)||e.num.bitwiseTo(rt.ONE.shiftLeft(u),i,e.num),e.num.dAddOffset(31-e.num.mod(n).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(RT(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(ET[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(rt.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};Ve.rsa.generateKeyPair=function(e,t,n,r){if(arguments.length===1?typeof e=="object"?(n=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(n=t,t=void 0):(n=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof n=="function"&&(r=n,n=void 0):(r=n,n=t,t=void 0)),n=n||{},e===void 0&&(e=n.bits||2048),t===void 0&&(t=n.e||65537),!De.options.usePureJavaScript&&!n.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(I1("generateKeyPair"))return T0.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,l,u){if(s)return r(s);r(null,{privateKey:Ve.privateKeyFromPem(u),publicKey:Ve.publicKeyFromPem(l)})});if(_1("generateKey")&&_1("exportKey"))return br.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return br.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){r(s)}).then(function(s){if(s){var l=Ve.privateKeyFromAsn1(q.fromDer(De.util.createBuffer(s)));r(null,{privateKey:l,publicKey:Ve.setRsaPublicKey(l.n,l.e)})}});if(D1("generateKey")&&D1("exportKey")){var i=br.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var l=s.target.result,u=br.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);u.oncomplete=function(c){var d=c.target.result,h=Ve.privateKeyFromAsn1(q.fromDer(De.util.createBuffer(d)));r(null,{privateKey:h,publicKey:Ve.setRsaPublicKey(h.n,h.e)})},u.onerror=function(c){r(c)}},i.onerror=function(s){r(s)};return}}else if(I1("generateKeyPairSync")){var a=T0.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Ve.privateKeyFromPem(a.privateKey),publicKey:Ve.publicKeyFromPem(a.publicKey)}}}var o=Ve.rsa.createKeyPairGenerationState(e,t,n);if(!r)return Ve.rsa.stepKeyPairGenerationState(o,0),o.keys;TT(o,n,r)};Ve.setRsaPublicKey=Ve.rsa.setPublicKey=function(e,t){var n={n:e,e:t};return n.encrypt=function(r,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,l,u){return IC(s,l,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,l){return De.pkcs1.encode_rsa_oaep(l,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(r,n,!0);return Ve.rsa.encrypt(o,n,!0)},n.verify=function(r,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(l,u){u=Qc(u,n,!0);var c=q.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),d={},h=[];if(!q.validate(c,DT,d,h)){var f=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw f.errors=h,f}var g=q.derToOid(d.algorithmIdentifier);if(!(g===De.oids.md2||g===De.oids.md5||g===De.oids.sha1||g===De.oids.sha224||g===De.oids.sha256||g===De.oids.sha384||g===De.oids.sha512||g===De.oids["sha512-224"]||g===De.oids["sha512-256"])){var f=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw f.oid=g,f}if((g===De.oids.md2||g===De.oids.md5)&&!("parameters"in d))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===d.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(l,u){return u=Qc(u,n,!0),l===u}});var s=Ve.rsa.decrypt(i,n,!0,!1);return a.verify(r,s,n.n.bitLength())},n};Ve.setRsaPrivateKey=Ve.rsa.setPrivateKey=function(e,t,n,r,i,a,o,s){var l={n:e,e:t,d:n,p:r,q:i,dP:a,dQ:o,qInv:s};return l.decrypt=function(u,c,d){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var h=Ve.rsa.decrypt(u,l,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:Qc};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(f,g){return De.pkcs1.decode_rsa_oaep(g,f,d)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(f){return f}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(h,l,!1)},l.sign=function(u,c){var d=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:AT},d=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},d=1);var h=c.encode(u,l.n.bitLength());return Ve.rsa.encrypt(h,l,d)},l};Ve.wrapRsaPrivateKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,q.integerToDer(0).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.OID,!1,q.oidToDer(Ve.oids.rsaEncryption).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,"")]),q.create(q.Class.UNIVERSAL,q.Type.OCTETSTRING,!1,q.toDer(e).getBytes())])};Ve.privateKeyFromAsn1=function(e){var t={},n=[];if(q.validate(e,ST,t,n)&&(e=q.fromDer(De.util.createBuffer(t.privateKey))),t={},n=[],!q.validate(e,wT,t,n)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=n,r}var i,a,o,s,l,u,c,d;return i=De.util.createBuffer(t.privateKeyModulus).toHex(),a=De.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=De.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=De.util.createBuffer(t.privateKeyPrime1).toHex(),l=De.util.createBuffer(t.privateKeyPrime2).toHex(),u=De.util.createBuffer(t.privateKeyExponent1).toHex(),c=De.util.createBuffer(t.privateKeyExponent2).toHex(),d=De.util.createBuffer(t.privateKeyCoefficient).toHex(),Ve.setRsaPrivateKey(new rt(i,16),new rt(a,16),new rt(o,16),new rt(s,16),new rt(l,16),new rt(u,16),new rt(c,16),new rt(d,16))};Ve.privateKeyToAsn1=Ve.privateKeyToRSAPrivateKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,q.integerToDer(0).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.n)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.e)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.d)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.p)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.q)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.dP)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.dQ)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.qInv))])};Ve.publicKeyFromAsn1=function(e){var t={},n=[];if(q.validate(e,_T,t,n)){var r=q.derToOid(t.publicKeyOid);if(r!==Ve.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=r,i}e=t.rsaPublicKey}if(n=[],!q.validate(e,IT,t,n)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=n,i}var a=De.util.createBuffer(t.publicKeyModulus).toHex(),o=De.util.createBuffer(t.publicKeyExponent).toHex();return Ve.setRsaPublicKey(new rt(a,16),new rt(o,16))};Ve.publicKeyToAsn1=Ve.publicKeyToSubjectPublicKeyInfo=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.OID,!1,q.oidToDer(Ve.oids.rsaEncryption).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,"")]),q.create(q.Class.UNIVERSAL,q.Type.BITSTRING,!1,[Ve.publicKeyToRSAPublicKey(e)])])};Ve.publicKeyToRSAPublicKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.n)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.e))])};function IC(e,t,n){var r=De.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}r.putByte(0),r.putByte(n);var o=i-3-e.length,s;if(n===0||n===1){s=n===0?0:255;for(var l=0;l<o;++l)r.putByte(s)}else for(;o>0;){for(var u=0,c=De.random.getBytes(o),l=0;l<o;++l)s=c.charCodeAt(l),s===0?++u:r.putByte(s);o=u}return r.putByte(0),r.putBytes(e),r}function Qc(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8),a=De.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||n&&s!==0&&s!==1||!n&&s!=2||n&&s===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(s===0){l=i-3-r;for(var u=0;u<l;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(l=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++l}else if(s===2)for(l=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++l}var c=a.getByte();if(c!==0||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function TT(e,t,n){typeof t=="function"&&(n=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),i();function i(){a(e.pBits,function(s,l){if(s)return n(s);if(e.p=l,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,l){De.prime.generateProbablePrime(s,r,l)}function o(s,l){if(s)return n(s);if(e.q=l,e.p.compareTo(e.q)<0){var u=e.p;e.p=e.q,e.q=u}if(e.p.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.p=null,i();return}if(e.q.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(rt.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)},n(null,e.keys)}}function jr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=De.util.hexToBytes(t);return n.length>1&&(n.charCodeAt(0)===0&&!(n.charCodeAt(1)&128)||n.charCodeAt(0)===255&&(n.charCodeAt(1)&128)===128)?n.substr(1):n}function RT(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function I1(e){return De.util.isNodejs&&typeof T0[e]=="function"}function _1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.crypto=="object"&&typeof br.globalScope.crypto.subtle=="object"&&typeof br.globalScope.crypto.subtle[e]=="function"}function D1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.msCrypto=="object"&&typeof br.globalScope.msCrypto.subtle=="object"&&typeof br.globalScope.msCrypto.subtle[e]=="function"}function A1(e){for(var t=De.util.hexToBytes(e.toString(16)),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}var me=ze;if(typeof BT>"u")var BT=me.jsbn.BigInteger;var ne=me.asn1,je=me.pki=me.pki||{};je.pbe=me.pbe=me.pbe||{};var ka=je.oids,$T={name:"EncryptedPrivateKeyInfo",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},kT={name:"PBES2Algorithms",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},PT={name:"pkcs-12PbeParams",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"iterations"}]};je.encryptPrivateKeyInfo=function(e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||"aes128",n.prfAlgorithm=n.prfAlgorithm||"sha1";var r=me.random.getBytesSync(n.saltSize),i=n.count,a=ne.integerToDer(i),o,s,l;if(n.algorithm.indexOf("aes")===0||n.algorithm==="des"){var u,c,d;switch(n.algorithm){case"aes128":o=16,u=16,c=ka["aes128-CBC"],d=me.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=ka["aes192-CBC"],d=me.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=ka["aes256-CBC"],d=me.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=ka.desCBC,d=me.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var f="hmacWith"+n.prfAlgorithm.toUpperCase(),g=DC(f),p=me.pkcs5.pbkdf2(t,r,i,o,g),m=me.random.getBytesSync(u),b=d(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes();var v=FT(r,a,o,f);s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBES2).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBKDF2).getBytes()),v]),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(c).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,m)])])])}else if(n.algorithm==="3des"){o=24;var x=new me.util.ByteBuffer(r),p=je.pbe.generatePkcs12Key(t,x,1,i,o),m=je.pbe.generatePkcs12Key(t,x,2,i,o),b=me.des.createEncryptionCipher(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes(),s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,r),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,a.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var C=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[s,ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,l)]);return C};je.decryptPrivateKeyInfo=function(e,t){var n=null,r={},i=[];if(!ne.validate(e,$T,r,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=ne.derToOid(r.encryptionOid),s=je.pbe.getCipher(o,r.encryptionParams,t),l=me.util.createBuffer(r.encryptedData);return s.update(l),s.finish()&&(n=ne.fromDer(s.output)),n};je.encryptedPrivateKeyToPem=function(e,t){var n={type:"ENCRYPTED PRIVATE KEY",body:ne.toDer(e).getBytes()};return me.pem.encode(n,{maxline:t})};je.encryptedPrivateKeyFromPem=function(e){var t=me.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var n=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ne.fromDer(t.body)};je.encryptRsaPrivateKey=function(e,t,n){if(n=n||{},!n.legacy){var r=je.wrapRsaPrivateKey(je.privateKeyToAsn1(e));return r=je.encryptPrivateKeyInfo(r,t,n),je.encryptedPrivateKeyToPem(r)}var i,a,o,s;switch(n.algorithm){case"aes128":i="AES-128-CBC",o=16,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+n.algorithm+'".');throw l.algorithm=n.algorithm,l}var u=me.pbe.opensslDeriveBytes(t,a.substr(0,8),o),c=s(u);c.start(a),c.update(ne.toDer(je.privateKeyToAsn1(e))),c.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:me.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return me.pem.encode(d)};je.decryptRsaPrivateKey=function(e,t){var n=null,r=me.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(r.procType&&r.procType.type==="ENCRYPTED"){var a,o;switch(r.dekInfo.algorithm){case"DES-CBC":a=8,o=me.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=me.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=me.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=me.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=me.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(d){return me.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":a=8,o=function(d){return me.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":a=16,o=function(d){return me.rc2.createDecryptionCipher(d,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw i.algorithm=r.dekInfo.algorithm,i}var s=me.util.hexToBytes(r.dekInfo.parameters),l=me.pbe.opensslDeriveBytes(t,s.substr(0,8),a),u=o(l);if(u.start(s),u.update(me.util.createBuffer(r.body)),u.finish())n=u.output.getBytes();else return n}else n=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?n=je.decryptPrivateKeyInfo(ne.fromDer(n),t):n=ne.fromDer(n),n!==null&&(n=je.privateKeyFromAsn1(n)),n};je.pbe.generatePkcs12Key=function(e,t,n,r,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in me.md))throw new Error('"sha1" hash algorithm unavailable.');a=me.md.sha1.create()}var l=a.digestLength,u=a.blockLength,c=new me.util.ByteBuffer,d=new me.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var h=d.length(),f=t.length(),g=new me.util.ByteBuffer;g.fillWithByte(n,u);var p=u*Math.ceil(f/u),m=new me.util.ByteBuffer;for(s=0;s<p;s++)m.putByte(t.at(s%f));var b=u*Math.ceil(h/u),v=new me.util.ByteBuffer;for(s=0;s<b;s++)v.putByte(d.at(s%h));var x=m;x.putBuffer(v);for(var C=Math.ceil(i/l),E=1;E<=C;E++){var w=new me.util.ByteBuffer;w.putBytes(g.bytes()),w.putBytes(x.bytes());for(var B=0;B<r;B++)a.start(),a.update(w.getBytes()),w=a.digest();var y=new me.util.ByteBuffer;for(s=0;s<u;s++)y.putByte(w.at(s%l));var S=Math.ceil(f/u)+Math.ceil(h/u),D=new me.util.ByteBuffer;for(o=0;o<S;o++){var A=new me.util.ByteBuffer(x.getBytes(u)),T=511;for(s=y.length()-1;s>=0;s--)T=T>>8,T+=y.at(s)+A.at(s),A.setAt(s,T&255);D.putBuffer(A)}x=D,c.putBuffer(w)}return c.truncate(c.length()-i),c};je.pbe.getCipher=function(e,t,n){switch(e){case je.oids.pkcs5PBES2:return je.pbe.getCipherForPBES2(e,t,n);case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case je.oids["pbewithSHAAnd40BitRC2-CBC"]:return je.pbe.getCipherForPKCS12PBE(e,t,n);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};je.pbe.getCipherForPBES2=function(e,t,n){var r={},i=[];if(!ne.validate(t,kT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=ne.derToOid(r.kdfOid),e!==je.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=ne.derToOid(r.encOid),e!==je.oids["aes128-CBC"]&&e!==je.oids["aes192-CBC"]&&e!==je.oids["aes256-CBC"]&&e!==je.oids["des-EDE3-CBC"]&&e!==je.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=r.kdfSalt,s=me.util.createBuffer(r.kdfIterationCount);s=s.getInt(s.length()<<3);var l,u;switch(je.oids[e]){case"aes128-CBC":l=16,u=me.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,u=me.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,u=me.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,u=me.des.createDecryptionCipher;break;case"desCBC":l=8,u=me.des.createDecryptionCipher;break}var c=_C(r.prfOid),d=me.pkcs5.pbkdf2(n,o,s,l,c),h=r.encIv,f=u(d);return f.start(h),f};je.pbe.getCipherForPKCS12PBE=function(e,t,n){var r={},i=[];if(!ne.validate(t,PT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=me.util.createBuffer(r.salt),s=me.util.createBuffer(r.iterations);s=s.getInt(s.length()<<3);var l,u,c;switch(e){case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,u=8,c=me.des.startDecrypting;break;case je.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,u=8,c=function(p,m){var b=me.rc2.createDecryptionCipher(p,40);return b.start(m,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var d=_C(r.prfOid),h=je.pbe.generatePkcs12Key(n,o,1,s,l,d);d.start();var f=je.pbe.generatePkcs12Key(n,o,2,s,u,d);return c(h,f)};je.pbe.opensslDeriveBytes=function(e,t,n,r){if(typeof r>"u"||r===null){if(!("md5"in me.md))throw new Error('"md5" hash algorithm unavailable.');r=me.md.md5.create()}t===null&&(t="");for(var i=[T1(r,e+t)],a=16,o=1;a<n;++o,a+=16)i.push(T1(r,i[o-1]+e+t));return i.join("").substr(0,n)};function T1(e,t){return e.start().update(t).digest().getBytes()}function _C(e){var t;if(!e)t="hmacWithSHA1";else if(t=je.oids[ne.derToOid(e)],!t){var n=new Error("Unsupported PRF OID.");throw n.oid=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}return DC(t)}function DC(e){var t=me.md;switch(e){case"hmacWithSHA224":t=me.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var n=new Error("Unsupported PRF algorithm.");throw n.algorithm=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function FT(e,t,n,r){var i=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,e),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&i.value.push(ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,me.util.hexToBytes(n.toString(16))),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(je.oids[r]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.NULL,!1,"")])),i}var cs=ze,pe=cs.asn1,Ts=cs.pkcs7asn1=cs.pkcs7asn1||{};cs.pkcs7=cs.pkcs7||{};cs.pkcs7.asn1=Ts;var AC={name:"ContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Ts.contentInfoValidator=AC;var TC={name:"EncryptedContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Ts.envelopedDataValidator={name:"EnvelopedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(TC)};Ts.encryptedDataValidator={name:"EncryptedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"}].concat(TC)};var NT={name:"SignerInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Ts.signedDataValidator={name:"SignedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},AC,{name:"SignedData.Certificates",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,capture:"signerInfos",optional:!0,value:[NT]}]};Ts.recipientInfoValidator={name:"RecipientInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var ao=ze;ao.mgf=ao.mgf||{};var MT=ao.mgf.mgf1=ao.mgf1=ao.mgf1||{};MT.create=function(e){var t={generate:function(n,r){for(var i=new ao.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new ao.util.ByteBuffer;s.putInt32(o),e.start(),e.update(n+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}};return t};var ed=ze;ed.mgf=ed.mgf||{};ed.mgf.mgf1=ed.mgf1;var Ga=ze,LT=Ga.pss=Ga.pss||{};LT.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,n=e.mgf,r=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=Ga.util.createBuffer(i));var a;if("saltLength"in e)a=e.saltLength;else if(i!==null)a=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==a)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||Ga.random,s={};return s.encode=function(l,u){var c,d=u-1,h=Math.ceil(d/8),f=l.digest().getBytes();if(h<r+a+2)throw new Error("Message is too long to encrypt.");var g;i===null?g=o.getBytesSync(a):g=i.bytes();var p=new Ga.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(g),t.start(),t.update(p.getBytes());var m=t.digest().getBytes(),b=new Ga.util.ByteBuffer;b.fillWithByte(0,h-a-r-2),b.putByte(1),b.putBytes(g);var v=b.getBytes(),x=h-r-1,C=n.generate(m,x),E="";for(c=0;c<x;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var w=65280>>8*h-d&255;return E=String.fromCharCode(E.charCodeAt(0)&~w)+E.substr(1),E+m+"¼"},s.verify=function(l,u,c){var d,h=c-1,f=Math.ceil(h/8);if(u=u.substr(-f),f<r+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(u.charCodeAt(f-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var g=f-r-1,p=u.substr(0,g),m=u.substr(g,r),b=65280>>8*f-h&255;if(p.charCodeAt(0)&b)throw new Error("Bits beyond keysize not zero as expected.");var v=n.generate(m,g),x="";for(d=0;d<g;d++)x+=String.fromCharCode(p.charCodeAt(d)^v.charCodeAt(d));x=String.fromCharCode(x.charCodeAt(0)&~b)+x.substr(1);var C=f-r-a-2;for(d=0;d<C;d++)if(x.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(x.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var E=x.substr(-a),w=new Ga.util.ByteBuffer;w.fillWithByte(0,8),w.putBytes(l),w.putBytes(E),t.start(),t.update(w.getBytes());var B=t.digest().getBytes();return m===B},s};var Ae=ze,N=Ae.asn1,de=Ae.pki=Ae.pki||{},nt=de.oids,Nt={};Nt.CN=nt.commonName;Nt.commonName="CN";Nt.C=nt.countryName;Nt.countryName="C";Nt.L=nt.localityName;Nt.localityName="L";Nt.ST=nt.stateOrProvinceName;Nt.stateOrProvinceName="ST";Nt.O=nt.organizationName;Nt.organizationName="O";Nt.OU=nt.organizationalUnitName;Nt.organizationalUnitName="OU";Nt.E=nt.emailAddress;Nt.emailAddress="E";var RC=Ae.pki.rsa.publicKeyValidator,OT={name:"Certificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},RC,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},VT={name:"rsapss",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},HT={name:"CertificationRequestInfo",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},RC,{name:"CertificationRequestInfo.attributes",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:N.Class.UNIVERSAL,type:N.Type.SET,constructed:!0}]}]}]},jT={name:"CertificationRequest",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[HT,{name:"CertificationRequest.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};de.RDNAttributesAsArray=function(e,t){for(var n=[],r,i,a,o=0;o<e.value.length;++o){r=e.value[o];for(var s=0;s<r.value.length;++s)a={},i=r.value[s],a.type=N.derToOid(i.value[0].value),a.value=i.value[1].value,a.valueTagClass=i.value[1].type,a.type in nt&&(a.name=nt[a.type],a.name in Nt&&(a.shortName=Nt[a.name])),t&&(t.update(a.type),t.update(a.value)),n.push(a)}return n};de.CRIAttributesAsArray=function(e){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],i=N.derToOid(r.value[0].value),a=r.value[1].value,o=0;o<a.length;++o){var s={};if(s.type=i,s.value=a[o].value,s.valueTagClass=a[o].type,s.type in nt&&(s.name=nt[s.type],s.name in Nt&&(s.shortName=Nt[s.name])),s.type===nt.extensionRequest){s.extensions=[];for(var l=0;l<s.value.length;++l)s.extensions.push(de.certificateExtensionFromAsn1(s.value[l]))}t.push(s)}return t};function xa(e,t){typeof t=="string"&&(t={shortName:t});for(var n=null,r,i=0;n===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}var td=function(e,t,n){var r={};if(e!==nt["RSASSA-PSS"])return r;n&&(r={hash:{algorithmOid:nt.sha1},mgf:{algorithmOid:nt.mgf1,hash:{algorithmOid:nt.sha1}},saltLength:20});var i={},a=[];if(!N.validate(t,VT,i,a)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=a,o}return i.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=N.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=N.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=N.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(r.saltLength=i.saltLength.charCodeAt(0)),r},sf=function(e){switch(nt[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Ae.md.sha1.create();case"md5WithRSAEncryption":return Ae.md.md5.create();case"sha256WithRSAEncryption":return Ae.md.sha256.create();case"sha384WithRSAEncryption":return Ae.md.sha384.create();case"sha512WithRSAEncryption":return Ae.md.sha512.create();case"RSASSA-PSS":return Ae.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},BC=function(e){var t=e.certificate,n;switch(t.signatureOid){case nt.sha1WithRSAEncryption:case nt.sha1WithRSASignature:break;case nt["RSASSA-PSS"]:var r,i;if(r=nt[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported MGF hash function.");throw a.oid=t.signatureParameters.mgf.hash.algorithmOid,a.name=r,a}if(i=nt[t.signatureParameters.mgf.algorithmOid],i===void 0||Ae.mgf[i]===void 0){var a=new Error("Unsupported MGF function.");throw a.oid=t.signatureParameters.mgf.algorithmOid,a.name=i,a}if(i=Ae.mgf[i].create(Ae.md[r].create()),r=nt[t.signatureParameters.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported RSASSA-PSS hash function.");throw a.oid=t.signatureParameters.hash.algorithmOid,a.name=r,a}n=Ae.pss.create(Ae.md[r].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,n)};de.certificateFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificateFromAsn1(a,t)};de.certificateToPem=function(e,t){var n={type:"CERTIFICATE",body:N.toDer(de.certificateToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyFromPem=function(e){var t=Ae.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var n=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=N.fromDer(t.body);return de.publicKeyFromAsn1(r)};de.publicKeyToPem=function(e,t){var n={type:"PUBLIC KEY",body:N.toDer(de.publicKeyToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyToRSAPublicKeyPem=function(e,t){var n={type:"RSA PUBLIC KEY",body:N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Ae.md.sha1.create(),r=t.type||"RSAPublicKey",i;switch(r){case"RSAPublicKey":i=N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=N.toDer(de.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(i);var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};de.certificationRequestFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificationRequestFromAsn1(a,t)};de.certificationRequestToPem=function(e,t){var n={type:"CERTIFICATE REQUEST",body:N.toDer(de.certificationRequestToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return xa(e.issuer,t)},e.issuer.addField=function(t){vr([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,n){vr(t),e.subject.attributes=t,delete e.subject.uniqueId,n&&(e.subject.uniqueId=n),e.subject.hash=null},e.setIssuer=function(t,n){vr(t),e.issuer.attributes=t,delete e.issuer.uniqueId,n&&(e.issuer.uniqueId=n),e.issuer.hash=null},e.setExtensions=function(t){for(var n=0;n<t.length;++n)$C(t[n],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var n=null,r,i=0;n===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=de.getTBSCertificate(e);var a=N.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var n=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject,a=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw a.expectedIssuer=i.attributes,a.actualIssuer=r.attributes,a}var o=t.md;if(o===null){o=sf({signatureOid:t.signatureOid,type:"certificate"});var s=t.tbsCertificate||de.getTBSCertificate(t),l=N.toDer(s);o.update(l.getBytes())}return o!==null&&(n=BC({certificate:e,md:o,signature:t.signature})),n},e.isIssuer=function(t){var n=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)n=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){n=!0;for(var a,o,s=0;n&&s<r.attributes.length;++s)a=r.attributes[s],o=i.attributes[s],(a.type!==o.type||a.value!==o.value)&&(n=!1)}return n},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return de.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=nt.subjectKeyIdentifier,n=0;n<e.extensions.length;++n){var r=e.extensions[n];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return Ae.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e};de.certificateFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,OT,n,r)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificate();o.version=n.certVersion?n.certVersion.charCodeAt(0):0;var s=Ae.util.createBuffer(n.certSerialNumber);o.serialNumber=s.toHex(),o.signatureOid=Ae.asn1.derToOid(n.certSignatureOid),o.signatureParameters=td(o.signatureOid,n.certSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.certinfoSignatureOid),o.siginfo.parameters=td(o.siginfo.algorithmOid,n.certinfoSignatureParams,!1),o.signature=n.certSignature;var l=[];if(n.certValidity1UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity1UTCTime)),n.certValidity2GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity2GeneralizedTime)),n.certValidity3UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity3UTCTime)),n.certValidity4GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(o.validity.notBefore=l[0],o.validity.notAfter=l[1],o.tbsCertificate=n.tbsCertificate,t){o.md=sf({signatureOid:o.signatureOid,type:"certificate"});var u=N.toDer(o.tbsCertificate);o.md.update(u.getBytes())}var c=Ae.md.sha1.create(),d=N.toDer(n.certIssuer);c.update(d.getBytes()),o.issuer.getField=function(g){return xa(o.issuer,g)},o.issuer.addField=function(g){vr([g]),o.issuer.attributes.push(g)},o.issuer.attributes=de.RDNAttributesAsArray(n.certIssuer),n.certIssuerUniqueId&&(o.issuer.uniqueId=n.certIssuerUniqueId),o.issuer.hash=c.digest().toHex();var h=Ae.md.sha1.create(),f=N.toDer(n.certSubject);return h.update(f.getBytes()),o.subject.getField=function(g){return xa(o.subject,g)},o.subject.addField=function(g){vr([g]),o.subject.attributes.push(g)},o.subject.attributes=de.RDNAttributesAsArray(n.certSubject),n.certSubjectUniqueId&&(o.subject.uniqueId=n.certSubjectUniqueId),o.subject.hash=h.digest().toHex(),n.certExtensions?o.extensions=de.certificateExtensionsFromAsn1(n.certExtensions):o.extensions=[],o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o};de.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var r=e.value[n],i=0;i<r.value.length;++i)t.push(de.certificateExtensionFromAsn1(r.value[i]));return t};de.certificateExtensionFromAsn1=function(e){var t={};if(t.id=N.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===N.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in nt){if(t.name=nt[t.id],t.name==="keyUsage"){var n=N.fromDer(t.value),r=0,i=0;n.value.length>1&&(r=n.value.charCodeAt(1),i=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(i&128)===128}else if(t.name==="basicConstraints"){var n=N.fromDer(t.value);n.value.length>0&&n.value[0].type===N.Type.BOOLEAN?t.cA=n.value[0].value.charCodeAt(0)!==0:t.cA=!1;var a=null;n.value.length>0&&n.value[0].type===N.Type.INTEGER?a=n.value[0].value:n.value.length>1&&(a=n.value[1].value),a!==null&&(t.pathLenConstraint=N.derToInteger(a))}else if(t.name==="extKeyUsage")for(var n=N.fromDer(t.value),o=0;o<n.value.length;++o){var s=N.derToOid(n.value[o].value);s in nt?t[nt[s]]=!0:t[s]=!0}else if(t.name==="nsCertType"){var n=N.fromDer(t.value),r=0;n.value.length>1&&(r=n.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var l,n=N.fromDer(t.value),u=0;u<n.value.length;++u){l=n.value[u];var c={type:l.type,value:l.value};switch(t.altNames.push(c),l.type){case 1:case 2:case 6:break;case 7:c.ip=Ae.util.bytesToIP(l.value);break;case 8:c.oid=N.derToOid(l.value);break}}}else if(t.name==="subjectKeyIdentifier"){var n=N.fromDer(t.value);t.subjectKeyIdentifier=Ae.util.bytesToHex(n.value)}}return t};de.certificationRequestFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,jT,n,r)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificationRequest();if(o.version=n.csrVersion?n.csrVersion.charCodeAt(0):0,o.signatureOid=Ae.asn1.derToOid(n.csrSignatureOid),o.signatureParameters=td(o.signatureOid,n.csrSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.csrSignatureOid),o.siginfo.parameters=td(o.siginfo.algorithmOid,n.csrSignatureParams,!1),o.signature=n.csrSignature,o.certificationRequestInfo=n.certificationRequestInfo,t){o.md=sf({signatureOid:o.signatureOid,type:"certification request"});var s=N.toDer(o.certificationRequestInfo);o.md.update(s.getBytes())}var l=Ae.md.sha1.create();return o.subject.getField=function(u){return xa(o.subject,u)},o.subject.addField=function(u){vr([u]),o.subject.attributes.push(u)},o.subject.attributes=de.RDNAttributesAsArray(n.certificationRequestInfoSubject,l),o.subject.hash=l.digest().toHex(),o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o.getAttribute=function(u){return xa(o,u)},o.addAttribute=function(u){vr([u]),o.attributes.push(u)},o.attributes=de.CRIAttributesAsArray(n.certificationRequestInfoAttributes||[]),o};de.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return xa(e,t)},e.addAttribute=function(t){vr([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){vr(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){vr(t),e.attributes=t},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=de.getCertificationRequestInfo(e);var a=N.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,n=e.md;if(n===null){n=sf({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||de.getCertificationRequestInfo(e),i=N.toDer(r);n.update(i.getBytes())}return n!==null&&(t=BC({certificate:e,md:n,signature:e.signature})),t},e};function ds(e){for(var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),n,r,i=e.attributes,a=0;a<i.length;++a){n=i[a];var o=n.value,s=N.Type.PRINTABLESTRING;"valueTagClass"in n&&(s=n.valueTagClass,s===N.Type.UTF8&&(o=Ae.util.encodeUtf8(o))),r=N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(n.type).getBytes()),N.create(N.Class.UNIVERSAL,s,!1,o)])]),t.value.push(r)}return t}function vr(e){for(var t,n=0;n<e.length;++n){if(t=e[n],typeof t.name>"u"&&(t.type&&t.type in de.oids?t.name=de.oids[t.type]:t.shortName&&t.shortName in Nt&&(t.name=de.oids[Nt[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in de.oids)t.type=de.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Nt&&(t.shortName=Nt[t.name]),t.type===nt.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=N.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(de.certificateExtensionToAsn1($C(t.extensions[i])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function $C(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in de.oids&&(e.name=de.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in de.oids)e.id=de.oids[e.name];else{var n=new Error("Extension ID not specified.");throw n.extension=e,n}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,i=0,a=0;e.digitalSignature&&(i|=128,r=7),e.nonRepudiation&&(i|=64,r=6),e.keyEncipherment&&(i|=32,r=5),e.dataEncipherment&&(i|=16,r=4),e.keyAgreement&&(i|=8,r=3),e.keyCertSign&&(i|=4,r=2),e.cRLSign&&(i|=2,r=1),e.encipherOnly&&(i|=1,r=0),e.decipherOnly&&(a|=128,r=7);var o=String.fromCharCode(r);a!==0?o+=String.fromCharCode(i)+String.fromCharCode(a):i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="basicConstraints")e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in e&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var l in e)e[l]===!0&&(l in nt?s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(nt[l]).getBytes())):l.indexOf(".")!==-1&&s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(l).getBytes())))}else if(e.name==="nsCertType"){var r=0,i=0;e.client&&(i|=128,r=7),e.server&&(i|=64,r=6),e.email&&(i|=32,r=5),e.objsign&&(i|=16,r=4),e.reserved&&(i|=8,r=3),e.sslCA&&(i|=4,r=2),e.emailCA&&(i|=2,r=1),e.objCA&&(i|=1,r=0);var o=String.fromCharCode(r);i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));e.value.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=N.create(N.Class.UNIVERSAL,N.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,d.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;if(e.keyIdentifier){var h=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var f=[N.create(N.Class.CONTEXT_SPECIFIC,4,!0,[ds(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];s.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,f))}if(e.serialNumber){var g=Ae.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);s.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if(e.name==="cRLDistributionPoints"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var s=e.value.value,p=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),m=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]),u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));m.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}p.value.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[m])),s.push(p)}if(typeof e.value>"u"){var n=new Error("Extension value not specified.");throw n.extension=e,n}return e}function ap(e,t){switch(e){case nt["RSASSA-PSS"]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(t.saltLength).getBytes())])),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,n);default:return N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")}}function WT(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var n=e.attributes,r=0;r<n.length;++r){var i=n[r],a=i.value,o=N.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===N.Type.UTF8&&(a=Ae.util.encodeUtf8(a));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var l=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(i.type).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,o,s,a)])]);t.value.push(l)}return t}var zT=new Date("1950-01-01T00:00:00Z"),GT=new Date("2050-01-01T00:00:00Z");function R1(e){return e>=zT&&e<GT?N.create(N.Class.UNIVERSAL,N.Type.UTCTIME,!1,N.dateToUtcTime(e)):N.create(N.Class.UNIVERSAL,N.Type.GENERALIZEDTIME,!1,N.dateToGeneralizedTime(e))}de.getTBSCertificate=function(e){var t=R1(e.validity.notBefore),n=R1(e.validity.notAfter),r=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes())]),N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,Ae.util.hexToBytes(e.serialNumber)),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.siginfo.algorithmOid).getBytes()),ap(e.siginfo.algorithmOid,e.siginfo.parameters)]),ds(e.issuer),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,n]),ds(e.subject),de.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(de.certificateExtensionsToAsn1(e.extensions)),r};de.getCertificationRequestInfo=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes()),ds(e.subject),de.publicKeyToAsn1(e.publicKey),WT(e)]);return t};de.distinguishedNameToAsn1=function(e){return ds(e)};de.certificateToAsn1=function(e){var t=e.tbsCertificate||de.getTBSCertificate(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.certificateExtensionsToAsn1=function(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,3,!0,[]),n=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(n);for(var r=0;r<e.length;++r)n.value.push(de.certificateExtensionToAsn1(e[r]));return t};de.certificateExtensionToAsn1=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.id).getBytes())),e.critical&&t.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ"));var n=e.value;return typeof e.value!="string"&&(n=N.toDer(n).getBytes()),t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,n)),t};de.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||de.getCertificationRequestInfo(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(o){var s=n(o.issuer);return s},t.addCertificate=function(o){if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))if(o.subject.hash in t.certs){var s=t.certs[o.subject.hash];Ae.util.isArray(s)||(s=[s]),s.push(o),t.certs[o.subject.hash]=s}else t.certs[o.subject.hash]=o},t.hasCertificate=function(o){typeof o=="string"&&(o=Ae.pki.certificateFromPem(o));var s=n(o.subject);if(!s)return!1;Ae.util.isArray(s)||(s=[s]);for(var l=N.toDer(de.certificateToAsn1(o)).getBytes(),u=0;u<s.length;++u){var c=N.toDer(de.certificateToAsn1(s[u])).getBytes();if(l===c)return!0}return!1},t.listAllCertificates=function(){var o=[];for(var s in t.certs)if(t.certs.hasOwnProperty(s)){var l=t.certs[s];if(!Ae.util.isArray(l))o.push(l);else for(var u=0;u<l.length;++u)o.push(l[u])}return o},t.removeCertificate=function(o){var s;if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))return null;var l=n(o.subject);if(!Ae.util.isArray(l))return s=t.certs[o.subject.hash],delete t.certs[o.subject.hash],s;for(var u=N.toDer(de.certificateToAsn1(o)).getBytes(),c=0;c<l.length;++c){var d=N.toDer(de.certificateToAsn1(l[c])).getBytes();u===d&&(s=l[c],l.splice(c,1))}return l.length===0&&delete t.certs[o.subject.hash],s};function n(o){return r(o),t.certs[o.hash]||null}function r(o){if(!o.hash){var s=Ae.md.sha1.create();o.attributes=de.RDNAttributesAsArray(ds(o),s),o.hash=s.digest().toHex()}}if(e)for(var i=0;i<e.length;++i){var a=e[i];t.addCertificate(a)}return t};de.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};de.verifyCertificateChain=function(e,t,n){typeof n=="function"&&(n={verify:n}),n=n||{},t=t.slice(0);var r=t.slice(0),i=n.validityCheckDate;typeof i>"u"&&(i=new Date);var a=!0,o=null,s=0;do{var l=t.shift(),u=null,c=!1;if(i&&(i<l.validity.notBefore||i>l.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:de.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:i}),o===null){if(u=t[0]||e.getIssuer(l),u===null&&l.isIssuer(l)&&(c=!0,u=l),u){var d=u;Ae.util.isArray(d)||(d=[d]);for(var h=!1;!h&&d.length>0;){u=d.shift();try{h=u.verify(l)}catch{}}h||(o={message:"Certificate signature is invalid.",error:de.certificateError.bad_certificate})}o===null&&(!u||c)&&!e.hasCertificate(l)&&(o={message:"Certificate is not trusted.",error:de.certificateError.unknown_ca})}if(o===null&&u&&!l.isIssuer(u)&&(o={message:"Certificate issuer is invalid.",error:de.certificateError.bad_certificate}),o===null)for(var f={keyUsage:!0,basicConstraints:!0},g=0;o===null&&g<l.extensions.length;++g){var p=l.extensions[g];p.critical&&!(p.name in f)&&(o={message:"Certificate has an unsupported critical extension.",error:de.certificateError.unsupported_certificate})}if(o===null&&(!a||t.length===0&&(!u||c))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||m===null)&&(o={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:de.certificateError.bad_certificate}),o===null&&m!==null&&!m.cA&&(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:de.certificateError.bad_certificate}),o===null&&b!==null&&"pathLenConstraint"in m){var v=s-1;v>m.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:de.certificateError.bad_certificate})}}var x=o===null?!0:o.error,C=n.verify?n.verify(x,s,r):x;if(C===!0)o=null;else throw x===!0&&(o={message:"The application rejected the certificate.",error:de.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!Ae.util.isArray(C)?(C.message&&(o.message=C.message),C.error&&(o.error=C.error)):typeof C=="string"&&(o.error=C)),o;a=!1,++s}while(t.length>0);return!0};var xt=ze,G=xt.asn1,Xe=xt.pki,Il=xt.pkcs12=xt.pkcs12||{},kC={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},UT={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},kC,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},XT={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ZT={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},YT={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ns(e,t,n,r){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];if(!(r!==void 0&&s.type!==r)){if(t===null){i.push(s);continue}s.attributes[t]!==void 0&&s.attributes[t].indexOf(n)>=0&&i.push(s)}}return i}Il.pkcs12FromAsn1=function(e,t,n){typeof t=="string"?(n=t,t=!0):t===void 0&&(t=!0);var r={},i=[];if(!G.validate(e,UT,r,i)){var a=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw a.errors=a,a}var o={version:r.version.charCodeAt(0),safeContents:[],getBags:function(m){var b={},v;return"localKeyId"in m?v=m.localKeyId:"localKeyIdHex"in m&&(v=xt.util.hexToBytes(m.localKeyIdHex)),v===void 0&&!("friendlyName"in m)&&"bagType"in m&&(b[m.bagType]=Ns(o.safeContents,null,null,m.bagType)),v!==void 0&&(b.localKeyId=Ns(o.safeContents,"localKeyId",v,m.bagType)),"friendlyName"in m&&(b.friendlyName=Ns(o.safeContents,"friendlyName",m.friendlyName,m.bagType)),b},getBagsByFriendlyName:function(m,b){return Ns(o.safeContents,"friendlyName",m,b)},getBagsByLocalKeyId:function(m,b){return Ns(o.safeContents,"localKeyId",m,b)}};if(r.version.charCodeAt(0)!==3){var a=new Error("PKCS#12 PFX of version other than 3 not supported.");throw a.version=r.version.charCodeAt(0),a}if(G.derToOid(r.contentType)!==Xe.oids.data){var a=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw a.oid=G.derToOid(r.contentType),a}var s=r.content.value[0];if(s.tagClass!==G.Class.UNIVERSAL||s.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(s=op(s),r.mac){var l=null,u=0,c=G.derToOid(r.macAlgorithm);switch(c){case Xe.oids.sha1:l=xt.md.sha1.create(),u=20;break;case Xe.oids.sha256:l=xt.md.sha256.create(),u=32;break;case Xe.oids.sha384:l=xt.md.sha384.create(),u=48;break;case Xe.oids.sha512:l=xt.md.sha512.create(),u=64;break;case Xe.oids.md5:l=xt.md.md5.create(),u=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var d=new xt.util.ByteBuffer(r.macSalt),h="macIterations"in r?parseInt(xt.util.bytesToHex(r.macIterations),16):1,f=Il.generateKey(n,d,3,h,u,l),g=xt.hmac.create();g.start(l,f),g.update(s.value);var p=g.getMac();if(p.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return KT(o,s.value,t,n),o};function op(e){if(e.composed||e.constructed){for(var t=xt.util.createBuffer(),n=0;n<e.value.length;++n)t.putBytes(e.value[n].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function KT(e,t,n,r){if(t=G.fromDer(t,n),t.tagClass!==G.Class.UNIVERSAL||t.type!==G.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var a=t.value[i],o={},s=[];if(!G.validate(a,kC,o,s)){var l=new Error("Cannot read ContentInfo.");throw l.errors=s,l}var u={encrypted:!1},c=null,d=o.content.value[0];switch(G.derToOid(o.contentType)){case Xe.oids.data:if(d.tagClass!==G.Class.UNIVERSAL||d.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=op(d).value;break;case Xe.oids.encryptedData:c=qT(d,r),u.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(o.contentType),l}u.safeBags=JT(c,n,r),e.safeContents.push(u)}}function qT(e,t){var n={},r=[];if(!G.validate(e,xt.pkcs7.asn1.encryptedDataValidator,n,r)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=r,i}var a=G.derToOid(n.contentType);if(a!==Xe.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=a,i}a=G.derToOid(n.encAlgorithm);var o=Xe.pbe.getCipher(a,n.encParameter,t),s=op(n.encryptedContentAsn1),l=xt.util.createBuffer(s.value);if(o.update(l),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function JT(e,t,n){if(!t&&e.length===0)return[];if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var a=e.value[i],o={},s=[];if(!G.validate(a,XT,o,s)){var l=new Error("Cannot read SafeBag.");throw l.errors=s,l}var u={type:G.derToOid(o.bagId),attributes:QT(o.bagAttributes)};r.push(u);var c,d,h=o.bagValue.value[0];switch(u.type){case Xe.oids.pkcs8ShroudedKeyBag:if(h=Xe.decryptPrivateKeyInfo(h,n),h===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Xe.oids.keyBag:try{u.key=Xe.privateKeyFromAsn1(h)}catch{u.key=null,u.asn1=h}continue;case Xe.oids.certBag:c=YT,d=function(){if(G.derToOid(o.certId)!==Xe.oids.x509Certificate){var g=new Error("Unsupported certificate type, only X.509 supported.");throw g.oid=G.derToOid(o.certId),g}var p=G.fromDer(o.cert,t);try{u.cert=Xe.certificateFromAsn1(p,!0)}catch{u.cert=null,u.asn1=p}};break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=u.type,l}if(c!==void 0&&!G.validate(h,c,o,s)){var l=new Error("Cannot read PKCS#12 "+c.name);throw l.errors=s,l}d()}return r}function QT(e){var t={};if(e!==void 0)for(var n=0;n<e.length;++n){var r={},i=[];if(!G.validate(e[n],ZT,r,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var o=G.derToOid(r.oid);if(Xe.oids[o]!==void 0){t[Xe.oids[o]]=[];for(var s=0;s<r.values.length;++s)t[Xe.oids[o]].push(r.values[s].value)}}return t}Il.toPkcs12Asn1=function(e,t,n,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i=r.localKeyId,a;if(i!==null)i=xt.util.hexToBytes(i);else if(r.generateLocalKeyId)if(t){var o=xt.util.isArray(t)?t[0]:t;typeof o=="string"&&(o=Xe.certificateFromPem(o));var s=xt.md.sha1.create();s.update(G.toDer(Xe.certificateToAsn1(o)).getBytes()),i=s.digest().getBytes()}else i=xt.random.getBytes(20);var l=[];i!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,i)])])),"friendlyName"in r&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,r.friendlyName)])])),l.length>0&&(a=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var u=[],c=[];t!==null&&(xt.util.isArray(t)?c=t:c=[t]);for(var d=[],h=0;h<c.length;++h){t=c[h],typeof t=="string"&&(t=Xe.certificateFromPem(t));var f=h===0?a:void 0,g=Xe.certificateToAsn1(t),p=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(g).getBytes())])])]),f]);d.push(p)}if(d.length>0){var m=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,d),b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])]);u.push(b)}var v=null;if(e!==null){var x=Xe.wrapRsaPrivateKey(Xe.privateKeyToAsn1(e));n===null?v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[x]),a]):v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Xe.encryptPrivateKeyInfo(x,n,r)]),a]);var C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[v]),E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(C).getBytes())])]);u.push(E)}var w=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,u),B;if(r.useMac){var s=xt.md.sha1.create(),y=new xt.util.ByteBuffer(xt.random.getBytes(r.saltSize)),S=r.count,e=Il.generateKey(n,y,3,S,20),D=xt.hmac.create();D.start(s,e),D.update(G.toDer(w).getBytes());var A=D.getMac();B=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,A.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,y.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(S).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(w).getBytes())])]),B])};Il.generateKey=xt.pbe.generatePkcs12Key;var Ca=ze,sp=Ca.asn1,fs=Ca.pki=Ca.pki||{};fs.pemToDer=function(e){var t=Ca.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ca.util.createBuffer(t.body)};fs.privateKeyFromPem=function(e){var t=Ca.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=sp.fromDer(t.body);return fs.privateKeyFromAsn1(r)};fs.privateKeyToPem=function(e,t){var n={type:"RSA PRIVATE KEY",body:sp.toDer(fs.privateKeyToAsn1(e)).getBytes()};return Ca.pem.encode(n,{maxline:t})};fs.privateKeyInfoToPem=function(e,t){var n={type:"PRIVATE KEY",body:sp.toDer(e).getBytes()};return Ca.pem.encode(n,{maxline:t})};var ae=ze,lf=function(e,t,n,r){var i=ae.util.createBuffer(),a=e.length>>1,o=a+(e.length&1),s=e.substr(0,o),l=e.substr(a,o),u=ae.util.createBuffer(),c=ae.hmac.create();n=t+n;var d=Math.ceil(r/16),h=Math.ceil(r/20);c.start("MD5",s);var f=ae.util.createBuffer();u.putBytes(n);for(var g=0;g<d;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),f.putBuffer(c.digest());c.start("SHA1",l);var p=ae.util.createBuffer();u.clear(),u.putBytes(n);for(var g=0;g<h;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),p.putBuffer(c.digest());return i.putBytes(ae.util.xorBytes(f.getBytes(),p.getBytes(),r)),i},eR=function(e,t,n){var r=ae.hmac.create();r.start("SHA1",e);var i=ae.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(n.type),i.putByte(n.version.major),i.putByte(n.version.minor),i.putInt16(n.length),i.putBytes(n.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},tR=function(e,t,n){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},nR=function(e,t,n){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},Yn=function(e,t){var n=0;switch(t){case 1:n=e.getByte();break;case 2:n=e.getInt16();break;case 3:n=e.getInt24();break;case 4:n=e.getInt32();break}return ae.util.createBuffer(e.getBytes(n))},gr=function(e,t,n){e.putInt(n.length(),t<<3),e.putBuffer(n)},L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(e){var t=null;for(var n in L.CipherSuites){var r=L.CipherSuites[n];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};L.handleUnexpected=function(e,t){var n=!e.open&&e.entity===L.ConnectionEnd.client;n||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(e,t,n){!e.handshaking&&e.handshakes>0&&(L.queue(e,L.createAlert(e,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(e)),e.process()};L.parseHelloMessage=function(e,t,n){var r=null,i=e.entity===L.ConnectionEnd.client;if(n<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(r={version:{major:a.getByte(),minor:a.getByte()},random:ae.util.createBuffer(a.getBytes(32)),session_id:Yn(a,1),extensions:[]},i?(r.cipher_suite=a.getBytes(2),r.compression_method=a.getByte()):(r.cipher_suites=Yn(a,2),r.compression_methods=Yn(a,1)),o=n-(o-a.length()),o>0){for(var s=Yn(a,2);s.length()>0;)r.extensions.push({type:[s.getByte(),s.getByte()],data:Yn(s,2)});if(!i)for(var l=0;l<r.extensions.length;++l){var u=r.extensions[l];if(u.type[0]===0&&u.type[1]===0)for(var c=Yn(u.data,2);c.length()>0;){var d=c.getByte();if(d!==0)break;e.session.extensions.server_name.serverNameList.push(Yn(c,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=L.getCipherSuite(r.cipher_suite);else for(var h=ae.util.createBuffer(r.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=L.getCipherSuite(h.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:ae.util.bytesToHex(r.cipher_suite)});i?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=L.CompressionMethod.none}return r};L.createSecurityParameters=function(e,t){var n=e.entity===L.ConnectionEnd.client,r=t.random.bytes(),i=n?e.session.sp.client_random:r,a=n?r:L.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:L.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}};L.handleServerHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=PC,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=iR,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.session.id=i,e.process()}};L.handleClientHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){var i=r.session_id.bytes(),a=null;if(e.sessionCache&&(a=e.sessionCache.getSession(i),a===null?i="":(a.version.major!==r.version.major||a.version.minor>r.version.minor)&&(a=null,i="")),i.length===0&&(i=ae.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<L.SupportedVersions.length&&(o=L.SupportedVersions[s],!(o.minor<=r.version.minor));++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}a!==null?(e.expect=lp,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?dR:R0,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.open=!0,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHello(e)})),e.session.resuming?(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.pending=L.createConnectionState(e),e.state.current.write=e.state.pending.write,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))):(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)})),e.fail||(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerKeyExchange(e)})),e.verifyClient!==!1&&L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificateRequest(e)})),L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHelloDone(e)})))),L.flush(e),e.process()}};L.handleCertificate=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_list:Yn(r,3)},a,o,s=[];try{for(;i.certificate_list.length()>0;)a=Yn(i.certificate_list,3),o=ae.asn1.fromDer(a),a=ae.pki.certificateFromAsn1(o,!0),s.push(a)}catch(u){return e.error(e,{message:"Could not parse certificate list.",cause:u,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=e.entity===L.ConnectionEnd.client;(l||e.verifyClient===!0)&&s.length===0?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):s.length===0?e.expect=l?B1:R0:(l?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],L.verifyCertificateChain(e,s)&&(e.expect=l?B1:R0)),e.process()};L.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});e.expect=aR,e.process()};L.handleClientKeyExchange=function(e,t,n){if(n<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:Yn(r,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=ae.pki.privateKeyFromPem(a)}catch(l){e.error(e,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(a===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{o.pre_master_secret=ae.random.getBytes(48)}e.expect=lp,e.session.clientCertificate!==null&&(e.expect=fR),e.process()};L.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:Yn(r,1),certificate_authorities:Yn(r,2)};e.session.certificateRequest=i,e.expect=oR,e.process()};L.handleCertificateVerify=function(e,t,n){if(n<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a={signature:Yn(r,2).getBytes()},o=ae.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{var s=e.session.clientCertificate;if(!s.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}e.expect=lp,e.process()};L.handleServerHelloDone=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},i=0,a=e.verify(e,r.alert.description,i,[]);if(a!==!0)return(a||a===0)&&(typeof a=="object"&&!ae.util.isArray(a)?(a.message&&(r.message=a.message),a.alert&&(r.alert.description=a.alert)):typeof a=="number"&&(r.alert.description=a)),e.error(e,r)}e.session.certificateRequest!==null&&(t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)}),L.queue(e,t)),t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createClientKeyExchange(e)}),L.queue(e,t),e.expect=uR;var o=function(s,l){s.session.certificateRequest!==null&&s.session.clientCertificate!==null&&L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createCertificateVerify(s,l)})),L.queue(s,L.createRecord(s,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),s.state.pending=L.createConnectionState(s),s.state.current.write=s.state.pending.write,L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createFinished(s)})),s.expect=PC,L.flush(s),s.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return o(e,null);L.getClientSignature(e,o)};L.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.entity===L.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=L.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?sR:hR,e.process()};L.handleFinished=function(e,t,n){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a=t.fragment.getBytes();r=ae.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var o=e.entity===L.ConnectionEnd.client,s=o?"server finished":"client finished",l=e.session.sp,u=12,c=lf;if(r=c(l.master_secret,s,r.getBytes(),u),r.getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))),e.expect=o?lR:gR,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,L.flush(e),e.isConnected=!0,e.connected(e),e.process()};L.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},i;switch(r.description){case L.Alert.Description.close_notify:i="Connection closed.";break;case L.Alert.Description.unexpected_message:i="Unexpected message.";break;case L.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case L.Alert.Description.decryption_failed:i="Decryption failed.";break;case L.Alert.Description.record_overflow:i="Record overflow.";break;case L.Alert.Description.decompression_failure:i="Decompression failed.";break;case L.Alert.Description.handshake_failure:i="Handshake failure.";break;case L.Alert.Description.bad_certificate:i="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case L.Alert.Description.certificate_expired:i="Certificate expired.";break;case L.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case L.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case L.Alert.Description.access_denied:i="Access denied.";break;case L.Alert.Description.decode_error:i="Decode error.";break;case L.Alert.Description.decrypt_error:i="Decrypt error.";break;case L.Alert.Description.export_restriction:i="Export restriction.";break;case L.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:i="Insufficient security.";break;case L.Alert.Description.internal_error:i="Internal error.";break;case L.Alert.Description.user_canceled:i="User canceled.";break;case L.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(r.description===L.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===L.ConnectionEnd.client?"server":"client",alert:r}),e.process()};L.handleHandshake=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt24();if(i>n.length())return e.fragmented=t,t.fragment=ae.util.createBuffer(),n.read-=4,e.process();e.fragmented=null,n.read-=4;var a=n.bytes(i+4);n.read+=4,r in nd[e.entity][e.expect]?(e.entity===L.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ae.md.md5.create(),sha1:ae.md.sha1.create()}),r!==L.HandshakeType.hello_request&&r!==L.HandshakeType.certificate_verify&&r!==L.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),nd[e.entity][e.expect][r](e,t,i)):L.handleUnexpected(e,t)};L.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};L.handleHeartbeat=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt16(),a=n.getBytes(i);if(r===L.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();L.queue(e,L.createRecord(e,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,a)})),L.flush(e)}else if(r===L.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,ae.util.createBuffer(a))}e.process()};var rR=0,iR=1,B1=2,aR=3,oR=4,PC=5,sR=6,lR=7,uR=8,cR=0,dR=1,R0=2,fR=3,lp=4,hR=5,gR=6,M=L.handleUnexpected,FC=L.handleChangeCipherSpec,dn=L.handleAlert,Dn=L.handleHandshake,NC=L.handleApplicationData,fn=L.handleHeartbeat,up=[];up[L.ConnectionEnd.client]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];up[L.ConnectionEnd.server]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];var Zi=L.handleHelloRequest,pR=L.handleServerHello,MC=L.handleCertificate,$1=L.handleServerKeyExchange,Yf=L.handleCertificateRequest,$u=L.handleServerHelloDone,LC=L.handleFinished,nd=[];nd[L.ConnectionEnd.client]=[[M,M,pR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,MC,$1,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,$1,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];var mR=L.handleClientHello,bR=L.handleClientKeyExchange,vR=L.handleCertificateVerify;nd[L.ConnectionEnd.server]=[[M,mR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,MC,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,bR,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,vR,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];L.generateKeys=function(e,t){var n=lf,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===L.Versions.TLS_1_0.major&&e.version.minor===L.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=n(t.master_secret,"key expansion",r,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s};L.createConnectionState=function(e){var t=e.entity===L.ConnectionEnd.client,n=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(o){return!0},compressionState:null,compressFunction:function(o){return!0},updateSequenceNumber:function(){a.sequenceNumber[1]===4294967295?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},r={read:n(),write:n()};if(r.read.update=function(a,o){return r.read.cipherFunction(o,r.read)?r.read.compressFunction(a,o,r.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_record_mac}}),!a.fail},r.write.update=function(a,o){return r.write.compressFunction(a,o,r.write)?r.write.cipherFunction(o,r.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!a.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=L.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case L.CompressionMethod.none:break;case L.CompressionMethod.deflate:r.read.compressFunction=nR,r.write.compressFunction=tR;break;default:throw new Error("Unsupported compression algorithm.")}}return r};L.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,n=ae.util.createBuffer();return n.putInt32(t),n.putBytes(ae.random.getBytes(28)),n};L.createRecord=function(e,t){if(!t.data)return null;var n={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return n};L.createAlert=function(e,t){var n=ae.util.createBuffer();return n.putByte(t.level),n.putByte(t.description),L.createRecord(e,{type:L.ContentType.alert,data:n})};L.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=ae.util.createBuffer(),n=0;n<e.cipherSuites.length;++n){var r=e.cipherSuites[n];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),a=ae.util.createBuffer();a.putByte(L.CompressionMethod.none);var o=a.length(),s=ae.util.createBuffer();if(e.virtualHost){var l=ae.util.createBuffer();l.putByte(0),l.putByte(0);var u=ae.util.createBuffer();u.putByte(0),gr(u,2,ae.util.createBuffer(e.virtualHost));var c=ae.util.createBuffer();gr(c,2,u),gr(l,2,c),s.putBuffer(l)}var d=s.length();d>0&&(d+=2);var h=e.session.id,f=h.length+1+2+4+28+2+i+1+o+d,g=ae.util.createBuffer();return g.putByte(L.HandshakeType.client_hello),g.putInt24(f),g.putByte(e.version.major),g.putByte(e.version.minor),g.putBytes(e.session.sp.client_random),gr(g,1,ae.util.createBuffer(h)),gr(g,2,t),gr(g,1,a),d>0&&gr(g,2,s),g};L.createServerHello=function(e){var t=e.session.id,n=t.length+1+2+4+28+2+1,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.server_hello),r.putInt24(n),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),gr(r,1,ae.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};L.createCertificate=function(e){var t=e.entity===L.ConnectionEnd.client,n=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,r)}var i=ae.util.createBuffer();if(n!==null)try{ae.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=ae.pem.decode(n[o])[0];if(s.type!=="CERTIFICATE"&&s.type!=="X509 CERTIFICATE"&&s.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=s.type,l}if(s.procType&&s.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=ae.util.createBuffer(s.body);a===null&&(a=ae.asn1.fromDer(u.bytes(),!1));var c=ae.util.createBuffer();gr(c,3,u),i.putBuffer(c)}n=ae.pki.certificateFromAsn1(a),t?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(f){return e.error(e,{message:"Could not send certificate list.",cause:f,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var d=3+i.length(),h=ae.util.createBuffer();return h.putByte(L.HandshakeType.certificate),h.putInt24(d),gr(h,3,i),h};L.createClientKeyExchange=function(e){var t=ae.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(ae.random.getBytes(46));var n=e.session.sp;n.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(n.pre_master_secret);var i=t.length+2,a=ae.util.createBuffer();return a.putByte(L.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a};L.createServerKeyExchange=function(e){var t=ae.util.createBuffer();return t};L.getClientSignature=function(e,t){var n=ae.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes(),e.getSignature=e.getSignature||function(r,i,a){var o=null;if(r.getPrivateKey)try{o=r.getPrivateKey(r,r.session.clientCertificate),o=ae.pki.privateKeyFromPem(o)}catch(s){r.error(r,{message:"Could not get private key.",cause:s,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}o===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i=o.sign(i,null),a(r,i)},e.getSignature(e,n,t)};L.createCertificateVerify=function(e,t){var n=t.length+2,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.certificate_verify),r.putInt24(n),r.putInt16(t.length),r.putBytes(t),r};L.createCertificateRequest=function(e){var t=ae.util.createBuffer();t.putByte(1);var n=ae.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],a=ae.pki.distinguishedNameToAsn1(i.subject),o=ae.asn1.toDer(a);n.putInt16(o.length()),n.putBuffer(o)}var s=1+t.length()+2+n.length(),l=ae.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(s),gr(l,1,t),gr(l,2,n),l};L.createServerHelloDone=function(e){var t=ae.util.createBuffer();return t.putByte(L.HandshakeType.server_hello_done),t.putInt24(0),t};L.createChangeCipherSpec=function(){var e=ae.util.createBuffer();return e.putByte(1),e};L.createFinished=function(e){var t=ae.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var n=e.entity===L.ConnectionEnd.client,r=e.session.sp,i=12,a=lf,o=n?"client finished":"server finished";t=a(r.master_secret,o,t.getBytes(),i);var s=ae.util.createBuffer();return s.putByte(L.HandshakeType.finished),s.putInt24(t.length()),s.putBuffer(t),s};L.createHeartbeat=function(e,t,n){typeof n>"u"&&(n=t.length);var r=ae.util.createBuffer();r.putByte(e),r.putInt16(n),r.putBytes(t);var i=r.length(),a=Math.max(16,i-n-3);return r.putBytes(ae.random.getBytes(a)),r};L.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===L.ContentType.handshake||t.type===L.ContentType.alert||t.type===L.ContentType.change_cipher_spec))){if(t.type===L.ContentType.handshake){var n=t.fragment.bytes();e.session.md5.update(n),e.session.sha1.update(n),n=null}var r;if(t.fragment.length()<=L.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>L.MaxFragment;)r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i.slice(0,L.MaxFragment))})),i=i.slice(L.MaxFragment);i.length>0&&r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i)}))}for(var a=0;a<r.length&&!e.fail;++a){var o=r[a],s=e.state.current.write;s.update(e,o)&&e.records.push(o)}}};L.flush=function(e){for(var t=0;t<e.records.length;++t){var n=e.records[t];e.tlsData.putByte(n.type),e.tlsData.putByte(n.version.major),e.tlsData.putByte(n.version.minor),e.tlsData.putInt16(n.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Kf=function(e){switch(e){case!0:return!0;case ae.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case ae.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case ae.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case ae.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case ae.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case ae.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},yR=function(e){switch(e){case!0:return!0;case L.Alert.Description.bad_certificate:return ae.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return ae.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return ae.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return ae.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return ae.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return ae.pki.certificateError.unknown_ca;default:return ae.pki.certificateError.bad_certificate}};L.verifyCertificateChain=function(e,t){try{var n={};for(var r in e.verifyOptions)n[r]=e.verifyOptions[r];n.verify=function(a,o,s){var l=Kf(a),u=e.verify(e,a,o,s);if(u!==!0){if(typeof u=="object"&&!ae.util.isArray(u)){var c=new Error("The application rejected the certificate.");throw c.send=!0,c.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},u.message&&(c.message=u.message),u.alert&&(c.alert.description=u.alert),c}u!==a&&(u=yR(u))}return u},ae.pki.verifyCertificateChain(e.caStore,t,n)}catch(a){var i=a;(typeof i!="object"||ae.util.isArray(i))&&(i={send:!0,alert:{level:L.Alert.Level.fatal,description:Kf(a)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:L.Alert.Level.fatal,description:Kf(i.error)}),e.error(e,i)}return!e.fail};L.createSessionCache=function(e,t){var n=null;if(e&&e.getSession&&e.setSession&&e.order)n=e;else{n={},n.cache=e||{},n.capacity=Math.max(t||100,1),n.order=[];for(var r in e)n.order.length<=t?n.order.push(r):delete e[r];n.getSession=function(i){var a=null,o=null;if(i?o=ae.util.bytesToHex(i):n.order.length>0&&(o=n.order[0]),o!==null&&o in n.cache){a=n.cache[o],delete n.cache[o];for(var s in n.order)if(n.order[s]===o){n.order.splice(s,1);break}}return a},n.setSession=function(i,a){if(n.order.length===n.capacity){var o=n.order.shift();delete n.cache[o]}var o=ae.util.bytesToHex(i);n.order.push(o),n.cache[o]=a}}return n};L.createConnection=function(e){var t=null;e.caStore?ae.util.isArray(e.caStore)?t=ae.pki.createCaStore(e.caStore):t=e.caStore:t=ae.pki.createCaStore();var n=e.cipherSuites||null;if(n===null){n=[];for(var r in L.CipherSuites)n.push(L.CipherSuites[r])}var i=e.server?L.ConnectionEnd.server:L.ConnectionEnd.client,a=e.sessionCache?L.createSessionCache(e.sessionCache):null,o={version:{major:L.Version.major,minor:L.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:n,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(c,d,h,f){return d},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:ae.util.createBuffer(),tlsData:ae.util.createBuffer(),data:ae.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(c,d){d.origin=d.origin||(c.entity===L.ConnectionEnd.client?"client":"server"),d.send&&(L.queue(c,L.createAlert(c,d.alert)),L.flush(c));var h=d.fatal!==!1;h&&(c.fail=!0),e.error(c,d),h&&c.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(c){o.version={major:L.Version.major,minor:L.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=o.entity===L.ConnectionEnd.client?rR:cR,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(c||typeof c>"u"),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=L.createConnectionState(o)},o.reset();var s=function(c,d){var h=d.type-L.ContentType.change_cipher_spec,f=up[c.entity][c.expect];h in f?f[h](c,d):L.handleUnexpected(c,d)},l=function(c){var d=0,h=c.input,f=h.length();if(f<5)d=5-f;else{c.record={type:h.getByte(),version:{major:h.getByte(),minor:h.getByte()},length:h.getInt16(),fragment:ae.util.createBuffer(),ready:!1};var g=c.record.version.major===c.version.major;g&&c.session&&c.session.version&&(g=c.record.version.minor===c.version.minor),g||c.error(c,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return d},u=function(c){var d=0,h=c.input,f=h.length();if(f<c.record.length)d=c.record.length-f;else{c.record.fragment.putBytes(h.getBytes(c.record.length)),h.compact();var g=c.state.current.read;g.update(c,c.record)&&(c.fragmented!==null&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),c.record.ready=!0)}return d};return o.handshake=function(c){if(o.entity!==L.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&o.handshakes===0&&(o.fail=!1),o.handshaking=!0,c=c||"";var d=null;c.length>0&&(o.sessionCache&&(d=o.sessionCache.getSession(c)),d===null&&(c="")),c.length===0&&o.sessionCache&&(d=o.sessionCache.getSession(),d!==null&&(c=d.id)),o.session={id:c,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ae.md.md5.create(),sha1:ae.md.sha1.create()},d&&(o.version=d.version,o.session.sp=d.sp),o.session.sp.client_random=L.createRandom().getBytes(),o.open=!0,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createClientHello(o)})),L.flush(o)}},o.process=function(c){var d=0;return c&&o.input.putBytes(c),o.fail||(o.record!==null&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),o.record===null&&(d=l(o)),!o.fail&&o.record!==null&&!o.record.ready&&(d=u(o)),!o.fail&&o.record!==null&&o.record.ready&&s(o,o.record)),d},o.prepare=function(c){return L.queue(o,L.createRecord(o,{type:L.ContentType.application_data,data:ae.util.createBuffer(c)})),L.flush(o)},o.prepareHeartbeatRequest=function(c,d){return c instanceof ae.util.ByteBuffer&&(c=c.bytes()),typeof d>"u"&&(d=c.length),o.expectedHeartbeatPayload=c,L.queue(o,L.createRecord(o,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,c,d)})),L.flush(o)},o.close=function(c){if(!o.fail&&o.sessionCache&&o.session){var d={id:o.session.id,version:o.session.version,sp:o.session.sp};d.sp.keys=null,o.sessionCache.setSession(d.id,d)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,L.queue(o,L.createAlert(o,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(o)),o.closed(o)),o.reset(c)},o};ae.tls=ae.tls||{};for(var qf in L)typeof L[qf]!="function"&&(ae.tls[qf]=L[qf]);ae.tls.prf_tls1=lf;ae.tls.hmac_sha1=eR;ae.tls.createSessionCache=L.createSessionCache;ae.tls.createConnection=L.createConnection;var pa=ze,yr=pa.tls;yr.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};yr.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};function OC(e,t,n){var r=t.entity===pa.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:pa.cipher.createDecipher("AES-CBC",r?n.keys.server_write_key:n.keys.client_write_key),iv:r?n.keys.server_write_IV:n.keys.client_write_IV},e.write.cipherState={init:!1,cipher:pa.cipher.createCipher("AES-CBC",r?n.keys.client_write_key:n.keys.server_write_key),iv:r?n.keys.client_write_IV:n.keys.server_write_IV},e.read.cipherFunction=SR,e.write.cipherFunction=xR,e.read.macLength=e.write.macLength=n.mac_length,e.read.macFunction=e.write.macFunction=yr.hmac_sha1}function xR(e,t){var n=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var i;e.version.minor===yr.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=pa.random.getBytesSync(16),t.cipherState.init=!0;var a=t.cipherState.cipher;return a.start({iv:i}),e.version.minor>=yr.Versions.TLS_1_1.minor&&a.output.putBytes(i),a.update(e.fragment),a.finish(CR)&&(e.fragment=a.output,e.length=e.fragment.length(),n=!0),n}function CR(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ER(e,t,n){var r=!0;if(n){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)r=r&&t.at(o)==a;r&&t.truncate(a+1)}return r}function SR(e,t){var n=!1,r;e.version.minor===yr.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),n=i.finish(ER);var a=t.macLength,o=pa.random.getBytesSync(a),s=i.output.length();s>=a?(e.fragment=i.output.getBytes(s-a),o=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=pa.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=wR(t.macKey,o,l)&&n,n}function wR(e,t,n){var r=pa.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(n),n=r.digest().getBytes(),t===n}var It=ze,hu=It.sha512=It.sha512||{};It.md.sha512=It.md.algorithms.sha512=hu;var VC=It.sha384=It.sha512.sha384=It.sha512.sha384||{};VC.create=function(){return hu.create("SHA-384")};It.md.sha384=It.md.algorithms.sha384=VC;It.sha512.sha256=It.sha512.sha256||{create:function(){return hu.create("SHA-512/256")}};It.md["sha512/256"]=It.md.algorithms["sha512/256"]=It.sha512.sha256;It.sha512.sha224=It.sha512.sha224||{create:function(){return hu.create("SHA-512/224")}};It.md["sha512/224"]=It.md.algorithms["sha512/224"]=It.sha512.sha224;hu.create=function(e){if(HC||IR(),typeof e>"u"&&(e="SHA-512"),!(e in Ua))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ua[e],n=null,r=It.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var l=s.messageLengthSize/4,u=0;u<l;++u)s.fullMessageLength.push(0);r=It.util.createBuffer(),n=new Array(t.length);for(var u=0;u<t.length;++u)n[u]=t[u].slice(0);return s},s.start(),s.update=function(l,u){u==="utf8"&&(l=It.util.encodeUtf8(l));var c=l.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var d=s.fullMessageLength.length-1;d>=0;--d)s.fullMessageLength[d]+=c[1],c[1]=c[0]+(s.fullMessageLength[d]/4294967296>>>0),s.fullMessageLength[d]=s.fullMessageLength[d]>>>0,c[0]=c[1]/4294967296>>>0;return r.putBytes(l),k1(n,i,r),(r.read>2048||r.length()===0)&&r.compact(),s},s.digest=function(){var l=It.util.createBuffer();l.putBytes(r.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;l.putBytes(B0.substr(0,s.blockLength-c));for(var d,h,f=s.fullMessageLength[0]*8,g=0;g<s.fullMessageLength.length-1;++g)d=s.fullMessageLength[g+1]*8,h=d/4294967296>>>0,f+=h,l.putInt32(f>>>0),f=d>>>0;l.putInt32(f);for(var p=new Array(n.length),g=0;g<n.length;++g)p[g]=n[g].slice(0);k1(p,i,l);var m=It.util.createBuffer(),b;e==="SHA-512"?b=p.length:e==="SHA-384"?b=p.length-2:b=p.length-4;for(var g=0;g<b;++g)m.putInt32(p[g][0]),(g!==b-1||e!=="SHA-512/224")&&m.putInt32(p[g][1]);return m},s};var B0=null,HC=!1,$0=null,Ua=null;function IR(){B0="€",B0+=It.util.fillString("\0",128),$0=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],Ua={},Ua["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Ua["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Ua["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Ua["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],HC=!0}function k1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v,x,C,E,w,B,y,S,D,A,T,F,k,P,$,R,O,j,V,W,U=n.length();U>=128;){for(P=0;P<16;++P)t[P][0]=n.getInt32()>>>0,t[P][1]=n.getInt32()>>>0;for(;P<80;++P)O=t[P-2],$=O[0],R=O[1],r=(($>>>19|R<<13)^(R>>>29|$<<3)^$>>>6)>>>0,i=(($<<13|R>>>19)^(R<<3|$>>>29)^($<<26|R>>>6))>>>0,V=t[P-15],$=V[0],R=V[1],a=(($>>>1|R<<31)^($>>>8|R<<24)^$>>>7)>>>0,o=(($<<31|R>>>1)^($<<24|R>>>8)^($<<25|R>>>7))>>>0,j=t[P-7],W=t[P-16],R=i+j[1]+o+W[1],t[P][0]=r+j[0]+a+W[0]+(R/4294967296>>>0)>>>0,t[P][1]=R>>>0;for(p=e[0][0],m=e[0][1],b=e[1][0],v=e[1][1],x=e[2][0],C=e[2][1],E=e[3][0],w=e[3][1],B=e[4][0],y=e[4][1],S=e[5][0],D=e[5][1],A=e[6][0],T=e[6][1],F=e[7][0],k=e[7][1],P=0;P<80;++P)u=((B>>>14|y<<18)^(B>>>18|y<<14)^(y>>>9|B<<23))>>>0,c=((B<<18|y>>>14)^(B<<14|y>>>18)^(y<<23|B>>>9))>>>0,d=(A^B&(S^A))>>>0,h=(T^y&(D^T))>>>0,s=((p>>>28|m<<4)^(m>>>2|p<<30)^(m>>>7|p<<25))>>>0,l=((p<<4|m>>>28)^(m<<30|p>>>2)^(m<<25|p>>>7))>>>0,f=(p&b|x&(p^b))>>>0,g=(m&v|C&(m^v))>>>0,R=k+c+h+$0[P][1]+t[P][1],r=F+u+d+$0[P][0]+t[P][0]+(R/4294967296>>>0)>>>0,i=R>>>0,R=l+g,a=s+f+(R/4294967296>>>0)>>>0,o=R>>>0,F=A,k=T,A=S,T=D,S=B,D=y,R=w+i,B=E+r+(R/4294967296>>>0)>>>0,y=R>>>0,E=x,w=C,x=b,C=v,b=p,v=m,R=i+o,p=r+a+(R/4294967296>>>0)>>>0,m=R>>>0;R=e[0][1]+m,e[0][0]=e[0][0]+p+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+v,e[1][0]=e[1][0]+b+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+C,e[2][0]=e[2][0]+x+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+w,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+y,e[4][0]=e[4][0]+B+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+D,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+T,e[6][0]=e[6][0]+A+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+k,e[7][0]=e[7][0]+F+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}var cp={},_R=ze,tn=_R.asn1;cp.privateKeyValidator={name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:tn.Class.UNIVERSAL,type:tn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};cp.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:tn.Class.UNIVERSAL,type:tn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var gn=ze,jC=cp,DR=jC.publicKeyValidator,AR=jC.privateKeyValidator;if(typeof TR>"u")var TR=gn.jsbn.BigInteger;var k0=gn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;gn.pki=gn.pki||{};gn.pki.ed25519=gn.ed25519=gn.ed25519||{};var Ze=gn.ed25519;Ze.constants={};Ze.constants.PUBLIC_KEY_BYTE_LENGTH=32;Ze.constants.PRIVATE_KEY_BYTE_LENGTH=64;Ze.constants.SEED_BYTE_LENGTH=32;Ze.constants.SIGN_BYTE_LENGTH=64;Ze.constants.HASH_BYTE_LENGTH=64;Ze.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=gn.random.getBytesSync(Ze.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==Ze.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ze.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Li({message:t,encoding:"binary"});for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Hn(Ze.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return kR(n,r),{publicKey:n,privateKey:r}};Ze.privateKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,AR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.privateKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.privateKey,l=Li({message:gn.asn1.fromDer(s).value,encoding:"binary"});return{privateKeyBytes:l}};Ze.publicKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,DR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.publicKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.ed25519PublicKey;if(s.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Li({message:s,encoding:"binary"})};Ze.publicKeyFromPrivateKey=function(e){e=e||{};var t=Li({message:e.privateKey,encoding:"binary"});if(t.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<n.length;++r)n[r]=t[32+r];return n};Ze.sign=function(e){e=e||{};var t=Li(e),n=Li({message:e.privateKey,encoding:"binary"});if(n.length===Ze.constants.SEED_BYTE_LENGTH){var r=Ze.generateKeyPair({seed:n});n=r.privateKey}else if(n.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.SEED_BYTE_LENGTH+" or "+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length);PR(i,t,t.length,n);for(var a=new Hn(Ze.constants.SIGN_BYTE_LENGTH),o=0;o<a.length;++o)a[o]=i[o];return a};Ze.verify=function(e){e=e||{};var t=Li(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var n=Li({message:e.signature,encoding:"binary"});if(n.length!==Ze.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ze.constants.SIGN_BYTE_LENGTH);var r=Li({message:e.publicKey,encoding:"binary"});if(r.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ze.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),a=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),o;for(o=0;o<Ze.constants.SIGN_BYTE_LENGTH;++o)i[o]=n[o];for(o=0;o<t.length;++o)i[o+Ze.constants.SIGN_BYTE_LENGTH]=t[o];return FR(a,i,i.length,r)>=0};function Li(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Hn)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,n);t=new k0(t,n)}else if(!(t instanceof k0))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new Hn(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var P0=ke(),rd=ke([1]),RR=ke([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),BR=ke([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P1=ke([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),F1=ke([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Jf=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),$R=ke([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function cl(e,t){var n=gn.md.sha512.create(),r=new k0(e);n.update(r.getBytes(t),"binary");var i=n.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(i,"binary");for(var a=new Hn(Ze.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function kR(e,t){var n=[ke(),ke(),ke(),ke()],r,i=cl(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,fp(n,i),dp(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function PR(e,t,n,r){var i,a,o=new Float64Array(64),s=[ke(),ke(),ke(),ke()],l=cl(r,32);l[0]&=248,l[31]&=127,l[31]|=64;var u=n+64;for(i=0;i<n;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=l[32+i];var c=cl(e.subarray(32),n+32);for(F0(c),fp(s,c),dp(e,s),i=32;i<64;++i)e[i]=r[i];var d=cl(e,n+64);for(F0(d),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=c[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=d[i]*l[a];return WC(e.subarray(32),o),u}function FR(e,t,n,r){var i,a,o=new Hn(32),s=[ke(),ke(),ke(),ke()],l=[ke(),ke(),ke(),ke()];if(a=-1,n<64||NR(l,r))return-1;for(i=0;i<n;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=cl(e,n);if(F0(u),UC(s,l,u),fp(l,t.subarray(32)),N0(s,l),dp(o,s),n-=64,zC(t,0,o,0)){for(i=0;i<n;++i)e[i]=0;return-1}for(i=0;i<n;++i)e[i]=t[i+64];return a=n,a}function WC(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*Jf[i-(r-32)],n=t[i]+128>>8,t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;++i)t[i]+=n-(t[31]>>4)*Jf[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=n*Jf[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function F0(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;WC(e,t)}function N0(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),c=ke();Yo(n,e[1],e[0]),Yo(c,t[1],t[0]),vt(n,n,c),Go(r,e[0],e[1]),Go(c,t[0],t[1]),vt(r,r,c),vt(i,e[3],t[3]),vt(i,i,BR),vt(a,e[2],t[2]),Go(a,a,a),Yo(o,r,n),Yo(s,a,i),Go(l,a,i),Go(u,r,n),vt(e[0],o,s),vt(e[1],u,l),vt(e[2],l,s),vt(e[3],o,u)}function N1(e,t,n){for(var r=0;r<4;++r)XC(e[r],t[r],n)}function dp(e,t){var n=ke(),r=ke(),i=ke();VR(i,t[2]),vt(n,t[0],i),vt(r,t[1],i),id(e,r),e[31]^=GC(n)<<7}function id(e,t){var n,r,i,a=ke(),o=ke();for(n=0;n<16;++n)o[n]=t[n];for(Qf(o),Qf(o),Qf(o),r=0;r<2;++r){for(a[0]=o[0]-65517,n=1;n<15;++n)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,XC(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=o[n]&255,e[2*n+1]=o[n]>>8}function NR(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke();return sa(e[2],rd),MR(e[1],t),Xa(i,e[1]),vt(a,i,RR),Yo(i,i,e[2]),Go(a,e[2],a),Xa(o,a),Xa(s,o),vt(l,s,o),vt(n,l,i),vt(n,n,a),LR(n,n),vt(n,n,i),vt(n,n,a),vt(n,n,a),vt(e[0],n,a),Xa(r,e[0]),vt(r,r,a),M1(r,i)&&vt(e[0],e[0],$R),Xa(r,e[0]),vt(r,r,a),M1(r,i)?-1:(GC(e[0])===t[31]>>7&&Yo(e[0],P0,e[0]),vt(e[3],e[0],e[1]),0)}function MR(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function LR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Xa(n,n),r!==1&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function M1(e,t){var n=new Hn(32),r=new Hn(32);return id(n,e),id(r,t),zC(n,0,r,0)}function zC(e,t,n,r){return OR(e,t,n,r,32)}function OR(e,t,n,r,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function GC(e){var t=new Hn(32);return id(t,e),t[0]&1}function UC(e,t,n){var r,i;for(sa(e[0],P0),sa(e[1],rd),sa(e[2],rd),sa(e[3],P0),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,N1(e,t,r),N0(t,e),N0(e,e),N1(e,t,r)}function fp(e,t){var n=[ke(),ke(),ke(),ke()];sa(n[0],P1),sa(n[1],F1),sa(n[2],rd),vt(n[3],P1,F1),UC(e,n,t)}function sa(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function VR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Xa(n,n),r!==2&&r!==4&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Qf(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function XC(e,t,n){for(var r,i=~(n-1),a=0;a<16;++a)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function ke(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;++t)n[t]=e[t];return n}function Go(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]+n[r]}function Yo(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]-n[r]}function Xa(e,t){vt(e,t,t)}function vt(e,t,n){var r,i,a=0,o=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,g=0,p=0,m=0,b=0,v=0,x=0,C=0,E=0,w=0,B=0,y=0,S=0,D=0,A=0,T=0,F=0,k=0,P=0,$=0,R=0,O=0,j=0,V=n[0],W=n[1],U=n[2],K=n[3],ee=n[4],z=n[5],H=n[6],X=n[7],te=n[8],ie=n[9],le=n[10],ce=n[11],Q=n[12],be=n[13],Ce=n[14],Se=n[15];r=t[0],a+=r*V,o+=r*W,s+=r*U,l+=r*K,u+=r*ee,c+=r*z,d+=r*H,h+=r*X,f+=r*te,g+=r*ie,p+=r*le,m+=r*ce,b+=r*Q,v+=r*be,x+=r*Ce,C+=r*Se,r=t[1],o+=r*V,s+=r*W,l+=r*U,u+=r*K,c+=r*ee,d+=r*z,h+=r*H,f+=r*X,g+=r*te,p+=r*ie,m+=r*le,b+=r*ce,v+=r*Q,x+=r*be,C+=r*Ce,E+=r*Se,r=t[2],s+=r*V,l+=r*W,u+=r*U,c+=r*K,d+=r*ee,h+=r*z,f+=r*H,g+=r*X,p+=r*te,m+=r*ie,b+=r*le,v+=r*ce,x+=r*Q,C+=r*be,E+=r*Ce,w+=r*Se,r=t[3],l+=r*V,u+=r*W,c+=r*U,d+=r*K,h+=r*ee,f+=r*z,g+=r*H,p+=r*X,m+=r*te,b+=r*ie,v+=r*le,x+=r*ce,C+=r*Q,E+=r*be,w+=r*Ce,B+=r*Se,r=t[4],u+=r*V,c+=r*W,d+=r*U,h+=r*K,f+=r*ee,g+=r*z,p+=r*H,m+=r*X,b+=r*te,v+=r*ie,x+=r*le,C+=r*ce,E+=r*Q,w+=r*be,B+=r*Ce,y+=r*Se,r=t[5],c+=r*V,d+=r*W,h+=r*U,f+=r*K,g+=r*ee,p+=r*z,m+=r*H,b+=r*X,v+=r*te,x+=r*ie,C+=r*le,E+=r*ce,w+=r*Q,B+=r*be,y+=r*Ce,S+=r*Se,r=t[6],d+=r*V,h+=r*W,f+=r*U,g+=r*K,p+=r*ee,m+=r*z,b+=r*H,v+=r*X,x+=r*te,C+=r*ie,E+=r*le,w+=r*ce,B+=r*Q,y+=r*be,S+=r*Ce,D+=r*Se,r=t[7],h+=r*V,f+=r*W,g+=r*U,p+=r*K,m+=r*ee,b+=r*z,v+=r*H,x+=r*X,C+=r*te,E+=r*ie,w+=r*le,B+=r*ce,y+=r*Q,S+=r*be,D+=r*Ce,A+=r*Se,r=t[8],f+=r*V,g+=r*W,p+=r*U,m+=r*K,b+=r*ee,v+=r*z,x+=r*H,C+=r*X,E+=r*te,w+=r*ie,B+=r*le,y+=r*ce,S+=r*Q,D+=r*be,A+=r*Ce,T+=r*Se,r=t[9],g+=r*V,p+=r*W,m+=r*U,b+=r*K,v+=r*ee,x+=r*z,C+=r*H,E+=r*X,w+=r*te,B+=r*ie,y+=r*le,S+=r*ce,D+=r*Q,A+=r*be,T+=r*Ce,F+=r*Se,r=t[10],p+=r*V,m+=r*W,b+=r*U,v+=r*K,x+=r*ee,C+=r*z,E+=r*H,w+=r*X,B+=r*te,y+=r*ie,S+=r*le,D+=r*ce,A+=r*Q,T+=r*be,F+=r*Ce,k+=r*Se,r=t[11],m+=r*V,b+=r*W,v+=r*U,x+=r*K,C+=r*ee,E+=r*z,w+=r*H,B+=r*X,y+=r*te,S+=r*ie,D+=r*le,A+=r*ce,T+=r*Q,F+=r*be,k+=r*Ce,P+=r*Se,r=t[12],b+=r*V,v+=r*W,x+=r*U,C+=r*K,E+=r*ee,w+=r*z,B+=r*H,y+=r*X,S+=r*te,D+=r*ie,A+=r*le,T+=r*ce,F+=r*Q,k+=r*be,P+=r*Ce,$+=r*Se,r=t[13],v+=r*V,x+=r*W,C+=r*U,E+=r*K,w+=r*ee,B+=r*z,y+=r*H,S+=r*X,D+=r*te,A+=r*ie,T+=r*le,F+=r*ce,k+=r*Q,P+=r*be,$+=r*Ce,R+=r*Se,r=t[14],x+=r*V,C+=r*W,E+=r*U,w+=r*K,B+=r*ee,y+=r*z,S+=r*H,D+=r*X,A+=r*te,T+=r*ie,F+=r*le,k+=r*ce,P+=r*Q,$+=r*be,R+=r*Ce,O+=r*Se,r=t[15],C+=r*V,E+=r*W,w+=r*U,B+=r*K,y+=r*ee,S+=r*z,D+=r*H,A+=r*X,T+=r*te,F+=r*ie,k+=r*le,P+=r*ce,$+=r*Q,R+=r*be,O+=r*Ce,j+=r*Se,a+=38*E,o+=38*w,s+=38*B,l+=38*y,u+=38*S,c+=38*D,d+=38*A,h+=38*T,f+=38*F,g+=38*k,p+=38*P,m+=38*$,b+=38*R,v+=38*O,x+=38*j,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=l,e[4]=u,e[5]=c,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=m,e[12]=b,e[13]=v,e[14]=x,e[15]=C}var qn=ze;qn.kem=qn.kem||{};var L1=qn.jsbn.BigInteger;qn.kem.rsa={};qn.kem.rsa.create=function(e,t){t=t||{};var n=t.prng||qn.random,r={};return r.encrypt=function(i,a){var o=Math.ceil(i.n.bitLength()/8),s;do s=new L1(qn.util.bytesToHex(n.getBytesSync(o)),16).mod(i.n);while(s.compareTo(L1.ONE)<=0);s=qn.util.hexToBytes(s.toString(16));var l=o-s.length;l>0&&(s=qn.util.fillString("\0",l)+s);var u=i.encrypt(s,"NONE"),c=e.generate(s,a);return{encapsulation:u,key:c}},r.decrypt=function(i,a,o){var s=i.decrypt(a,"NONE");return e.generate(s,o)},r};qn.kem.kdf1=function(e,t){ZC(this,e,0,t||e.digestLength)};qn.kem.kdf2=function(e,t){ZC(this,e,1,t||e.digestLength)};function ZC(e,t,n,r){e.generate=function(i,a){for(var o=new qn.util.ByteBuffer,s=Math.ceil(a/r)+n,l=new qn.util.ByteBuffer,u=n;u<s;++u){l.putInt32(u),t.start(),t.update(i+l.getBytes());var c=t.digest();o.putBytes(c.getBytes(r))}return o.truncate(o.length()-a),o.getBytes()}}var qe=ze;qe.log=qe.log||{};qe.log.levels=["none","error","warning","info","debug","verbose","max"];var ad={},M0=[],dl=null;qe.log.LEVEL_LOCKED=2;qe.log.NO_LEVEL_CHECK=4;qe.log.INTERPOLATE=8;for(var la=0;la<qe.log.levels.length;++la){var O1=qe.log.levels[la];ad[O1]={index:la,name:O1.toUpperCase()}}qe.log.logMessage=function(e){for(var t=ad[e.level].index,n=0;n<M0.length;++n){var r=M0[n];if(r.flags&qe.log.NO_LEVEL_CHECK)r.f(e);else{var i=ad[r.level].index;t<=i&&r.f(r,e)}}};qe.log.prepareStandard=function(e){"standard"in e||(e.standard=ad[e.level].name+" ["+e.category+"] "+e.message)};qe.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=qe.util.format.apply(this,t)}};qe.log.prepareStandardFull=function(e){"standardFull"in e||(qe.log.prepareStandard(e),e.standardFull=e.standard)};for(var V1=["error","warning","info","debug","verbose"],la=0;la<V1.length;++la)(function(t){qe.log[t]=function(n,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:t,category:n,message:r,arguments:i};qe.log.logMessage(a)}})(V1[la]);qe.log.makeLogger=function(e){var t={flags:0,f:e};return qe.log.setLevel(t,"none"),t};qe.log.setLevel=function(e,t){var n=!1;if(e&&!(e.flags&qe.log.LEVEL_LOCKED))for(var r=0;r<qe.log.levels.length;++r){var i=qe.log.levels[r];if(t==i){e.level=t,n=!0;break}}return n};qe.log.lock=function(e,t){typeof t>"u"||t?e.flags|=qe.log.LEVEL_LOCKED:e.flags&=~qe.log.LEVEL_LOCKED};qe.log.addLogger=function(e){M0.push(e)};if(typeof console<"u"&&"log"in console){var Ms;if(console.error&&console.warn&&console.info&&console.debug){var HR={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},hp=function(e,t){qe.log.prepareStandard(t);var n=HR[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),n.apply(console,r)};Ms=qe.log.makeLogger(hp)}else{var hp=function(t,n){qe.log.prepareStandardFull(n),console.log(n.standardFull)};Ms=qe.log.makeLogger(hp)}qe.log.setLevel(Ms,"debug"),qe.log.addLogger(Ms),dl=Ms}else console={log:function(){}};if(dl!==null&&typeof window<"u"&&window.location){var ku=new URL(window.location.href).searchParams;if(ku.has("console.level")&&qe.log.setLevel(dl,ku.get("console.level").slice(-1)[0]),ku.has("console.lock")){var jR=ku.get("console.lock").slice(-1)[0];jR=="true"&&qe.log.lock(dl)}}qe.log.consoleLogger=dl;var he=ze,Z=he.asn1,An=he.pkcs7=he.pkcs7||{};An.messageFromPem=function(e){var t=he.pem.decode(e)[0];if(t.type!=="PKCS7"){var n=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=Z.fromDer(t.body);return An.messageFromAsn1(r)};An.messageToPem=function(e,t){var n={type:"PKCS7",body:Z.toDer(e.toAsn1()).getBytes()};return he.pem.encode(n,{maxline:t})};An.messageFromAsn1=function(e){var t={},n=[];if(!Z.validate(e,An.asn1.contentInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=n,r}var i=Z.derToOid(t.contentType),a;switch(i){case he.pki.oids.envelopedData:a=An.createEnvelopedData();break;case he.pki.oids.encryptedData:a=An.createEncryptedData();break;case he.pki.oids.signedData:a=An.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a};An.createSignedData=function(){var e=null;return e={type:he.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(gp(e,r,An.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,a=0;a<i.length;++a)e.certificates.push(he.pki.certificateFromAsn1(i[a]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],i=0;i<e.certificates.length;++i)r.push(he.pki.certificateToAsn1(e.certificates[i]));var a=[],o=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,r)),a.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.signerInfos)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),o])},addSigner:function(r){var i=r.issuer,a=r.serialNumber;if(r.certificate){var o=r.certificate;typeof o=="string"&&(o=he.pki.certificateFromPem(o)),i=o.issuer.attributes,a=o.serialNumber}var s=r.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof s=="string"&&(s=he.pki.privateKeyFromPem(s));var l=r.digestAlgorithm||he.pki.oids.sha1;switch(l){case he.pki.oids.sha1:case he.pki.oids.sha256:case he.pki.oids.sha384:case he.pki.oids.sha512:case he.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var u=r.authenticatedAttributes||[];if(u.length>0){for(var c=!1,d=!1,h=0;h<u.length;++h){var f=u[h];if(!c&&f.type===he.pki.oids.contentType){if(c=!0,d)break;continue}if(!d&&f.type===he.pki.oids.messageDigest){if(d=!0,c)break;continue}}if(!c||!d)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:i,serialNumber:a,digestAlgorithm:l,signatureAlgorithm:he.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof he.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=he.util.encodeUtf8(e.content)),r.detached?e.detachedContent=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i):e.contentInfo.value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i)]))}if(e.signers.length!==0){var a=t();n(a)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=he.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},i=0;i<e.signers.length;++i){var a=e.signers[i],o=a.digestAlgorithm;o in r||(r[o]=he.md[he.pki.oids[o]].create()),a.authenticatedAttributes.length===0?a.md=r[o]:a.md=he.md[he.pki.oids[o]].create()}e.digestAlgorithmIdentifiers=[];for(var o in r)e.digestAlgorithmIdentifiers.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(o).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]));return r}function n(r){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=Z.derToOid(e.contentInfo.value[0].value),o=Z.toDer(i);o.getByte(),Z.getBerValueLength(o),o=o.getBytes();for(var s in r)r[s].start().update(o);for(var l=new Date,u=0;u<e.signers.length;++u){var c=e.signers[u];if(c.authenticatedAttributes.length===0){if(a!==he.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{c.authenticatedAttributesAsn1=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[]),h=0;h<c.authenticatedAttributes.length;++h){var f=c.authenticatedAttributes[h];f.type===he.pki.oids.messageDigest?f.value=r[c.digestAlgorithm].digest():f.type===he.pki.oids.signingTime&&(f.value||(f.value=l)),d.value.push(L0(f)),c.authenticatedAttributesAsn1.value.push(L0(f))}o=Z.toDer(d).getBytes(),c.md.start().update(o)}c.signature=c.key.sign(c.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=ZR(e.signers)}};An.createEncryptedData=function(){var e=null;return e={type:he.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){gp(e,t,An.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),YC(e)}},e};An.createEnvelopedData=function(){var e=null;return e={type:he.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){var n=gp(e,t,An.asn1.envelopedDataValidator);e.recipients=GR(n.recipientInfos.value)},toAsn1:function(){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,UR(e.recipients)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,YR(e.encryptedContent))])])])},findRecipient:function(t){for(var n=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===n.length){for(var o=!0,s=0;s<n.length;++s)if(a[s].type!==n[s].type||a[s].value!==n[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,n){if(e.encryptedContent.key===void 0&&t!==void 0&&n!==void 0)switch(t.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:case he.pki.oids.desCBC:var r=n.decrypt(t.encryptedContent.content);e.encryptedContent.key=he.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}YC(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:he.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,n){if(e.encryptedContent.content===void 0){n=n||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,i,a;switch(n){case he.pki.oids["aes128-CBC"]:r=16,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes192-CBC"]:r=24,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes256-CBC"]:r=32,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["des-EDE3-CBC"]:r=24,i=8,a=he.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+n)}if(t===void 0)t=he.util.createBuffer(he.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=n,e.encryptedContent.key=t,e.encryptedContent.parameter=he.util.createBuffer(he.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var l=e.recipients[s];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}}},e};function WR(e){var t={},n=[];if(!Z.validate(e,An.asn1.recipientInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=n,r}return{version:t.version.charCodeAt(0),issuer:he.pki.RDNAttributesAsArray(t.issuer),serialNumber:he.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:Z.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function zR(e){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.encryptedContent.algorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]),Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function GR(e){for(var t=[],n=0;n<e.length;++n)t.push(WR(e[n]));return t}function UR(e){for(var t=[],n=0;n<e.length;++n)t.push(zR(e[n]));return t}function XR(e){var t=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.digestAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.signatureAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];n.values.push(L0(i))}t.value.push(n)}return t}function ZR(e){for(var t=[],n=0;n<e.length;++n)t.push(XR(e[n]));return t}function L0(e){var t;if(e.type===he.pki.oids.contentType)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.value).getBytes());else if(e.type===he.pki.oids.messageDigest)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===he.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var a=Date.parse(i);isNaN(a)?i.length===13?i=Z.utcTimeToDate(i):i=Z.generalizedTimeToDate(i):i=new Date(a)}i>=n&&i<r?t=Z.create(Z.Class.UNIVERSAL,Z.Type.UTCTIME,!1,Z.dateToUtcTime(i)):t=Z.create(Z.Class.UNIVERSAL,Z.Type.GENERALIZEDTIME,!1,Z.dateToGeneralizedTime(i))}return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[t])])}function YR(e){return[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.algorithm).getBytes()),e.parameter?Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.content.getBytes())])]}function gp(e,t,n){var r={},i=[];if(!Z.validate(t,n,r,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}var o=Z.derToOid(r.contentType);if(o!==he.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var s="";if(he.util.isArray(r.encryptedContent))for(var l=0;l<r.encryptedContent.length;++l){if(r.encryptedContent[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=r.encryptedContent[l].value}else s=r.encryptedContent;e.encryptedContent={algorithm:Z.derToOid(r.encAlgorithm),parameter:he.util.createBuffer(r.encParameter.value),content:he.util.createBuffer(s)}}if(r.content){var s="";if(he.util.isArray(r.content))for(var l=0;l<r.content.length;++l){if(r.content[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=r.content[l].value}else s=r.content;e.content=he.util.createBuffer(s)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function YC(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case he.pki.oids["aes128-CBC"]:case he.pki.oids["aes192-CBC"]:case he.pki.oids["aes256-CBC"]:t=he.aes.createDecryptionCipher(e.encryptedContent.key);break;case he.pki.oids.desCBC:case he.pki.oids["des-EDE3-CBC"]:t=he.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var Wt=ze,uf=Wt.ssh=Wt.ssh||{};uf.privateKeyToPutty=function(e,t,n){n=n||"",t=t||"";var r="ssh-rsa",i=t===""?"none":"aes256-cbc",a="PuTTY-User-Key-File-2: "+r+`\r
14
+ `+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function y6(e){return e.replace(/^\s+/,"")}var Tt=ze;Tt.des=Tt.des||{};Tt.des.startEncrypting=function(e,t,n,r){var i=rf({key:e,output:n,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createEncryptionCipher=function(e,t){return rf({key:e,output:null,decrypt:!1,mode:t})};Tt.des.startDecrypting=function(e,t,n,r){var i=rf({key:e,output:n,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createDecryptionCipher=function(e,t){return rf({key:e,output:null,decrypt:!0,mode:t})};Tt.des.Algorithm=function(e,t){var n=this;n.name=e,n.mode=new t({blockSize:8,cipher:{encrypt:function(r,i){return y1(n._keys,r,i,!1)},decrypt:function(r,i){return y1(n._keys,r,i,!0)}}}),n._init=!1};Tt.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Tt.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=A6(t),this._init=!0}};hi("DES-ECB",Tt.cipher.modes.ecb);hi("DES-CBC",Tt.cipher.modes.cbc);hi("DES-CFB",Tt.cipher.modes.cfb);hi("DES-OFB",Tt.cipher.modes.ofb);hi("DES-CTR",Tt.cipher.modes.ctr);hi("3DES-ECB",Tt.cipher.modes.ecb);hi("3DES-CBC",Tt.cipher.modes.cbc);hi("3DES-CFB",Tt.cipher.modes.cfb);hi("3DES-OFB",Tt.cipher.modes.ofb);hi("3DES-CTR",Tt.cipher.modes.ctr);function hi(e,t){var n=function(){return new Tt.des.Algorithm(e,t)};Tt.cipher.registerAlgorithm(e,n)}var x6=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],C6=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],E6=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],S6=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],w6=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],I6=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],_6=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],D6=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function A6(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],f=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,x,C=0;C<p;C++){var E=e.getInt32(),w=e.getInt32();x=(E>>>4^w)&252645135,w^=x,E^=x<<4,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>2^w)&858993459,w^=x,E^=x<<2,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=(w>>>8^E)&16711935,E^=x,w^=x<<8,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=E<<8|w>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=x;for(var B=0;B<b.length;++B){b[B]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27),E&=-15,w&=-15;var y=t[E>>>28]|n[E>>>24&15]|r[E>>>20&15]|i[E>>>16&15]|a[E>>>12&15]|o[E>>>8&15]|s[E>>>4&15],S=l[w>>>28]|u[w>>>24&15]|c[w>>>20&15]|d[w>>>16&15]|h[w>>>12&15]|f[w>>>8&15]|g[w>>>4&15];x=(S>>>16^y)&65535,m[v++]=y^x,m[v++]=S^x<<16}}return m}function y1(e,t,n,r){var i=e.length===32?3:9,a;i===3?a=r?[30,-2,-2]:[0,32,2]:a=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],l=t[1];o=(s>>>4^l)&252645135,l^=o,s^=o<<4,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,s=s<<1|s>>>31,l=l<<1|l>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],d=a[u+2],h=a[u];h!=c;h+=d){var f=l^e[h],g=(l>>>4|l<<28)^e[h+1];o=s,s=l,l=o^(C6[f>>>24&63]|S6[f>>>16&63]|I6[f>>>8&63]|D6[f&63]|x6[g>>>24&63]|E6[g>>>16&63]|w6[g>>>8&63]|_6[g&63])}o=s,s=l,l=o}s=s>>>1|s<<31,l=l>>>1|l<<31,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(s>>>4^l)&252645135,l^=o,s^=o<<4,n[0]=s,n[1]=l}function rf(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),n="DES-"+t,r;e.decrypt?r=Tt.cipher.createDecipher(n,e.key):r=Tt.cipher.createCipher(n,e.key);var i=r.start;return r.start=function(a,o){var s=null;o instanceof Tt.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(r,o)},r}const T6={},R6=Object.freeze(Object.defineProperty({__proto__:null,default:T6},Symbol.toStringTag,{value:"Module"})),np=s6(R6);var _n=ze,B6=_n.pkcs5=_n.pkcs5||{},Si;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(Si=np);_n.pbkdf2=B6.pbkdf2=function(e,t,n,r,i,a){if(typeof i=="function"&&(a=i,i=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&Si.pbkdf2&&(i===null||typeof i!="object")&&(Si.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?Si.pbkdf2Sync.length===4?Si.pbkdf2(e,t,n,r,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):Si.pbkdf2(e,t,n,r,i,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):Si.pbkdf2Sync.length===4?Si.pbkdf2Sync(e,t,n,r).toString("binary"):Si.pbkdf2Sync(e,t,n,r,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=_n.md[i].create()}var o=i.digestLength;if(r>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var l=Math.ceil(r/o),u=r-(l-1)*o,c=_n.hmac.create();c.start(i,e);var d="",h,f,g;if(!a){for(var p=1;p<=l;++p){c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes();for(var m=2;m<=n;++m)c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f;d+=p<l?h:h.substr(0,u)}return d}var p=1,m;function b(){if(p>l)return a(null,d);c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes(),m=2,v()}function v(){if(m<=n)return c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f,++m,_n.util.setImmediate(v);d+=p<l?h:h.substr(0,u),++p,b()}b()};var ei=ze,hC=ei.sha256=ei.sha256||{};ei.md.sha256=ei.md.algorithms.sha256=hC;hC.create=function(){gC||$6();var e=null,t=ei.util.createBuffer(),n=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ei.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ei.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),x1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ei.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(_0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};x1(d,n,i);var h=ei.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h.putInt32(d.h5),h.putInt32(d.h6),h.putInt32(d.h7),h},r};var _0=null,gC=!1,pC=null;function $6(){_0="€",_0+=ei.util.fillString("\0",64),pC=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],gC=!0}function x1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v=n.length();v>=64;){for(u=0;u<16;++u)t[u]=n.getInt32();for(;u<64;++u)r=t[u-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=r+t[u-7]+i+t[u-16]|0;for(c=e.h0,d=e.h1,h=e.h2,f=e.h3,g=e.h4,p=e.h5,m=e.h6,b=e.h7,u=0;u<64;++u)o=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=m^g&(p^m),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),l=c&d|h&(c^d),r=b+o+s+pC[u]+t[u],i=a+l,b=m,m=p,p=g,g=f+r>>>0,f=h,h=d,d=c,c=r+i>>>0;e.h0=e.h0+c|0,e.h1=e.h1+d|0,e.h2=e.h2+h|0,e.h3=e.h3+f|0,e.h4=e.h4+g|0,e.h5=e.h5+p|0,e.h6=e.h6+m|0,e.h7=e.h7+b|0,v-=64}}var Yr=ze,Dc=null;Yr.util.isNodejs&&!Yr.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Dc=np);var k6=Yr.prng=Yr.prng||{};k6.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,r=new Array(32),i=0;i<32;++i)r[i]=n.create();t.pools=r,t.pool=0,t.generate=function(u,c){if(!c)return t.generateSync(u);var d=t.plugin.cipher,h=t.plugin.increment,f=t.plugin.formatKey,g=t.plugin.formatSeed,p=Yr.util.createBuffer();t.key=null,m();function m(b){if(b)return c(b);if(p.length()>=u)return c(null,p.getBytes(u));if(t.generated>1048575&&(t.key=null),t.key===null)return Yr.util.nextTick(function(){a(m)});var v=d(t.key,t.seed);t.generated+=v.length,p.putBytes(v),t.key=f(d(t.key,h(t.seed))),t.seed=g(d(t.key,t.seed)),Yr.util.setImmediate(m)}},t.generateSync=function(u){var c=t.plugin.cipher,d=t.plugin.increment,h=t.plugin.formatKey,f=t.plugin.formatSeed;t.key=null;for(var g=Yr.util.createBuffer();g.length()<u;){t.generated>1048575&&(t.key=null),t.key===null&&o();var p=c(t.key,t.seed);t.generated+=p.length,g.putBytes(p),t.key=h(c(t.key,d(t.seed))),t.seed=f(c(t.key,t.seed))}return g.getBytes(u)};function a(u){if(t.pools[0].messageLength>=32)return s(),u();var c=32-t.pools[0].messageLength<<5;t.seedFile(c,function(d,h){if(d)return u(d);t.collect(h),s(),u()})}function o(){if(t.pools[0].messageLength>=32)return s();var u=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(u)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var u=t.plugin.md.create();u.update(t.keyBytes);for(var c=1,d=0;d<32;++d)t.reseeds%c===0&&(u.update(t.pools[d].digest().getBytes()),t.pools[d].start()),c=c<<1;t.keyBytes=u.digest().getBytes(),u.start(),u.update(t.keyBytes);var h=u.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(h),t.generated=0}function l(u){var c=null,d=Yr.util.globalScope,h=d.crypto||d.msCrypto;h&&h.getRandomValues&&(c=function(E){return h.getRandomValues(E)});var f=Yr.util.createBuffer();if(c)for(;f.length()<u;){var g=Math.max(1,Math.min(u-f.length(),65536)/4),p=new Uint32Array(Math.floor(g));try{c(p);for(var m=0;m<p.length;++m)f.putInt32(p[m])}catch(E){if(!(typeof QuotaExceededError<"u"&&E instanceof QuotaExceededError))throw E}}if(f.length()<u)for(var b,v,x,C=Math.floor(Math.random()*65536);f.length()<u;){v=16807*(C&65535),b=16807*(C>>16),v+=(b&32767)<<16,v+=b>>15,v=(v&2147483647)+(v>>31),C=v&4294967295;for(var m=0;m<3;++m)x=C>>>(m<<3),x^=Math.floor(Math.random()*256),f.putByte(x&255)}return f.getBytes(u)}return Dc?(t.seedFile=function(u,c){Dc.randomBytes(u,function(d,h){if(d)return c(d);c(null,h.toString())})},t.seedFileSync=function(u){return Dc.randomBytes(u).toString()}):(t.seedFile=function(u,c){try{c(null,l(u))}catch(d){c(d)}},t.seedFileSync=l),t.collect=function(u){for(var c=u.length,d=0;d<c;++d)t.pools[t.pool].update(u.substr(d,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(u,c){for(var d="",h=0;h<c;h+=8)d+=String.fromCharCode(u>>h&255);t.collect(d)},t.registerWorker=function(u){if(u===self)t.seedFile=function(d,h){function f(g){var p=g.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",f),h(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",f),self.postMessage({forge:{prng:{needed:d}}})};else{var c=function(d){var h=d.data;h.forge&&h.forge.prng&&t.seedFile(h.forge.prng.needed,function(f,g){u.postMessage({forge:{prng:{err:f,bytes:g}}})})};u.addEventListener("message",c)}},t};var Qt=ze;(function(){if(Qt.random&&Qt.random.getBytes){Qt.random;return}(function(e){var t={},n=new Array(4),r=Qt.util.createBuffer();t.formatKey=function(d){var h=Qt.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),Qt.aes._expandKey(d,!1)},t.formatSeed=function(d){var h=Qt.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),d},t.cipher=function(d,h){return Qt.aes._updateBlock(d,h,n,!1),r.putInt32(n[0]),r.putInt32(n[1]),r.putInt32(n[2]),r.putInt32(n[3]),r.getBytes()},t.increment=function(d){return++d[3],d},t.md=Qt.md.sha256;function i(){var d=Qt.prng.create(t);return d.getBytes=function(h,f){return d.generate(h,f)},d.getBytesSync=function(h){return d.generate(h)},d}var a=i(),o=null,s=Qt.util.globalScope,l=s.crypto||s.msCrypto;if(l&&l.getRandomValues&&(o=function(d){return l.getRandomValues(d)}),Qt.options.usePureJavaScript||!Qt.util.isNodejs&&!o){if(a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}e&&(e().mousemove(function(d){a.collectInt(d.clientX,16),a.collectInt(d.clientY,16)}),e().keypress(function(d){a.collectInt(d.charCode,8)}))}if(!Qt.random)Qt.random=a;else for(var c in a)Qt.random[c]=a[c];Qt.random.createInstance=i,Qt.random})(typeof jQuery<"u"?jQuery:null)})();var Vn=ze,Zf=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],C1=[1,2,3,5],P6=function(e,t){return e<<t&65535|(e&65535)>>16-t},F6=function(e,t){return(e&65535)>>t|e<<16-t&65535};Vn.rc2=Vn.rc2||{};Vn.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Vn.util.createBuffer(e)),t=t||128;var n=e,r=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=r;s<128;s++)n.putByte(Zf[n.at(s-1)+n.at(s-r)&255]);for(n.setAt(128-a,Zf[n.at(128-a)&o]),s=127-a;s>=0;s--)n.setAt(s,Zf[n.at(s+1)^n.at(s+a)]);return n};var mC=function(e,t,n){var r=!1,i=null,a=null,o=null,s,l,u,c,d=[];for(e=Vn.rc2.expandKey(e,t),u=0;u<64;u++)d.push(e.getInt16Le());n?(s=function(g){for(u=0;u<4;u++)g[u]+=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),g[u]=P6(g[u],C1[u]),c++},l=function(g){for(u=0;u<4;u++)g[u]+=d[g[(u+3)%4]&63]}):(s=function(g){for(u=3;u>=0;u--)g[u]=F6(g[u],C1[u]),g[u]-=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),c--},l=function(g){for(u=3;u>=0;u--)g[u]-=d[g[(u+3)%4]&63]});var h=function(g){var p=[];for(u=0;u<4;u++){var m=i.getInt16Le();o!==null&&(n?m^=o.getInt16Le():o.putInt16Le(m)),p.push(m&65535)}c=n?0:63;for(var b=0;b<g.length;b++)for(var v=0;v<g[b][0];v++)g[b][1](p);for(u=0;u<4;u++)o!==null&&(n?o.putInt16Le(p[u]):p[u]^=o.getInt16Le()),a.putInt16Le(p[u])},f=null;return f={start:function(g,p){g&&typeof g=="string"&&(g=Vn.util.createBuffer(g)),r=!1,i=Vn.util.createBuffer(),a=p||new Vn.util.createBuffer,o=g,f.output=a},update:function(g){for(r||i.putBuffer(g);i.length()>=8;)h([[5,s],[1,l],[6,s],[1,l],[5,s]])},finish:function(g){var p=!0;if(n)if(g)p=g(8,i,!n);else{var m=i.length()===8?8:8-i.length();i.fillWithByte(m,m)}if(p&&(r=!0,f.update()),!n&&(p=i.length()===0,p))if(g)p=g(8,a,!n);else{var b=a.length(),v=a.at(b-1);v>b?p=!1:a.truncate(v)}return p}},f};Vn.rc2.startEncrypting=function(e,t,n){var r=Vn.rc2.createEncryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createEncryptionCipher=function(e,t){return mC(e,t,!0)};Vn.rc2.startDecrypting=function(e,t,n){var r=Vn.rc2.createDecryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createDecryptionCipher=function(e,t){return mC(e,t,!1)};var D0=ze;D0.jsbn=D0.jsbn||{};var $i;function oe(e,t,n){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,n):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}D0.jsbn.BigInteger=oe;function it(){return new oe(null)}function N6(e,t,n,r,i,a){for(;--a>=0;){var o=t*this.data[e++]+n.data[r]+i;i=Math.floor(o/67108864),n.data[r++]=o&67108863}return i}function M6(e,t,n,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this.data[e]&32767,u=this.data[e++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+n.data[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),n.data[r++]=l&1073741823}return i}function E1(e,t,n,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this.data[e]&16383,u=this.data[e++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+n.data[r]+i,i=(l>>28)+(c>>14)+s*u,n.data[r++]=l&268435455}return i}typeof navigator>"u"?(oe.prototype.am=E1,$i=28):navigator.appName=="Microsoft Internet Explorer"?(oe.prototype.am=M6,$i=30):navigator.appName!="Netscape"?(oe.prototype.am=N6,$i=26):(oe.prototype.am=E1,$i=28);oe.prototype.DB=$i;oe.prototype.DM=(1<<$i)-1;oe.prototype.DV=1<<$i;var rp=52;oe.prototype.FV=Math.pow(2,rp);oe.prototype.F1=rp-$i;oe.prototype.F2=2*$i-rp;var L6="0123456789abcdefghijklmnopqrstuvwxyz",af=new Array,Ds,mr;Ds=48;for(mr=0;mr<=9;++mr)af[Ds++]=mr;Ds=97;for(mr=10;mr<36;++mr)af[Ds++]=mr;Ds=65;for(mr=10;mr<36;++mr)af[Ds++]=mr;function S1(e){return L6.charAt(e)}function bC(e,t){var n=af[e.charCodeAt(t)];return n??-1}function O6(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function V6(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function oa(e){var t=it();return t.fromInt(e),t}function H6(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,a=0;--r>=0;){var o=n==8?e[r]&255:bC(e,r);if(o<0){e.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+n>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=n,a>=this.DB&&(a-=this.DB)}n==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&oe.ZERO.subTo(this,this)}function j6(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function W6(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=S1(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=S1(r));return i?a:"0"}function z6(){var e=it();return oe.ZERO.subTo(this,e),e}function G6(){return this.s<0?this.negate():this}function U6(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this.data[n]-e.data[n])!=0)return t;return 0}function of(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}function X6(){return this.t<=0?0:this.DB*(this.t-1)+of(this.data[this.t-1]^this.s&this.DM)}function Z6(e,t){var n;for(n=this.t-1;n>=0;--n)t.data[n+e]=this.data[n];for(n=e-1;n>=0;--n)t.data[n]=0;t.t=this.t+e,t.s=this.s}function Y6(e,t){for(var n=e;n<this.t;++n)t.data[n-e]=this.data[n];t.t=Math.max(this.t-e,0),t.s=this.s}function K6(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>r|o,o=(this.data[s]&i)<<n;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function q6(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,a=(1<<r)-1;t.data[0]=this.data[n]>>r;for(var o=n+1;o<this.t;++o)t.data[o-n-1]|=(this.data[o]&a)<<i,t.data[o-n]=this.data[o]>>r;r>0&&(t.data[this.t-n-1]|=(this.s&a)<<i),t.t=this.t-n,t.clamp()}function J6(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]-e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[n++]=this.DV+r:r>0&&(t.data[n++]=r),t.t=n,t.clamp()}function Q6(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+n.t]=n.am(0,r.data[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&oe.ZERO.subTo(t,t)}function eA(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e.data[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t.data[n],e,2*n,0,1);(e.data[n+t.t]+=t.am(n+1,2*t.data[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e.data[n+t.t]-=t.DV,e.data[n+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(n,t.data[n],e,2*n,0,1)),e.s=0,e.clamp()}function tA(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=it());var a=it(),o=this.s,s=e.s,l=this.DB-of(r.data[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,n)):(r.copyTo(a),i.copyTo(n));var u=a.t,c=a.data[u-1];if(c!=0){var d=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),h=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,p=n.t,m=p-u,b=t??it();for(a.dlShiftTo(m,b),n.compareTo(b)>=0&&(n.data[n.t++]=1,n.subTo(b,n)),oe.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=n.data[--p]==c?this.DM:Math.floor(n.data[p]*h+(n.data[p-1]+g)*f);if((n.data[p]+=a.am(0,v,n,m,0,u))<v)for(a.dlShiftTo(m,b),n.subTo(b,n);n.data[p]<--v;)n.subTo(b,n)}t!=null&&(n.drShiftTo(u,t),o!=s&&oe.ZERO.subTo(t,t)),n.t=u,n.clamp(),l>0&&n.rShiftTo(l,n),o<0&&oe.ZERO.subTo(n,n)}}}function nA(e){var t=it();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(oe.ZERO)>0&&e.subTo(t,t),t}function Eo(e){this.m=e}function rA(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function iA(e){return e}function aA(e){e.divRemTo(this.m,null,e)}function oA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function sA(e,t){e.squareTo(t),this.reduce(t)}Eo.prototype.convert=rA;Eo.prototype.revert=iA;Eo.prototype.reduce=aA;Eo.prototype.mulTo=oA;Eo.prototype.sqrTo=sA;function lA(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function So(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function uA(e){var t=it();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(oe.ZERO)>0&&this.m.subTo(t,t),t}function cA(e){var t=it();return e.copyTo(t),this.reduce(t),t}function dA(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e.data[t]&32767,r=n*this.mpl+((n*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e.data[n]+=this.m.am(0,r,e,t,0,this.m.t);e.data[n]>=e.DV;)e.data[n]-=e.DV,e.data[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function fA(e,t){e.squareTo(t),this.reduce(t)}function hA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}So.prototype.convert=uA;So.prototype.revert=cA;So.prototype.reduce=dA;So.prototype.mulTo=hA;So.prototype.sqrTo=fA;function gA(){return(this.t>0?this.data[0]&1:this.s)==0}function pA(e,t){if(e>4294967295||e<1)return oe.ONE;var n=it(),r=it(),i=t.convert(this),a=of(e)-1;for(i.copyTo(n);--a>=0;)if(t.sqrTo(n,r),(e&1<<a)>0)t.mulTo(r,i,n);else{var o=n;n=r,r=o}return t.revert(n)}function mA(e,t){var n;return e<256||t.isEven()?n=new Eo(t):n=new So(t),this.exp(e,n)}oe.prototype.copyTo=O6;oe.prototype.fromInt=V6;oe.prototype.fromString=H6;oe.prototype.clamp=j6;oe.prototype.dlShiftTo=Z6;oe.prototype.drShiftTo=Y6;oe.prototype.lShiftTo=K6;oe.prototype.rShiftTo=q6;oe.prototype.subTo=J6;oe.prototype.multiplyTo=Q6;oe.prototype.squareTo=eA;oe.prototype.divRemTo=tA;oe.prototype.invDigit=lA;oe.prototype.isEven=gA;oe.prototype.exp=pA;oe.prototype.toString=W6;oe.prototype.negate=z6;oe.prototype.abs=G6;oe.prototype.compareTo=U6;oe.prototype.bitLength=X6;oe.prototype.mod=nA;oe.prototype.modPowInt=mA;oe.ZERO=oa(0);oe.ONE=oa(1);function bA(){var e=it();return this.copyTo(e),e}function vA(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function yA(){return this.t==0?this.s:this.data[0]<<24>>24}function xA(){return this.t==0?this.s:this.data[0]<<16>>16}function CA(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function EA(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function SA(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=oa(n),i=it(),a=it(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o}function wA(e,t){this.fromInt(0),t==null&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,a=0,o=0,s=0;s<e.length;++s){var l=bC(e,s);if(l<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&oe.ZERO.subTo(this,this)}function IA(e,t,n){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(oe.ONE.shiftLeft(e-1),ip,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(oe.ONE.shiftLeft(e-1),this);else{var r=new Array,i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function _A(){var e=this.t,t=new Array;t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function DA(e){return this.compareTo(e)==0}function AA(e){return this.compareTo(e)<0?this:e}function TA(e){return this.compareTo(e)>0?this:e}function RA(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n.data[r]=t(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;r<e.t;++r)n.data[r]=t(i,e.data[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function BA(e,t){return e&t}function $A(e){var t=it();return this.bitwiseTo(e,BA,t),t}function ip(e,t){return e|t}function kA(e){var t=it();return this.bitwiseTo(e,ip,t),t}function vC(e,t){return e^t}function PA(e){var t=it();return this.bitwiseTo(e,vC,t),t}function yC(e,t){return e&~t}function FA(e){var t=it();return this.bitwiseTo(e,yC,t),t}function NA(){for(var e=it(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function MA(e){var t=it();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function LA(e){var t=it();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function OA(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function VA(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+OA(this.data[e]);return this.s<0?this.t*this.DB:-1}function HA(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function jA(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=HA(this.data[n]^t);return e}function WA(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function zA(e,t){var n=oe.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function GA(e){return this.changeBit(e,ip)}function UA(e){return this.changeBit(e,yC)}function XA(e){return this.changeBit(e,vC)}function ZA(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]+e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[n++]=r:r<-1&&(t.data[n++]=this.DV+r),t.t=n,t.clamp()}function YA(e){var t=it();return this.addTo(e,t),t}function KA(e){var t=it();return this.subTo(e,t),t}function qA(e){var t=it();return this.multiplyTo(e,t),t}function JA(e){var t=it();return this.divRemTo(e,t,null),t}function QA(e){var t=it();return this.divRemTo(e,null,t),t}function eT(e){var t=it(),n=it();return this.divRemTo(e,t,n),new Array(t,n)}function tT(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function nT(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function fu(){}function xC(e){return e}function rT(e,t,n){e.multiplyTo(t,n)}function iT(e,t){e.squareTo(t)}fu.prototype.convert=xC;fu.prototype.revert=xC;fu.prototype.mulTo=rT;fu.prototype.sqrTo=iT;function aT(e){return this.exp(e,new fu)}function oT(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n.data[r+this.t]=this.am(0,e.data[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],n,r,0,t-r);n.clamp()}function sT(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n.data[this.t+r-t]=this.am(t-r,e.data[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function As(e){this.r2=it(),this.q3=it(),oe.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function lT(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=it();return e.copyTo(t),this.reduce(t),t}function uT(e){return e}function cT(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function dT(e,t){e.squareTo(t),this.reduce(t)}function fT(e,t,n){e.multiplyTo(t,n),this.reduce(n)}As.prototype.convert=lT;As.prototype.revert=uT;As.prototype.reduce=cT;As.prototype.mulTo=fT;As.prototype.sqrTo=dT;function hT(e,t){var n=e.bitLength(),r,i=oa(1),a;if(n<=0)return i;n<18?r=1:n<48?r=3:n<144?r=4:n<768?r=5:r=6,n<8?a=new Eo(t):t.isEven()?a=new As(t):a=new So(t);var o=new Array,s=3,l=r-1,u=(1<<r)-1;if(o[1]=a.convert(this),r>1){var c=it();for(a.sqrTo(o[1],c);s<=u;)o[s]=it(),a.mulTo(c,o[s-2],o[s]),s+=2}var d=e.t-1,h,f=!0,g=it(),p;for(n=of(e.data[d])-1;d>=0;){for(n>=l?h=e.data[d]>>n-l&u:(h=(e.data[d]&(1<<n+1)-1)<<l-n,d>0&&(h|=e.data[d-1]>>this.DB+n-l)),s=r;!(h&1);)h>>=1,--s;if((n-=s)<0&&(n+=this.DB,--d),f)o[h].copyTo(i),f=!1;else{for(;s>1;)a.sqrTo(i,g),a.sqrTo(g,i),s-=2;s>0?a.sqrTo(i,g):(p=i,i=g,g=p),a.mulTo(g,o[h],i)}for(;d>=0&&!(e.data[d]&1<<n);)a.sqrTo(i,g),p=i,i=g,g=p,--n<0&&(n=this.DB-1,--d)}return a.revert(i)}function gT(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return a>0&&n.lShiftTo(a,n),n}function pT(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this.data[r])%e;return n}function mT(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return oe.ZERO;for(var n=e.clone(),r=this.clone(),i=oa(1),a=oa(0),o=oa(0),s=oa(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(o,i),a.subTo(s,a)):(r.subTo(n,r),t&&o.subTo(i,o),s.subTo(a,s))}if(r.compareTo(oe.ONE)!=0)return oe.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var Dr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],bT=(1<<26)/Dr[Dr.length-1];function vT(e){var t,n=this.abs();if(n.t==1&&n.data[0]<=Dr[Dr.length-1]){for(t=0;t<Dr.length;++t)if(n.data[0]==Dr[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<Dr.length;){for(var r=Dr[t],i=t+1;i<Dr.length&&r<bT;)r*=Dr[i++];for(r=n.modInt(r);t<i;)if(r%Dr[t++]==0)return!1}return n.millerRabin(e)}function yT(e){var t=this.subtract(oe.ONE),n=t.getLowestSetBit();if(n<=0)return!1;for(var r=t.shiftRight(n),i=xT(),a,o=0;o<e;++o){do a=new oe(this.bitLength(),i);while(a.compareTo(oe.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(r,this);if(s.compareTo(oe.ONE)!=0&&s.compareTo(t)!=0){for(var l=1;l++<n&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(oe.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function xT(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}oe.prototype.chunkSize=CA;oe.prototype.toRadix=SA;oe.prototype.fromRadix=wA;oe.prototype.fromNumber=IA;oe.prototype.bitwiseTo=RA;oe.prototype.changeBit=zA;oe.prototype.addTo=ZA;oe.prototype.dMultiply=tT;oe.prototype.dAddOffset=nT;oe.prototype.multiplyLowerTo=oT;oe.prototype.multiplyUpperTo=sT;oe.prototype.modInt=pT;oe.prototype.millerRabin=yT;oe.prototype.clone=bA;oe.prototype.intValue=vA;oe.prototype.byteValue=yA;oe.prototype.shortValue=xA;oe.prototype.signum=EA;oe.prototype.toByteArray=_A;oe.prototype.equals=DA;oe.prototype.min=AA;oe.prototype.max=TA;oe.prototype.and=$A;oe.prototype.or=kA;oe.prototype.xor=PA;oe.prototype.andNot=FA;oe.prototype.not=NA;oe.prototype.shiftLeft=MA;oe.prototype.shiftRight=LA;oe.prototype.getLowestSetBit=VA;oe.prototype.bitCount=jA;oe.prototype.testBit=WA;oe.prototype.setBit=GA;oe.prototype.clearBit=UA;oe.prototype.flipBit=XA;oe.prototype.add=YA;oe.prototype.subtract=KA;oe.prototype.multiply=qA;oe.prototype.divide=JA;oe.prototype.remainder=QA;oe.prototype.divideAndRemainder=eT;oe.prototype.modPow=hT;oe.prototype.modInverse=mT;oe.prototype.pow=aT;oe.prototype.gcd=gT;oe.prototype.isProbablePrime=vT;var ti=ze,CC=ti.sha1=ti.sha1||{};ti.md.sha1=ti.md.algorithms.sha1=CC;CC.create=function(){EC||CT();var e=null,t=ti.util.createBuffer(),n=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ti.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ti.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),w1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ti.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(A0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};w1(d,n,i);var h=ti.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h},r};var A0=null,EC=!1;function CT(){A0="€",A0+=ti.util.fillString("\0",64),EC=!0}function w1(e,t,n){for(var r,i,a,o,s,l,u,c,d=n.length();d>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,l=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<20;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<32;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<40;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<60;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a&o|s&(a^o),r=(i<<5|i>>>27)+u+l+2400959708+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<80;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+3395469782+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+l|0,d-=64}}var ni=ze,SC=ni.pkcs1=ni.pkcs1||{};SC.encode_rsa_oaep=function(e,t,n){var r,i,a,o;typeof n=="string"?(r=n,i=arguments[3]||void 0,a=arguments[4]||void 0):n&&(r=n.label||void 0,i=n.seed||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md)),a?a.start():a=ni.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),l=s-2*a.digestLength-2;if(t.length>l){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=t.length,u.maxLength=l,u}r||(r=""),a.update(r,"raw");for(var c=a.digest(),d="",h=l-t.length,f=0;f<h;f++)d+="\0";var g=c.getBytes()+d+""+t;if(!i)i=ni.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var p=Jc(i,s-a.digestLength-1,o),m=ni.util.xorBytes(g,p,g.length),b=Jc(m,a.digestLength,o),v=ni.util.xorBytes(i,b,i.length);return"\0"+v+m};SC.decode_rsa_oaep=function(e,t,n){var r,i,a;typeof n=="string"?(r=n,i=arguments[3]||void 0):n&&(r=n.label||void 0,i=n.md||void 0,n.mgf1&&n.mgf1.md&&(a=n.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var m=new Error("RSAES-OAEP encoded message length is invalid.");throw m.length=t.length,m.expectedLength=o,m}if(i===void 0?i=ni.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var s=i.digest().getBytes(),l=t.charAt(0),u=t.substring(1,i.digestLength+1),c=t.substring(1+i.digestLength),d=Jc(c,i.digestLength,a),h=ni.util.xorBytes(u,d,u.length),f=Jc(h,o-i.digestLength-1,a),g=ni.util.xorBytes(c,f,c.length),p=g.substring(0,i.digestLength),m=l!=="\0",b=0;b<i.digestLength;++b)m|=s.charAt(b)!==p.charAt(b);for(var v=1,x=i.digestLength,C=i.digestLength;C<g.length;C++){var E=g.charCodeAt(C),w=E&1^1,B=v?65534:0;m|=E&B,v=v&w,x+=v}if(m||g.charCodeAt(x)!==1)throw new Error("Invalid RSAES-OAEP padding.");return g.substring(x+1)};function Jc(e,t,n){n||(n=ni.md.sha1.create());for(var r="",i=Math.ceil(t/n.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);n.start(),n.update(e+o),r+=n.digest().getBytes()}return r.substring(0,t)}var Xi=ze;(function(){if(Xi.prime){Xi.prime;return}var e=Xi.prime=Xi.prime||{},t=Xi.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(d,h){return d|h};e.generateProbablePrime=function(d,h,f){typeof h=="function"&&(f=h,h={}),h=h||{};var g=h.algorithm||"PRIMEINC";typeof g=="string"&&(g={name:g}),g.options=g.options||{};var p=h.prng||Xi.random,m={nextBytes:function(b){for(var v=p.getBytesSync(b.length),x=0;x<b.length;++x)b[x]=v.charCodeAt(x)}};if(g.name==="PRIMEINC")return a(d,m,g.options,f);throw new Error("Invalid prime generation algorithm: "+g.name)};function a(d,h,f,g){return"workers"in f?l(d,h,f,g):o(d,h,f,g)}function o(d,h,f,g){var p=u(d,h),m=0,b=c(p.bitLength());"millerRabinTests"in f&&(b=f.millerRabinTests);var v=10;"maxBlockTime"in f&&(v=f.maxBlockTime),s(p,d,h,m,b,v,g)}function s(d,h,f,g,p,m,b){var v=+new Date;do{if(d.bitLength()>h&&(d=u(h,f)),d.isProbablePrime(p))return b(null,d);d.dAddOffset(n[g++%8],0)}while(m<0||+new Date-v<m);Xi.util.setImmediate(function(){s(d,h,f,g,p,m,b)})}function l(d,h,f,g){if(typeof Worker>"u")return o(d,h,f,g);var p=u(d,h),m=f.workers,b=f.workLoad||100,v=b*30/8,x=f.workerScript||"forge/prime.worker.js";if(m===-1)return Xi.util.estimateCores(function(E,w){E&&(w=2),m=w-1,C()});C();function C(){m=Math.max(1,m);for(var E=[],w=0;w<m;++w)E[w]=new Worker(x);for(var w=0;w<m;++w)E[w].addEventListener("message",y);var B=!1;function y(S){if(!B){var D=S.data;if(D.found){for(var A=0;A<E.length;++A)E[A].terminate();return B=!0,g(null,new t(D.prime,16))}p.bitLength()>d&&(p=u(d,h));var T=p.toString(16);S.target.postMessage({hex:T,workLoad:b}),p.dAddOffset(v,0)}}}}function u(d,h){var f=new t(d,h),g=d-1;return f.testBit(g)||f.bitwiseTo(t.ONE.shiftLeft(g),i,f),f.dAddOffset(31-f.mod(r).byteValue(),0),f}function c(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})();var De=ze;if(typeof rt>"u")var rt=De.jsbn.BigInteger;var T0=De.util.isNodejs?np:null,q=De.asn1,br=De.util;De.pki=De.pki||{};De.pki.rsa=De.rsa=De.rsa||{};var Ve=De.pki,ET=[6,4,2,4,2,4,6,2],ST={name:"PrivateKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},wT={name:"RSAPrivateKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},IT={name:"RSAPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:q.Class.UNIVERSAL,type:q.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},_T=De.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},DT={name:"DigestInfo",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:q.Class.UNIVERSAL,type:q.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:q.Class.UNIVERSAL,type:q.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:q.Class.UNIVERSAL,type:q.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:q.Class.UNIVERSAL,type:q.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},AT=function(e){var t;if(e.algorithm in Ve.oids)t=Ve.oids[e.algorithm];else{var n=new Error("Unknown message digest algorithm.");throw n.algorithm=e.algorithm,n}var r=q.oidToDer(t).getBytes(),i=q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[]),a=q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[]);a.value.push(q.create(q.Class.UNIVERSAL,q.Type.OID,!1,r)),a.value.push(q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,""));var o=q.create(q.Class.UNIVERSAL,q.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),q.toDer(i).getBytes()},wC=function(e,t,n){if(n)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(rt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(rt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new rt(De.util.bytesToHex(De.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(rt.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(r.modInverse(t.n)).mod(t.n),o};Ve.rsa.encrypt=function(e,t,n){var r=n,i,a=Math.ceil(t.n.bitLength()/8);n!==!1&&n!==!0?(r=n===2,i=IC(e,t,n)):(i=De.util.createBuffer(),i.putBytes(e));for(var o=new rt(i.toHex(),16),s=wC(o,t,r),l=s.toString(16),u=De.util.createBuffer(),c=a-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),u.getBytes()};Ve.rsa.decrypt=function(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new rt(De.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=wC(o,t,n),l=s.toString(16),u=De.util.createBuffer(),c=i-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),r!==!1?Qc(u.getBytes(),t,n):u.getBytes()};Ve.rsa.createKeyPairGenerationState=function(e,t,n){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,n=n||{};var r=n.prng||De.random,i={nextBytes:function(s){for(var l=r.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=l.charCodeAt(u)}},a=n.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new rt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};Ve.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var n=new rt(null);n.fromInt(30);for(var r=0,i=function(d,h){return d|h},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var l=e.p===null?e.pBits:e.qBits,u=l-1;e.pqState===0?(e.num=new rt(l,e.rng),e.num.testBit(u)||e.num.bitwiseTo(rt.ONE.shiftLeft(u),i,e.num),e.num.dAddOffset(31-e.num.mod(n).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(RT(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(ET[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(rt.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};Ve.rsa.generateKeyPair=function(e,t,n,r){if(arguments.length===1?typeof e=="object"?(n=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(n=t,t=void 0):(n=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof n=="function"&&(r=n,n=void 0):(r=n,n=t,t=void 0)),n=n||{},e===void 0&&(e=n.bits||2048),t===void 0&&(t=n.e||65537),!De.options.usePureJavaScript&&!n.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(I1("generateKeyPair"))return T0.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,l,u){if(s)return r(s);r(null,{privateKey:Ve.privateKeyFromPem(u),publicKey:Ve.publicKeyFromPem(l)})});if(_1("generateKey")&&_1("exportKey"))return br.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return br.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){r(s)}).then(function(s){if(s){var l=Ve.privateKeyFromAsn1(q.fromDer(De.util.createBuffer(s)));r(null,{privateKey:l,publicKey:Ve.setRsaPublicKey(l.n,l.e)})}});if(D1("generateKey")&&D1("exportKey")){var i=br.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var l=s.target.result,u=br.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);u.oncomplete=function(c){var d=c.target.result,h=Ve.privateKeyFromAsn1(q.fromDer(De.util.createBuffer(d)));r(null,{privateKey:h,publicKey:Ve.setRsaPublicKey(h.n,h.e)})},u.onerror=function(c){r(c)}},i.onerror=function(s){r(s)};return}}else if(I1("generateKeyPairSync")){var a=T0.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Ve.privateKeyFromPem(a.privateKey),publicKey:Ve.publicKeyFromPem(a.publicKey)}}}var o=Ve.rsa.createKeyPairGenerationState(e,t,n);if(!r)return Ve.rsa.stepKeyPairGenerationState(o,0),o.keys;TT(o,n,r)};Ve.setRsaPublicKey=Ve.rsa.setPublicKey=function(e,t){var n={n:e,e:t};return n.encrypt=function(r,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,l,u){return IC(s,l,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,l){return De.pkcs1.encode_rsa_oaep(l,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(r,n,!0);return Ve.rsa.encrypt(o,n,!0)},n.verify=function(r,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(l,u){u=Qc(u,n,!0);var c=q.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),d={},h=[];if(!q.validate(c,DT,d,h)){var f=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw f.errors=h,f}var g=q.derToOid(d.algorithmIdentifier);if(!(g===De.oids.md2||g===De.oids.md5||g===De.oids.sha1||g===De.oids.sha224||g===De.oids.sha256||g===De.oids.sha384||g===De.oids.sha512||g===De.oids["sha512-224"]||g===De.oids["sha512-256"])){var f=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw f.oid=g,f}if((g===De.oids.md2||g===De.oids.md5)&&!("parameters"in d))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===d.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(l,u){return u=Qc(u,n,!0),l===u}});var s=Ve.rsa.decrypt(i,n,!0,!1);return a.verify(r,s,n.n.bitLength())},n};Ve.setRsaPrivateKey=Ve.rsa.setPrivateKey=function(e,t,n,r,i,a,o,s){var l={n:e,e:t,d:n,p:r,q:i,dP:a,dQ:o,qInv:s};return l.decrypt=function(u,c,d){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var h=Ve.rsa.decrypt(u,l,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:Qc};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(f,g){return De.pkcs1.decode_rsa_oaep(g,f,d)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(f){return f}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(h,l,!1)},l.sign=function(u,c){var d=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:AT},d=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},d=1);var h=c.encode(u,l.n.bitLength());return Ve.rsa.encrypt(h,l,d)},l};Ve.wrapRsaPrivateKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,q.integerToDer(0).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.OID,!1,q.oidToDer(Ve.oids.rsaEncryption).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,"")]),q.create(q.Class.UNIVERSAL,q.Type.OCTETSTRING,!1,q.toDer(e).getBytes())])};Ve.privateKeyFromAsn1=function(e){var t={},n=[];if(q.validate(e,ST,t,n)&&(e=q.fromDer(De.util.createBuffer(t.privateKey))),t={},n=[],!q.validate(e,wT,t,n)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=n,r}var i,a,o,s,l,u,c,d;return i=De.util.createBuffer(t.privateKeyModulus).toHex(),a=De.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=De.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=De.util.createBuffer(t.privateKeyPrime1).toHex(),l=De.util.createBuffer(t.privateKeyPrime2).toHex(),u=De.util.createBuffer(t.privateKeyExponent1).toHex(),c=De.util.createBuffer(t.privateKeyExponent2).toHex(),d=De.util.createBuffer(t.privateKeyCoefficient).toHex(),Ve.setRsaPrivateKey(new rt(i,16),new rt(a,16),new rt(o,16),new rt(s,16),new rt(l,16),new rt(u,16),new rt(c,16),new rt(d,16))};Ve.privateKeyToAsn1=Ve.privateKeyToRSAPrivateKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,q.integerToDer(0).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.n)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.e)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.d)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.p)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.q)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.dP)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.dQ)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.qInv))])};Ve.publicKeyFromAsn1=function(e){var t={},n=[];if(q.validate(e,_T,t,n)){var r=q.derToOid(t.publicKeyOid);if(r!==Ve.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=r,i}e=t.rsaPublicKey}if(n=[],!q.validate(e,IT,t,n)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=n,i}var a=De.util.createBuffer(t.publicKeyModulus).toHex(),o=De.util.createBuffer(t.publicKeyExponent).toHex();return Ve.setRsaPublicKey(new rt(a,16),new rt(o,16))};Ve.publicKeyToAsn1=Ve.publicKeyToSubjectPublicKeyInfo=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.OID,!1,q.oidToDer(Ve.oids.rsaEncryption).getBytes()),q.create(q.Class.UNIVERSAL,q.Type.NULL,!1,"")]),q.create(q.Class.UNIVERSAL,q.Type.BITSTRING,!1,[Ve.publicKeyToRSAPublicKey(e)])])};Ve.publicKeyToRSAPublicKey=function(e){return q.create(q.Class.UNIVERSAL,q.Type.SEQUENCE,!0,[q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.n)),q.create(q.Class.UNIVERSAL,q.Type.INTEGER,!1,jr(e.e))])};function IC(e,t,n){var r=De.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}r.putByte(0),r.putByte(n);var o=i-3-e.length,s;if(n===0||n===1){s=n===0?0:255;for(var l=0;l<o;++l)r.putByte(s)}else for(;o>0;){for(var u=0,c=De.random.getBytes(o),l=0;l<o;++l)s=c.charCodeAt(l),s===0?++u:r.putByte(s);o=u}return r.putByte(0),r.putBytes(e),r}function Qc(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8),a=De.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||n&&s!==0&&s!==1||!n&&s!=2||n&&s===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(s===0){l=i-3-r;for(var u=0;u<l;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(l=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++l}else if(s===2)for(l=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++l}var c=a.getByte();if(c!==0||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function TT(e,t,n){typeof t=="function"&&(n=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),i();function i(){a(e.pBits,function(s,l){if(s)return n(s);if(e.p=l,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,l){De.prime.generateProbablePrime(s,r,l)}function o(s,l){if(s)return n(s);if(e.q=l,e.p.compareTo(e.q)<0){var u=e.p;e.p=e.q,e.q=u}if(e.p.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.p=null,i();return}if(e.q.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(rt.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)},n(null,e.keys)}}function jr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=De.util.hexToBytes(t);return n.length>1&&(n.charCodeAt(0)===0&&!(n.charCodeAt(1)&128)||n.charCodeAt(0)===255&&(n.charCodeAt(1)&128)===128)?n.substr(1):n}function RT(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function I1(e){return De.util.isNodejs&&typeof T0[e]=="function"}function _1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.crypto=="object"&&typeof br.globalScope.crypto.subtle=="object"&&typeof br.globalScope.crypto.subtle[e]=="function"}function D1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.msCrypto=="object"&&typeof br.globalScope.msCrypto.subtle=="object"&&typeof br.globalScope.msCrypto.subtle[e]=="function"}function A1(e){for(var t=De.util.hexToBytes(e.toString(16)),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}var me=ze;if(typeof BT>"u")var BT=me.jsbn.BigInteger;var ne=me.asn1,je=me.pki=me.pki||{};je.pbe=me.pbe=me.pbe||{};var ka=je.oids,$T={name:"EncryptedPrivateKeyInfo",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},kT={name:"PBES2Algorithms",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},PT={name:"pkcs-12PbeParams",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"iterations"}]};je.encryptPrivateKeyInfo=function(e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||"aes128",n.prfAlgorithm=n.prfAlgorithm||"sha1";var r=me.random.getBytesSync(n.saltSize),i=n.count,a=ne.integerToDer(i),o,s,l;if(n.algorithm.indexOf("aes")===0||n.algorithm==="des"){var u,c,d;switch(n.algorithm){case"aes128":o=16,u=16,c=ka["aes128-CBC"],d=me.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=ka["aes192-CBC"],d=me.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=ka["aes256-CBC"],d=me.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=ka.desCBC,d=me.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var f="hmacWith"+n.prfAlgorithm.toUpperCase(),g=DC(f),p=me.pkcs5.pbkdf2(t,r,i,o,g),m=me.random.getBytesSync(u),b=d(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes();var v=FT(r,a,o,f);s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBES2).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBKDF2).getBytes()),v]),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(c).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,m)])])])}else if(n.algorithm==="3des"){o=24;var x=new me.util.ByteBuffer(r),p=je.pbe.generatePkcs12Key(t,x,1,i,o),m=je.pbe.generatePkcs12Key(t,x,2,i,o),b=me.des.createEncryptionCipher(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes(),s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,r),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,a.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var C=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[s,ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,l)]);return C};je.decryptPrivateKeyInfo=function(e,t){var n=null,r={},i=[];if(!ne.validate(e,$T,r,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=ne.derToOid(r.encryptionOid),s=je.pbe.getCipher(o,r.encryptionParams,t),l=me.util.createBuffer(r.encryptedData);return s.update(l),s.finish()&&(n=ne.fromDer(s.output)),n};je.encryptedPrivateKeyToPem=function(e,t){var n={type:"ENCRYPTED PRIVATE KEY",body:ne.toDer(e).getBytes()};return me.pem.encode(n,{maxline:t})};je.encryptedPrivateKeyFromPem=function(e){var t=me.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var n=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ne.fromDer(t.body)};je.encryptRsaPrivateKey=function(e,t,n){if(n=n||{},!n.legacy){var r=je.wrapRsaPrivateKey(je.privateKeyToAsn1(e));return r=je.encryptPrivateKeyInfo(r,t,n),je.encryptedPrivateKeyToPem(r)}var i,a,o,s;switch(n.algorithm){case"aes128":i="AES-128-CBC",o=16,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+n.algorithm+'".');throw l.algorithm=n.algorithm,l}var u=me.pbe.opensslDeriveBytes(t,a.substr(0,8),o),c=s(u);c.start(a),c.update(ne.toDer(je.privateKeyToAsn1(e))),c.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:me.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return me.pem.encode(d)};je.decryptRsaPrivateKey=function(e,t){var n=null,r=me.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(r.procType&&r.procType.type==="ENCRYPTED"){var a,o;switch(r.dekInfo.algorithm){case"DES-CBC":a=8,o=me.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=me.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=me.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=me.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=me.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(d){return me.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":a=8,o=function(d){return me.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":a=16,o=function(d){return me.rc2.createDecryptionCipher(d,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw i.algorithm=r.dekInfo.algorithm,i}var s=me.util.hexToBytes(r.dekInfo.parameters),l=me.pbe.opensslDeriveBytes(t,s.substr(0,8),a),u=o(l);if(u.start(s),u.update(me.util.createBuffer(r.body)),u.finish())n=u.output.getBytes();else return n}else n=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?n=je.decryptPrivateKeyInfo(ne.fromDer(n),t):n=ne.fromDer(n),n!==null&&(n=je.privateKeyFromAsn1(n)),n};je.pbe.generatePkcs12Key=function(e,t,n,r,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in me.md))throw new Error('"sha1" hash algorithm unavailable.');a=me.md.sha1.create()}var l=a.digestLength,u=a.blockLength,c=new me.util.ByteBuffer,d=new me.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var h=d.length(),f=t.length(),g=new me.util.ByteBuffer;g.fillWithByte(n,u);var p=u*Math.ceil(f/u),m=new me.util.ByteBuffer;for(s=0;s<p;s++)m.putByte(t.at(s%f));var b=u*Math.ceil(h/u),v=new me.util.ByteBuffer;for(s=0;s<b;s++)v.putByte(d.at(s%h));var x=m;x.putBuffer(v);for(var C=Math.ceil(i/l),E=1;E<=C;E++){var w=new me.util.ByteBuffer;w.putBytes(g.bytes()),w.putBytes(x.bytes());for(var B=0;B<r;B++)a.start(),a.update(w.getBytes()),w=a.digest();var y=new me.util.ByteBuffer;for(s=0;s<u;s++)y.putByte(w.at(s%l));var S=Math.ceil(f/u)+Math.ceil(h/u),D=new me.util.ByteBuffer;for(o=0;o<S;o++){var A=new me.util.ByteBuffer(x.getBytes(u)),T=511;for(s=y.length()-1;s>=0;s--)T=T>>8,T+=y.at(s)+A.at(s),A.setAt(s,T&255);D.putBuffer(A)}x=D,c.putBuffer(w)}return c.truncate(c.length()-i),c};je.pbe.getCipher=function(e,t,n){switch(e){case je.oids.pkcs5PBES2:return je.pbe.getCipherForPBES2(e,t,n);case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case je.oids["pbewithSHAAnd40BitRC2-CBC"]:return je.pbe.getCipherForPKCS12PBE(e,t,n);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};je.pbe.getCipherForPBES2=function(e,t,n){var r={},i=[];if(!ne.validate(t,kT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=ne.derToOid(r.kdfOid),e!==je.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=ne.derToOid(r.encOid),e!==je.oids["aes128-CBC"]&&e!==je.oids["aes192-CBC"]&&e!==je.oids["aes256-CBC"]&&e!==je.oids["des-EDE3-CBC"]&&e!==je.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=r.kdfSalt,s=me.util.createBuffer(r.kdfIterationCount);s=s.getInt(s.length()<<3);var l,u;switch(je.oids[e]){case"aes128-CBC":l=16,u=me.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,u=me.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,u=me.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,u=me.des.createDecryptionCipher;break;case"desCBC":l=8,u=me.des.createDecryptionCipher;break}var c=_C(r.prfOid),d=me.pkcs5.pbkdf2(n,o,s,l,c),h=r.encIv,f=u(d);return f.start(h),f};je.pbe.getCipherForPKCS12PBE=function(e,t,n){var r={},i=[];if(!ne.validate(t,PT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=me.util.createBuffer(r.salt),s=me.util.createBuffer(r.iterations);s=s.getInt(s.length()<<3);var l,u,c;switch(e){case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,u=8,c=me.des.startDecrypting;break;case je.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,u=8,c=function(p,m){var b=me.rc2.createDecryptionCipher(p,40);return b.start(m,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var d=_C(r.prfOid),h=je.pbe.generatePkcs12Key(n,o,1,s,l,d);d.start();var f=je.pbe.generatePkcs12Key(n,o,2,s,u,d);return c(h,f)};je.pbe.opensslDeriveBytes=function(e,t,n,r){if(typeof r>"u"||r===null){if(!("md5"in me.md))throw new Error('"md5" hash algorithm unavailable.');r=me.md.md5.create()}t===null&&(t="");for(var i=[T1(r,e+t)],a=16,o=1;a<n;++o,a+=16)i.push(T1(r,i[o-1]+e+t));return i.join("").substr(0,n)};function T1(e,t){return e.start().update(t).digest().getBytes()}function _C(e){var t;if(!e)t="hmacWithSHA1";else if(t=je.oids[ne.derToOid(e)],!t){var n=new Error("Unsupported PRF OID.");throw n.oid=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}return DC(t)}function DC(e){var t=me.md;switch(e){case"hmacWithSHA224":t=me.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var n=new Error("Unsupported PRF algorithm.");throw n.algorithm=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function FT(e,t,n,r){var i=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,e),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&i.value.push(ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,me.util.hexToBytes(n.toString(16))),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(je.oids[r]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.NULL,!1,"")])),i}var cs=ze,pe=cs.asn1,Ts=cs.pkcs7asn1=cs.pkcs7asn1||{};cs.pkcs7=cs.pkcs7||{};cs.pkcs7.asn1=Ts;var AC={name:"ContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Ts.contentInfoValidator=AC;var TC={name:"EncryptedContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Ts.envelopedDataValidator={name:"EnvelopedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(TC)};Ts.encryptedDataValidator={name:"EncryptedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"}].concat(TC)};var NT={name:"SignerInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Ts.signedDataValidator={name:"SignedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},AC,{name:"SignedData.Certificates",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,capture:"signerInfos",optional:!0,value:[NT]}]};Ts.recipientInfoValidator={name:"RecipientInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var ao=ze;ao.mgf=ao.mgf||{};var MT=ao.mgf.mgf1=ao.mgf1=ao.mgf1||{};MT.create=function(e){var t={generate:function(n,r){for(var i=new ao.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new ao.util.ByteBuffer;s.putInt32(o),e.start(),e.update(n+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}};return t};var ed=ze;ed.mgf=ed.mgf||{};ed.mgf.mgf1=ed.mgf1;var Ga=ze,LT=Ga.pss=Ga.pss||{};LT.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,n=e.mgf,r=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=Ga.util.createBuffer(i));var a;if("saltLength"in e)a=e.saltLength;else if(i!==null)a=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==a)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||Ga.random,s={};return s.encode=function(l,u){var c,d=u-1,h=Math.ceil(d/8),f=l.digest().getBytes();if(h<r+a+2)throw new Error("Message is too long to encrypt.");var g;i===null?g=o.getBytesSync(a):g=i.bytes();var p=new Ga.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(g),t.start(),t.update(p.getBytes());var m=t.digest().getBytes(),b=new Ga.util.ByteBuffer;b.fillWithByte(0,h-a-r-2),b.putByte(1),b.putBytes(g);var v=b.getBytes(),x=h-r-1,C=n.generate(m,x),E="";for(c=0;c<x;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var w=65280>>8*h-d&255;return E=String.fromCharCode(E.charCodeAt(0)&~w)+E.substr(1),E+m+"¼"},s.verify=function(l,u,c){var d,h=c-1,f=Math.ceil(h/8);if(u=u.substr(-f),f<r+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(u.charCodeAt(f-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var g=f-r-1,p=u.substr(0,g),m=u.substr(g,r),b=65280>>8*f-h&255;if(p.charCodeAt(0)&b)throw new Error("Bits beyond keysize not zero as expected.");var v=n.generate(m,g),x="";for(d=0;d<g;d++)x+=String.fromCharCode(p.charCodeAt(d)^v.charCodeAt(d));x=String.fromCharCode(x.charCodeAt(0)&~b)+x.substr(1);var C=f-r-a-2;for(d=0;d<C;d++)if(x.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(x.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var E=x.substr(-a),w=new Ga.util.ByteBuffer;w.fillWithByte(0,8),w.putBytes(l),w.putBytes(E),t.start(),t.update(w.getBytes());var B=t.digest().getBytes();return m===B},s};var Ae=ze,N=Ae.asn1,de=Ae.pki=Ae.pki||{},nt=de.oids,Nt={};Nt.CN=nt.commonName;Nt.commonName="CN";Nt.C=nt.countryName;Nt.countryName="C";Nt.L=nt.localityName;Nt.localityName="L";Nt.ST=nt.stateOrProvinceName;Nt.stateOrProvinceName="ST";Nt.O=nt.organizationName;Nt.organizationName="O";Nt.OU=nt.organizationalUnitName;Nt.organizationalUnitName="OU";Nt.E=nt.emailAddress;Nt.emailAddress="E";var RC=Ae.pki.rsa.publicKeyValidator,OT={name:"Certificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},RC,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},VT={name:"rsapss",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},HT={name:"CertificationRequestInfo",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},RC,{name:"CertificationRequestInfo.attributes",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:N.Class.UNIVERSAL,type:N.Type.SET,constructed:!0}]}]}]},jT={name:"CertificationRequest",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[HT,{name:"CertificationRequest.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};de.RDNAttributesAsArray=function(e,t){for(var n=[],r,i,a,o=0;o<e.value.length;++o){r=e.value[o];for(var s=0;s<r.value.length;++s)a={},i=r.value[s],a.type=N.derToOid(i.value[0].value),a.value=i.value[1].value,a.valueTagClass=i.value[1].type,a.type in nt&&(a.name=nt[a.type],a.name in Nt&&(a.shortName=Nt[a.name])),t&&(t.update(a.type),t.update(a.value)),n.push(a)}return n};de.CRIAttributesAsArray=function(e){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],i=N.derToOid(r.value[0].value),a=r.value[1].value,o=0;o<a.length;++o){var s={};if(s.type=i,s.value=a[o].value,s.valueTagClass=a[o].type,s.type in nt&&(s.name=nt[s.type],s.name in Nt&&(s.shortName=Nt[s.name])),s.type===nt.extensionRequest){s.extensions=[];for(var l=0;l<s.value.length;++l)s.extensions.push(de.certificateExtensionFromAsn1(s.value[l]))}t.push(s)}return t};function xa(e,t){typeof t=="string"&&(t={shortName:t});for(var n=null,r,i=0;n===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}var td=function(e,t,n){var r={};if(e!==nt["RSASSA-PSS"])return r;n&&(r={hash:{algorithmOid:nt.sha1},mgf:{algorithmOid:nt.mgf1,hash:{algorithmOid:nt.sha1}},saltLength:20});var i={},a=[];if(!N.validate(t,VT,i,a)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=a,o}return i.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=N.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=N.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=N.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(r.saltLength=i.saltLength.charCodeAt(0)),r},sf=function(e){switch(nt[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Ae.md.sha1.create();case"md5WithRSAEncryption":return Ae.md.md5.create();case"sha256WithRSAEncryption":return Ae.md.sha256.create();case"sha384WithRSAEncryption":return Ae.md.sha384.create();case"sha512WithRSAEncryption":return Ae.md.sha512.create();case"RSASSA-PSS":return Ae.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},BC=function(e){var t=e.certificate,n;switch(t.signatureOid){case nt.sha1WithRSAEncryption:case nt.sha1WithRSASignature:break;case nt["RSASSA-PSS"]:var r,i;if(r=nt[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported MGF hash function.");throw a.oid=t.signatureParameters.mgf.hash.algorithmOid,a.name=r,a}if(i=nt[t.signatureParameters.mgf.algorithmOid],i===void 0||Ae.mgf[i]===void 0){var a=new Error("Unsupported MGF function.");throw a.oid=t.signatureParameters.mgf.algorithmOid,a.name=i,a}if(i=Ae.mgf[i].create(Ae.md[r].create()),r=nt[t.signatureParameters.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported RSASSA-PSS hash function.");throw a.oid=t.signatureParameters.hash.algorithmOid,a.name=r,a}n=Ae.pss.create(Ae.md[r].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,n)};de.certificateFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificateFromAsn1(a,t)};de.certificateToPem=function(e,t){var n={type:"CERTIFICATE",body:N.toDer(de.certificateToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyFromPem=function(e){var t=Ae.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var n=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=N.fromDer(t.body);return de.publicKeyFromAsn1(r)};de.publicKeyToPem=function(e,t){var n={type:"PUBLIC KEY",body:N.toDer(de.publicKeyToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyToRSAPublicKeyPem=function(e,t){var n={type:"RSA PUBLIC KEY",body:N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Ae.md.sha1.create(),r=t.type||"RSAPublicKey",i;switch(r){case"RSAPublicKey":i=N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=N.toDer(de.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(i);var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};de.certificationRequestFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificationRequestFromAsn1(a,t)};de.certificationRequestToPem=function(e,t){var n={type:"CERTIFICATE REQUEST",body:N.toDer(de.certificationRequestToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return xa(e.issuer,t)},e.issuer.addField=function(t){vr([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,n){vr(t),e.subject.attributes=t,delete e.subject.uniqueId,n&&(e.subject.uniqueId=n),e.subject.hash=null},e.setIssuer=function(t,n){vr(t),e.issuer.attributes=t,delete e.issuer.uniqueId,n&&(e.issuer.uniqueId=n),e.issuer.hash=null},e.setExtensions=function(t){for(var n=0;n<t.length;++n)$C(t[n],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var n=null,r,i=0;n===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=de.getTBSCertificate(e);var a=N.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var n=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject,a=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw a.expectedIssuer=i.attributes,a.actualIssuer=r.attributes,a}var o=t.md;if(o===null){o=sf({signatureOid:t.signatureOid,type:"certificate"});var s=t.tbsCertificate||de.getTBSCertificate(t),l=N.toDer(s);o.update(l.getBytes())}return o!==null&&(n=BC({certificate:e,md:o,signature:t.signature})),n},e.isIssuer=function(t){var n=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)n=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){n=!0;for(var a,o,s=0;n&&s<r.attributes.length;++s)a=r.attributes[s],o=i.attributes[s],(a.type!==o.type||a.value!==o.value)&&(n=!1)}return n},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return de.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=nt.subjectKeyIdentifier,n=0;n<e.extensions.length;++n){var r=e.extensions[n];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return Ae.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e};de.certificateFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,OT,n,r)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificate();o.version=n.certVersion?n.certVersion.charCodeAt(0):0;var s=Ae.util.createBuffer(n.certSerialNumber);o.serialNumber=s.toHex(),o.signatureOid=Ae.asn1.derToOid(n.certSignatureOid),o.signatureParameters=td(o.signatureOid,n.certSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.certinfoSignatureOid),o.siginfo.parameters=td(o.siginfo.algorithmOid,n.certinfoSignatureParams,!1),o.signature=n.certSignature;var l=[];if(n.certValidity1UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity1UTCTime)),n.certValidity2GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity2GeneralizedTime)),n.certValidity3UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity3UTCTime)),n.certValidity4GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(o.validity.notBefore=l[0],o.validity.notAfter=l[1],o.tbsCertificate=n.tbsCertificate,t){o.md=sf({signatureOid:o.signatureOid,type:"certificate"});var u=N.toDer(o.tbsCertificate);o.md.update(u.getBytes())}var c=Ae.md.sha1.create(),d=N.toDer(n.certIssuer);c.update(d.getBytes()),o.issuer.getField=function(g){return xa(o.issuer,g)},o.issuer.addField=function(g){vr([g]),o.issuer.attributes.push(g)},o.issuer.attributes=de.RDNAttributesAsArray(n.certIssuer),n.certIssuerUniqueId&&(o.issuer.uniqueId=n.certIssuerUniqueId),o.issuer.hash=c.digest().toHex();var h=Ae.md.sha1.create(),f=N.toDer(n.certSubject);return h.update(f.getBytes()),o.subject.getField=function(g){return xa(o.subject,g)},o.subject.addField=function(g){vr([g]),o.subject.attributes.push(g)},o.subject.attributes=de.RDNAttributesAsArray(n.certSubject),n.certSubjectUniqueId&&(o.subject.uniqueId=n.certSubjectUniqueId),o.subject.hash=h.digest().toHex(),n.certExtensions?o.extensions=de.certificateExtensionsFromAsn1(n.certExtensions):o.extensions=[],o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o};de.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var r=e.value[n],i=0;i<r.value.length;++i)t.push(de.certificateExtensionFromAsn1(r.value[i]));return t};de.certificateExtensionFromAsn1=function(e){var t={};if(t.id=N.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===N.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in nt){if(t.name=nt[t.id],t.name==="keyUsage"){var n=N.fromDer(t.value),r=0,i=0;n.value.length>1&&(r=n.value.charCodeAt(1),i=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(i&128)===128}else if(t.name==="basicConstraints"){var n=N.fromDer(t.value);n.value.length>0&&n.value[0].type===N.Type.BOOLEAN?t.cA=n.value[0].value.charCodeAt(0)!==0:t.cA=!1;var a=null;n.value.length>0&&n.value[0].type===N.Type.INTEGER?a=n.value[0].value:n.value.length>1&&(a=n.value[1].value),a!==null&&(t.pathLenConstraint=N.derToInteger(a))}else if(t.name==="extKeyUsage")for(var n=N.fromDer(t.value),o=0;o<n.value.length;++o){var s=N.derToOid(n.value[o].value);s in nt?t[nt[s]]=!0:t[s]=!0}else if(t.name==="nsCertType"){var n=N.fromDer(t.value),r=0;n.value.length>1&&(r=n.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var l,n=N.fromDer(t.value),u=0;u<n.value.length;++u){l=n.value[u];var c={type:l.type,value:l.value};switch(t.altNames.push(c),l.type){case 1:case 2:case 6:break;case 7:c.ip=Ae.util.bytesToIP(l.value);break;case 8:c.oid=N.derToOid(l.value);break}}}else if(t.name==="subjectKeyIdentifier"){var n=N.fromDer(t.value);t.subjectKeyIdentifier=Ae.util.bytesToHex(n.value)}}return t};de.certificationRequestFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,jT,n,r)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificationRequest();if(o.version=n.csrVersion?n.csrVersion.charCodeAt(0):0,o.signatureOid=Ae.asn1.derToOid(n.csrSignatureOid),o.signatureParameters=td(o.signatureOid,n.csrSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.csrSignatureOid),o.siginfo.parameters=td(o.siginfo.algorithmOid,n.csrSignatureParams,!1),o.signature=n.csrSignature,o.certificationRequestInfo=n.certificationRequestInfo,t){o.md=sf({signatureOid:o.signatureOid,type:"certification request"});var s=N.toDer(o.certificationRequestInfo);o.md.update(s.getBytes())}var l=Ae.md.sha1.create();return o.subject.getField=function(u){return xa(o.subject,u)},o.subject.addField=function(u){vr([u]),o.subject.attributes.push(u)},o.subject.attributes=de.RDNAttributesAsArray(n.certificationRequestInfoSubject,l),o.subject.hash=l.digest().toHex(),o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o.getAttribute=function(u){return xa(o,u)},o.addAttribute=function(u){vr([u]),o.attributes.push(u)},o.attributes=de.CRIAttributesAsArray(n.certificationRequestInfoAttributes||[]),o};de.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return xa(e,t)},e.addAttribute=function(t){vr([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){vr(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){vr(t),e.attributes=t},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=de.getCertificationRequestInfo(e);var a=N.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,n=e.md;if(n===null){n=sf({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||de.getCertificationRequestInfo(e),i=N.toDer(r);n.update(i.getBytes())}return n!==null&&(t=BC({certificate:e,md:n,signature:e.signature})),t},e};function ds(e){for(var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),n,r,i=e.attributes,a=0;a<i.length;++a){n=i[a];var o=n.value,s=N.Type.PRINTABLESTRING;"valueTagClass"in n&&(s=n.valueTagClass,s===N.Type.UTF8&&(o=Ae.util.encodeUtf8(o))),r=N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(n.type).getBytes()),N.create(N.Class.UNIVERSAL,s,!1,o)])]),t.value.push(r)}return t}function vr(e){for(var t,n=0;n<e.length;++n){if(t=e[n],typeof t.name>"u"&&(t.type&&t.type in de.oids?t.name=de.oids[t.type]:t.shortName&&t.shortName in Nt&&(t.name=de.oids[Nt[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in de.oids)t.type=de.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Nt&&(t.shortName=Nt[t.name]),t.type===nt.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=N.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(de.certificateExtensionToAsn1($C(t.extensions[i])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function $C(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in de.oids&&(e.name=de.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in de.oids)e.id=de.oids[e.name];else{var n=new Error("Extension ID not specified.");throw n.extension=e,n}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,i=0,a=0;e.digitalSignature&&(i|=128,r=7),e.nonRepudiation&&(i|=64,r=6),e.keyEncipherment&&(i|=32,r=5),e.dataEncipherment&&(i|=16,r=4),e.keyAgreement&&(i|=8,r=3),e.keyCertSign&&(i|=4,r=2),e.cRLSign&&(i|=2,r=1),e.encipherOnly&&(i|=1,r=0),e.decipherOnly&&(a|=128,r=7);var o=String.fromCharCode(r);a!==0?o+=String.fromCharCode(i)+String.fromCharCode(a):i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="basicConstraints")e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in e&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var l in e)e[l]===!0&&(l in nt?s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(nt[l]).getBytes())):l.indexOf(".")!==-1&&s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(l).getBytes())))}else if(e.name==="nsCertType"){var r=0,i=0;e.client&&(i|=128,r=7),e.server&&(i|=64,r=6),e.email&&(i|=32,r=5),e.objsign&&(i|=16,r=4),e.reserved&&(i|=8,r=3),e.sslCA&&(i|=4,r=2),e.emailCA&&(i|=2,r=1),e.objCA&&(i|=1,r=0);var o=String.fromCharCode(r);i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));e.value.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=N.create(N.Class.UNIVERSAL,N.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,d.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;if(e.keyIdentifier){var h=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var f=[N.create(N.Class.CONTEXT_SPECIFIC,4,!0,[ds(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];s.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,f))}if(e.serialNumber){var g=Ae.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);s.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if(e.name==="cRLDistributionPoints"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var s=e.value.value,p=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),m=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]),u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));m.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}p.value.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[m])),s.push(p)}if(typeof e.value>"u"){var n=new Error("Extension value not specified.");throw n.extension=e,n}return e}function ap(e,t){switch(e){case nt["RSASSA-PSS"]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(t.saltLength).getBytes())])),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,n);default:return N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")}}function WT(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var n=e.attributes,r=0;r<n.length;++r){var i=n[r],a=i.value,o=N.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===N.Type.UTF8&&(a=Ae.util.encodeUtf8(a));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var l=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(i.type).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,o,s,a)])]);t.value.push(l)}return t}var zT=new Date("1950-01-01T00:00:00Z"),GT=new Date("2050-01-01T00:00:00Z");function R1(e){return e>=zT&&e<GT?N.create(N.Class.UNIVERSAL,N.Type.UTCTIME,!1,N.dateToUtcTime(e)):N.create(N.Class.UNIVERSAL,N.Type.GENERALIZEDTIME,!1,N.dateToGeneralizedTime(e))}de.getTBSCertificate=function(e){var t=R1(e.validity.notBefore),n=R1(e.validity.notAfter),r=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes())]),N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,Ae.util.hexToBytes(e.serialNumber)),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.siginfo.algorithmOid).getBytes()),ap(e.siginfo.algorithmOid,e.siginfo.parameters)]),ds(e.issuer),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,n]),ds(e.subject),de.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(de.certificateExtensionsToAsn1(e.extensions)),r};de.getCertificationRequestInfo=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes()),ds(e.subject),de.publicKeyToAsn1(e.publicKey),WT(e)]);return t};de.distinguishedNameToAsn1=function(e){return ds(e)};de.certificateToAsn1=function(e){var t=e.tbsCertificate||de.getTBSCertificate(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.certificateExtensionsToAsn1=function(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,3,!0,[]),n=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(n);for(var r=0;r<e.length;++r)n.value.push(de.certificateExtensionToAsn1(e[r]));return t};de.certificateExtensionToAsn1=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.id).getBytes())),e.critical&&t.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ"));var n=e.value;return typeof e.value!="string"&&(n=N.toDer(n).getBytes()),t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,n)),t};de.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||de.getCertificationRequestInfo(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(o){var s=n(o.issuer);return s},t.addCertificate=function(o){if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))if(o.subject.hash in t.certs){var s=t.certs[o.subject.hash];Ae.util.isArray(s)||(s=[s]),s.push(o),t.certs[o.subject.hash]=s}else t.certs[o.subject.hash]=o},t.hasCertificate=function(o){typeof o=="string"&&(o=Ae.pki.certificateFromPem(o));var s=n(o.subject);if(!s)return!1;Ae.util.isArray(s)||(s=[s]);for(var l=N.toDer(de.certificateToAsn1(o)).getBytes(),u=0;u<s.length;++u){var c=N.toDer(de.certificateToAsn1(s[u])).getBytes();if(l===c)return!0}return!1},t.listAllCertificates=function(){var o=[];for(var s in t.certs)if(t.certs.hasOwnProperty(s)){var l=t.certs[s];if(!Ae.util.isArray(l))o.push(l);else for(var u=0;u<l.length;++u)o.push(l[u])}return o},t.removeCertificate=function(o){var s;if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))return null;var l=n(o.subject);if(!Ae.util.isArray(l))return s=t.certs[o.subject.hash],delete t.certs[o.subject.hash],s;for(var u=N.toDer(de.certificateToAsn1(o)).getBytes(),c=0;c<l.length;++c){var d=N.toDer(de.certificateToAsn1(l[c])).getBytes();u===d&&(s=l[c],l.splice(c,1))}return l.length===0&&delete t.certs[o.subject.hash],s};function n(o){return r(o),t.certs[o.hash]||null}function r(o){if(!o.hash){var s=Ae.md.sha1.create();o.attributes=de.RDNAttributesAsArray(ds(o),s),o.hash=s.digest().toHex()}}if(e)for(var i=0;i<e.length;++i){var a=e[i];t.addCertificate(a)}return t};de.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};de.verifyCertificateChain=function(e,t,n){typeof n=="function"&&(n={verify:n}),n=n||{},t=t.slice(0);var r=t.slice(0),i=n.validityCheckDate;typeof i>"u"&&(i=new Date);var a=!0,o=null,s=0;do{var l=t.shift(),u=null,c=!1;if(i&&(i<l.validity.notBefore||i>l.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:de.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:i}),o===null){if(u=t[0]||e.getIssuer(l),u===null&&l.isIssuer(l)&&(c=!0,u=l),u){var d=u;Ae.util.isArray(d)||(d=[d]);for(var h=!1;!h&&d.length>0;){u=d.shift();try{h=u.verify(l)}catch{}}h||(o={message:"Certificate signature is invalid.",error:de.certificateError.bad_certificate})}o===null&&(!u||c)&&!e.hasCertificate(l)&&(o={message:"Certificate is not trusted.",error:de.certificateError.unknown_ca})}if(o===null&&u&&!l.isIssuer(u)&&(o={message:"Certificate issuer is invalid.",error:de.certificateError.bad_certificate}),o===null)for(var f={keyUsage:!0,basicConstraints:!0},g=0;o===null&&g<l.extensions.length;++g){var p=l.extensions[g];p.critical&&!(p.name in f)&&(o={message:"Certificate has an unsupported critical extension.",error:de.certificateError.unsupported_certificate})}if(o===null&&(!a||t.length===0&&(!u||c))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||m===null)&&(o={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:de.certificateError.bad_certificate}),o===null&&m!==null&&!m.cA&&(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:de.certificateError.bad_certificate}),o===null&&b!==null&&"pathLenConstraint"in m){var v=s-1;v>m.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:de.certificateError.bad_certificate})}}var x=o===null?!0:o.error,C=n.verify?n.verify(x,s,r):x;if(C===!0)o=null;else throw x===!0&&(o={message:"The application rejected the certificate.",error:de.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!Ae.util.isArray(C)?(C.message&&(o.message=C.message),C.error&&(o.error=C.error)):typeof C=="string"&&(o.error=C)),o;a=!1,++s}while(t.length>0);return!0};var xt=ze,G=xt.asn1,Xe=xt.pki,Il=xt.pkcs12=xt.pkcs12||{},kC={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},UT={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},kC,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},XT={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ZT={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},YT={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ns(e,t,n,r){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];if(!(r!==void 0&&s.type!==r)){if(t===null){i.push(s);continue}s.attributes[t]!==void 0&&s.attributes[t].indexOf(n)>=0&&i.push(s)}}return i}Il.pkcs12FromAsn1=function(e,t,n){typeof t=="string"?(n=t,t=!0):t===void 0&&(t=!0);var r={},i=[];if(!G.validate(e,UT,r,i)){var a=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw a.errors=a,a}var o={version:r.version.charCodeAt(0),safeContents:[],getBags:function(m){var b={},v;return"localKeyId"in m?v=m.localKeyId:"localKeyIdHex"in m&&(v=xt.util.hexToBytes(m.localKeyIdHex)),v===void 0&&!("friendlyName"in m)&&"bagType"in m&&(b[m.bagType]=Ns(o.safeContents,null,null,m.bagType)),v!==void 0&&(b.localKeyId=Ns(o.safeContents,"localKeyId",v,m.bagType)),"friendlyName"in m&&(b.friendlyName=Ns(o.safeContents,"friendlyName",m.friendlyName,m.bagType)),b},getBagsByFriendlyName:function(m,b){return Ns(o.safeContents,"friendlyName",m,b)},getBagsByLocalKeyId:function(m,b){return Ns(o.safeContents,"localKeyId",m,b)}};if(r.version.charCodeAt(0)!==3){var a=new Error("PKCS#12 PFX of version other than 3 not supported.");throw a.version=r.version.charCodeAt(0),a}if(G.derToOid(r.contentType)!==Xe.oids.data){var a=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw a.oid=G.derToOid(r.contentType),a}var s=r.content.value[0];if(s.tagClass!==G.Class.UNIVERSAL||s.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(s=op(s),r.mac){var l=null,u=0,c=G.derToOid(r.macAlgorithm);switch(c){case Xe.oids.sha1:l=xt.md.sha1.create(),u=20;break;case Xe.oids.sha256:l=xt.md.sha256.create(),u=32;break;case Xe.oids.sha384:l=xt.md.sha384.create(),u=48;break;case Xe.oids.sha512:l=xt.md.sha512.create(),u=64;break;case Xe.oids.md5:l=xt.md.md5.create(),u=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var d=new xt.util.ByteBuffer(r.macSalt),h="macIterations"in r?parseInt(xt.util.bytesToHex(r.macIterations),16):1,f=Il.generateKey(n,d,3,h,u,l),g=xt.hmac.create();g.start(l,f),g.update(s.value);var p=g.getMac();if(p.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return KT(o,s.value,t,n),o};function op(e){if(e.composed||e.constructed){for(var t=xt.util.createBuffer(),n=0;n<e.value.length;++n)t.putBytes(e.value[n].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function KT(e,t,n,r){if(t=G.fromDer(t,n),t.tagClass!==G.Class.UNIVERSAL||t.type!==G.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var a=t.value[i],o={},s=[];if(!G.validate(a,kC,o,s)){var l=new Error("Cannot read ContentInfo.");throw l.errors=s,l}var u={encrypted:!1},c=null,d=o.content.value[0];switch(G.derToOid(o.contentType)){case Xe.oids.data:if(d.tagClass!==G.Class.UNIVERSAL||d.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=op(d).value;break;case Xe.oids.encryptedData:c=qT(d,r),u.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(o.contentType),l}u.safeBags=JT(c,n,r),e.safeContents.push(u)}}function qT(e,t){var n={},r=[];if(!G.validate(e,xt.pkcs7.asn1.encryptedDataValidator,n,r)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=r,i}var a=G.derToOid(n.contentType);if(a!==Xe.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=a,i}a=G.derToOid(n.encAlgorithm);var o=Xe.pbe.getCipher(a,n.encParameter,t),s=op(n.encryptedContentAsn1),l=xt.util.createBuffer(s.value);if(o.update(l),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function JT(e,t,n){if(!t&&e.length===0)return[];if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var a=e.value[i],o={},s=[];if(!G.validate(a,XT,o,s)){var l=new Error("Cannot read SafeBag.");throw l.errors=s,l}var u={type:G.derToOid(o.bagId),attributes:QT(o.bagAttributes)};r.push(u);var c,d,h=o.bagValue.value[0];switch(u.type){case Xe.oids.pkcs8ShroudedKeyBag:if(h=Xe.decryptPrivateKeyInfo(h,n),h===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Xe.oids.keyBag:try{u.key=Xe.privateKeyFromAsn1(h)}catch{u.key=null,u.asn1=h}continue;case Xe.oids.certBag:c=YT,d=function(){if(G.derToOid(o.certId)!==Xe.oids.x509Certificate){var g=new Error("Unsupported certificate type, only X.509 supported.");throw g.oid=G.derToOid(o.certId),g}var p=G.fromDer(o.cert,t);try{u.cert=Xe.certificateFromAsn1(p,!0)}catch{u.cert=null,u.asn1=p}};break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=u.type,l}if(c!==void 0&&!G.validate(h,c,o,s)){var l=new Error("Cannot read PKCS#12 "+c.name);throw l.errors=s,l}d()}return r}function QT(e){var t={};if(e!==void 0)for(var n=0;n<e.length;++n){var r={},i=[];if(!G.validate(e[n],ZT,r,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var o=G.derToOid(r.oid);if(Xe.oids[o]!==void 0){t[Xe.oids[o]]=[];for(var s=0;s<r.values.length;++s)t[Xe.oids[o]].push(r.values[s].value)}}return t}Il.toPkcs12Asn1=function(e,t,n,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i=r.localKeyId,a;if(i!==null)i=xt.util.hexToBytes(i);else if(r.generateLocalKeyId)if(t){var o=xt.util.isArray(t)?t[0]:t;typeof o=="string"&&(o=Xe.certificateFromPem(o));var s=xt.md.sha1.create();s.update(G.toDer(Xe.certificateToAsn1(o)).getBytes()),i=s.digest().getBytes()}else i=xt.random.getBytes(20);var l=[];i!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,i)])])),"friendlyName"in r&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,r.friendlyName)])])),l.length>0&&(a=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var u=[],c=[];t!==null&&(xt.util.isArray(t)?c=t:c=[t]);for(var d=[],h=0;h<c.length;++h){t=c[h],typeof t=="string"&&(t=Xe.certificateFromPem(t));var f=h===0?a:void 0,g=Xe.certificateToAsn1(t),p=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(g).getBytes())])])]),f]);d.push(p)}if(d.length>0){var m=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,d),b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])]);u.push(b)}var v=null;if(e!==null){var x=Xe.wrapRsaPrivateKey(Xe.privateKeyToAsn1(e));n===null?v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[x]),a]):v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Xe.encryptPrivateKeyInfo(x,n,r)]),a]);var C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[v]),E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(C).getBytes())])]);u.push(E)}var w=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,u),B;if(r.useMac){var s=xt.md.sha1.create(),y=new xt.util.ByteBuffer(xt.random.getBytes(r.saltSize)),S=r.count,e=Il.generateKey(n,y,3,S,20),D=xt.hmac.create();D.start(s,e),D.update(G.toDer(w).getBytes());var A=D.getMac();B=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,A.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,y.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(S).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(w).getBytes())])]),B])};Il.generateKey=xt.pbe.generatePkcs12Key;var Ca=ze,sp=Ca.asn1,fs=Ca.pki=Ca.pki||{};fs.pemToDer=function(e){var t=Ca.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ca.util.createBuffer(t.body)};fs.privateKeyFromPem=function(e){var t=Ca.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=sp.fromDer(t.body);return fs.privateKeyFromAsn1(r)};fs.privateKeyToPem=function(e,t){var n={type:"RSA PRIVATE KEY",body:sp.toDer(fs.privateKeyToAsn1(e)).getBytes()};return Ca.pem.encode(n,{maxline:t})};fs.privateKeyInfoToPem=function(e,t){var n={type:"PRIVATE KEY",body:sp.toDer(e).getBytes()};return Ca.pem.encode(n,{maxline:t})};var ae=ze,lf=function(e,t,n,r){var i=ae.util.createBuffer(),a=e.length>>1,o=a+(e.length&1),s=e.substr(0,o),l=e.substr(a,o),u=ae.util.createBuffer(),c=ae.hmac.create();n=t+n;var d=Math.ceil(r/16),h=Math.ceil(r/20);c.start("MD5",s);var f=ae.util.createBuffer();u.putBytes(n);for(var g=0;g<d;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),f.putBuffer(c.digest());c.start("SHA1",l);var p=ae.util.createBuffer();u.clear(),u.putBytes(n);for(var g=0;g<h;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),p.putBuffer(c.digest());return i.putBytes(ae.util.xorBytes(f.getBytes(),p.getBytes(),r)),i},eR=function(e,t,n){var r=ae.hmac.create();r.start("SHA1",e);var i=ae.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(n.type),i.putByte(n.version.major),i.putByte(n.version.minor),i.putInt16(n.length),i.putBytes(n.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},tR=function(e,t,n){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},nR=function(e,t,n){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},Yn=function(e,t){var n=0;switch(t){case 1:n=e.getByte();break;case 2:n=e.getInt16();break;case 3:n=e.getInt24();break;case 4:n=e.getInt32();break}return ae.util.createBuffer(e.getBytes(n))},gr=function(e,t,n){e.putInt(n.length(),t<<3),e.putBuffer(n)},L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(e){var t=null;for(var n in L.CipherSuites){var r=L.CipherSuites[n];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};L.handleUnexpected=function(e,t){var n=!e.open&&e.entity===L.ConnectionEnd.client;n||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(e,t,n){!e.handshaking&&e.handshakes>0&&(L.queue(e,L.createAlert(e,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(e)),e.process()};L.parseHelloMessage=function(e,t,n){var r=null,i=e.entity===L.ConnectionEnd.client;if(n<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(r={version:{major:a.getByte(),minor:a.getByte()},random:ae.util.createBuffer(a.getBytes(32)),session_id:Yn(a,1),extensions:[]},i?(r.cipher_suite=a.getBytes(2),r.compression_method=a.getByte()):(r.cipher_suites=Yn(a,2),r.compression_methods=Yn(a,1)),o=n-(o-a.length()),o>0){for(var s=Yn(a,2);s.length()>0;)r.extensions.push({type:[s.getByte(),s.getByte()],data:Yn(s,2)});if(!i)for(var l=0;l<r.extensions.length;++l){var u=r.extensions[l];if(u.type[0]===0&&u.type[1]===0)for(var c=Yn(u.data,2);c.length()>0;){var d=c.getByte();if(d!==0)break;e.session.extensions.server_name.serverNameList.push(Yn(c,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=L.getCipherSuite(r.cipher_suite);else for(var h=ae.util.createBuffer(r.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=L.getCipherSuite(h.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:ae.util.bytesToHex(r.cipher_suite)});i?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=L.CompressionMethod.none}return r};L.createSecurityParameters=function(e,t){var n=e.entity===L.ConnectionEnd.client,r=t.random.bytes(),i=n?e.session.sp.client_random:r,a=n?r:L.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:L.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}};L.handleServerHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=PC,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=iR,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.session.id=i,e.process()}};L.handleClientHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){var i=r.session_id.bytes(),a=null;if(e.sessionCache&&(a=e.sessionCache.getSession(i),a===null?i="":(a.version.major!==r.version.major||a.version.minor>r.version.minor)&&(a=null,i="")),i.length===0&&(i=ae.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<L.SupportedVersions.length&&(o=L.SupportedVersions[s],!(o.minor<=r.version.minor));++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}a!==null?(e.expect=lp,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?dR:R0,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.open=!0,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHello(e)})),e.session.resuming?(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.pending=L.createConnectionState(e),e.state.current.write=e.state.pending.write,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))):(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)})),e.fail||(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerKeyExchange(e)})),e.verifyClient!==!1&&L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificateRequest(e)})),L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHelloDone(e)})))),L.flush(e),e.process()}};L.handleCertificate=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_list:Yn(r,3)},a,o,s=[];try{for(;i.certificate_list.length()>0;)a=Yn(i.certificate_list,3),o=ae.asn1.fromDer(a),a=ae.pki.certificateFromAsn1(o,!0),s.push(a)}catch(u){return e.error(e,{message:"Could not parse certificate list.",cause:u,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=e.entity===L.ConnectionEnd.client;(l||e.verifyClient===!0)&&s.length===0?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):s.length===0?e.expect=l?B1:R0:(l?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],L.verifyCertificateChain(e,s)&&(e.expect=l?B1:R0)),e.process()};L.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});e.expect=aR,e.process()};L.handleClientKeyExchange=function(e,t,n){if(n<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:Yn(r,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=ae.pki.privateKeyFromPem(a)}catch(l){e.error(e,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(a===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{o.pre_master_secret=ae.random.getBytes(48)}e.expect=lp,e.session.clientCertificate!==null&&(e.expect=fR),e.process()};L.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:Yn(r,1),certificate_authorities:Yn(r,2)};e.session.certificateRequest=i,e.expect=oR,e.process()};L.handleCertificateVerify=function(e,t,n){if(n<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a={signature:Yn(r,2).getBytes()},o=ae.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{var s=e.session.clientCertificate;if(!s.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}e.expect=lp,e.process()};L.handleServerHelloDone=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},i=0,a=e.verify(e,r.alert.description,i,[]);if(a!==!0)return(a||a===0)&&(typeof a=="object"&&!ae.util.isArray(a)?(a.message&&(r.message=a.message),a.alert&&(r.alert.description=a.alert)):typeof a=="number"&&(r.alert.description=a)),e.error(e,r)}e.session.certificateRequest!==null&&(t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)}),L.queue(e,t)),t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createClientKeyExchange(e)}),L.queue(e,t),e.expect=uR;var o=function(s,l){s.session.certificateRequest!==null&&s.session.clientCertificate!==null&&L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createCertificateVerify(s,l)})),L.queue(s,L.createRecord(s,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),s.state.pending=L.createConnectionState(s),s.state.current.write=s.state.pending.write,L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createFinished(s)})),s.expect=PC,L.flush(s),s.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return o(e,null);L.getClientSignature(e,o)};L.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.entity===L.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=L.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?sR:hR,e.process()};L.handleFinished=function(e,t,n){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a=t.fragment.getBytes();r=ae.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var o=e.entity===L.ConnectionEnd.client,s=o?"server finished":"client finished",l=e.session.sp,u=12,c=lf;if(r=c(l.master_secret,s,r.getBytes(),u),r.getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))),e.expect=o?lR:gR,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,L.flush(e),e.isConnected=!0,e.connected(e),e.process()};L.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},i;switch(r.description){case L.Alert.Description.close_notify:i="Connection closed.";break;case L.Alert.Description.unexpected_message:i="Unexpected message.";break;case L.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case L.Alert.Description.decryption_failed:i="Decryption failed.";break;case L.Alert.Description.record_overflow:i="Record overflow.";break;case L.Alert.Description.decompression_failure:i="Decompression failed.";break;case L.Alert.Description.handshake_failure:i="Handshake failure.";break;case L.Alert.Description.bad_certificate:i="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case L.Alert.Description.certificate_expired:i="Certificate expired.";break;case L.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case L.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case L.Alert.Description.access_denied:i="Access denied.";break;case L.Alert.Description.decode_error:i="Decode error.";break;case L.Alert.Description.decrypt_error:i="Decrypt error.";break;case L.Alert.Description.export_restriction:i="Export restriction.";break;case L.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:i="Insufficient security.";break;case L.Alert.Description.internal_error:i="Internal error.";break;case L.Alert.Description.user_canceled:i="User canceled.";break;case L.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(r.description===L.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===L.ConnectionEnd.client?"server":"client",alert:r}),e.process()};L.handleHandshake=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt24();if(i>n.length())return e.fragmented=t,t.fragment=ae.util.createBuffer(),n.read-=4,e.process();e.fragmented=null,n.read-=4;var a=n.bytes(i+4);n.read+=4,r in nd[e.entity][e.expect]?(e.entity===L.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ae.md.md5.create(),sha1:ae.md.sha1.create()}),r!==L.HandshakeType.hello_request&&r!==L.HandshakeType.certificate_verify&&r!==L.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),nd[e.entity][e.expect][r](e,t,i)):L.handleUnexpected(e,t)};L.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};L.handleHeartbeat=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt16(),a=n.getBytes(i);if(r===L.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();L.queue(e,L.createRecord(e,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,a)})),L.flush(e)}else if(r===L.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,ae.util.createBuffer(a))}e.process()};var rR=0,iR=1,B1=2,aR=3,oR=4,PC=5,sR=6,lR=7,uR=8,cR=0,dR=1,R0=2,fR=3,lp=4,hR=5,gR=6,M=L.handleUnexpected,FC=L.handleChangeCipherSpec,dn=L.handleAlert,Dn=L.handleHandshake,NC=L.handleApplicationData,fn=L.handleHeartbeat,up=[];up[L.ConnectionEnd.client]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];up[L.ConnectionEnd.server]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];var Zi=L.handleHelloRequest,pR=L.handleServerHello,MC=L.handleCertificate,$1=L.handleServerKeyExchange,Yf=L.handleCertificateRequest,$u=L.handleServerHelloDone,LC=L.handleFinished,nd=[];nd[L.ConnectionEnd.client]=[[M,M,pR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,MC,$1,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,$1,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,Yf,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,$u,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Zi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];var mR=L.handleClientHello,bR=L.handleClientKeyExchange,vR=L.handleCertificateVerify;nd[L.ConnectionEnd.server]=[[M,mR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,MC,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,bR,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,vR,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];L.generateKeys=function(e,t){var n=lf,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===L.Versions.TLS_1_0.major&&e.version.minor===L.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=n(t.master_secret,"key expansion",r,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s};L.createConnectionState=function(e){var t=e.entity===L.ConnectionEnd.client,n=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(o){return!0},compressionState:null,compressFunction:function(o){return!0},updateSequenceNumber:function(){a.sequenceNumber[1]===4294967295?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},r={read:n(),write:n()};if(r.read.update=function(a,o){return r.read.cipherFunction(o,r.read)?r.read.compressFunction(a,o,r.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_record_mac}}),!a.fail},r.write.update=function(a,o){return r.write.compressFunction(a,o,r.write)?r.write.cipherFunction(o,r.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!a.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=L.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case L.CompressionMethod.none:break;case L.CompressionMethod.deflate:r.read.compressFunction=nR,r.write.compressFunction=tR;break;default:throw new Error("Unsupported compression algorithm.")}}return r};L.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,n=ae.util.createBuffer();return n.putInt32(t),n.putBytes(ae.random.getBytes(28)),n};L.createRecord=function(e,t){if(!t.data)return null;var n={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return n};L.createAlert=function(e,t){var n=ae.util.createBuffer();return n.putByte(t.level),n.putByte(t.description),L.createRecord(e,{type:L.ContentType.alert,data:n})};L.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=ae.util.createBuffer(),n=0;n<e.cipherSuites.length;++n){var r=e.cipherSuites[n];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),a=ae.util.createBuffer();a.putByte(L.CompressionMethod.none);var o=a.length(),s=ae.util.createBuffer();if(e.virtualHost){var l=ae.util.createBuffer();l.putByte(0),l.putByte(0);var u=ae.util.createBuffer();u.putByte(0),gr(u,2,ae.util.createBuffer(e.virtualHost));var c=ae.util.createBuffer();gr(c,2,u),gr(l,2,c),s.putBuffer(l)}var d=s.length();d>0&&(d+=2);var h=e.session.id,f=h.length+1+2+4+28+2+i+1+o+d,g=ae.util.createBuffer();return g.putByte(L.HandshakeType.client_hello),g.putInt24(f),g.putByte(e.version.major),g.putByte(e.version.minor),g.putBytes(e.session.sp.client_random),gr(g,1,ae.util.createBuffer(h)),gr(g,2,t),gr(g,1,a),d>0&&gr(g,2,s),g};L.createServerHello=function(e){var t=e.session.id,n=t.length+1+2+4+28+2+1,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.server_hello),r.putInt24(n),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),gr(r,1,ae.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};L.createCertificate=function(e){var t=e.entity===L.ConnectionEnd.client,n=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,r)}var i=ae.util.createBuffer();if(n!==null)try{ae.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=ae.pem.decode(n[o])[0];if(s.type!=="CERTIFICATE"&&s.type!=="X509 CERTIFICATE"&&s.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=s.type,l}if(s.procType&&s.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=ae.util.createBuffer(s.body);a===null&&(a=ae.asn1.fromDer(u.bytes(),!1));var c=ae.util.createBuffer();gr(c,3,u),i.putBuffer(c)}n=ae.pki.certificateFromAsn1(a),t?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(f){return e.error(e,{message:"Could not send certificate list.",cause:f,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var d=3+i.length(),h=ae.util.createBuffer();return h.putByte(L.HandshakeType.certificate),h.putInt24(d),gr(h,3,i),h};L.createClientKeyExchange=function(e){var t=ae.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(ae.random.getBytes(46));var n=e.session.sp;n.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(n.pre_master_secret);var i=t.length+2,a=ae.util.createBuffer();return a.putByte(L.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a};L.createServerKeyExchange=function(e){var t=ae.util.createBuffer();return t};L.getClientSignature=function(e,t){var n=ae.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes(),e.getSignature=e.getSignature||function(r,i,a){var o=null;if(r.getPrivateKey)try{o=r.getPrivateKey(r,r.session.clientCertificate),o=ae.pki.privateKeyFromPem(o)}catch(s){r.error(r,{message:"Could not get private key.",cause:s,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}o===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i=o.sign(i,null),a(r,i)},e.getSignature(e,n,t)};L.createCertificateVerify=function(e,t){var n=t.length+2,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.certificate_verify),r.putInt24(n),r.putInt16(t.length),r.putBytes(t),r};L.createCertificateRequest=function(e){var t=ae.util.createBuffer();t.putByte(1);var n=ae.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],a=ae.pki.distinguishedNameToAsn1(i.subject),o=ae.asn1.toDer(a);n.putInt16(o.length()),n.putBuffer(o)}var s=1+t.length()+2+n.length(),l=ae.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(s),gr(l,1,t),gr(l,2,n),l};L.createServerHelloDone=function(e){var t=ae.util.createBuffer();return t.putByte(L.HandshakeType.server_hello_done),t.putInt24(0),t};L.createChangeCipherSpec=function(){var e=ae.util.createBuffer();return e.putByte(1),e};L.createFinished=function(e){var t=ae.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var n=e.entity===L.ConnectionEnd.client,r=e.session.sp,i=12,a=lf,o=n?"client finished":"server finished";t=a(r.master_secret,o,t.getBytes(),i);var s=ae.util.createBuffer();return s.putByte(L.HandshakeType.finished),s.putInt24(t.length()),s.putBuffer(t),s};L.createHeartbeat=function(e,t,n){typeof n>"u"&&(n=t.length);var r=ae.util.createBuffer();r.putByte(e),r.putInt16(n),r.putBytes(t);var i=r.length(),a=Math.max(16,i-n-3);return r.putBytes(ae.random.getBytes(a)),r};L.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===L.ContentType.handshake||t.type===L.ContentType.alert||t.type===L.ContentType.change_cipher_spec))){if(t.type===L.ContentType.handshake){var n=t.fragment.bytes();e.session.md5.update(n),e.session.sha1.update(n),n=null}var r;if(t.fragment.length()<=L.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>L.MaxFragment;)r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i.slice(0,L.MaxFragment))})),i=i.slice(L.MaxFragment);i.length>0&&r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i)}))}for(var a=0;a<r.length&&!e.fail;++a){var o=r[a],s=e.state.current.write;s.update(e,o)&&e.records.push(o)}}};L.flush=function(e){for(var t=0;t<e.records.length;++t){var n=e.records[t];e.tlsData.putByte(n.type),e.tlsData.putByte(n.version.major),e.tlsData.putByte(n.version.minor),e.tlsData.putInt16(n.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Kf=function(e){switch(e){case!0:return!0;case ae.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case ae.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case ae.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case ae.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case ae.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case ae.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},yR=function(e){switch(e){case!0:return!0;case L.Alert.Description.bad_certificate:return ae.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return ae.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return ae.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return ae.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return ae.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return ae.pki.certificateError.unknown_ca;default:return ae.pki.certificateError.bad_certificate}};L.verifyCertificateChain=function(e,t){try{var n={};for(var r in e.verifyOptions)n[r]=e.verifyOptions[r];n.verify=function(a,o,s){var l=Kf(a),u=e.verify(e,a,o,s);if(u!==!0){if(typeof u=="object"&&!ae.util.isArray(u)){var c=new Error("The application rejected the certificate.");throw c.send=!0,c.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},u.message&&(c.message=u.message),u.alert&&(c.alert.description=u.alert),c}u!==a&&(u=yR(u))}return u},ae.pki.verifyCertificateChain(e.caStore,t,n)}catch(a){var i=a;(typeof i!="object"||ae.util.isArray(i))&&(i={send:!0,alert:{level:L.Alert.Level.fatal,description:Kf(a)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:L.Alert.Level.fatal,description:Kf(i.error)}),e.error(e,i)}return!e.fail};L.createSessionCache=function(e,t){var n=null;if(e&&e.getSession&&e.setSession&&e.order)n=e;else{n={},n.cache=e||{},n.capacity=Math.max(t||100,1),n.order=[];for(var r in e)n.order.length<=t?n.order.push(r):delete e[r];n.getSession=function(i){var a=null,o=null;if(i?o=ae.util.bytesToHex(i):n.order.length>0&&(o=n.order[0]),o!==null&&o in n.cache){a=n.cache[o],delete n.cache[o];for(var s in n.order)if(n.order[s]===o){n.order.splice(s,1);break}}return a},n.setSession=function(i,a){if(n.order.length===n.capacity){var o=n.order.shift();delete n.cache[o]}var o=ae.util.bytesToHex(i);n.order.push(o),n.cache[o]=a}}return n};L.createConnection=function(e){var t=null;e.caStore?ae.util.isArray(e.caStore)?t=ae.pki.createCaStore(e.caStore):t=e.caStore:t=ae.pki.createCaStore();var n=e.cipherSuites||null;if(n===null){n=[];for(var r in L.CipherSuites)n.push(L.CipherSuites[r])}var i=e.server?L.ConnectionEnd.server:L.ConnectionEnd.client,a=e.sessionCache?L.createSessionCache(e.sessionCache):null,o={version:{major:L.Version.major,minor:L.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:n,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(c,d,h,f){return d},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:ae.util.createBuffer(),tlsData:ae.util.createBuffer(),data:ae.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(c,d){d.origin=d.origin||(c.entity===L.ConnectionEnd.client?"client":"server"),d.send&&(L.queue(c,L.createAlert(c,d.alert)),L.flush(c));var h=d.fatal!==!1;h&&(c.fail=!0),e.error(c,d),h&&c.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(c){o.version={major:L.Version.major,minor:L.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=o.entity===L.ConnectionEnd.client?rR:cR,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(c||typeof c>"u"),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=L.createConnectionState(o)},o.reset();var s=function(c,d){var h=d.type-L.ContentType.change_cipher_spec,f=up[c.entity][c.expect];h in f?f[h](c,d):L.handleUnexpected(c,d)},l=function(c){var d=0,h=c.input,f=h.length();if(f<5)d=5-f;else{c.record={type:h.getByte(),version:{major:h.getByte(),minor:h.getByte()},length:h.getInt16(),fragment:ae.util.createBuffer(),ready:!1};var g=c.record.version.major===c.version.major;g&&c.session&&c.session.version&&(g=c.record.version.minor===c.version.minor),g||c.error(c,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return d},u=function(c){var d=0,h=c.input,f=h.length();if(f<c.record.length)d=c.record.length-f;else{c.record.fragment.putBytes(h.getBytes(c.record.length)),h.compact();var g=c.state.current.read;g.update(c,c.record)&&(c.fragmented!==null&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),c.record.ready=!0)}return d};return o.handshake=function(c){if(o.entity!==L.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&o.handshakes===0&&(o.fail=!1),o.handshaking=!0,c=c||"";var d=null;c.length>0&&(o.sessionCache&&(d=o.sessionCache.getSession(c)),d===null&&(c="")),c.length===0&&o.sessionCache&&(d=o.sessionCache.getSession(),d!==null&&(c=d.id)),o.session={id:c,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ae.md.md5.create(),sha1:ae.md.sha1.create()},d&&(o.version=d.version,o.session.sp=d.sp),o.session.sp.client_random=L.createRandom().getBytes(),o.open=!0,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createClientHello(o)})),L.flush(o)}},o.process=function(c){var d=0;return c&&o.input.putBytes(c),o.fail||(o.record!==null&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),o.record===null&&(d=l(o)),!o.fail&&o.record!==null&&!o.record.ready&&(d=u(o)),!o.fail&&o.record!==null&&o.record.ready&&s(o,o.record)),d},o.prepare=function(c){return L.queue(o,L.createRecord(o,{type:L.ContentType.application_data,data:ae.util.createBuffer(c)})),L.flush(o)},o.prepareHeartbeatRequest=function(c,d){return c instanceof ae.util.ByteBuffer&&(c=c.bytes()),typeof d>"u"&&(d=c.length),o.expectedHeartbeatPayload=c,L.queue(o,L.createRecord(o,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,c,d)})),L.flush(o)},o.close=function(c){if(!o.fail&&o.sessionCache&&o.session){var d={id:o.session.id,version:o.session.version,sp:o.session.sp};d.sp.keys=null,o.sessionCache.setSession(d.id,d)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,L.queue(o,L.createAlert(o,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(o)),o.closed(o)),o.reset(c)},o};ae.tls=ae.tls||{};for(var qf in L)typeof L[qf]!="function"&&(ae.tls[qf]=L[qf]);ae.tls.prf_tls1=lf;ae.tls.hmac_sha1=eR;ae.tls.createSessionCache=L.createSessionCache;ae.tls.createConnection=L.createConnection;var pa=ze,yr=pa.tls;yr.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};yr.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};function OC(e,t,n){var r=t.entity===pa.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:pa.cipher.createDecipher("AES-CBC",r?n.keys.server_write_key:n.keys.client_write_key),iv:r?n.keys.server_write_IV:n.keys.client_write_IV},e.write.cipherState={init:!1,cipher:pa.cipher.createCipher("AES-CBC",r?n.keys.client_write_key:n.keys.server_write_key),iv:r?n.keys.client_write_IV:n.keys.server_write_IV},e.read.cipherFunction=SR,e.write.cipherFunction=xR,e.read.macLength=e.write.macLength=n.mac_length,e.read.macFunction=e.write.macFunction=yr.hmac_sha1}function xR(e,t){var n=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var i;e.version.minor===yr.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=pa.random.getBytesSync(16),t.cipherState.init=!0;var a=t.cipherState.cipher;return a.start({iv:i}),e.version.minor>=yr.Versions.TLS_1_1.minor&&a.output.putBytes(i),a.update(e.fragment),a.finish(CR)&&(e.fragment=a.output,e.length=e.fragment.length(),n=!0),n}function CR(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ER(e,t,n){var r=!0;if(n){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)r=r&&t.at(o)==a;r&&t.truncate(a+1)}return r}function SR(e,t){var n=!1,r;e.version.minor===yr.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),n=i.finish(ER);var a=t.macLength,o=pa.random.getBytesSync(a),s=i.output.length();s>=a?(e.fragment=i.output.getBytes(s-a),o=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=pa.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=wR(t.macKey,o,l)&&n,n}function wR(e,t,n){var r=pa.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(n),n=r.digest().getBytes(),t===n}var It=ze,hu=It.sha512=It.sha512||{};It.md.sha512=It.md.algorithms.sha512=hu;var VC=It.sha384=It.sha512.sha384=It.sha512.sha384||{};VC.create=function(){return hu.create("SHA-384")};It.md.sha384=It.md.algorithms.sha384=VC;It.sha512.sha256=It.sha512.sha256||{create:function(){return hu.create("SHA-512/256")}};It.md["sha512/256"]=It.md.algorithms["sha512/256"]=It.sha512.sha256;It.sha512.sha224=It.sha512.sha224||{create:function(){return hu.create("SHA-512/224")}};It.md["sha512/224"]=It.md.algorithms["sha512/224"]=It.sha512.sha224;hu.create=function(e){if(HC||IR(),typeof e>"u"&&(e="SHA-512"),!(e in Ua))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ua[e],n=null,r=It.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var l=s.messageLengthSize/4,u=0;u<l;++u)s.fullMessageLength.push(0);r=It.util.createBuffer(),n=new Array(t.length);for(var u=0;u<t.length;++u)n[u]=t[u].slice(0);return s},s.start(),s.update=function(l,u){u==="utf8"&&(l=It.util.encodeUtf8(l));var c=l.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var d=s.fullMessageLength.length-1;d>=0;--d)s.fullMessageLength[d]+=c[1],c[1]=c[0]+(s.fullMessageLength[d]/4294967296>>>0),s.fullMessageLength[d]=s.fullMessageLength[d]>>>0,c[0]=c[1]/4294967296>>>0;return r.putBytes(l),k1(n,i,r),(r.read>2048||r.length()===0)&&r.compact(),s},s.digest=function(){var l=It.util.createBuffer();l.putBytes(r.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;l.putBytes(B0.substr(0,s.blockLength-c));for(var d,h,f=s.fullMessageLength[0]*8,g=0;g<s.fullMessageLength.length-1;++g)d=s.fullMessageLength[g+1]*8,h=d/4294967296>>>0,f+=h,l.putInt32(f>>>0),f=d>>>0;l.putInt32(f);for(var p=new Array(n.length),g=0;g<n.length;++g)p[g]=n[g].slice(0);k1(p,i,l);var m=It.util.createBuffer(),b;e==="SHA-512"?b=p.length:e==="SHA-384"?b=p.length-2:b=p.length-4;for(var g=0;g<b;++g)m.putInt32(p[g][0]),(g!==b-1||e!=="SHA-512/224")&&m.putInt32(p[g][1]);return m},s};var B0=null,HC=!1,$0=null,Ua=null;function IR(){B0="€",B0+=It.util.fillString("\0",128),$0=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],Ua={},Ua["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Ua["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Ua["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Ua["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],HC=!0}function k1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v,x,C,E,w,B,y,S,D,A,T,F,k,P,$,R,O,j,V,W,U=n.length();U>=128;){for(P=0;P<16;++P)t[P][0]=n.getInt32()>>>0,t[P][1]=n.getInt32()>>>0;for(;P<80;++P)O=t[P-2],$=O[0],R=O[1],r=(($>>>19|R<<13)^(R>>>29|$<<3)^$>>>6)>>>0,i=(($<<13|R>>>19)^(R<<3|$>>>29)^($<<26|R>>>6))>>>0,V=t[P-15],$=V[0],R=V[1],a=(($>>>1|R<<31)^($>>>8|R<<24)^$>>>7)>>>0,o=(($<<31|R>>>1)^($<<24|R>>>8)^($<<25|R>>>7))>>>0,j=t[P-7],W=t[P-16],R=i+j[1]+o+W[1],t[P][0]=r+j[0]+a+W[0]+(R/4294967296>>>0)>>>0,t[P][1]=R>>>0;for(p=e[0][0],m=e[0][1],b=e[1][0],v=e[1][1],x=e[2][0],C=e[2][1],E=e[3][0],w=e[3][1],B=e[4][0],y=e[4][1],S=e[5][0],D=e[5][1],A=e[6][0],T=e[6][1],F=e[7][0],k=e[7][1],P=0;P<80;++P)u=((B>>>14|y<<18)^(B>>>18|y<<14)^(y>>>9|B<<23))>>>0,c=((B<<18|y>>>14)^(B<<14|y>>>18)^(y<<23|B>>>9))>>>0,d=(A^B&(S^A))>>>0,h=(T^y&(D^T))>>>0,s=((p>>>28|m<<4)^(m>>>2|p<<30)^(m>>>7|p<<25))>>>0,l=((p<<4|m>>>28)^(m<<30|p>>>2)^(m<<25|p>>>7))>>>0,f=(p&b|x&(p^b))>>>0,g=(m&v|C&(m^v))>>>0,R=k+c+h+$0[P][1]+t[P][1],r=F+u+d+$0[P][0]+t[P][0]+(R/4294967296>>>0)>>>0,i=R>>>0,R=l+g,a=s+f+(R/4294967296>>>0)>>>0,o=R>>>0,F=A,k=T,A=S,T=D,S=B,D=y,R=w+i,B=E+r+(R/4294967296>>>0)>>>0,y=R>>>0,E=x,w=C,x=b,C=v,b=p,v=m,R=i+o,p=r+a+(R/4294967296>>>0)>>>0,m=R>>>0;R=e[0][1]+m,e[0][0]=e[0][0]+p+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+v,e[1][0]=e[1][0]+b+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+C,e[2][0]=e[2][0]+x+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+w,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+y,e[4][0]=e[4][0]+B+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+D,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+T,e[6][0]=e[6][0]+A+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+k,e[7][0]=e[7][0]+F+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}var cp={},_R=ze,tn=_R.asn1;cp.privateKeyValidator={name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:tn.Class.UNIVERSAL,type:tn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};cp.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:tn.Class.UNIVERSAL,type:tn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var gn=ze,jC=cp,DR=jC.publicKeyValidator,AR=jC.privateKeyValidator;if(typeof TR>"u")var TR=gn.jsbn.BigInteger;var k0=gn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;gn.pki=gn.pki||{};gn.pki.ed25519=gn.ed25519=gn.ed25519||{};var Ze=gn.ed25519;Ze.constants={};Ze.constants.PUBLIC_KEY_BYTE_LENGTH=32;Ze.constants.PRIVATE_KEY_BYTE_LENGTH=64;Ze.constants.SEED_BYTE_LENGTH=32;Ze.constants.SIGN_BYTE_LENGTH=64;Ze.constants.HASH_BYTE_LENGTH=64;Ze.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=gn.random.getBytesSync(Ze.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==Ze.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ze.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Li({message:t,encoding:"binary"});for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Hn(Ze.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return kR(n,r),{publicKey:n,privateKey:r}};Ze.privateKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,AR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.privateKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.privateKey,l=Li({message:gn.asn1.fromDer(s).value,encoding:"binary"});return{privateKeyBytes:l}};Ze.publicKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,DR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.publicKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.ed25519PublicKey;if(s.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Li({message:s,encoding:"binary"})};Ze.publicKeyFromPrivateKey=function(e){e=e||{};var t=Li({message:e.privateKey,encoding:"binary"});if(t.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<n.length;++r)n[r]=t[32+r];return n};Ze.sign=function(e){e=e||{};var t=Li(e),n=Li({message:e.privateKey,encoding:"binary"});if(n.length===Ze.constants.SEED_BYTE_LENGTH){var r=Ze.generateKeyPair({seed:n});n=r.privateKey}else if(n.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.SEED_BYTE_LENGTH+" or "+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length);PR(i,t,t.length,n);for(var a=new Hn(Ze.constants.SIGN_BYTE_LENGTH),o=0;o<a.length;++o)a[o]=i[o];return a};Ze.verify=function(e){e=e||{};var t=Li(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var n=Li({message:e.signature,encoding:"binary"});if(n.length!==Ze.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ze.constants.SIGN_BYTE_LENGTH);var r=Li({message:e.publicKey,encoding:"binary"});if(r.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ze.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),a=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),o;for(o=0;o<Ze.constants.SIGN_BYTE_LENGTH;++o)i[o]=n[o];for(o=0;o<t.length;++o)i[o+Ze.constants.SIGN_BYTE_LENGTH]=t[o];return FR(a,i,i.length,r)>=0};function Li(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Hn)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,n);t=new k0(t,n)}else if(!(t instanceof k0))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new Hn(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var P0=ke(),rd=ke([1]),RR=ke([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),BR=ke([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P1=ke([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),F1=ke([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Jf=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),$R=ke([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function cl(e,t){var n=gn.md.sha512.create(),r=new k0(e);n.update(r.getBytes(t),"binary");var i=n.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(i,"binary");for(var a=new Hn(Ze.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function kR(e,t){var n=[ke(),ke(),ke(),ke()],r,i=cl(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,fp(n,i),dp(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function PR(e,t,n,r){var i,a,o=new Float64Array(64),s=[ke(),ke(),ke(),ke()],l=cl(r,32);l[0]&=248,l[31]&=127,l[31]|=64;var u=n+64;for(i=0;i<n;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=l[32+i];var c=cl(e.subarray(32),n+32);for(F0(c),fp(s,c),dp(e,s),i=32;i<64;++i)e[i]=r[i];var d=cl(e,n+64);for(F0(d),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=c[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=d[i]*l[a];return WC(e.subarray(32),o),u}function FR(e,t,n,r){var i,a,o=new Hn(32),s=[ke(),ke(),ke(),ke()],l=[ke(),ke(),ke(),ke()];if(a=-1,n<64||NR(l,r))return-1;for(i=0;i<n;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=cl(e,n);if(F0(u),UC(s,l,u),fp(l,t.subarray(32)),N0(s,l),dp(o,s),n-=64,zC(t,0,o,0)){for(i=0;i<n;++i)e[i]=0;return-1}for(i=0;i<n;++i)e[i]=t[i+64];return a=n,a}function WC(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*Jf[i-(r-32)],n=t[i]+128>>8,t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;++i)t[i]+=n-(t[31]>>4)*Jf[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=n*Jf[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function F0(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;WC(e,t)}function N0(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),c=ke();Yo(n,e[1],e[0]),Yo(c,t[1],t[0]),vt(n,n,c),Go(r,e[0],e[1]),Go(c,t[0],t[1]),vt(r,r,c),vt(i,e[3],t[3]),vt(i,i,BR),vt(a,e[2],t[2]),Go(a,a,a),Yo(o,r,n),Yo(s,a,i),Go(l,a,i),Go(u,r,n),vt(e[0],o,s),vt(e[1],u,l),vt(e[2],l,s),vt(e[3],o,u)}function N1(e,t,n){for(var r=0;r<4;++r)XC(e[r],t[r],n)}function dp(e,t){var n=ke(),r=ke(),i=ke();VR(i,t[2]),vt(n,t[0],i),vt(r,t[1],i),id(e,r),e[31]^=GC(n)<<7}function id(e,t){var n,r,i,a=ke(),o=ke();for(n=0;n<16;++n)o[n]=t[n];for(Qf(o),Qf(o),Qf(o),r=0;r<2;++r){for(a[0]=o[0]-65517,n=1;n<15;++n)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,XC(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=o[n]&255,e[2*n+1]=o[n]>>8}function NR(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke();return sa(e[2],rd),MR(e[1],t),Xa(i,e[1]),vt(a,i,RR),Yo(i,i,e[2]),Go(a,e[2],a),Xa(o,a),Xa(s,o),vt(l,s,o),vt(n,l,i),vt(n,n,a),LR(n,n),vt(n,n,i),vt(n,n,a),vt(n,n,a),vt(e[0],n,a),Xa(r,e[0]),vt(r,r,a),M1(r,i)&&vt(e[0],e[0],$R),Xa(r,e[0]),vt(r,r,a),M1(r,i)?-1:(GC(e[0])===t[31]>>7&&Yo(e[0],P0,e[0]),vt(e[3],e[0],e[1]),0)}function MR(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function LR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Xa(n,n),r!==1&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function M1(e,t){var n=new Hn(32),r=new Hn(32);return id(n,e),id(r,t),zC(n,0,r,0)}function zC(e,t,n,r){return OR(e,t,n,r,32)}function OR(e,t,n,r,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function GC(e){var t=new Hn(32);return id(t,e),t[0]&1}function UC(e,t,n){var r,i;for(sa(e[0],P0),sa(e[1],rd),sa(e[2],rd),sa(e[3],P0),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,N1(e,t,r),N0(t,e),N0(e,e),N1(e,t,r)}function fp(e,t){var n=[ke(),ke(),ke(),ke()];sa(n[0],P1),sa(n[1],F1),sa(n[2],rd),vt(n[3],P1,F1),UC(e,n,t)}function sa(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function VR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Xa(n,n),r!==2&&r!==4&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Qf(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function XC(e,t,n){for(var r,i=~(n-1),a=0;a<16;++a)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function ke(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;++t)n[t]=e[t];return n}function Go(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]+n[r]}function Yo(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]-n[r]}function Xa(e,t){vt(e,t,t)}function vt(e,t,n){var r,i,a=0,o=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,g=0,p=0,m=0,b=0,v=0,x=0,C=0,E=0,w=0,B=0,y=0,S=0,D=0,A=0,T=0,F=0,k=0,P=0,$=0,R=0,O=0,j=0,V=n[0],W=n[1],U=n[2],K=n[3],ee=n[4],z=n[5],H=n[6],X=n[7],te=n[8],ie=n[9],le=n[10],ce=n[11],Q=n[12],be=n[13],Ce=n[14],Se=n[15];r=t[0],a+=r*V,o+=r*W,s+=r*U,l+=r*K,u+=r*ee,c+=r*z,d+=r*H,h+=r*X,f+=r*te,g+=r*ie,p+=r*le,m+=r*ce,b+=r*Q,v+=r*be,x+=r*Ce,C+=r*Se,r=t[1],o+=r*V,s+=r*W,l+=r*U,u+=r*K,c+=r*ee,d+=r*z,h+=r*H,f+=r*X,g+=r*te,p+=r*ie,m+=r*le,b+=r*ce,v+=r*Q,x+=r*be,C+=r*Ce,E+=r*Se,r=t[2],s+=r*V,l+=r*W,u+=r*U,c+=r*K,d+=r*ee,h+=r*z,f+=r*H,g+=r*X,p+=r*te,m+=r*ie,b+=r*le,v+=r*ce,x+=r*Q,C+=r*be,E+=r*Ce,w+=r*Se,r=t[3],l+=r*V,u+=r*W,c+=r*U,d+=r*K,h+=r*ee,f+=r*z,g+=r*H,p+=r*X,m+=r*te,b+=r*ie,v+=r*le,x+=r*ce,C+=r*Q,E+=r*be,w+=r*Ce,B+=r*Se,r=t[4],u+=r*V,c+=r*W,d+=r*U,h+=r*K,f+=r*ee,g+=r*z,p+=r*H,m+=r*X,b+=r*te,v+=r*ie,x+=r*le,C+=r*ce,E+=r*Q,w+=r*be,B+=r*Ce,y+=r*Se,r=t[5],c+=r*V,d+=r*W,h+=r*U,f+=r*K,g+=r*ee,p+=r*z,m+=r*H,b+=r*X,v+=r*te,x+=r*ie,C+=r*le,E+=r*ce,w+=r*Q,B+=r*be,y+=r*Ce,S+=r*Se,r=t[6],d+=r*V,h+=r*W,f+=r*U,g+=r*K,p+=r*ee,m+=r*z,b+=r*H,v+=r*X,x+=r*te,C+=r*ie,E+=r*le,w+=r*ce,B+=r*Q,y+=r*be,S+=r*Ce,D+=r*Se,r=t[7],h+=r*V,f+=r*W,g+=r*U,p+=r*K,m+=r*ee,b+=r*z,v+=r*H,x+=r*X,C+=r*te,E+=r*ie,w+=r*le,B+=r*ce,y+=r*Q,S+=r*be,D+=r*Ce,A+=r*Se,r=t[8],f+=r*V,g+=r*W,p+=r*U,m+=r*K,b+=r*ee,v+=r*z,x+=r*H,C+=r*X,E+=r*te,w+=r*ie,B+=r*le,y+=r*ce,S+=r*Q,D+=r*be,A+=r*Ce,T+=r*Se,r=t[9],g+=r*V,p+=r*W,m+=r*U,b+=r*K,v+=r*ee,x+=r*z,C+=r*H,E+=r*X,w+=r*te,B+=r*ie,y+=r*le,S+=r*ce,D+=r*Q,A+=r*be,T+=r*Ce,F+=r*Se,r=t[10],p+=r*V,m+=r*W,b+=r*U,v+=r*K,x+=r*ee,C+=r*z,E+=r*H,w+=r*X,B+=r*te,y+=r*ie,S+=r*le,D+=r*ce,A+=r*Q,T+=r*be,F+=r*Ce,k+=r*Se,r=t[11],m+=r*V,b+=r*W,v+=r*U,x+=r*K,C+=r*ee,E+=r*z,w+=r*H,B+=r*X,y+=r*te,S+=r*ie,D+=r*le,A+=r*ce,T+=r*Q,F+=r*be,k+=r*Ce,P+=r*Se,r=t[12],b+=r*V,v+=r*W,x+=r*U,C+=r*K,E+=r*ee,w+=r*z,B+=r*H,y+=r*X,S+=r*te,D+=r*ie,A+=r*le,T+=r*ce,F+=r*Q,k+=r*be,P+=r*Ce,$+=r*Se,r=t[13],v+=r*V,x+=r*W,C+=r*U,E+=r*K,w+=r*ee,B+=r*z,y+=r*H,S+=r*X,D+=r*te,A+=r*ie,T+=r*le,F+=r*ce,k+=r*Q,P+=r*be,$+=r*Ce,R+=r*Se,r=t[14],x+=r*V,C+=r*W,E+=r*U,w+=r*K,B+=r*ee,y+=r*z,S+=r*H,D+=r*X,A+=r*te,T+=r*ie,F+=r*le,k+=r*ce,P+=r*Q,$+=r*be,R+=r*Ce,O+=r*Se,r=t[15],C+=r*V,E+=r*W,w+=r*U,B+=r*K,y+=r*ee,S+=r*z,D+=r*H,A+=r*X,T+=r*te,F+=r*ie,k+=r*le,P+=r*ce,$+=r*Q,R+=r*be,O+=r*Ce,j+=r*Se,a+=38*E,o+=38*w,s+=38*B,l+=38*y,u+=38*S,c+=38*D,d+=38*A,h+=38*T,f+=38*F,g+=38*k,p+=38*P,m+=38*$,b+=38*R,v+=38*O,x+=38*j,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=l,e[4]=u,e[5]=c,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=m,e[12]=b,e[13]=v,e[14]=x,e[15]=C}var qn=ze;qn.kem=qn.kem||{};var L1=qn.jsbn.BigInteger;qn.kem.rsa={};qn.kem.rsa.create=function(e,t){t=t||{};var n=t.prng||qn.random,r={};return r.encrypt=function(i,a){var o=Math.ceil(i.n.bitLength()/8),s;do s=new L1(qn.util.bytesToHex(n.getBytesSync(o)),16).mod(i.n);while(s.compareTo(L1.ONE)<=0);s=qn.util.hexToBytes(s.toString(16));var l=o-s.length;l>0&&(s=qn.util.fillString("\0",l)+s);var u=i.encrypt(s,"NONE"),c=e.generate(s,a);return{encapsulation:u,key:c}},r.decrypt=function(i,a,o){var s=i.decrypt(a,"NONE");return e.generate(s,o)},r};qn.kem.kdf1=function(e,t){ZC(this,e,0,t||e.digestLength)};qn.kem.kdf2=function(e,t){ZC(this,e,1,t||e.digestLength)};function ZC(e,t,n,r){e.generate=function(i,a){for(var o=new qn.util.ByteBuffer,s=Math.ceil(a/r)+n,l=new qn.util.ByteBuffer,u=n;u<s;++u){l.putInt32(u),t.start(),t.update(i+l.getBytes());var c=t.digest();o.putBytes(c.getBytes(r))}return o.truncate(o.length()-a),o.getBytes()}}var qe=ze;qe.log=qe.log||{};qe.log.levels=["none","error","warning","info","debug","verbose","max"];var ad={},M0=[],dl=null;qe.log.LEVEL_LOCKED=2;qe.log.NO_LEVEL_CHECK=4;qe.log.INTERPOLATE=8;for(var la=0;la<qe.log.levels.length;++la){var O1=qe.log.levels[la];ad[O1]={index:la,name:O1.toUpperCase()}}qe.log.logMessage=function(e){for(var t=ad[e.level].index,n=0;n<M0.length;++n){var r=M0[n];if(r.flags&qe.log.NO_LEVEL_CHECK)r.f(e);else{var i=ad[r.level].index;t<=i&&r.f(r,e)}}};qe.log.prepareStandard=function(e){"standard"in e||(e.standard=ad[e.level].name+" ["+e.category+"] "+e.message)};qe.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=qe.util.format.apply(this,t)}};qe.log.prepareStandardFull=function(e){"standardFull"in e||(qe.log.prepareStandard(e),e.standardFull=e.standard)};for(var V1=["error","warning","info","debug","verbose"],la=0;la<V1.length;++la)(function(t){qe.log[t]=function(n,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:t,category:n,message:r,arguments:i};qe.log.logMessage(a)}})(V1[la]);qe.log.makeLogger=function(e){var t={flags:0,f:e};return qe.log.setLevel(t,"none"),t};qe.log.setLevel=function(e,t){var n=!1;if(e&&!(e.flags&qe.log.LEVEL_LOCKED))for(var r=0;r<qe.log.levels.length;++r){var i=qe.log.levels[r];if(t==i){e.level=t,n=!0;break}}return n};qe.log.lock=function(e,t){typeof t>"u"||t?e.flags|=qe.log.LEVEL_LOCKED:e.flags&=~qe.log.LEVEL_LOCKED};qe.log.addLogger=function(e){M0.push(e)};if(typeof console<"u"&&"log"in console){var Ms;if(console.error&&console.warn&&console.info&&console.debug){var HR={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},hp=function(e,t){qe.log.prepareStandard(t);var n=HR[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),n.apply(console,r)};Ms=qe.log.makeLogger(hp)}else{var hp=function(t,n){qe.log.prepareStandardFull(n),console.log(n.standardFull)};Ms=qe.log.makeLogger(hp)}qe.log.setLevel(Ms,"debug"),qe.log.addLogger(Ms),dl=Ms}else console={log:function(){}};if(dl!==null&&typeof window<"u"&&window.location){var ku=new URL(window.location.href).searchParams;if(ku.has("console.level")&&qe.log.setLevel(dl,ku.get("console.level").slice(-1)[0]),ku.has("console.lock")){var jR=ku.get("console.lock").slice(-1)[0];jR=="true"&&qe.log.lock(dl)}}qe.log.consoleLogger=dl;var he=ze,Z=he.asn1,An=he.pkcs7=he.pkcs7||{};An.messageFromPem=function(e){var t=he.pem.decode(e)[0];if(t.type!=="PKCS7"){var n=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=Z.fromDer(t.body);return An.messageFromAsn1(r)};An.messageToPem=function(e,t){var n={type:"PKCS7",body:Z.toDer(e.toAsn1()).getBytes()};return he.pem.encode(n,{maxline:t})};An.messageFromAsn1=function(e){var t={},n=[];if(!Z.validate(e,An.asn1.contentInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=n,r}var i=Z.derToOid(t.contentType),a;switch(i){case he.pki.oids.envelopedData:a=An.createEnvelopedData();break;case he.pki.oids.encryptedData:a=An.createEncryptedData();break;case he.pki.oids.signedData:a=An.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a};An.createSignedData=function(){var e=null;return e={type:he.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(gp(e,r,An.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,a=0;a<i.length;++a)e.certificates.push(he.pki.certificateFromAsn1(i[a]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],i=0;i<e.certificates.length;++i)r.push(he.pki.certificateToAsn1(e.certificates[i]));var a=[],o=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,r)),a.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.signerInfos)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),o])},addSigner:function(r){var i=r.issuer,a=r.serialNumber;if(r.certificate){var o=r.certificate;typeof o=="string"&&(o=he.pki.certificateFromPem(o)),i=o.issuer.attributes,a=o.serialNumber}var s=r.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof s=="string"&&(s=he.pki.privateKeyFromPem(s));var l=r.digestAlgorithm||he.pki.oids.sha1;switch(l){case he.pki.oids.sha1:case he.pki.oids.sha256:case he.pki.oids.sha384:case he.pki.oids.sha512:case he.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var u=r.authenticatedAttributes||[];if(u.length>0){for(var c=!1,d=!1,h=0;h<u.length;++h){var f=u[h];if(!c&&f.type===he.pki.oids.contentType){if(c=!0,d)break;continue}if(!d&&f.type===he.pki.oids.messageDigest){if(d=!0,c)break;continue}}if(!c||!d)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:i,serialNumber:a,digestAlgorithm:l,signatureAlgorithm:he.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof he.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=he.util.encodeUtf8(e.content)),r.detached?e.detachedContent=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i):e.contentInfo.value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i)]))}if(e.signers.length!==0){var a=t();n(a)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=he.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},i=0;i<e.signers.length;++i){var a=e.signers[i],o=a.digestAlgorithm;o in r||(r[o]=he.md[he.pki.oids[o]].create()),a.authenticatedAttributes.length===0?a.md=r[o]:a.md=he.md[he.pki.oids[o]].create()}e.digestAlgorithmIdentifiers=[];for(var o in r)e.digestAlgorithmIdentifiers.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(o).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]));return r}function n(r){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=Z.derToOid(e.contentInfo.value[0].value),o=Z.toDer(i);o.getByte(),Z.getBerValueLength(o),o=o.getBytes();for(var s in r)r[s].start().update(o);for(var l=new Date,u=0;u<e.signers.length;++u){var c=e.signers[u];if(c.authenticatedAttributes.length===0){if(a!==he.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{c.authenticatedAttributesAsn1=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[]),h=0;h<c.authenticatedAttributes.length;++h){var f=c.authenticatedAttributes[h];f.type===he.pki.oids.messageDigest?f.value=r[c.digestAlgorithm].digest():f.type===he.pki.oids.signingTime&&(f.value||(f.value=l)),d.value.push(L0(f)),c.authenticatedAttributesAsn1.value.push(L0(f))}o=Z.toDer(d).getBytes(),c.md.start().update(o)}c.signature=c.key.sign(c.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=ZR(e.signers)}};An.createEncryptedData=function(){var e=null;return e={type:he.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){gp(e,t,An.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),YC(e)}},e};An.createEnvelopedData=function(){var e=null;return e={type:he.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){var n=gp(e,t,An.asn1.envelopedDataValidator);e.recipients=GR(n.recipientInfos.value)},toAsn1:function(){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,UR(e.recipients)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,YR(e.encryptedContent))])])])},findRecipient:function(t){for(var n=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===n.length){for(var o=!0,s=0;s<n.length;++s)if(a[s].type!==n[s].type||a[s].value!==n[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,n){if(e.encryptedContent.key===void 0&&t!==void 0&&n!==void 0)switch(t.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:case he.pki.oids.desCBC:var r=n.decrypt(t.encryptedContent.content);e.encryptedContent.key=he.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}YC(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:he.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,n){if(e.encryptedContent.content===void 0){n=n||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,i,a;switch(n){case he.pki.oids["aes128-CBC"]:r=16,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes192-CBC"]:r=24,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes256-CBC"]:r=32,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["des-EDE3-CBC"]:r=24,i=8,a=he.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+n)}if(t===void 0)t=he.util.createBuffer(he.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=n,e.encryptedContent.key=t,e.encryptedContent.parameter=he.util.createBuffer(he.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var l=e.recipients[s];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}}},e};function WR(e){var t={},n=[];if(!Z.validate(e,An.asn1.recipientInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=n,r}return{version:t.version.charCodeAt(0),issuer:he.pki.RDNAttributesAsArray(t.issuer),serialNumber:he.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:Z.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function zR(e){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.encryptedContent.algorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]),Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function GR(e){for(var t=[],n=0;n<e.length;++n)t.push(WR(e[n]));return t}function UR(e){for(var t=[],n=0;n<e.length;++n)t.push(zR(e[n]));return t}function XR(e){var t=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.digestAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.signatureAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];n.values.push(L0(i))}t.value.push(n)}return t}function ZR(e){for(var t=[],n=0;n<e.length;++n)t.push(XR(e[n]));return t}function L0(e){var t;if(e.type===he.pki.oids.contentType)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.value).getBytes());else if(e.type===he.pki.oids.messageDigest)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===he.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var a=Date.parse(i);isNaN(a)?i.length===13?i=Z.utcTimeToDate(i):i=Z.generalizedTimeToDate(i):i=new Date(a)}i>=n&&i<r?t=Z.create(Z.Class.UNIVERSAL,Z.Type.UTCTIME,!1,Z.dateToUtcTime(i)):t=Z.create(Z.Class.UNIVERSAL,Z.Type.GENERALIZEDTIME,!1,Z.dateToGeneralizedTime(i))}return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[t])])}function YR(e){return[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.algorithm).getBytes()),e.parameter?Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.content.getBytes())])]}function gp(e,t,n){var r={},i=[];if(!Z.validate(t,n,r,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}var o=Z.derToOid(r.contentType);if(o!==he.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var s="";if(he.util.isArray(r.encryptedContent))for(var l=0;l<r.encryptedContent.length;++l){if(r.encryptedContent[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=r.encryptedContent[l].value}else s=r.encryptedContent;e.encryptedContent={algorithm:Z.derToOid(r.encAlgorithm),parameter:he.util.createBuffer(r.encParameter.value),content:he.util.createBuffer(s)}}if(r.content){var s="";if(he.util.isArray(r.content))for(var l=0;l<r.content.length;++l){if(r.content[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=r.content[l].value}else s=r.content;e.content=he.util.createBuffer(s)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function YC(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case he.pki.oids["aes128-CBC"]:case he.pki.oids["aes192-CBC"]:case he.pki.oids["aes256-CBC"]:t=he.aes.createDecryptionCipher(e.encryptedContent.key);break;case he.pki.oids.desCBC:case he.pki.oids["des-EDE3-CBC"]:t=he.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var Wt=ze,uf=Wt.ssh=Wt.ssh||{};uf.privateKeyToPutty=function(e,t,n){n=n||"",t=t||"";var r="ssh-rsa",i=t===""?"none":"aes256-cbc",a="PuTTY-User-Key-File-2: "+r+`\r
15
15
  `;a+="Encryption: "+i+`\r
16
16
  `,a+="Comment: "+n+`\r
17
17
  `;var o=Wt.util.createBuffer();Ko(o,r),Kr(o,e.e),Kr(o,e.n);var s=Wt.util.encode64(o.bytes(),64),l=Math.floor(s.length/66)+1;a+="Public-Lines: "+l+`\r
@@ -19,8 +19,8 @@
19
19
  Private-Lines: `+l+`\r
20
20
  `,a+=c;var m=Pu("putty-private-key-file-mac-key",t),b=Wt.util.createBuffer();Ko(b,r),Ko(b,i),Ko(b,n),b.putInt32(o.length()),b.putBuffer(o),b.putInt32(u.length()),b.putBuffer(u);var v=Wt.hmac.create();return v.start("sha1",m),v.update(b.bytes()),a+=`\r
21
21
  Private-MAC: `+v.digest().toHex()+`\r
22
- `,a};uf.publicKeyToOpenSSH=function(e,t){var n="ssh-rsa";t=t||"";var r=Wt.util.createBuffer();return Ko(r,n),Kr(r,e.e),Kr(r,e.n),n+" "+Wt.util.encode64(r.bytes())+" "+t};uf.privateKeyToOpenSSH=function(e,t){return t?Wt.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Wt.pki.privateKeyToPem(e)};uf.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Wt.md.md5.create(),r="ssh-rsa",i=Wt.util.createBuffer();Ko(i,r),Kr(i,e.e),Kr(i,e.n),n.start(),n.update(i.getBytes());var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};function Kr(e,t){var n=t.toString(16);n[0]>="8"&&(n="00"+n);var r=Wt.util.hexToBytes(n);e.putInt32(r.length),e.putBytes(r)}function Ko(e,t){e.putInt32(t.length),e.putString(t)}function Pu(){for(var e=Wt.md.sha1.create(),t=arguments.length,n=0;n<t;++n)e.update(arguments[n]);return e.digest()}var KR=ze;const Pa=o6(KR),ci=e=>{try{return $t(e).isFinite()}catch{return!1}},KC=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const t=Number(e);return Number.isFinite(t)}return!1};function cf(e,t){const{minimumFractionDigits:n,instance:r=!1}=t||{};let{maximumFractionDigits:i=2}=t||{};ci(e)||(e="0"),n!==void 0&&n>i&&(i=n);let a=$t(e).toFixed(i);if(a.includes(".")){const[o,s]=a.split(".");let l=s.replace(/0+$/,"");n!==void 0&&n>=0&&(l=l.padEnd(n,"0")),a=l?`${o}.${l}`:o}return r?$t(a):a}const pp=(e,t=2)=>{let n=parseFloat(KC(e)?e:0);return n=(+(Math.round(n+"e"+t)+"e-"+t)).toFixed(t),n=Number(n),n};function Ji(e,t="currency",n){const{minimumFractionDigits:r=0,locale:i="id-ID",currency:a="IDR",withSpace:o=!1}=n||{},s=new Intl.NumberFormat(i,{style:t,currency:a,minimumFractionDigits:r}).format(pp(e,r>0?r:2));return o?s:s.replace(/\s/g,"")}const qo=(e,t,n,r)=>{const i={"id-ID":Yc,"zh-CN":rC,"en-US":Yg,"nl-BE":nC};let a=n??"-";return e&&!isNaN(new Date(e).getTime())&&(a=wl(e,t??"dd/MM/yyyy",{locale:i[r??"id-ID"]})),a},qR=(e,t,n,r,i,a)=>{const o={"id-ID":Yc,"zh-CN":rC,"en-US":Yg,"nl-NL":nC};if(e&&!isNaN(new Date(e).getTime())){const s=wl(e,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});if(t&&!isNaN(new Date(t).getTime())){const l=wl(t,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});return s===l?s:`${s}${r??"-"}${l}`}return s}return i??"-"},qC=(e,t)=>e.reduce((n,r)=>{const i=String(r[t]);return n[i]||(n[i]=[]),n[i].push(r),n},{}),JR=({value:e,keyDate:t="date",keyFormat:n="formatDate",format:r="dd/MM/yyyy"})=>{const i=e.map(a=>({...a,[n]:qo(a[t],r)}));return qC(i,n)},QR=e=>(Object.keys(e).forEach(t=>{["",null,void 0,[],{}].includes(e[t])&&delete e[t]}),e),eB=(e,t)=>{var h,f;const n=/^-?\d+[0-9.,]*$/,r=/([.])(?=.*\1)/,i=/([,])(?=.*\1)/,a=((h=e.split(",")[0])==null?void 0:h.trim())||"",o=((f=e.split(",")[1])==null?void 0:f.trim())||"",s=!r.test(a)&&(a==="-"||n.test(a)||!a),l=!r.test(o)&&(o==="-"||n.test(o)||!o),u=(g,p,m)=>{let b=g;const v=g.split(".")[0];return isNaN(parseFloat(v.split(".")[0]))||(parseFloat(v.split(".")[0])<=p?b=`${p}`:parseFloat(v)>=m&&(b=`${m}`)),b},c=u(a,(t==null?void 0:t.latMin)??-85,(t==null?void 0:t.latMax)??85),d=u(o,(t==null?void 0:t.longMin)??-180,(t==null?void 0:t.longMax)??180);return{latitude:c,longitude:d,latlong:`${c}${e.includes(",")?","+d:""}`,isValid:!i.test(e)&&s&&l}},H1=(e,t)=>e?Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith(e))):t,mp=(e,t)=>e.map(n=>n[t]).join(","),bp=(e,t)=>e.map(n=>n[t]),tB=(e,t)=>Array.isArray(e)?e==null?void 0:e.map((n,r,i)=>typeof t=="function"?t(n,r,i):n):[],nB=(e,t,n,r,i)=>Array.isArray(e)?{[t]:e==null?void 0:e.map((a,o,s)=>typeof n=="function"?n(a,o,s):a),[`${t}-val-be`]:a=>r==="array-of-object-to-array"?bp(a,i):mp(a,i)}:{[t]:"",[`${t}-val-be`]:()=>""};function vp(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||!vp(e[i],t[i]))return!1;return!0}function rB(e,t={maxTime:"hour"}){const{maxTime:n="hour"}=t,r=l=>l<10?`0${l}`:l;let i=r(0),a=r(0);const o=r(Math.floor(e%3600/60)),s=r(Math.floor(e%60));return n==="hour"?a=r(Math.floor(e/3600)):n==="day"&&(i=r(Math.floor(e/(3600*24))),a=r(Math.floor(e%(3600*24)/3600))),{day:i,hour:a,minute:o,second:s}}function fl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function _l(e,...t){if(!t.length)return e;const n=t.shift();if(fl(e)&&fl(n))for(const r in n)fl(n[r])?(e[r]||Object.assign(e,{[r]:{}}),_l(e[r],n[r])):Object.assign(e,{[r]:n[r]});return _l(e,...t)}function od(e,t){const n=t.match(/[^.[\]]+/g);if(!n||n.length===0)return;const r=(i,a)=>{if(typeof i!="object"||i===null||a.length===0)return;const o=i,s=a[0],l=a.slice(1);if(l.length===0){delete o[s];return}const u=o[s];if(s==="*"&&Array.isArray(o)){for(const c of o)r(c,l);return}r(u,l)};r(e,n)}function iB(e,t){if(!e||!t)return e;if(Array.isArray(t))for(const n of t)od(e,n);else od(e,t);return e}function JC(e,t){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(t))for(const r of t)od(n,r);else od(n,t);return n}function aB(e,t,n={}){const r=n.arrayMergeStrategy||"combine",i=(n.keepKeys||[]).map(s=>s.match(/[^.[\]]+/g)||[]),a=s=>i.some(l=>l.length!==s.length?!1:l.every((u,c)=>u===s[c]));function o(s,l,u){if(u.length>0&&a(u))return s;if(Array.isArray(l)&&Array.isArray(s)){if(r==="overwrite")return[...l];const c=r==="sync"?l.length:Math.max(s.length,l.length),d=new Array(c);for(let h=0;h<c;h++){const f=[...u,String(h)],g=s[h],p=l[h];if(h>=l.length){d[h]=g;continue}if(h>=s.length){d[h]=p;continue}d[h]=o(g,p,f)}return d}if(fl(l)&&fl(s)){const c={...s};return Object.keys(l).forEach(d=>{const h=[...u,d],f=l[d],g=s[d];c[d]=o(g,f,h)}),c}return l===void 0?s:l}return o(e,t,[])}const oB=e=>pp(e||0),sB=e=>cf(e||0),lB=e=>isNaN(e)?void 0:e,df=e=>{const t=e.toString().split(""),n=t[1]!=="0"?`,${t[1]}`:"";let[r]=e.toString().split(".");return r=r.replaceAll("-",""),r.length>=15?`${+r.substring(0,3)} T`:r.length===14?`${+r.substring(0,2)} T`:r.length===13?`${+r.substring(0,1)}${n} T`:r.length===12?`${+r.substring(0,3)} M`:r.length===11?`${+r.substring(0,2)} M`:r.length===10?`${+r.substring(0,1)}${n} M`:r.length===9?`${+r.substring(0,3)} JT`:r.length===8?`${+r.substring(0,2)} JT`:r.length===7?`${+r.substring(0,1)}${n} JT`:r.length===6?`${+r.substring(0,3)} RB`:r.length===5?`${+r.substring(0,2)} RB`:r.length===4?`${+r.substring(0,1)}${n} RB`:r.length<=3?+r?`${+r}`:0:null};function O0(e){if(typeof e!="string")throw new Error("Input harus berupa string");const t=e.split(".");if(t.length===1)return{filename:e,extension:""};const n="."+t[t.length-1];return{filename:t.slice(0,-1).join("."),extension:n}}const uB=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function cB(e,t){const n=typeof e=="string"?e:JSON.stringify(e),r=Pa.util.decode64(t.replace(/\s+/g,"")),i=Pa.util.decode64(r),a=Pa.asn1.fromDer(i),s=Pa.pki.publicKeyFromAsn1(a).encrypt(n,"RSA-OAEP",{md:Pa.md.sha256.create(),mgf1:{md:Pa.md.sha1.create()}});return Pa.util.encode64(s)}function dB(e,t={}){const{locale:n,currency:r,minimumFractionDigits:i,withSpace:a,currencyDisplay:o}=t;let{maximumFractionDigits:s=2}=t;i!==void 0&&i>s&&(s=i);const l=cf(e,{maximumFractionDigits:s}),[u,c=""]=l.split("."),d=u.replace(/\B(?=(\d{3})+(?!\d))/g,".");let h=c.slice(0,s);i===void 0?h=h.replace(/0+$/,""):h&&i>0&&(h=h.padEnd(i,"0"));let f=h?`${d},${h}`:d;if(!n||!r)return f;const p={"id-ID":{symbol:"Rp",code:"IDR",name:"Rupiah",negativePosition:"start"},"en-US":{symbol:"$",code:"USD",name:"US Dollar",negativePosition:"middle"},"ja-JP":{symbol:"¥",code:"JPY",name:"Yen",negativePosition:"middle"}}[n]||{symbol:"",code:r,name:r},m={symbol:p.symbol,code:p.code,name:p.name}[o||"symbol"],b=f.includes("-");return f=p.negativePosition==="start"?f.replace("-",""):f,a?`${p.negativePosition==="start"&&b?"-":""}${m} ${f}`:`${p.negativePosition==="start"&&b?"-":""}${m}${f}`}function fB(e){if(!ci(e))return"0";const t=typeof e=="number"?$t(e).toString():e;if(!t.includes("."))return t;const[n,r]=t.split("."),i=r.replace(/0+$/,"");return i?`${n}.${i}`:n}/*! js-cookie v3.0.5 | MIT */function Fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var hB={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function V0(e,t){function n(i,a,o){if(!(typeof document>"u")){o=Fu({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},s=0;s<a.length;s++){var l=a[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),i===c)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,a){n(i,"",Fu({},a,{expires:-1}))},withAttributes:function(i){return V0(this.converter,Fu({},this.attributes,i))},withConverter:function(i){return V0(Fu({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Or=V0(hB,{path:"/"});const gB={setItem(e,t,n={},r=3e3){const a={...{path:"/",expires:365},...n};parseInt(Or.get(`${e}_count`)??"0",10)&&this.removeItem(e,n);const s=Math.ceil(t.length/r);for(let l=0;l<s;l++){const u=t.slice(l*r,(l+1)*r);Or.set(`${e}_${l}`,u,a)}Or.set(`${e}_count`,s.toString(),a)},getItem(e){const t=parseInt(Or.get(`${e}_count`)??"0",10);if(!t)return null;let n="";for(let r=0;r<t;r++){const i=Or.get(`${e}_${r}`);if(!i)return null;n+=i}return n},removeItem(e,t={}){const n=parseInt(Or.get(`${e}_count`)??"0",10),r={path:"/",...t};if(!isNaN(n)){for(let i=0;i<n;i++)Or.remove(`${e}_${i}`,r);Or.remove(`${e}_count`,r)}},clear(e={}){const t={path:"/",...e},n=Or.get();Object.keys(n).forEach(r=>Or.remove(r,t))}};function QC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=QC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ki(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=QC(e))&&(r&&(r+=" "),r+=t);return r}const Dl=e=>typeof e=="number"&&!isNaN(e),oo=e=>typeof e=="string",Qn=e=>typeof e=="function",Ac=e=>oo(e)||Qn(e)?e:null,H0=e=>I.isValidElement(e)||oo(e)||Qn(e)||Dl(e);function pB(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function ff(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:a=300}=e;return function(o){let{children:s,position:l,preventExitTransition:u,done:c,nodeRef:d,isIn:h,playToast:f}=o;const g=r?`${t}--${l}`:t,p=r?`${n}--${l}`:n,m=I.useRef(0);return I.useLayoutEffect(()=>{const b=d.current,v=g.split(" "),x=C=>{C.target===d.current&&(f(),b.removeEventListener("animationend",x),b.removeEventListener("animationcancel",x),m.current===0&&C.type!=="animationcancel"&&b.classList.remove(...v))};b.classList.add(...v),b.addEventListener("animationend",x),b.addEventListener("animationcancel",x)},[]),I.useEffect(()=>{const b=d.current,v=()=>{b.removeEventListener("animationend",v),i?pB(b,c,a):c()};h||(u?v():(m.current=1,b.className+=` ${p}`,b.addEventListener("animationend",v)))},[h]),I.createElement(I.Fragment,null,s)}}function j1(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Tn=new Map;let Al=[];const j0=new Set,mB=e=>j0.forEach(t=>t(e)),e4=()=>Tn.size>0;function t4(e,t){var n;if(t)return!((n=Tn.get(t))==null||!n.isToastActive(e));let r=!1;return Tn.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function n4(e,t){H0(e)&&(e4()||Al.push({content:e,options:t}),Tn.forEach(n=>{n.buildToast(e,t)}))}function W1(e,t){Tn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function bB(e){const{subscribe:t,getSnapshot:n,setProps:r}=I.useRef(function(a){const o=a.containerId||1;return{subscribe(s){const l=function(c,d,h){let f=1,g=0,p=[],m=[],b=[],v=d;const x=new Map,C=new Set,E=()=>{b=Array.from(x.values()),C.forEach(y=>y())},w=y=>{m=y==null?[]:m.filter(S=>S!==y),E()},B=y=>{const{toastId:S,onOpen:D,updateId:A,children:T}=y.props,F=A==null;y.staleId&&x.delete(y.staleId),x.set(S,y),m=[...m,y.props.toastId].filter(k=>k!==y.staleId),E(),h(j1(y,F?"added":"updated")),F&&Qn(D)&&D(I.isValidElement(T)&&T.props)};return{id:c,props:v,observe:y=>(C.add(y),()=>C.delete(y)),toggle:(y,S)=>{x.forEach(D=>{S!=null&&S!==D.props.toastId||Qn(D.toggle)&&D.toggle(y)})},removeToast:w,toasts:x,clearQueue:()=>{g-=p.length,p=[]},buildToast:(y,S)=>{if((U=>{let{containerId:K,toastId:ee,updateId:z}=U;const H=K?K!==c:c!==1,X=x.has(ee)&&z==null;return H||X})(S))return;const{toastId:D,updateId:A,data:T,staleId:F,delay:k}=S,P=()=>{w(D)},$=A==null;$&&g++;const R={...v,style:v.toastStyle,key:f++,...Object.fromEntries(Object.entries(S).filter(U=>{let[K,ee]=U;return ee!=null})),toastId:D,updateId:A,data:T,closeToast:P,isIn:!1,className:Ac(S.className||v.toastClassName),bodyClassName:Ac(S.bodyClassName||v.bodyClassName),progressClassName:Ac(S.progressClassName||v.progressClassName),autoClose:!S.isLoading&&(O=S.autoClose,j=v.autoClose,O===!1||Dl(O)&&O>0?O:j),deleteToast(){const U=x.get(D),{onClose:K,children:ee}=U.props;Qn(K)&&K(I.isValidElement(ee)&&ee.props),h(j1(U,"removed")),x.delete(D),g--,g<0&&(g=0),p.length>0?B(p.shift()):E()}};var O,j;R.closeButton=v.closeButton,S.closeButton===!1||H0(S.closeButton)?R.closeButton=S.closeButton:S.closeButton===!0&&(R.closeButton=!H0(v.closeButton)||v.closeButton);let V=y;I.isValidElement(y)&&!oo(y.type)?V=I.cloneElement(y,{closeToast:P,toastProps:R,data:T}):Qn(y)&&(V=y({closeToast:P,toastProps:R,data:T}));const W={content:V,props:R,staleId:F};v.limit&&v.limit>0&&g>v.limit&&$?p.push(W):Dl(k)?setTimeout(()=>{B(W)},k):B(W)},setProps(y){v=y},setToggle:(y,S)=>{x.get(y).toggle=S},isToastActive:y=>m.some(S=>S===y),getSnapshot:()=>v.newestOnTop?b.reverse():b}}(o,a,mB);Tn.set(o,l);const u=l.observe(s);return Al.forEach(c=>n4(c.content,c.options)),Al=[],()=>{u(),Tn.delete(o)}},setProps(s){var l;(l=Tn.get(o))==null||l.setProps(s)},getSnapshot(){var s;return(s=Tn.get(o))==null?void 0:s.getSnapshot()}}}(e)).current;r(e);const i=I.useSyncExternalStore(t,n,n);return{getToastToRender:function(a){if(!i)return[];const o=new Map;return i.forEach(s=>{const{position:l}=s.props;o.has(l)||o.set(l,[]),o.get(l).push(s)}),Array.from(o,s=>a(s[0],s[1]))},isToastActive:t4,count:i==null?void 0:i.length}}function vB(e){const[t,n]=I.useState(!1),[r,i]=I.useState(!1),a=I.useRef(null),o=I.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:d}=e;var h,f;function g(){n(!0)}function p(){n(!1)}function m(x){const C=a.current;o.canDrag&&C&&(o.didMove=!0,t&&p(),o.delta=e.draggableDirection==="x"?x.clientX-o.start:x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1),C.style.transform=`translate3d(${e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,C.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function b(){document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",b);const x=a.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),e.closeToast(),void e.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=Tn.get((h={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||f.setToggle(h.id,h.fn),I.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",g),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",p)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(x){if(e.draggable===!0||e.draggable===x.pointerType){o.didMove=!1,document.addEventListener("pointermove",m),document.addEventListener("pointerup",b);const C=a.current;o.canCloseOnClick=!0,o.canDrag=!0,C.style.transition="none",e.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(x){const{top:C,bottom:E,left:w,right:B}=a.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&x.clientX>=w&&x.clientX<=B&&x.clientY>=C&&x.clientY<=E?p():g()}};return s&&l&&(v.onMouseEnter=p,e.stacked||(v.onMouseLeave=g)),d&&(v.onClick=x=>{c&&c(x),o.canCloseOnClick&&u()}),{playToast:g,pauseToast:p,isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:v}}function yB(e){let{delay:t,isRunning:n,closeToast:r,type:i="default",hide:a,className:o,style:s,controlledProgress:l,progress:u,rtl:c,isIn:d,theme:h}=e;const f=a||l&&u===0,g={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(g.transform=`scaleX(${u})`);const p=ki("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":c}),m=Qn(o)?o({rtl:c,type:i,defaultClassName:p}):ki(p,o),b={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{d&&r()}};return I.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},I.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${h} Toastify__progress-bar--${i}`}),I.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:g,...b}))}let xB=1;const r4=()=>""+xB++;function CB(e){return e&&(oo(e.toastId)||Dl(e.toastId))?e.toastId:r4()}function hl(e,t){return n4(e,t),t.toastId}function sd(e,t){return{...t,type:t&&t.type||e,toastId:CB(t)}}function Nu(e){return(t,n)=>hl(t,sd(e,n))}function ft(e,t){return hl(e,sd("default",t))}ft.loading=(e,t)=>hl(e,sd("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ft.promise=function(e,t,n){let r,{pending:i,error:a,success:o}=t;i&&(r=oo(i)?ft.loading(i,n):ft.loading(i.render,{...n,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(c,d,h)=>{if(d==null)return void ft.dismiss(r);const f={type:c,...s,...n,data:h},g=oo(d)?{render:d}:d;return r?ft.update(r,{...f,...g}):ft(g.render,{...f,...g}),h},u=Qn(e)?e():e;return u.then(c=>l("success",o,c)).catch(c=>l("error",a,c)),u},ft.success=Nu("success"),ft.info=Nu("info"),ft.error=Nu("error"),ft.warning=Nu("warning"),ft.warn=ft.warning,ft.dark=(e,t)=>hl(e,sd("default",{theme:"dark",...t})),ft.dismiss=function(e){(function(t){var n;if(e4()){if(t==null||oo(n=t)||Dl(n))Tn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Tn.get(t.containerId);r?r.removeToast(t.id):Tn.forEach(i=>{i.removeToast(t.id)})}}else Al=Al.filter(r=>t!=null&&r.options.toastId!==t)})(e)},ft.clearWaitingQueue=function(e){e===void 0&&(e={}),Tn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},ft.isActive=t4,ft.update=function(e,t){t===void 0&&(t={});const n=((r,i)=>{var a;let{containerId:o}=i;return(a=Tn.get(o||1))==null?void 0:a.toasts.get(r)})(e,t);if(n){const{props:r,content:i}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:r4()};a.toastId!==e&&(a.staleId=e);const o=a.render||i;delete a.render,hl(o,a)}},ft.done=e=>{ft.update(e,{progress:1})},ft.onChange=function(e){return j0.add(e),()=>{j0.delete(e)}},ft.play=e=>W1(!0,e),ft.pause=e=>W1(!1,e);const EB=typeof window<"u"?I.useLayoutEffect:I.useEffect,Mu=e=>{let{theme:t,type:n,isLoading:r,...i}=e;return I.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...i})},eh={info:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return I.createElement("div",{className:"Toastify__spinner"})}},SB=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:a}=vB(e),{closeButton:o,children:s,autoClose:l,onClick:u,type:c,hideProgressBar:d,closeToast:h,transition:f,position:g,className:p,style:m,bodyClassName:b,bodyStyle:v,progressClassName:x,progressStyle:C,updateId:E,role:w,progress:B,rtl:y,toastId:S,deleteToast:D,isIn:A,isLoading:T,closeOnClick:F,theme:k}=e,P=ki("Toastify__toast",`Toastify__toast-theme--${k}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":y},{"Toastify__toast--close-on-click":F}),$=Qn(p)?p({rtl:y,position:g,type:c,defaultClassName:P}):ki(P,p),R=function(W){let{theme:U,type:K,isLoading:ee,icon:z}=W,H=null;const X={theme:U,type:K};return z===!1||(Qn(z)?H=z({...X,isLoading:ee}):I.isValidElement(z)?H=I.cloneElement(z,X):ee?H=eh.spinner():(te=>te in eh)(K)&&(H=eh[K](X))),H}(e),O=!!B||!l,j={closeToast:h,type:c,theme:k};let V=null;return o===!1||(V=Qn(o)?o(j):I.isValidElement(o)?I.cloneElement(o,j):function(W){let{closeToast:U,theme:K,ariaLabel:ee="close"}=W;return I.createElement("button",{className:`Toastify__close-button Toastify__close-button--${K}`,type:"button",onClick:z=>{z.stopPropagation(),U(z)},"aria-label":ee},I.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},I.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(j)),I.createElement(f,{isIn:A,done:D,position:g,preventExitTransition:n,nodeRef:r,playToast:a},I.createElement("div",{id:S,onClick:u,"data-in":A,className:$,...i,style:m,ref:r},I.createElement("div",{...A&&{role:w},className:Qn(b)?b({type:c}):ki("Toastify__toast-body",b),style:v},R!=null&&I.createElement("div",{className:ki("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},R),I.createElement("div",null,s)),V,I.createElement(yB,{...E&&!O?{key:`pb-${E}`}:{},rtl:y,theme:k,delay:l,isRunning:t,isIn:A,closeToast:h,hide:d,type:c,style:C,className:x,controlledProgress:O,progress:B||0})))},hf=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wB=ff(hf("bounce",!0));ff(hf("slide",!0));ff(hf("zoom"));ff(hf("flip"));const IB={position:"top-right",transition:wB,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function _B(e){let t={...IB,...e};const n=e.stacked,[r,i]=I.useState(!0),a=I.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=bB(t),{className:u,style:c,rtl:d,containerId:h}=t;function f(p){const m=ki("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":d});return Qn(u)?u({position:p,rtl:d,defaultClassName:m}):ki(m,Ac(u))}function g(){n&&(i(!0),ft.play())}return EB(()=>{if(n){var p;const m=a.current.querySelectorAll('[data-in="true"]'),b=12,v=(p=t.position)==null?void 0:p.includes("top");let x=0,C=0;Array.from(m).reverse().forEach((E,w)=>{const B=E;B.classList.add("Toastify__toast--stacked"),w>0&&(B.dataset.collapsed=`${r}`),B.dataset.pos||(B.dataset.pos=v?"top":"bot");const y=x*(r?.2:1)+(r?0:b*w);B.style.setProperty("--y",`${v?y:-1*y}px`),B.style.setProperty("--g",`${b}`),B.style.setProperty("--s",""+(1-(r?C:0))),x+=B.offsetHeight,C+=.025})}},[r,l,n]),I.createElement("div",{ref:a,className:"Toastify",id:h,onMouseEnter:()=>{n&&(i(!1),ft.pause())},onMouseLeave:g},o((p,m)=>{const b=m.length?{...c}:{...c,pointerEvents:"none"};return I.createElement("div",{className:f(p),style:b,key:`container-${p}`},m.map(v=>{let{content:x,props:C}=v;return I.createElement(SB,{...C,stacked:n,collapseAll:g,isIn:s(C.toastId,C.containerId),style:C.style,key:`toast-${C.key}`},x)}))}))}const Xn={"alert-body":"_alert-body_1qmvx_115","text-header":"_text-header_1qmvx_241","alert-info-filled":"_alert-info-filled_1qmvx_469","alert-warning-filled":"_alert-warning-filled_1qmvx_469","alert-error-filled":"_alert-error-filled_1qmvx_469","alert-success-filled":"_alert-success-filled_1qmvx_469","alert-info-outlined":"_alert-info-outlined_1qmvx_469","alert-warning-outlined":"_alert-warning-outlined_1qmvx_469","alert-error-outlined":"_alert-error-outlined_1qmvx_469","alert-success-outlined":"_alert-success-outlined_1qmvx_469"},DB=(e,t,n)=>{const r=(n==null?void 0:n.variant)??"outline",i={position:"top-center",autoClose:2e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,bodyClassName:Xn["alert-body"]},a={icon:{solid:{success:_.jsx(TB,{}),warning:_.jsx(PB,{}),error:_.jsx($B,{}),info:_.jsx(BB,{})},outline:{success:_.jsx(AB,{}),warning:_.jsx(kB,{}),error:_.jsx(RB,{}),info:_.jsx(FB,{})}},variant:{solid:{success:Xn["alert-success-filled"],error:Xn["alert-error-filled"],warning:Xn["alert-warning-filled"],info:Xn["alert-info-filled"]},outline:{success:Xn["alert-success-outlined"],error:Xn["alert-error-outlined"],warning:Xn["alert-warning-outlined"],info:Xn["alert-info-outlined"]}}};return t==="error"?ft.error(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Error"}),e]}),{icon:a.icon[r].error,className:a.variant[r].error,...i,...n}):t==="info"?ft.info(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Info"}),e]}),{icon:a.icon[r].info,className:a.variant[r].info,...i,...n}):t==="warning"?ft.warning(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Warning"}),e]}),{icon:a.icon[r].warning,className:a.variant[r].warning,...i,...n}):ft(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Success"}),e]}),{icon:a.icon[r].success,className:a.variant[r].success,...i,...n})},AB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"check-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M10 18.5C12.1217 18.5 14.1566 17.6571 15.6569 16.1569C17.1571 14.6566 18 12.6217 18 10.5C18 8.37827 17.1571 6.34344 15.6569 4.84315C14.1566 3.34285 12.1217 2.5 10 2.5C7.87827 2.5 5.84344 3.34285 4.34315 4.84315C2.84285 6.34344 2 8.37827 2 10.5C2 12.6217 2.84285 14.6566 4.34315 16.1569C5.84344 17.6571 7.87827 18.5 10 18.5ZM13.707 9.207C13.8892 9.0184 13.99 8.7658 13.9877 8.5036C13.9854 8.2414 13.8802 7.99059 13.6948 7.80518C13.5094 7.61977 13.2586 7.5146 12.9964 7.51233C12.7342 7.51005 12.4816 7.61084 12.293 7.793L9 11.086L7.707 9.793C7.5184 9.61084 7.2658 9.51005 7.0036 9.51233C6.7414 9.5146 6.49059 9.61977 6.30518 9.80518C6.11977 9.99059 6.0146 10.2414 6.01233 10.5036C6.01005 10.7658 6.11084 11.0184 6.293 11.207L8.293 13.207C8.48053 13.3945 8.73484 13.4998 9 13.4998C9.26516 13.4998 9.51947 13.3945 9.707 13.207L13.707 9.207Z",fill:"#388E3C"})})}),TB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"circle",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M9 12L11 14L15 10",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),RB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"exclamation-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 14.5C11 14.7652 10.8946 15.0196 10.7071 15.2071C10.5196 15.3946 10.2652 15.5 10 15.5C9.73478 15.5 9.48043 15.3946 9.29289 15.2071C9.10536 15.0196 9 14.7652 9 14.5C9 14.2348 9.10536 13.9804 9.29289 13.7929C9.48043 13.6054 9.73478 13.5 10 13.5C10.2652 13.5 10.5196 13.6054 10.7071 13.7929C10.8946 13.9804 11 14.2348 11 14.5ZM10 5.5C9.73478 5.5 9.48043 5.60536 9.29289 5.79289C9.10536 5.98043 9 6.23478 9 6.5V10.5C9 10.7652 9.10536 11.0196 9.29289 11.2071C9.48043 11.3946 9.73478 11.5 10 11.5C10.2652 11.5 10.5196 11.3946 10.7071 11.2071C10.8946 11.0196 11 10.7652 11 10.5V6.5C11 6.23478 10.8946 5.98043 10.7071 5.79289C10.5196 5.60536 10.2652 5.5 10 5.5Z",fill:"#F44336"})})}),BB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),$B=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),kB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"exclamation",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M8.25697 3.59898C9.02197 2.23898 10.979 2.23898 11.743 3.59898L17.323 13.519C18.073 14.853 17.11 16.499 15.581 16.499H4.41997C2.88997 16.499 1.92697 14.853 2.67697 13.519L8.25697 3.59898ZM11 13.5C11 13.7652 10.8946 14.0196 10.7071 14.2071C10.5195 14.3946 10.2652 14.5 9.99997 14.5C9.73475 14.5 9.4804 14.3946 9.29286 14.2071C9.10533 14.0196 8.99997 13.7652 8.99997 13.5C8.99997 13.2348 9.10533 12.9804 9.29286 12.7929C9.4804 12.6053 9.73475 12.5 9.99997 12.5C10.2652 12.5 10.5195 12.6053 10.7071 12.7929C10.8946 12.9804 11 13.2348 11 13.5ZM9.99997 5.49998C9.73475 5.49998 9.4804 5.60534 9.29286 5.79287C9.10533 5.98041 8.99997 6.23476 8.99997 6.49998V9.49998C8.99997 9.7652 9.10533 10.0195 9.29286 10.2071C9.4804 10.3946 9.73475 10.5 9.99997 10.5C10.2652 10.5 10.5195 10.3946 10.7071 10.2071C10.8946 10.0195 11 9.7652 11 9.49998V6.49998C11 6.23476 10.8946 5.98041 10.7071 5.79287C10.5195 5.60534 10.2652 5.49998 9.99997 5.49998Z",fill:"#F9A825"})})}),PB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 15V15.01M12 9V11V9Z",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M5 19H19C19.3263 18.9977 19.6471 18.9156 19.9344 18.7609C20.2217 18.6061 20.4667 18.3835 20.6482 18.1123C20.8297 17.841 20.942 17.5296 20.9754 17.205C21.0089 16.8804 20.9624 16.5525 20.84 16.25L13.74 4.00002C13.567 3.68741 13.3135 3.42685 13.0058 3.2454C12.698 3.06396 12.3473 2.96826 11.99 2.96826C11.6327 2.96826 11.282 3.06396 10.9742 3.2454C10.6665 3.42685 10.413 3.68741 10.24 4.00002L3.14 16.25C3.01994 16.5456 2.97233 16.8656 3.00115 17.1833C3.02997 17.501 3.13437 17.8073 3.30565 18.0764C3.47693 18.3456 3.71011 18.5698 3.98573 18.7305C4.26134 18.8912 4.57139 18.9836 4.89 19",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),FB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"information-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 6.5C11 6.76522 10.8946 7.01957 10.7071 7.20711C10.5196 7.39464 10.2652 7.5 10 7.5C9.73478 7.5 9.48043 7.39464 9.29289 7.20711C9.10536 7.01957 9 6.76522 9 6.5C9 6.23478 9.10536 5.98043 9.29289 5.79289C9.48043 5.60536 9.73478 5.5 10 5.5C10.2652 5.5 10.5196 5.60536 10.7071 5.79289C10.8946 5.98043 11 6.23478 11 6.5ZM9 9.5C8.73478 9.5 8.48043 9.60536 8.29289 9.79289C8.10536 9.98043 8 10.2348 8 10.5C8 10.7652 8.10536 11.0196 8.29289 11.2071C8.48043 11.3946 8.73478 11.5 9 11.5V14.5C9 14.7652 9.10536 15.0196 9.29289 15.2071C9.48043 15.3946 9.73478 15.5 10 15.5H11C11.2652 15.5 11.5196 15.3946 11.7071 15.2071C11.8946 15.0196 12 14.7652 12 14.5C12 14.2348 11.8946 13.9804 11.7071 13.7929C11.5196 13.6054 11.2652 13.5 11 13.5V10.5C11 10.2348 10.8946 9.98043 10.7071 9.79289C10.5196 9.60536 10.2652 9.5 10 9.5H9Z",fill:"#0288D1"})})}),gu=e=>typeof e=="string"||typeof e=="number"||typeof e=="bigint"?cf(e):"";function NB(e,t){return{name:"minBig",message:t||`Value must be greater than or equal to ${e}`,test(n){return n=gu(n),ci(n)?$t(n).gte($t(e))?!0:this.createError({message:t||`Value must be greater than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function MB(e,t){return{name:"maxBig",message:t||`Value must be less than or equal to ${e}`,test(n){return n=gu(n),ci(n)?$t(n).lte($t(e))?!0:this.createError({message:t||`Value must be less than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function LB(e,t){return{name:"moreThanBig",message:t||`Value must be greater than ${e}`,test(n){return n=gu(n),ci(n)?$t(n).gt($t(e))?!0:this.createError({message:t||`Value must be greater than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function OB(e,t){return{name:"lessThanBig",message:t||`Value must be less than ${e}`,test(n){return n=gu(n),ci(n)?$t(n).lt($t(e))?!0:this.createError({message:t||`Value must be less than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function VB(e,t,n){return{name:"betweenBig",message:n||`Value must be between ${e} and ${t}`,test(r){if(r=gu(r),!ci(r))return this.createError({message:n||"Invalid BigNumber value"});const i=$t(r),a=$t(e),o=$t(t);return i.lt(a)||i.gt(o)?this.createError({message:n||`Value must be between ${e} and ${t}`}):!0}}}function yp(e){return HB.test(e)}const HB=/^-?[0-9]+$/;function jB(e){return WB.test(e)}const WB=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function i4(e,t){const n=Number.parseFloat(e),r=String(n),i=z1(e),a=z1(r);return!!(i===a||(t==null?void 0:t.approx)===!0&&!yp(e)&&a.length>=14&&i.startsWith(a.substring(0,14)))}let qs=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function zB(e){if(i4(e,{approx:!1}))return;if(yp(e))return qs.truncate_integer;const t=Number.parseFloat(e);return Number.isFinite(t)?t===0?qs.underflow:qs.truncate_float:qs.overflow}function z1(e){return e.replace(GB,"").replace(XB,"").replace(ZB,"").replace(UB,"")}const GB=/[eE][+-]?\d+$/,UB=/^-?(0*)?/,XB=/\./,ZB=/0+$/;class YB{constructor(t){xe(this,"isLosslessNumber",!0);if(!jB(t))throw new Error(`Invalid number (value: "${t}")`);this.value=t}valueOf(){const t=zB(this.value);if(t===void 0||t===qs.truncate_float)return Number.parseFloat(this.value);if(yp(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${t} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function KB(e){return e&&typeof e=="object"&&e.isLosslessNumber===!0||!1}function qB(e){return new YB(e)}function JB(e,t){return xp({"":e},"",e,t)}function xp(e,t,n,r){return Array.isArray(n)?r.call(e,t,e9(n,r)):n&&typeof n=="object"&&!KB(n)?r.call(e,t,QB(n,r)):r.call(e,t,n)}function QB(e,t){for(const n of Object.keys(e)){const r=xp(e,n,e[n],t);r!==void 0?e[n]=r:delete e[n]}return e}function e9(e,t){for(let n=0;n<e.length;n++)e[n]=xp(e,String(n),e[n],t);return e}function t9(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qB,r=0;const i=s();return g(i),m(),t?JB(i,t):i;function a(){if(e.charCodeAt(r)===s9){r++,u();const k={};let P=!0;for(;r<e.length&&e.charCodeAt(r)!==U1;){P?P=!1:(h(),u());const $=r,R=c();if(R===void 0){x();return}u(),f();const O=s();if(O===void 0){S();return}Object.prototype.hasOwnProperty.call(k,R)&&!W0(O,k[R])&&C(R,$+1),k[R]=O}return e.charCodeAt(r)!==U1&&E(),r++,k}}function o(){if(e.charCodeAt(r)===l9){r++,u();const k=[];let P=!0;for(;r<e.length&&e.charCodeAt(r)!==X1;){P?P=!1:h();const $=s();p($),k.push($)}return e.charCodeAt(r)!==X1&&w(),r++,k}}function s(){u();const k=c()??d()??a()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),k}function l(k,P){if(e.slice(r,r+k.length)===k)return r+=k.length,P}function u(){for(;n9(e.charCodeAt(r));)r++}function c(){if(e.charCodeAt(r)===th){r++;let k="";for(;r<e.length&&e.charCodeAt(r)!==th;){if(e.charCodeAt(r)===o9){const P=e[r+1],$=a9[P];$!==void 0?(k+=$,r++):P==="u"?Lu(e.charCodeAt(r+2))&&Lu(e.charCodeAt(r+3))&&Lu(e.charCodeAt(r+4))&&Lu(e.charCodeAt(r+5))?(k+=String.fromCharCode(Number.parseInt(e.slice(r+2,r+6),16)),r+=5):D(r):y(r)}else i9(e.charCodeAt(r))?k+=e[r]:B(e[r]);r++}return v(),r++,k}}function d(){const k=r;if(e.charCodeAt(r)===Z1&&(r++,b(k)),e.charCodeAt(r)===Cp)r++;else if(r9(e.charCodeAt(r)))for(r++;Ou(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===m9)for(r++,b(k);Ou(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===C9||e.charCodeAt(r)===x9)for(r++,(e.charCodeAt(r)===Z1||e.charCodeAt(r)===h9)&&r++,b(k);Ou(e.charCodeAt(r));)r++;if(r>k)return n(e.slice(k,r))}function h(){if(e.charCodeAt(r)!==p9)throw new SyntaxError(`Comma ',' expected after value ${F()}`);r++}function f(){if(e.charCodeAt(r)!==b9)throw new SyntaxError(`Colon ':' expected after property name ${F()}`);r++}function g(k){if(k===void 0)throw new SyntaxError(`JSON value expected ${F()}`)}function p(k){if(k===void 0)throw new SyntaxError(`Array item expected ${F()}`)}function m(){if(r<e.length)throw new SyntaxError(`Expected end of input ${F()}`)}function b(k){if(!Ou(e.charCodeAt(r))){const P=e.slice(k,r);throw new SyntaxError(`Invalid number '${P}', expecting a digit ${F()}`)}}function v(){if(e.charCodeAt(r)!==th)throw new SyntaxError(`End of string '"' expected ${F()}`)}function x(){throw new SyntaxError(`Quoted object key expected ${F()}`)}function C(k,P){throw new SyntaxError(`Duplicate key '${k}' encountered at position ${P}`)}function E(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${F()}`)}function w(){throw new SyntaxError(`Array item or end of array ']' expected ${F()}`)}function B(k){throw new SyntaxError(`Invalid character '${k}' ${A()}`)}function y(k){const P=e.slice(k,k+2);throw new SyntaxError(`Invalid escape character '${P}' ${A()}`)}function S(){throw new SyntaxError(`Object value expected after ':' ${A()}`)}function D(k){const P=e.slice(k,k+6);throw new SyntaxError(`Invalid unicode character '${P}' ${A()}`)}function A(){return`at position ${r}`}function T(){return r<e.length?`but got '${e[r]}'`:"but reached end of input"}function F(){return`${T()} ${A()}`}}function n9(e){return e===u9||e===c9||e===d9||e===f9}function Lu(e){return e>=Cp&&e<=Ep||e>=v9&&e<=E9||e>=y9&&e<=S9}function Ou(e){return e>=Cp&&e<=Ep}function r9(e){return e>=g9&&e<=Ep}function i9(e){return e>=32&&e<=1114111}function W0(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>W0(n,t[r])):G1(e)&&G1(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>W0(e[r],t[r])):!1}function G1(e){return typeof e=="object"&&e!==null}const a9={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
23
- `,r:"\r",t:" "},o9=92,s9=123,U1=125,l9=91,X1=93,u9=32,c9=10,d9=9,f9=13,th=34,h9=43,Z1=45,Cp=48,g9=49,Ep=57,p9=44,m9=46,b9=58,v9=65,y9=97,x9=69,C9=101,E9=70,S9=102;function z0(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map(z0);const t={};for(const[n,r]of Object.entries(e))typeof r=="number"||typeof r=="string"?typeof r=="number"&&!Number.isSafeInteger(r)||typeof r=="string"&&/^-?\d+(?:\.\d+)?$/.test(r)?t[n]=$t(r).toString():t[n]=r:typeof r=="object"?t[n]=z0(r):t[n]=r;return t}return e}function G0(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map(G0);if(e instanceof $t)return e.toString();const t={};for(const[n,r]of Object.entries(e))t[n]=G0(r);return t}return e}const w9=e=>t9(e,null,n=>typeof n=="number"&&!Number.isSafeInteger(n)||typeof n=="string"&&/^-?\d+(?:\.\d+)?$/.test(n)?i4(n)?parseFloat(n):$t(n).toString():n),a4={transparent:"transparent",black:"#212121",white:"#FFFFFF","primary-50":"#E3F2FD","primary-100":"#BBDEFB","primary-200":"#90CAF9","primary-300":"#64B5F6","primary-400":"#42A5F5","primary-500":"#2196F3","primary-600":"#1E88E5","primary-700":"#1976D2","primary-800":"#1565C0","primary-900":"#0D47A1","blue-gray-50":"#ECEFF1","blue-gray-100":"#CFD8DC","blue-gray-200":"#B0BEC5","blue-gray-300":"#90A4AE","blue-gray-400":"#78909C","blue-gray-500":"#607D8B","blue-gray-600":"#546E7A","blue-gray-700":"#455A64","blue-gray-800":"#37474F","blue-gray-900":"#263238","gray-50":"#FAFAFA","gray-100":"#F5F5F5","gray-200":"#EEEEEE","gray-300":"#E0E0E0","gray-400":"#BDBDBD","gray-500":"#9E9E9E","gray-600":"#757575","gray-700":"#616161","gray-800":"#424242","gray-900":"#212121","brown-50":"#EFEBE9","brown-100":"#D7CCC8","brown-200":"#BCAAA4","brown-300":"#A1887F","brown-400":"#8D6E63","brown-500":"#795548","brown-600":"#6D4C41","brown-700":"#5D4037","brown-800":"#4E342E","brown-900":"#3E2723","deep-orange-50":"#FBE9E7","deep-orange-100":"#FFCCBC","deep-orange-200":"#FFAB91","deep-orange-300":"#FF8A65","deep-orange-400":"#FF7043","deep-orange-500":"#FF5722","deep-orange-600":"#F4511E","deep-orange-700":"#E64A19","deep-orange-800":"#D84315","deep-orange-900":"#BF360C","orange-50":"#FFF3E0","orange-100":"#FFE0B2","orange-200":"#FFCC80","orange-300":"#FFB74D","orange-400":"#FFA726","orange-500":"#FF9800","orange-600":"#FB8C00","orange-700":"#F57C00","orange-800":"#EF6C00","orange-900":"#E65100","amber-50":"#FFF8E1","amber-100":"#FFECB3","amber-200":"#FFE082","amber-300":"#FFD54F","amber-400":"#FFCA28","amber-500":"#FFC107","amber-600":"#FFB300","amber-700":"#FFA000","amber-800":"#FF8F00","amber-900":"#FF6F00","yellow-50":"#FFFDE7","yellow-100":"#FFF9C4","yellow-200":"#FFF59D","yellow-300":"#FFF176","yellow-400":"#FFEE58","yellow-500":"#FFEB3B","yellow-600":"#FDD835","yellow-700":"#FBC02D","yellow-800":"#F9A825","yellow-900":"#F57F17","lime-50":"#F9FBE7","lime-100":"#F0F4C3","lime-200":"#E6EE9C","lime-300":"#DCE775","lime-400":"#D4E157","lime-500":"#CDDC39","lime-600":"#C0CA33","lime-700":"#AFB42B","lime-800":"#9E9D24","lime-900":"#827717","light-green-50":"#F1F8E9","light-green-100":"#DCEDC8","light-green-200":"#C5E1A5","light-green-300":"#AED581","light-green-400":"#9CCC65","light-green-500":"#8BC34A","light-green-600":"#7CB342","light-green-700":"#689F38","light-green-800":"#558B2F","light-green-900":"#33691E","green-50":"#E8F5E9","green-100":"#C8E6C9","green-200":"#A5D6A7","green-300":"#81C784","green-400":"#66BB6A","green-500":"#4CAF50","green-600":"#43A047","green-700":"#388E3C","green-800":"#2E7D32","green-900":"#1B5E20","teal-50":"#E0F2F1","teal-100":"#B2DFDB","teal-200":"#80CBC4","teal-300":"#4DB6AC","teal-400":"#26A69A","teal-500":"#009688","teal-600":"#00897B","teal-700":"#00796B","teal-800":"#00695C","teal-900":"#004D40","cyan-50":"#E0F7FA","cyan-100":"#B2EBF2","cyan-200":"#80DEEA","cyan-300":"#4DD0E1","cyan-400":"#26C6DA","cyan-500":"#00BCD4","cyan-600":"#00ACC1","cyan-700":"#0097A7","cyan-800":"#00838F","cyan-900":"#006064","light-blue-50":"#E1F5FE","light-blue-100":"#B3E5FC","light-blue-200":"#81D4FA","light-blue-300":"#4FC3F7","light-blue-400":"#29B6F6","light-blue-500":"#03A9F4","light-blue-600":"#039BE5","light-blue-700":"#0288D1","light-blue-800":"#0277BD","light-blue-900":"#01579B","blue-50":"#E3F2FD","blue-100":"#BBDEFB","blue-200":"#90CAF9","blue-300":"#64B5F6","blue-400":"#42A5F5","blue-500":"#2196F3","blue-600":"#1E88E5","blue-700":"#1976D2","blue-800":"#1565C0","blue-900":"#0D47A1","indigo-50":"#E8EAF6","indigo-100":"#C5CAE9","indigo-200":"#9FA8DA","indigo-300":"#7986CB","indigo-400":"#5C6BC0","indigo-500":"#3F51B5","indigo-600":"#3949AB","indigo-700":"#303F9F","indigo-800":"#283593","indigo-900":"#1A237E","deep-purple-50":"#EDE7F6","deep-purple-100":"#D1C4E9","deep-purple-200":"#B39DDB","deep-purple-300":"#9575CD","deep-purple-400":"#7E57C2","deep-purple-500":"#673AB7","deep-purple-600":"#5E35B1","deep-purple-700":"#512DA8","deep-purple-800":"#4527A0","deep-purple-900":"#311B92","purple-50":"#F3E5F5","purple-100":"#E1BEE7","purple-200":"#CE93D8","purple-300":"#BA68C8","purple-400":"#AB47BC","purple-500":"#9C27B0","purple-600":"#8E24AA","purple-700":"#7B1FA2","purple-800":"#6A1B9A","purple-900":"#4A148C","pink-50":"#FCE4EC","pink-100":"#F8BBD0","pink-200":"#F48FB1","pink-300":"#F06292","pink-400":"#EC407A","pink-500":"#E91E63","pink-600":"#D81B60","pink-700":"#C2185B","pink-800":"#AD1457","pink-900":"#880E4F","red-50":"#FFEBEE","red-100":"#FFCDD2","red-200":"#EF9A9A","red-300":"#E57373","red-400":"#EF5350","red-500":"#F44336","red-600":"#E53935","red-700":"#D32F2F","red-800":"#C62828","red-900":"#B71C1C","payhere-brand-base":"#102A4D","payhere-brand-10":"#CFD4DB","payhere-brand-20":"#AFB8C4","payhere-brand-30":"#8794A6","payhere-brand-40":"#607188","payhere-brand-50":"#384E6B","payhere-brand-60":"#0D2340","laba-black":"#212529","laba-white":"#FFFFFF","laba-blue-10":"#0163C8","laba-blue-08":"#006DFF","laba-blue-06":"#2899FF","laba-blue-05":"#73A4D6","laba-blue-02":"#DBECFF","laba-blue-01":"#F0F7FF","laba-green-10":"#038C67","laba-green-08":"#04BA27","laba-green-06":"#78D798","laba-green-05":"#ABF3CC","laba-green-02":"#CAEEE5","laba-green-01":"#DFF6F6","laba-grey-10":"#898989","laba-grey-08":"#AEAEAE","laba-grey-06":"#D6D6D6","laba-grey-05":"#EEEEEE","laba-grey-02":"#F2F2F2","laba-grey-01":"#FDFDFD","laba-orange-10":"#C05000","laba-orange-08":"#FF7200","laba-orange-06":"#FF9300","laba-orange-05":"#FFBD78","laba-orange-02":"#FFDDBB","laba-orange-01":"#FFF5EB","laba-red-10":"#9E101F","laba-red-08":"#ED0019","laba-red-06":"#FB004E","laba-red-05":"#FF5378","laba-red-02":"#FFAEBF","laba-red-01":"#FFEBEF","lpd-primary-50":"#CEDBFE","lpd-primary-100":"#B6CAFE","lpd-primary-200":"#9DB8FE","lpd-primary-300":"#6C94FD","lpd-primary-400":"#3B71FD","lpd-primary-500":"#0A4DFC","lpd-primary-600":"#083ECA","lpd-primary-700":"#062E97","lpd-primary-800":"#041F65","lpd-primary-900":"#03174C","lpd-secondary-50":"#FEF5CE","lpd-secondary-100":"#FEEFB5","lpd-secondary-200":"#FDEA9D","lpd-secondary-300":"#FDE06B","lpd-secondary-400":"#FCD53A","lpd-secondary-500":"#FBCB09","lpd-secondary-600":"#C9A207","lpd-secondary-700":"#977A05","lpd-secondary-800":"#645104","lpd-secondary-900":"#4B3D03","bill-primary-50":"#EAF0FE","bill-primary-100":"#D5E1FD","bill-primary-200":"#ABC3FB","bill-primary-300":"#81A4F9","bill-primary-400":"#5786F7","bill-primary-500":"#2D68F5","bill-primary-600":"#2453C4","bill-primary-700":"#1B3E93","bill-primary-800":"#122A62","bill-primary-900":"#091531","bill-secondary-50":"#F0FEFD","bill-secondary-100":"#E2FCFA","bill-secondary-200":"#C5F9F5","bill-secondary-300":"#A8F7F1","bill-secondary-400":"#8BF4EC","bill-secondary-500":"#6EF1E7","bill-secondary-600":"#59CBC2","bill-secondary-700":"#44A59D","bill-secondary-800":"#2F7E79","bill-secondary-900":"#1A5854"},o4={"payhere-h1":["60px",{lineHeight:"72px",fontWeight:700}],"payhere-h2":["48px",{lineHeight:"58px",fontWeight:700}],"payhere-h3":["40px",{lineHeight:"48px",fontWeight:700}],"payhere-h4":["30px",{lineHeight:"38px",fontWeight:700}],"payhere-h5":["28px",{lineHeight:"40px",fontWeight:600}],"payhere-h6":["24px",{lineHeight:"30px",fontWeight:600}],"payhere-body-lr":["18px",{lineHeight:"26px",fontWeight:400}],"payhere-body-lm":["18px",{lineHeight:"26px",fontWeight:500}],"payhere-body-ls":["18px",{lineHeight:"26px",fontWeight:600}],"payhere-body-lb":["18px",{lineHeight:"26px",fontWeight:700}],"payhere-body-mr":["16px",{lineHeight:"24px",fontWeight:400}],"payhere-body-mm":["16px",{lineHeight:"24px",fontWeight:500}],"payhere-body-ms":["16px",{lineHeight:"24px",fontWeight:600}],"payhere-body-mb":["16px",{lineHeight:"24px",fontWeight:700}],"payhere-label-r":["15px",{lineHeight:"26px",fontWeight:400}],"payhere-label-m":["15px",{lineHeight:"26px",fontWeight:500}],"payhere-label-sb":["15px",{lineHeight:"26px",fontWeight:600}],"payhere-label-b":["15px",{lineHeight:"26px",fontWeight:700}],"payhere-body-sr":["14px",{lineHeight:"22px",fontWeight:400}],"payhere-body-sm":["14px",{lineHeight:"22px",fontWeight:500}],"payhere-body-smb":["14px",{lineHeight:"22px",fontWeight:600}],"payhere-body-sb":["14px",{lineHeight:"22px",fontWeight:700}],"payhere-body-esr":["12px",{lineHeight:"20px",fontWeight:400}],"payhere-body-esm":["12px",{lineHeight:"20px",fontWeight:500}],"payhere-body-esmb":["12px",{lineHeight:"20px",fontWeight:600}],"payhere-body-esb":["12px",{lineHeight:"20px",fontWeight:700}]},s4={"laba-title-lb":["36px",{lineHeight:"44px",fontWeight:700}],"laba-title-ls":["36px",{lineHeight:"44px",fontWeight:600}],"laba-title-lr":["36px",{lineHeight:"44px",fontWeight:400}],"laba-title-mb":["32px",{lineHeight:"40px",fontWeight:700}],"laba-title-ms":["32px",{lineHeight:"40px",fontWeight:600}],"laba-title-mr":["32px",{lineHeight:"40px",fontWeight:400}],"laba-h1":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-b":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-sb":["24px",{lineHeight:"30px",fontWeight:600}],"laba-h1-r":["24px",{lineHeight:"30px",fontWeight:400}],"laba-h2":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-b":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-sb":["18px",{lineHeight:"26px",fontWeight:600}],"laba-h2-r":["18px",{lineHeight:"26px",fontWeight:400}],"laba-base-rb":["16px",{lineHeight:"24px",fontWeight:700}],"laba-base-rs":["16px",{lineHeight:"24px",fontWeight:600}],"laba-base-rr":["16px",{lineHeight:"24px",fontWeight:400}],"laba-base-sb":["14px",{lineHeight:"20px",fontWeight:700}],"laba-base-ss":["14px",{lineHeight:"20px",fontWeight:600}],"laba-base-sr":["14px",{lineHeight:"20px",fontWeight:400}],"laba-subtitle-rb":["12px",{lineHeight:"16px",fontWeight:700}],"laba-subtitle-rs":["12px",{lineHeight:"16px",fontWeight:600}],"laba-subtitle-rr":["12px",{lineHeight:"16px",fontWeight:400}],"laba-subtitle-sb":["10px",{lineHeight:"12px",fontWeight:700}],"laba-subtitle-ss":["10px",{lineHeight:"12px",fontWeight:600}],"laba-subtitle-sr":["10px",{lineHeight:"12px",fontWeight:400}]},I9={"bill-h1":["60px",{lineHeight:"72px",fontWeight:700}],"bill-h2":["48px",{lineHeight:"58px",fontWeight:700}],"bill-h3":["40px",{lineHeight:"58px",fontWeight:700}],"bill-h4":["30px",{lineHeight:"38px",fontWeight:700}],"bill-h5":["28px",{lineHeight:"40px",fontWeight:600}],"bill-h6":["24px",{lineHeight:"30px",fontWeight:600}],"bill-body-lr":["18px",{lineHeight:"26px",fontWeight:400}],"bill-body-lm":["18px",{lineHeight:"26px",fontWeight:500}],"bill-body-lsm":["18px",{lineHeight:"26px",fontWeight:600}],"bill-body-blb":["18px",{lineHeight:"26px",fontWeight:700}],"bill-body-mr":["16px",{lineHeight:"24px",fontWeight:400}],"bill-body-mm":["16px",{lineHeight:"24px",fontWeight:500}],"bill-body-msm":["16px",{lineHeight:"24px",fontWeight:600}],"bill-body-mb":["16px",{lineHeight:"24px",fontWeight:700}],"bill-label-r":["15px",{lineHeight:"26px",fontWeight:400}],"bill-label-m":["15px",{lineHeight:"26px",fontWeight:500}],"bill-label-sm":["15px",{lineHeight:"26px",fontWeight:600}],"bill-label-b":["15px",{lineHeight:"26px",fontWeight:700}],"bill-body-sr":["14px",{lineHeight:"22px",fontWeight:400}],"bill-body-sm":["14px",{lineHeight:"22px",fontWeight:500}],"bill-body-ssm":["14px",{lineHeight:"22px",fontWeight:600}],"bill-body-sb":["14px",{lineHeight:"22px",fontWeight:700}],"bill-body-esr":["12px",{lineHeight:"20px",fontWeight:400}],"bill-body-ems":["12px",{lineHeight:"20px",fontWeight:500}],"bill-body-essm":["12px",{lineHeight:"20px",fontWeight:600}],"bill-body-esb":["12px",{lineHeight:"20px",fontWeight:700}]},_9={...o4,...s4,...I9},D9={"sm-default":"640px",sm:"576px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},U0={"sm-default":640,sm:576,md:768,lg:1024,xl:1280,"2xl":1536},A9=()=>_.jsx("div",{className:"1ru-w-full 1ru-bg-red-900",children:"index"}),T9="_loading_e63gb_482",Re={"button-l":"_button-l_e63gb_67","button-m":"_button-m_e63gb_67","button-s":"_button-s_e63gb_115","button-xs":"_button-xs_e63gb_115","button-large":"_button-large_e63gb_241","button-reguler":"_button-reguler_e63gb_241","button-small":"_button-small_e63gb_259","button-extra-small":"_button-extra-small_e63gb_259","button-bill-l":"_button-bill-l_e63gb_379","button-bill-m":"_button-bill-m_e63gb_379","button-bill-s":"_button-bill-s_e63gb_427","button-bill-xs":"_button-bill-xs_e63gb_427","button-bill-xxs":"_button-bill-xxs_e63gb_427",loading:T9,"filled-bill-secondary-800_bg-white":"_filled-bill-secondary-800_bg-white_e63gb_497","filled-bill-blue-gray-500_bg-blue-gray-50":"_filled-bill-blue-gray-500_bg-blue-gray-50_e63gb_497","nude-laba-red-05":"_nude-laba-red-05_e63gb_497","nude-laba-red-08":"_nude-laba-red-08_e63gb_497","nude-laba-red-10":"_nude-laba-red-10_e63gb_497","nude-gray-500":"_nude-gray-500_e63gb_497","nude-green-700":"_nude-green-700_e63gb_497","nude-red-700":"_nude-red-700_e63gb_497","nude-laba-blue-10":"_nude-laba-blue-10_e63gb_497","ghost-blue-gray-100-bg_white-text_blue-gray-400":"_ghost-blue-gray-100-bg_white-text_blue-gray-400_e63gb_497","ghost-blue-gray-100-bg_white":"_ghost-blue-gray-100-bg_white_e63gb_497","ghost-laba-green-10":"_ghost-laba-green-10_e63gb_497","ghost-laba-blue-01":"_ghost-laba-blue-01_e63gb_497","ghost-laba-blue-05":"_ghost-laba-blue-05_e63gb_497","ghost-green-700":"_ghost-green-700_e63gb_497","ghost-red-700":"_ghost-red-700_e63gb_497","ghost-laba-blue-10":"_ghost-laba-blue-10_e63gb_497","filled-laba-white_laba-red-05":"_filled-laba-white_laba-red-05_e63gb_497","filled-laba-white_laba-blue-10":"_filled-laba-white_laba-blue-10_e63gb_497","primary-green-700-dsb_laba-grey-06":"_primary-green-700-dsb_laba-grey-06_e63gb_497","primary-red-700-dsb_laba-grey-06":"_primary-red-700-dsb_laba-grey-06_e63gb_497","primary-laba-blue-10":"_primary-laba-blue-10_e63gb_497","primary-bill-red-700":"_primary-bill-red-700_e63gb_497","tertiary-bill-secondary-800":"_tertiary-bill-secondary-800_e63gb_497","secondary-bill-secondary-800":"_secondary-bill-secondary-800_e63gb_497","primary-bill-primary-600":"_primary-bill-primary-600_e63gb_497","tertiary-black":"_tertiary-black_e63gb_497","tertiary-gray-500":"_tertiary-gray-500_e63gb_497","tertiary-red-600":"_tertiary-red-600_e63gb_497","tertiary-red-300":"_tertiary-red-300_e63gb_497","tertiary-blue-700":"_tertiary-blue-700_e63gb_497","secondary-green-600":"_secondary-green-600_e63gb_497","secondary-red-700":"_secondary-red-700_e63gb_497","secondary-red-600":"_secondary-red-600_e63gb_497","secondary-blue-700":"_secondary-blue-700_e63gb_497","primary-red-700":"_primary-red-700_e63gb_497","primary-blue-700":"_primary-blue-700_e63gb_497","icon-loading":"_icon-loading_e63gb_647"},nh={size:{large:Re["button-large"],reguler:Re["button-reguler"],small:Re["button-small"],"extra-small":Re["button-extra-small"],l:Re["button-l"],m:Re["button-m"],s:Re["button-s"],xs:Re["button-xs"],"bill-l":Re["button-bill-l"],"bill-m":Re["button-bill-m"],"bill-s":Re["button-bill-s"],"bill-xs":Re["button-bill-xs"],"bill-xxs":Re["button-bill-xxs"]},loadingSize:{large:"1ru-size-6",reguler:"1ru-size-5",small:"1ru-size-5","extra-small":"1ru-size-5",l:"1ru-size-6",m:"1ru-size-5",s:"1ru-size-5",xs:"1ru-size-5","bill-l":"1ru-size-6","bill-m":"1ru-size-5","bill-s":"1ru-size-5","bill-xs":"1ru-size-5","bill-xxs":"1ru-size-5"},variants:{"primary-laba-blue-10":Re["primary-laba-blue-10"],"primary-red-700-dsb_laba-grey-06":Re["primary-red-700-dsb_laba-grey-06"],"primary-green-700-dsb_laba-grey-06":Re["primary-green-700-dsb_laba-grey-06"],"ghost-laba-blue-10":Re["ghost-laba-blue-10"],"ghost-red-700":Re["ghost-red-700"],"ghost-green-700":Re["ghost-green-700"],"ghost-laba-green-10":Re["ghost-laba-green-10"],"nude-laba-blue-10":Re["nude-laba-blue-10"],"nude-red-700":Re["nude-red-700"],"nude-green-700":Re["nude-green-700"],"nude-gray-500":Re["nude-gray-500"],"primary-blue-700":Re["primary-blue-700"],"secondary-blue-700":Re["secondary-blue-700"],"tertiary-blue-700":Re["tertiary-blue-700"],"ghost-blue-gray-100-bg_white":Re["ghost-blue-gray-100-bg_white"],"ghost-blue-gray-100-bg_white-text_blue-gray-400":Re["ghost-blue-gray-100-bg_white-text_blue-gray-400"],"ghost-laba-blue-05":Re["ghost-laba-blue-05"],"secondary-red-600":Re["secondary-red-600"],"tertiary-red-300":Re["tertiary-red-300"],"tertiary-gray-500":Re["tertiary-gray-500"],"tertiary-red-600":Re["tertiary-red-600"],"tertiary-black":Re["tertiary-black"],"secondary-green-600":Re["secondary-green-600"],"nude-laba-red-10":Re["nude-laba-red-10"],"nude-laba-red-05":Re["nude-laba-red-05"],"primary-red-700":Re["primary-red-700"],"nude-laba-red-08":Re["nude-laba-red-08"],"ghost-laba-blue-01":Re["ghost-laba-blue-01"],"filled-laba-white_laba-blue-10":Re["filled-laba-white_laba-blue-10"],"filled-laba-white_laba-red-05":Re["filled-laba-white_laba-red-05"],"secondary-red-700":Re["secondary-red-700"],"primary-bill-primary-600":Re["primary-bill-primary-600"],"secondary-bill-secondary-800":Re["secondary-bill-secondary-800"],"tertiary-bill-secondary-800":Re["tertiary-bill-secondary-800"],"primary-bill-red-700":Re["primary-bill-red-700"],"filled-bill-blue-gray-500_bg-blue-gray-50":Re["filled-bill-blue-gray-500_bg-blue-gray-50"],"filled-bill-secondary-800_bg-white":Re["filled-bill-secondary-800_bg-white"]}},R9=({className:e=""})=>_.jsx("svg",{className:`${Re["icon-loading"]} ${e??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:_.jsx("path",{d:`M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063 \r
22
+ `,a};uf.publicKeyToOpenSSH=function(e,t){var n="ssh-rsa";t=t||"";var r=Wt.util.createBuffer();return Ko(r,n),Kr(r,e.e),Kr(r,e.n),n+" "+Wt.util.encode64(r.bytes())+" "+t};uf.privateKeyToOpenSSH=function(e,t){return t?Wt.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Wt.pki.privateKeyToPem(e)};uf.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Wt.md.md5.create(),r="ssh-rsa",i=Wt.util.createBuffer();Ko(i,r),Kr(i,e.e),Kr(i,e.n),n.start(),n.update(i.getBytes());var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};function Kr(e,t){var n=t.toString(16);n[0]>="8"&&(n="00"+n);var r=Wt.util.hexToBytes(n);e.putInt32(r.length),e.putBytes(r)}function Ko(e,t){e.putInt32(t.length),e.putString(t)}function Pu(){for(var e=Wt.md.sha1.create(),t=arguments.length,n=0;n<t;++n)e.update(arguments[n]);return e.digest()}var KR=ze;const Pa=o6(KR),ci=e=>{try{return At(e).isFinite()}catch{return!1}},KC=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const t=Number(e);return Number.isFinite(t)}return!1};function cf(e,t){const{minimumFractionDigits:n,instance:r=!1,ignoreFractionLimit:i=!1}=t||{};let{maximumFractionDigits:a=2}=t||{};ci(e)||(e="0"),!i&&n!==void 0&&n>a&&(a=n);let o="";if(i?o=At(e).toString():o=At(e).toFixed(a),o.includes(".")&&!i){const[s,l]=o.split(".");let u=l.replace(/0+$/,"");n!==void 0&&n>=0&&(u=u.padEnd(n,"0")),o=u?`${s}.${u}`:s}return r?At(o):o}const pp=(e,t=2)=>{let n=parseFloat(KC(e)?e:0);return n=(+(Math.round(n+"e"+t)+"e-"+t)).toFixed(t),n=Number(n),n};function Ji(e,t="currency",n){const{minimumFractionDigits:r=0,locale:i="id-ID",currency:a="IDR",withSpace:o=!1}=n||{},s=new Intl.NumberFormat(i,{style:t,currency:a,minimumFractionDigits:r}).format(pp(e,r>0?r:2));return o?s:s.replace(/\s/g,"")}const qo=(e,t,n,r)=>{const i={"id-ID":Yc,"zh-CN":rC,"en-US":Yg,"nl-BE":nC};let a=n??"-";return e&&!isNaN(new Date(e).getTime())&&(a=wl(e,t??"dd/MM/yyyy",{locale:i[r??"id-ID"]})),a},qR=(e,t,n,r,i,a)=>{const o={"id-ID":Yc,"zh-CN":rC,"en-US":Yg,"nl-NL":nC};if(e&&!isNaN(new Date(e).getTime())){const s=wl(e,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});if(t&&!isNaN(new Date(t).getTime())){const l=wl(t,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});return s===l?s:`${s}${r??"-"}${l}`}return s}return i??"-"},qC=(e,t)=>e.reduce((n,r)=>{const i=String(r[t]);return n[i]||(n[i]=[]),n[i].push(r),n},{}),JR=({value:e,keyDate:t="date",keyFormat:n="formatDate",format:r="dd/MM/yyyy"})=>{const i=e.map(a=>({...a,[n]:qo(a[t],r)}));return qC(i,n)},QR=e=>(Object.keys(e).forEach(t=>{["",null,void 0,[],{}].includes(e[t])&&delete e[t]}),e),eB=(e,t)=>{var h,f;const n=/^-?\d+[0-9.,]*$/,r=/([.])(?=.*\1)/,i=/([,])(?=.*\1)/,a=((h=e.split(",")[0])==null?void 0:h.trim())||"",o=((f=e.split(",")[1])==null?void 0:f.trim())||"",s=!r.test(a)&&(a==="-"||n.test(a)||!a),l=!r.test(o)&&(o==="-"||n.test(o)||!o),u=(g,p,m)=>{let b=g;const v=g.split(".")[0];return isNaN(parseFloat(v.split(".")[0]))||(parseFloat(v.split(".")[0])<=p?b=`${p}`:parseFloat(v)>=m&&(b=`${m}`)),b},c=u(a,(t==null?void 0:t.latMin)??-85,(t==null?void 0:t.latMax)??85),d=u(o,(t==null?void 0:t.longMin)??-180,(t==null?void 0:t.longMax)??180);return{latitude:c,longitude:d,latlong:`${c}${e.includes(",")?","+d:""}`,isValid:!i.test(e)&&s&&l}},H1=(e,t)=>e?Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith(e))):t,mp=(e,t)=>e.map(n=>n[t]).join(","),bp=(e,t)=>e.map(n=>n[t]),tB=(e,t)=>Array.isArray(e)?e==null?void 0:e.map((n,r,i)=>typeof t=="function"?t(n,r,i):n):[],nB=(e,t,n,r,i)=>Array.isArray(e)?{[t]:e==null?void 0:e.map((a,o,s)=>typeof n=="function"?n(a,o,s):a),[`${t}-val-be`]:a=>r==="array-of-object-to-array"?bp(a,i):mp(a,i)}:{[t]:"",[`${t}-val-be`]:()=>""};function vp(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||!vp(e[i],t[i]))return!1;return!0}function rB(e,t={maxTime:"hour"}){const{maxTime:n="hour"}=t,r=l=>l<10?`0${l}`:l;let i=r(0),a=r(0);const o=r(Math.floor(e%3600/60)),s=r(Math.floor(e%60));return n==="hour"?a=r(Math.floor(e/3600)):n==="day"&&(i=r(Math.floor(e/(3600*24))),a=r(Math.floor(e%(3600*24)/3600))),{day:i,hour:a,minute:o,second:s}}function fl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function _l(e,...t){if(!t.length)return e;const n=t.shift();if(fl(e)&&fl(n))for(const r in n)fl(n[r])?(e[r]||Object.assign(e,{[r]:{}}),_l(e[r],n[r])):Object.assign(e,{[r]:n[r]});return _l(e,...t)}function od(e,t){const n=t.match(/[^.[\]]+/g);if(!n||n.length===0)return;const r=(i,a)=>{if(typeof i!="object"||i===null||a.length===0)return;const o=i,s=a[0],l=a.slice(1);if(l.length===0){delete o[s];return}const u=o[s];if(s==="*"&&Array.isArray(o)){for(const c of o)r(c,l);return}r(u,l)};r(e,n)}function iB(e,t){if(!e||!t)return e;if(Array.isArray(t))for(const n of t)od(e,n);else od(e,t);return e}function JC(e,t){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(t))for(const r of t)od(n,r);else od(n,t);return n}function aB(e,t,n={}){const r=n.arrayMergeStrategy||"combine",i=(n.keepKeys||[]).map(s=>s.match(/[^.[\]]+/g)||[]),a=s=>i.some(l=>l.length!==s.length?!1:l.every((u,c)=>u===s[c]));function o(s,l,u){if(u.length>0&&a(u))return s;if(Array.isArray(l)&&Array.isArray(s)){if(r==="overwrite")return[...l];const c=r==="sync"?l.length:Math.max(s.length,l.length),d=new Array(c);for(let h=0;h<c;h++){const f=[...u,String(h)],g=s[h],p=l[h];if(h>=l.length){d[h]=g;continue}if(h>=s.length){d[h]=p;continue}d[h]=o(g,p,f)}return d}if(fl(l)&&fl(s)){const c={...s};return Object.keys(l).forEach(d=>{const h=[...u,d],f=l[d],g=s[d];c[d]=o(g,f,h)}),c}return l===void 0?s:l}return o(e,t,[])}const oB=e=>pp(e||0),sB=e=>cf(e||0),lB=e=>isNaN(e)?void 0:e,df=e=>{const t=e.toString().split(""),n=t[1]!=="0"?`,${t[1]}`:"";let[r]=e.toString().split(".");return r=r.replaceAll("-",""),r.length>=15?`${+r.substring(0,3)} T`:r.length===14?`${+r.substring(0,2)} T`:r.length===13?`${+r.substring(0,1)}${n} T`:r.length===12?`${+r.substring(0,3)} M`:r.length===11?`${+r.substring(0,2)} M`:r.length===10?`${+r.substring(0,1)}${n} M`:r.length===9?`${+r.substring(0,3)} JT`:r.length===8?`${+r.substring(0,2)} JT`:r.length===7?`${+r.substring(0,1)}${n} JT`:r.length===6?`${+r.substring(0,3)} RB`:r.length===5?`${+r.substring(0,2)} RB`:r.length===4?`${+r.substring(0,1)}${n} RB`:r.length<=3?+r?`${+r}`:0:null};function O0(e){if(typeof e!="string")throw new Error("Input harus berupa string");const t=e.split(".");if(t.length===1)return{filename:e,extension:""};const n="."+t[t.length-1];return{filename:t.slice(0,-1).join("."),extension:n}}const uB=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function cB(e,t){const n=typeof e=="string"?e:JSON.stringify(e),r=Pa.util.decode64(t.replace(/\s+/g,"")),i=Pa.util.decode64(r),a=Pa.asn1.fromDer(i),s=Pa.pki.publicKeyFromAsn1(a).encrypt(n,"RSA-OAEP",{md:Pa.md.sha256.create(),mgf1:{md:Pa.md.sha1.create()}});return Pa.util.encode64(s)}function dB(e,t={}){const{locale:n,currency:r,minimumFractionDigits:i,withSpace:a,currencyDisplay:o,ignoreFractionLimit:s=!1}=t;let{maximumFractionDigits:l=2}=t;!s&&i!==void 0&&i>l&&(l=i);const u=cf(e,{maximumFractionDigits:l,ignoreFractionLimit:s}),[c,d=""]=u.split("."),h=c.replace(/\B(?=(\d{3})+(?!\d))/g,".");let f="";s?f=d:f=d.slice(0,l),s||(i===void 0?f=f.replace(/0+$/,""):f&&i>0&&(f=f.padEnd(i,"0")));let g=f?`${h},${f}`:h;if(!n||!r)return g;const m={"id-ID":{symbol:"Rp",code:"IDR",name:"Rupiah",negativePosition:"start"},"en-US":{symbol:"$",code:"USD",name:"US Dollar",negativePosition:"middle"},"ja-JP":{symbol:"¥",code:"JPY",name:"Yen",negativePosition:"middle"}}[n]||{symbol:"",code:r,name:r},b={symbol:m.symbol,code:m.code,name:m.name}[o||"symbol"],v=g.includes("-");return g=m.negativePosition==="start"?g.replace("-",""):g,a?`${m.negativePosition==="start"&&v?"-":""}${b} ${g}`:`${m.negativePosition==="start"&&v?"-":""}${b}${g}`}function fB(e){if(!ci(e))return"0";const t=typeof e=="number"?At(e).toString():e;if(!t.includes("."))return t;const[n,r]=t.split("."),i=r.replace(/0+$/,"");return i?`${n}.${i}`:n}/*! js-cookie v3.0.5 | MIT */function Fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var hB={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function V0(e,t){function n(i,a,o){if(!(typeof document>"u")){o=Fu({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},s=0;s<a.length;s++){var l=a[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),i===c)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,a){n(i,"",Fu({},a,{expires:-1}))},withAttributes:function(i){return V0(this.converter,Fu({},this.attributes,i))},withConverter:function(i){return V0(Fu({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Or=V0(hB,{path:"/"});const gB={setItem(e,t,n={},r=3e3){const a={...{path:"/",expires:365},...n};parseInt(Or.get(`${e}_count`)??"0",10)&&this.removeItem(e,n);const s=Math.ceil(t.length/r);for(let l=0;l<s;l++){const u=t.slice(l*r,(l+1)*r);Or.set(`${e}_${l}`,u,a)}Or.set(`${e}_count`,s.toString(),a)},getItem(e){const t=parseInt(Or.get(`${e}_count`)??"0",10);if(!t)return null;let n="";for(let r=0;r<t;r++){const i=Or.get(`${e}_${r}`);if(!i)return null;n+=i}return n},removeItem(e,t={}){const n=parseInt(Or.get(`${e}_count`)??"0",10),r={path:"/",...t};if(!isNaN(n)){for(let i=0;i<n;i++)Or.remove(`${e}_${i}`,r);Or.remove(`${e}_count`,r)}},clear(e={}){const t={path:"/",...e},n=Or.get();Object.keys(n).forEach(r=>Or.remove(r,t))}};function QC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=QC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ki(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=QC(e))&&(r&&(r+=" "),r+=t);return r}const Dl=e=>typeof e=="number"&&!isNaN(e),oo=e=>typeof e=="string",Qn=e=>typeof e=="function",Ac=e=>oo(e)||Qn(e)?e:null,H0=e=>I.isValidElement(e)||oo(e)||Qn(e)||Dl(e);function pB(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function ff(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:a=300}=e;return function(o){let{children:s,position:l,preventExitTransition:u,done:c,nodeRef:d,isIn:h,playToast:f}=o;const g=r?`${t}--${l}`:t,p=r?`${n}--${l}`:n,m=I.useRef(0);return I.useLayoutEffect(()=>{const b=d.current,v=g.split(" "),x=C=>{C.target===d.current&&(f(),b.removeEventListener("animationend",x),b.removeEventListener("animationcancel",x),m.current===0&&C.type!=="animationcancel"&&b.classList.remove(...v))};b.classList.add(...v),b.addEventListener("animationend",x),b.addEventListener("animationcancel",x)},[]),I.useEffect(()=>{const b=d.current,v=()=>{b.removeEventListener("animationend",v),i?pB(b,c,a):c()};h||(u?v():(m.current=1,b.className+=` ${p}`,b.addEventListener("animationend",v)))},[h]),I.createElement(I.Fragment,null,s)}}function j1(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Tn=new Map;let Al=[];const j0=new Set,mB=e=>j0.forEach(t=>t(e)),e4=()=>Tn.size>0;function t4(e,t){var n;if(t)return!((n=Tn.get(t))==null||!n.isToastActive(e));let r=!1;return Tn.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function n4(e,t){H0(e)&&(e4()||Al.push({content:e,options:t}),Tn.forEach(n=>{n.buildToast(e,t)}))}function W1(e,t){Tn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function bB(e){const{subscribe:t,getSnapshot:n,setProps:r}=I.useRef(function(a){const o=a.containerId||1;return{subscribe(s){const l=function(c,d,h){let f=1,g=0,p=[],m=[],b=[],v=d;const x=new Map,C=new Set,E=()=>{b=Array.from(x.values()),C.forEach(y=>y())},w=y=>{m=y==null?[]:m.filter(S=>S!==y),E()},B=y=>{const{toastId:S,onOpen:D,updateId:A,children:T}=y.props,F=A==null;y.staleId&&x.delete(y.staleId),x.set(S,y),m=[...m,y.props.toastId].filter(k=>k!==y.staleId),E(),h(j1(y,F?"added":"updated")),F&&Qn(D)&&D(I.isValidElement(T)&&T.props)};return{id:c,props:v,observe:y=>(C.add(y),()=>C.delete(y)),toggle:(y,S)=>{x.forEach(D=>{S!=null&&S!==D.props.toastId||Qn(D.toggle)&&D.toggle(y)})},removeToast:w,toasts:x,clearQueue:()=>{g-=p.length,p=[]},buildToast:(y,S)=>{if((U=>{let{containerId:K,toastId:ee,updateId:z}=U;const H=K?K!==c:c!==1,X=x.has(ee)&&z==null;return H||X})(S))return;const{toastId:D,updateId:A,data:T,staleId:F,delay:k}=S,P=()=>{w(D)},$=A==null;$&&g++;const R={...v,style:v.toastStyle,key:f++,...Object.fromEntries(Object.entries(S).filter(U=>{let[K,ee]=U;return ee!=null})),toastId:D,updateId:A,data:T,closeToast:P,isIn:!1,className:Ac(S.className||v.toastClassName),bodyClassName:Ac(S.bodyClassName||v.bodyClassName),progressClassName:Ac(S.progressClassName||v.progressClassName),autoClose:!S.isLoading&&(O=S.autoClose,j=v.autoClose,O===!1||Dl(O)&&O>0?O:j),deleteToast(){const U=x.get(D),{onClose:K,children:ee}=U.props;Qn(K)&&K(I.isValidElement(ee)&&ee.props),h(j1(U,"removed")),x.delete(D),g--,g<0&&(g=0),p.length>0?B(p.shift()):E()}};var O,j;R.closeButton=v.closeButton,S.closeButton===!1||H0(S.closeButton)?R.closeButton=S.closeButton:S.closeButton===!0&&(R.closeButton=!H0(v.closeButton)||v.closeButton);let V=y;I.isValidElement(y)&&!oo(y.type)?V=I.cloneElement(y,{closeToast:P,toastProps:R,data:T}):Qn(y)&&(V=y({closeToast:P,toastProps:R,data:T}));const W={content:V,props:R,staleId:F};v.limit&&v.limit>0&&g>v.limit&&$?p.push(W):Dl(k)?setTimeout(()=>{B(W)},k):B(W)},setProps(y){v=y},setToggle:(y,S)=>{x.get(y).toggle=S},isToastActive:y=>m.some(S=>S===y),getSnapshot:()=>v.newestOnTop?b.reverse():b}}(o,a,mB);Tn.set(o,l);const u=l.observe(s);return Al.forEach(c=>n4(c.content,c.options)),Al=[],()=>{u(),Tn.delete(o)}},setProps(s){var l;(l=Tn.get(o))==null||l.setProps(s)},getSnapshot(){var s;return(s=Tn.get(o))==null?void 0:s.getSnapshot()}}}(e)).current;r(e);const i=I.useSyncExternalStore(t,n,n);return{getToastToRender:function(a){if(!i)return[];const o=new Map;return i.forEach(s=>{const{position:l}=s.props;o.has(l)||o.set(l,[]),o.get(l).push(s)}),Array.from(o,s=>a(s[0],s[1]))},isToastActive:t4,count:i==null?void 0:i.length}}function vB(e){const[t,n]=I.useState(!1),[r,i]=I.useState(!1),a=I.useRef(null),o=I.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:d}=e;var h,f;function g(){n(!0)}function p(){n(!1)}function m(x){const C=a.current;o.canDrag&&C&&(o.didMove=!0,t&&p(),o.delta=e.draggableDirection==="x"?x.clientX-o.start:x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1),C.style.transform=`translate3d(${e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,C.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function b(){document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",b);const x=a.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),e.closeToast(),void e.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=Tn.get((h={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||f.setToggle(h.id,h.fn),I.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",g),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",p)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(x){if(e.draggable===!0||e.draggable===x.pointerType){o.didMove=!1,document.addEventListener("pointermove",m),document.addEventListener("pointerup",b);const C=a.current;o.canCloseOnClick=!0,o.canDrag=!0,C.style.transition="none",e.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(x){const{top:C,bottom:E,left:w,right:B}=a.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&x.clientX>=w&&x.clientX<=B&&x.clientY>=C&&x.clientY<=E?p():g()}};return s&&l&&(v.onMouseEnter=p,e.stacked||(v.onMouseLeave=g)),d&&(v.onClick=x=>{c&&c(x),o.canCloseOnClick&&u()}),{playToast:g,pauseToast:p,isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:v}}function yB(e){let{delay:t,isRunning:n,closeToast:r,type:i="default",hide:a,className:o,style:s,controlledProgress:l,progress:u,rtl:c,isIn:d,theme:h}=e;const f=a||l&&u===0,g={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(g.transform=`scaleX(${u})`);const p=ki("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":c}),m=Qn(o)?o({rtl:c,type:i,defaultClassName:p}):ki(p,o),b={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{d&&r()}};return I.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},I.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${h} Toastify__progress-bar--${i}`}),I.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:g,...b}))}let xB=1;const r4=()=>""+xB++;function CB(e){return e&&(oo(e.toastId)||Dl(e.toastId))?e.toastId:r4()}function hl(e,t){return n4(e,t),t.toastId}function sd(e,t){return{...t,type:t&&t.type||e,toastId:CB(t)}}function Nu(e){return(t,n)=>hl(t,sd(e,n))}function ft(e,t){return hl(e,sd("default",t))}ft.loading=(e,t)=>hl(e,sd("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ft.promise=function(e,t,n){let r,{pending:i,error:a,success:o}=t;i&&(r=oo(i)?ft.loading(i,n):ft.loading(i.render,{...n,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(c,d,h)=>{if(d==null)return void ft.dismiss(r);const f={type:c,...s,...n,data:h},g=oo(d)?{render:d}:d;return r?ft.update(r,{...f,...g}):ft(g.render,{...f,...g}),h},u=Qn(e)?e():e;return u.then(c=>l("success",o,c)).catch(c=>l("error",a,c)),u},ft.success=Nu("success"),ft.info=Nu("info"),ft.error=Nu("error"),ft.warning=Nu("warning"),ft.warn=ft.warning,ft.dark=(e,t)=>hl(e,sd("default",{theme:"dark",...t})),ft.dismiss=function(e){(function(t){var n;if(e4()){if(t==null||oo(n=t)||Dl(n))Tn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Tn.get(t.containerId);r?r.removeToast(t.id):Tn.forEach(i=>{i.removeToast(t.id)})}}else Al=Al.filter(r=>t!=null&&r.options.toastId!==t)})(e)},ft.clearWaitingQueue=function(e){e===void 0&&(e={}),Tn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},ft.isActive=t4,ft.update=function(e,t){t===void 0&&(t={});const n=((r,i)=>{var a;let{containerId:o}=i;return(a=Tn.get(o||1))==null?void 0:a.toasts.get(r)})(e,t);if(n){const{props:r,content:i}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:r4()};a.toastId!==e&&(a.staleId=e);const o=a.render||i;delete a.render,hl(o,a)}},ft.done=e=>{ft.update(e,{progress:1})},ft.onChange=function(e){return j0.add(e),()=>{j0.delete(e)}},ft.play=e=>W1(!0,e),ft.pause=e=>W1(!1,e);const EB=typeof window<"u"?I.useLayoutEffect:I.useEffect,Mu=e=>{let{theme:t,type:n,isLoading:r,...i}=e;return I.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...i})},eh={info:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return I.createElement(Mu,{...e},I.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return I.createElement("div",{className:"Toastify__spinner"})}},SB=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:a}=vB(e),{closeButton:o,children:s,autoClose:l,onClick:u,type:c,hideProgressBar:d,closeToast:h,transition:f,position:g,className:p,style:m,bodyClassName:b,bodyStyle:v,progressClassName:x,progressStyle:C,updateId:E,role:w,progress:B,rtl:y,toastId:S,deleteToast:D,isIn:A,isLoading:T,closeOnClick:F,theme:k}=e,P=ki("Toastify__toast",`Toastify__toast-theme--${k}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":y},{"Toastify__toast--close-on-click":F}),$=Qn(p)?p({rtl:y,position:g,type:c,defaultClassName:P}):ki(P,p),R=function(W){let{theme:U,type:K,isLoading:ee,icon:z}=W,H=null;const X={theme:U,type:K};return z===!1||(Qn(z)?H=z({...X,isLoading:ee}):I.isValidElement(z)?H=I.cloneElement(z,X):ee?H=eh.spinner():(te=>te in eh)(K)&&(H=eh[K](X))),H}(e),O=!!B||!l,j={closeToast:h,type:c,theme:k};let V=null;return o===!1||(V=Qn(o)?o(j):I.isValidElement(o)?I.cloneElement(o,j):function(W){let{closeToast:U,theme:K,ariaLabel:ee="close"}=W;return I.createElement("button",{className:`Toastify__close-button Toastify__close-button--${K}`,type:"button",onClick:z=>{z.stopPropagation(),U(z)},"aria-label":ee},I.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},I.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(j)),I.createElement(f,{isIn:A,done:D,position:g,preventExitTransition:n,nodeRef:r,playToast:a},I.createElement("div",{id:S,onClick:u,"data-in":A,className:$,...i,style:m,ref:r},I.createElement("div",{...A&&{role:w},className:Qn(b)?b({type:c}):ki("Toastify__toast-body",b),style:v},R!=null&&I.createElement("div",{className:ki("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},R),I.createElement("div",null,s)),V,I.createElement(yB,{...E&&!O?{key:`pb-${E}`}:{},rtl:y,theme:k,delay:l,isRunning:t,isIn:A,closeToast:h,hide:d,type:c,style:C,className:x,controlledProgress:O,progress:B||0})))},hf=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wB=ff(hf("bounce",!0));ff(hf("slide",!0));ff(hf("zoom"));ff(hf("flip"));const IB={position:"top-right",transition:wB,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function _B(e){let t={...IB,...e};const n=e.stacked,[r,i]=I.useState(!0),a=I.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=bB(t),{className:u,style:c,rtl:d,containerId:h}=t;function f(p){const m=ki("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":d});return Qn(u)?u({position:p,rtl:d,defaultClassName:m}):ki(m,Ac(u))}function g(){n&&(i(!0),ft.play())}return EB(()=>{if(n){var p;const m=a.current.querySelectorAll('[data-in="true"]'),b=12,v=(p=t.position)==null?void 0:p.includes("top");let x=0,C=0;Array.from(m).reverse().forEach((E,w)=>{const B=E;B.classList.add("Toastify__toast--stacked"),w>0&&(B.dataset.collapsed=`${r}`),B.dataset.pos||(B.dataset.pos=v?"top":"bot");const y=x*(r?.2:1)+(r?0:b*w);B.style.setProperty("--y",`${v?y:-1*y}px`),B.style.setProperty("--g",`${b}`),B.style.setProperty("--s",""+(1-(r?C:0))),x+=B.offsetHeight,C+=.025})}},[r,l,n]),I.createElement("div",{ref:a,className:"Toastify",id:h,onMouseEnter:()=>{n&&(i(!1),ft.pause())},onMouseLeave:g},o((p,m)=>{const b=m.length?{...c}:{...c,pointerEvents:"none"};return I.createElement("div",{className:f(p),style:b,key:`container-${p}`},m.map(v=>{let{content:x,props:C}=v;return I.createElement(SB,{...C,stacked:n,collapseAll:g,isIn:s(C.toastId,C.containerId),style:C.style,key:`toast-${C.key}`},x)}))}))}const Xn={"alert-body":"_alert-body_1qmvx_115","text-header":"_text-header_1qmvx_241","alert-info-filled":"_alert-info-filled_1qmvx_469","alert-warning-filled":"_alert-warning-filled_1qmvx_469","alert-error-filled":"_alert-error-filled_1qmvx_469","alert-success-filled":"_alert-success-filled_1qmvx_469","alert-info-outlined":"_alert-info-outlined_1qmvx_469","alert-warning-outlined":"_alert-warning-outlined_1qmvx_469","alert-error-outlined":"_alert-error-outlined_1qmvx_469","alert-success-outlined":"_alert-success-outlined_1qmvx_469"},DB=(e,t,n)=>{const r=(n==null?void 0:n.variant)??"outline",i={position:"top-center",autoClose:2e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,bodyClassName:Xn["alert-body"]},a={icon:{solid:{success:_.jsx(TB,{}),warning:_.jsx(PB,{}),error:_.jsx($B,{}),info:_.jsx(BB,{})},outline:{success:_.jsx(AB,{}),warning:_.jsx(kB,{}),error:_.jsx(RB,{}),info:_.jsx(FB,{})}},variant:{solid:{success:Xn["alert-success-filled"],error:Xn["alert-error-filled"],warning:Xn["alert-warning-filled"],info:Xn["alert-info-filled"]},outline:{success:Xn["alert-success-outlined"],error:Xn["alert-error-outlined"],warning:Xn["alert-warning-outlined"],info:Xn["alert-info-outlined"]}}};return t==="error"?ft.error(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Error"}),e]}),{icon:a.icon[r].error,className:a.variant[r].error,...i,...n}):t==="info"?ft.info(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Info"}),e]}),{icon:a.icon[r].info,className:a.variant[r].info,...i,...n}):t==="warning"?ft.warning(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Warning"}),e]}),{icon:a.icon[r].warning,className:a.variant[r].warning,...i,...n}):ft(_.jsxs("div",{children:[["solid"].includes(r)&&_.jsx("p",{className:Xn["text-header"],children:"Success"}),e]}),{icon:a.icon[r].success,className:a.variant[r].success,...i,...n})},AB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"check-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M10 18.5C12.1217 18.5 14.1566 17.6571 15.6569 16.1569C17.1571 14.6566 18 12.6217 18 10.5C18 8.37827 17.1571 6.34344 15.6569 4.84315C14.1566 3.34285 12.1217 2.5 10 2.5C7.87827 2.5 5.84344 3.34285 4.34315 4.84315C2.84285 6.34344 2 8.37827 2 10.5C2 12.6217 2.84285 14.6566 4.34315 16.1569C5.84344 17.6571 7.87827 18.5 10 18.5ZM13.707 9.207C13.8892 9.0184 13.99 8.7658 13.9877 8.5036C13.9854 8.2414 13.8802 7.99059 13.6948 7.80518C13.5094 7.61977 13.2586 7.5146 12.9964 7.51233C12.7342 7.51005 12.4816 7.61084 12.293 7.793L9 11.086L7.707 9.793C7.5184 9.61084 7.2658 9.51005 7.0036 9.51233C6.7414 9.5146 6.49059 9.61977 6.30518 9.80518C6.11977 9.99059 6.0146 10.2414 6.01233 10.5036C6.01005 10.7658 6.11084 11.0184 6.293 11.207L8.293 13.207C8.48053 13.3945 8.73484 13.4998 9 13.4998C9.26516 13.4998 9.51947 13.3945 9.707 13.207L13.707 9.207Z",fill:"#388E3C"})})}),TB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"circle",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M9 12L11 14L15 10",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),RB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"exclamation-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 14.5C11 14.7652 10.8946 15.0196 10.7071 15.2071C10.5196 15.3946 10.2652 15.5 10 15.5C9.73478 15.5 9.48043 15.3946 9.29289 15.2071C9.10536 15.0196 9 14.7652 9 14.5C9 14.2348 9.10536 13.9804 9.29289 13.7929C9.48043 13.6054 9.73478 13.5 10 13.5C10.2652 13.5 10.5196 13.6054 10.7071 13.7929C10.8946 13.9804 11 14.2348 11 14.5ZM10 5.5C9.73478 5.5 9.48043 5.60536 9.29289 5.79289C9.10536 5.98043 9 6.23478 9 6.5V10.5C9 10.7652 9.10536 11.0196 9.29289 11.2071C9.48043 11.3946 9.73478 11.5 10 11.5C10.2652 11.5 10.5196 11.3946 10.7071 11.2071C10.8946 11.0196 11 10.7652 11 10.5V6.5C11 6.23478 10.8946 5.98043 10.7071 5.79289C10.5196 5.60536 10.2652 5.5 10 5.5Z",fill:"#F44336"})})}),BB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),$B=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),kB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"exclamation",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M8.25697 3.59898C9.02197 2.23898 10.979 2.23898 11.743 3.59898L17.323 13.519C18.073 14.853 17.11 16.499 15.581 16.499H4.41997C2.88997 16.499 1.92697 14.853 2.67697 13.519L8.25697 3.59898ZM11 13.5C11 13.7652 10.8946 14.0196 10.7071 14.2071C10.5195 14.3946 10.2652 14.5 9.99997 14.5C9.73475 14.5 9.4804 14.3946 9.29286 14.2071C9.10533 14.0196 8.99997 13.7652 8.99997 13.5C8.99997 13.2348 9.10533 12.9804 9.29286 12.7929C9.4804 12.6053 9.73475 12.5 9.99997 12.5C10.2652 12.5 10.5195 12.6053 10.7071 12.7929C10.8946 12.9804 11 13.2348 11 13.5ZM9.99997 5.49998C9.73475 5.49998 9.4804 5.60534 9.29286 5.79287C9.10533 5.98041 8.99997 6.23476 8.99997 6.49998V9.49998C8.99997 9.7652 9.10533 10.0195 9.29286 10.2071C9.4804 10.3946 9.73475 10.5 9.99997 10.5C10.2652 10.5 10.5195 10.3946 10.7071 10.2071C10.8946 10.0195 11 9.7652 11 9.49998V6.49998C11 6.23476 10.8946 5.98041 10.7071 5.79287C10.5195 5.60534 10.2652 5.49998 9.99997 5.49998Z",fill:"#F9A825"})})}),PB=()=>_.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:_.jsxs("g",{id:"alert",children:[_.jsx("path",{id:"Vector",d:"M12 15V15.01M12 9V11V9Z",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),_.jsx("path",{id:"Vector_2",d:"M5 19H19C19.3263 18.9977 19.6471 18.9156 19.9344 18.7609C20.2217 18.6061 20.4667 18.3835 20.6482 18.1123C20.8297 17.841 20.942 17.5296 20.9754 17.205C21.0089 16.8804 20.9624 16.5525 20.84 16.25L13.74 4.00002C13.567 3.68741 13.3135 3.42685 13.0058 3.2454C12.698 3.06396 12.3473 2.96826 11.99 2.96826C11.6327 2.96826 11.282 3.06396 10.9742 3.2454C10.6665 3.42685 10.413 3.68741 10.24 4.00002L3.14 16.25C3.01994 16.5456 2.97233 16.8656 3.00115 17.1833C3.02997 17.501 3.13437 17.8073 3.30565 18.0764C3.47693 18.3456 3.71011 18.5698 3.98573 18.7305C4.26134 18.8912 4.57139 18.9836 4.89 19",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),FB=()=>_.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:_.jsx("g",{id:"information-circle",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 6.5C11 6.76522 10.8946 7.01957 10.7071 7.20711C10.5196 7.39464 10.2652 7.5 10 7.5C9.73478 7.5 9.48043 7.39464 9.29289 7.20711C9.10536 7.01957 9 6.76522 9 6.5C9 6.23478 9.10536 5.98043 9.29289 5.79289C9.48043 5.60536 9.73478 5.5 10 5.5C10.2652 5.5 10.5196 5.60536 10.7071 5.79289C10.8946 5.98043 11 6.23478 11 6.5ZM9 9.5C8.73478 9.5 8.48043 9.60536 8.29289 9.79289C8.10536 9.98043 8 10.2348 8 10.5C8 10.7652 8.10536 11.0196 8.29289 11.2071C8.48043 11.3946 8.73478 11.5 9 11.5V14.5C9 14.7652 9.10536 15.0196 9.29289 15.2071C9.48043 15.3946 9.73478 15.5 10 15.5H11C11.2652 15.5 11.5196 15.3946 11.7071 15.2071C11.8946 15.0196 12 14.7652 12 14.5C12 14.2348 11.8946 13.9804 11.7071 13.7929C11.5196 13.6054 11.2652 13.5 11 13.5V10.5C11 10.2348 10.8946 9.98043 10.7071 9.79289C10.5196 9.60536 10.2652 9.5 10 9.5H9Z",fill:"#0288D1"})})}),gu=e=>typeof e=="string"||typeof e=="number"||typeof e=="bigint"?cf(e):"";function NB(e,t){return{name:"minBig",message:t||`Value must be greater than or equal to ${e}`,test(n){return n=gu(n),ci(n)?At(n).gte(At(e))?!0:this.createError({message:t||`Value must be greater than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function MB(e,t){return{name:"maxBig",message:t||`Value must be less than or equal to ${e}`,test(n){return n=gu(n),ci(n)?At(n).lte(At(e))?!0:this.createError({message:t||`Value must be less than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function LB(e,t){return{name:"moreThanBig",message:t||`Value must be greater than ${e}`,test(n){return n=gu(n),ci(n)?At(n).gt(At(e))?!0:this.createError({message:t||`Value must be greater than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function OB(e,t){return{name:"lessThanBig",message:t||`Value must be less than ${e}`,test(n){return n=gu(n),ci(n)?At(n).lt(At(e))?!0:this.createError({message:t||`Value must be less than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function VB(e,t,n){return{name:"betweenBig",message:n||`Value must be between ${e} and ${t}`,test(r){if(r=gu(r),!ci(r))return this.createError({message:n||"Invalid BigNumber value"});const i=At(r),a=At(e),o=At(t);return i.lt(a)||i.gt(o)?this.createError({message:n||`Value must be between ${e} and ${t}`}):!0}}}function yp(e){return HB.test(e)}const HB=/^-?[0-9]+$/;function jB(e){return WB.test(e)}const WB=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function i4(e,t){const n=Number.parseFloat(e),r=String(n),i=z1(e),a=z1(r);return!!(i===a||(t==null?void 0:t.approx)===!0&&!yp(e)&&a.length>=14&&i.startsWith(a.substring(0,14)))}let qs=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function zB(e){if(i4(e,{approx:!1}))return;if(yp(e))return qs.truncate_integer;const t=Number.parseFloat(e);return Number.isFinite(t)?t===0?qs.underflow:qs.truncate_float:qs.overflow}function z1(e){return e.replace(GB,"").replace(XB,"").replace(ZB,"").replace(UB,"")}const GB=/[eE][+-]?\d+$/,UB=/^-?(0*)?/,XB=/\./,ZB=/0+$/;class YB{constructor(t){xe(this,"isLosslessNumber",!0);if(!jB(t))throw new Error(`Invalid number (value: "${t}")`);this.value=t}valueOf(){const t=zB(this.value);if(t===void 0||t===qs.truncate_float)return Number.parseFloat(this.value);if(yp(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${t} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function KB(e){return e&&typeof e=="object"&&e.isLosslessNumber===!0||!1}function qB(e){return new YB(e)}function JB(e,t){return xp({"":e},"",e,t)}function xp(e,t,n,r){return Array.isArray(n)?r.call(e,t,e9(n,r)):n&&typeof n=="object"&&!KB(n)?r.call(e,t,QB(n,r)):r.call(e,t,n)}function QB(e,t){for(const n of Object.keys(e)){const r=xp(e,n,e[n],t);r!==void 0?e[n]=r:delete e[n]}return e}function e9(e,t){for(let n=0;n<e.length;n++)e[n]=xp(e,String(n),e[n],t);return e}function t9(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qB,r=0;const i=s();return g(i),m(),t?JB(i,t):i;function a(){if(e.charCodeAt(r)===s9){r++,u();const k={};let P=!0;for(;r<e.length&&e.charCodeAt(r)!==U1;){P?P=!1:(h(),u());const $=r,R=c();if(R===void 0){x();return}u(),f();const O=s();if(O===void 0){S();return}Object.prototype.hasOwnProperty.call(k,R)&&!W0(O,k[R])&&C(R,$+1),k[R]=O}return e.charCodeAt(r)!==U1&&E(),r++,k}}function o(){if(e.charCodeAt(r)===l9){r++,u();const k=[];let P=!0;for(;r<e.length&&e.charCodeAt(r)!==X1;){P?P=!1:h();const $=s();p($),k.push($)}return e.charCodeAt(r)!==X1&&w(),r++,k}}function s(){u();const k=c()??d()??a()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),k}function l(k,P){if(e.slice(r,r+k.length)===k)return r+=k.length,P}function u(){for(;n9(e.charCodeAt(r));)r++}function c(){if(e.charCodeAt(r)===th){r++;let k="";for(;r<e.length&&e.charCodeAt(r)!==th;){if(e.charCodeAt(r)===o9){const P=e[r+1],$=a9[P];$!==void 0?(k+=$,r++):P==="u"?Lu(e.charCodeAt(r+2))&&Lu(e.charCodeAt(r+3))&&Lu(e.charCodeAt(r+4))&&Lu(e.charCodeAt(r+5))?(k+=String.fromCharCode(Number.parseInt(e.slice(r+2,r+6),16)),r+=5):D(r):y(r)}else i9(e.charCodeAt(r))?k+=e[r]:B(e[r]);r++}return v(),r++,k}}function d(){const k=r;if(e.charCodeAt(r)===Z1&&(r++,b(k)),e.charCodeAt(r)===Cp)r++;else if(r9(e.charCodeAt(r)))for(r++;Ou(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===m9)for(r++,b(k);Ou(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===C9||e.charCodeAt(r)===x9)for(r++,(e.charCodeAt(r)===Z1||e.charCodeAt(r)===h9)&&r++,b(k);Ou(e.charCodeAt(r));)r++;if(r>k)return n(e.slice(k,r))}function h(){if(e.charCodeAt(r)!==p9)throw new SyntaxError(`Comma ',' expected after value ${F()}`);r++}function f(){if(e.charCodeAt(r)!==b9)throw new SyntaxError(`Colon ':' expected after property name ${F()}`);r++}function g(k){if(k===void 0)throw new SyntaxError(`JSON value expected ${F()}`)}function p(k){if(k===void 0)throw new SyntaxError(`Array item expected ${F()}`)}function m(){if(r<e.length)throw new SyntaxError(`Expected end of input ${F()}`)}function b(k){if(!Ou(e.charCodeAt(r))){const P=e.slice(k,r);throw new SyntaxError(`Invalid number '${P}', expecting a digit ${F()}`)}}function v(){if(e.charCodeAt(r)!==th)throw new SyntaxError(`End of string '"' expected ${F()}`)}function x(){throw new SyntaxError(`Quoted object key expected ${F()}`)}function C(k,P){throw new SyntaxError(`Duplicate key '${k}' encountered at position ${P}`)}function E(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${F()}`)}function w(){throw new SyntaxError(`Array item or end of array ']' expected ${F()}`)}function B(k){throw new SyntaxError(`Invalid character '${k}' ${A()}`)}function y(k){const P=e.slice(k,k+2);throw new SyntaxError(`Invalid escape character '${P}' ${A()}`)}function S(){throw new SyntaxError(`Object value expected after ':' ${A()}`)}function D(k){const P=e.slice(k,k+6);throw new SyntaxError(`Invalid unicode character '${P}' ${A()}`)}function A(){return`at position ${r}`}function T(){return r<e.length?`but got '${e[r]}'`:"but reached end of input"}function F(){return`${T()} ${A()}`}}function n9(e){return e===u9||e===c9||e===d9||e===f9}function Lu(e){return e>=Cp&&e<=Ep||e>=v9&&e<=E9||e>=y9&&e<=S9}function Ou(e){return e>=Cp&&e<=Ep}function r9(e){return e>=g9&&e<=Ep}function i9(e){return e>=32&&e<=1114111}function W0(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>W0(n,t[r])):G1(e)&&G1(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>W0(e[r],t[r])):!1}function G1(e){return typeof e=="object"&&e!==null}const a9={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
23
+ `,r:"\r",t:" "},o9=92,s9=123,U1=125,l9=91,X1=93,u9=32,c9=10,d9=9,f9=13,th=34,h9=43,Z1=45,Cp=48,g9=49,Ep=57,p9=44,m9=46,b9=58,v9=65,y9=97,x9=69,C9=101,E9=70,S9=102;function z0(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map(z0);const t={};for(const[n,r]of Object.entries(e))typeof r=="number"||typeof r=="string"?typeof r=="number"&&!Number.isSafeInteger(r)||typeof r=="string"&&/^-?\d+(?:\.\d+)?$/.test(r)?t[n]=At(r).toString():t[n]=r:typeof r=="object"?t[n]=z0(r):t[n]=r;return t}return e}function G0(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map(G0);if(e instanceof At)return e.toString();const t={};for(const[n,r]of Object.entries(e))t[n]=G0(r);return t}return e}const w9=e=>t9(e,null,n=>typeof n=="number"&&!Number.isSafeInteger(n)||typeof n=="string"&&/^-?\d+(?:\.\d+)?$/.test(n)?i4(n)?parseFloat(n):At(n).toString():n),a4={transparent:"transparent",black:"#212121",white:"#FFFFFF","primary-50":"#E3F2FD","primary-100":"#BBDEFB","primary-200":"#90CAF9","primary-300":"#64B5F6","primary-400":"#42A5F5","primary-500":"#2196F3","primary-600":"#1E88E5","primary-700":"#1976D2","primary-800":"#1565C0","primary-900":"#0D47A1","blue-gray-50":"#ECEFF1","blue-gray-100":"#CFD8DC","blue-gray-200":"#B0BEC5","blue-gray-300":"#90A4AE","blue-gray-400":"#78909C","blue-gray-500":"#607D8B","blue-gray-600":"#546E7A","blue-gray-700":"#455A64","blue-gray-800":"#37474F","blue-gray-900":"#263238","gray-50":"#FAFAFA","gray-100":"#F5F5F5","gray-200":"#EEEEEE","gray-300":"#E0E0E0","gray-400":"#BDBDBD","gray-500":"#9E9E9E","gray-600":"#757575","gray-700":"#616161","gray-800":"#424242","gray-900":"#212121","brown-50":"#EFEBE9","brown-100":"#D7CCC8","brown-200":"#BCAAA4","brown-300":"#A1887F","brown-400":"#8D6E63","brown-500":"#795548","brown-600":"#6D4C41","brown-700":"#5D4037","brown-800":"#4E342E","brown-900":"#3E2723","deep-orange-50":"#FBE9E7","deep-orange-100":"#FFCCBC","deep-orange-200":"#FFAB91","deep-orange-300":"#FF8A65","deep-orange-400":"#FF7043","deep-orange-500":"#FF5722","deep-orange-600":"#F4511E","deep-orange-700":"#E64A19","deep-orange-800":"#D84315","deep-orange-900":"#BF360C","orange-50":"#FFF3E0","orange-100":"#FFE0B2","orange-200":"#FFCC80","orange-300":"#FFB74D","orange-400":"#FFA726","orange-500":"#FF9800","orange-600":"#FB8C00","orange-700":"#F57C00","orange-800":"#EF6C00","orange-900":"#E65100","amber-50":"#FFF8E1","amber-100":"#FFECB3","amber-200":"#FFE082","amber-300":"#FFD54F","amber-400":"#FFCA28","amber-500":"#FFC107","amber-600":"#FFB300","amber-700":"#FFA000","amber-800":"#FF8F00","amber-900":"#FF6F00","yellow-50":"#FFFDE7","yellow-100":"#FFF9C4","yellow-200":"#FFF59D","yellow-300":"#FFF176","yellow-400":"#FFEE58","yellow-500":"#FFEB3B","yellow-600":"#FDD835","yellow-700":"#FBC02D","yellow-800":"#F9A825","yellow-900":"#F57F17","lime-50":"#F9FBE7","lime-100":"#F0F4C3","lime-200":"#E6EE9C","lime-300":"#DCE775","lime-400":"#D4E157","lime-500":"#CDDC39","lime-600":"#C0CA33","lime-700":"#AFB42B","lime-800":"#9E9D24","lime-900":"#827717","light-green-50":"#F1F8E9","light-green-100":"#DCEDC8","light-green-200":"#C5E1A5","light-green-300":"#AED581","light-green-400":"#9CCC65","light-green-500":"#8BC34A","light-green-600":"#7CB342","light-green-700":"#689F38","light-green-800":"#558B2F","light-green-900":"#33691E","green-50":"#E8F5E9","green-100":"#C8E6C9","green-200":"#A5D6A7","green-300":"#81C784","green-400":"#66BB6A","green-500":"#4CAF50","green-600":"#43A047","green-700":"#388E3C","green-800":"#2E7D32","green-900":"#1B5E20","teal-50":"#E0F2F1","teal-100":"#B2DFDB","teal-200":"#80CBC4","teal-300":"#4DB6AC","teal-400":"#26A69A","teal-500":"#009688","teal-600":"#00897B","teal-700":"#00796B","teal-800":"#00695C","teal-900":"#004D40","cyan-50":"#E0F7FA","cyan-100":"#B2EBF2","cyan-200":"#80DEEA","cyan-300":"#4DD0E1","cyan-400":"#26C6DA","cyan-500":"#00BCD4","cyan-600":"#00ACC1","cyan-700":"#0097A7","cyan-800":"#00838F","cyan-900":"#006064","light-blue-50":"#E1F5FE","light-blue-100":"#B3E5FC","light-blue-200":"#81D4FA","light-blue-300":"#4FC3F7","light-blue-400":"#29B6F6","light-blue-500":"#03A9F4","light-blue-600":"#039BE5","light-blue-700":"#0288D1","light-blue-800":"#0277BD","light-blue-900":"#01579B","blue-50":"#E3F2FD","blue-100":"#BBDEFB","blue-200":"#90CAF9","blue-300":"#64B5F6","blue-400":"#42A5F5","blue-500":"#2196F3","blue-600":"#1E88E5","blue-700":"#1976D2","blue-800":"#1565C0","blue-900":"#0D47A1","indigo-50":"#E8EAF6","indigo-100":"#C5CAE9","indigo-200":"#9FA8DA","indigo-300":"#7986CB","indigo-400":"#5C6BC0","indigo-500":"#3F51B5","indigo-600":"#3949AB","indigo-700":"#303F9F","indigo-800":"#283593","indigo-900":"#1A237E","deep-purple-50":"#EDE7F6","deep-purple-100":"#D1C4E9","deep-purple-200":"#B39DDB","deep-purple-300":"#9575CD","deep-purple-400":"#7E57C2","deep-purple-500":"#673AB7","deep-purple-600":"#5E35B1","deep-purple-700":"#512DA8","deep-purple-800":"#4527A0","deep-purple-900":"#311B92","purple-50":"#F3E5F5","purple-100":"#E1BEE7","purple-200":"#CE93D8","purple-300":"#BA68C8","purple-400":"#AB47BC","purple-500":"#9C27B0","purple-600":"#8E24AA","purple-700":"#7B1FA2","purple-800":"#6A1B9A","purple-900":"#4A148C","pink-50":"#FCE4EC","pink-100":"#F8BBD0","pink-200":"#F48FB1","pink-300":"#F06292","pink-400":"#EC407A","pink-500":"#E91E63","pink-600":"#D81B60","pink-700":"#C2185B","pink-800":"#AD1457","pink-900":"#880E4F","red-50":"#FFEBEE","red-100":"#FFCDD2","red-200":"#EF9A9A","red-300":"#E57373","red-400":"#EF5350","red-500":"#F44336","red-600":"#E53935","red-700":"#D32F2F","red-800":"#C62828","red-900":"#B71C1C","payhere-brand-base":"#102A4D","payhere-brand-10":"#CFD4DB","payhere-brand-20":"#AFB8C4","payhere-brand-30":"#8794A6","payhere-brand-40":"#607188","payhere-brand-50":"#384E6B","payhere-brand-60":"#0D2340","laba-black":"#212529","laba-white":"#FFFFFF","laba-blue-10":"#0163C8","laba-blue-08":"#006DFF","laba-blue-06":"#2899FF","laba-blue-05":"#73A4D6","laba-blue-02":"#DBECFF","laba-blue-01":"#F0F7FF","laba-green-10":"#038C67","laba-green-08":"#04BA27","laba-green-06":"#78D798","laba-green-05":"#ABF3CC","laba-green-02":"#CAEEE5","laba-green-01":"#DFF6F6","laba-grey-10":"#898989","laba-grey-08":"#AEAEAE","laba-grey-06":"#D6D6D6","laba-grey-05":"#EEEEEE","laba-grey-02":"#F2F2F2","laba-grey-01":"#FDFDFD","laba-orange-10":"#C05000","laba-orange-08":"#FF7200","laba-orange-06":"#FF9300","laba-orange-05":"#FFBD78","laba-orange-02":"#FFDDBB","laba-orange-01":"#FFF5EB","laba-red-10":"#9E101F","laba-red-08":"#ED0019","laba-red-06":"#FB004E","laba-red-05":"#FF5378","laba-red-02":"#FFAEBF","laba-red-01":"#FFEBEF","lpd-primary-50":"#CEDBFE","lpd-primary-100":"#B6CAFE","lpd-primary-200":"#9DB8FE","lpd-primary-300":"#6C94FD","lpd-primary-400":"#3B71FD","lpd-primary-500":"#0A4DFC","lpd-primary-600":"#083ECA","lpd-primary-700":"#062E97","lpd-primary-800":"#041F65","lpd-primary-900":"#03174C","lpd-secondary-50":"#FEF5CE","lpd-secondary-100":"#FEEFB5","lpd-secondary-200":"#FDEA9D","lpd-secondary-300":"#FDE06B","lpd-secondary-400":"#FCD53A","lpd-secondary-500":"#FBCB09","lpd-secondary-600":"#C9A207","lpd-secondary-700":"#977A05","lpd-secondary-800":"#645104","lpd-secondary-900":"#4B3D03","bill-primary-50":"#EAF0FE","bill-primary-100":"#D5E1FD","bill-primary-200":"#ABC3FB","bill-primary-300":"#81A4F9","bill-primary-400":"#5786F7","bill-primary-500":"#2D68F5","bill-primary-600":"#2453C4","bill-primary-700":"#1B3E93","bill-primary-800":"#122A62","bill-primary-900":"#091531","bill-secondary-50":"#F0FEFD","bill-secondary-100":"#E2FCFA","bill-secondary-200":"#C5F9F5","bill-secondary-300":"#A8F7F1","bill-secondary-400":"#8BF4EC","bill-secondary-500":"#6EF1E7","bill-secondary-600":"#59CBC2","bill-secondary-700":"#44A59D","bill-secondary-800":"#2F7E79","bill-secondary-900":"#1A5854"},o4={"payhere-h1":["60px",{lineHeight:"72px",fontWeight:700}],"payhere-h2":["48px",{lineHeight:"58px",fontWeight:700}],"payhere-h3":["40px",{lineHeight:"48px",fontWeight:700}],"payhere-h4":["30px",{lineHeight:"38px",fontWeight:700}],"payhere-h5":["28px",{lineHeight:"40px",fontWeight:600}],"payhere-h6":["24px",{lineHeight:"30px",fontWeight:600}],"payhere-body-lr":["18px",{lineHeight:"26px",fontWeight:400}],"payhere-body-lm":["18px",{lineHeight:"26px",fontWeight:500}],"payhere-body-ls":["18px",{lineHeight:"26px",fontWeight:600}],"payhere-body-lb":["18px",{lineHeight:"26px",fontWeight:700}],"payhere-body-mr":["16px",{lineHeight:"24px",fontWeight:400}],"payhere-body-mm":["16px",{lineHeight:"24px",fontWeight:500}],"payhere-body-ms":["16px",{lineHeight:"24px",fontWeight:600}],"payhere-body-mb":["16px",{lineHeight:"24px",fontWeight:700}],"payhere-label-r":["15px",{lineHeight:"26px",fontWeight:400}],"payhere-label-m":["15px",{lineHeight:"26px",fontWeight:500}],"payhere-label-sb":["15px",{lineHeight:"26px",fontWeight:600}],"payhere-label-b":["15px",{lineHeight:"26px",fontWeight:700}],"payhere-body-sr":["14px",{lineHeight:"22px",fontWeight:400}],"payhere-body-sm":["14px",{lineHeight:"22px",fontWeight:500}],"payhere-body-smb":["14px",{lineHeight:"22px",fontWeight:600}],"payhere-body-sb":["14px",{lineHeight:"22px",fontWeight:700}],"payhere-body-esr":["12px",{lineHeight:"20px",fontWeight:400}],"payhere-body-esm":["12px",{lineHeight:"20px",fontWeight:500}],"payhere-body-esmb":["12px",{lineHeight:"20px",fontWeight:600}],"payhere-body-esb":["12px",{lineHeight:"20px",fontWeight:700}]},s4={"laba-title-lb":["36px",{lineHeight:"44px",fontWeight:700}],"laba-title-ls":["36px",{lineHeight:"44px",fontWeight:600}],"laba-title-lr":["36px",{lineHeight:"44px",fontWeight:400}],"laba-title-mb":["32px",{lineHeight:"40px",fontWeight:700}],"laba-title-ms":["32px",{lineHeight:"40px",fontWeight:600}],"laba-title-mr":["32px",{lineHeight:"40px",fontWeight:400}],"laba-h1":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-b":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-sb":["24px",{lineHeight:"30px",fontWeight:600}],"laba-h1-r":["24px",{lineHeight:"30px",fontWeight:400}],"laba-h2":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-b":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-sb":["18px",{lineHeight:"26px",fontWeight:600}],"laba-h2-r":["18px",{lineHeight:"26px",fontWeight:400}],"laba-base-rb":["16px",{lineHeight:"24px",fontWeight:700}],"laba-base-rs":["16px",{lineHeight:"24px",fontWeight:600}],"laba-base-rr":["16px",{lineHeight:"24px",fontWeight:400}],"laba-base-sb":["14px",{lineHeight:"20px",fontWeight:700}],"laba-base-ss":["14px",{lineHeight:"20px",fontWeight:600}],"laba-base-sr":["14px",{lineHeight:"20px",fontWeight:400}],"laba-subtitle-rb":["12px",{lineHeight:"16px",fontWeight:700}],"laba-subtitle-rs":["12px",{lineHeight:"16px",fontWeight:600}],"laba-subtitle-rr":["12px",{lineHeight:"16px",fontWeight:400}],"laba-subtitle-sb":["10px",{lineHeight:"12px",fontWeight:700}],"laba-subtitle-ss":["10px",{lineHeight:"12px",fontWeight:600}],"laba-subtitle-sr":["10px",{lineHeight:"12px",fontWeight:400}]},I9={"bill-h1":["60px",{lineHeight:"72px",fontWeight:700}],"bill-h2":["48px",{lineHeight:"58px",fontWeight:700}],"bill-h3":["40px",{lineHeight:"58px",fontWeight:700}],"bill-h4":["30px",{lineHeight:"38px",fontWeight:700}],"bill-h5":["28px",{lineHeight:"40px",fontWeight:600}],"bill-h6":["24px",{lineHeight:"30px",fontWeight:600}],"bill-body-lr":["18px",{lineHeight:"26px",fontWeight:400}],"bill-body-lm":["18px",{lineHeight:"26px",fontWeight:500}],"bill-body-lsm":["18px",{lineHeight:"26px",fontWeight:600}],"bill-body-blb":["18px",{lineHeight:"26px",fontWeight:700}],"bill-body-mr":["16px",{lineHeight:"24px",fontWeight:400}],"bill-body-mm":["16px",{lineHeight:"24px",fontWeight:500}],"bill-body-msm":["16px",{lineHeight:"24px",fontWeight:600}],"bill-body-mb":["16px",{lineHeight:"24px",fontWeight:700}],"bill-label-r":["15px",{lineHeight:"26px",fontWeight:400}],"bill-label-m":["15px",{lineHeight:"26px",fontWeight:500}],"bill-label-sm":["15px",{lineHeight:"26px",fontWeight:600}],"bill-label-b":["15px",{lineHeight:"26px",fontWeight:700}],"bill-body-sr":["14px",{lineHeight:"22px",fontWeight:400}],"bill-body-sm":["14px",{lineHeight:"22px",fontWeight:500}],"bill-body-ssm":["14px",{lineHeight:"22px",fontWeight:600}],"bill-body-sb":["14px",{lineHeight:"22px",fontWeight:700}],"bill-body-esr":["12px",{lineHeight:"20px",fontWeight:400}],"bill-body-ems":["12px",{lineHeight:"20px",fontWeight:500}],"bill-body-essm":["12px",{lineHeight:"20px",fontWeight:600}],"bill-body-esb":["12px",{lineHeight:"20px",fontWeight:700}]},_9={...o4,...s4,...I9},D9={"sm-default":"640px",sm:"576px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},U0={"sm-default":640,sm:576,md:768,lg:1024,xl:1280,"2xl":1536},A9=()=>_.jsx("div",{className:"1ru-w-full 1ru-bg-red-900",children:"index"}),T9="_loading_e63gb_482",Re={"button-l":"_button-l_e63gb_67","button-m":"_button-m_e63gb_67","button-s":"_button-s_e63gb_115","button-xs":"_button-xs_e63gb_115","button-large":"_button-large_e63gb_241","button-reguler":"_button-reguler_e63gb_241","button-small":"_button-small_e63gb_259","button-extra-small":"_button-extra-small_e63gb_259","button-bill-l":"_button-bill-l_e63gb_379","button-bill-m":"_button-bill-m_e63gb_379","button-bill-s":"_button-bill-s_e63gb_427","button-bill-xs":"_button-bill-xs_e63gb_427","button-bill-xxs":"_button-bill-xxs_e63gb_427",loading:T9,"filled-bill-secondary-800_bg-white":"_filled-bill-secondary-800_bg-white_e63gb_497","filled-bill-blue-gray-500_bg-blue-gray-50":"_filled-bill-blue-gray-500_bg-blue-gray-50_e63gb_497","nude-laba-red-05":"_nude-laba-red-05_e63gb_497","nude-laba-red-08":"_nude-laba-red-08_e63gb_497","nude-laba-red-10":"_nude-laba-red-10_e63gb_497","nude-gray-500":"_nude-gray-500_e63gb_497","nude-green-700":"_nude-green-700_e63gb_497","nude-red-700":"_nude-red-700_e63gb_497","nude-laba-blue-10":"_nude-laba-blue-10_e63gb_497","ghost-blue-gray-100-bg_white-text_blue-gray-400":"_ghost-blue-gray-100-bg_white-text_blue-gray-400_e63gb_497","ghost-blue-gray-100-bg_white":"_ghost-blue-gray-100-bg_white_e63gb_497","ghost-laba-green-10":"_ghost-laba-green-10_e63gb_497","ghost-laba-blue-01":"_ghost-laba-blue-01_e63gb_497","ghost-laba-blue-05":"_ghost-laba-blue-05_e63gb_497","ghost-green-700":"_ghost-green-700_e63gb_497","ghost-red-700":"_ghost-red-700_e63gb_497","ghost-laba-blue-10":"_ghost-laba-blue-10_e63gb_497","filled-laba-white_laba-red-05":"_filled-laba-white_laba-red-05_e63gb_497","filled-laba-white_laba-blue-10":"_filled-laba-white_laba-blue-10_e63gb_497","primary-green-700-dsb_laba-grey-06":"_primary-green-700-dsb_laba-grey-06_e63gb_497","primary-red-700-dsb_laba-grey-06":"_primary-red-700-dsb_laba-grey-06_e63gb_497","primary-laba-blue-10":"_primary-laba-blue-10_e63gb_497","primary-bill-red-700":"_primary-bill-red-700_e63gb_497","tertiary-bill-secondary-800":"_tertiary-bill-secondary-800_e63gb_497","secondary-bill-secondary-800":"_secondary-bill-secondary-800_e63gb_497","primary-bill-primary-600":"_primary-bill-primary-600_e63gb_497","tertiary-black":"_tertiary-black_e63gb_497","tertiary-gray-500":"_tertiary-gray-500_e63gb_497","tertiary-red-600":"_tertiary-red-600_e63gb_497","tertiary-red-300":"_tertiary-red-300_e63gb_497","tertiary-blue-700":"_tertiary-blue-700_e63gb_497","secondary-green-600":"_secondary-green-600_e63gb_497","secondary-red-700":"_secondary-red-700_e63gb_497","secondary-red-600":"_secondary-red-600_e63gb_497","secondary-blue-700":"_secondary-blue-700_e63gb_497","primary-red-700":"_primary-red-700_e63gb_497","primary-blue-700":"_primary-blue-700_e63gb_497","icon-loading":"_icon-loading_e63gb_647"},nh={size:{large:Re["button-large"],reguler:Re["button-reguler"],small:Re["button-small"],"extra-small":Re["button-extra-small"],l:Re["button-l"],m:Re["button-m"],s:Re["button-s"],xs:Re["button-xs"],"bill-l":Re["button-bill-l"],"bill-m":Re["button-bill-m"],"bill-s":Re["button-bill-s"],"bill-xs":Re["button-bill-xs"],"bill-xxs":Re["button-bill-xxs"]},loadingSize:{large:"1ru-size-6",reguler:"1ru-size-5",small:"1ru-size-5","extra-small":"1ru-size-5",l:"1ru-size-6",m:"1ru-size-5",s:"1ru-size-5",xs:"1ru-size-5","bill-l":"1ru-size-6","bill-m":"1ru-size-5","bill-s":"1ru-size-5","bill-xs":"1ru-size-5","bill-xxs":"1ru-size-5"},variants:{"primary-laba-blue-10":Re["primary-laba-blue-10"],"primary-red-700-dsb_laba-grey-06":Re["primary-red-700-dsb_laba-grey-06"],"primary-green-700-dsb_laba-grey-06":Re["primary-green-700-dsb_laba-grey-06"],"ghost-laba-blue-10":Re["ghost-laba-blue-10"],"ghost-red-700":Re["ghost-red-700"],"ghost-green-700":Re["ghost-green-700"],"ghost-laba-green-10":Re["ghost-laba-green-10"],"nude-laba-blue-10":Re["nude-laba-blue-10"],"nude-red-700":Re["nude-red-700"],"nude-green-700":Re["nude-green-700"],"nude-gray-500":Re["nude-gray-500"],"primary-blue-700":Re["primary-blue-700"],"secondary-blue-700":Re["secondary-blue-700"],"tertiary-blue-700":Re["tertiary-blue-700"],"ghost-blue-gray-100-bg_white":Re["ghost-blue-gray-100-bg_white"],"ghost-blue-gray-100-bg_white-text_blue-gray-400":Re["ghost-blue-gray-100-bg_white-text_blue-gray-400"],"ghost-laba-blue-05":Re["ghost-laba-blue-05"],"secondary-red-600":Re["secondary-red-600"],"tertiary-red-300":Re["tertiary-red-300"],"tertiary-gray-500":Re["tertiary-gray-500"],"tertiary-red-600":Re["tertiary-red-600"],"tertiary-black":Re["tertiary-black"],"secondary-green-600":Re["secondary-green-600"],"nude-laba-red-10":Re["nude-laba-red-10"],"nude-laba-red-05":Re["nude-laba-red-05"],"primary-red-700":Re["primary-red-700"],"nude-laba-red-08":Re["nude-laba-red-08"],"ghost-laba-blue-01":Re["ghost-laba-blue-01"],"filled-laba-white_laba-blue-10":Re["filled-laba-white_laba-blue-10"],"filled-laba-white_laba-red-05":Re["filled-laba-white_laba-red-05"],"secondary-red-700":Re["secondary-red-700"],"primary-bill-primary-600":Re["primary-bill-primary-600"],"secondary-bill-secondary-800":Re["secondary-bill-secondary-800"],"tertiary-bill-secondary-800":Re["tertiary-bill-secondary-800"],"primary-bill-red-700":Re["primary-bill-red-700"],"filled-bill-blue-gray-500_bg-blue-gray-50":Re["filled-bill-blue-gray-500_bg-blue-gray-50"],"filled-bill-secondary-800_bg-white":Re["filled-bill-secondary-800_bg-white"]}},R9=({className:e=""})=>_.jsx("svg",{className:`${Re["icon-loading"]} ${e??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:_.jsx("path",{d:`M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063 \r
24
24
  16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629 \r
25
25
  3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861 \r
26
26
  18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514 \r
@@ -63,7 +63,7 @@ Private-MAC: `+v.digest().toHex()+`\r
63
63
  * LICENSE.md file in the root directory of this source tree.
64
64
  *
65
65
  * @license MIT
66
- */function ms(e,t){return e?bk(e)?J.createElement(e,t):e:null}function bk(e){return vk(e)||typeof e=="function"||yk(e)}function vk(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yk(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function xk(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=J.useState(()=>({current:c2(t)})),[r,i]=J.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const Ck=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:O4,ColumnFiltering:Z4,ColumnGrouping:Y4,ColumnOrdering:q4,ColumnPinning:J4,ColumnSizing:Q4,ColumnVisibility:t2,GlobalFaceting:n2,GlobalFiltering:r2,Headers:L4,RowExpanding:i2,RowPagination:a2,RowPinning:o2,RowSelection:s2,RowSorting:u2,_getVisibleLeafColumns:ts,aggregationFns:Rc,buildHeaderGroups:Js,createCell:N4,createColumn:M4,createColumnHelper:H8,createRow:bu,createTable:c2,defaultColumnSizing:Qs,expandRows:Fp,filterFns:Xr,flattenBy:$p,flexRender:ms,functionalUpdate:Pi,getCoreRowModel:ak,getExpandedRowModel:ok,getFacetedMinMaxValues:sk,getFacetedRowModel:ck,getFacetedUniqueValues:dk,getFilteredRowModel:fk,getGroupedRowModel:hk,getMemoOptions:Ie,getPaginationRowModel:pk,getSortedRowModel:mk,isFunction:mu,isNumberArray:F4,isRowSelected:vf,isSubRowSelected:bd,makeStateUpdater:Wn,memo:we,noop:j8,orderColumns:K4,passiveEventSupported:e2,reSplitAlphaNumeric:vd,selectRowsFn:Bc,shouldAutoRemoveFilter:q0,sortingFns:Uo,useReactTable:xk},Symbol.toStringTag,{value:"Module"})),yf=0,Ta=1,Bs=2,f2=4;function kl(e,t){return n=>e(t(n))}function Ek(e,t){return t(e)}function h2(e,t){return n=>e(t,n)}function yb(e,t){return()=>e(t)}function xf(e,t){return t(e),e}function Dt(...e){return e}function Sk(e){e()}function xb(e){return()=>e}function wk(...e){return()=>{e.map(Sk)}}function Np(e){return e!==void 0}function wo(){}function mt(e,t){return e(Ta,t)}function We(e,t){e(yf,t)}function Mp(e){e(Bs)}function xn(e){return e(f2)}function _e(e,t){return mt(e,h2(t,yf))}function di(e,t){const n=e(Ta,r=>{n(),t(r)});return n}function tt(){const e=[];return(t,n)=>{switch(t){case Bs:e.splice(0,e.length);return;case Ta:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case yf:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=tt();return(r,i)=>{switch(r){case Ta:i(t);break;case yf:t=i;break;case f2:return t}return n(r,i)}}function Ik(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Ta:return a?n===a?void 0:(r(),n=a,t=mt(e,a),t):(r(),wo);case Bs:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function tr(e){return xf(tt(),t=>_e(e,t))}function Cn(e,t){return xf(fe(t),n=>_e(e,n))}function _k(...e){return t=>e.reduceRight(Ek,t)}function ue(e,...t){const n=_k(...t);return(r,i)=>{switch(r){case Ta:return mt(e,n(i));case Bs:Mp(e);return}}}function g2(e,t){return e===t}function _t(e=g2){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Fe(e){return t=>n=>{e(n)&&t(n)}}function ve(e){return t=>kl(t,e)}function qr(e){return t=>()=>t(e)}function ri(e,t){return n=>r=>n(t=e(t,r))}function bs(e){return t=>n=>{e>0?e--:t(n)}}function ua(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Cb(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ge(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);mt(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>a([o].concat(t));n===i?s():r=s}}function Eb(...e){return function(t,n){switch(t){case Ta:return wk(...e.map(r=>mt(r,n)));case Bs:return;default:throw new Error(`unrecognized action ${t}`)}}}function Me(e,t=g2){return ue(e,_t(t))}function sn(...e){const t=tt(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);mt(a,l=>{n[o]=l,r=r|s,r===i&&We(t,n)})}),function(a,o){switch(a){case Ta:return r===i&&o(n),mt(t,o);case Bs:return Mp(t);default:throw new Error(`unrecognized action ${a}`)}}}function lt(e,t=[],{singleton:n}={singleton:!0}){return{id:Dk(),constructor:e,dependencies:t,singleton:n}}const Dk=()=>Symbol();function Ak(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function Tk(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const zu=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Lp(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=I.createContext({});function l(b,v){b.propsReady&&We(b.propsReady,!1);for(const x of r){const C=b[t.required[x]];We(C,v[x])}for(const x of i)if(x in v){const C=b[t.optional[x]];We(C,v[x])}b.propsReady&&We(b.propsReady,!0)}function u(b){return a.reduce((v,x)=>(v[x]=C=>{const E=b[t.methods[x]];We(E,C)},v),{})}function c(b){return o.reduce((v,x)=>(v[x]=Ik(b[t.events[x]]),v),{})}const d=I.forwardRef((b,v)=>{const{children:x,...C}=b,[E]=I.useState(()=>xf(Ak(e),B=>l(B,C))),[w]=I.useState(yb(c,E));return zu(()=>{for(const B of o)B in C&&mt(w[B],C[B]);return()=>{Object.values(w).map(Mp)}},[C,w,E]),zu(()=>{l(E,C)}),I.useImperativeHandle(v,xb(u(E))),I.createElement(s.Provider,{value:E},n?I.createElement(n,Tk([...r,...i,...o],C),x):x)}),h=b=>I.useCallback(h2(We,I.useContext(s)[b]),[b]),f=b=>{const x=I.useContext(s)[b],C=I.useCallback(E=>mt(x,E),[x]);return I.useSyncExternalStore(C,()=>xn(x),()=>xn(x))},g=b=>{const x=I.useContext(s)[b],[C,E]=I.useState(yb(xn,x));return zu(()=>mt(x,w=>{w!==C&&E(xb(w))}),[x,C]),C},p=I.version.startsWith("18")?f:g;return{Component:d,usePublisher:h,useEmitterValue:p,useEmitter:(b,v)=>{const C=I.useContext(s)[b];zu(()=>mt(C,v),[v,C])}}}const Rk=typeof document<"u"?I.useLayoutEffect:I.useEffect,Bk=Rk;var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const $k={0:"debug",1:"log",2:"warn",3:"error"},kk=()=>typeof globalThis>"u"?window:globalThis,Ra=lt(()=>{const e=fe(3);return{log:fe((n,r,i=1)=>{var a;const o=(a=kk().VIRTUOSO_LOG_LEVEL)!=null?a:xn(e);i>=o&&console[$k[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Op(e,t=!0){const n=I.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=I.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function fi(e,t=!0){return Op(e,t).callbackRef}function p2(e,t,n,r,i,a,o){const s=I.useCallback(l=>{const u=Pk(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",h=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,f=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:g}),a==null||a(Fk("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return Op(s,n)}function Pk(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(!s||s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},nr.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function Fk(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Fr(e,t){return Math.round(e.getBoundingClientRect()[t])}function m2(e,t){return Math.abs(e-t)<1.01}function b2(e,t,n,r=wo,i){const a=I.useRef(null),o=I.useRef(null),s=I.useRef(null),l=I.useCallback(d=>{const h=d.target,f=h===window||h===document,g=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,p=f?document.documentElement.scrollHeight:h.scrollHeight,m=f?window.innerHeight:h.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:p,viewportHeight:m})};d.suppressFlushSync?b():cu.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===p-m)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);I.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const h=a.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let g,p,m;h===window?(p=Math.max(Fr(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,m=document.documentElement.scrollTop):(p=h.scrollHeight,g=Fr(h,"height"),m=h.scrollTop);const b=p-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),m2(g,p)||d.top===m){e({scrollTop:m,scrollHeight:p,viewportHeight:g}),f&&t(!0);return}f?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,h.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const $n=lt(()=>{const e=tt(),t=tt(),n=fe(0),r=tt(),i=fe(0),a=tt(),o=tt(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),d=tt(),h=tt(),f=fe(!1);return _e(ue(e,ve(({scrollTop:g})=>g)),t),_e(ue(e,ve(({scrollHeight:g})=>g)),o),_e(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:i,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),Pl={lvl:0};function v2(e,t,n,r=Pl,i=Pl){return{k:e,v:t,lvl:n,l:r,r:i}}function yt(e){return e===Pl}function ns(){return Pl}function tg(e,t){if(yt(e))return Pl;const{k:n,l:r,r:i}=e;if(t===n){if(yt(r))return i;if(yt(i))return r;{const[a,o]=y2(r);return $c(qt(e,{k:a,v:o,l:x2(r)}))}}else return t<n?$c(qt(e,{l:tg(r,t)})):$c(qt(e,{r:tg(i,t)}))}function Fl(e,t){if(!yt(e))return t===e.k?e.v:t<e.k?Fl(e.l,t):Fl(e.r,t)}function Nr(e,t,n="k"){if(yt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Nr(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Nr(e.l,t,n)}function Jn(e,t,n){return yt(e)?v2(t,n,1):t===e.k?qt(e,{k:t,v:n}):t<e.k?Sb(qt(e,{l:Jn(e.l,t,n)})):Sb(qt(e,{r:Jn(e.r,t,n)}))}function ng(e,t,n){if(yt(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(ng(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(ng(o,t,n))),s}function Qa(e){return yt(e)?[]:[...Qa(e.l),{k:e.k,v:e.v},...Qa(e.r)]}function y2(e){return yt(e.r)?[e.k,e.v]:y2(e.r)}function x2(e){return yt(e.r)?e.l:$c(qt(e,{r:x2(e.r)}))}function qt(e,t){return v2(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function gh(e){return yt(e)||e.lvl>e.r.lvl}function Sb(e){return rg(E2(e))}function $c(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(gh(t))return E2(qt(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return qt(t.r,{l:qt(t,{r:t.r.l}),r:qt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(gh(e))return rg(qt(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const i=n.l,a=gh(i)?n.lvl-1:n.lvl;return qt(i,{l:qt(e,{r:i.l,lvl:r-1}),r:rg(qt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Cf(e,t,n){if(yt(e))return[];const r=Nr(e,t)[0];return Nk(ng(e,r,n))}function C2(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function Nk(e){return C2(e,({k:t,v:n})=>({index:t,value:n}))}function rg(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?qt(t,{l:qt(e,{r:t.l}),lvl:n+1}):e}function E2(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?qt(t,{r:qt(e,{l:t.r})}):e}function yd(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function S2(e,t,n){return e[yd(e,t,n)]}function Mk(e,t,n,r){const i=yd(e,t,r),a=yd(e,n,r,i);return e.slice(i,a+1)}const Vp=lt(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function Lk(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function wb(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ok(e,t){let n=yt(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),yt(e)){e=Jn(e,0,i);continue}const s=Cf(e,a-1,o+1);if(s.some(Lk(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:h}of s)l?(o>=c||i===h)&&(e=tg(e,c)):(u=h!==i,l=!0),d>o&&o>=c&&h!==i&&(e=Jn(e,o+1,h));u&&(e=Jn(e,a,i))}return[e,n]}function Vk(){return{offsetTree:[],sizeTree:ns(),groupOffsetTree:ns(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hp({index:e},t){return t===e?0:t<e?-1:1}function Hk({offset:e},t){return t===e?0:t<e?-1:1}function jk(e){return{index:e.index,value:e}}function Wk(e,t,n,r=0){return r>0&&(t=Math.max(t,S2(e,r,Hp).offset)),C2(Mk(e,t,n,Hk),jk)}function ig(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=yd(i,t-1,Hp),s=i[l].offset;const c=Nr(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===Nr(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Cf(n,t,1/0)){const d=u-a,h=d*o+s+d*r;i.push({offset:h,size:c,index:u}),a=u,s=h,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function zk(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&yt(a)&&t.length===2){const h=t[0].size,f=t[1].size;o=n.reduce((g,p)=>Jn(Jn(g,p,h),p+1,f),o)}else[o,s]=Ok(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=ig(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((h,f)=>Jn(h,f,Nl(f,l,i)),ns()),groupIndices:n}}function Nl(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=S2(t,e,Hp),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function Gk(e){return typeof e.groupIndex<"u"}function w2(e,t,n){if(Gk(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=I2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function I2(e,t){if(!Ef(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Ef(e){return!yt(e.groupOffsetTree)}function Uk(e){return Qa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const Xk={offsetHeight:"height",offsetWidth:"width"},pi=lt(([{log:e},{recalcInProgress:t}])=>{const n=tt(),r=tt(),i=Cn(r,0),a=tt(),o=tt(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),d=fe((E,w)=>Fr(E,Xk[w])),h=fe(void 0),f=fe(0),g=Vk(),p=Cn(ue(n,Ge(l,e,f),ri(zk,g),_t()),g),m=Cn(ue(l,_t(),ri((E,w)=>({prev:E.current,current:w}),{prev:[],current:[]}),ve(({prev:E})=>E)),[]);_e(ue(l,Fe(E=>E.length>0),Ge(p,f),ve(([E,w,B])=>{const y=E.reduce((S,D,A)=>Jn(S,D,Nl(D,w.offsetTree,B)||A),ns());return{...w,groupIndices:E,groupOffsetTree:y}})),p),_e(ue(r,Ge(p),Fe(([E,{lastIndex:w}])=>E<w),ve(([E,{lastIndex:w,lastSize:B}])=>[{startIndex:E,endIndex:w,size:B}])),n),_e(u,c);const b=Cn(ue(u,ve(E=>E===void 0)),!0);_e(ue(c,Fe(E=>E!==void 0&&yt(xn(p).sizeTree)),ve(E=>[{startIndex:0,endIndex:0,size:E}])),n);const v=tr(ue(n,Ge(p),ri(({sizes:E},[w,B])=>({changed:B!==E,sizes:B}),{changed:!1,sizes:g}),ve(E=>E.changed)));mt(ue(s,ri((E,w)=>({diff:E.prev-w,prev:w}),{diff:0,prev:0}),ve(E=>E.diff)),E=>{const{groupIndices:w}=xn(p);if(E>0)We(t,!0),We(a,E+wb(E,w));else if(E<0){const B=xn(m);B.length>0&&(E-=wb(-E,B)),We(o,E)}}),mt(ue(s,Ge(e)),([E,w])=>{E<0&&w("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},nr.ERROR)});const x=tr(a);_e(ue(a,Ge(p),ve(([E,w])=>{const B=w.groupIndices.length>0,y=[],S=w.lastSize;if(B){const D=Fl(w.sizeTree,0);let A=0,T=0;for(;A<E;){const P=w.groupIndices[T],$=w.groupIndices.length===T+1?1/0:w.groupIndices[T+1]-P-1;y.push({startIndex:P,endIndex:P,size:D}),y.push({startIndex:P+1,endIndex:P+1+$-1,size:S}),T++,A+=$+1}const F=Qa(w.sizeTree);return A!==E&&F.shift(),F.reduce((P,{k:$,v:R})=>{let O=P.ranges;return P.prevSize!==0&&(O=[...P.ranges,{startIndex:P.prevIndex,endIndex:$+E-1,size:P.prevSize}]),{ranges:O,prevIndex:$+E,prevSize:R}},{ranges:y,prevIndex:E,prevSize:0}).ranges}return Qa(w.sizeTree).reduce((D,{k:A,v:T})=>({ranges:[...D.ranges,{startIndex:D.prevIndex,endIndex:A+E-1,size:D.prevSize}],prevIndex:A+E,prevSize:T}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const C=tr(ue(o,Ge(p,f),ve(([E,{offsetTree:w},B])=>{const y=-E;return Nl(y,w,B)})));return _e(ue(o,Ge(p,f),ve(([E,w,B])=>{if(w.groupIndices.length>0){if(yt(w.sizeTree))return w;let S=ns();const D=xn(m);let A=0,T=0,F=0;for(;A<-E;){F=D[T];const P=D[T+1]-F-1;T++,A+=P+1}if(S=Qa(w.sizeTree).reduce((P,{k:$,v:R})=>Jn(P,Math.max(0,$+E),R),S),A!==-E){const P=Fl(w.sizeTree,F);S=Jn(S,0,P);const $=Nr(w.sizeTree,-E+1)[1];S=Jn(S,1,$)}return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}else{const S=Qa(w.sizeTree).reduce((D,{k:A,v:T})=>Jn(D,Math.max(0,A+E),T),ns());return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}})),p),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:x,firstItemIndex:s,gap:f,sizes:p,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Dt(Ra,Vp),{singleton:!0}),Zk=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Zk)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const vu=lt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:h}])=>{const f=tt(),g=tt(),p=fe(0);let m=null,b=null,v=null;function x(){m&&(m(),m=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),We(i,!1)}return _e(ue(f,Ge(e,a,t,p,l,u,h),Ge(r,c,d),ve(([[C,E,w,B,y,S,D,A],T,F,k])=>{const P=_2(C),{align:$,behavior:R,offset:O}=P,j=B-1,V=w2(P,E,j);let W=Nl(V,E.offsetTree,T)+S;$==="end"?(W+=F+Nr(E.sizeTree,V)[1]-w+k,V===j&&(W+=D)):$==="center"?W+=(F+Nr(E.sizeTree,V)[1]-w+k)/2:W-=y,O&&(W+=O);const U=K=>{x(),K?(A("retrying to scroll to",{location:C},nr.DEBUG),We(f,C)):(We(g,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(x(),R==="smooth"){let K=!1;v=mt(n,ee=>{K=K||ee}),m=di(s,()=>{U(K)})}else m=di(ue(n,Yk(150)),U);return b=setTimeout(()=>{x()},1200),We(i,!0),A("scrolling from index to",{index:V,top:W,behavior:R},nr.DEBUG),{top:W,behavior:R}})),o),{scrollToIndex:f,scrollTargetReached:g,topListHeight:p}},Dt(pi,$n,Ra),{singleton:!0});function Yk(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ml="up",ml="down",Kk="none",qk={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Jk=0,yu=lt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=fe(!1),s=fe(!0),l=tt(),u=tt(),c=fe(4),d=fe(Jk),h=Cn(ue(Eb(ue(Me(t),bs(1),qr(!0)),ue(Me(t),bs(1),qr(!1),Cb(100))),_t()),!1),f=Cn(ue(Eb(ue(a,qr(!0)),ue(a,qr(!1),Cb(200))),_t()),!1);_e(ue(sn(Me(t),Me(d)),ve(([v,x])=>v<=x),_t()),s),_e(ue(s,ua(50)),u);const g=tr(ue(sn(e,Me(n),Me(r),Me(i),Me(c)),ri((v,[{scrollTop:x,scrollHeight:C},E,w,B,y])=>{const S=x+E-C>-y,D={viewportHeight:E,scrollTop:x,scrollHeight:C};if(S){let T,F;return x>v.state.scrollTop?(T="SCROLLED_DOWN",F=v.state.scrollTop-x):(T="SIZE_DECREASED",F=v.state.scrollTop-x||v.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:T,scrollTopDelta:F}}let A;return D.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":E<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":x<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:D}},qk),_t((v,x)=>v&&v.atBottom===x.atBottom))),p=Cn(ue(e,ri((v,{scrollTop:x,scrollHeight:C,viewportHeight:E})=>{if(m2(v.scrollHeight,C))return{scrollTop:x,scrollHeight:C,jump:0,changed:!1};{const w=C-(x+E)<1;return v.scrollTop!==x&&w?{scrollHeight:C,scrollTop:x,jump:v.scrollTop-x,changed:!0}:{scrollHeight:C,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Fe(v=>v.changed),ve(v=>v.jump)),0);_e(ue(g,ve(v=>v.atBottom)),o),_e(ue(o,ua(50)),l);const m=fe(ml);_e(ue(e,ve(({scrollTop:v})=>v),_t(),ri((v,x)=>xn(f)?{direction:v.direction,prevScrollTop:x}:{direction:x<v.prevScrollTop?Ml:ml,prevScrollTop:x},{direction:ml,prevScrollTop:0}),ve(v=>v.direction)),m),_e(ue(e,ua(50),qr(Kk)),m);const b=fe(0);return _e(ue(h,Fe(v=>!v),qr(0)),b),_e(ue(t,ua(100),Ge(h),Fe(([v,x])=>!!x),ri(([v,x],[C])=>[x,C],[0,0]),ve(([v,x])=>x-v)),b),{isScrolling:h,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:m,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Dt($n)),Ba=lt(([{log:e}])=>{const t=fe(!1),n=tr(ue(t,Fe(r=>r),_t()));return mt(t,r=>{r&&xn(e)("props updated",{},nr.DEBUG)}),{propsReady:t,didMount:n}},Dt(Ra),{singleton:!0});function jp(e,t){e==0?t():requestAnimationFrame(()=>jp(e-1,t))}function Wp(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const xu=lt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=fe(!0),l=fe(0),u=fe(!0);return _e(ue(o,Ge(l),Fe(([c,d])=>!!d),qr(!1)),s),_e(ue(o,Ge(l),Fe(([c,d])=>!!d),qr(!1)),u),mt(ue(sn(t,o),Ge(s,e,n,u),Fe(([[,c],d,{sizeTree:h},f,g])=>c&&(!yt(h)||Np(f))&&!d&&!g),Ge(l)),([,c])=>{di(a,()=>{We(u,!0)}),jp(4,()=>{di(r,()=>{We(s,!0)}),We(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Dt(pi,$n,vu,Ba),{singleton:!0});function Ib(e){return e?e==="smooth"?"smooth":"auto":!1}const Qk=(e,t)=>typeof e=="function"?Ib(e(t)):t&&Ib(e),e7=lt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),d=tt();let h=null;function f(p){We(i,{index:"LAST",align:"end",behavior:p})}mt(ue(sn(ue(Me(e),bs(1)),s),Ge(Me(c),n,a,u),ve(([[p,m],b,v,x,C])=>{let E=m&&x,w="auto";return E&&(w=Qk(b,v||C),E=E&&!!w),{totalCount:p,shouldFollow:E,followOutputBehavior:w}}),Fe(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:m})=>{h&&(h(),h=null),h=di(t,()=>{xn(l)("following output to ",{totalCount:p},nr.DEBUG),f(m),h=null})});function g(p){const m=di(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(xn(l)("scrolling to bottom due to increased size",{},nr.DEBUG),f("auto"))});setTimeout(m,100)}return mt(ue(sn(Me(c),e,o),Fe(([p,,m])=>p&&m),ri(({value:p},[,m])=>({refreshed:p===m,value:m}),{refreshed:!1,value:0}),Fe(({refreshed:p})=>p),Ge(c,e)),([,p])=>{xn(a)&&g(p!==!1)}),mt(d,()=>{g(xn(c)!==!1)}),mt(sn(Me(c),r),([p,m])=>{p&&!m.atBottom&&m.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:c,autoscrollToBottom:d}},Dt(pi,yu,vu,xu,Ba,Ra,$n));function t7(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const D2=lt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=tt(),o=tt(),s=tr(ue(a,ve(t7)));return _e(ue(s,ve(l=>l.totalCount)),e),_e(ue(s,ve(l=>l.groupIndices)),t),_e(ue(sn(r,n,i),Fe(([l,u])=>Ef(u)),ve(([l,u,c])=>Nr(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),_t(),ve(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Dt(pi,$n));function Ll(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function A2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const xd="top",Cd="bottom",_b="none";function Db(e,t,n){return typeof e=="number"?n===Ml&&t===xd||n===ml&&t===Cd?e:0:n===Ml?t===xd?e.main:e.reverse:t===Cd?e.main:e.reverse}function Ab(e,t){return typeof e=="number"?e:e[t]||0}const zp=lt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=tt(),o=fe(0),s=fe(0),l=fe(0),u=Cn(ue(sn(Me(e),Me(t),Me(r),Me(a,Ll),Me(l),Me(o),Me(i),Me(n),Me(s)),ve(([c,d,h,[f,g],p,m,b,v,x])=>{const C=c-v,E=m+b,w=Math.max(h-C,0);let B=_b;const y=Ab(x,xd),S=Ab(x,Cd);return f-=v,f+=h+b,g+=h+b,g-=v,f>c+E-y&&(B=Ml),g<c-w+d+S&&(B=ml),B!==_b?[Math.max(C-h-Db(p,xd,B)-y,0),C-w-b+d+Db(p,Cd,B)+S]:null}),Fe(c=>c!=null),_t(Ll)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Dt($n),{singleton:!0});function n7(e,t,n){if(Ef(t)){const r=I2(e,t);return[{index:Nr(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ph={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Tb(e,t,n){if(e.length===0)return[];if(!Ef(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=Cf(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function kc(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const p=e[e.length-1];c=p.offset+p.size}const d=n-l,h=s+d*o+(d-1)*r,f=u,g=h-c;return{items:Tb(e,i,a),topItems:Tb(t,i,a),topListHeight:t.reduce((p,m)=>m.size+p,0),offsetTop:u,offsetBottom:g,top:f,bottom:c,totalCount:n,firstItemIndex:a}}function T2(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=Wp(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return kc(u,[],s,i,n,r)}const Io=lt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},h,{didMount:f},{recalcInProgress:g}])=>{const p=fe([]),m=fe(0),b=tt();_e(a.topItemsIndexes,p);const v=Cn(ue(sn(f,g,Me(o,Ll),Me(t),Me(e),Me(c),u,Me(p),Me(r),Me(i),n),Fe(([w,B,,y,,,,,,,S])=>{const D=S&&S.length!==y;return w&&!B&&!D}),ve(([,,[w,B],y,S,D,A,T,F,k,P])=>{const $=S,{sizeTree:R,offsetTree:O}=$,j=xn(m);if(y===0)return{...ph,totalCount:y};if(w===0&&B===0)return j===0?{...ph,totalCount:y}:T2(j,D,S,F,k,P||[]);if(yt(R))return j>0?null:kc(n7(Wp(D,y),$,P),[],y,k,$,F);const V=[];if(T.length>0){const z=T[0],H=T[T.length-1];let X=0;for(const te of Cf(R,z,H)){const ie=te.value,le=Math.max(te.start,z),ce=Math.min(te.end,H);for(let Q=le;Q<=ce;Q++)V.push({index:Q,size:ie,offset:X,data:P&&P[Q]}),X+=ie}}if(!A)return kc([],V,y,k,$,F);const W=T.length>0?T[T.length-1]+1:0,U=Wk(O,w,B,W);if(U.length===0)return null;const K=y-1,ee=xf([],z=>{for(const H of U){const X=H.value;let te=X.offset,ie=H.start;const le=X.size;if(X.offset<w){ie+=Math.floor((w-X.offset+k)/(le+k));const Q=ie-H.start;te+=Q*le+Q*k}ie<W&&(te+=(W-ie)*le,ie=W);const ce=Math.min(H.end,K);for(let Q=ie;Q<=ce&&!(te>=B);Q++)z.push({index:Q,size:le,offset:te,data:P&&P[Q]}),te+=le+k}});return kc(ee,V,y,k,$,F)}),Fe(w=>w!==null),_t()),ph);_e(ue(n,Fe(Np),ve(w=>w==null?void 0:w.length)),t),_e(ue(v,ve(w=>w.topListHeight)),d),_e(d,l),_e(ue(v,ve(w=>[w.top,w.bottom])),s),_e(ue(v,ve(w=>w.items)),b);const x=tr(ue(v,Fe(({items:w})=>w.length>0),Ge(t,n),Fe(([{items:w},B])=>w[w.length-1].originalIndex===B-1),ve(([,w,B])=>[w-1,B]),_t(Ll),ve(([w])=>w))),C=tr(ue(v,ua(200),Fe(({items:w,topItems:B})=>w.length>0&&w[0].originalIndex===B.length),ve(({items:w})=>w[0].index),_t())),E=tr(ue(v,Fe(({items:w})=>w.length>0),ve(({items:w})=>{let B=0,y=w.length-1;for(;w[B].type==="group"&&B<y;)B++;for(;w[y].type==="group"&&y>B;)y--;return{startIndex:w[B].index,endIndex:w[y].index}}),_t(A2)));return{listState:v,topItemsIndexes:p,endReached:x,startReached:C,rangeChanged:E,itemsRendered:b,initialItemCount:m,...h}},Dt(pi,D2,zp,xu,vu,yu,Ba,Vp),{singleton:!0}),r7=lt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(_e(ue(s,Ge(a),Fe(([,l])=>l!==0),Ge(i,e,t,r,n),ve(([[,l],u,c,d,h,f=[]])=>T2(l,u,c,d,h,f))),o),{}),Dt(pi,xu,Io,Ba),{singleton:!0}),R2=lt(([{scrollVelocity:e}])=>{const t=fe(!1),n=tt(),r=fe(!1);return _e(ue(e,Ge(r,t,n),Fe(([i,a])=>!!a),ve(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),_t()),t),mt(ue(sn(t,e,n),Ge(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Dt(yu),{singleton:!0}),i7=lt(([{topItemsIndexes:e}])=>{const t=fe(0);return _e(ue(t,Fe(n=>n>0),ve(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Dt(Io)),B2=lt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=tt(),o=Cn(ue(sn(e,r,t,n,i),ve(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return _e(Me(o),a),{totalListHeight:o,totalListHeightChanged:a}},Dt($n,Io),{singleton:!0});function $2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const a7=$2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),o7=lt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:h},{log:f},{recalcInProgress:g}])=>{const p=tr(ue(l,Ge(s),ri(([,b,v,x],[{items:C,totalCount:E,bottom:w,offsetBottom:B},y])=>{const S=w+B;let D=0;return v===E&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(D=S-x,D!==0&&(D+=y))),[D,C,E,S]},[0,[],0,0]),Fe(([b])=>b!==0),Ge(t,o,r,a,f,g),Fe(([,b,v,x,,,C])=>!C&&!x&&b!==0&&v===Ml),ve(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},nr.DEBUG),b))));function m(b){b>0?(We(e,{top:-b,behavior:"auto"}),We(n,0)):(We(n,0),We(e,{top:-b,behavior:"auto"}))}return mt(ue(p,Ge(n,i)),([b,v,x])=>{x&&a7()?We(n,v-b):m(-b)}),mt(ue(sn(Cn(i,!1),n,g),Fe(([b,v,x])=>!b&&!x&&v!==0),ve(([b,v])=>v),ua(1)),m),_e(ue(c,ve(b=>({top:-b}))),e),mt(ue(u,Ge(d,h),ve(([b,{lastSize:v,groupIndices:x,sizeTree:C},E])=>{function w(B){return B*(v+E)}if(x.length===0)return w(b);{let B=0;const y=Fl(C,0);let S=0,D=0;for(;S<b;){S++,B+=y;let A=x.length===D+1?1/0:x[D+1]-x[D]-1;S+A>b&&(B-=y,A=b-S+1),S+=A,B+=w(A),D++}return B}})),b=>{We(n,b),requestAnimationFrame(()=>{We(e,{top:b}),requestAnimationFrame(()=>{We(n,0),We(g,!1)})})}),{deviation:n}},Dt($n,yu,Io,pi,Ra,Vp)),s7=lt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return mt(ue(e,Ge(r),Fe(([,i])=>i!==0),ve(([,i])=>({top:i}))),i=>{di(ue(n,bs(1),Fe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{We(t,i)})})}),{initialScrollTop:r}},Dt(Ba,$n,Io),{singleton:!0}),l7=lt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=Cn(ue(sn(n,e,t),Fe(([i])=>i),ve(([,i,a])=>Math.max(0,i-a)),ua(0),_t()),0);return{alignToBottom:n,paddingTopAddition:r}},Dt($n,B2),{singleton:!0}),Gp=lt(([{scrollTo:e,scrollContainerState:t}])=>{const n=tt(),r=tt(),i=tt(),a=fe(!1),o=fe(void 0);return _e(ue(sn(n,r),ve(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),_e(ue(e,Ge(r),ve(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Dt($n)),u7=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,c7=lt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=tt();return _e(ue(c,Ge(e,i,t,a,o,s,r),Ge(n),ve(([[d,h,f,g,p,m,b,v],x])=>{const{done:C,behavior:E,align:w,calculateViewLocation:B=u7,...y}=d,S=w2(d,h,g-1),D=Nl(S,h.offsetTree,x)+p+m,A=D+Nr(h.sizeTree,S)[1],T=v+m,F=v+f-b,k=B({itemTop:D,itemBottom:A,viewportTop:T,viewportBottom:F,locationParams:{behavior:E,align:w,...y}});return k?C&&di(ue(l,Fe(P=>P===!1),bs(xn(l)?1:2)),C):C&&C(),k}),Fe(d=>d!==null)),u),{scrollIntoView:c}},Dt(pi,$n,vu,Io,Ra),{singleton:!0}),d7=lt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=tt(),u=fe(void 0),c=fe(null),d=fe(null);return _e(o,c),_e(s,d),mt(ue(l,Ge(e,n,a,c,d)),([h,f,g,p,m,b])=>{const v=Uk(f.sizeTree);p&&m!==null&&b!==null&&(g=m.scrollTop-b.offsetTop),h({ranges:v,scrollTop:g})}),_e(ue(u,Fe(Np),ve(f7)),r),_e(ue(i,Ge(u),Fe(([,h])=>h!==void 0),_t(),ve(([,h])=>h.ranges)),t),{getState:l,restoreStateFrom:u}},Dt(pi,$n,xu,Ba,Gp));function f7(e){return{offset:e.scrollTop,index:0,align:"start"}}const h7=lt(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Dt(zp,r7,Ba,R2,B2,s7,l7,Gp,c7,Ra)),k2=lt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g},p,m,b,{listState:v,topItemsIndexes:x,...C},{scrollToIndex:E},w,{topItemCount:B},{groupCounts:y},S])=>(_e(C.rangeChanged,S.scrollSeekRangeChanged),_e(ue(S.windowViewportRect,ve(D=>D.visibleHeight)),p.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g,topItemsIndexes:x,topItemCount:B,groupCounts:y,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:E,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...S,...p,sizes:d,...m}),Dt(pi,xu,$n,d7,e7,Io,vu,o7,i7,D2,h7)),mh="-webkit-sticky",Rb="sticky",P2=$2(()=>{if(typeof document>"u")return Rb;const e=document.createElement("div");return e.style.position=mh,e.style.position===mh?mh:Rb});function Up(e,t){const n=I.useRef(null),r=I.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;c=h.height-Math.max(0,f),d=f+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=Op(r),o=I.useCallback(()=>{r(a.current)},[r,a]);return I.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const Sf=I.createContext(void 0),F2=I.createContext(void 0);function Xp(e){return e}const g7=lt(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),i=fe(Xp),a=fe("div"),o=fe(wo),s=(l,u=null)=>Cn(ue(r,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),p7=lt(([e,t])=>({...e,...t}),Dt(k2,g7)),m7=({height:e})=>I.createElement("div",{style:{height:e}}),b7={position:P2(),zIndex:1,overflowAnchor:"none"},v7={overflowAnchor:"none"},Bb=I.memo(function({showTopList:t=!1}){const n=Ke("listState"),r=xr("sizeRanges"),i=Ke("useWindowScroll"),a=Ke("customScrollParent"),o=xr("windowScrollContainerState"),s=xr("scrollContainerState"),l=a||i?o:s,u=Ke("itemContent"),c=Ke("context"),d=Ke("groupContent"),h=Ke("trackItemSizes"),f=Ke("itemSize"),g=Ke("log"),p=xr("gap"),{callbackRef:m}=p2(r,f,h,t?wo:l,g,p,a),[b,v]=I.useState(0);Kp("deviation",k=>{b!==k&&v(k)});const x=Ke("EmptyPlaceholder"),C=Ke("ScrollSeekPlaceholder")||m7,E=Ke("ListComponent"),w=Ke("ItemComponent"),B=Ke("GroupComponent"),y=Ke("computeItemKey"),S=Ke("isSeeking"),D=Ke("groupIndices").length>0,A=Ke("alignToBottom"),T=Ke("initialItemFinalLocationReached"),F=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:A?"auto":0,...T?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?I.createElement(x,Ft(x,c)):I.createElement(E,{...Ft(E,c),ref:m,style:F,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const P=k.originalIndex,$=y(P+n.firstItemIndex,k.data,c);return S?I.createElement(C,{...Ft(C,c),key:$,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?I.createElement(B,{...Ft(B,c),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,style:b7},d(k.index,c)):I.createElement(w,{...Ft(w,c),...N2(w,k.data),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:v7},D?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),y7={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},$s=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),x7={width:"100%",position:P2(),top:0,zIndex:1};function Ft(e,t){if(typeof e!="string")return{context:t}}function N2(e,t){return{item:typeof e=="string"?void 0:t}}const C7=I.memo(function(){const t=Ke("HeaderComponent"),n=xr("headerHeight"),r=Ke("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),E7=I.memo(function(){const t=Ke("FooterComponent"),n=xr("footerHeight"),r=Ke("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null});function Zp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:g,scrollToCallback:p}=b2(l,c,u,d);return t("scrollTo",p),t("scrollBy",g),I.createElement(u,{ref:f,style:{...y7,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...Ft(u,h)},o)})}function Yp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),g=n("context"),{scrollerRef:p,scrollByCallback:m,scrollToCallback:b}=b2(l,c,u,wo,f);return Bk(()=>(p.current=f||window,()=>{p.current=null}),[p,f]),t("windowScrollTo",b),t("scrollBy",m),I.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...s,...Ft(u,g)},o)})}const S7=({children:e})=>{const t=I.useContext(Sf),n=xr("viewportHeight"),r=xr("fixedItemHeight"),i=Ke("alignToBottom"),a=fi(kl(n,o=>Fr(o,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:$s(i),ref:a,"data-viewport-type":"element"},e)},w7=({children:e})=>{const t=I.useContext(Sf),n=xr("windowViewportRect"),r=xr("fixedItemHeight"),i=Ke("customScrollParent"),a=Up(n,i),o=Ke("alignToBottom");return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(o),"data-viewport-type":"window"},e)},I7=({children:e})=>{const t=Ke("TopItemListComponent")||"div",n=Ke("headerHeight"),r={...x7,marginTop:`${n}px`},i=Ke("context");return I.createElement(t,{style:r,...Ft(t,i)},e)},_7=I.memo(function(t){const n=Ke("useWindowScroll"),r=Ke("topItemsIndexes").length>0,i=Ke("customScrollParent"),a=i||n?T7:A7,o=i||n?w7:S7;return I.createElement(a,{...t},r&&I.createElement(I7,null,I.createElement(Bb,{showTopList:!0})),I.createElement(o,null,I.createElement(C7,null),I.createElement(Bb,null),I.createElement(E7,null)))}),{Component:D7,usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}=Lp(p7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},_7),A7=Zp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),T7=Yp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),R7=D7,$b={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},B7={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:kb,ceil:Pb,floor:Ed,min:bh,max:bl}=Math;function $7(e){return{...B7,items:e}}function Fb(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function k7(e,t){return e&&e.column===t.column&&e.row===t.row}function Gu(e,t){return e&&e.width===t.width&&e.height===t.height}const P7=lt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,h,{propsReady:f,didMount:g},{windowViewportRect:p,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:x},C])=>{const E=fe(0),w=fe(0),B=fe($b),y=fe({height:0,width:0}),S=fe({height:0,width:0}),D=tt(),A=tt(),T=fe(0),F=fe(null),k=fe({row:0,column:0}),P=tt(),$=tt(),R=fe(!1),O=fe(0),j=fe(!0),V=fe(!1);mt(ue(g,Ge(O),Fe(([H,X])=>!!X)),()=>{We(j,!1),We(w,0)}),mt(ue(sn(g,j,S,y,O,V),Fe(([H,X,te,ie,,le])=>H&&!X&&te.height!==0&&ie.height!==0&&!le)),([,,,,H])=>{We(V,!0),jp(1,()=>{We(D,H)}),di(ue(r),()=>{We(n,[0,0]),We(j,!0)})}),_e(ue($,Fe(H=>H!=null&&H.scrollTop>0),qr(0)),w),mt(ue(g,Ge($),Fe(([,H])=>H!=null)),([,H])=>{H&&(We(y,H.viewport),We(S,H==null?void 0:H.item),We(k,H.gap),H.scrollTop>0&&(We(R,!0),di(ue(r,bs(1)),X=>{We(R,!1)}),We(o,{top:H.scrollTop})))}),_e(ue(y,ve(({height:H})=>H)),i),_e(ue(sn(Me(y,Gu),Me(S,Gu),Me(k,(H,X)=>H&&H.column===X.column&&H.row===X.row),Me(r)),ve(([H,X,te,ie])=>({viewport:H,item:X,gap:te,scrollTop:ie}))),P),_e(ue(sn(Me(E),t,Me(k,k7),Me(S,Gu),Me(y,Gu),Me(F),Me(w),Me(R),Me(j),Me(O)),Fe(([,,,,,,,H])=>!H),ve(([H,[X,te],ie,le,ce,Q,be,,Ce,Se])=>{const{row:un,column:ye}=ie,{height:Ee,width:He}=le,{width:bt}=ce;if(be===0&&(H===0||bt===0))return $b;if(He===0){const Gf=Wp(Se,H),vI=Gf===0?Math.max(be-1,0):Gf;return $7(Fb(Gf,vI,Q))}const Yt=M2(bt,He,ye);let at,Qe;Ce?X===0&&te===0&&be>0?(at=0,Qe=be-1):(at=Yt*Ed((X+un)/(Ee+un)),Qe=Yt*Pb((te+un)/(Ee+un))-1,Qe=bh(H-1,bl(Qe,Yt-1)),at=bh(Qe,bl(0,at))):(at=0,Qe=-1);const or=Fb(at,Qe,Q),{top:wr,bottom:Ir}=Nb(ce,ie,le,or),Ro=Pb(H/Yt),bI=Ro*Ee+(Ro-1)*un-Ir;return{items:or,offsetTop:wr,offsetBottom:bI,top:wr,bottom:Ir,itemHeight:Ee,itemWidth:He}})),B),_e(ue(F,Fe(H=>H!==null),ve(H=>H.length)),E),_e(ue(sn(y,S,B,k),Fe(([H,X,{items:te}])=>te.length>0&&X.height!==0&&H.height!==0),ve(([H,X,{items:te},ie])=>{const{top:le,bottom:ce}=Nb(H,ie,X,te);return[le,ce]}),_t(Ll)),n);const W=fe(!1);_e(ue(r,Ge(W),ve(([H,X])=>X||H!==0)),W);const U=tr(ue(Me(B),Fe(({items:H})=>H.length>0),Ge(E,W),Fe(([{items:H},X,te])=>te&&H[H.length-1].index===X-1),ve(([,H])=>H-1),_t())),K=tr(ue(Me(B),Fe(({items:H})=>H.length>0&&H[0].index===0),qr(0),_t())),ee=tr(ue(Me(B),Ge(R),Fe(([{items:H},X])=>H.length>0&&!X),ve(([{items:H}])=>({startIndex:H[0].index,endIndex:H[H.length-1].index})),_t(A2),ua(0)));_e(ee,h.scrollSeekRangeChanged),_e(ue(D,Ge(y,S,E,k),ve(([H,X,te,ie,le])=>{const ce=_2(H),{align:Q,behavior:be,offset:Ce}=ce;let Se=ce.index;Se==="LAST"&&(Se=ie-1),Se=bl(0,Se,bh(ie-1,Se));let un=ag(X,le,te,Se);return Q==="end"?un=kb(un-X.height+te.height):Q==="center"&&(un=kb(un-X.height/2+te.height/2)),Ce&&(un+=Ce),{top:un,behavior:be}})),o);const z=Cn(ue(B,ve(H=>H.offsetBottom+H.bottom)),0);return _e(ue(p,ve(H=>({width:H.visibleWidth,height:H.visibleHeight}))),y),{data:F,totalCount:E,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:D,smoothScrollTargetReached:s,windowViewportRect:p,windowScrollTo:x,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,deviation:T,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:w,gap:k,restoreStateFrom:$,...h,initialTopMostItemIndex:O,gridState:B,totalListHeight:z,...d,startReached:K,endReached:U,rangeChanged:ee,stateChanged:P,propsReady:f,stateRestoreInProgress:R,...C}},Dt(zp,$n,yu,R2,Ba,Gp,Ra));function Nb(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=ag(e,t,n,r[0].index),o=ag(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function ag(e,t,n,r){const i=M2(e.width,n.width,t.column),a=Ed(r/i),o=a*n.height+bl(0,a-1)*t.row;return o>0?o+t.row:o}function M2(e,t,n){return bl(1,Ed((e+n)/(Ed(t)+n)))}const F7=lt(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),i=fe("virtuoso-grid-list"),a=fe(Xp),o=fe("div"),s=fe(wo),l=(u,c=null)=>Cn(ue(t,ve(d=>d[u]),_t()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),N7=lt(([e,t])=>({...e,...t}),Dt(P7,F7)),M7=I.memo(function(){const t=Bt("gridState"),n=Bt("listClassName"),r=Bt("itemClassName"),i=Bt("itemContent"),a=Bt("computeItemKey"),o=Bt("isSeeking"),s=kr("scrollHeight"),l=Bt("ItemComponent"),u=Bt("ListComponent"),c=Bt("ScrollSeekPlaceholder"),d=Bt("context"),h=kr("itemDimensions"),f=kr("gap"),g=Bt("log"),p=Bt("stateRestoreInProgress"),m=fi(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const x=b.firstChild;if(x){const{width:C,height:E}=x.getBoundingClientRect();h({width:C,height:E})}f({row:Mb("row-gap",getComputedStyle(b).rowGap,g),column:Mb("column-gap",getComputedStyle(b).columnGap,g)})});return p?null:I.createElement(u,{ref:m,className:n,...Ft(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?I.createElement(c,{key:v,...Ft(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):I.createElement(l,{...Ft(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),L7=I.memo(function(){const t=Bt("HeaderComponent"),n=kr("headerHeight"),r=Bt("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Bt("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),O7=I.memo(function(){const t=Bt("FooterComponent"),n=kr("footerHeight"),r=Bt("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Bt("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),V7=({children:e})=>{const t=I.useContext(F2),n=kr("itemDimensions"),r=kr("viewportDimensions"),i=fi(a=>{r(a.getBoundingClientRect())});return I.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),I.createElement("div",{style:$s(!1),ref:i},e)},H7=({children:e})=>{const t=I.useContext(F2),n=kr("windowViewportRect"),r=kr("itemDimensions"),i=Bt("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(!1)},e)},j7=I.memo(function({...t}){const n=Bt("useWindowScroll"),r=Bt("customScrollParent"),i=r||n?z7:W7,a=r||n?H7:V7;return I.createElement(i,{...t},I.createElement(a,null,I.createElement(L7,null),I.createElement(M7,null),I.createElement(O7,null)))}),{usePublisher:kr,useEmitterValue:Bt,useEmitter:L2}=Lp(N7,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},j7),W7=Zp({usePublisher:kr,useEmitterValue:Bt,useEmitter:L2}),z7=Yp({usePublisher:kr,useEmitterValue:Bt,useEmitter:L2});function Mb(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}const G7=lt(()=>{const e=fe(l=>I.createElement("td",null,"Item $",l)),t=fe(null),n=fe(null),r=fe(null),i=fe({}),a=fe(Xp),o=fe(wo),s=(l,u=null)=>Cn(ue(i,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),U7=lt(([e,t])=>({...e,...t}),Dt(k2,G7)),X7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e}})),Z7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e,padding:0,border:0}})),Y7={overflowAnchor:"none"},K7=I.memo(function(){const t=ht("listState"),n=Pr("sizeRanges"),r=ht("useWindowScroll"),i=ht("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),s=i||r?a:o,l=ht("itemContent"),u=ht("trackItemSizes"),c=ht("itemSize"),d=ht("log"),{callbackRef:h,ref:f}=p2(n,c,u,s,d,void 0,i),[g,p]=I.useState(0);qp("deviation",$=>{g!==$&&(f.current.style.marginTop=`${$}px`,p($))});const m=ht("EmptyPlaceholder"),b=ht("ScrollSeekPlaceholder")||X7,v=ht("FillerRow")||Z7,x=ht("TableBodyComponent"),C=ht("TableRowComponent"),E=ht("computeItemKey"),w=ht("isSeeking"),B=ht("paddingTopAddition"),y=ht("firstItemIndex"),S=ht("statefulTotalCount"),D=ht("context");if(S===0&&m)return I.createElement(m,Ft(m,D));const A=t.offsetTop+B+g,T=t.offsetBottom,F=A>0?I.createElement(v,{height:A,key:"padding-top",context:D}):null,k=T>0?I.createElement(v,{height:T,key:"padding-bottom",context:D}):null,P=t.items.map($=>{const R=$.originalIndex,O=E(R+y,$.data,D);return w?I.createElement(b,{...Ft(b,D),key:O,index:$.index,height:$.size,type:$.type||"item"}):I.createElement(C,{...Ft(C,D),...N2(C,$.data),key:O,"data-index":R,"data-known-size":$.size,"data-item-index":$.index,style:Y7},l($.index,$.data,D))});return I.createElement(x,{ref:h,"data-testid":"virtuoso-item-list",...Ft(x,D)},[F,...P,k])}),q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("viewportHeight"),r=Pr("fixedItemHeight"),i=fi(kl(n,a=>Fr(a,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:$s(!1),ref:i,"data-viewport-type":"element"},e)},J7=({children:e})=>{const t=I.useContext(Sf),n=Pr("windowViewportRect"),r=Pr("fixedItemHeight"),i=ht("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(!1),"data-viewport-type":"window"},e)},Q7=I.memo(function(t){const n=ht("useWindowScroll"),r=ht("customScrollParent"),i=Pr("fixedHeaderHeight"),a=Pr("fixedFooterHeight"),o=ht("fixedHeaderContent"),s=ht("fixedFooterContent"),l=ht("context"),u=fi(kl(i,v=>Fr(v,"height"))),c=fi(kl(a,v=>Fr(v,"height"))),d=r||n?nP:tP,h=r||n?J7:q7,f=ht("TableComponent"),g=ht("TableHeadComponent"),p=ht("TableFooterComponent"),m=o?I.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...Ft(g,l)},o()):null,b=s?I.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...Ft(p,l)},s()):null;return I.createElement(d,{...t},I.createElement(h,null,I.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Ft(f,l)},[m,I.createElement(K7,{key:"TableBody"}),b])))}),{Component:eP,usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}=Lp(U7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Q7),tP=Zp({usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}),nP=Yp({usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}),rP=eP,iP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),aP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),Jp=I.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:d,typeCalculateItemSize:h="manual",itemSizeNames:f=[],overscan:g=null,component:p={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:x=0,increaseViewportBy:C=()=>0,context:E={},endReached:w,increaseTotalCount:B=1}=e,[y,S]=I.useState(0),D=()=>{if(o==="min-max"){const F=(a+B)*s;return{height:a>u?l:y>F?y:F}}return o==="container"?{height:y}:{}},A=F=>{var $;const k=F.getAttribute("data-index");let P=(($=F.getBoundingClientRect())==null?void 0:$.height)||0;return f==null||f.forEach(R=>{var O,j;P+=((j=(O=document.querySelector(`[${R}="${k}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:j.height)??0}),P},T=()=>{var F;if(m&&o==="container"){const k=((F=document==null?void 0:document.getElementById(m))==null?void 0:F.offsetHeight)??0;S(k-v)}};return I.useEffect(()=>{const F=setTimeout(T,x);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout(F),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,b]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(rP,{context:E,ref:t,overscan:typeof g=="function"?g(o==="container"?y:l):o==="container"?y:l,totalListHeightChanged:F=>o==="min-max"?S(F):null,style:D(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(F=>h==="manual"?i(F):A(F),[]),components:{TableRow:aP,...p},fixedHeaderContent:c,itemContent:(...F)=>d(iP,...F),endReached:w,increaseViewportBy:C(o==="container"?y:l)})})});Jp.displayName="TableVirtualization";const oP="_sorting_1a30n_536",en={"payhere-reguler":"_payhere-reguler_1a30n_109","laba-reguler":"_laba-reguler_1a30n_259","laba-rounded-md-extra-small":"_laba-rounded-md-extra-small_1a30n_259","laba-small_body-small":"_laba-small_body-small_1a30n_295","laba-small":"_laba-small_1a30n_295","bill-reguler":"_bill-reguler_1a30n_421","pointer-laba":"_pointer-laba_1a30n_489","pointer-payhere":"_pointer-payhere_1a30n_494","pointer-bill":"_pointer-bill_1a30n_499","resize-menu":"_resize-menu_1a30n_504",sorting:oP,"laba-grey-02":"_laba-grey-02_1a30n_557","laba-blue-01_border-transparent":"_laba-blue-01_border-transparent_1a30n_566"};function sP(e,t=null){const[n,r]=I.useState(!1);return I.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const vh=e=>{const t=e.getTime()-Date.now();return Math.max(Math.floor(t/1e3),0)},lP=e=>{const t=I.useMemo(()=>{const f=new Date(e.date);return e.adjustTimesTime&&f.setHours(f.getHours()-e.adjustTimesTime),f},[e.date,e.adjustTimesTime]),[n,r]=I.useState(t),[i,a]=I.useState(()=>vh(n)),[o,s]=I.useState(e.running??!1),[l,u]=I.useState(()=>e==null?void 0:e.callbackDone);return I.useEffect(()=>{let f;return o&&i>0&&(f=setInterval(()=>{const g=vh(n);a(g),g<=0&&(s(!1),f&&clearInterval(f),typeof l=="function"&&l())},e.intervalMs)),()=>{f&&clearInterval(f)}},[o,n,e.intervalMs,l,i]),{count:i,isRunning:o,startCountdown:()=>{!o&&i>0&&s(!0)},stopCountdown:()=>{s(!1)},resetCountdown:f=>{let g;f instanceof Date?g=f:typeof f=="number"?g=new Date(Date.now()+f*1e3):g=t,r(g);const p=vh(g);a(p),p<=0&&s(!1)},setCallbackDone:f=>u(()=>f)}};function O2(e,t=0){const n=I.useRef({promise:null,resolve:null,reject:null,timeout:null});return I.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const wf=typeof window<"u"?I.useLayoutEffect:I.useEffect,uP=(e,t)=>{const[n,r]=I.useState({width:0,height:0}),[i,a]=I.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=I.useRef(null);return wf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const h of d){const{width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C}=h.contentRect;a({width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function cP(e){const[t,n]=I.useState(e),r=I.useRef(t);return I.useEffect(()=>{r.current=t},[t]),[t,n,r]}function dP(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function fP(...e){return t=>{e.forEach(n=>{dP(n,t)})}}function If(...e){return I.useMemo(()=>fP(...e),e)}function Ol(e){const t=I.useRef(e);return vp(e,t.current)||(t.current=e),t.current}function ba(e,t){const n=t.map(Ol);I.useEffect(e,n)}function hP({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){I.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const gP=({containerRef:e,children:t,columnCount:n,gapX:r,gapY:i,direction:a="masonry-ltr",debounceRecalculate:o=500,durationAnimation:s=500,enableAnimation:l=!1})=>{const u=I.useCallback(()=>{const d=e.current;if(!d)return;const h=Array.from(d.children);if(h.length===0){d.style.height="0px";return}const f=Array(n).fill(0),g=d.offsetWidth;if(g===0)return;const p=(g-(n-1)*r)/n,m=a.includes("rtl"),b=a.includes("top-down");h.forEach((x,C)=>{x.style.width=`${p}px`,x.style.position="absolute",l&&(x.style.transition=`top ${s}ms ease, left ${s}ms ease`);let E;if(b)E=C%n;else{const y=Math.min(...f);E=f.indexOf(y)}const w=f[E];let B;m?B=g-(p*(E+1)+r*E):B=E*(p+r),x.style.top=`${w}px`,x.style.left=`${B}px`,f[E]+=x.offsetHeight+i});const v=Math.max(...f);d.style.height=`${v-i}px`},[e,n,r,a,i]),c=O2(async()=>{u()},o);return I.useLayoutEffect(()=>{u()},[t,u]),I.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},pP=({id:e,numInputs:t,onComplete:n,disableFocusOnEdit:r=!1,blurOnComplete:i=!1,disableOnComplete:a=!1})=>{const[o,s]=I.useState(()=>Array(t).fill("")),l=I.useRef([]),[u]=I.useState(()=>`otp-${Math.random().toString(36).slice(2,9)}`),c=e||u;I.useEffect(()=>{l.current=l.current.slice(0,t)},[t]);const d=I.useCallback((v,x)=>{var D,A;const C=v.target.value,E=C.length>1?C.slice(-1):C,w=o[x]!=="",B=[...o];B[x]=E,s(B);const y=B.join(""),S=!B.slice(0,t).includes("");E!==""&&x<t-1&&(r&&w&&S||(D=l.current[x+1])==null||D.focus()),S&&(typeof n=="function"&&n(y),i&&((A=l.current[x])==null||A.blur()))},[o,t,n,r,i]),h=I.useCallback((v,x)=>{var C,E,w,B,y;switch(v.key){case"Backspace":if(o[x]===""&&x>0){v.preventDefault();const S=[...o];S[x-1]="",s(S),(C=l.current[x-1])==null||C.focus()}break;case"ArrowLeft":x>0&&(v.preventDefault(),(E=l.current[x-1])==null||E.focus());break;case"ArrowRight":x<t-1&&(v.preventDefault(),(w=l.current[x+1])==null||w.focus());break;case"Home":v.preventDefault(),(B=l.current[0])==null||B.focus();break;case"End":v.preventDefault(),(y=l.current[t-1])==null||y.focus();break}},[o,t]),f=I.useCallback((v,x)=>{var D,A;v.preventDefault();const C=v.clipboardData.getData("text").trim();if(!C)return;const E=[...o];let w=x;for(const T of C){if(w>=t)break;E[w]=T,w++}s(E);const B=E.join(""),y=!E.includes(""),S=Math.min(w,t-1);(D=l.current[S])==null||D.focus(),y&&(typeof n=="function"&&n(B),i&&((A=l.current[S])==null||A.blur()))},[o,t,n,i]),g=v=>{v.target.select()},p=()=>{var v;s(Array(t).fill("")),(v=l.current[0])==null||v.focus()},m=v=>{if(v<0||v>=t)throw new Error(`useOtpInput: index ${v} is out of bounds for numInputs ${t}.`);const x=o.join("").length===t;return{id:`${c}-${v}`,"aria-label":`OTP digit ${v+1} of ${t}`,ref:C=>{l.current[v]=C},value:o[v],onChange:C=>d(C,v),onKeyDown:C=>h(C,v),onPaste:C=>f(C,v),onFocus:g,disabled:a&&x,type:"text",inputMode:"numeric",autoComplete:"one-time-code"}};return{getInputProps:m,getInputData:v=>({...JC(m(v),["onChange","onKeyDown","onPaste","onFocus","aria-label","autoComplete"]),isOtpFilled:o[v]!==""}),otpValues:o,otpString:o.join(""),clearOtp:p,isOtpComplete:o.join("").length===t}},Fo={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_elvgc_115"},lr="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",cn=()=>({kind:{"payhere-reguler":en["payhere-reguler"],"laba-reguler":en["laba-reguler"],"laba-small":en["laba-small"],"laba-rounded-md-extra-small":en["laba-rounded-md-extra-small"],"laba-small_body-small":en["laba-small_body-small"],"bill-reguler":en["bill-reguler"]},subMobile:{"payhere-reguler":Fo["sub-mobile-payhere-reguler"],"laba-reguler":Fo["sub-mobile-laba-reguler"],"laba-small":Fo["sub-mobile-laba-small"],"laba-rounded-md-extra-small":Fo["sub-mobile-laba-rounded-md-extra-small"],"laba-small_body-small":Fo["sub-mobile-laba-small_body-small"],"bill-reguler":Fo["sub-mobile-bill-reguler"]},pointer:{"payhere-reguler":en["pointer-payhere"],"laba-reguler":en["pointer-laba"],"laba-small":en["pointer-laba"],"laba-rounded-md-extra-small":en["pointer-laba"],"laba-small_body-small":en["pointer-laba"],"bill-reguler":en["pointer-bill"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"bill-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-rounded-md-extra-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small_body-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":en["laba-grey-02"],"laba-blue-01_border-transparent":en["laba-blue-01_border-transparent"]}});Object.keys(cn().kind);Object.keys(cn().variant);const mP=(e,t)=>{var r,i;let n={};return e&&(n={position:"sticky",top:0,zIndex:2}),(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},Sd=(e,t=!1)=>{const n=e.getIsPinned(),r=n==="left"&&e.getIsLastColumn("left"),i=n==="right"&&e.getIsFirstColumn("right");return n?{boxShadow:r?"-4px 0 4px -4px gray inset":i?"4px 0 4px -4px gray inset":void 0,left:n==="left"?`${e.getStart("left")}px`:void 0,right:n==="right"?`${e.getAfter("right")}px`:void 0,position:"sticky",width:e.getSize(),zIndex:1,background:t?"white":""}:{}},V2=e=>{const t=e.columnPinning.left||[],n=e.columnPinning.right||[],r=e.rowPinning.top||[],i=e.rowPinning.bottom||[];return{left:t,right:n,top:r,bottom:i,isPinning:t.length>0||n.length>0||r.length>0||i.length>0}},bP=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,theadTrId:s,maxHeight:l,idCalculateHeight:u,componentSortASC:c,componentSortDESC:d,classNamePointer:h,emptyPlaceholder:f,renderSubComponent:g,visibilityColumns:p,classNameSubMobile:m})=>_.jsx("div",{id:"1ru-table",style:l?{height:l,overflow:"auto"}:{},className:t??"",children:_.jsxs("table",{className:n,style:{width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[_.jsx("thead",{id:a,"data-calculate-height-header":u,children:e.getHeaderGroups().map(b=>_.jsx("tr",{children:b.headers.map(v=>{var C,E,w,B;const x=(E=(C=v.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:E.call(C,v);return!v.isPlaceholder&&x!==void 0&&v.id===v.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{style:{...mP(l,v),...Sd(v.column),...p.columns.includes(v.column.id)?{display:"none"}:{}},id:`${s(v)}-${v.id}`,colSpan:typeof((w=v.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(B=v.column.columnDef.meta)==null?void 0:B.colSpan(v.column.columnDef):v.colSpan,rowSpan:x,children:[v.isPlaceholder&&x===void 0?null:_.jsxs("div",{className:v.column.getCanSort()?en.sorting:"",onClick:v.column.getToggleSortingHandler(),id:v.column.getCanSort()?`${s(v)}-${v.id}-sort`:"",children:[ms(v.column.columnDef.header,v.getContext()),v.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:v.column.getIsSorted()==="asc"||v.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[v.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:c}),v.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:d})]}):_.jsx(_.Fragment,{})})]}),v.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>v.column.resetSize(),onMouseDown:v.getResizeHandler(),onTouchStart:v.getResizeHandler(),className:en["resize-menu"]})]},v.id)})},b.id))}),_.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,v)=>{var x;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?h:"","data-calculate-height":`${u}-${v}`,id:o(b),children:b.getVisibleCells().map(C=>{var E,w,B;return _.jsx("td",{style:{...typeof((E=C.column.columnDef.meta)==null?void 0:E.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...Sd(C.column,!0),...p.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(B=C.column.columnDef.meta)==null?void 0:B.classNameTd(b.original,b):"",id:`${o(b)}-${C.column.id}`,children:ms(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof g=="function"&&_.jsx("tr",{children:_.jsx("td",{colSpan:b.getVisibleCells().length-(((x=p==null?void 0:p.realColumns)==null?void 0:x.length)||0),children:g(b.original,b,{visibilityColumns:p,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&I.isValidElement(f)&&_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),H2=I.forwardRef((e,t)=>{const{context:n,...r}=e;return _.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});H2.displayName="VirtualizationHead";const vP=({style:e,context:t,...n})=>_.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),yP=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,theadTrId:s,classNameTable:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:h,renderSubComponent:f,visibilityColumns:g,classNameSubMobile:p})=>{var v,x,C;const[m,b]=I.useState(0);return _.jsx(Jp,{context:{headerId:a,classNameTable:l,width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((v=e.getRowModel().rows)==null?void 0:v.length)||0,minLengthItem:((x=e.getRowModel().rows)==null?void 0:x.length)||0,typeCalculateItemSize:"auto",component:{TableHead:H2,Table:vP,EmptyPlaceholder:()=>_.jsx("tbody",{ref:E=>{var w;return b(((w=E==null?void 0:E.getBoundingClientRect())==null?void 0:w.height)??0)},children:_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:I.isValidElement(h)&&h})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(E=>_.jsx("tr",{children:E.headers.map(w=>{var y,S,D,A;const B=(S=(y=w.column.columnDef.meta)==null?void 0:y.rowSpan)==null?void 0:S.call(y,w);return!w.isPlaceholder&&B!==void 0&&w.id===w.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{id:`${s(w)}-${w.id}`,colSpan:w.colSpan,rowSpan:B,style:{...typeof((D=w.column.columnDef.meta)==null?void 0:D.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...Sd(w.column),...g.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&B===void 0?null:_.jsxs("div",{className:w.column.getCanSort()?en.sorting:"",onClick:w.column.getToggleSortingHandler(),id:w.column.getCanSort()?`${s(w)}-${w.id}-sort`:"",children:[ms(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[w.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:u}),w.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:c})]}):_.jsx(_.Fragment,{})})]}),w.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:en["resize-menu"]})]},w.id)})},E.id)),itemContent:(E,w)=>{var y,S;const B=(S=(y=e.getRowModel())==null?void 0:y.rows)==null?void 0:S[w];return _.jsx(E,{children:({...D})=>{var A;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{...D,onClick:T=>{T.stopPropagation(),r&&typeof n=="function"&&n(B.original,B)},className:r?d:"",id:o(B),children:B.getVisibleCells().map(T=>{var F,k,P;return _.jsx(_.Fragment,{children:_.jsx("td",{style:{...typeof((F=T.column.columnDef.meta)==null?void 0:F.styleTd)=="function"?T.column.columnDef.meta.styleTd(B.original,B):{},...Sd(T.column,!0),...g.columns.includes(T.column.id)?{display:"none"}:{}},className:typeof((k=T.column.columnDef.meta)==null?void 0:k.classNameTd)=="function"?(P=T.column.columnDef.meta)==null?void 0:P.classNameTd(B.original,B):"",id:`${o(B)}-${T.column.id}`,children:ms(T.column.columnDef.cell,T.getContext())},T.id)})})}),B.getIsExpanded()&&typeof f=="function"&&_.jsx("tr",{"data-sub-component":w,children:_.jsx("td",{colSpan:B.getVisibleCells().length-(((A=g==null?void 0:g.realColumns)==null?void 0:A.length)||0),children:f(B.original,B,{visibilityColumns:g,classNameSubMobile:p})})})]},B.id)}},B.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((C=e.getRowModel().rows)==null?void 0:C.length)||0)>0?0:m),itemSizeNames:typeof f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},xP=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",theadTrId:c=()=>"",maxHeight:d=0,idCalculateHeight:h=void 0,kind:f="laba-reguler",componentSortASC:g,componentSortDESC:p,scrollTop:m=!1,emptyPlaceholder:b,variant:v,renderSubComponent:x,columnBreakpoints:C})=>{var A;const[E,w]=I.useState(0),[B,y]=I.useState({columns:[],realColumns:[]}),S=()=>{if(![void 0,"undefined"].includes(h)){const T=document.querySelector(`[data-calculate-height-header="${h}"]`);let F=0;const k=document.querySelectorAll(`[data-calculate-height^="${h}-"]`);return k==null||k.forEach(P=>{F+=P.offsetHeight}),F>d?d+T.offsetHeight:0}return d},D=()=>{var P;const T=((P=document.querySelector("body"))==null?void 0:P.offsetWidth)||0,F=C==null?void 0:C.sort(($,R)=>{const O=($.maxWidth??$.minWidth)||0,j=(R.maxWidth??R.minWidth)||0;return O!==j?O-j:$.maxWidth?-1:1}),k=(F==null?void 0:F.find($=>!!(Object.hasOwnProperty.call($,"maxWidth")&&T<=($.maxWidth||0)||Object.hasOwnProperty.call($,"minWidth")&&T>=($.minWidth||0))))||{};Object.keys(k).length>0?(y({columns:k.columns,realColumns:k.realColumns||k.columns}),k!=null&&k.resetExpanded&&e.resetExpanded()):y({columns:[],realColumns:[]})};return ba(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),ba(()=>{d>0&&w(S())},[(A=e==null?void 0:e.options)==null?void 0:A.data,d]),ba(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return D(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[C]),_.jsxs(_.Fragment,{children:[!o&&_.jsx(bP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
66
+ */function ms(e,t){return e?bk(e)?J.createElement(e,t):e:null}function bk(e){return vk(e)||typeof e=="function"||yk(e)}function vk(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yk(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function xk(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=J.useState(()=>({current:c2(t)})),[r,i]=J.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const Ck=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:O4,ColumnFiltering:Z4,ColumnGrouping:Y4,ColumnOrdering:q4,ColumnPinning:J4,ColumnSizing:Q4,ColumnVisibility:t2,GlobalFaceting:n2,GlobalFiltering:r2,Headers:L4,RowExpanding:i2,RowPagination:a2,RowPinning:o2,RowSelection:s2,RowSorting:u2,_getVisibleLeafColumns:ts,aggregationFns:Rc,buildHeaderGroups:Js,createCell:N4,createColumn:M4,createColumnHelper:H8,createRow:bu,createTable:c2,defaultColumnSizing:Qs,expandRows:Fp,filterFns:Xr,flattenBy:$p,flexRender:ms,functionalUpdate:Pi,getCoreRowModel:ak,getExpandedRowModel:ok,getFacetedMinMaxValues:sk,getFacetedRowModel:ck,getFacetedUniqueValues:dk,getFilteredRowModel:fk,getGroupedRowModel:hk,getMemoOptions:Ie,getPaginationRowModel:pk,getSortedRowModel:mk,isFunction:mu,isNumberArray:F4,isRowSelected:vf,isSubRowSelected:bd,makeStateUpdater:Wn,memo:we,noop:j8,orderColumns:K4,passiveEventSupported:e2,reSplitAlphaNumeric:vd,selectRowsFn:Bc,shouldAutoRemoveFilter:q0,sortingFns:Uo,useReactTable:xk},Symbol.toStringTag,{value:"Module"})),yf=0,Ta=1,Bs=2,f2=4;function kl(e,t){return n=>e(t(n))}function Ek(e,t){return t(e)}function h2(e,t){return n=>e(t,n)}function yb(e,t){return()=>e(t)}function xf(e,t){return t(e),e}function Dt(...e){return e}function Sk(e){e()}function xb(e){return()=>e}function wk(...e){return()=>{e.map(Sk)}}function Np(e){return e!==void 0}function wo(){}function mt(e,t){return e(Ta,t)}function We(e,t){e(yf,t)}function Mp(e){e(Bs)}function xn(e){return e(f2)}function _e(e,t){return mt(e,h2(t,yf))}function di(e,t){const n=e(Ta,r=>{n(),t(r)});return n}function tt(){const e=[];return(t,n)=>{switch(t){case Bs:e.splice(0,e.length);return;case Ta:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case yf:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=tt();return(r,i)=>{switch(r){case Ta:i(t);break;case yf:t=i;break;case f2:return t}return n(r,i)}}function Ik(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Ta:return a?n===a?void 0:(r(),n=a,t=mt(e,a),t):(r(),wo);case Bs:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function tr(e){return xf(tt(),t=>_e(e,t))}function Cn(e,t){return xf(fe(t),n=>_e(e,n))}function _k(...e){return t=>e.reduceRight(Ek,t)}function ue(e,...t){const n=_k(...t);return(r,i)=>{switch(r){case Ta:return mt(e,n(i));case Bs:Mp(e);return}}}function g2(e,t){return e===t}function _t(e=g2){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Fe(e){return t=>n=>{e(n)&&t(n)}}function ve(e){return t=>kl(t,e)}function qr(e){return t=>()=>t(e)}function ri(e,t){return n=>r=>n(t=e(t,r))}function bs(e){return t=>n=>{e>0?e--:t(n)}}function ua(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Cb(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ge(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);mt(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>a([o].concat(t));n===i?s():r=s}}function Eb(...e){return function(t,n){switch(t){case Ta:return wk(...e.map(r=>mt(r,n)));case Bs:return;default:throw new Error(`unrecognized action ${t}`)}}}function Me(e,t=g2){return ue(e,_t(t))}function sn(...e){const t=tt(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);mt(a,l=>{n[o]=l,r=r|s,r===i&&We(t,n)})}),function(a,o){switch(a){case Ta:return r===i&&o(n),mt(t,o);case Bs:return Mp(t);default:throw new Error(`unrecognized action ${a}`)}}}function lt(e,t=[],{singleton:n}={singleton:!0}){return{id:Dk(),constructor:e,dependencies:t,singleton:n}}const Dk=()=>Symbol();function Ak(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function Tk(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const zu=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Lp(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=I.createContext({});function l(b,v){b.propsReady&&We(b.propsReady,!1);for(const x of r){const C=b[t.required[x]];We(C,v[x])}for(const x of i)if(x in v){const C=b[t.optional[x]];We(C,v[x])}b.propsReady&&We(b.propsReady,!0)}function u(b){return a.reduce((v,x)=>(v[x]=C=>{const E=b[t.methods[x]];We(E,C)},v),{})}function c(b){return o.reduce((v,x)=>(v[x]=Ik(b[t.events[x]]),v),{})}const d=I.forwardRef((b,v)=>{const{children:x,...C}=b,[E]=I.useState(()=>xf(Ak(e),B=>l(B,C))),[w]=I.useState(yb(c,E));return zu(()=>{for(const B of o)B in C&&mt(w[B],C[B]);return()=>{Object.values(w).map(Mp)}},[C,w,E]),zu(()=>{l(E,C)}),I.useImperativeHandle(v,xb(u(E))),I.createElement(s.Provider,{value:E},n?I.createElement(n,Tk([...r,...i,...o],C),x):x)}),h=b=>I.useCallback(h2(We,I.useContext(s)[b]),[b]),f=b=>{const x=I.useContext(s)[b],C=I.useCallback(E=>mt(x,E),[x]);return I.useSyncExternalStore(C,()=>xn(x),()=>xn(x))},g=b=>{const x=I.useContext(s)[b],[C,E]=I.useState(yb(xn,x));return zu(()=>mt(x,w=>{w!==C&&E(xb(w))}),[x,C]),C},p=I.version.startsWith("18")?f:g;return{Component:d,usePublisher:h,useEmitterValue:p,useEmitter:(b,v)=>{const C=I.useContext(s)[b];zu(()=>mt(C,v),[v,C])}}}const Rk=typeof document<"u"?I.useLayoutEffect:I.useEffect,Bk=Rk;var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const $k={0:"debug",1:"log",2:"warn",3:"error"},kk=()=>typeof globalThis>"u"?window:globalThis,Ra=lt(()=>{const e=fe(3);return{log:fe((n,r,i=1)=>{var a;const o=(a=kk().VIRTUOSO_LOG_LEVEL)!=null?a:xn(e);i>=o&&console[$k[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Op(e,t=!0){const n=I.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=I.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function fi(e,t=!0){return Op(e,t).callbackRef}function p2(e,t,n,r,i,a,o){const s=I.useCallback(l=>{const u=Pk(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",h=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,f=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:g}),a==null||a(Fk("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return Op(s,n)}function Pk(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(!s||s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},nr.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function Fk(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Fr(e,t){return Math.round(e.getBoundingClientRect()[t])}function m2(e,t){return Math.abs(e-t)<1.01}function b2(e,t,n,r=wo,i){const a=I.useRef(null),o=I.useRef(null),s=I.useRef(null),l=I.useCallback(d=>{const h=d.target,f=h===window||h===document,g=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,p=f?document.documentElement.scrollHeight:h.scrollHeight,m=f?window.innerHeight:h.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:p,viewportHeight:m})};d.suppressFlushSync?b():cu.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===p-m)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);I.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const h=a.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let g,p,m;h===window?(p=Math.max(Fr(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,m=document.documentElement.scrollTop):(p=h.scrollHeight,g=Fr(h,"height"),m=h.scrollTop);const b=p-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),m2(g,p)||d.top===m){e({scrollTop:m,scrollHeight:p,viewportHeight:g}),f&&t(!0);return}f?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,h.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const $n=lt(()=>{const e=tt(),t=tt(),n=fe(0),r=tt(),i=fe(0),a=tt(),o=tt(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),d=tt(),h=tt(),f=fe(!1);return _e(ue(e,ve(({scrollTop:g})=>g)),t),_e(ue(e,ve(({scrollHeight:g})=>g)),o),_e(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:i,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),Pl={lvl:0};function v2(e,t,n,r=Pl,i=Pl){return{k:e,v:t,lvl:n,l:r,r:i}}function yt(e){return e===Pl}function ns(){return Pl}function tg(e,t){if(yt(e))return Pl;const{k:n,l:r,r:i}=e;if(t===n){if(yt(r))return i;if(yt(i))return r;{const[a,o]=y2(r);return $c(qt(e,{k:a,v:o,l:x2(r)}))}}else return t<n?$c(qt(e,{l:tg(r,t)})):$c(qt(e,{r:tg(i,t)}))}function Fl(e,t){if(!yt(e))return t===e.k?e.v:t<e.k?Fl(e.l,t):Fl(e.r,t)}function Nr(e,t,n="k"){if(yt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Nr(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Nr(e.l,t,n)}function Jn(e,t,n){return yt(e)?v2(t,n,1):t===e.k?qt(e,{k:t,v:n}):t<e.k?Sb(qt(e,{l:Jn(e.l,t,n)})):Sb(qt(e,{r:Jn(e.r,t,n)}))}function ng(e,t,n){if(yt(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(ng(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(ng(o,t,n))),s}function Qa(e){return yt(e)?[]:[...Qa(e.l),{k:e.k,v:e.v},...Qa(e.r)]}function y2(e){return yt(e.r)?[e.k,e.v]:y2(e.r)}function x2(e){return yt(e.r)?e.l:$c(qt(e,{r:x2(e.r)}))}function qt(e,t){return v2(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function gh(e){return yt(e)||e.lvl>e.r.lvl}function Sb(e){return rg(E2(e))}function $c(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(gh(t))return E2(qt(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return qt(t.r,{l:qt(t,{r:t.r.l}),r:qt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(gh(e))return rg(qt(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const i=n.l,a=gh(i)?n.lvl-1:n.lvl;return qt(i,{l:qt(e,{r:i.l,lvl:r-1}),r:rg(qt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Cf(e,t,n){if(yt(e))return[];const r=Nr(e,t)[0];return Nk(ng(e,r,n))}function C2(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function Nk(e){return C2(e,({k:t,v:n})=>({index:t,value:n}))}function rg(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?qt(t,{l:qt(e,{r:t.l}),lvl:n+1}):e}function E2(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?qt(t,{r:qt(e,{l:t.r})}):e}function yd(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function S2(e,t,n){return e[yd(e,t,n)]}function Mk(e,t,n,r){const i=yd(e,t,r),a=yd(e,n,r,i);return e.slice(i,a+1)}const Vp=lt(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function Lk(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function wb(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ok(e,t){let n=yt(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),yt(e)){e=Jn(e,0,i);continue}const s=Cf(e,a-1,o+1);if(s.some(Lk(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:h}of s)l?(o>=c||i===h)&&(e=tg(e,c)):(u=h!==i,l=!0),d>o&&o>=c&&h!==i&&(e=Jn(e,o+1,h));u&&(e=Jn(e,a,i))}return[e,n]}function Vk(){return{offsetTree:[],sizeTree:ns(),groupOffsetTree:ns(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hp({index:e},t){return t===e?0:t<e?-1:1}function Hk({offset:e},t){return t===e?0:t<e?-1:1}function jk(e){return{index:e.index,value:e}}function Wk(e,t,n,r=0){return r>0&&(t=Math.max(t,S2(e,r,Hp).offset)),C2(Mk(e,t,n,Hk),jk)}function ig(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=yd(i,t-1,Hp),s=i[l].offset;const c=Nr(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===Nr(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Cf(n,t,1/0)){const d=u-a,h=d*o+s+d*r;i.push({offset:h,size:c,index:u}),a=u,s=h,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function zk(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&yt(a)&&t.length===2){const h=t[0].size,f=t[1].size;o=n.reduce((g,p)=>Jn(Jn(g,p,h),p+1,f),o)}else[o,s]=Ok(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=ig(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((h,f)=>Jn(h,f,Nl(f,l,i)),ns()),groupIndices:n}}function Nl(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=S2(t,e,Hp),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function Gk(e){return typeof e.groupIndex<"u"}function w2(e,t,n){if(Gk(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=I2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function I2(e,t){if(!Ef(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Ef(e){return!yt(e.groupOffsetTree)}function Uk(e){return Qa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const Xk={offsetHeight:"height",offsetWidth:"width"},pi=lt(([{log:e},{recalcInProgress:t}])=>{const n=tt(),r=tt(),i=Cn(r,0),a=tt(),o=tt(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),d=fe((E,w)=>Fr(E,Xk[w])),h=fe(void 0),f=fe(0),g=Vk(),p=Cn(ue(n,Ge(l,e,f),ri(zk,g),_t()),g),m=Cn(ue(l,_t(),ri((E,w)=>({prev:E.current,current:w}),{prev:[],current:[]}),ve(({prev:E})=>E)),[]);_e(ue(l,Fe(E=>E.length>0),Ge(p,f),ve(([E,w,B])=>{const y=E.reduce((S,D,A)=>Jn(S,D,Nl(D,w.offsetTree,B)||A),ns());return{...w,groupIndices:E,groupOffsetTree:y}})),p),_e(ue(r,Ge(p),Fe(([E,{lastIndex:w}])=>E<w),ve(([E,{lastIndex:w,lastSize:B}])=>[{startIndex:E,endIndex:w,size:B}])),n),_e(u,c);const b=Cn(ue(u,ve(E=>E===void 0)),!0);_e(ue(c,Fe(E=>E!==void 0&&yt(xn(p).sizeTree)),ve(E=>[{startIndex:0,endIndex:0,size:E}])),n);const v=tr(ue(n,Ge(p),ri(({sizes:E},[w,B])=>({changed:B!==E,sizes:B}),{changed:!1,sizes:g}),ve(E=>E.changed)));mt(ue(s,ri((E,w)=>({diff:E.prev-w,prev:w}),{diff:0,prev:0}),ve(E=>E.diff)),E=>{const{groupIndices:w}=xn(p);if(E>0)We(t,!0),We(a,E+wb(E,w));else if(E<0){const B=xn(m);B.length>0&&(E-=wb(-E,B)),We(o,E)}}),mt(ue(s,Ge(e)),([E,w])=>{E<0&&w("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},nr.ERROR)});const x=tr(a);_e(ue(a,Ge(p),ve(([E,w])=>{const B=w.groupIndices.length>0,y=[],S=w.lastSize;if(B){const D=Fl(w.sizeTree,0);let A=0,T=0;for(;A<E;){const P=w.groupIndices[T],$=w.groupIndices.length===T+1?1/0:w.groupIndices[T+1]-P-1;y.push({startIndex:P,endIndex:P,size:D}),y.push({startIndex:P+1,endIndex:P+1+$-1,size:S}),T++,A+=$+1}const F=Qa(w.sizeTree);return A!==E&&F.shift(),F.reduce((P,{k:$,v:R})=>{let O=P.ranges;return P.prevSize!==0&&(O=[...P.ranges,{startIndex:P.prevIndex,endIndex:$+E-1,size:P.prevSize}]),{ranges:O,prevIndex:$+E,prevSize:R}},{ranges:y,prevIndex:E,prevSize:0}).ranges}return Qa(w.sizeTree).reduce((D,{k:A,v:T})=>({ranges:[...D.ranges,{startIndex:D.prevIndex,endIndex:A+E-1,size:D.prevSize}],prevIndex:A+E,prevSize:T}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const C=tr(ue(o,Ge(p,f),ve(([E,{offsetTree:w},B])=>{const y=-E;return Nl(y,w,B)})));return _e(ue(o,Ge(p,f),ve(([E,w,B])=>{if(w.groupIndices.length>0){if(yt(w.sizeTree))return w;let S=ns();const D=xn(m);let A=0,T=0,F=0;for(;A<-E;){F=D[T];const P=D[T+1]-F-1;T++,A+=P+1}if(S=Qa(w.sizeTree).reduce((P,{k:$,v:R})=>Jn(P,Math.max(0,$+E),R),S),A!==-E){const P=Fl(w.sizeTree,F);S=Jn(S,0,P);const $=Nr(w.sizeTree,-E+1)[1];S=Jn(S,1,$)}return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}else{const S=Qa(w.sizeTree).reduce((D,{k:A,v:T})=>Jn(D,Math.max(0,A+E),T),ns());return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}})),p),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:x,firstItemIndex:s,gap:f,sizes:p,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Dt(Ra,Vp),{singleton:!0}),Zk=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Zk)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const vu=lt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:h}])=>{const f=tt(),g=tt(),p=fe(0);let m=null,b=null,v=null;function x(){m&&(m(),m=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),We(i,!1)}return _e(ue(f,Ge(e,a,t,p,l,u,h),Ge(r,c,d),ve(([[C,E,w,B,y,S,D,A],T,F,k])=>{const P=_2(C),{align:$,behavior:R,offset:O}=P,j=B-1,V=w2(P,E,j);let W=Nl(V,E.offsetTree,T)+S;$==="end"?(W+=F+Nr(E.sizeTree,V)[1]-w+k,V===j&&(W+=D)):$==="center"?W+=(F+Nr(E.sizeTree,V)[1]-w+k)/2:W-=y,O&&(W+=O);const U=K=>{x(),K?(A("retrying to scroll to",{location:C},nr.DEBUG),We(f,C)):(We(g,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(x(),R==="smooth"){let K=!1;v=mt(n,ee=>{K=K||ee}),m=di(s,()=>{U(K)})}else m=di(ue(n,Yk(150)),U);return b=setTimeout(()=>{x()},1200),We(i,!0),A("scrolling from index to",{index:V,top:W,behavior:R},nr.DEBUG),{top:W,behavior:R}})),o),{scrollToIndex:f,scrollTargetReached:g,topListHeight:p}},Dt(pi,$n,Ra),{singleton:!0});function Yk(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ml="up",ml="down",Kk="none",qk={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Jk=0,yu=lt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=fe(!1),s=fe(!0),l=tt(),u=tt(),c=fe(4),d=fe(Jk),h=Cn(ue(Eb(ue(Me(t),bs(1),qr(!0)),ue(Me(t),bs(1),qr(!1),Cb(100))),_t()),!1),f=Cn(ue(Eb(ue(a,qr(!0)),ue(a,qr(!1),Cb(200))),_t()),!1);_e(ue(sn(Me(t),Me(d)),ve(([v,x])=>v<=x),_t()),s),_e(ue(s,ua(50)),u);const g=tr(ue(sn(e,Me(n),Me(r),Me(i),Me(c)),ri((v,[{scrollTop:x,scrollHeight:C},E,w,B,y])=>{const S=x+E-C>-y,D={viewportHeight:E,scrollTop:x,scrollHeight:C};if(S){let T,F;return x>v.state.scrollTop?(T="SCROLLED_DOWN",F=v.state.scrollTop-x):(T="SIZE_DECREASED",F=v.state.scrollTop-x||v.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:T,scrollTopDelta:F}}let A;return D.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":E<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":x<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:D}},qk),_t((v,x)=>v&&v.atBottom===x.atBottom))),p=Cn(ue(e,ri((v,{scrollTop:x,scrollHeight:C,viewportHeight:E})=>{if(m2(v.scrollHeight,C))return{scrollTop:x,scrollHeight:C,jump:0,changed:!1};{const w=C-(x+E)<1;return v.scrollTop!==x&&w?{scrollHeight:C,scrollTop:x,jump:v.scrollTop-x,changed:!0}:{scrollHeight:C,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Fe(v=>v.changed),ve(v=>v.jump)),0);_e(ue(g,ve(v=>v.atBottom)),o),_e(ue(o,ua(50)),l);const m=fe(ml);_e(ue(e,ve(({scrollTop:v})=>v),_t(),ri((v,x)=>xn(f)?{direction:v.direction,prevScrollTop:x}:{direction:x<v.prevScrollTop?Ml:ml,prevScrollTop:x},{direction:ml,prevScrollTop:0}),ve(v=>v.direction)),m),_e(ue(e,ua(50),qr(Kk)),m);const b=fe(0);return _e(ue(h,Fe(v=>!v),qr(0)),b),_e(ue(t,ua(100),Ge(h),Fe(([v,x])=>!!x),ri(([v,x],[C])=>[x,C],[0,0]),ve(([v,x])=>x-v)),b),{isScrolling:h,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:m,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Dt($n)),Ba=lt(([{log:e}])=>{const t=fe(!1),n=tr(ue(t,Fe(r=>r),_t()));return mt(t,r=>{r&&xn(e)("props updated",{},nr.DEBUG)}),{propsReady:t,didMount:n}},Dt(Ra),{singleton:!0});function jp(e,t){e==0?t():requestAnimationFrame(()=>jp(e-1,t))}function Wp(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const xu=lt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=fe(!0),l=fe(0),u=fe(!0);return _e(ue(o,Ge(l),Fe(([c,d])=>!!d),qr(!1)),s),_e(ue(o,Ge(l),Fe(([c,d])=>!!d),qr(!1)),u),mt(ue(sn(t,o),Ge(s,e,n,u),Fe(([[,c],d,{sizeTree:h},f,g])=>c&&(!yt(h)||Np(f))&&!d&&!g),Ge(l)),([,c])=>{di(a,()=>{We(u,!0)}),jp(4,()=>{di(r,()=>{We(s,!0)}),We(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Dt(pi,$n,vu,Ba),{singleton:!0});function Ib(e){return e?e==="smooth"?"smooth":"auto":!1}const Qk=(e,t)=>typeof e=="function"?Ib(e(t)):t&&Ib(e),e7=lt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),d=tt();let h=null;function f(p){We(i,{index:"LAST",align:"end",behavior:p})}mt(ue(sn(ue(Me(e),bs(1)),s),Ge(Me(c),n,a,u),ve(([[p,m],b,v,x,C])=>{let E=m&&x,w="auto";return E&&(w=Qk(b,v||C),E=E&&!!w),{totalCount:p,shouldFollow:E,followOutputBehavior:w}}),Fe(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:m})=>{h&&(h(),h=null),h=di(t,()=>{xn(l)("following output to ",{totalCount:p},nr.DEBUG),f(m),h=null})});function g(p){const m=di(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(xn(l)("scrolling to bottom due to increased size",{},nr.DEBUG),f("auto"))});setTimeout(m,100)}return mt(ue(sn(Me(c),e,o),Fe(([p,,m])=>p&&m),ri(({value:p},[,m])=>({refreshed:p===m,value:m}),{refreshed:!1,value:0}),Fe(({refreshed:p})=>p),Ge(c,e)),([,p])=>{xn(a)&&g(p!==!1)}),mt(d,()=>{g(xn(c)!==!1)}),mt(sn(Me(c),r),([p,m])=>{p&&!m.atBottom&&m.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:c,autoscrollToBottom:d}},Dt(pi,yu,vu,xu,Ba,Ra,$n));function t7(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const D2=lt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=tt(),o=tt(),s=tr(ue(a,ve(t7)));return _e(ue(s,ve(l=>l.totalCount)),e),_e(ue(s,ve(l=>l.groupIndices)),t),_e(ue(sn(r,n,i),Fe(([l,u])=>Ef(u)),ve(([l,u,c])=>Nr(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),_t(),ve(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Dt(pi,$n));function Ll(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function A2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const xd="top",Cd="bottom",_b="none";function Db(e,t,n){return typeof e=="number"?n===Ml&&t===xd||n===ml&&t===Cd?e:0:n===Ml?t===xd?e.main:e.reverse:t===Cd?e.main:e.reverse}function Ab(e,t){return typeof e=="number"?e:e[t]||0}const zp=lt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=tt(),o=fe(0),s=fe(0),l=fe(0),u=Cn(ue(sn(Me(e),Me(t),Me(r),Me(a,Ll),Me(l),Me(o),Me(i),Me(n),Me(s)),ve(([c,d,h,[f,g],p,m,b,v,x])=>{const C=c-v,E=m+b,w=Math.max(h-C,0);let B=_b;const y=Ab(x,xd),S=Ab(x,Cd);return f-=v,f+=h+b,g+=h+b,g-=v,f>c+E-y&&(B=Ml),g<c-w+d+S&&(B=ml),B!==_b?[Math.max(C-h-Db(p,xd,B)-y,0),C-w-b+d+Db(p,Cd,B)+S]:null}),Fe(c=>c!=null),_t(Ll)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Dt($n),{singleton:!0});function n7(e,t,n){if(Ef(t)){const r=I2(e,t);return[{index:Nr(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ph={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Tb(e,t,n){if(e.length===0)return[];if(!Ef(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=Cf(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function kc(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const p=e[e.length-1];c=p.offset+p.size}const d=n-l,h=s+d*o+(d-1)*r,f=u,g=h-c;return{items:Tb(e,i,a),topItems:Tb(t,i,a),topListHeight:t.reduce((p,m)=>m.size+p,0),offsetTop:u,offsetBottom:g,top:f,bottom:c,totalCount:n,firstItemIndex:a}}function T2(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=Wp(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return kc(u,[],s,i,n,r)}const Io=lt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},h,{didMount:f},{recalcInProgress:g}])=>{const p=fe([]),m=fe(0),b=tt();_e(a.topItemsIndexes,p);const v=Cn(ue(sn(f,g,Me(o,Ll),Me(t),Me(e),Me(c),u,Me(p),Me(r),Me(i),n),Fe(([w,B,,y,,,,,,,S])=>{const D=S&&S.length!==y;return w&&!B&&!D}),ve(([,,[w,B],y,S,D,A,T,F,k,P])=>{const $=S,{sizeTree:R,offsetTree:O}=$,j=xn(m);if(y===0)return{...ph,totalCount:y};if(w===0&&B===0)return j===0?{...ph,totalCount:y}:T2(j,D,S,F,k,P||[]);if(yt(R))return j>0?null:kc(n7(Wp(D,y),$,P),[],y,k,$,F);const V=[];if(T.length>0){const z=T[0],H=T[T.length-1];let X=0;for(const te of Cf(R,z,H)){const ie=te.value,le=Math.max(te.start,z),ce=Math.min(te.end,H);for(let Q=le;Q<=ce;Q++)V.push({index:Q,size:ie,offset:X,data:P&&P[Q]}),X+=ie}}if(!A)return kc([],V,y,k,$,F);const W=T.length>0?T[T.length-1]+1:0,U=Wk(O,w,B,W);if(U.length===0)return null;const K=y-1,ee=xf([],z=>{for(const H of U){const X=H.value;let te=X.offset,ie=H.start;const le=X.size;if(X.offset<w){ie+=Math.floor((w-X.offset+k)/(le+k));const Q=ie-H.start;te+=Q*le+Q*k}ie<W&&(te+=(W-ie)*le,ie=W);const ce=Math.min(H.end,K);for(let Q=ie;Q<=ce&&!(te>=B);Q++)z.push({index:Q,size:le,offset:te,data:P&&P[Q]}),te+=le+k}});return kc(ee,V,y,k,$,F)}),Fe(w=>w!==null),_t()),ph);_e(ue(n,Fe(Np),ve(w=>w==null?void 0:w.length)),t),_e(ue(v,ve(w=>w.topListHeight)),d),_e(d,l),_e(ue(v,ve(w=>[w.top,w.bottom])),s),_e(ue(v,ve(w=>w.items)),b);const x=tr(ue(v,Fe(({items:w})=>w.length>0),Ge(t,n),Fe(([{items:w},B])=>w[w.length-1].originalIndex===B-1),ve(([,w,B])=>[w-1,B]),_t(Ll),ve(([w])=>w))),C=tr(ue(v,ua(200),Fe(({items:w,topItems:B})=>w.length>0&&w[0].originalIndex===B.length),ve(({items:w})=>w[0].index),_t())),E=tr(ue(v,Fe(({items:w})=>w.length>0),ve(({items:w})=>{let B=0,y=w.length-1;for(;w[B].type==="group"&&B<y;)B++;for(;w[y].type==="group"&&y>B;)y--;return{startIndex:w[B].index,endIndex:w[y].index}}),_t(A2)));return{listState:v,topItemsIndexes:p,endReached:x,startReached:C,rangeChanged:E,itemsRendered:b,initialItemCount:m,...h}},Dt(pi,D2,zp,xu,vu,yu,Ba,Vp),{singleton:!0}),r7=lt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(_e(ue(s,Ge(a),Fe(([,l])=>l!==0),Ge(i,e,t,r,n),ve(([[,l],u,c,d,h,f=[]])=>T2(l,u,c,d,h,f))),o),{}),Dt(pi,xu,Io,Ba),{singleton:!0}),R2=lt(([{scrollVelocity:e}])=>{const t=fe(!1),n=tt(),r=fe(!1);return _e(ue(e,Ge(r,t,n),Fe(([i,a])=>!!a),ve(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),_t()),t),mt(ue(sn(t,e,n),Ge(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Dt(yu),{singleton:!0}),i7=lt(([{topItemsIndexes:e}])=>{const t=fe(0);return _e(ue(t,Fe(n=>n>0),ve(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Dt(Io)),B2=lt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=tt(),o=Cn(ue(sn(e,r,t,n,i),ve(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return _e(Me(o),a),{totalListHeight:o,totalListHeightChanged:a}},Dt($n,Io),{singleton:!0});function $2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const a7=$2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),o7=lt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:h},{log:f},{recalcInProgress:g}])=>{const p=tr(ue(l,Ge(s),ri(([,b,v,x],[{items:C,totalCount:E,bottom:w,offsetBottom:B},y])=>{const S=w+B;let D=0;return v===E&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(D=S-x,D!==0&&(D+=y))),[D,C,E,S]},[0,[],0,0]),Fe(([b])=>b!==0),Ge(t,o,r,a,f,g),Fe(([,b,v,x,,,C])=>!C&&!x&&b!==0&&v===Ml),ve(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},nr.DEBUG),b))));function m(b){b>0?(We(e,{top:-b,behavior:"auto"}),We(n,0)):(We(n,0),We(e,{top:-b,behavior:"auto"}))}return mt(ue(p,Ge(n,i)),([b,v,x])=>{x&&a7()?We(n,v-b):m(-b)}),mt(ue(sn(Cn(i,!1),n,g),Fe(([b,v,x])=>!b&&!x&&v!==0),ve(([b,v])=>v),ua(1)),m),_e(ue(c,ve(b=>({top:-b}))),e),mt(ue(u,Ge(d,h),ve(([b,{lastSize:v,groupIndices:x,sizeTree:C},E])=>{function w(B){return B*(v+E)}if(x.length===0)return w(b);{let B=0;const y=Fl(C,0);let S=0,D=0;for(;S<b;){S++,B+=y;let A=x.length===D+1?1/0:x[D+1]-x[D]-1;S+A>b&&(B-=y,A=b-S+1),S+=A,B+=w(A),D++}return B}})),b=>{We(n,b),requestAnimationFrame(()=>{We(e,{top:b}),requestAnimationFrame(()=>{We(n,0),We(g,!1)})})}),{deviation:n}},Dt($n,yu,Io,pi,Ra,Vp)),s7=lt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return mt(ue(e,Ge(r),Fe(([,i])=>i!==0),ve(([,i])=>({top:i}))),i=>{di(ue(n,bs(1),Fe(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{We(t,i)})})}),{initialScrollTop:r}},Dt(Ba,$n,Io),{singleton:!0}),l7=lt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=Cn(ue(sn(n,e,t),Fe(([i])=>i),ve(([,i,a])=>Math.max(0,i-a)),ua(0),_t()),0);return{alignToBottom:n,paddingTopAddition:r}},Dt($n,B2),{singleton:!0}),Gp=lt(([{scrollTo:e,scrollContainerState:t}])=>{const n=tt(),r=tt(),i=tt(),a=fe(!1),o=fe(void 0);return _e(ue(sn(n,r),ve(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),_e(ue(e,Ge(r),ve(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Dt($n)),u7=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,c7=lt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=tt();return _e(ue(c,Ge(e,i,t,a,o,s,r),Ge(n),ve(([[d,h,f,g,p,m,b,v],x])=>{const{done:C,behavior:E,align:w,calculateViewLocation:B=u7,...y}=d,S=w2(d,h,g-1),D=Nl(S,h.offsetTree,x)+p+m,A=D+Nr(h.sizeTree,S)[1],T=v+m,F=v+f-b,k=B({itemTop:D,itemBottom:A,viewportTop:T,viewportBottom:F,locationParams:{behavior:E,align:w,...y}});return k?C&&di(ue(l,Fe(P=>P===!1),bs(xn(l)?1:2)),C):C&&C(),k}),Fe(d=>d!==null)),u),{scrollIntoView:c}},Dt(pi,$n,vu,Io,Ra),{singleton:!0}),d7=lt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=tt(),u=fe(void 0),c=fe(null),d=fe(null);return _e(o,c),_e(s,d),mt(ue(l,Ge(e,n,a,c,d)),([h,f,g,p,m,b])=>{const v=Uk(f.sizeTree);p&&m!==null&&b!==null&&(g=m.scrollTop-b.offsetTop),h({ranges:v,scrollTop:g})}),_e(ue(u,Fe(Np),ve(f7)),r),_e(ue(i,Ge(u),Fe(([,h])=>h!==void 0),_t(),ve(([,h])=>h.ranges)),t),{getState:l,restoreStateFrom:u}},Dt(pi,$n,xu,Ba,Gp));function f7(e){return{offset:e.scrollTop,index:0,align:"start"}}const h7=lt(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Dt(zp,r7,Ba,R2,B2,s7,l7,Gp,c7,Ra)),k2=lt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g},p,m,b,{listState:v,topItemsIndexes:x,...C},{scrollToIndex:E},w,{topItemCount:B},{groupCounts:y},S])=>(_e(C.rangeChanged,S.scrollSeekRangeChanged),_e(ue(S.windowViewportRect,ve(D=>D.visibleHeight)),p.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g,topItemsIndexes:x,topItemCount:B,groupCounts:y,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:E,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...S,...p,sizes:d,...m}),Dt(pi,xu,$n,d7,e7,Io,vu,o7,i7,D2,h7)),mh="-webkit-sticky",Rb="sticky",P2=$2(()=>{if(typeof document>"u")return Rb;const e=document.createElement("div");return e.style.position=mh,e.style.position===mh?mh:Rb});function Up(e,t){const n=I.useRef(null),r=I.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;c=h.height-Math.max(0,f),d=f+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=Op(r),o=I.useCallback(()=>{r(a.current)},[r,a]);return I.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const Sf=I.createContext(void 0),F2=I.createContext(void 0);function Xp(e){return e}const g7=lt(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),i=fe(Xp),a=fe("div"),o=fe(wo),s=(l,u=null)=>Cn(ue(r,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),p7=lt(([e,t])=>({...e,...t}),Dt(k2,g7)),m7=({height:e})=>I.createElement("div",{style:{height:e}}),b7={position:P2(),zIndex:1,overflowAnchor:"none"},v7={overflowAnchor:"none"},Bb=I.memo(function({showTopList:t=!1}){const n=Ke("listState"),r=xr("sizeRanges"),i=Ke("useWindowScroll"),a=Ke("customScrollParent"),o=xr("windowScrollContainerState"),s=xr("scrollContainerState"),l=a||i?o:s,u=Ke("itemContent"),c=Ke("context"),d=Ke("groupContent"),h=Ke("trackItemSizes"),f=Ke("itemSize"),g=Ke("log"),p=xr("gap"),{callbackRef:m}=p2(r,f,h,t?wo:l,g,p,a),[b,v]=I.useState(0);Kp("deviation",k=>{b!==k&&v(k)});const x=Ke("EmptyPlaceholder"),C=Ke("ScrollSeekPlaceholder")||m7,E=Ke("ListComponent"),w=Ke("ItemComponent"),B=Ke("GroupComponent"),y=Ke("computeItemKey"),S=Ke("isSeeking"),D=Ke("groupIndices").length>0,A=Ke("alignToBottom"),T=Ke("initialItemFinalLocationReached"),F=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:A?"auto":0,...T?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?I.createElement(x,Ft(x,c)):I.createElement(E,{...Ft(E,c),ref:m,style:F,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const P=k.originalIndex,$=y(P+n.firstItemIndex,k.data,c);return S?I.createElement(C,{...Ft(C,c),key:$,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?I.createElement(B,{...Ft(B,c),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,style:b7},d(k.index,c)):I.createElement(w,{...Ft(w,c),...N2(w,k.data),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:v7},D?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),y7={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},$s=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),x7={width:"100%",position:P2(),top:0,zIndex:1};function Ft(e,t){if(typeof e!="string")return{context:t}}function N2(e,t){return{item:typeof e=="string"?void 0:t}}const C7=I.memo(function(){const t=Ke("HeaderComponent"),n=xr("headerHeight"),r=Ke("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),E7=I.memo(function(){const t=Ke("FooterComponent"),n=xr("footerHeight"),r=Ke("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null});function Zp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:g,scrollToCallback:p}=b2(l,c,u,d);return t("scrollTo",p),t("scrollBy",g),I.createElement(u,{ref:f,style:{...y7,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...Ft(u,h)},o)})}function Yp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),g=n("context"),{scrollerRef:p,scrollByCallback:m,scrollToCallback:b}=b2(l,c,u,wo,f);return Bk(()=>(p.current=f||window,()=>{p.current=null}),[p,f]),t("windowScrollTo",b),t("scrollBy",m),I.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...s,...Ft(u,g)},o)})}const S7=({children:e})=>{const t=I.useContext(Sf),n=xr("viewportHeight"),r=xr("fixedItemHeight"),i=Ke("alignToBottom"),a=fi(kl(n,o=>Fr(o,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:$s(i),ref:a,"data-viewport-type":"element"},e)},w7=({children:e})=>{const t=I.useContext(Sf),n=xr("windowViewportRect"),r=xr("fixedItemHeight"),i=Ke("customScrollParent"),a=Up(n,i),o=Ke("alignToBottom");return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(o),"data-viewport-type":"window"},e)},I7=({children:e})=>{const t=Ke("TopItemListComponent")||"div",n=Ke("headerHeight"),r={...x7,marginTop:`${n}px`},i=Ke("context");return I.createElement(t,{style:r,...Ft(t,i)},e)},_7=I.memo(function(t){const n=Ke("useWindowScroll"),r=Ke("topItemsIndexes").length>0,i=Ke("customScrollParent"),a=i||n?T7:A7,o=i||n?w7:S7;return I.createElement(a,{...t},r&&I.createElement(I7,null,I.createElement(Bb,{showTopList:!0})),I.createElement(o,null,I.createElement(C7,null),I.createElement(Bb,null),I.createElement(E7,null)))}),{Component:D7,usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}=Lp(p7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},_7),A7=Zp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),T7=Yp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),R7=D7,$b={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},B7={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:kb,ceil:Pb,floor:Ed,min:bh,max:bl}=Math;function $7(e){return{...B7,items:e}}function Fb(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function k7(e,t){return e&&e.column===t.column&&e.row===t.row}function Gu(e,t){return e&&e.width===t.width&&e.height===t.height}const P7=lt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,h,{propsReady:f,didMount:g},{windowViewportRect:p,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:x},C])=>{const E=fe(0),w=fe(0),B=fe($b),y=fe({height:0,width:0}),S=fe({height:0,width:0}),D=tt(),A=tt(),T=fe(0),F=fe(null),k=fe({row:0,column:0}),P=tt(),$=tt(),R=fe(!1),O=fe(0),j=fe(!0),V=fe(!1);mt(ue(g,Ge(O),Fe(([H,X])=>!!X)),()=>{We(j,!1),We(w,0)}),mt(ue(sn(g,j,S,y,O,V),Fe(([H,X,te,ie,,le])=>H&&!X&&te.height!==0&&ie.height!==0&&!le)),([,,,,H])=>{We(V,!0),jp(1,()=>{We(D,H)}),di(ue(r),()=>{We(n,[0,0]),We(j,!0)})}),_e(ue($,Fe(H=>H!=null&&H.scrollTop>0),qr(0)),w),mt(ue(g,Ge($),Fe(([,H])=>H!=null)),([,H])=>{H&&(We(y,H.viewport),We(S,H==null?void 0:H.item),We(k,H.gap),H.scrollTop>0&&(We(R,!0),di(ue(r,bs(1)),X=>{We(R,!1)}),We(o,{top:H.scrollTop})))}),_e(ue(y,ve(({height:H})=>H)),i),_e(ue(sn(Me(y,Gu),Me(S,Gu),Me(k,(H,X)=>H&&H.column===X.column&&H.row===X.row),Me(r)),ve(([H,X,te,ie])=>({viewport:H,item:X,gap:te,scrollTop:ie}))),P),_e(ue(sn(Me(E),t,Me(k,k7),Me(S,Gu),Me(y,Gu),Me(F),Me(w),Me(R),Me(j),Me(O)),Fe(([,,,,,,,H])=>!H),ve(([H,[X,te],ie,le,ce,Q,be,,Ce,Se])=>{const{row:un,column:ye}=ie,{height:Ee,width:He}=le,{width:bt}=ce;if(be===0&&(H===0||bt===0))return $b;if(He===0){const Gf=Wp(Se,H),vI=Gf===0?Math.max(be-1,0):Gf;return $7(Fb(Gf,vI,Q))}const Yt=M2(bt,He,ye);let at,Qe;Ce?X===0&&te===0&&be>0?(at=0,Qe=be-1):(at=Yt*Ed((X+un)/(Ee+un)),Qe=Yt*Pb((te+un)/(Ee+un))-1,Qe=bh(H-1,bl(Qe,Yt-1)),at=bh(Qe,bl(0,at))):(at=0,Qe=-1);const or=Fb(at,Qe,Q),{top:wr,bottom:Ir}=Nb(ce,ie,le,or),Ro=Pb(H/Yt),bI=Ro*Ee+(Ro-1)*un-Ir;return{items:or,offsetTop:wr,offsetBottom:bI,top:wr,bottom:Ir,itemHeight:Ee,itemWidth:He}})),B),_e(ue(F,Fe(H=>H!==null),ve(H=>H.length)),E),_e(ue(sn(y,S,B,k),Fe(([H,X,{items:te}])=>te.length>0&&X.height!==0&&H.height!==0),ve(([H,X,{items:te},ie])=>{const{top:le,bottom:ce}=Nb(H,ie,X,te);return[le,ce]}),_t(Ll)),n);const W=fe(!1);_e(ue(r,Ge(W),ve(([H,X])=>X||H!==0)),W);const U=tr(ue(Me(B),Fe(({items:H})=>H.length>0),Ge(E,W),Fe(([{items:H},X,te])=>te&&H[H.length-1].index===X-1),ve(([,H])=>H-1),_t())),K=tr(ue(Me(B),Fe(({items:H})=>H.length>0&&H[0].index===0),qr(0),_t())),ee=tr(ue(Me(B),Ge(R),Fe(([{items:H},X])=>H.length>0&&!X),ve(([{items:H}])=>({startIndex:H[0].index,endIndex:H[H.length-1].index})),_t(A2),ua(0)));_e(ee,h.scrollSeekRangeChanged),_e(ue(D,Ge(y,S,E,k),ve(([H,X,te,ie,le])=>{const ce=_2(H),{align:Q,behavior:be,offset:Ce}=ce;let Se=ce.index;Se==="LAST"&&(Se=ie-1),Se=bl(0,Se,bh(ie-1,Se));let un=ag(X,le,te,Se);return Q==="end"?un=kb(un-X.height+te.height):Q==="center"&&(un=kb(un-X.height/2+te.height/2)),Ce&&(un+=Ce),{top:un,behavior:be}})),o);const z=Cn(ue(B,ve(H=>H.offsetBottom+H.bottom)),0);return _e(ue(p,ve(H=>({width:H.visibleWidth,height:H.visibleHeight}))),y),{data:F,totalCount:E,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:D,smoothScrollTargetReached:s,windowViewportRect:p,windowScrollTo:x,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,deviation:T,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:w,gap:k,restoreStateFrom:$,...h,initialTopMostItemIndex:O,gridState:B,totalListHeight:z,...d,startReached:K,endReached:U,rangeChanged:ee,stateChanged:P,propsReady:f,stateRestoreInProgress:R,...C}},Dt(zp,$n,yu,R2,Ba,Gp,Ra));function Nb(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=ag(e,t,n,r[0].index),o=ag(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function ag(e,t,n,r){const i=M2(e.width,n.width,t.column),a=Ed(r/i),o=a*n.height+bl(0,a-1)*t.row;return o>0?o+t.row:o}function M2(e,t,n){return bl(1,Ed((e+n)/(Ed(t)+n)))}const F7=lt(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),i=fe("virtuoso-grid-list"),a=fe(Xp),o=fe("div"),s=fe(wo),l=(u,c=null)=>Cn(ue(t,ve(d=>d[u]),_t()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),N7=lt(([e,t])=>({...e,...t}),Dt(P7,F7)),M7=I.memo(function(){const t=$t("gridState"),n=$t("listClassName"),r=$t("itemClassName"),i=$t("itemContent"),a=$t("computeItemKey"),o=$t("isSeeking"),s=kr("scrollHeight"),l=$t("ItemComponent"),u=$t("ListComponent"),c=$t("ScrollSeekPlaceholder"),d=$t("context"),h=kr("itemDimensions"),f=kr("gap"),g=$t("log"),p=$t("stateRestoreInProgress"),m=fi(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const x=b.firstChild;if(x){const{width:C,height:E}=x.getBoundingClientRect();h({width:C,height:E})}f({row:Mb("row-gap",getComputedStyle(b).rowGap,g),column:Mb("column-gap",getComputedStyle(b).columnGap,g)})});return p?null:I.createElement(u,{ref:m,className:n,...Ft(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?I.createElement(c,{key:v,...Ft(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):I.createElement(l,{...Ft(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),L7=I.memo(function(){const t=$t("HeaderComponent"),n=kr("headerHeight"),r=$t("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),O7=I.memo(function(){const t=$t("FooterComponent"),n=kr("footerHeight"),r=$t("headerFooterTag"),i=fi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),V7=({children:e})=>{const t=I.useContext(F2),n=kr("itemDimensions"),r=kr("viewportDimensions"),i=fi(a=>{r(a.getBoundingClientRect())});return I.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),I.createElement("div",{style:$s(!1),ref:i},e)},H7=({children:e})=>{const t=I.useContext(F2),n=kr("windowViewportRect"),r=kr("itemDimensions"),i=$t("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(!1)},e)},j7=I.memo(function({...t}){const n=$t("useWindowScroll"),r=$t("customScrollParent"),i=r||n?z7:W7,a=r||n?H7:V7;return I.createElement(i,{...t},I.createElement(a,null,I.createElement(L7,null),I.createElement(M7,null),I.createElement(O7,null)))}),{usePublisher:kr,useEmitterValue:$t,useEmitter:L2}=Lp(N7,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},j7),W7=Zp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2}),z7=Yp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2});function Mb(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}const G7=lt(()=>{const e=fe(l=>I.createElement("td",null,"Item $",l)),t=fe(null),n=fe(null),r=fe(null),i=fe({}),a=fe(Xp),o=fe(wo),s=(l,u=null)=>Cn(ue(i,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),U7=lt(([e,t])=>({...e,...t}),Dt(k2,G7)),X7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e}})),Z7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e,padding:0,border:0}})),Y7={overflowAnchor:"none"},K7=I.memo(function(){const t=ht("listState"),n=Pr("sizeRanges"),r=ht("useWindowScroll"),i=ht("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),s=i||r?a:o,l=ht("itemContent"),u=ht("trackItemSizes"),c=ht("itemSize"),d=ht("log"),{callbackRef:h,ref:f}=p2(n,c,u,s,d,void 0,i),[g,p]=I.useState(0);qp("deviation",$=>{g!==$&&(f.current.style.marginTop=`${$}px`,p($))});const m=ht("EmptyPlaceholder"),b=ht("ScrollSeekPlaceholder")||X7,v=ht("FillerRow")||Z7,x=ht("TableBodyComponent"),C=ht("TableRowComponent"),E=ht("computeItemKey"),w=ht("isSeeking"),B=ht("paddingTopAddition"),y=ht("firstItemIndex"),S=ht("statefulTotalCount"),D=ht("context");if(S===0&&m)return I.createElement(m,Ft(m,D));const A=t.offsetTop+B+g,T=t.offsetBottom,F=A>0?I.createElement(v,{height:A,key:"padding-top",context:D}):null,k=T>0?I.createElement(v,{height:T,key:"padding-bottom",context:D}):null,P=t.items.map($=>{const R=$.originalIndex,O=E(R+y,$.data,D);return w?I.createElement(b,{...Ft(b,D),key:O,index:$.index,height:$.size,type:$.type||"item"}):I.createElement(C,{...Ft(C,D),...N2(C,$.data),key:O,"data-index":R,"data-known-size":$.size,"data-item-index":$.index,style:Y7},l($.index,$.data,D))});return I.createElement(x,{ref:h,"data-testid":"virtuoso-item-list",...Ft(x,D)},[F,...P,k])}),q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("viewportHeight"),r=Pr("fixedItemHeight"),i=fi(kl(n,a=>Fr(a,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:$s(!1),ref:i,"data-viewport-type":"element"},e)},J7=({children:e})=>{const t=I.useContext(Sf),n=Pr("windowViewportRect"),r=Pr("fixedItemHeight"),i=ht("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:$s(!1),"data-viewport-type":"window"},e)},Q7=I.memo(function(t){const n=ht("useWindowScroll"),r=ht("customScrollParent"),i=Pr("fixedHeaderHeight"),a=Pr("fixedFooterHeight"),o=ht("fixedHeaderContent"),s=ht("fixedFooterContent"),l=ht("context"),u=fi(kl(i,v=>Fr(v,"height"))),c=fi(kl(a,v=>Fr(v,"height"))),d=r||n?nP:tP,h=r||n?J7:q7,f=ht("TableComponent"),g=ht("TableHeadComponent"),p=ht("TableFooterComponent"),m=o?I.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...Ft(g,l)},o()):null,b=s?I.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...Ft(p,l)},s()):null;return I.createElement(d,{...t},I.createElement(h,null,I.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Ft(f,l)},[m,I.createElement(K7,{key:"TableBody"}),b])))}),{Component:eP,usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}=Lp(U7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Q7),tP=Zp({usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}),nP=Yp({usePublisher:Pr,useEmitterValue:ht,useEmitter:qp}),rP=eP,iP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),aP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),Jp=I.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:d,typeCalculateItemSize:h="manual",itemSizeNames:f=[],overscan:g=null,component:p={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:x=0,increaseViewportBy:C=()=>0,context:E={},endReached:w,increaseTotalCount:B=1}=e,[y,S]=I.useState(0),D=()=>{if(o==="min-max"){const F=(a+B)*s;return{height:a>u?l:y>F?y:F}}return o==="container"?{height:y}:{}},A=F=>{var $;const k=F.getAttribute("data-index");let P=(($=F.getBoundingClientRect())==null?void 0:$.height)||0;return f==null||f.forEach(R=>{var O,j;P+=((j=(O=document.querySelector(`[${R}="${k}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:j.height)??0}),P},T=()=>{var F;if(m&&o==="container"){const k=((F=document==null?void 0:document.getElementById(m))==null?void 0:F.offsetHeight)??0;S(k-v)}};return I.useEffect(()=>{const F=setTimeout(T,x);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout(F),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,b]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(rP,{context:E,ref:t,overscan:typeof g=="function"?g(o==="container"?y:l):o==="container"?y:l,totalListHeightChanged:F=>o==="min-max"?S(F):null,style:D(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(F=>h==="manual"?i(F):A(F),[]),components:{TableRow:aP,...p},fixedHeaderContent:c,itemContent:(...F)=>d(iP,...F),endReached:w,increaseViewportBy:C(o==="container"?y:l)})})});Jp.displayName="TableVirtualization";const oP="_sorting_1a30n_536",en={"payhere-reguler":"_payhere-reguler_1a30n_109","laba-reguler":"_laba-reguler_1a30n_259","laba-rounded-md-extra-small":"_laba-rounded-md-extra-small_1a30n_259","laba-small_body-small":"_laba-small_body-small_1a30n_295","laba-small":"_laba-small_1a30n_295","bill-reguler":"_bill-reguler_1a30n_421","pointer-laba":"_pointer-laba_1a30n_489","pointer-payhere":"_pointer-payhere_1a30n_494","pointer-bill":"_pointer-bill_1a30n_499","resize-menu":"_resize-menu_1a30n_504",sorting:oP,"laba-grey-02":"_laba-grey-02_1a30n_557","laba-blue-01_border-transparent":"_laba-blue-01_border-transparent_1a30n_566"};function sP(e,t=null){const[n,r]=I.useState(!1);return I.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const vh=e=>{const t=e.getTime()-Date.now();return Math.max(Math.floor(t/1e3),0)},lP=e=>{const t=I.useMemo(()=>{const f=new Date(e.date);return e.adjustTimesTime&&f.setHours(f.getHours()-e.adjustTimesTime),f},[e.date,e.adjustTimesTime]),[n,r]=I.useState(t),[i,a]=I.useState(()=>vh(n)),[o,s]=I.useState(e.running??!1),[l,u]=I.useState(()=>e==null?void 0:e.callbackDone);return I.useEffect(()=>{let f;return o&&i>0&&(f=setInterval(()=>{const g=vh(n);a(g),g<=0&&(s(!1),f&&clearInterval(f),typeof l=="function"&&l())},e.intervalMs)),()=>{f&&clearInterval(f)}},[o,n,e.intervalMs,l,i]),{count:i,isRunning:o,startCountdown:()=>{!o&&i>0&&s(!0)},stopCountdown:()=>{s(!1)},resetCountdown:f=>{let g;f instanceof Date?g=f:typeof f=="number"?g=new Date(Date.now()+f*1e3):g=t,r(g);const p=vh(g);a(p),p<=0&&s(!1)},setCallbackDone:f=>u(()=>f)}};function O2(e,t=0){const n=I.useRef({promise:null,resolve:null,reject:null,timeout:null});return I.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const wf=typeof window<"u"?I.useLayoutEffect:I.useEffect,uP=(e,t)=>{const[n,r]=I.useState({width:0,height:0}),[i,a]=I.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=I.useRef(null);return wf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const h of d){const{width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C}=h.contentRect;a({width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function cP(e){const[t,n]=I.useState(e),r=I.useRef(t);return I.useEffect(()=>{r.current=t},[t]),[t,n,r]}function dP(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function fP(...e){return t=>{e.forEach(n=>{dP(n,t)})}}function If(...e){return I.useMemo(()=>fP(...e),e)}function Ol(e){const t=I.useRef(e);return vp(e,t.current)||(t.current=e),t.current}function ba(e,t){const n=t.map(Ol);I.useEffect(e,n)}function hP({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){I.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const gP=({containerRef:e,children:t,columnCount:n,gapX:r,gapY:i,direction:a="masonry-ltr",debounceRecalculate:o=500,durationAnimation:s=500,enableAnimation:l=!1})=>{const u=I.useCallback(()=>{const d=e.current;if(!d)return;const h=Array.from(d.children);if(h.length===0){d.style.height="0px";return}const f=Array(n).fill(0),g=d.offsetWidth;if(g===0)return;const p=(g-(n-1)*r)/n,m=a.includes("rtl"),b=a.includes("top-down");h.forEach((x,C)=>{x.style.width=`${p}px`,x.style.position="absolute",l&&(x.style.transition=`top ${s}ms ease, left ${s}ms ease`);let E;if(b)E=C%n;else{const y=Math.min(...f);E=f.indexOf(y)}const w=f[E];let B;m?B=g-(p*(E+1)+r*E):B=E*(p+r),x.style.top=`${w}px`,x.style.left=`${B}px`,f[E]+=x.offsetHeight+i});const v=Math.max(...f);d.style.height=`${v-i}px`},[e,n,r,a,i]),c=O2(async()=>{u()},o);return I.useLayoutEffect(()=>{u()},[t,u]),I.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},pP=({id:e,numInputs:t,onComplete:n,disableFocusOnEdit:r=!1,blurOnComplete:i=!1,disableOnComplete:a=!1})=>{const[o,s]=I.useState(()=>Array(t).fill("")),l=I.useRef([]),[u]=I.useState(()=>`otp-${Math.random().toString(36).slice(2,9)}`),c=e||u;I.useEffect(()=>{l.current=l.current.slice(0,t)},[t]);const d=I.useCallback((v,x)=>{var D,A;const C=v.target.value,E=C.length>1?C.slice(-1):C,w=o[x]!=="",B=[...o];B[x]=E,s(B);const y=B.join(""),S=!B.slice(0,t).includes("");E!==""&&x<t-1&&(r&&w&&S||(D=l.current[x+1])==null||D.focus()),S&&(typeof n=="function"&&n(y),i&&((A=l.current[x])==null||A.blur()))},[o,t,n,r,i]),h=I.useCallback((v,x)=>{var C,E,w,B,y;switch(v.key){case"Backspace":if(o[x]===""&&x>0){v.preventDefault();const S=[...o];S[x-1]="",s(S),(C=l.current[x-1])==null||C.focus()}break;case"ArrowLeft":x>0&&(v.preventDefault(),(E=l.current[x-1])==null||E.focus());break;case"ArrowRight":x<t-1&&(v.preventDefault(),(w=l.current[x+1])==null||w.focus());break;case"Home":v.preventDefault(),(B=l.current[0])==null||B.focus();break;case"End":v.preventDefault(),(y=l.current[t-1])==null||y.focus();break}},[o,t]),f=I.useCallback((v,x)=>{var D,A;v.preventDefault();const C=v.clipboardData.getData("text").trim();if(!C)return;const E=[...o];let w=x;for(const T of C){if(w>=t)break;E[w]=T,w++}s(E);const B=E.join(""),y=!E.includes(""),S=Math.min(w,t-1);(D=l.current[S])==null||D.focus(),y&&(typeof n=="function"&&n(B),i&&((A=l.current[S])==null||A.blur()))},[o,t,n,i]),g=v=>{v.target.select()},p=()=>{var v;s(Array(t).fill("")),(v=l.current[0])==null||v.focus()},m=v=>{if(v<0||v>=t)throw new Error(`useOtpInput: index ${v} is out of bounds for numInputs ${t}.`);const x=o.join("").length===t;return{id:`${c}-${v}`,"aria-label":`OTP digit ${v+1} of ${t}`,ref:C=>{l.current[v]=C},value:o[v],onChange:C=>d(C,v),onKeyDown:C=>h(C,v),onPaste:C=>f(C,v),onFocus:g,disabled:a&&x,type:"text",inputMode:"numeric",autoComplete:"one-time-code"}};return{getInputProps:m,getInputData:v=>({...JC(m(v),["onChange","onKeyDown","onPaste","onFocus","aria-label","autoComplete"]),isOtpFilled:o[v]!==""}),otpValues:o,otpString:o.join(""),clearOtp:p,isOtpComplete:o.join("").length===t}},Fo={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_elvgc_115"},lr="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",cn=()=>({kind:{"payhere-reguler":en["payhere-reguler"],"laba-reguler":en["laba-reguler"],"laba-small":en["laba-small"],"laba-rounded-md-extra-small":en["laba-rounded-md-extra-small"],"laba-small_body-small":en["laba-small_body-small"],"bill-reguler":en["bill-reguler"]},subMobile:{"payhere-reguler":Fo["sub-mobile-payhere-reguler"],"laba-reguler":Fo["sub-mobile-laba-reguler"],"laba-small":Fo["sub-mobile-laba-small"],"laba-rounded-md-extra-small":Fo["sub-mobile-laba-rounded-md-extra-small"],"laba-small_body-small":Fo["sub-mobile-laba-small_body-small"],"bill-reguler":Fo["sub-mobile-bill-reguler"]},pointer:{"payhere-reguler":en["pointer-payhere"],"laba-reguler":en["pointer-laba"],"laba-small":en["pointer-laba"],"laba-rounded-md-extra-small":en["pointer-laba"],"laba-small_body-small":en["pointer-laba"],"bill-reguler":en["pointer-bill"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"bill-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-rounded-md-extra-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small_body-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":en["laba-grey-02"],"laba-blue-01_border-transparent":en["laba-blue-01_border-transparent"]}});Object.keys(cn().kind);Object.keys(cn().variant);const mP=(e,t)=>{var r,i;let n={};return e&&(n={position:"sticky",top:0,zIndex:2}),(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},Sd=(e,t=!1)=>{const n=e.getIsPinned(),r=n==="left"&&e.getIsLastColumn("left"),i=n==="right"&&e.getIsFirstColumn("right");return n?{boxShadow:r?"-4px 0 4px -4px gray inset":i?"4px 0 4px -4px gray inset":void 0,left:n==="left"?`${e.getStart("left")}px`:void 0,right:n==="right"?`${e.getAfter("right")}px`:void 0,position:"sticky",width:e.getSize(),zIndex:1,background:t?"white":""}:{}},V2=e=>{const t=e.columnPinning.left||[],n=e.columnPinning.right||[],r=e.rowPinning.top||[],i=e.rowPinning.bottom||[];return{left:t,right:n,top:r,bottom:i,isPinning:t.length>0||n.length>0||r.length>0||i.length>0}},bP=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,theadTrId:s,maxHeight:l,idCalculateHeight:u,componentSortASC:c,componentSortDESC:d,classNamePointer:h,emptyPlaceholder:f,renderSubComponent:g,visibilityColumns:p,classNameSubMobile:m})=>_.jsx("div",{id:"1ru-table",style:l?{height:l,overflow:"auto"}:{},className:t??"",children:_.jsxs("table",{className:n,style:{width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[_.jsx("thead",{id:a,"data-calculate-height-header":u,children:e.getHeaderGroups().map(b=>_.jsx("tr",{children:b.headers.map(v=>{var C,E,w,B;const x=(E=(C=v.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:E.call(C,v);return!v.isPlaceholder&&x!==void 0&&v.id===v.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{style:{...mP(l,v),...Sd(v.column),...p.columns.includes(v.column.id)?{display:"none"}:{}},id:`${s(v)}-${v.id}`,colSpan:typeof((w=v.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(B=v.column.columnDef.meta)==null?void 0:B.colSpan(v.column.columnDef):v.colSpan,rowSpan:x,children:[v.isPlaceholder&&x===void 0?null:_.jsxs("div",{className:v.column.getCanSort()?en.sorting:"",onClick:v.column.getToggleSortingHandler(),id:v.column.getCanSort()?`${s(v)}-${v.id}-sort`:"",children:[ms(v.column.columnDef.header,v.getContext()),v.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:v.column.getIsSorted()==="asc"||v.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[v.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:c}),v.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:d})]}):_.jsx(_.Fragment,{})})]}),v.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>v.column.resetSize(),onMouseDown:v.getResizeHandler(),onTouchStart:v.getResizeHandler(),className:en["resize-menu"]})]},v.id)})},b.id))}),_.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,v)=>{var x;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?h:"","data-calculate-height":`${u}-${v}`,id:o(b),children:b.getVisibleCells().map(C=>{var E,w,B;return _.jsx("td",{style:{...typeof((E=C.column.columnDef.meta)==null?void 0:E.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...Sd(C.column,!0),...p.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(B=C.column.columnDef.meta)==null?void 0:B.classNameTd(b.original,b):"",id:`${o(b)}-${C.column.id}`,children:ms(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof g=="function"&&_.jsx("tr",{children:_.jsx("td",{colSpan:b.getVisibleCells().length-(((x=p==null?void 0:p.realColumns)==null?void 0:x.length)||0),children:g(b.original,b,{visibilityColumns:p,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&I.isValidElement(f)&&_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),H2=I.forwardRef((e,t)=>{const{context:n,...r}=e;return _.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});H2.displayName="VirtualizationHead";const vP=({style:e,context:t,...n})=>_.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),yP=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,theadTrId:s,classNameTable:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:h,renderSubComponent:f,visibilityColumns:g,classNameSubMobile:p})=>{var v,x,C;const[m,b]=I.useState(0);return _.jsx(Jp,{context:{headerId:a,classNameTable:l,width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((v=e.getRowModel().rows)==null?void 0:v.length)||0,minLengthItem:((x=e.getRowModel().rows)==null?void 0:x.length)||0,typeCalculateItemSize:"auto",component:{TableHead:H2,Table:vP,EmptyPlaceholder:()=>_.jsx("tbody",{ref:E=>{var w;return b(((w=E==null?void 0:E.getBoundingClientRect())==null?void 0:w.height)??0)},children:_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:I.isValidElement(h)&&h})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(E=>_.jsx("tr",{children:E.headers.map(w=>{var y,S,D,A;const B=(S=(y=w.column.columnDef.meta)==null?void 0:y.rowSpan)==null?void 0:S.call(y,w);return!w.isPlaceholder&&B!==void 0&&w.id===w.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{id:`${s(w)}-${w.id}`,colSpan:w.colSpan,rowSpan:B,style:{...typeof((D=w.column.columnDef.meta)==null?void 0:D.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...Sd(w.column),...g.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&B===void 0?null:_.jsxs("div",{className:w.column.getCanSort()?en.sorting:"",onClick:w.column.getToggleSortingHandler(),id:w.column.getCanSort()?`${s(w)}-${w.id}-sort`:"",children:[ms(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[w.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:u}),w.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:c})]}):_.jsx(_.Fragment,{})})]}),w.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:en["resize-menu"]})]},w.id)})},E.id)),itemContent:(E,w)=>{var y,S;const B=(S=(y=e.getRowModel())==null?void 0:y.rows)==null?void 0:S[w];return _.jsx(E,{children:({...D})=>{var A;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{...D,onClick:T=>{T.stopPropagation(),r&&typeof n=="function"&&n(B.original,B)},className:r?d:"",id:o(B),children:B.getVisibleCells().map(T=>{var F,k,P;return _.jsx(_.Fragment,{children:_.jsx("td",{style:{...typeof((F=T.column.columnDef.meta)==null?void 0:F.styleTd)=="function"?T.column.columnDef.meta.styleTd(B.original,B):{},...Sd(T.column,!0),...g.columns.includes(T.column.id)?{display:"none"}:{}},className:typeof((k=T.column.columnDef.meta)==null?void 0:k.classNameTd)=="function"?(P=T.column.columnDef.meta)==null?void 0:P.classNameTd(B.original,B):"",id:`${o(B)}-${T.column.id}`,children:ms(T.column.columnDef.cell,T.getContext())},T.id)})})}),B.getIsExpanded()&&typeof f=="function"&&_.jsx("tr",{"data-sub-component":w,children:_.jsx("td",{colSpan:B.getVisibleCells().length-(((A=g==null?void 0:g.realColumns)==null?void 0:A.length)||0),children:f(B.original,B,{visibilityColumns:g,classNameSubMobile:p})})})]},B.id)}},B.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((C=e.getRowModel().rows)==null?void 0:C.length)||0)>0?0:m),itemSizeNames:typeof f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},xP=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",theadTrId:c=()=>"",maxHeight:d=0,idCalculateHeight:h=void 0,kind:f="laba-reguler",componentSortASC:g,componentSortDESC:p,scrollTop:m=!1,emptyPlaceholder:b,variant:v,renderSubComponent:x,columnBreakpoints:C})=>{var A;const[E,w]=I.useState(0),[B,y]=I.useState({columns:[],realColumns:[]}),S=()=>{if(![void 0,"undefined"].includes(h)){const T=document.querySelector(`[data-calculate-height-header="${h}"]`);let F=0;const k=document.querySelectorAll(`[data-calculate-height^="${h}-"]`);return k==null||k.forEach(P=>{F+=P.offsetHeight}),F>d?d+T.offsetHeight:0}return d},D=()=>{var P;const T=((P=document.querySelector("body"))==null?void 0:P.offsetWidth)||0,F=C==null?void 0:C.sort(($,R)=>{const O=($.maxWidth??$.minWidth)||0,j=(R.maxWidth??R.minWidth)||0;return O!==j?O-j:$.maxWidth?-1:1}),k=(F==null?void 0:F.find($=>!!(Object.hasOwnProperty.call($,"maxWidth")&&T<=($.maxWidth||0)||Object.hasOwnProperty.call($,"minWidth")&&T>=($.minWidth||0))))||{};Object.keys(k).length>0?(y({columns:k.columns,realColumns:k.realColumns||k.columns}),k!=null&&k.resetExpanded&&e.resetExpanded()):y({columns:[],realColumns:[]})};return ba(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),ba(()=>{d>0&&w(S())},[(A=e==null?void 0:e.options)==null?void 0:A.data,d]),ba(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return D(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[C]),_.jsxs(_.Fragment,{children:[!o&&_.jsx(bP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
67
67
  ${m?cn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,maxHeight:E,idCalculateHeight:h,componentSortASC:I.isValidElement(g)?g:cn().sortingIcon[f].asc,componentSortDESC:I.isValidElement(p)?p:cn().sortingIcon[f].desc,classNamePointer:cn().pointer[f],emptyPlaceholder:b,renderSubComponent:x,visibilityColumns:B,classNameSubMobile:cn().subMobile[f]}),o&&_.jsx(yP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
68
68
  ${m?cn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:I.isValidElement(g)?g:cn().sortingIcon[f].asc,componentSortDESC:I.isValidElement(p)?p:cn().sortingIcon[f].desc,classNamePointer:cn().pointer[f],emptyPlaceholder:b,renderSubComponent:x,visibilityColumns:B,classNameSubMobile:cn().subMobile[f]})]})},CP=(e,t,{visibilityColumns:n,classNameSubMobile:r})=>_.jsx("table",{className:"-1ru-mx-6 -1ru-my-3 !1ru-w-[calc(100%+48px)]",children:_.jsx("tbody",{children:t.getVisibleCells().map((i,a)=>{var o,s,l,u,c,d;return _.jsx(_.Fragment,{children:n!=null&&n.columns.includes(i.column.id)?_.jsxs("tr",{className:r,children:[_.jsx("td",{"data-section":"left",style:{...typeof((o=i.column.columnDef.meta)==null?void 0:o.styleTdLeftCellSubs)=="function"?(s=i.column.columnDef.meta)==null?void 0:s.styleTdLeftCellSubs(t.original,t):{}},children:_.jsxs("div",{children:[typeof i.column.columnDef.header=="string"&&_.jsx(_.Fragment,{children:i.column.columnDef.header}),typeof i.column.columnDef.header!="string"&&((l=i.column.columnDef.meta)==null?void 0:l.labelCellSubs)&&_.jsx(_.Fragment,{children:(u=i.column.columnDef.meta)==null?void 0:u.labelCellSubs(t.original,t)})]})}),_.jsx("td",{"data-section":"right",style:{...typeof((c=i.column.columnDef.meta)==null?void 0:c.styleTdRightCellSubs)=="function"?(d=i.column.columnDef.meta)==null?void 0:d.styleTdRightCellSubs(t.original,t):{}},children:_.jsxs("div",{children:[_.jsx("div",{className:"1ru-pr-1",children:":"})," ",ms(i.column.columnDef.cell,i.getContext())]})})]},i.id):_.jsx(_.Fragment,{})},a)})})}),EP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),SP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),j2=I.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,itemContent:c,typeCalculateItemSize:d="manual",itemSizeNames:h=[],overscan:f=null,component:g={},idContainer:p="",triggerCalCulateContainer:m="",accumulationHeight:b=0,delayTriggerCalculateHeight:v=0,increaseViewportBy:x=()=>0,context:C={},endReached:E,increaseTotalCount:w=1}=e,[B,y]=I.useState(0),S=()=>{if(o==="min-max"){const T=(a+w)*s;return{height:a>u?l:B>T?B:T}}return o==="container"?{height:B}:{}},D=T=>{var P;const F=T.getAttribute("data-index");let k=((P=T.getBoundingClientRect())==null?void 0:P.height)||0;return h==null||h.forEach($=>{var R,O;k+=((O=(R=document.querySelector(`[${$}="${F}"]`))==null?void 0:R.getBoundingClientRect())==null?void 0:O.height)??0}),k},A=()=>{var T;if(p&&o==="container"){const F=((T=document==null?void 0:document.getElementById(p))==null?void 0:T.offsetHeight)??0;y(F-b)}};return I.useEffect(()=>{const T=setTimeout(A,v);return window==null||window.addEventListener("resize",A),window==null||window.addEventListener("load",A),()=>{clearTimeout(T),window==null||window.removeEventListener("resize",A),window==null||window.removeEventListener("load",A)}},[o,m]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(R7,{context:C,ref:t,overscan:typeof f=="function"?f(o==="container"?B:l):o==="container"?B:l,totalListHeightChanged:T=>o==="min-max"?y(T):null,style:S(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(T=>d==="manual"?i(T):D(T),[]),itemContent:(...T)=>c(EP,...T),components:{Item:SP,...g},endReached:E,increaseViewportBy:x(o==="container"?B:l)})})});j2.displayName="ListVirtualization";const wP="_ripple_eap0t_571",IP="_active_eap0t_578",Vt={"tabs-m":"_tabs-m_eap0t_115","tabs-list":"_tabs-list_eap0t_115","button-tabs":"_button-tabs_eap0t_115","container-tabs":"_container-tabs_eap0t_115","original-laba-blue-10":"_original-laba-blue-10_eap0t_115","original-bill-secondary-800":"_original-bill-secondary-800_eap0t_115","tabs-s":"_tabs-s_eap0t_139","tabs-medium":"_tabs-medium_eap0t_259","tabs-small":"_tabs-small_eap0t_289","disable-transition":"_disable-transition_eap0t_469","tab-panel":"_tab-panel_eap0t_473",ripple:wP,active:IP,"tabs-slider":"_tabs-slider_eap0t_585","container-payhere-brand-base":"_container-payhere-brand-base_eap0t_593","container-payhere-brand-base-bg_white":"_container-payhere-brand-base-bg_white_eap0t_630","container-laba-blue-10":"_container-laba-blue-10_eap0t_667","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_eap0t_704","container-laba-blue-10-bg_blue-01":"_container-laba-blue-10-bg_blue-01_eap0t_741","container-bill-secondary-800":"_container-bill-secondary-800_eap0t_820"},_f={"0px":"1ru-rounded-none","2px":"1ru-rounded-sm","4px":"1ru-rounded","6px":"1ru-rounded-md","8px":"1ru-rounded-lg","12px":"1ru-rounded-xl","16px":"1ru-rounded-2xl","24px":"1ru-rounded-3xl",full:"1ru-rounded-full"},Na={tabsVariant:{"original-laba-blue-10":Vt["original-laba-blue-10"],"container-payhere-brand-base":Vt["container-payhere-brand-base"],"container-payhere-brand-base-bg_white":Vt["container-payhere-brand-base-bg_white"],"container-laba-blue-10":Vt["container-laba-blue-10"],"container-laba-blue-10-bg_white":Vt["container-laba-blue-10-bg_white"],"container-laba-blue-10-bg_blue-01":Vt["container-laba-blue-10-bg_blue-01"],"original-bill-secondary-800":Vt["original-bill-secondary-800"],"container-bill-secondary-800":Vt["container-bill-secondary-800"]},size:{"tabs-m":Vt["tabs-m"],"tabs-s":Vt["tabs-s"],"tabs-medium":Vt["tabs-medium"],"tabs-small":Vt["tabs-small"]},borderRadius:_f,isContainer:["container-payhere-brand-base","container-payhere-brand-base-bg_white","container-laba-blue-10","container-laba-blue-10-bg_white","container-laba-blue-10-bg_blue-01","container-bill-secondary-800"]},_P=({id:e,value:t="",keyValueTab:n="",tabsList:r,className:i,classNameContainer:a,classNameButton:o,variant:s="original-laba-blue-10",size:l="tabs-m",borderRadius:u="0px",disabled:c,animation:d=!0,mountedExecuteChange:h=!0,typeButton:f="button",onChange:g,locale:p})=>{var D;const m=I.useRef([]);let b=r||[];const v=Object.fromEntries(new URL(window.location.href).searchParams.entries()),[x,C]=I.useState(-1),[E,w]=I.useState({height:0,width:0,left:0});b=b.filter(A=>typeof(A==null?void 0:A.isHide)=="boolean"?!A.isHide:!0);const B=A=>{const T=A.currentTarget,F=document.createElement("span"),k=Math.max(T.clientWidth,T.clientHeight),P=k/2;F.style.width=F.style.height=`${k}px`,F.style.left=`${A.clientX-T.getBoundingClientRect().left-P}px`,F.style.top=`${A.clientY-T.getBoundingClientRect().top-P}px`,F.classList.add(Vt.ripple);const $=T.getElementsByClassName(Vt.ripple)[0];$&&$.remove(),T.appendChild(F),setTimeout(()=>{F.remove()},500)},y=(A,T)=>{typeof g=="function"&&g(A,T)},S=I.useCallback((A,T)=>{var F,k;return p&&((k=(F=r.find($=>$.id===A))==null?void 0:F.locale)==null?void 0:k[p])||T},[p]);return I.useLayoutEffect(()=>{function A(){setTimeout(()=>{const T=m.current[x],F={left:(T==null?void 0:T.offsetLeft)??0,width:(T==null?void 0:T.clientWidth)??0,height:Na.isContainer.includes(s)?(T==null?void 0:T.clientHeight)||0:4};w(F)},50)}return x>=0&&A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[x]),I.useLayoutEffect(()=>{const A=b.findIndex(T=>T.id===(v==null?void 0:v[n])||T.id===t);if((v!=null&&v[n]||t)&&A>=0){C(A);const T=b==null?void 0:b.find(F=>F.id===(v==null?void 0:v[n]));v!=null&&v[n]&&T&&!t&&h&&y(T,"mounted")}A<0&&h&&y(b[0],"mounted")},[JSON.stringify(t),JSON.stringify(v==null?void 0:v[n])]),_.jsx("div",{className:`${Vt["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:_.jsxs("div",{className:`${Na.tabsVariant[s]}
69
69
  ${Na.isContainer.includes(s)?Na.size[l]:""}
@@ -139,7 +139,7 @@ You should wrap it with \`css\` like this:
139
139
  Prefix can't start with '-' when allowNegative is true.
140
140
  prefix: `+i+`
141
141
  allowNegative: `+a+`
142
- `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function gj(e){e=hj(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Bi);var a=e.onBlur;a===void 0&&(a=Bi);var o=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var c=e.defaultValue,d=e.value,h=e.valueIsNumericString,f=e.onValueChange,g=Mm(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),p=Of(e),m=p.decimalSeparator,b=p.allowedDecimalSeparators,v=function($){return sy($,e)},x=function($,R){return dj($,R,e)},C=lo(d)?c:d,E=h??cj(C,u,t);lo(d)?lo(c)||(E=E||typeof c=="number"):E=E||typeof d=="number";var w=function($){return t5($)?$:(typeof $=="number"&&($=i5($)),E&&typeof s=="number"?oy($,s,!!l):$)},B=l5(w(d),w(c),!!E,v,x,f),y=B[0],S=y.numAsString,D=y.formattedValue,A=B[1],T=function($){var R=$.target,O=$.key,j=R.selectionStart,V=R.selectionEnd,W=R.value;if(W===void 0&&(W=""),(O==="Backspace"||O==="Delete")&&V<u.length){$.preventDefault();return}if(j!==V){i($);return}O==="Backspace"&&W[0]==="-"&&j===u.length+1&&n&&ra(R,1),s&&l&&(O==="Backspace"&&W[j-1]===m?(ra(R,j-1),$.preventDefault()):O==="Delete"&&W[j]===m&&$.preventDefault()),b!=null&&b.includes(O)&&W[j]===m&&ra(R,j+1);var U=o===!0?",":o;O==="Backspace"&&W[j-1]===U&&ra(R,j-1),O==="Delete"&&W[j]===U&&ra(R,j+1),i($)},F=function($){var R=S;if(R.match(/\d/g)||(R=""),r||(R=QH(R)),l&&s&&(R=oy(R,s,l)),R!==S){var O=sy(R,e);A({formattedValue:O,value:R,floatValue:parseFloat(R)},{event:$,source:eu.event})}a($)},k=function($){return $===m?!0:yo($)},P=function($){var R=$.currentValue,O=$.lastValue,j=$.formattedValue,V=$.currentValueIndex,W=$.formattedValueIndex,U=R[V],K=j[W],ee=a5(O,R),z=ee.to;return V>=z.start&&V<z.end&&b&&b.includes(U)&&K===m?!0:U===K};return Object.assign(Object.assign({},g),{value:D,valueIsNumericString:!1,isValidInputCharacter:k,isCharacterSame:P,onValueChange:A,format:v,removeFormatting:x,getCaretBoundary:function($){return fj($,e)},onKeyDown:T,onBlur:F})}function pj(e){var t=gj(e);return I.createElement(u5,Object.assign({},t))}function mj(e,t){var n=t.format,r=t.allowEmptyFormatting,i=t.mask,a=t.patternChar;if(a===void 0&&(a="#"),e===""&&!r)return"";for(var o=0,s=n.split(""),l=0,u=n.length;l<u;l++)n[l]===a&&(s[l]=e[o]||s5(i,o),o+=1);return s.join("")}function bj(e,t,n){t===void 0&&(t=o5(e));var r=n.format,i=n.patternChar;i===void 0&&(i="#");var a=t.from,o=t.to,s=t.lastValue;s===void 0&&(s="");var l=function(m){return r[m]===i},u=function(m,b){for(var v="",x=0;x<m.length;x++)l(b+x)&&yo(m[x])&&(v+=m[x]);return v},c=function(m){return m.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((s===""||a.end-a.start===s.length)&&e.length===r.length){for(var d="",h=0;h<e.length;h++)if(l(h))yo(e[h])&&(d+=e[h]);else if(e[h]!==r[h])return c(e);return d}var f=s.substring(0,a.start),g=e.substring(o.start,o.end),p=s.substring(a.end);return""+u(f,0)+c(g)+u(p,a.end)}function vj(e,t){var n=t.format,r=t.mask,i=t.patternChar;i===void 0&&(i="#");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=0,s=-1,l={};n.split("").forEach(function(h,f){var g=void 0;h===i&&(o++,g=s5(r,o-1),s===-1&&e[f]===g&&(s=f)),l[f]=g});for(var u=function(h){return n[h]===i&&e[h]!==l[h]},c=0,d=a.length;c<d;c++)a[c]=c===s||u(c)||u(c-1);return a[n.indexOf(i)]=!0,a}function yj(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function xj(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function Cj(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=Bi);var i=e.patternChar;i===void 0&&(i="#");var a=e.value,o=e.defaultValue,s=e.valueIsNumericString,l=Mm(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);yj(e);var u=function(g){return vj(g,e)},c=function(g){var p=g.key,m=g.target,b=m.selectionStart,v=m.selectionEnd,x=m.value;if(b!==v){r(g);return}var C=b;if(p==="Backspace"||p==="Delete"){var E="right";if(p==="Backspace"){for(;C>0&&t[C-1]!==i;)C--;E="left"}else{for(var w=t.length;C<w&&t[C]!==i;)C++;E="right"}C=Hd(x,C,u(x),E)}else t[C]!==i&&p!=="ArrowLeft"&&p!=="ArrowRight"&&(C=Hd(x,C+1,u(x),"right"));C!==b&&ra(m,C),r(g)},d=lo(a)?o:a,h=s??xj(d,t),f=Object.assign(Object.assign({},e),{valueIsNumericString:h});return Object.assign(Object.assign({},l),{value:a,defaultValue:o,valueIsNumericString:h,inputMode:n,format:function(g){return mj(g,f)},removeFormatting:function(g,p){return bj(g,p,f)},getCaretBoundary:u,onKeyDown:c})}function Ej(e){var t=Cj(e);return I.createElement(u5,Object.assign({},t))}const Sj=({max:e,min:t,selectedText:n="Rp0",onChange:r,onFocusInput:i,...a})=>_.jsx(pj,{isAllowed:o=>e!==void 0&&ci(e)&&$t(o.value).isGreaterThan(e)?(typeof r=="function"&&r({target:{value:$t(e).toString()}}),!1):t!==void 0&&ci(t)&&$t(o.value).isLessThan(t)?(typeof r=="function"&&r({target:{value:$t(t).toString()}}),!1):!0,onValueChange:(o,{source:s})=>{typeof r=="function"&&s.includes("event")&&r({target:{value:o.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:o=>{var s;((s=o==null?void 0:o.target)==null?void 0:s.value)===n&&(typeof i=="function"?i(""):typeof r=="function"&&r({target:{value:""}}))},...a}),Om=({children:e,containerId:t="portal-root",selector:n})=>{const[r,i]=I.useState(null);return I.useEffect(()=>{let a=n?document.querySelector(n):document.getElementById(t),o=!1;return a||(a=document.createElement("div"),a.id=t,document.body.appendChild(a),o=!0),i(a),()=>{o&&a&&document.body.removeChild(a)}},[t,n]),r?cu.createPortal(e,r):null},wj={"button-remove":"_button-remove_lgwgf_1"},Ij=()=>_.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 6.74871 13.9891 6.83619 13.9542 6.91753C13.9192 6.99886 13.8684 7.07243 13.8048 7.13392L10.9428 9.99592L13.8048 12.8579C13.9262 12.9837 13.9934 13.1521 13.9919 13.3269C13.9904 13.5017 13.9203 13.6689 13.7966 13.7925C13.673 13.9161 13.5058 13.9862 13.331 13.9877C13.1562 13.9892 12.9878 13.922 12.8621 13.8006L10.0001 10.9386L7.1381 13.8006C7.01237 13.922 6.84397 13.9892 6.66917 13.9877C6.49437 13.9862 6.32716 13.9161 6.20356 13.7925C6.07995 13.6689 6.00984 13.5017 6.00832 13.3269C6.0068 13.1521 6.074 12.9837 6.19544 12.8579L9.05744 9.99592L6.19544 7.13392C6.07045 7.00891 6.00024 6.83937 6.00024 6.66259C6.00024 6.48581 6.07045 6.31628 6.19544 6.19126Z",fill:"#212121"})}),_j=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:_.jsx("path",{d:"M2 11.3334V4.66671C2 4.31309 2.14048 3.97395 2.39052 3.7239C2.64057 3.47385 2.97971 3.33337 3.33333 3.33337H7.33333L8.66667 4.66671H12.6667C13.0203 4.66671 13.3594 4.80718 13.6095 5.05723C13.8595 5.30728 14 5.64642 14 6.00004V11.3334C14 11.687 13.8595 12.0261 13.6095 12.2762C13.3594 12.5262 13.0203 12.6667 12.6667 12.6667H3.33333C2.97971 12.6667 2.64057 12.5262 2.39052 12.2762C2.14048 12.0261 2 11.687 2 11.3334Z",stroke:"#9E9E9E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),c5=e=>{const t=I.useRef(null),{fileName:n,onChange:r,maxFile:i,maxSize:a=2,validateFile:o,error:s,label:l,inputProps:u,priorityError:c="external",eventError:d}=e,h=o||["image/png","image/jpeg","image/jpg"],[f,g]=I.useState(""),p={internal:f||s,external:s||f},m=x=>{if(x!=null&&x.length){const C=x[0],E=C.size/1024/1024;let w="";if(h.some(B=>{var y;return(y=x[0].type)==null?void 0:y.includes(B)})?E>a?w=`${x.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${a}MB.`:r(C):w="Berkas tidak didukung, silahkan pilih file kembali.",g(w),d==null||d(w),!(t!=null&&t.current))return;t.current.value=""}},b=x=>{var C;x.preventDefault(),t!=null&&t.current&&((C=t.current)==null||C.click())},v=x=>{x.preventDefault(),t!=null&&t.current&&(r(null),t.current.value="")};return _.jsxs(_.Fragment,{children:[_.jsx("input",{accept:h==null?void 0:h.join(", "),ref:t,hidden:!0,type:"file",max:i,onChange:x=>{m(x.target.files)}}),_.jsx(Bp,{sizeInput:"medium",placeholder:"Pilih Berkas",label:l,value:n,readOnly:!0,onClick:x=>b(x),startIcon:_.jsx(_j,{}),endIcon:n&&_.jsx("div",{className:wj["button-remove"],onClick:x=>v(x),children:_.jsx(Ij,{})}),error:p[c],...u})]})};c5.displayName="UploadFile";const Dj=({children:e,maxWidth:t,moreElement:n,style:r={},className:i,gap:a=0,gapStyle:o,...s})=>{const l=I.useMemo(()=>I.Children.toArray(e),[e]),u=l.length,[c,d]=I.useState(u),h=I.useRef(null),f=I.useRef([]),g=I.useRef(null);f.current=[];const p=()=>{const x=h.current,C=g.current;if(!x||x.offsetWidth===0)return;const E=x.offsetWidth,w=f.current.map(k=>k?k.offsetWidth:0),B=w.reduce((k,P)=>k+P,0),y=Math.max(0,u-1)*a;if(B+y<=E){d(u);return}const D=C?C.offsetWidth+a:0,A=E-D;let T=0,F=0;for(let k=0;k<u;k++){const P=w[k],$=k>0?a:0;if(T+P+$>A)break;T+=P+$,F++}d(F)};I.useLayoutEffect(()=>{p();const x=new ResizeObserver(p);return h.current&&x.observe(h.current),()=>{x.disconnect()}},[l,a]);const m=u-c,b={display:"flex",flexWrap:"nowrap",alignItems:"center",overflow:"hidden",gap:o??`${a}px`,maxWidth:t,minHeight:"38px",...r},v={position:"fixed",top:"-9999px",left:"-9999px",visibility:"hidden",pointerEvents:"none",zIndex:-1,display:"flex",flexWrap:"nowrap",alignItems:"center",gap:o??`${a}px`};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{ref:h,style:b,className:i??"",...s,children:[l.slice(0,c),m>0&&n(m)]}),_.jsxs("div",{style:v,"aria-hidden":"true",children:[l.map((x,C)=>I.cloneElement(x,{ref:E=>f.current[C]=E,key:`measure-${x.key||C}`})),u>0&&_.jsx("span",{ref:g,children:n(u)})]})]})},Aj="_container_1t9z5_133",Tj="_image_1t9z5_133",Ci={container:Aj,"image-content":"_image-content_1t9z5_133","text-desc":"_text-desc_1t9z5_133","action-content":"_action-content_1t9z5_133","text-error":"_text-error_1t9z5_133",image:Tj,"button-content":"_button-content_1t9z5_515"},Rj=({className:e})=>_.jsx("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-5 1ru-w-5 1ru-text-red-600 ${e??""}`,fill:"currentColor",children:_.jsx("g",{id:"x",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:`M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 \r
142
+ `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function gj(e){e=hj(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Bi);var a=e.onBlur;a===void 0&&(a=Bi);var o=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var c=e.defaultValue,d=e.value,h=e.valueIsNumericString,f=e.onValueChange,g=Mm(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),p=Of(e),m=p.decimalSeparator,b=p.allowedDecimalSeparators,v=function($){return sy($,e)},x=function($,R){return dj($,R,e)},C=lo(d)?c:d,E=h??cj(C,u,t);lo(d)?lo(c)||(E=E||typeof c=="number"):E=E||typeof d=="number";var w=function($){return t5($)?$:(typeof $=="number"&&($=i5($)),E&&typeof s=="number"?oy($,s,!!l):$)},B=l5(w(d),w(c),!!E,v,x,f),y=B[0],S=y.numAsString,D=y.formattedValue,A=B[1],T=function($){var R=$.target,O=$.key,j=R.selectionStart,V=R.selectionEnd,W=R.value;if(W===void 0&&(W=""),(O==="Backspace"||O==="Delete")&&V<u.length){$.preventDefault();return}if(j!==V){i($);return}O==="Backspace"&&W[0]==="-"&&j===u.length+1&&n&&ra(R,1),s&&l&&(O==="Backspace"&&W[j-1]===m?(ra(R,j-1),$.preventDefault()):O==="Delete"&&W[j]===m&&$.preventDefault()),b!=null&&b.includes(O)&&W[j]===m&&ra(R,j+1);var U=o===!0?",":o;O==="Backspace"&&W[j-1]===U&&ra(R,j-1),O==="Delete"&&W[j]===U&&ra(R,j+1),i($)},F=function($){var R=S;if(R.match(/\d/g)||(R=""),r||(R=QH(R)),l&&s&&(R=oy(R,s,l)),R!==S){var O=sy(R,e);A({formattedValue:O,value:R,floatValue:parseFloat(R)},{event:$,source:eu.event})}a($)},k=function($){return $===m?!0:yo($)},P=function($){var R=$.currentValue,O=$.lastValue,j=$.formattedValue,V=$.currentValueIndex,W=$.formattedValueIndex,U=R[V],K=j[W],ee=a5(O,R),z=ee.to;return V>=z.start&&V<z.end&&b&&b.includes(U)&&K===m?!0:U===K};return Object.assign(Object.assign({},g),{value:D,valueIsNumericString:!1,isValidInputCharacter:k,isCharacterSame:P,onValueChange:A,format:v,removeFormatting:x,getCaretBoundary:function($){return fj($,e)},onKeyDown:T,onBlur:F})}function pj(e){var t=gj(e);return I.createElement(u5,Object.assign({},t))}function mj(e,t){var n=t.format,r=t.allowEmptyFormatting,i=t.mask,a=t.patternChar;if(a===void 0&&(a="#"),e===""&&!r)return"";for(var o=0,s=n.split(""),l=0,u=n.length;l<u;l++)n[l]===a&&(s[l]=e[o]||s5(i,o),o+=1);return s.join("")}function bj(e,t,n){t===void 0&&(t=o5(e));var r=n.format,i=n.patternChar;i===void 0&&(i="#");var a=t.from,o=t.to,s=t.lastValue;s===void 0&&(s="");var l=function(m){return r[m]===i},u=function(m,b){for(var v="",x=0;x<m.length;x++)l(b+x)&&yo(m[x])&&(v+=m[x]);return v},c=function(m){return m.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((s===""||a.end-a.start===s.length)&&e.length===r.length){for(var d="",h=0;h<e.length;h++)if(l(h))yo(e[h])&&(d+=e[h]);else if(e[h]!==r[h])return c(e);return d}var f=s.substring(0,a.start),g=e.substring(o.start,o.end),p=s.substring(a.end);return""+u(f,0)+c(g)+u(p,a.end)}function vj(e,t){var n=t.format,r=t.mask,i=t.patternChar;i===void 0&&(i="#");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=0,s=-1,l={};n.split("").forEach(function(h,f){var g=void 0;h===i&&(o++,g=s5(r,o-1),s===-1&&e[f]===g&&(s=f)),l[f]=g});for(var u=function(h){return n[h]===i&&e[h]!==l[h]},c=0,d=a.length;c<d;c++)a[c]=c===s||u(c)||u(c-1);return a[n.indexOf(i)]=!0,a}function yj(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function xj(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function Cj(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=Bi);var i=e.patternChar;i===void 0&&(i="#");var a=e.value,o=e.defaultValue,s=e.valueIsNumericString,l=Mm(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);yj(e);var u=function(g){return vj(g,e)},c=function(g){var p=g.key,m=g.target,b=m.selectionStart,v=m.selectionEnd,x=m.value;if(b!==v){r(g);return}var C=b;if(p==="Backspace"||p==="Delete"){var E="right";if(p==="Backspace"){for(;C>0&&t[C-1]!==i;)C--;E="left"}else{for(var w=t.length;C<w&&t[C]!==i;)C++;E="right"}C=Hd(x,C,u(x),E)}else t[C]!==i&&p!=="ArrowLeft"&&p!=="ArrowRight"&&(C=Hd(x,C+1,u(x),"right"));C!==b&&ra(m,C),r(g)},d=lo(a)?o:a,h=s??xj(d,t),f=Object.assign(Object.assign({},e),{valueIsNumericString:h});return Object.assign(Object.assign({},l),{value:a,defaultValue:o,valueIsNumericString:h,inputMode:n,format:function(g){return mj(g,f)},removeFormatting:function(g,p){return bj(g,p,f)},getCaretBoundary:u,onKeyDown:c})}function Ej(e){var t=Cj(e);return I.createElement(u5,Object.assign({},t))}const Sj=({max:e,min:t,selectedText:n="Rp0",onChange:r,onFocusInput:i,...a})=>_.jsx(pj,{isAllowed:o=>e!==void 0&&ci(e)&&At(o.value).isGreaterThan(e)?(typeof r=="function"&&r({target:{value:At(e).toString()}}),!1):t!==void 0&&ci(t)&&At(o.value).isLessThan(t)?(typeof r=="function"&&r({target:{value:At(t).toString()}}),!1):!0,onValueChange:(o,{source:s})=>{typeof r=="function"&&s.includes("event")&&r({target:{value:o.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:o=>{var s;((s=o==null?void 0:o.target)==null?void 0:s.value)===n&&(typeof i=="function"?i(""):typeof r=="function"&&r({target:{value:""}}))},...a}),Om=({children:e,containerId:t="portal-root",selector:n})=>{const[r,i]=I.useState(null);return I.useEffect(()=>{let a=n?document.querySelector(n):document.getElementById(t),o=!1;return a||(a=document.createElement("div"),a.id=t,document.body.appendChild(a),o=!0),i(a),()=>{o&&a&&document.body.removeChild(a)}},[t,n]),r?cu.createPortal(e,r):null},wj={"button-remove":"_button-remove_lgwgf_1"},Ij=()=>_.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 6.74871 13.9891 6.83619 13.9542 6.91753C13.9192 6.99886 13.8684 7.07243 13.8048 7.13392L10.9428 9.99592L13.8048 12.8579C13.9262 12.9837 13.9934 13.1521 13.9919 13.3269C13.9904 13.5017 13.9203 13.6689 13.7966 13.7925C13.673 13.9161 13.5058 13.9862 13.331 13.9877C13.1562 13.9892 12.9878 13.922 12.8621 13.8006L10.0001 10.9386L7.1381 13.8006C7.01237 13.922 6.84397 13.9892 6.66917 13.9877C6.49437 13.9862 6.32716 13.9161 6.20356 13.7925C6.07995 13.6689 6.00984 13.5017 6.00832 13.3269C6.0068 13.1521 6.074 12.9837 6.19544 12.8579L9.05744 9.99592L6.19544 7.13392C6.07045 7.00891 6.00024 6.83937 6.00024 6.66259C6.00024 6.48581 6.07045 6.31628 6.19544 6.19126Z",fill:"#212121"})}),_j=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:_.jsx("path",{d:"M2 11.3334V4.66671C2 4.31309 2.14048 3.97395 2.39052 3.7239C2.64057 3.47385 2.97971 3.33337 3.33333 3.33337H7.33333L8.66667 4.66671H12.6667C13.0203 4.66671 13.3594 4.80718 13.6095 5.05723C13.8595 5.30728 14 5.64642 14 6.00004V11.3334C14 11.687 13.8595 12.0261 13.6095 12.2762C13.3594 12.5262 13.0203 12.6667 12.6667 12.6667H3.33333C2.97971 12.6667 2.64057 12.5262 2.39052 12.2762C2.14048 12.0261 2 11.687 2 11.3334Z",stroke:"#9E9E9E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),c5=e=>{const t=I.useRef(null),{fileName:n,onChange:r,maxFile:i,maxSize:a=2,validateFile:o,error:s,label:l,inputProps:u,priorityError:c="external",eventError:d}=e,h=o||["image/png","image/jpeg","image/jpg"],[f,g]=I.useState(""),p={internal:f||s,external:s||f},m=x=>{if(x!=null&&x.length){const C=x[0],E=C.size/1024/1024;let w="";if(h.some(B=>{var y;return(y=x[0].type)==null?void 0:y.includes(B)})?E>a?w=`${x.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${a}MB.`:r(C):w="Berkas tidak didukung, silahkan pilih file kembali.",g(w),d==null||d(w),!(t!=null&&t.current))return;t.current.value=""}},b=x=>{var C;x.preventDefault(),t!=null&&t.current&&((C=t.current)==null||C.click())},v=x=>{x.preventDefault(),t!=null&&t.current&&(r(null),t.current.value="")};return _.jsxs(_.Fragment,{children:[_.jsx("input",{accept:h==null?void 0:h.join(", "),ref:t,hidden:!0,type:"file",max:i,onChange:x=>{m(x.target.files)}}),_.jsx(Bp,{sizeInput:"medium",placeholder:"Pilih Berkas",label:l,value:n,readOnly:!0,onClick:x=>b(x),startIcon:_.jsx(_j,{}),endIcon:n&&_.jsx("div",{className:wj["button-remove"],onClick:x=>v(x),children:_.jsx(Ij,{})}),error:p[c],...u})]})};c5.displayName="UploadFile";const Dj=({children:e,maxWidth:t,moreElement:n,style:r={},className:i,gap:a=0,gapStyle:o,...s})=>{const l=I.useMemo(()=>I.Children.toArray(e),[e]),u=l.length,[c,d]=I.useState(u),h=I.useRef(null),f=I.useRef([]),g=I.useRef(null);f.current=[];const p=()=>{const x=h.current,C=g.current;if(!x||x.offsetWidth===0)return;const E=x.offsetWidth,w=f.current.map(k=>k?k.offsetWidth:0),B=w.reduce((k,P)=>k+P,0),y=Math.max(0,u-1)*a;if(B+y<=E){d(u);return}const D=C?C.offsetWidth+a:0,A=E-D;let T=0,F=0;for(let k=0;k<u;k++){const P=w[k],$=k>0?a:0;if(T+P+$>A)break;T+=P+$,F++}d(F)};I.useLayoutEffect(()=>{p();const x=new ResizeObserver(p);return h.current&&x.observe(h.current),()=>{x.disconnect()}},[l,a]);const m=u-c,b={display:"flex",flexWrap:"nowrap",alignItems:"center",overflow:"hidden",gap:o??`${a}px`,maxWidth:t,minHeight:"38px",...r},v={position:"fixed",top:"-9999px",left:"-9999px",visibility:"hidden",pointerEvents:"none",zIndex:-1,display:"flex",flexWrap:"nowrap",alignItems:"center",gap:o??`${a}px`};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{ref:h,style:b,className:i??"",...s,children:[l.slice(0,c),m>0&&n(m)]}),_.jsxs("div",{style:v,"aria-hidden":"true",children:[l.map((x,C)=>I.cloneElement(x,{ref:E=>f.current[C]=E,key:`measure-${x.key||C}`})),u>0&&_.jsx("span",{ref:g,children:n(u)})]})]})},Aj="_container_1t9z5_133",Tj="_image_1t9z5_133",Ci={container:Aj,"image-content":"_image-content_1t9z5_133","text-desc":"_text-desc_1t9z5_133","action-content":"_action-content_1t9z5_133","text-error":"_text-error_1t9z5_133",image:Tj,"button-content":"_button-content_1t9z5_515"},Rj=({className:e})=>_.jsx("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-5 1ru-w-5 1ru-text-red-600 ${e??""}`,fill:"currentColor",children:_.jsx("g",{id:"x",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:`M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 \r
143
143
  6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 \r
144
144
  5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 \r
145
145
  6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 \r
@@ -189,7 +189,7 @@ You should wrap it with \`css\` like this:
189
189
  ${(d.step??f)<=e?Gr.active:""}`,style:{maxWidth:h+1===(t==null?void 0:t.length)||h===0?(n-30)*2:n-30,marginRight:h+1===(t==null?void 0:t.length)?-(n/2):0,marginLeft:h===0?-(n/2):0},children:d.desc})]},h)})});To.register(ws,Is,fo,ai,rI,uu,tI);const OX=(e,t,n)=>{const r=e,i=t||new Date().getMonth(),a=n||new Date().getFullYear();return new Date(`${i}/${r}/${a}`)},VX=({data:e,className:t,height:n=65})=>{const r=I.useRef(null),i=e.map(h=>wl(OX(1,h.label,h.year),"MMM yy",{locale:Yc}))||[],[a,o]=I.useState(""),[s,l]=I.useState(""),u=h=>{const f=[],g=[];let p=!h.find(m=>m.isCurrent);return h.forEach(m=>{p?(g.push(m.value),f.push(null)):(f.push(m.value),m.isCurrent?(p=!0,g.push(m.value)):g.push(null))}),{passed:f,notPassed:g}},c={labels:i,datasets:[{label:"",fill:"blue",backgroundColor:"rgba(75,192,192,1)",borderColor:a,borderCapStyle:"butt",borderDashOffset:0,borderJoinStyle:"miter",pointBackgroundColor:function(h){const f=e[h.dataIndex];let g=s;return f.isCurrent&&(g="#ED0019"),g},pointBorderWidth:.1,pointHoverRadius:4,pointRadius:5,pointBorderColor:s,pointHoverBorderColor:a,data:u(e).passed||[]},{label:"",fill:"grey",backgroundColor:"rgba(75,192,192,1)",borderColor:"#D6D6D6",borderCapStyle:"butt",borderDashOffset:0,pointRadius:5,borderJoinStyle:"miter",pointBackgroundColor:s,pointBorderWidth:.1,pointHoverRadius:4,borderDash:[15,5],data:u(e).notPassed||[]}]},d={interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1,labels:{usePointStyle:!0}},tooltip:{external:function(h){let f=document.getElementById("chartjs-tooltip");f||(f=document.createElement("div"),f.id="chartjs-tooltip",f.innerHTML="<table></table>",document.body.appendChild(f));const g=h.tooltip;if(g.opacity===0){f.style.opacity="0";return}f.classList.remove("above","below","no-transform"),g.yAlign?f.classList.add(g.yAlign):f.classList.add("no-transform");function p(b){return b.lines}if(g.body){const b=g.title||[];let v=g.body.map(p),x="<thead>";b.forEach(E=>{let w="";w+="display: flex",w+="; justify-content: center",w+="; font-weight: 600",w+="; font-size: 12px",w+="; padding: 0px 14px",x+=`<tr><span style="${w}">${E}</span></tr>`}),x+="</thead><tbody>",v.length>1&&v[0][0]===v[1][0]&&(v=[v[0]]),v.forEach(E=>{let w="";w+="display: flex",w+="; justify-content: center",w+="; color: #0163C8",w+="; padding: 0px 14px",w+="; font-size: 12px";const B=`<span style="${w}">${E}</span>`;x+=`<tr><td>${B}</td></tr>`}),x+="</tbody>";const C=f.querySelector("table");C&&(C.innerHTML=x)}const m=h.chart.canvas.getBoundingClientRect();f.style.opacity="1",f.style.border="solid 1px #0163C8",f.style.background="white",f.style.height="fit-content",f.style.borderRadius="10px",f.style.position="absolute",f.style.zIndex="10",f.style.padding="4px 0",f.style.left=m.left+window.pageXOffset+g.caretX-30+"px",f.style.top=m.top+window.pageYOffset+g.caretY-60+"px",f.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title:function(h){const f=e[h[0].dataIndex];return wl(new Date(`1/${f.label}/${f.year}`),"MMMM yyyy",{locale:Yc})},label:function(h){let f=h.dataset.label??"";return f&&(f+=": "),h.parsed.y!==null&&(f+=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(h.parsed.y)),f}}}},scales:{x:{grid:{display:!1},beginAtZero:!0,ticks:{autoSkip:!0,maxTicksLimit:20}},y:{min:0,grid:{display:!1},beginAtZero:!0,ticks:{maxTicksLimit:6,callback:function(h){return df(h)??0}}}}};return I.useEffect(()=>{if(r.current){const h=r.current.getContext("2d"),f=h==null?void 0:h.createLinearGradient(0,100,500,-500);f==null||f.addColorStop(0,"rgba(237, 0, 25, 0)"),f==null||f.addColorStop(1,"rgba(237, 0, 25, 20)");const g=h.fillStyle="rgba(255, 255, 255, 0)";l(g),o(f)}},[]),_.jsxs("div",{className:t??"",children:[_.jsx(lI,{options:d,data:c,height:n}),_.jsx("div",{className:"1ru-h-5",children:_.jsx("canvas",{ref:r})})]})},HX="_container_ser71_289",kx={"container-popover":"_container-popover_ser71_289",container:HX},jX=({id:e="1ru-tooltip",children:t,text:n,zIndexPopover:r=1,onShow:i,onClose:a,placement:o="top",backgroundColor:s="black",popoverProps:l={},arrowProps:u={},className:c,isHover:d,delay:h=600})=>{let f;const g=I.useRef(null),p={backgroundColor:a4[s]||s},[m,b]=I.useState(!1),[v,x]=I.useState(!1),C=w=>{var B;(B=g.current)==null||B.handlerShow(w),x(!0),typeof i=="function"&&i()},E=()=>{var w;x(!1),m||(clearInterval(f),(w=g.current)==null||w.setShow(!1),typeof a=="function"&&a())};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:e,onMouseEnter:w=>{if(d&&!m){const B=w.currentTarget;f=setTimeout(()=>{C({...w,currentTarget:B})},h)}},onMouseLeave:()=>{d&&!m&&E()},onClick:w=>{b(!0),clearInterval(f),v||C(w)},className:kx.container,children:t}),_.jsx(gi,{floatingOptions:{placement:o},ref:g,id:"1ru-popover-tooltip",offset:10,withArrow:!0,zIndex:r,onClose:()=>{m&&(b(!1),E())},styleInnerPopover:{backgroundColor:p.backgroundColor},propsArrow:{fill:p.backgroundColor,...u},className:`${kx["container-popover"]} ${c??""}`,...l,children:n})]})},WX="_icon_zrudt_5",zX="_show_zrudt_10",c0={"container-popover":"_container-popover_zrudt_1",icon:WX,show:zX},cI=I.forwardRef((e,t)=>{const{children:n,id:r="1ru-button-popover",text:i="",startIcon:a,endIcon:o,startIconShow:s,endIconShow:l,classNameButton:u="",classNameButtonShow:c="",className:d="",placement:h="top-end",popoverProps:f,zIndexPopover:g=1,offset:p=5,idPopover:m="1ru-popover-button-popover",onClick:b,onClose:v,...x}=e,C=I.useRef(null),E=I.useRef(null),[w,B]=I.useState(!1),y=(T,F,k)=>{let P=_.jsx(_.Fragment,{});return T&&I.isValidElement(F)?P=F:I.isValidElement(k)&&(P=_.jsx("div",{className:`${c0.icon} ${T?c0.show:""}`,children:k})),P},S=T=>{var F;(F=C.current)==null||F.setShow(T),B(T)},D=T=>{var F;(F=C.current)==null||F.handlerShow(T),B(!0)},A=()=>{var T;B(!1),(T=C.current)==null||T.setShow(!1),typeof v=="function"&&v()};return I.useImperativeHandle(t,()=>({show:w,setShow:S,handlerClose:A,handlerShow:D}),[w]),_.jsxs(_.Fragment,{children:[_.jsx(jn,{ref:E,id:r,className:`${u} ${w?c:""}`,onClick:T=>{w?A():typeof b=="function"?b(T):D(T)},startIcon:y(w,s,a),endIcon:y(w,l,o),...x,children:i}),_.jsx(gi,{ref:C,id:m,offset:p,floatingOptions:{placement:h},zIndex:g,onClose:A,className:`${c0["container-popover"]} ${d}`,...f,children:n})]})});cI.displayName="ButtonPopover";To.register(ws,Is,fo,ai,Q5,uu);const GX=e=>({chart:t,tooltip:n})=>{var l,u,c,d,h,f;const r={};if(n.opacity===0){e(g=>({...g,style:{...g.style,opacity:0,pointerEvents:"none"}}));return}if(!n.dataPoints||n.dataPoints.length===0)return;r.opacity="1",r.position="absolute",r.pointerEvents="none";const i=t.canvas.getBoundingClientRect();r.left=i.left+window.pageXOffset+n.caretX+"px",r.top=i.top+window.pageYOffset+n.caretY+"px";const a=((u=(l=n.dataPoints)==null?void 0:l[0])==null?void 0:u.label)??"",o=((d=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:d.raw)??"",s=((f=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:f.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},UX={id:"hairlinePlugin",beforeDatasetsDraw:e=>{const t=e.scales.y;if(!t)return;const{ctx:n}=e,{top:r,bottom:i,left:a,right:o}=e.chartArea;if(t.min>0||t.max<0)return;const s=t.getPixelForValue(0);s<r||s>i||(n.save(),n.beginPath(),n.moveTo(a,s),n.lineTo(o,s),n.lineWidth=2,n.strokeStyle="rgb(207, 216, 220)",n.setLineDash([4,3]),n.stroke(),n.restore())}},XX={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"right",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},ZX=({data:e,height:t,classNameContainer:n,id:r,options:i,CustomTooltip:a})=>{const o=I.useRef(void 0),s=I.useRef(0),l=I.useRef(0),[u,c]=I.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),d=I.useCallback(function({ctx:p,chartArea:m,scales:b,chartHeight:v,gradientFor:x,item:C}){let B=(b.y.getPixelForValue(0)-m.top)/v;B=B<0?0:B>1?1:B,o.current=p.createLinearGradient(0,m.top,0,v+m.top),x==="background"?(o.current.addColorStop(0,(C==null?void 0:C.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(C==null?void 0:C.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(B,(C==null?void 0:C.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(B,(C==null?void 0:C.colorBorderNegative)||"#EB6B6B"))},[]),h=I.useCallback(function({ctx:p,chartArea:m,scales:b,gradientFor:v,item:x}){const C=m.right-m.left,E=m.bottom-m.top;return(!o.current||s.current!==C||l.current!==E)&&(s.current=C,l.current=E,d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x})),d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x}),o.current},[]),f=I.useMemo(()=>({...e,datasets:e.datasets.map(m=>({fill:!0,backgroundColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"background",item:m})},borderColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"border",item:m})},borderWidth:3,tension:0,pointRadius:0,pointHoverRadius:4,...m,data:m.data}))}),[e]),g=I.useMemo(()=>_l(XX,{plugins:{tooltip:{enabled:!a,external:({chart:m,tooltip:b})=>a?GX(c)({chart:m,tooltip:b}):void 0}}},i??{}),[i,a]);return _.jsxs("div",{id:r,className:n,style:{height:t||"300px"},children:[a&&_.jsx(Om,{selector:"body",children:_.jsx(a,{...u})}),_.jsx(lI,{data:f,options:g,plugins:[UX]})]})};To.register(ws,Is,Xc,uu,fo,Q5,uu);const YX=e=>({chart:t,tooltip:n})=>{var l,u,c,d,h,f;const r={};if(n.opacity===0){e(g=>({...g,style:{...g.style,opacity:0,pointerEvents:"none"}}));return}if(!n.dataPoints||n.dataPoints.length===0)return;r.opacity="1",r.position="absolute",r.pointerEvents="none";const i=t.canvas.getBoundingClientRect();r.left=i.left+window.pageXOffset+n.caretX+"px",r.top=i.top+window.pageYOffset+n.caretY+"px";const a=((u=(l=n.dataPoints)==null?void 0:l[0])==null?void 0:u.label)??"",o=((d=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:d.raw)??"",s=((f=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:f.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},KX={id:"labelplugin",afterDatasetsDraw(e){const{ctx:t,chartArea:{top:n,bottom:r}}=e;t.save(),e.data.datasets.forEach((i,a)=>{const o=e.getDatasetMeta(a);o.visible&&o.data.forEach((s,l)=>{const u=i.data[l]||0,c=i!=null&&i.setDigit?df(String(u)):String(u);t.font="12px Lato",t.textAlign="center";let d,h=!1;typeof u=="number"&&u>=0?(t.textBaseline="bottom",t.fillStyle=(i==null?void 0:i.colorTextLabelPositive)||s.options.borderColor,d=s.y-5,d>n&&(h=!0)):(t.textBaseline="top",t.fillStyle=(i==null?void 0:i.colorTextLabelNegative)||s.options.borderColor,d=s.y+5,d<r&&(h=!0)),h&&t.fillText(c,s.x,d)})}),t.restore()}},qX={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"left",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{callback:function(e){return df(e)??0},font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{grid:{display:!1},border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},JX=({data:e,classNameContainer:t,height:n,id:r,options:i,CustomTooltip:a})=>{const o=I.useRef(void 0),s=I.useRef(0),l=I.useRef(0),[u,c]=I.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),d=I.useCallback(function({ctx:p,chartArea:m,scales:b,chartHeight:v,gradientFor:x,item:C}){let B=(b.y.getPixelForValue(0)-m.top)/v;B=B<0?0:B>1?1:B,o.current=p.createLinearGradient(0,m.top,0,v+m.top),x==="background"?(o.current.addColorStop(0,(C==null?void 0:C.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(C==null?void 0:C.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(B,(C==null?void 0:C.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(B,(C==null?void 0:C.colorBorderNegative)||"#EB6B6B"))},[]),h=I.useCallback(function({ctx:p,chartArea:m,scales:b,gradientFor:v,item:x}){const C=m.right-m.left,E=m.bottom-m.top;return(!o.current||s.current!==C||l.current!==E)&&(s.current=C,l.current=E,d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x})),d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x}),o.current},[]),f=I.useMemo(()=>({...e,datasets:e.datasets.map(m=>({fill:!0,backgroundColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"background",item:m})},borderColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"border",item:m})},borderWidth:0,tension:0,pointRadius:0,pointHoverRadius:4,setDigit:!0,...m,data:m.data}))}),[e]),g=I.useMemo(()=>_l(qX,{plugins:{tooltip:{enabled:!a,external:({chart:m,tooltip:b})=>a?YX(c)({chart:m,tooltip:b}):void 0}}},i??{}),[i,a]);return _.jsxs("div",{id:r,className:t,style:{height:n||"300px"},children:[a&&_.jsx(Om,{selector:"body",children:_.jsx(a,{...u})}),_.jsx(bX,{data:f,options:g,plugins:[KX]})]})},QX="_left_fwo8v_475",eZ="_right_fwo8v_478",tZ="_indicator_fwo8v_489",nZ="_active_fwo8v_494",Ki={"container-step-indicator":"_container-step-indicator_fwo8v_301","text-step-indicator":"_text-step-indicator_fwo8v_301",left:QX,right:eZ,"step-indicator":"_step-indicator_fwo8v_485",indicator:tZ,active:nZ};function rZ(e,t){if(e<=0)return"0px";if(e===1)return"100%";const n=e-1;return`calc((100% - (${t} * ${n})) / ${e})`}const iZ=({activeStep:e=0,countStep:t=0,classNameActiveStepIndicator:n="",classNameContainer:r="",classNameDesc:i="",classNameStepIndicator:a="",id:o="1ru-step-indicator",locationStepIndicator:s="right",widthStepIndicator:l=120,dynamicWidthStepIndicator:u=!1,gapStepIndicator:c="2px",classNameStepIndicatorContainer:d=""})=>_.jsxs("div",{id:o,className:`${Ki["container-step-indicator"]}
190
190
  ${s==="left"?Ki.left:Ki.right} ${r||""}`,children:[s==="left"&&_.jsxs("p",{className:`${Ki["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]}),_.jsx("div",{className:`${Ki["step-indicator"]} ${d||""}
191
191
  ${u?"1ru-w-full":""} ${c}`,style:{gap:c},children:Array.from({length:t}).map((h,f)=>_.jsx("div",{className:`${Ki.indicator} ${a||""}
192
- ${f<=e?`${Ki.active} ${n}`:""}`,style:{width:u?rZ(t,c):l}},f))}),s==="right"&&_.jsxs("p",{className:`${Ki["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),aZ="1.0.7",Px={version:aZ},oZ=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/assets/fontfamily.css`,toolbar:"fontfamily fontsize italic bold underline bullist numlist",font_size_formats:"8px 10px 12px 14px 16px 18px 24px 36px 48px",image_advtab:!0,importcss_append:!0,min_height:220,image_caption:!0,noneditable_class:"mceNonEditable",toolbar_mode:"sliding",table_tab_navigation:!1,line_height_formats:"100px",font_family_formats:`
192
+ ${f<=e?`${Ki.active} ${n}`:""}`,style:{width:u?rZ(t,c):l}},f))}),s==="right"&&_.jsxs("p",{className:`${Ki["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),aZ="1.0.8",Px={version:aZ},oZ=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/assets/fontfamily.css`,toolbar:"fontfamily fontsize italic bold underline bullist numlist",font_size_formats:"8px 10px 12px 14px 16px 18px 24px 36px 48px",image_advtab:!0,importcss_append:!0,min_height:220,image_caption:!0,noneditable_class:"mceNonEditable",toolbar_mode:"sliding",table_tab_navigation:!1,line_height_formats:"100px",font_family_formats:`
193
193
  Lato=Lato;
194
194
  Inter=Inter;
195
195
  Andale Mono=Andale Mono,times;
@@ -221,7 +221,7 @@ object-assign
221
221
  (c) Sindre Sorhus
222
222
  @license MIT
223
223
  */var d0,Fx;function uZ(){if(Fx)return d0;Fx=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return d0=i()?Object.assign:function(a,o){for(var s,l=r(a),u,c=1;c<arguments.length;c++){s=Object(arguments[c]);for(var d in s)t.call(s,d)&&(l[d]=s[d]);if(e){u=e(s);for(var h=0;h<u.length;h++)n.call(s,u[h])&&(l[u[h]]=s[u[h]])}}return l},d0}var f0,Nx;function i1(){if(Nx)return f0;Nx=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return f0=e,f0}var h0,Mx;function dI(){return Mx||(Mx=1,h0=Function.call.bind(Object.prototype.hasOwnProperty)),h0}var g0,Lx;function cZ(){if(Lx)return g0;Lx=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=i1(),n={},r=dI();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,l,u){if(process.env.NODE_ENV!=="production"){for(var c in a)if(r(a,c)){var d;try{if(typeof a[c]!="function"){var h=Error((l||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=a[c](o,c,l,s,null,t)}catch(g){d=g}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=u?u():"";e("Failed "+s+" type: "+d.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},g0=i,g0}var p0,Ox;function dZ(){if(Ox)return p0;Ox=1;var e=im,t=uZ(),n=i1(),r=dI(),i=cZ(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return p0=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function d(V){var W=V&&(u&&V[u]||V[c]);if(typeof W=="function")return W}var h="<<anonymous>>",f={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:v(),arrayOf:x,element:C(),elementType:E(),instanceOf:w,node:D(),objectOf:y,oneOf:B,oneOfType:S,shape:T,exact:F};function g(V,W){return V===W?V!==0||1/V===1/W:V!==V&&W!==W}function p(V,W){this.message=V,this.data=W&&typeof W=="object"?W:{},this.stack=""}p.prototype=Error.prototype;function m(V){if(process.env.NODE_ENV!=="production")var W={},U=0;function K(z,H,X,te,ie,le,ce){if(te=te||h,le=le||X,ce!==n){if(l){var Q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Q.name="Invariant Violation",Q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=te+":"+X;!W[be]&&U<3&&(a("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+te+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),W[be]=!0,U++)}}return H[X]==null?z?H[X]===null?new p("The "+ie+" `"+le+"` is marked as required "+("in `"+te+"`, but its value is `null`.")):new p("The "+ie+" `"+le+"` is marked as required in "+("`"+te+"`, but its value is `undefined`.")):null:V(H,X,te,ie,le)}var ee=K.bind(null,!1);return ee.isRequired=K.bind(null,!0),ee}function b(V){function W(U,K,ee,z,H,X){var te=U[K],ie=$(te);if(ie!==V){var le=R(te);return new p("Invalid "+z+" `"+H+"` of type "+("`"+le+"` supplied to `"+ee+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return m(W)}function v(){return m(o)}function x(V){function W(U,K,ee,z,H){if(typeof V!="function")return new p("Property `"+H+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var X=U[K];if(!Array.isArray(X)){var te=$(X);return new p("Invalid "+z+" `"+H+"` of type "+("`"+te+"` supplied to `"+ee+"`, expected an array."))}for(var ie=0;ie<X.length;ie++){var le=V(X,ie,ee,z,H+"["+ie+"]",n);if(le instanceof Error)return le}return null}return m(W)}function C(){function V(W,U,K,ee,z){var H=W[U];if(!s(H)){var X=$(H);return new p("Invalid "+ee+" `"+z+"` of type "+("`"+X+"` supplied to `"+K+"`, expected a single ReactElement."))}return null}return m(V)}function E(){function V(W,U,K,ee,z){var H=W[U];if(!e.isValidElementType(H)){var X=$(H);return new p("Invalid "+ee+" `"+z+"` of type "+("`"+X+"` supplied to `"+K+"`, expected a single ReactElement type."))}return null}return m(V)}function w(V){function W(U,K,ee,z,H){if(!(U[K]instanceof V)){var X=V.name||h,te=j(U[K]);return new p("Invalid "+z+" `"+H+"` of type "+("`"+te+"` supplied to `"+ee+"`, expected ")+("instance of `"+X+"`."))}return null}return m(W)}function B(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function W(U,K,ee,z,H){for(var X=U[K],te=0;te<V.length;te++)if(g(X,V[te]))return null;var ie=JSON.stringify(V,function(ce,Q){var be=R(Q);return be==="symbol"?String(Q):Q});return new p("Invalid "+z+" `"+H+"` of value `"+String(X)+"` "+("supplied to `"+ee+"`, expected one of "+ie+"."))}return m(W)}function y(V){function W(U,K,ee,z,H){if(typeof V!="function")return new p("Property `"+H+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var X=U[K],te=$(X);if(te!=="object")return new p("Invalid "+z+" `"+H+"` of type "+("`"+te+"` supplied to `"+ee+"`, expected an object."));for(var ie in X)if(r(X,ie)){var le=V(X,ie,ee,z,H+"."+ie,n);if(le instanceof Error)return le}return null}return m(W)}function S(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var W=0;W<V.length;W++){var U=V[W];if(typeof U!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(U)+" at index "+W+"."),o}function K(ee,z,H,X,te){for(var ie=[],le=0;le<V.length;le++){var ce=V[le],Q=ce(ee,z,H,X,te,n);if(Q==null)return null;Q.data&&r(Q.data,"expectedType")&&ie.push(Q.data.expectedType)}var be=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new p("Invalid "+X+" `"+te+"` supplied to "+("`"+H+"`"+be+"."))}return m(K)}function D(){function V(W,U,K,ee,z){return k(W[U])?null:new p("Invalid "+ee+" `"+z+"` supplied to "+("`"+K+"`, expected a ReactNode."))}return m(V)}function A(V,W,U,K,ee){return new p((V||"React class")+": "+W+" type `"+U+"."+K+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function T(V){function W(U,K,ee,z,H){var X=U[K],te=$(X);if(te!=="object")return new p("Invalid "+z+" `"+H+"` of type `"+te+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ie in V){var le=V[ie];if(typeof le!="function")return A(ee,z,H,ie,R(le));var ce=le(X,ie,ee,z,H+"."+ie,n);if(ce)return ce}return null}return m(W)}function F(V){function W(U,K,ee,z,H){var X=U[K],te=$(X);if(te!=="object")return new p("Invalid "+z+" `"+H+"` of type `"+te+"` "+("supplied to `"+ee+"`, expected `object`."));var ie=t({},U[K],V);for(var le in ie){var ce=V[le];if(r(V,le)&&typeof ce!="function")return A(ee,z,H,le,R(ce));if(!ce)return new p("Invalid "+z+" `"+H+"` key `"+le+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(U[K],null," ")+`
224
- Valid keys: `+JSON.stringify(Object.keys(V),null," "));var Q=ce(X,le,ee,z,H+"."+le,n);if(Q)return Q}return null}return m(W)}function k(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(k);if(V===null||s(V))return!0;var W=d(V);if(W){var U=W.call(V),K;if(W!==V.entries){for(;!(K=U.next()).done;)if(!k(K.value))return!1}else for(;!(K=U.next()).done;){var ee=K.value;if(ee&&!k(ee[1]))return!1}}else return!1;return!0;default:return!1}}function P(V,W){return V==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function $(V){var W=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":P(W,V)?"symbol":W}function R(V){if(typeof V>"u"||V===null)return""+V;var W=$(V);if(W==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return W}function O(V){var W=R(V);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function j(V){return!V.constructor||!V.constructor.name?h:V.constructor.name}return f.checkPropTypes=i,f.resetWarningCache=i.resetWarningCache,f.PropTypes=f,f},p0}var m0,Vx;function fZ(){if(Vx)return m0;Vx=1;var e=i1();function t(){}function n(){}return n.resetWarningCache=t,m0=function(){function r(o,s,l,u,c,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},m0}if(process.env.NODE_ENV!=="production"){var hZ=im,gZ=!0;Ug.exports=dZ()(hZ.isElement,gZ)}else Ug.exports=fZ()();var re=Ug.exports,Xg=function(){return Xg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Xg.apply(this,arguments)},fI={onActivate:re.func,onAddUndo:re.func,onBeforeAddUndo:re.func,onBeforeExecCommand:re.func,onBeforeGetContent:re.func,onBeforeRenderUI:re.func,onBeforeSetContent:re.func,onBeforePaste:re.func,onBlur:re.func,onChange:re.func,onClearUndos:re.func,onClick:re.func,onContextMenu:re.func,onCommentChange:re.func,onCompositionEnd:re.func,onCompositionStart:re.func,onCompositionUpdate:re.func,onCopy:re.func,onCut:re.func,onDblclick:re.func,onDeactivate:re.func,onDirty:re.func,onDrag:re.func,onDragDrop:re.func,onDragEnd:re.func,onDragGesture:re.func,onDragOver:re.func,onDrop:re.func,onExecCommand:re.func,onFocus:re.func,onFocusIn:re.func,onFocusOut:re.func,onGetContent:re.func,onHide:re.func,onInit:re.func,onInput:re.func,onKeyDown:re.func,onKeyPress:re.func,onKeyUp:re.func,onLoadContent:re.func,onMouseDown:re.func,onMouseEnter:re.func,onMouseLeave:re.func,onMouseMove:re.func,onMouseOut:re.func,onMouseOver:re.func,onMouseUp:re.func,onNodeChange:re.func,onObjectResizeStart:re.func,onObjectResized:re.func,onObjectSelected:re.func,onPaste:re.func,onPostProcess:re.func,onPostRender:re.func,onPreProcess:re.func,onProgressState:re.func,onRedo:re.func,onRemove:re.func,onReset:re.func,onSaveContent:re.func,onSelectionChange:re.func,onSetAttrib:re.func,onSetContent:re.func,onShow:re.func,onSubmit:re.func,onUndo:re.func,onVisualAid:re.func,onSkinLoadError:re.func,onThemeLoadError:re.func,onModelLoadError:re.func,onPluginLoadError:re.func,onIconsLoadError:re.func,onLanguageLoadError:re.func,onScriptsLoad:re.func,onScriptsLoadError:re.func},pZ=Xg({apiKey:re.string,licenseKey:re.string,id:re.string,inline:re.bool,init:re.object,initialValue:re.string,onEditorChange:re.func,value:re.string,tagName:re.string,tabIndex:re.number,cloudChannel:re.string,plugins:re.oneOfType([re.string,re.array]),toolbar:re.oneOfType([re.string,re.array]),disabled:re.bool,readonly:re.bool,textareaName:re.string,tinymceScriptSrc:re.oneOfType([re.string,re.arrayOf(re.string),re.arrayOf(re.shape({src:re.string,async:re.bool,defer:re.bool}))]),rollback:re.oneOfType([re.number,re.oneOf([!1])]),scriptLoading:re.shape({async:re.bool,defer:re.bool,delay:re.number})},fI),hI=function(e){var t=e;return t&&t.tinymce?t.tinymce:null},b0=function(e){return typeof e=="function"},Hx=function(e){return e in fI},jx=function(e){return e.substr(2)},mZ=function(e,t,n,r,i,a,o){var s=Object.keys(i).filter(Hx),l=Object.keys(a).filter(Hx),u=s.filter(function(d){return a[d]===void 0}),c=l.filter(function(d){return i[d]===void 0});u.forEach(function(d){var h=jx(d),f=o[h];n(h,f),delete o[h]}),c.forEach(function(d){var h=r(e,d),f=jx(d);o[f]=h,t(f,h)})},bZ=function(e,t,n,r,i){return mZ(i,e.on.bind(e),e.off.bind(e),function(a,o){return function(s){var l;return(l=a(o))===null||l===void 0?void 0:l(s,e)}},t,n,r)},Wx=0,gI=function(e){var t=Date.now(),n=Math.floor(Math.random()*1e9);return Wx++,e+"_"+n+Wx+String(t)},zx=function(e){return e!==null&&(e.tagName.toLowerCase()==="textarea"||e.tagName.toLowerCase()==="input")},Gx=function(e){return typeof e>"u"||e===""?[]:Array.isArray(e)?e:e.split(" ")},vZ=function(e,t){return Gx(e).concat(Gx(t))},yZ=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},xZ=function(e){if(!("isConnected"in Node.prototype)){for(var t=e,n=e.parentNode;n!=null;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected},Ux=function(e,t){e!==void 0&&(e.mode!=null&&typeof e.mode=="object"&&typeof e.mode.set=="function"?e.mode.set(t):e.setMode(t))},CZ=function(e){var t=hI(e);if(!t)throw new Error("tinymce should have been loaded into global scope");return t},Xx=function(e){return e.options&&e.options.isRegistered("disabled")},Zg=function(){return Zg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Zg.apply(this,arguments)},EZ=function(e,t,n){var r,i,a=e.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=t.id,a.src=t.src,a.async=(r=t.async)!==null&&r!==void 0?r:!1,a.defer=(i=t.defer)!==null&&i!==void 0?i:!1;var o=function(){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src)},s=function(l){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src,l)};a.addEventListener("load",o),a.addEventListener("error",s),e.head&&e.head.appendChild(a)},SZ=function(e){var t={},n=function(o,s){var l=t[o];l.done=!0,l.error=s;for(var u=0,c=l.handlers;u<c.length;u++){var d=c[u];d(o,s)}l.handlers=[]},r=function(o,s,l){var u=function(v){return l!==void 0?l(v):console.error(v)};if(o.length===0){u(new Error("At least one script must be provided"));return}for(var c=0,d=!1,h=function(v,x){d||(x?(d=!0,u(x)):++c===o.length&&s())},f=0,g=o;f<g.length;f++){var p=g[f],m=t[p.src];if(m)m.done?h(p.src,m.error):m.handlers.push(h);else{var b=gI("tiny-");t[p.src]={id:b,src:p.src,done:!1,error:null,handlers:[h]},EZ(e,Zg({id:b},p),n)}}},i=function(){for(var o,s=0,l=Object.values(t);s<l.length;s++){var u=l[s],c=e.getElementById(u.id);c!=null&&c.tagName==="SCRIPT"&&((o=c.parentNode)===null||o===void 0||o.removeChild(c))}t={}},a=function(){return e};return{loadScripts:r,deleteScripts:i,getDocument:a}},wZ=function(){var e=[],t=function(i){var a=e.find(function(o){return o.getDocument()===i});return a===void 0&&(a=SZ(i),e.push(a)),a},n=function(i,a,o,s,l){var u=function(){return t(i).loadScripts(a,s,l)};o>0?setTimeout(u,o):u()},r=function(){for(var i=e.pop();i!=null;i=e.pop())i.deleteScripts()};return{loadList:n,reinitialize:r}},IZ=wZ(),_Z=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qo=function(){return Qo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qo.apply(this,arguments)},v0="change keyup compositionend setcontent CommentChange",DZ=function(e){_Z(t,e);function t(n){var r,i,a,o=e.call(this,n)||this;return o.rollbackTimer=void 0,o.valueCursor=void 0,o.rollbackChange=function(){var s=o.editor,l=o.props.value;s&&l&&l!==o.currentContent&&s.undoManager.ignore(function(){if(s.setContent(l),o.valueCursor&&(!o.inline||s.hasFocus()))try{s.selection.moveToBookmark(o.valueCursor)}catch{}}),o.rollbackTimer=void 0},o.handleBeforeInput=function(s){if(o.props.value!==void 0&&o.props.value===o.currentContent&&o.editor&&(!o.inline||o.editor.hasFocus()))try{o.valueCursor=o.editor.selection.getBookmark(3)}catch{}},o.handleBeforeInputSpecial=function(s){(s.key==="Enter"||s.key==="Backspace"||s.key==="Delete")&&o.handleBeforeInput(s)},o.handleEditorChange=function(s){var l=o.editor;if(l&&l.initialized){var u=l.getContent();o.props.value!==void 0&&o.props.value!==u&&o.props.rollback!==!1&&(o.rollbackTimer||(o.rollbackTimer=window.setTimeout(o.rollbackChange,typeof o.props.rollback=="number"?o.props.rollback:200))),u!==o.currentContent&&(o.currentContent=u,b0(o.props.onEditorChange)&&o.props.onEditorChange(u,l))}},o.handleEditorChangeSpecial=function(s){(s.key==="Backspace"||s.key==="Delete")&&o.handleEditorChange(s)},o.initialise=function(s){var l,u,c;s===void 0&&(s=0);var d=o.elementRef.current;if(d){if(!xZ(d)){if(s===0)setTimeout(function(){return o.initialise(1)},1);else if(s<100)setTimeout(function(){return o.initialise(s+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=CZ(o.view),f=Qo(Qo(Qo(Qo({},o.props.init),{selector:void 0,target:d,disabled:o.props.disabled,readonly:o.props.readonly,inline:o.inline,plugins:vZ((l=o.props.init)===null||l===void 0?void 0:l.plugins,o.props.plugins),toolbar:(u=o.props.toolbar)!==null&&u!==void 0?u:(c=o.props.init)===null||c===void 0?void 0:c.toolbar}),o.props.licenseKey?{license_key:o.props.licenseKey}:{}),{setup:function(g){o.editor=g,o.bindHandlers({}),o.inline&&!zx(d)&&g.once("PostRender",function(p){g.setContent(o.getInitialValue(),{no_events:!0})}),o.props.init&&b0(o.props.init.setup)&&o.props.init.setup(g),o.props.disabled&&(Xx(o.editor)?o.editor.options.set("disabled",o.props.disabled):o.editor.mode.set("readonly"))},init_instance_callback:function(g){var p,m=o.getInitialValue();o.currentContent=(p=o.currentContent)!==null&&p!==void 0?p:g.getContent(),o.currentContent!==m&&(o.currentContent=m,g.setContent(m),g.undoManager.clear(),g.undoManager.add(),g.setDirty(!1)),o.props.init&&b0(o.props.init.init_instance_callback)&&o.props.init.init_instance_callback(g)}});o.inline||(d.style.visibility=""),zx(d)&&(d.value=o.getInitialValue()),h.init(f)}},o.id=o.props.id||gI("tiny-react"),o.elementRef=J.createRef(),o.inline=(a=(r=o.props.inline)!==null&&r!==void 0?r:(i=o.props.init)===null||i===void 0?void 0:i.inline)!==null&&a!==void 0?a:!1,o.boundHandlers={},o}return Object.defineProperty(t.prototype,"view",{get:function(){var n,r;return(r=(n=this.elementRef.current)===null||n===void 0?void 0:n.ownerDocument.defaultView)!==null&&r!==void 0?r:window},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(n){var r=this,i,a;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(n),this.editor.initialized)){if(this.currentContent=(i=this.currentContent)!==null&&i!==void 0?i:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==n.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var o=this.editor;o.undoManager.transact(function(){var l;if(!r.inline||o.hasFocus())try{l=o.selection.getBookmark(3)}catch{}var u=r.valueCursor;if(o.setContent(r.props.value),!r.inline||o.hasFocus())for(var c=0,d=[l,u];c<d.length;c++){var h=d[c];if(h)try{o.selection.moveToBookmark(h),r.valueCursor=h;break}catch{}}})}if(this.props.readonly!==n.readonly){var s=(a=this.props.readonly)!==null&&a!==void 0?a:!1;Ux(this.editor,s?"readonly":"design")}this.props.disabled!==n.disabled&&(Xx(this.editor)?this.editor.options.set("disabled",this.props.disabled):Ux(this.editor,this.props.disabled?"readonly":"design"))}},t.prototype.componentDidMount=function(){var n=this,r,i,a,o,s;if(hI(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(i=(r=this.props).onScriptsLoadError)===null||i===void 0||i.call(r,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((a=this.elementRef.current)===null||a===void 0)&&a.ownerDocument){var l=function(){var c,d;(d=(c=n.props).onScriptsLoad)===null||d===void 0||d.call(c),n.initialise()},u=function(c){var d,h;(h=(d=n.props).onScriptsLoadError)===null||h===void 0||h.call(d,c)};IZ.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(s=(o=this.props.scriptLoading)===null||o===void 0?void 0:o.delay)!==null&&s!==void 0?s:0,l,u)}},t.prototype.componentWillUnmount=function(){var n=this,r=this.editor;r&&(r.off(v0,this.handleEditorChange),r.off(this.beforeInputEvent(),this.handleBeforeInput),r.off("keypress",this.handleEditorChangeSpecial),r.off("keydown",this.handleBeforeInputSpecial),r.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(i){r.off(i,n.boundHandlers[i])}),this.boundHandlers={},r.remove(),this.editor=void 0)},t.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},t.prototype.beforeInputEvent=function(){return yZ()?"beforeinput SelectionChange":"SelectionChange"},t.prototype.renderInline=function(){var n=this.props.tagName,r=n===void 0?"div":n;return J.createElement(r,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.renderIframe=function(){return J.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.getScriptSources=function(){var n,r,i=(n=this.props.scriptLoading)===null||n===void 0?void 0:n.async,a=(r=this.props.scriptLoading)===null||r===void 0?void 0:r.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:i,defer:a}]:this.props.tinymceScriptSrc.map(function(u){return typeof u=="string"?{src:u,async:i,defer:a}:u});var o=this.props.cloudChannel,s=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(s,"/tinymce/").concat(o,"/tinymce.min.js");return[{src:l,async:i,defer:a}]},t.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},t.prototype.bindHandlers=function(n){var r=this;if(this.editor!==void 0){bZ(this.editor,n,this.props,this.boundHandlers,function(s){return r.props[s]});var i=function(s){return s.onEditorChange!==void 0||s.value!==void 0},a=i(n),o=i(this.props);!a&&o?(this.editor.on(v0,this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!o&&(this.editor.off(v0,this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},t.propTypes=pZ,t.defaultProps={cloudChannel:"7"},t}(J.Component);const AZ=e=>_.jsx("div",{className:`${lZ.container}`,children:_.jsx(DZ,{..._l(oZ({label:e.label}),e)})}),TZ=({children:e,open:t,className:n,id:r,classNameContainer:i})=>(I.useLayoutEffect(()=>{const a=document.getElementById(r),o=document.getElementById(`inner-${r}`);if(!a||!o)return;const s=new ResizeObserver(()=>{const l=o.getBoundingClientRect().height;a.style.height=`${l}px`});if(t){const l=o.getBoundingClientRect().height;a.style.height=`${l}px`,s.observe(o)}else a.style.height="0px";return()=>{s.disconnect()}},[t,r]),_.jsx("div",{id:r,className:`${Qw.collapse} ${i??""}`,style:{height:0},children:_.jsx("div",{id:`inner-${r}`,className:n??"",children:e})})),RZ="_selected_dsej5_541",BZ="_error_dsej5_546",$Z="_disabled_dsej5_550",Rt={"container-time-range":"_container-time-range_dsej5_133","time-range-header":"_time-range-header_dsej5_133","text-to":"_text-to_dsej5_133","time-range":"_time-range_dsej5_133","time-range-body":"_time-range-body_dsej5_133","list-time":"_list-time_dsej5_133","container-time":"_container-time_dsej5_133","title-time":"_title-time_dsej5_133","cell-time":"_cell-time_dsej5_133","time-range-divider":"_time-range-divider_dsej5_502","container-cell-time":"_container-cell-time_dsej5_524",selected:RZ,error:BZ,disabled:$Z,"time-range-footer":"_time-range-footer_dsej5_557"},zo=(e,t=2)=>String(e).padStart(t,"0"),Zx=(e,t)=>e[0][0]&&e[0][1]&&e[1][0]&&e[1][1]?`${e[0][0]}:${e[0][1]} - ${e[1][0]}:${e[1][1]}`:io[t]["Select Time"],io={"en-US":{to:"to",Hour:"Hour",Minute:"Minute","Select Time":"Select Time",Reset:"Reset",Apply:"Apply"},"id-ID":{to:"to",Hour:"Jam",Minute:"Menit","Select Time":"Pilih Waktu",Reset:"Reset",Apply:"Terapkan"},"zh-CN":{to:"到",Hour:"小时",Minute:"分钟","Select Time":"选择时间",Reset:"重置",Apply:"应用"},"nl-NL":{to:"tot",Hour:"Uur",Minute:"Minuten","Select Time":"Select Time",Reset:"Reset",Apply:"Toepassen"}},Zs=[["",""],["",""]],kZ=e=>{const{id:t="time-range",classNameContainer:n,value:r=Zs,buttonClick:i,zIndexPopper:a=1,offsetPopover:o=5,floatingOptions:s,locale:l="id-ID",disableValidation:u=!1}=e,c=I.useRef(null),[d,h]=I.useState(Zs),f=(b,v)=>{if(v==="start"){const x=[b,d[1]];h(x)}else{const x=[d[0],b];h(x)}},g=b=>{var v;(v=c.current)==null||v.handlerShow(b),h(r||Zs)},p=()=>{var b;typeof(e==null?void 0:e.onChange)=="function"&&e.onChange(Zs),h(Zs),(b=c.current)==null||b.setShow(!1)},m=()=>{var B;const b=Number(d[0][0]),v=Number(d[0][1]),x=Number(d[1][0]),C=Number(d[1][1]),E=d[0][0]&&d[0][1]&&d[1][0]&&d[1][1],w=b<x||b===x&&v<=C;E&&(w||u)&&(typeof(e==null?void 0:e.onChange)=="function"&&e.onChange(d),(B=c.current)==null||B.setShow(!1))};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:t,onClick:g,className:n,children:typeof i=="function"?i(r,Zx(r,l)):r?Zx(r,l):io[l]["Select Time"]}),_.jsx(gi,{zIndex:a,ref:c,offset:o,id:`${t}-popover`,floatingOptions:{placement:"bottom-end",...s},className:"1ru-flex 1ru-flex-col",children:_.jsxs("div",{className:Rt["container-time-range"],children:[_.jsxs("div",{className:Rt["time-range-header"],children:[_.jsx("div",{className:Rt["time-range"],children:d[0][0]&&d[0][1]?`${d[0][0]}:${d[0][1]}`:"--:--"}),_.jsx("p",{className:Rt["text-to"],children:io[l].to}),_.jsx("div",{className:Rt["time-range"],children:d[1][0]&&d[1][1]?`${d[1][0]}:${d[1][1]}`:"--:--"})]}),_.jsxs("div",{className:Rt["time-range-body"],children:[_.jsx(Yx,{type:"start",value:[d[0][0],d[0][1]],onChange:b=>f(b,"start"),locale:l,values:d,disableValidation:u}),_.jsx("div",{className:Rt["time-range-divider"]}),_.jsx(Yx,{type:"end",value:[d[1][0],d[1][1]],onChange:b=>f(b,"end"),locale:l,values:d,disableValidation:u})]}),_.jsxs("div",{className:`${Rt["time-range-footer"]}`,children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:p,children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:p,children:io[l].Reset}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:m,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:m,children:io[l].Apply})]})]})})]})},Yx=e=>{const{value:t,onChange:n,type:r,locale:i,values:a,disableValidation:o}=e,s=(f,g,p)=>Array.from({length:(g-f)/p+1},(m,b)=>f+b*p),l=()=>{const f=document.getElementById(`time-range-${r}-hour-${t[0]}`),g=document.getElementById(`time-range-${r}-minute-${t[1]}`),p=document.getElementById(`time-range-${r}-hour`),m=document.getElementById(`time-range-${r}-minute`);f&&p&&p.scrollTo({behavior:"instant",top:f.offsetTop-75}),g&&m&&m.scrollTo({behavior:"instant",top:g.offsetTop-75})},u=f=>{if(r==="start"||o)return!1;{if(!a[0][0])return!1;const g=Number(a[0][0]);return f<g}},c=f=>{if(r==="start"||o)return!1;{if(!a[0][0]||!a[0][1]||!a[1][0])return!1;const g=Number(a[0][0]),p=Number(a[1][0]),m=Number(a[0][1]);return g===p&&f<m}},d=f=>{if(r==="start"||o)return!1;{const g=Number(a[0][0]);return f<g}},h=f=>{if(r==="start"||o)return!1;{if(!a[0][0]||!a[0][1]||!a[1][0])return!1;const g=Number(a[0][0]),p=Number(a[1][0]),m=Number(a[0][1]);return g===p&&f<m}};return I.useEffect(()=>{l()},[]),_.jsxs("div",{className:Rt["list-time"],children:[_.jsxs("div",{className:Rt["container-time"],children:[_.jsx("p",{className:Rt["title-time"],children:io[i].Hour}),_.jsx("div",{id:`time-range-${r}-hour`,className:Rt["container-cell-time"],children:s(0,23,1).map(f=>_.jsx("div",{id:`time-range-${r}-hour-${f}`,className:`${Rt["cell-time"]} ${t[0]===zo(f)?Rt.selected:""} ${u(f)?Rt.error:""} ${d(f)?Rt.disabled:""}`,onClick:()=>n([zo(f),t[1]]),children:zo(f)},f))})]}),_.jsxs("div",{className:Rt["container-time"],children:[_.jsx("p",{className:Rt["title-time"],children:io[i].Minute}),_.jsx("div",{id:`time-range-${r}-minute`,className:Rt["container-cell-time"],children:s(0,59,1).map(f=>_.jsx("div",{id:`time-range-${r}-minute-${f}`,className:`${Rt["cell-time"]} ${t[1]===zo(f)?Rt.selected:""} ${c(f)?Rt.error:""} ${h(f)?Rt.disabled:""}`,onClick:()=>n([t[0],zo(f)]),children:zo(f)},f))})]})]})},PZ="_container_4603f_421",FZ="_textarea_4603f_421",NZ="_label_4603f_421",MZ="_error_4603f_517",Ur={container:PZ,"size-large":"_size-large_4603f_421","container-textarea":"_container-textarea_4603f_421",textarea:FZ,"label-error":"_label-error_4603f_421","size-small":"_size-small_4603f_421",label:NZ,error:MZ},LZ={size:{large:Ur["size-large"],small:Ur["size-small"]}},pI=I.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:d,minHeight:h=94,maxHeight:f=150,style:g,sizeInput:p="large",...m}=e,b=I.useRef(null),v=If(b,t),x={...g??{},maxHeight:f,height:d??h,minHeight:h},[C,E]=I.useState(!1),w=function(S){var D;E(!0),(D=e.onFocus)==null||D.call(e,S)},B=function(S){var D;E(!1),(D=e.onBlur)==null||D.call(e,S)},y=function(S){const D=(S==null?void 0:S.target)??b.current;D.style.height="0px",D.style.height=D.scrollHeight+"px"};return wf(()=>(C&&b.current?b.current.addEventListener("input",y):y(),()=>{var S;(S=b.current)==null||S.removeEventListener("input",y)}),[C]),_.jsxs("div",{className:`${Ur.container}
224
+ Valid keys: `+JSON.stringify(Object.keys(V),null," "));var Q=ce(X,le,ee,z,H+"."+le,n);if(Q)return Q}return null}return m(W)}function k(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(k);if(V===null||s(V))return!0;var W=d(V);if(W){var U=W.call(V),K;if(W!==V.entries){for(;!(K=U.next()).done;)if(!k(K.value))return!1}else for(;!(K=U.next()).done;){var ee=K.value;if(ee&&!k(ee[1]))return!1}}else return!1;return!0;default:return!1}}function P(V,W){return V==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function $(V){var W=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":P(W,V)?"symbol":W}function R(V){if(typeof V>"u"||V===null)return""+V;var W=$(V);if(W==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return W}function O(V){var W=R(V);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function j(V){return!V.constructor||!V.constructor.name?h:V.constructor.name}return f.checkPropTypes=i,f.resetWarningCache=i.resetWarningCache,f.PropTypes=f,f},p0}var m0,Vx;function fZ(){if(Vx)return m0;Vx=1;var e=i1();function t(){}function n(){}return n.resetWarningCache=t,m0=function(){function r(o,s,l,u,c,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},m0}if(process.env.NODE_ENV!=="production"){var hZ=im,gZ=!0;Ug.exports=dZ()(hZ.isElement,gZ)}else Ug.exports=fZ()();var re=Ug.exports,Xg=function(){return Xg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Xg.apply(this,arguments)},fI={onActivate:re.func,onAddUndo:re.func,onBeforeAddUndo:re.func,onBeforeExecCommand:re.func,onBeforeGetContent:re.func,onBeforeRenderUI:re.func,onBeforeSetContent:re.func,onBeforePaste:re.func,onBlur:re.func,onChange:re.func,onClearUndos:re.func,onClick:re.func,onContextMenu:re.func,onCommentChange:re.func,onCompositionEnd:re.func,onCompositionStart:re.func,onCompositionUpdate:re.func,onCopy:re.func,onCut:re.func,onDblclick:re.func,onDeactivate:re.func,onDirty:re.func,onDrag:re.func,onDragDrop:re.func,onDragEnd:re.func,onDragGesture:re.func,onDragOver:re.func,onDrop:re.func,onExecCommand:re.func,onFocus:re.func,onFocusIn:re.func,onFocusOut:re.func,onGetContent:re.func,onHide:re.func,onInit:re.func,onInput:re.func,onKeyDown:re.func,onKeyPress:re.func,onKeyUp:re.func,onLoadContent:re.func,onMouseDown:re.func,onMouseEnter:re.func,onMouseLeave:re.func,onMouseMove:re.func,onMouseOut:re.func,onMouseOver:re.func,onMouseUp:re.func,onNodeChange:re.func,onObjectResizeStart:re.func,onObjectResized:re.func,onObjectSelected:re.func,onPaste:re.func,onPostProcess:re.func,onPostRender:re.func,onPreProcess:re.func,onProgressState:re.func,onRedo:re.func,onRemove:re.func,onReset:re.func,onSaveContent:re.func,onSelectionChange:re.func,onSetAttrib:re.func,onSetContent:re.func,onShow:re.func,onSubmit:re.func,onUndo:re.func,onVisualAid:re.func,onSkinLoadError:re.func,onThemeLoadError:re.func,onModelLoadError:re.func,onPluginLoadError:re.func,onIconsLoadError:re.func,onLanguageLoadError:re.func,onScriptsLoad:re.func,onScriptsLoadError:re.func},pZ=Xg({apiKey:re.string,licenseKey:re.string,id:re.string,inline:re.bool,init:re.object,initialValue:re.string,onEditorChange:re.func,value:re.string,tagName:re.string,tabIndex:re.number,cloudChannel:re.string,plugins:re.oneOfType([re.string,re.array]),toolbar:re.oneOfType([re.string,re.array]),disabled:re.bool,readonly:re.bool,textareaName:re.string,tinymceScriptSrc:re.oneOfType([re.string,re.arrayOf(re.string),re.arrayOf(re.shape({src:re.string,async:re.bool,defer:re.bool}))]),rollback:re.oneOfType([re.number,re.oneOf([!1])]),scriptLoading:re.shape({async:re.bool,defer:re.bool,delay:re.number})},fI),hI=function(e){var t=e;return t&&t.tinymce?t.tinymce:null},b0=function(e){return typeof e=="function"},Hx=function(e){return e in fI},jx=function(e){return e.substr(2)},mZ=function(e,t,n,r,i,a,o){var s=Object.keys(i).filter(Hx),l=Object.keys(a).filter(Hx),u=s.filter(function(d){return a[d]===void 0}),c=l.filter(function(d){return i[d]===void 0});u.forEach(function(d){var h=jx(d),f=o[h];n(h,f),delete o[h]}),c.forEach(function(d){var h=r(e,d),f=jx(d);o[f]=h,t(f,h)})},bZ=function(e,t,n,r,i){return mZ(i,e.on.bind(e),e.off.bind(e),function(a,o){return function(s){var l;return(l=a(o))===null||l===void 0?void 0:l(s,e)}},t,n,r)},Wx=0,gI=function(e){var t=Date.now(),n=Math.floor(Math.random()*1e9);return Wx++,e+"_"+n+Wx+String(t)},zx=function(e){return e!==null&&(e.tagName.toLowerCase()==="textarea"||e.tagName.toLowerCase()==="input")},Gx=function(e){return typeof e>"u"||e===""?[]:Array.isArray(e)?e:e.split(" ")},vZ=function(e,t){return Gx(e).concat(Gx(t))},yZ=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},xZ=function(e){if(!("isConnected"in Node.prototype)){for(var t=e,n=e.parentNode;n!=null;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected},Ux=function(e,t){e!==void 0&&(e.mode!=null&&typeof e.mode=="object"&&typeof e.mode.set=="function"?e.mode.set(t):e.setMode(t))},CZ=function(e){var t=hI(e);if(!t)throw new Error("tinymce should have been loaded into global scope");return t},Xx=function(e){return e.options&&e.options.isRegistered("disabled")},Zg=function(){return Zg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Zg.apply(this,arguments)},EZ=function(e,t,n){var r,i,a=e.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=t.id,a.src=t.src,a.async=(r=t.async)!==null&&r!==void 0?r:!1,a.defer=(i=t.defer)!==null&&i!==void 0?i:!1;var o=function(){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src)},s=function(l){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src,l)};a.addEventListener("load",o),a.addEventListener("error",s),e.head&&e.head.appendChild(a)},SZ=function(e){var t={},n=function(o,s){var l=t[o];l.done=!0,l.error=s;for(var u=0,c=l.handlers;u<c.length;u++){var d=c[u];d(o,s)}l.handlers=[]},r=function(o,s,l){var u=function(v){return l!==void 0?l(v):console.error(v)};if(o.length===0){u(new Error("At least one script must be provided"));return}for(var c=0,d=!1,h=function(v,x){d||(x?(d=!0,u(x)):++c===o.length&&s())},f=0,g=o;f<g.length;f++){var p=g[f],m=t[p.src];if(m)m.done?h(p.src,m.error):m.handlers.push(h);else{var b=gI("tiny-");t[p.src]={id:b,src:p.src,done:!1,error:null,handlers:[h]},EZ(e,Zg({id:b},p),n)}}},i=function(){for(var o,s=0,l=Object.values(t);s<l.length;s++){var u=l[s],c=e.getElementById(u.id);c!=null&&c.tagName==="SCRIPT"&&((o=c.parentNode)===null||o===void 0||o.removeChild(c))}t={}},a=function(){return e};return{loadScripts:r,deleteScripts:i,getDocument:a}},wZ=function(){var e=[],t=function(i){var a=e.find(function(o){return o.getDocument()===i});return a===void 0&&(a=SZ(i),e.push(a)),a},n=function(i,a,o,s,l){var u=function(){return t(i).loadScripts(a,s,l)};o>0?setTimeout(u,o):u()},r=function(){for(var i=e.pop();i!=null;i=e.pop())i.deleteScripts()};return{loadList:n,reinitialize:r}},IZ=wZ(),_Z=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qo=function(){return Qo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qo.apply(this,arguments)},v0="change keyup compositionend setcontent CommentChange",DZ=function(e){_Z(t,e);function t(n){var r,i,a,o=e.call(this,n)||this;return o.rollbackTimer=void 0,o.valueCursor=void 0,o.rollbackChange=function(){var s=o.editor,l=o.props.value;s&&l&&l!==o.currentContent&&s.undoManager.ignore(function(){if(s.setContent(l),o.valueCursor&&(!o.inline||s.hasFocus()))try{s.selection.moveToBookmark(o.valueCursor)}catch{}}),o.rollbackTimer=void 0},o.handleBeforeInput=function(s){if(o.props.value!==void 0&&o.props.value===o.currentContent&&o.editor&&(!o.inline||o.editor.hasFocus()))try{o.valueCursor=o.editor.selection.getBookmark(3)}catch{}},o.handleBeforeInputSpecial=function(s){(s.key==="Enter"||s.key==="Backspace"||s.key==="Delete")&&o.handleBeforeInput(s)},o.handleEditorChange=function(s){var l=o.editor;if(l&&l.initialized){var u=l.getContent();o.props.value!==void 0&&o.props.value!==u&&o.props.rollback!==!1&&(o.rollbackTimer||(o.rollbackTimer=window.setTimeout(o.rollbackChange,typeof o.props.rollback=="number"?o.props.rollback:200))),u!==o.currentContent&&(o.currentContent=u,b0(o.props.onEditorChange)&&o.props.onEditorChange(u,l))}},o.handleEditorChangeSpecial=function(s){(s.key==="Backspace"||s.key==="Delete")&&o.handleEditorChange(s)},o.initialise=function(s){var l,u,c;s===void 0&&(s=0);var d=o.elementRef.current;if(d){if(!xZ(d)){if(s===0)setTimeout(function(){return o.initialise(1)},1);else if(s<100)setTimeout(function(){return o.initialise(s+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=CZ(o.view),f=Qo(Qo(Qo(Qo({},o.props.init),{selector:void 0,target:d,disabled:o.props.disabled,readonly:o.props.readonly,inline:o.inline,plugins:vZ((l=o.props.init)===null||l===void 0?void 0:l.plugins,o.props.plugins),toolbar:(u=o.props.toolbar)!==null&&u!==void 0?u:(c=o.props.init)===null||c===void 0?void 0:c.toolbar}),o.props.licenseKey?{license_key:o.props.licenseKey}:{}),{setup:function(g){o.editor=g,o.bindHandlers({}),o.inline&&!zx(d)&&g.once("PostRender",function(p){g.setContent(o.getInitialValue(),{no_events:!0})}),o.props.init&&b0(o.props.init.setup)&&o.props.init.setup(g),o.props.disabled&&(Xx(o.editor)?o.editor.options.set("disabled",o.props.disabled):o.editor.mode.set("readonly"))},init_instance_callback:function(g){var p,m=o.getInitialValue();o.currentContent=(p=o.currentContent)!==null&&p!==void 0?p:g.getContent(),o.currentContent!==m&&(o.currentContent=m,g.setContent(m),g.undoManager.clear(),g.undoManager.add(),g.setDirty(!1)),o.props.init&&b0(o.props.init.init_instance_callback)&&o.props.init.init_instance_callback(g)}});o.inline||(d.style.visibility=""),zx(d)&&(d.value=o.getInitialValue()),h.init(f)}},o.id=o.props.id||gI("tiny-react"),o.elementRef=J.createRef(),o.inline=(a=(r=o.props.inline)!==null&&r!==void 0?r:(i=o.props.init)===null||i===void 0?void 0:i.inline)!==null&&a!==void 0?a:!1,o.boundHandlers={},o}return Object.defineProperty(t.prototype,"view",{get:function(){var n,r;return(r=(n=this.elementRef.current)===null||n===void 0?void 0:n.ownerDocument.defaultView)!==null&&r!==void 0?r:window},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(n){var r=this,i,a;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(n),this.editor.initialized)){if(this.currentContent=(i=this.currentContent)!==null&&i!==void 0?i:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==n.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var o=this.editor;o.undoManager.transact(function(){var l;if(!r.inline||o.hasFocus())try{l=o.selection.getBookmark(3)}catch{}var u=r.valueCursor;if(o.setContent(r.props.value),!r.inline||o.hasFocus())for(var c=0,d=[l,u];c<d.length;c++){var h=d[c];if(h)try{o.selection.moveToBookmark(h),r.valueCursor=h;break}catch{}}})}if(this.props.readonly!==n.readonly){var s=(a=this.props.readonly)!==null&&a!==void 0?a:!1;Ux(this.editor,s?"readonly":"design")}this.props.disabled!==n.disabled&&(Xx(this.editor)?this.editor.options.set("disabled",this.props.disabled):Ux(this.editor,this.props.disabled?"readonly":"design"))}},t.prototype.componentDidMount=function(){var n=this,r,i,a,o,s;if(hI(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(i=(r=this.props).onScriptsLoadError)===null||i===void 0||i.call(r,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((a=this.elementRef.current)===null||a===void 0)&&a.ownerDocument){var l=function(){var c,d;(d=(c=n.props).onScriptsLoad)===null||d===void 0||d.call(c),n.initialise()},u=function(c){var d,h;(h=(d=n.props).onScriptsLoadError)===null||h===void 0||h.call(d,c)};IZ.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(s=(o=this.props.scriptLoading)===null||o===void 0?void 0:o.delay)!==null&&s!==void 0?s:0,l,u)}},t.prototype.componentWillUnmount=function(){var n=this,r=this.editor;r&&(r.off(v0,this.handleEditorChange),r.off(this.beforeInputEvent(),this.handleBeforeInput),r.off("keypress",this.handleEditorChangeSpecial),r.off("keydown",this.handleBeforeInputSpecial),r.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(i){r.off(i,n.boundHandlers[i])}),this.boundHandlers={},r.remove(),this.editor=void 0)},t.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},t.prototype.beforeInputEvent=function(){return yZ()?"beforeinput SelectionChange":"SelectionChange"},t.prototype.renderInline=function(){var n=this.props.tagName,r=n===void 0?"div":n;return J.createElement(r,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.renderIframe=function(){return J.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.getScriptSources=function(){var n,r,i=(n=this.props.scriptLoading)===null||n===void 0?void 0:n.async,a=(r=this.props.scriptLoading)===null||r===void 0?void 0:r.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:i,defer:a}]:this.props.tinymceScriptSrc.map(function(u){return typeof u=="string"?{src:u,async:i,defer:a}:u});var o=this.props.cloudChannel,s=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(s,"/tinymce/").concat(o,"/tinymce.min.js");return[{src:l,async:i,defer:a}]},t.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},t.prototype.bindHandlers=function(n){var r=this;if(this.editor!==void 0){bZ(this.editor,n,this.props,this.boundHandlers,function(s){return r.props[s]});var i=function(s){return s.onEditorChange!==void 0||s.value!==void 0},a=i(n),o=i(this.props);!a&&o?(this.editor.on(v0,this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!o&&(this.editor.off(v0,this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},t.propTypes=pZ,t.defaultProps={cloudChannel:"7"},t}(J.Component);const AZ=e=>_.jsx("div",{className:`${lZ.container}`,children:_.jsx(DZ,{..._l(oZ({label:e.label}),e)})}),TZ=({children:e,open:t,className:n,id:r,classNameContainer:i})=>(I.useLayoutEffect(()=>{const a=document.getElementById(r),o=document.getElementById(`inner-${r}`);if(!a||!o)return;const s=new ResizeObserver(()=>{const l=o.getBoundingClientRect().height;a.style.height=`${l}px`});if(t){const l=o.getBoundingClientRect().height;a.style.height=`${l}px`,s.observe(o)}else a.style.height="0px";return()=>{s.disconnect()}},[t,r]),_.jsx("div",{id:r,className:`${Qw.collapse} ${i??""}`,style:{height:0},children:_.jsx("div",{id:`inner-${r}`,className:n??"",children:e})})),RZ="_selected_dsej5_541",BZ="_error_dsej5_546",$Z="_disabled_dsej5_550",Bt={"container-time-range":"_container-time-range_dsej5_133","time-range-header":"_time-range-header_dsej5_133","text-to":"_text-to_dsej5_133","time-range":"_time-range_dsej5_133","time-range-body":"_time-range-body_dsej5_133","list-time":"_list-time_dsej5_133","container-time":"_container-time_dsej5_133","title-time":"_title-time_dsej5_133","cell-time":"_cell-time_dsej5_133","time-range-divider":"_time-range-divider_dsej5_502","container-cell-time":"_container-cell-time_dsej5_524",selected:RZ,error:BZ,disabled:$Z,"time-range-footer":"_time-range-footer_dsej5_557"},zo=(e,t=2)=>String(e).padStart(t,"0"),Zx=(e,t)=>e[0][0]&&e[0][1]&&e[1][0]&&e[1][1]?`${e[0][0]}:${e[0][1]} - ${e[1][0]}:${e[1][1]}`:io[t]["Select Time"],io={"en-US":{to:"to",Hour:"Hour",Minute:"Minute","Select Time":"Select Time",Reset:"Reset",Apply:"Apply"},"id-ID":{to:"to",Hour:"Jam",Minute:"Menit","Select Time":"Pilih Waktu",Reset:"Reset",Apply:"Terapkan"},"zh-CN":{to:"到",Hour:"小时",Minute:"分钟","Select Time":"选择时间",Reset:"重置",Apply:"应用"},"nl-NL":{to:"tot",Hour:"Uur",Minute:"Minuten","Select Time":"Select Time",Reset:"Reset",Apply:"Toepassen"}},Zs=[["",""],["",""]],kZ=e=>{const{id:t="time-range",classNameContainer:n,value:r=Zs,buttonClick:i,zIndexPopper:a=1,offsetPopover:o=5,floatingOptions:s,locale:l="id-ID",disableValidation:u=!1}=e,c=I.useRef(null),[d,h]=I.useState(Zs),f=(b,v)=>{if(v==="start"){const x=[b,d[1]];h(x)}else{const x=[d[0],b];h(x)}},g=b=>{var v;(v=c.current)==null||v.handlerShow(b),h(r||Zs)},p=()=>{var b;typeof(e==null?void 0:e.onChange)=="function"&&e.onChange(Zs),h(Zs),(b=c.current)==null||b.setShow(!1)},m=()=>{var B;const b=Number(d[0][0]),v=Number(d[0][1]),x=Number(d[1][0]),C=Number(d[1][1]),E=d[0][0]&&d[0][1]&&d[1][0]&&d[1][1],w=b<x||b===x&&v<=C;E&&(w||u)&&(typeof(e==null?void 0:e.onChange)=="function"&&e.onChange(d),(B=c.current)==null||B.setShow(!1))};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:t,onClick:g,className:n,children:typeof i=="function"?i(r,Zx(r,l)):r?Zx(r,l):io[l]["Select Time"]}),_.jsx(gi,{zIndex:a,ref:c,offset:o,id:`${t}-popover`,floatingOptions:{placement:"bottom-end",...s},className:"1ru-flex 1ru-flex-col",children:_.jsxs("div",{className:Bt["container-time-range"],children:[_.jsxs("div",{className:Bt["time-range-header"],children:[_.jsx("div",{className:Bt["time-range"],children:d[0][0]&&d[0][1]?`${d[0][0]}:${d[0][1]}`:"--:--"}),_.jsx("p",{className:Bt["text-to"],children:io[l].to}),_.jsx("div",{className:Bt["time-range"],children:d[1][0]&&d[1][1]?`${d[1][0]}:${d[1][1]}`:"--:--"})]}),_.jsxs("div",{className:Bt["time-range-body"],children:[_.jsx(Yx,{type:"start",value:[d[0][0],d[0][1]],onChange:b=>f(b,"start"),locale:l,values:d,disableValidation:u}),_.jsx("div",{className:Bt["time-range-divider"]}),_.jsx(Yx,{type:"end",value:[d[1][0],d[1][1]],onChange:b=>f(b,"end"),locale:l,values:d,disableValidation:u})]}),_.jsxs("div",{className:`${Bt["time-range-footer"]}`,children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:p,children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:p,children:io[l].Reset}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:m,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:m,children:io[l].Apply})]})]})})]})},Yx=e=>{const{value:t,onChange:n,type:r,locale:i,values:a,disableValidation:o}=e,s=(f,g,p)=>Array.from({length:(g-f)/p+1},(m,b)=>f+b*p),l=()=>{const f=document.getElementById(`time-range-${r}-hour-${t[0]}`),g=document.getElementById(`time-range-${r}-minute-${t[1]}`),p=document.getElementById(`time-range-${r}-hour`),m=document.getElementById(`time-range-${r}-minute`);f&&p&&p.scrollTo({behavior:"instant",top:f.offsetTop-75}),g&&m&&m.scrollTo({behavior:"instant",top:g.offsetTop-75})},u=f=>{if(r==="start"||o)return!1;{if(!a[0][0])return!1;const g=Number(a[0][0]);return f<g}},c=f=>{if(r==="start"||o)return!1;{if(!a[0][0]||!a[0][1]||!a[1][0])return!1;const g=Number(a[0][0]),p=Number(a[1][0]),m=Number(a[0][1]);return g===p&&f<m}},d=f=>{if(r==="start"||o)return!1;{const g=Number(a[0][0]);return f<g}},h=f=>{if(r==="start"||o)return!1;{if(!a[0][0]||!a[0][1]||!a[1][0])return!1;const g=Number(a[0][0]),p=Number(a[1][0]),m=Number(a[0][1]);return g===p&&f<m}};return I.useEffect(()=>{l()},[]),_.jsxs("div",{className:Bt["list-time"],children:[_.jsxs("div",{className:Bt["container-time"],children:[_.jsx("p",{className:Bt["title-time"],children:io[i].Hour}),_.jsx("div",{id:`time-range-${r}-hour`,className:Bt["container-cell-time"],children:s(0,23,1).map(f=>_.jsx("div",{id:`time-range-${r}-hour-${f}`,className:`${Bt["cell-time"]} ${t[0]===zo(f)?Bt.selected:""} ${u(f)?Bt.error:""} ${d(f)?Bt.disabled:""}`,onClick:()=>n([zo(f),t[1]]),children:zo(f)},f))})]}),_.jsxs("div",{className:Bt["container-time"],children:[_.jsx("p",{className:Bt["title-time"],children:io[i].Minute}),_.jsx("div",{id:`time-range-${r}-minute`,className:Bt["container-cell-time"],children:s(0,59,1).map(f=>_.jsx("div",{id:`time-range-${r}-minute-${f}`,className:`${Bt["cell-time"]} ${t[1]===zo(f)?Bt.selected:""} ${c(f)?Bt.error:""} ${h(f)?Bt.disabled:""}`,onClick:()=>n([t[0],zo(f)]),children:zo(f)},f))})]})]})},PZ="_container_4603f_421",FZ="_textarea_4603f_421",NZ="_label_4603f_421",MZ="_error_4603f_517",Ur={container:PZ,"size-large":"_size-large_4603f_421","container-textarea":"_container-textarea_4603f_421",textarea:FZ,"label-error":"_label-error_4603f_421","size-small":"_size-small_4603f_421",label:NZ,error:MZ},LZ={size:{large:Ur["size-large"],small:Ur["size-small"]}},pI=I.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:d,minHeight:h=94,maxHeight:f=150,style:g,sizeInput:p="large",...m}=e,b=I.useRef(null),v=If(b,t),x={...g??{},maxHeight:f,height:d??h,minHeight:h},[C,E]=I.useState(!1),w=function(S){var D;E(!0),(D=e.onFocus)==null||D.call(e,S)},B=function(S){var D;E(!1),(D=e.onBlur)==null||D.call(e,S)},y=function(S){const D=(S==null?void 0:S.target)??b.current;D.style.height="0px",D.style.height=D.scrollHeight+"px"};return wf(()=>(C&&b.current?b.current.addEventListener("input",y):y(),()=>{var S;(S=b.current)==null||S.removeEventListener("input",y)}),[C]),_.jsxs("div",{className:`${Ur.container}
225
225
  ${LZ.size[p]}
226
226
  ${r??""}`,children:[_.jsxs("div",{className:`${Ur["container-textarea"]}`,children:[_.jsx("textarea",{id:l??s,className:` ${c?Ur.error:""}
227
227
  ${Ur.textarea}
@@ -231,4 +231,4 @@ Valid keys: `+JSON.stringify(Object.keys(V),null," "));var Q=ce(X,le,ee,z,H+"."
231
231
  ${m()?Nn["isset-left-icon"]:""}
232
232
  ${b()?Nn["isset-right-icon"]:""}
233
233
  ${i??""}`,ref:t,type:c,...p}),_.jsxs("div",{className:Nn["end-icon"],children:[typeof h=="function"&&h(),I.isValidElement(h)&&h]}),u&&_.jsxs("label",{htmlFor:l??s,className:`${Nn.label} ${p.disabled?Nn.disabled:""} ${a??""}`,children:[u," ",n&&_.jsx("span",{children:"*"})]})]}),f&&_.jsx("label",{className:`${Nn["label-error"]}
234
- ${p.disabled?Nn.disabled:""} ${o??""}`,children:f})]})});mI.displayName="InputInnerLabel";exports.AlertContainer=_B;exports.Badges=Xw;exports.BigNumber=$t;exports.Breadcrumbs=FH;exports.Button=jn;exports.ButtonIcon=Uw;exports.ButtonPopover=cI;exports.Calendar=Mf;exports.CalendarRange=zw;exports.CheckboxTable=xX;exports.Chips=Zw;exports.Collapse=VH;exports.CollapseV2=TZ;exports.ConfigColors=a4;exports.ConfigTable=cn;exports.DatePicker=mH;exports.DateRangePicker=Gw;exports.DefaultCheckedChecboxIcon=Yw;exports.DefaultRadioChecboxIcon=Kw;exports.DoughnutChart=vX;exports.ErrorMessage=TX;exports.FilterContainer=e5;exports.FilterDate=bH;exports.GradientBarChart=JX;exports.GradientLineChart=ZX;exports.InputFloatingInner=P4;exports.InputInnerLabel=mI;exports.InputNative=r1;exports.InputReguler=Bp;exports.LineChart=VX;exports.ListVirtualization=j2;exports.ModalDialog=WH;exports.MonthYearPicker=yX;exports.NumberFormat=Sj;exports.Pagination=FP;exports.PatternFormat=Ej;exports.Popover=gi;exports.PortalComponent=Om;exports.RadioCheckbox=Lf;exports.RadioCheckboxLabel=RH;exports.SelectDropdownContainer=$3;exports.SelectDropdownContainerComponents=x3;exports.Sidebar=Jw;exports.Step=LX;exports.StepIndicator=iZ;exports.Switch=xH;exports.TPublish=A9;exports.TabPanel=DP;exports.Table=xP;exports.TableSubComponent=CP;exports.TableVirtualization=Jp;exports.Tabs=_P;exports.TextEditor=AZ;exports.Textarea=d5;exports.TextareaFloatingInner=uI;exports.TextareaInnerLabel=pI;exports.TimeRange=kZ;exports.Timeline=XH;exports.Tooltip=jX;exports.TruncateComponent=Dj;exports.TypeBigNumber=Jd;exports.UploadFile=c5;exports.UploadImage=$j;exports.UploadMultipleFile=DX;exports.betweenBig=VB;exports.configNativeScreens=U0;exports.configScreens=D9;exports.configTypography=_9;exports.configTypographyLabaBisnis=s4;exports.configTypographyPayhere=o4;exports.convertBigNumbersToStrings=G0;exports.convertNumbersToBigNumbers=z0;exports.convertTextToJsonBigNumbers=w9;exports.cookieStorage=gB;exports.deepCompareEquals=vp;exports.deepMerge=aB;exports.defaultConfig=aC;exports.deleteKeysImmutable=JC;exports.deleteKeysMutable=iB;exports.encryptRSAOAEP=cB;exports.extractElementStringToOriginalValue=uB;exports.formatBigNumber=dB;exports.formatDate=qo;exports.formatDateRange=qR;exports.formatNumber=Ji;exports.groupByKey=qC;exports.isAccurateBigNumber=ci;exports.isAccurateNumber=KC;exports.lessThanBig=OB;exports.maxBig=MB;exports.minBig=NB;exports.moreThanBig=LB;exports.openAlert=DB;exports.parseBigDecimal=cf;exports.parseDecimal=pp;exports.parseFileName=O0;exports.removeKeyObjectEmptyValue=QR;exports.removeTrailingZeros=fB;exports.setDigit=df;exports.transformArrayMapping=tB;exports.transformArrayMappingObjectFC=nB;exports.transformArrayOfObjectToArray=bp;exports.transformArrayOfObjectToString=mp;exports.transformBigNumber=sB;exports.transformDataHistory=JR;exports.transformLatLong=eB;exports.transformNumber=oB;exports.transformSecondTime=rB;exports.transfromIsNan=lB;exports.useAsyncDebounce=O2;exports.useCombinedResizeObserver=uP;exports.useCountdown=lP;exports.useDeepCompareEffect=ba;exports.useDeepCompareMemoize=Ol;exports.useElementOrWindowMediaQuery=sP;exports.useEventListener=hP;exports.useMasonry=gP;exports.useMergeRefs=If;exports.useOtpInput=pP;exports.useStateRef=cP;exports.utilTable=Ck;
234
+ ${p.disabled?Nn.disabled:""} ${o??""}`,children:f})]})});mI.displayName="InputInnerLabel";exports.AlertContainer=_B;exports.Badges=Xw;exports.BigNumber=At;exports.Breadcrumbs=FH;exports.Button=jn;exports.ButtonIcon=Uw;exports.ButtonPopover=cI;exports.Calendar=Mf;exports.CalendarRange=zw;exports.CheckboxTable=xX;exports.Chips=Zw;exports.Collapse=VH;exports.CollapseV2=TZ;exports.ConfigColors=a4;exports.ConfigTable=cn;exports.DatePicker=mH;exports.DateRangePicker=Gw;exports.DefaultCheckedChecboxIcon=Yw;exports.DefaultRadioChecboxIcon=Kw;exports.DoughnutChart=vX;exports.ErrorMessage=TX;exports.FilterContainer=e5;exports.FilterDate=bH;exports.GradientBarChart=JX;exports.GradientLineChart=ZX;exports.InputFloatingInner=P4;exports.InputInnerLabel=mI;exports.InputNative=r1;exports.InputReguler=Bp;exports.LineChart=VX;exports.ListVirtualization=j2;exports.ModalDialog=WH;exports.MonthYearPicker=yX;exports.NumberFormat=Sj;exports.Pagination=FP;exports.PatternFormat=Ej;exports.Popover=gi;exports.PortalComponent=Om;exports.RadioCheckbox=Lf;exports.RadioCheckboxLabel=RH;exports.SelectDropdownContainer=$3;exports.SelectDropdownContainerComponents=x3;exports.Sidebar=Jw;exports.Step=LX;exports.StepIndicator=iZ;exports.Switch=xH;exports.TPublish=A9;exports.TabPanel=DP;exports.Table=xP;exports.TableSubComponent=CP;exports.TableVirtualization=Jp;exports.Tabs=_P;exports.TextEditor=AZ;exports.Textarea=d5;exports.TextareaFloatingInner=uI;exports.TextareaInnerLabel=pI;exports.TimeRange=kZ;exports.Timeline=XH;exports.Tooltip=jX;exports.TruncateComponent=Dj;exports.TypeBigNumber=Jd;exports.UploadFile=c5;exports.UploadImage=$j;exports.UploadMultipleFile=DX;exports.betweenBig=VB;exports.configNativeScreens=U0;exports.configScreens=D9;exports.configTypography=_9;exports.configTypographyLabaBisnis=s4;exports.configTypographyPayhere=o4;exports.convertBigNumbersToStrings=G0;exports.convertNumbersToBigNumbers=z0;exports.convertTextToJsonBigNumbers=w9;exports.cookieStorage=gB;exports.deepCompareEquals=vp;exports.deepMerge=aB;exports.defaultConfig=aC;exports.deleteKeysImmutable=JC;exports.deleteKeysMutable=iB;exports.encryptRSAOAEP=cB;exports.extractElementStringToOriginalValue=uB;exports.formatBigNumber=dB;exports.formatDate=qo;exports.formatDateRange=qR;exports.formatNumber=Ji;exports.groupByKey=qC;exports.isAccurateBigNumber=ci;exports.isAccurateNumber=KC;exports.lessThanBig=OB;exports.maxBig=MB;exports.minBig=NB;exports.moreThanBig=LB;exports.openAlert=DB;exports.parseBigDecimal=cf;exports.parseDecimal=pp;exports.parseFileName=O0;exports.removeKeyObjectEmptyValue=QR;exports.removeTrailingZeros=fB;exports.setDigit=df;exports.transformArrayMapping=tB;exports.transformArrayMappingObjectFC=nB;exports.transformArrayOfObjectToArray=bp;exports.transformArrayOfObjectToString=mp;exports.transformBigNumber=sB;exports.transformDataHistory=JR;exports.transformLatLong=eB;exports.transformNumber=oB;exports.transformSecondTime=rB;exports.transfromIsNan=lB;exports.useAsyncDebounce=O2;exports.useCombinedResizeObserver=uP;exports.useCountdown=lP;exports.useDeepCompareEffect=ba;exports.useDeepCompareMemoize=Ol;exports.useElementOrWindowMediaQuery=sP;exports.useEventListener=hP;exports.useMasonry=gP;exports.useMergeRefs=If;exports.useOtpInput=pP;exports.useStateRef=cP;exports.utilTable=Ck;