react-kd-grid 1.0.0 → 1.1.0

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.
Files changed (42) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1537 -1537
  4. package/dist/index.js.map +1 -1
  5. package/dist/workers/CustomGrid.d.ts +3 -0
  6. package/dist/workers/components/ColumnFilterSelector.d.ts +18 -0
  7. package/dist/workers/components/CustomSelect.d.ts +14 -0
  8. package/dist/workers/components/FooterAggregate.d.ts +16 -0
  9. package/dist/workers/components/GridHeader.d.ts +33 -0
  10. package/dist/workers/components/GridRows.d.ts +49 -0
  11. package/dist/workers/components/GroupBar.d.ts +12 -0
  12. package/dist/workers/components/GroupHeader.d.ts +29 -0
  13. package/dist/workers/components/NoDataMessage.d.ts +7 -0
  14. package/dist/workers/components/PaginationControls.d.ts +15 -0
  15. package/dist/workers/components/Popover.d.ts +17 -0
  16. package/dist/workers/components/RowContextMenu.d.ts +22 -0
  17. package/dist/workers/components/SearchToolbar.d.ts +79 -0
  18. package/dist/workers/components/filters/BooleanFilter.d.ts +7 -0
  19. package/dist/workers/components/filters/DateFilter.d.ts +9 -0
  20. package/dist/workers/components/filters/FilterContent.d.ts +9 -0
  21. package/dist/workers/components/filters/FilterPopup.d.ts +2 -0
  22. package/dist/workers/components/filters/MultiselectFilter.d.ts +10 -0
  23. package/dist/workers/components/filters/NumberFilter.d.ts +9 -0
  24. package/dist/workers/components/filters/TextFilter.d.ts +8 -0
  25. package/dist/workers/components/filters/index.d.ts +6 -0
  26. package/dist/workers/components/ui/DatePicker.d.ts +10 -0
  27. package/dist/workers/constants.d.ts +1 -0
  28. package/dist/workers/dataWorker.js +2 -0
  29. package/dist/workers/dataWorker.js.map +1 -0
  30. package/dist/workers/hooks/useAdvancedFiltering.d.ts +16 -0
  31. package/dist/workers/hooks/useDataWorker.d.ts +10 -0
  32. package/dist/workers/hooks/useExport.d.ts +15 -0
  33. package/dist/workers/hooks/useFilteringAndSorting.d.ts +16 -0
  34. package/dist/workers/hooks/useGrouping.d.ts +28 -0
  35. package/dist/workers/hooks/usePagination.d.ts +28 -0
  36. package/dist/workers/hooks/useSelection.d.ts +13 -0
  37. package/dist/workers/hooks/useVirtualization.d.ts +17 -0
  38. package/dist/workers/index.d.ts +11 -0
  39. package/dist/workers/types.d.ts +421 -0
  40. package/dist/workers/utils/highlightText.d.ts +15 -0
  41. package/dist/workers/workers/dataWorker.d.ts +16 -0
  42. package/package.json +5 -5
package/dist/index.esm.js CHANGED
@@ -10735,7 +10735,7 @@ E("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:
10735
10735
  * This source code is licensed under the ISC license.
10736
10736
  * See the LICENSE file in the root directory of this source tree.
10737
10737
  */
10738
- E("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const de=({value:e,onChange:t,placeholder:r="Enter text to filter..."})=>{const[a,n]=s(e?.value||""),[i,o]=s(e?.operator||"contains");return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:i,onChange:e=>(e=>{const r=e;o(r),a.trim()&&t({type:"text",value:a,operator:r})})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"contains",children:"Contains"}),_.jsx("option",{value:"equals",children:"Equals"}),_.jsx("option",{value:"startsWith",children:"Starts with"}),_.jsx("option",{value:"endsWith",children:"Ends with"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Text Value"}),_.jsx("input",{type:"text",value:a,onChange:e=>{return r=e.target.value,n(r),void(r.trim()?t({type:"text",value:r,operator:i}):t(null));var r},placeholder:r,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]})},ce=({value:e,onChange:t,min:r,max:a})=>{const[n,i]=s(e?.value||""),[o,h]=s(e?.secondValue||""),[l,d]=s(e?.operator||"equals"),c=(e,r=!1)=>{r?h(e):i(e);const a=parseFloat(e),n=parseFloat(o);"between"===l?isNaN(a)||isNaN(n)?t(null):t({type:"number",value:Math.min(a,n),secondValue:Math.max(a,n),operator:"between"}):isNaN(a)?t(null):t({type:"number",value:a,operator:l})};return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:l,onChange:e=>(e=>{const r=e;if(d(r),"between"===r){const e=parseFloat(n),r=parseFloat(o);isNaN(e)||isNaN(r)||t({type:"number",value:Math.min(e,r),secondValue:Math.max(e,r),operator:"between"})}else{const e=parseFloat(n);isNaN(e)||t({type:"number",value:e,operator:r})}})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"equals",children:"Equals"}),_.jsx("option",{value:"gt",children:"Greater than"}),_.jsx("option",{value:"gte",children:"Greater than or equal"}),_.jsx("option",{value:"lt",children:"Less than"}),_.jsx("option",{value:"lte",children:"Less than or equal"}),_.jsx("option",{value:"between",children:"Between"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"between"===l?"From Value":"Number Value"}),_.jsx("input",{type:"number",value:n,onChange:e=>c(e.target.value),min:r,max:a,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),"between"===l&&_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"To Value"}),_.jsx("input",{type:"number",value:o,onChange:e=>c(e.target.value,!0),min:r,max:a,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]})},ue=({name:e,label:t,value:r,onChange:a,className:n=""})=>_.jsxs("div",{className:`space-y-1 ${n}`,children:[t&&_.jsx("label",{className:"text-sm font-medium text-gray-700",children:t}),_.jsx("input",{type:"date",name:e,value:r||"",onChange:e=>a(e.target.value||null),className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]});function fe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function pe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ye(e,t){const r=fe(e);return isNaN(t)?pe(e,NaN):t?(r.setDate(r.getDate()+t),r):r}const me=6048e5;let ge={};function be(){return ge}function ke(e,t){const r=be(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,n=fe(e),i=n.getDay(),s=(i<a?7:0)+i-a;return n.setDate(n.getDate()-s),n.setHours(0,0,0,0),n}function ve(e){return ke(e,{weekStartsOn:1})}function we(e){const t=fe(e),r=t.getFullYear(),a=pe(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const n=ve(a),i=pe(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=ve(i);return t.getTime()>=n.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function xe(e){const t=fe(e);return t.setHours(0,0,0,0),t}function Me(e){const t=fe(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function _e(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const r=fe(e);return!isNaN(Number(r))}const Se={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"}};function je(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Ce={date:je({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:je({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:je({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ae={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Te(e){return(t,r)=>{let a;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,n=r?.width?String(r.width):t;a=e.formattingValues[n]||e.formattingValues[t]}else{const t=e.defaultWidth,n=r?.width?String(r.width):e.defaultWidth;a=e.values[n]||e.values[t]}return a[e.argumentCallback?e.argumentCallback(t):t]}}const Ee={ordinalNumber:(e,t)=>{const r=Number(e),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Te({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Te({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Te({values:{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"]},defaultWidth:"wide"}),day:Te({values:{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"]},defaultWidth:"wide"}),dayPeriod:Te({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})};function Ne(e){return(t,r={})=>{const a=r.width,n=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const s=i[0],o=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(o)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(o,e=>e.test(s)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(o,e=>e.test(s));let l;l=e.valueCallback?e.valueCallback(h):h,l=r.valueCallback?r.valueCallback(l):l;return{value:l,rest:t.slice(s.length)}}}const ze={ordinalNumber:(Re={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const r=e.match(Re.matchPattern);if(!r)return null;const a=r[0],n=e.match(Re.parsePattern);if(!n)return null;let i=Re.valueCallback?Re.valueCallback(n[0]):n[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(a.length)}}),era:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Ne({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:Ne({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})};var Re;const Oe={code:"en-US",formatDistance:(e,t,r)=>{let a;const n=Se[e];return a="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a},formatLong:Ce,formatRelative:(e,t,r,a)=>Ae[e],localize:Ee,match:ze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pe(e){const t=fe(e),r=function(e,t){const r=xe(e),a=xe(t),n=+r-Me(r),i=+a-Me(a);return Math.round((n-i)/864e5)}(t,function(e){const t=fe(e),r=pe(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}(t));return r+1}function Le(e){const t=fe(e),r=+ve(t)-+function(e){const t=we(e),r=pe(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),ve(r)}(t);return Math.round(r/me)+1}function Ie(e,t){const r=fe(e),a=r.getFullYear(),n=be(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=pe(e,0);s.setFullYear(a+1,0,i),s.setHours(0,0,0,0);const o=ke(s,t),h=pe(e,0);h.setFullYear(a,0,i),h.setHours(0,0,0,0);const l=ke(h,t);return r.getTime()>=o.getTime()?a+1:r.getTime()>=l.getTime()?a:a-1}function qe(e,t){const r=fe(e),a=+ke(r,t)-+function(e,t){const r=be(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,n=Ie(e,t),i=pe(e,0);return i.setFullYear(n,0,a),i.setHours(0,0,0,0),ke(i,t)}(r,t);return Math.round(a/me)+1}function De(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const He={y(e,t){const r=e.getFullYear(),a=r>0?r:1-r;return De("yy"===t?a%100:a,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):De(r+1,2)},d:(e,t)=>De(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>De(e.getHours()%12||12,t.length),H:(e,t)=>De(e.getHours(),t.length),m:(e,t)=>De(e.getMinutes(),t.length),s:(e,t)=>De(e.getSeconds(),t.length),S(e,t){const r=t.length,a=e.getMilliseconds();return De(Math.trunc(a*Math.pow(10,r-3)),t.length)}},Fe="midnight",Be="noon",Ve="morning",Ue="afternoon",$e="evening",We="night",Ze={G:function(e,t,r){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),a=t>0?t:1-t;return r.ordinalNumber(a,{unit:"year"})}return He.y(e,t)},Y:function(e,t,r,a){const n=Ie(e,a),i=n>0?n:1-n;if("YY"===t){return De(i%100,2)}return"Yo"===t?r.ordinalNumber(i,{unit:"year"}):De(i,t.length)},R:function(e,t){return De(we(e),t.length)},u:function(e,t){return De(e.getFullYear(),t.length)},Q:function(e,t,r){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return De(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,r){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return De(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,r){const a=e.getMonth();switch(t){case"M":case"MM":return He.M(e,t);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,r){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return De(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,r,a){const n=qe(e,a);return"wo"===t?r.ordinalNumber(n,{unit:"week"}):De(n,t.length)},I:function(e,t,r){const a=Le(e);return"Io"===t?r.ordinalNumber(a,{unit:"week"}):De(a,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):He.d(e,t)},D:function(e,t,r){const a=Pe(e);return"Do"===t?r.ordinalNumber(a,{unit:"dayOfYear"}):De(a,t.length)},E:function(e,t,r){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,r,a){const n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return De(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,r,a){const n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return De(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"});default:return r.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,r){const a=e.getDay(),n=0===a?7:a;switch(t){case"i":return String(n);case"ii":return De(n,t.length);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const a=e.getHours();let n;switch(n=12===a?Be:0===a?Fe:a/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){const a=e.getHours();let n;switch(n=a>=17?$e:a>=12?Ue:a>=4?Ve:We,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return He.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):He.H(e,t)},K:function(e,t,r){const a=e.getHours()%12;return"Ko"===t?r.ordinalNumber(a,{unit:"hour"}):De(a,t.length)},k:function(e,t,r){let a=e.getHours();return 0===a&&(a=24),"ko"===t?r.ordinalNumber(a,{unit:"hour"}):De(a,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):He.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):He.s(e,t)},S:function(e,t){return He.S(e,t)},X:function(e,t,r){const a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return Ke(a);case"XXXX":case"XX":return Ge(a);default:return Ge(a,":")}},x:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"x":return Ke(a);case"xxxx":case"xx":return Ge(a);default:return Ge(a,":")}},O:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xe(a,":");default:return"GMT"+Ge(a,":")}},z:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xe(a,":");default:return"GMT"+Ge(a,":")}},t:function(e,t,r){return De(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,r){return De(e.getTime(),t.length)}};function Xe(e,t=""){const r=e>0?"-":"+",a=Math.abs(e),n=Math.trunc(a/60),i=a%60;return 0===i?r+String(n):r+String(n)+t+De(i,2)}function Ke(e,t){if(e%60==0){return(e>0?"-":"+")+De(Math.abs(e)/60,2)}return Ge(e,t)}function Ge(e,t=""){const r=e>0?"-":"+",a=Math.abs(e);return r+De(Math.trunc(a/60),2)+t+De(a%60,2)}const Ye=(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"});default:return t.date({width:"full"})}},Je=(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"});default:return t.time({width:"full"})}},Qe={p:Je,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],a=r[1],n=r[2];if(!n)return Ye(e,t);let i;switch(a){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",Ye(a,t)).replace("{{time}}",Je(n,t))}},et=/^D+$/,tt=/^Y+$/,rt=["D","DD","YY","YYYY"];function at(e){return et.test(e)}function nt(e){return tt.test(e)}function it(e,t,r){const a=function(e,t,r){const a="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(console.warn(a),rt.includes(e))throw new RangeError(a)}const st=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ot=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ht=/^'([^]*?)'?$/,lt=/''/g,dt=/[a-zA-Z]/;function ct(e,t,r){const a=be(),n=r?.locale??a.locale??Oe,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,o=fe(e);if(!_e(o))throw new RangeError("Invalid time value");let h=t.match(ot).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Qe[t])(e,n.formatLong)}return e}).join("").match(st).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ut(e)};if(Ze[t])return{isToken:!0,value:e};if(t.match(dt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});n.localize.preprocessor&&(h=n.localize.preprocessor(o,h));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return h.map(a=>{if(!a.isToken)return a.value;const i=a.value;(!r?.useAdditionalWeekYearTokens&&nt(i)||!r?.useAdditionalDayOfYearTokens&&at(i))&&it(i,t,String(e));return(0,Ze[i[0]])(o,i,n.localize,l)}).join("")}function ut(e){const t=e.match(ht);return t?t[1].replace(lt,"'"):e}class ft{subPriority=0;validate(e,t){return!0}}class pt extends ft{constructor(e,t,r,a,n){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=a,n&&(this.subPriority=n)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}}class yt extends ft{priority=10;subPriority=-1;set(e,t){return t.timestampIsSet?e:pe(e,function(e,t){const r=t instanceof Date?pe(t,0):new t(0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}(e,Date))}}class mt{run(e,t,r,a){const n=this.parse(e,t,r,a);return n?{setter:new pt(n.value,this.validate,this.set,this.priority,this.subPriority),rest:n.rest}:null}validate(e,t,r){return!0}}const gt=/^(1[0-2]|0?\d)/,bt=/^(3[0-1]|[0-2]?\d)/,kt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,vt=/^(5[0-3]|[0-4]?\d)/,wt=/^(2[0-3]|[0-1]?\d)/,xt=/^(2[0-4]|[0-1]?\d)/,Mt=/^(1[0-1]|0?\d)/,_t=/^(1[0-2]|0?\d)/,St=/^[0-5]?\d/,jt=/^[0-5]?\d/,Ct=/^\d/,At=/^\d{1,2}/,Tt=/^\d{1,3}/,Et=/^\d{1,4}/,Nt=/^-?\d+/,zt=/^-?\d/,Rt=/^-?\d{1,2}/,Ot=/^-?\d{1,3}/,Pt=/^-?\d{1,4}/,Lt=/^([+-])(\d{2})(\d{2})?|Z/,It=/^([+-])(\d{2})(\d{2})|Z/,qt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Dt=/^([+-])(\d{2}):(\d{2})|Z/,Ht=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Ft(e,t){return e?{value:t(e.value),rest:e.rest}:e}function Bt(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function Vt(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:t.slice(r[0].length)}}function Ut(e){return Bt(Nt,e)}function $t(e,t){switch(e){case 1:return Bt(Ct,t);case 2:return Bt(At,t);case 3:return Bt(Tt,t);case 4:return Bt(Et,t);default:return Bt(new RegExp("^\\d{1,"+e+"}"),t)}}function Wt(e,t){switch(e){case 1:return Bt(zt,t);case 2:return Bt(Rt,t);case 3:return Bt(Ot,t);case 4:return Bt(Pt,t);default:return Bt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Zt(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Xt(e,t){const r=t>0,a=r?t:1-t;let n;if(a<=50)n=e||100;else{const t=a+50;n=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?n:1-n}function Kt(e){return e%400==0||e%4==0&&e%100!=0}const Gt=[31,28,31,30,31,30,31,31,30,31,30,31],Yt=[31,29,31,30,31,30,31,31,30,31,30,31];function Jt(e,t,r){const a=be(),n=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=fe(e),s=i.getDay(),o=7-n;return ye(i,t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7)}function Qt(e,t){const r=fe(e),a=function(e){let t=fe(e).getDay();return 0===t&&(t=7),t}(r);return ye(r,t-a)}const er={G:new class extends mt{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends mt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const a=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return Ft($t(4,e),a);case"yo":return Ft(r.ordinalNumber(e,{unit:"year"}),a);default:return Ft($t(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const a=e.getFullYear();if(r.isTwoDigitYear){const t=Xt(r.year,a);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const n="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}},Y:new class extends mt{priority=130;parse(e,t,r){const a=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return Ft($t(4,e),a);case"Yo":return Ft(r.ordinalNumber(e,{unit:"year"}),a);default:return Ft($t(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,a){const n=Ie(e,a);if(r.isTwoDigitYear){const t=Xt(r.year,n);return e.setFullYear(t,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ke(e,a)}const i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ke(e,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends mt{priority=130;parse(e,t){return Wt("R"===t?4:t.length,e)}set(e,t,r){const a=pe(e,0);return a.setFullYear(r,0,4),a.setHours(0,0,0,0),ve(a)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends mt{priority=130;parse(e,t){return Wt("u"===t?4:t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends mt{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return $t(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends mt{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return $t(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends mt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const a=e=>e-1;switch(t){case"M":return Ft(Bt(gt,e),a);case"MM":return Ft($t(2,e),a);case"Mo":return Ft(r.ordinalNumber(e,{unit:"month"}),a);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends mt{priority=110;parse(e,t,r){const a=e=>e-1;switch(t){case"L":return Ft(Bt(gt,e),a);case"LL":return Ft($t(2,e),a);case"Lo":return Ft(r.ordinalNumber(e,{unit:"month"}),a);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends mt{priority=100;parse(e,t,r){switch(t){case"w":return Bt(vt,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,a){return ke(function(e,t,r){const a=fe(e),n=qe(a,r)-t;return a.setDate(a.getDate()-7*n),a}(e,r,a),a)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends mt{priority=100;parse(e,t,r){switch(t){case"I":return Bt(vt,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return ve(function(e,t){const r=fe(e),a=Le(r)-t;return r.setDate(r.getDate()-7*a),r}(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends mt{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return Bt(bt,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return $t(t.length,e)}}validate(e,t){const r=Kt(e.getFullYear()),a=e.getMonth();return r?t>=1&&t<=Yt[a]:t>=1&&t<=Gt[a]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends mt{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return Bt(kt,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return $t(t.length,e)}}validate(e,t){return Kt(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends mt{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends mt{priority=90;parse(e,t,r,a){const n=e=>{const t=7*Math.floor((e-1)/7);return(e+a.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return Ft($t(t.length,e),n);case"eo":return Ft(r.ordinalNumber(e,{unit:"day"}),n);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends mt{priority=90;parse(e,t,r,a){const n=e=>{const t=7*Math.floor((e-1)/7);return(e+a.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return Ft($t(t.length,e),n);case"co":return Ft(r.ordinalNumber(e,{unit:"day"}),n);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends mt{priority=90;parse(e,t,r){const a=e=>0===e?7:e;switch(t){case"i":case"ii":return $t(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return Ft(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ft(r.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ft(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a);default:return Ft(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=Qt(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends mt{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends mt{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends mt{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends mt{priority=70;parse(e,t,r){switch(t){case"h":return Bt(_t,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const a=e.getHours()>=12;return a&&r<12?e.setHours(r+12,0,0,0):a||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends mt{priority=70;parse(e,t,r){switch(t){case"H":return Bt(wt,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends mt{priority=70;parse(e,t,r){switch(t){case"K":return Bt(Mt,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends mt{priority=70;parse(e,t,r){switch(t){case"k":return Bt(xt,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const a=r<=24?r%24:r;return e.setHours(a,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends mt{priority=60;parse(e,t,r){switch(t){case"m":return Bt(St,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends mt{priority=50;parse(e,t,r){switch(t){case"s":return Bt(jt,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends mt{priority=30;parse(e,t){return Ft($t(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends mt{priority=10;parse(e,t){switch(t){case"X":return Vt(Lt,e);case"XX":return Vt(It,e);case"XXXX":return Vt(qt,e);case"XXXXX":return Vt(Ht,e);default:return Vt(Dt,e)}}set(e,t,r){return t.timestampIsSet?e:pe(e,e.getTime()-Me(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends mt{priority=10;parse(e,t){switch(t){case"x":return Vt(Lt,e);case"xx":return Vt(It,e);case"xxxx":return Vt(qt,e);case"xxxxx":return Vt(Ht,e);default:return Vt(Dt,e)}}set(e,t,r){return t.timestampIsSet?e:pe(e,e.getTime()-Me(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends mt{priority=40;parse(e){return Ut(e)}set(e,t,r){return[pe(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends mt{priority=20;parse(e){return Ut(e)}set(e,t,r){return[pe(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},tr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ar=/^'([^]*?)'?$/,nr=/''/g,ir=/\S/,sr=/[a-zA-Z]/;function or(e,t,r,a){const n=Object.assign({},be()),i=a?.locale??n.locale??Oe,s=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;if(""===t)return""===e?fe(r):pe(r,NaN);const h={firstWeekContainsDate:s,weekStartsOn:o,locale:i},l=[new yt],d=t.match(rr).map(e=>{const t=e[0];if(t in Qe){return(0,Qe[t])(e,i.formatLong)}return e}).join("").match(tr),c=[];for(let n of d){!a?.useAdditionalWeekYearTokens&&nt(n)&&it(n,t,e),!a?.useAdditionalDayOfYearTokens&&at(n)&&it(n,t,e);const s=n[0],o=er[s];if(o){const{incompatibleTokens:t}=o;if(Array.isArray(t)){const e=c.find(e=>t.includes(e.token)||e.token===s);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if("*"===o.incompatibleTokens&&c.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);c.push({token:s,fullToken:n});const a=o.run(e,n,i.match,h);if(!a)return pe(r,NaN);l.push(a.setter),e=a.rest}else{if(s.match(sr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");if("''"===n?n="'":"'"===s&&(n=hr(n)),0!==e.indexOf(n))return pe(r,NaN);e=e.slice(n.length)}}if(e.length>0&&ir.test(e))return pe(r,NaN);const u=l.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>l.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let f=fe(r);if(isNaN(f.getTime()))return pe(r,NaN);const p={};for(const e of u){if(!e.validate(f,h))return pe(r,NaN);const t=e.set(f,p,h);Array.isArray(t)?(f=t[0],Object.assign(p,t[1])):f=t}return pe(r,f)}function hr(e){return e.match(ar)[1].replace(nr,"'")}const lr=({value:e,onChange:t,min:r,max:n})=>{const i=e=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;try{const t=or(String(e),"yyyy-MM-dd",new Date);return isNaN(t.getTime())?null:t}catch(t){const r=new Date(e);return isNaN(r.getTime())?null:r}},h=e=>e?ct(e,"yyyy-MM-dd"):"",[l,d]=s(i(e?.value)),[c,u]=s("between"===e?.operator?i(e?.secondValue??e?.value):null),[f,p]=s(e?.operator||"between");o(()=>{p(e?.operator||"between"),d(i(e?.value)),u("between"===e?.operator?i(e?.secondValue??e?.value):null)},[e?.value,e?.secondValue,e?.operator]),o(()=>{"between"===f&&!c&&l&&u(l)},[f,l,c]);const y=(e,t,r)=>e?t&&e<t||r&&e>r?null:e:null,m=(e,r=!1)=>{const a=r?l:e,n=r?e:c,i="between"===f&&c?c:b,s=r?y(e,l??g??void 0,b):y(e,g,i);if(r?u(s):d(s),"between"===f)if(a&&n){const e=a>=n?a:n;t({type:"date",value:h(a<=n?a:n),secondValue:h(e),operator:"between"})}else t(null);else t(s?{type:"date",value:h(s),operator:f}:null)},g=a(()=>r?new Date(r):void 0,[r]),b=a(()=>n?new Date(n):void 0,[n]);return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:f,onChange:e=>(e=>{const r=e;p(r),"between"===r?l&&c&&t({type:"date",value:l<=c?l:c,secondValue:l>=c?l:c,operator:"between"}):l&&t({type:"date",value:l,operator:r})})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"equals",children:"On Date"}),_.jsx("option",{value:"gt",children:"After"}),_.jsx("option",{value:"gte",children:"On or After"}),_.jsx("option",{value:"lt",children:"Before"}),_.jsx("option",{value:"lte",children:"On or Before"}),_.jsx("option",{value:"between",children:"Between Dates"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"between"===f?"From Date":"Date"}),_.jsx(ue,{name:"date_filter_start",value:l?ct(l,"yyyy-MM-dd"):null,onChange:e=>m(e?or(e,"yyyy-MM-dd",new Date):null,!1),className:"w-full"})]}),"between"===f&&_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"To Date"}),_.jsx(ue,{name:"date_filter_end",value:c?ct(c,"yyyy-MM-dd"):null,onChange:e=>m(e?or(e,"yyyy-MM-dd",new Date):null,!0),className:"w-full"})]})]})},dr=({value:e,onChange:t,options:r,data:n,columnKey:i})=>{const[h,l]=s(""),[d,c]=s(new Set(e?.value||[]));o(()=>{c(new Set(e?.value||[]))},[e]);const u=a(()=>{let e=[];const t=e=>null==e||""===e||"string"==typeof e&&""===e.trim();if(r&&r.length>0)e=r;else{const r=n.map(e=>{const r=e[i];return t(r)?null:r});e=[...new Set(r)].map(e=>({label:null===e?"Blank":String(e),value:e}))}const a=e.map(e=>{const r=t(e.value);return{...e,label:r?"Blank":e.label,value:r?null:e.value,isBlank:r}});return Array.from(new Map(a.map(e=>[e.isBlank?"__blank__":e.value,e])).values()).sort((e,t)=>e.isBlank&&!t.isBlank?1:!e.isBlank&&t.isBlank?-1:String(e.label).localeCompare(String(t.label)))},[r,n,i]),f=a(()=>{if(!h)return u;const e=h.toLowerCase();return u.filter(t=>t.label.toLowerCase().includes(e)||String(t.value).toLowerCase().includes(e)||"blank"===e&&t.isBlank)},[u,h]);return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"relative",children:[_.jsx(re,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),_.jsx("input",{type:"text",value:h,onChange:e=>l(e.target.value),placeholder:"Search options...",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),_.jsxs("div",{className:"flex justify-between items-center text-sm",children:[_.jsxs("span",{className:"text-gray-600",children:[d.size," of ",u.length," selected"]}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx("button",{onClick:()=>{const e=new Set(f.map(e=>e.value));c(e),t({type:"multiselect",value:Array.from(e),operator:"equals"})},className:"text-blue-600 hover:text-blue-800 transition-colors",children:"Select All"}),_.jsx("button",{onClick:()=>{c(new Set),t(null)},className:"text-gray-600 hover:text-gray-800 transition-colors",children:"Clear All"})]})]}),_.jsx("div",{className:"max-h-48 overflow-y-auto border border-gray-200 rounded-md",children:0===f.length?_.jsx("div",{className:"p-3 text-sm text-gray-500 text-center",children:"No options found"}):f.map((e,r)=>{const a=d.has(e.value);return _.jsxs("div",{onClick:()=>(e=>{const r=new Set(d);r.has(e)?r.delete(e):r.add(e),c(r),r.size>0?t({type:"multiselect",value:Array.from(r),operator:"equals"}):t(null)})(e.value),className:"flex items-center gap-3 p-2 cursor-pointer hover:bg-gray-50 transition-colors "+(a?"bg-blue-50":""),children:[_.jsx("div",{className:"w-4 h-4 border-2 rounded flex items-center justify-center "+(a?"bg-blue-600 border-blue-600 text-white":"border-gray-300"),children:a&&_.jsx(P,{className:"w-3 h-3"})}),_.jsx("span",{className:`text-sm ${a?"text-blue-900 font-medium":"text-gray-700"} ${e.isBlank?"italic text-gray-500":""}`,children:e.label})]},r)})})]})},cr=({value:e,onChange:t})=>{const[r,a]=s(void 0!==e?.value?String(e.value):"");return _.jsx("div",{className:"space-y-3",children:_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Boolean Value"}),_.jsxs("select",{value:r,onChange:e=>{return r=e.target.value,a(r),void t(""===r?null:{type:"boolean",value:"true"===r,operator:"equals"});var r},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"",children:"All values"}),_.jsx("option",{value:"true",children:"True"}),_.jsx("option",{value:"false",children:"False"})]})]})})},ur=({column:e,data:t,value:r,onChange:n})=>{const i=a(()=>{if("object"==typeof e.filterable)return e.filterable;const r=t.slice(0,100).map(t=>t[e.key]).filter(e=>null!=e);if(0===r.length)return{type:"text"};const a=r[0];if("boolean"==typeof a)return{type:"boolean"};if("number"==typeof a)return{type:"number"};if(a instanceof Date||"string"==typeof a&&!isNaN(Date.parse(a)))return{type:"date"};const n=[...new Set(r)];return n.length<=20?{type:"multiselect",options:n.map(e=>({label:String(e),value:e}))}:{type:"text"}},[e.filterable,e.key,t]);switch(i.type){case"text":return _.jsx(de,{value:r,onChange:n,placeholder:i.placeholder});case"number":return _.jsx(ce,{value:r,onChange:n,min:i.min,max:i.max});case"date":return _.jsx(lr,{value:r,onChange:n,min:i.min,max:i.max});case"multiselect":return _.jsx(dr,{value:r,onChange:n,options:i.options||[],data:t,columnKey:e.key});case"boolean":return _.jsx(cr,{value:r,onChange:n});default:return null}},fr=({pinnedColumns:e,unpinnedColumns:t,hvPadLeft:r=0,hvPadRight:a=0,headerHeight:n,sortConfig:i,columnFilters:h,selectable:l,selectedRows:d,totalRows:c,data:u,onSort:f,onColumnFilter:p,onSelectAll:y,onColumnResize:m,pinnedKeySet:g=new Set,onColumnPin:b,groupable:k=!1,groupedByColumn:v,onGroupBy:w,groupedByColumns:x=[],onGroupToggle:M,onAutosizeColumn:j,onAutosizeAllColumns:C,onResetColumns:A,columnOrder:T,onColumnOrderChange:E,paginationMode:N="client"})=>{const P=[...e,...t],[L,I]=s(null),[q,D]=s(null),[H,F]=s(null),[B,V]=s(0),[U,$]=s(0),[W,Z]=s("menu"),[Y,J]=s(null),[re,ae]=s(!1);o(()=>{ae("ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia("(pointer: coarse)").matches)},[]);const[ne,ie]=s(null),[se,he]=s(null),le=d.size===c&&c>0,de=d.size>0&&d.size<c,ce=(e,t)=>{if(t.stopPropagation(),L===e)I(null);else{I(e),Z("menu"),J(h[e]||null);const r=t.currentTarget.getBoundingClientRect(),a=t.currentTarget.closest("[data-grid-container]"),n=a?a.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight),i=320,s=10,o=n.left+s,l=n.right-i-s,d=Math.max(o,Math.min(r.left,l));D({top:r.bottom+4,left:d,containerRect:n})}},ue=e=>{p(e,Y||null),I(null)},fe=e=>null!=h[e],pe=(r,a)=>{a.preventDefault(),F(r),V(a.clientX);const n=[...e,...t].find(e=>e.key===r);$(n?.width||100)},ye=e=>{if(!H||!m)return;const t=e.clientX-B,r=Math.max(50,U+t);m(H,r)},me=()=>{F(null),V(0),$(0)},[ge,be]=s(null),[ke,ve]=s(null),we=(e,t)=>{be(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)},xe=(e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.left+r.width/2,n=t.clientX<a?"before":"after";ve({key:e,position:n})},Me=e=>{const t=ge;if(!t||t===e)return;if(g.has(t)!==g.has(e))return be(null),void ve(null);const r=ke?.key!==e||"before"===ke?.position,a=T.filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return E(a),be(null),void ve(null);r||(n+=1),a.splice(n,0,t);E(a),be(null),ve(null)},_e=()=>{be(null),ve(null)},Se=(e,t)=>{ie(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)},je=(e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.top+r.height/2,n=t.clientY<a?"before":"after";he({key:e,position:n})},Ce=e=>{const t=ne;if(!t||t===e)return;if(g.has(t)!==g.has(e))return ie(null),void he(null);const r=se?.key!==e||"before"===se?.position,a=T.filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return E(a),ie(null),void he(null);r||(n+=1),a.splice(n,0,t),E(a),ie(null),he(null)},Ae=()=>{ie(null),he(null)};return o(()=>{if(H)return document.addEventListener("mousemove",ye),document.addEventListener("mouseup",me),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",me),document.body.style.cursor="",document.body.style.userSelect=""}},[H,B,U,m]),o(()=>{const e=e=>{const t=e.target;L&&!t.closest("[data-column-menu]")&&I(null)};if(L)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[L]),_.jsx(_.Fragment,{children:_.jsx("div",{className:"bg-blue-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",style:{height:n},role:"row","aria-label":"Column headers",children:_.jsxs("div",{className:"flex h-full",children:[l&&_.jsx("div",{className:"px-3 border-r border-gray-200 dark:border-gray-700 flex items-center justify-center bg-blue-50 dark:bg-gray-800 sticky left-0 z-3 h-full",style:{width:S,height:n},role:"columnheader","aria-label":"Select all rows",children:_.jsx("input",{type:"checkbox",checked:le,ref:e=>{e&&(e.indeterminate=de)},onChange:y,onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),y())},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 h-4 w-4 transition-all duration-150","aria-label":le?"Deselect all rows":de?`${d.size} rows selected. Click to select all`:"Select all rows",title:le?`Deselect all ${c} rows`:de?`${d.size} of ${c} rows selected`:`Select all ${c} rows`})}),e.map((t,r)=>{const a=g.has(t.key),s=e.filter(e=>g.has(e.key)).map(e=>e.key),o=s.indexOf(t.key),h=a?s.slice(0,o).reduce((t,r)=>{const a=e.find(e=>e.key===r);return t+(a?.width||100)},l?S:0):0,d="center"===t.headerAlign?"justify-center":"right"===t.headerAlign?"justify-end":"justify-start",c=!1!==t.sortable;return _.jsxs("div",{className:`flex-none border-r border-gray-200 dark:border-gray-700 last:border-r-0 relative ${a?"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700 sticky z-2":""} `,style:{width:t.width||100,left:a?`${h}px`:"auto",height:n},"data-column-key":t.key,draggable:!0,onDragStart:e=>we(t.key,e),onDragOver:e=>xe(t.key,e),onDrop:()=>Me(t.key),onDragEnd:_e,children:[ke?.key===t.key&&_.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 z-4",style:{left:"before"===ke?.position?0:void 0,right:"after"===ke?.position?0:void 0}}),_.jsx("div",{className:"px-3 h-full",children:_.jsxs("div",{className:"flex items-center justify-between gap-1 group h-full",children:[_.jsxs("div",{className:`flex items-center min-w-0 flex-1 ${d} ${c?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>c&&f(t.key),children:[_.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[fe(t.key)&&_.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full shrink-0",title:"Filter applied"}),_.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 text-sm truncate min-w-0",children:t.header})]}),c&&i.key===t.key&&_.jsx("div",{className:"ml-1 shrink-0 pointer-events-none select-none",children:"asc"===i.direction?_.jsx(O,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"}):_.jsx(z,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"})})]}),(t.filterable||b||k)&&_.jsxs("div",{className:"relative "+(L===t.key||re?"block":"hidden group-hover:block"),"data-column-menu":!0,children:[_.jsx("button",{className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded shrink-0",onClick:e=>ce(t.key,e),"data-menu-trigger":!0,children:_.jsx(Q,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),L===t.key&&q&&_.jsxs("div",{className:"fixed bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg z-1000 w-[320px] overflow-auto",style:{top:`${q.top}px`,left:`${q.left}px`,maxHeight:`${Math.max(160,q.containerRect.bottom-12-q.top)}px`},"data-column-menu":!0,children:[_.jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700",children:[_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("menu"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("menu"),children:_.jsx(Q,{className:"w-4 h-4"})}),t.filterable&&_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("filter"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("filter"),children:_.jsx(K,{className:"w-4 h-4"})}),_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("reorder"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("reorder"),children:_.jsx(R,{className:"w-4 h-4"})})]}),"menu"===W&&_.jsxs("div",{className:"py-1",children:[b&&(v===t.key?_.jsxs("div",{className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 text-blue-600",children:[_.jsx(te,{className:"w-4 h-4"}),"Pinned by grouping"]}):_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:e=>{e.stopPropagation(),I(null),b?.(t.key,!g.has(t.key))},children:g.has(t.key)?_.jsxs(_.Fragment,{children:[_.jsx(ee,{className:"w-4 h-4"}),"Unpin Column"]}):_.jsxs(_.Fragment,{children:[_.jsx(te,{className:"w-4 h-4"}),"Pin Column"]})})),j&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{j?.(t.key),I(null)},children:"Autosize This Column"}),C&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{C?.(),I(null)},children:"Autosize All Columns"}),k&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:e=>{e.stopPropagation(),I(null);const r=x?.includes(t.key)||v===t.key;M?M(t.key,!r):w?.(r?null:t.key)},children:v===t.key||x?.includes(t.key)?_.jsxs(_.Fragment,{children:[_.jsx(oe,{className:"w-4 h-4"}),"Ungroup"]}):_.jsxs(_.Fragment,{children:[_.jsx(G,{className:"w-4 h-4"}),"Group by ",t.header]})}),A&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{A?.(),I(null)},children:"Reset Columns"})]}),"filter"===W&&_.jsxs("div",{className:"p-3 w-full",children:[fe(t.key)&&_.jsxs("button",{className:"mb-2 text-xs text-red-600 hover:underline flex items-center gap-1",onClick:()=>{J(null),p(t.key,null),I(null)},children:[_.jsx(X,{className:"w-3 h-3"})," Clear Filter"]}),_.jsx("div",{className:"max-h-75 overflow-auto pr-1",children:_.jsx(ur,{column:t,data:u,value:Y,onChange:e=>{J(e),"server"!==N&&p(t.key,e)}})}),"server"===N?_.jsxs("div",{className:"flex justify-end gap-2 mt-3",children:[_.jsx("button",{className:"px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200",onClick:()=>I(null),children:"Cancel"}),_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>ue(t.key),children:"Apply"})]}):_.jsx("div",{className:"flex justify-end mt-3",children:_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>I(null),children:"Close"})})]}),"reorder"===W&&_.jsxs("div",{className:"px-3 py-2",children:[_.jsx("div",{className:"text-xs font-medium text-gray-500 mb-1",children:"Reorder Columns"}),_.jsx("div",{className:"max-h-60 overflow-auto border border-gray-200 rounded-md",children:[...T.map(e=>P.find(t=>t.key===e)).filter(Boolean),...P.filter(e=>!T.includes(e.key))].map(e=>{const t=g.has(e.key);return _.jsxs("div",{className:`flex items-center justify-between px-2 py-1 text-sm bg-white hover:bg-gray-50 border-b last:border-b-0 relative ${ne===e.key?"opacity-60":""} ${t?"bg-blue-50/40":""}`,draggable:!0,onDragStart:t=>Se(e.key,t),onDragOver:t=>je(e.key,t),onDrop:()=>Ce(e.key),onDragEnd:Ae,children:[se?.key===e.key&&_.jsx("div",{className:"absolute left-0 right-0 h-0.5 bg-blue-600",style:{top:"before"===se?.position?0:void 0,bottom:"after"===se?.position?0:void 0}}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-gray-400 select-none",children:"⋮⋮"}),_.jsxs("span",{className:"text-gray-800 truncate max-w-45",children:[e.header,t&&_.jsx("span",{className:"ml-1 text-[10px] text-blue-600",children:"(pinned)"})]})]})]},e.key)})}),_.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Tip: You can only reorder within pinned or unpinned groups."})]})]})]})]})}),r<e.length-1&&m&&_.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-300 transition-colors group",onMouseDown:e=>pe(t.key,e),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),j?.(t.key)},title:"Drag to resize • Double‑click to autosize",children:_.jsx("div",{className:"w-full h-full group-hover:bg-blue-400"})})]},t.key+r)}),r>0&&_.jsx("div",{style:{width:r,height:n},className:"flex-none"}),t.map((e,r)=>{const a="center"===e.headerAlign?"justify-center":"right"===e.headerAlign?"justify-end":"justify-start",s=!1!==e.sortable;return _.jsxs("div",{className:"flex-none border-r border-gray-200 dark:border-gray-700 last:border-r-0 relative",style:{width:e.width||100,height:n},"data-column-key":e.key,draggable:!0,onDragStart:t=>we(e.key,t),onDragOver:t=>xe(e.key,t),onDrop:()=>Me(e.key),onDragEnd:_e,children:[ke?.key===e.key&&_.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 z-4",style:{left:"before"===ke?.position?0:void 0,right:"after"===ke?.position?0:void 0}}),_.jsx("div",{className:"px-3 h-full",children:_.jsxs("div",{className:"flex items-center justify-between gap-1 group h-full",children:[_.jsxs("div",{className:`flex items-center min-w-0 flex-1 ${a} ${s?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>s&&f(e.key),children:[_.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[fe(e.key)&&_.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full shrink-0",title:"Filter applied"}),_.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 text-sm truncate min-w-0",children:e.header})]}),s&&i.key===e.key&&_.jsx("div",{className:"ml-1 shrink-0 pointer-events-none select-none",children:"asc"===i.direction?_.jsx(O,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"}):_.jsx(z,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"})})]}),(e.filterable||b||k)&&_.jsxs("div",{className:"relative "+(L===e.key||re?"block":"hidden group-hover:block"),"data-column-menu":!0,children:[_.jsx("button",{className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded shrink-0",onClick:t=>ce(e.key,t),"data-menu-trigger":!0,children:_.jsx(Q,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),L===e.key&&q&&_.jsxs("div",{className:"fixed bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg z-10 w-[320px] overflow-auto",style:{top:`${q.top}px`,left:`${q.left}px`,maxHeight:`${Math.max(160,q.containerRect.bottom-12-q.top)}px`},"data-column-menu":!0,children:[_.jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700",children:[_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("menu"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("menu"),children:_.jsx(Q,{className:"w-4 h-4"})}),e.filterable&&_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("filter"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("filter"),children:_.jsx(K,{className:"w-4 h-4"})}),_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("reorder"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("reorder"),children:_.jsx(R,{className:"w-4 h-4"})})]}),"menu"===W&&_.jsxs("div",{className:"py-1",children:[b&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:t=>{t.stopPropagation(),I(null);const r=!g.has(e.key);b?.(e.key,r)},children:g.has(e.key)?_.jsxs(_.Fragment,{children:[_.jsx(ee,{className:"w-4 h-4"}),"Unpin Column"]}):_.jsxs(_.Fragment,{children:[_.jsx(te,{className:"w-4 h-4"}),"Pin Column"]})}),j&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{j?.(e.key),I(null)},children:"Autosize This Column"}),C&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{C?.(),I(null)},children:"Autosize All Columns"}),k&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:t=>{t.stopPropagation(),I(null);const r=x?.includes(e.key)||v===e.key;M?M(e.key,!r):w?.(r?null:e.key)},children:v===e.key||x?.includes(e.key)?_.jsxs(_.Fragment,{children:[_.jsx(oe,{className:"w-4 h-4"}),"Ungroup"]}):_.jsxs(_.Fragment,{children:[_.jsx(G,{className:"w-4 h-4"}),"Group by ",e.header]})}),A&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{A?.(),I(null)},children:"Reset Columns"})]}),"filter"===W&&_.jsxs("div",{className:"p-3 w-full",children:[_.jsx("div",{className:"max-h-75 overflow-auto pr-1",children:_.jsx(ur,{column:e,data:u,value:Y,onChange:t=>{J(t),"server"!==N&&p(e.key,t)}})}),_.jsxs("div",{className:"flex justify-end gap-2 mt-3",children:[fe(e.key)&&_.jsxs("button",{className:"px-3 py-1.5 text-sm bg-red-500 text-white rounded-md hover:bg-red-600 flex items-center gap-2 cursor-pointer",onClick:()=>{J(null),p(e.key,null),I(null)},children:[_.jsx(X,{className:"w-3 h-3"})," Clear Filter"]}),_.jsx("button",{className:"px-3 py-1.5 text-sm bg-green-100 text-green-700 rounded-md hover:bg-green-200 cursor-pointer",onClick:()=>I(null),children:"Apply"}),"server"===N&&_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>ue(e.key),children:"Apply"})]})]}),"reorder"===W&&_.jsxs("div",{className:"px-3 py-2",children:[_.jsx("div",{className:"text-xs font-medium text-gray-500 mb-1",children:"Reorder Columns"}),_.jsx("div",{className:"max-h-60 overflow-auto border border-gray-200 rounded-md",children:[...T.map(e=>P.find(t=>t.key===e)).filter(Boolean),...P.filter(e=>!T.includes(e.key))].map(e=>{const t=g.has(e.key);return _.jsxs("div",{className:`flex items-center justify-between px-2 py-1 text-sm bg-white hover:bg-gray-50 border-b last:border-b-0 relative ${ne===e.key?"opacity-60":""} ${t?"bg-blue-50/40":""}`,draggable:!0,onDragStart:t=>Se(e.key,t),onDragOver:t=>je(e.key,t),onDrop:()=>Ce(e.key),onDragEnd:Ae,children:[se?.key===e.key&&_.jsx("div",{className:"absolute left-0 right-0 h-0.5 bg-blue-600",style:{top:"before"===se?.position?0:void 0,bottom:"after"===se?.position?0:void 0}}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-gray-400 select-none",children:"⋮⋮"}),_.jsxs("span",{className:"text-gray-800 truncate max-w-45",children:[e.header,t&&_.jsx("span",{className:"ml-1 text-[10px] text-blue-600",children:"(pinned)"})]})]})]},e.key)})}),_.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Tip: You can only reorder within pinned or unpinned groups."})]})]})]})]})}),r<t.length-1&&m&&_.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-300 transition-colors group",onMouseDown:t=>pe(e.key,t),onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),j?.(e.key)},title:"Drag to resize • Double‑click to autosize",children:_.jsx("div",{className:"w-full h-full group-hover:bg-blue-400"})})]},e.key+r)}),a>0&&_.jsx("div",{style:{width:a,height:n},className:"flex-none"})]})})})},pr=r(({data:e,columns:t,selectedRows:r,virtualized:n,virtualizedRange:i,rowHeight:s,selectable:o,isRowSelectable:h,onRowSelect:l,pinnedColumns:d=new Set,hvPadLeft:c=0,hvPadRight:u=0,rowStyle:f,globalFilter:p,onContextMenu:y,onRowDoubleClick:m,onRowClick:g,onCellClick:b,isCellFocused:k,isCellSelected:v,onCellContextMenu:w,onCellMouseDown:x,onCellMouseEnter:M,getRowId:j})=>{const C=a(()=>e.length*s,[e.length,s]),{leftOffsetByPinnedKey:A}=a(()=>{if(0===d.size)return{leftOffsetByPinnedKey:new Map};const e=t.filter(e=>d.has(e.key)).map(e=>e.key),r=new Map;for(const e of t)r.set(e.key,e.width||100);const a=new Map;let n=o?S:0;for(const t of e)a.set(t,n),n+=r.get(t)||100;return{leftOffsetByPinnedKey:a}},[t,d,o]),T=a(()=>t.reduce((e,t)=>e+(d.has(t.key)?1:0),0),[t,d]);return _.jsx("div",{style:{height:n?`${C}px`:"auto",position:"relative"},children:_.jsx("div",{style:{transform:n?`translate3d(0, ${i.offsetY}px, 0)`:"none",position:n?"absolute":"static",top:0,left:0,right:0},children:e.map((e,a)=>{const C=n?i.startIndex+a:a,E=f?.(e),N=((e,t)=>j?j(e):void 0!==e.id?e.id:("development"===process.env.NODE_ENV&&0===t&&console.warn("[CustomDataGrid] No row IDs found. Either:\n 1. Add 'id' property to each row object, or\n 2. Provide 'getRowId' prop to extract a unique identifier.\n Using row index as fallback ID, but this may cause issues with pagination/filtering."),t??0))(e,C),z=C%2==0?"bg-white dark:bg-gray-900":"bg-gray-25 dark:bg-gray-800",R=r.has(N)?"bg-blue-50 dark:bg-blue-900/20":"";return _.jsxs("div",{className:`flex border-b border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${R||(E?"":z)}`,style:{height:`${s}px`,...E},onContextMenu:t=>((e,t)=>{e.preventDefault(),y?.(t,e)})(t,e),onDoubleClick:t=>((e,t)=>{m?.(t,e)})(t,e),onClick:t=>((e,t)=>{g?.(t,e)})(t,e),children:[o&&_.jsx("div",{className:"flex items-center justify-center sticky left-0 bg-white dark:bg-gray-900 z-2 border-r border-gray-200 dark:border-gray-700",style:{width:S},children:_.jsx("input",{type:"checkbox",checked:r.has(N),disabled:!!h&&!h(e),onChange:e=>l(N,e.target.checked),onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),l(N,!r.has(N)))},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 h-4 w-4 transition-all duration-150","aria-label":`Select row ${N}`,tabIndex:0})}),t.map((t,r)=>{const a=d.has(t.key),n=a&&A.get(t.key)||0,i=e[t.key];let s,o;if(t.cellRenderer?(s=t.cellRenderer(i,e),"string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i||(o=String(i))):t.formatter?(s=t.formatter(i),o=String(s)):(s=i??"",o=s?String(s):void 0),p&&p.trim()&&!t.cellRenderer&&s){const e=String(s);((e,t)=>{if(!t||null==e)return!1;const r=t.toLowerCase().trim();return!!r&&String(e).toLowerCase().includes(r)})(e,p)&&(s=((e,t)=>{if(!t||!e)return e;const r=t.toLowerCase().trim(),a=e.toLowerCase();if(!r||!a.includes(r))return e;const n=[];let i=0,s=0,o=0;for(;-1!==(s=a.indexOf(r,i));)s>i&&n.push(e.slice(i,s)),n.push(_.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-600/40 text-current font-medium px-0.5 py-0 rounded-sm",style:{margin:0},children:e.slice(s,s+r.length)},"highlight-"+o++)),i=s+r.length;return i<e.length&&n.push(e.slice(i)),_.jsx(_.Fragment,{children:n})})(e,p))}o&&0===o.trim().length&&(o=void 0);const h="center"===t.align?"text-center":"right"===t.align?"text-right":"text-left",l="center"===t.align?"justify-center":"right"===t.align?"justify-end":"justify-start",u=t.noPadding?"p-0":"p-3",f="function"==typeof t.className?t.className(i,e):t.className||"",y="function"==typeof t.cellStyle?t.cellStyle(i,e):t.cellStyle||void 0,m=_.jsxs("div",{className:`border-r border-gray-200 last:border-r-0 ${u} text-sm flex items-center ${v?.(N,t.key)?"bg-blue-100/60 dark:bg-blue-900/30":""} ${a?k?.(N,t.key)?"sticky z-2 bg-inherit":"sticky z-1 bg-inherit":""} ${k?.(N,t.key)?"relative":""} ${h} ${l} ${f}`,style:{width:`${t.width||100}px`,left:a?`${n}px`:"auto",...y},title:o,onClick:r=>((e,t,r,a)=>{b?.({row:t,column:r,value:a,event:e})})(r,e,t,e[t.key]),onContextMenu:r=>{e._isGroupHeader||e._isGroupFooter||w&&(r.preventDefault(),r.stopPropagation(),w({row:e,column:t,value:e[t.key],displayValue:o??"",event:r}))},onMouseDown:r=>x?.({row:e,column:t,event:r}),onMouseEnter:r=>M?.({row:e,column:t,event:r}),children:[k?.(N,t.key)&&_.jsx("div",{className:"pointer-events-none absolute inset-0 border border-blue-400"}),!1===t.wrapCellContent?_.jsx(_.Fragment,{children:s}):_.jsx("div",{className:"truncate w-full",children:s})]},`${t.key}-${r}`);return c>0&&r===T?_.jsxs(_.Fragment,{children:[_.jsx("div",{style:{width:c},className:"flex-none"}),m]}):m}),u>0&&_.jsx("div",{style:{width:u},className:"flex-none"})]},`${N}-${C}`)})})})},(e,t)=>{if(e.rowHeight!==t.rowHeight)return!1;if(e.selectable!==t.selectable)return!1;if(e.virtualized!==t.virtualized)return!1;if(e.globalFilter!==t.globalFilter)return!1;if(e.virtualizedRange.startIndex!==t.virtualizedRange.startIndex)return!1;if(e.virtualizedRange.endIndex!==t.virtualizedRange.endIndex)return!1;if(e.virtualizedRange.offsetY!==t.virtualizedRange.offsetY)return!1;if(e.isCellSelected!==t.isCellSelected)return!1;if(e.isCellFocused!==t.isCellFocused)return!1;if(e.onCellMouseDown!==t.onCellMouseDown)return!1;if(e.onCellMouseEnter!==t.onCellMouseEnter)return!1;if(e.getRowId!==t.getRowId)return!1;if(e.selectedRows.size!==t.selectedRows.size)return!1;if(e.pinnedColumns?.size!==t.pinnedColumns?.size)return!1;if(e.columns.map(e=>e.key).join("|")!==t.columns.map(e=>e.key).join("|"))return!1;if(e.data.length!==t.data.length)return!1;const r=(e,t,r)=>r?r(e):void 0!==e.id?e.id:t,a=e.data.length>0?r(e.data[0],0,e.getRowId):void 0,n=t.data.length>0?r(t.data[0],0,t.getRowId):void 0,i=e.data.length-1,s=t.data.length-1,o=e.data.length>0?r(e.data[i],i,e.getRowId):void 0,h=t.data.length>0?r(t.data[s],s,t.getRowId):void 0;return a===n&&o===h}),yr=({columns:e,groupedKeys:t,onRemove:r,onReorder:a,onDropColumnKey:n,onToggleExpandAll:i,isAnyExpanded:o=!1})=>{const[h,l]=s(null),[d,c]=s(null),[u,f]=s(!0),p=t=>e.find(e=>e.key===t)?.header||t,y=e=>t=>{l(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("application/x-group-key",e)},m=e=>t=>{t.preventDefault();const r=t.currentTarget.getBoundingClientRect(),a=t.clientX<r.left+r.width/2;c(e),f(a)};return _.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gray-50 border-b border-gray-200 text-sm",onDrop:e=>{e.preventDefault();const r=e.dataTransfer.getData("text/plain");r&&(t.includes(r)||n(r))},onDragOver:e=>{e.preventDefault()},onDragEnd:()=>{l(null),c(null)},children:[_.jsx("span",{className:"text-gray-600 whitespace-nowrap",children:"Group by:"}),t.length>0&&_.jsx("button",{type:"button",className:"ml-1 px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-100",title:o?"Collapse all groups":"Expand all groups",onClick:e=>{e.preventDefault(),e.stopPropagation(),i?.()},children:o?"Collapse All":"Expand All"}),0===t.length&&_.jsx("span",{className:"text-gray-400",children:"Drag a column here"}),_.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map(e=>{return _.jsxs("div",{className:"inline-flex items-center gap-2 bg-blue-100 text-blue-800 px-2 py-1 rounded-md border border-blue-200 cursor-move relative",draggable:!0,onDragStart:y(e),onDragOver:m(e),onDrop:(n=e,()=>{if(!h||h===n)return l(null),void c(null);const e=t.filter(e=>e!==h),r=e.indexOf(n);-1!==r&&(u?e.splice(r,0,h):e.splice(r+1,0,h),a(e),l(null),c(null))}),title:p(e),children:[_.jsx("span",{className:"text-xs font-medium truncate max-w-[160px]",children:p(e)}),_.jsx("button",{className:"text-blue-700 hover:text-blue-900",onClick:()=>r(e),"aria-label":`Remove grouping ${p(e)}`,children:"×"}),d===e&&_.jsx("span",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 dark:bg-blue-400 animate-pulse",style:{left:u?0:void 0,right:u?void 0:0},"aria-hidden":"true"})]},e);var n})})]})},mr=r(({row:e,isExpanded:t,onToggle:r,viewportWidth:a,selectable:n,rowHeight:i=40,getHeaderLabel:s,getValueLabel:o,renderGroupActions:h})=>{const l=()=>{e._groupKey&&r(e._groupKey)};return _.jsxs("div",{className:"flex items-center bg-blue-50 dark:bg-blue-900/20 border-b border-gray-200 dark:border-gray-800 hover:bg-blue-100/70 cursor-pointer sticky left-0 z-20 overflow-hidden",style:{minWidth:`${a+(n?S:0)}px`,height:`${i}px`},onClick:l,role:"button",tabIndex:0,"aria-expanded":t,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l())},children:[n&&_.jsx("div",{className:"w-12 flex items-center justify-center"}),_.jsxs("div",{className:"flex items-center px-4 py-2 flex-1",children:[_.jsx("div",{className:"flex items-center mr-3",style:{paddingLeft:(e._groupLevel?16*e._groupLevel:0)+"px"},children:t?_.jsx(L,{className:"w-4 h-4 text-gray-600"}):_.jsx(q,{className:"w-4 h-4 text-gray-600"})}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs("span",{className:"font-medium text-gray-900",children:[e._groupColumnKey?`${s?s(e._groupColumnKey):e._groupColumnKey}: `:"",o&&e._groupColumnKey?o(e._groupColumnKey,e._groupValue):e._groupValue??(e._groupKey||"Unknown")]}),_.jsxs("span",{className:"text-sm text-gray-600 bg-gray-200/70 px-2 py-1 rounded-full",children:[e._groupCount," ",1===e._groupCount?"item":"items"]})]}),h&&_.jsx("div",{className:"flex items-center px-4",onClick:e=>e.stopPropagation(),children:h({groupKey:e._groupKey||"",columnKey:e._groupColumnKey||"",groupValue:e._groupValue,rows:e._groupRows||[],count:e._groupCount||0,level:e._groupLevel||0})})]})]})}),gr=({hasFilters:e=!1,hasData:t=!0,message:r})=>{const{title:a,description:n,icon:i}=r?{title:r,description:"",icon:B}:t?e?{title:"No Results Found",description:"No data matches your current search criteria. Try adjusting your filters.",icon:re}:{title:"No Data to Display",description:"There are no items to show at the moment.",icon:B}:{title:"No Data Available",description:"There is no data to display in this table.",icon:B};return _.jsxs("div",{className:"flex flex-col items-center justify-center pt-16 pb-10 px-4 text-center",children:[_.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mb-4",children:_.jsx(i,{className:"w-8 h-8 text-gray-400 dark:text-gray-500"})}),_.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:a}),_.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 max-w-md",children:n})]})},br=({paginationConfig:e,currentPage:t,isServerLoading:r,selectedRowsCount:a,totalDataLength:n,filteredDataLength:i,paginationMode:s="client",onPageChange:o,onPageSizeChange:h})=>{const{start:l,end:d,total:c}=(()=>{const r=e.enabled||"server"===s?e.totalRows||n:i||n;return{start:e.enabled?Math.min((t-1)*e.pageSize+1,r):1,end:e.enabled?Math.min(t*e.pageSize,r):r,total:r}})(),u="client"===s&&i&&i!==n;return _.jsx("div",{className:"px-3 sm:px-6 py-2 border-t border-gray-200 dark:border-gray-700 bg-linear-to-r from-white via-gray-50 to-white dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:_.jsxs("div",{className:"flex flex-col xl:flex-row gap-4 xl:gap-6 xl:justify-between xl:items-center",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 items-start sm:items-center",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[!e.enabled&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold bg-linear-to-r from-blue-500 to-blue-600 text-white shadow-lg ring-2 ring-blue-500/20",children:[_.jsx(B,{className:"w-3 h-3"}),_.jsxs("span",{className:"font-bold",children:[c.toLocaleString()," ",1===c?"Record":"Records"]}),u&&_.jsxs("span",{className:"text-blue-100 font-normal",children:["(of ",n.toLocaleString(),")"]})]}),a>0&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold bg-linear-to-r from-primary to-primary text-white shadow-lg ring-2 ring-primary/20",children:[_.jsx(he,{className:"w-3 h-3"}),_.jsxs("span",{children:[a.toLocaleString()," selected"]})]}),u&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-linear-to-r from-warning/10 to-warning/5 text-warning border border-warning/20",children:[_.jsx(W,{className:"w-3 h-3"}),_.jsx("span",{children:"Filtered"})]}),e.enabled&&_.jsx("div",{className:"hidden sm:block text-sm text-gray-600 dark:text-gray-400 font-medium",children:_.jsxs("span",{className:"inline-flex items-center gap-1",children:[_.jsx("span",{children:"Showing"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:l.toLocaleString()}),_.jsx("span",{children:"-"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:d.toLocaleString()}),_.jsxs("span",{children:["of ",c.toLocaleString()]})]})})]}),e.enabled&&e.showPageSizeSelector&&_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 whitespace-nowrap",children:"Rows per page:"}),_.jsx("select",{value:e.pageSize,onChange:e=>h(Number(e.target.value)),className:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-xl px-3 py-1 text-sm font-medium focus:ring-2 focus:ring-primary focus:border-primary disabled:opacity-50 disabled:cursor-not-allowed shadow-sm transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500",disabled:r,children:e.pageSizeOptions?.map(e=>_.jsx("option",{value:e,children:e},e))})]})]}),e.enabled&&_.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4",children:[r&&_.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-blue-50 dark:bg-blue-900/20 rounded-full border border-blue-200 dark:border-blue-800",children:[_.jsx(Y,{className:"w-4 h-4 animate-spin text-primary"}),_.jsx("span",{className:"text-sm font-medium text-primary",children:"Loading..."})]}),_.jsx("div",{className:"sm:hidden text-sm text-gray-600 dark:text-gray-400 font-medium",children:_.jsxs("div",{className:"flex flex-col gap-1",children:[_.jsxs("span",{className:"inline-flex items-center gap-1",children:[_.jsx("span",{children:"Page"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:t.toLocaleString()}),_.jsx("span",{children:"of"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:e.totalPages.toLocaleString()})]}),_.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[l.toLocaleString()," - ",d.toLocaleString()," of"," ",c.toLocaleString()]})]})}),_.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[_.jsx("button",{onClick:()=>o(1,e.pageSize),disabled:1===t||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"First page","aria-label":"Go to first page",children:_.jsx(D,{className:"w-3.5 h-3.5"})}),_.jsx("button",{onClick:()=>o(t-1,e.pageSize),disabled:1===t||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Previous page","aria-label":"Go to previous page",children:_.jsx(I,{className:"w-3.5 h-3.5"})}),_.jsx("div",{className:"sm:hidden",children:_.jsx("select",{value:t,onChange:t=>o(Number(t.target.value),e.pageSize),className:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-xl px-3 py-2 text-sm font-medium focus:ring-2 focus:ring-primary focus:border-primary disabled:opacity-50 disabled:cursor-not-allowed shadow-sm min-w-[80px]",disabled:r,"aria-label":"Select page",children:Array.from({length:e.totalPages},(e,t)=>t+1).map(e=>_.jsx("option",{value:e,children:e},e))})}),_.jsx("div",{className:"hidden sm:flex items-center gap-1 mx-2",children:(()=>{const a=[],n=e.totalPages,i=t,s="undefined"!=typeof window&&window.innerWidth>=768?7:5;if(n<=s)for(let e=1;e<=n;e++)a.push(e);else{const e=Math.floor(s/2)-1;if(i<=e+1){for(let e=1;e<=s-2;e++)a.push(e);a.push("ellipsis1"),a.push(n)}else if(i>=n-e){a.push(1),a.push("ellipsis1");for(let e=n-(s-3);e<=n;e++)a.push(e)}else{a.push(1),a.push("ellipsis1");for(let t=i-e;t<=i+e;t++)a.push(t);a.push("ellipsis2"),a.push(n)}}return a.map(t=>{if("string"==typeof t)return _.jsx("div",{className:"flex items-center justify-center w-8 h-8 text-gray-400 dark:text-gray-500 select-none","aria-hidden":"true",children:_.jsx("span",{className:"text-lg leading-none",children:"⋯"})},t);const a=t===i;return _.jsx("button",{onClick:()=>o(t,e.pageSize),disabled:r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full text-sm font-semibold transition-all duration-200 focus:ring-2 focus:ring-primary/20 focus:outline-none cursor-pointer "+(a?"bg-linear-to-r from-primary to-primary text-white shadow-lg ring-2 ring-primary/20 transform scale-105 z-10 relative":"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md disabled:opacity-40 disabled:cursor-not-allowed"),"aria-label":`Go to page ${t}`,"aria-current":a?"page":void 0,children:t},t)})})()}),_.jsx("button",{onClick:()=>o(t+1,e.pageSize),disabled:t===e.totalPages||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Next page","aria-label":"Go to next page",children:_.jsx(q,{className:"w-3.5 h-3.5"})}),_.jsx("button",{onClick:()=>o(e.totalPages,e.pageSize),disabled:t===e.totalPages||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Last page","aria-label":"Go to last page",children:_.jsx(H,{className:"w-3.5 h-3.5"})})]})]})]})})},kr=({options:e,value:t,placeholder:r="Select an option...",onChange:a,searchable:n=!0,className:i=""})=>{const[l,d]=s(!1),[c,u]=s(""),[f,p]=s(-1),y=h(null),m=h(null),g=h(null),b=e.find(e=>e.value===t),k=n?e.filter(e=>e.label?.toLowerCase()?.includes(c?.toLowerCase())):e;o(()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&(d(!1),u(""),p(-1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),o(()=>{const e=e=>{if(l)switch(e.key){case"ArrowDown":e.preventDefault(),p(e=>e<k.length-1?e+1:0);break;case"ArrowUp":e.preventDefault(),p(e=>e>0?e-1:k.length-1);break;case"Enter":e.preventDefault(),f>=0&&k[f]&&v(k[f].value);break;case"Escape":d(!1),u(""),p(-1)}};if(l)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l,f,k]),o(()=>{if(f>=0&&g.current){const e=g.current.children[f];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[f]);const v=e=>{a(e),d(!1),u(""),p(-1)};return _.jsxs("div",{className:`relative ${i}`,ref:y,children:[_.jsx("div",{className:"relative w-full cursor-pointer border border-gray-300 rounded-lg bg-white transition-all duration-200 "+(l?"ring-2 ring-blue-500 border-blue-500":"hover:border-gray-400 focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500"),onClick:()=>{d(!l),n&&!l&&setTimeout(()=>m.current?.focus(),0)},children:_.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5",children:[n&&l?_.jsx("input",{ref:m,type:"text",className:"flex-1 outline-none text-sm bg-transparent",placeholder:`Search ${r?.toLowerCase()}...`,value:c,onChange:e=>{u(e.target.value),p(-1),l||d(!0)},onClick:e=>e.stopPropagation()}):_.jsx("span",{className:"flex-1 text-sm truncate "+(b?"text-gray-900":"text-gray-500"),children:b?b.label:r}),_.jsx(L,{className:"w-4 h-4 text-gray-400 transition-transform duration-200 "+(l?"rotate-180":"")})]})}),l&&_.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-99999 max-h-80 overflow-hidden",children:k.length>0?_.jsx("ul",{ref:g,className:"py-1 overflow-y-auto max-h-80",children:k.map((e,t)=>_.jsxs("li",{className:"px-3 py-2 text-sm cursor-pointer flex items-center justify-between transition-colors "+(t===f?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-50"),onClick:()=>v(e.value),onMouseEnter:()=>p(t),children:[_.jsx("span",{className:"truncate",children:e.label}),b?.value===e.value&&_.jsx(P,{className:"w-4 h-4 text-blue-600 shrink-0 ml-2"})]},e.value))}):_.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 text-center",children:"No options found"})})]})},vr=({columns:e,columnFilters:t,onColumnFilter:r})=>{const a=e.filter(e=>e.filterable),[n,i]=s(a.length>0?a[0].key:""),[h,l]=s(""),d=a.map(e=>({label:e.header,value:e.key})),c=a.find(e=>e.key===n);o(()=>{l("")},[n]);return _.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{children:[_.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select Column to Filter"}),_.jsx(kr,{options:d,value:n,placeholder:"Choose a column...",onChange:e=>{i(e)},searchable:!0})]}),n&&(()=>{if(!c)return null;const e=c.filterable?.type||"text",a=t[n];if("multiselect"===e&&c.filterable?.options){const e=h.toLowerCase(),t=e?c.filterable.options.filter(t=>t.label.toLowerCase().includes(e)||String(t.value).toLowerCase().includes(e)):c.filterable.options;return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsxs("div",{className:"relative mb-2",children:[_.jsx(re,{className:"w-4 h-4 text-gray-400 absolute left-2 top-1/2 -translate-y-1/2"}),_.jsx("input",{type:"text",value:h,onChange:e=>l(e.target.value),placeholder:"Search options...",className:"w-full pl-8 pr-2 py-1.5 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),h&&_.jsx("button",{type:"button",onClick:()=>l(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:_.jsx(le,{className:"w-3 h-3"})})]}),_.jsxs("div",{className:"max-h-32 overflow-y-auto border border-gray-300 rounded-md p-2 bg-white",children:[0===t.length&&_.jsx("div",{className:"text-xs text-gray-500 px-1 py-1",children:"No matches"}),t.map(e=>{const t=a?.value||[],i=Array.isArray(t)&&t.includes(e.value);return _.jsxs("label",{className:"flex items-center gap-2 py-1 hover:bg-gray-50 cursor-pointer",children:[_.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:i,onChange:t=>{const i=a?.value||[];let s;s=t.target.checked?[...i,e.value]:i.filter(t=>t!==e.value),s.length>0?r?.(n,{type:"multiselect",value:s,operator:"in"}):r?.(n,null)}}),_.jsx("span",{className:"text-sm",children:e.label})]},e.value)})]})]})}if("select"===e&&c.filterable?.options){const e=[{label:`All ${c.header}`,value:""},...c.filterable.options.map(e=>({label:e.label,value:String(e.value)}))];return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsx(kr,{options:e,value:a?.value||"",placeholder:`Select ${c.header.toLowerCase()}...`,onChange:e=>{r?.(n,e?{type:"select",value:e,operator:"between"}:null)},searchable:!0})]})}if("date"===e){const e=e=>{if(!e)return null;if(e instanceof Date&&!isNaN(e.getTime()))return e;const t=or(String(e),"yyyy-MM-dd",new Date);if(!isNaN(t.getTime()))return t;const r=new Date(e);return isNaN(r.getTime())?null:r},t=e(a?.value),i=e(a?.secondValue),s=a?.operator||"between";return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsx("div",{className:"mb-3",children:_.jsx(kr,{options:[{label:"Between Dates",value:"between"},{label:"On Date",value:"equals"}],value:s,placeholder:"Select date filter...",onChange:e=>{r?.(n,{type:"date",value:a?.value||"",operator:e,secondValue:a?.secondValue||""})},searchable:!1},`date-operator-${n}-${s}`)}),_.jsxs("div",{className:"flex items-end gap-2",children:[_.jsx("div",{className:"flex-1 min-w-37.5",children:_.jsx(ue,{name:"column_filter_start",label:"between"===s?"Start Date":"Date",value:t?ct(t,"yyyy-MM-dd"):null,onChange:e=>{if(e){const t=ct(or(e,"yyyy-MM-dd",new Date),"yyyy-MM-dd");r?.(n,{type:"date",value:t,operator:s,secondValue:a?.secondValue||null})}else r?.(n,null)},className:"w-full"})}),"between"===s&&_.jsx("div",{className:"flex-1 min-w-37.5",children:_.jsx(ue,{name:"column_filter_end",label:"End Date",value:i?ct(i,"yyyy-MM-dd"):null,onChange:e=>{if(e&&a){const t=ct(or(e,"yyyy-MM-dd",new Date),"yyyy-MM-dd");r?.(n,{...a,secondValue:t})}},className:"w-full"})})]})]})}return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsxs(_.Fragment,{children:[_.jsx("input",{type:"text",placeholder:c.filterable?.placeholder||`Filter ${c.header.toLowerCase()}...`,className:"w-full px-3 py-2.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200",value:a?.value||"",onChange:e=>{e.target.value?r?.(n,{type:"text",value:e.target.value,operator:"contains"}):r?.(n,null)}}),a&&_.jsx("div",{className:"mt-2",children:_.jsx(kr,{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"equals"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"}],value:a?.operator||"contains",placeholder:"Select operator...",onChange:e=>{a&&r?.(n,{...a,operator:e})},searchable:!1})})]})]})})(),Object.keys(t).length>0&&_.jsxs("div",{className:"mt-4",children:[_.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Active Filters"}),_.jsx("div",{className:"space-y-2",children:Object.entries(t).map(([e,t])=>{const n=a.find(t=>t.key===e);return n?_.jsxs("div",{className:"flex items-center justify-between bg-blue-50 border border-blue-200 rounded-md px-3 py-2 cursor-pointer hover:bg-blue-100",role:"button",title:`Edit filter for ${n.header}`,onClick:()=>(e=>{i(e)})(e),children:[_.jsxs("div",{className:"flex-1",children:[_.jsxs("span",{className:"text-sm font-medium text-blue-900",children:[n.header,":"]}),_.jsx("span",{className:"text-sm text-blue-700 ml-1",children:(()=>{if(Array.isArray(t.value))return`${t.value.length} selected`;if("date"===t.type){const e=e=>{try{if(!e)return"";if(e instanceof Date&&!isNaN(e.getTime()))return ct(e,"dd-MM-yyyy");if("string"==typeof e){const t=or(e,"yyyy-MM-dd",new Date);if(!isNaN(t.getTime()))return ct(t,"dd-MM-yyyy");const r=new Date(e);if(!isNaN(r.getTime()))return ct(r,"dd-MM-yyyy")}return String(e)}catch{return String(e??"")}},r={equals:"On",gt:"After",gte:"On or After",lt:"Before",lte:"On or Before",between:"Between"}[t.operator]||"On";return"between"===t.operator&&t.secondValue?`${r} ${e(t.value)} - ${e(t.secondValue)}`:`${r} ${e(t.value)}`}return t.value})()})]}),_.jsx("button",{onClick:t=>{t.stopPropagation(),r?.(e,null)},className:"text-blue-400 hover:text-red-500 transition-colors",title:"Clear filter",children:_.jsx(le,{className:"w-4 h-4"})})]},e):null})})]})]})};function wr(){return"undefined"!=typeof window}function xr(e){return Sr(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _r(e){var t;return null==(t=(Sr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sr(e){return!!wr()&&(e instanceof Node||e instanceof Mr(e).Node)}function jr(e){return!!wr()&&(e instanceof Element||e instanceof Mr(e).Element)}function Cr(e){return!!wr()&&(e instanceof HTMLElement||e instanceof Mr(e).HTMLElement)}function Ar(e){return!(!wr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot)}const Tr=new Set(["inline","contents"]);function Er(e){const{overflow:t,overflowX:r,overflowY:a,display:n}=Br(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!Tr.has(n)}const Nr=new Set(["table","td","th"]);function zr(e){return Nr.has(xr(e))}const Rr=[":popover-open",":modal"];function Or(e){return Rr.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Pr=["transform","translate","scale","rotate","perspective"],Lr=["transform","translate","scale","rotate","perspective","filter"],Ir=["paint","layout","strict","content"];function qr(e){const t=Dr(),r=jr(e)?Br(e):e;return Pr.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Lr.some(e=>(r.willChange||"").includes(e))||Ir.some(e=>(r.contain||"").includes(e))}function Dr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Hr=new Set(["html","body","#document"]);function Fr(e){return Hr.has(xr(e))}function Br(e){return Mr(e).getComputedStyle(e)}function Vr(e){return jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ur(e){if("html"===xr(e))return e;const t=e.assignedSlot||e.parentNode||Ar(e)&&e.host||_r(e);return Ar(t)?t.host:t}function $r(e){const t=Ur(e);return Fr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Er(t)?t:$r(t)}function Wr(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);const n=$r(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),s=Mr(n);if(i){const e=Zr(s);return t.concat(s,s.visualViewport||[],Er(n)?n:[],e&&r?Wr(e):[])}return t.concat(n,Wr(n,[],r))}function Zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Xr=Math.min,Kr=Math.max,Gr=Math.round,Yr=Math.floor,Jr=e=>({x:e,y:e}),Qr={left:"right",right:"left",bottom:"top",top:"bottom"},ea={start:"end",end:"start"};function ta(e,t,r){return Kr(e,Xr(t,r))}function ra(e,t){return"function"==typeof e?e(t):e}function aa(e){return e.split("-")[0]}function na(e){return e.split("-")[1]}function ia(e){return"x"===e?"y":"x"}function sa(e){return"y"===e?"height":"width"}const oa=new Set(["top","bottom"]);function ha(e){return oa.has(aa(e))?"y":"x"}function la(e){return ia(ha(e))}function da(e){return e.replace(/start|end/g,e=>ea[e])}const ca=["left","right"],ua=["right","left"],fa=["top","bottom"],pa=["bottom","top"];function ya(e,t,r,a){const n=na(e);let i=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ua:ca:t?ca:ua;case"left":case"right":return t?fa:pa;default:return[]}}(aa(e),"start"===r,a);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(da)))),i}function ma(e){return e.replace(/left|right|bottom|top/g,e=>Qr[e])}function ga(e){const{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}var ba="undefined"!=typeof document?l:function(){};const ka={...e}.useInsertionEffect||(e=>e());function va(e,t,r){let{reference:a,floating:n}=e;const i=ha(t),s=la(t),o=sa(s),h=aa(t),l="y"===i,d=a.x+a.width/2-n.width/2,c=a.y+a.height/2-n.height/2,u=a[o]/2-n[o]/2;let f;switch(h){case"top":f={x:d,y:a.y-n.height};break;case"bottom":f={x:d,y:a.y+a.height};break;case"right":f={x:a.x+a.width,y:c};break;case"left":f={x:a.x-n.width,y:c};break;default:f={x:a.x,y:a.y}}switch(na(t)){case"start":f[s]-=u*(r&&l?-1:1);break;case"end":f[s]+=u*(r&&l?-1:1)}return f}async function wa(e,t){var r;void 0===t&&(t={});const{x:a,y:n,platform:i,rects:s,elements:o,strategy:h}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:u=!1,padding:f=0}=ra(t,e),p=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),y=o[u?"floating"===c?"reference":"floating":c],m=ga(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(y)))||r?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:d,strategy:h})),g="floating"===c?{x:a,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),k=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},v=ga(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:b,strategy:h}):g);return{top:(m.top-v.top+p.top)/k.y,bottom:(v.bottom-m.bottom+p.bottom)/k.y,left:(m.left-v.left+p.left)/k.x,right:(v.right-m.right+p.right)/k.x}}const xa=new Set(["left","top"]);function Ma(e){const t=Br(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const n=Cr(e),i=n?e.offsetWidth:r,s=n?e.offsetHeight:a,o=Gr(r)!==i||Gr(a)!==s;return o&&(r=i,a=s),{width:r,height:a,$:o}}function _a(e){return jr(e)?e:e.contextElement}function Sa(e){const t=_a(e);if(!Cr(t))return Jr(1);const r=t.getBoundingClientRect(),{width:a,height:n,$:i}=Ma(t);let s=(i?Gr(r.width):r.width)/a,o=(i?Gr(r.height):r.height)/n;return s&&Number.isFinite(s)||(s=1),o&&Number.isFinite(o)||(o=1),{x:s,y:o}}const ja=Jr(0);function Ca(e){const t=Mr(e);return Dr()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ja}function Aa(e,t,r,a){void 0===t&&(t=!1),void 0===r&&(r=!1);const n=e.getBoundingClientRect(),i=_a(e);let s=Jr(1);t&&(a?jr(a)&&(s=Sa(a)):s=Sa(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Mr(e))&&t}(i,r,a)?Ca(i):Jr(0);let h=(n.left+o.x)/s.x,l=(n.top+o.y)/s.y,d=n.width/s.x,c=n.height/s.y;if(i){const e=Mr(i),t=a&&jr(a)?Mr(a):a;let r=e,n=Zr(r);for(;n&&a&&t!==r;){const e=Sa(n),t=n.getBoundingClientRect(),a=Br(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,s=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;h*=e.x,l*=e.y,d*=e.x,c*=e.y,h+=i,l+=s,r=Mr(n),n=Zr(r)}}return ga({width:d,height:c,x:h,y:l})}function Ta(e,t){const r=Vr(e).scrollLeft;return t?t.left+r:Aa(_r(e)).left+r}function Ea(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ta(e,r),y:r.top+t.scrollTop}}const Na=new Set(["absolute","fixed"]);function za(e,t,r){let a;if("viewport"===t)a=function(e,t){const r=Mr(e),a=_r(e),n=r.visualViewport;let i=a.clientWidth,s=a.clientHeight,o=0,h=0;if(n){i=n.width,s=n.height;const e=Dr();(!e||e&&"fixed"===t)&&(o=n.offsetLeft,h=n.offsetTop)}const l=Ta(a);if(l<=0){const e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(a.clientWidth-t.clientWidth-n);s<=25&&(i-=s)}else l<=25&&(i+=l);return{width:i,height:s,x:o,y:h}}(e,r);else if("document"===t)a=function(e){const t=_r(e),r=Vr(e),a=e.ownerDocument.body,n=Kr(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let s=-r.scrollLeft+Ta(e);const o=-r.scrollTop;return"rtl"===Br(a).direction&&(s+=Kr(t.clientWidth,a.clientWidth)-n),{width:n,height:i,x:s,y:o}}(_r(e));else if(jr(t))a=function(e,t){const r=Aa(e,!0,"fixed"===t),a=r.top+e.clientTop,n=r.left+e.clientLeft,i=Cr(e)?Sa(e):Jr(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:a*i.y}}(t,r);else{const r=Ca(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ga(a)}function Ra(e,t){const r=Ur(e);return!(r===t||!jr(r)||Fr(r))&&("fixed"===Br(r).position||Ra(r,t))}function Oa(e,t,r){const a=Cr(t),n=_r(t),i="fixed"===r,s=Aa(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const h=Jr(0);function l(){h.x=Ta(n)}if(a||!a&&!i)if(("body"!==xr(t)||Er(n))&&(o=Vr(t)),a){const e=Aa(t,!0,i,t);h.x=e.x+t.clientLeft,h.y=e.y+t.clientTop}else n&&l();i&&!a&&n&&l();const d=!n||a||i?Jr(0):Ea(n,o);return{x:s.left+o.scrollLeft-h.x-d.x,y:s.top+o.scrollTop-h.y-d.y,width:s.width,height:s.height}}function Pa(e){return"static"===Br(e).position}function La(e,t){if(!Cr(e)||"fixed"===Br(e).position)return null;if(t)return t(e);let r=e.offsetParent;return _r(e)===r&&(r=r.ownerDocument.body),r}function Ia(e,t){const r=Mr(e);if(Or(e))return r;if(!Cr(e)){let t=Ur(e);for(;t&&!Fr(t);){if(jr(t)&&!Pa(t))return t;t=Ur(t)}return r}let a=La(e,t);for(;a&&zr(a)&&Pa(a);)a=La(a,t);return a&&Fr(a)&&Pa(a)&&!qr(a)?r:a||function(e){let t=Ur(e);for(;Cr(t)&&!Fr(t);){if(qr(t))return t;if(Or(t))return null;t=Ur(t)}return null}(e)||r}const qa={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e;const i="fixed"===n,s=_r(a),o=!!t&&Or(t.floating);if(a===s||o&&i)return r;let h={scrollLeft:0,scrollTop:0},l=Jr(1);const d=Jr(0),c=Cr(a);if((c||!c&&!i)&&(("body"!==xr(a)||Er(s))&&(h=Vr(a)),Cr(a))){const e=Aa(a);l=Sa(a),d.x=e.x+a.clientLeft,d.y=e.y+a.clientTop}const u=!s||c||i?Jr(0):Ea(s,h);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-h.scrollLeft*l.x+d.x+u.x,y:r.y*l.y-h.scrollTop*l.y+d.y+u.y}},getDocumentElement:_r,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e;const i=[..."clippingAncestors"===r?Or(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let a=Wr(e,[],!1).filter(e=>jr(e)&&"body"!==xr(e)),n=null;const i="fixed"===Br(e).position;let s=i?Ur(e):e;for(;jr(s)&&!Fr(s);){const t=Br(s),r=qr(s);r||"fixed"!==t.position||(n=null),(i?!r&&!n:!r&&"static"===t.position&&n&&Na.has(n.position)||Er(s)&&!r&&Ra(e,s))?a=a.filter(e=>e!==s):n=t,s=Ur(s)}return t.set(e,a),a}(t,this._c):[].concat(r),a],s=i[0],o=i.reduce((e,r)=>{const a=za(t,r,n);return e.top=Kr(a.top,e.top),e.right=Xr(a.right,e.right),e.bottom=Xr(a.bottom,e.bottom),e.left=Kr(a.left,e.left),e},za(t,s,n));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Ia,getElementRects:async function(e){const t=this.getOffsetParent||Ia,r=this.getDimensions,a=await r(e.floating);return{reference:Oa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ma(e);return{width:t,height:r}},getScale:Sa,isElement:jr,isRTL:function(e){return"rtl"===Br(e).direction}};function Da(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ha(e,t,r,a){void 0===a&&(a={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:h=!1}=a,l=_a(e),d=n||i?[...l?Wr(l):[],...Wr(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});const c=l&&o?function(e,t){let r,a=null;const n=_r(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return function s(o,h){void 0===o&&(o=!1),void 0===h&&(h=1),i();const l=e.getBoundingClientRect(),{left:d,top:c,width:u,height:f}=l;if(o||t(),!u||!f)return;const p={rootMargin:-Yr(c)+"px "+-Yr(n.clientWidth-(d+u))+"px "+-Yr(n.clientHeight-(c+f))+"px "+-Yr(d)+"px",threshold:Kr(0,Xr(1,h))||1};let y=!0;function m(t){const a=t[0].intersectionRatio;if(a!==h){if(!y)return s();a?s(!1,a):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==a||Da(l,e.getBoundingClientRect())||s(),y=!1}try{a=new IntersectionObserver(m,{...p,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(m,p)}a.observe(e)}(!0),i}(l,r):null;let u,f=-1,p=null;s&&(p=new ResizeObserver(e=>{let[a]=e;a&&a.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),l&&!h&&p.observe(l),p.observe(t));let y=h?Aa(e):null;return h&&function t(){const a=Aa(e);y&&!Da(y,a)&&r();y=a,u=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==c||c(),null==(e=p)||e.disconnect(),p=null,h&&cancelAnimationFrame(u)}}const Fa=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,a;const{x:n,y:i,placement:s,middlewareData:o}=t,h=await async function(e,t){const{placement:r,platform:a,elements:n}=e,i=await(null==a.isRTL?void 0:a.isRTL(n.floating)),s=aa(r),o=na(r),h="y"===ha(r),l=xa.has(s)?-1:1,d=i&&h?-1:1,c=ra(t,e);let{mainAxis:u,crossAxis:f,alignmentAxis:p}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return o&&"number"==typeof p&&(f="end"===o?-1*p:p),h?{x:f*d,y:u*l}:{x:u*l,y:f*d}}(t,e);return s===(null==(r=o.offset)?void 0:r.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:n+h.x,y:i+h.y,data:{...h,placement:s}}}}},Ba=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:a,placement:n,platform:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:h={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=ra(e,t),d={x:r,y:a},c=await i.detectOverflow(t,l),u=ha(aa(n)),f=ia(u);let p=d[f],y=d[u];if(s){const e="y"===f?"bottom":"right";p=ta(p+c["y"===f?"top":"left"],p,p-c[e])}if(o){const e="y"===u?"bottom":"right";y=ta(y+c["y"===u?"top":"left"],y,y-c[e])}const m=h.fn({...t,[f]:p,[u]:y});return{...m,data:{x:m.x-r,y:m.y-a,enabled:{[f]:s,[u]:o}}}}}},Va=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,a;const{placement:n,middlewareData:i,rects:s,initialPlacement:o,platform:h,elements:l}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...m}=ra(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const g=aa(n),b=ha(o),k=aa(o)===o,v=await(null==h.isRTL?void 0:h.isRTL(l.floating)),w=u||(k||!y?[ma(o)]:function(e){const t=ma(e);return[da(e),t,da(t)]}(o)),x="none"!==p;!u&&x&&w.push(...ya(o,y,p,v));const M=[o,...w],_=await h.detectOverflow(t,m),S=[];let j=(null==(a=i.flip)?void 0:a.overflows)||[];if(d&&S.push(_[g]),c){const e=function(e,t,r){void 0===r&&(r=!1);const a=na(e),n=la(e),i=sa(n);let s="x"===n?a===(r?"end":"start")?"right":"left":"start"===a?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ma(s)),[s,ma(s)]}(n,s,v);S.push(_[e[0]],_[e[1]])}if(j=[...j,{placement:n,overflows:S}],!S.every(e=>e<=0)){var C,A;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=M[e];if(t){if(!("alignment"===c&&b!==ha(t))||j.every(e=>ha(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:j},reset:{placement:t}}}let r=null==(A=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!r)switch(f){case"bestFit":{var T;const e=null==(T=j.filter(e=>{if(x){const t=ha(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(r=e);break}case"initialPlacement":r=o}if(n!==r)return{reset:{placement:r}}}return{}}}},Ua=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,a;const{placement:n,rects:i,platform:s,elements:o}=t,{apply:h=()=>{},...l}=ra(e,t),d=await s.detectOverflow(t,l),c=aa(n),u=na(n),f="y"===ha(n),{width:p,height:y}=i.floating;let m,g;"top"===c||"bottom"===c?(m=c,g=u===(await(null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,m="end"===u?"top":"bottom");const b=y-d.top-d.bottom,k=p-d.left-d.right,v=Xr(y-d[m],b),w=Xr(p-d[g],k),x=!t.middlewareData.shift;let M=v,_=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(_=k),null!=(a=t.middlewareData.shift)&&a.enabled.y&&(M=b),x&&!u){const e=Kr(d.left,0),t=Kr(d.right,0),r=Kr(d.top,0),a=Kr(d.bottom,0);f?_=p-2*(0!==e||0!==t?e+t:Kr(d.left,d.right)):M=y-2*(0!==r||0!==a?r+a:Kr(d.top,d.bottom))}await h({...t,availableWidth:_,availableHeight:M});const S=await s.getDimensions(o.floating);return p!==S.width||y!==S.height?{reset:{rects:!0}}:{}}}},$a=(e,t,r)=>{const a=new Map,n={platform:qa,...r},i={...n.platform,_c:a};return(async(e,t,r)=>{const{placement:a="bottom",strategy:n="absolute",middleware:i=[],platform:s}=r,o=i.filter(Boolean),h=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:c}=va(l,a,h),u=a,f={},p=0;for(let r=0;r<o.length;r++){var y;const{name:i,fn:m}=o[r],{x:g,y:b,data:k,reset:v}=await m({x:d,y:c,initialPlacement:a,placement:u,strategy:n,middlewareData:f,rects:l,platform:{...s,detectOverflow:null!=(y=s.detectOverflow)?y:wa},elements:{reference:e,floating:t}});d=null!=g?g:d,c=null!=b?b:c,f={...f,[i]:{...f[i],...k}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(u=v.placement),v.rects&&(l=!0===v.rects?await s.getElementRects({reference:e,floating:t,strategy:n}):v.rects),({x:d,y:c}=va(l,u,h))),r=-1)}return{x:d,y:c,placement:u,strategy:n,middlewareData:f}})(e,t,{...n,platform:i})};var Wa="undefined"!=typeof document?l:function(){};function Za(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,a,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;0!==a--;)if(!Za(e[a],t[a]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(a=r;0!==a--;)if(!{}.hasOwnProperty.call(t,n[a]))return!1;for(a=r;0!==a--;){const r=n[a];if(("_owner"!==r||!e.$$typeof)&&!Za(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Xa(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ka(e,t){const r=Xa(e);return Math.round(t*r)/r}function Ga(t){const r=e.useRef(t);return Wa(()=>{r.current=t}),r}const Ya=(e,t)=>({...Fa(e),options:[e,t]}),Ja=(e,t)=>({...Ba(e),options:[e,t]}),Qa=(e,t)=>({...Ua(e),options:[e,t]}),en={...e};let tn=!1,rn=0;const an=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rn++;const nn=en.useId||function(){const[t,r]=e.useState(()=>tn?an():void 0);return ba(()=>{null==t&&r(an())},[]),e.useEffect(()=>{tn=!0},[]),t};let sn;"production"!==process.env.NODE_ENV&&(sn=new Set);const on=e.createContext(null),hn=e.createContext(null);function ln(t){const{open:r=!1,onOpenChange:a,elements:n}=t,i=nn(),s=e.useRef({}),[o]=e.useState(()=>function(){const e=new Map;return{emit(t,r){var a;null==(a=e.get(t))||a.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var a;null==(a=e.get(t))||a.delete(r)}}}()),h=null!=((null==(l=e.useContext(on))?void 0:l.id)||null);var l;if("production"!==process.env.NODE_ENV){const e=n.reference;e&&!jr(e)&&function(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];const n="Floating UI: "+r.join(" ");var i;null!=(e=sn)&&e.has(n)||(null==(i=sn)||i.add(n),console.error(n))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,c]=e.useState(n.reference),u=function(t){const r=e.useRef(()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")});return ka(()=>{r.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return null==r.current?void 0:r.current(...t)},[])}((e,t,r)=>{s.current.openEvent=e?t:void 0,o.emit("openchange",{open:e,event:t,reason:r,nested:h}),null==a||a(e,t,r)}),f=e.useMemo(()=>({setPositionReference:c}),[]),p=e.useMemo(()=>({reference:d||n.reference||null,floating:n.floating||null,domReference:n.reference}),[d,n.reference,n.floating]);return e.useMemo(()=>({dataRef:s,open:r,onOpenChange:u,elements:p,events:o,floatingId:i,refs:f}),[r,u,p,o,i,f])}function dn(t){void 0===t&&(t={});const{nodeId:r}=t,a=ln({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||a,i=n.elements,[s,o]=e.useState(null),[h,l]=e.useState(null),d=(null==i?void 0:i.domReference)||s,c=e.useRef(null),u=e.useContext(hn);ba(()=>{d&&(c.current=d)},[d]);const p=function(t){void 0===t&&(t={});const{placement:r="bottom",strategy:a="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:h=!0,whileElementsMounted:l,open:d}=t,[c,u]=e.useState({x:0,y:0,strategy:a,placement:r,middlewareData:{},isPositioned:!1}),[p,y]=e.useState(n);Za(p,n)||y(n);const[m,g]=e.useState(null),[b,k]=e.useState(null),v=e.useCallback(e=>{e!==_.current&&(_.current=e,g(e))},[]),w=e.useCallback(e=>{e!==S.current&&(S.current=e,k(e))},[]),x=s||m,M=o||b,_=e.useRef(null),S=e.useRef(null),j=e.useRef(c),C=null!=l,A=Ga(l),T=Ga(i),E=Ga(d),N=e.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:r,strategy:a,middleware:p};T.current&&(e.platform=T.current),$a(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};z.current&&!Za(j.current,t)&&(j.current=t,f.flushSync(()=>{u(t)}))})},[p,r,a,T,E]);Wa(()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,u(e=>({...e,isPositioned:!1})))},[d]);const z=e.useRef(!1);Wa(()=>(z.current=!0,()=>{z.current=!1}),[]),Wa(()=>{if(x&&(_.current=x),M&&(S.current=M),x&&M){if(A.current)return A.current(x,M,N);N()}},[x,M,N,A,C]);const R=e.useMemo(()=>({reference:_,floating:S,setReference:v,setFloating:w}),[v,w]),O=e.useMemo(()=>({reference:x,floating:M}),[x,M]),P=e.useMemo(()=>{const e={position:a,left:0,top:0};if(!O.floating)return e;const t=Ka(O.floating,c.x),r=Ka(O.floating,c.y);return h?{...e,transform:"translate("+t+"px, "+r+"px)",...Xa(O.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:t,top:r}},[a,h,O.floating,c.x,c.y]);return e.useMemo(()=>({...c,update:N,refs:R,elements:O,floatingStyles:P}),[c,N,R,O,P])}({...t,elements:{...i,...h&&{reference:h}}}),y=e.useCallback(e=>{const t=jr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),m=e.useCallback(e=>{(jr(e)||null===e)&&(c.current=e,o(e)),(jr(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!jr(e))&&p.refs.setReference(e)},[p.refs]),g=e.useMemo(()=>({...p.refs,setReference:m,setPositionReference:y,domReference:c}),[p.refs,m,y]),b=e.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),k=e.useMemo(()=>({...p,...n,refs:g,elements:b,nodeId:r}),[p,g,b,r,n]);return ba(()=>{n.dataRef.current.floatingContext=k;const e=null==u?void 0:u.nodesRef.current.find(e=>e.id===r);e&&(e.context=k)}),e.useMemo(()=>({...p,context:k,refs:g,elements:b}),[p,g,b,k])}const cn=({open:e,anchorEl:t,onClose:r,placement:a="bottom-start",offset:n=8,sameWidth:i=!1,maxHeight:s,zIndex:h=1e3,className:l,children:d,shouldIgnoreClose:c})=>{const{refs:u,floatingStyles:f,update:y}=dn({placement:a,whileElementsMounted:Ha,middleware:[Ya(n),(m={padding:8},{...Va(m),options:[m,g]}),Ja({padding:8}),Qa({apply({rects:e,elements:t,availableHeight:r,availableWidth:a}){const n=t.floating;n&&(i&&(n.style.width=`${e.reference.width}px`),n.style.maxHeight=null!=s?"number"==typeof s?`${s}px`:String(s):`${r}px`,null!=a&&(n.style.maxWidth=`${a}px`))}})]});var m,g;return o(()=>{t&&u.setReference(t),e&&y&&y()},[t,e,u,y]),o(()=>{if(!e)return;const a=e=>{const a=e.target;if(c&&c(a))return;const n=u.floating.current;n&&(t&&t.contains(a)||n&&n.contains(a)||r())},n=e=>{"Escape"===e.key&&r()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",n)}},[e,r,u.floating,t]),e&&t?p(_.jsx("div",{ref:u.setFloating,"data-popover-root":"true",style:{...f,zIndex:h,position:f.position,overflowX:"hidden"},className:l,children:d}),document.body):null},un=({globalFilter:e,filteredDataLength:t,selectedRowsCount:r=0,selectedRows:n=new Set,showExport:i=!0,showColumnToggle:l=!0,showBulkActions:d=!0,columns:c=[],columnVisibility:u={},columnFilters:f={},bulkActions:p=[],exportOptions:y,onGlobalFilterChange:m,onClearFilters:g,onColumnVisibilityChange:b,onColumnFilter:k,onResetColumns:v,columnOrder:w=[],onColumnOrderChange:x,pinnedColumns:M,onScrollToColumn:S,density:j="md",onDensityChange:C,showDensityControl:A=!1,customLeftContent:T,customRightContent:E})=>{const[z,R]=s(!1),[O,P]=s(!1),[L,I]=s(!1),[q,D]=s(!1),[H,X]=s(""),[G,Y]=s(null),[Q,ee]=s(null),te=h(null),oe=h(null),he=h(null),de=h(null),ce=h(null),ue=h(null),fe=h(null),pe=h(null),ye=h(null);o(()=>{const e=e=>{if((e=>{let t=e;for(;t;){if(t.getAttribute&&"true"===t.getAttribute("data-popover-root")||t.dataset&&"true"===t.dataset.popoverRoot)return!0;t=t.parentNode}return!1})(e.target))return;oe.current&&!oe.current.contains(e.target)&&R(!1),he.current&&!he.current.contains(e.target)&&I(!1),de.current&&!de.current.contains(e.target)&&D(!1),!ce.current||ce.current.contains(e.target)||(e=>{let t=e;for(;t;){if(t.classList){const e=Array.from(t.classList).join(" ");if(/MuiPickers|MuiDatePicker|MuiPickersPopper/.test(e))return!0}if(t.getAttribute&&"dialog"===t.getAttribute("role")){const e=t.className?.toString()||"";if(/MuiPickers|MuiDatePicker/.test(e))return!0}t=t.parentNode}return!1})(e.target)||P(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const me=y?.formats||["xlsx"],ge=(e?.length??0)>0||Object.keys(f||{}).length>0,be=r>0,ke=c.filter(e=>!1!==u[e.key]).length,ve=[...w.map(e=>c.find(t=>t.key===e)).filter(Boolean),...c.filter(e=>!w.includes(e.key))].filter(e=>e.header?.toLowerCase()?.includes(H?.toLowerCase())),we=e=>{switch(e){case"csv":return _.jsx(ie,{size:18});case"json":return _.jsx(B,{size:18});case"xlsx":return _.jsx(Z,{size:18});default:return _.jsx(V,{size:18})}},xe=e=>{switch(e){case"delete":return _.jsx(se,{size:18});case"archive":return _.jsx(N,{size:18});case"copy":return _.jsx(F,{size:18});case"edit":return _.jsx(ne,{size:18});case"export":return _.jsx(V,{size:18});default:return _.jsx(U,{size:18})}},Me=e=>{switch(e){case"csv":return"CSV";case"json":return"JSON";case"xlsx":return"Excel";default:return e}},_e=(e,t=!1)=>{y?.onExport?.(e,t),R(!1)},Se=()=>{Y(null),ee(null)},je=a(()=>c.some(e=>e.filterable),[c]);return _.jsxs("div",{className:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",role:"toolbar","aria-label":"Data grid toolbar",children:[_.jsxs("div",{id:"search-results-status",className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:[ge?`Showing ${t} of ${t} rows`:`${t} total rows`,be&&`, ${r} row${1!==r?"s":""} selected`]}),_.jsx("div",{className:"px-3 py-2",children:_.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 sm:gap-4",children:[_.jsxs("div",{className:"order-1 flex items-center flex-wrap gap-2 sm:gap-3",children:[_.jsxs("div",{className:"relative",ref:ce,children:[je&&_.jsxs("button",{ref:e=>{ue.current=e},onClick:()=>P(!O),className:"flex cursor-pointer items-center gap-2 px-3 py-2 border rounded-lg transition-colors "+(O?"bg-blue-50 dark:bg-blue-900/40 border-blue-200 dark:border-blue-600 text-blue-700 dark:text-blue-300":"border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800"),title:"Toggle column filters (Ctrl+K)","aria-label":"Toggle column filters","aria-haspopup":"menu","aria-expanded":O,"aria-controls":"filters-menu","aria-keyshortcuts":"Control+K",children:[_.jsx(K,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline",children:"Filters"}),Object.keys(f).length>0&&_.jsxs("button",{type:"button",onClick:e=>{e.stopPropagation(),g?.()},className:"bg-red-500 cursor-pointer hover:bg-red-600 text-white text-xs px-1.5 py-0.5 rounded-full min-w-5 h-5 flex items-center justify-center transition-all group relative",title:"Clear all filters",children:[_.jsx("span",{className:"group-hover:hidden",children:Object.keys(f).length}),_.jsx(le,{className:"w-3 h-3 hidden group-hover:block absolute"})]})]}),_.jsxs(cn,{open:O,anchorEl:ue.current,onClose:()=>P(!1),placement:"bottom-start",offset:8,zIndex:1e3,maxHeight:520,className:"w-88 sm:w-88 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl overflow-y-auto min-h-100",shouldIgnoreClose:e=>{let t=e;for(;t;){if(t.classList){const e=Array.from(t.classList).join(" ");if(/MuiPickers|MuiDatePicker|MuiPickersPopper/.test(e))return!0}if(t.getAttribute&&"dialog"===t.getAttribute("role")){const e=t.className?.toString()||"";if(/MuiPickers|MuiDatePicker/.test(e))return!0}t=t.parentNode}return!1},children:[_.jsxs("div",{className:"flex items-center justify-between px-2",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Column Filters"}),_.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Filter data by column values"})]}),_.jsx("button",{onClick:g,className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",children:"Clear All"})]}),_.jsx("div",{className:"p-3 space-y-3",children:_.jsx(vr,{columns:c,columnFilters:f,onColumnFilter:k})}),_.jsx("div",{className:"flex items-center justify-between p-3 border-t border-gray-200",children:_.jsx("div",{className:"text-sm text-gray-600",children:Object.keys(f).length>0&&_.jsxs("span",{children:[Object.keys(f).length," filter",1!==Object.keys(f).length?"s":""," ","applied"]})})})]})]}),T]}),_.jsxs("div",{className:"order-2 flex items-center gap-2 sm:gap-3 flex-wrap sm:flex-nowrap",children:[E,d&&be&&p.length>0&&_.jsxs("div",{className:"relative",ref:he,children:[_.jsxs("button",{ref:e=>{pe.current=e},onClick:()=>I(!L),className:"flex items-center gap-2 px-3 py-2.5 bg-orange-600 text-white rounded-lg hover:bg-orange-700 transition-colors",title:"Bulk actions",children:[_.jsx(U,{className:"w-4 h-4"}),_.jsxs("span",{className:"hidden sm:inline text-sm font-medium",children:["Actions (",r,")"]})]}),_.jsxs(cn,{open:L,anchorEl:pe.current,onClose:()=>I(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-56 bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Bulk Actions"}),_.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r," row",1!==r?"s":""," selected"]})]}),_.jsx("div",{className:"p-2",children:p.map(e=>_.jsxs("button",{onClick:()=>(e=>{e.disabled||(e.onClick(n),I(!1))})(e),disabled:e.disabled,className:"w-full flex items-center gap-3 px-3 py-2 text-sm rounded-md transition-colors "+(e.disabled?"text-gray-400 cursor-not-allowed":e.destructive?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"),children:[xe(e.id),e.label]},e.id))})]})]}),l&&c.length>0&&_.jsxs("div",{className:"relative",ref:de,children:[_.jsxs("button",{ref:e=>{ye.current=e},onClick:()=>D(!q),className:"flex items-center gap-2 px-3 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",title:"Column visibility","aria-label":`Column visibility. ${ke} of ${c.length} columns visible`,"aria-haspopup":"menu","aria-expanded":q,"aria-controls":"column-visibility-menu",children:[_.jsx(ae,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline text-sm font-medium",children:"Columns"}),_.jsxs("span",{className:"hidden sm:inline text-xs text-gray-500",children:["(",ke,"/",c.length,")"]})]}),_.jsxs(cn,{open:q,anchorEl:ye.current,onClose:()=>D(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-[90vw] sm:w-72 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Show/Hide Columns"}),_.jsxs("div",{className:"relative mt-2",children:[_.jsx(re,{className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-400 w-4 h-4"}),_.jsx("input",{type:"text",placeholder:"Search columns...",className:"w-full pl-8 pr-2 py-1.5 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm",value:H,onChange:e=>X(e.target.value)})]})]}),_.jsx("div",{className:"max-h-60 overflow-y-auto p-2",children:ve.map(e=>{const t=!1!==u[e.key];return _.jsxs("label",{className:"flex items-center gap-3 p-2 hover:bg-gray-50 rounded-md cursor-grab relative "+(G===e.key?"opacity-60":""),draggable:!0,onDragStart:t=>((e,t)=>{Y(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)})(e.key,t),onDragOver:t=>((e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.top+r.height/2,n=t.clientY<a?"before":"after";ee({key:e,position:n})})(e.key,t),onDrop:()=>(e=>{const t=G;if(!t||t===e)return;if(M&&M.has(t)!==M.has(e))return Y(null),void ee(null);const r=Q?.key!==e||"before"===Q.position,a=(w&&w.length?w:c.map(e=>e.key)).filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return x?.(a),Y(null),void ee(null);r||(n+=1),a.splice(n,0,t),x?.(a),Y(null),ee(null)})(e.key),onDragEnd:Se,children:[Q?.key===e.key&&_.jsx("span",{className:"absolute left-2 right-2 h-0.5 bg-blue-600",style:{top:"before"===Q.position?0:void 0,bottom:"after"===Q.position?0:void 0}}),_.jsx("input",{type:"checkbox",checked:t,onChange:()=>(e=>{const t=!1!==u[e];b?.(e,!t)})(e.key),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),t?_.jsx(W,{className:"w-4 h-4 text-green-600"}):_.jsx($,{className:"w-4 h-4 text-gray-400"}),_.jsx("span",{className:"text-sm text-gray-700",children:e.header}),_.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),t?S?.(e.key):(b?.(e.key,!0),requestAnimationFrame(()=>S?.(e.key)))},className:"ml-auto p-1 text-gray-400 hover:text-blue-600",title:"Scroll to this column","aria-label":`Scroll to column ${e.header}`,children:_.jsx(J,{className:"w-4 h-4"})})]},e.key)})}),_.jsxs("div",{className:"p-2 border-t border-gray-100",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900 cursor-pointer hover:bg-gray-50 px-3 py-1.5 rounded transition-colors min-h-9",children:[_.jsx("input",{type:"checkbox",checked:ve.every(e=>!1!==u[e.key]),onChange:e=>{ve.forEach(t=>{b?.(t.key,e.target.checked)})},className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),_.jsx("span",{children:"Select All"})]}),_.jsx("button",{className:"text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-50 px-3 py-1.5 rounded transition-colors min-h-9",onClick:()=>{c.forEach(e=>{b?.(e.key,!1!==e.visible)}),x?.(c.map(e=>e.key)),v?.(),D(!1)},children:"Reset Columns"})]}),H&&_.jsx("button",{className:"text-xs text-blue-600 hover:underline mt-2",onClick:()=>X(""),children:"Clear Search"})]})]})]}),A&&_.jsx("div",{className:"flex items-center",children:_.jsx("div",{className:"flex items-center gap-1 border border-gray-300 rounded-lg p-1",title:"Row density",children:["sm","md","lg"].map(e=>_.jsx("button",{className:"px-2 py-1 text-xs rounded-md "+(j===e?"bg-blue-600 text-white":"text-gray-700 hover:bg-gray-100"),onClick:()=>C?.(e),children:e.toUpperCase()},e))})}),_.jsx("div",{className:"flex items-center gap-2 order-3 w-full sm:order-0 sm:w-auto flex-1 min-w-0",children:_.jsxs("div",{className:"relative",children:[_.jsx(re,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4","aria-hidden":"true"}),_.jsx("input",{ref:te,type:"text",placeholder:"Search...",className:"w-full sm:w-64 pl-10 pr-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-800 dark:text-gray-200 transition-colors",value:e,onChange:m,"aria-label":"Search all columns","aria-keyshortcuts":"Control+F","aria-describedby":"search-results-status"}),e&&_.jsx("button",{onClick:()=>m({target:{value:""}}),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",title:"Clear search",children:_.jsx(le,{className:"w-4 h-4"})})]})}),i&&y?.enabled&&_.jsxs("div",{className:"relative",ref:oe,children:[_.jsx("button",{ref:e=>{fe.current=e},onClick:()=>R(!z),className:"p-2.5 cursor-pointer border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 transition-colors","aria-label":"Export data"+(be?` (${r} rows selected)`:` (${t} rows)`),"aria-haspopup":"menu","aria-expanded":z,"aria-controls":"export-menu","aria-keyshortcuts":"Control+E",title:"Export data (Ctrl+E)",children:_.jsx(V,{className:"w-4 h-4"})}),_.jsxs(cn,{open:z,anchorEl:fe.current,onClose:()=>R(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-[90vw] sm:w-64 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Export Data"}),_.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Choose format and data scope"})]}),_.jsxs("div",{className:"p-2",children:[_.jsxs("div",{className:"mb-3",children:[_.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2 px-2",children:"Export All Data"}),_.jsx("div",{className:"space-y-1",children:me.map(e=>_.jsxs("button",{onClick:()=>_e(e,!1),className:" cursor-pointer w-full flex items-center gap-3 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded-md transition-colors",children:[we(e),_.jsxs("span",{children:["Export as ",Me(e)]}),_.jsxs("span",{className:"ml-auto text-xs text-gray-500",children:[t.toLocaleString()," rows"]})]},`all-${e}`))})]}),be&&_.jsxs("div",{children:[_.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2 px-2",children:"Export Selected"}),_.jsx("div",{className:"space-y-1",children:me.map(e=>_.jsxs("button",{onClick:()=>_e(e,!0),className:"w-full flex items-center gap-3 px-3 py-2 text-sm text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:[we(e),_.jsxs("span",{children:["Export as ",Me(e)]}),_.jsxs("span",{className:"ml-auto text-xs text-blue-500",children:[r," rows"]})]},`selected-${e}`))})]})]})]})]})]})]})})]})};function fn(e){const t=e?.enabled??!0,r=h(null),n=h(null);o(()=>{if(!t)return;try{r.current=new Worker(new URL("../workers/dataWorker.ts",import.meta.url),{type:"module"})}catch{const e=`(${pn.toString()})()`,t=new Blob([e],{type:"application/javascript"});r.current=new Worker(URL.createObjectURL(t))}const e=r.current;return e.onmessage=e=>{const t=e.data;t&&"result"===t.type&&(n.current?.(t.payload.rows),n.current=null)},()=>{e?.terminate(),r.current=null,n.current=null}},[t]);return{process:a(()=>(e,a)=>{if(!t||!r.current){if(!e||0===e.length||!a?.key)return Promise.resolve(e);const t="asc"===a.direction?1:-1,r=[...e].sort((e,r)=>{const n=e?.[a.key],i=r?.[a.key];return null==n&&null==i?0:null==n?-1*t:null==i?1*t:"number"==typeof n&&"number"==typeof i?(n-i)*t:String(n).localeCompare(String(i))*t});return Promise.resolve(r)}return new Promise(t=>{n.current=t,r.current.postMessage({type:"process",payload:{rows:e,sort:a}})})},[t])}}function pn(){const e=self;e.onmessage=t=>{const r=t.data;if(r&&"process"===r.type)try{const{rows:t,sort:a}=r.payload,n=((e,t)=>{if(!e||0===e.length)return e;let r=e;if(t&&t.key){const{key:a,direction:n}=t,i="asc"===n?1:-1;r=[...e].sort((e,t)=>{const r=e?.[a],n=t?.[a];if(null==r&&null==n)return 0;if(null==r)return-1*i;if(null==n)return 1*i;if("number"==typeof r&&"number"==typeof n)return(r-n)*i;const s=String(r),o=String(n);return s.localeCompare(o)*i})}return r})(t,a??null);e.postMessage({type:"result",payload:{rows:n}})}catch(r){e.postMessage({type:"result",payload:{rows:t.data?.payload?.rows||[]}})}}}function yn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mn,gn={exports:{}};
10738
+ E("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const de=({value:e,onChange:t,placeholder:r="Enter text to filter..."})=>{const[a,n]=s(e?.value||""),[i,o]=s(e?.operator||"contains");return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:i,onChange:e=>(e=>{const r=e;o(r),a.trim()&&t({type:"text",value:a,operator:r})})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"contains",children:"Contains"}),_.jsx("option",{value:"equals",children:"Equals"}),_.jsx("option",{value:"startsWith",children:"Starts with"}),_.jsx("option",{value:"endsWith",children:"Ends with"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Text Value"}),_.jsx("input",{type:"text",value:a,onChange:e=>{return r=e.target.value,n(r),void(r.trim()?t({type:"text",value:r,operator:i}):t(null));var r},placeholder:r,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]})},ce=({value:e,onChange:t,min:r,max:a})=>{const[n,i]=s(e?.value||""),[o,h]=s(e?.secondValue||""),[l,d]=s(e?.operator||"equals"),c=(e,r=!1)=>{r?h(e):i(e);const a=parseFloat(e),n=parseFloat(o);"between"===l?isNaN(a)||isNaN(n)?t(null):t({type:"number",value:Math.min(a,n),secondValue:Math.max(a,n),operator:"between"}):isNaN(a)?t(null):t({type:"number",value:a,operator:l})};return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:l,onChange:e=>(e=>{const r=e;if(d(r),"between"===r){const e=parseFloat(n),r=parseFloat(o);isNaN(e)||isNaN(r)||t({type:"number",value:Math.min(e,r),secondValue:Math.max(e,r),operator:"between"})}else{const e=parseFloat(n);isNaN(e)||t({type:"number",value:e,operator:r})}})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"equals",children:"Equals"}),_.jsx("option",{value:"gt",children:"Greater than"}),_.jsx("option",{value:"gte",children:"Greater than or equal"}),_.jsx("option",{value:"lt",children:"Less than"}),_.jsx("option",{value:"lte",children:"Less than or equal"}),_.jsx("option",{value:"between",children:"Between"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"between"===l?"From Value":"Number Value"}),_.jsx("input",{type:"number",value:n,onChange:e=>c(e.target.value),min:r,max:a,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),"between"===l&&_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"To Value"}),_.jsx("input",{type:"number",value:o,onChange:e=>c(e.target.value,!0),min:r,max:a,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]})},ue=({name:e,label:t,value:r,onChange:a,className:n=""})=>_.jsxs("div",{className:`space-y-1 ${n}`,children:[t&&_.jsx("label",{className:"text-sm font-medium text-gray-700",children:t}),_.jsx("input",{type:"date",name:e,value:r||"",onChange:e=>a(e.target.value||null),className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]});function fe(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function pe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ye(e,t){const r=fe(e);return isNaN(t)?pe(e,NaN):t?(r.setDate(r.getDate()+t),r):r}const me=6048e5;let ge={};function be(){return ge}function ke(e,t){const r=be(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,n=fe(e),i=n.getDay(),s=(i<a?7:0)+i-a;return n.setDate(n.getDate()-s),n.setHours(0,0,0,0),n}function ve(e){return ke(e,{weekStartsOn:1})}function we(e){const t=fe(e),r=t.getFullYear(),a=pe(e,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const n=ve(a),i=pe(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=ve(i);return t.getTime()>=n.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function xe(e){const t=fe(e);return t.setHours(0,0,0,0),t}function Me(e){const t=fe(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function _e(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const r=fe(e);return!isNaN(Number(r))}const Se={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"}};function je(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Ce={date:je({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:je({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:je({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Ae={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Te(e){return(t,r)=>{let a;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,n=r?.width?String(r.width):t;a=e.formattingValues[n]||e.formattingValues[t]}else{const t=e.defaultWidth,n=r?.width?String(r.width):e.defaultWidth;a=e.values[n]||e.values[t]}return a[e.argumentCallback?e.argumentCallback(t):t]}}const Ee={ordinalNumber:(e,t)=>{const r=Number(e),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Te({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Te({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Te({values:{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"]},defaultWidth:"wide"}),day:Te({values:{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"]},defaultWidth:"wide"}),dayPeriod:Te({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})};function Ne(e){return(t,r={})=>{const a=r.width,n=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const s=i[0],o=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(o)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(o,e=>e.test(s)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(o,e=>e.test(s));let l;l=e.valueCallback?e.valueCallback(h):h,l=r.valueCallback?r.valueCallback(l):l;return{value:l,rest:t.slice(s.length)}}}const ze={ordinalNumber:(Re={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const r=e.match(Re.matchPattern);if(!r)return null;const a=r[0],n=e.match(Re.parsePattern);if(!n)return null;let i=Re.valueCallback?Re.valueCallback(n[0]):n[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(a.length)}}),era:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Ne({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:Ne({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:Ne({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})};var Re;const Oe={code:"en-US",formatDistance:(e,t,r)=>{let a;const n=Se[e];return a="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a},formatLong:Ce,formatRelative:(e,t,r,a)=>Ae[e],localize:Ee,match:ze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pe(e){const t=fe(e),r=function(e,t){const r=xe(e),a=xe(t),n=+r-Me(r),i=+a-Me(a);return Math.round((n-i)/864e5)}(t,function(e){const t=fe(e),r=pe(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}(t));return r+1}function Le(e){const t=fe(e),r=+ve(t)-+function(e){const t=we(e),r=pe(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),ve(r)}(t);return Math.round(r/me)+1}function Ie(e,t){const r=fe(e),a=r.getFullYear(),n=be(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=pe(e,0);s.setFullYear(a+1,0,i),s.setHours(0,0,0,0);const o=ke(s,t),h=pe(e,0);h.setFullYear(a,0,i),h.setHours(0,0,0,0);const l=ke(h,t);return r.getTime()>=o.getTime()?a+1:r.getTime()>=l.getTime()?a:a-1}function qe(e,t){const r=fe(e),a=+ke(r,t)-+function(e,t){const r=be(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,n=Ie(e,t),i=pe(e,0);return i.setFullYear(n,0,a),i.setHours(0,0,0,0),ke(i,t)}(r,t);return Math.round(a/me)+1}function De(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const He={y(e,t){const r=e.getFullYear(),a=r>0?r:1-r;return De("yy"===t?a%100:a,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):De(r+1,2)},d:(e,t)=>De(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>De(e.getHours()%12||12,t.length),H:(e,t)=>De(e.getHours(),t.length),m:(e,t)=>De(e.getMinutes(),t.length),s:(e,t)=>De(e.getSeconds(),t.length),S(e,t){const r=t.length,a=e.getMilliseconds();return De(Math.trunc(a*Math.pow(10,r-3)),t.length)}},Fe="midnight",Be="noon",Ve="morning",Ue="afternoon",$e="evening",We="night",Ze={G:function(e,t,r){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),a=t>0?t:1-t;return r.ordinalNumber(a,{unit:"year"})}return He.y(e,t)},Y:function(e,t,r,a){const n=Ie(e,a),i=n>0?n:1-n;if("YY"===t){return De(i%100,2)}return"Yo"===t?r.ordinalNumber(i,{unit:"year"}):De(i,t.length)},R:function(e,t){return De(we(e),t.length)},u:function(e,t){return De(e.getFullYear(),t.length)},Q:function(e,t,r){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return De(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,r){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return De(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,r){const a=e.getMonth();switch(t){case"M":case"MM":return He.M(e,t);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,r){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return De(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,r,a){const n=qe(e,a);return"wo"===t?r.ordinalNumber(n,{unit:"week"}):De(n,t.length)},I:function(e,t,r){const a=Le(e);return"Io"===t?r.ordinalNumber(a,{unit:"week"}):De(a,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):He.d(e,t)},D:function(e,t,r){const a=Pe(e);return"Do"===t?r.ordinalNumber(a,{unit:"dayOfYear"}):De(a,t.length)},E:function(e,t,r){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,r,a){const n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return De(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,r,a){const n=e.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return De(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"});default:return r.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,r){const a=e.getDay(),n=0===a?7:a;switch(t){case"i":return String(n);case"ii":return De(n,t.length);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const a=e.getHours();let n;switch(n=12===a?Be:0===a?Fe:a/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){const a=e.getHours();let n;switch(n=a>=17?$e:a>=12?Ue:a>=4?Ve:We,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return He.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):He.H(e,t)},K:function(e,t,r){const a=e.getHours()%12;return"Ko"===t?r.ordinalNumber(a,{unit:"hour"}):De(a,t.length)},k:function(e,t,r){let a=e.getHours();return 0===a&&(a=24),"ko"===t?r.ordinalNumber(a,{unit:"hour"}):De(a,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):He.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):He.s(e,t)},S:function(e,t){return He.S(e,t)},X:function(e,t,r){const a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return Ke(a);case"XXXX":case"XX":return Ge(a);default:return Ge(a,":")}},x:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"x":return Ke(a);case"xxxx":case"xx":return Ge(a);default:return Ge(a,":")}},O:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xe(a,":");default:return"GMT"+Ge(a,":")}},z:function(e,t,r){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xe(a,":");default:return"GMT"+Ge(a,":")}},t:function(e,t,r){return De(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,r){return De(e.getTime(),t.length)}};function Xe(e,t=""){const r=e>0?"-":"+",a=Math.abs(e),n=Math.trunc(a/60),i=a%60;return 0===i?r+String(n):r+String(n)+t+De(i,2)}function Ke(e,t){if(e%60==0){return(e>0?"-":"+")+De(Math.abs(e)/60,2)}return Ge(e,t)}function Ge(e,t=""){const r=e>0?"-":"+",a=Math.abs(e);return r+De(Math.trunc(a/60),2)+t+De(a%60,2)}const Ye=(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"});default:return t.date({width:"full"})}},Je=(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"});default:return t.time({width:"full"})}},Qe={p:Je,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],a=r[1],n=r[2];if(!n)return Ye(e,t);let i;switch(a){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",Ye(a,t)).replace("{{time}}",Je(n,t))}},et=/^D+$/,tt=/^Y+$/,rt=["D","DD","YY","YYYY"];function at(e){return et.test(e)}function nt(e){return tt.test(e)}function it(e,t,r){const a=function(e,t,r){const a="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(console.warn(a),rt.includes(e))throw new RangeError(a)}const st=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ot=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ht=/^'([^]*?)'?$/,lt=/''/g,dt=/[a-zA-Z]/;function ct(e,t,r){const a=be(),n=r?.locale??a.locale??Oe,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,o=fe(e);if(!_e(o))throw new RangeError("Invalid time value");let h=t.match(ot).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Qe[t])(e,n.formatLong)}return e}).join("").match(st).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:ut(e)};if(Ze[t])return{isToken:!0,value:e};if(t.match(dt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});n.localize.preprocessor&&(h=n.localize.preprocessor(o,h));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return h.map(a=>{if(!a.isToken)return a.value;const i=a.value;(!r?.useAdditionalWeekYearTokens&&nt(i)||!r?.useAdditionalDayOfYearTokens&&at(i))&&it(i,t,String(e));return(0,Ze[i[0]])(o,i,n.localize,l)}).join("")}function ut(e){const t=e.match(ht);return t?t[1].replace(lt,"'"):e}class ft{subPriority=0;validate(e,t){return!0}}class pt extends ft{constructor(e,t,r,a,n){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=a,n&&(this.subPriority=n)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}}class yt extends ft{priority=10;subPriority=-1;set(e,t){return t.timestampIsSet?e:pe(e,function(e,t){const r=t instanceof Date?pe(t,0):new t(0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}(e,Date))}}class mt{run(e,t,r,a){const n=this.parse(e,t,r,a);return n?{setter:new pt(n.value,this.validate,this.set,this.priority,this.subPriority),rest:n.rest}:null}validate(e,t,r){return!0}}const gt=/^(1[0-2]|0?\d)/,bt=/^(3[0-1]|[0-2]?\d)/,kt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,vt=/^(5[0-3]|[0-4]?\d)/,wt=/^(2[0-3]|[0-1]?\d)/,xt=/^(2[0-4]|[0-1]?\d)/,Mt=/^(1[0-1]|0?\d)/,_t=/^(1[0-2]|0?\d)/,St=/^[0-5]?\d/,jt=/^[0-5]?\d/,Ct=/^\d/,At=/^\d{1,2}/,Tt=/^\d{1,3}/,Et=/^\d{1,4}/,Nt=/^-?\d+/,zt=/^-?\d/,Rt=/^-?\d{1,2}/,Ot=/^-?\d{1,3}/,Pt=/^-?\d{1,4}/,Lt=/^([+-])(\d{2})(\d{2})?|Z/,It=/^([+-])(\d{2})(\d{2})|Z/,qt=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Dt=/^([+-])(\d{2}):(\d{2})|Z/,Ht=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Ft(e,t){return e?{value:t(e.value),rest:e.rest}:e}function Bt(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function Vt(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};return{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:t.slice(r[0].length)}}function Ut(e){return Bt(Nt,e)}function $t(e,t){switch(e){case 1:return Bt(Ct,t);case 2:return Bt(At,t);case 3:return Bt(Tt,t);case 4:return Bt(Et,t);default:return Bt(new RegExp("^\\d{1,"+e+"}"),t)}}function Wt(e,t){switch(e){case 1:return Bt(zt,t);case 2:return Bt(Rt,t);case 3:return Bt(Ot,t);case 4:return Bt(Pt,t);default:return Bt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Zt(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Xt(e,t){const r=t>0,a=r?t:1-t;let n;if(a<=50)n=e||100;else{const t=a+50;n=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?n:1-n}function Kt(e){return e%400==0||e%4==0&&e%100!=0}const Gt=[31,28,31,30,31,30,31,31,30,31,30,31],Yt=[31,29,31,30,31,30,31,31,30,31,30,31];function Jt(e,t,r){const a=be(),n=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=fe(e),s=i.getDay(),o=7-n;return ye(i,t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7)}function Qt(e,t){const r=fe(e),a=function(e){let t=fe(e).getDay();return 0===t&&(t=7),t}(r);return ye(r,t-a)}const er={G:new class extends mt{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends mt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const a=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return Ft($t(4,e),a);case"yo":return Ft(r.ordinalNumber(e,{unit:"year"}),a);default:return Ft($t(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const a=e.getFullYear();if(r.isTwoDigitYear){const t=Xt(r.year,a);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const n="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}},Y:new class extends mt{priority=130;parse(e,t,r){const a=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return Ft($t(4,e),a);case"Yo":return Ft(r.ordinalNumber(e,{unit:"year"}),a);default:return Ft($t(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,a){const n=Ie(e,a);if(r.isTwoDigitYear){const t=Xt(r.year,n);return e.setFullYear(t,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ke(e,a)}const i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),ke(e,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends mt{priority=130;parse(e,t){return Wt("R"===t?4:t.length,e)}set(e,t,r){const a=pe(e,0);return a.setFullYear(r,0,4),a.setHours(0,0,0,0),ve(a)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends mt{priority=130;parse(e,t){return Wt("u"===t?4:t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends mt{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return $t(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends mt{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return $t(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends mt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const a=e=>e-1;switch(t){case"M":return Ft(Bt(gt,e),a);case"MM":return Ft($t(2,e),a);case"Mo":return Ft(r.ordinalNumber(e,{unit:"month"}),a);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends mt{priority=110;parse(e,t,r){const a=e=>e-1;switch(t){case"L":return Ft(Bt(gt,e),a);case"LL":return Ft($t(2,e),a);case"Lo":return Ft(r.ordinalNumber(e,{unit:"month"}),a);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends mt{priority=100;parse(e,t,r){switch(t){case"w":return Bt(vt,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,a){return ke(function(e,t,r){const a=fe(e),n=qe(a,r)-t;return a.setDate(a.getDate()-7*n),a}(e,r,a),a)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends mt{priority=100;parse(e,t,r){switch(t){case"I":return Bt(vt,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return ve(function(e,t){const r=fe(e),a=Le(r)-t;return r.setDate(r.getDate()-7*a),r}(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends mt{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return Bt(bt,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return $t(t.length,e)}}validate(e,t){const r=Kt(e.getFullYear()),a=e.getMonth();return r?t>=1&&t<=Yt[a]:t>=1&&t<=Gt[a]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends mt{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return Bt(kt,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return $t(t.length,e)}}validate(e,t){return Kt(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends mt{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends mt{priority=90;parse(e,t,r,a){const n=e=>{const t=7*Math.floor((e-1)/7);return(e+a.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return Ft($t(t.length,e),n);case"eo":return Ft(r.ordinalNumber(e,{unit:"day"}),n);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends mt{priority=90;parse(e,t,r,a){const n=e=>{const t=7*Math.floor((e-1)/7);return(e+a.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return Ft($t(t.length,e),n);case"co":return Ft(r.ordinalNumber(e,{unit:"day"}),n);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,a){return(e=Jt(e,r,a)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends mt{priority=90;parse(e,t,r){const a=e=>0===e?7:e;switch(t){case"i":case"ii":return $t(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return Ft(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ft(r.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ft(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a);default:return Ft(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=Qt(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends mt{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends mt{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends mt{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(Zt(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends mt{priority=70;parse(e,t,r){switch(t){case"h":return Bt(_t,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const a=e.getHours()>=12;return a&&r<12?e.setHours(r+12,0,0,0):a||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends mt{priority=70;parse(e,t,r){switch(t){case"H":return Bt(wt,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends mt{priority=70;parse(e,t,r){switch(t){case"K":return Bt(Mt,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends mt{priority=70;parse(e,t,r){switch(t){case"k":return Bt(xt,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return $t(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const a=r<=24?r%24:r;return e.setHours(a,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends mt{priority=60;parse(e,t,r){switch(t){case"m":return Bt(St,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends mt{priority=50;parse(e,t,r){switch(t){case"s":return Bt(jt,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return $t(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends mt{priority=30;parse(e,t){return Ft($t(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends mt{priority=10;parse(e,t){switch(t){case"X":return Vt(Lt,e);case"XX":return Vt(It,e);case"XXXX":return Vt(qt,e);case"XXXXX":return Vt(Ht,e);default:return Vt(Dt,e)}}set(e,t,r){return t.timestampIsSet?e:pe(e,e.getTime()-Me(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends mt{priority=10;parse(e,t){switch(t){case"x":return Vt(Lt,e);case"xx":return Vt(It,e);case"xxxx":return Vt(qt,e);case"xxxxx":return Vt(Ht,e);default:return Vt(Dt,e)}}set(e,t,r){return t.timestampIsSet?e:pe(e,e.getTime()-Me(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends mt{priority=40;parse(e){return Ut(e)}set(e,t,r){return[pe(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends mt{priority=20;parse(e){return Ut(e)}set(e,t,r){return[pe(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},tr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ar=/^'([^]*?)'?$/,nr=/''/g,ir=/\S/,sr=/[a-zA-Z]/;function or(e,t,r,a){const n=Object.assign({},be()),i=a?.locale??n.locale??Oe,s=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;if(""===t)return""===e?fe(r):pe(r,NaN);const h={firstWeekContainsDate:s,weekStartsOn:o,locale:i},l=[new yt],d=t.match(rr).map(e=>{const t=e[0];if(t in Qe){return(0,Qe[t])(e,i.formatLong)}return e}).join("").match(tr),c=[];for(let n of d){!a?.useAdditionalWeekYearTokens&&nt(n)&&it(n,t,e),!a?.useAdditionalDayOfYearTokens&&at(n)&&it(n,t,e);const s=n[0],o=er[s];if(o){const{incompatibleTokens:t}=o;if(Array.isArray(t)){const e=c.find(e=>t.includes(e.token)||e.token===s);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if("*"===o.incompatibleTokens&&c.length>0)throw new RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);c.push({token:s,fullToken:n});const a=o.run(e,n,i.match,h);if(!a)return pe(r,NaN);l.push(a.setter),e=a.rest}else{if(s.match(sr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");if("''"===n?n="'":"'"===s&&(n=hr(n)),0!==e.indexOf(n))return pe(r,NaN);e=e.slice(n.length)}}if(e.length>0&&ir.test(e))return pe(r,NaN);const u=l.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>l.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let f=fe(r);if(isNaN(f.getTime()))return pe(r,NaN);const p={};for(const e of u){if(!e.validate(f,h))return pe(r,NaN);const t=e.set(f,p,h);Array.isArray(t)?(f=t[0],Object.assign(p,t[1])):f=t}return pe(r,f)}function hr(e){return e.match(ar)[1].replace(nr,"'")}const lr=({value:e,onChange:t,min:r,max:n})=>{const i=e=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;try{const t=or(String(e),"yyyy-MM-dd",new Date);return isNaN(t.getTime())?null:t}catch(t){const r=new Date(e);return isNaN(r.getTime())?null:r}},h=e=>e?ct(e,"yyyy-MM-dd"):"",[l,d]=s(i(e?.value)),[c,u]=s("between"===e?.operator?i(e?.secondValue??e?.value):null),[f,p]=s(e?.operator||"between");o(()=>{p(e?.operator||"between"),d(i(e?.value)),u("between"===e?.operator?i(e?.secondValue??e?.value):null)},[e?.value,e?.secondValue,e?.operator]),o(()=>{"between"===f&&!c&&l&&u(l)},[f,l,c]);const y=(e,t,r)=>e?t&&e<t||r&&e>r?null:e:null,m=(e,r=!1)=>{const a=r?l:e,n=r?e:c,i="between"===f&&c?c:b,s=r?y(e,l??g??void 0,b):y(e,g,i);if(r?u(s):d(s),"between"===f)if(a&&n){const e=a>=n?a:n;t({type:"date",value:h(a<=n?a:n),secondValue:h(e),operator:"between"})}else t(null);else t(s?{type:"date",value:h(s),operator:f}:null)},g=a(()=>r?new Date(r):void 0,[r]),b=a(()=>n?new Date(n):void 0,[n]);return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Filter Type"}),_.jsxs("select",{value:f,onChange:e=>(e=>{const r=e;p(r),"between"===r?l&&c&&t({type:"date",value:l<=c?l:c,secondValue:l>=c?l:c,operator:"between"}):l&&t({type:"date",value:l,operator:r})})(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"equals",children:"On Date"}),_.jsx("option",{value:"gt",children:"After"}),_.jsx("option",{value:"gte",children:"On or After"}),_.jsx("option",{value:"lt",children:"Before"}),_.jsx("option",{value:"lte",children:"On or Before"}),_.jsx("option",{value:"between",children:"Between Dates"})]})]}),_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"between"===f?"From Date":"Date"}),_.jsx(ue,{name:"date_filter_start",value:l?ct(l,"yyyy-MM-dd"):null,onChange:e=>m(e?or(e,"yyyy-MM-dd",new Date):null,!1),className:"w-full"})]}),"between"===f&&_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"To Date"}),_.jsx(ue,{name:"date_filter_end",value:c?ct(c,"yyyy-MM-dd"):null,onChange:e=>m(e?or(e,"yyyy-MM-dd",new Date):null,!0),className:"w-full"})]})]})},dr=({value:e,onChange:t,options:r,data:n,columnKey:i})=>{const[h,l]=s(""),[d,c]=s(new Set(e?.value||[]));o(()=>{c(new Set(e?.value||[]))},[e]);const u=a(()=>{let e=[];const t=e=>null==e||""===e||"string"==typeof e&&""===e.trim();if(r&&r.length>0)e=r;else{const r=n.map(e=>{const r=e[i];return t(r)?null:r});e=[...new Set(r)].map(e=>({label:null===e?"Blank":String(e),value:e}))}const a=e.map(e=>{const r=t(e.value);return{...e,label:r?"Blank":e.label,value:r?null:e.value,isBlank:r}});return Array.from(new Map(a.map(e=>[e.isBlank?"__blank__":e.value,e])).values()).sort((e,t)=>e.isBlank&&!t.isBlank?1:!e.isBlank&&t.isBlank?-1:String(e.label).localeCompare(String(t.label)))},[r,n,i]),f=a(()=>{if(!h)return u;const e=h.toLowerCase();return u.filter(t=>t.label.toLowerCase().includes(e)||String(t.value).toLowerCase().includes(e)||"blank"===e&&t.isBlank)},[u,h]);return _.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"relative",children:[_.jsx(re,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),_.jsx("input",{type:"text",value:h,onChange:e=>l(e.target.value),placeholder:"Search options...",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),_.jsxs("div",{className:"flex justify-between items-center text-sm",children:[_.jsxs("span",{className:"text-gray-600",children:[d.size," of ",u.length," selected"]}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx("button",{onClick:()=>{const e=new Set(f.map(e=>e.value));c(e),t({type:"multiselect",value:Array.from(e),operator:"equals"})},className:"text-blue-600 hover:text-blue-800 transition-colors",children:"Select All"}),_.jsx("button",{onClick:()=>{c(new Set),t(null)},className:"text-gray-600 hover:text-gray-800 transition-colors",children:"Clear All"})]})]}),_.jsx("div",{className:"max-h-48 overflow-y-auto border border-gray-200 rounded-md",children:0===f.length?_.jsx("div",{className:"p-3 text-sm text-gray-500 text-center",children:"No options found"}):f.map((e,r)=>{const a=d.has(e.value);return _.jsxs("div",{onClick:()=>(e=>{const r=new Set(d);r.has(e)?r.delete(e):r.add(e),c(r),r.size>0?t({type:"multiselect",value:Array.from(r),operator:"equals"}):t(null)})(e.value),className:"flex items-center gap-3 p-2 cursor-pointer hover:bg-gray-50 transition-colors "+(a?"bg-blue-50":""),children:[_.jsx("div",{className:"w-4 h-4 border-2 rounded flex items-center justify-center "+(a?"bg-blue-600 border-blue-600 text-white":"border-gray-300"),children:a&&_.jsx(P,{className:"w-3 h-3"})}),_.jsx("span",{className:`text-sm ${a?"text-blue-900 font-medium":"text-gray-700"} ${e.isBlank?"italic text-gray-500":""}`,children:e.label})]},r)})})]})},cr=({value:e,onChange:t})=>{const[r,a]=s(void 0!==e?.value?String(e.value):"");return _.jsx("div",{className:"space-y-3",children:_.jsxs("div",{children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Boolean Value"}),_.jsxs("select",{value:r,onChange:e=>{return r=e.target.value,a(r),void t(""===r?null:{type:"boolean",value:"true"===r,operator:"equals"});var r},className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[_.jsx("option",{value:"",children:"All values"}),_.jsx("option",{value:"true",children:"True"}),_.jsx("option",{value:"false",children:"False"})]})]})})},ur=({column:e,data:t,value:r,onChange:n})=>{const i=a(()=>{if("object"==typeof e.filterable)return e.filterable;const r=t.slice(0,100).map(t=>t[e.key]).filter(e=>null!=e);if(0===r.length)return{type:"text"};const a=r[0];if("boolean"==typeof a)return{type:"boolean"};if("number"==typeof a)return{type:"number"};if(a instanceof Date||"string"==typeof a&&!isNaN(Date.parse(a)))return{type:"date"};const n=[...new Set(r)];return n.length<=20?{type:"multiselect",options:n.map(e=>({label:String(e),value:e}))}:{type:"text"}},[e.filterable,e.key,t]);switch(i.type){case"text":return _.jsx(de,{value:r,onChange:n,placeholder:i.placeholder});case"number":return _.jsx(ce,{value:r,onChange:n,min:i.min,max:i.max});case"date":return _.jsx(lr,{value:r,onChange:n,min:i.min,max:i.max});case"multiselect":return _.jsx(dr,{value:r,onChange:n,options:i.options||[],data:t,columnKey:e.key});case"boolean":return _.jsx(cr,{value:r,onChange:n});default:return null}},fr=({pinnedColumns:e,unpinnedColumns:t,hvPadLeft:r=0,hvPadRight:a=0,headerHeight:n,sortConfig:i,columnFilters:h,selectable:l,selectedRows:d,totalRows:c,data:u,onSort:f,onColumnFilter:p,onSelectAll:y,onColumnResize:m,pinnedKeySet:g=new Set,onColumnPin:b,groupable:k=!1,groupedByColumn:v,onGroupBy:w,groupedByColumns:x=[],onGroupToggle:M,onAutosizeColumn:j,onAutosizeAllColumns:C,onResetColumns:A,columnOrder:T,onColumnOrderChange:E,paginationMode:N="client"})=>{const P=[...e,...t],[L,I]=s(null),[q,D]=s(null),[H,F]=s(null),[B,V]=s(0),[U,$]=s(0),[W,Z]=s("menu"),[Y,J]=s(null),[re,ae]=s(!1);o(()=>{ae("ontouchstart"in window||navigator.maxTouchPoints>0||window.matchMedia("(pointer: coarse)").matches)},[]);const[ne,ie]=s(null),[se,he]=s(null),le=d.size===c&&c>0,de=d.size>0&&d.size<c,ce=(e,t)=>{if(t.stopPropagation(),L===e)I(null);else{I(e),Z("menu"),J(h[e]||null);const r=t.currentTarget.getBoundingClientRect(),a=t.currentTarget.closest("[data-grid-container]"),n=a?a.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight),i=320,s=10,o=n.left+s,l=n.right-i-s,d=Math.max(o,Math.min(r.left,l));D({top:r.bottom+4,left:d,containerRect:n})}},ue=e=>{p(e,Y||null),I(null)},fe=e=>null!=h[e],pe=(r,a)=>{a.preventDefault(),F(r),V(a.clientX);const n=[...e,...t].find(e=>e.key===r);$(n?.width||100)},ye=e=>{if(!H||!m)return;const t=e.clientX-B,r=Math.max(50,U+t);m(H,r)},me=()=>{F(null),V(0),$(0)},[ge,be]=s(null),[ke,ve]=s(null),we=(e,t)=>{be(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)},xe=(e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.left+r.width/2,n=t.clientX<a?"before":"after";ve({key:e,position:n})},Me=e=>{const t=ge;if(!t||t===e)return;if(g.has(t)!==g.has(e))return be(null),void ve(null);const r=ke?.key!==e||"before"===ke?.position,a=T.filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return E(a),be(null),void ve(null);r||(n+=1),a.splice(n,0,t);E(a),be(null),ve(null)},_e=()=>{be(null),ve(null)},Se=(e,t)=>{ie(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)},je=(e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.top+r.height/2,n=t.clientY<a?"before":"after";he({key:e,position:n})},Ce=e=>{const t=ne;if(!t||t===e)return;if(g.has(t)!==g.has(e))return ie(null),void he(null);const r=se?.key!==e||"before"===se?.position,a=T.filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return E(a),ie(null),void he(null);r||(n+=1),a.splice(n,0,t),E(a),ie(null),he(null)},Ae=()=>{ie(null),he(null)};return o(()=>{if(H)return document.addEventListener("mousemove",ye),document.addEventListener("mouseup",me),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",me),document.body.style.cursor="",document.body.style.userSelect=""}},[H,B,U,m]),o(()=>{const e=e=>{const t=e.target;L&&!t.closest("[data-column-menu]")&&I(null)};if(L)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[L]),_.jsx(_.Fragment,{children:_.jsx("div",{className:"bg-blue-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",style:{height:n},role:"row","aria-label":"Column headers",children:_.jsxs("div",{className:"flex h-full",children:[l&&_.jsx("div",{className:"px-3 border-r border-gray-200 dark:border-gray-700 flex items-center justify-center bg-blue-50 dark:bg-gray-800 sticky left-0 z-3 h-full",style:{width:S,height:n},role:"columnheader","aria-label":"Select all rows",children:_.jsx("input",{type:"checkbox",checked:le,ref:e=>{e&&(e.indeterminate=de)},onChange:y,onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),y())},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 h-4 w-4 transition-all duration-150","aria-label":le?"Deselect all rows":de?`${d.size} rows selected. Click to select all`:"Select all rows",title:le?`Deselect all ${c} rows`:de?`${d.size} of ${c} rows selected`:`Select all ${c} rows`})}),e.map((t,r)=>{const a=g.has(t.key),s=e.filter(e=>g.has(e.key)).map(e=>e.key),o=s.indexOf(t.key),h=a?s.slice(0,o).reduce((t,r)=>{const a=e.find(e=>e.key===r);return t+(a?.width||100)},l?S:0):0,d="center"===t.headerAlign?"justify-center":"right"===t.headerAlign?"justify-end":"justify-start",c=!1!==t.sortable;return _.jsxs("div",{className:`flex-none border-r border-gray-200 dark:border-gray-700 last:border-r-0 relative ${a?"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-700 sticky z-2":""} `,style:{width:t.width||100,left:a?`${h}px`:"auto",height:n},"data-column-key":t.key,draggable:!0,onDragStart:e=>we(t.key,e),onDragOver:e=>xe(t.key,e),onDrop:()=>Me(t.key),onDragEnd:_e,children:[ke?.key===t.key&&_.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 z-4",style:{left:"before"===ke?.position?0:void 0,right:"after"===ke?.position?0:void 0}}),_.jsx("div",{className:"px-3 h-full",children:_.jsxs("div",{className:"flex items-center justify-between gap-1 group h-full",children:[_.jsxs("div",{className:`flex items-center min-w-0 flex-1 ${d} ${c?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>c&&f(t.key),children:[_.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[fe(t.key)&&_.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full shrink-0",title:"Filter applied"}),_.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 text-sm truncate min-w-0",children:t.header})]}),c&&i.key===t.key&&_.jsx("div",{className:"ml-1 shrink-0 pointer-events-none select-none",children:"asc"===i.direction?_.jsx(O,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"}):_.jsx(z,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"})})]}),(t.filterable||b||k)&&_.jsxs("div",{className:"relative "+(L===t.key||re?"block":"hidden group-hover:block"),"data-column-menu":!0,children:[_.jsx("button",{className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded shrink-0",onClick:e=>ce(t.key,e),"data-menu-trigger":!0,children:_.jsx(Q,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),L===t.key&&q&&_.jsxs("div",{className:"fixed bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg z-1000 w-[320px] overflow-auto",style:{top:`${q.top}px`,left:`${q.left}px`,maxHeight:`${Math.max(160,q.containerRect.bottom-12-q.top)}px`},"data-column-menu":!0,children:[_.jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700",children:[_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("menu"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("menu"),children:_.jsx(Q,{className:"w-4 h-4"})}),t.filterable&&_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("filter"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("filter"),children:_.jsx(K,{className:"w-4 h-4"})}),_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("reorder"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("reorder"),children:_.jsx(R,{className:"w-4 h-4"})})]}),"menu"===W&&_.jsxs("div",{className:"py-1",children:[b&&(v===t.key?_.jsxs("div",{className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 text-blue-600",children:[_.jsx(te,{className:"w-4 h-4"}),"Pinned by grouping"]}):_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:e=>{e.stopPropagation(),I(null),b?.(t.key,!g.has(t.key))},children:g.has(t.key)?_.jsxs(_.Fragment,{children:[_.jsx(ee,{className:"w-4 h-4"}),"Unpin Column"]}):_.jsxs(_.Fragment,{children:[_.jsx(te,{className:"w-4 h-4"}),"Pin Column"]})})),j&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{j?.(t.key),I(null)},children:"Autosize This Column"}),C&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{C?.(),I(null)},children:"Autosize All Columns"}),k&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:e=>{e.stopPropagation(),I(null);const r=x?.includes(t.key)||v===t.key;M?M(t.key,!r):w?.(r?null:t.key)},children:v===t.key||x?.includes(t.key)?_.jsxs(_.Fragment,{children:[_.jsx(oe,{className:"w-4 h-4"}),"Ungroup"]}):_.jsxs(_.Fragment,{children:[_.jsx(G,{className:"w-4 h-4"}),"Group by ",t.header]})}),A&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{A?.(),I(null)},children:"Reset Columns"})]}),"filter"===W&&_.jsxs("div",{className:"p-3 w-full",children:[fe(t.key)&&_.jsxs("button",{className:"mb-2 text-xs text-red-600 hover:underline flex items-center gap-1",onClick:()=>{J(null),p(t.key,null),I(null)},children:[_.jsx(X,{className:"w-3 h-3"})," Clear Filter"]}),_.jsx("div",{className:"max-h-75 overflow-auto pr-1",children:_.jsx(ur,{column:t,data:u,value:Y,onChange:e=>{J(e),"server"!==N&&p(t.key,e)}})}),"server"===N?_.jsxs("div",{className:"flex justify-end gap-2 mt-3",children:[_.jsx("button",{className:"px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200",onClick:()=>I(null),children:"Cancel"}),_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>ue(t.key),children:"Apply"})]}):_.jsx("div",{className:"flex justify-end mt-3",children:_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>I(null),children:"Close"})})]}),"reorder"===W&&_.jsxs("div",{className:"px-3 py-2",children:[_.jsx("div",{className:"text-xs font-medium text-gray-500 mb-1",children:"Reorder Columns"}),_.jsx("div",{className:"max-h-60 overflow-auto border border-gray-200 rounded-md",children:[...T.map(e=>P.find(t=>t.key===e)).filter(Boolean),...P.filter(e=>!T.includes(e.key))].map(e=>{const t=g.has(e.key);return _.jsxs("div",{className:`flex items-center justify-between px-2 py-1 text-sm bg-white hover:bg-gray-50 border-b last:border-b-0 relative ${ne===e.key?"opacity-60":""} ${t?"bg-blue-50/40":""}`,draggable:!0,onDragStart:t=>Se(e.key,t),onDragOver:t=>je(e.key,t),onDrop:()=>Ce(e.key),onDragEnd:Ae,children:[se?.key===e.key&&_.jsx("div",{className:"absolute left-0 right-0 h-0.5 bg-blue-600",style:{top:"before"===se?.position?0:void 0,bottom:"after"===se?.position?0:void 0}}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-gray-400 select-none",children:"⋮⋮"}),_.jsxs("span",{className:"text-gray-800 truncate max-w-45",children:[e.header,t&&_.jsx("span",{className:"ml-1 text-[10px] text-blue-600",children:"(pinned)"})]})]})]},e.key)})}),_.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Tip: You can only reorder within pinned or unpinned groups."})]})]})]})]})}),r<e.length-1&&m&&_.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-300 transition-colors group",onMouseDown:e=>pe(t.key,e),onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),j?.(t.key)},title:"Drag to resize • Double‑click to autosize",children:_.jsx("div",{className:"w-full h-full group-hover:bg-blue-400"})})]},t.key+r)}),r>0&&_.jsx("div",{style:{width:r,height:n},className:"flex-none"}),t.map((e,r)=>{const a="center"===e.headerAlign?"justify-center":"right"===e.headerAlign?"justify-end":"justify-start",s=!1!==e.sortable;return _.jsxs("div",{className:"flex-none border-r border-gray-200 dark:border-gray-700 last:border-r-0 relative",style:{width:e.width||100,height:n},"data-column-key":e.key,draggable:!0,onDragStart:t=>we(e.key,t),onDragOver:t=>xe(e.key,t),onDrop:()=>Me(e.key),onDragEnd:_e,children:[ke?.key===e.key&&_.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 z-4",style:{left:"before"===ke?.position?0:void 0,right:"after"===ke?.position?0:void 0}}),_.jsx("div",{className:"px-3 h-full",children:_.jsxs("div",{className:"flex items-center justify-between gap-1 group h-full",children:[_.jsxs("div",{className:`flex items-center min-w-0 flex-1 ${a} ${s?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>s&&f(e.key),children:[_.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[fe(e.key)&&_.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full shrink-0",title:"Filter applied"}),_.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 text-sm truncate min-w-0",children:e.header})]}),s&&i.key===e.key&&_.jsx("div",{className:"ml-1 shrink-0 pointer-events-none select-none",children:"asc"===i.direction?_.jsx(O,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"}):_.jsx(z,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"})})]}),(e.filterable||b||k)&&_.jsxs("div",{className:"relative "+(L===e.key||re?"block":"hidden group-hover:block"),"data-column-menu":!0,children:[_.jsx("button",{className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded shrink-0",onClick:t=>ce(e.key,t),"data-menu-trigger":!0,children:_.jsx(Q,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),L===e.key&&q&&_.jsxs("div",{className:"fixed bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg z-10 w-[320px] overflow-auto",style:{top:`${q.top}px`,left:`${q.left}px`,maxHeight:`${Math.max(160,q.containerRect.bottom-12-q.top)}px`},"data-column-menu":!0,children:[_.jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700",children:[_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("menu"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("menu"),children:_.jsx(Q,{className:"w-4 h-4"})}),e.filterable&&_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("filter"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("filter"),children:_.jsx(K,{className:"w-4 h-4"})}),_.jsx("button",{className:"px-3 py-2 text-sm flex items-center gap-2 "+("reorder"===W?"border-b-2 border-blue-600 text-blue-600":"text-gray-600"),onClick:()=>Z("reorder"),children:_.jsx(R,{className:"w-4 h-4"})})]}),"menu"===W&&_.jsxs("div",{className:"py-1",children:[b&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:t=>{t.stopPropagation(),I(null);const r=!g.has(e.key);b?.(e.key,r)},children:g.has(e.key)?_.jsxs(_.Fragment,{children:[_.jsx(ee,{className:"w-4 h-4"}),"Unpin Column"]}):_.jsxs(_.Fragment,{children:[_.jsx(te,{className:"w-4 h-4"}),"Pin Column"]})}),j&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{j?.(e.key),I(null)},children:"Autosize This Column"}),C&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{C?.(),I(null)},children:"Autosize All Columns"}),k&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 flex items-center gap-2",onClick:t=>{t.stopPropagation(),I(null);const r=x?.includes(e.key)||v===e.key;M?M(e.key,!r):w?.(r?null:e.key)},children:v===e.key||x?.includes(e.key)?_.jsxs(_.Fragment,{children:[_.jsx(oe,{className:"w-4 h-4"}),"Ungroup"]}):_.jsxs(_.Fragment,{children:[_.jsx(G,{className:"w-4 h-4"}),"Group by ",e.header]})}),A&&_.jsx("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50",onClick:()=>{A?.(),I(null)},children:"Reset Columns"})]}),"filter"===W&&_.jsxs("div",{className:"p-3 w-full",children:[_.jsx("div",{className:"max-h-75 overflow-auto pr-1",children:_.jsx(ur,{column:e,data:u,value:Y,onChange:t=>{J(t),"server"!==N&&p(e.key,t)}})}),_.jsxs("div",{className:"flex justify-end gap-2 mt-3",children:[fe(e.key)&&_.jsxs("button",{className:"px-3 py-1.5 text-sm bg-red-500 text-white rounded-md hover:bg-red-600 flex items-center gap-2 cursor-pointer",onClick:()=>{J(null),p(e.key,null),I(null)},children:[_.jsx(X,{className:"w-3 h-3"})," Clear Filter"]}),_.jsx("button",{className:"px-3 py-1.5 text-sm bg-green-100 text-green-700 rounded-md hover:bg-green-200 cursor-pointer",onClick:()=>I(null),children:"Apply"}),"server"===N&&_.jsx("button",{className:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",onClick:()=>ue(e.key),children:"Apply"})]})]}),"reorder"===W&&_.jsxs("div",{className:"px-3 py-2",children:[_.jsx("div",{className:"text-xs font-medium text-gray-500 mb-1",children:"Reorder Columns"}),_.jsx("div",{className:"max-h-60 overflow-auto border border-gray-200 rounded-md",children:[...T.map(e=>P.find(t=>t.key===e)).filter(Boolean),...P.filter(e=>!T.includes(e.key))].map(e=>{const t=g.has(e.key);return _.jsxs("div",{className:`flex items-center justify-between px-2 py-1 text-sm bg-white hover:bg-gray-50 border-b last:border-b-0 relative ${ne===e.key?"opacity-60":""} ${t?"bg-blue-50/40":""}`,draggable:!0,onDragStart:t=>Se(e.key,t),onDragOver:t=>je(e.key,t),onDrop:()=>Ce(e.key),onDragEnd:Ae,children:[se?.key===e.key&&_.jsx("div",{className:"absolute left-0 right-0 h-0.5 bg-blue-600",style:{top:"before"===se?.position?0:void 0,bottom:"after"===se?.position?0:void 0}}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-gray-400 select-none",children:"⋮⋮"}),_.jsxs("span",{className:"text-gray-800 truncate max-w-45",children:[e.header,t&&_.jsx("span",{className:"ml-1 text-[10px] text-blue-600",children:"(pinned)"})]})]})]},e.key)})}),_.jsx("div",{className:"text-[10px] text-gray-400 mt-1",children:"Tip: You can only reorder within pinned or unpinned groups."})]})]})]})]})}),r<t.length-1&&m&&_.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-300 transition-colors group",onMouseDown:t=>pe(e.key,t),onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),j?.(e.key)},title:"Drag to resize • Double‑click to autosize",children:_.jsx("div",{className:"w-full h-full group-hover:bg-blue-400"})})]},e.key+r)}),a>0&&_.jsx("div",{style:{width:a,height:n},className:"flex-none"})]})})})},pr=r(({data:e,columns:t,selectedRows:r,virtualized:n,virtualizedRange:i,rowHeight:s,selectable:o,isRowSelectable:h,onRowSelect:l,pinnedColumns:d=new Set,hvPadLeft:c=0,hvPadRight:u=0,rowStyle:f,globalFilter:p,onContextMenu:y,onRowDoubleClick:m,onRowClick:g,onCellClick:b,isCellFocused:k,isCellSelected:v,onCellContextMenu:w,onCellMouseDown:x,onCellMouseEnter:M,getRowId:j})=>{const C=a(()=>e.length*s,[e.length,s]),{leftOffsetByPinnedKey:A}=a(()=>{if(0===d.size)return{leftOffsetByPinnedKey:new Map};const e=t.filter(e=>d.has(e.key)).map(e=>e.key),r=new Map;for(const e of t)r.set(e.key,e.width||100);const a=new Map;let n=o?S:0;for(const t of e)a.set(t,n),n+=r.get(t)||100;return{leftOffsetByPinnedKey:a}},[t,d,o]),T=a(()=>t.reduce((e,t)=>e+(d.has(t.key)?1:0),0),[t,d]);return _.jsx("div",{style:{height:n?`${C}px`:"auto",position:"relative"},children:_.jsx("div",{style:{transform:n?`translate3d(0, ${i.offsetY}px, 0)`:"none",position:n?"absolute":"static",top:0,left:0,right:0},children:e.map((e,a)=>{const C=n?i.startIndex+a:a,E=f?.(e),N=((e,t)=>j?j(e):void 0!==e.id?e.id:("development"===process.env.NODE_ENV&&0===t&&console.warn("[CustomDataGrid] No row IDs found. Either:\n 1. Add 'id' property to each row object, or\n 2. Provide 'getRowId' prop to extract a unique identifier.\n Using row index as fallback ID, but this may cause issues with pagination/filtering."),t??0))(e,C),z=C%2==0?"bg-white dark:bg-gray-900":"bg-gray-25 dark:bg-gray-800",R=r.has(N)?"bg-blue-50 dark:bg-blue-900/20":"";return _.jsxs("div",{className:`flex border-b border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 ${R||(E?"":z)}`,style:{height:`${s}px`,...E},onContextMenu:t=>((e,t)=>{e.preventDefault(),y?.(t,e)})(t,e),onDoubleClick:t=>((e,t)=>{m?.(t,e)})(t,e),onClick:t=>((e,t)=>{g?.(t,e)})(t,e),children:[o&&_.jsx("div",{className:"flex items-center justify-center sticky left-0 bg-white dark:bg-gray-900 z-2 border-r border-gray-200 dark:border-gray-700",style:{width:S},children:_.jsx("input",{type:"checkbox",checked:r.has(N),disabled:!!h&&!h(e),onChange:e=>l(N,e.target.checked),onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),l(N,!r.has(N)))},className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 h-4 w-4 transition-all duration-150","aria-label":`Select row ${N}`,tabIndex:0})}),t.map((t,r)=>{const a=d.has(t.key),n=a&&A.get(t.key)||0,i=e[t.key];let s,o;if(t.cellRenderer?(s=t.cellRenderer(i,e),"string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i||(o=String(i))):t.formatter?(s=t.formatter(i),o=String(s)):(s=i??"",o=s?String(s):void 0),p&&p.trim()&&!t.cellRenderer&&s){const e=String(s);((e,t)=>{if(!t||null==e)return!1;const r=t.toLowerCase().trim();return!!r&&String(e).toLowerCase().includes(r)})(e,p)&&(s=((e,t)=>{if(!t||!e)return e;const r=t.toLowerCase().trim(),a=e.toLowerCase();if(!r||!a.includes(r))return e;const n=[];let i=0,s=0,o=0;for(;-1!==(s=a.indexOf(r,i));)s>i&&n.push(e.slice(i,s)),n.push(_.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-600/40 text-current font-medium px-0.5 py-0 rounded-sm",style:{margin:0},children:e.slice(s,s+r.length)},"highlight-"+o++)),i=s+r.length;return i<e.length&&n.push(e.slice(i)),_.jsx(_.Fragment,{children:n})})(e,p))}o&&0===o.trim().length&&(o=void 0);const h="center"===t.align?"text-center":"right"===t.align?"text-right":"text-left",l="center"===t.align?"justify-center":"right"===t.align?"justify-end":"justify-start",u=t.noPadding?"p-0":"p-3",f="function"==typeof t.className?t.className(i,e):t.className||"",y="function"==typeof t.cellStyle?t.cellStyle(i,e):t.cellStyle||void 0,m=_.jsxs("div",{className:`border-r border-gray-200 last:border-r-0 ${u} text-sm flex items-center ${v?.(N,t.key)?"bg-blue-100/60 dark:bg-blue-900/30":""} ${a?k?.(N,t.key)?"sticky z-2 bg-inherit":"sticky z-1 bg-inherit":""} ${k?.(N,t.key)?"relative":""} ${h} ${l} ${f}`,style:{width:`${t.width||100}px`,left:a?`${n}px`:"auto",...y},title:o,onClick:r=>((e,t,r,a)=>{b?.({row:t,column:r,value:a,event:e})})(r,e,t,e[t.key]),onContextMenu:r=>{e._isGroupHeader||e._isGroupFooter||w&&(r.preventDefault(),r.stopPropagation(),w({row:e,column:t,value:e[t.key],displayValue:o??"",event:r}))},onMouseDown:r=>x?.({row:e,column:t,event:r}),onMouseEnter:r=>M?.({row:e,column:t,event:r}),children:[k?.(N,t.key)&&_.jsx("div",{className:"pointer-events-none absolute inset-0 border border-blue-400"}),!1===t.wrapCellContent?_.jsx(_.Fragment,{children:s}):_.jsx("div",{className:"truncate w-full",children:s})]},`${t.key}-${r}`);return c>0&&r===T?_.jsxs(_.Fragment,{children:[_.jsx("div",{style:{width:c},className:"flex-none"}),m]}):m}),u>0&&_.jsx("div",{style:{width:u},className:"flex-none"})]},`${N}-${C}`)})})})},(e,t)=>{if(e.rowHeight!==t.rowHeight)return!1;if(e.selectable!==t.selectable)return!1;if(e.virtualized!==t.virtualized)return!1;if(e.globalFilter!==t.globalFilter)return!1;if(e.virtualizedRange.startIndex!==t.virtualizedRange.startIndex)return!1;if(e.virtualizedRange.endIndex!==t.virtualizedRange.endIndex)return!1;if(e.virtualizedRange.offsetY!==t.virtualizedRange.offsetY)return!1;if(e.isCellSelected!==t.isCellSelected)return!1;if(e.isCellFocused!==t.isCellFocused)return!1;if(e.onCellMouseDown!==t.onCellMouseDown)return!1;if(e.onCellMouseEnter!==t.onCellMouseEnter)return!1;if(e.getRowId!==t.getRowId)return!1;if(e.selectedRows.size!==t.selectedRows.size)return!1;if(e.pinnedColumns?.size!==t.pinnedColumns?.size)return!1;if(e.columns.map(e=>e.key).join("|")!==t.columns.map(e=>e.key).join("|"))return!1;if(e.data.length!==t.data.length)return!1;const r=(e,t,r)=>r?r(e):void 0!==e.id?e.id:t,a=e.data.length>0?r(e.data[0],0,e.getRowId):void 0,n=t.data.length>0?r(t.data[0],0,t.getRowId):void 0,i=e.data.length-1,s=t.data.length-1,o=e.data.length>0?r(e.data[i],i,e.getRowId):void 0,h=t.data.length>0?r(t.data[s],s,t.getRowId):void 0;return a===n&&o===h}),yr=({columns:e,groupedKeys:t,onRemove:r,onReorder:a,onDropColumnKey:n,onToggleExpandAll:i,isAnyExpanded:o=!1})=>{const[h,l]=s(null),[d,c]=s(null),[u,f]=s(!0),p=t=>e.find(e=>e.key===t)?.header||t,y=e=>t=>{l(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("application/x-group-key",e)},m=e=>t=>{t.preventDefault();const r=t.currentTarget.getBoundingClientRect(),a=t.clientX<r.left+r.width/2;c(e),f(a)};return _.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gray-50 border-b border-gray-200 text-sm",onDrop:e=>{e.preventDefault();const r=e.dataTransfer.getData("text/plain");r&&(t.includes(r)||n(r))},onDragOver:e=>{e.preventDefault()},onDragEnd:()=>{l(null),c(null)},children:[_.jsx("span",{className:"text-gray-600 whitespace-nowrap",children:"Group by:"}),t.length>0&&_.jsx("button",{type:"button",className:"ml-1 px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-100",title:o?"Collapse all groups":"Expand all groups",onClick:e=>{e.preventDefault(),e.stopPropagation(),i?.()},children:o?"Collapse All":"Expand All"}),0===t.length&&_.jsx("span",{className:"text-gray-400",children:"Drag a column here"}),_.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map(e=>{return _.jsxs("div",{className:"inline-flex items-center gap-2 bg-blue-100 text-blue-800 px-2 py-1 rounded-md border border-blue-200 cursor-move relative",draggable:!0,onDragStart:y(e),onDragOver:m(e),onDrop:(n=e,()=>{if(!h||h===n)return l(null),void c(null);const e=t.filter(e=>e!==h),r=e.indexOf(n);-1!==r&&(u?e.splice(r,0,h):e.splice(r+1,0,h),a(e),l(null),c(null))}),title:p(e),children:[_.jsx("span",{className:"text-xs font-medium truncate max-w-[160px]",children:p(e)}),_.jsx("button",{className:"text-blue-700 hover:text-blue-900",onClick:()=>r(e),"aria-label":`Remove grouping ${p(e)}`,children:"×"}),d===e&&_.jsx("span",{className:"absolute top-0 bottom-0 w-0.5 bg-blue-600 dark:bg-blue-400 animate-pulse",style:{left:u?0:void 0,right:u?void 0:0},"aria-hidden":"true"})]},e);var n})})]})},mr=r(({row:e,isExpanded:t,onToggle:r,viewportWidth:a,selectable:n,rowHeight:i=40,getHeaderLabel:s,getValueLabel:o,renderGroupActions:h})=>{const l=()=>{e._groupKey&&r(e._groupKey)};return _.jsxs("div",{className:"flex items-center bg-blue-50 dark:bg-blue-900/20 border-b border-gray-200 dark:border-gray-800 hover:bg-blue-100/70 cursor-pointer sticky left-0 z-20 overflow-hidden",style:{minWidth:`${a+(n?S:0)}px`,height:`${i}px`},onClick:l,role:"button",tabIndex:0,"aria-expanded":t,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l())},children:[n&&_.jsx("div",{className:"w-12 flex items-center justify-center"}),_.jsxs("div",{className:"flex items-center px-4 py-2 flex-1",children:[_.jsx("div",{className:"flex items-center mr-3",style:{paddingLeft:(e._groupLevel?16*e._groupLevel:0)+"px"},children:t?_.jsx(L,{className:"w-4 h-4 text-gray-600"}):_.jsx(q,{className:"w-4 h-4 text-gray-600"})}),_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs("span",{className:"font-medium text-gray-900",children:[e._groupColumnKey?`${s?s(e._groupColumnKey):e._groupColumnKey}: `:"",o&&e._groupColumnKey?o(e._groupColumnKey,e._groupValue):e._groupValue??(e._groupKey||"Unknown")]}),_.jsxs("span",{className:"text-sm text-gray-600 bg-gray-200/70 px-2 py-1 rounded-full",children:[e._groupCount," ",1===e._groupCount?"item":"items"]})]}),h&&_.jsx("div",{className:"flex items-center px-4",onClick:e=>e.stopPropagation(),children:h({groupKey:e._groupKey||"",columnKey:e._groupColumnKey||"",groupValue:e._groupValue,rows:e._groupRows||[],count:e._groupCount||0,level:e._groupLevel||0})})]})]})}),gr=({hasFilters:e=!1,hasData:t=!0,message:r})=>{const{title:a,description:n,icon:i}=r?{title:r,description:"",icon:B}:t?e?{title:"No Results Found",description:"No data matches your current search criteria. Try adjusting your filters.",icon:re}:{title:"No Data to Display",description:"There are no items to show at the moment.",icon:B}:{title:"No Data Available",description:"There is no data to display in this table.",icon:B};return _.jsxs("div",{className:"flex flex-col items-center justify-center pt-16 pb-10 px-4 text-center",children:[_.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center mb-4",children:_.jsx(i,{className:"w-8 h-8 text-gray-400 dark:text-gray-500"})}),_.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:a}),_.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 max-w-md",children:n})]})},br=({paginationConfig:e,currentPage:t,isServerLoading:r,selectedRowsCount:a,totalDataLength:n,filteredDataLength:i,paginationMode:s="client",onPageChange:o,onPageSizeChange:h})=>{const{start:l,end:d,total:c}=(()=>{const r=e.enabled||"server"===s?e.totalRows||n:i||n;return{start:e.enabled?Math.min((t-1)*e.pageSize+1,r):1,end:e.enabled?Math.min(t*e.pageSize,r):r,total:r}})(),u="client"===s&&i&&i!==n;return _.jsx("div",{className:"px-3 sm:px-6 py-2 border-t border-gray-200 dark:border-gray-700 bg-linear-to-r from-white via-gray-50 to-white dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:_.jsxs("div",{className:"flex flex-col xl:flex-row gap-4 xl:gap-6 xl:justify-between xl:items-center",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 items-start sm:items-center",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[!e.enabled&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold bg-linear-to-r from-blue-500 to-blue-600 text-white shadow-lg ring-2 ring-blue-500/20",children:[_.jsx(B,{className:"w-3 h-3"}),_.jsxs("span",{className:"font-bold",children:[c.toLocaleString()," ",1===c?"Record":"Records"]}),u&&_.jsxs("span",{className:"text-blue-100 font-normal",children:["(of ",n.toLocaleString(),")"]})]}),a>0&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold bg-linear-to-r from-primary to-primary text-white shadow-lg ring-2 ring-primary/20",children:[_.jsx(he,{className:"w-3 h-3"}),_.jsxs("span",{children:[a.toLocaleString()," selected"]})]}),u&&_.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-linear-to-r from-warning/10 to-warning/5 text-warning border border-warning/20",children:[_.jsx(W,{className:"w-3 h-3"}),_.jsx("span",{children:"Filtered"})]}),e.enabled&&_.jsx("div",{className:"hidden sm:block text-sm text-gray-600 dark:text-gray-400 font-medium",children:_.jsxs("span",{className:"inline-flex items-center gap-1",children:[_.jsx("span",{children:"Showing"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:l.toLocaleString()}),_.jsx("span",{children:"-"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:d.toLocaleString()}),_.jsxs("span",{children:["of ",c.toLocaleString()]})]})})]}),e.enabled&&e.showPageSizeSelector&&_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 whitespace-nowrap",children:"Rows per page:"}),_.jsx("select",{value:e.pageSize,onChange:e=>h(Number(e.target.value)),className:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-xl px-3 py-1 text-sm font-medium focus:ring-2 focus:ring-primary focus:border-primary disabled:opacity-50 disabled:cursor-not-allowed shadow-sm transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500",disabled:r,children:e.pageSizeOptions?.map(e=>_.jsx("option",{value:e,children:e},e))})]})]}),e.enabled&&_.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-3 sm:gap-4",children:[r&&_.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-blue-50 dark:bg-blue-900/20 rounded-full border border-blue-200 dark:border-blue-800",children:[_.jsx(Y,{className:"w-4 h-4 animate-spin text-primary"}),_.jsx("span",{className:"text-sm font-medium text-primary",children:"Loading..."})]}),_.jsx("div",{className:"sm:hidden text-sm text-gray-600 dark:text-gray-400 font-medium",children:_.jsxs("div",{className:"flex flex-col gap-1",children:[_.jsxs("span",{className:"inline-flex items-center gap-1",children:[_.jsx("span",{children:"Page"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:t.toLocaleString()}),_.jsx("span",{children:"of"}),_.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md font-bold text-gray-900 dark:text-gray-100",children:e.totalPages.toLocaleString()})]}),_.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[l.toLocaleString()," - ",d.toLocaleString()," of"," ",c.toLocaleString()]})]})}),_.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[_.jsx("button",{onClick:()=>o(1,e.pageSize),disabled:1===t||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"First page","aria-label":"Go to first page",children:_.jsx(D,{className:"w-3.5 h-3.5"})}),_.jsx("button",{onClick:()=>o(t-1,e.pageSize),disabled:1===t||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Previous page","aria-label":"Go to previous page",children:_.jsx(I,{className:"w-3.5 h-3.5"})}),_.jsx("div",{className:"sm:hidden",children:_.jsx("select",{value:t,onChange:t=>o(Number(t.target.value),e.pageSize),className:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-xl px-3 py-2 text-sm font-medium focus:ring-2 focus:ring-primary focus:border-primary disabled:opacity-50 disabled:cursor-not-allowed shadow-sm min-w-[80px]",disabled:r,"aria-label":"Select page",children:Array.from({length:e.totalPages},(e,t)=>t+1).map(e=>_.jsx("option",{value:e,children:e},e))})}),_.jsx("div",{className:"hidden sm:flex items-center gap-1 mx-2",children:(()=>{const a=[],n=e.totalPages,i=t,s="undefined"!=typeof window&&window.innerWidth>=768?7:5;if(n<=s)for(let e=1;e<=n;e++)a.push(e);else{const e=Math.floor(s/2)-1;if(i<=e+1){for(let e=1;e<=s-2;e++)a.push(e);a.push("ellipsis1"),a.push(n)}else if(i>=n-e){a.push(1),a.push("ellipsis1");for(let e=n-(s-3);e<=n;e++)a.push(e)}else{a.push(1),a.push("ellipsis1");for(let t=i-e;t<=i+e;t++)a.push(t);a.push("ellipsis2"),a.push(n)}}return a.map(t=>{if("string"==typeof t)return _.jsx("div",{className:"flex items-center justify-center w-8 h-8 text-gray-400 dark:text-gray-500 select-none","aria-hidden":"true",children:_.jsx("span",{className:"text-lg leading-none",children:"⋯"})},t);const a=t===i;return _.jsx("button",{onClick:()=>o(t,e.pageSize),disabled:r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full text-sm font-semibold transition-all duration-200 focus:ring-2 focus:ring-primary/20 focus:outline-none cursor-pointer "+(a?"bg-linear-to-r from-primary to-primary text-white shadow-lg ring-2 ring-primary/20 transform scale-105 z-10 relative":"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md disabled:opacity-40 disabled:cursor-not-allowed"),"aria-label":`Go to page ${t}`,"aria-current":a?"page":void 0,children:t},t)})})()}),_.jsx("button",{onClick:()=>o(t+1,e.pageSize),disabled:t===e.totalPages||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Next page","aria-label":"Go to next page",children:_.jsx(q,{className:"w-3.5 h-3.5"})}),_.jsx("button",{onClick:()=>o(e.totalPages,e.pageSize),disabled:t===e.totalPages||r,className:"inline-flex items-center justify-center w-8 h-8 rounded-full border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-all duration-200 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md focus:ring-2 focus:ring-primary/20 focus:border-primary",title:"Last page","aria-label":"Go to last page",children:_.jsx(H,{className:"w-3.5 h-3.5"})})]})]})]})})},kr=({options:e,value:t,placeholder:r="Select an option...",onChange:a,searchable:n=!0,className:i=""})=>{const[l,d]=s(!1),[c,u]=s(""),[f,p]=s(-1),y=h(null),m=h(null),g=h(null),b=e.find(e=>e.value===t),k=n?e.filter(e=>e.label?.toLowerCase()?.includes(c?.toLowerCase())):e;o(()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&(d(!1),u(""),p(-1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),o(()=>{const e=e=>{if(l)switch(e.key){case"ArrowDown":e.preventDefault(),p(e=>e<k.length-1?e+1:0);break;case"ArrowUp":e.preventDefault(),p(e=>e>0?e-1:k.length-1);break;case"Enter":e.preventDefault(),f>=0&&k[f]&&v(k[f].value);break;case"Escape":d(!1),u(""),p(-1)}};if(l)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l,f,k]),o(()=>{if(f>=0&&g.current){const e=g.current.children[f];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[f]);const v=e=>{a(e),d(!1),u(""),p(-1)};return _.jsxs("div",{className:`relative ${i}`,ref:y,children:[_.jsx("div",{className:"relative w-full cursor-pointer border border-gray-300 rounded-lg bg-white transition-all duration-200 "+(l?"ring-2 ring-blue-500 border-blue-500":"hover:border-gray-400 focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500"),onClick:()=>{d(!l),n&&!l&&setTimeout(()=>m.current?.focus(),0)},children:_.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5",children:[n&&l?_.jsx("input",{ref:m,type:"text",className:"flex-1 outline-none text-sm bg-transparent",placeholder:`Search ${r?.toLowerCase()}...`,value:c,onChange:e=>{u(e.target.value),p(-1),l||d(!0)},onClick:e=>e.stopPropagation()}):_.jsx("span",{className:"flex-1 text-sm truncate "+(b?"text-gray-900":"text-gray-500"),children:b?b.label:r}),_.jsx(L,{className:"w-4 h-4 text-gray-400 transition-transform duration-200 "+(l?"rotate-180":"")})]})}),l&&_.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-99999 max-h-80 overflow-hidden",children:k.length>0?_.jsx("ul",{ref:g,className:"py-1 overflow-y-auto max-h-80",children:k.map((e,t)=>_.jsxs("li",{className:"px-3 py-2 text-sm cursor-pointer flex items-center justify-between transition-colors "+(t===f?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-50"),onClick:()=>v(e.value),onMouseEnter:()=>p(t),children:[_.jsx("span",{className:"truncate",children:e.label}),b?.value===e.value&&_.jsx(P,{className:"w-4 h-4 text-blue-600 shrink-0 ml-2"})]},e.value))}):_.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 text-center",children:"No options found"})})]})},vr=({columns:e,columnFilters:t,onColumnFilter:r})=>{const a=e.filter(e=>e.filterable),[n,i]=s(a.length>0?a[0].key:""),[h,l]=s(""),d=a.map(e=>({label:e.header,value:e.key})),c=a.find(e=>e.key===n);o(()=>{l("")},[n]);return _.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{children:[_.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select Column to Filter"}),_.jsx(kr,{options:d,value:n,placeholder:"Choose a column...",onChange:e=>{i(e)},searchable:!0})]}),n&&(()=>{if(!c)return null;const e=c.filterable?.type||"text",a=t[n];if("multiselect"===e&&c.filterable?.options){const e=h.toLowerCase(),t=e?c.filterable.options.filter(t=>t.label.toLowerCase().includes(e)||String(t.value).toLowerCase().includes(e)):c.filterable.options;return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsxs("div",{className:"relative mb-2",children:[_.jsx(re,{className:"w-4 h-4 text-gray-400 absolute left-2 top-1/2 -translate-y-1/2"}),_.jsx("input",{type:"text",value:h,onChange:e=>l(e.target.value),placeholder:"Search options...",className:"w-full pl-8 pr-2 py-1.5 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),h&&_.jsx("button",{type:"button",onClick:()=>l(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:_.jsx(le,{className:"w-3 h-3"})})]}),_.jsxs("div",{className:"max-h-32 overflow-y-auto border border-gray-300 rounded-md p-2 bg-white",children:[0===t.length&&_.jsx("div",{className:"text-xs text-gray-500 px-1 py-1",children:"No matches"}),t.map(e=>{const t=a?.value||[],i=Array.isArray(t)&&t.includes(e.value);return _.jsxs("label",{className:"flex items-center gap-2 py-1 hover:bg-gray-50 cursor-pointer",children:[_.jsx("input",{type:"checkbox",className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:i,onChange:t=>{const i=a?.value||[];let s;s=t.target.checked?[...i,e.value]:i.filter(t=>t!==e.value),s.length>0?r?.(n,{type:"multiselect",value:s,operator:"in"}):r?.(n,null)}}),_.jsx("span",{className:"text-sm",children:e.label})]},e.value)})]})]})}if("select"===e&&c.filterable?.options){const e=[{label:`All ${c.header}`,value:""},...c.filterable.options.map(e=>({label:e.label,value:String(e.value)}))];return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsx(kr,{options:e,value:a?.value||"",placeholder:`Select ${c.header.toLowerCase()}...`,onChange:e=>{r?.(n,e?{type:"select",value:e,operator:"between"}:null)},searchable:!0})]})}if("date"===e){const e=e=>{if(!e)return null;if(e instanceof Date&&!isNaN(e.getTime()))return e;const t=or(String(e),"yyyy-MM-dd",new Date);if(!isNaN(t.getTime()))return t;const r=new Date(e);return isNaN(r.getTime())?null:r},t=e(a?.value),i=e(a?.secondValue),s=a?.operator||"between";return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsx("div",{className:"mb-3",children:_.jsx(kr,{options:[{label:"Between Dates",value:"between"},{label:"On Date",value:"equals"}],value:s,placeholder:"Select date filter...",onChange:e=>{r?.(n,{type:"date",value:a?.value||"",operator:e,secondValue:a?.secondValue||""})},searchable:!1},`date-operator-${n}-${s}`)}),_.jsxs("div",{className:"flex items-end gap-2",children:[_.jsx("div",{className:"flex-1 min-w-37.5",children:_.jsx(ue,{name:"column_filter_start",label:"between"===s?"Start Date":"Date",value:t?ct(t,"yyyy-MM-dd"):null,onChange:e=>{if(e){const t=ct(or(e,"yyyy-MM-dd",new Date),"yyyy-MM-dd");r?.(n,{type:"date",value:t,operator:s,secondValue:a?.secondValue||null})}else r?.(n,null)},className:"w-full"})}),"between"===s&&_.jsx("div",{className:"flex-1 min-w-37.5",children:_.jsx(ue,{name:"column_filter_end",label:"End Date",value:i?ct(i,"yyyy-MM-dd"):null,onChange:e=>{if(e&&a){const t=ct(or(e,"yyyy-MM-dd",new Date),"yyyy-MM-dd");r?.(n,{...a,secondValue:t})}},className:"w-full"})})]})]})}return _.jsxs("div",{className:"mt-3",children:[_.jsxs("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Filter by ",c.header]}),_.jsxs(_.Fragment,{children:[_.jsx("input",{type:"text",placeholder:c.filterable?.placeholder||`Filter ${c.header.toLowerCase()}...`,className:"w-full px-3 py-2.5 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200",value:a?.value||"",onChange:e=>{e.target.value?r?.(n,{type:"text",value:e.target.value,operator:"contains"}):r?.(n,null)}}),a&&_.jsx("div",{className:"mt-2",children:_.jsx(kr,{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"equals"},{label:"Starts with",value:"startsWith"},{label:"Ends with",value:"endsWith"}],value:a?.operator||"contains",placeholder:"Select operator...",onChange:e=>{a&&r?.(n,{...a,operator:e})},searchable:!1})})]})]})})(),Object.keys(t).length>0&&_.jsxs("div",{className:"mt-4",children:[_.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Active Filters"}),_.jsx("div",{className:"space-y-2",children:Object.entries(t).map(([e,t])=>{const n=a.find(t=>t.key===e);return n?_.jsxs("div",{className:"flex items-center justify-between bg-blue-50 border border-blue-200 rounded-md px-3 py-2 cursor-pointer hover:bg-blue-100",role:"button",title:`Edit filter for ${n.header}`,onClick:()=>(e=>{i(e)})(e),children:[_.jsxs("div",{className:"flex-1",children:[_.jsxs("span",{className:"text-sm font-medium text-blue-900",children:[n.header,":"]}),_.jsx("span",{className:"text-sm text-blue-700 ml-1",children:(()=>{if(Array.isArray(t.value))return`${t.value.length} selected`;if("date"===t.type){const e=e=>{try{if(!e)return"";if(e instanceof Date&&!isNaN(e.getTime()))return ct(e,"dd-MM-yyyy");if("string"==typeof e){const t=or(e,"yyyy-MM-dd",new Date);if(!isNaN(t.getTime()))return ct(t,"dd-MM-yyyy");const r=new Date(e);if(!isNaN(r.getTime()))return ct(r,"dd-MM-yyyy")}return String(e)}catch{return String(e??"")}},r={equals:"On",gt:"After",gte:"On or After",lt:"Before",lte:"On or Before",between:"Between"}[t.operator]||"On";return"between"===t.operator&&t.secondValue?`${r} ${e(t.value)} - ${e(t.secondValue)}`:`${r} ${e(t.value)}`}return t.value})()})]}),_.jsx("button",{onClick:t=>{t.stopPropagation(),r?.(e,null)},className:"text-blue-400 hover:text-red-500 transition-colors",title:"Clear filter",children:_.jsx(le,{className:"w-4 h-4"})})]},e):null})})]})]})};function wr(){return"undefined"!=typeof window}function xr(e){return Sr(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _r(e){var t;return null==(t=(Sr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sr(e){return!!wr()&&(e instanceof Node||e instanceof Mr(e).Node)}function jr(e){return!!wr()&&(e instanceof Element||e instanceof Mr(e).Element)}function Cr(e){return!!wr()&&(e instanceof HTMLElement||e instanceof Mr(e).HTMLElement)}function Ar(e){return!(!wr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot)}const Tr=new Set(["inline","contents"]);function Er(e){const{overflow:t,overflowX:r,overflowY:a,display:n}=Br(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!Tr.has(n)}const Nr=new Set(["table","td","th"]);function zr(e){return Nr.has(xr(e))}const Rr=[":popover-open",":modal"];function Or(e){return Rr.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Pr=["transform","translate","scale","rotate","perspective"],Lr=["transform","translate","scale","rotate","perspective","filter"],Ir=["paint","layout","strict","content"];function qr(e){const t=Dr(),r=jr(e)?Br(e):e;return Pr.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Lr.some(e=>(r.willChange||"").includes(e))||Ir.some(e=>(r.contain||"").includes(e))}function Dr(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Hr=new Set(["html","body","#document"]);function Fr(e){return Hr.has(xr(e))}function Br(e){return Mr(e).getComputedStyle(e)}function Vr(e){return jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ur(e){if("html"===xr(e))return e;const t=e.assignedSlot||e.parentNode||Ar(e)&&e.host||_r(e);return Ar(t)?t.host:t}function $r(e){const t=Ur(e);return Fr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&Er(t)?t:$r(t)}function Wr(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);const n=$r(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),s=Mr(n);if(i){const e=Zr(s);return t.concat(s,s.visualViewport||[],Er(n)?n:[],e&&r?Wr(e):[])}return t.concat(n,Wr(n,[],r))}function Zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Xr=Math.min,Kr=Math.max,Gr=Math.round,Yr=Math.floor,Jr=e=>({x:e,y:e}),Qr={left:"right",right:"left",bottom:"top",top:"bottom"},ea={start:"end",end:"start"};function ta(e,t,r){return Kr(e,Xr(t,r))}function ra(e,t){return"function"==typeof e?e(t):e}function aa(e){return e.split("-")[0]}function na(e){return e.split("-")[1]}function ia(e){return"x"===e?"y":"x"}function sa(e){return"y"===e?"height":"width"}const oa=new Set(["top","bottom"]);function ha(e){return oa.has(aa(e))?"y":"x"}function la(e){return ia(ha(e))}function da(e){return e.replace(/start|end/g,e=>ea[e])}const ca=["left","right"],ua=["right","left"],fa=["top","bottom"],pa=["bottom","top"];function ya(e,t,r,a){const n=na(e);let i=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ua:ca:t?ca:ua;case"left":case"right":return t?fa:pa;default:return[]}}(aa(e),"start"===r,a);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(da)))),i}function ma(e){return e.replace(/left|right|bottom|top/g,e=>Qr[e])}function ga(e){const{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}var ba="undefined"!=typeof document?l:function(){};const ka={...e}.useInsertionEffect||(e=>e());function va(e,t,r){let{reference:a,floating:n}=e;const i=ha(t),s=la(t),o=sa(s),h=aa(t),l="y"===i,d=a.x+a.width/2-n.width/2,c=a.y+a.height/2-n.height/2,u=a[o]/2-n[o]/2;let f;switch(h){case"top":f={x:d,y:a.y-n.height};break;case"bottom":f={x:d,y:a.y+a.height};break;case"right":f={x:a.x+a.width,y:c};break;case"left":f={x:a.x-n.width,y:c};break;default:f={x:a.x,y:a.y}}switch(na(t)){case"start":f[s]-=u*(r&&l?-1:1);break;case"end":f[s]+=u*(r&&l?-1:1)}return f}async function wa(e,t){var r;void 0===t&&(t={});const{x:a,y:n,platform:i,rects:s,elements:o,strategy:h}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:u=!1,padding:f=0}=ra(t,e),p=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),y=o[u?"floating"===c?"reference":"floating":c],m=ga(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(y)))||r?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:d,strategy:h})),g="floating"===c?{x:a,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),k=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},v=ga(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:b,strategy:h}):g);return{top:(m.top-v.top+p.top)/k.y,bottom:(v.bottom-m.bottom+p.bottom)/k.y,left:(m.left-v.left+p.left)/k.x,right:(v.right-m.right+p.right)/k.x}}const xa=new Set(["left","top"]);function Ma(e){const t=Br(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const n=Cr(e),i=n?e.offsetWidth:r,s=n?e.offsetHeight:a,o=Gr(r)!==i||Gr(a)!==s;return o&&(r=i,a=s),{width:r,height:a,$:o}}function _a(e){return jr(e)?e:e.contextElement}function Sa(e){const t=_a(e);if(!Cr(t))return Jr(1);const r=t.getBoundingClientRect(),{width:a,height:n,$:i}=Ma(t);let s=(i?Gr(r.width):r.width)/a,o=(i?Gr(r.height):r.height)/n;return s&&Number.isFinite(s)||(s=1),o&&Number.isFinite(o)||(o=1),{x:s,y:o}}const ja=Jr(0);function Ca(e){const t=Mr(e);return Dr()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ja}function Aa(e,t,r,a){void 0===t&&(t=!1),void 0===r&&(r=!1);const n=e.getBoundingClientRect(),i=_a(e);let s=Jr(1);t&&(a?jr(a)&&(s=Sa(a)):s=Sa(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Mr(e))&&t}(i,r,a)?Ca(i):Jr(0);let h=(n.left+o.x)/s.x,l=(n.top+o.y)/s.y,d=n.width/s.x,c=n.height/s.y;if(i){const e=Mr(i),t=a&&jr(a)?Mr(a):a;let r=e,n=Zr(r);for(;n&&a&&t!==r;){const e=Sa(n),t=n.getBoundingClientRect(),a=Br(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,s=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;h*=e.x,l*=e.y,d*=e.x,c*=e.y,h+=i,l+=s,r=Mr(n),n=Zr(r)}}return ga({width:d,height:c,x:h,y:l})}function Ta(e,t){const r=Vr(e).scrollLeft;return t?t.left+r:Aa(_r(e)).left+r}function Ea(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ta(e,r),y:r.top+t.scrollTop}}const Na=new Set(["absolute","fixed"]);function za(e,t,r){let a;if("viewport"===t)a=function(e,t){const r=Mr(e),a=_r(e),n=r.visualViewport;let i=a.clientWidth,s=a.clientHeight,o=0,h=0;if(n){i=n.width,s=n.height;const e=Dr();(!e||e&&"fixed"===t)&&(o=n.offsetLeft,h=n.offsetTop)}const l=Ta(a);if(l<=0){const e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(a.clientWidth-t.clientWidth-n);s<=25&&(i-=s)}else l<=25&&(i+=l);return{width:i,height:s,x:o,y:h}}(e,r);else if("document"===t)a=function(e){const t=_r(e),r=Vr(e),a=e.ownerDocument.body,n=Kr(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let s=-r.scrollLeft+Ta(e);const o=-r.scrollTop;return"rtl"===Br(a).direction&&(s+=Kr(t.clientWidth,a.clientWidth)-n),{width:n,height:i,x:s,y:o}}(_r(e));else if(jr(t))a=function(e,t){const r=Aa(e,!0,"fixed"===t),a=r.top+e.clientTop,n=r.left+e.clientLeft,i=Cr(e)?Sa(e):Jr(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:a*i.y}}(t,r);else{const r=Ca(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ga(a)}function Ra(e,t){const r=Ur(e);return!(r===t||!jr(r)||Fr(r))&&("fixed"===Br(r).position||Ra(r,t))}function Oa(e,t,r){const a=Cr(t),n=_r(t),i="fixed"===r,s=Aa(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const h=Jr(0);function l(){h.x=Ta(n)}if(a||!a&&!i)if(("body"!==xr(t)||Er(n))&&(o=Vr(t)),a){const e=Aa(t,!0,i,t);h.x=e.x+t.clientLeft,h.y=e.y+t.clientTop}else n&&l();i&&!a&&n&&l();const d=!n||a||i?Jr(0):Ea(n,o);return{x:s.left+o.scrollLeft-h.x-d.x,y:s.top+o.scrollTop-h.y-d.y,width:s.width,height:s.height}}function Pa(e){return"static"===Br(e).position}function La(e,t){if(!Cr(e)||"fixed"===Br(e).position)return null;if(t)return t(e);let r=e.offsetParent;return _r(e)===r&&(r=r.ownerDocument.body),r}function Ia(e,t){const r=Mr(e);if(Or(e))return r;if(!Cr(e)){let t=Ur(e);for(;t&&!Fr(t);){if(jr(t)&&!Pa(t))return t;t=Ur(t)}return r}let a=La(e,t);for(;a&&zr(a)&&Pa(a);)a=La(a,t);return a&&Fr(a)&&Pa(a)&&!qr(a)?r:a||function(e){let t=Ur(e);for(;Cr(t)&&!Fr(t);){if(qr(t))return t;if(Or(t))return null;t=Ur(t)}return null}(e)||r}const qa={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e;const i="fixed"===n,s=_r(a),o=!!t&&Or(t.floating);if(a===s||o&&i)return r;let h={scrollLeft:0,scrollTop:0},l=Jr(1);const d=Jr(0),c=Cr(a);if((c||!c&&!i)&&(("body"!==xr(a)||Er(s))&&(h=Vr(a)),Cr(a))){const e=Aa(a);l=Sa(a),d.x=e.x+a.clientLeft,d.y=e.y+a.clientTop}const u=!s||c||i?Jr(0):Ea(s,h);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-h.scrollLeft*l.x+d.x+u.x,y:r.y*l.y-h.scrollTop*l.y+d.y+u.y}},getDocumentElement:_r,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e;const i=[..."clippingAncestors"===r?Or(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let a=Wr(e,[],!1).filter(e=>jr(e)&&"body"!==xr(e)),n=null;const i="fixed"===Br(e).position;let s=i?Ur(e):e;for(;jr(s)&&!Fr(s);){const t=Br(s),r=qr(s);r||"fixed"!==t.position||(n=null),(i?!r&&!n:!r&&"static"===t.position&&n&&Na.has(n.position)||Er(s)&&!r&&Ra(e,s))?a=a.filter(e=>e!==s):n=t,s=Ur(s)}return t.set(e,a),a}(t,this._c):[].concat(r),a],s=i[0],o=i.reduce((e,r)=>{const a=za(t,r,n);return e.top=Kr(a.top,e.top),e.right=Xr(a.right,e.right),e.bottom=Xr(a.bottom,e.bottom),e.left=Kr(a.left,e.left),e},za(t,s,n));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Ia,getElementRects:async function(e){const t=this.getOffsetParent||Ia,r=this.getDimensions,a=await r(e.floating);return{reference:Oa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ma(e);return{width:t,height:r}},getScale:Sa,isElement:jr,isRTL:function(e){return"rtl"===Br(e).direction}};function Da(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ha(e,t,r,a){void 0===a&&(a={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:h=!1}=a,l=_a(e),d=n||i?[...l?Wr(l):[],...Wr(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});const c=l&&o?function(e,t){let r,a=null;const n=_r(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return function s(o,h){void 0===o&&(o=!1),void 0===h&&(h=1),i();const l=e.getBoundingClientRect(),{left:d,top:c,width:u,height:f}=l;if(o||t(),!u||!f)return;const p={rootMargin:-Yr(c)+"px "+-Yr(n.clientWidth-(d+u))+"px "+-Yr(n.clientHeight-(c+f))+"px "+-Yr(d)+"px",threshold:Kr(0,Xr(1,h))||1};let y=!0;function m(t){const a=t[0].intersectionRatio;if(a!==h){if(!y)return s();a?s(!1,a):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==a||Da(l,e.getBoundingClientRect())||s(),y=!1}try{a=new IntersectionObserver(m,{...p,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(m,p)}a.observe(e)}(!0),i}(l,r):null;let u,f=-1,p=null;s&&(p=new ResizeObserver(e=>{let[a]=e;a&&a.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),l&&!h&&p.observe(l),p.observe(t));let y=h?Aa(e):null;return h&&function t(){const a=Aa(e);y&&!Da(y,a)&&r();y=a,u=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==c||c(),null==(e=p)||e.disconnect(),p=null,h&&cancelAnimationFrame(u)}}const Fa=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,a;const{x:n,y:i,placement:s,middlewareData:o}=t,h=await async function(e,t){const{placement:r,platform:a,elements:n}=e,i=await(null==a.isRTL?void 0:a.isRTL(n.floating)),s=aa(r),o=na(r),h="y"===ha(r),l=xa.has(s)?-1:1,d=i&&h?-1:1,c=ra(t,e);let{mainAxis:u,crossAxis:f,alignmentAxis:p}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return o&&"number"==typeof p&&(f="end"===o?-1*p:p),h?{x:f*d,y:u*l}:{x:u*l,y:f*d}}(t,e);return s===(null==(r=o.offset)?void 0:r.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:n+h.x,y:i+h.y,data:{...h,placement:s}}}}},Ba=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:a,placement:n,platform:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:h={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=ra(e,t),d={x:r,y:a},c=await i.detectOverflow(t,l),u=ha(aa(n)),f=ia(u);let p=d[f],y=d[u];if(s){const e="y"===f?"bottom":"right";p=ta(p+c["y"===f?"top":"left"],p,p-c[e])}if(o){const e="y"===u?"bottom":"right";y=ta(y+c["y"===u?"top":"left"],y,y-c[e])}const m=h.fn({...t,[f]:p,[u]:y});return{...m,data:{x:m.x-r,y:m.y-a,enabled:{[f]:s,[u]:o}}}}}},Va=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,a;const{placement:n,middlewareData:i,rects:s,initialPlacement:o,platform:h,elements:l}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...m}=ra(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const g=aa(n),b=ha(o),k=aa(o)===o,v=await(null==h.isRTL?void 0:h.isRTL(l.floating)),w=u||(k||!y?[ma(o)]:function(e){const t=ma(e);return[da(e),t,da(t)]}(o)),x="none"!==p;!u&&x&&w.push(...ya(o,y,p,v));const M=[o,...w],_=await h.detectOverflow(t,m),S=[];let j=(null==(a=i.flip)?void 0:a.overflows)||[];if(d&&S.push(_[g]),c){const e=function(e,t,r){void 0===r&&(r=!1);const a=na(e),n=la(e),i=sa(n);let s="x"===n?a===(r?"end":"start")?"right":"left":"start"===a?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ma(s)),[s,ma(s)]}(n,s,v);S.push(_[e[0]],_[e[1]])}if(j=[...j,{placement:n,overflows:S}],!S.every(e=>e<=0)){var C,A;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=M[e];if(t){if(!("alignment"===c&&b!==ha(t))||j.every(e=>ha(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:j},reset:{placement:t}}}let r=null==(A=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!r)switch(f){case"bestFit":{var T;const e=null==(T=j.filter(e=>{if(x){const t=ha(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(r=e);break}case"initialPlacement":r=o}if(n!==r)return{reset:{placement:r}}}return{}}}},Ua=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,a;const{placement:n,rects:i,platform:s,elements:o}=t,{apply:h=()=>{},...l}=ra(e,t),d=await s.detectOverflow(t,l),c=aa(n),u=na(n),f="y"===ha(n),{width:p,height:y}=i.floating;let m,g;"top"===c||"bottom"===c?(m=c,g=u===(await(null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,m="end"===u?"top":"bottom");const b=y-d.top-d.bottom,k=p-d.left-d.right,v=Xr(y-d[m],b),w=Xr(p-d[g],k),x=!t.middlewareData.shift;let M=v,_=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(_=k),null!=(a=t.middlewareData.shift)&&a.enabled.y&&(M=b),x&&!u){const e=Kr(d.left,0),t=Kr(d.right,0),r=Kr(d.top,0),a=Kr(d.bottom,0);f?_=p-2*(0!==e||0!==t?e+t:Kr(d.left,d.right)):M=y-2*(0!==r||0!==a?r+a:Kr(d.top,d.bottom))}await h({...t,availableWidth:_,availableHeight:M});const S=await s.getDimensions(o.floating);return p!==S.width||y!==S.height?{reset:{rects:!0}}:{}}}},$a=(e,t,r)=>{const a=new Map,n={platform:qa,...r},i={...n.platform,_c:a};return(async(e,t,r)=>{const{placement:a="bottom",strategy:n="absolute",middleware:i=[],platform:s}=r,o=i.filter(Boolean),h=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:c}=va(l,a,h),u=a,f={},p=0;for(let r=0;r<o.length;r++){var y;const{name:i,fn:m}=o[r],{x:g,y:b,data:k,reset:v}=await m({x:d,y:c,initialPlacement:a,placement:u,strategy:n,middlewareData:f,rects:l,platform:{...s,detectOverflow:null!=(y=s.detectOverflow)?y:wa},elements:{reference:e,floating:t}});d=null!=g?g:d,c=null!=b?b:c,f={...f,[i]:{...f[i],...k}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(u=v.placement),v.rects&&(l=!0===v.rects?await s.getElementRects({reference:e,floating:t,strategy:n}):v.rects),({x:d,y:c}=va(l,u,h))),r=-1)}return{x:d,y:c,placement:u,strategy:n,middlewareData:f}})(e,t,{...n,platform:i})};var Wa="undefined"!=typeof document?l:function(){};function Za(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,a,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;0!==a--;)if(!Za(e[a],t[a]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(a=r;0!==a--;)if(!{}.hasOwnProperty.call(t,n[a]))return!1;for(a=r;0!==a--;){const r=n[a];if(("_owner"!==r||!e.$$typeof)&&!Za(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Xa(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ka(e,t){const r=Xa(e);return Math.round(t*r)/r}function Ga(t){const r=e.useRef(t);return Wa(()=>{r.current=t}),r}const Ya=(e,t)=>({...Fa(e),options:[e,t]}),Ja=(e,t)=>({...Ba(e),options:[e,t]}),Qa=(e,t)=>({...Ua(e),options:[e,t]}),en={...e};let tn=!1,rn=0;const an=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rn++;const nn=en.useId||function(){const[t,r]=e.useState(()=>tn?an():void 0);return ba(()=>{null==t&&r(an())},[]),e.useEffect(()=>{tn=!0},[]),t};let sn;"production"!==process.env.NODE_ENV&&(sn=new Set);const on=e.createContext(null),hn=e.createContext(null);function ln(t){const{open:r=!1,onOpenChange:a,elements:n}=t,i=nn(),s=e.useRef({}),[o]=e.useState(()=>function(){const e=new Map;return{emit(t,r){var a;null==(a=e.get(t))||a.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var a;null==(a=e.get(t))||a.delete(r)}}}()),h=null!=((null==(l=e.useContext(on))?void 0:l.id)||null);var l;if("production"!==process.env.NODE_ENV){const e=n.reference;e&&!jr(e)&&function(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];const n="Floating UI: "+r.join(" ");var i;null!=(e=sn)&&e.has(n)||(null==(i=sn)||i.add(n),console.error(n))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,c]=e.useState(n.reference),u=function(t){const r=e.useRef(()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")});return ka(()=>{r.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return null==r.current?void 0:r.current(...t)},[])}((e,t,r)=>{s.current.openEvent=e?t:void 0,o.emit("openchange",{open:e,event:t,reason:r,nested:h}),null==a||a(e,t,r)}),f=e.useMemo(()=>({setPositionReference:c}),[]),p=e.useMemo(()=>({reference:d||n.reference||null,floating:n.floating||null,domReference:n.reference}),[d,n.reference,n.floating]);return e.useMemo(()=>({dataRef:s,open:r,onOpenChange:u,elements:p,events:o,floatingId:i,refs:f}),[r,u,p,o,i,f])}function dn(t){void 0===t&&(t={});const{nodeId:r}=t,a=ln({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||a,i=n.elements,[s,o]=e.useState(null),[h,l]=e.useState(null),d=(null==i?void 0:i.domReference)||s,c=e.useRef(null),u=e.useContext(hn);ba(()=>{d&&(c.current=d)},[d]);const p=function(t){void 0===t&&(t={});const{placement:r="bottom",strategy:a="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:h=!0,whileElementsMounted:l,open:d}=t,[c,u]=e.useState({x:0,y:0,strategy:a,placement:r,middlewareData:{},isPositioned:!1}),[p,y]=e.useState(n);Za(p,n)||y(n);const[m,g]=e.useState(null),[b,k]=e.useState(null),v=e.useCallback(e=>{e!==_.current&&(_.current=e,g(e))},[]),w=e.useCallback(e=>{e!==S.current&&(S.current=e,k(e))},[]),x=s||m,M=o||b,_=e.useRef(null),S=e.useRef(null),j=e.useRef(c),C=null!=l,A=Ga(l),T=Ga(i),E=Ga(d),N=e.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:r,strategy:a,middleware:p};T.current&&(e.platform=T.current),$a(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==E.current};z.current&&!Za(j.current,t)&&(j.current=t,f.flushSync(()=>{u(t)}))})},[p,r,a,T,E]);Wa(()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,u(e=>({...e,isPositioned:!1})))},[d]);const z=e.useRef(!1);Wa(()=>(z.current=!0,()=>{z.current=!1}),[]),Wa(()=>{if(x&&(_.current=x),M&&(S.current=M),x&&M){if(A.current)return A.current(x,M,N);N()}},[x,M,N,A,C]);const R=e.useMemo(()=>({reference:_,floating:S,setReference:v,setFloating:w}),[v,w]),O=e.useMemo(()=>({reference:x,floating:M}),[x,M]),P=e.useMemo(()=>{const e={position:a,left:0,top:0};if(!O.floating)return e;const t=Ka(O.floating,c.x),r=Ka(O.floating,c.y);return h?{...e,transform:"translate("+t+"px, "+r+"px)",...Xa(O.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:t,top:r}},[a,h,O.floating,c.x,c.y]);return e.useMemo(()=>({...c,update:N,refs:R,elements:O,floatingStyles:P}),[c,N,R,O,P])}({...t,elements:{...i,...h&&{reference:h}}}),y=e.useCallback(e=>{const t=jr(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),p.refs.setReference(t)},[p.refs]),m=e.useCallback(e=>{(jr(e)||null===e)&&(c.current=e,o(e)),(jr(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!jr(e))&&p.refs.setReference(e)},[p.refs]),g=e.useMemo(()=>({...p.refs,setReference:m,setPositionReference:y,domReference:c}),[p.refs,m,y]),b=e.useMemo(()=>({...p.elements,domReference:d}),[p.elements,d]),k=e.useMemo(()=>({...p,...n,refs:g,elements:b,nodeId:r}),[p,g,b,r,n]);return ba(()=>{n.dataRef.current.floatingContext=k;const e=null==u?void 0:u.nodesRef.current.find(e=>e.id===r);e&&(e.context=k)}),e.useMemo(()=>({...p,context:k,refs:g,elements:b}),[p,g,b,k])}const cn=({open:e,anchorEl:t,onClose:r,placement:a="bottom-start",offset:n=8,sameWidth:i=!1,maxHeight:s,zIndex:h=1e3,className:l,children:d,shouldIgnoreClose:c})=>{const{refs:u,floatingStyles:f,update:y}=dn({placement:a,whileElementsMounted:Ha,middleware:[Ya(n),(m={padding:8},{...Va(m),options:[m,g]}),Ja({padding:8}),Qa({apply({rects:e,elements:t,availableHeight:r,availableWidth:a}){const n=t.floating;n&&(i&&(n.style.width=`${e.reference.width}px`),n.style.maxHeight=null!=s?"number"==typeof s?`${s}px`:String(s):`${r}px`,null!=a&&(n.style.maxWidth=`${a}px`))}})]});var m,g;return o(()=>{t&&u.setReference(t),e&&y&&y()},[t,e,u,y]),o(()=>{if(!e)return;const a=e=>{const a=e.target;if(c&&c(a))return;const n=u.floating.current;n&&(t&&t.contains(a)||n&&n.contains(a)||r())},n=e=>{"Escape"===e.key&&r()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",n)}},[e,r,u.floating,t]),e&&t?p(_.jsx("div",{ref:u.setFloating,"data-popover-root":"true",style:{...f,zIndex:h,position:f.position,overflowX:"hidden"},className:l,children:d}),document.body):null},un=({globalFilter:e,filteredDataLength:t,selectedRowsCount:r=0,selectedRows:n=new Set,showExport:i=!0,showColumnToggle:l=!0,showBulkActions:d=!0,columns:c=[],columnVisibility:u={},columnFilters:f={},bulkActions:p=[],exportOptions:y,onGlobalFilterChange:m,onClearFilters:g,onColumnVisibilityChange:b,onColumnFilter:k,onResetColumns:v,columnOrder:w=[],onColumnOrderChange:x,pinnedColumns:M,onScrollToColumn:S,density:j="md",onDensityChange:C,showDensityControl:A=!1,customLeftContent:T,customRightContent:E})=>{const[z,R]=s(!1),[O,P]=s(!1),[L,I]=s(!1),[q,D]=s(!1),[H,X]=s(""),[G,Y]=s(null),[Q,ee]=s(null),te=h(null),oe=h(null),he=h(null),de=h(null),ce=h(null),ue=h(null),fe=h(null),pe=h(null),ye=h(null);o(()=>{const e=e=>{if((e=>{let t=e;for(;t;){if(t.getAttribute&&"true"===t.getAttribute("data-popover-root")||t.dataset&&"true"===t.dataset.popoverRoot)return!0;t=t.parentNode}return!1})(e.target))return;oe.current&&!oe.current.contains(e.target)&&R(!1),he.current&&!he.current.contains(e.target)&&I(!1),de.current&&!de.current.contains(e.target)&&D(!1),!ce.current||ce.current.contains(e.target)||(e=>{let t=e;for(;t;){if(t.classList){const e=Array.from(t.classList).join(" ");if(/MuiPickers|MuiDatePicker|MuiPickersPopper/.test(e))return!0}if(t.getAttribute&&"dialog"===t.getAttribute("role")){const e=t.className?.toString()||"";if(/MuiPickers|MuiDatePicker/.test(e))return!0}t=t.parentNode}return!1})(e.target)||P(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const me=y?.formats||["xlsx"],ge=(e?.length??0)>0||Object.keys(f||{}).length>0,be=r>0,ke=c.filter(e=>!1!==u[e.key]).length,ve=[...w.map(e=>c.find(t=>t.key===e)).filter(Boolean),...c.filter(e=>!w.includes(e.key))].filter(e=>e.header?.toLowerCase()?.includes(H?.toLowerCase())),we=e=>{switch(e){case"csv":return _.jsx(ie,{size:18});case"json":return _.jsx(B,{size:18});case"xlsx":return _.jsx(Z,{size:18});default:return _.jsx(V,{size:18})}},xe=e=>{switch(e){case"delete":return _.jsx(se,{size:18});case"archive":return _.jsx(N,{size:18});case"copy":return _.jsx(F,{size:18});case"edit":return _.jsx(ne,{size:18});case"export":return _.jsx(V,{size:18});default:return _.jsx(U,{size:18})}},Me=e=>{switch(e){case"csv":return"CSV";case"json":return"JSON";case"xlsx":return"Excel";default:return e}},_e=(e,t=!1)=>{y?.onExport?.(e,t),R(!1)},Se=()=>{Y(null),ee(null)},je=a(()=>c.some(e=>e.filterable),[c]);return _.jsxs("div",{className:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",role:"toolbar","aria-label":"Data grid toolbar",children:[_.jsxs("div",{id:"search-results-status",className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:[ge?`Showing ${t} of ${t} rows`:`${t} total rows`,be&&`, ${r} row${1!==r?"s":""} selected`]}),_.jsx("div",{className:"px-3 py-2",children:_.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 sm:gap-4",children:[_.jsxs("div",{className:"order-1 flex items-center flex-wrap gap-2 sm:gap-3",children:[_.jsxs("div",{className:"relative",ref:ce,children:[je&&_.jsxs("button",{ref:e=>{ue.current=e},onClick:()=>P(!O),className:"flex cursor-pointer items-center gap-2 px-3 py-2 border rounded-lg transition-colors "+(O?"bg-blue-50 dark:bg-blue-900/40 border-blue-200 dark:border-blue-600 text-blue-700 dark:text-blue-300":"border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800"),title:"Toggle column filters (Ctrl+K)","aria-label":"Toggle column filters","aria-haspopup":"menu","aria-expanded":O,"aria-controls":"filters-menu","aria-keyshortcuts":"Control+K",children:[_.jsx(K,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline",children:"Filters"}),Object.keys(f).length>0&&_.jsxs("button",{type:"button",onClick:e=>{e.stopPropagation(),g?.()},className:"bg-red-500 cursor-pointer hover:bg-red-600 text-white text-xs px-1.5 py-0.5 rounded-full min-w-5 h-5 flex items-center justify-center transition-all group relative",title:"Clear all filters",children:[_.jsx("span",{className:"group-hover:hidden",children:Object.keys(f).length}),_.jsx(le,{className:"w-3 h-3 hidden group-hover:block absolute"})]})]}),_.jsxs(cn,{open:O,anchorEl:ue.current,onClose:()=>P(!1),placement:"bottom-start",offset:8,zIndex:1e3,maxHeight:520,className:"w-88 sm:w-88 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl overflow-y-auto min-h-100",shouldIgnoreClose:e=>{let t=e;for(;t;){if(t.classList){const e=Array.from(t.classList).join(" ");if(/MuiPickers|MuiDatePicker|MuiPickersPopper/.test(e))return!0}if(t.getAttribute&&"dialog"===t.getAttribute("role")){const e=t.className?.toString()||"";if(/MuiPickers|MuiDatePicker/.test(e))return!0}t=t.parentNode}return!1},children:[_.jsxs("div",{className:"flex items-center justify-between px-2",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Column Filters"}),_.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Filter data by column values"})]}),_.jsx("button",{onClick:g,className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",children:"Clear All"})]}),_.jsx("div",{className:"p-3 space-y-3",children:_.jsx(vr,{columns:c,columnFilters:f,onColumnFilter:k})}),_.jsx("div",{className:"flex items-center justify-between p-3 border-t border-gray-200",children:_.jsx("div",{className:"text-sm text-gray-600",children:Object.keys(f).length>0&&_.jsxs("span",{children:[Object.keys(f).length," filter",1!==Object.keys(f).length?"s":""," ","applied"]})})})]})]}),T]}),_.jsxs("div",{className:"order-2 flex items-center gap-2 sm:gap-3 flex-wrap sm:flex-nowrap",children:[E,d&&be&&p.length>0&&_.jsxs("div",{className:"relative",ref:he,children:[_.jsxs("button",{ref:e=>{pe.current=e},onClick:()=>I(!L),className:"flex items-center gap-2 px-3 py-2.5 bg-orange-600 text-white rounded-lg hover:bg-orange-700 transition-colors",title:"Bulk actions",children:[_.jsx(U,{className:"w-4 h-4"}),_.jsxs("span",{className:"hidden sm:inline text-sm font-medium",children:["Actions (",r,")"]})]}),_.jsxs(cn,{open:L,anchorEl:pe.current,onClose:()=>I(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-56 bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Bulk Actions"}),_.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r," row",1!==r?"s":""," selected"]})]}),_.jsx("div",{className:"p-2",children:p.map(e=>_.jsxs("button",{onClick:()=>(e=>{e.disabled||(e.onClick(n),I(!1))})(e),disabled:e.disabled,className:"w-full flex items-center gap-3 px-3 py-2 text-sm rounded-md transition-colors "+(e.disabled?"text-gray-400 cursor-not-allowed":e.destructive?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-50"),children:[xe(e.id),e.label]},e.id))})]})]}),l&&c.length>0&&_.jsxs("div",{className:"relative",ref:de,children:[_.jsxs("button",{ref:e=>{ye.current=e},onClick:()=>D(!q),className:"flex items-center gap-2 px-3 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",title:"Column visibility","aria-label":`Column visibility. ${ke} of ${c.length} columns visible`,"aria-haspopup":"menu","aria-expanded":q,"aria-controls":"column-visibility-menu",children:[_.jsx(ae,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline text-sm font-medium",children:"Columns"}),_.jsxs("span",{className:"hidden sm:inline text-xs text-gray-500",children:["(",ke,"/",c.length,")"]})]}),_.jsxs(cn,{open:q,anchorEl:ye.current,onClose:()=>D(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-[90vw] sm:w-72 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Show/Hide Columns"}),_.jsxs("div",{className:"relative mt-2",children:[_.jsx(re,{className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-400 w-4 h-4"}),_.jsx("input",{type:"text",placeholder:"Search columns...",className:"w-full pl-8 pr-2 py-1.5 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm",value:H,onChange:e=>X(e.target.value)})]})]}),_.jsx("div",{className:"max-h-60 overflow-y-auto p-2",children:ve.map(e=>{const t=!1!==u[e.key];return _.jsxs("label",{className:"flex items-center gap-3 p-2 hover:bg-gray-50 rounded-md cursor-grab relative "+(G===e.key?"opacity-60":""),draggable:!0,onDragStart:t=>((e,t)=>{Y(e),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)})(e.key,t),onDragOver:t=>((e,t)=>{t.preventDefault(),t.dataTransfer.dropEffect="move";const r=t.currentTarget.getBoundingClientRect(),a=r.top+r.height/2,n=t.clientY<a?"before":"after";ee({key:e,position:n})})(e.key,t),onDrop:()=>(e=>{const t=G;if(!t||t===e)return;if(M&&M.has(t)!==M.has(e))return Y(null),void ee(null);const r=Q?.key!==e||"before"===Q.position,a=(w&&w.length?w:c.map(e=>e.key)).filter(e=>e!==t);let n=a.indexOf(e);if(-1===n)return x?.(a),Y(null),void ee(null);r||(n+=1),a.splice(n,0,t),x?.(a),Y(null),ee(null)})(e.key),onDragEnd:Se,children:[Q?.key===e.key&&_.jsx("span",{className:"absolute left-2 right-2 h-0.5 bg-blue-600",style:{top:"before"===Q.position?0:void 0,bottom:"after"===Q.position?0:void 0}}),_.jsx("input",{type:"checkbox",checked:t,onChange:()=>(e=>{const t=!1!==u[e];b?.(e,!t)})(e.key),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),t?_.jsx(W,{className:"w-4 h-4 text-green-600"}):_.jsx($,{className:"w-4 h-4 text-gray-400"}),_.jsx("span",{className:"text-sm text-gray-700",children:e.header}),_.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),t?S?.(e.key):(b?.(e.key,!0),requestAnimationFrame(()=>S?.(e.key)))},className:"ml-auto p-1 text-gray-400 hover:text-blue-600",title:"Scroll to this column","aria-label":`Scroll to column ${e.header}`,children:_.jsx(J,{className:"w-4 h-4"})})]},e.key)})}),_.jsxs("div",{className:"p-2 border-t border-gray-100",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900 cursor-pointer hover:bg-gray-50 px-3 py-1.5 rounded transition-colors min-h-9",children:[_.jsx("input",{type:"checkbox",checked:ve.every(e=>!1!==u[e.key]),onChange:e=>{ve.forEach(t=>{b?.(t.key,e.target.checked)})},className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),_.jsx("span",{children:"Select All"})]}),_.jsx("button",{className:"text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-50 px-3 py-1.5 rounded transition-colors min-h-9",onClick:()=>{c.forEach(e=>{b?.(e.key,!1!==e.visible)}),x?.(c.map(e=>e.key)),v?.(),D(!1)},children:"Reset Columns"})]}),H&&_.jsx("button",{className:"text-xs text-blue-600 hover:underline mt-2",onClick:()=>X(""),children:"Clear Search"})]})]})]}),A&&_.jsx("div",{className:"flex items-center",children:_.jsx("div",{className:"flex items-center gap-1 border border-gray-300 rounded-lg p-1",title:"Row density",children:["sm","md","lg"].map(e=>_.jsx("button",{className:"px-2 py-1 text-xs rounded-md "+(j===e?"bg-blue-600 text-white":"text-gray-700 hover:bg-gray-100"),onClick:()=>C?.(e),children:e.toUpperCase()},e))})}),_.jsx("div",{className:"flex items-center gap-2 order-3 w-full sm:order-0 sm:w-auto flex-1 min-w-0",children:_.jsxs("div",{className:"relative",children:[_.jsx(re,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4","aria-hidden":"true"}),_.jsx("input",{ref:te,type:"text",placeholder:"Search...",className:"w-full sm:w-64 pl-10 pr-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-800 dark:text-gray-200 transition-colors",value:e,onChange:m,"aria-label":"Search all columns","aria-keyshortcuts":"Control+F","aria-describedby":"search-results-status"}),e&&_.jsx("button",{onClick:()=>m({target:{value:""}}),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors",title:"Clear search",children:_.jsx(le,{className:"w-4 h-4"})})]})}),i&&y?.enabled&&_.jsxs("div",{className:"relative",ref:oe,children:[_.jsx("button",{ref:e=>{fe.current=e},onClick:()=>R(!z),className:"p-2.5 cursor-pointer border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 transition-colors","aria-label":"Export data"+(be?` (${r} rows selected)`:` (${t} rows)`),"aria-haspopup":"menu","aria-expanded":z,"aria-controls":"export-menu","aria-keyshortcuts":"Control+E",title:"Export data (Ctrl+E)",children:_.jsx(V,{className:"w-4 h-4"})}),_.jsxs(cn,{open:z,anchorEl:fe.current,onClose:()=>R(!1),placement:"bottom-end",offset:8,zIndex:1e3,className:"w-[90vw] sm:w-64 max-w-[90vw] bg-white border border-gray-200 rounded-lg shadow-xl",children:[_.jsxs("div",{className:"p-3 border-b border-gray-100",children:[_.jsx("h3",{className:"font-medium text-gray-900",children:"Export Data"}),_.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Choose format and data scope"})]}),_.jsxs("div",{className:"p-2",children:[_.jsxs("div",{className:"mb-3",children:[_.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2 px-2",children:"Export All Data"}),_.jsx("div",{className:"space-y-1",children:me.map(e=>_.jsxs("button",{onClick:()=>_e(e,!1),className:" cursor-pointer w-full flex items-center gap-3 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded-md transition-colors",children:[we(e),_.jsxs("span",{children:["Export as ",Me(e)]}),_.jsxs("span",{className:"ml-auto text-xs text-gray-500",children:[t.toLocaleString()," rows"]})]},`all-${e}`))})]}),be&&_.jsxs("div",{children:[_.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2 px-2",children:"Export Selected"}),_.jsx("div",{className:"space-y-1",children:me.map(e=>_.jsxs("button",{onClick:()=>_e(e,!0),className:"w-full flex items-center gap-3 px-3 py-2 text-sm text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:[we(e),_.jsxs("span",{children:["Export as ",Me(e)]}),_.jsxs("span",{className:"ml-auto text-xs text-blue-500",children:[r," rows"]})]},`selected-${e}`))})]})]})]})]})]})]})})]})};function fn(e){const t=e?.enabled??!0,r=h(null),n=h(null);o(()=>{if(!t)return;try{const e=`(${pn.toString()})()`,t=new Blob([e],{type:"application/javascript"});r.current=new Worker(URL.createObjectURL(t))}catch(e){console.warn("Failed to initialize data worker, grid will run in main thread mode.",e),r.current=null}const e=r.current;return e.onmessage=e=>{const t=e.data;t&&"result"===t.type&&(n.current?.(t.payload.rows),n.current=null)},()=>{e?.terminate(),r.current=null,n.current=null}},[t]);return{process:a(()=>(e,a)=>{if(!t||!r.current){if(!e||0===e.length||!a?.key)return Promise.resolve(e);const t="asc"===a.direction?1:-1,r=[...e].sort((e,r)=>{const n=e?.[a.key],i=r?.[a.key];return null==n&&null==i?0:null==n?-1*t:null==i?1*t:"number"==typeof n&&"number"==typeof i?(n-i)*t:String(n).localeCompare(String(i))*t});return Promise.resolve(r)}return new Promise(t=>{n.current=t,r.current.postMessage({type:"process",payload:{rows:e,sort:a}})})},[t])}}function pn(){const e=self;e.onmessage=t=>{const r=t.data;if(r&&"process"===r.type)try{const{rows:t,sort:a}=r.payload,n=((e,t)=>{if(!e||0===e.length)return e;let r=e;if(t&&t.key){const{key:a,direction:n}=t,i="asc"===n?1:-1;r=[...e].sort((e,t)=>{const r=e?.[a],n=t?.[a];if(null==r&&null==n)return 0;if(null==r)return-1*i;if(null==n)return 1*i;if("number"==typeof r&&"number"==typeof n)return(r-n)*i;const s=String(r),o=String(n);return s.localeCompare(o)*i})}return r})(t,a??null);e.postMessage({type:"result",payload:{rows:n}})}catch(r){e.postMessage({type:"result",payload:{rows:t.data?.payload?.rows||[]}})}}}function yn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mn,gn={exports:{}};
10739
10739
  /*! ExcelJS 19-10-2023 */var bn,kn=(mn||(mn=1,gn.exports=function e(t,r,a){function n(s,o){if(!r[s]){if(!t[s]){if(!o&&yn)return yn(s);if(i)return i(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){return n(t[s][1][e]||e)},l,l.exports,e,t,r,a)}return r[s].exports}for(var i=yn,s=0;s<a.length;s++)n(a[s]);return n}({1:[function(e,t,r){const a=e("fs"),n=e("fast-csv"),i=e("dayjs/plugin/customParseFormat"),s=e("dayjs/plugin/utc"),o=e("dayjs").extend(i).extend(s),h=e("../utils/stream-buf"),{fs:{exists:l}}=e("../utils/utils"),d={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};t.exports=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t=t||{},!await l(e))throw new Error("File not found: "+e);const r=a.createReadStream(e),n=await this.read(r,t);return r.close(),n}read(e,t){return t=t||{},new Promise((r,a)=>{const i=this.workbook.addWorksheet(t.sheetName),s=t.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],h=t.map||function(e){if(""===e)return null;const t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;const r=s.reduce((t,r)=>{if(t)return t;const a=o(e,r,!0);return a.isValid()?a:null},null);if(r)return new Date(r.valueOf());const a=d[e];return void 0!==a?a:e},l=n.parse(t.parserOptions).on("data",e=>{i.addRow(e.map(h))}).on("end",()=>{l.emit("worksheet",i)});l.on("worksheet",r).on("error",a),e.pipe(l)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(e,t){return new Promise((r,a)=>{t=t||{};const i=this.workbook.getWorksheet(t.sheetName||t.sheetId),s=n.format(t.formatterOptions);e.on("finish",()=>{r()}),s.on("error",a),s.pipe(e);const{dateFormat:h,dateUTC:l}=t,d=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||"";if(e.formula||e.result)return e.result||"";if(e instanceof Date)return h?l?o.utc(e).format(h):o(e).format(h):l?o.utc(e).format():o(e).format();if(e.error)return e.error;if("object"==typeof e)return JSON.stringify(e)}return e}),c=void 0===t.includeEmptyRows||t.includeEmptyRows;let u=1;i&&i.eachRow((e,t)=>{if(c)for(;u++<t-1;)s.write([]);const{values:r}=e;r.shift(),s.write(r.map(d)),u=t}),s.end()})}writeFile(e,t){const r={encoding:(t=t||{}).encoding||"utf8"},n=a.createWriteStream(e,r);return this.write(n,t)}async writeBuffer(e){const t=new h;return await this.write(t,e),t.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(e,t,r){const a=e("../utils/col-cache");class n{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.worksheet=e,t)if("string"==typeof t){const e=a.decodeAddress(t);this.nativeCol=e.col+r,this.nativeColOff=0,this.nativeRow=e.row+r,this.nativeRowOff=0}else void 0!==t.nativeCol?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):void 0!==t.col?(this.col=t.col+r,this.row=t.row+r):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(e){return e instanceof n||null==e?e:new n(e)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e),this.nativeColOff=Math.floor((e-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e),this.nativeRowOff=Math.floor((e-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}}t.exports=n},{"../utils/col-cache":19}],3:[function(e,t,r){const a=e("../utils/col-cache"),n=e("../utils/under-dash"),i=e("./enums"),{slideFormula:s}=e("../utils/shared-formula"),o=e("./note");class h{constructor(e,t,r){if(!e||!t)throw new Error("A Cell needs a Row");this._row=e,this._column=t,a.validateAddress(r),this._address=r,this._value=l.create(h.Types.Null,this),this.style=this._mergeStyle(e.style,t.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,r){const a=e&&e.numFmt||t&&t.numFmt;a&&(r.numFmt=a);const n=e&&e.font||t&&t.font;n&&(r.font=n);const i=e&&e.alignment||t&&t.alignment;i&&(r.alignment=i);const s=e&&e.border||t&&t.border;s&&(r.border=s);const o=e&&e.fill||t&&t.fill;o&&(r.fill=o);const h=e&&e.protection||t&&t.protection;return h&&(r.protection=h),r}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===h.Types.Merge}merge(e,t){this._value.release(),this._value=l.create(h.Types.Merge,this,e),t||(this.style=e.style)}unmerge(){this.type===h.Types.Merge&&(this._value.release(),this._value=l.create(h.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(e){return this._value.type===h.Types.Merge&&this._value.isMergedTo(e)}get master(){return this.type===h.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===h.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(e){this.type!==h.Types.Merge?(this._value.release(),this._value=l.create(l.getType(e),this,e)):this._value.master.value=e}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new o(e)}get text(){return this._value.toString()}get html(){return n.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(e){this.type===h.Types.String&&(this._value=l.create(h.Types.Hyperlink,this,{text:this._value.value,hyperlink:e}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){const{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach(e=>{t.addEx(this.fullAddress,e)})}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){const{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){this._value.release(),this._value=l.create(e.type,this),this._value.model=e,e.comment&&"note"===e.comment.type&&(this._comment=o.fromModel(e.comment)),e.style?this.style=e.style:this.style={}}}h.Types=i.ValueType;const l={getType:e=>null==e?h.Types.Null:e instanceof String||"string"==typeof e?h.Types.String:"number"==typeof e?h.Types.Number:"boolean"==typeof e?h.Types.Boolean:e instanceof Date?h.Types.Date:e.text&&e.hyperlink?h.Types.Hyperlink:e.formula||e.sharedFormula?h.Types.Formula:e.richText?h.Types.RichText:e.sharedString?h.Types.SharedString:e.error?h.Types.Error:h.Types.JSON,types:[{t:h.Types.Null,f:class{constructor(e){this.model={address:e.address,type:h.Types.Null}}get value(){return null}set value(e){}get type(){return h.Types.Null}get effectiveType(){return h.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){}toString(){return""}}},{t:h.Types.Number,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.Number}get effectiveType(){return h.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:h.Types.String,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.String}get effectiveType(){return h.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:h.Types.Date,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.Date}get effectiveType(){return h.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:h.Types.Hyperlink,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){const e={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(e.tooltip=this.model.tooltip),e}set value(e){this.model={text:e.text,hyperlink:e.hyperlink},e.tooltip&&(this.model.tooltip=e.tooltip)}get text(){return this.model.text}set text(e){this.model.text=e}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return h.Types.Hyperlink}get effectiveType(){return h.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:h.Types.Formula,f:class{constructor(e,t){this.cell=e,this.model={address:e.address,type:h.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0}}_copyModel(e){const t={},r=r=>{const a=e[r];a&&(t[r]=a)};return r("formula"),r("result"),r("ref"),r("shareType"),r("sharedFormula"),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(l.getType(e)){case h.Types.Null:case h.Types.String:case h.Types.Number:case h.Types.Date:break;case h.Types.Hyperlink:case h.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?i.FormulaType.Master:this.model.sharedFormula?i.FormulaType.Shared:i.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return h.Types.Formula}get effectiveType(){const e=this.model.result;return null==e?i.ValueType.Null:e instanceof String||"string"==typeof e?i.ValueType.String:"number"==typeof e?i.ValueType.Number:e instanceof Date?i.ValueType.Date:e.text&&e.hyperlink?i.ValueType.Hyperlink:e.formula?i.ValueType.Formula:i.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&s(t.formula,t.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:h.Types.Merge,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof h?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return h.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:h.Types.JSON,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return h.Types.String}get effectiveType(){return h.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:h.Types.SharedString,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.SharedString}get effectiveType(){return h.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:h.Types.RichText,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map(e=>e.text).join("")}get type(){return h.Types.RichText}get effectiveType(){return h.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:h.Types.Boolean,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.Boolean}get effectiveType(){return h.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:h.Types.Error,f:class{constructor(e,t){this.model={address:e.address,type:h.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return h.Types.Error}get effectiveType(){return h.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,r){const a=this.types[e];if(!a)throw new Error("Could not create Value of type "+e);return new a(t,r)}};t.exports=h},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,t,r){const a=e("../utils/under-dash"),n=e("./enums"),i=e("../utils/col-cache");class s{constructor(e,t,r){this._worksheet=e,this._number=t,!1!==r&&(this.defn=r)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return i.n2l(this._number)}get isCustomWidth(){return void 0!==this.width&&9!==this.width}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=void 0!==e.width?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){void 0!==e?(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e})):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&a.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,t){const r=this.number;t||(t=e,e=null),this._worksheet.eachRow(e,(e,a)=>{t(e.getCell(r),a)})}get values(){const e=[];return this.eachCell((t,r)=>{t&&t.type!==n.ValueType.Null&&(e[r]=t.value)}),e}set values(e){if(!e)return;const t=this.number;let r=0;e.hasOwnProperty("0")&&(r=1),e.forEach((e,a)=>{this._worksheet.getCell(a+r,t).value=e})}_applyStyle(e,t){return this.style[e]=t,this.eachCell(r=>{r[e]=t}),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const t=[];let r=null;return e&&e.forEach((e,a)=>{e.isDefault?r&&(r=null):r&&e.equivalentTo(r)?r.max=a+1:(r={min:a+1,max:a+1,width:void 0!==e.width?e.width:9,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(r))}),t.length?t:void 0}static fromModel(e,t){const r=[];let a=1,n=0;for(t=(t=t||[]).sort(function(e,t){return e.min-t.min});n<t.length;){const i=t[n++];for(;a<i.min;)r.push(new s(e,a++));for(;a<=i.max;)r.push(new s(e,a++,i))}return r.length?r:null}}t.exports=s},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(e,t,r){t.exports=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){return this.model[e]}remove(e){this.model[e]=void 0}}},{}],6:[function(e,t,r){const a=e("../utils/under-dash"),n=e("../utils/col-cache"),i=e("../utils/cell-matrix"),s=e("./range"),o=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;t.exports=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new i)}add(e,t){const r=n.decodeEx(e);this.addEx(r,t)}addEx(e,t){const r=this.getMatrix(t);if(e.top)for(let t=e.left;t<=e.right;t++)for(let a=e.top;a<=e.bottom;a++){const i={sheetName:e.sheetName,address:n.n2l(t)+a,row:a,col:t};r.addCellEx(i)}else r.addCellEx(e)}remove(e,t){const r=n.decodeEx(e);this.removeEx(r,t)}removeEx(e,t){this.getMatrix(t).removeCellEx(e)}removeAllNames(e){a.each(this.matrixMap,t=>{t.removeCellEx(e)})}forEach(e){a.each(this.matrixMap,(t,r)=>{t.forEach(t=>{e(r,t)})})}getNames(e){return this.getNamesEx(n.decodeEx(e))}getNamesEx(e){return a.map(this.matrixMap,(t,r)=>t.findCellEx(e)&&r).filter(Boolean)}_explore(e,t){t.mark=!1;const{sheetName:r}=t,a=new s(t.row,t.col,t.row,t.col,r);let n,i;function o(n,i){const s=e.findCellAt(r,n,t.col);return!(!s||!s.mark||(a[i]=n,s.mark=!1,0))}for(i=t.row-1;o(i,"top");i--);for(i=t.row+1;o(i,"bottom");i++);function h(t,n){const s=[];for(i=a.top;i<=a.bottom;i++){const a=e.findCellAt(r,i,t);if(!a||!a.mark)return!1;s.push(a)}a[n]=t;for(let e=0;e<s.length;e++)s[e].mark=!1;return!0}for(n=t.col-1;h(n,"left");n--);for(n=t.col+1;h(n,"right");n++);return a}getRanges(e,t){return(t=t||this.matrixMap[e])?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,r)=>{e&&(e.row===t&&e.col===r||(e.row=t,e.col=r,e.address=n.n2l(r)+t))})}spliceRows(e,t,r,n){a.each(this.matrixMap,a=>{a.spliceRows(e,t,r,n),this.normaliseMatrix(a,e)})}spliceColumns(e,t,r,n){a.each(this.matrixMap,a=>{a.spliceColumns(e,t,r,n),this.normaliseMatrix(a,e)})}get model(){return a.map(this.matrixMap,(e,t)=>this.getRanges(t,e)).filter(e=>e.ranges.length)}set model(e){const t=this.matrixMap={};e.forEach(e=>{const r=t[e.name]=new i;e.ranges.forEach(e=>{o.test(e.split("!").pop()||"")&&r.addCell(e)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,t,r){t.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(e,t,r){const a=e("../utils/col-cache"),n=e("./anchor");t.exports=class{constructor(e,t){this.worksheet=e,this.model=t}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(e){let{type:t,imageId:r,range:i,hyperlinks:s}=e;if(this.type=t,this.imageId=r,"image"===t)if("string"==typeof i){const e=a.decode(i);this.range={tl:new n(this.worksheet,{col:e.left,row:e.top},-1),br:new n(this.worksheet,{col:e.right,row:e.bottom},0),editAs:"oneCell"}}else this.range={tl:new n(this.worksheet,i.tl,0),br:i.br&&new n(this.worksheet,i.br,0),ext:i.ext,editAs:i.editAs,hyperlinks:s||i.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,t,r){const a=e("../utils/under-dash");class n{constructor(e){this.note=e}get model(){let e=null;return e="string"==typeof this.note?{type:"note",note:{texts:[{text:this.note}]}}:{type:"note",note:this.note},a.deepMerge({},n.DEFAULT_CONFIGS,e)}set model(e){const{note:t}=e,{texts:r}=t;1===r.length&&1===Object.keys(r[0]).length?this.note=r[0].text:this.note=t}static fromModel(e){const t=new n;return t.model=e,t}}n.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},t.exports=n},{"../utils/under-dash":26}],10:[function(e,t,r){const a=e("../utils/col-cache");class n{constructor(){this.decode(arguments)}setTLBR(e,t,r,n,i){if(arguments.length<4){const n=a.decodeAddress(e),s=a.decodeAddress(t);this.model={top:Math.min(n.row,s.row),left:Math.min(n.col,s.col),bottom:Math.max(n.row,s.row),right:Math.max(n.col,s.col),sheetName:r},this.setTLBR(n.row,n.col,s.row,s.col,i)}else this.model={top:Math.min(e,r),left:Math.min(t,n),bottom:Math.max(e,r),right:Math.max(t,n),sheetName:i}}decode(e){switch(e.length){case 5:this.setTLBR(e[0],e[1],e[2],e[3],e[4]);break;case 4:this.setTLBR(e[0],e[1],e[2],e[3]);break;case 3:this.setTLBR(e[0],e[1],e[2]);break;case 2:this.setTLBR(e[0],e[1]);break;case 1:{const t=e[0];if(t instanceof n)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{const e=a.decodeEx(t);e.top?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+e.length)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){const{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?e+"!":`'${e}'!`:""}expand(e,t,r,a){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||r>this.bottom)&&(this.bottom=r),(!this.model.right||a>this.right)&&(this.right=a)}expandRow(e){if(e){const{dimensions:t,number:r}=e;t&&this.expand(r,t.min,r,t.max)}}expandToAddress(e){const t=a.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return a.n2l(this.left)+this.top}get $t$l(){return`$${a.n2l(this.left)}$${this.top}`}get br(){return a.n2l(this.right)+this.bottom}get $b$r(){return`$${a.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return!(e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName||e.bottom<this.top||e.top>this.bottom||e.right<this.left||e.left>this.right)}contains(e){const t=a.decodeEx(e);return this.containsEx(t)}containsEx(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let r=this.top;r<=this.bottom;r++)e(a.encodeAddress(r,t),r,t)}}t.exports=n},{"../utils/col-cache":19}],11:[function(e,t,r){const a=e("../utils/under-dash"),n=e("./enums"),i=e("../utils/col-cache"),s=e("./cell");t.exports=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){const r=this._worksheet.getColumn(e.col);t=new s(this,r,e.address),this._cells[e.col-1]=t}return t}getCell(e){if("string"==typeof e){const t=this._worksheet.getColumnKey(e);e=t?t.number:i.l2n(e)}return this._cells[e-1]||this.getCellEx({address:i.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,t){const r=e+t;for(var a=arguments.length,n=new Array(a>2?a-2:0),i=2;i<a;i++)n[i-2]=arguments[i];const s=n.length-t,o=this._cells.length;let h,l,d;if(s<0)for(h=e+n.length;h<=o;h++)d=this._cells[h-1],l=this._cells[h-s-1],l?(d=this.getCell(h),d.value=l.value,d.style=l.style,d._comment=l._comment):d&&(d.value=null,d.style={},d._comment=void 0);else if(s>0)for(h=o;h>=r;h--)l=this._cells[h-1],l?(d=this.getCell(h+s),d.value=l.value,d.style=l.style,d._comment=l._comment):this._cells[h+s-1]=void 0;for(h=0;h<n.length;h++)d=this.getCell(e+h),d.value=n[h],d.style={},d._comment=void 0}eachCell(e,t){if(t||(t=e,e=null),e&&e.includeEmpty){const e=this._cells.length;for(let r=1;r<=e;r++)t(this.getCell(r),r)}else this._cells.forEach((e,r)=>{e&&e.type!==n.ValueType.Null&&t(e,r+1)})}addPageBreak(e,t){const r=this._worksheet,a=Math.max(0,e-1)||0,n=Math.max(0,t-1)||16838,i={id:this._number,max:n,man:1};a&&(i.min=a),r.rowBreaks.push(i)}get values(){const e=[];return this._cells.forEach(t=>{t&&t.type!==n.ValueType.Null&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;e.hasOwnProperty("0")&&(t=1),e.forEach((e,r)=>{void 0!==e&&(this.getCellEx({address:i.encodeAddress(this._number,r+t),row:this._number,col:r+t}).value=e)})}else this._worksheet.eachColumnKey((t,r)=>{void 0!==e[r]&&(this.getCellEx({address:i.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[r])})}get hasValues(){return a.some(this._cells,e=>e&&e.type!==n.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,t=0;return this._cells.forEach(r=>{r&&r.type!==n.ValueType.Null&&((!e||e>r.col)&&(e=r.col),t<r.col&&(t=r.col))}),e>0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach(r=>{r&&(r[e]=t)}),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const e=[];let t=0,r=0;return this._cells.forEach(a=>{if(a){const n=a.model;n&&((!t||t>a.col)&&(t=a.col),r<a.col&&(r=a.col),e.push(n))}}),this.height||e.length?{cells:e,number:this.number,min:t,max:r,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(e){if(e.number!==this._number)throw new Error("Invalid row number in model");let t;this._cells=[],e.cells.forEach(e=>{switch(e.type){case s.Types.Merge:break;default:{let r;if(e.address)r=i.decodeAddress(e.address);else if(t){const{row:e}=t,a=t.col+1;r={row:e,col:a,address:i.encodeAddress(e,a),$col$row:`$${i.n2l(a)}$${e}`}}t=r,this.getCellEx(r).model=e;break}}}),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,t,r){const a=e("../utils/col-cache");class n{constructor(e,t,r){this.table=e,this.column=t,this.index=r}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set("name",e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set("totalsRowLabel",e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set("totalsRowFunction",e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set("totalsRowResult",e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set("totalsRowFormula",e)}}t.exports=class{constructor(e,t){this.worksheet=e,t&&(this.table=t,this.validate(),this.store())}getFormula(e){switch(e.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${e.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${e.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${e.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${e.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${e.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${e.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${e.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${e.name}])`;case"custom":return e.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+e.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:e}=this,t=(e,t,r)=>{void 0===e[t]&&(e[t]=r)};t(e,"headerRow",!0),t(e,"totalsRow",!1),t(e,"style",{}),t(e.style,"theme","TableStyleMedium2"),t(e.style,"showFirstColumn",!1),t(e.style,"showLastColumn",!1),t(e.style,"showRowStripes",!1),t(e.style,"showColumnStripes",!1);const r=(e,t)=>{if(!e)throw new Error(t)};r(e.ref,"Table must have ref"),r(e.columns,"Table must have column definitions"),r(e.rows,"Table must have row definitions"),e.tl=a.decodeAddress(e.ref);const{row:n,col:i}=e.tl;r(n>0,"Table must be on valid row"),r(i>0,"Table must be on valid col");const{width:s,filterHeight:o,tableHeight:h}=this;e.autoFilterRef=a.encode(n,i,n+o-1,i+s-1),e.tableRef=a.encode(n,i,n+h-1,i+s-1),e.columns.forEach((e,a)=>{r(e.name,`Column ${a} must have a name`),0===a?t(e,"totalsRowLabel","Total"):(t(e,"totalsRowFunction","none"),e.totalsRowFormula=this.getFormula(e))})}store(){const e=(e,t)=>{t&&Object.keys(t).forEach(r=>{e[r]=t[r]})},{worksheet:t,table:r}=this,{row:a,col:n}=r.tl;let i=0;if(r.headerRow){const s=t.getRow(a+i++);r.columns.forEach((t,r)=>{const{style:a,name:i}=t,o=s.getCell(n+r);o.value=i,e(o,a)})}if(r.rows.forEach(s=>{const o=t.getRow(a+i++);s.forEach((t,a)=>{const i=o.getCell(n+a);i.value=t,e(i,r.columns[a].style)})}),r.totalsRow){const s=t.getRow(a+i++);r.columns.forEach((t,r)=>{const a=s.getCell(n+r);if(0===r)a.value=t.totalsRowLabel;else{const e=this.getFormula(t);a.value=e?{formula:t.totalsRowFormula,result:t.totalsRowResult}:null}e(a,t.style)})}}load(e){const{table:t}=this,{row:r,col:a}=t.tl;let n=0;if(t.headerRow){const i=e.getRow(r+n++);t.columns.forEach((e,t)=>{i.getCell(a+t).value=e.name})}if(t.rows.forEach(t=>{const i=e.getRow(r+n++);t.forEach((e,t)=>{i.getCell(a+t).value=e})}),t.totalsRow){const i=e.getRow(r+n++);t.columns.forEach((e,t)=>{const r=i.getCell(a+t);0===t?r.value=e.totalsRowLabel:this.getFormula(e)&&(r.value={formula:e.totalsRowFormula,result:e.totalsRowResult})})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const e=a.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++)r.getCell(e.col+t).value=null}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++)r.getCell(e.col+t).value=null}for(let t=0;t<this.tableHeight;t++){const r=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++)r.getCell(e.col+t).value=null}}this.store()}addRow(e,t){this.cacheState(),void 0===t?this.table.rows.push(e):this.table.rows.splice(t,0,e)}removeRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){const t=this.table.columns[e];return new n(this,t,e)}addColumn(e,t,r){this.cacheState(),void 0===r?(this.table.columns.push(e),this.table.rows.forEach((e,r)=>{e.push(t[r])})):(this.table.columns.splice(r,0,e),this.table.rows.forEach((e,a)=>{e.splice(r,0,t[a])}))}removeColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(r=>{r.splice(e,t)})}_assign(e,t,r){this.cacheState(),e[t]=r}get ref(){return this.table.ref}set ref(e){this._assign(this.table,"ref",e)}get name(){return this.table.name}set name(e){this.table.name=e}get displayName(){return this.table.displyName||this.table.name}set displayNamename(e){this.table.displayName=e}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,"headerRow",e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,"totalsRow",e)}get theme(){return this.table.style.name}set theme(e){this.table.style.name=e}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(e){this.table.style.showFirstColumn=e}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(e){this.table.style.showLastColumn=e}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(e){this.table.style.showRowStripes=e}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(e){this.table.style.showColumnStripes=e}}},{"../utils/col-cache":19}],13:[function(e,t,r){const a=e("./worksheet"),n=e("./defined-names"),i=e("../xlsx/xlsx"),s=e("../csv/csv");t.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new n}get xlsx(){return this._xlsx||(this._xlsx=new i(this)),this._xlsx}get csv(){return this._csv||(this._csv=new s(this)),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){const r=this.nextId;t&&("string"==typeof t?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),t={properties:{tabColor:{argb:t}}}):(t.argb||t.theme||t.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),t={properties:{tabColor:t}}));const n=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=Object.assign({},t,{id:r,name:e,orderNo:n+1,workbook:this}),s=new a(i);return this._worksheets[r]=s,s}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){const t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){return void 0===e?this._worksheets.find(Boolean):"number"==typeof e?this._worksheets[e]:"string"==typeof e?this._worksheets.find(t=>t&&t.name===e):void 0}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){const t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{const{id:r,name:n,state:i}=t,s=e.sheets&&e.sheets.findIndex(e=>e.id===r);(this._worksheets[r]=new a({id:r,name:n,orderNo:s,state:i,workbook:this})).model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,t,r){const a=e("../utils/under-dash"),n=e("../utils/col-cache"),i=e("./range"),s=e("./row"),o=e("./column"),h=e("./enums"),l=e("./image"),d=e("./table"),c=e("./data-validations"),u=e("../utils/encryptor"),{copyStyle:f}=e("../utils/copy-style");t.exports=class{constructor(e){e=e||{},this._workbook=e.workbook,this.id=e.id,this.orderNo=e.orderNo,this.name=e.name,this.state=e.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new c,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(void 0===e&&(e="sheet"+this.id),this._name!==e){if("string"!=typeof e)throw new Error("The name has to be a string.");if(""===e)throw new Error("The name can't be empty.");if("History"===e)throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(e))throw new Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+e);if(e&&e.length>31&&(console.warn(`Worksheet name ${e} exceeds 31 chars. This will be truncated`),e=e.substring(0,31)),this._workbook._worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw new Error("Worksheet name already exists: "+e);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const e=new i;return this._rows.forEach(t=>{if(t){const r=t.dimensions;r&&e.expand(t.number,r.min,t.number,r.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{const r=(t.header?1:t.headers&&t.headers.length)||0;return Math.max(e,r)},0);let t=1;const r=this._columns=[];e.forEach(e=>{const a=new o(this,t++,!1);r.push(a),a.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){a.each(this._keys,e)}getColumn(e){if("string"==typeof e){const t=this._keys[e];if(t)return t;e=n.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new o(this,t++))}return this._columns[e-1]}spliceColumns(e,t){const r=this._rows.length;for(var a=arguments.length,n=new Array(a>2?a-2:0),i=2;i<a;i++)n[i-2]=arguments[i];if(n.length>0)for(let a=0;a<r;a++){const r=[e,t];n.forEach(e=>{r.push(e[a]||null)});const i=this.getRow(a+1);i.splice.apply(i,r)}else this._rows.forEach(r=>{r&&r.splice(e,t)});const s=n.length-t,o=e+t,h=this._columns.length;if(s<0)for(let t=e+n.length;t<=h;t++)this.getColumn(t).defn=this.getColumn(t-s).defn;else if(s>0)for(let e=h;e>=o;e--)this.getColumn(e+s).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){const e=[];let t=0;return this.eachRow(r=>{r.eachCell(r=>{let{col:a}=r;e[a]||(e[a]=!0,t++)})}),t}_commitRow(){}get _lastRowNumber(){const e=this._rows;let t=e.length;for(;t>0&&void 0===e[t-1];)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||(t=this._rows[e-1]=new s(this,e)),t}getRows(e,t){if(t<1)return;const r=[];for(let a=e;a<e+t;a++)r.push(this.getRow(a));return r}addRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=this._nextRow,a=this.getRow(r);return a.values=e,this._setStyleOption(r,"i"===t[0]?t:"n"),a}addRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=[];return e.forEach(e=>{r.push(this.addRow(e,t))}),r}insertRow(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";return this.spliceRows(e,0,t),this._setStyleOption(e,r),this.getRow(e)}insertRows(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";if(this.spliceRows(e,0,...t),"n"!==r)for(let a=0;a<t.length;a++)"o"===r[0]&&void 0!==this.findRow(t.length+e+a)?this._copyStyle(t.length+e+a,e+a,"+"===r[1]):"i"===r[0]&&void 0!==this.findRow(e-1)&&this._copyStyle(e-1,e+a,"+"===r[1]);return this.getRows(e,t.length)}_setStyleOption(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";"o"===t[0]&&void 0!==this.findRow(e+1)?this._copyStyle(e+1,e,"+"===t[1]):"i"===t[0]&&void 0!==this.findRow(e-1)&&this._copyStyle(e-1,e,"+"===t[1])}_copyStyle(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=this.getRow(e),n=this.getRow(t);n.style=f(a.style),a.eachCell({includeEmpty:r},(e,t)=>{n.getCell(t).style=f(e.style)}),n.height=a.height}duplicateRow(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=this._rows[e-1],n=new Array(t).fill(a.values);this.spliceRows(e+1,r?0:t,...n);for(let r=0;r<t;r++){const t=this._rows[e+r];t.style=a.style,t.height=a.height,a.eachCell({includeEmpty:!0},(e,r)=>{t.getCell(r).style=e.style})}}spliceRows(e,t){const r=e+t;for(var a=arguments.length,n=new Array(a>2?a-2:0),i=2;i<a;i++)n[i-2]=arguments[i];const s=n.length,o=s-t,h=this._rows.length;let l,d;if(o<0)for(e===h&&(this._rows[h-1]=void 0),l=r;l<=h;l++)if(d=this._rows[l-1],d){const e=this.getRow(l+o);e.values=d.values,e.style=d.style,e.height=d.height,d.eachCell({includeEmpty:!0},(t,r)=>{e.getCell(r).style=t.style}),this._rows[l-1]=void 0}else this._rows[l+o-1]=void 0;else if(o>0)for(l=h;l>=r;l--)if(d=this._rows[l-1],d){const e=this.getRow(l+o);e.values=d.values,e.style=d.style,e.height=d.height,d.eachCell({includeEmpty:!0},(t,r)=>{if(e.getCell(r).style=t.style,"MergeValue"===t._value.constructor.name){const e=this.getRow(t._row._number+s).getCell(r),a=t._value._master,n=this.getRow(a._row._number+s).getCell(a._column._number);e.merge(n)}})}else this._rows[l+o-1]=void 0;for(l=0;l<s;l++){const t=this.getRow(e+l);t.style={},t.values=n[l]}this.workbook.definedNames.spliceRows(this.name,e,t,s)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){const e=this._rows.length;for(let r=1;r<=e;r++)t(this.getRow(r),r)}else this._rows.forEach(e=>{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){const e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){const r=n.getAddress(e,t),a=this._rows[r.row-1];return a?a.findCell(r.col):void 0}getCell(e,t){const r=n.getAddress(e,t);return this.getRow(r.row).getCellEx(r)}mergeCells(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const a=new i(t);this._mergeCellsInternal(a)}mergeCellsWithoutStyle(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const a=new i(t);this._mergeCellsInternal(a,!0)}_mergeCellsInternal(e,t){a.each(this._merges,t=>{if(t.intersects(e))throw new Error("Cannot merge already merged cells")});const r=this.getCell(e.top,e.left);for(let a=e.top;a<=e.bottom;a++)for(let n=e.left;n<=e.right;n++)(a>e.top||n>e.left)&&this.getCell(a,n).merge(r,t);this._merges[r.address]=e}_unMergeMaster(e){const t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let r=t.left;r<=t.right;r++)this.getCell(e,r).unmerge();delete this._merges[e.address]}}get hasMerges(){return a.some(this._merges,Boolean)}unMergeCells(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const a=new i(t);for(let e=a.top;e<=a.bottom;e++)for(let t=a.left;t<=a.right;t++){const r=this.findCell(e,t);r&&(r.type===h.ValueType.Merge?this._unMergeMaster(r.master):this._merges[r.address]&&this._unMergeMaster(r))}}fillFormula(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"shared";const i=n.decode(e),{top:s,left:o,bottom:h,right:l}=i,d=l-o+1,c=n.encodeAddress(s,o),u="shared"===a;let f;f="function"==typeof r?r:Array.isArray(r)?Array.isArray(r[0])?(e,t)=>r[e-s][t-o]:(e,t)=>r[(e-s)*d+(t-o)]:()=>{};let p=!0;for(let r=s;r<=h;r++)for(let n=o;n<=l;n++)p?(this.getCell(r,n).value={shareType:a,formula:t,ref:e,result:f(r,n)},p=!1):this.getCell(r,n).value=u?{sharedFormula:c,result:f(r,n)}:f(r,n)}addImage(e,t){const r={type:"image",imageId:e,range:t};this._media.push(new l(this,r))}getImages(){return this._media.filter(e=>"image"===e.type)}addBackgroundImage(e){const t={type:"background",imageId:e};this._media.push(new l(this,t))}getBackgroundImageId(){const e=this._media.find(e=>"background"===e.type);return e&&e.imageId}protect(e,t){return new Promise(r=>{this.sheetProtection={sheet:!0},t&&"spinCount"in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=u.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=t&&"spinCount"in t?t.spinCount:1e5,this.sheetProtection.hashValue=u.convertPasswordToHash(e,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&"spinCount"in t&&delete this.sheetProtection.spinCount),r()})}unprotect(){this.sheetProtection=null}addTable(e){const t=new d(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){"number"==typeof e?this.conditionalFormattings.splice(e,1):this.conditionalFormattings=e instanceof Function?this.conditionalFormattings.filter(e):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(e){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=e}get model(){const e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),conditionalFormattings:this.conditionalFormattings};e.cols=o.toModel(this.columns);const t=e.rows=[],r=e.dimensions=new i;return this._rows.forEach(e=>{const a=e&&e.model;a&&(r.expand(a.number,a.min,a.number,a.max),t.push(a))}),e.merges=[],a.each(this._merges,t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows.forEach(e=>{const t=new s(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){a.each(e.mergeCells,e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=o.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new c(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new l(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{const r=new d;return r.model=t,e[t.name]=r,e},{}),this.conditionalFormattings=e.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,t,r){e("core-js/modules/es.promise"),e("core-js/modules/es.promise.finally"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.values"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.async-iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.find"),e("core-js/modules/es.string.from-code-point"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.number.is-nan"),e("regenerator-runtime/runtime");const a={Workbook:e("./doc/workbook")},n=e("./doc/enums");Object.keys(n).forEach(e=>{a[e]=n[e]}),t.exports=a},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,t,r){const a="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");r.bufferToString=function(e){return"string"==typeof e?e:a?a.decode(e):e.toString()}},{}],17:[function(e,t,r){const a="undefined"==typeof TextEncoder?null:new TextEncoder("utf-8"),{Buffer:n}=e("buffer");r.stringToBuffer=function(e){return"string"!=typeof e?e:a?n.from(a.encode(e).buffer):n.from(e)}},{buffer:220}],18:[function(e,t,r){const a=e("./under-dash"),n=e("./col-cache");t.exports=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(n.decodeEx(e))}getCell(e){return this.findCellEx(n.decodeEx(e),!0)}findCell(e){return this.findCellEx(n.decodeEx(e),!1)}findCellAt(e,t,r){const a=this.sheets[e],n=a&&a[t];return n&&n[r]}addCellEx(e){if(e.top)for(let t=e.top;t<=e.bottom;t++)for(let r=e.left;r<=e.right;r++)this.getCellAt(e.sheetName,t,r);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){const r=this.findSheet(e,t),a=this.findSheetRow(r,e,t);return this.findRowCell(a,e,t)}getCellAt(e,t,r){const a=this.sheets[e]||(this.sheets[e]=[]),i=a[t]||(a[t]=[]);return i[r]||(i[r]={sheetName:e,address:n.n2l(r)+t,row:t,col:r})}removeCellEx(e){const t=this.findSheet(e);if(!t)return;const r=this.findSheetRow(t,e);r&&delete r[e.col]}forEachInSheet(e,t){const r=this.sheets[e];r&&r.forEach((e,r)=>{e&&e.forEach((e,a)=>{e&&t(e,r,a)})})}forEach(e){a.each(this.sheets,(t,r)=>{this.forEachInSheet(r,e)})}map(e){const t=[];return this.forEach(r=>{t.push(e(r))}),t}findSheet(e,t){const r=e.sheetName;return this.sheets[r]?this.sheets[r]:t?this.sheets[r]=[]:void 0}findSheetRow(e,t,r){const{row:a}=t;return e&&e[a]?e[a]:r?e[a]=[]:void 0}findRowCell(e,t,r){const{col:a}=t;return e&&e[a]?e[a]:r?e[a]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t:void 0}spliceRows(e,t,r,a){const n=this.sheets[e];if(n){const e=[];for(let t=0;t<a;t++)e.push([]);n.splice(t,r,...e)}}spliceColumns(e,t,r,n){const i=this.sheets[e];if(i){const e=[];for(let t=0;t<n;t++)e.push(null);a.each(i,a=>{a.splice(t,r,...e)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,t,r){const a=/^[A-Z]+\d+$/,n={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:e=>e<=26?1:e<=676?2:3,_fill(e){let t,r,a,n,i,s=1;if(e>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&e>=1){for(;s<=26;)t=this._dictionary[s-1],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(s=27;s<=702;)r=s-27,a=r%26,n=Math.floor(r/26),t=this._dictionary[n]+this._dictionary[a],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(s=703;s<=16384;)r=s-703,a=r%26,n=Math.floor(r/26)%26,i=Math.floor(r/676),t=this._dictionary[i]+this._dictionary[n]+this._dictionary[a],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw new Error("Out of bounds. Invalid column letter: "+e);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw new Error(e+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},validateAddress(e){if(!a.test(e))throw new Error("Invalid Address: "+e);return!0},decodeAddress(e){const t=e.length<5&&this._hash[e];if(t)return t;let r=!1,a="",n=0,i=!1,s="",o=0;for(let t,h=0;h<e.length;h++)if(t=e.charCodeAt(h),!i&&t>=65&&t<=90)r=!0,a+=e[h],n=26*n+t-64;else if(t>=48&&t<=57)i=!0,s+=e[h],o=10*o+t-48;else if(i&&r&&36!==t)break;if(r){if(n>16384)throw new Error("Out of bounds. Invalid column letter: "+a)}else n=void 0;i||(o=void 0);const h={address:e=a+s,col:n,row:o,$col$row:`$${a}$${s}`};return n<=100&&o<=100&&(this._hash[e]=h,this._hash[h.$col$row]=h),h},getAddress(e,t){if(t){const r=this.n2l(t)+e;return this.decodeAddress(r)}return this.decodeAddress(e)},decode(e){const t=e.split(":");if(2===t.length){const e=this.decodeAddress(t[0]),r=this.decodeAddress(t[1]),a={top:Math.min(e.row,r.row),left:Math.min(e.col,r.col),bottom:Math.max(e.row,r.row),right:Math.max(e.col,r.col)};return a.tl=this.n2l(a.left)+a.top,a.br=this.n2l(a.right)+a.bottom,a.dimensions=`${a.tl}:${a.br}`,a}return this.decodeAddress(e)},decodeEx(e){const t=e.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),r=t[1]||t[2],a=t[3],n=a.split(":");if(n.length>1){let e=this.decodeAddress(n[0]),t=this.decodeAddress(n[1]);const a=Math.min(e.row,t.row),i=Math.min(e.col,t.col),s=Math.max(e.row,t.row),o=Math.max(e.col,t.col);return e=this.n2l(i)+a,t=this.n2l(o)+s,{top:a,left:i,bottom:s,right:o,sheetName:r,tl:{address:e,col:i,row:a,$col$row:`$${this.n2l(i)}$${a}`,sheetName:r},br:{address:t,col:o,row:s,$col$row:`$${this.n2l(o)}$${s}`,sheetName:r},dimensions:`${e}:${t}`}}if(a.startsWith("#"))return r?{sheetName:r,error:a}:{error:a};const i=this.decodeAddress(a);return r?{sheetName:r,...i}:i},encodeAddress:(e,t)=>n.n2l(t)+e,encode(){switch(arguments.length){case 2:return n.encodeAddress(arguments[0],arguments[1]);case 4:return`${n.encodeAddress(arguments[0],arguments[1])}:${n.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(e,t){const[r,a,,n,i]=e,[s,o]=t;return s>=r&&s<=n&&o>=a&&o<=i}};t.exports=n},{}],20:[function(e,t,r){const a=(e,t)=>({...e,...t.reduce((t,r)=>(e[r]&&(t[r]={...e[r]}),t),{})}),n=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];e[r]&&(t[r]=a(e[r],n))};r.copyStyle=e=>{if(!e)return e;if(t=e,0===Object.keys(t).length)return{};var t;const r={...e};return n(e,r,"font",["color"]),n(e,r,"alignment"),n(e,r,"protection"),e.border&&(n(e,r,"border"),n(e.border,r.border,"top",["color"]),n(e.border,r.border,"left",["color"]),n(e.border,r.border,"bottom",["color"]),n(e.border,r.border,"right",["color"]),n(e.border,r.border,"diagonal",["color"])),e.fill&&(n(e,r,"fill",["fgColor","bgColor","center"]),e.fill.stops&&(r.fill.stops=e.fill.stops.map(e=>a(e,["color"])))),r}},{}],21:[function(e,t,r){(function(r){(function(){const a=e("crypto"),n={hash(e){const t=a.createHash(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return t.update(r.concat(i)),t.digest()},convertPasswordToHash(e,t,n,i){if(t=t.toLowerCase(),a.getHashes().indexOf(t)<0)throw new Error(`Hash algorithm '${t}' not supported!`);const s=r.from(e,"utf16le");let o=this.hash(t,r.from(n,"base64"),s);for(let e=0;e<i;e++){const a=r.alloc(4);a.writeUInt32LE(e,0),o=this.hash(t,o,a)}return o.toString("base64")},randomBytes:e=>a.randomBytes(e)};t.exports=n}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(e,t,r){const{SaxesParser:a}=e("saxes"),{PassThrough:n}=e("readable-stream"),{bufferToString:i}=e("./browser-buffer-decode");t.exports=async function*(e){e.pipe&&!e[Symbol.asyncIterator]&&(e=e.pipe(new n));const t=new a;let r;t.on("error",e=>{r=e});let s=[];t.on("opentag",e=>s.push({eventType:"opentag",value:e})),t.on("text",e=>s.push({eventType:"text",value:e})),t.on("closetag",e=>s.push({eventType:"closetag",value:e}));for await(const a of e){if(t.write(i(a)),r)throw r;yield s,s=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,t,r){const a=e("./col-cache"),n=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,i=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;t.exports={slideFormula:function(e,t,r){const s=a.decode(t),o=a.decode(r);return e.replace(n,(e,t,r,n,h)=>{if(h)return e;const l=i.exec(n);if(l){const r=l[1],n=l[2].toUpperCase(),i=l[3],h=l[4];if(n.length>3||3===n.length&&n>"XFD")return e;let d=a.l2n(n),c=parseInt(h,10);return r||(d+=o.col-s.col),i||(c+=o.row-s.row),(t||"")+(r||"")+a.n2l(d)+(i||"")+c}return e})}}},{"./col-cache":19}],24:[function(e,t,r){(function(r,a){(function(){const n=e("readable-stream"),i=e("./utils"),s=e("./string-buf");class o{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,r,a){return this.toBuffer().copy(e,t,r,a)}toBuffer(){return this._buffer||(this._buffer=a.from(this._data,this._encoding)),this._buffer}}class h{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,r,a){return this._data._buf.copy(e,t,r,a)}toBuffer(){return this._data.toBuffer()}}class l{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,r,a){this._data.copy(e,t,r,a)}toBuffer(){return this._data}}class d{constructor(e){this.size=e,this.buffer=a.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(0===this.iRead&&this.iWrite===this.size)return this.buffer;const e=a.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return 0===e?null:void 0===e||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=a.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,r){const a=Math.min(r,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+a),this.iWrite+=a,a}}const c=function(e){e=e||{},this.bufSize=e.bufSize||1048576,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};i.inherits(c,n.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return a.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const e=this.buffers[this.buffers.length-1];if(!e.full)return e}const e=new d(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map(function(t){return new Promise(r=>{t.write(e.toBuffer(),()=>{r()})})}))},_writeToBuffers(e){let t=0;const r=e.length;for(;t<r;)t+=this._getWritableBuffer().write(e,t,r-t)},async write(e,t,n){let d;if(t instanceof Function&&(n=t,t="utf8"),n=n||i.nop,e instanceof s)d=new h(e);else if(e instanceof a)d=new l(e);else{if(!("string"==typeof e||e instanceof String||e instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");d=new o(e,t)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(d);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(d),r.nextTick(n)):(await this._pipe(d),n());else this.paused||this.emit("data",d.toBuffer()),this._writeToBuffers(d),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,r){const a=e=>{e?r(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit("finish"))};e?this.write(e,t,a):a()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){const r=this.buffers[0],a=r.read(e);e-=a.length,t.push(a),r.eod&&r.full&&this.buffers.shift()}return a.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],a.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){this.pipes.push(e),!this.paused&&this.buffers.length&&this.end()},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),t.exports=c}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,t,r){(function(e){(function(){t.exports=class{constructor(t){this._buf=e.alloc(t&&t.size||16384),this._encoding=t&&t.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=e.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e=e||0,this._buffer=void 0,this._inPos=e}_grow(t){let r=2*this._buf.length;for(;r<t;)r*=2;const a=e.alloc(r);this._buf.copy(a,0),this._buf=a}addText(e){this._buffer=void 0;let t=this._inPos+this._buf.write(e,this._inPos,this._encoding);for(;t>=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],26:[function(e,t,r){const{toString:a}=Object.prototype,n=/["&<>]/,i={each:function(e,t){e&&(Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(r=>{t(e[r],r)}))},some:function(e,t){return!!e&&(Array.isArray(e)?e.some(t):Object.keys(e).some(r=>t(e[r],r)))},every:function(e,t){return!e||(Array.isArray(e)?e.every(t):Object.keys(e).every(r=>t(e[r],r)))},map:function(e,t){return e?Array.isArray(e)?e.map(t):Object.keys(e).map(r=>t(e[r],r)):[]},keyBy:(e,t)=>e.reduce((e,r)=>(e[r[t]]=r,e),{}),isEqual:function(e,t){const r=typeof e,a=typeof t,n=Array.isArray(e),s=Array.isArray(t);let o;if(r!==a)return!1;if("object"==typeof e){if(n||s)return!(!n||!s)&&e.length===t.length&&e.every((e,r)=>{const a=t[r];return i.isEqual(e,a)});if(null===e||null===t)return e===t;if(o=Object.keys(e),Object.keys(t).length!==o.length)return!1;for(const e of o)if(!t.hasOwnProperty(e))return!1;return i.every(e,(e,r)=>{const a=t[r];return i.isEqual(e,a)})}return e===t},escapeHtml(e){const t=n.exec(e);if(!t)return e;let r="",a="",i=0,s=t.index;for(;s<e.length;s++){switch(e.charAt(s)){case'"':a="&quot;";break;case"&":a="&amp;";break;case"'":a="&apos;";break;case"<":a="&lt;";break;case">":a="&gt;";break;default:continue}i!==s&&(r+=e.substring(i,s)),i=s+1,r+=a}return i!==s?r+e.substring(i,s):r},strcmp:(e,t)=>e<t?-1:e>t?1:0,isUndefined:e=>"[object Undefined]"===a.call(e),isObject:e=>"[object Object]"===a.call(e),deepMerge(){const e=arguments[0]||{},{length:t}=arguments;let r,a,n;function s(t,s){r=e[s],n=Array.isArray(t),i.isObject(t)||n?(n?(n=!1,a=r&&Array.isArray(r)?r:[]):a=r&&i.isObject(r)?r:{},e[s]=i.deepMerge(a,t)):i.isUndefined(t)||(e[s]=t)}for(let e=0;e<t;e++)i.each(arguments[e],s);return e}};t.exports=i},{}],27:[function(e,t,r){(function(r,a){(function(){const n=e("fs"),i=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,s={nop(){},promiseImmediate:e=>new Promise(t=>{r.setImmediate?a(()=>{t(e)}):setTimeout(()=>{t(e)},1)}),inherits:function(e,t,r,a){e.super_=t,a||(a=r,r=null),r&&Object.keys(r).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))});const n={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};a&&Object.keys(a).forEach(e=>{n[e]=Object.getOwnPropertyDescriptor(a,e)}),e.prototype=Object.create(t.prototype,n)},dateToExcel:(e,t)=>25569+e.getTime()/864e5-(t?1462:0),excelToDate(e,t){const r=Math.round(24*(e-25569+(t?1462:0))*3600*1e3);return new Date(r)},parsePath(e){const t=e.lastIndexOf("/");return{path:e.substring(0,t),name:e.substring(t+1)}},getRelsPath(e){const t=s.parsePath(e);return`${t.path}/_rels/${t.name}.rels`},xmlEncode(e){const t=i.exec(e);if(!t)return e;let r="",a="",n=0,s=t.index;for(;s<e.length;s++){const t=e.charCodeAt(s);switch(t){case 34:a="&quot;";break;case 38:a="&amp;";break;case 39:a="&apos;";break;case 60:a="&lt;";break;case 62:a="&gt;";break;case 127:a="";break;default:if(t<=31&&(t<=8||t>=11&&13!==t)){a="";break}continue}n!==s&&(r+=e.substring(n,s)),n=s+1,a&&(r+=a)}return n!==s?r+e.substring(n,s):r},xmlDecode:e=>e.replace(/&([a-z]*);/g,e=>{switch(e){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":return'"';default:return e}}),validInt(e){const t=parseInt(e,10);return Number.isNaN(t)?0:t},isDateFmt:e=>!!e&&null!==(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/),fs:{exists:e=>new Promise(t=>{n.access(e,n.constants.F_OK,e=>{t(!e)})})},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>!0===e||"true"===e||1===e||"1"===e};t.exports=s}).call(this)}).call(this,void 0!==y?y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{fs:216,timers:523}],28:[function(e,t,r){const a=e("./under-dash"),n=e("./utils");function i(e,t,r){e.push(` ${t}="${n.xmlEncode(r.toString())}"`)}function s(e,t){if(t){const r=[];a.each(t,(e,t)=>{void 0!==e&&i(r,t,e)}),e.push(r.join(""))}}class o{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){const t=this._xml;t.push("<?xml"),s(t,e),t.push("?>\n")}openNode(e,t){const r=this.tos,a=this._xml;r&&this.open&&a.push(">"),this._stack.push(e),a.push("<"),a.push(e),s(a,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");void 0!==t&&i(this._xml,e,t)}addAttributes(e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");s(this._xml,e)}writeText(e){const t=this._xml;this.open&&(t.push(">"),this.open=!1),this.leaf=!1,t.push(n.xmlEncode(e.toString()))}writeXml(e){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(e)}closeNode(){const e=this._stack.pop(),t=this._xml;this.leaf?t.push("/>"):(t.push("</"),t.push(e),t.push(">")),this.open=!1,this.leaf=!1}leafNode(e,t,r){this.openNode(e,t),void 0!==r&&this.writeText(r),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join("")}}o.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},t.exports=o},{"./under-dash":26,"./utils":27}],29:[function(e,t,r){(function(r){(function(){const a=e("events"),n=e("jszip"),i=e("./stream-buf"),{stringToBuffer:s}=e("./browser-buffer-encode");class o extends a.EventEmitter{constructor(e){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},e),this.zip=new n,this.stream=new i}append(e,t){t.hasOwnProperty("base64")&&t.base64?this.zip.file(t.name,e,{base64:!0}):(r.browser&&"string"==typeof e&&(e=s(e)),this.zip.file(t.name,e))}async finalize(){const e=await this.zip.generateAsync(this.options);this.stream.end(e),this.emit("finish")}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}}t.exports={ZipWriter:o}}).call(this)}).call(this,e("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,t,r){t.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(e,t,r){t.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(e,t,r){const a=e("../../utils/parse-sax"),n=e("../../utils/xml-stream");class i{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(e=>{e instanceof i?e.reset():e.xform&&e.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(const t of e)for(const{eventType:e,value:r}of t)if("opentag"===e)this.parseOpen(r);else if("text"===e)this.parseText(r);else if("closetag"===e&&!this.parseClose(r.name))return this.model;return this.model}async parseStream(e){return this.parse(a(e))}get xml(){return this.toXml(this.model)}toXml(e){const t=new n;return this.render(t,e),t.xml}static toAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(r)return t}else if(r||e!==t)return e.toString()}static toStringAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.toAttribute(e,t,r)}static toStringValue(e,t){return void 0===e?t:e}static toBoolAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(r)return t}else if(r||e!==t)return e?"1":"0"}static toBoolValue(e,t){return void 0===e?t:"1"===e}static toIntAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.toAttribute(e,t,r)}static toIntValue(e,t){return void 0===e?t:parseInt(e,10)}static toFloatAttribute(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.toAttribute(e,t,r)}static toFloatValue(e,t){return void 0===e?t:parseFloat(e)}}t.exports=i},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,t,r){const a=e("../base-xform"),n=e("../../../utils/col-cache");function i(e){try{return n.decodeEx(e),!0}catch(e){return!1}}function s(e){const t=[];let r=!1,a="";return e.split(",").forEach(e=>{if(!e)return;const n=(e.match(/'/g)||[]).length;if(!n)return void(r?a+=e+",":i(e)&&t.push(e));const s=n%2==0;!r&&s&&i(e)?t.push(e):r&&!s?(r=!1,i(a+e)&&t.push(a+e),a=""):(r=!0,a+=e+",")}),t}t.exports=class extends a{render(e,t){e.openNode("definedName",{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(",")),e.closeNode()}parseOpen(e){return"definedName"===e.name&&(this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0)}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:s(this._parsedText.join(""))},void 0!==this._parsedLocalSheetId&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,t,r){const a=e("../../../utils/utils"),n=e("../base-xform");t.exports=class extends n{render(e,t){e.leafNode("sheet",{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return"sheet"===e.name&&(this.model={name:a.xmlDecode(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){e.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return"calcPr"===e.name&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){e.leafNode("workbookPr",{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return"workbookPr"===e.name&&(this.model={date1904:"1"===e.attributes.date1904},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){const r={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&"visible"!==t.visibility&&(r.visibility=t.visibility),e.leafNode("workbookView",r)}parseOpen(e){if("workbookView"===e.name){const t=this.model={},r=function(e,r,a){const n=void 0!==r?t[e]=r:a;void 0!==n&&(t[e]=n)},a=function(e,r,a){const n=void 0!==r?t[e]=parseInt(r,10):a;void 0!==n&&(t[e]=n)};return a("x",e.attributes.xWindow,0),a("y",e.attributes.yWindow,0),a("width",e.attributes.windowWidth,25e3),a("height",e.attributes.windowHeight,1e4),r("visibility",e.attributes.visibility,"visible"),a("activeTab",e.attributes.activeTab,void 0),a("firstSheet",e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../../../utils/col-cache"),i=e("../../../utils/xml-stream"),s=e("../base-xform"),o=e("../static-xform"),h=e("../list-xform"),l=e("./defined-name-xform"),d=e("./sheet-xform"),c=e("./workbook-view-xform"),u=e("./workbook-properties-xform"),f=e("./workbook-calc-properties-xform");class p extends s{constructor(){super(),this.map={fileVersion:p.STATIC_XFORMS.fileVersion,workbookPr:new u,bookViews:new h({tag:"bookViews",count:!1,childXform:new c}),sheets:new h({tag:"sheets",count:!1,childXform:new d}),definedNames:new h({tag:"definedNames",count:!1,childXform:new l}),calcPr:new f}}prepare(e){e.sheets=e.worksheets;const t=[];let r=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split("&&").forEach(a=>{const n=a.split(":"),i={name:"_xlnm.Print_Area",ranges:[`'${e.name}'!$${n[0]}:$${n[1]}`],localSheetId:r};t.push(i)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){const a=[];if(e.pageSetup.printTitlesColumn){const t=e.pageSetup.printTitlesColumn.split(":");a.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){const t=e.pageSetup.printTitlesRow.split(":");a.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}const n={name:"_xlnm.Print_Titles",ranges:a,localSheetId:r};t.push(n)}r++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(e,t){e.openXml(i.StdDocAttributes),e.openNode("workbook",p.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(e),this.map.workbookPr.render(e,t.properties),this.map.bookViews.render(e,t.views),this.map.sheets.render(e,t.sheets),this.map.definedNames.render(e,t.definedNames),this.map.calcPr.render(e,t.calcProperties),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):("workbook"===e.name||(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"workbook"!==e||(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1)}reconcile(e){const t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),r=[];let i,s=0;(e.sheets||[]).forEach(a=>{const n=t[a.rId];n&&(i=e.worksheetHash["xl/"+n.Target.replace(/^(\s|\/xl\/)+/,"")],i&&(i.name=a.name,i.id=a.id,i.state=a.state,r[s++]=i))});const o=[];a.each(e.definedNames,e=>{if("_xlnm.Print_Area"===e.name){if(i=r[e.localSheetId],i){i.pageSetup||(i.pageSetup={});const t=n.decodeEx(e.ranges[0]);i.pageSetup.printArea=i.pageSetup.printArea?`${i.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if("_xlnm.Print_Titles"===e.name){if(i=r[e.localSheetId],i){i.pageSetup||(i.pageSetup={});const t=e.ranges.join(","),r=/\$/g,a=/\$\d+:\$\d+/,n=t.match(a);if(n&&n.length){const e=n[0];i.pageSetup.printTitlesRow=e.replace(r,"")}const s=/\$[A-Z]+:\$[A-Z]+/,o=t.match(s);if(o&&o.length){const e=o[0];i.pageSetup.printTitlesColumn=e.replace(r,"")}}}else o.push(e)}),e.definedNames=o,e.media.forEach((e,t)=>{e.index=t})}}p.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},p.STATIC_XFORMS={fileVersion:new o({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},t.exports=p},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,t,r){const a=e("../strings/rich-text-xform"),n=e("../../../utils/utils"),i=e("../base-xform"),s=t.exports=function(e){this.model=e};n.inherits(s,i,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new a),this._richTextXform},render(e,t){t=t||this.model,e.openNode("comment",{ref:t.ref,authorId:0}),e.openNode("text"),t&&t.note&&t.note.texts&&t.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"comment":return this.model={type:"note",note:{texts:[]},...e.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../../../utils/utils"),i=e("../base-xform"),s=e("./comment-xform"),o=t.exports=function(){this.map={comment:new s}};n.inherits(o,i,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,t){t=t||this.model,e.openXml(a.StdDocAttributes),e.openNode("comments",o.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),t.comments.forEach(t=>{this.map.comment.render(e,t)}),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t,r){(t===r[2]||"x:SizeWithCells"===this.tag&&t===r[1])&&e.leafNode(this.tag)}parseOpen(e){return e.name===this.tag&&(this.model={},this.model[this.tag]=!0,!0)}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"x:Anchor"}getAnchorRect(e){const t=Math.floor(e.left),r=Math.floor(68*(e.left-t)),a=Math.floor(e.top),n=Math.floor(18*(e.top-a)),i=Math.floor(e.right),s=Math.floor(68*(e.right-i)),o=Math.floor(e.bottom);return[t,r,a,n,i,s,o,Math.floor(18*(e.bottom-o))]}getDefaultRect(e){const t=e.col,r=Math.max(e.row-2,0);return[t,6,r,14,t+2,2,r+4,16]}render(e,t){const r=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode("x:Anchor",null,r.join(", "))}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,t,r){const a=e("../base-xform"),n=e("./vml-anchor-xform"),i=e("./style/vml-protection-xform"),s=e("./style/vml-position-xform"),o=["twoCells","oneCells","absolute"];t.exports=class extends a{constructor(){super(),this.map={"x:Anchor":new n,"x:Locked":new i({tag:"x:Locked"}),"x:LockText":new i({tag:"x:LockText"}),"x:SizeWithCells":new s({tag:"x:SizeWithCells"}),"x:MoveWithCells":new s({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,t){const{protection:r,editAs:a}=t.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,a,o),this.map["x:SizeWithCells"].render(e,a,o),this.map["x:Anchor"].render(e,t),this.map["x:Locked"].render(e,r.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,r.lockText),e.leafNode("x:Row",null,t.refAddress.row-1),e.leafNode("x:Column",null,t.refAddress.col-1),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.normalizeModel(),!1)}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),t=Object.keys(e).length;this.model.editAs=o[t],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("./vml-shape-xform");class s extends n{constructor(){super(),this.map={"v:shape":new i}}get tag(){return"xml"}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(this.tag,s.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),t.comments.forEach((t,r)=>{this.map["v:shape"].render(e,t,r)}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)})}}s.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},t.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,t,r){const a=e("../base-xform"),n=e("./vml-textbox-xform"),i=e("./vml-client-data-xform");class s extends a{constructor(){super(),this.map={"v:textbox":new n,"x:ClientData":new i}}get tag(){return"v:shape"}render(e,t,r){e.openNode("v:shape",s.V_SHAPE_ATTRIBUTES(t,r)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,t),this.map["x:ClientData"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1)}}s.V_SHAPE_ATTRIBUTES=(e,t)=>({id:"_x0000_s"+(1025+t),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":e.note.margins&&e.note.margins.insetmode}),t.exports=s},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"v:textbox"}conversionUnit(e,t,r){return`${parseFloat(e)*t.toFixed(2)}${r}`}reverseConversionUnit(e){return(e||"").split(",").map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,"")).toFixed(2)))}render(e,t){const r={style:"mso-direction-alt:auto"};if(t&&t.note){let{inset:e}=t.note&&t.note.margins;Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,"mm")).join(",")),e&&(r.inset=e)}e.openNode("v:textbox",r),e.leafNode("div",{style:"text-align:left"}),e.closeNode()}parseOpen(e){return e.name!==this.tag||(this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0)}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],48:[function(e,t,r){const a=e("./base-xform");t.exports=class extends a{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag&&(this.model=this.createNewModel(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}}},{"./base-xform":32}],49:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){e.openNode("HeadingPairs"),e.openNode("vt:vector",{size:2,baseType:"variant"}),e.openNode("vt:variant"),e.leafNode("vt:lpstr",void 0,"Worksheets"),e.closeNode(),e.openNode("vt:variant"),e.leafNode("vt:i4",void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return"HeadingPairs"===e.name}parseText(){}parseClose(e){return"HeadingPairs"!==e}}},{"../base-xform":32}],50:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){e.openNode("TitlesOfParts"),e.openNode("vt:vector",{size:t.length,baseType:"lpstr"}),t.forEach(t=>{e.leafNode("vt:lpstr",void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return"TitlesOfParts"===e.name}parseText(){}parseClose(e){return"TitlesOfParts"!==e}}},{"../base-xform":32}],51:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("../simple/string-xform"),s=e("./app-heading-pairs-xform"),o=e("./app-titles-of-parts-xform");class h extends n{constructor(){super(),this.map={Company:new i({tag:"Company"}),Manager:new i({tag:"Manager"}),HeadingPairs:new s,TitleOfParts:new o}}render(e,t){e.openXml(a.StdDocAttributes),e.openNode("Properties",h.PROPERTY_ATTRIBUTES),e.leafNode("Application",void 0,"Microsoft Excel"),e.leafNode("DocSecurity",void 0,"0"),e.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(e,t.worksheets),this.map.TitleOfParts.render(e,t.worksheets),this.map.Company.render(e,t.company||""),this.map.Manager.render(e,t.manager),e.leafNode("LinksUpToDate",void 0,"false"),e.leafNode("SharedDoc",void 0,"false"),e.leafNode("HyperlinksChanged",void 0,"false"),e.leafNode("AppVersion",void 0,"16.0300"),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"Properties"===e.name||(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"Properties"!==e||(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1)}}h.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,"")},h.DateAttrs={"xsi:type":"dcterms:W3CDTF"},h.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},t.exports=h},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform");class i extends n{render(e,t){e.openXml(a.StdDocAttributes),e.openNode("Types",i.PROPERTY_ATTRIBUTES);const r={};(t.media||[]).forEach(t=>{if("image"===t.type){const a=t.extension;r[a]||(r[a]=!0,e.leafNode("Default",{Extension:a,ContentType:"image/"+a}))}}),e.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),e.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),e.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),t.worksheets.forEach(t=>{const r=`/xl/worksheets/sheet${t.id}.xml`;e.leafNode("Override",{PartName:r,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),e.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),e.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),t.sharedStrings&&t.sharedStrings.count&&e.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),t.tables&&t.tables.forEach(t=>{e.leafNode("Override",{PartName:"/xl/tables/"+t.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),t.drawings&&t.drawings.forEach(t=>{e.leafNode("Override",{PartName:`/xl/drawings/${t.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),t.commentRefs&&(e.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),t.commentRefs.forEach(t=>{let{commentName:r}=t;e.leafNode("Override",{PartName:`/xl/${r}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),e.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),e.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}i.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},t.exports=i},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("../simple/date-xform"),s=e("../simple/string-xform"),o=e("../simple/integer-xform");class h extends n{constructor(){super(),this.map={"dc:creator":new s({tag:"dc:creator"}),"dc:title":new s({tag:"dc:title"}),"dc:subject":new s({tag:"dc:subject"}),"dc:description":new s({tag:"dc:description"}),"dc:identifier":new s({tag:"dc:identifier"}),"dc:language":new s({tag:"dc:language"}),"cp:keywords":new s({tag:"cp:keywords"}),"cp:category":new s({tag:"cp:category"}),"cp:lastModifiedBy":new s({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new i({tag:"cp:lastPrinted",format:h.DateFormat}),"cp:revision":new o({tag:"cp:revision"}),"cp:version":new s({tag:"cp:version"}),"cp:contentStatus":new s({tag:"cp:contentStatus"}),"cp:contentType":new s({tag:"cp:contentType"}),"dcterms:created":new i({tag:"dcterms:created",attrs:h.DateAttrs,format:h.DateFormat}),"dcterms:modified":new i({tag:"dcterms:modified",attrs:h.DateAttrs,format:h.DateFormat})}}render(e,t){e.openXml(a.StdDocAttributes),e.openNode("cp:coreProperties",h.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(e,t.creator),this.map["dc:title"].render(e,t.title),this.map["dc:subject"].render(e,t.subject),this.map["dc:description"].render(e,t.description),this.map["dc:identifier"].render(e,t.identifier),this.map["dc:language"].render(e,t.language),this.map["cp:keywords"].render(e,t.keywords),this.map["cp:category"].render(e,t.category),this.map["cp:lastModifiedBy"].render(e,t.lastModifiedBy),this.map["cp:lastPrinted"].render(e,t.lastPrinted),this.map["cp:revision"].render(e,t.revision),this.map["cp:version"].render(e,t.version),this.map["cp:contentStatus"].render(e,t.contentStatus),this.map["cp:contentType"].render(e,t.contentType),this.map["dcterms:created"].render(e,t.created),this.map["dcterms:modified"].render(e,t.modified),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}h.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,"")},h.DateAttrs={"xsi:type":"dcterms:W3CDTF"},h.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},t.exports=h},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{render(e,t){e.leafNode("Relationship",t)}parseOpen(e){return"Relationship"===e.name&&(this.model=e.attributes,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("./relationship-xform");class s extends n{constructor(){super(),this.map={Relationship:new i}}render(e,t){t=t||this._values,e.openXml(a.StdDocAttributes),e.openNode("Relationships",s.RELATIONSHIPS_ATTRIBUTES),t.forEach(t=>{this.map.Relationship.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("Relationships"===e.name)return this.model=[],!0;if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;if("Relationships"===e)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}s.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},t.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={range:{editAs:e.attributes.editAs||"oneCell"}}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){const r=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const e=r[1],a=t.mediaIndex[e];return t.media[a]}}}}},{"../base-xform":32}],57:[function(e,t,r){const a=e("../base-xform"),n=e("./blip-xform");t.exports=class extends a{constructor(){super(),this.map={"a:blip":new n}}get tag(){return"xdr:blipFill"}render(e,t){e.openNode(this.tag),this.map["a:blip"].render(e,t),e.openNode("a:stretch"),e.leafNode("a:fillRect"),e.closeNode(),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:blip"].model,!1)}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"a:blip"}render(e,t){e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":t.rId,cstate:"print"})}parseOpen(e){return e.name!==this.tag||(this.model={rId:e.attributes["r:embed"]},!0)}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],59:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"xdr:cNvPicPr"}render(e){e.openNode(this.tag),e.leafNode("a:picLocks",{noChangeAspect:"1"}),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],60:[function(e,t,r){const a=e("../base-xform"),n=e("./hlink-click-xform"),i=e("./ext-lst-xform");t.exports=class extends a{constructor(){super(),this.map={"a:hlinkClick":new n,"a:extLst":new i}}get tag(){return"xdr:cNvPr"}render(e,t){e.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(e,t),this.map["a:extLst"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:hlinkClick"].model,!1)}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,t,r){const a=e("../base-xform"),n=e("../simple/integer-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new n({tag:"xdr:col",zero:!0}),"xdr:colOff":new n({tag:"xdr:colOff",zero:!0}),"xdr:row":new n({tag:"xdr:row",zero:!0}),"xdr:rowOff":new n({tag:"xdr:rowOff",zero:!0})}}render(e,t){e.openNode(this.tag),this.map["xdr:col"].render(e,t.nativeCol),this.map["xdr:colOff"].render(e,t.nativeColOff),this.map["xdr:row"].render(e,t.nativeRow),this.map["xdr:rowOff"].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1)}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,t,r){const a=e("../../../utils/col-cache"),n=e("../../../utils/xml-stream"),i=e("../base-xform"),s=e("./two-cell-anchor-xform"),o=e("./one-cell-anchor-xform");class h extends i{constructor(){super(),this.map={"xdr:twoCellAnchor":new s,"xdr:oneCellAnchor":new o}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=function(e){return("string"==typeof e.range?a.decode(e.range):e.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return"xdr:wsDr"}render(e,t){e.openXml(n.StdDocAttributes),e.openNode(this.tag,h.DRAWING_ATTRIBUTES),t.anchors.forEach(t=>{this.map[t.anchorType].render(e,t)}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={anchors:[]}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)})}}h.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},t.exports=h},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"a:extLst"}render(e){e.openNode(this.tag),e.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),e.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],64:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.map={}}render(e,t){e.openNode(this.tag);const r=Math.floor(9525*t.width),a=Math.floor(9525*t.height);e.addAttribute("cx",r),e.addAttribute("cy",a),e.closeNode()}parseOpen(e){return e.name===this.tag&&(this.model={width:parseInt(e.attributes.cx||"0",10)/9525,height:parseInt(e.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"a:hlinkClick"}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){return e.name!==this.tag||(this.model={hyperlinks:{rId:e.attributes["r:id"],tooltip:e.attributes.tooltip}},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,t,r){const a=e("../base-xform"),n=e("./c-nv-pr-xform"),i=e("./c-nv-pic-pr-xform");t.exports=class extends a{constructor(){super(),this.map={"xdr:cNvPr":new n,"xdr:cNvPicPr":new i}}get tag(){return"xdr:nvPicPr"}render(e,t){e.openNode(this.tag),this.map["xdr:cNvPr"].render(e,t),this.map["xdr:cNvPicPr"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["xdr:cNvPr"].model,!1)}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,t,r){const a=e("./base-cell-anchor-xform"),n=e("../static-xform"),i=e("./cell-position-xform"),s=e("./ext-xform"),o=e("./pic-xform");t.exports=class extends a{constructor(){super(),this.map={"xdr:from":new i({tag:"xdr:from"}),"xdr:ext":new s({tag:"xdr:ext"}),"xdr:pic":new o,"xdr:clientData":new n({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:ext"].render(e,t.range.ext),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,t,r){const a=e("../base-xform"),n=e("../static-xform"),i=e("./blip-fill-xform"),s=e("./nv-pic-pr-xform"),o=e("./sp-pr");t.exports=class extends a{constructor(){super(),this.map={"xdr:nvPicPr":new s,"xdr:blipFill":new i,"xdr:spPr":new n(o)}}get tag(){return"xdr:pic"}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,t),this.map["xdr:blipFill"].render(e,t),this.map["xdr:spPr"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):e!==this.tag}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,t,r){t.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(e,t,r){const a=e("./base-cell-anchor-xform"),n=e("../static-xform"),i=e("./cell-position-xform"),s=e("./pic-xform");t.exports=class extends a{constructor(){super(),this.map={"xdr:from":new i({tag:"xdr:from"}),"xdr:to":new i({tag:"xdr:to"}),"xdr:pic":new s,"xdr:clientData":new n({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:to"].render(e,t.range.br),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,t,r){const a=e("./base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||"count",this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){const{childXform:r}=this;e&&e.forEach((e,a)=>{t.index=a,r.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);const{childXform:r}=this;(t||[]).forEach((t,a)=>{r.render(e,t,a)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(e)&&(this.parser=this.childXform,!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){const{childXform:r}=this;e.forEach(e=>{r.reconcile(e,t)})}}}},{"./base-xform":32}],72:[function(e,t,r){const a=e("../../../utils/col-cache"),n=e("../base-xform");t.exports=class extends n{get tag(){return"autoFilter"}render(e,t){if(t)if("string"==typeof t)e.leafNode("autoFilter",{ref:t});else{const r=function(e){return"string"==typeof e?e:a.getAddress(e.row,e.column).address},n=r(t.from),i=r(t.to);n&&i&&e.leafNode("autoFilter",{ref:`${n}:${i}`})}}parseOpen(e){"autoFilter"===e.name&&(this.model=e.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,t,r){const a=e("../../../utils/utils"),n=e("../base-xform"),i=e("../../../doc/range"),s=e("../../../doc/enums"),o=e("../strings/rich-text-xform");function h(e){if(null==e)return s.ValueType.Null;if(e instanceof String||"string"==typeof e)return s.ValueType.String;if("number"==typeof e)return s.ValueType.Number;if("boolean"==typeof e)return s.ValueType.Boolean;if(e instanceof Date)return s.ValueType.Date;if(e.text&&e.hyperlink)return s.ValueType.Hyperlink;if(e.formula)return s.ValueType.Formula;if(e.error)return s.ValueType.Error;throw new Error("I could not understand type of value")}t.exports=class extends n{constructor(){super(),this.richTextXForm=new o}get tag(){return"c"}prepare(e,t){const r=t.styles.addStyleModel(e.style||{},function(e){return e.type===s.ValueType.Formula?h(e.result):e.type}(e));switch(r&&(e.styleId=r),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case s.ValueType.String:case s.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case s.ValueType.Date:t.date1904&&(e.date1904=!0);break;case s.ValueType.Hyperlink:t.sharedStrings&&void 0!==e.text&&null!==e.text&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case s.ValueType.Merge:t.merges.add(e);break;case s.ValueType.Formula:if(t.date1904&&(e.date1904=!0),"shared"===e.shareType&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){const r=t.formulae[e.sharedFormula];if(!r)throw new Error("Shared Formula master must exist above and or left of clone for cell "+e.address);void 0===r.si?(r.shareType="shared",r.si=t.siFormulae++,r.range=new i(r.address,e.address)):r.range&&r.range.expandToAddress(e.address),e.si=r.si}}}renderFormula(e,t){let r=null;switch(t.shareType){case"shared":r={t:"shared",ref:t.ref||t.range.range,si:t.si};break;case"array":r={t:"array",ref:t.ref};break;default:void 0!==t.si&&(r={t:"shared",si:t.si})}switch(h(t.result)){case s.ValueType.Null:e.leafNode("f",r,t.formula);break;case s.ValueType.String:e.addAttribute("t","str"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result);break;case s.ValueType.Number:e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result);break;case s.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result?1:0);break;case s.ValueType.Error:e.addAttribute("t","e"),e.leafNode("f",r,t.formula),e.leafNode("v",null,t.result.error);break;case s.ValueType.Date:e.leafNode("f",r,t.formula),e.leafNode("v",null,a.dateToExcel(t.result,t.date1904));break;default:throw new Error("I could not understand type of value")}}render(e,t){if(t.type!==s.ValueType.Null||t.styleId){switch(e.openNode("c"),e.addAttribute("r",t.address),t.styleId&&e.addAttribute("s",t.styleId),t.type){case s.ValueType.Null:break;case s.ValueType.Number:e.leafNode("v",null,t.value);break;case s.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("v",null,t.value?"1":"0");break;case s.ValueType.Error:e.addAttribute("t","e"),e.leafNode("v",null,t.value.error);break;case s.ValueType.String:case s.ValueType.RichText:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):t.value&&t.value.richText?(e.addAttribute("t","inlineStr"),e.openNode("is"),t.value.richText.forEach(t=>{this.richTextXForm.render(e,t)}),e.closeNode("is")):(e.addAttribute("t","str"),e.leafNode("v",null,t.value));break;case s.ValueType.Date:e.leafNode("v",null,a.dateToExcel(t.value,t.date1904));break;case s.ValueType.Hyperlink:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):(e.addAttribute("t","str"),e.leafNode("v",null,t.text));break;case s.ValueType.Formula:this.renderFormula(e,t);case s.ValueType.Merge:}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"c":return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser)this.parser.parseText(e);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+e:e;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e}}parseClose(e){switch(e){case"c":{const{model:e}=this;if(e.formula||e.shareType)e.type=s.ValueType.Formula,e.value&&("str"===this.t?e.result=a.xmlDecode(e.value):"b"===this.t?e.result=0!==parseInt(e.value,10):"e"===this.t?e.result={error:e.value}:e.result=parseFloat(e.value),e.value=void 0);else if(void 0!==e.value)switch(this.t){case"s":e.type=s.ValueType.String,e.value=parseInt(e.value,10);break;case"str":e.type=s.ValueType.String,e.value=a.xmlDecode(e.value);break;case"inlineStr":e.type=s.ValueType.String;break;case"b":e.type=s.ValueType.Boolean,e.value=0!==parseInt(e.value,10);break;case"e":e.type=s.ValueType.Error,e.value={error:e.value};break;default:e.type=s.ValueType.Number,e.value=parseFloat(e.value)}else e.styleId?e.type=s.ValueType.Null:e.type=s.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(e),!0)}}reconcile(e,t){const r=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(r&&(e.style=r),void 0!==e.styleId&&(e.styleId=void 0),e.type){case s.ValueType.String:"number"==typeof e.value&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=s.ValueType.RichText);break;case s.ValueType.Number:r&&a.isDateFmt(r.numFmt)&&(e.type=s.ValueType.Date,e.value=a.excelToDate(e.value,t.date1904));break;case s.ValueType.Formula:void 0!==e.result&&r&&a.isDateFmt(r.numFmt)&&(e.result=a.excelToDate(e.result,t.date1904)),"shared"===e.shareType&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si)}const n=t.hyperlinkMap[e.address];n&&(e.type===s.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=s.ValueType.Hyperlink,e.hyperlink=n);const i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{get tag(){return"x14:cfIcon"}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen(e){let{attributes:t}=e;this.model={iconSet:t.iconSet,iconId:a.toIntValue(t.iconId)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],75:[function(e,t,r){const{v4:a}=e("uuid"),n=e("../../base-xform"),i=e("../../composite-xform"),s=e("./databar-ext-xform"),o=e("./icon-set-ext-xform"),h={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends i{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new s,"x14:iconSet":this.iconSetXform=new o}}get tag(){return"x14:cfRule"}static isExt(e){return"dataBar"===e.type?s.isExt(e):!("iconSet"!==e.type||!e.custom&&!h[e.iconSet])}prepare(e){l.isExt(e)&&(e.x14Id=`{${a()}}`.toUpperCase())}render(e,t){if(l.isExt(t))switch(t.type){case"dataBar":this.renderDataBar(e,t);break;case"iconSet":this.renderIconSet(e,t)}}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:"iconSet",priority:t.priority,id:t.x14Id||`{${a()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{type:t.type,x14Id:t.id,priority:n.toIntValue(t.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}}t.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,t,r){const a=e("../../composite-xform"),n=e("./f-ext-xform");t.exports=class extends a{constructor(){super(),this.map={"xm:f":this.fExtXform=new n}}get tag(){return"x14:cfvo"}render(e,t){e.openNode(this.tag,{type:t.type}),void 0!==t.value&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){"xm:f"===e&&(this.model.value=t.model?parseFloat(t.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,t,r){const a=e("../../composite-xform"),n=e("./sqref-ext-xform"),i=e("./cf-rule-ext-xform");t.exports=class extends a{constructor(){super(),this.map={"xm:sqref":this.sqRef=new n,"x14:cfRule":this.cfRule=new i}}get tag(){return"x14:conditionalFormatting"}prepare(e,t){e.rules.forEach(e=>{this.cfRule.prepare(e,t)})}render(e,t){t.rules.some(i.isExt)&&(e.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(i.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,t,r){const a=e("../../composite-xform"),n=e("./cf-rule-ext-xform"),i=e("./conditional-formatting-ext-xform");t.exports=class extends a{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new i}}get tag(){return"x14:conditionalFormattings"}hasContent(e){return void 0===e.hasExtContent&&(e.hasExtContent=e.some(e=>e.rules.some(n.isExt))),e.hasExtContent}prepare(e,t){e.forEach(e=>{this.cfXform.prepare(e,t)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,t,r){const a=e("../../base-xform"),n=e("../../composite-xform"),i=e("../../style/color-xform"),s=e("./cfvo-ext-xform");t.exports=class extends n{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new s,"x14:borderColor":this.borderColorXform=new i("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new i("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new i("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new i("x14:axisColor")}}static isExt(e){return!e.gradient}get tag(){return"x14:dataBar"}render(e,t){e.openNode(this.tag,{minLength:a.toIntAttribute(t.minLength,0,!0),maxLength:a.toIntAttribute(t.maxLength,100,!0),border:a.toBoolAttribute(t.border,!1),gradient:a.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:a.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:a.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:a.toAttribute(t.axisPosition,"auto"),direction:a.toAttribute(t.direction,"leftToRight")}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],minLength:a.toIntValue(t.minLength,0),maxLength:a.toIntValue(t.maxLength,100),border:a.toBoolValue(t.border,!1),gradient:a.toBoolValue(t.gradient,!0),negativeBarColorSameAsPositive:a.toBoolValue(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:a.toBoolValue(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:a.toStringValue(t.axisPosition,"auto"),direction:a.toStringValue(t.direction,"leftToRight")}}onParserClose(e,t){const[,r]=e.split(":");"cfvo"===r?this.model.cfvo.push(t.model):this.model[r]=t.model}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{get tag(){return"xm:f"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],81:[function(e,t,r){const a=e("../../base-xform"),n=e("../../composite-xform"),i=e("./cfvo-ext-xform"),s=e("./cf-icon-ext-xform");t.exports=class extends n{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new i,"x14:cfIcon":this.cfIconXform=new s}}get tag(){return"x14:iconSet"}render(e,t){e.openNode(this.tag,{iconSet:a.toStringAttribute(t.iconSet),reverse:a.toBoolAttribute(t.reverse,!1),showValue:a.toBoolAttribute(t.showValue,!0),custom:a.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,r)=>{t.iconId=r,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],iconSet:a.toStringValue(t.iconSet,"3TrafficLights"),reverse:a.toBoolValue(t.reverse,!1),showValue:a.toBoolValue(t.showValue,!0)}}onParserClose(e,t){const[,r]=e.split(":");switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[r]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{get tag(){return"xm:sqref"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],83:[function(e,t,r){const a=e("../../base-xform"),n=e("../../composite-xform"),i=e("../../../../doc/range"),s=e("./databar-xform"),o=e("./ext-lst-ref-xform"),h=e("./formula-xform"),l=e("./color-scale-xform"),d=e("./icon-set-xform"),c={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},u=e=>{const{type:t,operator:r}=e;switch(t){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:t};default:return{type:t,operator:r}}};class f extends n{constructor(){super(),this.map={dataBar:this.databarXform=new s,extLst:this.extLstRefXform=new o,formula:this.formulaXform=new h,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new d}}get tag(){return"cfRule"}static isPrimitive(e){return"iconSet"!==e.type||!e.custom&&!c[e.iconSet]}render(e,t){switch(t.type){case"expression":this.renderExpression(e,t);break;case"cellIs":this.renderCellIs(e,t);break;case"top10":this.renderTop10(e,t);break;case"aboveAverage":this.renderAboveAverage(e,t);break;case"dataBar":this.renderDataBar(e,t);break;case"colorScale":this.renderColorScale(e,t);break;case"iconSet":this.renderIconSet(e,t);break;case"containsText":this.renderText(e,t);break;case"timePeriod":this.renderTimePeriod(e,t)}}renderExpression(e,t){e.openNode(this.tag,{type:"expression",dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:"cellIs",dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:"top10",dxfId:t.dxfId,priority:t.priority,percent:a.toBoolAttribute(t.percent,!1),bottom:a.toBoolAttribute(t.bottom,!1),rank:a.toIntValue(t.rank,10,!0)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:"aboveAverage",dxfId:t.dxfId,priority:t.priority,aboveAverage:a.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:"colorScale",priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(e,t){f.isPrimitive(t)&&(e.openNode(this.tag,{type:"iconSet",priority:t.priority}),this.iconSetXform.render(e,t),e.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:a.toStringAttribute(t.operator,"containsText")});const r=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new i(e.ref),{tl:r}=t;switch(e.operator){case"containsText":return`NOT(ISERROR(SEARCH("${e.text}",${r})))`;case"containsBlanks":return`LEN(TRIM(${r}))=0`;case"notContainsBlanks":return`LEN(TRIM(${r}))>0`;case"containsErrors":return`ISERROR(${r})`;case"notContainsErrors":return`NOT(ISERROR(${r}))`;default:return}})(t);r&&this.formulaXform.render(e,r),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:"timePeriod",dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});const r=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new i(e.ref),{tl:r}=t;switch(e.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${r},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${r},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${r},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${r},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${r},1)=TODAY()-1`;case"today":return`FLOOR(${r},1)=TODAY()`;case"tomorrow":return`FLOOR(${r},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${r},1)<=6,FLOOR(${r},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0-1)),YEAR(${r})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${r})=MONTH(TODAY()),YEAR(${r})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0+1)),YEAR(${r})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(t);r&&this.formulaXform.render(e,r),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{...u(t),dxfId:a.toIntValue(t.dxfId),priority:a.toIntValue(t.priority),timePeriod:t.timePeriod,percent:a.toBoolValue(t.percent),bottom:a.toBoolValue(t.bottom),rank:a.toIntValue(t.rank),aboveAverage:a.toBoolValue(t.aboveAverage)}}onParserClose(e,t){switch(e){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,t.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model)}}}t.exports=f},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{get tag(){return"cfvo"}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:a.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],85:[function(e,t,r){const a=e("../../composite-xform"),n=e("../../style/color-xform"),i=e("./cfvo-xform");t.exports=class extends a{constructor(){super(),this.map={cfvo:this.cfvoXform=new i,color:this.colorXform=new n}}get tag(){return"colorScale"}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,t,r){const a=e("../../composite-xform"),n=e("./cf-rule-xform");t.exports=class extends a{constructor(){super(),this.map={cfRule:new n}}get tag(){return"conditionalFormatting"}render(e,t){t.rules.some(n.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(r=>{n.isPrimitive(r)&&(r.ref=t.ref,this.map.cfRule.render(e,r))}),e.closeNode())}createNewModel(e){let{attributes:t}=e;return{ref:t.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,t,r){const a=e("../../base-xform"),n=e("./conditional-formatting-xform");t.exports=class extends a{constructor(){super(),this.cfXform=new n}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(e,t){let r=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||(e.priority=r++),e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"conditionalFormatting"===e.name&&(this.parser=this.cfXform,this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!(!this.parser||!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,1))}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,t,r){const a=e("../../composite-xform"),n=e("../../style/color-xform"),i=e("./cfvo-xform");t.exports=class extends a{constructor(){super(),this.map={cfvo:this.cfvoXform=new i,color:this.colorXform=new n}}get tag(){return"dataBar"}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,t,r){const a=e("../../base-xform"),n=e("../../composite-xform");class i extends a{get tag(){return"x14:id"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class s extends n{constructor(){super(),this.map={"x14:id":this.idXform=new i}}get tag(){return"ext"}render(e,t){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}}t.exports=class extends n{constructor(){super(),this.map={ext:new s}}get tag(){return"extLst"}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,t,r){const a=e("../../base-xform");t.exports=class extends a{get tag(){return"formula"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],91:[function(e,t,r){const a=e("../../base-xform"),n=e("../../composite-xform"),i=e("./cfvo-xform");t.exports=class extends n{constructor(){super(),this.map={cfvo:this.cfvoXform=new i}}get tag(){return"iconSet"}render(e,t){e.openNode(this.tag,{iconSet:a.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:a.toBoolAttribute(t.reverse,!1),showValue:a.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{iconSet:a.toStringValue(t.iconSet,"3TrafficLights"),reverse:a.toBoolValue(t.reverse),showValue:a.toBoolValue(t.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,t,r){const a=e("../../../utils/utils"),n=e("../base-xform");t.exports=class extends n{get tag(){return"col"}prepare(e,t){const r=t.styles.addStyleModel(e.style||{});r&&(e.styleId=r)}render(e,t){e.openNode("col"),e.addAttribute("min",t.min),e.addAttribute("max",t.max),t.width&&e.addAttribute("width",t.width),t.styleId&&e.addAttribute("style",t.styleId),t.hidden&&e.addAttribute("hidden","1"),t.bestFit&&e.addAttribute("bestFit","1"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1"),e.addAttribute("customWidth","1"),e.closeNode()}parseOpen(e){if("col"===e.name){const t=this.model={min:parseInt(e.attributes.min||"0",10),max:parseInt(e.attributes.max||"0",10),width:void 0===e.attributes.width?void 0:parseFloat(e.attributes.width||"0")};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),a.parseBoolean(e.attributes.hidden)&&(t.hidden=!0),a.parseBoolean(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),a.parseBoolean(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../../../utils/utils"),i=e("../../../utils/col-cache"),s=e("../base-xform"),o=e("../../../doc/range");function h(e,t,r,a){const n=t[r];void 0!==n?e[r]=n:void 0!==a&&(e[r]=a)}function l(e,t,r,a){const i=t[r];void 0!==i?e[r]=n.parseBoolean(i):void 0!==a&&(e[r]=a)}t.exports=class extends s{get tag(){return"dataValidations"}render(e,t){const r=function(e){const t=a.map(e,(e,t)=>({address:t,dataValidation:e,marked:!1})).sort((e,t)=>a.strcmp(e.address,t.address)),r=a.keyBy(t,"address"),n=(t,r,n)=>{for(let s=0;s<r;s++){const r=i.encodeAddress(t.row+s,n);if(!e[r]||!a.isEqual(e[t.address],e[r]))return!1}return!0};return t.map(t=>{if(!t.marked){const s=i.decodeEx(t.address);if(s.dimensions)return r[s.dimensions].marked=!0,{...t.dataValidation,sqref:t.address};let o=1,h=i.encodeAddress(s.row+o,s.col);for(;e[h]&&a.isEqual(t.dataValidation,e[h]);)o++,h=i.encodeAddress(s.row+o,s.col);let l=1;for(;n(s,o,s.col+l);)l++;for(let e=0;e<o;e++)for(let t=0;t<l;t++)h=i.encodeAddress(s.row+e,s.col+t),r[h].marked=!0;if(o>1||l>1){const e=s.row+(o-1),r=s.col+(l-1);return{...t.dataValidation,sqref:`${t.address}:${i.encodeAddress(e,r)}`}}return{...t.dataValidation,sqref:t.address}}return null}).filter(Boolean)}(t);r.length&&(e.openNode("dataValidations",{count:r.length}),r.forEach(t=>{e.openNode("dataValidation"),"any"!==t.type&&(e.addAttribute("type",t.type),t.operator&&"list"!==t.type&&"between"!==t.operator&&e.addAttribute("operator",t.operator),t.allowBlank&&e.addAttribute("allowBlank","1")),t.showInputMessage&&e.addAttribute("showInputMessage","1"),t.promptTitle&&e.addAttribute("promptTitle",t.promptTitle),t.prompt&&e.addAttribute("prompt",t.prompt),t.showErrorMessage&&e.addAttribute("showErrorMessage","1"),t.errorStyle&&e.addAttribute("errorStyle",t.errorStyle),t.errorTitle&&e.addAttribute("errorTitle",t.errorTitle),t.error&&e.addAttribute("error",t.error),e.addAttribute("sqref",t.sqref),(t.formulae||[]).forEach((r,a)=>{e.openNode("formula"+(a+1)),"date"===t.type?e.writeText(n.dateToExcel(new Date(r))):e.writeText(r),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=e.attributes.sqref;const t={type:e.attributes.type||"any",formulae:[]};switch(e.attributes.type&&l(t,e.attributes,"allowBlank"),l(t,e.attributes,"showInputMessage"),l(t,e.attributes,"showErrorMessage"),t.type){case"any":case"list":case"custom":break;default:h(t,e.attributes,"operator","between")}return h(t,e.attributes,"promptTitle"),h(t,e.attributes,"prompt"),h(t,e.attributes,"errorStyle"),h(t,e.attributes,"errorTitle"),h(t,e.attributes,"error"),this._dataValidation=t,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{e.includes(":")?new o(e).forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[e]=this._dataValidation}),!0;case"formula1":case"formula2":{let e=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":e=parseInt(e,10);break;case"decimal":e=parseFloat(e);break;case"date":e=n.excelToDate(parseFloat(e))}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"dimension"}render(e,t){t&&e.leafNode("dimension",{ref:t})}parseOpen(e){return"dimension"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"drawing"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,t,r){const a=e("../composite-xform"),n=e("./cf-ext/conditional-formattings-ext-xform");class i extends a{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new n}}get tag(){return"ext"}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,t){this.conditionalFormattings.prepare(e.conditionalFormattings,t)}render(e,t){e.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}}t.exports=class extends a{constructor(){super(),this.map={ext:this.ext=new i}}get tag(){return"extLst"}prepare(e,t){this.ext.prepare(e,t)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode("extLst"),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"headerFooter"}render(e,t){if(t){e.addRollback();let r=!1;e.openNode("headerFooter"),t.differentFirst&&(e.addAttribute("differentFirst","1"),r=!0),t.differentOddEven&&(e.addAttribute("differentOddEven","1"),r=!0),t.oddHeader&&"string"==typeof t.oddHeader&&(e.leafNode("oddHeader",null,t.oddHeader),r=!0),t.oddFooter&&"string"==typeof t.oddFooter&&(e.leafNode("oddFooter",null,t.oddFooter),r=!0),t.evenHeader&&"string"==typeof t.evenHeader&&(e.leafNode("evenHeader",null,t.evenHeader),r=!0),t.evenFooter&&"string"==typeof t.evenFooter&&(e.leafNode("evenFooter",null,t.evenFooter),r=!0),t.firstHeader&&"string"==typeof t.firstHeader&&(e.leafNode("firstHeader",null,t.firstHeader),r=!0),t.firstFooter&&"string"==typeof t.firstFooter&&(e.leafNode("firstFooter",null,t.firstFooter),r=!0),r?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case"headerFooter":return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=1===parseInt(e.attributes.differentFirst,0)),e.attributes.differentOddEven&&(this.model.differentOddEven=1===parseInt(e.attributes.differentOddEven,0)),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(e){switch(this.currentNode){case"oddHeader":this.model.oddHeader=e;break;case"oddFooter":this.model.oddFooter=e;break;case"evenHeader":this.model.evenHeader=e;break;case"evenFooter":this.model.evenFooter=e;break;case"firstHeader":this.model.firstHeader=e;break;case"firstFooter":this.model.firstFooter=e}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"hyperlink"}render(e,t){this.isInternalLink(t)?e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return"hyperlink"===e.name&&(this.model={address:e.attributes.ref,rId:e.attributes["r:id"],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(e){return e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target)}}},{"../base-xform":32}],99:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"mergeCell"}render(e,t){e.leafNode("mergeCell",{ref:t})}parseOpen(e){return"mergeCell"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../../../doc/range"),i=e("../../../utils/col-cache"),s=e("../../../doc/enums");t.exports=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{const t=`${e.master}:${e.address}`;this.merges[e.master]=new n(t)}}get mergeCells(){return a.map(this.merges,e=>e.range)}reconcile(e,t){a.each(e,e=>{const r=i.decode(e);for(let e=r.top;e<=r.bottom;e++){const a=t[e-1];for(let t=r.left;t<=r.right;t++){const n=a.cells[t-1];n?n.type===s.ValueType.Merge&&(n.master=r.tl):a.cells[t]={type:s.ValueType.Null,address:i.encodeAddress(e,t)}}}})}getMasterAddress(e){const t=this.hash[e];return t&&t.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,t,r){const a=e("../base-xform"),n=e=>void 0!==e;t.exports=class extends a{get tag(){return"outlinePr"}render(e,t){return!(!t||!n(t.summaryBelow)&&!n(t.summaryRight)||(e.leafNode(this.tag,{summaryBelow:n(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:n(t.summaryRight)?Number(t.summaryRight):void 0}),0))}parseOpen(e){return e.name===this.tag&&(this.model={summaryBelow:n(e.attributes.summaryBelow)?Boolean(Number(e.attributes.summaryBelow)):void 0,summaryRight:n(e.attributes.summaryRight)?Boolean(Number(e.attributes.summaryRight)):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"brk"}render(e,t){e.leafNode("brk",t)}parseOpen(e){return"brk"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../base-xform");t.exports=class extends n{get tag(){return"pageMargins"}render(e,t){if(t){const r={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};a.some(r,e=>void 0!==e)&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"pageSetUpPr"}render(e,t){return!(!t||!t.fitToPage||(e.leafNode(this.tag,{fitToPage:t.fitToPage?"1":void 0}),0))}parseOpen(e){return e.name===this.tag&&(this.model={fitToPage:"1"===e.attributes.fitToPage},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../base-xform");function i(e){return e?"1":void 0}function s(e){if("overThenDown"===e)return e}function o(e){switch(e){case"atEnd":case"asDisplyed":return e;default:return}}function h(e){switch(e){case"dash":case"blank":case"NA":return e;default:return}}t.exports=class extends n{get tag(){return"pageSetup"}render(e,t){if(t){const r={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:s(t.pageOrder),blackAndWhite:i(t.blackAndWhite),draft:i(t.draft),cellComments:o(t.cellComments),errors:h(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:i(t.firstPageNumber),usePrinterDefaults:i(t.usePrinterDefaults),copies:t.copies};a.some(r,e=>void 0!==e)&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={paperSize:(t=e.attributes.paperSize,void 0!==t?parseInt(t,10):void 0),orientation:e.attributes.orientation||"portrait",horizontalDpi:parseInt(e.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(e.attributes.verticalDpi||"4294967295",10),pageOrder:e.attributes.pageOrder||"downThenOver",blackAndWhite:"1"===e.attributes.blackAndWhite,draft:"1"===e.attributes.draft,cellComments:e.attributes.cellComments||"None",errors:e.attributes.errors||"displayed",scale:parseInt(e.attributes.scale||"100",10),fitToWidth:parseInt(e.attributes.fitToWidth||"1",10),fitToHeight:parseInt(e.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(e.attributes.firstPageNumber||"1",10),useFirstPageNumber:"1"===e.attributes.useFirstPageNumber,usePrinterDefaults:"1"===e.attributes.usePrinterDefaults,copies:parseInt(e.attributes.copies||"1",10)},!0);var t}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"picture"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../base-xform");function i(e){return e?"1":void 0}t.exports=class extends n{get tag(){return"printOptions"}render(e,t){if(t){const r={headings:i(t.showRowColHeaders),gridLines:i(t.showGridLines),horizontalCentered:i(t.horizontalCentered),verticalCentered:i(t.verticalCentered)};a.some(r,e=>void 0!==e)&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={showRowColHeaders:"1"===e.attributes.headings,showGridLines:"1"===e.attributes.gridLines,horizontalCentered:"1"===e.attributes.horizontalCentered,verticalCentered:"1"===e.attributes.verticalCentered},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,t,r){const a=e("./page-breaks-xform"),n=e("../list-xform");t.exports=class extends n{constructor(){super({tag:"rowBreaks",count:!0,childXform:new a})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute("manualBreakCount",t.length));const{childXform:r}=this;t.forEach(t=>{r.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,t,r){const a=e("../base-xform"),n=e("../../../utils/utils"),i=e("./cell-xform");t.exports=class extends a{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new i}}get tag(){return"row"}prepare(e,t){const r=t.styles.addStyleModel(e.style);r&&(e.styleId=r);const a=this.map.c;e.cells.forEach(e=>{a.prepare(e,t)})}render(e,t,r){e.openNode("row"),e.addAttribute("r",t.number),t.height&&(e.addAttribute("ht",t.height),e.addAttribute("customHeight","1")),t.hidden&&e.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(e.addAttribute("s",t.styleId),e.addAttribute("customFormat","1")),e.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1");const a=this.map.c;t.cells.forEach(t=>{a.render(e,t,r)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("row"===e.name){this.numRowsSeen+=1;const t=e.attributes.spans?e.attributes.spans.split(":").map(e=>parseInt(e,10)):[void 0,void 0],r=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(r.styleId=parseInt(e.attributes.s,10)),n.parseBoolean(e.attributes.hidden)&&(r.hidden=!0),n.parseBoolean(e.attributes.bestFit)&&(r.bestFit=!0),e.attributes.ht&&(r.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(r.outlineLevel=parseInt(e.attributes.outlineLevel,10)),n.parseBoolean(e.attributes.collapsed)&&(r.collapsed=!0),!0}return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},void 0!==e.styleId&&(e.styleId=void 0);const r=this.map.c;e.cells.forEach(e=>{r.reconcile(e,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../base-xform");t.exports=class extends n{get tag(){return"sheetFormatPr"}render(e,t){if(t){const r={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(r.defaultColWidth=t.defaultColWidth),t.defaultRowHeight&&15===t.defaultRowHeight||(r.customHeight="1"),a.some(r,e=>void 0!==e)&&e.leafNode("sheetFormatPr",r)}}parseOpen(e){return"sheetFormatPr"===e.name&&(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(e.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||"0",10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,t,r){const a=e("../base-xform"),n=e("../style/color-xform"),i=e("./page-setup-properties-xform"),s=e("./outline-properties-xform");t.exports=class extends a{constructor(){super(),this.map={tabColor:new n("tabColor"),pageSetUpPr:new i,outlinePr:new s}}get tag(){return"sheetPr"}render(e,t){if(t){e.addRollback(),e.openNode("sheetPr");let r=!1;r=this.map.tabColor.render(e,t.tabColor)||r,r=this.map.pageSetUpPr.render(e,t.pageSetup)||r,r=this.map.outlinePr.render(e,t.outlineProperties)||r,r?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../base-xform");function i(e,t){return e?t:void 0}function s(e,t){return e===t||void 0}t.exports=class extends n{get tag(){return"sheetProtection"}render(e,t){if(t){const r={sheet:i(t.sheet,"1"),selectLockedCells:!1===t.selectLockedCells?"1":void 0,selectUnlockedCells:!1===t.selectUnlockedCells?"1":void 0,formatCells:i(t.formatCells,"0"),formatColumns:i(t.formatColumns,"0"),formatRows:i(t.formatRows,"0"),insertColumns:i(t.insertColumns,"0"),insertRows:i(t.insertRows,"0"),insertHyperlinks:i(t.insertHyperlinks,"0"),deleteColumns:i(t.deleteColumns,"0"),deleteRows:i(t.deleteRows,"0"),sort:i(t.sort,"0"),autoFilter:i(t.autoFilter,"0"),pivotTables:i(t.pivotTables,"0")};t.sheet&&(r.algorithmName=t.algorithmName,r.hashValue=t.hashValue,r.saltValue=t.saltValue,r.spinCount=t.spinCount,r.objects=i(!1===t.objects,"1"),r.scenarios=i(!1===t.scenarios,"1")),a.some(r,e=>void 0!==e)&&e.leafNode(this.tag,r)}}parseOpen(e){return e.name===this.tag&&(this.model={sheet:s(e.attributes.sheet,"1"),objects:"1"!==e.attributes.objects&&void 0,scenarios:"1"!==e.attributes.scenarios&&void 0,selectLockedCells:"1"!==e.attributes.selectLockedCells&&void 0,selectUnlockedCells:"1"!==e.attributes.selectUnlockedCells&&void 0,formatCells:s(e.attributes.formatCells,"0"),formatColumns:s(e.attributes.formatColumns,"0"),formatRows:s(e.attributes.formatRows,"0"),insertColumns:s(e.attributes.insertColumns,"0"),insertRows:s(e.attributes.insertRows,"0"),insertHyperlinks:s(e.attributes.insertHyperlinks,"0"),deleteColumns:s(e.attributes.deleteColumns,"0"),deleteRows:s(e.attributes.deleteRows,"0"),sort:s(e.attributes.sort,"0"),autoFilter:s(e.attributes.autoFilter,"0"),pivotTables:s(e.attributes.pivotTables,"0")},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,t,r){const a=e("../../../utils/col-cache"),n=e("../base-xform"),i={frozen:"frozen",frozenSplit:"frozen",split:"split"};t.exports=class extends n{get tag(){return"sheetView"}prepare(e){switch(e.state){case"frozen":case"split":break;default:e.state="normal"}}render(e,t){e.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const r=function(t,r,a){a&&e.addAttribute(t,r)};let n,i,s,o;switch(r("rightToLeft","1",!0===t.rightToLeft),r("tabSelected","1",t.tabSelected),r("showRuler","0",!1===t.showRuler),r("showRowColHeaders","0",!1===t.showRowColHeaders),r("showGridLines","0",!1===t.showGridLines),r("zoomScale",t.zoomScale,t.zoomScale),r("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),r("view",t.style,t.style),t.state){case"frozen":i=t.xSplit||0,s=t.ySplit||0,n=t.topLeftCell||a.getAddress(s+1,i+1).address,o=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:n,activePane:o,state:"frozen"}),e.leafNode("selection",{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":"topLeft"===t.activePane&&(t.activePane=void 0),e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&e.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}e.closeNode()}parseOpen(e){switch(e.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:"1"===e.attributes.rightToLeft,tabSelected:"1"===e.attributes.tabSelected,showRuler:!("0"===e.attributes.showRuler),showRowColHeaders:!("0"===e.attributes.showRowColHeaders),showGridLines:!("0"===e.attributes.showGridLines),zoomScale:parseInt(e.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||"100",10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(e.attributes.xSplit||"0",10),ySplit:parseInt(e.attributes.ySplit||"0",10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||"topLeft",state:e.attributes.state},!0;case"selection":{const t=e.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,r;return"sheetView"!==e||(this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:i[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},"split"===this.model.state&&(t.activePane=this.pane.activePane),r=this.selections[this.pane.activePane],r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},r=this.selections.topLeft,r&&r.activeCell&&(t.activeCell=r.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1)}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"tablePart"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../../../utils/col-cache"),i=e("../../../utils/xml-stream"),s=e("../../rel-type"),o=e("./merges"),h=e("../base-xform"),l=e("../list-xform"),d=e("./row-xform"),c=e("./col-xform"),u=e("./dimension-xform"),f=e("./hyperlink-xform"),p=e("./merge-cell-xform"),y=e("./data-validations-xform"),m=e("./sheet-properties-xform"),g=e("./sheet-format-properties-xform"),b=e("./sheet-view-xform"),k=e("./sheet-protection-xform"),v=e("./page-margins-xform"),w=e("./page-setup-xform"),x=e("./print-options-xform"),M=e("./auto-filter-xform"),_=e("./picture-xform"),S=e("./drawing-xform"),j=e("./table-part-xform"),C=e("./row-breaks-xform"),A=e("./header-footer-xform"),T=e("./cf/conditional-formattings-xform"),E=e("./ext-lst-xform"),N=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;const r={},a={};return e.forEach(e=>{r[e.ref]=e,e.rules.forEach(e=>{const{x14Id:t}=e;t&&(a[t]=e)})}),t.forEach(t=>{t.rules.forEach(n=>{const i=a[n.x14Id];i?((e,t)=>{Object.keys(t).forEach(r=>{const a=e[r],n=t[r];void 0===a&&void 0!==n&&(e[r]=n)})})(i,n):r[t.ref]?r[t.ref].rules.push(n):e.push({ref:t.ref,rules:[n]})})}),e};class z extends h{constructor(e){super();const{maxRows:t,maxCols:r,ignoreNodes:a}=e||{};this.ignoreNodes=a||[],this.map={sheetPr:new m,dimension:new u,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new b}),sheetFormatPr:new g,cols:new l({tag:"cols",count:!1,childXform:new c}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new d({maxItems:r}),maxItems:t}),autoFilter:new M,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new p}),rowBreaks:new C,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new f}),pageMargins:new v,dataValidations:new y,pageSetup:new w,headerFooter:new A,printOptions:new x,picture:new _,drawing:new S,sheetProtection:new k,tableParts:new l({tag:"tableParts",count:!0,childXform:new j}),conditionalFormatting:new T,extLst:new E}}prepare(e,t){t.merges=new o,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;const r=e.rels=[];function a(e){return"rId"+(e.length+1)}if(e.hyperlinks.forEach(e=>{const t=a(r);e.rId=t,r.push({Id:t,Type:s.Hyperlink,Target:e.target,TargetMode:"External"})}),e.comments.length>0){const i={Id:a(r),Type:s.Comments,Target:`../comments${e.id}.xml`};r.push(i);const o={Id:a(r),Type:s.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};r.push(o),e.comments.forEach(e=>{e.refAddress=n.decodeAddress(e.ref)}),t.commentRefs.push({commentName:"comments"+e.id,vmlDrawing:"vmlDrawing"+e.id})}const i=[];let h;e.media.forEach(n=>{if("background"===n.type){const i=a(r);h=t.media[n.imageId],r.push({Id:i,Type:s.Image,Target:`../media/${h.name}.${h.extension}`}),e.background={rId:i},e.image=t.media[n.imageId]}else if("image"===n.type){let{drawing:o}=e;h=t.media[n.imageId],o||(o=e.drawing={rId:a(r),name:"drawing"+ ++t.drawingsCount,anchors:[],rels:[]},t.drawings.push(o),r.push({Id:o.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${o.name}.xml`}));let l=this.preImageId===n.imageId?i[n.imageId]:i[o.rels.length];l||(l=a(o.rels),i[o.rels.length]=l,o.rels.push({Id:l,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${h.name}.${h.extension}`}));const d={picture:{rId:l},range:n.range};if(n.hyperlinks&&n.hyperlinks.hyperlink){const e=a(o.rels);i[o.rels.length]=e,d.picture.hyperlinks={tooltip:n.hyperlinks.tooltip,rId:e},o.rels.push({Id:e,Type:s.Hyperlink,Target:n.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=n.imageId,o.anchors.push(d)}}),e.tables.forEach(e=>{const n=a(r);e.rId=n,r.push({Id:n,Type:s.Table,Target:"../tables/"+e.target}),e.columns.forEach(e=>{const{style:r}=e;r&&(e.dxfId=t.styles.addDxfStyle(r))})}),this.map.extLst.prepare(e,t)}render(e,t){e.openXml(i.StdDocAttributes),e.openNode("worksheet",z.WORKSHEET_ATTRIBUTES);const r=t.properties?{defaultRowHeight:t.properties.defaultRowHeight,dyDescent:t.properties.dyDescent,outlineLevelCol:t.properties.outlineLevelCol,outlineLevelRow:t.properties.outlineLevelRow}:void 0;t.properties&&t.properties.defaultColWidth&&(r.defaultColWidth=t.properties.defaultColWidth);const a={outlineProperties:t.properties&&t.properties.outlineProperties,tabColor:t.properties&&t.properties.tabColor,pageSetup:t.pageSetup&&t.pageSetup.fitToPage?{fitToPage:t.pageSetup.fitToPage}:void 0},n=t.pageSetup&&t.pageSetup.margins,o={showRowColHeaders:t.pageSetup&&t.pageSetup.showRowColHeaders,showGridLines:t.pageSetup&&t.pageSetup.showGridLines,horizontalCentered:t.pageSetup&&t.pageSetup.horizontalCentered,verticalCentered:t.pageSetup&&t.pageSetup.verticalCentered},h=t.sheetProtection;this.map.sheetPr.render(e,a),this.map.dimension.render(e,t.dimensions),this.map.sheetViews.render(e,t.views),this.map.sheetFormatPr.render(e,r),this.map.cols.render(e,t.cols),this.map.sheetData.render(e,t.rows),this.map.sheetProtection.render(e,h),this.map.autoFilter.render(e,t.autoFilter),this.map.mergeCells.render(e,t.mergeCells),this.map.conditionalFormatting.render(e,t.conditionalFormattings),this.map.dataValidations.render(e,t.dataValidations),this.map.hyperlinks.render(e,t.hyperlinks),this.map.printOptions.render(e,o),this.map.pageMargins.render(e,n),this.map.pageSetup.render(e,t.pageSetup),this.map.headerFooter.render(e,t.headerFooter),this.map.rowBreaks.render(e,t.rowBreaks),this.map.drawing.render(e,t.drawing),this.map.picture.render(e,t.background),this.map.tableParts.render(e,t.tables),this.map.extLst.render(e,t),t.rels&&t.rels.forEach(t=>{t.Type===s.VmlDrawing&&e.leafNode("legacyDrawing",{"r:id":t.Id})}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"worksheet"===e.name?(a.each(this.map,e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("worksheet"===e){const e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);const t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},r=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),a=N(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:r,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:a},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}return!0}reconcile(e,t){const r=(e.relationships||[]).reduce((r,a)=>{if(r[a.Id]=a,a.Type===s.Comments&&(e.comments=t.comments[a.Target].comments),a.Type===s.VmlDrawing&&e.comments&&e.comments.length){const r=t.vmlDrawings[a.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,r[t])})}return r},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=r[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){const a=r[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(a){const r=a[1];t.drawings[r].anchors.forEach(t=>{if(t.medium){const r={type:"image",imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(r)}})}}const a=e.background&&r[e.background.rId];if(a){const r=a.Target.split("/media/")[1],n=t.mediaIndex&&t.mediaIndex[r];void 0!==n&&e.media.push({type:"background",imageId:n})}e.tables=(e.tables||[]).map(e=>{const a=r[e.rId];return t.tables[a.Target]}),delete e.relationships,delete e.hyperlinks,delete e.comments}}z.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},t.exports=z},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?"":e.toISOString()}catch(e){return""}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag&&(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0)}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs}render(e,t){void 0!==t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(e,t,r){const a=e("./base-xform"),n=e("../../utils/xml-stream");t.exports=class extends a{constructor(e){super(),this._model=e}render(e){if(!this._xml){const e=new n;!function e(t,r){t.openNode(r.tag,r.$),r.c&&r.c.forEach(r=>{e(t,r)}),r.t&&t.writeText(r.t),t.closeNode()}(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){return e!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,t,r){const a=e("./text-xform"),n=e("./rich-text-xform"),i=e("../base-xform");t.exports=class extends i{constructor(){super(),this.map={r:new n,t:new a}}get tag(){return"rPh"}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:r}=this.map;t.richText.forEach(t=>{r.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,t,r){const a=e("./text-xform"),n=e("../style/font-xform"),i=e("../base-xform");class s extends i{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new a)}get fontXform(){return this._fontXform||(this._fontXform=new n(s.FONT_OPTIONS))}render(e,t){t=t||this.model,e.openNode("r"),t.font&&this.fontXform.render(e,t.font),this.textXform.render(e,t.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}s.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},t.exports=s},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,t,r){const a=e("./text-xform"),n=e("./rich-text-xform"),i=e("./phonetic-text-xform"),s=e("../base-xform");t.exports=class extends s{constructor(e){super(),this.model=e,this.map={r:new n,t:new a,rPh:new i}}get tag(){return"si"}render(e,t){e.openNode(this.tag),t&&t.hasOwnProperty("richText")&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,""):null!=t&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("./shared-string-xform");t.exports=class extends n{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new i)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return void 0===t&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){const t=this.sharedStringXform.toXml(e);let r=this.rich[t];return void 0===r&&(r=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,r}render(e,t){t=t||this._values,e.openXml(a.StdDocAttributes),e.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const r=this.sharedStringXform;t.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if("sst"===e)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"t"}render(e,t){e.openNode("t"),/^\s|\n|\s$/.test(t)&&e.addAttribute("xml:space","preserve"),e.writeText(t),e.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseOpen(e){return"t"===e.name&&(this._text=[],!0)}parseText(e){this._text.push(e)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,t,r){const a=e("../../../doc/enums"),n=e("../../../utils/utils"),i=e("../base-xform"),s={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return"middle"===e?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation:e=>"vertical"===e||(e=n.validInt(e))>=-90&&e<=90?e:void 0,indent:e=>(e=n.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return a.ReadingOrder.LeftToRight;case"rtl":return a.ReadingOrder.RightToLeft;default:return}}},o={toXml(e){if(e=s.textRotation(e)){if("vertical"===e)return 255;const t=Math.round(e);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(e){const t=n.validInt(e);if(void 0!==t){if(255===t)return"vertical";if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};t.exports=class extends i{get tag(){return"alignment"}render(e,t){e.addRollback(),e.openNode("alignment");let r=!1;function a(t,a){a&&(e.addAttribute(t,a),r=!0)}a("horizontal",s.horizontal(t.horizontal)),a("vertical",s.vertical(t.vertical)),a("wrapText",!!s.wrapText(t.wrapText)&&"1"),a("shrinkToFit",!!s.shrinkToFit(t.shrinkToFit)&&"1"),a("indent",s.indent(t.indent)),a("textRotation",o.toXml(t.textRotation)),a("readingOrder",s.readingOrder(t.readingOrder)),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const t={};let r=!1;function a(e,a,n){e&&(t[a]=n,r=!0)}a(e.attributes.horizontal,"horizontal",e.attributes.horizontal),a(e.attributes.vertical,"vertical","center"===e.attributes.vertical?"middle":e.attributes.vertical),a(e.attributes.wrapText,"wrapText",n.parseBoolean(e.attributes.wrapText)),a(e.attributes.shrinkToFit,"shrinkToFit",n.parseBoolean(e.attributes.shrinkToFit)),a(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),a(e.attributes.textRotation,"textRotation",o.toModel(e.attributes.textRotation)),a(e.attributes.readingOrder,"readingOrder","2"===e.attributes.readingOrder?"rtl":"ltr"),this.model=r?t:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,t,r){const a=e("../base-xform"),n=e("../../../utils/utils"),i=e("./color-xform");class s extends a{constructor(e){super(),this.name=e,this.map={color:new i}}get tag(){return this.name}render(e,t,r){const a=t&&t.color||r||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute("style",t.style),a&&this.map.color.render(e,a)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:t}=e.attributes;return this.model=t?{style:t}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return s.validStyleValues[e]}}s.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((e,t)=>(e[t]=!0,e),{}),t.exports=class extends a{constructor(){super(),this.map={top:new s("top"),left:new s("left"),bottom:new s("bottom"),right:new s("right"),diagonal:new s("diagonal")}}render(e,t){const{color:r}=t;function a(a,n){a&&!a.color&&t.color&&(a={...a,color:t.color}),n.render(e,a,r)}e.openNode("border"),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute("diagonalUp","1"),t.diagonal.down&&e.addAttribute("diagonalDown","1")),a(t.left,this.map.left),a(t.right,this.map.right),a(t.top,this.map.top),a(t.bottom,this.map.bottom),a(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"border"===e.name?(this.reset(),this.diagonalUp=n.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=n.parseBoolean(e.attributes.diagonalDown),!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("border"===e){const e=this.model={},t=function(t,r,a){r&&(a&&Object.assign(r,a),e[t]=r)};t("left",this.map.left.model),t("right",this.map.right.model),t("top",this.map.top.model),t("bottom",this.map.bottom.model),t("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{constructor(e){super(),this.name=e||"color"}get tag(){return this.name}render(e,t){return!!t&&(e.openNode(this.name),t.argb?e.addAttribute("rgb",t.argb):void 0!==t.theme?(e.addAttribute("theme",t.theme),void 0!==t.tint&&e.addAttribute("tint",t.tint)):void 0!==t.indexed?e.addAttribute("indexed",t.indexed):e.addAttribute("auto","1"),e.closeNode(),!0)}parseOpen(e){return e.name===this.name&&(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,t,r){const a=e("../base-xform"),n=e("./alignment-xform"),i=e("./border-xform"),s=e("./fill-xform"),o=e("./font-xform"),h=e("./numfmt-xform"),l=e("./protection-xform");t.exports=class extends a{constructor(){super(),this.map={alignment:new n,border:new i,fill:new s,font:new o,numFmt:new h,protection:new l}}get tag(){return"dxf"}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){const r={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,r)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,t,r){const a=e("../base-xform"),n=e("./color-xform");class i extends a{constructor(){super(),this.map={color:new n}}get tag(){return"stop"}render(e,t){e.openNode("stop"),e.addAttribute("position",t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"stop":return this.model={position:parseFloat(e.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class s extends a{constructor(){super(),this.map={fgColor:new n("fgColor"),bgColor:new n("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(e,t){e.openNode("patternFill"),e.addAttribute("patternType",t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"patternFill"===e.name?(this.model={type:"pattern",pattern:e.attributes.patternType},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0)}}class o extends a{constructor(){super(),this.map={stop:new i}}get name(){return"gradient"}get tag(){return"gradientFill"}render(e,t){switch(e.openNode("gradientFill"),t.gradient){case"angle":e.addAttribute("degree",t.degree);break;case"path":e.addAttribute("type","path"),t.center.left&&(e.addAttribute("left",t.center.left),void 0===t.center.right&&e.addAttribute("right",t.center.left)),t.center.right&&e.addAttribute("right",t.center.right),t.center.top&&(e.addAttribute("top",t.center.top),void 0===t.center.bottom&&e.addAttribute("bottom",t.center.top)),t.center.bottom&&e.addAttribute("bottom",t.center.bottom)}const r=this.map.stop;t.stops.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"gradientFill":{const t=this.model={stops:[]};return e.attributes.degree?(t.gradient="angle",t.degree=parseInt(e.attributes.degree,10)):"path"===e.attributes.type&&(t.gradient="path",t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class h extends a{constructor(){super(),this.map={patternFill:new s,gradientFill:new o}}get tag(){return"fill"}render(e,t){switch(e.addRollback(),e.openNode("fill"),t.type){case"pattern":this.map.patternFill.render(e,t);break;case"gradient":this.map.gradientFill.render(e,t);break;default:return void e.rollback()}e.closeNode(),e.commit()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"fill"===e.name?(this.model={},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(e){return h.validPatternValues[e]}}h.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((e,t)=>(e[t]=!0,e),{}),h.StopXform=i,h.PatternFillXform=s,h.GradientFillXform=o,t.exports=h},{"../base-xform":32,"./color-xform":128}],131:[function(e,t,r){const a=e("./color-xform"),n=e("../simple/boolean-xform"),i=e("../simple/integer-xform"),s=e("../simple/string-xform"),o=e("./underline-xform"),h=e("../../../utils/under-dash"),l=e("../base-xform");class d extends l{constructor(e){super(),this.options=e||d.OPTIONS,this.map={b:{prop:"bold",xform:new n({tag:"b",attr:"val"})},i:{prop:"italic",xform:new n({tag:"i",attr:"val"})},u:{prop:"underline",xform:new o},charset:{prop:"charset",xform:new i({tag:"charset",attr:"val"})},color:{prop:"color",xform:new a},condense:{prop:"condense",xform:new n({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new n({tag:"extend",attr:"val"})},family:{prop:"family",xform:new i({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new n({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new s({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new s({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new n({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new n({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new i({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new s({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(e,t){const{map:r}=this;e.openNode(this.options.tagName),h.each(this.map,(a,n)=>{r[n].xform.render(e,t[a.prop])}),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):this.map[e.name]?(this.parser=this.map[e.name].xform,this.parser.parseOpen(e)):e.name===this.options.tagName&&(this.model={},!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){const t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}return e!==this.options.tagName}}d.OPTIONS={tagName:"font",fontNameTag:"name"},t.exports=d},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,t,r){const a=e("../../../utils/under-dash"),n=e("../../defaultnumformats"),i=e("../base-xform"),s=function(){const e={};return a.each(n,(t,r)=>{t.f&&(e[t.f]=parseInt(r,10))}),e}();class o extends i{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return"numFmt"}render(e,t){e.leafNode("numFmt",{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){return"numFmt"===e.name&&(this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0)}parseText(){}parseClose(){return!1}}o.getDefaultFmtId=function(e){return s[e]},o.getDefaultFmtCode=function(e){return n[e]&&n[e].f},t.exports=o},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,t,r){const a=e("../base-xform"),n={boolean:(e,t)=>void 0===e?t:e};t.exports=class extends a{get tag(){return"protection"}render(e,t){e.addRollback(),e.openNode("protection");let r=!1;function a(t,a){void 0!==a&&(e.addAttribute(t,a),r=!0)}a("locked",n.boolean(t.locked,!0)?void 0:"0"),a("hidden",n.boolean(t.hidden,!1)?"1":void 0),e.closeNode(),r?e.commit():e.rollback()}parseOpen(e){const t={locked:!("0"===e.attributes.locked),hidden:"1"===e.attributes.hidden},r=!t.locked||t.hidden;this.model=r?t:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,t,r){const a=e("../base-xform"),n=e("./alignment-xform"),i=e("./protection-xform");t.exports=class extends a{constructor(e){super(),this.xfId=!(!e||!e.xfId),this.map={alignment:new n,protection:new i}}get tag(){return"xf"}render(e,t){e.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute("xfId",t.xfId||0),t.numFmtId&&e.addAttribute("applyNumberFormat","1"),t.fontId&&e.addAttribute("applyFont","1"),t.fillId&&e.addAttribute("applyFill","1"),t.borderId&&e.addAttribute("applyBorder","1"),t.alignment&&e.addAttribute("applyAlignment","1"),t.protection&&e.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"xf":return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):"xf"!==e}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,t,r){const a=e("../../../doc/enums"),n=e("../../../utils/xml-stream"),i=e("../base-xform"),s=e("../static-xform"),o=e("../list-xform"),h=e("./font-xform"),l=e("./fill-xform"),d=e("./border-xform"),c=e("./numfmt-xform"),u=e("./style-xform"),f=e("./dxf-xform");class p extends i{constructor(e){super(),this.map={numFmts:new o({tag:"numFmts",count:!0,childXform:new c}),fonts:new o({tag:"fonts",count:!0,childXform:new h,$:{"x14ac:knownFonts":1}}),fills:new o({tag:"fills",count:!0,childXform:new l}),borders:new o({tag:"borders",count:!0,childXform:new d}),cellStyleXfs:new o({tag:"cellStyleXfs",count:!0,childXform:new u}),cellXfs:new o({tag:"cellXfs",count:!0,childXform:new u({xfId:!0})}),dxfs:new o({tag:"dxfs",always:!0,count:!0,childXform:new f}),numFmt:new c,font:new h,fill:new l,border:new d,style:new u({xfId:!0}),cellStyles:p.STATIC_XFORMS.cellStyles,tableStyles:p.STATIC_XFORMS.tableStyles,extLst:p.STATIC_XFORMS.extLst},e&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(e,t){t=t||this.model,e.openXml(n.StdDocAttributes),e.openNode("styleSheet",p.STYLESHEET_ATTRIBUTES),this.index?(t.numFmts&&t.numFmts.length&&(e.openNode("numFmts",{count:t.numFmts.length}),t.numFmts.forEach(t=>{e.writeXml(t)}),e.closeNode()),t.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),e.openNode("fonts",{count:t.fonts.length,"x14ac:knownFonts":1}),t.fonts.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode("fills",{count:t.fills.length}),t.fills.forEach(t=>{e.writeXml(t)}),e.closeNode(),e.openNode("borders",{count:t.borders.length}),t.borders.forEach(t=>{e.writeXml(t)}),e.closeNode(),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),e.openNode("cellXfs",{count:t.styles.length}),t.styles.forEach(t=>{e.writeXml(t)}),e.closeNode()):(this.map.numFmts.render(e,t.numFmts),this.map.fonts.render(e,t.fonts),this.map.fills.render(e,t.fills),this.map.borders.render(e,t.borders),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(e,t.styles)),p.STATIC_XFORMS.cellStyles.render(e),this.map.dxfs.render(e,t.dxfs),p.STATIC_XFORMS.tableStyles.render(e),p.STATIC_XFORMS.extLst.render(e),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"styleSheet"===e.name?(this.initIndex(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("styleSheet"===e){this.model={};const e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e("numFmts",this.map.numFmts),e("fonts",this.map.fonts),e("fills",this.map.fills),e("borders",this.map.borders),e("styles",this.map.cellXfs),e("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}return!0}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);const r={};if(t=t||a.ValueType.Number,e.numFmt)r.numFmtId=this._addNumFmtStr(e.numFmt);else switch(t){case a.ValueType.Number:r.numFmtId=this._addNumFmtStr("General");break;case a.ValueType.Date:r.numFmtId=this._addNumFmtStr("mm-dd-yy")}e.font&&(r.fontId=this._addFont(e.font)),e.border&&(r.borderId=this._addBorder(e.border)),e.fill&&(r.fillId=this._addFill(e.fill)),e.alignment&&(r.alignment=e.alignment),e.protection&&(r.protection=e.protection);const n=this._addStyle(r);return this.weakMap&&this.weakMap.set(e,n),n}getStyleModel(e){const t=this.model.styles[e];if(!t)return null;let r=this.index.model[e];if(r)return r;if(r=this.index.model[e]={},t.numFmtId){const e=this.index.numFmt[t.numFmtId]||c.getDefaultFmtCode(t.numFmtId);e&&(r.numFmt=e)}function a(e,t,a){if(a||0===a){const n=t[a];n&&(r[e]=n)}}return a("font",this.model.fonts,t.fontId),a("border",this.model.borders,t.borderId),a("fill",this.model.fills,t.fillId),t.alignment&&(r.alignment=t.alignment),t.protection&&(r.protection=t.protection),r}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){const t=this.map.style.toXml(e);let r=this.index.style[t];return void 0===r&&(r=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),r}_addNumFmtStr(e){let t=c.getDefaultFmtId(e);if(void 0!==t)return t;if(t=this.index.numFmt[e],void 0!==t)return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;const r=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(r),t}_addFont(e){const t=this.map.font.toXml(e);let r=this.index.font[t];return void 0===r&&(r=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),r}_addBorder(e){const t=this.map.border.toXml(e);let r=this.index.border[t];return void 0===r&&(r=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),r}_addFill(e){const t=this.map.fill.toXml(e);let r=this.index.fill[t];return void 0===r&&(r=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),r}}p.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},p.STATIC_XFORMS={cellStyles:new s({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new s({tag:"dxfs",$:{count:0}}),tableStyles:new s({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new s({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},p.Mock=class extends p{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){return t===a.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){const e={numFmtId:c.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}},t.exports=p},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,t,r){const a=e("../base-xform");class n extends a{constructor(e){super(),this.model=e}get tag(){return"u"}render(e,t){if(!0===(t=t||this.model))e.leafNode("u");else{const r=n.Attributes[t];r&&e.leafNode("u",r)}}parseOpen(e){"u"===e.name&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}}n.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},t.exports=n},{"../base-xform":32}],137:[function(e,t,r){const a=e("../base-xform"),n=e("./filter-column-xform");t.exports=class extends a{constructor(){super(),this.map={filterColumn:new n}}get tag(){return"autoFilter"}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){return e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode(),!0}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(e===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"customFilter"}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val,operator:e.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,t,r){const a=e("../base-xform"),n=e("../list-xform"),i=e("./custom-filter-xform"),s=e("./filter-xform");t.exports=class extends a{constructor(){super(),this.map={customFilters:new n({tag:"customFilters",count:!1,empty:!0,childXform:new i}),filters:new n({tag:"filters",count:!1,empty:!0,childXform:new s})}}get tag(){return"filterColumn"}prepare(e,t){e.colId=t.index.toString()}render(e,t){return t.customFilters?(e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),this.map.customFilters.render(e,t.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{attributes:t}=e;if(e.name===this.tag)return this.model={filterButton:"0"===t.hiddenButton},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.customFilters=this.map.customFilters.model,!1)}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"filter"}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"tableColumn"}prepare(e,t){e.id=t.index+1}render(e,t){return e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,t,r){const a=e("../base-xform");t.exports=class extends a{get tag(){return"tableStyleInfo"}render(e,t){return e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?"1":"0",showLastColumn:t.showLastColumn?"1":"0",showRowStripes:t.showRowStripes?"1":"0",showColumnStripes:t.showColumnStripes?"1":"0"}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:"1"===t.showFirstColumn,showLastColumn:"1"===t.showLastColumn,showRowStripes:"1"===t.showRowStripes,showColumnStripes:"1"===t.showColumnStripes},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,t,r){const a=e("../../../utils/xml-stream"),n=e("../base-xform"),i=e("../list-xform"),s=e("./auto-filter-xform"),o=e("./table-column-xform"),h=e("./table-style-info-xform");class l extends n{constructor(){super(),this.map={autoFilter:new s,tableColumns:new i({tag:"tableColumns",count:!0,empty:!0,childXform:new o}),tableStyleInfo:new h}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return"table"}render(e,t){e.openXml(a.StdDocAttributes),e.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:t.id,name:t.name,displayName:t.displayName||t.name,ref:t.tableRef,totalsRowCount:t.totalsRow?"1":void 0,totalsRowShown:t.totalsRow?void 0:"1",headerRowCount:t.headerRow?"1":"0"}),this.map.autoFilter.render(e,t),this.map.tableColumns.render(e,t.columns),this.map.tableStyleInfo.render(e,t.style),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{name:t,attributes:r}=e;return t===this.tag?(this.reset(),this.model={name:r.name,displayName:r.displayName||r.name,tableRef:r.ref,totalsRow:"1"===r.totalsRowCount,headerRow:"1"===r.headerRowCount}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1)}reconcile(e,t){e.columns.forEach(e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},t.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,t,r){(function(r,a){(function(){const n=e("fs"),i=e("jszip"),{PassThrough:s}=e("readable-stream"),o=e("../utils/zip-stream"),h=e("../utils/stream-buf"),l=e("../utils/utils"),d=e("../utils/xml-stream"),{bufferToString:c}=e("../utils/browser-buffer-decode"),u=e("./xform/style/styles-xform"),f=e("./xform/core/core-xform"),p=e("./xform/strings/shared-strings-xform"),y=e("./xform/core/relationships-xform"),m=e("./xform/core/content-types-xform"),g=e("./xform/core/app-xform"),b=e("./xform/book/workbook-xform"),k=e("./xform/sheet/worksheet-xform"),v=e("./xform/drawing/drawing-xform"),w=e("./xform/table/table-xform"),x=e("./xform/comment/comments-xform"),M=e("./xform/comment/vml-notes-xform"),_=e("./xml/theme1");class S{constructor(e){this.workbook=e}async readFile(e,t){if(!await l.fs.exists(e))throw new Error("File not found: "+e);const r=n.createReadStream(e);try{const e=await this.read(r,t);return r.close(),e}catch(e){throw r.close(),e}}parseRels(e){return(new y).parseStream(e)}parseWorkbook(e){return(new b).parseStream(e)}parseSharedStrings(e){return(new p).parseStream(e)}reconcile(e,t){const r=new b,a=new k(t),n=new v,i=new w;r.reconcile(e);const s={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{const r=e.drawings[t],a=e.drawingRels[t];a&&(s.rels=a.reduce((e,t)=>(e[t.Id]=t,e),{}),(r.anchors||[]).forEach(e=>{const t=e.picture&&e.picture.hyperlinks;t&&s.rels[t.rId]&&(t.hyperlink=s.rels[t.rId].Target,delete t.rId)}),n.reconcile(r,s))});const o={styles:e.styles};Object.values(e.tables).forEach(e=>{i.reconcile(e,o)});const h={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],a.reconcile(t,h)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,r,a,n){const i=new k(a),s=await i.parseStream(e);s.sheetNo=r,t.worksheetHash[n]=s,t.worksheets.push(s)}async _processCommentEntry(e,t,r){const a=new x,n=await a.parseStream(e);t.comments[`../${r}.xml`]=n}async _processTableEntry(e,t,r){const a=new w,n=await a.parseStream(e);t.tables[`../tables/${r}.xml`]=n}async _processWorksheetRelsEntry(e,t,r){const a=new y,n=await a.parseStream(e);t.worksheetRels[r]=n}async _processMediaEntry(e,t,r){const a=r.lastIndexOf(".");if(a>=1){const n=r.substr(a+1),i=r.substr(0,a);await new Promise((a,s)=>{const o=new h;o.on("finish",()=>{t.mediaIndex[r]=t.media.length,t.mediaIndex[i]=t.media.length;const e={type:"image",name:i,extension:n,buffer:o.toBuffer()};t.media.push(e),a()}),e.on("error",e=>{s(e)}),e.pipe(o)})}}async _processDrawingEntry(e,t,r){const a=new v,n=await a.parseStream(e);t.drawings[r]=n}async _processDrawingRelsEntry(e,t,r){const a=new y,n=await a.parseStream(e);t.drawingRels[r]=n}async _processVmlDrawingEntry(e,t,r){const a=new M,n=await a.parseStream(e);t.vmlDrawings[`../drawings/${r}.vml`]=n}async _processThemeEntry(e,t,r){await new Promise((a,n)=>{const i=new h;e.on("error",n),i.on("error",n),i.on("finish",()=>{t.themes[r]=i.read().toString(),a()}),e.pipe(i)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(e,t){!e[Symbol.asyncIterator]&&e.pipe&&(e=e.pipe(new s));const r=[];for await(const t of e)r.push(t);return this.load(a.concat(r),t)}async load(e,t){let n;n=t&&t.base64?a.from(e.toString(),"base64"):e;const o={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},h=await i.loadAsync(n);for(const e of Object.values(h.files))if(!e.dir){let a,n=e.name;if("/"===n[0]&&(n=n.substr(1)),n.match(/xl\/media\//)||n.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))a=new s,a.write(await e.async("nodebuffer"));else{let t;a=new s({writableObjectMode:!0,readableObjectMode:!0}),t=r.browser?c(await e.async("nodebuffer")):await e.async("string");const n=16384;for(let e=0;e<t.length;e+=n)a.write(t.substring(e,e+n))}switch(a.end(),n){case"_rels/.rels":o.globalRels=await this.parseRels(a);break;case"xl/workbook.xml":{const e=await this.parseWorkbook(a);o.sheets=e.sheets,o.definedNames=e.definedNames,o.views=e.views,o.properties=e.properties,o.calcProperties=e.calcProperties;break}case"xl/_rels/workbook.xml.rels":o.workbookRels=await this.parseRels(a);break;case"xl/sharedStrings.xml":o.sharedStrings=new p,await o.sharedStrings.parseStream(a);break;case"xl/styles.xml":o.styles=new u,await o.styles.parseStream(a);break;case"docProps/app.xml":{const e=new g,t=await e.parseStream(a);o.company=t.company,o.manager=t.manager;break}case"docProps/core.xml":{const e=new f,t=await e.parseStream(a);Object.assign(o,t);break}default:{let e=n.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(e){await this._processWorksheetEntry(a,o,e[1],t,n);break}if(e=n.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),e){await this._processWorksheetRelsEntry(a,o,e[1]);break}if(e=n.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),e){await this._processThemeEntry(a,o,e[1]);break}if(e=n.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),e){await this._processMediaEntry(a,o,e[1]);break}if(e=n.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),e){await this._processDrawingEntry(a,o,e[1]);break}if(e=n.match(/xl\/(comments\d+)[.]xml/),e){await this._processCommentEntry(a,o,e[1]);break}if(e=n.match(/xl\/tables\/(table\d+)[.]xml/),e){await this._processTableEntry(a,o,e[1]);break}if(e=n.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),e){await this._processDrawingRelsEntry(a,o,e[1]);break}if(e=n.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),e){await this._processVmlDrawingEntry(a,o,e[1]);break}}}}return this.reconcile(o,t),this.workbook.model=o,this.workbook}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if("image"===t.type){const r=`xl/media/${t.name}.${t.extension}`;if(t.filename){const a=await function(e,t){return new Promise((r,a)=>{n.readFile(e,t,(e,t)=>{e?a(e):r(t)})})}(t.filename);return e.append(a,{name:r})}if(t.buffer)return e.append(t.buffer,{name:r});if(t.base64){const a=t.base64,n=a.substring(a.indexOf(",")+1);return e.append(n,{name:r,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(e,t){const r=new v,a=new y;t.worksheets.forEach(t=>{const{drawing:n}=t;if(n){r.prepare(n,{});let t=r.toXml(n);e.append(t,{name:`xl/drawings/${n.name}.xml`}),t=a.toXml(n.rels),e.append(t,{name:`xl/drawings/_rels/${n.name}.xml.rels`})}})}addTables(e,t){const r=new w;t.worksheets.forEach(t=>{const{tables:a}=t;a.forEach(t=>{r.prepare(t,{});const a=r.toXml(t);e.append(a,{name:"xl/tables/"+t.target})})})}async addContentTypes(e,t){const r=(new m).toXml(t);e.append(r,{name:"[Content_Types].xml"})}async addApp(e,t){const r=(new g).toXml(t);e.append(r,{name:"docProps/app.xml"})}async addCore(e,t){const r=new f;e.append(r.toXml(t),{name:"docProps/core.xml"})}async addThemes(e,t){const r=t.themes||{theme1:_};Object.keys(r).forEach(t=>{const a=r[t],n=`xl/theme/${t}.xml`;e.append(a,{name:n})})}async addOfficeRels(e){const t=(new y).toXml([{Id:"rId1",Type:S.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:S.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:S.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);e.append(t,{name:"_rels/.rels"})}async addWorkbookRels(e,t){let r=1;const a=[{Id:"rId"+r++,Type:S.RelType.Styles,Target:"styles.xml"},{Id:"rId"+r++,Type:S.RelType.Theme,Target:"theme/theme1.xml"}];t.sharedStrings.count&&a.push({Id:"rId"+r++,Type:S.RelType.SharedStrings,Target:"sharedStrings.xml"}),t.worksheets.forEach(e=>{e.rId="rId"+r++,a.push({Id:e.rId,Type:S.RelType.Worksheet,Target:`worksheets/sheet${e.id}.xml`})});const n=(new y).toXml(a);e.append(n,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(e,t){const{xml:r}=t.styles;r&&e.append(r,{name:"xl/styles.xml"})}async addWorkbook(e,t){const r=new b;e.append(r.toXml(t),{name:"xl/workbook.xml"})}async addWorksheets(e,t){const r=new k,a=new y,n=new x,i=new M;t.worksheets.forEach(t=>{let s=new d;r.render(s,t),e.append(s.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(s=new d,a.render(s,t.rels),e.append(s.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(s=new d,n.render(s,t),e.append(s.xml,{name:`xl/comments${t.id}.xml`}),s=new d,i.render(s,t),e.append(s.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}_finalize(e){return new Promise((t,r)=>{e.on("finish",()=>{t(this)}),e.on("error",r),e.finalize()})}prepareModel(e,t){e.creator=e.creator||"ExcelJS",e.lastModifiedBy=e.lastModifiedBy||"ExcelJS",e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=void 0===t.useSharedStrings||t.useSharedStrings,e.useStyles=void 0===t.useStyles||t.useStyles,e.sharedStrings=new p,e.styles=e.useStyles?new u(!0):new u.Mock;const r=new b,a=new k;r.prepare(e);const n={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};n.drawings=e.drawings=[],n.commentRefs=e.commentRefs=[];let i=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{i++,t.target=`table${i}.xml`,t.id=i,e.tables.push(t)}),a.prepare(t,n)})}async write(e,t){t=t||{};const{model:r}=this.workbook,a=new o.ZipWriter(t.zip);return a.pipe(e),this.prepareModel(r,t),await this.addContentTypes(a,r),await this.addOfficeRels(a,r),await this.addWorkbookRels(a,r),await this.addWorksheets(a,r),await this.addSharedStrings(a,r),await this.addDrawings(a,r),await this.addTables(a,r),await Promise.all([this.addThemes(a,r),this.addStyles(a,r)]),await this.addMedia(a,r),await Promise.all([this.addApp(a,r),this.addCore(a,r)]),await this.addWorkbook(a,r),this._finalize(a)}writeFile(e,t){const r=n.createWriteStream(e);return new Promise((e,a)=>{r.on("finish",()=>{e()}),r.on("error",e=>{a(e)}),this.write(r,t).then(()=>{r.end()}).catch(e=>{a(e)})})}async writeBuffer(e){const t=new h;return await this.write(t,e),t.read()}}S.RelType=e("./rel-type"),t.exports=S}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,t,r){t.exports='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>'},{}],146:[function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CsvFormatterStream=void 0;const a=e("stream"),n=e("./formatter");class i extends a.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new n.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,r,a){let n=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,(e,r)=>e?(n=!0,a(e)):(r&&r.forEach(e=>{this.push(t.from(e,"utf8"))}),n=!0,a()))}catch(e){if(n)throw e;a(e)}}_flush(e){this.rowFormatter.finish((r,a)=>r?e(r):(a&&a.forEach(e=>{this.push(t.from(e,"utf8"))}),e()))}}r.CsvFormatterStream=i}).call(this)}).call(this,e("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.FormatterOptions=void 0,r.FormatterOptions=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.objectMode=!0,this.delimiter=",",this.rowDelimiter="\n",this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\ufeff",this.alwaysWriteHeaders=!1,Object.assign(this,e||{}),void 0===(null==e?void 0:e.quoteHeaders)&&(this.quoteHeaders=this.quoteColumns),!0===(null==e?void 0:e.quote)?this.quote='"':!1===(null==e?void 0:e.quote)&&(this.quote=""),"string"!=typeof(null==e?void 0:e.escape)&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(null===(t=e.writeHeaders)||void 0===t||t),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(e,t,r){var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=void 0;const n=a(e("lodash.isboolean")),i=a(e("lodash.isnil")),s=a(e("lodash.escaperegexp"));r.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,null!==e.headers&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,"g");const t=`[${e.delimiter}${s.default(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){const r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return n.default(r)?r:Array.isArray(r)?r[e]:null!==this._headers&&r[this._headers[e]]}format(e,t,r){const a=(""+(i.default(e)?"":e)).replace(/\0/g,""),{formatterOptions:n}=this;return""!==n.quote&&-1!==a.indexOf(n.quote)?this.quoteField(a.replace(this.REPLACE_REGEXP,n.escapedQuote)):-1!==a.search(this.ESCAPE_REGEXP)||this.shouldQuote(t,r)?this.quoteField(a):a}quoteField(e){const{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,t,r){var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.RowFormatter=void 0;const n=a(e("lodash.isfunction")),i=a(e("lodash.isequal")),s=e("./FieldFormatter"),o=e("../types");class h{constructor(e){this.rowCount=0,this.formatterOptions=e,this.fieldFormatter=new s.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,null!==this.headers&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}static isRowHashArray(e){return!!Array.isArray(e)&&Array.isArray(e[0])&&2===e[0].length}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(e){return h.isRowHashArray(e)?e.map(e=>e[0]):Array.isArray(e)?e:Object.keys(e)}static createTransform(e){return o.isSyncTransform(e)?(t,r)=>{let a=null;try{a=e(t)}catch(e){return r(e)}return r(null,a)}:(t,r)=>{e(t,r)}}set rowTransform(e){if(!n.default(e))throw new TypeError("The transform should be a function");this._rowTransform=h.createTransform(e)}format(e,t){this.callTransformer(e,(r,a)=>{if(r)return t(r);if(!e)return t(null);const n=[];if(a){const{shouldFormatColumns:e,headers:t}=this.checkHeaders(a);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(n.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){const e=this.gatherColumns(a);n.push(this.formatColumns(e,!1))}}return t(null,n)})}finish(e){const t=[];if(this.formatterOptions.alwaysWriteHeaders&&0===this.rowCount){if(!this.headers)return e(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(e){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const t=h.gatherHeaders(e);return this.headers=t,this.fieldFormatter.headers=t,this.shouldWriteHeaders?{shouldFormatColumns:!i.default(t,e),headers:t}:{shouldFormatColumns:!0,headers:null}}gatherColumns(e){if(null===this.headers)throw new Error("Headers is currently null");return Array.isArray(e)?h.isRowHashArray(e)?this.headers.map((t,r)=>{const a=e[r];return a?a[1]:""}):h.isRowArray(e)&&!this.shouldWriteHeaders?e:this.headers.map((t,r)=>e[r]):this.headers.map(t=>e[t])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){const r=e.map((e,r)=>this.fieldFormatter.format(e,r,t)).join(this.formatterOptions.delimiter),{rowCount:a}=this;return this.rowCount+=1,a?[this.formatterOptions.rowDelimiter,r].join(""):r}}r.RowFormatter=h},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=r.RowFormatter=void 0;var a=e("./RowFormatter");Object.defineProperty(r,"RowFormatter",{enumerable:!0,get:function(){return a.RowFormatter}});var n=e("./FieldFormatter");Object.defineProperty(r,"FieldFormatter",{enumerable:!0,get:function(){return n.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,t,r){(function(t){(function(){var a=Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]},n=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},s=function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.writeToPath=r.writeToString=r.writeToBuffer=r.writeToStream=r.write=r.format=r.FormatterOptions=r.CsvFormatterStream=void 0;const o=e("util"),h=e("stream"),l=i(e("fs")),d=e("./FormatterOptions"),c=e("./CsvFormatterStream");s(e("./types"),r);var u=e("./CsvFormatterStream");Object.defineProperty(r,"CsvFormatterStream",{enumerable:!0,get:function(){return u.CsvFormatterStream}});var f=e("./FormatterOptions");Object.defineProperty(r,"FormatterOptions",{enumerable:!0,get:function(){return f.FormatterOptions}}),r.format=e=>new c.CsvFormatterStream(new d.FormatterOptions(e)),r.write=(e,t)=>{const a=r.format(t),n=o.promisify((e,t)=>{a.write(e,void 0,t)});return e.reduce((e,t)=>e.then(()=>n(t)),Promise.resolve()).then(()=>a.end()).catch(e=>{a.emit("error",e)}),a},r.writeToStream=(e,t,a)=>r.write(t,a).pipe(e),r.writeToBuffer=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[],i=new h.Writable({write(e,t,r){n.push(e),r()}});return new Promise((s,o)=>{i.on("error",o).on("finish",()=>s(t.concat(n))),r.write(e,a).pipe(i)})},r.writeToString=(e,t)=>r.writeToBuffer(e,t).then(e=>e.toString()),r.writeToPath=(e,t,a)=>{const n=l.createWriteStream(e,{encoding:"utf8"});return r.write(t,a).pipe(n)}}).call(this)}).call(this,e("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isSyncTransform=void 0,r.isSyncTransform=e=>1===e.length},{}],153:[function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=void 0;const a=e("string_decoder"),n=e("stream"),i=e("./transforms"),s=e("./parser");class o extends n.Transform{constructor(e){super({objectMode:e.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=e,this.parser=new s.Parser(e),this.headerTransformer=new i.HeaderTransformer(e),this.decoder=new a.StringDecoder(e.encoding),this.rowTransformerValidator=new i.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e){if("end"===e)return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return super.emit(e,...r)}_transform(e,t,r){if(this.hasHitRowLimit)return r();const a=o.wrapDoneCallback(r);try{const{lines:t}=this,r=t+this.decoder.write(e),n=this.parse(r,!0);return this.processRows(n,a)}catch(e){return a(e)}}_flush(e){const t=o.wrapDoneCallback(e);if(this.hasHitRowLimit)return t();try{const e=this.lines+this.decoder.end(),r=this.parse(e,!1);return this.processRows(r,t)}catch(e){return t(e)}}parse(e,t){if(!e)return[];const{line:r,rows:a}=this.parser.parse(e,t);return this.lines=r,a}processRows(e,r){const a=e.length,n=i=>{const s=e=>e?r(e):i%100!=0?n(i+1):void t(()=>n(i+1));if(this.checkAndEmitHeaders(),i>=a||this.hasHitRowLimit)return r();if(this.parsedLineCount+=1,this.shouldSkipLine)return s();const o=e[i];this.rowCount+=1,this.parsedRowCount+=1;const h=this.rowCount;return this.transformRow(o,(e,t)=>{if(e)return this.rowCount-=1,s(e);if(!t)return s(new Error("expected transform result"));if(t.isValid){if(t.row)return this.pushRow(t.row,s)}else this.emit("data-invalid",t.row,h,t.reason);return s()})};n(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(r,a)=>r?t(r):a?a.isValid?a.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(a.row,t):this.skipRow(t):(this.rowCount-=1,this.parsedRowCount-=1,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(new Error("Expected result from header transform")))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(e){return this.rowCount-=1,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return function(r){if(r){if(t)throw r;return t=!0,void e(r)}for(var a=arguments.length,n=new Array(a>1?a-1:0),i=1;i<a;i++)n[i-1]=arguments[i];e(...n)}}}r.CsvParserStream=o}).call(this)}).call(this,e("timers").setImmediate)},{"./parser":165,"./transforms":168,stream:505,string_decoder:218,timers:523}],154:[function(e,t,r){var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ParserOptions=void 0;const n=a(e("lodash.escaperegexp")),i=a(e("lodash.isnil"));r.ParserOptions=class{constructor(e){var t;if(this.objectMode=!0,this.delimiter=",",this.ignoreEmpty=!1,this.quote='"',this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn="\r",this.encoding="utf8",this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,e||{}),this.delimiter.length>1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=n.default(this.delimiter),this.escapeChar=null!==(t=this.escape)&&void 0!==t?t:this.quote,this.supportsComments=!i.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,t,r){var a=Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]},n=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},s=function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.parseString=r.parseFile=r.parseStream=r.parse=r.ParserOptions=r.CsvParserStream=void 0;const o=i(e("fs")),h=e("stream"),l=e("./ParserOptions"),d=e("./CsvParserStream");s(e("./types"),r);var c=e("./CsvParserStream");Object.defineProperty(r,"CsvParserStream",{enumerable:!0,get:function(){return c.CsvParserStream}});var u=e("./ParserOptions");Object.defineProperty(r,"ParserOptions",{enumerable:!0,get:function(){return u.ParserOptions}}),r.parse=e=>new d.CsvParserStream(new l.ParserOptions(e)),r.parseStream=(e,t)=>e.pipe(new d.CsvParserStream(new l.ParserOptions(t))),r.parseFile=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.createReadStream(e).pipe(new d.CsvParserStream(new l.ParserOptions(t)))},r.parseString=(e,t)=>{const r=new h.Readable;return r.push(e),r.push(null),r.pipe(new d.CsvParserStream(new l.ParserOptions(t)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Parser=void 0;const a=e("./Scanner"),n=e("./RowParser"),i=e("./Token");class s{constructor(e){this.parserOptions=e,this.rowParser=new n.RowParser(this.parserOptions)}static removeBOM(e){return e&&65279===e.charCodeAt(0)?e.slice(1):e}parse(e,t){const r=new a.Scanner({line:s.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:t});return this.parserOptions.supportsComments?this.parseWithComments(r):this.parseWithoutComments(r)}parseWithoutComments(e){const t=[];let r=!0;for(;r;)r=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){const{parserOptions:t}=this,r=[];for(let a=e.nextCharacterToken;null!==a;a=e.nextCharacterToken)if(i.Token.isTokenComment(a,t)){if(null===e.advancePastLine())return{line:e.lineFromCursor,rows:r};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:r};e.truncateToCursor()}else if(!this.parseRow(e,r))break;return{line:e.line,rows:r}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;const r=this.rowParser.parse(e);return null!==r&&(this.parserOptions.ignoreEmpty&&n.RowParser.isEmptyRow(r)||t.push(r),!0)}}r.Parser=s},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RowParser=void 0;const a=e("./column"),n=e("./Token");r.RowParser=class{constructor(e){this.parserOptions=e,this.columnParser=new a.ColumnParser(e)}static isEmptyRow(e){return""===e.join("").replace(/\s+/g,"")}parse(e){const{parserOptions:t}=this,{hasMoreData:r}=e,a=e,i=[];let s=this.getStartToken(a,i);for(;s;){if(n.Token.isTokenRowDelimiter(s))return a.advancePastToken(s),!a.hasMoreCharacters&&n.Token.isTokenCarriageReturn(s,t)&&r?null:(a.truncateToCursor(),i);if(!this.shouldSkipColumnParse(a,s,i)){const e=this.columnParser.parse(a);if(null===e)return null;i.push(e)}s=a.nextNonSpaceToken}return r?null:(a.truncateToCursor(),i)}getStartToken(e,t){const r=e.nextNonSpaceToken;return null!==r&&n.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(""),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){const{parserOptions:a}=this;if(n.Token.isTokenDelimiter(t,a)){e.advancePastToken(t);const i=e.nextCharacterToken;if(!e.hasMoreCharacters||null!==i&&n.Token.isTokenRowDelimiter(i))return r.push(""),!0;if(null!==i&&n.Token.isTokenDelimiter(i,a))return r.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Scanner=void 0;const a=e("./Token"),n=/((?:\r\n)|\n|\r)/;r.Scanner=class{constructor(e){this.cursor=0,this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:e}=this,t=this.parserOptions.NEXT_TOKEN_REGEXP;if(-1===e.search(t))return null;const r=t.exec(e);if(null==r)return null;const n=r[1],i=this.cursor+(r.index||0);return new a.Token({token:n,startCursor:i,endCursor:i+n.length-1})}get nextCharacterToken(){const{cursor:e,lineLength:t}=this;return t<=e?null:new a.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const e=n.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Token=void 0,r.Token=class{constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}static isTokenRowDelimiter(e){const t=e.token;return"\r"===t||"\n"===t||"\r\n"===t}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}}},{}],160:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnFormatter=void 0,r.ColumnFormatter=class{constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}},{}],161:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnParser=void 0;const a=e("./NonQuotedColumnParser"),n=e("./QuotedColumnParser"),i=e("../Token");r.ColumnParser=class{constructor(e){this.parserOptions=e,this.quotedColumnParser=new n.QuotedColumnParser(e),this.nonQuotedColumnParser=new a.NonQuotedColumnParser(e)}parse(e){const{nextNonSpaceToken:t}=e;return null!==t&&i.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NonQuotedColumnParser=void 0;const a=e("./ColumnFormatter"),n=e("../Token");r.NonQuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new a.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const{parserOptions:t}=this,r=[];let a=e.nextCharacterToken;for(;a&&!n.Token.isTokenDelimiter(a,t)&&!n.Token.isTokenRowDelimiter(a);a=e.nextCharacterToken)r.push(a.token),e.advancePastToken(a);return this.columnFormatter.format(r.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.QuotedColumnParser=void 0;const a=e("./ColumnFormatter"),n=e("../Token");r.QuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new a.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const t=e.cursor,{foundClosingQuote:r,col:a}=this.gatherDataBetweenQuotes(e);if(!r){if(e.advanceTo(t),!e.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(e),a}gatherDataBetweenQuotes(e){const{parserOptions:t}=this;let r=!1,a=!1;const i=[];let s=e.nextCharacterToken;for(;!a&&null!==s;s=e.nextCharacterToken){const o=n.Token.isTokenQuote(s,t);if(!r&&o)r=!0;else if(r)if(n.Token.isTokenEscapeCharacter(s,t)){e.advancePastToken(s);const r=e.nextCharacterToken;null!==r&&(n.Token.isTokenQuote(r,t)||n.Token.isTokenEscapeCharacter(r,t))?(i.push(r.token),s=r):o?a=!0:i.push(s.token)}else o?a=!0:i.push(s.token);e.advancePastToken(s)}return{col:this.columnFormatter.format(i.join("")),foundClosingQuote:a}}checkForMalformedColumn(e){const{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){const a=n.Token.isTokenDelimiter(r,t),i=n.Token.isTokenRowDelimiter(r);if(!a&&!i){const a=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${a}`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnFormatter=r.QuotedColumnParser=r.NonQuotedColumnParser=r.ColumnParser=void 0;var a=e("./ColumnParser");Object.defineProperty(r,"ColumnParser",{enumerable:!0,get:function(){return a.ColumnParser}});var n=e("./NonQuotedColumnParser");Object.defineProperty(r,"NonQuotedColumnParser",{enumerable:!0,get:function(){return n.NonQuotedColumnParser}});var i=e("./QuotedColumnParser");Object.defineProperty(r,"QuotedColumnParser",{enumerable:!0,get:function(){return i.QuotedColumnParser}});var s=e("./ColumnFormatter");Object.defineProperty(r,"ColumnFormatter",{enumerable:!0,get:function(){return s.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.QuotedColumnParser=r.NonQuotedColumnParser=r.ColumnParser=r.Token=r.Scanner=r.RowParser=r.Parser=void 0;var a=e("./Parser");Object.defineProperty(r,"Parser",{enumerable:!0,get:function(){return a.Parser}});var n=e("./RowParser");Object.defineProperty(r,"RowParser",{enumerable:!0,get:function(){return n.RowParser}});var i=e("./Scanner");Object.defineProperty(r,"Scanner",{enumerable:!0,get:function(){return i.Scanner}});var s=e("./Token");Object.defineProperty(r,"Token",{enumerable:!0,get:function(){return s.Token}});var o=e("./column");Object.defineProperty(r,"ColumnParser",{enumerable:!0,get:function(){return o.ColumnParser}}),Object.defineProperty(r,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}}),Object.defineProperty(r,"QuotedColumnParser",{enumerable:!0,get:function(){return o.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,t,r){var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=void 0;const n=a(e("lodash.isundefined")),i=a(e("lodash.isfunction")),s=a(e("lodash.uniq")),o=a(e("lodash.groupby"));r.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,!0===e.headers?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):i.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){const t={},{headers:r,headersLength:a}=this;for(let i=0;i<a;i+=1){const a=r[i];if(!n.default(a)){const r=e[i];n.default(r)?t[a]="":t[a]=r}}return t}setHeaders(e){var t;const r=e.filter(e=>!!e);if(s.default(r).length!==r.length){const e=o.default(r),t=Object.keys(e).filter(t=>e[t].length>1);throw new Error("Duplicate headers found "+JSON.stringify(t))}this.headers=e,this.receivedHeaders=!0,this.headersLength=(null===(t=this.headers)||void 0===t?void 0:t.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,t,r){var a=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.RowTransformerValidator=void 0;const n=a(e("lodash.isfunction")),i=e("../types");class s{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return i.isSyncTransform(e)?(t,r)=>{let a=null;try{a=e(t)}catch(e){return r(e)}return r(null,a)}:e}static createValidator(e){return i.isSyncValidate(e)?(t,r)=>{r(null,{row:t,isValid:e(t)})}:(t,r)=>{e(t,(e,a,n)=>e?r(e):r(null,a?{row:t,isValid:a,reason:n}:{row:t,isValid:!1,reason:n}))}}set rowTransform(e){if(!n.default(e))throw new TypeError("The transform should be a function");this._rowTransform=s.createTransform(e)}set rowValidator(e){if(!n.default(e))throw new TypeError("The validate should be a function");this._rowValidator=s.createValidator(e)}transformAndValidate(e,t){return this.callTransformer(e,(e,r)=>e?t(e):r?this.callValidator(r,(e,a)=>e?t(e):a&&!a.isValid?t(null,{row:r,isValid:!1,reason:a.reason}):t(null,{row:r,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}r.RowTransformerValidator=s},{"../types":169,"lodash.isfunction":446}],168:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=r.RowTransformerValidator=void 0;var a=e("./RowTransformerValidator");Object.defineProperty(r,"RowTransformerValidator",{enumerable:!0,get:function(){return a.RowTransformerValidator}});var n=e("./HeaderTransformer");Object.defineProperty(r,"HeaderTransformer",{enumerable:!0,get:function(){return n.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isSyncValidate=r.isSyncTransform=void 0,r.isSyncTransform=e=>1===e.length,r.isSyncValidate=e=>1===e.length},{}],170:[function(e,t,r){const a=r;a.bignum=e("bn.js"),a.define=e("./asn1/api").define,a.base=e("./asn1/base"),a.constants=e("./asn1/constants"),a.decoders=e("./asn1/decoders"),a.encoders=e("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,t,r){const a=e("./encoders"),n=e("./decoders"),i=e("inherits");function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}r.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return i(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},s.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(a[e])),this.encoders[e]},s.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,t,r){const a=e("inherits"),n=e("../base/reporter").Reporter,i=e("safer-buffer").Buffer;function s(e,t){n.call(this,t),i.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else{if(!i.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}a(s,n),r.DecoderBuffer=s,s.isDecoderBuffer=function(e){return e instanceof s||"object"==typeof e&&i.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},r.EncoderBuffer=o,o.isEncoderBuffer=function(e){return e instanceof o||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=i.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,t,r){const a=r;a.Reporter=e("./reporter").Reporter,a.DecoderBuffer=e("./buffer").DecoderBuffer,a.EncoderBuffer=e("./buffer").EncoderBuffer,a.Node=e("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,t,r){const a=e("../base/reporter").Reporter,n=e("../base/buffer").EncoderBuffer,i=e("../base/buffer").DecoderBuffer,s=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function l(e,t,r){const a={};this._baseState=a,a.name=r,a.enc=e,a.parent=t||null,a.children=null,a.tag=null,a.args=null,a.reverseArgs=null,a.choice=null,a.optional=!1,a.any=!1,a.obj=!1,a.use=null,a.useDecoder=null,a.key=null,a.default=null,a.explicit=null,a.implicit=null,a.contains=null,a.parent||(a.children=[],this._wrap())}t.exports=l;const d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const e=this._baseState,t={};d.forEach(function(r){t[r]=e[r]});const r=new this.constructor(t.parent);return r._baseState=t,r},l.prototype._wrap=function(){const e=this._baseState;h.forEach(function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},l.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),s.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){const t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);const a=e[r];t[a]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){l.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),o.forEach(function(e){l.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}}),l.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},l.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let a,n=r.default,s=!0,o=null;if(null!==r.key&&(o=e.enterKey(r.key)),r.optional){let a=null;if(null!==r.explicit?a=r.explicit:null!==r.implicit?a=r.implicit:null!==r.tag&&(a=r.tag),null!==a||r.any){if(s=this._peekTag(e,a,r.any),e.isError(s))return s}else{const a=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(a)}}if(r.obj&&s&&(a=e.enterObject()),s){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const a=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const a=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(a))return a;r.any?n=e.raw(t):e=a}if(t&&t.track&&null!==r.tag&&t.track(e.path(),a,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const a=new i(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(a,t)}}return r.obj&&s&&(n=e.leaveObject(a)),null===r.key||null===n&&!0!==s?null!==o&&e.exitKey(o):e.leaveKey(o,r.key,n),n},l.prototype._decodeGeneric=function(e,t,r){const a=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,a.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&a.args?this._decodeObjid(t,a.args[0],a.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,a.args&&a.args[0],r):null!==a.use?this._getUse(a.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},l.prototype._decodeChoice=function(e,t){const r=this._baseState;let a=null,n=!1;return Object.keys(r.choice).some(function(i){const s=e.save(),o=r.choice[i];try{const r=o._decode(e,t);if(e.isError(r))return!1;a={type:i,value:r},n=!0}catch(t){return e.restore(s),!1}return!0},this),n?a:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},l.prototype._encode=function(e,t,r){const a=this._baseState;if(null!==a.default&&a.default===e)return;const n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n},l.prototype._encodeValue=function(e,t,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new a);let i=null;if(this.reporter=t,n.optional&&void 0===e){if(null===n.default)return;e=n.default}let s=null,o=!1;if(n.any)i=this._createEncoderBuffer(e);else if(n.choice)i=this._encodeChoice(e,t);else if(n.contains)s=this._getUse(n.contains,r)._encode(e,t),o=!0;else if(n.children)s=n.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const a=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(a),n},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){const a=this._baseState;return this._getUse(a.args[0],e)._encode(r,t)},r))}else null!==n.use?i=this._getUse(n.use,r)._encode(e,t):(s=this._encodePrimitive(n.tag,e),o=!0);if(!n.any&&null===n.choice){const e=null!==n.implicit?n.implicit:n.tag,r=null===n.implicit?"universal":"context";null===e?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(i=this._encodeComposite(e,o,r,s))}return null!==n.explicit&&(i=this._encodeComposite(n.explicit,!1,"context",i)),i},l.prototype._encodeChoice=function(e,t){const r=this._baseState,a=r.choice[e.type];return a||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),a._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,t,r){const a=e("inherits");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}r.Reporter=n,n.prototype.isError=function(e){return e instanceof i},n.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,r){const a=this._reporterState;this.exitKey(e),null!==a.obj&&(a.obj[t]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},n.prototype.error=function(e){let t;const r=this._reporterState,a=e instanceof i;if(t=a?e:new i(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return a||r.errors.push(t),t},n.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},a(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:440}],176:[function(e,t,r){function a(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);const a=e[r];t[a]=r}),t}r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=a(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=a(r.tag)},{}],177:[function(e,t,r){const a=r;a._reverse=function(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);const a=e[r];t[a]=r}),t},a.der=e("./der")},{"./der":176}],178:[function(e,t,r){const a=e("inherits"),n=e("bn.js"),i=e("../base/buffer").DecoderBuffer,s=e("../base/node"),o=e("../constants/der");function h(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){s.call(this,"der",e)}function d(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const a=o.tagClass[r>>6],n=!(32&r);if(31&~r)r&=31;else{let a=r;for(r=0;!(128&~a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}return{cls:a,primitive:n,tag:r,tagStr:o.tag[r]}}function c(e,t,r){let a=e.readUInt8(r);if(e.isError(a))return a;if(!t&&128===a)return null;if(!(128&a))return a;const n=127&a;if(n>4)return e.error("length octect is too long");a=0;for(let t=0;t<n;t++){a<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;a|=t}return a}t.exports=h,h.prototype.decode=function(e,t){return i.isDecoderBuffer(e)||(e=new i(e,t)),this.tree._decode(e,t)},a(l,s),l.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const a=e.save(),n=d(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(a),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},l.prototype._decodeTag=function(e,t,r){const a=d(e,'Failed to decode tag of "'+t+'"');if(e.isError(a))return a;let n=c(e,a.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&a.tag!==t&&a.tagStr!==t&&a.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(a.primitive||null!==n)return e.skip(n,'Failed to match body of: "'+t+'"');const i=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(n=e.offset-i.offset,e.restore(i),e.skip(n,'Failed to match body of: "'+t+'"'))},l.prototype._skipUntilEnd=function(e,t){for(;;){const r=d(e,t);if(e.isError(r))return r;const a=c(e,r.primitive,t);if(e.isError(a))return a;let n;if(n=r.primitive||null!==a?e.skip(a):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===r.tagStr)break}},l.prototype._decodeList=function(e,t,r,a){const n=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const i=r.decode(e,"der",a);if(e.isError(i)&&t)break;n.push(i)}return n},l.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},l.prototype._decodeObjid=function(e,t,r){let a;const n=[];let i=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),i<<=7,i|=127&s,!(128&s)&&(n.push(i),i=0);128&s&&n.push(i);const o=n[0]/40|0,h=n[0]%40;if(a=r?n:[o,h].concat(n.slice(1)),t){let e=t[a.join(" ")];void 0===e&&(e=t[a.join(".")]),void 0!==e&&(a=e)}return a},l.prototype._decodeTime=function(e,t){const r=e.raw().toString();let a,n,i,s,o,h;if("gentime"===t)a=0|r.slice(0,4),n=0|r.slice(4,6),i=0|r.slice(6,8),s=0|r.slice(8,10),o=0|r.slice(10,12),h=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");a=0|r.slice(0,2),n=0|r.slice(2,4),i=0|r.slice(4,6),s=0|r.slice(6,8),o=0|r.slice(8,10),h=0|r.slice(10,12),a=a<70?2e3+a:1900+a}return Date.UTC(a,n-1,i,s,o,h,0)},l.prototype._decodeNull=function(){return null},l.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},l.prototype._decodeInt=function(e,t){const r=e.raw();let a=new n(r);return t&&(a=t[a.toString(10)]||a),a},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../base/buffer":172,"../base/node":174,"../constants/der":176,"bn.js":184,inherits:440}],179:[function(e,t,r){const a=r;a.der=e("./der"),a.pem=e("./pem")},{"./der":178,"./pem":180}],180:[function(e,t,r){const a=e("inherits"),n=e("safer-buffer").Buffer,i=e("./der");function s(e){i.call(this,e),this.enc="pem"}a(s,i),t.exports=s,s.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),a=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,h=-1;for(let e=0;e<r.length;e++){const t=r[e].match(s);if(null!==t&&t[2]===a){if(-1!==o){if("END"!==t[1])break;h=e;break}if("BEGIN"!==t[1])break;o=e}}if(-1===o||-1===h)throw new Error("PEM section not found for: "+a);const l=r.slice(o+1,h).join("");l.replace(/[^a-z0-9+/=]+/gi,"");const d=n.from(l,"base64");return i.prototype.decode.call(this,d,t)}},{"./der":178,inherits:440,"safer-buffer":495}],181:[function(e,t,r){const a=e("inherits"),n=e("safer-buffer").Buffer,i=e("../base/node"),s=e("../constants/der");function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new h,this.tree._init(e.body)}function h(e){i.call(this,"der",e)}function l(e){return e<10?"0"+e:e}t.exports=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},a(h,i),h.prototype._encodeComposite=function(e,t,r,a){const i=function(e,t,r,a){let n;if("seqof"===e?e="seq":"setof"===e&&(e="set"),s.tagByName.hasOwnProperty(e))n=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return a.error("Unknown tag: "+e);n=e}return n>=31?a.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=s.tagClassByName[r||"universal"]<<6,n)}(e,t,r,this.reporter);if(a.length<128){const e=n.alloc(2);return e[0]=i,e[1]=a.length,this._createEncoderBuffer([e,a])}let o=1;for(let e=a.length;e>=256;e>>=8)o++;const h=n.alloc(2+o);h[0]=i,h[1]=128|o;for(let e=1+o,t=a.length;t>0;e--,t>>=8)h[e]=255&t;return this._createEncoderBuffer([h,a])},h.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=n.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},h.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let a=0;for(let t=0;t<e.length;t++){let r=e[t];for(a++;r>=128;r>>=7)a++}const i=n.alloc(a);let s=i.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(i[s--]=127&r;(r>>=7)>0;)i[s--]=128|127&r}return this._createEncoderBuffer(i)},h.prototype._encodeTime=function(e,t){let r;const a=new Date(e);return"gentime"===t?r=[l(a.getUTCFullYear()),l(a.getUTCMonth()+1),l(a.getUTCDate()),l(a.getUTCHours()),l(a.getUTCMinutes()),l(a.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[l(a.getUTCFullYear()%100),l(a.getUTCMonth()+1),l(a.getUTCDate()),l(a.getUTCHours()),l(a.getUTCMinutes()),l(a.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!n.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=n.from(t)}if(n.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=n.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const a=new Array(r);for(let t=a.length-1;t>=0;t--)a[t]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(n.from(a))},h.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},h.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},h.prototype._skipDefault=function(e,t,r){const a=this._baseState;let n;if(null===a.default)return!1;const i=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a.default,t,r).join()),i.length!==a.defaultBuffer.length)return!1;for(n=0;n<i.length;n++)if(i[n]!==a.defaultBuffer[n])return!1;return!0}},{"../base/node":174,"../constants/der":176,inherits:440,"safer-buffer":495}],182:[function(e,t,r){const a=r;a.der=e("./der"),a.pem=e("./pem")},{"./der":181,"./pem":183}],183:[function(e,t,r){const a=e("inherits"),n=e("./der");function i(e){n.call(this,e),this.enc="pem"}a(i,n),t.exports=i,i.prototype.encode=function(e,t){const r=n.prototype.encode.call(this,e).toString("base64"),a=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)a.push(r.slice(e,e+64));return a.push("-----END "+t.label+"-----"),a.join("\n")}},{"./der":181,inherits:440}],184:[function(e,t,r){!function(t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof t?t.exports=n:(void 0).BN=n,n.BN=n,n.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=s(e,r);return r-1>=t&&(a|=s(e,r-1)<<4),a}function h(e,t,r,a){for(var n=0,i=Math.min(e.length,r),s=t;s<i;s++){var o=e.charCodeAt(s)-48;n*=a,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,a):(this._parseBase(e,t,n),"le"===a&&this._initArray(this.toArray(),t,a)))},n.prototype._initNumber=function(e,t,a){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===a&&this._initArray(this.toArray(),t,a)},n.prototype._initArray=function(e,t,a){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s,o=0;if("be"===a)for(n=e.length-1,i=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===a)for(n=0,i=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var n,i=0,s=0;if("be"===r)for(a=e.length-1;a>=t;a-=2)n=o(e,t,a)<<i,this.words[s]|=67108863&n,i>=18?(i-=18,s+=1,this.words[s]|=n>>>26):i+=8;else for(a=(e.length-t)%2==0?t+1:t;a<e.length;a+=2)n=o(e,t,a)<<i,this.words[s]|=67108863&n,i>=18?(i-=18,s+=1,this.words[s]|=n>>>26):i+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,s=i%a,o=Math.min(i,i-s)+r,l=0,d=r;d<o;d+=a)l=h(e,d,d+a,t),this.imuln(n),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==s){var c=1;for(l=h(e,d,e.length,t),d=0;d<s;d++)c*=t;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function u(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],s=n*i,o=67108863&s,h=s/67108864|0;r.words[0]=o;for(var l=1;l<a;l++){for(var d=h>>>26,c=67108863&h,u=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=u;f++){var p=l-f|0;d+=(s=(n=0|e.words[p])*(i=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,h=0|d}return 0!==h?r.words[l]=0|h:r.length--,r.strip()}n.prototype.toString=function(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var n=0,i=0,s=0;s<this.length;s++){var o=this.words[s],h=(16777215&(o<<n|i)).toString(16);a=0!=(i=o>>>24-n&16777215)||s!==this.length-1?l[6-h.length]+h+a:h+a,(n+=2)>=26&&(n-=26,s--)}for(0!==i&&(a=i.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],f=c[e];a="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);a=(p=p.idivn(f)).isZero()?y+a:l[u-y.length]+y+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==i),this.toArrayLike(i,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,o,h="le"===t,l=new e(i),d=this.clone();if(h){for(o=0;!d.isZero();o++)s=d.andln(255),d.iushrn(8),l[o]=s;for(;o<i;o++)l[o]=0}else{for(o=0;o<i-n;o++)l[o]=0;for(o=0;!d.isZero();o++)s=d.andln(255),d.iushrn(8),l[i-o-1]=s}return l},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return!(8191&t)&&(r+=13,t>>>=13),!(127&t)&&(r+=7,t>>>=7),!(15&t)&&(r+=4,t>>>=4),!(3&t)&&(r+=2,t>>>=2),!(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;a<r.length;a++)this.words[a]=t.words[a]^r.words[a];if(this!==t)for(;a<t.length;a++)this.words[a]=t.words[a];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return a>0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<<n:this.words[a]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,a;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i<a.length;i++)t=(0|r.words[i])+(0|a.words[i])+n,this.words[i]=67108863&t,n=t>>>26;for(;0!==n&&i<r.length;i++)t=(0|r.words[i])+n,this.words[i]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=this);for(var i=0,s=0;s<a.length;s++)i=(t=(0|r.words[s])-(0|a.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var a,n,i,s=e.words,o=t.words,h=r.words,l=0,d=0|s[0],c=8191&d,u=d>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],g=8191&m,b=m>>>13,k=0|s[3],v=8191&k,w=k>>>13,x=0|s[4],M=8191&x,_=x>>>13,S=0|s[5],j=8191&S,C=S>>>13,A=0|s[6],T=8191&A,E=A>>>13,N=0|s[7],z=8191&N,R=N>>>13,O=0|s[8],P=8191&O,L=O>>>13,I=0|s[9],q=8191&I,D=I>>>13,H=0|o[0],F=8191&H,B=H>>>13,V=0|o[1],U=8191&V,$=V>>>13,W=0|o[2],Z=8191&W,X=W>>>13,K=0|o[3],G=8191&K,Y=K>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],re=8191&te,ae=te>>>13,ne=0|o[6],ie=8191&ne,se=ne>>>13,oe=0|o[7],he=8191&oe,le=oe>>>13,de=0|o[8],ce=8191&de,ue=de>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(a=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,B))+Math.imul(u,F)|0))<<13)|0;l=((i=Math.imul(u,B))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(p,F),n=(n=Math.imul(p,B))+Math.imul(y,F)|0,i=Math.imul(y,B);var ge=(l+(a=a+Math.imul(c,U)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(u,U)|0))<<13)|0;l=((i=i+Math.imul(u,$)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(g,F),n=(n=Math.imul(g,B))+Math.imul(b,F)|0,i=Math.imul(b,B),a=a+Math.imul(p,U)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(y,U)|0,i=i+Math.imul(y,$)|0;var be=(l+(a=a+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,X)|0)+Math.imul(u,Z)|0))<<13)|0;l=((i=i+Math.imul(u,X)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,a=Math.imul(v,F),n=(n=Math.imul(v,B))+Math.imul(w,F)|0,i=Math.imul(w,B),a=a+Math.imul(g,U)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(b,U)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(y,Z)|0,i=i+Math.imul(y,X)|0;var ke=(l+(a=a+Math.imul(c,G)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(u,G)|0))<<13)|0;l=((i=i+Math.imul(u,Y)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(M,F),n=(n=Math.imul(M,B))+Math.imul(_,F)|0,i=Math.imul(_,B),a=a+Math.imul(v,U)|0,n=(n=n+Math.imul(v,$)|0)+Math.imul(w,U)|0,i=i+Math.imul(w,$)|0,a=a+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,X)|0,a=a+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,Y)|0;var ve=(l+(a=a+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,ee)|0)+Math.imul(u,Q)|0))<<13)|0;l=((i=i+Math.imul(u,ee)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(j,F),n=(n=Math.imul(j,B))+Math.imul(C,F)|0,i=Math.imul(C,B),a=a+Math.imul(M,U)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(_,U)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(v,Z)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(w,Z)|0,i=i+Math.imul(w,X)|0,a=a+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Y)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0;var we=(l+(a=a+Math.imul(c,re)|0)|0)+((8191&(n=(n=n+Math.imul(c,ae)|0)+Math.imul(u,re)|0))<<13)|0;l=((i=i+Math.imul(u,ae)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(T,F),n=(n=Math.imul(T,B))+Math.imul(E,F)|0,i=Math.imul(E,B),a=a+Math.imul(j,U)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(C,U)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,X)|0,a=a+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,a=a+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ae)|0;var xe=(l+(a=a+Math.imul(c,ie)|0)|0)+((8191&(n=(n=n+Math.imul(c,se)|0)+Math.imul(u,ie)|0))<<13)|0;l=((i=i+Math.imul(u,se)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(z,F),n=(n=Math.imul(z,B))+Math.imul(R,F)|0,i=Math.imul(R,B),a=a+Math.imul(T,U)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(E,U)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(j,Z)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,X)|0,a=a+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ae)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(p,ie)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,se)|0;var Me=(l+(a=a+Math.imul(c,he)|0)|0)+((8191&(n=(n=n+Math.imul(c,le)|0)+Math.imul(u,he)|0))<<13)|0;l=((i=i+Math.imul(u,le)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(P,F),n=(n=Math.imul(P,B))+Math.imul(L,F)|0,i=Math.imul(L,B),a=a+Math.imul(z,U)|0,n=(n=n+Math.imul(z,$)|0)+Math.imul(R,U)|0,i=i+Math.imul(R,$)|0,a=a+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(E,Z)|0,i=i+Math.imul(E,X)|0,a=a+Math.imul(j,G)|0,n=(n=n+Math.imul(j,Y)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,a=a+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ae)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(g,ie)|0,n=(n=n+Math.imul(g,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,a=a+Math.imul(p,he)|0,n=(n=n+Math.imul(p,le)|0)+Math.imul(y,he)|0,i=i+Math.imul(y,le)|0;var _e=(l+(a=a+Math.imul(c,ce)|0)|0)+((8191&(n=(n=n+Math.imul(c,ue)|0)+Math.imul(u,ce)|0))<<13)|0;l=((i=i+Math.imul(u,ue)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(q,F),n=(n=Math.imul(q,B))+Math.imul(D,F)|0,i=Math.imul(D,B),a=a+Math.imul(P,U)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,U)|0,i=i+Math.imul(L,$)|0,a=a+Math.imul(z,Z)|0,n=(n=n+Math.imul(z,X)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,X)|0,a=a+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,a=a+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(v,ie)|0,n=(n=n+Math.imul(v,se)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,se)|0,a=a+Math.imul(g,he)|0,n=(n=n+Math.imul(g,le)|0)+Math.imul(b,he)|0,i=i+Math.imul(b,le)|0,a=a+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0;var Se=(l+(a=a+Math.imul(c,pe)|0)|0)+((8191&(n=(n=n+Math.imul(c,ye)|0)+Math.imul(u,pe)|0))<<13)|0;l=((i=i+Math.imul(u,ye)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(q,U),n=(n=Math.imul(q,$))+Math.imul(D,U)|0,i=Math.imul(D,$),a=a+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,X)|0,a=a+Math.imul(z,G)|0,n=(n=n+Math.imul(z,Y)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,Y)|0,a=a+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ae)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(M,ie)|0,n=(n=n+Math.imul(M,se)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,se)|0,a=a+Math.imul(v,he)|0,n=(n=n+Math.imul(v,le)|0)+Math.imul(w,he)|0,i=i+Math.imul(w,le)|0,a=a+Math.imul(g,ce)|0,n=(n=n+Math.imul(g,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0;var je=(l+(a=a+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((i=i+Math.imul(y,ye)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,a=Math.imul(q,Z),n=(n=Math.imul(q,X))+Math.imul(D,Z)|0,i=Math.imul(D,X),a=a+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(z,Q)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,a=a+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(j,ie)|0,n=(n=n+Math.imul(j,se)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,se)|0,a=a+Math.imul(M,he)|0,n=(n=n+Math.imul(M,le)|0)+Math.imul(_,he)|0,i=i+Math.imul(_,le)|0,a=a+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0;var Ce=(l+(a=a+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,ye)|0)+Math.imul(b,pe)|0))<<13)|0;l=((i=i+Math.imul(b,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(D,G)|0,i=Math.imul(D,Y),a=a+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(z,re)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ae)|0,a=a+Math.imul(T,ie)|0,n=(n=n+Math.imul(T,se)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,se)|0,a=a+Math.imul(j,he)|0,n=(n=n+Math.imul(j,le)|0)+Math.imul(C,he)|0,i=i+Math.imul(C,le)|0,a=a+Math.imul(M,ce)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0;var Ae=(l+(a=a+Math.imul(v,pe)|0)|0)+((8191&(n=(n=n+Math.imul(v,ye)|0)+Math.imul(w,pe)|0))<<13)|0;l=((i=i+Math.imul(w,ye)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(q,Q),n=(n=Math.imul(q,ee))+Math.imul(D,Q)|0,i=Math.imul(D,ee),a=a+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,a=a+Math.imul(T,he)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(E,he)|0,i=i+Math.imul(E,le)|0,a=a+Math.imul(j,ce)|0,n=(n=n+Math.imul(j,ue)|0)+Math.imul(C,ce)|0,i=i+Math.imul(C,ue)|0;var Te=(l+(a=a+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((i=i+Math.imul(_,ye)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(q,re),n=(n=Math.imul(q,ae))+Math.imul(D,re)|0,i=Math.imul(D,ae),a=a+Math.imul(P,ie)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,se)|0,a=a+Math.imul(z,he)|0,n=(n=n+Math.imul(z,le)|0)+Math.imul(R,he)|0,i=i+Math.imul(R,le)|0,a=a+Math.imul(T,ce)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(E,ce)|0,i=i+Math.imul(E,ue)|0;var Ee=(l+(a=a+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,ye)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(q,ie),n=(n=Math.imul(q,se))+Math.imul(D,ie)|0,i=Math.imul(D,se),a=a+Math.imul(P,he)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(L,he)|0,i=i+Math.imul(L,le)|0,a=a+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,ue)|0;var Ne=(l+(a=a+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,ye)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,a=Math.imul(q,he),n=(n=Math.imul(q,le))+Math.imul(D,he)|0,i=Math.imul(D,le),a=a+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,ue)|0;var ze=(l+(a=a+Math.imul(z,pe)|0)|0)+((8191&(n=(n=n+Math.imul(z,ye)|0)+Math.imul(R,pe)|0))<<13)|0;l=((i=i+Math.imul(R,ye)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,a=Math.imul(q,ce),n=(n=Math.imul(q,ue))+Math.imul(D,ce)|0,i=Math.imul(D,ue);var Re=(l+(a=a+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ye)|0)+Math.imul(L,pe)|0))<<13)|0;l=((i=i+Math.imul(L,ye)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(l+(a=Math.imul(q,pe))|0)+((8191&(n=(n=Math.imul(q,ye))+Math.imul(D,pe)|0))<<13)|0;return l=((i=Math.imul(D,ye))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,h[0]=me,h[1]=ge,h[2]=be,h[3]=ke,h[4]=ve,h[5]=we,h[6]=xe,h[7]=Me,h[8]=_e,h[9]=Se,h[10]=je,h[11]=Ce,h[12]=Ae,h[13]=Te,h[14]=Ee,h[15]=Ne,h[16]=ze,h[17]=Re,h[18]=Oe,0!==l&&(h[19]=l,r.length++),r};function p(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(f=u),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):r<63?u(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i<r.length-1;i++){var s=n;n=0;for(var o=67108863&a,h=Math.min(i,t.length-1),l=Math.max(0,i-e.length+1);l<=h;l++){var d=i-l,c=(0|e.words[d])*(0|t.words[l]),u=67108863&c;o=67108863&(u=u+o|0),n+=(s=(s=s+(c/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[i]=o,a=s,s=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}(this,e,t):p(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,a=0;a<e;a++)t[a]=this.revBin(a,r,e);return t},y.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var a=0,n=0;n<t;n++)a|=(1&e)<<t-n-1,e>>=1;return a},y.prototype.permute=function(e,t,r,a,n,i){for(var s=0;s<i;s++)a[s]=t[e[s]],n[s]=r[e[s]]},y.prototype.transform=function(e,t,r,a,n,i){this.permute(i,e,t,r,a,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,h=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),d=0;d<n;d+=o)for(var c=h,u=l,f=0;f<s;f++){var p=r[d+f],y=a[d+f],m=r[d+f+s],g=a[d+f+s],b=c*m-u*g;g=c*g+u*m,m=b,r[d+f]=p+m,a[d+f]=y+g,r[d+f+s]=p-m,a[d+f+s]=y-g,f!==o&&(b=h*c-l*u,u=h*u+l*c,c=b)}},y.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),a=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+a},y.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var a=0;a<r/2;a++){var n=e[a];e[a]=e[r-a-1],e[r-a-1]=n,n=t[a],t[a]=-t[r-a-1],t[r-a-1]=-n}},y.prototype.normalize13b=function(e,t){for(var r=0,a=0;a<t/2;a++){var n=8192*Math.round(e[2*a+1]/t)+Math.round(e[2*a]/t)+r;e[a]=67108863&n,r=n<67108864?0:n/67108864|0}return e},y.prototype.convert13b=function(e,t,a,n){for(var i=0,s=0;s<t;s++)i+=0|e[s],a[2*s]=8191&i,i>>>=13,a[2*s+1]=8191&i,i>>>=13;for(s=2*t;s<n;++s)a[s]=0;r(0===i),r(!(-8192&i))},y.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},y.prototype.mulp=function(e,t,r){var a=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(a),i=this.stub(a),s=new Array(a),o=new Array(a),h=new Array(a),l=new Array(a),d=new Array(a),c=new Array(a),u=r.words;u.length=a,this.convert13b(e.words,e.length,s,a),this.convert13b(t.words,t.length,l,a),this.transform(s,i,o,h,a,n),this.transform(l,i,d,c,a,n);for(var f=0;f<a;f++){var p=o[f]*d[f]-h[f]*c[f];h[f]=o[f]*c[f]+h[f]*d[f],o[f]=p}return this.conjugate(o,h,a),this.transform(o,h,u,i,a,n),this.conjugate(u,i,a),this.normalize13b(u,a),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,a=0;a<this.length;a++){var n=(0|this.words[a])*e,i=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var a=r/26|0,n=r%26;t[r]=(e.words[a]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,a=0;a<t.length&&0===t[a];a++,r=r.sqr());if(++a<t.length)for(var i=r.sqr();a<t.length;a++,i=i.sqr())0!==t[a]&&(r=r.mul(i));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&i,h=(0|this.words[t])-o<<a;this.words[t]=h|s,s=o>>>26-a}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,a){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<<i,h=a;if(n-=s,n=Math.max(0,n),h){for(var l=0;l<s;l++)h.words[l]=this.words[l];h.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=n);l--){var c=0|this.words[l];this.words[l]=d<<26-i|c>>>i,d=c&o}return h&&0!==d&&(h.words[h.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<<t;return!(this.length<=a||!(this.words[a]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,a){var n,i,s=e.length+a;this._expand(s);var o=0;for(n=0;n<e.length;n++){i=(0|this.words[n+a])+o;var h=(0|e.words[n])*t;o=((i-=67108863&h)>>26)-(h/67108864|0),this.words[n+a]=67108863&i}for(;n<this.length-a;n++)o=(i=(0|this.words[n+a])+o)>>26,this.words[n+a]=67108863&i;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(i=-(0|this.words[n])+o)>>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),a=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),a.iushln(r),s=0|i.words[i.length-1]);var o,h=a.length-i.length;if("mod"!==t){(o=new n(null)).length=h+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var d=a.clone()._ishlnsubmul(i,1,h);0===d.negative&&(a=d,o&&(o.words[h]=1));for(var c=h-1;c>=0;c--){var u=67108864*(0|a.words[i.length+c])+(0|a.words[i.length+c-1]);for(u=Math.min(u/s|0,67108863),a._ishlnsubmul(i,u,c);0!==a.negative;)u--,a.negative=0,a._ishlnsubmul(i,1,c),a.isZero()||(a.negative^=1);o&&(o.words[c]=u)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},n.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),a&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),a&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new n(1),s=new n(0),o=new n(0),h=new n(1),l=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++l;for(var d=a.clone(),c=t.clone();!t.isZero();){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(d),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(a.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(a.iushrn(p);p-- >0;)(o.isOdd()||h.isOdd())&&(o.iadd(d),h.isub(c)),o.iushrn(1),h.iushrn(1);t.cmp(a)>=0?(t.isub(a),i.isub(o),s.isub(h)):(a.isub(t),o.isub(i),h.isub(s))}return{a:o,b:h,gcd:a.iushln(l)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new n(1),o=new n(0),h=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var c=0,u=1;0==(a.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(a.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),s.isub(o)):(a.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(a)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,a=(e-t)/26,n=1<<t;if(this.length<=a)return this._expand(a+1),this.words[a]|=n,this;for(var i=n,s=a;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){a<n?t=-1:a>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new x(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var a=t<this.n?-1:r.ucmp(this.p);return 0===a?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},a(b,g),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),a=0;a<r;a++)t.words[a]=e.words[a];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,a=10;a<e.length;a++){var i=0|e.words[a];e.words[a-10]=(4194303&i)<<4|n>>>22,n=i}n>>>=22,e.words[a-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var a=0|e.words[r];t+=977*a,e.words[r]=67108863&t,t=64*a+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,g),a(v,g),a(w,g),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var a=19*(0|e.words[r])+t,n=67108863&a;a>>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new k;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},x.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var a=this.m.add(new n(1)).iushrn(2);return this.pow(e,a)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var o=new n(1).toRed(this),h=o.redNeg(),l=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new n(2*d*d).toRed(this);0!==this.pow(d,l).cmp(h);)d.redIAdd(h);for(var c=this.pow(d,i),u=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();r(m<p);var g=this.pow(c,new n(1).iushln(p-m-1));u=u.redMul(g),c=g.redSqr(),f=f.redMul(c),p=m}return u},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var a=2;a<r.length;a++)r[a]=this.mul(r[a-1],e);var i=r[0],s=0,o=0,h=t.bitLength()%26;for(0===h&&(h=26),a=t.length-1;a>=0;a--){for(var l=t.words[a],d=h-1;d>=0;d--){var c=l>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++o||0===a&&0===d)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}h=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new M(e)},a(M,x),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(a).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{buffer:188}],185:[function(e,t,r){r.byteLength=function(e){var t=l(e),r=t[0],a=t[1];return 3*(r+a)/4-a},r.toByteArray=function(e){var t,r,a=l(e),s=a[0],o=a[1],h=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),d=0,c=o>0?s-4:s;for(r=0;r<c;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],h[d++]=t>>16&255,h[d++]=t>>8&255,h[d++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,h[d++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,h[d++]=t>>8&255,h[d++]=255&t),h},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],s=0,o=r-n;s<o;s+=16383)i.push(d(e,s,s+16383>o?o:s+16383));return 1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"=")),i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=s.length;o<h;++o)a[o]=s[o],n[s.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function d(e,t,r){for(var n,i,s=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(a[(i=n)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},{}],186:[function(e,t,r){!function(t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof t?t.exports=n:(void 0).BN=n,n.BN=n,n.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function o(e,t,r){var a=s(e,r);return r-1>=t&&(a|=s(e,r-1)<<4),a}function h(e,t,a,n){for(var i=0,s=0,o=Math.min(e.length,a),h=t;h<o;h++){var l=e.charCodeAt(h)-48;i*=n,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<n,"Invalid character"),i+=s}return i}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,a){if("number"==typeof e)return this._initNumber(e,t,a);if("object"==typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,a):(this._parseBase(e,t,n),"le"===a&&this._initArray(this.toArray(),t,a)))},n.prototype._initNumber=function(e,t,a){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===a&&this._initArray(this.toArray(),t,a)},n.prototype._initArray=function(e,t,a){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s,o=0;if("be"===a)for(n=e.length-1,i=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===a)for(n=0,i=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var n,i=0,s=0;if("be"===r)for(a=e.length-1;a>=t;a-=2)n=o(e,t,a)<<i,this.words[s]|=67108863&n,i>=18?(i-=18,s+=1,this.words[s]|=n>>>26):i+=8;else for(a=(e.length-t)%2==0?t+1:t;a<e.length;a+=2)n=o(e,t,a)<<i,this.words[s]|=67108863&n,i>=18?(i-=18,s+=1,this.words[s]|=n>>>26):i+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,s=i%a,o=Math.min(i,i-s)+r,l=0,d=r;d<o;d+=a)l=h(e,d,d+a,t),this.imuln(n),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==s){var c=1;for(l=h(e,d,e.length,t),d=0;d<s;d++)c*=t;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){l(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){n.prototype.inspect=d}else n.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],s=n*i,o=67108863&s,h=s/67108864|0;r.words[0]=o;for(var l=1;l<a;l++){for(var d=h>>>26,c=67108863&h,u=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=u;f++){var p=l-f|0;d+=(s=(n=0|e.words[p])*(i=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,h=0|d}return 0!==h?r.words[l]=0|h:r.length--,r._strip()}n.prototype.toString=function(e,t){var a;if(t=0|t||1,16===(e=e||10)||"hex"===e){a="";for(var n=0,i=0,s=0;s<this.length;s++){var o=this.words[s],h=(16777215&(o<<n|i)).toString(16);i=o>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),a=0!==i||s!==this.length-1?c[6-h.length]+h+a:h+a}for(0!==i&&(a=i.toString(16)+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var l=u[e],d=f[e];a="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modrn(d).toString(e);a=(p=p.idivn(d)).isZero()?y+a:c[l-y.length]+y+a}for(this.isZero()&&(a="0"+a);a.length%t!=0;)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},i&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,a=0,n=0,i=0;n<this.length;n++){var s=this.words[n]<<i|a;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),a=0,i=0):(a=s>>>24,i+=2)}if(r<e.length)for(e[r++]=a;r<e.length;)e[r++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,a=0,n=0,i=0;n<this.length;n++){var s=this.words[n]<<i|a;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),a=0,i=0):(a=s>>>24,i+=2)}if(r>=0)for(e[r--]=a;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return!(8191&t)&&(r+=13,t>>>=13),!(127&t)&&(r+=7,t>>>=7),!(15&t)&&(r+=4,t>>>=4),!(3&t)&&(r+=2,t>>>=2),!(1&t)&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;a<r.length;a++)this.words[a]=t.words[a]^r.words[a];if(this!==t)for(;a<t.length;a++)this.words[a]=t.words[a];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return a>0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<<n:this.words[a]&~(1<<n),this._strip()},n.prototype.iadd=function(e){var t,r,a;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i<a.length;i++)t=(0|r.words[i])+(0|a.words[i])+n,this.words[i]=67108863&t,n=t>>>26;for(;0!==n&&i<r.length;i++)t=(0|r.words[i])+n,this.words[i]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=this);for(var i=0,s=0;s<a.length;s++)i=(t=(0|r.words[s])-(0|a.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var a,n,i,s=e.words,o=t.words,h=r.words,l=0,d=0|s[0],c=8191&d,u=d>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],g=8191&m,b=m>>>13,k=0|s[3],v=8191&k,w=k>>>13,x=0|s[4],M=8191&x,_=x>>>13,S=0|s[5],j=8191&S,C=S>>>13,A=0|s[6],T=8191&A,E=A>>>13,N=0|s[7],z=8191&N,R=N>>>13,O=0|s[8],P=8191&O,L=O>>>13,I=0|s[9],q=8191&I,D=I>>>13,H=0|o[0],F=8191&H,B=H>>>13,V=0|o[1],U=8191&V,$=V>>>13,W=0|o[2],Z=8191&W,X=W>>>13,K=0|o[3],G=8191&K,Y=K>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],re=8191&te,ae=te>>>13,ne=0|o[6],ie=8191&ne,se=ne>>>13,oe=0|o[7],he=8191&oe,le=oe>>>13,de=0|o[8],ce=8191&de,ue=de>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(a=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,B))+Math.imul(u,F)|0))<<13)|0;l=((i=Math.imul(u,B))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(p,F),n=(n=Math.imul(p,B))+Math.imul(y,F)|0,i=Math.imul(y,B);var ge=(l+(a=a+Math.imul(c,U)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(u,U)|0))<<13)|0;l=((i=i+Math.imul(u,$)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(g,F),n=(n=Math.imul(g,B))+Math.imul(b,F)|0,i=Math.imul(b,B),a=a+Math.imul(p,U)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(y,U)|0,i=i+Math.imul(y,$)|0;var be=(l+(a=a+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,X)|0)+Math.imul(u,Z)|0))<<13)|0;l=((i=i+Math.imul(u,X)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,a=Math.imul(v,F),n=(n=Math.imul(v,B))+Math.imul(w,F)|0,i=Math.imul(w,B),a=a+Math.imul(g,U)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(b,U)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(y,Z)|0,i=i+Math.imul(y,X)|0;var ke=(l+(a=a+Math.imul(c,G)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(u,G)|0))<<13)|0;l=((i=i+Math.imul(u,Y)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(M,F),n=(n=Math.imul(M,B))+Math.imul(_,F)|0,i=Math.imul(_,B),a=a+Math.imul(v,U)|0,n=(n=n+Math.imul(v,$)|0)+Math.imul(w,U)|0,i=i+Math.imul(w,$)|0,a=a+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(b,Z)|0,i=i+Math.imul(b,X)|0,a=a+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,Y)|0;var ve=(l+(a=a+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,ee)|0)+Math.imul(u,Q)|0))<<13)|0;l=((i=i+Math.imul(u,ee)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(j,F),n=(n=Math.imul(j,B))+Math.imul(C,F)|0,i=Math.imul(C,B),a=a+Math.imul(M,U)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(_,U)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(v,Z)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(w,Z)|0,i=i+Math.imul(w,X)|0,a=a+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Y)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0;var we=(l+(a=a+Math.imul(c,re)|0)|0)+((8191&(n=(n=n+Math.imul(c,ae)|0)+Math.imul(u,re)|0))<<13)|0;l=((i=i+Math.imul(u,ae)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(T,F),n=(n=Math.imul(T,B))+Math.imul(E,F)|0,i=Math.imul(E,B),a=a+Math.imul(j,U)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(C,U)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(_,Z)|0,i=i+Math.imul(_,X)|0,a=a+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0,a=a+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ae)|0;var xe=(l+(a=a+Math.imul(c,ie)|0)|0)+((8191&(n=(n=n+Math.imul(c,se)|0)+Math.imul(u,ie)|0))<<13)|0;l=((i=i+Math.imul(u,se)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(z,F),n=(n=Math.imul(z,B))+Math.imul(R,F)|0,i=Math.imul(R,B),a=a+Math.imul(T,U)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(E,U)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(j,Z)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(C,Z)|0,i=i+Math.imul(C,X)|0,a=a+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ae)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(p,ie)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,se)|0;var Me=(l+(a=a+Math.imul(c,he)|0)|0)+((8191&(n=(n=n+Math.imul(c,le)|0)+Math.imul(u,he)|0))<<13)|0;l=((i=i+Math.imul(u,le)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(P,F),n=(n=Math.imul(P,B))+Math.imul(L,F)|0,i=Math.imul(L,B),a=a+Math.imul(z,U)|0,n=(n=n+Math.imul(z,$)|0)+Math.imul(R,U)|0,i=i+Math.imul(R,$)|0,a=a+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(E,Z)|0,i=i+Math.imul(E,X)|0,a=a+Math.imul(j,G)|0,n=(n=n+Math.imul(j,Y)|0)+Math.imul(C,G)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,ee)|0,a=a+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ae)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(g,ie)|0,n=(n=n+Math.imul(g,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,a=a+Math.imul(p,he)|0,n=(n=n+Math.imul(p,le)|0)+Math.imul(y,he)|0,i=i+Math.imul(y,le)|0;var _e=(l+(a=a+Math.imul(c,ce)|0)|0)+((8191&(n=(n=n+Math.imul(c,ue)|0)+Math.imul(u,ce)|0))<<13)|0;l=((i=i+Math.imul(u,ue)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(q,F),n=(n=Math.imul(q,B))+Math.imul(D,F)|0,i=Math.imul(D,B),a=a+Math.imul(P,U)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,U)|0,i=i+Math.imul(L,$)|0,a=a+Math.imul(z,Z)|0,n=(n=n+Math.imul(z,X)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,X)|0,a=a+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(C,Q)|0,i=i+Math.imul(C,ee)|0,a=a+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(v,ie)|0,n=(n=n+Math.imul(v,se)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,se)|0,a=a+Math.imul(g,he)|0,n=(n=n+Math.imul(g,le)|0)+Math.imul(b,he)|0,i=i+Math.imul(b,le)|0,a=a+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0;var Se=(l+(a=a+Math.imul(c,pe)|0)|0)+((8191&(n=(n=n+Math.imul(c,ye)|0)+Math.imul(u,pe)|0))<<13)|0;l=((i=i+Math.imul(u,ye)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(q,U),n=(n=Math.imul(q,$))+Math.imul(D,U)|0,i=Math.imul(D,$),a=a+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,X)|0,a=a+Math.imul(z,G)|0,n=(n=n+Math.imul(z,Y)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,Y)|0,a=a+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ae)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(M,ie)|0,n=(n=n+Math.imul(M,se)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,se)|0,a=a+Math.imul(v,he)|0,n=(n=n+Math.imul(v,le)|0)+Math.imul(w,he)|0,i=i+Math.imul(w,le)|0,a=a+Math.imul(g,ce)|0,n=(n=n+Math.imul(g,ue)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,ue)|0;var je=(l+(a=a+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((i=i+Math.imul(y,ye)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,a=Math.imul(q,Z),n=(n=Math.imul(q,X))+Math.imul(D,Z)|0,i=Math.imul(D,X),a=a+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(z,Q)|0,n=(n=n+Math.imul(z,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,a=a+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(j,ie)|0,n=(n=n+Math.imul(j,se)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,se)|0,a=a+Math.imul(M,he)|0,n=(n=n+Math.imul(M,le)|0)+Math.imul(_,he)|0,i=i+Math.imul(_,le)|0,a=a+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,i=i+Math.imul(w,ue)|0;var Ce=(l+(a=a+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,ye)|0)+Math.imul(b,pe)|0))<<13)|0;l=((i=i+Math.imul(b,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(D,G)|0,i=Math.imul(D,Y),a=a+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(z,re)|0,n=(n=n+Math.imul(z,ae)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ae)|0,a=a+Math.imul(T,ie)|0,n=(n=n+Math.imul(T,se)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,se)|0,a=a+Math.imul(j,he)|0,n=(n=n+Math.imul(j,le)|0)+Math.imul(C,he)|0,i=i+Math.imul(C,le)|0,a=a+Math.imul(M,ce)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0;var Ae=(l+(a=a+Math.imul(v,pe)|0)|0)+((8191&(n=(n=n+Math.imul(v,ye)|0)+Math.imul(w,pe)|0))<<13)|0;l=((i=i+Math.imul(w,ye)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(q,Q),n=(n=Math.imul(q,ee))+Math.imul(D,Q)|0,i=Math.imul(D,ee),a=a+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ae)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(z,ie)|0,n=(n=n+Math.imul(z,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,a=a+Math.imul(T,he)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(E,he)|0,i=i+Math.imul(E,le)|0,a=a+Math.imul(j,ce)|0,n=(n=n+Math.imul(j,ue)|0)+Math.imul(C,ce)|0,i=i+Math.imul(C,ue)|0;var Te=(l+(a=a+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((i=i+Math.imul(_,ye)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(q,re),n=(n=Math.imul(q,ae))+Math.imul(D,re)|0,i=Math.imul(D,ae),a=a+Math.imul(P,ie)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,se)|0,a=a+Math.imul(z,he)|0,n=(n=n+Math.imul(z,le)|0)+Math.imul(R,he)|0,i=i+Math.imul(R,le)|0,a=a+Math.imul(T,ce)|0,n=(n=n+Math.imul(T,ue)|0)+Math.imul(E,ce)|0,i=i+Math.imul(E,ue)|0;var Ee=(l+(a=a+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((i=i+Math.imul(C,ye)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(q,ie),n=(n=Math.imul(q,se))+Math.imul(D,ie)|0,i=Math.imul(D,se),a=a+Math.imul(P,he)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(L,he)|0,i=i+Math.imul(L,le)|0,a=a+Math.imul(z,ce)|0,n=(n=n+Math.imul(z,ue)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,ue)|0;var Ne=(l+(a=a+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((i=i+Math.imul(E,ye)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,a=Math.imul(q,he),n=(n=Math.imul(q,le))+Math.imul(D,he)|0,i=Math.imul(D,le),a=a+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,ue)|0;var ze=(l+(a=a+Math.imul(z,pe)|0)|0)+((8191&(n=(n=n+Math.imul(z,ye)|0)+Math.imul(R,pe)|0))<<13)|0;l=((i=i+Math.imul(R,ye)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863,a=Math.imul(q,ce),n=(n=Math.imul(q,ue))+Math.imul(D,ce)|0,i=Math.imul(D,ue);var Re=(l+(a=a+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ye)|0)+Math.imul(L,pe)|0))<<13)|0;l=((i=i+Math.imul(L,ye)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Oe=(l+(a=Math.imul(q,pe))|0)+((8191&(n=(n=Math.imul(q,ye))+Math.imul(D,pe)|0))<<13)|0;return l=((i=Math.imul(D,ye))+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,h[0]=me,h[1]=ge,h[2]=be,h[3]=ke,h[4]=ve,h[5]=we,h[6]=xe,h[7]=Me,h[8]=_e,h[9]=Se,h[10]=je,h[11]=Ce,h[12]=Ae,h[13]=Te,h[14]=Ee,h[15]=Ne,h[16]=ze,h[17]=Re,h[18]=Oe,0!==l&&(h[19]=l,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i<r.length-1;i++){var s=n;n=0;for(var o=67108863&a,h=Math.min(i,t.length-1),l=Math.max(0,i-e.length+1);l<=h;l++){var d=i-l,c=(0|e.words[d])*(0|t.words[l]),u=67108863&c;o=67108863&(u=u+o|0),n+=(s=(s=s+(c/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[i]=o,a=s,s=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function g(e,t,r){return m(e,t,r)}Math.imul||(y=p),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?p(this,e,t):r<1024?m(this,e,t):g(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),g(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var a=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,s=(67108863&i)+(67108863&a);a>>=26,a+=i/67108864|0,a+=s>>>26,this.words[n]=67108863&s}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var a=r/26|0,n=r%26;t[r]=e.words[a]>>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,a=0;a<t.length&&0===t[a];a++,r=r.sqr());if(++a<t.length)for(var i=r.sqr();a<t.length;a++,i=i.sqr())0!==t[a]&&(r=r.mul(i));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&i,h=(0|this.words[t])-o<<a;this.words[t]=h|s,s=o>>>26-a}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,a){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<<i,h=a;if(n-=s,n=Math.max(0,n),h){for(var l=0;l<s;l++)h.words[l]=this.words[l];h.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=n);l--){var c=0|this.words[l];this.words[l]=d<<26-i|c>>>i,d=c&o}return h&&0!==d&&(h.words[h.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<<t;return!(this.length<=a||!(this.words[a]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,a){var n,i,s=e.length+a;this._expand(s);var o=0;for(n=0;n<e.length;n++){i=(0|this.words[n+a])+o;var h=(0|e.words[n])*t;o=((i-=67108863&h)>>26)-(h/67108864|0),this.words[n+a]=67108863&i}for(;n<this.length-a;n++)o=(i=(0|this.words[n+a])+o)>>26,this.words[n+a]=67108863&i;if(0===o)return this._strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(i=-(0|this.words[n])+o)>>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),a=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),a.iushln(r),s=0|i.words[i.length-1]);var o,h=a.length-i.length;if("mod"!==t){(o=new n(null)).length=h+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var d=a.clone()._ishlnsubmul(i,1,h);0===d.negative&&(a=d,o&&(o.words[h]=1));for(var c=h-1;c>=0;c--){var u=67108864*(0|a.words[i.length+c])+(0|a.words[i.length+c-1]);for(u=Math.min(u/s|0,67108863),a._ishlnsubmul(i,u,c);0!==a.negative;)u--,a.negative=0,a._ishlnsubmul(i,1,c),a.isZero()||(a.negative^=1);o&&(o.words[c]=u)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},n.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),a&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),a&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new n(1),s=new n(0),o=new n(0),h=new n(1),l=0;t.isEven()&&a.isEven();)t.iushrn(1),a.iushrn(1),++l;for(var d=a.clone(),c=t.clone();!t.isZero();){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(d),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(a.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(a.iushrn(p);p-- >0;)(o.isOdd()||h.isOdd())&&(o.iadd(d),h.isub(c)),o.iushrn(1),h.iushrn(1);t.cmp(a)>=0?(t.isub(a),i.isub(o),s.isub(h)):(a.isub(t),o.isub(i),h.isub(s))}return{a:o,b:h,gcd:a.iushln(l)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new n(1),o=new n(0),h=a.clone();t.cmpn(1)>0&&a.cmpn(1)>0;){for(var l=0,d=1;0==(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var c=0,u=1;0==(a.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(a.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);t.cmp(a)>=0?(t.isub(a),s.isub(o)):(a.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(a)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,a=(e-t)/26,n=1<<t;if(this.length<=a)return this._expand(a+1),this.words[a]|=n,this;for(var i=n,s=a;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){a<n?t=-1:a>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new _(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}k.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var a=t<this.n?-1:r.ucmp(this.p);return 0===a?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},a(v,k),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),a=0;a<r;a++)t.words[a]=e.words[a];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,a=10;a<e.length;a++){var i=0|e.words[a];e.words[a-10]=(4194303&i)<<4|n>>>22,n=i}n>>>=22,e.words[a-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var a=0|e.words[r];t+=977*a,e.words[r]=67108863&t,t=64*a+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(w,k),a(x,k),a(M,k),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var a=19*(0|e.words[r])+t,n=67108863&a;a>>>=26,e.words[r]=n,t=a}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var a=this.m.add(new n(1)).iushrn(2);return this.pow(e,a)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var o=new n(1).toRed(this),h=o.redNeg(),l=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new n(2*d*d).toRed(this);0!==this.pow(d,l).cmp(h);)d.redIAdd(h);for(var c=this.pow(d,i),u=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();r(m<p);var g=this.pow(c,new n(1).iushln(p-m-1));u=u.redMul(g),c=g.redSqr(),f=f.redMul(c),p=m}return u},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var a=2;a<r.length;a++)r[a]=this.mul(r[a-1],e);var i=r[0],s=0,o=0,h=t.bitLength()%26;for(0===h&&(h=26),a=t.length-1;a>=0;a--){for(var l=t.words[a],d=h-1;d>=0;d--){var c=l>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++o||0===a&&0===d)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}h=26}return i},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},a(S,_),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(a).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{buffer:188}],187:[function(e,t,r){var a;function n(e){this.rand=e}if(t.exports=function(e){return a||(a=new n(null)),a.generate(e)},t.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var i=e("crypto");if("function"!=typeof i.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return i.randomBytes(e)}}catch(e){}},{crypto:188}],188:[function(e,t,r){},{}],189:[function(e,t,r){var a=e("safe-buffer").Buffer;function n(e){a.isBuffer(e)||(e=a.from(e));for(var t=e.length/4|0,r=new Array(t),n=0;n<t;n++)r[n]=e.readUInt32BE(4*n);return r}function i(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,a,n){for(var i,s,o,h,l=r[0],d=r[1],c=r[2],u=r[3],f=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],m=e[3]^t[3],g=4,b=1;b<n;b++)i=l[f>>>24]^d[p>>>16&255]^c[y>>>8&255]^u[255&m]^t[g++],s=l[p>>>24]^d[y>>>16&255]^c[m>>>8&255]^u[255&f]^t[g++],o=l[y>>>24]^d[m>>>16&255]^c[f>>>8&255]^u[255&p]^t[g++],h=l[m>>>24]^d[f>>>16&255]^c[p>>>8&255]^u[255&y]^t[g++],f=i,p=s,y=o,m=h;return i=(a[f>>>24]<<24|a[p>>>16&255]<<16|a[y>>>8&255]<<8|a[255&m])^t[g++],s=(a[p>>>24]<<24|a[y>>>16&255]<<16|a[m>>>8&255]<<8|a[255&f])^t[g++],o=(a[y>>>24]<<24|a[m>>>16&255]<<16|a[f>>>8&255]<<8|a[255&p])^t[g++],h=(a[m>>>24]<<24|a[f>>>16&255]<<16|a[p>>>8&255]<<8|a[255&y])^t[g++],[i>>>=0,s>>>=0,o>>>=0,h>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],a=[],n=[[],[],[],[]],i=[[],[],[],[]],s=0,o=0,h=0;h<256;++h){var l=o^o<<1^o<<2^o<<3^o<<4;l=l>>>8^255&l^99,r[s]=l,a[l]=s;var d=e[s],c=e[d],u=e[c],f=257*e[l]^16843008*l;n[0][s]=f<<24|f>>>8,n[1][s]=f<<16|f>>>16,n[2][s]=f<<8|f>>>24,n[3][s]=f,f=16843009*u^65537*c^257*d^16843008*s,i[0][l]=f<<24|f>>>8,i[1][l]=f<<16|f>>>16,i[2][l]=f<<8|f>>>24,i[3][l]=f,0===s?s=o=1:(s=d^e[e[e[u^d]]],o^=e[e[o]])}return{SBOX:r,INV_SBOX:a,SUB_MIX:n,INV_SUB_MIX:i}}();function l(e){this._key=n(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,a=4*(r+1),n=[],i=0;i<t;i++)n[i]=e[i];for(i=t;i<a;i++){var s=n[i-1];i%t==0?(s=s<<8|s>>>24,s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s],s^=o[i/t|0]<<24):t>6&&i%t==4&&(s=h.SBOX[s>>>24]<<24|h.SBOX[s>>>16&255]<<16|h.SBOX[s>>>8&255]<<8|h.SBOX[255&s]),n[i]=n[i-t]^s}for(var l=[],d=0;d<a;d++){var c=a-d,u=n[c-(d%4?0:4)];l[d]=d<4||c<=4?u:h.INV_SUB_MIX[0][h.SBOX[u>>>24]]^h.INV_SUB_MIX[1][h.SBOX[u>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[u>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&u]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return s(e=n(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=a.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},l.prototype.decryptBlock=function(e){var t=(e=n(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=a.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},l.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=l},{"safe-buffer":494}],190:[function(e,t,r){var a=e("./aes"),n=e("safe-buffer").Buffer,i=e("cipher-base"),s=e("inherits"),o=e("./ghash"),h=e("buffer-xor"),l=e("./incr32");function d(e,t,r,s){i.call(this);var h=n.alloc(4,0);this._cipher=new a.AES(t);var d=this._cipher.encryptBlock(h);this._ghash=new o(d),r=function(e,t,r){if(12===t.length)return e._finID=n.concat([t,n.from([0,0,0,1])]),n.concat([t,n.from([0,0,0,2])]);var a=new o(r),i=t.length,s=i%16;a.update(t),s&&(s=16-s,a.update(n.alloc(s,0))),a.update(n.alloc(8,0));var h=8*i,d=n.alloc(8);d.writeUIntBE(h,0,8),a.update(d),e._finID=a.state;var c=n.from(e._finID);return l(c),c}(this,r,d),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(d,i),d.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=n.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},d.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=h(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var a=Math.min(e.length,t.length),n=0;n<a;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},d.prototype.getAuthTag=function(){if(this._decrypt||!n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},d.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},d.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=d},{"./aes":189,"./ghash":194,"./incr32":195,"buffer-xor":219,"cipher-base":221,inherits:440,"safe-buffer":494}],191:[function(e,t,r){var a=e("./encrypter"),n=e("./decrypter"),i=e("./modes/list.json");r.createCipher=r.Cipher=a.createCipher,r.createCipheriv=r.Cipheriv=a.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(i)}},{"./decrypter":192,"./encrypter":193,"./modes/list.json":203}],192:[function(e,t,r){var a=e("./authCipher"),n=e("safe-buffer").Buffer,i=e("./modes"),s=e("./streamCipher"),o=e("cipher-base"),h=e("./aes"),l=e("evp_bytestokey");function d(e,t,r){o.call(this),this._cache=new c,this._last=void 0,this._cipher=new h.AES(t),this._prev=n.from(r),this._mode=e,this._autopadding=!0}function c(){this.cache=n.allocUnsafe(0)}function u(e,t,r){var o=i[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=n.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=n.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===o.type?new s(o.module,t,r,!0):"auth"===o.type?new a(o.module,t,r,!0):new d(o.module,t,r)}e("inherits")(d,o),d.prototype._update=function(e){var t,r;this._cache.add(e);for(var a=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),a.push(r);return n.concat(a)},d.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},c.prototype.add=function(e){this.cache=n.concat([this.cache,e])},c.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=i[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var a=l(t,!1,r.key,r.iv);return u(e,a.key,a.iv)},r.createDecipheriv=u},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,t,r){var a=e("./modes"),n=e("./authCipher"),i=e("safe-buffer").Buffer,s=e("./streamCipher"),o=e("cipher-base"),h=e("./aes"),l=e("evp_bytestokey");function d(e,t,r){o.call(this),this._cache=new u,this._cipher=new h.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}e("inherits")(d,o),d.prototype._update=function(e){var t,r;this._cache.add(e);for(var a=[];t=this._cache.get();)r=this._mode.encrypt(this,t),a.push(r);return i.concat(a)};var c=i.alloc(16,16);function u(){this.cache=i.allocUnsafe(0)}function f(e,t,r){var o=a[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=i.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=i.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===o.type?new s(o.module,t,r):"auth"===o.type?new n(o.module,t,r):new d(o.module,t,r)}d.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=i.concat([this.cache,e])},u.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},u.prototype.flush=function(){for(var e=16-this.cache.length,t=i.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return i.concat([this.cache,t])},r.createCipheriv=f,r.createCipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=l(t,!1,r.key,r.iv);return f(e,n.key,n.iv)}},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],194:[function(e,t,r){var a=e("safe-buffer").Buffer,n=a.alloc(16,0);function i(e){var t=a.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=a.alloc(16,0),this.cache=a.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},s.prototype._multiply=function(){for(var e,t,r,a=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],n=[0,0,0,0],s=-1;++s<128;){for(!!(this.state[~~(s/8)]&1<<7-s%8)&&(n[0]^=a[0],n[1]^=a[1],n[2]^=a[2],n[3]^=a[3]),r=!!(1&a[3]),t=3;t>0;t--)a[t]=a[t]>>>1|(1&a[t-1])<<31;a[0]=a[0]>>>1,r&&(a[0]=a[0]^225<<24)}this.state=i(n)},s.prototype.update=function(e){var t;for(this.cache=a.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(a.concat([this.cache,n],16)),this.ghash(i([0,e,0,t])),this.state},t.exports=s},{"safe-buffer":494}],195:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],196:[function(e,t,r){var a=e("buffer-xor");r.encrypt=function(e,t){var r=a(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return a(n,r)}},{"buffer-xor":219}],197:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("buffer-xor");function i(e,t,r){var i=t.length,s=n(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:s]),s}r.encrypt=function(e,t,r){for(var n,s=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){s=a.concat([s,i(e,t,r)]);break}n=e._cache.length,s=a.concat([s,i(e,t.slice(0,n),r)]),t=t.slice(n)}return s}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,t,r){var a=e("safe-buffer").Buffer;function n(e,t,r){for(var a,n,s=-1,o=0;++s<8;)a=t&1<<7-s?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^a))>>s%8,e._prev=i(e._prev,r?a:n);return o}function i(e,t){var r=e.length,n=-1,i=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++n<r;)i[n]=e[n]<<1|e[n+1]>>7;return i}r.encrypt=function(e,t,r){for(var i=t.length,s=a.allocUnsafe(i),o=-1;++o<i;)s[o]=n(e,t[o],r);return s}},{"safe-buffer":494}],199:[function(e,t,r){var a=e("safe-buffer").Buffer;function n(e,t,r){var n=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=a.concat([e._prev.slice(1),a.from([r?t:n])]),n}r.encrypt=function(e,t,r){for(var i=t.length,s=a.allocUnsafe(i),o=-1;++o<i;)s[o]=n(e,t[o],r);return s}},{"safe-buffer":494}],200:[function(e,t,r){var a=e("buffer-xor"),n=e("safe-buffer").Buffer,i=e("../incr32");function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return i(e._prev),t}r.encrypt=function(e,t){var r=Math.ceil(t.length/16),i=e._cache.length;e._cache=n.concat([e._cache,n.allocUnsafe(16*r)]);for(var o=0;o<r;o++){var h=s(e),l=i+16*o;e._cache.writeUInt32BE(h[0],l+0),e._cache.writeUInt32BE(h[1],l+4),e._cache.writeUInt32BE(h[2],l+8),e._cache.writeUInt32BE(h[3],l+12)}var d=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),a(t,d)}},{"../incr32":195,"buffer-xor":219,"safe-buffer":494}],201:[function(e,t,r){r.encrypt=function(e,t){return e._cipher.encryptBlock(t)},r.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],202:[function(e,t,r){var a={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},n=e("./list.json");for(var i in n)n[i].module=a[n[i].mode];t.exports=n},{"./cbc":196,"./cfb":197,"./cfb1":198,"./cfb8":199,"./ctr":200,"./ecb":201,"./list.json":203,"./ofb":204}],203:[function(e,t,r){t.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],204:[function(e,t,r){(function(t){(function(){var a=e("buffer-xor");function n(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}r.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,n(e)]);var i=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),a(r,i)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,"buffer-xor":219}],205:[function(e,t,r){var a=e("./aes"),n=e("safe-buffer").Buffer,i=e("cipher-base");function s(e,t,r,s){i.call(this),this._cipher=new a.AES(t),this._prev=n.from(r),this._cache=n.allocUnsafe(0),this._secCache=n.allocUnsafe(0),this._decrypt=s,this._mode=e}e("inherits")(s,i),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},{"./aes":189,"cipher-base":221,inherits:440,"safe-buffer":494}],206:[function(e,t,r){var a=e("browserify-des"),n=e("browserify-aes/browser"),i=e("browserify-aes/modes"),s=e("browserify-des/modes"),o=e("evp_bytestokey");function h(e,t,r){if(e=e.toLowerCase(),i[e])return n.createCipheriv(e,t,r);if(s[e])return new a({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function l(e,t,r){if(e=e.toLowerCase(),i[e])return n.createDecipheriv(e,t,r);if(s[e])return new a({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(e,t){var r,a;if(e=e.toLowerCase(),i[e])r=i[e].key,a=i[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,a=s[e].iv}var n=o(t,!1,r,a);return h(e,n.key,n.iv)},r.createCipheriv=r.Cipheriv=h,r.createDecipher=r.Decipher=function(e,t){var r,a;if(e=e.toLowerCase(),i[e])r=i[e].key,a=i[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,a=s[e].iv}var n=o(t,!1,r,a);return l(e,n.key,n.iv)},r.createDecipheriv=r.Decipheriv=l,r.listCiphers=r.getCiphers=function(){return Object.keys(s).concat(n.getCiphers())}},{"browserify-aes/browser":191,"browserify-aes/modes":202,"browserify-des":207,"browserify-des/modes":208,evp_bytestokey:423}],207:[function(e,t,r){var a=e("cipher-base"),n=e("des.js"),i=e("inherits"),s=e("safe-buffer").Buffer,o={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function h(e){a.call(this);var t,r=e.mode.toLowerCase(),n=o[r];t=e.decrypt?"decrypt":"encrypt";var i=e.key;s.isBuffer(i)||(i=s.from(i)),"des-ede"!==r&&"des-ede-cbc"!==r||(i=s.concat([i,i.slice(0,8)]));var h=e.iv;s.isBuffer(h)||(h=s.from(h)),this._des=n.create({key:i,iv:h,type:t})}o.des=o["des-cbc"],o.des3=o["des-ede3-cbc"],t.exports=h,i(h,a),h.prototype._update=function(e){return s.from(this._des.update(e))},h.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":221,"des.js":394,inherits:440,"safe-buffer":494}],208:[function(e,t,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],209:[function(e,t,r){(function(r){(function(){var a=e("bn.js"),n=e("randombytes");function i(e){var t,r=e.modulus.byteLength();do{t=new a(n(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var n=function(e){var t=i(e);return{blinder:t.toRed(a.mont(e.modulus)).redPow(new a(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),s=t.modulus.byteLength(),o=new a(e).mul(n.blinder).umod(t.modulus),h=o.toRed(a.mont(t.prime1)),l=o.toRed(a.mont(t.prime2)),d=t.coefficient,c=t.prime1,u=t.prime2,f=h.redPow(t.exponent1).fromRed(),p=l.redPow(t.exponent2).fromRed(),y=f.isub(p).imul(d).umod(c).imul(u);return p.iadd(y).imul(n.unblinder).umod(t.modulus).toArrayLike(r,"be",s)}s.getr=i,t.exports=s}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("create-hash"),i=e("readable-stream"),s=e("inherits"),o=e("./sign"),h=e("./verify"),l=e("./algorithms.json");function d(e){i.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function c(e){i.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){return new d(e)}function f(e){return new c(e)}Object.keys(l).forEach(function(e){l[e].id=a.from(l[e].id,"hex"),l[e.toLowerCase()]=l[e]}),s(d,i.Writable),d.prototype._write=function(e,t,r){this._hash.update(e),r()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=a.from(e,t)),this._hash.update(e),this},d.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),a=o(r,e,this._hashType,this._signType,this._tag);return t?a.toString(t):a},s(c,i.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return"string"==typeof e&&(e=a.from(e,t)),this._hash.update(e),this},c.prototype.verify=function(e,t,r){"string"==typeof t&&(t=a.from(t,r)),this.end();var n=this._hash.digest();return h(t,n,e,this._signType,this._tag)},t.exports={Sign:u,Verify:f,createSign:u,createVerify:f}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("create-hmac"),i=e("browserify-rsa"),s=e("elliptic").ec,o=e("bn.js"),h=e("parse-asn1"),l=e("./curves.json");function d(e,t,r,i){if((e=a.from(e.toArray())).length<t.byteLength()){var s=a.alloc(t.byteLength()-e.length);e=a.concat([s,e])}var o=r.length,h=function(e,t){e=(e=c(e,t)).mod(t);var r=a.from(e.toArray());if(r.length<t.byteLength()){var n=a.alloc(t.byteLength()-r.length);r=a.concat([n,r])}return r}(r,t),l=a.alloc(o);l.fill(1);var d=a.alloc(o);return d=n(i,d).update(l).update(a.from([0])).update(e).update(h).digest(),l=n(i,d).update(l).digest(),{k:d=n(i,d).update(l).update(a.from([1])).update(e).update(h).digest(),v:l=n(i,d).update(l).digest()}}function c(e,t){var r=new o(e),a=(e.length<<3)-t.bitLength();return a>0&&r.ishrn(a),r}function u(e,t,r){var i,s;do{for(i=a.alloc(0);8*i.length<e.bitLength();)t.v=n(r,t.k).update(t.v).digest(),i=a.concat([i,t.v]);s=c(i,e),t.k=n(r,t.k).update(t.v).update(a.from([0])).digest(),t.v=n(r,t.k).update(t.v).digest()}while(-1!==s.cmp(e));return s}function f(e,t,r,a){return e.toRed(o.mont(r)).redPow(t).fromRed().mod(a)}t.exports=function(e,t,r,n,p){var y=h(t);if(y.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return function(e,t){var r=l[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var n=new s(r).keyFromPrivate(t.privateKey).sign(e);return a.from(n.toDER())}(e,y)}if("dsa"===y.type){if("dsa"!==n)throw new Error("wrong private key type");return function(e,t,r){for(var n,i=t.params.priv_key,s=t.params.p,h=t.params.q,l=t.params.g,p=new o(0),y=c(e,h).mod(h),m=!1,g=d(i,h,e,r);!1===m;)p=f(l,n=u(h,g,r),s,h),0===(m=n.invm(h).imul(y.add(i.mul(p))).mod(h)).cmpn(0)&&(m=!1,p=new o(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),a.from(r)}(p,m)}(e,y,r)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");e=a.concat([p,e]);for(var m=y.modulus.byteLength(),g=[0,1];e.length+g.length+1<m;)g.push(255);g.push(0);for(var b=-1;++b<e.length;)g.push(e[b]);return i(g,y)},t.exports.getKey=d,t.exports.makeKey=u},{"./curves.json":212,"bn.js":186,"browserify-rsa":209,"create-hmac":388,elliptic:405,"parse-asn1":459,"safe-buffer":494}],215:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("bn.js"),i=e("elliptic").ec,s=e("parse-asn1"),o=e("./curves.json");function h(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}t.exports=function(e,t,r,l,d){var c=s(r);if("ec"===c.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");return function(e,t,r){var a=o[r.data.algorithm.curve.join(".")];if(!a)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new i(a),s=r.data.subjectPrivateKey.data;return n.verify(t,e,s)}(e,t,c)}if("dsa"===c.type){if("dsa"!==l)throw new Error("wrong public key type");return function(e,t,r){var a=r.data.p,i=r.data.q,o=r.data.g,l=r.data.pub_key,d=s.signature.decode(e,"der"),c=d.s,u=d.r;h(c,i),h(u,i);var f=n.mont(a),p=c.invm(i);return 0===o.toRed(f).redPow(new n(t).mul(p).mod(i)).fromRed().mul(l.toRed(f).redPow(u.mul(p).mod(i)).fromRed()).mod(a).mod(i).cmp(u)}(e,t,c)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");t=a.concat([d,t]);for(var u=c.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<u;)f.push(255),p++;f.push(0);for(var y=-1;++y<t.length;)f.push(t[y]);f=a.from(f);var m=n.mont(c.modulus);e=(e=new n(e).toRed(m)).redPow(new n(c.publicExponent)),e=a.from(e.fromRed().toArray());var g=p<8?1:0;for(u=Math.min(e.length,f.length),e.length!==f.length&&(g=1),y=-1;++y<u;)g|=e[y]^f[y];return 0===g}},{"./curves.json":212,"bn.js":186,elliptic:405,"parse-asn1":459,"safe-buffer":494}],216:[function(e,t,r){},{}],217:[function(e,t,r){var a=e("buffer"),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=a:(i(a,r),r.Buffer=s),i(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"==typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},{buffer:220}],218:[function(e,t,r){var a=e("safe-buffer").Buffer,n=a.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(a.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=h,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=d,this.end=c,t=3;break;default:return this.write=u,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=a.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function h(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function d(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var a=t.length-1;if(a<r)return 0;var n=s(t[a]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--a<r||-2===n?0:(n=s(t[a]))>=0?(n>0&&(e.lastNeed=n-2),n):--a<r||-2===n?0:(n=s(t[a]))>=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":217}],219:[function(e,t,r){(function(e){(function(){t.exports=function(t,r){for(var a=Math.min(t.length,r.length),n=new e(a),i=0;i<a;++i)n[i]=t[i]^r[i];return n}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],220:[function(e,t,r){(function(t){(function(){var t=e("base64-js"),a=e("ieee754");function n(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|c(e,t),a=n(r),s=a.write(e,t);return s!==r&&(a=a.slice(0,s)),a}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var a;return(a=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=i.prototype,a}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return i.from(a,t,r);var s=function(e){if(i.isBuffer(e)){var t=0|d(e.length),r=n(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||D(e.length)?n(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return o(e),n(e<0?0:0|d(e))}function l(e){for(var t=e.length<0?0:0|d(e.length),r=n(t),a=0;a<t;a+=1)r[a]=255&e[a];return r}function d(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function c(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(n)return a?-1:P(e).length;t=(""+t).toLowerCase(),n=!0}}function u(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function f(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function p(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=i.from(t,a)),i.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,s=1,o=e.length,h=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;s=2,o/=2,h/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var d=-1;for(i=r;i<o;i++)if(l(e,i)===l(t,-1===d?0:i-d)){if(-1===d&&(d=i),i-d+1===h)return d*s}else-1!==d&&(i-=i-d),d=-1}else for(r+h>o&&(r=o-h),i=r;i>=0;i--){for(var c=!0,u=0;u<h;u++)if(l(e,i+u)!==l(t,u)){c=!1;break}if(c)return i}return-1}function m(e,t,r,a){r=Number(r)||0;var n=e.length-r;a?(a=Number(a))>n&&(a=n):a=n;var i=t.length;a>i/2&&(a=i/2);for(var s=0;s<a;++s){var o=parseInt(t.substr(2*s,2),16);if(D(o))return s;e[r+s]=o}return s}function g(e,t,r,a){return I(P(t,e.length-r),e,r,a)}function b(e,t,r,a){return I(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,a)}function k(e,t,r,a){return b(e,t,r,a)}function v(e,t,r,a){return I(L(t),e,r,a)}function w(e,t,r,a){return I(function(e,t){for(var r,a,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)a=(r=e.charCodeAt(s))>>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function x(e,r,a){return 0===r&&a===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,a))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n<r;){var i,s,o,h,l=e[n],d=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c<=r)switch(c){case 1:l<128&&(d=l);break;case 2:128==(192&(i=e[n+1]))&&(h=(31&l)<<6|63&i)>127&&(d=h);break;case 3:i=e[n+1],s=e[n+2],128==(192&i)&&128==(192&s)&&(h=(15&l)<<12|(63&i)<<6|63&s)>2047&&(h<55296||h>57343)&&(d=h);break;case 4:i=e[n+1],s=e[n+2],o=e[n+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(h=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&h<1114112&&(d=h)}null===d?(d=65533,c=1):d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|1023&d),a.push(d),n+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",a=0;a<t;)r+=String.fromCharCode.apply(String,e.slice(a,a+=4096));return r}(a)}function _(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(127&e[n]);return a}function S(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(e[n]);return a}function j(e,t,r){var a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);for(var n="",i=t;i<r;++i)n+=O(e[i]);return n}function C(e,t,r){for(var a=e.slice(t,r),n="",i=0;i<a.length;i+=2)n+=String.fromCharCode(a[i]+256*a[i+1]);return n}function A(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,a,n,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}function E(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function z(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,8),a.write(e,t,r,n,52,8),r+8}r.Buffer=i,r.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return s(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return function(e,t,r){return o(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}(e,t,r)},i.allocUnsafe=function(e){return h(e)},i.allocUnsafeSlow=function(e){return h(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(q(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,a=t.length,n=0,s=Math.min(r,a);n<s;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:a<r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var a=i.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var s=e[r];if(q(s,Uint8Array)&&(s=i.from(s)),!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(a,n),n+=s.length}return a},i.byteLength=c,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):u.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,a,n){if(q(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),h=Math.min(s,o),l=this.slice(a,n),d=e.slice(t,r),c=0;c<h;++c)if(l[c]!==d[c]){s=l[c],o=d[c];break}return s<o?-1:o<s?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return p(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return p(this,e,t,r,!1)},i.prototype.write=function(e,t,r,a){if(void 0===t)a="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)a=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return g(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var a=this.subarray(e,t);return a.__proto__=i.prototype,a},i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a},i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var a=this[e+--t],n=1;t>0&&(n*=256);)a+=this[e+--t]*n;return a},i.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},i.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),a.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),a.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),a.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),a.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,a){e=+e,t>>>=0,r>>>=0,a||T(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i<r&&(n*=256);)this[t+i]=e/n&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,a){e=+e,t>>>=0,r>>>=0,a||T(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=e/i&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}var i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},i.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}var i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return z(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return z(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,a){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var n=a-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,a);else if(this===e&&r<t&&t<a)for(var s=n-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,a),t);return n},i.prototype.fill=function(e,t,r,a){if("string"==typeof e){if("string"==typeof t?(a=t,t=0,r=this.length):"string"==typeof r&&(a=r,r=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!i.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var n=e.charCodeAt(0);("utf8"===a&&n<128||"latin1"===a)&&(e=n)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var o=i.isBuffer(e)?e:i.from(e,a),h=o.length;if(0===h)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=o[s%h]}return this};var R=/[^+/0-9A-Za-z-_]/g;function O(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,t){var r;t=t||1/0;for(var a=e.length,n=null,i=[],s=0;s<a;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function L(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,r,a){for(var n=0;n<a&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function D(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("stream").Transform,i=e("string_decoder").StringDecoder;function s(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(s,n),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=a.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var a;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){a=e}finally{r(a)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||a.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var a=this._decoder.write(e);return r&&(a+=this._decoder.end()),a},t.exports=s},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,t,r){var a=e("../internals/is-callable"),n=e("../internals/try-to-string"),i=TypeError;t.exports=function(e){if(a(e))return e;throw new i(n(e)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,t,r){var a=e("../internals/is-constructor"),n=e("../internals/try-to-string"),i=TypeError;t.exports=function(e){if(a(e))return e;throw new i(n(e)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,t,r){var a=e("../internals/is-callable"),n=String,i=TypeError;t.exports=function(e){if("object"==typeof e||a(e))return e;throw new i("Can't set "+n(e)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(e,t,r){var a=e("../internals/well-known-symbol"),n=e("../internals/object-create"),i=e("../internals/object-define-property").f,s=a("unscopables"),o=Array.prototype;void 0===o[s]&&i(o,s,{configurable:!0,value:n(null)}),t.exports=function(e){o[s][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,t,r){var a=e("../internals/object-is-prototype-of"),n=TypeError;t.exports=function(e,t){if(a(t,e))return e;throw new n("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(e,t,r){var a=e("../internals/is-object"),n=String,i=TypeError;t.exports=function(e){if(a(e))return e;throw new i(n(e)+" is not an object")}},{"../internals/is-object":289}],228:[function(e,t,r){var a=e("../internals/to-indexed-object"),n=e("../internals/to-absolute-index"),i=e("../internals/length-of-array-like"),s=function(e){return function(t,r,s){var o,h=a(t),l=i(h),d=n(s,l);if(e&&r!=r){for(;l>d;)if((o=h[d++])!=o)return!0}else for(;l>d;d++)if((e||d in h)&&h[d]===r)return e||d||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,t,r){var a=e("../internals/function-bind-context"),n=e("../internals/function-uncurry-this"),i=e("../internals/indexed-object"),s=e("../internals/to-object"),o=e("../internals/length-of-array-like"),h=e("../internals/array-species-create"),l=n([].push),d=function(e){var t=1===e,r=2===e,n=3===e,d=4===e,c=6===e,u=7===e,f=5===e||c;return function(p,y,m,g){for(var b,k,v=s(p),w=i(v),x=a(y,m),M=o(w),_=0,S=g||h,j=t?S(p,M):r||u?S(p,0):void 0;M>_;_++)if((f||_ in w)&&(k=x(b=w[_],_,v),e))if(t)j[_]=k;else if(k)switch(e){case 3:return!0;case 5:return b;case 6:return _;case 2:l(j,b)}else switch(e){case 4:return!1;case 7:l(j,b)}return c?-1:n||d?d:j}};t.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterReject:d(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,t,r){var a=e("../internals/to-absolute-index"),n=e("../internals/length-of-array-like"),i=e("../internals/create-property"),s=Array,o=Math.max;t.exports=function(e,t,r){for(var h=n(e),l=a(t,h),d=a(void 0===r?h:r,h),c=s(o(d-l,0)),u=0;l<d;l++,u++)i(c,u,e[l]);return c.length=u,c}},{"../internals/create-property":243,"../internals/length-of-array-like":299,"../internals/to-absolute-index":340}],231:[function(e,t,r){var a=e("../internals/function-uncurry-this");t.exports=a([].slice)},{"../internals/function-uncurry-this":268}],232:[function(e,t,r){var a=e("../internals/is-array"),n=e("../internals/is-constructor"),i=e("../internals/is-object"),s=e("../internals/well-known-symbol")("species"),o=Array;t.exports=function(e){var t;return a(e)&&(t=e.constructor,(n(t)&&(t===o||a(t.prototype))||i(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?o:t}},{"../internals/is-array":284,"../internals/is-constructor":286,"../internals/is-object":289,"../internals/well-known-symbol":357}],233:[function(e,t,r){var a=e("../internals/array-species-constructor");t.exports=function(e,t){return new(a(e))(0===t?0:t)}},{"../internals/array-species-constructor":232}],234:[function(e,t,r){var a=e("../internals/well-known-symbol")("iterator"),n=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){n=!0}};s[a]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!n)return!1}catch(e){return!1}var r=!1;try{var i={};i[a]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},{"../internals/well-known-symbol":357}],235:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=a({}.toString),i=a("".slice);t.exports=function(e){return i(n(e),8,-1)}},{"../internals/function-uncurry-this":268}],236:[function(e,t,r){var a=e("../internals/to-string-tag-support"),n=e("../internals/is-callable"),i=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("toStringTag"),o=Object,h="Arguments"===i(function(){return arguments}());t.exports=a?i:function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?r:h?i(t):"Object"===(a=i(t))&&n(t.callee)?"Arguments":a}},{"../internals/classof-raw":235,"../internals/is-callable":285,"../internals/to-string-tag-support":347,"../internals/well-known-symbol":357}],237:[function(e,t,r){var a=e("../internals/has-own-property"),n=e("../internals/own-keys"),i=e("../internals/object-get-own-property-descriptor"),s=e("../internals/object-define-property");t.exports=function(e,t,r){for(var o=n(t),h=s.f,l=i.f,d=0;d<o.length;d++){var c=o[d];a(e,c)||r&&a(r,c)||h(e,c,l(t,c))}}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/own-keys":321}],238:[function(e,t,r){var a=e("../internals/well-known-symbol")("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[a]=!1,"/./"[e](t)}catch(e){}}return!1}},{"../internals/well-known-symbol":357}],239:[function(e,t,r){var a=e("../internals/fails");t.exports=!a(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},{"../internals/fails":260}],240:[function(e,t,r){t.exports=function(e,t){return{value:e,done:t}}},{}],241:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/object-define-property"),i=e("../internals/create-property-descriptor");t.exports=a?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/object-define-property":308}],242:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],243:[function(e,t,r){var a=e("../internals/to-property-key"),n=e("../internals/object-define-property"),i=e("../internals/create-property-descriptor");t.exports=function(e,t,r){var s=a(t);s in e?n.f(e,s,i(0,r)):e[s]=r}},{"../internals/create-property-descriptor":242,"../internals/object-define-property":308,"../internals/to-property-key":346}],244:[function(e,t,r){var a=e("../internals/make-built-in"),n=e("../internals/object-define-property");t.exports=function(e,t,r){return r.get&&a(r.get,t,{getter:!0}),r.set&&a(r.set,t,{setter:!0}),n.f(e,t,r)}},{"../internals/make-built-in":300,"../internals/object-define-property":308}],245:[function(e,t,r){var a=e("../internals/is-callable"),n=e("../internals/object-define-property"),i=e("../internals/make-built-in"),s=e("../internals/define-global-property");t.exports=function(e,t,r,o){o||(o={});var h=o.enumerable,l=void 0!==o.name?o.name:t;if(a(r)&&i(r,l,o),o.global)h?e[t]=r:s(t,r);else{try{o.unsafe?e[t]&&(h=!0):delete e[t]}catch(e){}h?e[t]=r:n.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},{"../internals/define-global-property":246,"../internals/is-callable":285,"../internals/make-built-in":300,"../internals/object-define-property":308}],246:[function(e,t,r){var a=e("../internals/global"),n=Object.defineProperty;t.exports=function(e,t){try{n(a,e,{value:t,configurable:!0,writable:!0})}catch(r){a[e]=t}return t}},{"../internals/global":274}],247:[function(e,t,r){var a=e("../internals/fails");t.exports=!a(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":260}],248:[function(e,t,r){var a="object"==typeof document&&document.all,n=void 0===a&&void 0!==a;t.exports={all:a,IS_HTMLDDA:n}},{}],249:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/is-object"),i=a.document,s=n(i)&&n(i.createElement);t.exports=function(e){return s?i.createElement(e):{}}},{"../internals/global":274,"../internals/is-object":289}],250:[function(e,t,r){var a=e("../internals/engine-is-deno"),n=e("../internals/engine-is-node");t.exports=!a&&!n&&"object"==typeof window&&"object"==typeof document},{"../internals/engine-is-deno":251,"../internals/engine-is-node":254}],251:[function(e,t,r){t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},{}],252:[function(e,t,r){var a=e("../internals/engine-user-agent");t.exports=/ipad|iphone|ipod/i.test(a)&&"undefined"!=typeof Pebble},{"../internals/engine-user-agent":256}],253:[function(e,t,r){var a=e("../internals/engine-user-agent");t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(a)},{"../internals/engine-user-agent":256}],254:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/classof-raw");t.exports="process"===n(a.process)},{"../internals/classof-raw":235,"../internals/global":274}],255:[function(e,t,r){var a=e("../internals/engine-user-agent");t.exports=/web0s(?!.*chrome)/i.test(a)},{"../internals/engine-user-agent":256}],256:[function(e,t,r){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},{}],257:[function(e,t,r){var a,n,i=e("../internals/global"),s=e("../internals/engine-user-agent"),o=i.process,h=i.Deno,l=o&&o.versions||h&&h.version,d=l&&l.v8;d&&(n=(a=d.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!n&&s&&(!(a=s.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=s.match(/Chrome\/(\d+)/))&&(n=+a[1]),t.exports=n},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/object-get-own-property-descriptor").f,i=e("../internals/create-non-enumerable-property"),s=e("../internals/define-built-in"),o=e("../internals/define-global-property"),h=e("../internals/copy-constructor-properties"),l=e("../internals/is-forced");t.exports=function(e,t){var r,d,c,u,f,p=e.target,y=e.global,m=e.stat;if(r=y?a:m?a[p]||o(p,{}):(a[p]||{}).prototype)for(d in t){if(u=t[d],c=e.dontCallGetSet?(f=n(r,d))&&f.value:r[d],!l(y?d:p+(m?".":"#")+d,e.forced)&&void 0!==c){if(typeof u==typeof c)continue;h(u,c)}(e.sham||c&&c.sham)&&i(u,"sham",!0),s(r,d,u,e)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],261:[function(e,t,r){var a=e("../internals/function-bind-native"),n=Function.prototype,i=n.apply,s=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(a?s.bind(i):function(){return s.apply(i,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,t,r){var a=e("../internals/function-uncurry-this-clause"),n=e("../internals/a-callable"),i=e("../internals/function-bind-native"),s=a(a.bind);t.exports=function(e,t){return n(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,t,r){var a=e("../internals/fails");t.exports=!a(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},{"../internals/fails":260}],264:[function(e,t,r){var a=e("../internals/function-bind-native"),n=Function.prototype.call;t.exports=a?n.bind(n):function(){return n.apply(n,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/has-own-property"),i=Function.prototype,s=a&&Object.getOwnPropertyDescriptor,o=n(i,"name"),h=o&&"something"===function(){}.name,l=o&&(!a||a&&s(i,"name").configurable);t.exports={EXISTS:o,PROPER:h,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/a-callable");t.exports=function(e,t,r){try{return a(n(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,t,r){var a=e("../internals/classof-raw"),n=e("../internals/function-uncurry-this");t.exports=function(e){if("Function"===a(e))return n(e)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,t,r){var a=e("../internals/function-bind-native"),n=Function.prototype,i=n.call,s=a&&n.bind.bind(i,i);t.exports=a?s:function(e){return function(){return i.apply(e,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/is-callable"),i=function(e){return n(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?i(a[e]):a[e]&&a[e][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,t,r){var a=e("../internals/classof"),n=e("../internals/get-method"),i=e("../internals/is-null-or-undefined"),s=e("../internals/iterators"),o=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(!i(e))return n(e,o)||n(e,"@@iterator")||s[a(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,t,r){var a=e("../internals/function-call"),n=e("../internals/a-callable"),i=e("../internals/an-object"),s=e("../internals/try-to-string"),o=e("../internals/get-iterator-method"),h=TypeError;t.exports=function(e,t){var r=arguments.length<2?o(e):t;if(n(r))return i(a(r,e));throw new h(s(e)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/is-array"),i=e("../internals/is-callable"),s=e("../internals/classof-raw"),o=e("../internals/to-string"),h=a([].push);t.exports=function(e){if(i(e))return e;if(n(e)){for(var t=e.length,r=[],a=0;a<t;a++){var l=e[a];"string"==typeof l?h(r,l):"number"!=typeof l&&"Number"!==s(l)&&"String"!==s(l)||h(r,o(l))}var d=r.length,c=!0;return function(e,t){if(c)return c=!1,t;if(n(this))return t;for(var a=0;a<d;a++)if(r[a]===e)return t}}}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268,"../internals/is-array":284,"../internals/is-callable":285,"../internals/to-string":348}],273:[function(e,t,r){var a=e("../internals/a-callable"),n=e("../internals/is-null-or-undefined");t.exports=function(e,t){var r=e[t];return n(r)?void 0:a(r)}},{"../internals/a-callable":222,"../internals/is-null-or-undefined":288}],274:[function(e,t,r){(function(e){(function(){var r=function(e){return e&&e.Math===Math&&e};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||this||Function("return this")()}).call(this)}).call(this,void 0!==y?y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],275:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/to-object"),i=a({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(n(e),t)}},{"../internals/function-uncurry-this":268,"../internals/to-object":344}],276:[function(e,t,r){t.exports={}},{}],277:[function(e,t,r){t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},{}],278:[function(e,t,r){var a=e("../internals/get-built-in");t.exports=a("document","documentElement")},{"../internals/get-built-in":269}],279:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/fails"),i=e("../internals/document-create-element");t.exports=!a&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},{"../internals/descriptors":247,"../internals/document-create-element":249,"../internals/fails":260}],280:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/fails"),i=e("../internals/classof-raw"),s=Object,o=a("".split);t.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?o(e,""):s(e)}:s},{"../internals/classof-raw":235,"../internals/fails":260,"../internals/function-uncurry-this":268}],281:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/is-callable"),i=e("../internals/shared-store"),s=a(Function.toString);n(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),t.exports=i.inspectSource},{"../internals/function-uncurry-this":268,"../internals/is-callable":285,"../internals/shared-store":333}],282:[function(e,t,r){var a,n,i,s=e("../internals/weak-map-basic-detection"),o=e("../internals/global"),h=e("../internals/is-object"),l=e("../internals/create-non-enumerable-property"),d=e("../internals/has-own-property"),c=e("../internals/shared-store"),u=e("../internals/shared-key"),f=e("../internals/hidden-keys"),p=o.TypeError,y=o.WeakMap;if(s||c.state){var m=c.state||(c.state=new y);m.get=m.get,m.has=m.has,m.set=m.set,a=function(e,t){if(m.has(e))throw new p("Object already initialized");return t.facade=e,m.set(e,t),t},n=function(e){return m.get(e)||{}},i=function(e){return m.has(e)}}else{var g=u("state");f[g]=!0,a=function(e,t){if(d(e,g))throw new p("Object already initialized");return t.facade=e,l(e,g,t),t},n=function(e){return d(e,g)?e[g]:{}},i=function(e){return d(e,g)}}t.exports={set:a,get:n,has:i,enforce:function(e){return i(e)?n(e):a(e,{})},getterFor:function(e){return function(t){var r;if(!h(t)||(r=n(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return r}}}},{"../internals/create-non-enumerable-property":241,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/is-object":289,"../internals/shared-key":332,"../internals/shared-store":333,"../internals/weak-map-basic-detection":354}],283:[function(e,t,r){var a=e("../internals/well-known-symbol"),n=e("../internals/iterators"),i=a("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},{"../internals/iterators":298,"../internals/well-known-symbol":357}],284:[function(e,t,r){var a=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"===a(e)}},{"../internals/classof-raw":235}],285:[function(e,t,r){var a=e("../internals/document-all"),n=a.all;t.exports=a.IS_HTMLDDA?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}},{"../internals/document-all":248}],286:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/fails"),i=e("../internals/is-callable"),s=e("../internals/classof"),o=e("../internals/get-built-in"),h=e("../internals/inspect-source"),l=function(){},d=[],c=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,f=a(u.exec),p=!u.test(l),y=function(e){if(!i(e))return!1;try{return c(l,d,e),!0}catch(e){return!1}},m=function(e){if(!i(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(u,h(e))}catch(e){return!0}};m.sham=!0,t.exports=!c||n(function(){var e;return y(y.call)||!y(Object)||!y(function(){e=!0})||e})?m:y},{"../internals/classof":236,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/inspect-source":281,"../internals/is-callable":285}],287:[function(e,t,r){var a=e("../internals/fails"),n=e("../internals/is-callable"),i=/#|\.prototype\./,s=function(e,t){var r=h[o(e)];return r===d||r!==l&&(n(t)?a(t):!!t)},o=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},h=s.data={},l=s.NATIVE="N",d=s.POLYFILL="P";t.exports=s},{"../internals/fails":260,"../internals/is-callable":285}],288:[function(e,t,r){t.exports=function(e){return null==e}},{}],289:[function(e,t,r){var a=e("../internals/is-callable"),n=e("../internals/document-all"),i=n.all;t.exports=n.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:a(e)||e===i}:function(e){return"object"==typeof e?null!==e:a(e)}},{"../internals/document-all":248,"../internals/is-callable":285}],290:[function(e,t,r){t.exports=!1},{}],291:[function(e,t,r){var a=e("../internals/is-object"),n=e("../internals/classof-raw"),i=e("../internals/well-known-symbol")("match");t.exports=function(e){var t;return a(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===n(e))}},{"../internals/classof-raw":235,"../internals/is-object":289,"../internals/well-known-symbol":357}],292:[function(e,t,r){var a=e("../internals/get-built-in"),n=e("../internals/is-callable"),i=e("../internals/object-is-prototype-of"),s=e("../internals/use-symbol-as-uid"),o=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return n(t)&&i(t.prototype,o(e))}},{"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/object-is-prototype-of":314,"../internals/use-symbol-as-uid":351}],293:[function(e,t,r){var a=e("../internals/function-bind-context"),n=e("../internals/function-call"),i=e("../internals/an-object"),s=e("../internals/try-to-string"),o=e("../internals/is-array-iterator-method"),h=e("../internals/length-of-array-like"),l=e("../internals/object-is-prototype-of"),d=e("../internals/get-iterator"),c=e("../internals/get-iterator-method"),u=e("../internals/iterator-close"),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},y=p.prototype;t.exports=function(e,t,r){var m,g,b,k,v,w,x,M=r&&r.that,_=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_RECORD),j=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),A=a(t,M),T=function(e){return m&&u(m,"normal",e),new p(!0,e)},E=function(e){return _?(i(e),C?A(e[0],e[1],T):A(e[0],e[1])):C?A(e,T):A(e)};if(S)m=e.iterator;else if(j)m=e;else{if(!(g=c(e)))throw new f(s(e)+" is not iterable");if(o(g)){for(b=0,k=h(e);k>b;b++)if((v=E(e[b]))&&l(y,v))return v;return new p(!1)}m=d(e,g)}for(w=S?e.next:m.next;!(x=n(w,m)).done;){try{v=E(x.value)}catch(e){u(m,"throw",e)}if("object"==typeof v&&v&&l(y,v))return v}return new p(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,t,r){var a=e("../internals/function-call"),n=e("../internals/an-object"),i=e("../internals/get-method");t.exports=function(e,t,r){var s,o;n(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw r;return r}s=a(s,e)}catch(e){o=!0,s=e}if("throw"===t)throw r;if(o)throw s;return n(s),r}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,t,r){var a=e("../internals/iterators-core").IteratorPrototype,n=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),s=e("../internals/set-to-string-tag"),o=e("../internals/iterators"),h=function(){return this};t.exports=function(e,t,r,l){var d=t+" Iterator";return e.prototype=n(a,{next:i(+!l,r)}),s(e,d,!1,!0),o[d]=h,e}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-call"),i=e("../internals/is-pure"),s=e("../internals/function-name"),o=e("../internals/is-callable"),h=e("../internals/iterator-create-constructor"),l=e("../internals/object-get-prototype-of"),d=e("../internals/object-set-prototype-of"),c=e("../internals/set-to-string-tag"),u=e("../internals/create-non-enumerable-property"),f=e("../internals/define-built-in"),p=e("../internals/well-known-symbol"),y=e("../internals/iterators"),m=e("../internals/iterators-core"),g=s.PROPER,b=s.CONFIGURABLE,k=m.IteratorPrototype,v=m.BUGGY_SAFARI_ITERATORS,w=p("iterator"),x=function(){return this};t.exports=function(e,t,r,s,p,m,M){h(r,t,s);var _,S,j,C=function(e){if(e===p&&z)return z;if(!v&&e&&e in E)return E[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},A=t+" Iterator",T=!1,E=e.prototype,N=E[w]||E["@@iterator"]||p&&E[p],z=!v&&N||C(p),R="Array"===t&&E.entries||N;if(R&&(_=l(R.call(new e)))!==Object.prototype&&_.next&&(i||l(_)===k||(d?d(_,k):o(_[w])||f(_,w,x)),c(_,A,!0,!0),i&&(y[A]=x)),g&&"values"===p&&N&&"values"!==N.name&&(!i&&b?u(E,"name","values"):(T=!0,z=function(){return n(N,this)})),p)if(S={values:C("values"),keys:m?z:C("keys"),entries:C("entries")},M)for(j in S)(v||T||!(j in E))&&f(E,j,S[j]);else a({target:t,proto:!0,forced:v||T},S);return i&&!M||E[w]===z||f(E,w,z,{name:p}),y[t]=z,S}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,t,r){var a,n,i,s=e("../internals/fails"),o=e("../internals/is-callable"),h=e("../internals/is-object"),l=e("../internals/object-create"),d=e("../internals/object-get-prototype-of"),c=e("../internals/define-built-in"),u=e("../internals/well-known-symbol"),f=e("../internals/is-pure"),p=u("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(n=d(d(i)))!==Object.prototype&&(a=n):y=!0),!h(a)||s(function(){var e={};return a[p].call(e)!==e})?a={}:f&&(a=l(a)),o(a[p])||c(a,p,function(){return this}),t.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:y}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,t,r){arguments[4][276][0].apply(r,arguments)},{dup:276}],299:[function(e,t,r){var a=e("../internals/to-length");t.exports=function(e){return a(e.length)}},{"../internals/to-length":343}],300:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/fails"),i=e("../internals/is-callable"),s=e("../internals/has-own-property"),o=e("../internals/descriptors"),h=e("../internals/function-name").CONFIGURABLE,l=e("../internals/inspect-source"),d=e("../internals/internal-state"),c=d.enforce,u=d.get,f=String,p=Object.defineProperty,y=a("".slice),m=a("".replace),g=a([].join),b=o&&!n(function(){return 8!==p(function(){},"length",{value:8}).length}),k=String(String).split("String"),v=t.exports=function(e,t,r){"Symbol("===y(f(t),0,7)&&(t="["+m(f(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||h&&e.name!==t)&&(o?p(e,"name",{value:t,configurable:!0}):e.name=t),b&&r&&s(r,"arity")&&e.length!==r.arity&&p(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?o&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=c(e);return s(a,"source")||(a.source=g(k,"string"==typeof t?t:"")),e};Function.prototype.toString=v(function(){return i(this)&&u(this).source||l(this)},"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,t,r){var a=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?n:a)(t)}},{}],302:[function(e,t,r){var a,n,i,s,o,h=e("../internals/global"),l=e("../internals/function-bind-context"),d=e("../internals/object-get-own-property-descriptor").f,c=e("../internals/task").set,u=e("../internals/queue"),f=e("../internals/engine-is-ios"),p=e("../internals/engine-is-ios-pebble"),y=e("../internals/engine-is-webos-webkit"),m=e("../internals/engine-is-node"),g=h.MutationObserver||h.WebKitMutationObserver,b=h.document,k=h.process,v=h.Promise,w=d(h,"queueMicrotask"),x=w&&w.value;if(!x){var M=new u,_=function(){var e,t;for(m&&(e=k.domain)&&e.exit();t=M.get();)try{t()}catch(e){throw M.head&&a(),e}e&&e.enter()};f||m||y||!g||!b?!p&&v&&v.resolve?((s=v.resolve(void 0)).constructor=v,o=l(s.then,s),a=function(){o(_)}):m?a=function(){k.nextTick(_)}:(c=l(c,h),a=function(){c(_)}):(n=!0,i=b.createTextNode(""),new g(_).observe(i,{characterData:!0}),a=function(){i.data=n=!n}),x=function(e){M.head||a(),M.add(e)}}t.exports=x},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,t,r){var a=e("../internals/a-callable"),n=TypeError,i=function(e){var t,r;this.promise=new e(function(e,a){if(void 0!==t||void 0!==r)throw new n("Bad Promise constructor");t=e,r=a}),this.resolve=a(t),this.reject=a(r)};t.exports.f=function(e){return new i(e)}},{"../internals/a-callable":222}],304:[function(e,t,r){var a=e("../internals/is-regexp"),n=TypeError;t.exports=function(e){if(a(e))throw new n("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":291}],305:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/function-uncurry-this"),i=e("../internals/function-call"),s=e("../internals/fails"),o=e("../internals/object-keys"),h=e("../internals/object-get-own-property-symbols"),l=e("../internals/object-property-is-enumerable"),d=e("../internals/to-object"),c=e("../internals/indexed-object"),u=Object.assign,f=Object.defineProperty,p=n([].concat);t.exports=!u||s(function(){if(a&&1!==u({b:1},u(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection");return e[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!==u({},e)[r]||"abcdefghijklmnopqrst"!==o(u({},t)).join("")})?function(e,t){for(var r=d(e),n=arguments.length,s=1,u=h.f,f=l.f;n>s;)for(var y,m=c(arguments[s++]),g=u?p(o(m),u(m)):o(m),b=g.length,k=0;b>k;)y=g[k++],a&&!i(f,m,y)||(r[y]=m[y]);return r}:u},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,t,r){var a,n=e("../internals/an-object"),i=e("../internals/object-define-properties"),s=e("../internals/enum-bug-keys"),o=e("../internals/hidden-keys"),h=e("../internals/html"),l=e("../internals/document-create-element"),d=e("../internals/shared-key")("IE_PROTO"),c=function(){},u=function(e){return"<script>"+e+"<\/script>"},f=function(e){e.write(u("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}var e,t;p="undefined"!=typeof document?document.domain&&a?f(a):((t=l("iframe")).style.display="none",h.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(u("document.F=Object")),e.close(),e.F):f(a);for(var r=s.length;r--;)delete p.prototype[s[r]];return p()};o[d]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(c.prototype=n(e),r=new c,c.prototype=null,r[d]=e):r=p(),void 0===t?r:i.f(r,t)}},{"../internals/an-object":227,"../internals/document-create-element":249,"../internals/enum-bug-keys":258,"../internals/hidden-keys":276,"../internals/html":278,"../internals/object-define-properties":307,"../internals/shared-key":332}],307:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/v8-prototype-define-bug"),i=e("../internals/object-define-property"),s=e("../internals/an-object"),o=e("../internals/to-indexed-object"),h=e("../internals/object-keys");r.f=a&&!n?Object.defineProperties:function(e,t){s(e);for(var r,a=o(t),n=h(t),l=n.length,d=0;l>d;)i.f(e,r=n[d++],a[r]);return e}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/object-define-property":308,"../internals/object-keys":316,"../internals/to-indexed-object":341,"../internals/v8-prototype-define-bug":352}],308:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/ie8-dom-define"),i=e("../internals/v8-prototype-define-bug"),s=e("../internals/an-object"),o=e("../internals/to-property-key"),h=TypeError,l=Object.defineProperty,d=Object.getOwnPropertyDescriptor;r.f=a?i?function(e,t,r){if(s(e),t=o(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var a=d(e,t);a&&a.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:a.configurable,enumerable:"enumerable"in r?r.enumerable:a.enumerable,writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(s(e),t=o(t),s(r),n)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new h("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/ie8-dom-define":279,"../internals/to-property-key":346,"../internals/v8-prototype-define-bug":352}],309:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/function-call"),i=e("../internals/object-property-is-enumerable"),s=e("../internals/create-property-descriptor"),o=e("../internals/to-indexed-object"),h=e("../internals/to-property-key"),l=e("../internals/has-own-property"),d=e("../internals/ie8-dom-define"),c=Object.getOwnPropertyDescriptor;r.f=a?c:function(e,t){if(e=o(e),t=h(t),d)try{return c(e,t)}catch(e){}if(l(e,t))return s(!n(i.f,e,t),e[t])}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/function-call":264,"../internals/has-own-property":275,"../internals/ie8-dom-define":279,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341,"../internals/to-property-key":346}],310:[function(e,t,r){var a=e("../internals/classof-raw"),n=e("../internals/to-indexed-object"),i=e("../internals/object-get-own-property-names").f,s=e("../internals/array-slice-simple"),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){return o&&"Window"===a(e)?function(e){try{return i(e)}catch(e){return s(o)}}(e):i(n(e))}},{"../internals/array-slice-simple":230,"../internals/classof-raw":235,"../internals/object-get-own-property-names":311,"../internals/to-indexed-object":341}],311:[function(e,t,r){var a=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return a(e,n)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],312:[function(e,t,r){r.f=Object.getOwnPropertySymbols},{}],313:[function(e,t,r){var a=e("../internals/has-own-property"),n=e("../internals/is-callable"),i=e("../internals/to-object"),s=e("../internals/shared-key"),o=e("../internals/correct-prototype-getter"),h=s("IE_PROTO"),l=Object,d=l.prototype;t.exports=o?l.getPrototypeOf:function(e){var t=i(e);if(a(t,h))return t[h];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof l?d:null}},{"../internals/correct-prototype-getter":239,"../internals/has-own-property":275,"../internals/is-callable":285,"../internals/shared-key":332,"../internals/to-object":344}],314:[function(e,t,r){var a=e("../internals/function-uncurry-this");t.exports=a({}.isPrototypeOf)},{"../internals/function-uncurry-this":268}],315:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=e("../internals/has-own-property"),i=e("../internals/to-indexed-object"),s=e("../internals/array-includes").indexOf,o=e("../internals/hidden-keys"),h=a([].push);t.exports=function(e,t){var r,a=i(e),l=0,d=[];for(r in a)!n(o,r)&&n(a,r)&&h(d,r);for(;t.length>l;)n(a,r=t[l++])&&(~s(d,r)||h(d,r));return d}},{"../internals/array-includes":228,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/to-indexed-object":341}],316:[function(e,t,r){var a=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return a(e,n)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],317:[function(e,t,r){var a={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!a.call({1:2},1);r.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:a},{}],318:[function(e,t,r){var a=e("../internals/function-uncurry-this-accessor"),n=e("../internals/an-object"),i=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=a(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,a){return n(r),i(a),t?e(r,a):r.__proto__=a,r}}():void 0)},{"../internals/a-possible-prototype":224,"../internals/an-object":227,"../internals/function-uncurry-this-accessor":266}],319:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/fails"),i=e("../internals/function-uncurry-this"),s=e("../internals/object-get-prototype-of"),o=e("../internals/object-keys"),h=e("../internals/to-indexed-object"),l=i(e("../internals/object-property-is-enumerable").f),d=i([].push),c=a&&n(function(){var e=Object.create(null);return e[2]=2,!l(e,2)}),u=function(e){return function(t){for(var r,n=h(t),i=o(n),u=c&&null===s(n),f=i.length,p=0,y=[];f>p;)r=i[p++],a&&!(u?r in n:l(n,r))||d(y,e?[r,n[r]]:n[r]);return y}};t.exports={entries:u(!0),values:u(!1)}},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/object-get-prototype-of":313,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341}],320:[function(e,t,r){var a=e("../internals/function-call"),n=e("../internals/is-callable"),i=e("../internals/is-object"),s=TypeError;t.exports=function(e,t){var r,o;if("string"===t&&n(r=e.toString)&&!i(o=a(r,e)))return o;if(n(r=e.valueOf)&&!i(o=a(r,e)))return o;if("string"!==t&&n(r=e.toString)&&!i(o=a(r,e)))return o;throw new s("Can't convert object to primitive value")}},{"../internals/function-call":264,"../internals/is-callable":285,"../internals/is-object":289}],321:[function(e,t,r){var a=e("../internals/get-built-in"),n=e("../internals/function-uncurry-this"),i=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),o=e("../internals/an-object"),h=n([].concat);t.exports=a("Reflect","ownKeys")||function(e){var t=i.f(o(e)),r=s.f;return r?h(t,r(e)):t}},{"../internals/an-object":227,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-symbols":312}],322:[function(e,t,r){var a=e("../internals/global");t.exports=a},{"../internals/global":274}],323:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],324:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/promise-native-constructor"),i=e("../internals/is-callable"),s=e("../internals/is-forced"),o=e("../internals/inspect-source"),h=e("../internals/well-known-symbol"),l=e("../internals/engine-is-browser"),d=e("../internals/engine-is-deno"),c=e("../internals/is-pure"),u=e("../internals/engine-v8-version"),f=n&&n.prototype,p=h("species"),y=!1,m=i(a.PromiseRejectionEvent),g=s("Promise",function(){var e=o(n),t=e!==String(n);if(!t&&66===u)return!0;if(c&&(!f.catch||!f.finally))return!0;if(!u||u<51||!/native code/.test(e)){var r=new n(function(e){e(1)}),a=function(e){e(function(){},function(){})};if((r.constructor={})[p]=a,!(y=r.then(function(){})instanceof a))return!0}return!t&&(l||d)&&!m});t.exports={CONSTRUCTOR:g,REJECTION_EVENT:m,SUBCLASSING:y}},{"../internals/engine-is-browser":250,"../internals/engine-is-deno":251,"../internals/engine-v8-version":257,"../internals/global":274,"../internals/inspect-source":281,"../internals/is-callable":285,"../internals/is-forced":287,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/well-known-symbol":357}],325:[function(e,t,r){var a=e("../internals/global");t.exports=a.Promise},{"../internals/global":274}],326:[function(e,t,r){var a=e("../internals/an-object"),n=e("../internals/is-object"),i=e("../internals/new-promise-capability");t.exports=function(e,t){if(a(e),n(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},{"../internals/an-object":227,"../internals/is-object":289,"../internals/new-promise-capability":303}],327:[function(e,t,r){var a=e("../internals/promise-native-constructor"),n=e("../internals/check-correctness-of-iteration"),i=e("../internals/promise-constructor-detection").CONSTRUCTOR;t.exports=i||!n(function(e){a.all(e).then(void 0,function(){})})},{"../internals/check-correctness-of-iteration":234,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],328:[function(e,t,r){var a=function(){this.head=null,this.tail=null};a.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=a},{}],329:[function(e,t,r){var a=e("../internals/is-null-or-undefined"),n=TypeError;t.exports=function(e){if(a(e))throw new n("Can't call method on "+e);return e}},{"../internals/is-null-or-undefined":288}],330:[function(e,t,r){var a=e("../internals/get-built-in"),n=e("../internals/define-built-in-accessor"),i=e("../internals/well-known-symbol"),s=e("../internals/descriptors"),o=i("species");t.exports=function(e){var t=a(e);s&&t&&!t[o]&&n(t,o,{configurable:!0,get:function(){return this}})}},{"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],331:[function(e,t,r){var a=e("../internals/object-define-property").f,n=e("../internals/has-own-property"),i=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!n(e,i)&&a(e,i,{configurable:!0,value:t})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],332:[function(e,t,r){var a=e("../internals/shared"),n=e("../internals/uid"),i=a("keys");t.exports=function(e){return i[e]||(i[e]=n(e))}},{"../internals/shared":334,"../internals/uid":350}],333:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/define-global-property"),i=a["__core-js_shared__"]||n("__core-js_shared__",{});t.exports=i},{"../internals/define-global-property":246,"../internals/global":274}],334:[function(e,t,r){var a=e("../internals/is-pure"),n=e("../internals/shared-store");(t.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:a?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":290,"../internals/shared-store":333}],335:[function(e,t,r){var a=e("../internals/an-object"),n=e("../internals/a-constructor"),i=e("../internals/is-null-or-undefined"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var r,o=a(e).constructor;return void 0===o||i(r=a(o)[s])?t:n(r)}},{"../internals/a-constructor":223,"../internals/an-object":227,"../internals/is-null-or-undefined":288,"../internals/well-known-symbol":357}],336:[function(e,t,r){var a=e("../internals/engine-v8-version"),n=e("../internals/fails"),i=e("../internals/global").String;t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41})},{"../internals/engine-v8-version":257,"../internals/fails":260,"../internals/global":274}],337:[function(e,t,r){var a=e("../internals/function-call"),n=e("../internals/get-built-in"),i=e("../internals/well-known-symbol"),s=e("../internals/define-built-in");t.exports=function(){var e=n("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,o=i("toPrimitive");t&&!t[o]&&s(t,o,function(e){return a(r,this)},{arity:1})}},{"../internals/define-built-in":245,"../internals/function-call":264,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],338:[function(e,t,r){var a=e("../internals/symbol-constructor-detection");t.exports=a&&!!Symbol.for&&!!Symbol.keyFor},{"../internals/symbol-constructor-detection":336}],339:[function(e,t,r){var a,n,i,s,o=e("../internals/global"),h=e("../internals/function-apply"),l=e("../internals/function-bind-context"),d=e("../internals/is-callable"),c=e("../internals/has-own-property"),u=e("../internals/fails"),f=e("../internals/html"),p=e("../internals/array-slice"),y=e("../internals/document-create-element"),m=e("../internals/validate-arguments-length"),g=e("../internals/engine-is-ios"),b=e("../internals/engine-is-node"),k=o.setImmediate,v=o.clearImmediate,w=o.process,x=o.Dispatch,M=o.Function,_=o.MessageChannel,S=o.String,j=0,C={};u(function(){a=o.location});var A=function(e){if(c(C,e)){var t=C[e];delete C[e],t()}},T=function(e){return function(){A(e)}},E=function(e){A(e.data)},N=function(e){o.postMessage(S(e),a.protocol+"//"+a.host)};k&&v||(k=function(e){m(arguments.length,1);var t=d(e)?e:M(e),r=p(arguments,1);return C[++j]=function(){h(t,void 0,r)},n(j),j},v=function(e){delete C[e]},b?n=function(e){w.nextTick(T(e))}:x&&x.now?n=function(e){x.now(T(e))}:_&&!g?(s=(i=new _).port2,i.port1.onmessage=E,n=l(s.postMessage,s)):o.addEventListener&&d(o.postMessage)&&!o.importScripts&&a&&"file:"!==a.protocol&&!u(N)?(n=N,o.addEventListener("message",E,!1)):n="onreadystatechange"in y("script")?function(e){f.appendChild(y("script")).onreadystatechange=function(){f.removeChild(this),A(e)}}:function(e){setTimeout(T(e),0)}),t.exports={set:k,clear:v}},{"../internals/array-slice":231,"../internals/document-create-element":249,"../internals/engine-is-ios":253,"../internals/engine-is-node":254,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-bind-context":262,"../internals/global":274,"../internals/has-own-property":275,"../internals/html":278,"../internals/is-callable":285,"../internals/validate-arguments-length":353}],340:[function(e,t,r){var a=e("../internals/to-integer-or-infinity"),n=Math.max,i=Math.min;t.exports=function(e,t){var r=a(e);return r<0?n(r+t,0):i(r,t)}},{"../internals/to-integer-or-infinity":342}],341:[function(e,t,r){var a=e("../internals/indexed-object"),n=e("../internals/require-object-coercible");t.exports=function(e){return a(n(e))}},{"../internals/indexed-object":280,"../internals/require-object-coercible":329}],342:[function(e,t,r){var a=e("../internals/math-trunc");t.exports=function(e){var t=+e;return t!=t||0===t?0:a(t)}},{"../internals/math-trunc":301}],343:[function(e,t,r){var a=e("../internals/to-integer-or-infinity"),n=Math.min;t.exports=function(e){return e>0?n(a(e),9007199254740991):0}},{"../internals/to-integer-or-infinity":342}],344:[function(e,t,r){var a=e("../internals/require-object-coercible"),n=Object;t.exports=function(e){return n(a(e))}},{"../internals/require-object-coercible":329}],345:[function(e,t,r){var a=e("../internals/function-call"),n=e("../internals/is-object"),i=e("../internals/is-symbol"),s=e("../internals/get-method"),o=e("../internals/ordinary-to-primitive"),h=e("../internals/well-known-symbol"),l=TypeError,d=h("toPrimitive");t.exports=function(e,t){if(!n(e)||i(e))return e;var r,h=s(e,d);if(h){if(void 0===t&&(t="default"),r=a(h,e,t),!n(r)||i(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},{"../internals/function-call":264,"../internals/get-method":273,"../internals/is-object":289,"../internals/is-symbol":292,"../internals/ordinary-to-primitive":320,"../internals/well-known-symbol":357}],346:[function(e,t,r){var a=e("../internals/to-primitive"),n=e("../internals/is-symbol");t.exports=function(e){var t=a(e,"string");return n(t)?t:t+""}},{"../internals/is-symbol":292,"../internals/to-primitive":345}],347:[function(e,t,r){var a={};a[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(a)},{"../internals/well-known-symbol":357}],348:[function(e,t,r){var a=e("../internals/classof"),n=String;t.exports=function(e){if("Symbol"===a(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},{"../internals/classof":236}],349:[function(e,t,r){var a=String;t.exports=function(e){try{return a(e)}catch(e){return"Object"}}},{}],350:[function(e,t,r){var a=e("../internals/function-uncurry-this"),n=0,i=Math.random(),s=a(1..toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+i,36)}},{"../internals/function-uncurry-this":268}],351:[function(e,t,r){var a=e("../internals/symbol-constructor-detection");t.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":336}],352:[function(e,t,r){var a=e("../internals/descriptors"),n=e("../internals/fails");t.exports=a&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},{"../internals/descriptors":247,"../internals/fails":260}],353:[function(e,t,r){var a=TypeError;t.exports=function(e,t){if(e<t)throw new a("Not enough arguments");return e}},{}],354:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/is-callable"),i=a.WeakMap;t.exports=n(i)&&/native code/.test(String(i))},{"../internals/global":274,"../internals/is-callable":285}],355:[function(e,t,r){var a=e("../internals/path"),n=e("../internals/has-own-property"),i=e("../internals/well-known-symbol-wrapped"),s=e("../internals/object-define-property").f;t.exports=function(e){var t=a.Symbol||(a.Symbol={});n(t,e)||s(t,e,{value:i.f(e)})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/path":322,"../internals/well-known-symbol-wrapped":356}],356:[function(e,t,r){var a=e("../internals/well-known-symbol");r.f=a},{"../internals/well-known-symbol":357}],357:[function(e,t,r){var a=e("../internals/global"),n=e("../internals/shared"),i=e("../internals/has-own-property"),s=e("../internals/uid"),o=e("../internals/symbol-constructor-detection"),h=e("../internals/use-symbol-as-uid"),l=a.Symbol,d=n("wks"),c=h?l.for||l:l&&l.withoutSetter||s;t.exports=function(e){return i(d,e)||(d[e]=o&&i(l,e)?l[e]:c("Symbol."+e)),d[e]}},{"../internals/global":274,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-constructor-detection":336,"../internals/uid":350,"../internals/use-symbol-as-uid":351}],358:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/array-iteration").findIndex,i=e("../internals/add-to-unscopables"),s=!0;"findIndex"in[]&&Array(1).findIndex(function(){s=!1}),a({target:"Array",proto:!0,forced:s},{findIndex:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findIndex")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],359:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/array-iteration").find,i=e("../internals/add-to-unscopables"),s=!0;"find"in[]&&Array(1).find(function(){s=!1}),a({target:"Array",proto:!0,forced:s},{find:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),i("find")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],360:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/array-includes").includes,i=e("../internals/fails"),s=e("../internals/add-to-unscopables");a({target:"Array",proto:!0,forced:i(function(){return!Array(1).includes()})},{includes:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),s("includes")},{"../internals/add-to-unscopables":225,"../internals/array-includes":228,"../internals/export":259,"../internals/fails":260}],361:[function(e,t,r){var a=e("../internals/to-indexed-object"),n=e("../internals/add-to-unscopables"),i=e("../internals/iterators"),s=e("../internals/internal-state"),o=e("../internals/object-define-property").f,h=e("../internals/iterator-define"),l=e("../internals/create-iter-result-object"),d=e("../internals/is-pure"),c=e("../internals/descriptors"),u=s.set,f=s.getterFor("Array Iterator");t.exports=h(Array,"Array",function(e,t){u(this,{type:"Array Iterator",target:a(e),index:0,kind:t})},function(){var e=f(this),t=e.target,r=e.kind,a=e.index++;if(!t||a>=t.length)return e.target=void 0,l(void 0,!0);switch(r){case"keys":return l(a,!1);case"values":return l(t[a],!1)}return l([a,t[a]],!1)},"values");var p=i.Arguments=i.Array;if(n("keys"),n("values"),n("entries"),!d&&c&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}},{"../internals/add-to-unscopables":225,"../internals/create-iter-result-object":240,"../internals/descriptors":247,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/iterator-define":296,"../internals/iterators":298,"../internals/object-define-property":308,"../internals/to-indexed-object":341}],362:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/get-built-in"),i=e("../internals/function-apply"),s=e("../internals/function-call"),o=e("../internals/function-uncurry-this"),h=e("../internals/fails"),l=e("../internals/is-callable"),d=e("../internals/is-symbol"),c=e("../internals/array-slice"),u=e("../internals/get-json-replacer-function"),f=e("../internals/symbol-constructor-detection"),p=String,y=n("JSON","stringify"),m=o(/./.exec),g=o("".charAt),b=o("".charCodeAt),k=o("".replace),v=o(1..toString),w=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,M=/^[\uDC00-\uDFFF]$/,_=!f||h(function(){var e=n("Symbol")("stringify detection");return"[null]"!==y([e])||"{}"!==y({a:e})||"{}"!==y(Object(e))}),S=h(function(){return'"\\udf06\\ud834"'!==y("\udf06\ud834")||'"\\udead"'!==y("\udead")}),j=function(e,t){var r=c(arguments),a=u(t);if(l(a)||void 0!==e&&!d(e))return r[1]=function(e,t){if(l(a)&&(t=s(a,this,p(e),t)),!d(t))return t},i(y,null,r)},C=function(e,t,r){var a=g(r,t-1),n=g(r,t+1);return m(x,e)&&!m(M,n)||m(M,e)&&!m(x,a)?"\\u"+v(b(e,0),16):e};y&&a({target:"JSON",stat:!0,arity:3,forced:_||S},{stringify:function(e,t,r){var a=c(arguments),n=i(_?j:y,null,a);return S&&"string"==typeof n?k(n,w,C):n}})},{"../internals/array-slice":231,"../internals/export":259,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/get-json-replacer-function":272,"../internals/is-callable":285,"../internals/is-symbol":292,"../internals/symbol-constructor-detection":336}],363:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},{"../internals/export":259}],364:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/object-assign");a({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},{"../internals/export":259,"../internals/object-assign":305}],365:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/symbol-constructor-detection"),i=e("../internals/fails"),s=e("../internals/object-get-own-property-symbols"),o=e("../internals/to-object");a({target:"Object",stat:!0,forced:!n||i(function(){s.f(1)})},{getOwnPropertySymbols:function(e){var t=s.f;return t?t(o(e)):[]}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-get-own-property-symbols":312,"../internals/symbol-constructor-detection":336,"../internals/to-object":344}],366:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/to-object"),i=e("../internals/object-keys");a({target:"Object",stat:!0,forced:e("../internals/fails")(function(){i(1)})},{keys:function(e){return i(n(e))}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-keys":316,"../internals/to-object":344}],367:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/object-to-array").values;a({target:"Object",stat:!0},{values:function(e){return n(e)}})},{"../internals/export":259,"../internals/object-to-array":319}],368:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-call"),i=e("../internals/a-callable"),s=e("../internals/new-promise-capability"),o=e("../internals/perform"),h=e("../internals/iterate");a({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{all:function(e){var t=this,r=s.f(t),a=r.resolve,l=r.reject,d=o(function(){var r=i(t.resolve),s=[],o=0,d=1;h(e,function(e){var i=o++,h=!1;d++,n(r,t,e).then(function(e){h||(h=!0,s[i]=e,--d||a(s))},l)}),--d||a(s)});return d.error&&l(d.value),r.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],369:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/is-pure"),i=e("../internals/promise-constructor-detection").CONSTRUCTOR,s=e("../internals/promise-native-constructor"),o=e("../internals/get-built-in"),h=e("../internals/is-callable"),l=e("../internals/define-built-in"),d=s&&s.prototype;if(a({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!n&&h(s)){var c=o("Promise").prototype.catch;d.catch!==c&&l(d,"catch",c,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],370:[function(e,t,r){var a,n,i,s=e("../internals/export"),o=e("../internals/is-pure"),h=e("../internals/engine-is-node"),l=e("../internals/global"),d=e("../internals/function-call"),c=e("../internals/define-built-in"),u=e("../internals/object-set-prototype-of"),f=e("../internals/set-to-string-tag"),p=e("../internals/set-species"),y=e("../internals/a-callable"),m=e("../internals/is-callable"),g=e("../internals/is-object"),b=e("../internals/an-instance"),k=e("../internals/species-constructor"),v=e("../internals/task").set,w=e("../internals/microtask"),x=e("../internals/host-report-errors"),M=e("../internals/perform"),_=e("../internals/queue"),S=e("../internals/internal-state"),j=e("../internals/promise-native-constructor"),C=e("../internals/promise-constructor-detection"),A=e("../internals/new-promise-capability"),T=C.CONSTRUCTOR,E=C.REJECTION_EVENT,N=C.SUBCLASSING,z=S.getterFor("Promise"),R=S.set,O=j&&j.prototype,P=j,L=O,I=l.TypeError,q=l.document,D=l.process,H=A.f,F=H,B=!!(q&&q.createEvent&&l.dispatchEvent),V=function(e){var t;return!(!g(e)||!m(t=e.then))&&t},U=function(e,t){var r,a,n,i=t.value,s=1===t.state,o=s?e.ok:e.fail,h=e.resolve,l=e.reject,c=e.domain;try{o?(s||(2===t.rejection&&K(t),t.rejection=1),!0===o?r=i:(c&&c.enter(),r=o(i),c&&(c.exit(),n=!0)),r===e.promise?l(new I("Promise-chain cycle")):(a=V(r))?d(a,r,h,l):h(r)):l(i)}catch(e){c&&!n&&c.exit(),l(e)}},$=function(e,t){e.notified||(e.notified=!0,w(function(){for(var r,a=e.reactions;r=a.get();)U(r,e);e.notified=!1,t&&!e.rejection&&Z(e)}))},W=function(e,t,r){var a,n;B?((a=q.createEvent("Event")).promise=t,a.reason=r,a.initEvent(e,!1,!0),l.dispatchEvent(a)):a={promise:t,reason:r},!E&&(n=l["on"+e])?n(a):"unhandledrejection"===e&&x("Unhandled promise rejection",r)},Z=function(e){d(v,l,function(){var t,r=e.facade,a=e.value;if(X(e)&&(t=M(function(){h?D.emit("unhandledRejection",a,r):W("unhandledrejection",r,a)}),e.rejection=h||X(e)?2:1,t.error))throw t.value})},X=function(e){return 1!==e.rejection&&!e.parent},K=function(e){d(v,l,function(){var t=e.facade;h?D.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)})},G=function(e,t,r){return function(a){e(t,a,r)}},Y=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,$(e,!0))},J=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new I("Promise can't be resolved itself");var a=V(t);a?w(function(){var r={done:!1};try{d(a,t,G(J,r,e),G(Y,r,e))}catch(t){Y(r,t,e)}}):(e.value=t,e.state=1,$(e,!1))}catch(t){Y({done:!1},t,e)}}};if(T&&(L=(P=function(e){b(this,L),y(e),d(a,this);var t=z(this);try{e(G(J,t),G(Y,t))}catch(e){Y(t,e)}}).prototype,(a=function(e){R(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new _,rejection:!1,state:0,value:void 0})}).prototype=c(L,"then",function(e,t){var r=z(this),a=H(k(this,P));return r.parent=!0,a.ok=!m(e)||e,a.fail=m(t)&&t,a.domain=h?D.domain:void 0,0===r.state?r.reactions.add(a):w(function(){U(a,r)}),a.promise}),n=function(){var e=new a,t=z(e);this.promise=e,this.resolve=G(J,t),this.reject=G(Y,t)},A.f=H=function(e){return e===P||void 0===e?new n(e):F(e)},!o&&m(j)&&O!==Object.prototype)){i=O.then,N||c(O,"then",function(e,t){var r=this;return new P(function(e,t){d(i,r,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}u&&u(O,L)}s({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:P}),f(P,"Promise",!1,!0),p("Promise")},{"../internals/a-callable":222,"../internals/an-instance":226,"../internals/define-built-in":245,"../internals/engine-is-node":254,"../internals/export":259,"../internals/function-call":264,"../internals/global":274,"../internals/host-report-errors":277,"../internals/internal-state":282,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/microtask":302,"../internals/new-promise-capability":303,"../internals/object-set-prototype-of":318,"../internals/perform":323,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/queue":328,"../internals/set-species":330,"../internals/set-to-string-tag":331,"../internals/species-constructor":335,"../internals/task":339}],371:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/is-pure"),i=e("../internals/promise-native-constructor"),s=e("../internals/fails"),o=e("../internals/get-built-in"),h=e("../internals/is-callable"),l=e("../internals/species-constructor"),d=e("../internals/promise-resolve"),c=e("../internals/define-built-in"),u=i&&i.prototype;if(a({target:"Promise",proto:!0,real:!0,forced:!!i&&s(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=l(this,o("Promise")),r=h(e);return this.then(r?function(r){return d(t,e()).then(function(){return r})}:e,r?function(r){return d(t,e()).then(function(){throw r})}:e)}}),!n&&h(i)){var f=o("Promise").prototype.finally;u.finally!==f&&c(u,"finally",f,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/fails":260,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326,"../internals/species-constructor":335}],372:[function(e,t,r){e("../modules/es.promise.constructor"),e("../modules/es.promise.all"),e("../modules/es.promise.catch"),e("../modules/es.promise.race"),e("../modules/es.promise.reject"),e("../modules/es.promise.resolve")},{"../modules/es.promise.all":368,"../modules/es.promise.catch":369,"../modules/es.promise.constructor":370,"../modules/es.promise.race":373,"../modules/es.promise.reject":374,"../modules/es.promise.resolve":375}],373:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-call"),i=e("../internals/a-callable"),s=e("../internals/new-promise-capability"),o=e("../internals/perform"),h=e("../internals/iterate");a({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{race:function(e){var t=this,r=s.f(t),a=r.reject,l=o(function(){var s=i(t.resolve);h(e,function(e){n(s,t,e).then(r.resolve,a)})});return l.error&&a(l.value),r.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],374:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-call"),i=e("../internals/new-promise-capability");a({target:"Promise",stat:!0,forced:e("../internals/promise-constructor-detection").CONSTRUCTOR},{reject:function(e){var t=i.f(this);return n(t.reject,void 0,e),t.promise}})},{"../internals/export":259,"../internals/function-call":264,"../internals/new-promise-capability":303,"../internals/promise-constructor-detection":324}],375:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/get-built-in"),i=e("../internals/is-pure"),s=e("../internals/promise-native-constructor"),o=e("../internals/promise-constructor-detection").CONSTRUCTOR,h=e("../internals/promise-resolve"),l=n("Promise"),d=i&&!o;a({target:"Promise",stat:!0,forced:i||o},{resolve:function(e){return h(d&&this===l?s:this,e)}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326}],376:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-uncurry-this"),i=e("../internals/to-absolute-index"),s=RangeError,o=String.fromCharCode,h=String.fromCodePoint,l=n([].join);a({target:"String",stat:!0,arity:1,forced:!!h&&1!==h.length},{fromCodePoint:function(e){for(var t,r=[],a=arguments.length,n=0;a>n;){if(t=+arguments[n++],i(t,1114111)!==t)throw new s(t+" is not a valid code point");r[n]=t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320)}return l(r,"")}})},{"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/to-absolute-index":340}],377:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/function-uncurry-this"),i=e("../internals/not-a-regexp"),s=e("../internals/require-object-coercible"),o=e("../internals/to-string"),h=e("../internals/correct-is-regexp-logic"),l=n("".indexOf);a({target:"String",proto:!0,forced:!h("includes")},{includes:function(e){return!!~l(o(s(this)),o(i(e)),arguments.length>1?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":238,"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/not-a-regexp":304,"../internals/require-object-coercible":329,"../internals/to-string":348}],378:[function(e,t,r){e("../internals/well-known-symbol-define")("asyncIterator")},{"../internals/well-known-symbol-define":355}],379:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/global"),i=e("../internals/function-call"),s=e("../internals/function-uncurry-this"),o=e("../internals/is-pure"),h=e("../internals/descriptors"),l=e("../internals/symbol-constructor-detection"),d=e("../internals/fails"),c=e("../internals/has-own-property"),u=e("../internals/object-is-prototype-of"),f=e("../internals/an-object"),p=e("../internals/to-indexed-object"),y=e("../internals/to-property-key"),m=e("../internals/to-string"),g=e("../internals/create-property-descriptor"),b=e("../internals/object-create"),k=e("../internals/object-keys"),v=e("../internals/object-get-own-property-names"),w=e("../internals/object-get-own-property-names-external"),x=e("../internals/object-get-own-property-symbols"),M=e("../internals/object-get-own-property-descriptor"),_=e("../internals/object-define-property"),S=e("../internals/object-define-properties"),j=e("../internals/object-property-is-enumerable"),C=e("../internals/define-built-in"),A=e("../internals/define-built-in-accessor"),T=e("../internals/shared"),E=e("../internals/shared-key"),N=e("../internals/hidden-keys"),z=e("../internals/uid"),R=e("../internals/well-known-symbol"),O=e("../internals/well-known-symbol-wrapped"),P=e("../internals/well-known-symbol-define"),L=e("../internals/symbol-define-to-primitive"),I=e("../internals/set-to-string-tag"),q=e("../internals/internal-state"),D=e("../internals/array-iteration").forEach,H=E("hidden"),F=q.set,B=q.getterFor("Symbol"),V=Object.prototype,U=n.Symbol,$=U&&U.prototype,W=n.RangeError,Z=n.TypeError,X=n.QObject,K=M.f,G=_.f,Y=w.f,J=j.f,Q=s([].push),ee=T("symbols"),te=T("op-symbols"),re=T("wks"),ae=!X||!X.prototype||!X.prototype.findChild,ne=function(e,t,r){var a=K(V,t);a&&delete V[t],G(e,t,r),a&&e!==V&&G(V,t,a)},ie=h&&d(function(){return 7!==b(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a})?ne:G,se=function(e,t){var r=ee[e]=b($);return F(r,{type:"Symbol",tag:e,description:t}),h||(r.description=t),r},oe=function(e,t,r){e===V&&oe(te,t,r),f(e);var a=y(t);return f(r),c(ee,a)?(r.enumerable?(c(e,H)&&e[H][a]&&(e[H][a]=!1),r=b(r,{enumerable:g(0,!1)})):(c(e,H)||G(e,H,g(1,{})),e[H][a]=!0),ie(e,a,r)):G(e,a,r)},he=function(e,t){f(e);var r=p(t),a=k(r).concat(ue(r));return D(a,function(t){h&&!i(le,r,t)||oe(e,t,r[t])}),e},le=function(e){var t=y(e),r=i(J,this,t);return!(this===V&&c(ee,t)&&!c(te,t))&&(!(r||!c(this,t)||!c(ee,t)||c(this,H)&&this[H][t])||r)},de=function(e,t){var r=p(e),a=y(t);if(r!==V||!c(ee,a)||c(te,a)){var n=K(r,a);return!n||!c(ee,a)||c(r,H)&&r[H][a]||(n.enumerable=!0),n}},ce=function(e){var t=Y(p(e)),r=[];return D(t,function(e){c(ee,e)||c(N,e)||Q(r,e)}),r},ue=function(e){var t=e===V,r=Y(t?te:p(e)),a=[];return D(r,function(e){!c(ee,e)||t&&!c(V,e)||Q(a,ee[e])}),a};l||(C($=(U=function(){if(u($,this))throw new Z("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,t=z(e),r=function(e){this===V&&i(r,te,e),c(this,H)&&c(this[H],t)&&(this[H][t]=!1);var a=g(1,e);try{ie(this,t,a)}catch(e){if(!(e instanceof W))throw e;ne(this,t,a)}};return h&&ae&&ie(V,t,{configurable:!0,set:r}),se(t,e)}).prototype,"toString",function(){return B(this).tag}),C(U,"withoutSetter",function(e){return se(z(e),e)}),j.f=le,_.f=oe,S.f=he,M.f=de,v.f=w.f=ce,x.f=ue,O.f=function(e){return se(R(e),e)},h&&(A($,"description",{configurable:!0,get:function(){return B(this).description}}),o||C(V,"propertyIsEnumerable",le,{unsafe:!0}))),a({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:U}),D(k(re),function(e){P(e)}),a({target:"Symbol",stat:!0,forced:!l},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),a({target:"Object",stat:!0,forced:!l,sham:!h},{create:function(e,t){return void 0===t?b(e):he(b(e),t)},defineProperty:oe,defineProperties:he,getOwnPropertyDescriptor:de}),a({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ce}),L(),I(U,"Symbol"),N[H]=!0},{"../internals/an-object":227,"../internals/array-iteration":229,"../internals/create-property-descriptor":242,"../internals/define-built-in":245,"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/export":259,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-define-properties":307,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-names-external":310,"../internals/object-get-own-property-symbols":312,"../internals/object-is-prototype-of":314,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/set-to-string-tag":331,"../internals/shared":334,"../internals/shared-key":332,"../internals/symbol-constructor-detection":336,"../internals/symbol-define-to-primitive":337,"../internals/to-indexed-object":341,"../internals/to-property-key":346,"../internals/to-string":348,"../internals/uid":350,"../internals/well-known-symbol":357,"../internals/well-known-symbol-define":355,"../internals/well-known-symbol-wrapped":356}],380:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/get-built-in"),i=e("../internals/has-own-property"),s=e("../internals/to-string"),o=e("../internals/shared"),h=e("../internals/symbol-registry-detection"),l=o("string-to-symbol-registry"),d=o("symbol-to-string-registry");a({target:"Symbol",stat:!0,forced:!h},{for:function(e){var t=s(e);if(i(l,t))return l[t];var r=n("Symbol")(t);return l[t]=r,d[r]=t,r}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/to-string":348}],381:[function(e,t,r){e("../modules/es.symbol.constructor"),e("../modules/es.symbol.for"),e("../modules/es.symbol.key-for"),e("../modules/es.json.stringify"),e("../modules/es.object.get-own-property-symbols")},{"../modules/es.json.stringify":362,"../modules/es.object.get-own-property-symbols":365,"../modules/es.symbol.constructor":379,"../modules/es.symbol.for":380,"../modules/es.symbol.key-for":382}],382:[function(e,t,r){var a=e("../internals/export"),n=e("../internals/has-own-property"),i=e("../internals/is-symbol"),s=e("../internals/try-to-string"),o=e("../internals/shared"),h=e("../internals/symbol-registry-detection"),l=o("symbol-to-string-registry");a({target:"Symbol",stat:!0,forced:!h},{keyFor:function(e){if(!i(e))throw new TypeError(s(e)+" is not a symbol");if(n(l,e))return l[e]}})},{"../internals/export":259,"../internals/has-own-property":275,"../internals/is-symbol":292,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/try-to-string":349}],383:[function(e,t,r){function a(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===a(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===a(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===a(e)},r.isError=function(e){return"[object Error]"===a(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("buffer").Buffer.isBuffer},{buffer:220}],384:[function(e,t,r){(function(r){(function(){var a=e("elliptic"),n=e("bn.js");t.exports=function(e){return new s(e)};var i={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=i[e],this.curveType||(this.curveType={name:e}),this.curve=new a.ec(this.curveType.name),this.keys=void 0}function o(e,t,a){Array.isArray(e)||(e=e.toArray());var n=new r(e);if(a&&n.length<a){var i=new r(a-n.length);i.fill(0),n=r.concat([i,n])}return t?n.toString(t):n}i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1,s.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},s.prototype.computeSecret=function(e,t,a){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),o(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),a,this.curveType.byteLength)},s.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),o(r,e)},s.prototype.getPrivateKey=function(e){return o(this.keys.getPrivate(),e)},s.prototype.setPublicKey=function(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this.keys._importPublic(e),this},s.prototype.setPrivateKey=function(e,t){t=t||"utf8",r.isBuffer(e)||(e=new r(e,t));var a=new n(e);return a=a.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(a),this}}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":385,buffer:220,elliptic:405}],385:[function(e,t,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],386:[function(e,t,r){var a=e("inherits"),n=e("md5.js"),i=e("ripemd160"),s=e("sha.js"),o=e("cipher-base");function h(e){o.call(this,"digest"),this._hash=e}a(h,o),h.prototype._update=function(e){this._hash.update(e)},h.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new i:new h(s(e))}},{"cipher-base":221,inherits:440,"md5.js":450,ripemd160:493,"sha.js":498}],387:[function(e,t,r){var a=e("md5.js");t.exports=function(e){return(new a).update(e).digest()}},{"md5.js":450}],388:[function(e,t,r){var a=e("inherits"),n=e("./legacy"),i=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),h=e("ripemd160"),l=e("sha.js"),d=s.alloc(128);function c(e,t){i.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new h:l(e)).update(t).digest():t.length<r&&(t=s.concat([t,d],r));for(var a=this._ipad=s.allocUnsafe(r),n=this._opad=s.allocUnsafe(r),o=0;o<r;o++)a[o]=54^t[o],n[o]=92^t[o];this._hash="rmd160"===e?new h:l(e),this._hash.update(a)}a(c,i),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new h:l(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new c("rmd160",t):"md5"===e?new n(o,t):new c(e,t)}},{"./legacy":389,"cipher-base":221,"create-hash/md5":387,inherits:440,ripemd160:493,"safe-buffer":494,"sha.js":498}],389:[function(e,t,r){var a=e("inherits"),n=e("safe-buffer").Buffer,i=e("cipher-base"),s=n.alloc(128);function o(e,t){i.call(this,"digest"),"string"==typeof t&&(t=n.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=n.concat([t,s],64));for(var r=this._ipad=n.allocUnsafe(64),a=this._opad=n.allocUnsafe(64),o=0;o<64;o++)r[o]=54^t[o],a[o]=92^t[o];this._hash=[r]}a(o,i),o.prototype._update=function(e){this._hash.push(e)},o.prototype._final=function(){var e=this._alg(n.concat(this._hash));return this._alg(n.concat([this._opad,e]))},t.exports=o},{"cipher-base":221,inherits:440,"safe-buffer":494}],390:[function(e,t,r){r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var a=e("browserify-sign/algos"),n=Object.keys(a),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);r.getHashes=function(){return i};var s=e("pbkdf2");r.pbkdf2=s.pbkdf2,r.pbkdf2Sync=s.pbkdf2Sync;var o=e("browserify-cipher");r.Cipher=o.Cipher,r.createCipher=o.createCipher,r.Cipheriv=o.Cipheriv,r.createCipheriv=o.createCipheriv,r.Decipher=o.Decipher,r.createDecipher=o.createDecipher,r.Decipheriv=o.Decipheriv,r.createDecipheriv=o.createDecipheriv,r.getCiphers=o.getCiphers,r.listCiphers=o.listCiphers;var h=e("diffie-hellman");r.DiffieHellmanGroup=h.DiffieHellmanGroup,r.createDiffieHellmanGroup=h.createDiffieHellmanGroup,r.getDiffieHellman=h.getDiffieHellman,r.createDiffieHellman=h.createDiffieHellman,r.DiffieHellman=h.DiffieHellman;var l=e("browserify-sign");r.createSign=l.createSign,r.Sign=l.Sign,r.createVerify=l.createVerify,r.Verify=l.Verify,r.createECDH=e("create-ecdh");var d=e("public-encrypt");r.publicEncrypt=d.publicEncrypt,r.privateEncrypt=d.privateEncrypt,r.publicDecrypt=d.publicDecrypt,r.privateDecrypt=d.privateDecrypt;var c=e("randomfill");r.randomFill=c.randomFill,r.randomFillSync=c.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":206,"browserify-sign":213,"browserify-sign/algos":210,"create-ecdh":384,"create-hash":386,"create-hmac":388,"diffie-hellman":400,pbkdf2:460,"public-encrypt":468,randombytes:475,randomfill:476}],391:[function(e,t,r){!function(e,a){"object"==typeof r&&void 0!==t?t.exports=a():(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs=a()}(void 0,function(){var e=6e4,t=36e5,r="millisecond",a="second",n="minute",i="hour",s="day",o="week",h="month",l="quarter",d="year",c="date",u="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},m=function(e,t,r){var a=String(e);return!a||a.length>=t?e:""+Array(t+1-a.length).join(r)+e},g={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),a=Math.floor(r/60),n=r%60;return(t<=0?"+":"-")+m(a,2,"0")+":"+m(n,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var a=12*(r.year()-t.year())+(r.month()-t.month()),n=t.clone().add(a,h),i=r-n<0,s=t.clone().add(a+(i?-1:1),h);return+(-(a+(r-n)/(i?n-s:s-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:h,y:d,w:o,d:s,D:c,h:i,m:n,s:a,ms:r,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",k={};k[b]=y;var v="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[v])},x=function e(t,r,a){var n;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();k[i]&&(n=i),r&&(k[i]=r,n=i);var s=t.split("-");if(!n&&s.length>1)return e(s[0])}else{var o=t.name;k[o]=t,n=o}return!a&&n&&(b=n),n||!a&&b},M=function(e,t){if(w(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new S(r)},_=g;_.l=x,_.i=w,_.w=function(e,t){return M(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function y(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[v]=!0}var m=y.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var a=t.match(f);if(a){var n=a[2]-1||0,i=(a[7]||"0").substring(0,3);return r?new Date(Date.UTC(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)):new Date(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return _},m.isValid=function(){return!(this.$d.toString()===u)},m.isSame=function(e,t){var r=M(e);return this.startOf(t)<=r&&r<=this.endOf(t)},m.isAfter=function(e,t){return M(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<M(e)},m.$g=function(e,t,r){return _.u(e)?this[t]:this.set(r,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var r=this,l=!!_.u(t)||t,u=_.p(e),f=function(e,t){var a=_.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return l?a:a.endOf(s)},p=function(e,t){return _.w(r.toDate()[e].apply(r.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},y=this.$W,m=this.$M,g=this.$D,b="set"+(this.$u?"UTC":"");switch(u){case d:return l?f(1,0):f(31,11);case h:return l?f(1,m):f(0,m+1);case o:var k=this.$locale().weekStart||0,v=(y<k?y+7:y)-k;return f(l?g-v:g+(6-v),m);case s:case c:return p(b+"Hours",0);case i:return p(b+"Minutes",1);case n:return p(b+"Seconds",2);case a:return p(b+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var o,l=_.p(e),u="set"+(this.$u?"UTC":""),f=(o={},o[s]=u+"Date",o[c]=u+"Date",o[h]=u+"Month",o[d]=u+"FullYear",o[i]=u+"Hours",o[n]=u+"Minutes",o[a]=u+"Seconds",o[r]=u+"Milliseconds",o)[l],p=l===s?this.$D+(t-this.$W):t;if(l===h||l===d){var y=this.clone().set(c,1);y.$d[f](p),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[_.p(e)]()},m.add=function(r,l){var c,u=this;r=Number(r);var f=_.p(l),p=function(e){var t=M(u);return _.w(t.date(t.date()+Math.round(e*r)),u)};if(f===h)return this.set(h,this.$M+r);if(f===d)return this.set(d,this.$y+r);if(f===s)return p(1);if(f===o)return p(7);var y=(c={},c[n]=e,c[i]=t,c[a]=1e3,c)[f]||1,m=this.$d.getTime()+r*y;return _.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||u;var a=e||"YYYY-MM-DDTHH:mm:ssZ",n=_.z(this),i=this.$H,s=this.$m,o=this.$M,h=r.weekdays,l=r.months,d=r.meridiem,c=function(e,r,n,i){return e&&(e[r]||e(t,a))||n[r].slice(0,i)},f=function(e){return _.s(i%12||12,e,"0")},y=d||function(e,t,r){var a=e<12?"AM":"PM";return r?a.toLowerCase():a};return a.replace(p,function(e,a){return a||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return _.s(t.$y,4,"0");case"M":return o+1;case"MM":return _.s(o+1,2,"0");case"MMM":return c(r.monthsShort,o,l,3);case"MMMM":return c(l,o);case"D":return t.$D;case"DD":return _.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return c(r.weekdaysMin,t.$W,h,2);case"ddd":return c(r.weekdaysShort,t.$W,h,3);case"dddd":return h[t.$W];case"H":return String(i);case"HH":return _.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return y(i,s,!0);case"A":return y(i,s,!1);case"m":return String(s);case"mm":return _.s(s,2,"0");case"s":return String(t.$s);case"ss":return _.s(t.$s,2,"0");case"SSS":return _.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")})},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,c,u){var f,p=this,y=_.p(c),m=M(r),g=(m.utcOffset()-this.utcOffset())*e,b=this-m,k=function(){return _.m(p,m)};switch(y){case d:f=k()/12;break;case h:f=k();break;case l:f=k()/3;break;case o:f=(b-g)/6048e5;break;case s:f=(b-g)/864e5;break;case i:f=b/t;break;case n:f=b/e;break;case a:f=b/1e3;break;default:f=b}return u?f:_.a(f)},m.daysInMonth=function(){return this.endOf(h).$D},m.$locale=function(){return k[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),a=x(e,t,!0);return a&&(r.$L=a),r},m.clone=function(){return _.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},y}(),j=S.prototype;return M.prototype=j,[["$ms",r],["$s",a],["$m",n],["$H",i],["$W",s],["$M",h],["$y",d],["$D",c]].forEach(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),M.extend=function(e,t){return e.$i||(e(t,S,M),e.$i=!0),M},M.locale=x,M.isDayjs=w,M.unix=function(e){return M(1e3*e)},M.en=k[b],M.Ls=k,M.p={},M})},{}],392:[function(e,t,r){!function(e,a){"object"==typeof r&&void 0!==t?t.exports=a():(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=a()}(void 0,function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,a=/\d\d?/,n=/\d*[^-_:/,()\s\d]+/,i={},s=function(e){return(e=+e)+(e>68?1900:2e3)},o=function(e){return function(t){this[e]=+t}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],l=function(e){var t=i[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var r,a=i.meridiem;if(a){for(var n=1;n<=24;n+=1)if(e.indexOf(a(n,0,t))>-1){r=n>12;break}}else r=e===(t?"pm":"PM");return r},c={A:[n,function(e){this.afternoon=d(e,!1)}],a:[n,function(e){this.afternoon=d(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[a,o("seconds")],ss:[a,o("seconds")],m:[a,o("minutes")],mm:[a,o("minutes")],H:[a,o("hours")],h:[a,o("hours")],HH:[a,o("hours")],hh:[a,o("hours")],D:[a,o("day")],DD:[r,o("day")],Do:[n,function(e){var t=i.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var a=1;a<=31;a+=1)t(a).replace(/\[|\]/g,"")===e&&(this.day=a)}],M:[a,o("month")],MM:[r,o("month")],MMM:[n,function(e){var t=l("months"),r=(l("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[n,function(e){var t=l("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,o("year")],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,o("year")],Z:h,ZZ:h};function u(r){var a,n;a=r,n=i&&i.formats;for(var s=(r=a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,r,a){var i=a&&a.toUpperCase();return r||n[a]||e[a]||n[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,r){return t||r.slice(1)})})).match(t),o=s.length,h=0;h<o;h+=1){var l=s[h],d=c[l],u=d&&d[0],f=d&&d[1];s[h]=f?{regex:u,parser:f}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,a=0;r<o;r+=1){var n=s[r];if("string"==typeof n)a+=n.length;else{var i=n.regex,h=n.parser,l=e.slice(a),d=i.exec(l)[0];h.call(t,d),e=e.replace(d,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var a=t.prototype,n=a.parse;a.parse=function(e){var t=e.date,a=e.utc,s=e.args;this.$u=a;var o=s[1];if("string"==typeof o){var h=!0===s[2],l=!0===s[3],d=h||l,c=s[2];l&&(c=s[2]),i=this.$locale(),!h&&c&&(i=r.Ls[c]),this.$d=function(e,t,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var a=u(t)(e),n=a.year,i=a.month,s=a.day,o=a.hours,h=a.minutes,l=a.seconds,d=a.milliseconds,c=a.zone,f=new Date,p=s||(n||i?1:f.getDate()),y=n||f.getFullYear(),m=0;n&&!i||(m=i>0?i-1:f.getMonth());var g=o||0,b=h||0,k=l||0,v=d||0;return c?new Date(Date.UTC(y,m,p,g,b,k,v+60*c.offset*1e3)):r?new Date(Date.UTC(y,m,p,g,b,k,v)):new Date(y,m,p,g,b,k,v)}catch(e){return new Date("")}}(t,o,a),this.init(),c&&!0!==c&&(this.$L=this.locale(c).$L),d&&t!=this.format(o)&&(this.$d=new Date("")),i={}}else if(o instanceof Array)for(var f=o.length,p=1;p<=f;p+=1){s[1]=o[p-1];var y=r.apply(this,s);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}p===f&&(this.$d=new Date(""))}else n.call(this,e)}}})},{}],393:[function(e,t,r){!function(e,a){"object"==typeof r&&void 0!==t?t.exports=a():(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_utc=a()}(void 0,function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(a,n,i){var s=n.prototype;i.utc=function(e){return new n({date:e,utc:!0,args:arguments})},s.utc=function(t){var r=i(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var o=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var h=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else h.call(this)};var l=s.utcOffset;s.utcOffset=function(a,n){var i=this.$utils().u;if(i(a))return this.$u?0:i(this.$offset)?l.call(this):this.$offset;if("string"==typeof a&&null===(a=function(e){void 0===e&&(e="");var a=e.match(t);if(!a)return null;var n=(""+a[0]).match(r)||["-",0,0],i=n[0],s=60*+n[1]+ +n[2];return 0===s?0:"+"===i?s:-s}(a)))return this;var s=Math.abs(a)<=16?60*a:a,o=this;if(n)return o.$offset=s,o.$u=0===a,o;if(0!==a){var h=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(s+h,e)).$offset=s,o.$x.$localOffset=h}else o=this.utc();return o};var d=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var c=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=s.diff;s.diff=function(e,t,r){if(e&&this.$u===e.$u)return u.call(this,e,t,r);var a=this.local(),n=i(e).local();return u.call(a,n,t,r)}}})},{}],394:[function(e,t,r){r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":395,"./des/cipher":396,"./des/des":397,"./des/ede":398,"./des/utils":399}],395:[function(e,t,r){var a=e("minimalistic-assert"),n=e("inherits"),i={};function s(e){a.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}n(t,e);for(var r=Object.keys(i),a=0;a<r.length;a++){var s=r[a];t.prototype[s]=i[s]}return t.create=function(e){return new t(e)},t},i._cbcInit=function(){var e=new s(this.options.iv);this._cbcState=e},i._update=function(e,t,r,a){var n=this._cbcState,i=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var o=0;o<this.blockSize;o++)s[o]^=e[t+o];for(i._update.call(this,s,0,r,a),o=0;o<this.blockSize;o++)s[o]=r[a+o]}else{for(i._update.call(this,e,t,r,a),o=0;o<this.blockSize;o++)r[a+o]^=s[o];for(o=0;o<this.blockSize;o++)s[o]=e[t+o]}}},{inherits:440,"minimalistic-assert":453}],396:[function(e,t,r){var a=e("minimalistic-assert");function n(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}t.exports=n,n.prototype._init=function(){},n.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),a=0;a<r;a++)this.buffer[this.bufferOff+a]=e[t+a];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(e){var t=0,r=0,a=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(a*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var i=e.length-(e.length-t)%this.blockSize;t<i;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},n.prototype._updateDecrypt=function(e){for(var t=0,r=0,a=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(a*this.blockSize);a>0;a--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},n.prototype._unpad=function(e){return e},n.prototype._finalDecrypt=function(){a.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":453}],397:[function(e,t,r){var a=e("minimalistic-assert"),n=e("inherits"),i=e("./utils"),s=e("./cipher");function o(){this.tmp=new Array(2),this.keys=null}function h(e){s.call(this,e);var t=new o;this._desState=t,this.deriveKeys(t,e.key)}n(h,s),t.exports=h,h.create=function(e){return new h(e)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];h.prototype.deriveKeys=function(e,t){e.keys=new Array(32),a.equal(t.length,this.blockSize,"Invalid key length");var r=i.readUInt32BE(t,0),n=i.readUInt32BE(t,4);i.pc1(r,n,e.tmp,0),r=e.tmp[0],n=e.tmp[1];for(var s=0;s<e.keys.length;s+=2){var o=l[s>>>1];r=i.r28shl(r,o),n=i.r28shl(n,o),i.pc2(r,n,e.keys,s)}},h.prototype._update=function(e,t,r,a){var n=this._desState,s=i.readUInt32BE(e,t),o=i.readUInt32BE(e,t+4);i.ip(s,o,n.tmp,0),s=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,s,o,n.tmp,0):this._decrypt(n,s,o,n.tmp,0),s=n.tmp[0],o=n.tmp[1],i.writeUInt32BE(r,s,a),i.writeUInt32BE(r,o,a+4)},h.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var r=e.length-t,a=t;a<e.length;a++)e[a]=r;return!0},h.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)a.equal(e[r],t);return e.slice(0,e.length-t)},h.prototype._encrypt=function(e,t,r,a,n){for(var s=t,o=r,h=0;h<e.keys.length;h+=2){var l=e.keys[h],d=e.keys[h+1];i.expand(o,e.tmp,0),l^=e.tmp[0],d^=e.tmp[1];var c=i.substitute(l,d),u=o;o=(s^i.permute(c))>>>0,s=u}i.rip(o,s,a,n)},h.prototype._decrypt=function(e,t,r,a,n){for(var s=r,o=t,h=e.keys.length-2;h>=0;h-=2){var l=e.keys[h],d=e.keys[h+1];i.expand(s,e.tmp,0),l^=e.tmp[0],d^=e.tmp[1];var c=i.substitute(l,d),u=s;s=(o^i.permute(c))>>>0,o=u}i.rip(s,o,a,n)}},{"./cipher":396,"./utils":399,inherits:440,"minimalistic-assert":453}],398:[function(e,t,r){var a=e("minimalistic-assert"),n=e("inherits"),i=e("./cipher"),s=e("./des");function o(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),n=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i})]:[s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n}),s.create({type:"decrypt",key:r})]}function h(e){i.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}n(h,i),t.exports=h,h.create=function(e){return new h(e)},h.prototype._update=function(e,t,r,a){var n=this._edeState;n.ciphers[0]._update(e,t,r,a),n.ciphers[1]._update(r,a,r,a),n.ciphers[2]._update(r,a,r,a)},h.prototype._pad=s.prototype._pad,h.prototype._unpad=s.prototype._unpad},{"./cipher":396,"./des":397,inherits:440,"minimalistic-assert":453}],399:[function(e,t,r){r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,a){for(var n=0,i=0,s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8)n<<=1,n|=t>>>o+s&1;for(o=0;o<=24;o+=8)n<<=1,n|=e>>>o+s&1}for(s=6;s>=0;s-=2){for(o=1;o<=25;o+=8)i<<=1,i|=t>>>o+s&1;for(o=1;o<=25;o+=8)i<<=1,i|=e>>>o+s&1}r[a+0]=n>>>0,r[a+1]=i>>>0},r.rip=function(e,t,r,a){for(var n=0,i=0,s=0;s<4;s++)for(var o=24;o>=0;o-=8)n<<=1,n|=t>>>o+s&1,n<<=1,n|=e>>>o+s&1;for(s=4;s<8;s++)for(o=24;o>=0;o-=8)i<<=1,i|=t>>>o+s&1,i<<=1,i|=e>>>o+s&1;r[a+0]=n>>>0,r[a+1]=i>>>0},r.pc1=function(e,t,r,a){for(var n=0,i=0,s=7;s>=5;s--){for(var o=0;o<=24;o+=8)n<<=1,n|=t>>o+s&1;for(o=0;o<=24;o+=8)n<<=1,n|=e>>o+s&1}for(o=0;o<=24;o+=8)n<<=1,n|=t>>o+s&1;for(s=1;s<=3;s++){for(o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>o+s&1}for(o=0;o<=24;o+=8)i<<=1,i|=e>>o+s&1;r[a+0]=n>>>0,r[a+1]=i>>>0},r.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,n){for(var i=0,s=0,o=a.length>>>1,h=0;h<o;h++)i<<=1,i|=e>>>a[h]&1;for(h=o;h<a.length;h++)s<<=1,s|=t>>>a[h]&1;r[n+0]=i>>>0,r[n+1]=s>>>0},r.expand=function(e,t,r){var a=0,n=0;a=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)a<<=6,a|=e>>>i&63;for(i=11;i>=3;i-=4)n|=e>>>i&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=a>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,a=0;a<4;a++)r<<=4,r|=n[64*a+(e>>>18-6*a&63)];for(a=0;a<4;a++)r<<=4,r|=n[256+64*a+(t>>>18-6*a&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r<i.length;r++)t<<=1,t|=e>>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var a=e.toString(2);a.length<t;)a="0"+a;for(var n=[],i=0;i<t;i+=r)n.push(a.slice(i,i+r));return n.join(" ")}},{}],400:[function(e,t,r){(function(t){(function(){var a=e("./lib/generatePrime"),n=e("./lib/primes.json"),i=e("./lib/dh"),s={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(e){var r=new t(n[e].prime,"hex"),a=new t(n[e].gen,"hex");return new i(r,a)},r.createDiffieHellman=r.DiffieHellman=function e(r,n,o,h){return t.isBuffer(n)||void 0===s[n]?e(r,"binary",n,o):(n=n||"binary",h=h||"binary",o=o||new t([2]),t.isBuffer(o)||(o=new t(o,h)),"number"==typeof r?new i(a(r,o),o,!0):(t.isBuffer(r)||(r=new t(r,n)),new i(r,o,!0)))}}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/dh":401,"./lib/generatePrime":402,"./lib/primes.json":403,buffer:220}],401:[function(e,t,r){(function(r){(function(){var a=e("bn.js"),n=new(e("miller-rabin")),i=new a(24),s=new a(11),o=new a(10),h=new a(3),l=new a(7),d=e("./generatePrime"),c=e("randombytes");function u(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._pub=new a(e),this}function f(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._priv=new a(e),this}t.exports=y;var p={};function y(e,t,r){this.setGenerator(t),this.__prime=new a(e),this._prime=a.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=u,this.setPrivateKey=f):this._primeCode=8}function m(e,t){var a=new r(e.toArray());return t?a.toString(t):a}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),a=[r,e.toString(16)].join("_");if(a in p)return p[a];var c,u=0;if(e.isEven()||!d.simpleSieve||!d.fermatTest(e)||!n.test(e))return u+=1,u+="02"===r||"05"===r?8:4,p[a]=u,u;switch(n.test(e.shrn(1))||(u+=2),r){case"02":e.mod(i).cmp(s)&&(u+=8);break;case"05":(c=e.mod(o)).cmp(h)&&c.cmp(l)&&(u+=8);break;default:u+=4}return p[a]=u,u}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new a(c(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(e){var t=(e=(e=new a(e)).toRed(this._prime)).redPow(this._priv).fromRed(),n=new r(t.toArray()),i=this.getPrime();if(n.length<i.length){var s=new r(i.length-n.length);s.fill(0),n=r.concat([s,n])}return n},y.prototype.getPublicKey=function(e){return m(this._pub,e)},y.prototype.getPrivateKey=function(e){return m(this._priv,e)},y.prototype.getPrime=function(e){return m(this.__prime,e)},y.prototype.getGenerator=function(e){return m(this._gen,e)},y.prototype.setGenerator=function(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this.__gen=e,this._gen=new a(e),this}}).call(this)}).call(this,e("buffer").Buffer)},{"./generatePrime":402,"bn.js":404,buffer:220,"miller-rabin":451,randombytes:475}],402:[function(e,t,r){var a=e("randombytes");t.exports=b,b.simpleSieve=m,b.fermatTest=g;var n=e("bn.js"),i=new n(24),s=new(e("miller-rabin")),o=new n(1),h=new n(2),l=new n(5),d=(new n(16),new n(8),new n(10)),c=new n(3),u=(new n(7),new n(11)),f=new n(4),p=(new n(12),null);function y(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var a=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=a&&r%e[n]!=0;n++);t!==n&&e[n]<=a||(e[t++]=r)}return p=e,e}function m(e){for(var t=y(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function g(e){var t=n.mont(e);return 0===h.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function b(e,t){if(e<16)return new n(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new n(t);;){for(r=new n(a(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(o),r.testn(1)||r.iadd(h),t.cmp(h)){if(!t.cmp(l))for(;r.mod(d).cmp(c);)r.iadd(f)}else for(;r.mod(i).cmp(u);)r.iadd(f);if(m(p=r.shrn(1))&&m(r)&&g(p)&&g(r)&&s.test(p)&&s.test(r))return r}}},{"bn.js":404,"miller-rabin":451,randombytes:475}],403:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],404:[function(e,t,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],405:[function(e,t,r){var a=r;a.version=e("../package.json").version,a.utils=e("./elliptic/utils"),a.rand=e("brorand"),a.curve=e("./elliptic/curve"),a.curves=e("./elliptic/curves"),a.ec=e("./elliptic/ec"),a.eddsa=e("./elliptic/eddsa")},{"../package.json":421,"./elliptic/curve":408,"./elliptic/curves":411,"./elliptic/ec":412,"./elliptic/eddsa":415,"./elliptic/utils":419,brorand:187}],406:[function(e,t,r){var a=e("bn.js"),n=e("../utils"),i=n.getNAF,s=n.getJSF,o=n.assert;function h(e,t){this.type=e,this.p=new a(t.p,16),this.red=t.prime?a.red(t.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=t.n&&new a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(e,t){o(e.precomputed);var r=e._getDoubles(),a=i(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var s,h,l=[];for(s=0;s<a.length;s+=r.step){h=0;for(var d=s+r.step-1;d>=s;d--)h=(h<<1)+a[d];l.push(h)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=n;f>0;f--){for(s=0;s<l.length;s++)(h=l[s])===f?u=u.mixedAdd(r.points[s]):h===-f&&(u=u.mixedAdd(r.points[s].neg()));c=c.add(u)}return c.toP()},h.prototype._wnafMul=function(e,t){var r=4,a=e._getNAFPoints(r);r=a.wnd;for(var n=a.points,s=i(t,r,this._bitLength),h=this.jpoint(null,null,null),l=s.length-1;l>=0;l--){for(var d=0;l>=0&&0===s[l];l--)d++;if(l>=0&&d++,h=h.dblp(d),l<0)break;var c=s[l];o(0!==c),h="affine"===e.type?c>0?h.mixedAdd(n[c-1>>1]):h.mixedAdd(n[-c-1>>1].neg()):c>0?h.add(n[c-1>>1]):h.add(n[-c-1>>1].neg())}return"affine"===e.type?h.toP():h},h.prototype._wnafMulAdd=function(e,t,r,a,n){var o,h,l,d=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0;for(o=0;o<a;o++){var p=(l=t[o])._getNAFPoints(e);d[o]=p.wnd,c[o]=p.points}for(o=a-1;o>=1;o-=2){var y=o-1,m=o;if(1===d[y]&&1===d[m]){var g=[t[y],null,null,t[m]];0===t[y].y.cmp(t[m].y)?(g[1]=t[y].add(t[m]),g[2]=t[y].toJ().mixedAdd(t[m].neg())):0===t[y].y.cmp(t[m].y.redNeg())?(g[1]=t[y].toJ().mixedAdd(t[m]),g[2]=t[y].add(t[m].neg())):(g[1]=t[y].toJ().mixedAdd(t[m]),g[2]=t[y].toJ().mixedAdd(t[m].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],k=s(r[y],r[m]);for(f=Math.max(k[0].length,f),u[y]=new Array(f),u[m]=new Array(f),h=0;h<f;h++){var v=0|k[0][h],w=0|k[1][h];u[y][h]=b[3*(v+1)+(w+1)],u[m][h]=0,c[y]=g}}else u[y]=i(r[y],d[y],this._bitLength),u[m]=i(r[m],d[m],this._bitLength),f=Math.max(u[y].length,f),f=Math.max(u[m].length,f)}var x=this.jpoint(null,null,null),M=this._wnafT4;for(o=f;o>=0;o--){for(var _=0;o>=0;){var S=!0;for(h=0;h<a;h++)M[h]=0|u[h][o],0!==M[h]&&(S=!1);if(!S)break;_++,o--}if(o>=0&&_++,x=x.dblp(_),o<0)break;for(h=0;h<a;h++){var j=M[h];0!==j&&(j>0?l=c[h][j-1>>1]:j<0&&(l=c[h][-j-1>>1].neg()),x="affine"===l.type?x.mixedAdd(l):x.add(l))}}for(o=0;o<a;o++)c[o]=null;return n?x:x.toP()},h.BasePoint=l,l.prototype.eq=function(){throw new Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},h.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?o(e[e.length-1]%2==0):7===e[0]&&o(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},l.prototype.encodeCompressed=function(e){return this.encode(e,!0)},l.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},l.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},l.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},l.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],a=this,n=0;n<t;n+=e){for(var i=0;i<e;i++)a=a.dbl();r.push(a)}return{step:e,points:r}},l.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,a=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(a);return{wnd:e,points:t}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},{"../utils":419,"bn.js":420}],407:[function(e,t,r){var a=e("../utils"),n=e("bn.js"),i=e("inherits"),s=e("./base"),o=a.assert;function h(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function l(e,t,r,a,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===a?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=a?new n(a,16):this.curve.one,this.t=i&&new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(h,s),t.exports=h,h.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},h.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},h.prototype.jpoint=function(e,t,r,a){return this.point(e,t,r,a)},h.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),a=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=a.redMul(i.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var h=o.fromRed().isOdd();return(t&&!h||!t&&h)&&(o=o.redNeg()),this.point(e,o)},h.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),a=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=a.redMul(i.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},h.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),a=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===a.cmp(n)},i(l,s.BasePoint),h.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},h.prototype.point=function(e,t,r,a){return new l(this,e,t,r,a)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var a=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=a.redAdd(t),s=i.redSub(r),o=a.redSub(t),h=n.redMul(s),l=i.redMul(o),d=n.redMul(o),c=s.redMul(i);return this.curve.point(h,l,c,d)},l.prototype._projDbl=function(){var e,t,r,a,n,i,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),h=this.y.redSqr();if(this.curve.twisted){var l=(a=this.curve._mulA(o)).redAdd(h);this.zOne?(e=s.redSub(o).redSub(h).redMul(l.redSub(this.curve.two)),t=l.redMul(a.redSub(h)),r=l.redSqr().redSub(l).redSub(l)):(n=this.z.redSqr(),i=l.redSub(n).redISub(n),e=s.redSub(o).redISub(h).redMul(i),t=l.redMul(a.redSub(h)),r=l.redMul(i))}else a=o.redAdd(h),n=this.curve._mulC(this.z).redSqr(),i=a.redSub(n).redSub(n),e=this.curve._mulC(s.redISub(a)).redMul(i),t=this.curve._mulC(a).redMul(o.redISub(h)),r=a.redMul(i);return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),a=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),s=n.redSub(a),o=n.redAdd(a),h=r.redAdd(t),l=i.redMul(s),d=o.redMul(h),c=i.redMul(h),u=s.redMul(o);return this.curve.point(l,d,u,c)},l.prototype._projAdd=function(e){var t,r,a=this.z.redMul(e.z),n=a.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),h=n.redSub(o),l=n.redAdd(o),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),c=a.redMul(h).redMul(d);return this.curve.twisted?(t=a.redMul(l).redMul(s.redSub(this.curve._mulA(i))),r=h.redMul(l)):(t=a.redMul(l).redMul(s.redSub(i)),r=this.curve._mulC(h).redMul(l)),this.curve.point(c,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),a=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(a),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],408:[function(e,t,r){var a=r;a.base=e("./base"),a.short=e("./short"),a.mont=e("./mont"),a.edwards=e("./edwards")},{"./base":406,"./edwards":407,"./mont":409,"./short":410}],409:[function(e,t,r){var a=e("bn.js"),n=e("inherits"),i=e("./base"),s=e("../utils");function o(e){i.call(this,"mont",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(t,16),this.z=new a(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(o,i),t.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),a=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===a.redSqrt().redSqr().cmp(a)},n(h,i.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},o.prototype.point=function(e,t){return new h(this,e,t)},o.prototype.pointFromJSON=function(e){return h.fromJSON(this,e)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(e,t){return new h(e,t[0],t[1]||e.one)},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),a=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(a,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),a=this.x.redSub(this.z),n=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),s=n.redMul(a),o=t.z.redMul(i.redAdd(s).redSqr()),h=t.x.redMul(i.redISub(s).redSqr());return this.curve.point(o,h)},h.prototype.mul=function(e){for(var t=e.clone(),r=this,a=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var i=n.length-1;i>=0;i--)0===n[i]?(r=r.diffAdd(a,this),a=a.dbl()):(a=r.diffAdd(a,this),r=r.dbl());return a},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],410:[function(e,t,r){var a=e("../utils"),n=e("bn.js"),i=e("inherits"),s=e("./base"),o=a.assert;function h(e){s.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,r,a){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function d(e,t,r,a){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===a?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(h,s),t.exports=h,h.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);t=(t=a[0].cmp(a[1])<0?a[0]:a[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],o(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}):this._getEndoBasis(r)}}},h.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),a=r.redNeg(),i=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[a.redAdd(i).fromRed(),a.redSub(i).fromRed()]},h.prototype._getEndoBasis=function(e){for(var t,r,a,i,s,o,h,l,d,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,f=this.n.clone(),p=new n(1),y=new n(0),m=new n(0),g=new n(1),b=0;0!==u.cmpn(0);){var k=f.div(u);l=f.sub(k.mul(u)),d=m.sub(k.mul(p));var v=g.sub(k.mul(y));if(!a&&l.cmp(c)<0)t=h.neg(),r=p,a=l.neg(),i=d;else if(a&&2==++b)break;h=l,f=u,u=l,m=p,p=d,g=y,y=v}s=l.neg(),o=d;var w=a.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(w)>=0&&(s=t,o=r),a.negative&&(a=a.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:a,b:i},{a:s,b:o}]},h.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],a=t[1],n=a.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),o=i.mul(a.a),h=n.mul(r.b),l=i.mul(a.b);return{k1:e.sub(s).sub(o),k2:h.add(l).neg()}},h.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),a=r.redSqrt();if(0!==a.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=a.fromRed().isOdd();return(t&&!i||!t&&i)&&(a=a.redNeg()),this.point(e,a)},h.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,a=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(a).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},h.prototype._endoWnafMulAdd=function(e,t,r){for(var a=this._endoWnafT1,n=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),o=e[i],h=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),h=h.neg(!0)),a[2*i]=o,a[2*i+1]=h,n[2*i]=s.k1,n[2*i+1]=s.k2}for(var l=this._wnafMulAdd(1,a,n,2*i,r),d=0;d<2*i;d++)a[d]=null,n[d]=null;return l},i(l,s.BasePoint),h.prototype.point=function(e,t,r){return new l(this,e,t,r)},h.prototype.pointFromJSON=function(e,t){return l.fromJSON(this,e,t)},l.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,a=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(a)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(a)}}}return t}},l.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},l.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var a=e.point(t[0],t[1],r);if(!t[2])return a;function n(t){return e.point(t[0],t[1],r)}var i=t[2];return a.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[a].concat(i.doubles.points.map(n))},naf:i.naf&&{wnd:i.naf.wnd,points:[a].concat(i.naf.points.map(n))}},a},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),a=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,a)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),a=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(a),i=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n):this.curve._wnafMulAdd(1,a,n,2)},l.prototype.jmulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n,!0):this.curve._wnafMulAdd(1,a,n,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,a=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(a)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(a)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(d,s.BasePoint),h.prototype.jpoint=function(e,t,r){return new d(this,e,t,r)},d.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),a=this.y.redMul(t).redMul(e);return this.curve.point(r,a)},d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),a=this.x.redMul(t),n=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=a.redSub(n),h=i.redSub(s);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),d=l.redMul(o),c=a.redMul(l),u=h.redSqr().redIAdd(d).redISub(c).redISub(c),f=h.redMul(c.redISub(u)).redISub(i.redMul(d)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(u,f,p)},d.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,a=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(a),o=n.redSub(i);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),l=h.redMul(s),d=r.redMul(h),c=o.redSqr().redIAdd(l).redISub(d).redISub(d),u=o.redMul(d.redISub(c)).redISub(n.redMul(l)),f=this.z.redMul(s);return this.curve.jpoint(c,u,f)},d.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var a=this.curve.a,n=this.curve.tinv,i=this.x,s=this.y,o=this.z,h=o.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var d=i.redSqr(),c=l.redSqr(),u=c.redSqr(),f=d.redAdd(d).redIAdd(d).redIAdd(a.redMul(h)),p=i.redMul(c),y=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(y),g=f.redMul(m);g=g.redIAdd(g).redISub(u);var b=l.redMul(o);t+1<e&&(h=h.redMul(u)),i=y,o=b,l=g}return this.curve.jpoint(i,l.redMul(n),o)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},d.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var a=this.x.redSqr(),n=this.y.redSqr(),i=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(a).redISub(i);s=s.redIAdd(s);var o=a.redAdd(a).redIAdd(a),h=o.redSqr().redISub(s).redISub(s),l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),e=h,t=o.redMul(s.redISub(h)).redISub(l),r=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),c=this.y.redSqr(),u=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(d).redISub(u);f=f.redIAdd(f);var p=d.redAdd(d).redIAdd(d),y=p.redSqr(),m=u.redIAdd(u);m=(m=m.redIAdd(m)).redIAdd(m),e=y.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},d.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var a=this.x.redSqr(),n=this.y.redSqr(),i=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(a).redISub(i);s=s.redIAdd(s);var o=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),h=o.redSqr().redISub(s).redISub(s);e=h;var l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),t=o.redMul(s.redISub(h)).redISub(l),r=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),c=this.y.redSqr(),u=this.x.redMul(c),f=this.x.redSub(d).redMul(this.x.redAdd(d));f=f.redAdd(f).redIAdd(f);var p=u.redIAdd(u),y=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(d);var m=c.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},d.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,a=this.z,n=a.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),o=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(n)),h=t.redAdd(t),l=(h=h.redIAdd(h)).redMul(s),d=o.redSqr().redISub(l.redAdd(l)),c=l.redISub(d),u=s.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=o.redMul(c).redISub(u),p=r.redAdd(r).redMul(a);return this.curve.jpoint(d,f,p)},d.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),a=t.redSqr(),n=e.redAdd(e).redIAdd(e),i=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(a),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),h=a.redIAdd(a);h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=n.redIAdd(s).redSqr().redISub(i).redISub(o).redISub(h),d=t.redMul(l);d=(d=d.redIAdd(d)).redIAdd(d);var c=this.x.redMul(o).redISub(d);c=(c=c.redIAdd(c)).redIAdd(c);var u=this.y.redMul(l.redMul(h.redISub(l)).redISub(s.redMul(o)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(c,u,f)},d.prototype.mul=function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)},d.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var a=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(a)).cmpn(0)},d.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var a=e.clone(),n=this.curve.redN.redMul(t);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},d.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],411:[function(e,t,r){var a,n=r,i=e("hash.js"),s=e("./curve"),o=e("./utils").assert;function h(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new h(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{a=e("./precomputed/secp256k1")}catch(e){a=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})},{"./curve":408,"./precomputed/secp256k1":418,"./utils":419,"hash.js":426}],412:[function(e,t,r){var a=e("bn.js"),n=e("hmac-drbg"),i=e("../utils"),s=e("../curves"),o=e("brorand"),h=i.assert,l=e("./key"),d=e("./signature");function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(h(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=c,c.prototype.keyPair=function(e){return new l(this,e)},c.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},c.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new a(2));;){var s=new a(t.generate(r));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},c.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new a(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),h=e.toArray("be",s),l=new n({hash:this.hash,entropy:o,nonce:h,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new a(1)),u=0;;u++){var f=i.k?i.k(u):new a(l.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var y=p.getX(),m=y.umod(this.n);if(0!==m.cmpn(0)){var g=f.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==y.cmp(m)?2:0);return i.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),b^=1),new d({r:m,s:g,recoveryParam:b})}}}}}},c.prototype.verify=function(e,t,r,n){e=this._truncateToN(new a(e,16)),r=this.keyFromPublic(r,n);var i=(t=new d(t,"hex")).r,s=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,h=s.invm(this.n),l=h.mul(e).umod(this.n),c=h.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},c.prototype.recoverPubKey=function(e,t,r,n){h((3&r)===r,"The recovery param is more than two bits"),t=new d(t,n);var i=this.n,s=new a(e),o=t.r,l=t.s,c=1&r,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(i),p=i.sub(s).mul(f).umod(i),y=l.mul(f).umod(i);return this.g.mulAdd(p,o,y)},c.prototype.getKeyRecoveryParam=function(e,t,r,a){if(null!==(t=new d(t,a)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../curves":411,"../utils":419,"./key":413,"./signature":414,"bn.js":420,brorand:187,"hmac-drbg":438}],413:[function(e,t,r){var a=e("bn.js"),n=e("../utils").assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new a(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":419,"bn.js":420}],414:[function(e,t,r){var a=e("bn.js"),n=e("../utils"),i=n.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new a(e.r,16),this.s=new a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function h(e,t){var r=e[t.place++];if(!(128&r))return r;var a=15&r;if(0===a||a>4)return!1;for(var n=0,i=0,s=t.place;i<a;i++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function l(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function d(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}t.exports=s,s.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;var i=h(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=h(e,r);if(!1===s)return!1;var l=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var d=h(e,r);if(!1===d)return!1;if(e.length!==d+r.place)return!1;var c=e.slice(r.place,d+r.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new a(l),this.s=new a(c),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=l(t),r=l(r);!(r[0]||128&r[1]);)r=r.slice(1);var a=[2];d(a,t.length),(a=a.concat(t)).push(2),d(a,r.length);var i=a.concat(r),s=[48];return d(s,i.length),s=s.concat(i),n.encode(s,e)}},{"../utils":419,"bn.js":420}],415:[function(e,t,r){var a=e("hash.js"),n=e("../curves"),i=e("../utils"),s=i.assert,o=i.parseBytes,h=e("./key"),l=e("./signature");function d(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof d))return new d(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=a.sha512}t.exports=d,d.prototype.sign=function(e,t){e=o(e);var r=this.keyFromSecret(t),a=this.hashInt(r.messagePrefix(),e),n=this.g.mul(a),i=this.encodePoint(n),s=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),h=a.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:i})},d.prototype.verify=function(e,t,r){e=o(e),t=this.makeSignature(t);var a=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),a.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(a.pub().mul(n)).eq(i)},d.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)},d.prototype.keyFromPublic=function(e){return h.fromPublic(this,e)},d.prototype.keyFromSecret=function(e){return h.fromSecret(this,e)},d.prototype.makeSignature=function(e){return e instanceof l?e:new l(this,e)},d.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},d.prototype.decodePoint=function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),a=!!(128&e[t]),n=i.intFromLE(r);return this.curve.pointFromY(n,a)},d.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},d.prototype.decodeInt=function(e){return i.intFromLE(e)},d.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../curves":411,"../utils":419,"./key":416,"./signature":417,"hash.js":426}],416:[function(e,t,r){var a=e("../utils"),n=a.assert,i=a.parseBytes,s=a.cachedProperty;function o(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}o.fromPublic=function(e,t){return t instanceof o?t:new o(e,{pub:t})},o.fromSecret=function(e,t){return t instanceof o?t:new o(e,{secret:t})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(o,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,a=t.slice(0,e.encodingLength);return a[0]&=248,a[r]&=127,a[r]|=64,a}),s(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},o.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},o.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),a.encode(this.secret(),e)},o.prototype.getPublic=function(e){return a.encode(this.pubBytes(),e)},t.exports=o},{"../utils":419}],417:[function(e,t,r){var a=e("bn.js"),n=e("../utils"),i=n.assert,s=n.cachedProperty,o=n.parseBytes;function h(e,t){this.eddsa=e,"object"!=typeof t&&(t=o(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof a&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(h,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(h,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(h,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(h,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},{"../utils":419,"bn.js":420}],418:[function(e,t,r){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],419:[function(e,t,r){var a=r,n=e("bn.js"),i=e("minimalistic-assert"),s=e("minimalistic-crypto-utils");a.assert=i,a.toArray=s.toArray,a.zero2=s.zero2,a.toHex=s.toHex,a.encode=s.encode,a.getNAF=function(e,t,r){var a=new Array(Math.max(e.bitLength(),r)+1);a.fill(0);for(var n=1<<t+1,i=e.clone(),s=0;s<a.length;s++){var o,h=i.andln(n-1);i.isOdd()?(o=h>(n>>1)-1?(n>>1)-h:h,i.isubn(o)):o=0,a[s]=o,i.iushrn(1)}return a},a.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var a,n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var s,o,h=e.andln(3)+n&3,l=t.andln(3)+i&3;3===h&&(h=-1),3===l&&(l=-1),s=1&h?3!=(a=e.andln(7)+n&7)&&5!==a||2!==l?h:-h:0,r[0].push(s),o=1&l?3!=(a=t.andln(7)+i&7)&&5!==a||2!==h?l:-l:0,r[1].push(o),2*n===s+1&&(n=1-n),2*i===o+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},a.cachedProperty=function(e,t,r){var a="_"+t;e.prototype[t]=function(){return void 0!==this[a]?this[a]:this[a]=r.call(this)}},a.parseBytes=function(e){return"string"==typeof e?a.toArray(e,"hex"):e},a.intFromLE=function(e){return new n(e,"hex","le")}},{"bn.js":420,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],420:[function(e,t,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],421:[function(e,t,r){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],422:[function(e,t,r){var a=Object.create||function(e){var t=function(){};return t.prototype=e,new t},n=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},i=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=a(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var o,h=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),o=0===l.x}catch(e){o=!1}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r){if(t)e.call(r);else for(var a=e.length,n=w(e,a),i=0;i<a;++i)n[i].call(r)}function u(e,t,r,a){if(t)e.call(r,a);else for(var n=e.length,i=w(e,n),s=0;s<n;++s)i[s].call(r,a)}function f(e,t,r,a,n){if(t)e.call(r,a,n);else for(var i=e.length,s=w(e,i),o=0;o<i;++o)s[o].call(r,a,n)}function p(e,t,r,a,n,i){if(t)e.call(r,a,n,i);else for(var s=e.length,o=w(e,s),h=0;h<s;++h)o[h].call(r,a,n,i)}function y(e,t,r,a){if(t)e.apply(r,a);else for(var n=e.length,i=w(e,n),s=0;s<n;++s)i[s].apply(r,a)}function m(e,t,r,n){var i,s,o;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]):(s=e._events=a(null),e._eventsCount=0),o){if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),!o.warned&&(i=d(e))&&i>0&&o.length>i){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",h.name,h.message)}}else o=s[t]=r,++e._eventsCount;return e}function g(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function b(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=i.call(g,a);return n.listener=r,a.wrapFn=n,n}function k(e,t,r){var a=e._events;if(!a)return[];var n=a[t];return n?"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):w(n,n.length):[]}function v(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function w(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}o?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');h=e}}):s.defaultMaxListeners=h,s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return d(this)},s.prototype.emit=function(e){var t,r,a,n,i,s,o="error"===e;if(s=this._events)o=o&&null==s.error;else if(!o)return!1;if(o){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var h=new Error('Unhandled "error" event. ('+t+")");throw h.context=t,h}if(!(r=s[e]))return!1;var l="function"==typeof r;switch(a=arguments.length){case 1:c(r,l,this);break;case 2:u(r,l,this,arguments[1]);break;case 3:f(r,l,this,arguments[1],arguments[2]);break;case 4:p(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(n=new Array(a-1),i=1;i<a;i++)n[i-1]=arguments[i];y(r,l,this,n)}return!0},s.prototype.addListener=function(e,t){return m(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return m(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,b(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,b(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=a(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(var r=t,a=r+1,n=e.length;a<n;r+=1,a+=1)e[r]=e[a];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.removeAllListeners=function(e){var t,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=a(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=a(null):delete r[e]),this;if(0===arguments.length){var s,o=n(r);for(i=0;i<o.length;++i)"removeListener"!==(s=o[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=a(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return k(this,e,!0)},s.prototype.rawListeners=function(e){return k(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],423:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("md5.js");t.exports=function(e,t,r,i){if(a.isBuffer(e)||(e=a.from(e,"binary")),t&&(a.isBuffer(t)||(t=a.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,o=a.alloc(s),h=a.alloc(i||0),l=a.alloc(0);s>0||i>0;){var d=new n;d.update(l),d.update(e),t&&d.update(t),l=d.digest();var c=0;if(s>0){var u=o.length-s;c=Math.min(s,l.length),l.copy(o,u,0,c),s-=c}if(c<l.length&&i>0){var f=h.length-i,p=Math.min(i,l.length-c);l.copy(h,f,c,c+p),i-=p}}return l.fill(0),{key:o,iv:h}}},{"md5.js":450,"safe-buffer":494}],424:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=r.ParserOptions=r.parseFile=r.parseStream=r.parseString=r.parse=r.FormatterOptions=r.CsvFormatterStream=r.writeToPath=r.writeToString=r.writeToBuffer=r.writeToStream=r.write=r.format=void 0;var a=e("@fast-csv/format");Object.defineProperty(r,"format",{enumerable:!0,get:function(){return a.format}}),Object.defineProperty(r,"write",{enumerable:!0,get:function(){return a.write}}),Object.defineProperty(r,"writeToStream",{enumerable:!0,get:function(){return a.writeToStream}}),Object.defineProperty(r,"writeToBuffer",{enumerable:!0,get:function(){return a.writeToBuffer}}),Object.defineProperty(r,"writeToString",{enumerable:!0,get:function(){return a.writeToString}}),Object.defineProperty(r,"writeToPath",{enumerable:!0,get:function(){return a.writeToPath}}),Object.defineProperty(r,"CsvFormatterStream",{enumerable:!0,get:function(){return a.CsvFormatterStream}}),Object.defineProperty(r,"FormatterOptions",{enumerable:!0,get:function(){return a.FormatterOptions}});var n=e("@fast-csv/parse");Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(r,"parseString",{enumerable:!0,get:function(){return n.parseString}}),Object.defineProperty(r,"parseStream",{enumerable:!0,get:function(){return n.parseStream}}),Object.defineProperty(r,"parseFile",{enumerable:!0,get:function(){return n.parseFile}}),Object.defineProperty(r,"ParserOptions",{enumerable:!0,get:function(){return n.ParserOptions}}),Object.defineProperty(r,"CsvParserStream",{enumerable:!0,get:function(){return n.CsvParserStream}})},{"@fast-csv/format":151,"@fast-csv/parse":155}],425:[function(e,t,r){var a=e("safe-buffer").Buffer,n=e("readable-stream").Transform;function i(e){n.call(this),this._block=a.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(i,n),i.prototype._transform=function(e,t,r){var a=null;try{this.update(e,t)}catch(e){a=e}r(a)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!a.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");a.isBuffer(e)||(e=a.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var s=0,o=8*e.length;o>0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=i},{inherits:440,"readable-stream":491,"safe-buffer":494}],426:[function(e,t,r){var a=r;a.utils=e("./hash/utils"),a.common=e("./hash/common"),a.sha=e("./hash/sha"),a.ripemd=e("./hash/ripemd"),a.hmac=e("./hash/hmac"),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160},{"./hash/common":427,"./hash/hmac":428,"./hash/ripemd":429,"./hash/sha":430,"./hash/utils":437}],427:[function(e,t,r){var a=e("./utils"),n=e("minimalistic-assert");function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=i,i.prototype.update=function(e,t){if(e=a.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=a.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,a=new Array(r+this.padLength);a[0]=128;for(var n=1;n<r;n++)a[n]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)a[n++]=0;a[n++]=0,a[n++]=0,a[n++]=0,a[n++]=0,a[n++]=e>>>24&255,a[n++]=e>>>16&255,a[n++]=e>>>8&255,a[n++]=255&e}else for(a[n++]=255&e,a[n++]=e>>>8&255,a[n++]=e>>>16&255,a[n++]=e>>>24&255,a[n++]=0,a[n++]=0,a[n++]=0,a[n++]=0,i=8;i<this.padLength;i++)a[n++]=0;return a}},{"./utils":437,"minimalistic-assert":453}],428:[function(e,t,r){var a=e("./utils"),n=e("minimalistic-assert");function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(a.toArray(t,r))}t.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":437,"minimalistic-assert":453}],429:[function(e,t,r){var a=e("./utils"),n=e("./common"),i=a.rotl32,s=a.sum32,o=a.sum32_3,h=a.sum32_4,l=n.BlockHash;function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,a){return e<=15?t^r^a:e<=31?t&r|~t&a:e<=47?(t|~r)^a:e<=63?t&a|r&~a:t^(r|~a)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}a.inherits(d,l),r.ripemd160=d,d.blockSize=512,d.outSize=160,d.hmacStrength=192,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.h[0],a=this.h[1],n=this.h[2],l=this.h[3],d=this.h[4],b=r,k=a,v=n,w=l,x=d,M=0;M<80;M++){var _=s(i(h(r,c(M,a,n,l),e[p[M]+t],u(M)),m[M]),d);r=d,d=l,l=i(n,10),n=a,a=_,_=s(i(h(b,c(79-M,k,v,w),e[y[M]+t],f(M)),g[M]),x),b=x,x=w,w=i(v,10),v=k,k=_}_=o(this.h[1],n,w),this.h[1]=o(this.h[2],l,x),this.h[2]=o(this.h[3],d,b),this.h[3]=o(this.h[4],r,k),this.h[4]=o(this.h[0],a,v),this.h[0]=_},d.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h,"little"):a.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":427,"./utils":437}],430:[function(e,t,r){r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":431,"./sha/224":432,"./sha/256":433,"./sha/384":434,"./sha/512":435}],431:[function(e,t,r){var a=e("../utils"),n=e("../common"),i=e("./common"),s=a.rotl32,o=a.sum32,h=a.sum32_5,l=i.ft_1,d=n.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}a.inherits(u,d),t.exports=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=s(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var n=this.h[0],i=this.h[1],d=this.h[2],u=this.h[3],f=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),y=h(s(n,5),l(p,i,d,u),f,r[a],c[p]);f=u,u=d,d=s(i,30),i=n,n=y}this.h[0]=o(this.h[0],n),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],d),this.h[3]=o(this.h[3],u),this.h[4]=o(this.h[4],f)},u.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h,"big"):a.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436}],432:[function(e,t,r){var a=e("../utils"),n=e("./256");function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}a.inherits(i,n),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h.slice(0,7),"big"):a.split32(this.h.slice(0,7),"big")}},{"../utils":437,"./256":433}],433:[function(e,t,r){var a=e("../utils"),n=e("../common"),i=e("./common"),s=e("minimalistic-assert"),o=a.sum32,h=a.sum32_4,l=a.sum32_5,d=i.ch32,c=i.maj32,u=i.s0_256,f=i.s1_256,p=i.g0_256,y=i.g1_256,m=n.BlockHash,g=[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];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}a.inherits(b,m),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=h(y(r[a-2]),r[a-7],p(r[a-15]),r[a-16]);var n=this.h[0],i=this.h[1],m=this.h[2],g=this.h[3],b=this.h[4],k=this.h[5],v=this.h[6],w=this.h[7];for(s(this.k.length===r.length),a=0;a<r.length;a++){var x=l(w,f(b),d(b,k,v),this.k[a],r[a]),M=o(u(n),c(n,i,m));w=v,v=k,k=b,b=o(g,x),g=m,m=i,i=n,n=o(x,M)}this.h[0]=o(this.h[0],n),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],m),this.h[3]=o(this.h[3],g),this.h[4]=o(this.h[4],b),this.h[5]=o(this.h[5],k),this.h[6]=o(this.h[6],v),this.h[7]=o(this.h[7],w)},b.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h,"big"):a.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436,"minimalistic-assert":453}],434:[function(e,t,r){var a=e("../utils"),n=e("./512");function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}a.inherits(i,n),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h.slice(0,12),"big"):a.split32(this.h.slice(0,12),"big")}},{"../utils":437,"./512":435}],435:[function(e,t,r){var a=e("../utils"),n=e("../common"),i=e("minimalistic-assert"),s=a.rotr64_hi,o=a.rotr64_lo,h=a.shr64_hi,l=a.shr64_lo,d=a.sum64,c=a.sum64_hi,u=a.sum64_lo,f=a.sum64_4_hi,p=a.sum64_4_lo,y=a.sum64_5_hi,m=a.sum64_5_lo,g=n.BlockHash,b=[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];function k(){if(!(this instanceof k))return new k;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function v(e,t,r,a,n){var i=e&r^~e&n;return i<0&&(i+=4294967296),i}function w(e,t,r,a,n,i){var s=t&a^~t&i;return s<0&&(s+=4294967296),s}function x(e,t,r,a,n){var i=e&r^e&n^r&n;return i<0&&(i+=4294967296),i}function M(e,t,r,a,n,i){var s=t&a^t&i^a&i;return s<0&&(s+=4294967296),s}function _(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function C(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,1)^s(e,t,8)^h(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=o(e,t,1)^o(e,t,8)^l(e,t,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,19)^s(t,e,29)^h(e,t,6);return r<0&&(r+=4294967296),r}function N(e,t){var r=o(e,t,19)^o(t,e,29)^l(e,t,6);return r<0&&(r+=4294967296),r}a.inherits(k,g),t.exports=k,k.blockSize=1024,k.outSize=512,k.hmacStrength=192,k.padLength=128,k.prototype._prepareBlock=function(e,t){for(var r=this.W,a=0;a<32;a++)r[a]=e[t+a];for(;a<r.length;a+=2){var n=E(r[a-4],r[a-3]),i=N(r[a-4],r[a-3]),s=r[a-14],o=r[a-13],h=A(r[a-30],r[a-29]),l=T(r[a-30],r[a-29]),d=r[a-32],c=r[a-31];r[a]=f(n,i,s,o,h,l,d,c),r[a+1]=p(n,i,s,o,h,l,d,c)}},k.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,a=this.h[0],n=this.h[1],s=this.h[2],o=this.h[3],h=this.h[4],l=this.h[5],f=this.h[6],p=this.h[7],g=this.h[8],b=this.h[9],k=this.h[10],A=this.h[11],T=this.h[12],E=this.h[13],N=this.h[14],z=this.h[15];i(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var O=N,P=z,L=j(g,b),I=C(g,b),q=v(g,b,k,A,T),D=w(g,b,k,A,T,E),H=this.k[R],F=this.k[R+1],B=r[R],V=r[R+1],U=y(O,P,L,I,q,D,H,F,B,V),$=m(O,P,L,I,q,D,H,F,B,V);O=_(a,n),P=S(a,n),L=x(a,n,s,o,h),I=M(a,n,s,o,h,l);var W=c(O,P,L,I),Z=u(O,P,L,I);N=T,z=E,T=k,E=A,k=g,A=b,g=c(f,p,U,$),b=u(p,p,U,$),f=h,p=l,h=s,l=o,s=a,o=n,a=c(U,$,W,Z),n=u(U,$,W,Z)}d(this.h,0,a,n),d(this.h,2,s,o),d(this.h,4,h,l),d(this.h,6,f,p),d(this.h,8,g,b),d(this.h,10,k,A),d(this.h,12,T,E),d(this.h,14,N,z)},k.prototype._digest=function(e){return"hex"===e?a.toHex32(this.h,"big"):a.split32(this.h,"big")}},{"../common":427,"../utils":437,"minimalistic-assert":453}],436:[function(e,t,r){var a=e("../utils").rotr32;function n(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}r.ft_1=function(e,t,r,a){return 0===e?n(t,r,a):1===e||3===e?s(t,r,a):2===e?i(t,r,a):void 0},r.ch32=n,r.maj32=i,r.p32=s,r.s0_256=function(e){return a(e,2)^a(e,13)^a(e,22)},r.s1_256=function(e){return a(e,6)^a(e,11)^a(e,25)},r.g0_256=function(e){return a(e,7)^a(e,18)^e>>>3},r.g1_256=function(e){return a(e,17)^a(e,19)^e>>>10}},{"../utils":437}],437:[function(e,t,r){var a=e("minimalistic-assert"),n=e("inherits");function i(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function h(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=n,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var a=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?r[a++]=s:s<2048?(r[a++]=s>>6|192,r[a++]=63&s|128):i(e,n)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),r[a++]=s>>18|240,r[a++]=s>>12&63|128,r[a++]=s>>6&63|128,r[a++]=63&s|128):(r[a++]=s>>12|224,r[a++]=s>>6&63|128,r[a++]=63&s|128)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},r.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},r.htonl=s,r.toHex32=function(e,t){for(var r="",a=0;a<e.length;a++){var n=e[a];"little"===t&&(n=s(n)),r+=h(n.toString(16))}return r},r.zero2=o,r.zero8=h,r.join32=function(e,t,r,n){var i=r-t;a(i%4==0);for(var s=new Array(i/4),o=0,h=t;o<s.length;o++,h+=4){var l;l="big"===n?e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3]:e[h+3]<<24|e[h+2]<<16|e[h+1]<<8|e[h],s[o]=l>>>0}return s},r.split32=function(e,t){for(var r=new Array(4*e.length),a=0,n=0;a<e.length;a++,n+=4){var i=e[a];"big"===t?(r[n]=i>>>24,r[n+1]=i>>>16&255,r[n+2]=i>>>8&255,r[n+3]=255&i):(r[n+3]=i>>>24,r[n+2]=i>>>16&255,r[n+1]=i>>>8&255,r[n]=255&i)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<<t|e>>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,a){return e+t+r+a>>>0},r.sum32_5=function(e,t,r,a,n){return e+t+r+a+n>>>0},r.sum64=function(e,t,r,a){var n=e[t],i=a+e[t+1]>>>0,s=(i<a?1:0)+r+n;e[t]=s>>>0,e[t+1]=i},r.sum64_hi=function(e,t,r,a){return(t+a>>>0<t?1:0)+e+r>>>0},r.sum64_lo=function(e,t,r,a){return t+a>>>0},r.sum64_4_hi=function(e,t,r,a,n,i,s,o){var h=0,l=t;return h+=(l=l+a>>>0)<t?1:0,h+=(l=l+i>>>0)<i?1:0,e+r+n+s+(h+=(l=l+o>>>0)<o?1:0)>>>0},r.sum64_4_lo=function(e,t,r,a,n,i,s,o){return t+a+i+o>>>0},r.sum64_5_hi=function(e,t,r,a,n,i,s,o,h,l){var d=0,c=t;return d+=(c=c+a>>>0)<t?1:0,d+=(c=c+i>>>0)<i?1:0,d+=(c=c+o>>>0)<o?1:0,e+r+n+s+h+(d+=(c=c+l>>>0)<l?1:0)>>>0},r.sum64_5_lo=function(e,t,r,a,n,i,s,o,h,l){return t+a+i+o+l>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:440,"minimalistic-assert":453}],438:[function(e,t,r){var a=e("hash.js"),n=e("minimalistic-crypto-utils"),i=e("minimalistic-assert");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),a=n.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,a)}t.exports=s,s.prototype._init=function(e,t,r){var a=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new a.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,a){"string"!=typeof t&&(a=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,a),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(a=r,r=t,t=null),r&&(r=n.toArray(r,a||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,e);return this._update(r),this._reseed++,n.encode(s,t)}},{"hash.js":426,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],439:[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(e,t,r,a,n){var i,s,o=8*n-a-1,h=(1<<o)-1,l=h>>1,d=-7,c=r?n-1:0,u=r?-1:1,f=e[t+c];for(c+=u,i=f&(1<<-d)-1,f>>=-d,d+=o;d>0;i=256*i+e[t+c],c+=u,d-=8);for(s=i&(1<<-d)-1,i>>=-d,d+=a;d>0;s=256*s+e[t+c],c+=u,d-=8);if(0===i)i=1-l;else{if(i===h)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,a),i-=l}return(f?-1:1)*s*Math.pow(2,i-a)},r.write=function(e,t,r,a,n,i){var s,o,h,l=8*i-n-1,d=(1<<l)-1,c=d>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=a?0:i-1,p=a?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-s))<1&&(s--,h*=2),(t+=s+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=d?(o=0,s=d):s+c>=1?(o=(t*h-1)*Math.pow(2,n),s+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;e[r+f]=255&o,f+=p,o/=256,n-=8);for(s=s<<n|o,l+=n;l>0;e[r+f]=255&s,f+=p,s/=256,l-=8);e[r+f-p]|=128*y}},{}],440:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],441:[function(e,t,r){(function(a,n,i,s,o,h,l,d){(function(){
10740
10740
  /*!
10741
10741