@kong-ui-public/core 1.0.1-pr.615.98eb515.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.
@@ -0,0 +1 @@
1
+ (function(p,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],w):(p=typeof globalThis<"u"?globalThis:p||self,w(p["kong-ui-core"]={},p.Vue))})(this,function(p,w){"use strict";function j(r){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(r)}function W(r){if(r===null||r===!0||r===!1)return NaN;var e=Number(r);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function S(r,e){if(e.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+e.length+" present")}function M(r){S(1,arguments);var e=Object.prototype.toString.call(r);return r instanceof Date||j(r)==="object"&&e==="[object Date]"?new Date(r.getTime()):typeof r=="number"||e==="[object Number]"?new Date(r):((typeof r=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function be(r,e){S(2,arguments);var t=M(r).getTime(),n=W(e);return new Date(t+n)}var ye={};function B(){return ye}function Te(r){var e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),r.getTime()-e.getTime()}function pe(r){return S(1,arguments),r instanceof Date||j(r)==="object"&&Object.prototype.toString.call(r)==="[object Date]"}function Se(r){if(S(1,arguments),!pe(r)&&typeof r!="number")return!1;var e=M(r);return!isNaN(Number(e))}function Ce(r,e){S(2,arguments);var t=W(e);return be(r,-t)}var De=864e5;function Oe(r){S(1,arguments);var e=M(r),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/De)+1}function X(r){S(1,arguments);var e=1,t=M(r),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ie(r){S(1,arguments);var e=M(r),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=X(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var o=X(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Ee(r){S(1,arguments);var e=ie(r),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=X(t);return n}var Pe=6048e5;function Me(r){S(1,arguments);var e=M(r),t=X(e).getTime()-Ee(e).getTime();return Math.round(t/Pe)+1}function Q(r,e){var t,n,a,i,o,s,l,u;S(1,arguments);var c=B(),h=W((t=(n=(a=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&a!==void 0?a:c.weekStartsOn)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&t!==void 0?t:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=M(r),f=d.getUTCDay(),g=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-g),d.setUTCHours(0,0,0,0),d}function oe(r,e){var t,n,a,i,o,s,l,u;S(1,arguments);var c=M(r),h=c.getUTCFullYear(),d=B(),f=W((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&a!==void 0?a:d.firstWeekContainsDate)!==null&&n!==void 0?n:(l=d.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(h+1,0,f),g.setUTCHours(0,0,0,0);var y=Q(g,e),C=new Date(0);C.setUTCFullYear(h,0,f),C.setUTCHours(0,0,0,0);var L=Q(C,e);return c.getTime()>=y.getTime()?h+1:c.getTime()>=L.getTime()?h:h-1}function ke(r,e){var t,n,a,i,o,s,l,u;S(1,arguments);var c=B(),h=W((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(l=c.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=oe(r,e),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var g=Q(f,e);return g}var _e=6048e5;function Re(r,e){S(1,arguments);var t=M(r),n=Q(t,e).getTime()-ke(t,e).getTime();return Math.round(n/_e)+1}function v(r,e){for(var t=r<0?"-":"",n=Math.abs(r).toString();n.length<e;)n="0"+n;return t+n}var xe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return v(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):v(n+1,2)},d:function(e,t){return v(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return v(e.getUTCHours()%12||12,t.length)},H:function(e,t){return v(e.getUTCHours(),t.length)},m:function(e,t){return v(e.getUTCMinutes(),t.length)},s:function(e,t){return v(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,a=e.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,n-3));return v(i,t.length)}};const x=xe;var Y={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ue={G:function(e,t,n){var a=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var a=e.getUTCFullYear(),i=a>0?a:1-a;return n.ordinalNumber(i,{unit:"year"})}return x.y(e,t)},Y:function(e,t,n,a){var i=oe(e,a),o=i>0?i:1-i;if(t==="YY"){var s=o%100;return v(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):v(o,t.length)},R:function(e,t){var n=ie(e);return v(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return v(n,t.length)},Q:function(e,t,n){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return v(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return v(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){var a=e.getUTCMonth();switch(t){case"M":case"MM":return x.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){var a=e.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return v(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){var i=Re(e,a);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):v(i,t.length)},I:function(e,t,n){var a=Me(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):v(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):x.d(e,t)},D:function(e,t,n){var a=Oe(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):v(a,t.length)},E:function(e,t,n){var a=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){var i=e.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return v(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){var i=e.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return v(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var a=e.getUTCDay(),i=a===0?7:a;switch(t){case"i":return String(i);case"ii":return v(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){var a=e.getUTCHours(),i=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var a=e.getUTCHours(),i;switch(a===12?i=Y.noon:a===0?i=Y.midnight:i=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var a=e.getUTCHours(),i;switch(a>=17?i=Y.evening:a>=12?i=Y.afternoon:a>=4?i=Y.morning:i=Y.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var a=e.getUTCHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return x.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):x.H(e,t)},K:function(e,t,n){var a=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):v(a,t.length)},k:function(e,t,n){var a=e.getUTCHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):v(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):x.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):x.s(e,t)},S:function(e,t){return x.S(e,t)},X:function(e,t,n,a){var i=a._originalDate||e,o=i.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return le(o);case"XXXX":case"XX":return A(o);case"XXXXX":case"XXX":default:return A(o,":")}},x:function(e,t,n,a){var i=a._originalDate||e,o=i.getTimezoneOffset();switch(t){case"x":return le(o);case"xxxx":case"xx":return A(o);case"xxxxx":case"xxx":default:return A(o,":")}},O:function(e,t,n,a){var i=a._originalDate||e,o=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ue(o,":");case"OOOO":default:return"GMT"+A(o,":")}},z:function(e,t,n,a){var i=a._originalDate||e,o=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ue(o,":");case"zzzz":default:return"GMT"+A(o,":")}},t:function(e,t,n,a){var i=a._originalDate||e,o=Math.floor(i.getTime()/1e3);return v(o,t.length)},T:function(e,t,n,a){var i=a._originalDate||e,o=i.getTime();return v(o,t.length)}};function ue(r,e){var t=r>0?"-":"+",n=Math.abs(r),a=Math.floor(n/60),i=n%60;if(i===0)return t+String(a);var o=e||"";return t+String(a)+o+v(i,2)}function le(r,e){if(r%60===0){var t=r>0?"-":"+";return t+v(Math.abs(r)/60,2)}return A(r,e)}function A(r,e){var t=e||"",n=r>0?"-":"+",a=Math.abs(r),i=v(Math.floor(a/60),2),o=v(a%60,2);return n+i+t+o}const We=Ue;var se=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ce=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ae=function(e,t){var n=e.match(/(P+)(p+)?/)||[],a=n[1],i=n[2];if(!i)return se(e,t);var o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",se(a,t)).replace("{{time}}",ce(i,t))},Le={p:ce,P:Ae};const Ne=Le;var Ye=["D","DD"],Ie=["YY","YYYY"];function Fe(r){return Ye.indexOf(r)!==-1}function $e(r){return Ie.indexOf(r)!==-1}function de(r,e,t){if(r==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(r==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var He={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"}},Ve=function(e,t,n){var a,i=He[e];return typeof i=="string"?a=i:t===1?a=i.one:a=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};const qe=Ve;function ee(r){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):r.defaultWidth,n=r.formats[t]||r.formats[r.defaultWidth];return n}}var Ge={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},je={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Be={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xe={date:ee({formats:Ge,defaultWidth:"full"}),time:ee({formats:je,defaultWidth:"full"}),dateTime:ee({formats:Be,defaultWidth:"full"})};const Qe=Xe;var Je={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ke=function(e,t,n,a){return Je[e]};const ze=Ke;function V(r){return function(e,t){var n=t!=null&&t.context?String(t.context):"standalone",a;if(n==="formatting"&&r.formattingValues){var i=r.defaultFormattingWidth||r.defaultWidth,o=t!=null&&t.width?String(t.width):i;a=r.formattingValues[o]||r.formattingValues[i]}else{var s=r.defaultWidth,l=t!=null&&t.width?String(t.width):r.defaultWidth;a=r.values[l]||r.values[s]}var u=r.argumentCallback?r.argumentCallback(e):e;return a[u]}}var Ze={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},et={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tt={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"]},rt={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"]},nt={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"}},at={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"}},it=function(e,t){var n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ot={ordinalNumber:it,era:V({values:Ze,defaultWidth:"wide"}),quarter:V({values:et,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:V({values:tt,defaultWidth:"wide"}),day:V({values:rt,defaultWidth:"wide"}),dayPeriod:V({values:nt,defaultWidth:"wide",formattingValues:at,defaultFormattingWidth:"wide"})};const ut=ot;function q(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],i=e.match(a);if(!i)return null;var o=i[0],s=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(s)?st(s,function(h){return h.test(o)}):lt(s,function(h){return h.test(o)}),u;u=r.valueCallback?r.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;var c=e.slice(o.length);return{value:u,rest:c}}}function lt(r,e){for(var t in r)if(r.hasOwnProperty(t)&&e(r[t]))return t}function st(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return t}function ct(r){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.match(r.matchPattern);if(!n)return null;var a=n[0],i=e.match(r.parsePattern);if(!i)return null;var o=r.valueCallback?r.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var s=e.slice(a.length);return{value:o,rest:s}}}var dt=/^(\d+)(th|st|nd|rd)?/i,ft=/\d+/i,ht={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},vt={any:[/^b/i,/^(a|c)/i]},mt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gt={any:[/1/i,/2/i,/3/i,/4/i]},wt={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},bt={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]},yt={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},Tt={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]},pt={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},St={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}},Ct={ordinalNumber:ct({matchPattern:dt,parsePattern:ft,valueCallback:function(e){return parseInt(e,10)}}),era:q({matchPatterns:ht,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any"}),quarter:q({matchPatterns:mt,defaultMatchWidth:"wide",parsePatterns:gt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:q({matchPatterns:wt,defaultMatchWidth:"wide",parsePatterns:bt,defaultParseWidth:"any"}),day:q({matchPatterns:yt,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any"}),dayPeriod:q({matchPatterns:pt,defaultMatchWidth:"any",parsePatterns:St,defaultParseWidth:"any"})},Dt={code:"en-US",formatDistance:qe,formatLong:Qe,formatRelative:ze,localize:ut,match:Ct,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ot=Dt;var Et=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mt=/^'([^]*?)'?$/,kt=/''/g,_t=/[a-zA-Z]/;function Rt(r,e,t){var n,a,i,o,s,l,u,c,h,d,f,g,y,C,L,b,m,$;S(2,arguments);var D=String(e),O=B(),E=(n=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:O.locale)!==null&&n!==void 0?n:Ot,N=W((i=(o=(s=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(c=u.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&s!==void 0?s:O.firstWeekContainsDate)!==null&&o!==void 0?o:(h=O.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var H=W((f=(g=(y=(C=t==null?void 0:t.weekStartsOn)!==null&&C!==void 0?C:t==null||(L=t.locale)===null||L===void 0||(b=L.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&y!==void 0?y:O.weekStartsOn)!==null&&g!==void 0?g:(m=O.locale)===null||m===void 0||($=m.options)===null||$===void 0?void 0:$.weekStartsOn)!==null&&f!==void 0?f:0);if(!(H>=0&&H<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var U=M(r);if(!Se(U))throw new RangeError("Invalid time value");var z=Te(U),G=Ce(U,z),_={firstWeekContainsDate:N,weekStartsOn:H,locale:E,_originalDate:U},Z=D.match(Pt).map(function(T){var P=T[0];if(P==="p"||P==="P"){var R=Ne[P];return R(T,E.formatLong)}return T}).join("").match(Et).map(function(T){if(T==="''")return"'";var P=T[0];if(P==="'")return xt(T);var R=We[P];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&$e(T)&&de(T,e,String(r)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Fe(T)&&de(T,e,String(r)),R(G,T,E.localize,_);if(P.match(_t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");return T}).join("");return Z}function xt(r){var e=r.match(Mt);return e?e[1].replace(kt,"'"):r}function Ut(){return{formatDateBy:(t,n={})=>{if(isNaN(t))return null;try{return new Date(t*1e3).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,...n})}catch{return null}},formatUnixToDate:(t,n)=>{if(!t)return"";const a=n?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd HH:mm:ss XX";try{const i=new Date(t*1e3);return Rt(i,a)}catch{return""}}}}function Wt(){return{debounce:(e,t)=>{let n;return(...a)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...a)},t)}}}}function At({script:r,styles:e,onReady:t}){const n=w.ref(!0),a=w.ref(!0),i=async()=>{const{libName:l,url:u,type:c}=r;if((c!==void 0&&["umd","es"].includes(c)?c:"umd")==="es"){await import(u),typeof t=="function"&&await t();return}const d=l.startsWith("kong-ui-")?l:`kong-ui-${l}`;return window[d]||(window[d]=await new Promise((f,g)=>{const y=document.createElement("script");y.async=!0,y.addEventListener("load",async()=>{typeof t=="function"&&await t(),n.value=!1,f(window[d])}),y.addEventListener("error",()=>{g(new Error(`Could not load '${d}' from ${u}`))}),y.src=u,document.head.appendChild(y)})),window[d]},o=async(l,u)=>{var c;for(const h of l){const d=document.createElement("link");d.type="text/css",d.rel="stylesheet",d.href=h;const f=u?document.querySelector(u):null,g=u?(c=f==null?void 0:f.shadowRoot)==null?void 0:c.children[0]:null;if(f&&g)try{g.appendChild(d)}catch{document.head.appendChild(d)}else document.head.appendChild(d)}};return{importPackage:async()=>{var u,c;if(!r||!r.url||typeof window>"u"||typeof document>"u")return;const l=w.computed(()=>!!(e&&(e!=null&&e.urls)&&(e!=null&&e.urls.length)&&e.shadowRoot));if((!e||!(e!=null&&e.urls)||!((u=e==null?void 0:e.urls)!=null&&u.length))&&(a.value=!1),e!=null&&e.urls&&((c=e==null?void 0:e.urls)!=null&&c.length)&&!l.value&&(await o(e.urls),a.value=!1),(!r.type||r.type==="umd")&&!l.value)return await i();await i(),await w.nextTick(),n.value=!1,e!=null&&e.urls&&l.value&&(await o(e.urls,e==null?void 0:e.shadowRoot),await w.nextTick(),a.value=!1)},loadingPackage:w.readonly(n),loadingStyles:w.readonly(a)}}var te=new WeakMap,fe=0;function Lt(r){if(!r.length)return"";for(var e="arg",t=0;t<r.length;++t){var n=void 0;r[t]===null||typeof r[t]!="object"&&typeof r[t]!="function"?typeof r[t]=="string"?n='"'+r[t]+'"':n=String(r[t]):te.has(r[t])?n=te.get(r[t]):(n=fe,te.set(r[t],fe++)),e+="@"+n}return e}function Nt(r){if(typeof r=="function")try{r=r()}catch{r=""}return Array.isArray(r)?r=Lt(r):r=String(r||""),r}var re=function(){function r(e){e===void 0&&(e=0),this.items=new Map,this.ttl=e}return r.prototype.serializeKey=function(e){return Nt(e)},r.prototype.get=function(e){var t=this.serializeKey(e);return this.items.get(t)},r.prototype.set=function(e,t,n){var a=this.serializeKey(e),i=n||this.ttl,o=Date.now(),s={data:t,createdAt:o,expiresAt:i?o+i:1/0};this.dispatchExpire(i,s,a),this.items.set(a,s)},r.prototype.dispatchExpire=function(e,t,n){var a=this;e&&setTimeout(function(){var i=Date.now(),o=i>=t.expiresAt;o&&a.delete(n)},e)},r.prototype.delete=function(e){this.items.delete(e)},r}();function Yt(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function It(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var Ft=function(r){return fetch(r).then(function(e){return e.json()})};const ne={isOnline:Yt,isDocumentVisible:It,fetcher:Ft};var k=globalThis&&globalThis.__assign||function(){return k=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},k.apply(this,arguments)},I=globalThis&&globalThis.__awaiter||function(r,e,t,n){function a(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function s(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?i(c.value):a(c.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},F=globalThis&&globalThis.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,a=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(c){u=[6,c],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},$t=globalThis&&globalThis.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),a,i=[],o;try{for(;(e===void 0||e-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i},Ht=globalThis&&globalThis.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))},he=new re,J=new re,ae=new re,ve={cache:he,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:ne.fetcher,isOnline:ne.isOnline,isDocumentVisible:ne.isDocumentVisible};function Vt(r,e,t){var n=J.get(r);if(n)n.data.push(e);else{var a=5e3;J.set(r,[e],t>0?t+a:t)}}function qt(r,e,t){if(t.isDocumentVisible()&&!(t.errorRetryCount!==void 0&&e>t.errorRetryCount)){var n=Math.min(e||0,t.errorRetryCount),a=n*t.errorRetryInterval;setTimeout(function(){r(null,{errorRetryCount:n+1,shouldRetryOnError:!0})},a)}}var me=function(r,e,t,n){return t===void 0&&(t=he),n===void 0&&(n=ve.ttl),I(void 0,void 0,void 0,function(){var a,i,o,s,l,u,c;return F(this,function(h){switch(h.label){case 0:if(!jt(e))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e];case 2:return a=h.sent(),[3,4];case 3:return s=h.sent(),i=s,[3,4];case 4:return[3,6];case 5:a=e,h.label=6;case 6:if(o=!1,l={data:a,error:i,isValidating:o},typeof a<"u")try{t.set(r,l,n)}catch(d){console.error("swrv(mutate): failed to set cache",d)}return u=J.get(r),u&&u.data.length&&(c=u.data.filter(function(d){return d.key===r}),c.forEach(function(d,f){typeof l.data<"u"&&(d.data=l.data),d.error=l.error,d.isValidating=l.isValidating;var g=f===c.length-1;g||delete c[f]}),c=c.filter(Boolean)),[2,l]}})})};function Gt(){for(var r=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,a,i=k({},ve),o=!1,s=!1,l=w.getCurrentInstance(),u=(l==null?void 0:l.proxy)||l;if(!u)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var c=(u==null?void 0:u.$isServer)||!1;e.length>=1&&(n=e[0]),e.length>=2&&(a=e[1]),e.length>2&&(i=k(k({},i),e[2]));var h=c?i.serverTTL:i.ttl,d=typeof n=="function"?n:w.ref(n);typeof a>"u"&&(a=i.fetcher);var f=null;f||(f=w.reactive({data:void 0,error:void 0,isValidating:!0,key:null}));var g=function(b,m){return I(r,void 0,void 0,function(){var $,D,O,E,N,H,U,z=this;return F(this,function(G){switch(G.label){case 0:return $=f.data===void 0,D=d.value,D?(O=i.cache.get(D),E=O&&O.data,f.isValidating=!0,E&&(f.data=E.data,f.error=E.error),N=b||a,!N||!i.isDocumentVisible()&&!$||(m==null?void 0:m.forceRevalidate)!==void 0&&!(m!=null&&m.forceRevalidate)?(f.isValidating=!1,[2]):O&&(H=!!(Date.now()-O.createdAt>=i.dedupingInterval||m!=null&&m.forceRevalidate),!H)?(f.isValidating=!1,[2]):(U=function(){return I(z,void 0,void 0,function(){var _,Z,T,P;return F(this,function(R){switch(R.label){case 0:return _=ae.get(D),_?[3,2]:(Z=Array.isArray(D)?D:[D],T=N.apply(void 0,Ht([],$t(Z),!1)),ae.set(D,T,i.dedupingInterval),[4,me(D,T,i.cache,h)]);case 1:return R.sent(),[3,4];case 2:return[4,me(D,_.data,i.cache,h)];case 3:R.sent(),R.label=4;case 4:return f.isValidating=!1,ae.delete(D),f.error!==void 0&&(P=!o&&i.shouldRetryOnError&&(m?m.shouldRetryOnError:!0),P&&qt(g,m?m.errorRetryCount:1,i)),[2]}})})},E&&i.revalidateDebounce?(setTimeout(function(){return I(z,void 0,void 0,function(){return F(this,function(_){switch(_.label){case 0:return o?[3,2]:[4,U()];case 1:_.sent(),_.label=2;case 2:return[2]}})})},i.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,U()];case 2:G.sent(),G.label=3;case 3:return[2]}})})},y=function(){return I(r,void 0,void 0,function(){return F(this,function(b){return[2,g(null,{shouldRetryOnError:!1})]})})},C=null;w.onMounted(function(){var b=function(){return I(r,void 0,void 0,function(){return F(this,function(m){switch(m.label){case 0:return!f.error&&i.isOnline()?[4,g()]:[3,2];case 1:return m.sent(),[3,3];case 2:C&&clearTimeout(C),m.label=3;case 3:return i.refreshInterval&&!o&&(C=setTimeout(b,i.refreshInterval)),[2]}})})};i.refreshInterval&&(C=setTimeout(b,i.refreshInterval)),i.revalidateOnFocus&&(document.addEventListener("visibilitychange",y,!1),window.addEventListener("focus",y,!1))}),w.onUnmounted(function(){o=!0,C&&clearTimeout(C),i.revalidateOnFocus&&(document.removeEventListener("visibilitychange",y,!1),window.removeEventListener("focus",y,!1));var b=J.get(d.value);b&&(b.data=b.data.filter(function(m){return m!==f}))});try{w.watch(d,function(b){w.isReadonly(d)||(d.value=b),f.key=b,f.isValidating=!!b,Vt(d.value,f,h),!c&&!s&&d.value&&g(),s=!1},{immediate:!0})}catch{}var L=k(k({},w.toRefs(f)),{mutate:function(b,m){return g(b,k(k({},m),{forceRevalidate:!0}))}});return L}function jt(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}function Bt(r,e,t){const{data:n,error:a,isValidating:i,mutate:o}=Gt(r,e,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...t});return{data:w.computed(()=>{var l;return(l=n.value)==null?void 0:l.data}),response:n,error:a,isValidating:i,revalidate:o}}var ge=(r=>(r.VALIDATING="VALIDATING",r.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",r.PENDING="PENDING",r.SUCCESS="SUCCESS",r.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",r.ERROR="ERROR",r.STALE_IF_ERROR="STALE_IF_ERROR",r))(ge||{});const Xt=r=>{var e,t,n,a,i;return r?!!((e=Object.keys(r))!=null&&e.length||(t=r.data)!=null&&t.length||(a=(n=r.data)==null?void 0:n.data)!=null&&a.length||!((i=r.data)!=null&&i.data)&&typeof r.data=="object"&&Object.keys(r==null?void 0:r.data).length):!1};function Qt(r=w.ref({}),e,t,n=Xt){const a=w.ref("PENDING");return w.watchEffect(()=>{const i=n(r.value);if(r.value&&i&&t.value){a.value="VALIDATING_HAS_DATA";return}if(r.value&&t.value){a.value="VALIDATING";return}if(r.value&&e.value){a.value="STALE_IF_ERROR";return}if(r.value===void 0&&!e.value){a.value="PENDING";return}if(r.value&&!e.value&&i){a.value="SUCCESS_HAS_DATA";return}if(r.value&&!e.value){a.value="SUCCESS";return}r.value===void 0&&e&&(a.value="ERROR")}),{state:a,swrvState:ge}}const K="khcp-user-table-preferences",we={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Jt(){const r=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch(o){console.error("useTablePreferences(tryParseJson)",o);return}},e=()=>{const i=r(localStorage.getItem(K));return!i||!Object.keys(i).length?new Map:new Map(Object.entries(i))};return{setTablePreferences:(i,o)=>{try{const s=e();s.set(i,o),localStorage.setItem(K,JSON.stringify(Object.fromEntries(s.entries())))}catch(s){console.error("useTablePreferences(setTablePreferences)",s)}},getTablePreferences:i=>{const o=e();return(o==null?void 0:o.get(i))||void 0||we},deleteAllTablePreferences:()=>{localStorage.removeItem(K)}}}function Kt(){const r=()=>{var l;return((l=window==null?void 0:window.location)==null?void 0:l.search)||""};return{getLocationSearch:r,getLocationHostname:()=>{var l;return((l=window==null?void 0:window.location)==null?void 0:l.hostname)||""},getLocationHref:()=>{var l;return((l=window==null?void 0:window.location)==null?void 0:l.href)||""},getLocationPathname:()=>{var l;return((l=window==null?void 0:window.location)==null?void 0:l.pathname)||""},getLocationOrigin:()=>{var l;return((l=window==null?void 0:window.location)==null?void 0:l.origin)||""},getUrlSearchParams:()=>new URLSearchParams(r()),setLocationAssign:l=>{window.location.assign(l)},setLocationReplace:l=>{window.location.replace(l)}}}p.DEFAULT_USER_TABLE_PREFERENCES=we,p.USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY=K,p.useDate=Ut,p.useDebounce=Wt,p.usePackage=At,p.useSwrvRequest=Bt,p.useSwrvState=Qt,p.useTablePreferences=Jt,p.useWindow=Kt,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,5 @@
1
+ import type { UserTablePreferences } from './useTablePreferences/types';
2
+ /** The localStorage key to store user table preferences */
3
+ export declare const USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY = "khcp-user-table-preferences";
4
+ export declare const DEFAULT_USER_TABLE_PREFERENCES: UserTablePreferences;
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,2DAA2D;AAC3D,eAAO,MAAM,wCAAwC,gCAAgC,CAAA;AAErF,eAAO,MAAM,8BAA8B,EAAE,oBAI5C,CAAA"}
@@ -0,0 +1,12 @@
1
+ export { default as useDate } from './useDate';
2
+ export { default as useDebounce } from './useDebounce';
3
+ export { default as usePackage } from './usePackage';
4
+ export { default as useSwrvRequest } from './useSwrvRequest';
5
+ export { default as useSwrvState } from './useSwrvState';
6
+ export { default as useTablePreferences } from './useTablePreferences';
7
+ export { default as useWindow } from './useWindow';
8
+ export * from './usePackage/types';
9
+ export * from './useTablePreferences/types';
10
+ export * from './useWindow/types';
11
+ export * from './constants';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlD,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mBAAmB,CAAA;AAGjC,cAAc,aAAa,CAAA"}
@@ -0,0 +1,5 @@
1
+ export default function useDate(): {
2
+ formatDateBy: (seconds: number, options?: Intl.DateTimeFormatOptions) => string | null;
3
+ formatUnixToDate: (timestamp: number, omitTimezone?: boolean) => string;
4
+ };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useDate/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,OAAO;4BAOE,MAAM,YAAW,KAAK,qBAAqB,KAAQ,MAAM,GAAG,IAAI;kCA6B1D,MAAM,iBAAiB,OAAO,KAAG,MAAM;EAoB7E"}
@@ -0,0 +1,4 @@
1
+ export default function useDebounce(): {
2
+ debounce: (initialFunction: (...args: any) => any, delay: number) => (...args: any) => void;
3
+ };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useDebounce/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,WAAW;0CAQY,GAAG,KAAK,GAAG,SAAS,MAAM,eAAa,GAAG,KAAK,IAAI;EAkBjG"}
@@ -0,0 +1,8 @@
1
+ import { Ref } from 'vue';
2
+ import type { ImportParams } from './types';
3
+ export default function usePackage({ script, styles, onReady }: ImportParams): {
4
+ importPackage: () => Promise<any>;
5
+ loadingPackage: Ref<boolean>;
6
+ loadingStyles: Ref<boolean>;
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/usePackage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,GAAG,EAA6C,MAAM,KAAK,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG;IAC7E,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CAC7B,CA6IA"}
@@ -0,0 +1,24 @@
1
+ type ScriptType = 'umd' | 'es';
2
+ interface PackageScript {
3
+ /** String of the lib name defined in the component's vite.config.ts. Only required for UMD imports; ES imports can pass an empty string. Example: 'demo-component' or 'kong-ui-demo-component' */
4
+ libName: string;
5
+ /** String of URL of script to import */
6
+ url: string;
7
+ /** The type of the script bundle being imported, one of 'umd' or 'es'. Default is 'umd' */
8
+ type?: ScriptType;
9
+ }
10
+ export interface ImportParams {
11
+ /** Script import config object */
12
+ script: PackageScript;
13
+ /** Style import config object */
14
+ styles?: {
15
+ /** Array of strings of CSS assets. */
16
+ urls?: string[];
17
+ /** Query selector string of the shadowRoot element if adding the styles to the shadowDOM. */
18
+ shadowRoot?: string;
19
+ };
20
+ /** Asynchronous function to call once package has been loaded. */
21
+ onReady?: () => Promise<void>;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/usePackage/types/index.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,KAAK,GAAG,IAAI,CAAA;AAE9B,UAAU,aAAa;IACrB,kMAAkM;IAClM,OAAO,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAA;IACX,2FAA2F;IAC3F,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,iCAAiC;IACjC,MAAM,CAAC,EAAE;QACP,sCAAsC;QACtC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;QACf,6FAA6F;QAC7F,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B"}
@@ -0,0 +1,13 @@
1
+ import { IConfig } from 'swrv';
2
+ import { AxiosResponse, AxiosError } from 'axios';
3
+ import { IKey, fetcherFn } from 'swrv/dist/types';
4
+ export default function useSwrvRequest<Data = unknown, Error = {
5
+ message: string;
6
+ }>(key: IKey, fn?: fetcherFn<AxiosResponse<Data>>, config?: IConfig): {
7
+ data: import("vue").ComputedRef<Data | undefined>;
8
+ response: import("vue").Ref<AxiosResponse<Data, any> | undefined>;
9
+ error: import("vue").Ref<AxiosError<Error, any> | undefined>;
10
+ isValidating: import("vue").Ref<boolean>;
11
+ revalidate: (data?: fetcherFn<AxiosResponse<Data, any>> | undefined, opts?: import("swrv/dist/types").revalidateOptions | undefined) => Promise<void>;
12
+ };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useSwrvRequest/index.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGjD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO;;;;;;EAsBnJ"}
@@ -0,0 +1,16 @@
1
+ import { Ref } from 'vue';
2
+ declare enum swrvState {
3
+ VALIDATING = "VALIDATING",
4
+ VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA",
5
+ PENDING = "PENDING",
6
+ SUCCESS = "SUCCESS",
7
+ SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA",
8
+ ERROR = "ERROR",
9
+ STALE_IF_ERROR = "STALE_IF_ERROR"
10
+ }
11
+ export default function useSwrvState(response: any, error: Ref<any>, isValidating: Ref<boolean>, hasDataCallback?: (response: any) => boolean): {
12
+ state: Ref<swrvState>;
13
+ swrvState: typeof swrvState;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useSwrvState/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,GAAG,EAAe,MAAM,KAAK,CAAA;AAE3C,aAAK,SAAS;IACZ,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,gBAAgB,qBAAqB;IACrC,KAAK,UAAU;IACf,cAAc,mBAAmB;CAClC;AAkBD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,KAAe,EACvB,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,EACf,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,EAC1B,eAAe,GAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAwB;;;EAoD7D"}
@@ -0,0 +1,7 @@
1
+ import type { UserTablePreferences } from './types';
2
+ export default function useTablePreferences(): {
3
+ setTablePreferences: (tableKey: string, newPreferences: UserTablePreferences) => void;
4
+ getTablePreferences: (tableKey: string) => UserTablePreferences;
5
+ deleteAllTablePreferences: () => void;
6
+ };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useTablePreferences/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,MAAM,CAAC,OAAO,UAAU,mBAAmB;oCA0CF,MAAM,kBAAkB,oBAAoB,KAAG,IAAI;oCAmBnD,MAAM,KAAG,oBAAoB;qCAY9B,IAAI;EAS3C"}
@@ -0,0 +1,9 @@
1
+ export interface UserTablePreferences {
2
+ /** The number of items to display per page */
3
+ pageSize?: number;
4
+ /** The column to sort by's `key` defined in the table headers */
5
+ sortColumnKey?: string;
6
+ /** The order by which to sort the column, one of `asc` or `desc` */
7
+ sortColumnOrder?: 'asc' | 'desc';
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/useTablePreferences/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,eAAe,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACjC"}
@@ -0,0 +1,3 @@
1
+ import type { WindowComposable } from './types';
2
+ export default function useWindow(): WindowComposable;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/useWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,gBAAgB,CA+BpD"}
@@ -0,0 +1,11 @@
1
+ export interface WindowComposable {
2
+ getLocationHostname: () => string;
3
+ getLocationHref: () => string;
4
+ getLocationOrigin: () => string;
5
+ getLocationPathname: () => string;
6
+ getLocationSearch: () => string;
7
+ getUrlSearchParams: () => URLSearchParams;
8
+ setLocationAssign: (url: string) => void;
9
+ setLocationReplace: (url: string) => void;
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/useWindow/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAClC,eAAe,EAAE,MAAM,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAClC,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAC1C,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C"}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@kong-ui-public/core",
3
+ "version": "1.0.1-pr.615.98eb515.0",
4
+ "type": "module",
5
+ "main": "./dist/core.umd.js",
6
+ "module": "./dist/core.es.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/core.es.js",
14
+ "require": "./dist/core.umd.js"
15
+ },
16
+ "./package.json": "./package.json",
17
+ "./dist/*": "./dist/*"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/Kong/public-ui-components.git",
25
+ "directory": "packages/core/core"
26
+ },
27
+ "homepage": "https://github.com/Kong/public-ui-components/tree/main/packages/core/core",
28
+ "author": "Kong, Inc.",
29
+ "license": "Apache-2.0",
30
+ "volta": {
31
+ "extends": "../../../package.json"
32
+ },
33
+ "distSizeChecker": {
34
+ "errorLimit": "246KB"
35
+ },
36
+ "peerDependencies": {
37
+ "axios": "^1.4.0",
38
+ "swrv": "^1.0.4",
39
+ "vue": "^3.2.47"
40
+ },
41
+ "dependencies": {
42
+ "date-fns": "^2.30.0"
43
+ },
44
+ "devDependencies": {
45
+ "axios": "^1.4.0",
46
+ "swrv": "^1.0.4"
47
+ },
48
+ "scripts": {
49
+ "dev": "cross-env USE_SANDBOX=true vite",
50
+ "build": "run-s typecheck build:package build:types",
51
+ "build:package": "vite build -m production",
52
+ "build:analyzer": "BUILD_VISUALIZER='core/core' vite build -m production",
53
+ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly",
54
+ "preview:package": "vite preview --port 4173",
55
+ "preview": "cross-env USE_SANDBOX=true run-s build:package preview:package",
56
+ "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'",
57
+ "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix",
58
+ "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'",
59
+ "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix",
60
+ "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit",
61
+ "test:unit": "cross-env FORCE_COLOR=1 vitest run",
62
+ "test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
63
+ }
64
+ }