From 3c898faf67c3ce321d1012a694329197d435b236 Mon Sep 17 00:00:00 2001 From: acelaya Date: Sat, 18 Mar 2023 15:34:25 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20preview-env=20from=20@=20shlin?= =?UTF-8?q?kio/shlink-web-client@ddaec7c6acdb290fbf2881feb3d64d0fab5a445c?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/{index-245198b7.js => index-2ae00fee.js} | 4 ++-- feature/tags-stats/index.html | 2 +- feature/tags-stats/service-worker.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename feature/tags-stats/assets/{index-245198b7.js => index-2ae00fee.js} (98%) diff --git a/feature/tags-stats/assets/index-245198b7.js b/feature/tags-stats/assets/index-2ae00fee.js similarity index 98% rename from feature/tags-stats/assets/index-245198b7.js rename to feature/tags-stats/assets/index-2ae00fee.js index 6d7055e9..9d1fe5fe 100644 --- a/feature/tags-stats/assets/index-245198b7.js +++ b/feature/tags-stats/assets/index-2ae00fee.js @@ -120,7 +120,7 @@ ${ae.current.stack} \v\f\r                 \u2028\u2029\uFEFF`,MZ="​",RZ=typeof String.prototype.trim=="function",NZ=bt(!RZ||Fu.trim()||!MZ.trim()?function(t){var n=new RegExp("^["+Fu+"]["+Fu+"]*"),r=new RegExp("["+Fu+"]["+Fu+"]*$");return t.replace(n,"").replace(r,"")}:function(t){return t.trim()});const LZ=NZ;var DZ=ut(function(t,n){for(var r=0,i=Math.min(t.length,n.length),o={};r!!(e!=null&&e.url)&&!!(e!=null&&e.apiKey),Ms=e=>!!(e!=null&&e.id),i_=e=>!!(e!=null&&e.version),AZ=e=>!!(e!=null&&e.serverNotFound),Yd=e=>Ms(e)?e.id:"",IZ=e=>vZ(["id","autoConnect"],e),o_=(e,t,n)=>e!==t?"ASC":n?{ASC:"DESC",DESC:void 0}[n]:"ASC",LI=(e,{field:t,dir:n})=>!t||!n?e:e.sort((r,i)=>{const o=n==="ASC"?1:-1,s=n==="ASC"?-1:1;return r[t]>i[t]?o:s}),DI=e=>e.dir?`${e.field}-${e.dir}`:void 0,FZ=e=>{const[t,n]=e.split("-");return{field:t,dir:n}};var $Z=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},pM=typeof Symbol<"u"&&Symbol,jZ=$Z,BZ=function(){return typeof pM!="function"||typeof Symbol!="function"||typeof pM("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:jZ()},zZ="Function.prototype.bind called on incompatible ",J0=Array.prototype.slice,UZ=Object.prototype.toString,VZ="[object Function]",HZ=function(t){var n=this;if(typeof n!="function"||UZ.call(n)!==VZ)throw new TypeError(zZ+n);for(var r=J0.call(arguments,1),i,o=function(){if(this instanceof i){var f=n.apply(this,r.concat(J0.call(arguments)));return Object(f)===f?f:this}else return n.apply(t,r.concat(J0.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l"u"?lt:ns(Uint8Array),mc={"%AggregateError%":typeof AggregateError>"u"?lt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?lt:ArrayBuffer,"%ArrayIteratorPrototype%":Rl?ns([][Symbol.iterator]()):lt,"%AsyncFromSyncIteratorPrototype%":lt,"%AsyncFunction%":zl,"%AsyncGenerator%":zl,"%AsyncGeneratorFunction%":zl,"%AsyncIteratorPrototype%":zl,"%Atomics%":typeof Atomics>"u"?lt:Atomics,"%BigInt%":typeof BigInt>"u"?lt:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?lt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?lt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?lt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?lt:FinalizationRegistry,"%Function%":AI,"%GeneratorFunction%":zl,"%Int8Array%":typeof Int8Array>"u"?lt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?lt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?lt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Rl?ns(ns([][Symbol.iterator]())):lt,"%JSON%":typeof JSON=="object"?JSON:lt,"%Map%":typeof Map>"u"?lt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Rl?lt:ns(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?lt:Promise,"%Proxy%":typeof Proxy>"u"?lt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?lt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?lt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Rl?lt:ns(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?lt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Rl?ns(""[Symbol.iterator]()):lt,"%Symbol%":Rl?Symbol:lt,"%SyntaxError%":hd,"%ThrowTypeError%":GZ,"%TypedArray%":ZZ,"%TypeError%":pc,"%Uint8Array%":typeof Uint8Array>"u"?lt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?lt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?lt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?lt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?lt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?lt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?lt:WeakSet},KZ=function e(t){var n;if(t==="%AsyncFunction%")n=e1("async function () {}");else if(t==="%GeneratorFunction%")n=e1("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=e1("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&(n=ns(i.prototype))}return mc[t]=n,n},mM={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},s_=cC,Xg=qZ,XZ=s_.call(Function.call,Array.prototype.concat),QZ=s_.call(Function.apply,Array.prototype.splice),gM=s_.call(Function.call,String.prototype.replace),Qg=s_.call(Function.call,String.prototype.slice),JZ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,eK=/\\(\\)?/g,tK=function(t){var n=Qg(t,0,1),r=Qg(t,-1);if(n==="%"&&r!=="%")throw new hd("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new hd("invalid intrinsic syntax, expected opening `%`");var i=[];return gM(t,JZ,function(o,s,a,l){i[i.length]=a?gM(l,eK,"$1"):s||o}),i},nK=function(t,n){var r=t,i;if(Xg(mM,r)&&(i=mM[r],r="%"+i[0]+"%"),Xg(mc,r)){var o=mc[r];if(o===zl&&(o=KZ(r)),typeof o>"u"&&!n)throw new pc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new hd("intrinsic "+t+" does not exist!")},uC=function(t,n){if(typeof t!="string"||t.length===0)throw new pc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new pc('"allowMissing" argument must be a boolean');var r=tK(t),i=r.length>0?r[0]:"",o=nK("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],QZ(r,XZ([0,1],c)));for(var f=1,h=!0;f=r.length){var v=Ua(a,p);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?a=v.get:a=a[p]}else h=Xg(a,p),a=a[p];h&&!l&&(mc[s]=a)}}return a},hw={},rK={get exports(){return hw},set exports(e){hw=e}};(function(e){var t=cC,n=uC,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}e.exports=function(h){var p=o(t,i,arguments);if(s&&a){var m=s(p,"length");m.configurable&&a(p,"length",{value:1+l(0,h.length-(arguments.length-1))})}return p};var c=function(){return o(t,r,arguments)};a?a(e.exports,"apply",{value:c}):e.exports.apply=c})(rK);var II=uC,FI=hw,iK=FI(II("String.prototype.indexOf")),oK=function(t,n){var r=II(t,!!n);return typeof r=="function"&&iK(t,".prototype.")>-1?FI(r):r};const sK={},aK=Object.freeze(Object.defineProperty({__proto__:null,default:sK},Symbol.toStringTag,{value:"Module"})),lK=g7(aK);var fC=typeof Map=="function"&&Map.prototype,n1=Object.getOwnPropertyDescriptor&&fC?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Jg=fC&&n1&&typeof n1.get=="function"?n1.get:null,cK=fC&&Map.prototype.forEach,dC=typeof Set=="function"&&Set.prototype,r1=Object.getOwnPropertyDescriptor&&dC?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ev=dC&&r1&&typeof r1.get=="function"?r1.get:null,uK=dC&&Set.prototype.forEach,fK=typeof WeakMap=="function"&&WeakMap.prototype,xf=fK?WeakMap.prototype.has:null,dK=typeof WeakSet=="function"&&WeakSet.prototype,Sf=dK?WeakSet.prototype.has:null,hK=typeof WeakRef=="function"&&WeakRef.prototype,vM=hK?WeakRef.prototype.deref:null,pK=Boolean.prototype.valueOf,mK=Object.prototype.toString,gK=Function.prototype.toString,vK=String.prototype.match,hC=String.prototype.slice,gs=String.prototype.replace,yK=String.prototype.toUpperCase,yM=String.prototype.toLowerCase,$I=RegExp.prototype.test,_M=Array.prototype.concat,Vi=Array.prototype.join,_K=Array.prototype.slice,bM=Math.floor,pw=typeof BigInt=="function"?BigInt.prototype.valueOf:null,i1=Object.getOwnPropertySymbols,mw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ir=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Lc||"symbol")?Symbol.toStringTag:null,jI=Object.prototype.propertyIsEnumerable,wM=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function xM(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||$I.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-bM(-e):bM(e);if(r!==e){var i=String(r),o=hC.call(t,i.length+1);return gs.call(i,n,"$&_")+"."+gs.call(gs.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return gs.call(t,n,"$&_")}var o1=lK.custom,s1=o1&&zI(o1)?o1:null,bK=function e(t,n,r,i){var o=n||{};if(rs(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(rs(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=rs(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(rs(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(rs(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return VI(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?xM(t,l):l}if(typeof t=="bigint"){var c=String(t)+"n";return a?xM(t,c):c}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof t=="object")return gw(t)?"[Array]":"[Object]";var h=jK(o,r);if(typeof i>"u")i=[];else if(UI(i,t)>=0)return"[Circular]";function p(ee,K,te){if(K&&(i=_K.call(i),i.push(K)),te){var oe={depth:o.depth};return rs(o,"quoteStyle")&&(oe.quoteStyle=o.quoteStyle),e(ee,oe,r+1,i)}return e(ee,o,r+1,i)}if(typeof t=="function"){var m=MK(t),g=gp(t,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(g.length>0?" { "+Vi.call(g,", ")+" }":"")}if(zI(t)){var v=Lc?gs.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):mw.call(t);return typeof t=="object"&&!Lc?$u(v):v}if(IK(t)){for(var w="<"+yM.call(String(t.nodeName)),y=t.attributes||[],b=0;b",w}if(gw(t)){if(t.length===0)return"[]";var x=gp(t,p);return h&&!$K(x)?"["+vw(x,h)+"]":"[ "+Vi.call(x,", ")+" ]"}if(CK(t)){var T=gp(t,p);return"cause"in t&&!jI.call(t,"cause")?"{ ["+String(t)+"] "+Vi.call(_M.call("[cause]: "+p(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Vi.call(T,", ")+" }"}if(typeof t=="object"&&s){if(s1&&typeof t[s1]=="function")return t[s1]();if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(RK(t)){var P=[];return cK.call(t,function(ee,K){P.push(p(K,t,!0)+" => "+p(ee,t))}),SM("Map",Jg.call(t),P,h)}if(DK(t)){var k=[];return uK.call(t,function(ee){k.push(p(ee,t))}),SM("Set",ev.call(t),k,h)}if(NK(t))return a1("WeakMap");if(AK(t))return a1("WeakSet");if(LK(t))return a1("WeakRef");if(TK(t))return $u(p(Number(t)));if(PK(t))return $u(p(pw.call(t)));if(OK(t))return $u(pK.call(t));if(EK(t))return $u(p(String(t)));if(!xK(t)&&!SK(t)){var N=gp(t,p),D=wM?wM(t)===Object.prototype:t instanceof Object||t.constructor===Object,z=t instanceof Object?"":"null prototype",A=!D&&ir&&Object(t)===t&&ir in t?hC.call(ea(t),8,-1):z?"Object":"",Y=D||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",q=Y+(A||z?"["+Vi.call(_M.call([],A||[],z||[]),": ")+"] ":"");return N.length===0?q+"{}":h?q+"{"+vw(N,h)+"}":q+"{ "+Vi.call(N,", ")+" }"}return String(t)};function BI(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function wK(e){return gs.call(String(e),/"/g,""")}function gw(e){return ea(e)==="[object Array]"&&(!ir||!(typeof e=="object"&&ir in e))}function xK(e){return ea(e)==="[object Date]"&&(!ir||!(typeof e=="object"&&ir in e))}function SK(e){return ea(e)==="[object RegExp]"&&(!ir||!(typeof e=="object"&&ir in e))}function CK(e){return ea(e)==="[object Error]"&&(!ir||!(typeof e=="object"&&ir in e))}function EK(e){return ea(e)==="[object String]"&&(!ir||!(typeof e=="object"&&ir in e))}function TK(e){return ea(e)==="[object Number]"&&(!ir||!(typeof e=="object"&&ir in e))}function OK(e){return ea(e)==="[object Boolean]"&&(!ir||!(typeof e=="object"&&ir in e))}function zI(e){if(Lc)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!mw)return!1;try{return mw.call(e),!0}catch{}return!1}function PK(e){if(!e||typeof e!="object"||!pw)return!1;try{return pw.call(e),!0}catch{}return!1}var kK=Object.prototype.hasOwnProperty||function(e){return e in this};function rs(e,t){return kK.call(e,t)}function ea(e){return mK.call(e)}function MK(e){if(e.name)return e.name;var t=vK.call(gK.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function UI(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return VI(hC.call(e,0,t.maxStringLength),t)+r}var i=gs.call(gs.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,FK);return BI(i,"single",t)}function FK(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+yK.call(t.toString(16))}function $u(e){return"Object("+e+")"}function a1(e){return e+" { ? }"}function SM(e,t,n,r){var i=r?vw(n,r):Vi.call(n,", ");return e+" ("+t+") {"+i+"}"}function $K(e){for(var t=0;t=0)return!1;return!0}function jK(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Vi.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Vi.call(Array(t+1),n)}}function vw(e,t){if(e.length===0)return"";var n=` `+t.prev+t.base;return n+Vi.call(e,","+n)+` -`+t.prev}function gp(e,t){var n=gw(e),r=[];if(n){r.length=e.length;for(var i=0;i1;){var n=t.pop(),r=n.obj[n.prop];if(Ma(r)){for(var i=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===eX.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+$i[c];continue}if(c<2048){a=a+($i[192|c>>6]+$i[128|c&63]);continue}if(c<55296||c>=57344){a=a+($i[224|c>>12]+$i[128|c>>6&63]+$i[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=$i[240|c>>18]+$i[128|c>>12&63]+$i[128|c>>6&63]+$i[128|c&63]}return a},sX=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],i=0;i"u"&&(x=0)}if(typeof l=="function"?y=l(n,y):y instanceof Date?y=h(y):r==="comma"&&vo(y)&&(y=yw.maybeMap(y,function($){return $ instanceof Date?h($):$})),y===null){if(o)return a&&!g?a(n,zn.encoder,v,"key",p):n;y=""}if(mX(y)||yw.isBuffer(y)){if(a){var k=g?n:a(n,zn.encoder,v,"key",p);if(r==="comma"&&g){for(var N=dX.call(String(y),","),D="",z=0;z"u")return A;var Y;if(r==="comma"&&vo(y))Y=[{value:y.length>0?y.join(",")||null:void 0}];else if(vo(l))Y=l;else{var q=Object.keys(y);Y=c?q.sort(c):q}for(var ee=i&&vo(y)&&y.length===1?n+"[]":n,K=0;K"u"?zn.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:zn.charsetSentinel,delimiter:typeof t.delimiter>"u"?zn.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:zn.encode,encoder:typeof t.encoder=="function"?t.encoder:zn.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:zn.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:zn.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:zn.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:zn.strictNullHandling}},yX=function(e,t){var n=e,r=vX(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):vo(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;t&&t.arrayFormat in CM?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var l=CM[a];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var f=YI(),h=0;h0?g+m:""},Dc=WI,_w=Object.prototype.hasOwnProperty,_X=Array.isArray,En={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Dc.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},bX=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},GI=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},wX="utf8=%26%2310003%3B",xX="utf8=%E2%9C%93",SX=function(t,n){var r={},i=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l-1&&(g=_X(g)?[g]:g),_w.call(r,m)?r[m]=Dc.combine(r[m],g):r[m]=g}return r},CX=function(e,t,n,r){for(var i=r?t:GI(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!n.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},EX=function(t,n,r,i){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,f=[];if(c){if(!r.plainObjects&&_w.call(Object.prototype,c)&&!r.allowPrototypes)return;f.push(c)}for(var h=0;r.depth>0&&(l=a.exec(o))!==null&&h"u"?En.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?En.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:En.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:En.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:En.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:En.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:En.comma,decoder:typeof t.decoder=="function"?t.decoder:En.decoder,delimiter:typeof t.delimiter=="string"||Dc.isRegExp(t.delimiter)?t.delimiter:En.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:En.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:En.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:En.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:En.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:En.strictNullHandling}},OX=function(e,t){var n=TX(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?SX(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;sZI.parse(e,{ignoreQueryPrefix:!0}),qd=e=>ZI.stringify(e,{arrayFormat:"brackets"});var a_=(e=>(e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.INVALID_SHORT_URL_DELETION="INVALID_SHORT_URL_DELETION",e.DOMAIN_NOT_FOUND="DOMAIN_NOT_FOUND",e.FORBIDDEN_OPERATION="FORBIDDEN_OPERATION",e.INVALID_URL="INVALID_URL",e.INVALID_SLUG="INVALID_SLUG",e.INVALID_SHORTCODE="INVALID_SHORTCODE",e.TAG_CONFLICT="TAG_CONFLICT",e.TAG_NOT_FOUND="TAG_NOT_FOUND",e.MERCURE_NOT_CONFIGURED="MERCURE_NOT_CONFIGURED",e.INVALID_AUTHORIZATION="INVALID_AUTHORIZATION",e.INVALID_API_KEY="INVALID_API_KEY",e.NOT_FOUND="NOT_FOUND",e))(a_||{}),l_=(e=>(e.INVALID_ARGUMENT="https://shlink.io/api/error/invalid-data",e.INVALID_SHORT_URL_DELETION="https://shlink.io/api/error/invalid-short-url-deletion",e.DOMAIN_NOT_FOUND="https://shlink.io/api/error/domain-not-found",e.FORBIDDEN_OPERATION="https://shlink.io/api/error/forbidden-tag-operation",e.INVALID_URL="https://shlink.io/api/error/invalid-url",e.INVALID_SLUG="https://shlink.io/api/error/non-unique-slug",e.INVALID_SHORTCODE="https://shlink.io/api/error/short-url-not-found",e.TAG_CONFLICT="https://shlink.io/api/error/tag-conflict",e.TAG_NOT_FOUND="https://shlink.io/api/error/tag-not-found",e.MERCURE_NOT_CONFIGURED="https://shlink.io/api/error/mercure-not-configured",e.INVALID_AUTHORIZATION="https://shlink.io/api/error/missing-authentication",e.INVALID_API_KEY="https://shlink.io/api/error/invalid-api-key",e.NOT_FOUND="https://shlink.io/api/error/not-found",e))(l_||{});const RX=e=>!!e&&typeof e=="object"&&["type","detail","title","status"].every(t=>t in e),io=e=>RX(e)?e:void 0,NX=e=>(e==null?void 0:e.type)===a_.INVALID_ARGUMENT||(e==null?void 0:e.type)===l_.INVALID_ARGUMENT,LX=e=>(e==null?void 0:e.type)==="INVALID_SHORTCODE_DELETION"||(e==null?void 0:e.type)===a_.INVALID_SHORT_URL_DELETION||(e==null?void 0:e.type)===l_.INVALID_SHORT_URL_DELETION,DX=e=>((e==null?void 0:e.type)===a_.NOT_FOUND||(e==null?void 0:e.type)===l_.NOT_FOUND)&&(e==null?void 0:e.status)===404,AX=(e,t)=>`${e}/rest/v${t}`,IX=Wd(Bo),FX=({orderBy:e={},excludeMaxVisitsReached:t,excludePastValidUntil:n,...r})=>({...r,excludeMaxVisitsReached:t===!0?"true":void 0,excludePastValidUntil:n===!0?"true":void 0,orderBy:DI(e)});class $X{constructor(t,n,r){Se(this,"apiVersion");Se(this,"listShortUrls",async(t={})=>this.performRequest("/short-urls","GET",FX(t)).then(({shortUrls:n})=>n));Se(this,"createShortUrl",async t=>{const n=Wd(r=>qn(r)||Bo(r),t);return this.performRequest("/short-urls","POST",{},n)});Se(this,"getShortUrlVisits",async(t,n)=>this.performRequest(`/short-urls/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getTagVisits",async(t,n)=>this.performRequest(`/tags/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getDomainVisits",async(t,n)=>this.performRequest(`/domains/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getOrphanVisits",async t=>this.performRequest("/visits/orphan","GET",t).then(({visits:n})=>n));Se(this,"getNonOrphanVisits",async t=>this.performRequest("/visits/non-orphan","GET",t).then(({visits:n})=>n));Se(this,"getVisitsOverview",async()=>this.performRequest("/visits").then(({visits:t})=>t));Se(this,"getShortUrl",async(t,n)=>this.performRequest(`/short-urls/${t}`,"GET",{domain:n}));Se(this,"deleteShortUrl",async(t,n)=>this.performEmptyRequest(`/short-urls/${t}`,"DELETE",{domain:n}));Se(this,"updateShortUrl",async(t,n,r)=>this.performRequest(`/short-urls/${t}`,"PATCH",{domain:n},r));Se(this,"listTags",async t=>t?this.performRequest("/tags/stats","GET").then(({tags:n})=>n).then(({data:n})=>({tags:n.map(({tag:r})=>r),stats:n})):this.performRequest("/tags","GET",{withStats:"true"}).then(({tags:n})=>n).then(({data:n,stats:r})=>({tags:n,stats:r})));Se(this,"deleteTags",async t=>this.performEmptyRequest("/tags","DELETE",{tags:t}).then(()=>({tags:t})));Se(this,"editTag",async(t,n)=>this.performEmptyRequest("/tags","PUT",{},{oldName:t,newName:n}).then(()=>({oldName:t,newName:n})));Se(this,"health",async()=>this.performRequest("/health","GET"));Se(this,"mercureInfo",async()=>this.performRequest("/mercure-info","GET"));Se(this,"listDomains",async()=>this.performRequest("/domains").then(({domains:t})=>t));Se(this,"editDomainRedirects",async t=>this.performRequest("/domains/redirects","PATCH",{},t));Se(this,"performRequest",async(t,n="GET",r={},i)=>this.httpClient.fetchJson(...this.toFetchParams(t,n,r,i)).catch(this.handleFetchError(()=>this.httpClient.fetchJson(...this.toFetchParams(t,n,r,i)))));Se(this,"performEmptyRequest",async(t,n="GET",r={},i)=>this.httpClient.fetchEmpty(...this.toFetchParams(t,n,r,i)).catch(this.handleFetchError(()=>this.httpClient.fetchEmpty(...this.toFetchParams(t,n,r,i)))));Se(this,"toFetchParams",(t,n,r={},i)=>{const o=qd(IX(r)),s=qn(o)?"":`?${o}`;return[`${AX(this.baseUrl,this.apiVersion)}${t}${s}`,{method:n,body:i&&JSON.stringify(i),headers:{"X-Api-Key":this.apiKey}}]});Se(this,"handleFetchError",t=>n=>{if(!DX(io(n)))throw n;return this.apiVersion=2,t()});this.httpClient=t,this.baseUrl=n,this.apiKey=r,this.apiVersion=3}}const f1={},jX=e=>typeof e=="function",BX=e=>{const{selectedServer:t}=e();if(!lC(t))throw new Error("There's no selected server or it is not found");return t},zX=e=>t=>{const{url:n,apiKey:r}=jX(t)?BX(t):t,i=`${n}_${r}`;return f1[i]||(f1[i]=new $X(e,n,r)),f1[i]},UX=e=>{e.serviceFactory("buildShlinkApiClient",zX,"HttpClient")};var bw={},VX={get exports(){return bw},set exports(e){bw=e}};/*! +`+t.prev}function gp(e,t){var n=gw(e),r=[];if(n){r.length=e.length;for(var i=0;i1;){var n=t.pop(),r=n.obj[n.prop];if(Ma(r)){for(var i=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===eX.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+$i[c];continue}if(c<2048){a=a+($i[192|c>>6]+$i[128|c&63]);continue}if(c<55296||c>=57344){a=a+($i[224|c>>12]+$i[128|c>>6&63]+$i[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=$i[240|c>>18]+$i[128|c>>12&63]+$i[128|c>>6&63]+$i[128|c&63]}return a},sX=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],i=0;i"u"&&(x=0)}if(typeof l=="function"?y=l(n,y):y instanceof Date?y=h(y):r==="comma"&&vo(y)&&(y=yw.maybeMap(y,function($){return $ instanceof Date?h($):$})),y===null){if(o)return a&&!g?a(n,zn.encoder,v,"key",p):n;y=""}if(mX(y)||yw.isBuffer(y)){if(a){var k=g?n:a(n,zn.encoder,v,"key",p);if(r==="comma"&&g){for(var N=dX.call(String(y),","),D="",z=0;z"u")return A;var Y;if(r==="comma"&&vo(y))Y=[{value:y.length>0?y.join(",")||null:void 0}];else if(vo(l))Y=l;else{var q=Object.keys(y);Y=c?q.sort(c):q}for(var ee=i&&vo(y)&&y.length===1?n+"[]":n,K=0;K"u"?zn.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:zn.charsetSentinel,delimiter:typeof t.delimiter>"u"?zn.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:zn.encode,encoder:typeof t.encoder=="function"?t.encoder:zn.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:zn.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:zn.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:zn.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:zn.strictNullHandling}},yX=function(e,t){var n=e,r=vX(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):vo(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;t&&t.arrayFormat in CM?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var l=CM[a];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var f=YI(),h=0;h0?g+m:""},Dc=WI,_w=Object.prototype.hasOwnProperty,_X=Array.isArray,En={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Dc.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},bX=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},GI=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},wX="utf8=%26%2310003%3B",xX="utf8=%E2%9C%93",SX=function(t,n){var r={},i=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l-1&&(g=_X(g)?[g]:g),_w.call(r,m)?r[m]=Dc.combine(r[m],g):r[m]=g}return r},CX=function(e,t,n,r){for(var i=r?t:GI(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!n.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},EX=function(t,n,r,i){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,f=[];if(c){if(!r.plainObjects&&_w.call(Object.prototype,c)&&!r.allowPrototypes)return;f.push(c)}for(var h=0;r.depth>0&&(l=a.exec(o))!==null&&h"u"?En.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?En.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:En.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:En.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:En.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:En.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:En.comma,decoder:typeof t.decoder=="function"?t.decoder:En.decoder,delimiter:typeof t.delimiter=="string"||Dc.isRegExp(t.delimiter)?t.delimiter:En.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:En.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:En.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:En.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:En.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:En.strictNullHandling}},OX=function(e,t){var n=TX(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?SX(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;sZI.parse(e,{ignoreQueryPrefix:!0}),qd=e=>ZI.stringify(e,{arrayFormat:"brackets"});var a_=(e=>(e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.INVALID_SHORT_URL_DELETION="INVALID_SHORT_URL_DELETION",e.DOMAIN_NOT_FOUND="DOMAIN_NOT_FOUND",e.FORBIDDEN_OPERATION="FORBIDDEN_OPERATION",e.INVALID_URL="INVALID_URL",e.INVALID_SLUG="INVALID_SLUG",e.INVALID_SHORTCODE="INVALID_SHORTCODE",e.TAG_CONFLICT="TAG_CONFLICT",e.TAG_NOT_FOUND="TAG_NOT_FOUND",e.MERCURE_NOT_CONFIGURED="MERCURE_NOT_CONFIGURED",e.INVALID_AUTHORIZATION="INVALID_AUTHORIZATION",e.INVALID_API_KEY="INVALID_API_KEY",e.NOT_FOUND="NOT_FOUND",e))(a_||{}),l_=(e=>(e.INVALID_ARGUMENT="https://shlink.io/api/error/invalid-data",e.INVALID_SHORT_URL_DELETION="https://shlink.io/api/error/invalid-short-url-deletion",e.DOMAIN_NOT_FOUND="https://shlink.io/api/error/domain-not-found",e.FORBIDDEN_OPERATION="https://shlink.io/api/error/forbidden-tag-operation",e.INVALID_URL="https://shlink.io/api/error/invalid-url",e.INVALID_SLUG="https://shlink.io/api/error/non-unique-slug",e.INVALID_SHORTCODE="https://shlink.io/api/error/short-url-not-found",e.TAG_CONFLICT="https://shlink.io/api/error/tag-conflict",e.TAG_NOT_FOUND="https://shlink.io/api/error/tag-not-found",e.MERCURE_NOT_CONFIGURED="https://shlink.io/api/error/mercure-not-configured",e.INVALID_AUTHORIZATION="https://shlink.io/api/error/missing-authentication",e.INVALID_API_KEY="https://shlink.io/api/error/invalid-api-key",e.NOT_FOUND="https://shlink.io/api/error/not-found",e))(l_||{});const RX=e=>!!e&&typeof e=="object"&&["type","detail","title","status"].every(t=>t in e),io=e=>RX(e)?e:void 0,NX=e=>(e==null?void 0:e.type)===a_.INVALID_ARGUMENT||(e==null?void 0:e.type)===l_.INVALID_ARGUMENT,LX=e=>(e==null?void 0:e.type)==="INVALID_SHORTCODE_DELETION"||(e==null?void 0:e.type)===a_.INVALID_SHORT_URL_DELETION||(e==null?void 0:e.type)===l_.INVALID_SHORT_URL_DELETION,DX=e=>((e==null?void 0:e.type)===a_.NOT_FOUND||(e==null?void 0:e.type)===l_.NOT_FOUND)&&(e==null?void 0:e.status)===404,AX=(e,t)=>`${e}/rest/v${t}`,IX=Wd(Bo),FX=({orderBy:e={},excludeMaxVisitsReached:t,excludePastValidUntil:n,...r})=>({...r,excludeMaxVisitsReached:t===!0?"true":void 0,excludePastValidUntil:n===!0?"true":void 0,orderBy:DI(e)});class $X{constructor(t,n,r){Se(this,"apiVersion");Se(this,"listShortUrls",async(t={})=>this.performRequest("/short-urls","GET",FX(t)).then(({shortUrls:n})=>n));Se(this,"createShortUrl",async t=>{const n=Wd(r=>qn(r)||Bo(r),t);return this.performRequest("/short-urls","POST",{},n)});Se(this,"getShortUrlVisits",async(t,n)=>this.performRequest(`/short-urls/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getTagVisits",async(t,n)=>this.performRequest(`/tags/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getDomainVisits",async(t,n)=>this.performRequest(`/domains/${t}/visits`,"GET",n).then(({visits:r})=>r));Se(this,"getOrphanVisits",async t=>this.performRequest("/visits/orphan","GET",t).then(({visits:n})=>n));Se(this,"getNonOrphanVisits",async t=>this.performRequest("/visits/non-orphan","GET",t).then(({visits:n})=>n));Se(this,"getVisitsOverview",async()=>this.performRequest("/visits").then(({visits:t})=>t));Se(this,"getShortUrl",async(t,n)=>this.performRequest(`/short-urls/${t}`,"GET",{domain:n}));Se(this,"deleteShortUrl",async(t,n)=>this.performEmptyRequest(`/short-urls/${t}`,"DELETE",{domain:n}));Se(this,"updateShortUrl",async(t,n,r)=>this.performRequest(`/short-urls/${t}`,"PATCH",{domain:n},r));Se(this,"listTags",async()=>this.performRequest("/tags","GET",{withStats:"true"}).then(({tags:t})=>t).then(({data:t,stats:n})=>({tags:t,stats:n})));Se(this,"tagsStats",async()=>this.performRequest("/tags/stats","GET").then(({tags:t})=>t).then(({data:t})=>({tags:t.map(({tag:n})=>n),stats:t})));Se(this,"deleteTags",async t=>this.performEmptyRequest("/tags","DELETE",{tags:t}).then(()=>({tags:t})));Se(this,"editTag",async(t,n)=>this.performEmptyRequest("/tags","PUT",{},{oldName:t,newName:n}).then(()=>({oldName:t,newName:n})));Se(this,"health",async()=>this.performRequest("/health","GET"));Se(this,"mercureInfo",async()=>this.performRequest("/mercure-info","GET"));Se(this,"listDomains",async()=>this.performRequest("/domains").then(({domains:t})=>t));Se(this,"editDomainRedirects",async t=>this.performRequest("/domains/redirects","PATCH",{},t));Se(this,"performRequest",async(t,n="GET",r={},i)=>this.httpClient.fetchJson(...this.toFetchParams(t,n,r,i)).catch(this.handleFetchError(()=>this.httpClient.fetchJson(...this.toFetchParams(t,n,r,i)))));Se(this,"performEmptyRequest",async(t,n="GET",r={},i)=>this.httpClient.fetchEmpty(...this.toFetchParams(t,n,r,i)).catch(this.handleFetchError(()=>this.httpClient.fetchEmpty(...this.toFetchParams(t,n,r,i)))));Se(this,"toFetchParams",(t,n,r={},i)=>{const o=qd(IX(r)),s=qn(o)?"":`?${o}`;return[`${AX(this.baseUrl,this.apiVersion)}${t}${s}`,{method:n,body:i&&JSON.stringify(i),headers:{"X-Api-Key":this.apiKey}}]});Se(this,"handleFetchError",t=>n=>{if(!DX(io(n)))throw n;return this.apiVersion=2,t()});this.httpClient=t,this.baseUrl=n,this.apiKey=r,this.apiVersion=3}}const f1={},jX=e=>typeof e=="function",BX=e=>{const{selectedServer:t}=e();if(!lC(t))throw new Error("There's no selected server or it is not found");return t},zX=e=>t=>{const{url:n,apiKey:r}=jX(t)?BX(t):t,i=`${n}_${r}`;return f1[i]||(f1[i]=new $X(e,n,r)),f1[i]},UX=e=>{e.serviceFactory("buildShlinkApiClient",zX,"HttpClient")};var bw={},VX={get exports(){return bw},set exports(e){bw=e}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames @@ -913,7 +913,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `.charCodeAt(0))An=B;else if(An===I&&(An=B),In==="\r".charCodeAt(0)||In===` `.charCodeAt(0)){if(An!==B){An===re&&(Li=gn+1);var li=Fn.slice(cu,Li-1),ci=Fn.slice(Li+(Li"u"?typeof window<"u"?window:typeof self<"u"?self:Vl:globalThis)})(Ipe,iy);const Fpe=(e,t,n,r)=>{const{mercureHubUrl:i,token:o,loading:s,error:a}=e;if(s||a||!i)return;const l=({data:h})=>n(JSON.parse(h)),c=({status:h})=>h===401&&r(),f=t.map(h=>{const p=new URL(i);p.searchParams.append("topic",h);const m=new iy.EventSourcePolyfill(p,{headers:{Authorization:`Bearer ${o}`}});return m.onmessage=l,m.onerror=c,m});return()=>f.forEach(h=>h.close())};function oa(e,t){const n=new Set;return r=>{const{createNewVisits:i,loadMercureInfo:o,mercureInfo:s}=r,{interval:a}=s,l=Qs();return H.useEffect(()=>{const c=m=>a?n.add(m):i([m]),f=t(r,l),h=Fpe(s,f,c,o);if(!a)return h;const p=setInterval(()=>{i([...n]),n.clear()},a*1e3*60);return It(()=>clearInterval(p),()=>h==null?void 0:h())},[s]),C(e,{...r})}}class Jr{}Se(Jr,"visits","https://shlink.io/new-visit"),Se(Jr,"orphanVisits","https://shlink.io/new-orphan-visit"),Se(Jr,"shortUrlVisits",t=>`https://shlink.io/new-visit/${t}`);const HE="shlink/shortUrlDeletion",PN={shortCode:"",loading:!1,deleted:!1,error:!1},$pe=e=>or(`${HE}/deleteShortUrl`,async({shortCode:t,domain:n},{getState:r})=>{const{deleteShortUrl:i}=e(r);return await i(t,n),{shortCode:t,domain:n}}),L8=bn(`${HE}/shortUrlDeleted`),jpe=e=>{const{actions:t,reducer:n}=Gn({name:HE,initialState:PN,reducers:{resetDeleteShortUrl:()=>PN},extraReducers:i=>{i.addCase(e.pending,o=>({...o,loading:!0,error:!1,deleted:!1})),i.addCase(e.rejected,(o,{error:s})=>({...o,errorData:io(s),loading:!1,error:!0,deleted:!1})),i.addCase(e.fulfilled,(o,{payload:s})=>({...o,shortCode:s.shortCode,loading:!1,error:!1,deleted:!0}))}}),{resetDeleteShortUrl:r}=t;return{reducer:n,resetDeleteShortUrl:r}},D8="shlink/shortUrlsList",A8=5,Bpe={loading:!0,error:!1},zpe=e=>or(`${D8}/listShortUrls`,(t,{getState:n})=>{const{listShortUrls:r}=e(n);return r(t??{})}),Upe=(e,t,n)=>Gn({name:D8,initialState:Bpe,reducers:{},extraReducers:r=>{r.addCase(e.pending,i=>({...i,loading:!0,error:!1})),r.addCase(e.rejected,()=>({loading:!1,error:!0})),r.addCase(e.fulfilled,(i,{payload:o})=>({loading:!1,error:!1,shortUrls:o})),r.addCase(n.fulfilled,It((i,{payload:o})=>i.shortUrls?Ml(["shortUrls","data"],[o,...i.shortUrls.data.slice(0,A8-1)],i):i,i=>i.shortUrls?Ml(["shortUrls","pagination","totalItems"],i.shortUrls.pagination.totalItems+1,i):i)),r.addCase(t.fulfilled,(i,{payload:o})=>i.shortUrls?Ml(["shortUrls","data"],i.shortUrls.data.map(s=>{const{shortCode:a,domain:l}=o;return kf(s,a,l)?o:s}),i):i),r.addCase(L8,It((i,{payload:o})=>i.shortUrls?Ml(["shortUrls","data"],Wd(s=>kf(s,o.shortCode,o.domain),i.shortUrls.data),i):i,i=>i.shortUrls?Ml(["shortUrls","pagination","totalItems"],i.shortUrls.pagination.totalItems-1,i):i)),r.addCase(uh,(i,{payload:o})=>{var s,a;return Ml(["shortUrls","data"],(a=(s=i.shortUrls)==null?void 0:s.data)==null?void 0:a.map(l=>{var c;return((c=QG(o.createdVisits.filter(({shortUrl:f})=>f&&kf(l,f.shortCode,f.domain))))==null?void 0:c.shortUrl)??l}),i)})}}),kN=10,{ceil:Vpe}=Math,Hpe=new Intl.NumberFormat("en-US"),wn=e=>Hpe.format(Number(e)),Wpe=e=>Vpe(e/kN)*kN;const Ype=e=>e?{tag:At,to:e}:{},fx=({children:e,title:t,link:n,tooltip:r})=>{const i=gl();return U(We,{children:[U(Er,{innerRef:i,className:"highlight-card",body:!0,...Ype(n),children:[n&&C(Fe,{size:"3x",className:"highlight-card__link-icon",icon:Lpe}),C(nE,{tag:"h5",className:"highlight-card__title",children:t}),C(tE,{tag:"h2",children:e})]}),r&&C(Or,{target:i,placement:"bottom",children:r})]})},MN=({loading:e,excludeBots:t,visitsSummary:n,...r})=>C(fx,{tooltip:n.bots!==void 0?U(We,{children:[t?"Plus":"Including"," ",C("b",{children:wn(n.bots)})," potential bot visits"]}):void 0,...r,children:e?"Loading...":wn(t&&n.nonBots?n.nonBots:n.total)}),qpe=(e,t)=>oa(({shortUrlsList:n,listShortUrls:r,listTags:i,tagsList:o,selectedServer:s,loadVisitsOverview:a,visitsOverview:l,settings:{visits:c}})=>{const{loading:f,shortUrls:h}=n,{loading:p}=o,{loading:m,nonOrphanVisits:g,orphanVisits:v}=l,w=Yd(s),y=Mi("nonOrphanVisits",s),b=jo();return H.useEffect(()=>{r({itemsPerPage:A8,orderBy:{field:"dateCreated",dir:"DESC"}}),i(),a()},[]),U(We,{children:[U(er,{children:[C("div",{className:"col-lg-6 col-xl-3 mb-3",children:C(MN,{title:"Visits",link:y?`/server/${w}/non-orphan-visits`:void 0,excludeBots:(c==null?void 0:c.excludeBots)??!1,loading:m,visitsSummary:g})}),C("div",{className:"col-lg-6 col-xl-3 mb-3",children:C(MN,{title:"Orphan visits",link:`/server/${w}/orphan-visits`,excludeBots:(c==null?void 0:c.excludeBots)??!1,loading:m,visitsSummary:v})}),C("div",{className:"col-lg-6 col-xl-3 mb-3",children:C(fx,{title:"Short URLs",link:`/server/${w}/list-short-urls/1`,children:f?"Loading...":wn((h==null?void 0:h.pagination.totalItems)??0)})}),C("div",{className:"col-lg-6 col-xl-3 mb-3",children:C(fx,{title:"Tags",link:`/server/${w}/manage-tags`,children:p?"Loading...":wn(o.tags.length)})})]}),U(Er,{className:"mb-3",children:[U(ol,{children:[C("span",{className:"d-sm-none",children:"Create a short URL"}),C("h5",{className:"d-none d-sm-inline",children:"Create a short URL"}),C(At,{className:"float-end",to:`/server/${w}/create-short-url`,children:"Advanced options »"})]}),C(il,{children:C(t,{basicMode:!0})})]}),U(Er,{children:[U(ol,{children:[C("span",{className:"d-sm-none",children:"Recently created URLs"}),C("h5",{className:"d-none d-sm-inline",children:"Recently created URLs"}),C(At,{className:"float-end",to:`/server/${w}/list-short-urls/1`,children:"See all »"})]}),C(il,{children:C(e,{shortUrlsList:n,selectedServer:s,className:"mb-0",onTagClick:x=>b(`/server/${w}/list-short-urls/1?tags=${encodeURIComponent(x)}`)})})]})]})},()=>[Jr.visits,Jr.orphanVisits]),Gpe={},Zpe=e=>e.id?e:fd("id",dE(),e),Kpe=tC((e,t)=>fd(t.id,t,e),{}),{actions:Xpe,reducer:Qpe}=Gn({name:"shlink/servers",initialState:Gpe,reducers:{editServer:{prepare:(e,t)=>({payload:{serverId:e,serverData:t}}),reducer:(e,{payload:t})=>{const{serverId:n,serverData:r}=t;return e[n]?fd(n,{...e[n],...r},e):e}},deleteServer:(e,{payload:t})=>KG(t.id,e),setAutoConnect:{prepare:({id:e},t)=>({payload:{serverId:e,autoConnect:t}}),reducer:(e,{payload:t})=>{const{serverId:n,autoConnect:r}=t;return e[n]?r?Qu(Kg(e).map(([i,o])=>[i,{...o,autoConnect:i===n}])):fd(n,{...e[n],autoConnect:r},e):e}},createServers:{prepare:It(Hd(Zpe),Kpe,e=>({payload:e})),reducer:(e,{payload:t})=>({...e,...t})}}}),{editServer:Jpe,deleteServer:eme,setAutoConnect:tme,createServers:I8}=Xpe,nme=Qpe,rme=e=>Array.isArray(e)?e.filter(lC):[],ime=e=>or("shlink/remoteServers/fetchServers",async(t,{dispatch:n})=>{const r=await e.fetchJson(`${Wg.homepage}/servers.json`),i=rme(r);n(I8(i))}),ome=({servers:e,selectedServer:t})=>{const n=eu(e);return U(nh,{nav:!0,inNavbar:!0,children:[U(iu,{nav:!0,caret:!0,children:[C(Fe,{icon:TM})," ",C("span",{className:"ms-1",children:"Servers"})]}),C(ml,{end:!0,style:{right:0},children:(()=>qn(n)?U(Ve,{tag:At,to:"/server/create",children:[C(Fe,{icon:wC})," ",C("span",{className:"ms-1",children:"Add a server"})]}):U(We,{children:[n.map(({name:i,id:o})=>C(Ve,{tag:At,to:`/server/${o}`,active:Yd(t)===o,children:i},o)),C(Ve,{divider:!0}),U(Ve,{tag:At,to:"/manage-servers",children:[C(Fe,{icon:TM})," ",C("span",{className:"ms-1",children:"Manage servers"})]})]}))()})]})},sme="shlink-servers.csv";class ame{constructor(t,n,r){Se(this,"exportServers",async()=>{const t=eu(this.storage.get("servers")??{}).map(IZ);try{const n=this.jsonToCsv(t);t8(this.window,n,sme)}catch(n){console.error(n)}});this.storage=t,this.window=n,this.jsonToCsv=r}}const lme=e=>typeof e.url=="string"&&typeof e.apiKey=="string"&&typeof e.name=="string",cme=e=>Array.isArray(e)&&e.every(lme);class ume{constructor(t,n){Se(this,"importServersFromFile",async t=>{if(!t)throw new Error("No file provided");const n=this.fileReaderFactory();return new Promise((r,i)=>{n.addEventListener("loadend",async o=>{var s,a;try{const l=((a=(s=o.target)==null?void 0:s.result)==null?void 0:a.toString())??"",c=await this.csvToJson(l);if(!cme(c))throw new Error("Provided file does not have the right format.");r(c)}catch(l){i(l)}}),n.readAsText(t)})});this.csvToJson=t,this.fileReaderFactory=n}}const fme=(e,t)=>{e.serviceFactory("ManageServers",Ppe,"ServersExporter","ImportServersBtn","useTimeoutToggle","ManageServersRow"),e.decorator("ManageServers",vv),e.decorator("ManageServers",t(["selectedServer","servers"],["resetSelectedServer"])),e.serviceFactory("ManageServersRow",kpe,"ManageServersRowDropdown"),e.serviceFactory("ManageServersRowDropdown",Ape,"DeleteServerModal"),e.decorator("ManageServersRowDropdown",t(null,["setAutoConnect"])),e.serviceFactory("CreateServer",wpe,"ImportServersBtn","useTimeoutToggle"),e.decorator("CreateServer",vv),e.decorator("CreateServer",t(["selectedServer","servers"],["createServers","resetSelectedServer"])),e.serviceFactory("EditServer",Cpe,"ServerError"),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer","resetSelectedServer"])),e.serviceFactory("ServersDropdown",()=>ome),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",()=>Spe),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.serviceFactory("DeleteServerButton",xpe,"DeleteServerModal"),e.serviceFactory("ImportServersBtn",Epe,"ServersImporter"),e.decorator("ImportServersBtn",t(["servers"],["createServers"])),e.serviceFactory("ServerError",Tpe,"DeleteServerButton"),e.decorator("ServerError",t(["servers","selectedServer"])),e.serviceFactory("Overview",qpe,"ShortUrlsTable","CreateShortUrl"),e.decorator("Overview",t(["shortUrlsList","tagsList","selectedServer","mercureInfo","visitsOverview","settings"],["listShortUrls","listTags","createNewVisits","loadMercureInfo","loadVisitsOverview"])),e.constant("fileReaderFactory",()=>new FileReader),e.service("ServersImporter",ume,"csvToJson","fileReaderFactory"),e.service("ServersExporter",ame,"Storage","window","jsonToCsv"),e.serviceFactory("selectServer",J5,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServers",()=>I8),e.serviceFactory("deleteServer",()=>eme),e.serviceFactory("editServer",()=>Jpe),e.serviceFactory("setAutoConnect",()=>tme),e.serviceFactory("fetchServers",ime,"HttpClient"),e.serviceFactory("resetSelectedServer",()=>EE),e.serviceFactory("selectServerListener",aae,"selectServer","loadMercureInfo"),e.serviceFactory("selectedServerReducerCreator",lae,"selectServer"),e.serviceFactory("selectedServerReducer",ct("reducer"),"selectedServerReducerCreator")},wc=({children:e})=>C("small",{className:"form-text text-muted d-block",children:e}),F8=({checked:e=!1,onChange:t=rC,className:n,children:r,type:i,inline:o=!1})=>{const s=S_(),a=f=>t(f.target.checked,f),l={"form-switch":i==="switch","form-checkbox":i==="checkbox"},c=o?{display:"inline-block"}:{};return U("span",{className:ge("form-check",l,n),style:c,children:[C("input",{type:"checkbox",className:"form-check-input",id:s,checked:e,onChange:a}),C("label",{className:"form-check-label",htmlFor:s,children:r})]})},Yc=e=>C(F8,{type:"switch",...e}),dme=e=>e?`${e}`:"",hme=({settings:{realTimeUpdates:e},toggleRealTimeUpdates:t,setRealTimeUpdatesInterval:n})=>{const r=S_();return U(dn,{title:"Real-time updates",className:"h-100",children:[C(_r,{children:U(Yc,{checked:e.enabled,onChange:t,children:["Enable or disable real-time updates.",U(wc,{children:["Real-time updates are currently being ",C("b",{children:e.enabled?"processed":"ignored"}),"."]})]})}),U(au,{noMargin:!0,label:"Real-time updates frequency (in minutes):",labelClassName:ge("form-label",{"text-muted":!e.enabled}),id:r,children:[C(zc,{type:"number",min:0,placeholder:"Immediate",disabled:!e.enabled,value:dme(e.interval),id:r,onChange:({target:i})=>n(Number(i.value))}),e.enabled&&U(wc,{children:[e.interval!==void 0&&e.interval>0&&U("span",{children:["Updates will be reflected in the UI every ",C("b",{children:e.interval})," minute",e.interval>1&&"s","."]}),!e.interval&&"Updates will be reflected in the UI as soon as they happen."]})]})]})},WE={field:"dateCreated",dir:"DESC"},pme={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:"light"},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:WE}},mme=(e,{payload:t})=>kI(e,t),ba=e=>({reducer:mme,prepare:e}),wa=e=>({payload:e}),{reducer:gme,actions:vme}=Gn({name:"shlink/settings",initialState:pme,reducers:{toggleRealTimeUpdates:ba(e=>wa({realTimeUpdates:{enabled:e}})),setRealTimeUpdatesInterval:ba(e=>wa({realTimeUpdates:{interval:e}})),setShortUrlCreationSettings:ba(e=>wa({shortUrlCreation:e})),setShortUrlsListSettings:ba(e=>wa({shortUrlsList:e})),setUiSettings:ba(e=>wa({ui:e})),setVisitsSettings:ba(e=>wa({visits:e})),setTagsSettings:ba(e=>wa({tags:e}))}}),{toggleRealTimeUpdates:yme,setRealTimeUpdatesInterval:_me,setShortUrlCreationSettings:bme,setShortUrlsListSettings:wme,setUiSettings:xme,setVisitsSettings:Sme,setTagsSettings:Cme}=vme,Eme=gme;const Lf=({children:e,...t})=>C(o5,{className:"nav-pills__nav-link",tag:sI,...t,children:e}),$8=({children:e,fill:t=!1,className:n=""})=>C(Er,{className:`nav-pills__nav p-0 overflow-hidden ${n}`,body:!0,children:C(p_,{pills:!0,fill:t,children:H.Children.map(e,r=>{if(!H.isValidElement(r)||r.type!==Lf)throw new Error("Only NavPillItem children are allowed inside NavPills.");return r})})}),I1=({items:e})=>C(We,{children:e.map((t,n)=>C("div",{className:"mb-3",children:t},n))}),Tme=(e,t,n,r,i,o)=>()=>U(su,{children:[U($8,{className:"mb-3",children:[C(Lf,{to:"general",children:"General"}),C(Lf,{to:"short-urls",children:"Short URLs"}),C(Lf,{to:"other-items",children:"Other items"})]}),U(e_,{children:[C(yt,{path:"general",element:C(I1,{items:[C(r,{}),C(e,{})]})}),C(yt,{path:"short-urls",element:C(I1,{items:[C(t,{}),C(n,{})]})}),C(yt,{path:"other-items",element:C(I1,{items:[C(o,{}),C(i,{})]})}),C(yt,{path:"*",element:C(ZS,{replace:!0,to:"general"})})]})]}),F1=e=>e==="includes"?"Suggest tags including input":"Suggest tags starting with input",Ome=e=>e==="includes"?U(We,{children:["The list of suggested tags will contain those ",C("b",{children:"including"})," provided input."]}):U(We,{children:["The list of suggested tags will contain those ",C("b",{children:"starting with"})," provided input."]}),Pme=({settings:e,setShortUrlCreationSettings:t})=>{const n=e.shortUrlCreation??{validateUrls:!1},r=i=>()=>t({...n??{validateUrls:!1},tagFilteringMode:i});return U(dn,{title:"Short URLs form",className:"h-100",children:[C(_r,{children:U(Yc,{checked:n.validateUrls??!1,onChange:i=>t({...n,validateUrls:i}),children:["Request validation on long URLs when creating new short URLs.",U(wc,{children:["The initial state of the ",C("b",{children:"Validate URL"})," checkbox will be ",C("b",{children:n.validateUrls?"checked":"unchecked"}),"."]})]})}),C(_r,{children:U(Yc,{checked:n.forwardQuery??!0,onChange:i=>t({...n,forwardQuery:i}),children:["Make all new short URLs forward their query params to the long URL.",U(wc,{children:["The initial state of the ",C("b",{children:"Forward query params on redirect"})," checkbox will be ",C("b",{children:n.forwardQuery??!0?"checked":"unchecked"}),"."]})]})}),U(au,{noMargin:!0,label:"Tag suggestions search mode:",children:[U(ia,{text:F1(n.tagFilteringMode),children:[C(Ve,{active:!n.tagFilteringMode||n.tagFilteringMode==="startsWith",onClick:r("startsWith"),children:F1("startsWith")}),C(Ve,{active:n.tagFilteringMode==="includes",onClick:r("includes"),children:F1("includes")})]}),C(wc,{children:Ome(n.tagFilteringMode)})]})]})},j8={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"};function ph({items:e,order:t,onChange:n,isButton:r=!0,right:i=!1,prefixed:o=!0}){const s=a=>()=>{const l=o_(a,t.field,t.dir);n(l?a:void 0,l)};return U(nh,{children:[U(iu,{caret:!0,color:r?"primary":"link",className:ge({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":r,"btn-sm p-0":!r}),children:[!r&&C(We,{children:"Order by"}),r&&!t.field&&C("i",{children:"Order by..."}),r&&t.field&&U(We,{children:[o&&"Order by: ",e[t.field]," - ",C("small",{children:t.dir??"DESC"})]})]}),U(ml,{end:i,className:ge("w-100",{"ordering-dropdown__menu--link":!r}),children:[Kg(e).map(([a,l])=>U(Ve,{active:t.field===a,onClick:s(a),children:[l,t.field===a&&C(Fe,{icon:t.dir==="ASC"?CQ:cQ,className:"ordering-dropdown__sort-icon"})]},a)),C(Ve,{divider:!0}),C(Ve,{disabled:!t.field,onClick:()=>n(),children:C("i",{children:"Clear selection"})})]})]})}const kme=({settings:{shortUrlsList:e},setShortUrlsListSettings:t})=>C(dn,{title:"Short URLs list",className:"h-100",children:C(au,{noMargin:!0,label:"Default ordering for short URLs list:",children:C(ph,{items:j8,order:(e==null?void 0:e.defaultOrdering)??WE,onChange:(n,r)=>t({defaultOrdering:{field:n,dir:r}})})})}),B8={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},Mme=({settings:{tags:e},setTagsSettings:t})=>C(dn,{title:"Tags",className:"h-100",children:C(au,{noMargin:!0,label:"Default ordering for tags list:",children:C(ph,{items:B8,order:(e==null?void 0:e.defaultOrdering)??{},onChange:(n,r)=>t({...e,defaultOrdering:{field:n,dir:r}})})})});const Rme=({settings:{ui:e},setUiSettings:t})=>U(dn,{title:"User interface",className:"h-100",children:[C(Fe,{icon:(e==null?void 0:e.theme)==="dark"?$Q:TQ,className:"user-interface__theme-icon"}),C(Yc,{checked:(e==null?void 0:e.theme)==="dark",onChange:n=>{const r=n?"dark":"light";t({...e,theme:r}),T5(r)},children:"Use dark theme."})]}),z8=({active:e,allText:t,onChange:n})=>U(We,{children:[C(Ve,{active:e==="all",onClick:()=>n("all"),children:t}),C(Ve,{divider:!0}),Qhe.map(r=>C(Ve,{active:e===r,onClick:()=>n(r),children:VE(r)},r))]}),Nme=({onChange:e,active:t,allText:n})=>C(ia,{text:VE(t)??n,children:C(z8,{allText:n,active:t,onChange:e})}),RN=e=>{var t;return((t=e.visits)==null?void 0:t.defaultInterval)??"last30Days"},Lme=({settings:e,setVisitsSettings:t})=>{var n,r;return U(dn,{title:"Visits",className:"h-100",children:[C(_r,{children:U(Yc,{checked:!!((n=e.visits)!=null&&n.excludeBots),onChange:i=>t({defaultInterval:RN(e),excludeBots:i}),children:["Exclude bots wherever possible (this option‘s effect might depend on Shlink server‘s version).",U(wc,{children:["The visits coming from potential bots will be ",C("b",{children:(r=e.visits)!=null&&r.excludeBots?"excluded":"included"}),"."]})]})}),C(au,{noMargin:!0,label:"Default interval to load on visits sections:",children:C(Nme,{allText:"All visits",active:RN(e),onChange:i=>t({defaultInterval:i})})})]})},Dme=(e,t)=>{e.serviceFactory("Settings",Tme,"RealTimeUpdatesSettings","ShortUrlCreationSettings","ShortUrlsListSettings","UserInterfaceSettings","VisitsSettings","TagsSettings"),e.decorator("Settings",vv),e.decorator("Settings",t(null,["resetSelectedServer"])),e.serviceFactory("RealTimeUpdatesSettings",()=>hme),e.decorator("RealTimeUpdatesSettings",t(["settings"],["toggleRealTimeUpdates","setRealTimeUpdatesInterval"])),e.serviceFactory("ShortUrlCreationSettings",()=>Pme),e.decorator("ShortUrlCreationSettings",t(["settings"],["setShortUrlCreationSettings"])),e.serviceFactory("UserInterfaceSettings",()=>Rme),e.decorator("UserInterfaceSettings",t(["settings"],["setUiSettings"])),e.serviceFactory("VisitsSettings",()=>Lme),e.decorator("VisitsSettings",t(["settings"],["setVisitsSettings"])),e.serviceFactory("TagsSettings",()=>Mme),e.decorator("TagsSettings",t(["settings"],["setTagsSettings"])),e.serviceFactory("ShortUrlsListSettings",()=>kme),e.decorator("ShortUrlsListSettings",t(["settings"],["setShortUrlsListSettings"])),e.serviceFactory("toggleRealTimeUpdates",()=>yme),e.serviceFactory("setRealTimeUpdatesInterval",()=>_me),e.serviceFactory("setShortUrlCreationSettings",()=>bme),e.serviceFactory("setShortUrlsListSettings",()=>wme),e.serviceFactory("setUiSettings",()=>xme),e.serviceFactory("setVisitsSettings",()=>Sme),e.serviceFactory("setTagsSettings",()=>Cme)},Ame=e=>({longUrl:"",tags:[],customSlug:"",title:void 0,shortCodeLength:void 0,domain:"",validSince:void 0,validUntil:void 0,maxVisits:void 0,findIfExists:!1,validateUrl:(e==null?void 0:e.validateUrls)??!1,forwardQuery:(e==null?void 0:e.forwardQuery)??!0}),Ime=(e,t)=>({createShortUrl:n,shortUrlCreation:r,resetCreateShortUrl:i,selectedServer:o,basicMode:s=!1,settings:{shortUrlCreation:a}})=>{const l=H.useMemo(()=>Ame(a),[a]);return U(We,{children:[C(e,{initialState:l,saving:r.saving,selectedServer:o,mode:s?"create-basic":"create",onSave:async c=>(i(),n(c))}),C(t,{creation:r,resetCreateShortUrl:i,canBeClosed:s})]})},Fme=e=>({settings:{shortUrlCreation:t},selectedServer:n,shortUrlDetail:r,getShortUrlDetail:i,shortUrlEdition:o,editShortUrl:s})=>{const{search:a}=Mn(),l=Qs(),c=ra(),{loading:f,error:h,errorData:p,shortUrl:m}=r,{saving:g,saved:v,error:w,errorData:y}=o,{domain:b}=pl(a),x=H.useMemo(()=>Pae(m,t),[m,t]);return H.useEffect(()=>{l.shortCode&&i({shortCode:gm(l.shortCode),domain:b})},[]),f?C(Eo,{loading:!0}):h?C(Dr,{type:"error",children:C(Ao,{errorData:p,fallbackMessage:"An error occurred while loading short URL detail :("})}):U(We,{children:[C("header",{className:"mb-3",children:C(Er,{body:!0,children:U("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[C(mt,{color:"link",size:"lg",className:"p-0 me-3",onClick:c,children:C(Fe,{icon:e6})}),C("span",{className:"text-center",children:U("small",{children:["Edit ",C(Ei,{href:(m==null?void 0:m.shortUrl)??""})]})}),C("span",{})]})})}),C(e,{initialState:x,saving:g,selectedServer:n,mode:"edit",onSave:async T=>{m&&s({...m,data:T})}}),v&&w&&C(Dr,{type:"error",className:"mt-3",children:C(Ao,{errorData:y,fallbackMessage:"An error occurred while updating short URL :("})}),v&&!w&&C(Dr,{type:"success",className:"mt-3",children:"Short URL properly edited."})]})};var O_={},$me=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=NN[t.format]||NN.default;window.clipboardData.setData(h,e)}else f.clipboardData.clearData(),f.clipboardData.setData(t.format,e);t.onCopy&&(f.preventDefault(),t.onCopy(f.clipboardData))}),document.body.appendChild(a),o.selectNodeContents(a),s.addRange(o);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");l=!0}catch(f){n&&console.error("unable to copy using execCommand: ",f),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(h){n&&console.error("unable to copy using clipboardData: ",h),n&&console.error("falling back to prompt"),r=zme("message"in t?t.message:Bme),window.prompt(r,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return l}var Vme=Ume;function dx(e){return dx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dx(e)}Object.defineProperty(O_,"__esModule",{value:!0});O_.CopyToClipboard=void 0;var Ap=U8(H),Hme=U8(Vme),Wme=["text","onCopy","options","children"];function U8(e){return e&&e.__esModule?e:{default:e}}function LN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DN(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qme(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Gme(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AN(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function oy(e){return oy=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},oy(e)}function YE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var H8=function(e){Kme(n,e);var t=Xme(n);function n(){var r;Gme(this,n);for(var i=arguments.length,o=new Array(i),s=0;s({creation:t,resetCreateShortUrl:n,canBeClosed:r=!1})=>{const[i,o]=e(),{error:s,saved:a}=t;if(H.useEffect(()=>{n()},[]),s)return U(Dr,{type:"error",className:"mt-3",children:[r&&C(Fe,{icon:ww,className:"float-end pointer",onClick:n}),C(Ao,{errorData:t.errorData,fallbackMessage:"An error occurred while creating the URL :("})]});if(!a)return null;const{shortUrl:l}=t.result;return U(Dr,{type:"success",className:"mt-3",children:[r&&C(Fe,{icon:ww,className:"float-end pointer",onClick:n}),U("span",{children:[C("b",{children:"Great!"})," The short URL is ",C("b",{children:l})]}),C(W8,{text:l,onCopy:o,children:U("button",{className:"btn btn-light btn-sm create-short-url-result__copy-btn",id:"copyBtn",type:"button",children:[C(Fe,{icon:N8})," Copy"]})}),C(eh,{placement:"left",isOpen:i,target:"copyBtn",children:"Copied!"})]})},$1="delete",nge=({shortUrl:e,toggle:t,isOpen:n,shortUrlDeletion:r,resetDeleteShortUrl:i,deleteShortUrl:o,shortUrlDeleted:s})=>{const[a,l]=H.useState("");H.useEffect(()=>i,[]);const{loading:c,error:f,deleted:h,errorData:p}=r,m=It(i,t),g=sh(()=>o(e).then(t));return C(Ho,{isOpen:n,toggle:m,centered:!0,onClosed:()=>h&&s(e),children:U("form",{onSubmit:g,children:[C(oo,{toggle:m,children:C("span",{className:"text-danger",children:"Delete short URL"})}),U(Ri,{children:[U("p",{children:[C("b",{className:"text-danger",children:"Caution!"})," You are about to delete a short URL."]}),C("p",{children:"This action cannot be undone. Once you have deleted it, all the visits stats will be lost."}),U("p",{children:["Write ",C("b",{children:$1})," to confirm deletion."]}),C("input",{type:"text",className:"form-control",placeholder:`Insert ${$1}`,value:a,onChange:v=>l(v.target.value)}),f&&C(Dr,{type:LX(p)?"warning":"error",small:!0,className:"mt-2",children:C(Ao,{errorData:p,fallbackMessage:"Something went wrong while deleting the URL :("})})]}),U(na,{children:[C("button",{type:"button",className:"btn btn-link",onClick:m,children:"Cancel"}),C("button",{type:"submit",className:"btn btn-danger",disabled:a!==$1||c,children:c?"Deleting...":"Delete"})]})]})})},Y8=({amount:e=0,loading:t=!1,...n})=>U(mt,{...n,outline:!0,color:"primary",disabled:t,children:[C(Fe,{icon:qX})," ",t?"Exporting...":U(We,{children:["Export (",wn(e),")"]})]}),P_=()=>{const e=jo(),{search:t}=Mn(),{serverId:n=""}=Qs(),r=H.useMemo(It(()=>pl(t),({orderBy:o,tags:s,excludeBots:a,excludeMaxVisitsReached:l,excludePastValidUntil:c,...f})=>{const h=o?FZ(o):void 0,p=(s==null?void 0:s.split(","))??[];return{...f,orderBy:h,tags:p,excludeBots:a!==void 0?a==="true":void 0,excludeMaxVisitsReached:l!==void 0?l==="true":void 0,excludePastValidUntil:c!==void 0?c==="true":void 0}}),[t]);return[r,o=>{const s={...r,...o},{orderBy:a,tags:l,excludeBots:c,excludeMaxVisitsReached:f,excludePastValidUntil:h,...p}=s,m={...p,orderBy:a&&DI(a),tags:l.length>0?l.join(","):void 0,excludeBots:O1(c),excludeMaxVisitsReached:O1(f),excludePastValidUntil:O1(h)},g=qd(m),v=qn(g)?"":`?${g}`;e(`/server/${n}/list-short-urls/1${v}`)}]},IN=20,rge=(e,{exportShortUrls:t})=>({amount:n=0,selectedServer:r})=>{const[{tags:i,search:o,startDate:s,endDate:a,orderBy:l,tagsMode:c}]=P_(),[f,,h,p]=jt();return C(Y8,{loading:f,className:"btn-md-block",amount:n,onClick:async()=>{if(!Ms(r))return;const g=n/IN,{listShortUrls:v}=e(r),w=async(b=1)=>{const{data:x}=await v({page:`${b}`,tags:i,searchTerm:o,startDate:s,endDate:a,orderBy:l,tagsMode:c,itemsPerPage:IN});return b>=g?x:x.concat(await w(b+1))};h();const y=await w();t(y.map(b=>{var x;return{createdAt:b.dateCreated,shortUrl:b.shortUrl,longUrl:b.longUrl,title:b.title??"",tags:b.tags.join(","),visits:((x=b==null?void 0:b.visitsSummary)==null?void 0:x.total)??b.visitsCount}})),p()}})};const q8=({text:e,onCopy:t})=>C(W8,{text:e,onCopy:t,children:C(Fe,{icon:N8,className:"ms-2 copy-to-clipboard-icon"})}),ige=(e,{margin:t,...n})=>{const r=`${e}/qr-code`,i=qd({...n,margin:t>0?t:void 0});return`${r}${qn(i)?"":`?${i}`}`},oge=({errorCorrection:e,setErrorCorrection:t})=>U(ia,{text:`Error correction (${e})`,children:[U(Ve,{active:e==="L",onClick:()=>t("L"),children:[C("b",{children:"L"}),"ow"]}),U(Ve,{active:e==="M",onClick:()=>t("M"),children:[C("b",{children:"M"}),"edium"]}),U(Ve,{active:e==="Q",onClick:()=>t("Q"),children:[C("b",{children:"Q"}),"uartile"]}),U(Ve,{active:e==="H",onClick:()=>t("H"),children:[C("b",{children:"H"}),"igh"]})]}),sge=({format:e,setFormat:t})=>U(ia,{text:`Format (${e})`,children:[C(Ve,{active:e==="png",onClick:()=>t("png"),children:"PNG"}),C(Ve,{active:e==="svg",onClick:()=>t("svg"),children:"SVG"})]});const age=e=>({shortUrl:{shortUrl:t,shortCode:n},toggle:r,isOpen:i,selectedServer:o})=>{const[s,a]=H.useState(300),[l,c]=H.useState(0),[f,h]=H.useState("png"),[p,m]=H.useState("L"),g=Mi("nonRestCors",o),v=H.useMemo(()=>ige(t,{size:s,format:f,margin:l,errorCorrection:p}),[t,s,f,l,p]),w=H.useMemo(()=>s+l,[s,l]),y=H.useMemo(()=>{if(!(w<500))return w<800?"lg":"xl"},[w]);return U(Ho,{isOpen:i,toggle:r,centered:!0,size:y,children:[U(oo,{toggle:r,children:["QR code for ",C(Ei,{href:t,children:t})]}),U(Ri,{children:[U(er,{children:[U(_r,{className:"d-grid col-md-4",children:[U("label",{children:["Size: ",s,"px"]}),C("input",{type:"range",className:"form-control-range",value:s,step:10,min:50,max:1e3,onChange:b=>a(Number(b.target.value))})]}),U(_r,{className:"d-grid col-md-4",children:[U("label",{htmlFor:"marginControl",children:["Margin: ",l,"px"]}),C("input",{id:"marginControl",type:"range",className:"form-control-range",value:l,step:1,min:0,max:100,onChange:b=>c(Number(b.target.value))})]}),C(_r,{className:"d-grid col-md-4",children:C(sge,{format:f,setFormat:h})}),C(_r,{className:"col-md-6",children:C(oge,{errorCorrection:p,setErrorCorrection:m})})]}),U("div",{className:"text-center",children:[U("div",{className:"mb-3",children:[C(Ei,{href:v}),C(q8,{text:v})]}),C("img",{src:v,className:"qr-code-modal__img",alt:"QR code"}),g&&C("div",{className:"mt-3",children:U(mt,{block:!0,color:"primary",onClick:()=>{e.saveImage(v,`${n}-qr-code.${f}`).catch(()=>{})},children:["Download ",C(Fe,{icon:t6,className:"ms-1"})]})})]})]})]})},sy=({date:e,format:t=zE,relative:n=!1})=>{const r=UE(e)?e:Io(e);return C("time",{dateTime:`${cce(r)}000`,children:n?`${nce(Ws(),r)} ago`:_o(r,t)})},lge=e=>{const{meta:t,visitsCount:n,visitsSummary:r}=e,{maxVisits:i,validSince:o,validUntil:s}=t,a=(r==null?void 0:r.total)??n;return i&&a>=i?{icon:jQ,className:"text-danger",description:U(We,{children:["This short URL cannot be currently visited because it has reached the maximum amount of ",C("b",{children:i})," visit",i>1?"s":"","."]})}:s&&Kr(wi(s),Ws())?{icon:OM,className:"text-danger",description:U(We,{children:["This short URL cannot be visited since ",C("b",{className:"indivisible",children:ny(wi(s))}),"."]})}:o&&Kr(Ws(),wi(o))?{icon:OM,className:"text-warning",description:U(We,{children:["This short URL will start working on ",C("b",{className:"indivisible",children:ny(wi(o))}),"."]})}:{icon:pd,className:"text-primary",description:"This short URL can be visited normally."}},cge=({shortUrl:e})=>{const t=gl(),{icon:n,className:r,description:i}=lge(e);return U(We,{children:[C("span",{style:{cursor:i?"help":void 0},ref:t,children:C(Fe,{icon:n,className:r})}),C(Or,{target:t,placement:"bottom",children:i})]})},uge=({id:e},{shortCode:t,domain:n},r)=>{const i=n?`?domain=${n}`:"";return`/server/${e}/short-code/${kae(t)}/${r}${i}`},mx=({selectedServer:e,shortUrl:t,suffix:n,children:r,...i})=>!e||!Ms(e)||!t?C("span",{...i,children:r}):C(At,{to:uge(e,t,n),...i,children:r});const G8=({visitsCount:e,shortUrl:t,selectedServer:n,active:r=!1})=>{const{maxVisits:i,validSince:o,validUntil:s}=(t==null?void 0:t.meta)??{},a=!!i||!!o||!!s,l=C(mx,{selectedServer:n,shortUrl:t,suffix:"visits",children:C("strong",{className:ge("short-url-visits-count__amount",{"short-url-visits-count__amount--big":r}),children:wn(e)})});if(!a)return l;const c=gl();return U(We,{children:[U("span",{className:"indivisible",children:[l,U("small",{className:"short-urls-visits-count__max-visits-control",ref:c,children:[i&&U(We,{children:[" / ",wn(i)]}),C("sup",{className:"ms-1",children:C(Fe,{icon:bC})})]})]}),C(Or,{target:c,placement:"bottom",children:U("ul",{className:"list-unstyled mb-0",children:[i&&U("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept more than ",C("b",{children:wn(i)})," visit",i===1?"":"s","."]}),o&&U("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits before ",C("b",{className:"indivisible",children:ny(wi(o))}),"."]}),s&&U("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits after ",C("b",{className:"indivisible",children:ny(wi(s))}),"."]})]})})]})};const qE=({text:e,children:t,clearable:n,className:r="",colorGenerator:i,onClick:o,onClose:s})=>U("span",{className:ge("badge tag",r,{"tag--light-bg":i.isColorLightForKey(e)}),style:{backgroundColor:i.getColorForKey(e),cursor:n||!o?"auto":"pointer"},onClick:o,children:[t??e,n&&C("span",{"aria-label":`Remove ${e}`,className:"close tag__close-selected-tag",onClick:s,children:"×"})]}),fge=({tags:e,onTagClick:t,colorGenerator:n})=>qn(e)?C("i",{className:"indivisible",children:C("small",{children:"No tags"})}):C(We,{children:e.map(r=>C(qE,{text:r,colorGenerator:n,onClick:()=>t==null?void 0:t(r)},r))});const dge=(e,t,n)=>({shortUrl:r,selectedServer:i,onTagClick:o,settings:s})=>{var v,w,y,b;const[a,l]=n(),[c,f]=n(!1,500),h=H.useRef(!0),[{excludeBots:p}]=P_(),{visits:m}=s,g=p??(m==null?void 0:m.excludeBots);return H.useEffect(()=>{!h.current&&f(),h.current=!1},[(v=r.visitsSummary)==null?void 0:v.total,(w=r.visitsSummary)==null?void 0:w.nonBots,r.visitsCount]),U("tr",{className:"responsive-table__row",children:[C("td",{className:"indivisible short-urls-row__cell responsive-table__cell","data-th":"Created at",children:C(sy,{date:r.dateCreated})}),C("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Short URL",children:U("span",{className:"position-relative short-urls-row__cell--indivisible",children:[C("span",{className:"short-urls-row__short-url-wrapper",children:C(Ei,{href:r.shortUrl})}),C(q8,{text:r.shortUrl,onCopy:l}),C("span",{className:"badge bg-warning text-black short-urls-row__copy-hint",hidden:!a,children:"Copied short URL!"})]})}),C("td",{className:"responsive-table__cell short-urls-row__cell short-urls-row__cell--break","data-th":`${r.title?"Title":"Long URL"}`,children:C(Ei,{href:r.longUrl,children:r.title??r.longUrl})}),r.title&&C("td",{className:"short-urls-row__cell responsive-table__cell short-urls-row__cell--break d-lg-none","data-th":"Long URL",children:C(Ei,{href:r.longUrl})}),C("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Tags",children:C(fge,{tags:r.tags,colorGenerator:t,onTagClick:o})}),C("td",{className:"responsive-table__cell short-urls-row__cell text-lg-end","data-th":"Visits",children:C(G8,{visitsCount:(g?(y=r.visitsSummary)==null?void 0:y.nonBots:(b=r.visitsSummary)==null?void 0:b.total)??r.visitsCount,shortUrl:r,selectedServer:i,active:c})}),C("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Status",children:C(cge,{shortUrl:r})}),C("td",{className:"responsive-table__cell short-urls-row__cell",children:C(e,{selectedServer:i,shortUrl:r})})]})},hge=(e,t)=>({shortUrl:n,selectedServer:r})=>{const[i,o]=jt(),[s,,a,l]=jt(),[c,,f,h]=jt();return U(E_,{toggle:o,isOpen:i,children:[U(Ve,{tag:mx,selectedServer:r,shortUrl:n,suffix:"visits",children:[C(Fe,{icon:_C,fixedWidth:!0})," Visit stats"]}),U(Ve,{tag:mx,selectedServer:r,shortUrl:n,suffix:"edit",children:[C(Fe,{icon:yC,fixedWidth:!0})," Edit short URL"]}),U(Ve,{onClick:a,children:[C(Fe,{icon:FQ,fixedWidth:!0})," QR code"]}),C(t,{shortUrl:n,isOpen:s,toggle:l}),C(Ve,{divider:!0}),U(Ve,{className:"dropdown-item--danger",onClick:f,children:[C(Fe,{icon:vC,fixedWidth:!0})," Delete short URL"]}),C(e,{shortUrl:n,isOpen:c,toggle:h})]})},Z8="shlink/shortUrlCreation",FN={saving:!1,saved:!1,error:!1},pge=e=>or(`${Z8}/createShortUrl`,(t,{getState:n})=>e(n).createShortUrl(t)),mge=e=>{const{reducer:t,actions:n}=Gn({name:Z8,initialState:FN,reducers:{resetCreateShortUrl:()=>FN},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(o,{error:s})=>({saving:!1,saved:!1,error:!0,errorData:io(s)})),i.addCase(e.fulfilled,(o,{payload:s})=>({result:s,saving:!1,saved:!0,error:!1}))}}),{resetCreateShortUrl:r}=n;return{reducer:t,resetCreateShortUrl:r}},$N="shlink/shortUrlDetail",jN={loading:!1,error:!1},gge=e=>{const t=or(`${$N}/getShortUrlDetail`,async({shortCode:r,domain:i},{getState:o})=>{var l;const{shortUrlsList:s}=o();return((l=s==null?void 0:s.shortUrls)==null?void 0:l.data.find(c=>kf(c,r,i)))??await e(o).getShortUrl(r,i)}),{reducer:n}=Gn({name:$N,initialState:jN,reducers:{},extraReducers:r=>{r.addCase(t.pending,()=>({loading:!0,error:!1})),r.addCase(t.rejected,(i,{error:o})=>({loading:!1,error:!0,errorData:io(o)})),r.addCase(t.fulfilled,(i,{payload:o})=>({...jN,shortUrl:o}))}});return{reducer:n,getShortUrlDetail:t}},K8="shlink/shortUrlEdition",vge={saving:!1,saved:!1,error:!1},yge=e=>or(`${K8}/editShortUrl`,({shortCode:t,domain:n,data:r},{getState:i})=>{const{updateShortUrl:o}=e(i);return o(t,n,r)}),_ge=e=>Gn({name:K8,initialState:vge,reducers:{},extraReducers:t=>{t.addCase(e.pending,n=>({...n,saving:!0,error:!1,saved:!1})),t.addCase(e.rejected,(n,{error:r})=>({...n,saving:!1,error:!0,saved:!1,errorData:io(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({shortUrl:r,saving:!1,error:!1,saved:!0}))}});var bge={prefix:"fab",iconName:"apple",icon:[384,512,[],"f179","M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"]},wge={prefix:"fab",iconName:"android",icon:[576,512,[],"f17b","M420.55,301.93a24,24,0,1,1,24-24,24,24,0,0,1-24,24m-265.1,0a24,24,0,1,1,24-24,24,24,0,0,1-24,24m273.7-144.48,47.94-83a10,10,0,1,0-17.27-10h0l-48.54,84.07a301.25,301.25,0,0,0-246.56,0L116.18,64.45a10,10,0,1,0-17.27,10h0l47.94,83C64.53,202.22,8.24,285.55,0,384H576c-8.24-98.45-64.54-181.78-146.85-226.55"]};const X8=e=>C(F8,{type:"checkbox",...e});function xge(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gx(e,t)}function gx(e,t){return gx=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},gx(e,t)}function Sge(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function BN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cge(e,t,n){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n)}function Ege(e,t,n){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&Cge(e,t,n))return!0;e=e.parentNode||e.host}return e}function Tge(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var Oge=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var t=!1,n=Object.defineProperty({},"passive",{get:function(){t=!0}}),r=function(){};return window.addEventListener("testPassiveEventSupport",r,n),window.removeEventListener("testPassiveEventSupport",r,n),t}};function Pge(e){return e===void 0&&(e=0),function(){return++e}}var kge=Pge(),vx,Ip={},j1={},Mge=["touchstart","touchmove"],Rge="ignore-react-onclickoutside";function zN(e,t){var n=null,r=Mge.indexOf(t)!==-1;return r&&vx&&(n={passive:!e.props.preventDefault}),n}function k_(e,t){var n,r,i=e.displayName||e.name||"Component";return r=n=function(o){xge(s,o);function s(l){var c;return c=o.call(this,l)||this,c.__outsideClickHandler=function(f){if(typeof c.__clickOutsideHandlerProp=="function"){c.__clickOutsideHandlerProp(f);return}var h=c.getInstance();if(typeof h.props.handleClickOutside=="function"){h.props.handleClickOutside(f);return}if(typeof h.handleClickOutside=="function"){h.handleClickOutside(f);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},c.__getComponentNode=function(){var f=c.getInstance();return t&&typeof t.setClickOutsideRef=="function"?t.setClickOutsideRef()(f):typeof f.setClickOutsideRef=="function"?f.setClickOutsideRef():Ga.findDOMNode(f)},c.enableOnClickOutside=function(){if(!(typeof document>"u"||j1[c._uid])){typeof vx>"u"&&(vx=Oge()),j1[c._uid]=!0;var f=c.props.eventTypes;f.forEach||(f=[f]),Ip[c._uid]=function(h){if(c.componentNode!==null&&(c.props.preventDefault&&h.preventDefault(),c.props.stopPropagation&&h.stopPropagation(),!(c.props.excludeScrollbar&&Tge(h)))){var p=h.composed&&h.composedPath&&h.composedPath().shift()||h.target;Ege(p,c.componentNode,c.props.outsideClickIgnoreClass)===document&&c.__outsideClickHandler(h)}},f.forEach(function(h){document.addEventListener(h,Ip[c._uid],zN(BN(c),h))})}},c.disableOnClickOutside=function(){delete j1[c._uid];var f=Ip[c._uid];if(f&&typeof document<"u"){var h=c.props.eventTypes;h.forEach||(h=[h]),h.forEach(function(p){return document.removeEventListener(p,f,zN(BN(c),p))}),delete Ip[c._uid]}},c.getRef=function(f){return c.instanceRef=f},c._uid=kge(),c}var a=s.prototype;return a.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var c=this.instanceRef;return c.getInstance?c.getInstance():c},a.componentDidMount=function(){if(!(typeof document>"u"||!document.createElement)){var c=this.getInstance();if(t&&typeof t.handleClickOutside=="function"&&(this.__clickOutsideHandlerProp=t.handleClickOutside(c),typeof this.__clickOutsideHandlerProp!="function"))throw new Error("WrappedComponent: "+i+" lacks a function for processing outside click events specified by the handleClickOutside config option.");this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside()}},a.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},a.componentWillUnmount=function(){this.disableOnClickOutside()},a.render=function(){var c=this.props;c.excludeScrollbar;var f=Sge(c,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?f.ref=this.getRef:f.wrappedRef=this.getRef,f.disableOnClickOutside=this.disableOnClickOutside,f.enableOnClickOutside=this.enableOnClickOutside,H.createElement(e,f)},s}(H.Component),n.displayName="OnClickOutside("+i+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:Rge,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}var Q8=H.createContext(),J8=H.createContext();function Nge(e){var t=e.children,n=H.useState(null),r=n[0],i=n[1],o=H.useRef(!1);H.useEffect(function(){return function(){o.current=!0}},[]);var s=H.useCallback(function(a){o.current||i(a)},[]);return H.createElement(Q8.Provider,{value:r},H.createElement(J8.Provider,{value:s},t))}var eF=function(t){return Array.isArray(t)?t[0]:t},tF=function(t){if(typeof t=="function"){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=_x(e);if(t){var i=_x(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Bge(this,n)}}function iF(e){return function(t){if(Array.isArray(t))return B1(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return B1(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B1(t,n)}}(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function B1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o=N1(e,t.slice(0,e.length),new Date)),is(o)||(o=new Date(e))),is(o)&&a?o:null)}function is(e,t){return t=t||new Date("1/1/1000"),i8(e)&&!Kr(e,t)}function ln(e,t,n){if(n==="en")return _o(e,t,{awareOfUnicodeTokens:!0});var r=Ds(n);return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),!r&&Wa()&&Ds(Wa())&&(r=Ds(Wa())),_o(e,t,{locale:r||null,awareOfUnicodeTokens:!0})}function z1(e,t){var n=t.dateFormat,r=t.locale;return e&&ln(e,Array.isArray(n)?n[0]:n,r)||""}function ZN(e,t){var n=t.hour,r=n===void 0?0:n,i=t.minute,o=i===void 0?0:i,s=t.second;return Mf(Rf(Khe(e,s===void 0?0:s),o),r)}function Hge(e,t){var n=t&&Ds(t)||Wa()&&Ds(Wa());return ace(e,n?{locale:n}:null)}function Wge(e,t){return ln(e,"ddd",t)}function Yge(e){return Ar(e)}function GE(e,t,n){var r=Ds(t||Wa());return r8(e,{locale:r,weekStartsOn:n})}function Ha(e){return Yae(e)}function rf(e){return qae(e)}function qge(e){return e2(e)}function oF(e,t){return e&&t?Dhe(e,t):!e&&!t}function ys(e,t){return e&&t?Nhe(e,t):!e&&!t}function ay(e,t){return e&&t?Lhe(e,t):!e&&!t}function gr(e,t){return e&&t?jae(e,t):!e&&!t}function _s(e,t){return e&&t?h8(e,t):!e&&!t}function sg(e,t,n){var r,i=Ar(t),o=al(n);try{r=Wc(e,{start:i,end:o})}catch{r=!1}return r}function Wa(){return(typeof window<"u"?window:globalThis).__localeId__}function Ds(e){if(typeof e=="string"){var t=typeof window<"u"?window:globalThis;return t.__localeData__?t.__localeData__[e]:null}return e}function sF(e,t){return ln(qi(mn(),e),"LLLL",t)}function aF(e,t){return ln(qi(mn(),e),"LLL",t)}function Gge(e,t){return ln(nf(mn(),e),"QQQ",t)}function R_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.excludeDateIntervals,s=t.includeDates,a=t.includeDateIntervals,l=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(c){return gr(e,c)})||o&&o.some(function(c){var f=c.start,h=c.end;return Wc(e,{start:f,end:h})})||s&&!s.some(function(c){return gr(e,c)})||a&&!a.some(function(c){var f=c.start,h=c.end;return Wc(e,{start:f,end:h})})||l&&!l(mn(e))||!1}function ZE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.excludeDates,r=t.excludeDateIntervals;return r&&r.length>0?r.some(function(i){var o=i.start,s=i.end;return Wc(e,{start:o,end:s})}):n&&n.some(function(i){return gr(e,i)})||!1}function Zge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,s=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(a){return ys(e,a)})||o&&!o.some(function(a){return ys(e,a)})||s&&!s(mn(e))||!1}function Kge(e,t,n,r){var i=pt(e),o=ur(e),s=pt(t),a=ur(t),l=pt(r);return i===s&&i===l?o<=n&&n<=a:i=n||li:void 0}function Xge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,s=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(a){return ay(e,a)})||o&&!o.some(function(a){return ay(e,a)})||s&&!s(mn(e))||!1}function Qge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=new Date(e,0,1);return N_(i,{minDate:n,maxDate:r})||!1}function Jge(e,t,n,r){var i=pt(e),o=Jw(e),s=pt(t),a=Jw(t),l=pt(r);return i===s&&i===l?o<=n&&n<=a:i=n||li:void 0}function N_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate;return n&&Od(e,n)<0||r&&Od(e,r)>0}function KN(e,t){return t.some(function(n){return Ti(n)===Ti(e)&&Oi(n)===Oi(e)})}function XN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.excludeTimes,r=t.includeTimes,i=t.filterTime;return n&&KN(e,n)||r&&!KN(e,r)||i&&!i(e)||!1}function QN(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var i,o=mn(),s=Mf(Rf(o,Oi(e)),Ti(e)),a=Mf(Rf(o,Oi(n)),Ti(n)),l=Mf(Rf(o,Oi(r)),Ti(r));try{i=!Wc(s,{start:a,end:l})}catch{i=!1}return i}function JN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=kd(e,1);return n&&Pd(n,i)>0||r&&r.every(function(o){return Pd(o,i)>0})||!1}function eL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=ro(e,1);return n&&Pd(i,n)>0||r&&r.every(function(o){return Pd(i,o)>0})||!1}function tL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=Md(e,1);return n&&yv(n,i)>0||r&&r.every(function(o){return yv(o,i)>0})||!1}function nL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=Vc(e,1);return n&&yv(i,n)>0||r&&r.every(function(o){return yv(i,o)>0})||!1}function lF(e){var t=e.minDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Od(i,t)>=0});return J3(r)}return n?J3(n):t}function cF(e){var t=e.maxDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Od(i,t)<=0});return Q3(r)}return n?Q3(n):t}function rL(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"react-datepicker__day--highlighted",n=new Map,r=0,i=e.length;r1&&arguments[1]!==void 0?arguments[1]:12,n=Math.ceil(pt(e)/t)*t,r=n-(t-1);return{startPeriod:r,endPeriod:n}}function tve(e,t,n,r){for(var i=[],o=0;o<2*t+1;o++){var s=e+t-o,a=!0;n&&(a=pt(n)<=s),r&&a&&(a=pt(r)>=s),a&&i.push(s)}return i}var nve=k_(function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;Rn(this,n),ie(ce(i=t.call(this,r)),"renderOptions",function(){var l=i.props.year,c=i.state.yearsList.map(function(p){return V.createElement("div",{className:l===p?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:p,onClick:i.onChange.bind(ce(i),p),"aria-selected":l===p?"true":void 0},l===p?V.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",p)}),f=i.props.minDate?pt(i.props.minDate):null,h=i.props.maxDate?pt(i.props.maxDate):null;return h&&i.state.yearsList.find(function(p){return p===h})||c.unshift(V.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:i.incrementYears},V.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),f&&i.state.yearsList.find(function(p){return p===f})||c.push(V.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:i.decrementYears},V.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c}),ie(ce(i),"onChange",function(l){i.props.onChange(l)}),ie(ce(i),"handleClickOutside",function(){i.props.onCancel()}),ie(ce(i),"shiftYears",function(l){var c=i.state.yearsList.map(function(f){return f+l});i.setState({yearsList:c})}),ie(ce(i),"incrementYears",function(){return i.shiftYears(1)}),ie(ce(i),"decrementYears",function(){return i.shiftYears(-1)});var o=r.yearDropdownItemNumber,s=r.scrollableYearDropdown,a=o||(s?10:5);return i.state={yearsList:tve(i.props.year,a,i.props.minDate,i.props.maxDate)},i.dropdownRef=H.createRef(),i}return Nn(n,[{key:"componentDidMount",value:function(){var r=this.dropdownRef.current;r&&(r.scrollTop=r.scrollHeight/2-r.clientHeight/2)}},{key:"render",value:function(){var r=ge({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return V.createElement("div",{className:r,ref:this.dropdownRef},this.renderOptions())}}]),n}()),rve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:{},l=!1;r.getTabIndex()===0&&!a.isInputFocused&&r.isSameDay(r.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(l=!0),r.props.inline&&!r.props.shouldFocusDayInline&&(l=!1),r.props.containerRef&&r.props.containerRef.current&&r.props.containerRef.current.contains(document.activeElement)&&document.activeElement.classList.contains("react-datepicker__day")&&(l=!0)),l&&r.dayEl.current.focus({preventScroll:!0})}),ie(ce(r),"renderDayContents",function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(sR(r.props.day),r.props.day):sR(r.props.day)}),ie(ce(r),"render",function(){return V.createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.handleMouseEnter,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"option","aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()},r.renderDayContents())}),r}return Nn(n,[{key:"componentDidMount",value:function(){this.handleFocusDay()}},{key:"componentDidUpdate",value:function(r){this.handleFocusDay(r)}}]),n}(),uve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=6,m=!l&&!r.isWeekInMonth(h);if(p||m){if(!r.props.peekNextMonth)break;f=!0}}return a}),ie(ce(r),"onMonthClick",function(a,l){r.handleDayClick(Ha(qi(r.props.day,l)),a)}),ie(ce(r),"handleMonthNavigation",function(a,l){r.isDisabled(l)||r.isExcluded(l)||(r.props.setPreSelection(l),r.MONTH_REFS[a].current&&r.MONTH_REFS[a].current.focus())}),ie(ce(r),"onMonthKeyDown",function(a,l){var c=a.key;if(!r.props.disabledKeyboardNavigation)switch(c){case"Enter":r.onMonthClick(a,l),r.props.setPreSelection(r.props.selected);break;case"ArrowRight":r.handleMonthNavigation(l===11?0:l+1,ro(r.props.preSelection,1));break;case"ArrowLeft":r.handleMonthNavigation(l===0?11:l-1,kd(r.props.preSelection,1))}}),ie(ce(r),"onQuarterClick",function(a,l){r.handleDayClick(qge(nf(r.props.day,l)),a)}),ie(ce(r),"getMonthClassNames",function(a){var l=r.props,c=l.day,f=l.startDate,h=l.endDate,p=l.selected,m=l.minDate,g=l.maxDate,v=l.preSelection,w=l.monthClassName,y=w?w(c):void 0;return ge("react-datepicker__month-text","react-datepicker__month-".concat(a),y,{"react-datepicker__month--disabled":(m||g)&&Zge(qi(c,a),r.props),"react-datepicker__month--selected":r.isSelectedMonth(c,a,p),"react-datepicker__month-text--keyboard-selected":ur(v)===a,"react-datepicker__month--in-range":Kge(f,h,a,c),"react-datepicker__month--range-start":r.isRangeStartMonth(a),"react-datepicker__month--range-end":r.isRangeEndMonth(a),"react-datepicker__month-text--today":r.isCurrentMonth(c,a)})}),ie(ce(r),"getTabIndex",function(a){var l=ur(r.props.preSelection);return r.props.disabledKeyboardNavigation||a!==l?"-1":"0"}),ie(ce(r),"getAriaLabel",function(a){var l=r.props,c=l.chooseDayAriaLabelPrefix,f=c===void 0?"Choose":c,h=l.disabledDayAriaLabelPrefix,p=h===void 0?"Not available":h,m=l.day,g=qi(m,a),v=r.isDisabled(g)||r.isExcluded(g)?p:f;return"".concat(v," ").concat(ln(g,"MMMM yyyy"))}),ie(ce(r),"getQuarterClassNames",function(a){var l=r.props,c=l.day,f=l.startDate,h=l.endDate,p=l.selected,m=l.minDate,g=l.maxDate;return ge("react-datepicker__quarter-text","react-datepicker__quarter-".concat(a),{"react-datepicker__quarter--disabled":(m||g)&&Xge(nf(c,a),r.props),"react-datepicker__quarter--selected":r.isSelectedQuarter(c,a,p),"react-datepicker__quarter--in-range":Jge(f,h,a,c),"react-datepicker__quarter--range-start":r.isRangeStartQuarter(a),"react-datepicker__quarter--range-end":r.isRangeEndQuarter(a)})}),ie(ce(r),"renderMonths",function(){var a=r.props,l=a.showFullMonthYearPicker,c=a.showTwoColumnMonthYearPicker,f=a.showFourColumnMonthYearPicker,h=a.locale,p=a.day,m=a.selected;return(f?[[0,1,2,3],[4,5,6,7],[8,9,10,11]]:c?[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]]:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]]).map(function(g,v){return V.createElement("div",{className:"react-datepicker__month-wrapper",key:v},g.map(function(w,y){return V.createElement("div",{ref:r.MONTH_REFS[w],key:y,onClick:function(b){r.onMonthClick(b,w)},onKeyDown:function(b){r.onMonthKeyDown(b,w)},tabIndex:r.getTabIndex(w),className:r.getMonthClassNames(w),role:"option","aria-label":r.getAriaLabel(w),"aria-current":r.isCurrentMonth(p,w)?"date":void 0,"aria-selected":r.isSelectedMonth(p,w,m)},l?sF(w,h):aF(w,h))}))})}),ie(ce(r),"renderQuarters",function(){var a=r.props,l=a.day,c=a.selected;return V.createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(f,h){return V.createElement("div",{key:h,role:"option",onClick:function(p){r.onQuarterClick(p,f)},className:r.getQuarterClassNames(f),"aria-selected":r.isSelectedQuarter(l,f,c)},Gge(f,r.props.locale))}))}),ie(ce(r),"getClassNames",function(){var a=r.props;a.day;var l=a.selectingDate,c=a.selectsStart,f=a.selectsEnd,h=a.showMonthYearPicker,p=a.showQuarterYearPicker;return ge("react-datepicker__month",{"react-datepicker__month--selecting-range":l&&(c||f)},{"react-datepicker__monthPicker":h},{"react-datepicker__quarterPicker":p})}),r}return Nn(n,[{key:"render",value:function(){var r=this.props,i=r.showMonthYearPicker,o=r.showQuarterYearPicker,s=r.day,a=r.ariaLabelPrefix,l=a===void 0?"month ":a;return V.createElement("div",{className:this.getClassNames(),onMouseLeave:this.handleMouseLeave,"aria-label":"".concat(l," ").concat(ln(s,"yyyy-MM")),role:"listbox"},i?this.renderMonths():o?this.renderQuarters():this.renderWeeks())}}]),n}(),uF=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:{}).className||"").split(/\s+/);return gve.some(function(a){return s.indexOf(a)>=0})})(o.target)&&i.props.onDropdownFocus()}),ie(ce(i),"getDateInView",function(){var o=i.props,s=o.preSelection,a=o.selected,l=o.openToDate,c=lF(i.props),f=cF(i.props),h=mn(),p=l||a||s;return p||(c&&Kr(h,c)?c:f&&Hs(h,f)?f:h)}),ie(ce(i),"increaseMonth",function(){i.setState(function(o){var s=o.date;return{date:ro(s,1)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"decreaseMonth",function(){i.setState(function(o){var s=o.date;return{date:kd(s,1)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"handleDayClick",function(o,s,a){i.props.onSelect(o,s,a),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleDayMouseEnter",function(o){i.setState({selectingDate:o}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(o)}),ie(ce(i),"handleMonthMouseLeave",function(){i.setState({selectingDate:null}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()}),ie(ce(i),"handleYearChange",function(o){i.props.onYearChange&&i.props.onYearChange(o),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(o),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleMonthChange",function(o){i.props.onMonthChange&&i.props.onMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(o),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleMonthYearChange",function(o){i.handleYearChange(o),i.handleMonthChange(o)}),ie(ce(i),"changeYear",function(o){i.setState(function(s){var a=s.date;return{date:ty(a,o)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"changeMonth",function(o){i.setState(function(s){var a=s.date;return{date:qi(a,o)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"changeMonthYear",function(o){i.setState(function(s){var a=s.date;return{date:ty(qi(a,ur(o)),pt(o))}},function(){return i.handleMonthYearChange(i.state.date)})}),ie(ce(i),"header",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i.state.date,s=GE(o,i.props.locale,i.props.calendarStartDay),a=[];return i.props.showWeekNumbers&&a.push(V.createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),a.concat([0,1,2,3,4,5,6].map(function(l){var c=vl(s,l),f=i.formatWeekday(c,i.props.locale),h=i.props.weekDayClassName?i.props.weekDayClassName(c):void 0;return V.createElement("div",{key:l,className:ge("react-datepicker__day-name",h)},f)}))}),ie(ce(i),"formatWeekday",function(o,s){return i.props.formatWeekDay?function(a,l,c){return l(ln(a,"EEEE",c))}(o,i.props.formatWeekDay,s):i.props.useWeekdaysShort?function(a,l){return ln(a,"EEE",l)}(o,s):function(a,l){return ln(a,"EEEEEE",l)}(o,s)}),ie(ce(i),"decreaseYear",function(){i.setState(function(o){var s=o.date;return{date:Md(s,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"renderPreviousButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=tL(i.state.date,i.props);break;case i.props.showYearPicker:o=function(y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=b.minDate,T=b.yearItemNumber,P=T===void 0?12:T,k=Df(rf(Md(y,P)),P).endPeriod,N=x&&pt(x);return N&&N>k||!1}(i.state.date,i.props);break;default:o=JN(i.state.date,i.props)}if((i.props.forceShowMonthNavigation||i.props.showDisabledMonthNavigation||!o)&&!i.props.showTimeSelectOnly){var s=["react-datepicker__navigation","react-datepicker__navigation--previous"],a=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.decreaseYear),o&&i.props.showDisabledMonthNavigation&&(s.push("react-datepicker__navigation--previous--disabled"),a=null);var l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,c=i.props,f=c.previousMonthButtonLabel,h=c.previousYearButtonLabel,p=i.props,m=p.previousMonthAriaLabel,g=m===void 0?typeof f=="string"?f:"Previous Month":m,v=p.previousYearAriaLabel,w=v===void 0?typeof h=="string"?h:"Previous Year":v;return V.createElement("button",{type:"button",className:s.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":l?w:g},V.createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},l?i.props.previousYearButtonLabel:i.props.previousMonthButtonLabel))}}}),ie(ce(i),"increaseYear",function(){i.setState(function(o){var s=o.date;return{date:Vc(s,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"renderNextButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=nL(i.state.date,i.props);break;case i.props.showYearPicker:o=function(y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=b.maxDate,T=b.yearItemNumber,P=T===void 0?12:T,k=Df(Vc(y,P),P).startPeriod,N=x&&pt(x);return N&&N0&&arguments[0]!==void 0?arguments[0]:i.state.date,s=["react-datepicker__current-month"];return i.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),V.createElement("div",{className:s.join(" ")},ln(o,i.props.dateFormat,i.props.locale))}),ie(ce(i),"renderYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showYearDropdown&&!o)return V.createElement(rve,{adjustDateOnChange:i.props.adjustDateOnChange,date:i.state.date,onSelect:i.props.onSelect,setOpen:i.props.setOpen,dropdownMode:i.props.dropdownMode,onChange:i.changeYear,minDate:i.props.minDate,maxDate:i.props.maxDate,year:pt(i.state.date),scrollableYearDropdown:i.props.scrollableYearDropdown,yearDropdownItemNumber:i.props.yearDropdownItemNumber})}),ie(ce(i),"renderMonthDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthDropdown&&!o)return V.createElement(ove,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,onChange:i.changeMonth,month:ur(i.state.date),useShortMonthInDropdown:i.props.useShortMonthInDropdown})}),ie(ce(i),"renderMonthYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthYearDropdown&&!o)return V.createElement(lve,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,dateFormat:i.props.dateFormat,onChange:i.changeMonthYear,minDate:i.props.minDate,maxDate:i.props.maxDate,date:i.state.date,scrollableMonthYearDropdown:i.props.scrollableMonthYearDropdown})}),ie(ce(i),"renderTodayButton",function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return V.createElement("div",{className:"react-datepicker__today-button",onClick:function(o){return i.props.onSelect(Ar(mn()),o)}},i.props.todayButton)}),ie(ce(i),"renderDefaultHeader",function(o){var s=o.monthDate,a=o.i;return V.createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(s),V.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(a!==0),i.renderMonthYearDropdown(a!==0),i.renderYearDropdown(a!==0)),V.createElement("div",{className:"react-datepicker__day-names"},i.header(s)))}),ie(ce(i),"renderCustomHeader",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.monthDate,a=o.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var l=JN(i.state.date,i.props),c=eL(i.state.date,i.props),f=tL(i.state.date,i.props),h=nL(i.state.date,i.props),p=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return V.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},i.props.renderCustomHeader(WN(WN({},i.state),{},{customHeaderCount:a,monthDate:s,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:l,nextMonthButtonDisabled:c,prevYearButtonDisabled:f,nextYearButtonDisabled:h})),p&&V.createElement("div",{className:"react-datepicker__day-names"},i.header(s)))}),ie(ce(i),"renderYearHeader",function(){var o=i.state.date,s=i.props,a=s.showYearPicker,l=Df(o,s.yearItemNumber),c=l.startPeriod,f=l.endPeriod;return V.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(c," - ").concat(f):pt(o))}),ie(ce(i),"renderHeader",function(o){switch(!0){case i.props.renderCustomHeader!==void 0:return i.renderCustomHeader(o);case(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker):return i.renderYearHeader(o);default:return i.renderDefaultHeader(o)}}),ie(ce(i),"renderMonths",function(){if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],s=i.props.showPreviousMonths?i.props.monthsShown-1:0,a=kd(i.state.date,s),l=0;l0;o.push(V.createElement("div",{key:h,ref:function(g){i.monthContainer=g},className:"react-datepicker__month-container"},i.renderHeader({monthDate:f,i:l}),V.createElement(dve,{chooseDayAriaLabelPrefix:i.props.chooseDayAriaLabelPrefix,disabledDayAriaLabelPrefix:i.props.disabledDayAriaLabelPrefix,weekAriaLabelPrefix:i.props.weekAriaLabelPrefix,ariaLabelPrefix:i.props.monthAriaLabelPrefix,onChange:i.changeMonthYear,day:f,dayClassName:i.props.dayClassName,calendarStartDay:i.props.calendarStartDay,monthClassName:i.props.monthClassName,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,onWeekSelect:i.props.onWeekSelect,orderInDisplay:l,formatWeekNumber:i.props.formatWeekNumber,locale:i.props.locale,minDate:i.props.minDate,maxDate:i.props.maxDate,excludeDates:i.props.excludeDates,excludeDateIntervals:i.props.excludeDateIntervals,highlightDates:i.props.highlightDates,selectingDate:i.state.selectingDate,includeDates:i.props.includeDates,includeDateIntervals:i.props.includeDateIntervals,inline:i.props.inline,shouldFocusDayInline:i.props.shouldFocusDayInline,fixedHeight:i.props.fixedHeight,filterDate:i.props.filterDate,preSelection:i.props.preSelection,setPreSelection:i.props.setPreSelection,selected:i.props.selected,selectsStart:i.props.selectsStart,selectsEnd:i.props.selectsEnd,selectsRange:i.props.selectsRange,selectsDisabledDaysInRange:i.props.selectsDisabledDaysInRange,showWeekNumbers:i.props.showWeekNumbers,startDate:i.props.startDate,endDate:i.props.endDate,peekNextMonth:i.props.peekNextMonth,setOpen:i.props.setOpen,shouldCloseOnSelect:i.props.shouldCloseOnSelect,renderDayContents:i.props.renderDayContents,disabledKeyboardNavigation:i.props.disabledKeyboardNavigation,showMonthYearPicker:i.props.showMonthYearPicker,showFullMonthYearPicker:i.props.showFullMonthYearPicker,showTwoColumnMonthYearPicker:i.props.showTwoColumnMonthYearPicker,showFourColumnMonthYearPicker:i.props.showFourColumnMonthYearPicker,showYearPicker:i.props.showYearPicker,showQuarterYearPicker:i.props.showQuarterYearPicker,isInputFocused:i.props.isInputFocused,containerRef:i.containerRef,monthShowsDuplicateDaysEnd:p,monthShowsDuplicateDaysStart:m})))}return o}}),ie(ce(i),"renderYears",function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?V.createElement("div",{className:"react-datepicker__year--container"},i.renderHeader(),V.createElement(hve,M_({onDayClick:i.handleDayClick,date:i.state.date},i.props))):void 0}),ie(ce(i),"renderTimeSection",function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return V.createElement(uF,{selected:i.props.selected,openToDate:i.props.openToDate,onChange:i.props.onTimeChange,timeClassName:i.props.timeClassName,format:i.props.timeFormat,includeTimes:i.props.includeTimes,intervals:i.props.timeIntervals,minTime:i.props.minTime,maxTime:i.props.maxTime,excludeTimes:i.props.excludeTimes,filterTime:i.props.filterTime,timeCaption:i.props.timeCaption,todayButton:i.props.todayButton,showMonthDropdown:i.props.showMonthDropdown,showMonthYearDropdown:i.props.showMonthYearDropdown,showYearDropdown:i.props.showYearDropdown,withPortal:i.props.withPortal,monthRef:i.state.monthContainer,injectTimes:i.props.injectTimes,locale:i.props.locale,handleOnKeyDown:i.props.handleOnKeyDown,showTimeSelectOnly:i.props.showTimeSelectOnly})}),ie(ce(i),"renderInputTimeSection",function(){var o=new Date(i.props.selected),s=is(o)&&i.props.selected?"".concat(iL(o.getHours()),":").concat(iL(o.getMinutes())):"";if(i.props.showTimeInput)return V.createElement(pve,{date:o,timeString:s,timeInputLabel:i.props.timeInputLabel,onChange:i.props.onTimeChange,customTimeInput:i.props.customTimeInput})}),i.containerRef=V.createRef(),i.state={date:i.getDateInView(),selectingDate:null,monthContainer:null},i}return Nn(n,[{key:"componentDidMount",value:function(){var r=this;this.props.showTimeSelect&&(this.assignMonthContainer=void r.setState({monthContainer:r.monthContainer}))}},{key:"componentDidUpdate",value:function(r){this.props.preSelection&&!gr(this.props.preSelection,r.preSelection)?this.setState({date:this.props.preSelection}):this.props.openToDate&&!gr(this.props.openToDate,r.openToDate)&&this.setState({date:this.props.openToDate})}},{key:"render",value:function(){var r=this.props.container||mve;return V.createElement("div",{ref:this.containerRef},V.createElement(r,{className:ge("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showPopperArrow:this.props.showPopperArrow,arrowProps:this.props.arrowProps},this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.props.children))}}],[{key:"defaultProps",get:function(){return{onDropdownFocus:function(){},monthsShown:1,monthSelectedIn:0,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",customTimeInput:null,yearItemNumber:12}}}]),n}(),fF=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),(i=t.call(this,r)).el=document.createElement("div"),i}return Nn(n,[{key:"componentDidMount",value:function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.portalRoot.removeChild(this.el)}},{key:"render",value:function(){return za.createPortal(this.props.children,this.el)}}]),n}(),yve=function(e){return!e.disabled&&e.tabIndex!==-1},_ve=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),ie(ce(i=t.call(this,r)),"getTabChildren",function(){return Array.prototype.slice.call(i.tabLoopRef.current.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(yve)}),ie(ce(i),"handleFocusStart",function(o){var s=i.getTabChildren();s&&s.length>1&&s[s.length-1].focus()}),ie(ce(i),"handleFocusEnd",function(o){var s=i.getTabChildren();s&&s.length>1&&s[0].focus()}),i.tabLoopRef=V.createRef(),i}return Nn(n,[{key:"render",value:function(){return this.props.enableTabLoop?V.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},V.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:"0",onFocus:this.handleFocusStart}),this.props.children,V.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:"0",onFocus:this.handleFocusEnd})):this.props.children}}],[{key:"defaultProps",get:function(){return{enableTabLoop:!0}}}]),n}(),bve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){return Rn(this,n),t.apply(this,arguments)}return Nn(n,[{key:"render",value:function(){var r,i=this.props,o=i.className,s=i.wrapperClassName,a=i.hidePopper,l=i.popperComponent,c=i.popperModifiers,f=i.popperPlacement,h=i.popperProps,p=i.targetComponent,m=i.enableTabLoop,g=i.popperOnKeyDown,v=i.portalId,w=i.portalHost;if(!a){var y=ge("react-datepicker-popper",o);r=V.createElement($ge,M_({modifiers:c,placement:f},h),function(x){var T=x.ref,P=x.style,k=x.placement,N=x.arrowProps;return V.createElement(_ve,{enableTabLoop:m},V.createElement("div",{ref:T,style:P,className:y,"data-placement":k,onKeyDown:g},V.cloneElement(l,{arrowProps:N})))})}this.props.popperContainer&&(r=V.createElement(this.props.popperContainer,{},r)),v&&!a&&(r=V.createElement(fF,{portalId:v,portalHost:w},r));var b=ge("react-datepicker-wrapper",s);return V.createElement(Nge,{className:"react-datepicker-manager"},V.createElement(jge,null,function(x){var T=x.ref;return V.createElement("div",{ref:T,className:b},p)}),r)}}],[{key:"defaultProps",get:function(){return{hidePopper:!0,popperModifiers:[],popperProps:{},popperPlacement:"bottom-start"}}}]),n}(),wve=k_(vve),xve=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),ie(ce(i=t.call(this,r)),"getPreSelection",function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:mn()}),ie(ce(i),"calcInitialState",function(){var o,s=i.getPreSelection(),a=lF(i.props),l=cF(i.props),c=a&&Kr(s,Ar(a))?a:l&&Hs(s,al(l))?l:s;return{open:i.props.startOpen||!1,preventFocus:!1,preSelection:(o=i.props.selectsRange?i.props.startDate:i.props.selected)!==null&&o!==void 0?o:c,highlightDates:rL(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1}}),ie(ce(i),"clearPreventFocusTimeout",function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)}),ie(ce(i),"setFocus",function(){i.input&&i.input.focus&&i.input.focus({preventScroll:!0})}),ie(ce(i),"setBlur",function(){i.input&&i.input.blur&&i.input.blur(),i.cancelFocusInput()}),ie(ce(i),"setOpen",function(o){var s=arguments.length>1&&arguments[1]!==void 0&&arguments[1];i.setState({open:o,preSelection:o&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:U1},function(){o||i.setState(function(a){return{focused:!!s&&a.focused}},function(){!s&&i.setBlur(),i.setState({inputValue:null})})})}),ie(ce(i),"inputOk",function(){return ME(i.state.preSelection)}),ie(ce(i),"isCalendarOpen",function(){return i.props.open===void 0?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open}),ie(ce(i),"handleFocus",function(o){i.state.preventFocus||(i.props.onFocus(o),i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})}),ie(ce(i),"cancelFocusInput",function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=null}),ie(ce(i),"deferFocusInput",function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)}),ie(ce(i),"handleDropdownFocus",function(){i.cancelFocusInput()}),ie(ce(i),"handleBlur",function(o){(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&i.props.onBlur(o),i.setState({focused:!1})}),ie(ce(i),"handleCalendarClickOutside",function(o){i.props.inline||i.setOpen(!1),i.props.onClickOutside(o),i.props.withPortal&&o.preventDefault()}),ie(ce(i),"handleChange",function(){for(var o=arguments.length,s=new Array(o),a=0;a{const{className:t,isClearable:n,selected:r,dateFormat:i}=e,o=!n||Bo(r),s=H.useRef();return U("div",{className:"icon-input-container",children:[C(xve,{...e,popperModifiers:[{name:"arrow",options:{padding:24}}],dateFormat:i??Nf,className:ge("icon-input-container__input form-control",t),ref:s}),o&&C(Fe,{icon:Rpe,className:"icon-input-container__icon",onClick:()=>{var a;return(a=s.current)==null?void 0:a.input.focus()}})]})},Cve=e=>C(bx,{...e,dateFormat:zE,showTimeSelect:!0,timeIntervals:10});const Eve=({icon:e,className:t,...n})=>{const r=gl(),i=ge("icon-input-container__input",t);return U("div",{className:"icon-input-container",children:[C(zc,{className:i,innerRef:r,...n}),C(Fe,{icon:e,fixedWidth:!0,className:"icon-input-container__icon",onClick:()=>{var o;return(o=r.current)==null?void 0:o.focus()}})]})},V1=({children:e,infoTooltip:t,checked:n,onChange:r})=>U("p",{children:[C(X8,{inline:!0,checked:n,className:t?"me-2":"",onChange:r,children:e}),t&&C(og,{placement:"right",children:t})]});const Tve=({isOpen:e,toggle:t})=>U(Ho,{isOpen:e,toggle:t,centered:!0,size:"lg",children:[C(oo,{toggle:t,children:"Info"}),U(Ri,{children:[U("p",{children:["When the ",C("b",{children:C("i",{children:'"Use existing URL if found"'})})," checkbox is checked, the server will return an existing short URL if it matches provided params."]}),C("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),U("ul",{children:[C("li",{children:"When only the long URL is provided: The most recent match will be returned, or a new short URL will be created if none is found."}),U("li",{children:["When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.",C("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),C("li",{children:"When other params are provided: Same as in previous cases, but it will try to match existing short URLs with all provided data. If any of them does not match, a new short URL will be created"})]})]})]}),Ove=()=>{const[e,t]=jt();return U(We,{children:[C("span",{title:"What does this mean?",children:C(Fe,{icon:bC,style:{cursor:"pointer"},onClick:t})}),C(Tve,{isOpen:e,toggle:t})]})};const Pve=It(LZ,SZ(/ /g,"-")),H1=e=>typeof e=="string"?Io(e):e,kve=(e,t)=>({mode:n,saving:r,onSave:i,initialState:o,selectedServer:s})=>{const[a,l]=H.useState(o),c=()=>l(o),f=Mi("deviceLongUrls",s),h=n==="edit",p=n==="create-basic",m=P=>l({...a,tags:P.map(Pve)}),g=(P,k)=>yi(P)?P:yi(k)?null:void 0,v=sh(async()=>i({...a,validSince:Ys(a.validSince)??null,validUntil:Ys(a.validUntil)??null,maxVisits:yi(a.maxVisits)?Number(a.maxVisits):null}).then(()=>!h&&c()).catch(()=>{}));H.useEffect(()=>{l(o)},[o]);const w=(P,k,N="text",D={},z={})=>C(_r,{...z,children:C(zc,{id:P,type:N,placeholder:k,value:a[P]??"",onChange:D.onChange??(A=>l({...a,[P]:A.target.value})),...D})}),y=(P,k,N)=>{var D;return C(Eve,{icon:N,id:P,type:"url",placeholder:k,value:((D=a.deviceLongUrls)==null?void 0:D[P])??"",onChange:z=>{var A;return l({...a,deviceLongUrls:{...a.deviceLongUrls??{},[P]:g(z.target.value,(A=o.deviceLongUrls)==null?void 0:A[P])}})}})},b=(P,k,N={})=>C(Cve,{selected:a[P]?H1(a[P]):null,placeholderText:k,isClearable:!0,onChange:D=>l({...a,[P]:D}),...N}),x=U(We,{children:[C(_r,{children:C(zc,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:a.longUrl,onChange:P=>l({...a,longUrl:P.target.value})})}),U(er,{children:[p&&w("customSlug","Custom slug","text",{bsSize:"lg"},{className:"col-lg-6"}),C("div",{className:p?"col-lg-6 mb-3":"col-12",children:C(e,{selectedTags:a.tags??[],onChange:m})})]})]}),T=Mi("forwardQuery",s);return U("form",{name:"shortUrlForm",className:"short-url-form",onSubmit:v,children:[p&&x,!p&&U(We,{children:[U(er,{children:[C("div",{className:ge("mb-3",{"col-sm-6":f,"col-12":!f}),children:C(dn,{title:"Main options",className:"mb-3",children:x})}),f&&C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Device-specific long URLs",children:[C(_r,{children:y("android","Android-specific redirection",wge)}),C(_r,{children:y("ios","iOS-specific redirection",bge)}),y("desktop","Desktop-specific redirection",BQ)]})})]}),U(er,{children:[C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Customize the short URL",children:[w("title","Title","text",{onChange:({target:P})=>l({...a,title:g(P.value,o.title)})}),!h&&U(We,{children:[U(er,{children:[C("div",{className:"col-lg-6",children:w("customSlug","Custom slug","text",{disabled:yi(a.shortCodeLength)})}),C("div",{className:"col-lg-6",children:w("shortCodeLength","Short code length","number",{min:4,disabled:yi(a.customSlug)})})]}),C(t,{value:a.domain,onChange:P=>l({...a,domain:P})})]})]})}),C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Limit access to the short URL",children:[w("maxVisits","Maximum number of visits allowed","number",{min:1}),C("div",{className:"mb-3",children:b("validSince","Enabled since...",{maxDate:a.validUntil?H1(a.validUntil):void 0})}),b("validUntil","Enabled until...",{minDate:a.validSince?H1(a.validSince):void 0})]})})]}),U(er,{children:[C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Extra checks",children:[C(V1,{infoTooltip:"If checked, Shlink will try to reach the long URL, failing in case it's not publicly accessible.",checked:a.validateUrl,onChange:P=>l({...a,validateUrl:P}),children:"Validate URL"}),!h&&U("p",{children:[C(X8,{inline:!0,className:"me-2",checked:a.findIfExists,onChange:P=>l({...a,findIfExists:P}),children:"Use existing URL if found"}),C(Ove,{})]})]})}),C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Configure behavior",children:[C(V1,{infoTooltip:"This short URL will be included in the robots.txt for your Shlink instance, allowing web crawlers (like Google) to index it.",checked:a.crawlable,onChange:P=>l({...a,crawlable:P}),children:"Make it crawlable"}),T&&C(V1,{infoTooltip:"When this short URL is visited, any query params appended to it will be forwarded to the long URL.",checked:a.forwardQuery,onChange:P=>l({...a,forwardQuery:P}),children:"Forward query params on redirect"})]})})]})]}),C("div",{className:"text-center",children:C(mt,{outline:!0,color:"primary",disabled:r||qn(a.longUrl),className:"btn-xs-block",children:r?"Saving...":"Save"})})]})},Mve=({startDate:e=null,endDate:t=null,disabled:n=!1,onStartDateChange:r,onEndDateChange:i})=>U("div",{className:"row",children:[C("div",{className:"col-md-6",children:C(bx,{selected:e,placeholderText:"Since...",isClearable:!0,maxDate:t??void 0,disabled:n,onChange:r})}),C("div",{className:"col-md-6",children:C(bx,{className:"mt-2 mt-md-0",selected:t,placeholderText:"Until...",isClearable:!0,minDate:e??void 0,disabled:n,onChange:o=>i(o&&al(o))})})]}),dF=({onDatesChange:e,initialDateRange:t,defaultText:n,disabled:r,updatable:i=!1})=>{const o=ry(t),[s,a]=H.useState(o?t:void 0),[l,c]=H.useState(o?void 0:t),f=p=>{a(E8(p)?ch:void 0),c(p),e(p)},h=p=>{a(p),c(void 0),e(O8(p))};return i&&Ooe(()=>{const p=ry(t);p&&h(t),t&&!p&&f(t)},[t]),U(ia,{disabled:r,text:VE(s??l)??n,children:[C(z8,{allText:n,active:s,onChange:h}),C(Ve,{divider:!0}),C(Ve,{header:!0,children:"Custom:"}),C(Ve,{text:!0,children:C(Mve,{...l,onStartDateChange:p=>f({...l,startDate:p}),onEndDateChange:p=>f({...l,endDate:p})})})]})},Rve=({onChange:e,selected:t={},className:n,supportsDisabledFiltering:r})=>{const{excludeBots:i=!1,excludeMaxVisitsReached:o=!1,excludePastValidUntil:s=!1}=t,a=l=>()=>e({...t,[l]:!(t!=null&&t[l])});return U(ia,{text:"Filters",dropdownClassName:n,className:"me-3",right:!0,minWidth:250,children:[C(Ve,{header:!0,children:"Visits:"}),C(Ve,{active:i,onClick:a("excludeBots"),children:"Ignore visits from bots"}),r&&U(We,{children:[C(Ve,{divider:!0}),C(Ve,{header:!0,children:"Short URLs:"}),C(Ve,{active:o,onClick:a("excludeMaxVisitsReached"),children:"Exclude with visits reached"}),C(Ve,{active:s,onClick:a("excludePastValidUntil"),children:"Exclude enabled in the past"})]}),C(Ve,{divider:!0}),C(Ve,{disabled:!yi(t),onClick:()=>e({excludeBots:!1,excludeMaxVisitsReached:!1,excludePastValidUntil:!1}),children:C("i",{children:"Clear filters"})})]})};const Nve=(e,t)=>({selectedServer:n,className:r,shortUrlsAmount:i,order:o,handleOrderBy:s,settings:a})=>{var D;const[l,c]=P_(),{search:f,tags:h,startDate:p,endDate:m,excludeBots:g,excludeMaxVisitsReached:v,excludePastValidUntil:w,tagsMode:y="any"}=l,b=Mi("filterDisabledUrls",n),x=It(({startDate:z,endDate:A})=>({startDate:Ys(z)??void 0,endDate:Ys(A)??void 0}),c),T=It(z=>qn(z)?void 0:z,z=>c({search:z})),P=z=>c({tags:z}),k=Mi("allTagsFiltering",n),N=It(()=>y==="any"?"all":"any",z=>c({tagsMode:z}));return U("div",{className:ge("short-urls-filtering-bar-container",r),children:[C(ah,{initialValue:f,onChange:T}),U(th,{className:"mt-3",children:[C(t,{allowNew:!1,placeholder:"With tags...",selectedTags:h,onChange:P}),k&&h.length>1&&U(We,{children:[C(mt,{outline:!0,color:"secondary",onClick:N,id:"tagsModeBtn","aria-label":"Change tags mode",children:C(Fe,{className:"short-urls-filtering-bar__tags-icon",icon:y==="all"?JI:pQ})}),C(Or,{target:"tagsModeBtn",placement:"left",children:y==="all"?"With all the tags.":"With any of the tags."})]})]}),U(er,{className:"flex-lg-row-reverse",children:[C("div",{className:"col-lg-8 col-xl-6 mt-3",children:U("div",{className:"d-md-flex",children:[C("div",{className:"flex-fill",children:C(dF,{defaultText:"All short URLs",initialDateRange:T8(p,m),onDatesChange:x})}),C(Rve,{className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:{excludeBots:g??((D=a.visits)==null?void 0:D.excludeBots),excludeMaxVisitsReached:v,excludePastValidUntil:w},onChange:c,supportsDisabledFiltering:b})]})}),C("div",{className:"col-6 col-lg-4 col-xl-6 mt-3",children:C(e,{amount:i})}),C("div",{className:"col-6 d-lg-none mt-3",children:C(ph,{prefixed:!1,items:j8,order:o,onChange:s})})]})]})};function Af({currentOrder:e,field:t,className:n="ms-1"}){return!e.dir||e.field!==t?null:C(Fe,{icon:e.dir==="ASC"?sQ:yQ,className:n})}const jl=2,wx="...",hF=(e,t)=>{const n=aC(yI(jl,e-jl),MI(t-1,e+jl)+1);return e-jl>jl&&n.unshift(wx),e+jle===wx,pF=e=>Rd(e)?e:wn(e),mF=(e,t)=>Rd(e)?`${e}_${t}`:`${e}`,Lve=({paginator:e,serverId:t,currentQueryString:n=""})=>{const{currentPage:r=0,pagesCount:i=0}=e??{},o=a=>`/server/${t}/list-short-urls/${a}${n}`;if(i<=1)return C("div",{className:"pb-3"});const s=()=>hF(r,i).map((a,l)=>C(Rs,{disabled:Rd(a),active:r===a,children:C(Ns,{tag:At,to:o(a),children:pF(a)})},mF(a,l)));return U(x_,{className:"sticky-card-paginator py-3",listClassName:"flex-wrap justify-content-center mb-0",children:[C(Rs,{disabled:r===1,children:C(Ns,{previous:!0,tag:At,to:o(r-1)})}),s(),C(Rs,{disabled:r>=i,children:C(Ns,{next:!0,tag:At,to:o(r+1)})})]})},Dve=(e,t)=>oa(({listShortUrls:n,shortUrlsList:r,selectedServer:i,settings:o})=>{var K,te,oe;const s=Yd(i),{page:a}=Qs(),l=Mn(),[c,f]=P_(),{tags:h,search:p,startDate:m,endDate:g,orderBy:v,tagsMode:w,excludeBots:y,excludePastValidUntil:b,excludeMaxVisitsReached:x}=c,[T,P]=H.useState(v??((K=o.shortUrlsList)==null?void 0:K.defaultOrdering)??WE),{pagination:k}=(r==null?void 0:r.shortUrls)??{},N=y??((te=o.visits)==null?void 0:te.excludeBots),D=Mi("excludeBotsOnShortUrls",i),z=(se,Z)=>{f({orderBy:{field:se,dir:Z}}),P({field:se,dir:Z})},A=se=>()=>z(se,o_(se,T.field,T.dir)),Y=se=>C(Af,{currentOrder:T,field:se}),q=It(se=>[...new Set([...h,se])],se=>f({tags:se})),ee=({field:se,dir:Z})=>D&&N&&se==="visits"?{field:"nonBotVisits",dir:Z}:{field:se,dir:Z};return H.useEffect(()=>{n({page:a,searchTerm:p,tags:h,startDate:m,endDate:g,orderBy:ee(T),tagsMode:w,excludePastValidUntil:b,excludeMaxVisitsReached:x})},[a,p,h,m,g,T.field,T.dir,w,b,x]),U(We,{children:[C(t,{selectedServer:i,shortUrlsAmount:(oe=r.shortUrls)==null?void 0:oe.pagination.totalItems,order:T,handleOrderBy:z,settings:o,className:"mb-3"}),U(Er,{body:!0,className:"pb-0",children:[C(e,{selectedServer:i,shortUrlsList:r,orderByColumn:A,renderOrderIcon:Y,onTagClick:q}),C(Lve,{paginator:k,serverId:s,currentQueryString:l.search})]})]})},()=>[Jr.visits]);const Ave=e=>({orderByColumn:t,renderOrderIcon:n,shortUrlsList:r,onTagClick:i,selectedServer:o,className:s})=>{const{error:a,loading:l,shortUrls:c}=r,f=ge({"short-urls-table__header-cell--with-action":!!t}),h=ge("short-urls-table__header-cell",f),p=ge("table table-hover responsive-table short-urls-table",s),m=()=>a?C("tr",{children:C("td",{colSpan:6,className:"text-center table-danger text-dark",children:"Something went wrong while loading short URLs :("})}):l?C("tr",{children:C("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!l&&qn(c==null?void 0:c.data)?C("tr",{children:C("td",{colSpan:6,className:"text-center",children:"No results found"})}):c==null?void 0:c.data.map(g=>C(e,{shortUrl:g,selectedServer:o,onTagClick:i},g.shortUrl));return U("table",{className:p,children:[C("thead",{className:"responsive-table__header short-urls-table__header",children:U("tr",{children:[U("th",{className:h,onClick:t==null?void 0:t("dateCreated"),children:["Created at ",n==null?void 0:n("dateCreated")]}),U("th",{className:h,onClick:t==null?void 0:t("shortCode"),children:["Short URL ",n==null?void 0:n("shortCode")]}),U("th",{className:"short-urls-table__header-cell",children:[U("span",{className:f,onClick:t==null?void 0:t("title"),children:["Title ",n==null?void 0:n("title")]}),"  /  ",U("span",{className:f,onClick:t==null?void 0:t("longUrl"),children:[C("span",{className:"indivisible",children:"Long URL"})," ",n==null?void 0:n("longUrl")]})]}),C("th",{className:"short-urls-table__header-cell",children:"Tags"}),C("th",{className:h,onClick:t==null?void 0:t("visits"),children:U("span",{className:"indivisible",children:["Visits ",n==null?void 0:n("visits")]})}),C("th",{className:"short-urls-table__header-cell",colSpan:2})]})}),C("tbody",{children:m()})]})},Ive=(e,t)=>{e.serviceFactory("ShortUrlsList",Dve,"ShortUrlsTable","ShortUrlsFilteringBar"),e.decorator("ShortUrlsList",t(["selectedServer","mercureInfo","shortUrlsList","settings"],["listShortUrls","createNewVisits","loadMercureInfo"])),e.serviceFactory("ShortUrlsTable",Ave,"ShortUrlsRow"),e.serviceFactory("ShortUrlsRow",dge,"ShortUrlsRowMenu","ColorGenerator","useTimeoutToggle"),e.decorator("ShortUrlsRow",t(["settings"])),e.serviceFactory("ShortUrlsRowMenu",hge,"DeleteShortUrlModal","QrCodeModal"),e.serviceFactory("CreateShortUrlResult",tge,"useTimeoutToggle"),e.serviceFactory("ShortUrlForm",kve,"TagsSelector","DomainSelector"),e.serviceFactory("CreateShortUrl",Ime,"ShortUrlForm","CreateShortUrlResult"),e.decorator("CreateShortUrl",t(["shortUrlCreation","selectedServer","settings"],["createShortUrl","resetCreateShortUrl"])),e.serviceFactory("EditShortUrl",Fme,"ShortUrlForm"),e.decorator("EditShortUrl",t(["shortUrlDetail","shortUrlEdition","selectedServer","settings"],["getShortUrlDetail","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",()=>nge),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["deleteShortUrl","shortUrlDeleted","resetDeleteShortUrl"])),e.serviceFactory("QrCodeModal",age,"ImageDownloader"),e.decorator("QrCodeModal",t(["selectedServer"])),e.serviceFactory("ShortUrlsFilteringBar",Nve,"ExportShortUrlsBtn","TagsSelector"),e.serviceFactory("ExportShortUrlsBtn",rge,"buildShlinkApiClient","ReportExporter"),e.decorator("ExportShortUrlsBtn",t(["selectedServer"])),e.serviceFactory("shortUrlsListReducerCreator",Upe,"listShortUrls","editShortUrl","createShortUrl"),e.serviceFactory("shortUrlsListReducer",ct("reducer"),"shortUrlsListReducerCreator"),e.serviceFactory("shortUrlCreationReducerCreator",mge,"createShortUrl"),e.serviceFactory("shortUrlCreationReducer",ct("reducer"),"shortUrlCreationReducerCreator"),e.serviceFactory("shortUrlEditionReducerCreator",_ge,"editShortUrl"),e.serviceFactory("shortUrlEditionReducer",ct("reducer"),"shortUrlEditionReducerCreator"),e.serviceFactory("shortUrlDeletionReducerCreator",jpe,"deleteShortUrl"),e.serviceFactory("shortUrlDeletionReducer",ct("reducer"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDetailReducerCreator",gge,"buildShlinkApiClient"),e.serviceFactory("shortUrlDetailReducer",ct("reducer"),"shortUrlDetailReducerCreator"),e.serviceFactory("listShortUrls",zpe,"buildShlinkApiClient"),e.serviceFactory("createShortUrl",pge,"buildShlinkApiClient"),e.serviceFactory("resetCreateShortUrl",ct("resetCreateShortUrl"),"shortUrlCreationReducerCreator"),e.serviceFactory("deleteShortUrl",$pe,"buildShlinkApiClient"),e.serviceFactory("resetDeleteShortUrl",ct("resetDeleteShortUrl"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDeleted",()=>L8),e.serviceFactory("getShortUrlDetail",ct("getShortUrlDetail"),"shortUrlDetailReducerCreator"),e.serviceFactory("editShortUrl",yge,"buildShlinkApiClient")},Fve=({tag:e,toggle:t,isOpen:n,deleteTag:r,tagDelete:i,tagDeleted:o})=>{const{deleting:s,error:a,deleted:l,errorData:c}=i;return U(Ho,{toggle:t,isOpen:n,centered:!0,onClosed:()=>l&&o(e),children:[C(oo,{toggle:t,className:"text-danger",children:"Delete tag"}),U(Ri,{children:["Are you sure you want to delete tag ",C("b",{children:e}),"?",a&&C(Dr,{type:"error",small:!0,className:"mt-2",children:C(Ao,{errorData:c,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),U(na,{children:[C(mt,{color:"link",onClick:t,children:"Cancel"}),C(mt,{color:"danger",disabled:s,onClick:async()=>{await r(e),t()},children:s?"Deleting tag...":"Delete tag"})]})]})};function L_(){return(L_=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function xx(e){var t=H.useRef(e),n=H.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Nd=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:w.buttons>0)&&i.current?o(oL(i.current,w,a.current)):v(!1)},g=function(){return v(!1)};function v(w){var y=l.current,b=Sx(i.current),x=w?b.addEventListener:b.removeEventListener;x(y?"touchmove":"mousemove",m),x(y?"touchend":"mouseup",g)}return[function(w){var y=w.nativeEvent,b=i.current;if(b&&(sL(y),!function(T,P){return P&&!If(T)}(y,l.current)&&b)){if(If(y)){l.current=!0;var x=y.changedTouches||[];x.length&&(a.current=x[0].identifier)}b.focus(),o(oL(b,y,a.current)),v(!0)}},function(w){var y=w.which||w.keyCode;y<37||y>40||(w.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},v]},[s,o]),f=c[0],h=c[1],p=c[2];return H.useEffect(function(){return p},[p]),V.createElement("div",L_({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),KE=function(e){return e.filter(Boolean).join(" ")},yF=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=KE(["react-colorful__pointer",e.className]);return V.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},V.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Hn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},$ve=function(e){return Vve(Cx(e))},Cx=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Hn(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Hn(parseInt(e.substring(6,8),16)/255,2):1}},jve=function(e){return Uve(zve(e))},Bve=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Hn(e.h),s:Hn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Hn(i/2),a:Hn(r,2)}},Ex=function(e){var t=Bve(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},zve=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),a=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:Hn(255*[r,a,s,s,l,r][c]),g:Hn(255*[l,r,r,a,s,s][c]),b:Hn(255*[s,s,l,r,r,a][c]),a:Hn(i,2)}},Fp=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Uve=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?Fp(Hn(255*i)):"";return"#"+Fp(t)+Fp(n)+Fp(r)+o},Vve=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),a=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:Hn(60*(a<0?a+6:a)),s:Hn(o?s/o*100:0),v:Hn(o/255*100),a:i}},Hve=V.memo(function(e){var t=e.hue,n=e.onChange,r=KE(["react-colorful__hue",e.className]);return V.createElement("div",{className:r},V.createElement(vF,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Nd(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Hn(t),"aria-valuemax":"360","aria-valuemin":"0"},V.createElement(yF,{className:"react-colorful__hue-pointer",left:t/360,color:Ex({h:t,s:100,v:100,a:1})})))}),Wve=V.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ex({h:t.h,s:100,v:100,a:1})};return V.createElement("div",{className:"react-colorful__saturation",style:r},V.createElement(vF,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Nd(t.s+100*i.left,0,100),v:Nd(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Hn(t.s)+"%, Brightness "+Hn(t.v)+"%"},V.createElement(yF,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ex(t)})))}),_F=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Yve=function(e,t){return e.toLowerCase()===t.toLowerCase()||_F(Cx(e),Cx(t))};function qve(e,t,n){var r=xx(n),i=H.useState(function(){return e.toHsva(t)}),o=i[0],s=i[1],a=H.useRef({color:t,hsva:o});H.useEffect(function(){if(!e.equal(t,a.current.color)){var c=e.toHsva(t);a.current={hsva:c,color:t},s(c)}},[t,e]),H.useEffect(function(){var c;_F(o,a.current.hsva)||e.equal(c=e.fromHsva(o),a.current.color)||(a.current={hsva:o,color:c},r(c))},[o,e,r]);var l=H.useCallback(function(c){s(function(f){return Object.assign({},f,c)})},[]);return[o,l]}var Gve=typeof window<"u"?H.useLayoutEffect:H.useEffect,Zve=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},aL=new Map,Kve=function(e){Gve(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!aL.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,aL.set(t,n);var r=Zve();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Xve=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,s=gF(e,["className","colorModel","color","onChange"]),a=H.useRef(null);Kve(a);var l=qve(n,i,o),c=l[0],f=l[1],h=KE(["react-colorful",t]);return V.createElement("div",L_({},s,{ref:a,className:h}),V.createElement(Wve,{hsva:c,onChange:f}),V.createElement(Hve,{hue:c.h,onChange:f,className:"react-colorful__last-control"}))},Qve={defaultColor:"000",toHsva:$ve,fromHsva:function(e){return jve({h:e.h,s:e.s,v:e.v,a:1})},equal:Yve},Jve=function(e){return V.createElement(Xve,L_({},e,{colorModel:Qve}))};const eye=({getColorForKey:e})=>({tag:t,editTag:n,toggle:r,tagEdited:i,isOpen:o,tagEdit:s})=>{const[a,l]=H.useState(t),[c,f]=H.useState(e(t)),[h,p,,m]=jt(),{editing:g,error:v,edited:w,errorData:y}=s,b=sh(async()=>{await n({oldName:t,newName:a,color:c}),r()}),x=It(m,()=>w&&i({oldName:t,newName:a,color:c}));return C(Ho,{isOpen:o,toggle:r,centered:!0,onClosed:x,children:U("form",{name:"editTag",onSubmit:b,children:[C(oo,{toggle:r,children:"Edit tag"}),U(Ri,{children:[U(th,{children:[C("div",{id:"colorPickerBtn",className:"input-group-text edit-tag-modal__color-picker-toggle",style:{backgroundColor:c,borderColor:c},onClick:p,children:C(Fe,{icon:aQ,className:"edit-tag-modal__color-icon"})}),C(Jd,{isOpen:h,toggle:p,target:"colorPickerBtn",placement:"right",hideArrow:!0,popperClassName:"edit-tag-modal__popover",children:C(Jve,{color:c,onChange:f})}),C(zc,{value:a,placeholder:"Tag",required:!0,onChange:({target:T})=>l(T.value)})]}),v&&C(Dr,{type:"error",small:!0,className:"mt-2",children:C(Ao,{errorData:y,fallbackMessage:"Something went wrong while editing the tag :("})})]}),U(na,{children:[C(mt,{type:"button",color:"link",onClick:r,children:"Cancel"}),C(mt,{color:"primary",disabled:g,children:g?"Saving...":"Save"})]})]})})};function tye(e){return V.createElement("button",{type:"button",className:e.classNames.selectedTag,title:e.removeButtonText,onClick:e.onDelete},V.createElement("span",{className:e.classNames.selectedTagName},e.tag.name))}const nye={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},rye=["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform"];class iye extends V.Component{constructor(t){super(t),this.state={inputWidth:null},this.input=V.createRef(),this.sizer=V.createRef()}componentDidMount(){this.props.autoresize&&(this.copyInputStyles(),this.updateInputWidth())}componentDidUpdate({query:t,placeholderText:n}){(t!==this.props.query||n!==this.props.placeholderText)&&this.updateInputWidth()}copyInputStyles(){const t=window.getComputedStyle(this.input.current);rye.forEach(n=>{this.sizer.current.style[n]=t[n]})}updateInputWidth(){let t;this.props.autoresize&&(t=Math.ceil(this.sizer.current.scrollWidth)+2),t!==this.state.inputWidth&&this.setState({inputWidth:t})}render(){const{id:t,query:n,ariaLabelText:r,placeholderText:i,expanded:o,classNames:s,inputAttributes:a,inputEventHandlers:l,index:c}=this.props;return V.createElement("div",{className:s.searchWrapper},V.createElement("input",Object.assign({},a,l,{ref:this.input,value:n,placeholder:i,className:s.searchInput,role:"combobox","aria-autocomplete":"list","aria-label":r||i,"aria-owns":t,"aria-activedescendant":c>-1?`${t}-${c}`:null,"aria-expanded":o,style:{width:this.state.inputWidth}})),V.createElement("div",{ref:this.sizer,style:nye},n||i))}}function XE(e){return e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function oye(e){return new RegExp(XE(e),"gi")}function sye(e){return new RegExp(`(?:^|\\s)${XE(e)}`,"i")}function aye(e){return new RegExp(`^${XE(e)}$`,"i")}function lye(e,t){const n=oye(t);return e.replace(n,"$&")}function cye({item:e,query:t}){return V.createElement("span",{dangerouslySetInnerHTML:{__html:lye(e.name,t)}})}function uye(e){const t=e.suggestionComponent||cye,n=e.options.map((r,i)=>{const o=`${e.id}-${i}`,s=[];return e.index===i&&s.push(e.classNames.suggestionActive),r.disabled&&s.push(e.classNames.suggestionDisabled),V.createElement("li",{id:o,key:o,role:"option",className:s.join(" "),"aria-disabled":!!r.disabled,onMouseDown:a=>a.preventDefault(),onClick:()=>e.addTag(r)},r.prefix?V.createElement("span",{className:e.classNames.suggestionPrefix},r.prefix," "):null,r.disableMarkIt?r.name:V.createElement(t,{item:r,query:e.query}))});return V.createElement("div",{className:e.classNames.suggestions},V.createElement("ul",{role:"listbox",id:e.id},n))}function fye(e,t){const n=e.querySelectorAll("a,button,input"),r=Array.prototype.findIndex.call(n,o=>o===t),i=n[r-1]||n[r+1];i&&i.focus()}const Ra={ENTER:"Enter",TAB:"Tab",BACKSPACE:"Backspace",UP_ARROW:"ArrowUp",UP_ARROW_COMPAT:"Up",DOWN_ARROW:"ArrowDown",DOWN_ARROW_COMPAT:"Down"},bF={root:"react-tags",rootFocused:"is-focused",selected:"react-tags__selected",selectedTag:"react-tags__selected-tag",selectedTagName:"react-tags__selected-tag-name",search:"react-tags__search",searchWrapper:"react-tags__search-wrapper",searchInput:"react-tags__search-input",suggestions:"react-tags__suggestions",suggestionActive:"is-active",suggestionDisabled:"is-disabled",suggestionPrefix:"react-tags__suggestion-prefix"};function wF(e,t){return e.findIndex(n=>aye(t).test(n.name))}function W1(){if(this.state.query.length>=this.props.minQueryLength){const e=wF(this.state.options,this.state.query),t=this.state.index===-1?e:this.state.index,n=t>-1?this.state.options[t]:null;n?this.addTag(n):this.props.allowNew&&this.addTag({name:this.state.query})}}function dye(e){e.preventDefault();const t=this.state.options.length-1;this.setState({index:this.state.index<=0?t:this.state.index-1})}function hye(e){e.preventDefault();const t=this.state.options.length-1;this.setState({index:this.state.index>=t?0:this.state.index+1})}function pye(){this.state.query.length||this.deleteTag(this.props.tags.length-1)}function mye(e,t){return sye(t).test(e.name)}function gye(e,t){let n;return e.suggestionsTransform?n=e.suggestionsTransform(t.query,e.suggestions):n=e.suggestions.filter(r=>e.suggestionsFilter(r,t.query)),n=n.slice(0,e.maxSuggestionsLength),e.allowNew&&e.newTagText&&wF(n,t.query)===-1?n.push({id:0,name:t.query,prefix:e.newTagText,disableMarkIt:!0}):e.noSuggestionsText&&n.length===0&&n.push({id:0,name:e.noSuggestionsText,disabled:!0,disableMarkIt:!0}),n}class QE extends V.Component{constructor(t){super(t),this.state={query:"",focused:!1,index:-1},this.inputEventHandlers={onChange:()=>{},onBlur:this.onBlur.bind(this),onFocus:this.onFocus.bind(this),onInput:this.onInput.bind(this),onKeyDown:this.onKeyDown.bind(this)},this.container=V.createRef(),this.input=V.createRef()}onInput(t){const n=t.target.value;this.props.onInput&&this.props.onInput(n),n.length===this.state.query.length+1&&this.props.delimiters.indexOf(n.slice(-1))>-1?W1.call(this):n!==this.state.query&&this.setState({query:n})}onKeyDown(t){this.props.delimiters.indexOf(t.key)>-1&&((this.state.query||this.state.index>-1)&&t.preventDefault(),W1.call(this)),t.key===Ra.BACKSPACE&&this.props.allowBackspace&&pye.call(this,t),(t.key===Ra.UP_ARROW||t.key===Ra.UP_ARROW_COMPAT)&&dye.call(this,t),(t.key===Ra.DOWN_ARROW||t.key===Ra.DOWN_ARROW_COMPAT)&&hye.call(this,t)}onClick(t){document.activeElement!==t.target&&this.focusInput()}onBlur(){this.setState({focused:!1,index:-1}),this.props.onBlur&&this.props.onBlur(),this.props.addOnBlur&&W1.call(this)}onFocus(){this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus()}onDeleteTag(t,n){this.container.current&&fye(this.container.current,n.currentTarget),this.deleteTag(t)}addTag(t){t.disabled||typeof this.props.onValidate=="function"&&!this.props.onValidate(t)||(this.props.onAddition({id:t.id,name:t.name}),this.clearInput())}deleteTag(t){this.props.onDelete(t)}clearInput(){this.setState({query:"",index:-1})}clearSelectedIndex(){this.setState({index:-1})}focusInput(){this.input.current&&this.input.current.input.current&&this.input.current.input.current.focus()}render(){const t=this.props.tagComponent||tye,n=this.state.focused&&this.state.query.length>=this.props.minQueryLength,r=Object.assign({},bF,this.props.classNames),i=[r.root];return this.state.focused&&i.push(r.rootFocused),V.createElement("div",{ref:this.container,className:i.join(" "),onClick:this.onClick.bind(this)},V.createElement("div",{className:r.selected,"aria-relevant":"additions removals","aria-live":"polite"},this.props.tags.map((o,s)=>V.createElement(t,{key:s,tag:o,removeButtonText:this.props.removeButtonText,classNames:r,onDelete:this.onDeleteTag.bind(this,s)}))),V.createElement("div",{className:r.search},V.createElement(iye,Object.assign({},this.state,{id:this.props.id,ref:this.input,classNames:r,inputAttributes:this.props.inputAttributes,inputEventHandlers:this.inputEventHandlers,autoresize:this.props.autoresize,expanded:n,placeholderText:this.props.placeholderText,ariaLabelText:this.props.ariaLabelText})),n&&this.state.options.length?V.createElement(uye,Object.assign({},this.state,{id:this.props.id,classNames:r,expanded:n,addTag:this.addTag.bind(this),suggestionComponent:this.props.suggestionComponent})):null))}static getDerivedStateFromProps(t,n){return n.prevQuery!==n.query||n.prevSuggestions!==t.suggestions?{prevQuery:n.query,prevSuggestions:t.suggestions,options:gye(t,n)}:null}}QE.defaultProps={id:"ReactTags",tags:[],placeholderText:"Add new tag",removeButtonText:"Click to remove tag",noSuggestionsText:null,newTagText:null,suggestions:[],suggestionsFilter:mye,suggestionsTransform:null,autoresize:!0,classNames:bF,delimiters:[Ra.TAB,Ra.ENTER],minQueryLength:2,maxSuggestionsLength:6,allowNew:!1,allowBackspace:!0,addOnBlur:!1,tagComponent:null,suggestionComponent:null,inputAttributes:{}};QE.propTypes={id:S.string,tags:S.arrayOf(S.object),placeholderText:S.string,ariaLabelText:S.string,removeButtonText:S.string,noSuggestionsText:S.string,newTagText:S.string,suggestions:S.arrayOf(S.object),suggestionsFilter:S.func,suggestionsTransform:S.func,autoresize:S.bool,delimiters:S.arrayOf(S.string),onDelete:S.func.isRequired,onAddition:S.func.isRequired,onInput:S.func,onFocus:S.func,onBlur:S.func,onValidate:S.func,minQueryLength:S.number,maxSuggestionsLength:S.number,classNames:S.object,allowNew:S.bool,allowBackspace:S.bool,addOnBlur:S.bool,tagComponent:S.oneOfType([S.func,S.element]),suggestionComponent:S.oneOfType([S.func,S.element]),inputAttributes:S.object};const xF=({tag:e,colorGenerator:t})=>C("div",{style:{backgroundColor:t.getColorForKey(e)},className:"tag-bullet"}),lL=e=>({id:e,name:e}),vye=e=>({selectedTags:t,onChange:n,placeholder:r,listTags:i,tagsList:o,settings:s,allowNew:a=!0})=>{var h;H.useEffect(()=>{i()},[]);const l=((h=s.shortUrlCreation)==null?void 0:h.tagFilteringMode)??"startsWith",c=({tag:p,onDelete:m})=>C(qE,{colorGenerator:e,text:p.name,clearable:!0,className:"react-tags__tag",onClose:m}),f=({item:p})=>U(We,{children:[C(xF,{tag:`${p.name}`,colorGenerator:e}),p.name]});return C(QE,{tags:t.map(lL),tagComponent:c,suggestions:o.tags.filter(p=>!t.includes(p)).map(lL),suggestionComponent:f,allowNew:a,addOnBlur:!0,placeholderText:r??"Add tags to the URL",minQueryLength:1,delimiters:["Enter","Tab",","],suggestionsTransform:l==="includes"?(p,m)=>m.filter(({name:g})=>g.includes(p)):void 0,onDelete:p=>{const m=[...t];m.splice(p,1),n(m)},onAddition:({name:p})=>n([...new Set([...t,...p.toLowerCase().split(",")])])})},Tx="shlink/tagDelete",yye={deleting:!1,deleted:!1,error:!1},SF=bn(`${Tx}/tagDeleted`),_ye=e=>{const t=or(`${Tx}/deleteTag`,async(r,{getState:i})=>{const{deleteTags:o}=e(i);await o([r])}),{reducer:n}=Gn({name:Tx,initialState:yye,reducers:{},extraReducers:r=>{r.addCase(t.pending,()=>({deleting:!0,deleted:!1,error:!1})),r.addCase(t.rejected,(i,{error:o})=>({deleting:!1,deleted:!1,error:!0,errorData:io(o)})),r.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:n,deleteTag:t}},JE="shlink/tagEdit",bye={editing:!1,edited:!1,error:!1},CF=bn(`${JE}/tagEdited`),wye=(e,t)=>or(`${JE}/editTag`,async({oldName:n,newName:r,color:i},{getState:o})=>(await e(o).editTag(n,r),t.setColorForKey(r,i),{oldName:n,newName:r,color:i})),xye=e=>Gn({name:JE,initialState:bye,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({editing:!0,edited:!1,error:!1})),t.addCase(e.rejected,(n,{error:r})=>({editing:!1,edited:!1,error:!0,errorData:io(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({...RI(["oldName","newName"],r),editing:!1,edited:!0,error:!1}))}}),eT="shlink/tagsList",Y1={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},cL=(e,t)=>n=>n===e?t:n,uL=(e,t)=>Wd(n=>n===t,e),Sye=(e,t)=>e.reduce((n,[r,i])=>{if(!n[r])return n;const o=n[r];return{...n,[r]:{...o,visitsCount:o.visitsCount+i}}},{...t}),Cye=e=>Object.entries(e.reduce((t,{shortUrl:n})=>(n==null||n.tags.forEach(r=>{t[r]=(t[r]||0)+1}),t),{})),Eye=(e,t=!0)=>or(`${eT}/listTags`,async(n,{getState:r})=>{const{tagsList:i,selectedServer:o}=r();if(!t&&!qn(i.tags))return i;const{listTags:s}=e(r),{tags:a,stats:l=[]}=await s(TE.tagsStats(o)),c=l.reduce((f,{tag:h,shortUrlsCount:p,visitsCount:m})=>(f[h]={shortUrlsCount:p,visitsCount:m},f),{});return{tags:a,stats:c}}),EF=bn(`${eT}/filterTags`),Tye=(e,t)=>Gn({name:eT,initialState:Y1,reducers:{},extraReducers:n=>{n.addCase(EF,(r,{payload:i})=>({...r,filteredTags:r.tags.filter(o=>o.toLowerCase().match(i.toLowerCase()))})),n.addCase(e.pending,r=>({...r,loading:!0,error:!1})),n.addCase(e.rejected,(r,{error:i})=>({...Y1,error:!0,errorData:io(i)})),n.addCase(e.fulfilled,(r,{payload:i})=>({...Y1,stats:i.stats,tags:i.tags,filteredTags:i.tags})),n.addCase(SF,({tags:r,filteredTags:i,...o},{payload:s})=>({...o,tags:uL(r,s),filteredTags:uL(i,s)})),n.addCase(CF,({tags:r,filteredTags:i,stats:o,...s},{payload:a})=>({...s,stats:{...o,[a.newName]:o[a.oldName]},tags:r.map(cL(a.oldName,a.newName)).sort(),filteredTags:i.map(cL(a.oldName,a.newName)).sort()})),n.addCase(uh,(r,{payload:i})=>({...r,stats:Sye(Cye(i.createdVisits),r.stats)})),n.addCase(t.fulfilled,({tags:r,...i},{payload:o})=>({...i,tags:r.concat(o.tags.filter(s=>!r.includes(s)))}))}}),Oye=e=>oa(({filterTags:t,forceListTags:n,tagsList:r,selectedServer:i,settings:o})=>{var h;const[s,a]=H.useState(((h=o.tags)==null?void 0:h.defaultOrdering)??{}),l=It(()=>r.filteredTags.map(p=>{var m,g;return{tag:p,shortUrls:((m=r.stats[p])==null?void 0:m.shortUrlsCount)??0,visits:((g=r.stats[p])==null?void 0:g.visitsCount)??0}}),p=>LI(p,s));if(H.useEffect(()=>{n()},[]),r.loading)return C(Eo,{loading:!0});if(r.error)return C(Dr,{type:"error",children:C(Ao,{errorData:r.errorData,fallbackMessage:"Error loading tags :("})});const c=p=>()=>{const m=o_(p,s.field,s.dir);a({field:m?p:void 0,dir:m})};return U(We,{children:[C(ah,{className:"mb-3",onChange:t}),C(er,{className:"mb-3",children:C("div",{className:"col-lg-6 offset-lg-6",children:C(ph,{items:B8,order:s,onChange:(p,m)=>a({field:p,dir:m})})})}),(()=>{if(r.filteredTags.length<1)return C(Eo,{children:"No tags found"});const p=l();return C(e,{sortedTags:p,selectedServer:i,currentOrder:s,orderByColumn:c})})()]})},()=>[Jr.visits]);const tT=({pagesCount:e,currentPage:t,setCurrentPage:n,centered:r=!0})=>{if(e<2)return null;const i=o=>()=>!Rd(o)&&n(o);return U(x_,{listClassName:ge("flex-wrap mb-0 simple-paginator",{"justify-content-center":r}),children:[C(Rs,{disabled:t<=1,children:C(Ns,{previous:!0,tag:"span",onClick:i(t-1)})}),hF(t,e).map((o,s)=>C(Rs,{disabled:Rd(o),active:t===o,children:C(Ns,{role:"link",tag:"span",onClick:i(o),children:pF(o)})},mF(o,s))),C(Rs,{disabled:t>=e,children:C(Ns,{next:!0,tag:"span",onClick:i(t+1)})})]})};const Pye=20,kye=e=>({sortedTags:t,selectedServer:n,orderByColumn:r,currentOrder:i})=>{const o=H.useRef(!0),{search:s}=Mn(),{page:a=1}=pl(s),[l,c]=Toe("page",Number(a)),f=dd(Pye,t),h=f.length>1,p=f[l-1]??[];return H.useEffect(()=>{!o.current&&c(1),o.current=!1},[t]),H.useEffect(()=>{scrollTo(0,0)},[l]),U(dn,{bodyClassName:h?"pb-1":"",children:[U("table",{className:"table table-hover responsive-table mb-0",children:[U("thead",{className:"responsive-table__header",children:[U("tr",{children:[U("th",{className:"tags-table__header-cell",onClick:r("tag"),children:["Tag ",C(Af,{currentOrder:i,field:"tag"})]}),U("th",{className:"tags-table__header-cell text-lg-end",onClick:r("shortUrls"),children:["Short URLs ",C(Af,{currentOrder:i,field:"shortUrls"})]}),U("th",{className:"tags-table__header-cell text-lg-end",onClick:r("visits"),children:["Visits ",C(Af,{currentOrder:i,field:"visits"})]}),C("th",{"aria-label":"Options",className:"tags-table__header-cell"})]}),C("tr",{children:C("th",{"aria-label":"Separator",colSpan:4,className:"p-0 border-top-0"})})]}),U("tbody",{children:[p.length===0&&C("tr",{children:C("td",{colSpan:4,className:"text-center",children:"No results found"})}),p.map(m=>C(e,{tag:m,selectedServer:n},m.tag))]})]}),h&&C("div",{className:"sticky-card-paginator",children:C(tT,{pagesCount:f.length,currentPage:l,setCurrentPage:c})})]},l)},Mye=(e,t,n)=>({tag:r,selectedServer:i})=>{const[o,s]=jt(),[a,l]=jt(),[c,f]=jt(),h=Yd(i);return U("tr",{className:"responsive-table__row",children:[U("th",{className:"responsive-table__cell","data-th":"Tag",children:[C(xF,{tag:r.tag,colorGenerator:n})," ",r.tag]}),C("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:C(At,{to:`/server/${h}/list-short-urls/1?tags=${encodeURIComponent(r.tag)}`,children:wn(r.shortUrls)})}),C("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:C(At,{to:`/server/${h}/tag/${r.tag}/visits`,children:wn(r.visits)})}),C("td",{className:"responsive-table__cell text-lg-end",children:U(E_,{toggle:f,isOpen:c,children:[U(Ve,{onClick:l,children:[C(Fe,{icon:ZX,fixedWidth:!0,className:"me-1"})," Edit"]}),U(Ve,{onClick:s,children:[C(Fe,{icon:fQ,fixedWidth:!0,className:"me-1"})," Delete"]})]})}),C(t,{tag:r.tag,toggle:l,isOpen:a}),C(e,{tag:r.tag,toggle:s,isOpen:o})]})},Rye=(e,t)=>{e.serviceFactory("TagsSelector",vye,"ColorGenerator"),e.decorator("TagsSelector",t(["tagsList","settings"],["listTags"])),e.serviceFactory("DeleteTagConfirmModal",()=>Fve),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.serviceFactory("EditTagModal",eye,"ColorGenerator"),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.serviceFactory("TagsTableRow",Mye,"DeleteTagConfirmModal","EditTagModal","ColorGenerator"),e.serviceFactory("TagsTable",kye,"TagsTableRow"),e.serviceFactory("TagsList",Oye,"TagsTable"),e.decorator("TagsList",t(["tagsList","selectedServer","mercureInfo","settings"],["forceListTags","filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",xye,"editTag"),e.serviceFactory("tagEditReducer",ct("reducer"),"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",_ye,"buildShlinkApiClient"),e.serviceFactory("tagDeleteReducer",ct("reducer"),"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",Tye,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",ct("reducer"),"tagsListReducerCreator");const n=r=>({buildShlinkApiClient:i})=>Eye(i,r);e.factory("listTags",n(!1)),e.factory("forceListTags",n(!0)),e.serviceFactory("filterTags",()=>EF),e.serviceFactory("deleteTag",ct("deleteTag"),"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>SF),e.serviceFactory("editTag",wye,"buildShlinkApiClient","ColorGenerator"),e.serviceFactory("tagEdited",()=>CF)};var Nye="Expected a function",TF="__lodash_hash_undefined__",OF=1/0,Lye="[object Function]",Dye="[object GeneratorFunction]",Aye="[object Symbol]",Iye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fye=/^\w*$/,$ye=/^\./,jye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bye=/[\\^$.*+?()[\]{}|]/g,zye=/\\(\\)?/g,Uye=/^\[object .+?Constructor\]$/,Vye=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Hye=typeof self=="object"&&self&&self.Object===Object&&self,nT=Vye||Hye||Function("return this")();function Wye(e,t){return e==null?void 0:e[t]}function Yye(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var qye=Array.prototype,Gye=Function.prototype,PF=Object.prototype,q1=nT["__core-js_shared__"],fL=function(){var e=/[^.]+$/.exec(q1&&q1.keys&&q1.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),kF=Gye.toString,rT=PF.hasOwnProperty,MF=PF.toString,Zye=RegExp("^"+kF.call(rT).replace(Bye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dL=nT.Symbol,Kye=qye.splice,Xye=RF(nT,"Map"),Ld=RF(Object,"create"),hL=dL?dL.prototype:void 0,pL=hL?hL.toString:void 0;function cl(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function a_e(e,t){var n=this.__data__,r=D_(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}lu.prototype.clear=r_e;lu.prototype.delete=i_e;lu.prototype.get=o_e;lu.prototype.has=s_e;lu.prototype.set=a_e;function yl(e){var t=-1,n=e?e.length:0;for(this.clear();++tt.toFixed(e.decimals).replace(".",e.separator):t=>`${t}`.replace(".",e.separator):e.decimals?t=>t.toFixed(e.decimals):t=>`${t}`}function sT(e={}){const t=typeof e.quote=="string"?e.quote:'"',n=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;return!t||t===n?r=>r:r=>(r.includes(t)&&(r=r.replace(new RegExp(t,"g"),n)),`${t}${r}${t}`)}function k_e(e={stringFormatter:sT()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function M_e(e={stringFormatter:sT()}){return t=>t===null||(t=JSON.stringify(t),t===void 0)?"":(t[0]==='"'&&(t=t.replace(/^"(.+)"$/,"$1")),e.stringFormatter(t))}function gL(e,t,n){const r=e[t];return r===void 0?n:r}function DF(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function Ox(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}class R_e{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const n=Object.assign({},t);n.fields&&(n.fields=this.preprocessFieldsInfo(n.fields,n.defaultValue)),n.transforms=n.transforms||[];const r=n.formatters&&n.formatters.string||sT(),i=M_e({stringFormatter:r}),o={header:r,undefined:G1,boolean:G1,number:P_e(),bigint:G1,string:r,symbol:k_e({stringFormatter:r}),function:i,object:i};return n.formatters={...o,...n.formatters},n.delimiter=n.delimiter||",",n.eol=n.eol||` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function B1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(o=N1(e,t.slice(0,e.length),new Date)),is(o)||(o=new Date(e))),is(o)&&a?o:null)}function is(e,t){return t=t||new Date("1/1/1000"),i8(e)&&!Kr(e,t)}function ln(e,t,n){if(n==="en")return _o(e,t,{awareOfUnicodeTokens:!0});var r=Ds(n);return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),!r&&Wa()&&Ds(Wa())&&(r=Ds(Wa())),_o(e,t,{locale:r||null,awareOfUnicodeTokens:!0})}function z1(e,t){var n=t.dateFormat,r=t.locale;return e&&ln(e,Array.isArray(n)?n[0]:n,r)||""}function ZN(e,t){var n=t.hour,r=n===void 0?0:n,i=t.minute,o=i===void 0?0:i,s=t.second;return Mf(Rf(Khe(e,s===void 0?0:s),o),r)}function Hge(e,t){var n=t&&Ds(t)||Wa()&&Ds(Wa());return ace(e,n?{locale:n}:null)}function Wge(e,t){return ln(e,"ddd",t)}function Yge(e){return Ar(e)}function GE(e,t,n){var r=Ds(t||Wa());return r8(e,{locale:r,weekStartsOn:n})}function Ha(e){return Yae(e)}function rf(e){return qae(e)}function qge(e){return e2(e)}function oF(e,t){return e&&t?Dhe(e,t):!e&&!t}function ys(e,t){return e&&t?Nhe(e,t):!e&&!t}function ay(e,t){return e&&t?Lhe(e,t):!e&&!t}function gr(e,t){return e&&t?jae(e,t):!e&&!t}function _s(e,t){return e&&t?h8(e,t):!e&&!t}function sg(e,t,n){var r,i=Ar(t),o=al(n);try{r=Wc(e,{start:i,end:o})}catch{r=!1}return r}function Wa(){return(typeof window<"u"?window:globalThis).__localeId__}function Ds(e){if(typeof e=="string"){var t=typeof window<"u"?window:globalThis;return t.__localeData__?t.__localeData__[e]:null}return e}function sF(e,t){return ln(qi(mn(),e),"LLLL",t)}function aF(e,t){return ln(qi(mn(),e),"LLL",t)}function Gge(e,t){return ln(nf(mn(),e),"QQQ",t)}function R_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.excludeDateIntervals,s=t.includeDates,a=t.includeDateIntervals,l=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(c){return gr(e,c)})||o&&o.some(function(c){var f=c.start,h=c.end;return Wc(e,{start:f,end:h})})||s&&!s.some(function(c){return gr(e,c)})||a&&!a.some(function(c){var f=c.start,h=c.end;return Wc(e,{start:f,end:h})})||l&&!l(mn(e))||!1}function ZE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.excludeDates,r=t.excludeDateIntervals;return r&&r.length>0?r.some(function(i){var o=i.start,s=i.end;return Wc(e,{start:o,end:s})}):n&&n.some(function(i){return gr(e,i)})||!1}function Zge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,s=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(a){return ys(e,a)})||o&&!o.some(function(a){return ys(e,a)})||s&&!s(mn(e))||!1}function Kge(e,t,n,r){var i=pt(e),o=ur(e),s=pt(t),a=ur(t),l=pt(r);return i===s&&i===l?o<=n&&n<=a:i=n||li:void 0}function Xge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,s=t.filterDate;return N_(e,{minDate:n,maxDate:r})||i&&i.some(function(a){return ay(e,a)})||o&&!o.some(function(a){return ay(e,a)})||s&&!s(mn(e))||!1}function Qge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=new Date(e,0,1);return N_(i,{minDate:n,maxDate:r})||!1}function Jge(e,t,n,r){var i=pt(e),o=Jw(e),s=pt(t),a=Jw(t),l=pt(r);return i===s&&i===l?o<=n&&n<=a:i=n||li:void 0}function N_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate;return n&&Od(e,n)<0||r&&Od(e,r)>0}function KN(e,t){return t.some(function(n){return Ti(n)===Ti(e)&&Oi(n)===Oi(e)})}function XN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.excludeTimes,r=t.includeTimes,i=t.filterTime;return n&&KN(e,n)||r&&!KN(e,r)||i&&!i(e)||!1}function QN(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var i,o=mn(),s=Mf(Rf(o,Oi(e)),Ti(e)),a=Mf(Rf(o,Oi(n)),Ti(n)),l=Mf(Rf(o,Oi(r)),Ti(r));try{i=!Wc(s,{start:a,end:l})}catch{i=!1}return i}function JN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=kd(e,1);return n&&Pd(n,i)>0||r&&r.every(function(o){return Pd(o,i)>0})||!1}function eL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=ro(e,1);return n&&Pd(i,n)>0||r&&r.every(function(o){return Pd(i,o)>0})||!1}function tL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=Md(e,1);return n&&yv(n,i)>0||r&&r.every(function(o){return yv(o,i)>0})||!1}function nL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=Vc(e,1);return n&&yv(i,n)>0||r&&r.every(function(o){return yv(i,o)>0})||!1}function lF(e){var t=e.minDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Od(i,t)>=0});return J3(r)}return n?J3(n):t}function cF(e){var t=e.maxDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Od(i,t)<=0});return Q3(r)}return n?Q3(n):t}function rL(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"react-datepicker__day--highlighted",n=new Map,r=0,i=e.length;r1&&arguments[1]!==void 0?arguments[1]:12,n=Math.ceil(pt(e)/t)*t,r=n-(t-1);return{startPeriod:r,endPeriod:n}}function tve(e,t,n,r){for(var i=[],o=0;o<2*t+1;o++){var s=e+t-o,a=!0;n&&(a=pt(n)<=s),r&&a&&(a=pt(r)>=s),a&&i.push(s)}return i}var nve=k_(function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;Rn(this,n),ie(ce(i=t.call(this,r)),"renderOptions",function(){var l=i.props.year,c=i.state.yearsList.map(function(p){return V.createElement("div",{className:l===p?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:p,onClick:i.onChange.bind(ce(i),p),"aria-selected":l===p?"true":void 0},l===p?V.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",p)}),f=i.props.minDate?pt(i.props.minDate):null,h=i.props.maxDate?pt(i.props.maxDate):null;return h&&i.state.yearsList.find(function(p){return p===h})||c.unshift(V.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:i.incrementYears},V.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),f&&i.state.yearsList.find(function(p){return p===f})||c.push(V.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:i.decrementYears},V.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c}),ie(ce(i),"onChange",function(l){i.props.onChange(l)}),ie(ce(i),"handleClickOutside",function(){i.props.onCancel()}),ie(ce(i),"shiftYears",function(l){var c=i.state.yearsList.map(function(f){return f+l});i.setState({yearsList:c})}),ie(ce(i),"incrementYears",function(){return i.shiftYears(1)}),ie(ce(i),"decrementYears",function(){return i.shiftYears(-1)});var o=r.yearDropdownItemNumber,s=r.scrollableYearDropdown,a=o||(s?10:5);return i.state={yearsList:tve(i.props.year,a,i.props.minDate,i.props.maxDate)},i.dropdownRef=H.createRef(),i}return Nn(n,[{key:"componentDidMount",value:function(){var r=this.dropdownRef.current;r&&(r.scrollTop=r.scrollHeight/2-r.clientHeight/2)}},{key:"render",value:function(){var r=ge({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return V.createElement("div",{className:r,ref:this.dropdownRef},this.renderOptions())}}]),n}()),rve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:{},l=!1;r.getTabIndex()===0&&!a.isInputFocused&&r.isSameDay(r.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(l=!0),r.props.inline&&!r.props.shouldFocusDayInline&&(l=!1),r.props.containerRef&&r.props.containerRef.current&&r.props.containerRef.current.contains(document.activeElement)&&document.activeElement.classList.contains("react-datepicker__day")&&(l=!0)),l&&r.dayEl.current.focus({preventScroll:!0})}),ie(ce(r),"renderDayContents",function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(sR(r.props.day),r.props.day):sR(r.props.day)}),ie(ce(r),"render",function(){return V.createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.handleMouseEnter,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"option","aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()},r.renderDayContents())}),r}return Nn(n,[{key:"componentDidMount",value:function(){this.handleFocusDay()}},{key:"componentDidUpdate",value:function(r){this.handleFocusDay(r)}}]),n}(),uve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=6,m=!l&&!r.isWeekInMonth(h);if(p||m){if(!r.props.peekNextMonth)break;f=!0}}return a}),ie(ce(r),"onMonthClick",function(a,l){r.handleDayClick(Ha(qi(r.props.day,l)),a)}),ie(ce(r),"handleMonthNavigation",function(a,l){r.isDisabled(l)||r.isExcluded(l)||(r.props.setPreSelection(l),r.MONTH_REFS[a].current&&r.MONTH_REFS[a].current.focus())}),ie(ce(r),"onMonthKeyDown",function(a,l){var c=a.key;if(!r.props.disabledKeyboardNavigation)switch(c){case"Enter":r.onMonthClick(a,l),r.props.setPreSelection(r.props.selected);break;case"ArrowRight":r.handleMonthNavigation(l===11?0:l+1,ro(r.props.preSelection,1));break;case"ArrowLeft":r.handleMonthNavigation(l===0?11:l-1,kd(r.props.preSelection,1))}}),ie(ce(r),"onQuarterClick",function(a,l){r.handleDayClick(qge(nf(r.props.day,l)),a)}),ie(ce(r),"getMonthClassNames",function(a){var l=r.props,c=l.day,f=l.startDate,h=l.endDate,p=l.selected,m=l.minDate,g=l.maxDate,v=l.preSelection,w=l.monthClassName,y=w?w(c):void 0;return ge("react-datepicker__month-text","react-datepicker__month-".concat(a),y,{"react-datepicker__month--disabled":(m||g)&&Zge(qi(c,a),r.props),"react-datepicker__month--selected":r.isSelectedMonth(c,a,p),"react-datepicker__month-text--keyboard-selected":ur(v)===a,"react-datepicker__month--in-range":Kge(f,h,a,c),"react-datepicker__month--range-start":r.isRangeStartMonth(a),"react-datepicker__month--range-end":r.isRangeEndMonth(a),"react-datepicker__month-text--today":r.isCurrentMonth(c,a)})}),ie(ce(r),"getTabIndex",function(a){var l=ur(r.props.preSelection);return r.props.disabledKeyboardNavigation||a!==l?"-1":"0"}),ie(ce(r),"getAriaLabel",function(a){var l=r.props,c=l.chooseDayAriaLabelPrefix,f=c===void 0?"Choose":c,h=l.disabledDayAriaLabelPrefix,p=h===void 0?"Not available":h,m=l.day,g=qi(m,a),v=r.isDisabled(g)||r.isExcluded(g)?p:f;return"".concat(v," ").concat(ln(g,"MMMM yyyy"))}),ie(ce(r),"getQuarterClassNames",function(a){var l=r.props,c=l.day,f=l.startDate,h=l.endDate,p=l.selected,m=l.minDate,g=l.maxDate;return ge("react-datepicker__quarter-text","react-datepicker__quarter-".concat(a),{"react-datepicker__quarter--disabled":(m||g)&&Xge(nf(c,a),r.props),"react-datepicker__quarter--selected":r.isSelectedQuarter(c,a,p),"react-datepicker__quarter--in-range":Jge(f,h,a,c),"react-datepicker__quarter--range-start":r.isRangeStartQuarter(a),"react-datepicker__quarter--range-end":r.isRangeEndQuarter(a)})}),ie(ce(r),"renderMonths",function(){var a=r.props,l=a.showFullMonthYearPicker,c=a.showTwoColumnMonthYearPicker,f=a.showFourColumnMonthYearPicker,h=a.locale,p=a.day,m=a.selected;return(f?[[0,1,2,3],[4,5,6,7],[8,9,10,11]]:c?[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]]:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]]).map(function(g,v){return V.createElement("div",{className:"react-datepicker__month-wrapper",key:v},g.map(function(w,y){return V.createElement("div",{ref:r.MONTH_REFS[w],key:y,onClick:function(b){r.onMonthClick(b,w)},onKeyDown:function(b){r.onMonthKeyDown(b,w)},tabIndex:r.getTabIndex(w),className:r.getMonthClassNames(w),role:"option","aria-label":r.getAriaLabel(w),"aria-current":r.isCurrentMonth(p,w)?"date":void 0,"aria-selected":r.isSelectedMonth(p,w,m)},l?sF(w,h):aF(w,h))}))})}),ie(ce(r),"renderQuarters",function(){var a=r.props,l=a.day,c=a.selected;return V.createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(f,h){return V.createElement("div",{key:h,role:"option",onClick:function(p){r.onQuarterClick(p,f)},className:r.getQuarterClassNames(f),"aria-selected":r.isSelectedQuarter(l,f,c)},Gge(f,r.props.locale))}))}),ie(ce(r),"getClassNames",function(){var a=r.props;a.day;var l=a.selectingDate,c=a.selectsStart,f=a.selectsEnd,h=a.showMonthYearPicker,p=a.showQuarterYearPicker;return ge("react-datepicker__month",{"react-datepicker__month--selecting-range":l&&(c||f)},{"react-datepicker__monthPicker":h},{"react-datepicker__quarterPicker":p})}),r}return Nn(n,[{key:"render",value:function(){var r=this.props,i=r.showMonthYearPicker,o=r.showQuarterYearPicker,s=r.day,a=r.ariaLabelPrefix,l=a===void 0?"month ":a;return V.createElement("div",{className:this.getClassNames(),onMouseLeave:this.handleMouseLeave,"aria-label":"".concat(l," ").concat(ln(s,"yyyy-MM")),role:"listbox"},i?this.renderMonths():o?this.renderQuarters():this.renderWeeks())}}]),n}(),uF=function(e){Ln(n,V.Component);var t=Dn(n);function n(){var r;Rn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:{}).className||"").split(/\s+/);return gve.some(function(a){return s.indexOf(a)>=0})})(o.target)&&i.props.onDropdownFocus()}),ie(ce(i),"getDateInView",function(){var o=i.props,s=o.preSelection,a=o.selected,l=o.openToDate,c=lF(i.props),f=cF(i.props),h=mn(),p=l||a||s;return p||(c&&Kr(h,c)?c:f&&Hs(h,f)?f:h)}),ie(ce(i),"increaseMonth",function(){i.setState(function(o){var s=o.date;return{date:ro(s,1)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"decreaseMonth",function(){i.setState(function(o){var s=o.date;return{date:kd(s,1)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"handleDayClick",function(o,s,a){i.props.onSelect(o,s,a),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleDayMouseEnter",function(o){i.setState({selectingDate:o}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(o)}),ie(ce(i),"handleMonthMouseLeave",function(){i.setState({selectingDate:null}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()}),ie(ce(i),"handleYearChange",function(o){i.props.onYearChange&&i.props.onYearChange(o),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(o),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleMonthChange",function(o){i.props.onMonthChange&&i.props.onMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(o),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(o)}),ie(ce(i),"handleMonthYearChange",function(o){i.handleYearChange(o),i.handleMonthChange(o)}),ie(ce(i),"changeYear",function(o){i.setState(function(s){var a=s.date;return{date:ty(a,o)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"changeMonth",function(o){i.setState(function(s){var a=s.date;return{date:qi(a,o)}},function(){return i.handleMonthChange(i.state.date)})}),ie(ce(i),"changeMonthYear",function(o){i.setState(function(s){var a=s.date;return{date:ty(qi(a,ur(o)),pt(o))}},function(){return i.handleMonthYearChange(i.state.date)})}),ie(ce(i),"header",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i.state.date,s=GE(o,i.props.locale,i.props.calendarStartDay),a=[];return i.props.showWeekNumbers&&a.push(V.createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),a.concat([0,1,2,3,4,5,6].map(function(l){var c=vl(s,l),f=i.formatWeekday(c,i.props.locale),h=i.props.weekDayClassName?i.props.weekDayClassName(c):void 0;return V.createElement("div",{key:l,className:ge("react-datepicker__day-name",h)},f)}))}),ie(ce(i),"formatWeekday",function(o,s){return i.props.formatWeekDay?function(a,l,c){return l(ln(a,"EEEE",c))}(o,i.props.formatWeekDay,s):i.props.useWeekdaysShort?function(a,l){return ln(a,"EEE",l)}(o,s):function(a,l){return ln(a,"EEEEEE",l)}(o,s)}),ie(ce(i),"decreaseYear",function(){i.setState(function(o){var s=o.date;return{date:Md(s,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"renderPreviousButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=tL(i.state.date,i.props);break;case i.props.showYearPicker:o=function(y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=b.minDate,T=b.yearItemNumber,P=T===void 0?12:T,k=Df(rf(Md(y,P)),P).endPeriod,N=x&&pt(x);return N&&N>k||!1}(i.state.date,i.props);break;default:o=JN(i.state.date,i.props)}if((i.props.forceShowMonthNavigation||i.props.showDisabledMonthNavigation||!o)&&!i.props.showTimeSelectOnly){var s=["react-datepicker__navigation","react-datepicker__navigation--previous"],a=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.decreaseYear),o&&i.props.showDisabledMonthNavigation&&(s.push("react-datepicker__navigation--previous--disabled"),a=null);var l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,c=i.props,f=c.previousMonthButtonLabel,h=c.previousYearButtonLabel,p=i.props,m=p.previousMonthAriaLabel,g=m===void 0?typeof f=="string"?f:"Previous Month":m,v=p.previousYearAriaLabel,w=v===void 0?typeof h=="string"?h:"Previous Year":v;return V.createElement("button",{type:"button",className:s.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":l?w:g},V.createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},l?i.props.previousYearButtonLabel:i.props.previousMonthButtonLabel))}}}),ie(ce(i),"increaseYear",function(){i.setState(function(o){var s=o.date;return{date:Vc(s,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),ie(ce(i),"renderNextButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=nL(i.state.date,i.props);break;case i.props.showYearPicker:o=function(y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=b.maxDate,T=b.yearItemNumber,P=T===void 0?12:T,k=Df(Vc(y,P),P).startPeriod,N=x&&pt(x);return N&&N0&&arguments[0]!==void 0?arguments[0]:i.state.date,s=["react-datepicker__current-month"];return i.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),V.createElement("div",{className:s.join(" ")},ln(o,i.props.dateFormat,i.props.locale))}),ie(ce(i),"renderYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showYearDropdown&&!o)return V.createElement(rve,{adjustDateOnChange:i.props.adjustDateOnChange,date:i.state.date,onSelect:i.props.onSelect,setOpen:i.props.setOpen,dropdownMode:i.props.dropdownMode,onChange:i.changeYear,minDate:i.props.minDate,maxDate:i.props.maxDate,year:pt(i.state.date),scrollableYearDropdown:i.props.scrollableYearDropdown,yearDropdownItemNumber:i.props.yearDropdownItemNumber})}),ie(ce(i),"renderMonthDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthDropdown&&!o)return V.createElement(ove,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,onChange:i.changeMonth,month:ur(i.state.date),useShortMonthInDropdown:i.props.useShortMonthInDropdown})}),ie(ce(i),"renderMonthYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthYearDropdown&&!o)return V.createElement(lve,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,dateFormat:i.props.dateFormat,onChange:i.changeMonthYear,minDate:i.props.minDate,maxDate:i.props.maxDate,date:i.state.date,scrollableMonthYearDropdown:i.props.scrollableMonthYearDropdown})}),ie(ce(i),"renderTodayButton",function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return V.createElement("div",{className:"react-datepicker__today-button",onClick:function(o){return i.props.onSelect(Ar(mn()),o)}},i.props.todayButton)}),ie(ce(i),"renderDefaultHeader",function(o){var s=o.monthDate,a=o.i;return V.createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(s),V.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(a!==0),i.renderMonthYearDropdown(a!==0),i.renderYearDropdown(a!==0)),V.createElement("div",{className:"react-datepicker__day-names"},i.header(s)))}),ie(ce(i),"renderCustomHeader",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.monthDate,a=o.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var l=JN(i.state.date,i.props),c=eL(i.state.date,i.props),f=tL(i.state.date,i.props),h=nL(i.state.date,i.props),p=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return V.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},i.props.renderCustomHeader(WN(WN({},i.state),{},{customHeaderCount:a,monthDate:s,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:l,nextMonthButtonDisabled:c,prevYearButtonDisabled:f,nextYearButtonDisabled:h})),p&&V.createElement("div",{className:"react-datepicker__day-names"},i.header(s)))}),ie(ce(i),"renderYearHeader",function(){var o=i.state.date,s=i.props,a=s.showYearPicker,l=Df(o,s.yearItemNumber),c=l.startPeriod,f=l.endPeriod;return V.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(c," - ").concat(f):pt(o))}),ie(ce(i),"renderHeader",function(o){switch(!0){case i.props.renderCustomHeader!==void 0:return i.renderCustomHeader(o);case(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker):return i.renderYearHeader(o);default:return i.renderDefaultHeader(o)}}),ie(ce(i),"renderMonths",function(){if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],s=i.props.showPreviousMonths?i.props.monthsShown-1:0,a=kd(i.state.date,s),l=0;l0;o.push(V.createElement("div",{key:h,ref:function(g){i.monthContainer=g},className:"react-datepicker__month-container"},i.renderHeader({monthDate:f,i:l}),V.createElement(dve,{chooseDayAriaLabelPrefix:i.props.chooseDayAriaLabelPrefix,disabledDayAriaLabelPrefix:i.props.disabledDayAriaLabelPrefix,weekAriaLabelPrefix:i.props.weekAriaLabelPrefix,ariaLabelPrefix:i.props.monthAriaLabelPrefix,onChange:i.changeMonthYear,day:f,dayClassName:i.props.dayClassName,calendarStartDay:i.props.calendarStartDay,monthClassName:i.props.monthClassName,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,onWeekSelect:i.props.onWeekSelect,orderInDisplay:l,formatWeekNumber:i.props.formatWeekNumber,locale:i.props.locale,minDate:i.props.minDate,maxDate:i.props.maxDate,excludeDates:i.props.excludeDates,excludeDateIntervals:i.props.excludeDateIntervals,highlightDates:i.props.highlightDates,selectingDate:i.state.selectingDate,includeDates:i.props.includeDates,includeDateIntervals:i.props.includeDateIntervals,inline:i.props.inline,shouldFocusDayInline:i.props.shouldFocusDayInline,fixedHeight:i.props.fixedHeight,filterDate:i.props.filterDate,preSelection:i.props.preSelection,setPreSelection:i.props.setPreSelection,selected:i.props.selected,selectsStart:i.props.selectsStart,selectsEnd:i.props.selectsEnd,selectsRange:i.props.selectsRange,selectsDisabledDaysInRange:i.props.selectsDisabledDaysInRange,showWeekNumbers:i.props.showWeekNumbers,startDate:i.props.startDate,endDate:i.props.endDate,peekNextMonth:i.props.peekNextMonth,setOpen:i.props.setOpen,shouldCloseOnSelect:i.props.shouldCloseOnSelect,renderDayContents:i.props.renderDayContents,disabledKeyboardNavigation:i.props.disabledKeyboardNavigation,showMonthYearPicker:i.props.showMonthYearPicker,showFullMonthYearPicker:i.props.showFullMonthYearPicker,showTwoColumnMonthYearPicker:i.props.showTwoColumnMonthYearPicker,showFourColumnMonthYearPicker:i.props.showFourColumnMonthYearPicker,showYearPicker:i.props.showYearPicker,showQuarterYearPicker:i.props.showQuarterYearPicker,isInputFocused:i.props.isInputFocused,containerRef:i.containerRef,monthShowsDuplicateDaysEnd:p,monthShowsDuplicateDaysStart:m})))}return o}}),ie(ce(i),"renderYears",function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?V.createElement("div",{className:"react-datepicker__year--container"},i.renderHeader(),V.createElement(hve,M_({onDayClick:i.handleDayClick,date:i.state.date},i.props))):void 0}),ie(ce(i),"renderTimeSection",function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return V.createElement(uF,{selected:i.props.selected,openToDate:i.props.openToDate,onChange:i.props.onTimeChange,timeClassName:i.props.timeClassName,format:i.props.timeFormat,includeTimes:i.props.includeTimes,intervals:i.props.timeIntervals,minTime:i.props.minTime,maxTime:i.props.maxTime,excludeTimes:i.props.excludeTimes,filterTime:i.props.filterTime,timeCaption:i.props.timeCaption,todayButton:i.props.todayButton,showMonthDropdown:i.props.showMonthDropdown,showMonthYearDropdown:i.props.showMonthYearDropdown,showYearDropdown:i.props.showYearDropdown,withPortal:i.props.withPortal,monthRef:i.state.monthContainer,injectTimes:i.props.injectTimes,locale:i.props.locale,handleOnKeyDown:i.props.handleOnKeyDown,showTimeSelectOnly:i.props.showTimeSelectOnly})}),ie(ce(i),"renderInputTimeSection",function(){var o=new Date(i.props.selected),s=is(o)&&i.props.selected?"".concat(iL(o.getHours()),":").concat(iL(o.getMinutes())):"";if(i.props.showTimeInput)return V.createElement(pve,{date:o,timeString:s,timeInputLabel:i.props.timeInputLabel,onChange:i.props.onTimeChange,customTimeInput:i.props.customTimeInput})}),i.containerRef=V.createRef(),i.state={date:i.getDateInView(),selectingDate:null,monthContainer:null},i}return Nn(n,[{key:"componentDidMount",value:function(){var r=this;this.props.showTimeSelect&&(this.assignMonthContainer=void r.setState({monthContainer:r.monthContainer}))}},{key:"componentDidUpdate",value:function(r){this.props.preSelection&&!gr(this.props.preSelection,r.preSelection)?this.setState({date:this.props.preSelection}):this.props.openToDate&&!gr(this.props.openToDate,r.openToDate)&&this.setState({date:this.props.openToDate})}},{key:"render",value:function(){var r=this.props.container||mve;return V.createElement("div",{ref:this.containerRef},V.createElement(r,{className:ge("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showPopperArrow:this.props.showPopperArrow,arrowProps:this.props.arrowProps},this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.props.children))}}],[{key:"defaultProps",get:function(){return{onDropdownFocus:function(){},monthsShown:1,monthSelectedIn:0,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",customTimeInput:null,yearItemNumber:12}}}]),n}(),fF=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),(i=t.call(this,r)).el=document.createElement("div"),i}return Nn(n,[{key:"componentDidMount",value:function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.portalRoot.removeChild(this.el)}},{key:"render",value:function(){return za.createPortal(this.props.children,this.el)}}]),n}(),yve=function(e){return!e.disabled&&e.tabIndex!==-1},_ve=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),ie(ce(i=t.call(this,r)),"getTabChildren",function(){return Array.prototype.slice.call(i.tabLoopRef.current.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(yve)}),ie(ce(i),"handleFocusStart",function(o){var s=i.getTabChildren();s&&s.length>1&&s[s.length-1].focus()}),ie(ce(i),"handleFocusEnd",function(o){var s=i.getTabChildren();s&&s.length>1&&s[0].focus()}),i.tabLoopRef=V.createRef(),i}return Nn(n,[{key:"render",value:function(){return this.props.enableTabLoop?V.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},V.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:"0",onFocus:this.handleFocusStart}),this.props.children,V.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:"0",onFocus:this.handleFocusEnd})):this.props.children}}],[{key:"defaultProps",get:function(){return{enableTabLoop:!0}}}]),n}(),bve=function(e){Ln(n,V.Component);var t=Dn(n);function n(){return Rn(this,n),t.apply(this,arguments)}return Nn(n,[{key:"render",value:function(){var r,i=this.props,o=i.className,s=i.wrapperClassName,a=i.hidePopper,l=i.popperComponent,c=i.popperModifiers,f=i.popperPlacement,h=i.popperProps,p=i.targetComponent,m=i.enableTabLoop,g=i.popperOnKeyDown,v=i.portalId,w=i.portalHost;if(!a){var y=ge("react-datepicker-popper",o);r=V.createElement($ge,M_({modifiers:c,placement:f},h),function(x){var T=x.ref,P=x.style,k=x.placement,N=x.arrowProps;return V.createElement(_ve,{enableTabLoop:m},V.createElement("div",{ref:T,style:P,className:y,"data-placement":k,onKeyDown:g},V.cloneElement(l,{arrowProps:N})))})}this.props.popperContainer&&(r=V.createElement(this.props.popperContainer,{},r)),v&&!a&&(r=V.createElement(fF,{portalId:v,portalHost:w},r));var b=ge("react-datepicker-wrapper",s);return V.createElement(Nge,{className:"react-datepicker-manager"},V.createElement(jge,null,function(x){var T=x.ref;return V.createElement("div",{ref:T,className:b},p)}),r)}}],[{key:"defaultProps",get:function(){return{hidePopper:!0,popperModifiers:[],popperProps:{},popperPlacement:"bottom-start"}}}]),n}(),wve=k_(vve),xve=function(e){Ln(n,V.Component);var t=Dn(n);function n(r){var i;return Rn(this,n),ie(ce(i=t.call(this,r)),"getPreSelection",function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:mn()}),ie(ce(i),"calcInitialState",function(){var o,s=i.getPreSelection(),a=lF(i.props),l=cF(i.props),c=a&&Kr(s,Ar(a))?a:l&&Hs(s,al(l))?l:s;return{open:i.props.startOpen||!1,preventFocus:!1,preSelection:(o=i.props.selectsRange?i.props.startDate:i.props.selected)!==null&&o!==void 0?o:c,highlightDates:rL(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1}}),ie(ce(i),"clearPreventFocusTimeout",function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)}),ie(ce(i),"setFocus",function(){i.input&&i.input.focus&&i.input.focus({preventScroll:!0})}),ie(ce(i),"setBlur",function(){i.input&&i.input.blur&&i.input.blur(),i.cancelFocusInput()}),ie(ce(i),"setOpen",function(o){var s=arguments.length>1&&arguments[1]!==void 0&&arguments[1];i.setState({open:o,preSelection:o&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:U1},function(){o||i.setState(function(a){return{focused:!!s&&a.focused}},function(){!s&&i.setBlur(),i.setState({inputValue:null})})})}),ie(ce(i),"inputOk",function(){return ME(i.state.preSelection)}),ie(ce(i),"isCalendarOpen",function(){return i.props.open===void 0?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open}),ie(ce(i),"handleFocus",function(o){i.state.preventFocus||(i.props.onFocus(o),i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})}),ie(ce(i),"cancelFocusInput",function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=null}),ie(ce(i),"deferFocusInput",function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)}),ie(ce(i),"handleDropdownFocus",function(){i.cancelFocusInput()}),ie(ce(i),"handleBlur",function(o){(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&i.props.onBlur(o),i.setState({focused:!1})}),ie(ce(i),"handleCalendarClickOutside",function(o){i.props.inline||i.setOpen(!1),i.props.onClickOutside(o),i.props.withPortal&&o.preventDefault()}),ie(ce(i),"handleChange",function(){for(var o=arguments.length,s=new Array(o),a=0;a{const{className:t,isClearable:n,selected:r,dateFormat:i}=e,o=!n||Bo(r),s=H.useRef();return U("div",{className:"icon-input-container",children:[C(xve,{...e,popperModifiers:[{name:"arrow",options:{padding:24}}],dateFormat:i??Nf,className:ge("icon-input-container__input form-control",t),ref:s}),o&&C(Fe,{icon:Rpe,className:"icon-input-container__icon",onClick:()=>{var a;return(a=s.current)==null?void 0:a.input.focus()}})]})},Cve=e=>C(bx,{...e,dateFormat:zE,showTimeSelect:!0,timeIntervals:10});const Eve=({icon:e,className:t,...n})=>{const r=gl(),i=ge("icon-input-container__input",t);return U("div",{className:"icon-input-container",children:[C(zc,{className:i,innerRef:r,...n}),C(Fe,{icon:e,fixedWidth:!0,className:"icon-input-container__icon",onClick:()=>{var o;return(o=r.current)==null?void 0:o.focus()}})]})},V1=({children:e,infoTooltip:t,checked:n,onChange:r})=>U("p",{children:[C(X8,{inline:!0,checked:n,className:t?"me-2":"",onChange:r,children:e}),t&&C(og,{placement:"right",children:t})]});const Tve=({isOpen:e,toggle:t})=>U(Ho,{isOpen:e,toggle:t,centered:!0,size:"lg",children:[C(oo,{toggle:t,children:"Info"}),U(Ri,{children:[U("p",{children:["When the ",C("b",{children:C("i",{children:'"Use existing URL if found"'})})," checkbox is checked, the server will return an existing short URL if it matches provided params."]}),C("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),U("ul",{children:[C("li",{children:"When only the long URL is provided: The most recent match will be returned, or a new short URL will be created if none is found."}),U("li",{children:["When long URL and custom slug and/or domain are provided: Same as in previous case, but it will try to match the short URL using both the long URL and the slug, the long URL and the domain, or the three of them.",C("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),C("li",{children:"When other params are provided: Same as in previous cases, but it will try to match existing short URLs with all provided data. If any of them does not match, a new short URL will be created"})]})]})]}),Ove=()=>{const[e,t]=jt();return U(We,{children:[C("span",{title:"What does this mean?",children:C(Fe,{icon:bC,style:{cursor:"pointer"},onClick:t})}),C(Tve,{isOpen:e,toggle:t})]})};const Pve=It(LZ,SZ(/ /g,"-")),H1=e=>typeof e=="string"?Io(e):e,kve=(e,t)=>({mode:n,saving:r,onSave:i,initialState:o,selectedServer:s})=>{const[a,l]=H.useState(o),c=()=>l(o),f=Mi("deviceLongUrls",s),h=n==="edit",p=n==="create-basic",m=P=>l({...a,tags:P.map(Pve)}),g=(P,k)=>yi(P)?P:yi(k)?null:void 0,v=sh(async()=>i({...a,validSince:Ys(a.validSince)??null,validUntil:Ys(a.validUntil)??null,maxVisits:yi(a.maxVisits)?Number(a.maxVisits):null}).then(()=>!h&&c()).catch(()=>{}));H.useEffect(()=>{l(o)},[o]);const w=(P,k,N="text",D={},z={})=>C(_r,{...z,children:C(zc,{id:P,type:N,placeholder:k,value:a[P]??"",onChange:D.onChange??(A=>l({...a,[P]:A.target.value})),...D})}),y=(P,k,N)=>{var D;return C(Eve,{icon:N,id:P,type:"url",placeholder:k,value:((D=a.deviceLongUrls)==null?void 0:D[P])??"",onChange:z=>{var A;return l({...a,deviceLongUrls:{...a.deviceLongUrls??{},[P]:g(z.target.value,(A=o.deviceLongUrls)==null?void 0:A[P])}})}})},b=(P,k,N={})=>C(Cve,{selected:a[P]?H1(a[P]):null,placeholderText:k,isClearable:!0,onChange:D=>l({...a,[P]:D}),...N}),x=U(We,{children:[C(_r,{children:C(zc,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:a.longUrl,onChange:P=>l({...a,longUrl:P.target.value})})}),U(er,{children:[p&&w("customSlug","Custom slug","text",{bsSize:"lg"},{className:"col-lg-6"}),C("div",{className:p?"col-lg-6 mb-3":"col-12",children:C(e,{selectedTags:a.tags??[],onChange:m})})]})]}),T=Mi("forwardQuery",s);return U("form",{name:"shortUrlForm",className:"short-url-form",onSubmit:v,children:[p&&x,!p&&U(We,{children:[U(er,{children:[C("div",{className:ge("mb-3",{"col-sm-6":f,"col-12":!f}),children:C(dn,{title:"Main options",className:"mb-3",children:x})}),f&&C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Device-specific long URLs",children:[C(_r,{children:y("android","Android-specific redirection",wge)}),C(_r,{children:y("ios","iOS-specific redirection",bge)}),y("desktop","Desktop-specific redirection",BQ)]})})]}),U(er,{children:[C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Customize the short URL",children:[w("title","Title","text",{onChange:({target:P})=>l({...a,title:g(P.value,o.title)})}),!h&&U(We,{children:[U(er,{children:[C("div",{className:"col-lg-6",children:w("customSlug","Custom slug","text",{disabled:yi(a.shortCodeLength)})}),C("div",{className:"col-lg-6",children:w("shortCodeLength","Short code length","number",{min:4,disabled:yi(a.customSlug)})})]}),C(t,{value:a.domain,onChange:P=>l({...a,domain:P})})]})]})}),C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Limit access to the short URL",children:[w("maxVisits","Maximum number of visits allowed","number",{min:1}),C("div",{className:"mb-3",children:b("validSince","Enabled since...",{maxDate:a.validUntil?H1(a.validUntil):void 0})}),b("validUntil","Enabled until...",{minDate:a.validSince?H1(a.validSince):void 0})]})})]}),U(er,{children:[C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Extra checks",children:[C(V1,{infoTooltip:"If checked, Shlink will try to reach the long URL, failing in case it's not publicly accessible.",checked:a.validateUrl,onChange:P=>l({...a,validateUrl:P}),children:"Validate URL"}),!h&&U("p",{children:[C(X8,{inline:!0,className:"me-2",checked:a.findIfExists,onChange:P=>l({...a,findIfExists:P}),children:"Use existing URL if found"}),C(Ove,{})]})]})}),C("div",{className:"col-sm-6 mb-3",children:U(dn,{title:"Configure behavior",children:[C(V1,{infoTooltip:"This short URL will be included in the robots.txt for your Shlink instance, allowing web crawlers (like Google) to index it.",checked:a.crawlable,onChange:P=>l({...a,crawlable:P}),children:"Make it crawlable"}),T&&C(V1,{infoTooltip:"When this short URL is visited, any query params appended to it will be forwarded to the long URL.",checked:a.forwardQuery,onChange:P=>l({...a,forwardQuery:P}),children:"Forward query params on redirect"})]})})]})]}),C("div",{className:"text-center",children:C(mt,{outline:!0,color:"primary",disabled:r||qn(a.longUrl),className:"btn-xs-block",children:r?"Saving...":"Save"})})]})},Mve=({startDate:e=null,endDate:t=null,disabled:n=!1,onStartDateChange:r,onEndDateChange:i})=>U("div",{className:"row",children:[C("div",{className:"col-md-6",children:C(bx,{selected:e,placeholderText:"Since...",isClearable:!0,maxDate:t??void 0,disabled:n,onChange:r})}),C("div",{className:"col-md-6",children:C(bx,{className:"mt-2 mt-md-0",selected:t,placeholderText:"Until...",isClearable:!0,minDate:e??void 0,disabled:n,onChange:o=>i(o&&al(o))})})]}),dF=({onDatesChange:e,initialDateRange:t,defaultText:n,disabled:r,updatable:i=!1})=>{const o=ry(t),[s,a]=H.useState(o?t:void 0),[l,c]=H.useState(o?void 0:t),f=p=>{a(E8(p)?ch:void 0),c(p),e(p)},h=p=>{a(p),c(void 0),e(O8(p))};return i&&Ooe(()=>{const p=ry(t);p&&h(t),t&&!p&&f(t)},[t]),U(ia,{disabled:r,text:VE(s??l)??n,children:[C(z8,{allText:n,active:s,onChange:h}),C(Ve,{divider:!0}),C(Ve,{header:!0,children:"Custom:"}),C(Ve,{text:!0,children:C(Mve,{...l,onStartDateChange:p=>f({...l,startDate:p}),onEndDateChange:p=>f({...l,endDate:p})})})]})},Rve=({onChange:e,selected:t={},className:n,supportsDisabledFiltering:r})=>{const{excludeBots:i=!1,excludeMaxVisitsReached:o=!1,excludePastValidUntil:s=!1}=t,a=l=>()=>e({...t,[l]:!(t!=null&&t[l])});return U(ia,{text:"Filters",dropdownClassName:n,className:"me-3",right:!0,minWidth:250,children:[C(Ve,{header:!0,children:"Visits:"}),C(Ve,{active:i,onClick:a("excludeBots"),children:"Ignore visits from bots"}),r&&U(We,{children:[C(Ve,{divider:!0}),C(Ve,{header:!0,children:"Short URLs:"}),C(Ve,{active:o,onClick:a("excludeMaxVisitsReached"),children:"Exclude with visits reached"}),C(Ve,{active:s,onClick:a("excludePastValidUntil"),children:"Exclude enabled in the past"})]}),C(Ve,{divider:!0}),C(Ve,{disabled:!yi(t),onClick:()=>e({excludeBots:!1,excludeMaxVisitsReached:!1,excludePastValidUntil:!1}),children:C("i",{children:"Clear filters"})})]})};const Nve=(e,t)=>({selectedServer:n,className:r,shortUrlsAmount:i,order:o,handleOrderBy:s,settings:a})=>{var D;const[l,c]=P_(),{search:f,tags:h,startDate:p,endDate:m,excludeBots:g,excludeMaxVisitsReached:v,excludePastValidUntil:w,tagsMode:y="any"}=l,b=Mi("filterDisabledUrls",n),x=It(({startDate:z,endDate:A})=>({startDate:Ys(z)??void 0,endDate:Ys(A)??void 0}),c),T=It(z=>qn(z)?void 0:z,z=>c({search:z})),P=z=>c({tags:z}),k=Mi("allTagsFiltering",n),N=It(()=>y==="any"?"all":"any",z=>c({tagsMode:z}));return U("div",{className:ge("short-urls-filtering-bar-container",r),children:[C(ah,{initialValue:f,onChange:T}),U(th,{className:"mt-3",children:[C(t,{allowNew:!1,placeholder:"With tags...",selectedTags:h,onChange:P}),k&&h.length>1&&U(We,{children:[C(mt,{outline:!0,color:"secondary",onClick:N,id:"tagsModeBtn","aria-label":"Change tags mode",children:C(Fe,{className:"short-urls-filtering-bar__tags-icon",icon:y==="all"?JI:pQ})}),C(Or,{target:"tagsModeBtn",placement:"left",children:y==="all"?"With all the tags.":"With any of the tags."})]})]}),U(er,{className:"flex-lg-row-reverse",children:[C("div",{className:"col-lg-8 col-xl-6 mt-3",children:U("div",{className:"d-md-flex",children:[C("div",{className:"flex-fill",children:C(dF,{defaultText:"All short URLs",initialDateRange:T8(p,m),onDatesChange:x})}),C(Rve,{className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:{excludeBots:g??((D=a.visits)==null?void 0:D.excludeBots),excludeMaxVisitsReached:v,excludePastValidUntil:w},onChange:c,supportsDisabledFiltering:b})]})}),C("div",{className:"col-6 col-lg-4 col-xl-6 mt-3",children:C(e,{amount:i})}),C("div",{className:"col-6 d-lg-none mt-3",children:C(ph,{prefixed:!1,items:j8,order:o,onChange:s})})]})]})};function Af({currentOrder:e,field:t,className:n="ms-1"}){return!e.dir||e.field!==t?null:C(Fe,{icon:e.dir==="ASC"?sQ:yQ,className:n})}const jl=2,wx="...",hF=(e,t)=>{const n=aC(yI(jl,e-jl),MI(t-1,e+jl)+1);return e-jl>jl&&n.unshift(wx),e+jle===wx,pF=e=>Rd(e)?e:wn(e),mF=(e,t)=>Rd(e)?`${e}_${t}`:`${e}`,Lve=({paginator:e,serverId:t,currentQueryString:n=""})=>{const{currentPage:r=0,pagesCount:i=0}=e??{},o=a=>`/server/${t}/list-short-urls/${a}${n}`;if(i<=1)return C("div",{className:"pb-3"});const s=()=>hF(r,i).map((a,l)=>C(Rs,{disabled:Rd(a),active:r===a,children:C(Ns,{tag:At,to:o(a),children:pF(a)})},mF(a,l)));return U(x_,{className:"sticky-card-paginator py-3",listClassName:"flex-wrap justify-content-center mb-0",children:[C(Rs,{disabled:r===1,children:C(Ns,{previous:!0,tag:At,to:o(r-1)})}),s(),C(Rs,{disabled:r>=i,children:C(Ns,{next:!0,tag:At,to:o(r+1)})})]})},Dve=(e,t)=>oa(({listShortUrls:n,shortUrlsList:r,selectedServer:i,settings:o})=>{var K,te,oe;const s=Yd(i),{page:a}=Qs(),l=Mn(),[c,f]=P_(),{tags:h,search:p,startDate:m,endDate:g,orderBy:v,tagsMode:w,excludeBots:y,excludePastValidUntil:b,excludeMaxVisitsReached:x}=c,[T,P]=H.useState(v??((K=o.shortUrlsList)==null?void 0:K.defaultOrdering)??WE),{pagination:k}=(r==null?void 0:r.shortUrls)??{},N=y??((te=o.visits)==null?void 0:te.excludeBots),D=Mi("excludeBotsOnShortUrls",i),z=(se,Z)=>{f({orderBy:{field:se,dir:Z}}),P({field:se,dir:Z})},A=se=>()=>z(se,o_(se,T.field,T.dir)),Y=se=>C(Af,{currentOrder:T,field:se}),q=It(se=>[...new Set([...h,se])],se=>f({tags:se})),ee=({field:se,dir:Z})=>D&&N&&se==="visits"?{field:"nonBotVisits",dir:Z}:{field:se,dir:Z};return H.useEffect(()=>{n({page:a,searchTerm:p,tags:h,startDate:m,endDate:g,orderBy:ee(T),tagsMode:w,excludePastValidUntil:b,excludeMaxVisitsReached:x})},[a,p,h,m,g,T.field,T.dir,w,b,x]),U(We,{children:[C(t,{selectedServer:i,shortUrlsAmount:(oe=r.shortUrls)==null?void 0:oe.pagination.totalItems,order:T,handleOrderBy:z,settings:o,className:"mb-3"}),U(Er,{body:!0,className:"pb-0",children:[C(e,{selectedServer:i,shortUrlsList:r,orderByColumn:A,renderOrderIcon:Y,onTagClick:q}),C(Lve,{paginator:k,serverId:s,currentQueryString:l.search})]})]})},()=>[Jr.visits]);const Ave=e=>({orderByColumn:t,renderOrderIcon:n,shortUrlsList:r,onTagClick:i,selectedServer:o,className:s})=>{const{error:a,loading:l,shortUrls:c}=r,f=ge({"short-urls-table__header-cell--with-action":!!t}),h=ge("short-urls-table__header-cell",f),p=ge("table table-hover responsive-table short-urls-table",s),m=()=>a?C("tr",{children:C("td",{colSpan:6,className:"text-center table-danger text-dark",children:"Something went wrong while loading short URLs :("})}):l?C("tr",{children:C("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!l&&qn(c==null?void 0:c.data)?C("tr",{children:C("td",{colSpan:6,className:"text-center",children:"No results found"})}):c==null?void 0:c.data.map(g=>C(e,{shortUrl:g,selectedServer:o,onTagClick:i},g.shortUrl));return U("table",{className:p,children:[C("thead",{className:"responsive-table__header short-urls-table__header",children:U("tr",{children:[U("th",{className:h,onClick:t==null?void 0:t("dateCreated"),children:["Created at ",n==null?void 0:n("dateCreated")]}),U("th",{className:h,onClick:t==null?void 0:t("shortCode"),children:["Short URL ",n==null?void 0:n("shortCode")]}),U("th",{className:"short-urls-table__header-cell",children:[U("span",{className:f,onClick:t==null?void 0:t("title"),children:["Title ",n==null?void 0:n("title")]}),"  /  ",U("span",{className:f,onClick:t==null?void 0:t("longUrl"),children:[C("span",{className:"indivisible",children:"Long URL"})," ",n==null?void 0:n("longUrl")]})]}),C("th",{className:"short-urls-table__header-cell",children:"Tags"}),C("th",{className:h,onClick:t==null?void 0:t("visits"),children:U("span",{className:"indivisible",children:["Visits ",n==null?void 0:n("visits")]})}),C("th",{className:"short-urls-table__header-cell",colSpan:2})]})}),C("tbody",{children:m()})]})},Ive=(e,t)=>{e.serviceFactory("ShortUrlsList",Dve,"ShortUrlsTable","ShortUrlsFilteringBar"),e.decorator("ShortUrlsList",t(["selectedServer","mercureInfo","shortUrlsList","settings"],["listShortUrls","createNewVisits","loadMercureInfo"])),e.serviceFactory("ShortUrlsTable",Ave,"ShortUrlsRow"),e.serviceFactory("ShortUrlsRow",dge,"ShortUrlsRowMenu","ColorGenerator","useTimeoutToggle"),e.decorator("ShortUrlsRow",t(["settings"])),e.serviceFactory("ShortUrlsRowMenu",hge,"DeleteShortUrlModal","QrCodeModal"),e.serviceFactory("CreateShortUrlResult",tge,"useTimeoutToggle"),e.serviceFactory("ShortUrlForm",kve,"TagsSelector","DomainSelector"),e.serviceFactory("CreateShortUrl",Ime,"ShortUrlForm","CreateShortUrlResult"),e.decorator("CreateShortUrl",t(["shortUrlCreation","selectedServer","settings"],["createShortUrl","resetCreateShortUrl"])),e.serviceFactory("EditShortUrl",Fme,"ShortUrlForm"),e.decorator("EditShortUrl",t(["shortUrlDetail","shortUrlEdition","selectedServer","settings"],["getShortUrlDetail","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",()=>nge),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["deleteShortUrl","shortUrlDeleted","resetDeleteShortUrl"])),e.serviceFactory("QrCodeModal",age,"ImageDownloader"),e.decorator("QrCodeModal",t(["selectedServer"])),e.serviceFactory("ShortUrlsFilteringBar",Nve,"ExportShortUrlsBtn","TagsSelector"),e.serviceFactory("ExportShortUrlsBtn",rge,"buildShlinkApiClient","ReportExporter"),e.decorator("ExportShortUrlsBtn",t(["selectedServer"])),e.serviceFactory("shortUrlsListReducerCreator",Upe,"listShortUrls","editShortUrl","createShortUrl"),e.serviceFactory("shortUrlsListReducer",ct("reducer"),"shortUrlsListReducerCreator"),e.serviceFactory("shortUrlCreationReducerCreator",mge,"createShortUrl"),e.serviceFactory("shortUrlCreationReducer",ct("reducer"),"shortUrlCreationReducerCreator"),e.serviceFactory("shortUrlEditionReducerCreator",_ge,"editShortUrl"),e.serviceFactory("shortUrlEditionReducer",ct("reducer"),"shortUrlEditionReducerCreator"),e.serviceFactory("shortUrlDeletionReducerCreator",jpe,"deleteShortUrl"),e.serviceFactory("shortUrlDeletionReducer",ct("reducer"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDetailReducerCreator",gge,"buildShlinkApiClient"),e.serviceFactory("shortUrlDetailReducer",ct("reducer"),"shortUrlDetailReducerCreator"),e.serviceFactory("listShortUrls",zpe,"buildShlinkApiClient"),e.serviceFactory("createShortUrl",pge,"buildShlinkApiClient"),e.serviceFactory("resetCreateShortUrl",ct("resetCreateShortUrl"),"shortUrlCreationReducerCreator"),e.serviceFactory("deleteShortUrl",$pe,"buildShlinkApiClient"),e.serviceFactory("resetDeleteShortUrl",ct("resetDeleteShortUrl"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDeleted",()=>L8),e.serviceFactory("getShortUrlDetail",ct("getShortUrlDetail"),"shortUrlDetailReducerCreator"),e.serviceFactory("editShortUrl",yge,"buildShlinkApiClient")},Fve=({tag:e,toggle:t,isOpen:n,deleteTag:r,tagDelete:i,tagDeleted:o})=>{const{deleting:s,error:a,deleted:l,errorData:c}=i;return U(Ho,{toggle:t,isOpen:n,centered:!0,onClosed:()=>l&&o(e),children:[C(oo,{toggle:t,className:"text-danger",children:"Delete tag"}),U(Ri,{children:["Are you sure you want to delete tag ",C("b",{children:e}),"?",a&&C(Dr,{type:"error",small:!0,className:"mt-2",children:C(Ao,{errorData:c,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),U(na,{children:[C(mt,{color:"link",onClick:t,children:"Cancel"}),C(mt,{color:"danger",disabled:s,onClick:async()=>{await r(e),t()},children:s?"Deleting tag...":"Delete tag"})]})]})};function L_(){return(L_=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function xx(e){var t=H.useRef(e),n=H.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Nd=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:w.buttons>0)&&i.current?o(oL(i.current,w,a.current)):v(!1)},g=function(){return v(!1)};function v(w){var y=l.current,b=Sx(i.current),x=w?b.addEventListener:b.removeEventListener;x(y?"touchmove":"mousemove",m),x(y?"touchend":"mouseup",g)}return[function(w){var y=w.nativeEvent,b=i.current;if(b&&(sL(y),!function(T,P){return P&&!If(T)}(y,l.current)&&b)){if(If(y)){l.current=!0;var x=y.changedTouches||[];x.length&&(a.current=x[0].identifier)}b.focus(),o(oL(b,y,a.current)),v(!0)}},function(w){var y=w.which||w.keyCode;y<37||y>40||(w.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},v]},[s,o]),f=c[0],h=c[1],p=c[2];return H.useEffect(function(){return p},[p]),V.createElement("div",L_({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),KE=function(e){return e.filter(Boolean).join(" ")},yF=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=KE(["react-colorful__pointer",e.className]);return V.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},V.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Hn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},$ve=function(e){return Vve(Cx(e))},Cx=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Hn(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Hn(parseInt(e.substring(6,8),16)/255,2):1}},jve=function(e){return Uve(zve(e))},Bve=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Hn(e.h),s:Hn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Hn(i/2),a:Hn(r,2)}},Ex=function(e){var t=Bve(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},zve=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),a=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:Hn(255*[r,a,s,s,l,r][c]),g:Hn(255*[l,r,r,a,s,s][c]),b:Hn(255*[s,s,l,r,r,a][c]),a:Hn(i,2)}},Fp=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Uve=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?Fp(Hn(255*i)):"";return"#"+Fp(t)+Fp(n)+Fp(r)+o},Vve=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),a=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:Hn(60*(a<0?a+6:a)),s:Hn(o?s/o*100:0),v:Hn(o/255*100),a:i}},Hve=V.memo(function(e){var t=e.hue,n=e.onChange,r=KE(["react-colorful__hue",e.className]);return V.createElement("div",{className:r},V.createElement(vF,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Nd(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Hn(t),"aria-valuemax":"360","aria-valuemin":"0"},V.createElement(yF,{className:"react-colorful__hue-pointer",left:t/360,color:Ex({h:t,s:100,v:100,a:1})})))}),Wve=V.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ex({h:t.h,s:100,v:100,a:1})};return V.createElement("div",{className:"react-colorful__saturation",style:r},V.createElement(vF,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Nd(t.s+100*i.left,0,100),v:Nd(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Hn(t.s)+"%, Brightness "+Hn(t.v)+"%"},V.createElement(yF,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ex(t)})))}),_F=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Yve=function(e,t){return e.toLowerCase()===t.toLowerCase()||_F(Cx(e),Cx(t))};function qve(e,t,n){var r=xx(n),i=H.useState(function(){return e.toHsva(t)}),o=i[0],s=i[1],a=H.useRef({color:t,hsva:o});H.useEffect(function(){if(!e.equal(t,a.current.color)){var c=e.toHsva(t);a.current={hsva:c,color:t},s(c)}},[t,e]),H.useEffect(function(){var c;_F(o,a.current.hsva)||e.equal(c=e.fromHsva(o),a.current.color)||(a.current={hsva:o,color:c},r(c))},[o,e,r]);var l=H.useCallback(function(c){s(function(f){return Object.assign({},f,c)})},[]);return[o,l]}var Gve=typeof window<"u"?H.useLayoutEffect:H.useEffect,Zve=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},aL=new Map,Kve=function(e){Gve(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!aL.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,aL.set(t,n);var r=Zve();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Xve=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,s=gF(e,["className","colorModel","color","onChange"]),a=H.useRef(null);Kve(a);var l=qve(n,i,o),c=l[0],f=l[1],h=KE(["react-colorful",t]);return V.createElement("div",L_({},s,{ref:a,className:h}),V.createElement(Wve,{hsva:c,onChange:f}),V.createElement(Hve,{hue:c.h,onChange:f,className:"react-colorful__last-control"}))},Qve={defaultColor:"000",toHsva:$ve,fromHsva:function(e){return jve({h:e.h,s:e.s,v:e.v,a:1})},equal:Yve},Jve=function(e){return V.createElement(Xve,L_({},e,{colorModel:Qve}))};const eye=({getColorForKey:e})=>({tag:t,editTag:n,toggle:r,tagEdited:i,isOpen:o,tagEdit:s})=>{const[a,l]=H.useState(t),[c,f]=H.useState(e(t)),[h,p,,m]=jt(),{editing:g,error:v,edited:w,errorData:y}=s,b=sh(async()=>{await n({oldName:t,newName:a,color:c}),r()}),x=It(m,()=>w&&i({oldName:t,newName:a,color:c}));return C(Ho,{isOpen:o,toggle:r,centered:!0,onClosed:x,children:U("form",{name:"editTag",onSubmit:b,children:[C(oo,{toggle:r,children:"Edit tag"}),U(Ri,{children:[U(th,{children:[C("div",{id:"colorPickerBtn",className:"input-group-text edit-tag-modal__color-picker-toggle",style:{backgroundColor:c,borderColor:c},onClick:p,children:C(Fe,{icon:aQ,className:"edit-tag-modal__color-icon"})}),C(Jd,{isOpen:h,toggle:p,target:"colorPickerBtn",placement:"right",hideArrow:!0,popperClassName:"edit-tag-modal__popover",children:C(Jve,{color:c,onChange:f})}),C(zc,{value:a,placeholder:"Tag",required:!0,onChange:({target:T})=>l(T.value)})]}),v&&C(Dr,{type:"error",small:!0,className:"mt-2",children:C(Ao,{errorData:y,fallbackMessage:"Something went wrong while editing the tag :("})})]}),U(na,{children:[C(mt,{type:"button",color:"link",onClick:r,children:"Cancel"}),C(mt,{color:"primary",disabled:g,children:g?"Saving...":"Save"})]})]})})};function tye(e){return V.createElement("button",{type:"button",className:e.classNames.selectedTag,title:e.removeButtonText,onClick:e.onDelete},V.createElement("span",{className:e.classNames.selectedTagName},e.tag.name))}const nye={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},rye=["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform"];class iye extends V.Component{constructor(t){super(t),this.state={inputWidth:null},this.input=V.createRef(),this.sizer=V.createRef()}componentDidMount(){this.props.autoresize&&(this.copyInputStyles(),this.updateInputWidth())}componentDidUpdate({query:t,placeholderText:n}){(t!==this.props.query||n!==this.props.placeholderText)&&this.updateInputWidth()}copyInputStyles(){const t=window.getComputedStyle(this.input.current);rye.forEach(n=>{this.sizer.current.style[n]=t[n]})}updateInputWidth(){let t;this.props.autoresize&&(t=Math.ceil(this.sizer.current.scrollWidth)+2),t!==this.state.inputWidth&&this.setState({inputWidth:t})}render(){const{id:t,query:n,ariaLabelText:r,placeholderText:i,expanded:o,classNames:s,inputAttributes:a,inputEventHandlers:l,index:c}=this.props;return V.createElement("div",{className:s.searchWrapper},V.createElement("input",Object.assign({},a,l,{ref:this.input,value:n,placeholder:i,className:s.searchInput,role:"combobox","aria-autocomplete":"list","aria-label":r||i,"aria-owns":t,"aria-activedescendant":c>-1?`${t}-${c}`:null,"aria-expanded":o,style:{width:this.state.inputWidth}})),V.createElement("div",{ref:this.sizer,style:nye},n||i))}}function XE(e){return e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function oye(e){return new RegExp(XE(e),"gi")}function sye(e){return new RegExp(`(?:^|\\s)${XE(e)}`,"i")}function aye(e){return new RegExp(`^${XE(e)}$`,"i")}function lye(e,t){const n=oye(t);return e.replace(n,"$&")}function cye({item:e,query:t}){return V.createElement("span",{dangerouslySetInnerHTML:{__html:lye(e.name,t)}})}function uye(e){const t=e.suggestionComponent||cye,n=e.options.map((r,i)=>{const o=`${e.id}-${i}`,s=[];return e.index===i&&s.push(e.classNames.suggestionActive),r.disabled&&s.push(e.classNames.suggestionDisabled),V.createElement("li",{id:o,key:o,role:"option",className:s.join(" "),"aria-disabled":!!r.disabled,onMouseDown:a=>a.preventDefault(),onClick:()=>e.addTag(r)},r.prefix?V.createElement("span",{className:e.classNames.suggestionPrefix},r.prefix," "):null,r.disableMarkIt?r.name:V.createElement(t,{item:r,query:e.query}))});return V.createElement("div",{className:e.classNames.suggestions},V.createElement("ul",{role:"listbox",id:e.id},n))}function fye(e,t){const n=e.querySelectorAll("a,button,input"),r=Array.prototype.findIndex.call(n,o=>o===t),i=n[r-1]||n[r+1];i&&i.focus()}const Ra={ENTER:"Enter",TAB:"Tab",BACKSPACE:"Backspace",UP_ARROW:"ArrowUp",UP_ARROW_COMPAT:"Up",DOWN_ARROW:"ArrowDown",DOWN_ARROW_COMPAT:"Down"},bF={root:"react-tags",rootFocused:"is-focused",selected:"react-tags__selected",selectedTag:"react-tags__selected-tag",selectedTagName:"react-tags__selected-tag-name",search:"react-tags__search",searchWrapper:"react-tags__search-wrapper",searchInput:"react-tags__search-input",suggestions:"react-tags__suggestions",suggestionActive:"is-active",suggestionDisabled:"is-disabled",suggestionPrefix:"react-tags__suggestion-prefix"};function wF(e,t){return e.findIndex(n=>aye(t).test(n.name))}function W1(){if(this.state.query.length>=this.props.minQueryLength){const e=wF(this.state.options,this.state.query),t=this.state.index===-1?e:this.state.index,n=t>-1?this.state.options[t]:null;n?this.addTag(n):this.props.allowNew&&this.addTag({name:this.state.query})}}function dye(e){e.preventDefault();const t=this.state.options.length-1;this.setState({index:this.state.index<=0?t:this.state.index-1})}function hye(e){e.preventDefault();const t=this.state.options.length-1;this.setState({index:this.state.index>=t?0:this.state.index+1})}function pye(){this.state.query.length||this.deleteTag(this.props.tags.length-1)}function mye(e,t){return sye(t).test(e.name)}function gye(e,t){let n;return e.suggestionsTransform?n=e.suggestionsTransform(t.query,e.suggestions):n=e.suggestions.filter(r=>e.suggestionsFilter(r,t.query)),n=n.slice(0,e.maxSuggestionsLength),e.allowNew&&e.newTagText&&wF(n,t.query)===-1?n.push({id:0,name:t.query,prefix:e.newTagText,disableMarkIt:!0}):e.noSuggestionsText&&n.length===0&&n.push({id:0,name:e.noSuggestionsText,disabled:!0,disableMarkIt:!0}),n}class QE extends V.Component{constructor(t){super(t),this.state={query:"",focused:!1,index:-1},this.inputEventHandlers={onChange:()=>{},onBlur:this.onBlur.bind(this),onFocus:this.onFocus.bind(this),onInput:this.onInput.bind(this),onKeyDown:this.onKeyDown.bind(this)},this.container=V.createRef(),this.input=V.createRef()}onInput(t){const n=t.target.value;this.props.onInput&&this.props.onInput(n),n.length===this.state.query.length+1&&this.props.delimiters.indexOf(n.slice(-1))>-1?W1.call(this):n!==this.state.query&&this.setState({query:n})}onKeyDown(t){this.props.delimiters.indexOf(t.key)>-1&&((this.state.query||this.state.index>-1)&&t.preventDefault(),W1.call(this)),t.key===Ra.BACKSPACE&&this.props.allowBackspace&&pye.call(this,t),(t.key===Ra.UP_ARROW||t.key===Ra.UP_ARROW_COMPAT)&&dye.call(this,t),(t.key===Ra.DOWN_ARROW||t.key===Ra.DOWN_ARROW_COMPAT)&&hye.call(this,t)}onClick(t){document.activeElement!==t.target&&this.focusInput()}onBlur(){this.setState({focused:!1,index:-1}),this.props.onBlur&&this.props.onBlur(),this.props.addOnBlur&&W1.call(this)}onFocus(){this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus()}onDeleteTag(t,n){this.container.current&&fye(this.container.current,n.currentTarget),this.deleteTag(t)}addTag(t){t.disabled||typeof this.props.onValidate=="function"&&!this.props.onValidate(t)||(this.props.onAddition({id:t.id,name:t.name}),this.clearInput())}deleteTag(t){this.props.onDelete(t)}clearInput(){this.setState({query:"",index:-1})}clearSelectedIndex(){this.setState({index:-1})}focusInput(){this.input.current&&this.input.current.input.current&&this.input.current.input.current.focus()}render(){const t=this.props.tagComponent||tye,n=this.state.focused&&this.state.query.length>=this.props.minQueryLength,r=Object.assign({},bF,this.props.classNames),i=[r.root];return this.state.focused&&i.push(r.rootFocused),V.createElement("div",{ref:this.container,className:i.join(" "),onClick:this.onClick.bind(this)},V.createElement("div",{className:r.selected,"aria-relevant":"additions removals","aria-live":"polite"},this.props.tags.map((o,s)=>V.createElement(t,{key:s,tag:o,removeButtonText:this.props.removeButtonText,classNames:r,onDelete:this.onDeleteTag.bind(this,s)}))),V.createElement("div",{className:r.search},V.createElement(iye,Object.assign({},this.state,{id:this.props.id,ref:this.input,classNames:r,inputAttributes:this.props.inputAttributes,inputEventHandlers:this.inputEventHandlers,autoresize:this.props.autoresize,expanded:n,placeholderText:this.props.placeholderText,ariaLabelText:this.props.ariaLabelText})),n&&this.state.options.length?V.createElement(uye,Object.assign({},this.state,{id:this.props.id,classNames:r,expanded:n,addTag:this.addTag.bind(this),suggestionComponent:this.props.suggestionComponent})):null))}static getDerivedStateFromProps(t,n){return n.prevQuery!==n.query||n.prevSuggestions!==t.suggestions?{prevQuery:n.query,prevSuggestions:t.suggestions,options:gye(t,n)}:null}}QE.defaultProps={id:"ReactTags",tags:[],placeholderText:"Add new tag",removeButtonText:"Click to remove tag",noSuggestionsText:null,newTagText:null,suggestions:[],suggestionsFilter:mye,suggestionsTransform:null,autoresize:!0,classNames:bF,delimiters:[Ra.TAB,Ra.ENTER],minQueryLength:2,maxSuggestionsLength:6,allowNew:!1,allowBackspace:!0,addOnBlur:!1,tagComponent:null,suggestionComponent:null,inputAttributes:{}};QE.propTypes={id:S.string,tags:S.arrayOf(S.object),placeholderText:S.string,ariaLabelText:S.string,removeButtonText:S.string,noSuggestionsText:S.string,newTagText:S.string,suggestions:S.arrayOf(S.object),suggestionsFilter:S.func,suggestionsTransform:S.func,autoresize:S.bool,delimiters:S.arrayOf(S.string),onDelete:S.func.isRequired,onAddition:S.func.isRequired,onInput:S.func,onFocus:S.func,onBlur:S.func,onValidate:S.func,minQueryLength:S.number,maxSuggestionsLength:S.number,classNames:S.object,allowNew:S.bool,allowBackspace:S.bool,addOnBlur:S.bool,tagComponent:S.oneOfType([S.func,S.element]),suggestionComponent:S.oneOfType([S.func,S.element]),inputAttributes:S.object};const xF=({tag:e,colorGenerator:t})=>C("div",{style:{backgroundColor:t.getColorForKey(e)},className:"tag-bullet"}),lL=e=>({id:e,name:e}),vye=e=>({selectedTags:t,onChange:n,placeholder:r,listTags:i,tagsList:o,settings:s,allowNew:a=!0})=>{var h;H.useEffect(()=>{i()},[]);const l=((h=s.shortUrlCreation)==null?void 0:h.tagFilteringMode)??"startsWith",c=({tag:p,onDelete:m})=>C(qE,{colorGenerator:e,text:p.name,clearable:!0,className:"react-tags__tag",onClose:m}),f=({item:p})=>U(We,{children:[C(xF,{tag:`${p.name}`,colorGenerator:e}),p.name]});return C(QE,{tags:t.map(lL),tagComponent:c,suggestions:o.tags.filter(p=>!t.includes(p)).map(lL),suggestionComponent:f,allowNew:a,addOnBlur:!0,placeholderText:r??"Add tags to the URL",minQueryLength:1,delimiters:["Enter","Tab",","],suggestionsTransform:l==="includes"?(p,m)=>m.filter(({name:g})=>g.includes(p)):void 0,onDelete:p=>{const m=[...t];m.splice(p,1),n(m)},onAddition:({name:p})=>n([...new Set([...t,...p.toLowerCase().split(",")])])})},Tx="shlink/tagDelete",yye={deleting:!1,deleted:!1,error:!1},SF=bn(`${Tx}/tagDeleted`),_ye=e=>{const t=or(`${Tx}/deleteTag`,async(r,{getState:i})=>{const{deleteTags:o}=e(i);await o([r])}),{reducer:n}=Gn({name:Tx,initialState:yye,reducers:{},extraReducers:r=>{r.addCase(t.pending,()=>({deleting:!0,deleted:!1,error:!1})),r.addCase(t.rejected,(i,{error:o})=>({deleting:!1,deleted:!1,error:!0,errorData:io(o)})),r.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:n,deleteTag:t}},JE="shlink/tagEdit",bye={editing:!1,edited:!1,error:!1},CF=bn(`${JE}/tagEdited`),wye=(e,t)=>or(`${JE}/editTag`,async({oldName:n,newName:r,color:i},{getState:o})=>(await e(o).editTag(n,r),t.setColorForKey(r,i),{oldName:n,newName:r,color:i})),xye=e=>Gn({name:JE,initialState:bye,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({editing:!0,edited:!1,error:!1})),t.addCase(e.rejected,(n,{error:r})=>({editing:!1,edited:!1,error:!0,errorData:io(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({...RI(["oldName","newName"],r),editing:!1,edited:!0,error:!1}))}}),eT="shlink/tagsList",Y1={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},cL=(e,t)=>n=>n===e?t:n,uL=(e,t)=>Wd(n=>n===t,e),Sye=(e,t)=>e.reduce((n,[r,i])=>{if(!n[r])return n;const o=n[r];return{...n,[r]:{...o,visitsCount:o.visitsCount+i}}},{...t}),Cye=e=>Object.entries(e.reduce((t,{shortUrl:n})=>(n==null||n.tags.forEach(r=>{t[r]=(t[r]||0)+1}),t),{})),Eye=(e,t=!0)=>or(`${eT}/listTags`,async(n,{getState:r})=>{const{tagsList:i,selectedServer:o}=r();if(!t&&!qn(i.tags))return i;const{listTags:s,tagsStats:a}=e(r),{tags:l,stats:c=[]}=await(TE.tagsStats(o)?a():s()),f=c.reduce((h,{tag:p,shortUrlsCount:m,visitsCount:g})=>(h[p]={shortUrlsCount:m,visitsCount:g},h),{});return{tags:l,stats:f}}),EF=bn(`${eT}/filterTags`),Tye=(e,t)=>Gn({name:eT,initialState:Y1,reducers:{},extraReducers:n=>{n.addCase(EF,(r,{payload:i})=>({...r,filteredTags:r.tags.filter(o=>o.toLowerCase().match(i.toLowerCase()))})),n.addCase(e.pending,r=>({...r,loading:!0,error:!1})),n.addCase(e.rejected,(r,{error:i})=>({...Y1,error:!0,errorData:io(i)})),n.addCase(e.fulfilled,(r,{payload:i})=>({...Y1,stats:i.stats,tags:i.tags,filteredTags:i.tags})),n.addCase(SF,({tags:r,filteredTags:i,...o},{payload:s})=>({...o,tags:uL(r,s),filteredTags:uL(i,s)})),n.addCase(CF,({tags:r,filteredTags:i,stats:o,...s},{payload:a})=>({...s,stats:{...o,[a.newName]:o[a.oldName]},tags:r.map(cL(a.oldName,a.newName)).sort(),filteredTags:i.map(cL(a.oldName,a.newName)).sort()})),n.addCase(uh,(r,{payload:i})=>({...r,stats:Sye(Cye(i.createdVisits),r.stats)})),n.addCase(t.fulfilled,({tags:r,...i},{payload:o})=>({...i,tags:r.concat(o.tags.filter(s=>!r.includes(s)))}))}}),Oye=e=>oa(({filterTags:t,forceListTags:n,tagsList:r,selectedServer:i,settings:o})=>{var h;const[s,a]=H.useState(((h=o.tags)==null?void 0:h.defaultOrdering)??{}),l=It(()=>r.filteredTags.map(p=>{var m,g;return{tag:p,shortUrls:((m=r.stats[p])==null?void 0:m.shortUrlsCount)??0,visits:((g=r.stats[p])==null?void 0:g.visitsCount)??0}}),p=>LI(p,s));if(H.useEffect(()=>{n()},[]),r.loading)return C(Eo,{loading:!0});if(r.error)return C(Dr,{type:"error",children:C(Ao,{errorData:r.errorData,fallbackMessage:"Error loading tags :("})});const c=p=>()=>{const m=o_(p,s.field,s.dir);a({field:m?p:void 0,dir:m})};return U(We,{children:[C(ah,{className:"mb-3",onChange:t}),C(er,{className:"mb-3",children:C("div",{className:"col-lg-6 offset-lg-6",children:C(ph,{items:B8,order:s,onChange:(p,m)=>a({field:p,dir:m})})})}),(()=>{if(r.filteredTags.length<1)return C(Eo,{children:"No tags found"});const p=l();return C(e,{sortedTags:p,selectedServer:i,currentOrder:s,orderByColumn:c})})()]})},()=>[Jr.visits]);const tT=({pagesCount:e,currentPage:t,setCurrentPage:n,centered:r=!0})=>{if(e<2)return null;const i=o=>()=>!Rd(o)&&n(o);return U(x_,{listClassName:ge("flex-wrap mb-0 simple-paginator",{"justify-content-center":r}),children:[C(Rs,{disabled:t<=1,children:C(Ns,{previous:!0,tag:"span",onClick:i(t-1)})}),hF(t,e).map((o,s)=>C(Rs,{disabled:Rd(o),active:t===o,children:C(Ns,{role:"link",tag:"span",onClick:i(o),children:pF(o)})},mF(o,s))),C(Rs,{disabled:t>=e,children:C(Ns,{next:!0,tag:"span",onClick:i(t+1)})})]})};const Pye=20,kye=e=>({sortedTags:t,selectedServer:n,orderByColumn:r,currentOrder:i})=>{const o=H.useRef(!0),{search:s}=Mn(),{page:a=1}=pl(s),[l,c]=Toe("page",Number(a)),f=dd(Pye,t),h=f.length>1,p=f[l-1]??[];return H.useEffect(()=>{!o.current&&c(1),o.current=!1},[t]),H.useEffect(()=>{scrollTo(0,0)},[l]),U(dn,{bodyClassName:h?"pb-1":"",children:[U("table",{className:"table table-hover responsive-table mb-0",children:[U("thead",{className:"responsive-table__header",children:[U("tr",{children:[U("th",{className:"tags-table__header-cell",onClick:r("tag"),children:["Tag ",C(Af,{currentOrder:i,field:"tag"})]}),U("th",{className:"tags-table__header-cell text-lg-end",onClick:r("shortUrls"),children:["Short URLs ",C(Af,{currentOrder:i,field:"shortUrls"})]}),U("th",{className:"tags-table__header-cell text-lg-end",onClick:r("visits"),children:["Visits ",C(Af,{currentOrder:i,field:"visits"})]}),C("th",{"aria-label":"Options",className:"tags-table__header-cell"})]}),C("tr",{children:C("th",{"aria-label":"Separator",colSpan:4,className:"p-0 border-top-0"})})]}),U("tbody",{children:[p.length===0&&C("tr",{children:C("td",{colSpan:4,className:"text-center",children:"No results found"})}),p.map(m=>C(e,{tag:m,selectedServer:n},m.tag))]})]}),h&&C("div",{className:"sticky-card-paginator",children:C(tT,{pagesCount:f.length,currentPage:l,setCurrentPage:c})})]},l)},Mye=(e,t,n)=>({tag:r,selectedServer:i})=>{const[o,s]=jt(),[a,l]=jt(),[c,f]=jt(),h=Yd(i);return U("tr",{className:"responsive-table__row",children:[U("th",{className:"responsive-table__cell","data-th":"Tag",children:[C(xF,{tag:r.tag,colorGenerator:n})," ",r.tag]}),C("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:C(At,{to:`/server/${h}/list-short-urls/1?tags=${encodeURIComponent(r.tag)}`,children:wn(r.shortUrls)})}),C("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:C(At,{to:`/server/${h}/tag/${r.tag}/visits`,children:wn(r.visits)})}),C("td",{className:"responsive-table__cell text-lg-end",children:U(E_,{toggle:f,isOpen:c,children:[U(Ve,{onClick:l,children:[C(Fe,{icon:ZX,fixedWidth:!0,className:"me-1"})," Edit"]}),U(Ve,{onClick:s,children:[C(Fe,{icon:fQ,fixedWidth:!0,className:"me-1"})," Delete"]})]})}),C(t,{tag:r.tag,toggle:l,isOpen:a}),C(e,{tag:r.tag,toggle:s,isOpen:o})]})},Rye=(e,t)=>{e.serviceFactory("TagsSelector",vye,"ColorGenerator"),e.decorator("TagsSelector",t(["tagsList","settings"],["listTags"])),e.serviceFactory("DeleteTagConfirmModal",()=>Fve),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.serviceFactory("EditTagModal",eye,"ColorGenerator"),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.serviceFactory("TagsTableRow",Mye,"DeleteTagConfirmModal","EditTagModal","ColorGenerator"),e.serviceFactory("TagsTable",kye,"TagsTableRow"),e.serviceFactory("TagsList",Oye,"TagsTable"),e.decorator("TagsList",t(["tagsList","selectedServer","mercureInfo","settings"],["forceListTags","filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",xye,"editTag"),e.serviceFactory("tagEditReducer",ct("reducer"),"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",_ye,"buildShlinkApiClient"),e.serviceFactory("tagDeleteReducer",ct("reducer"),"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",Tye,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",ct("reducer"),"tagsListReducerCreator");const n=r=>({buildShlinkApiClient:i})=>Eye(i,r);e.factory("listTags",n(!1)),e.factory("forceListTags",n(!0)),e.serviceFactory("filterTags",()=>EF),e.serviceFactory("deleteTag",ct("deleteTag"),"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>SF),e.serviceFactory("editTag",wye,"buildShlinkApiClient","ColorGenerator"),e.serviceFactory("tagEdited",()=>CF)};var Nye="Expected a function",TF="__lodash_hash_undefined__",OF=1/0,Lye="[object Function]",Dye="[object GeneratorFunction]",Aye="[object Symbol]",Iye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fye=/^\w*$/,$ye=/^\./,jye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bye=/[\\^$.*+?()[\]{}|]/g,zye=/\\(\\)?/g,Uye=/^\[object .+?Constructor\]$/,Vye=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Hye=typeof self=="object"&&self&&self.Object===Object&&self,nT=Vye||Hye||Function("return this")();function Wye(e,t){return e==null?void 0:e[t]}function Yye(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var qye=Array.prototype,Gye=Function.prototype,PF=Object.prototype,q1=nT["__core-js_shared__"],fL=function(){var e=/[^.]+$/.exec(q1&&q1.keys&&q1.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),kF=Gye.toString,rT=PF.hasOwnProperty,MF=PF.toString,Zye=RegExp("^"+kF.call(rT).replace(Bye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dL=nT.Symbol,Kye=qye.splice,Xye=RF(nT,"Map"),Ld=RF(Object,"create"),hL=dL?dL.prototype:void 0,pL=hL?hL.toString:void 0;function cl(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function a_e(e,t){var n=this.__data__,r=D_(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}lu.prototype.clear=r_e;lu.prototype.delete=i_e;lu.prototype.get=o_e;lu.prototype.has=s_e;lu.prototype.set=a_e;function yl(e){var t=-1,n=e?e.length:0;for(this.clear();++tt.toFixed(e.decimals).replace(".",e.separator):t=>`${t}`.replace(".",e.separator):e.decimals?t=>t.toFixed(e.decimals):t=>`${t}`}function sT(e={}){const t=typeof e.quote=="string"?e.quote:'"',n=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;return!t||t===n?r=>r:r=>(r.includes(t)&&(r=r.replace(new RegExp(t,"g"),n)),`${t}${r}${t}`)}function k_e(e={stringFormatter:sT()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function M_e(e={stringFormatter:sT()}){return t=>t===null||(t=JSON.stringify(t),t===void 0)?"":(t[0]==='"'&&(t=t.replace(/^"(.+)"$/,"$1")),e.stringFormatter(t))}function gL(e,t,n){const r=e[t];return r===void 0?n:r}function DF(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function Ox(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}class R_e{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const n=Object.assign({},t);n.fields&&(n.fields=this.preprocessFieldsInfo(n.fields,n.defaultValue)),n.transforms=n.transforms||[];const r=n.formatters&&n.formatters.string||sT(),i=M_e({stringFormatter:r}),o={header:r,undefined:G1,boolean:G1,number:P_e(),bigint:G1,string:r,symbol:k_e({stringFormatter:r}),function:i,object:i};return n.formatters={...o,...n.formatters},n.delimiter=n.delimiter||",",n.eol=n.eol||` `,n.header=n.header!==!1,n.includeEmptyRows=n.includeEmptyRows||!1,n.withBOM=n.withBOM||!1,n}preprocessFieldsInfo(t,n){return t.map(r=>{if(typeof r=="string")return{label:r,value:r.includes(".")||r.includes("[")?i=>mL(i,r,n):i=>gL(i,r,n)};if(typeof r=="object"){const i="default"in r?r.default:n;if(typeof r.value=="string")return{label:r.label||r.value,value:r.value.includes(".")||r.value.includes("[")?o=>mL(o,r.value,i):o=>gL(o,r.value,i)};if(typeof r.value=="function"){const o=r.label||r.value.name||"",s={label:o,default:i};return{label:o,value(a){const l=r.value(a,s);return l??i}}}}throw new Error("Invalid field info option. "+JSON.stringify(r))})}getHeader(){return Ox(this.opts.fields.map(t=>this.opts.formatters.header(t.label)),this.opts.delimiter)}preprocessRow(t){return this.opts.transforms.reduce((n,r)=>n.map(i=>r(i)).reduce(DF,[]),[t])}processRow(t){if(!t)return;const n=this.opts.fields.map(r=>this.processCell(t,r));if(!(!this.opts.includeEmptyRows&&n.every(r=>r==="")))return Ox(n,this.opts.delimiter)}processCell(t,n){return this.processValue(n.value(t))}processValue(t){return this.opts.formatters[typeof t](t)}}class N_e extends R_e{constructor(t){super(t)}parse(t){const n=this.preprocessData(t);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(n.reduce((s,a)=>(Object.keys(a).forEach(l=>{s.includes(l)||s.push(l)}),s),[]));const r=this.opts.header?this.getHeader():"",i=this.processData(n);return(this.opts.withBOM?"\uFEFF":"")+r+(r&&i?this.opts.eol:"")+i}preprocessData(t){const n=Array.isArray(t)?t:[t];if(!this.opts.fields&&(n.length===0||typeof n[0]!="object"))throw new Error('Data should not be empty or the "fields" option should be included');return this.opts.transforms.length===0?n:n.map(r=>this.preprocessRow(r)).reduce(DF,[])}processData(t){return Ox(t.map(n=>this.processRow(n)).filter(n=>n),this.opts.eol)}}var Cn;(function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.FORM_FEED=12]="FORM_FEED",e[e.NEWLINE=10]="NEWLINE",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.TAB=9]="TAB",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.DOLLAR_SIGN=36]="DOLLAR_SIGN",e[e.PERCENT_SIGN=37]="PERCENT_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",e[e.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",e[e.ASTERISK=42]="ASTERISK",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.COMMA=44]="COMMA",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.FULL_STOP=46]="FULL_STOP",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_ZERO=48]="DIGIT_ZERO",e[e.DIGIT_ONE=49]="DIGIT_ONE",e[e.DIGIT_TWO=50]="DIGIT_TWO",e[e.DIGIT_THREE=51]="DIGIT_THREE",e[e.DIGIT_FOUR=52]="DIGIT_FOUR",e[e.DIGIT_FIVE=53]="DIGIT_FIVE",e[e.DIGIT_SIX=54]="DIGIT_SIX",e[e.DIGIT_SEVEN=55]="DIGIT_SEVEN",e[e.DIGIT_EIGHT=56]="DIGIT_EIGHT",e[e.DIGIT_NINE=57]="DIGIT_NINE",e[e.COLON=58]="COLON",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.COMMERCIAL_AT=64]="COMMERCIAL_AT",e[e.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",e[e.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",e[e.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",e[e.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",e[e.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",e[e.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",e[e.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",e[e.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",e[e.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",e[e.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",e[e.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",e[e.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",e[e.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",e[e.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",e[e.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",e[e.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",e[e.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",e[e.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",e[e.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",e[e.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",e[e.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",e[e.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",e[e.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",e[e.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",e[e.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",e[e.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",e[e.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",e[e.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",e[e.LOW_LINE=95]="LOW_LINE",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",e[e.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",e[e.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",e[e.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",e[e.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",e[e.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",e[e.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",e[e.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",e[e.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",e[e.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",e[e.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",e[e.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",e[e.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",e[e.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",e[e.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",e[e.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",e[e.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",e[e.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",e[e.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",e[e.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",e[e.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",e[e.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",e[e.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",e[e.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",e[e.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",e[e.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",e[e.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",e[e.VERTICAL_LINE=124]="VERTICAL_LINE",e[e.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",e[e.TILDE=126]="TILDE"})(Cn||(Cn={}));Cn.QUOTATION_MARK+"",Cn.QUOTATION_MARK,Cn.REVERSE_SOLIDUS+"",Cn.REVERSE_SOLIDUS,Cn.SOLIDUS+"",Cn.SOLIDUS,Cn.LATIN_SMALL_LETTER_B+"",Cn.BACKSPACE,Cn.LATIN_SMALL_LETTER_F+"",Cn.FORM_FEED,Cn.LATIN_SMALL_LETTER_N+"",Cn.NEWLINE,Cn.LATIN_SMALL_LETTER_R+"",Cn.CARRIAGE_RETURN,Cn.LATIN_SMALL_LETTER_T+"",Cn.TAB;var vL;(function(e){e[e.LEFT_BRACE=1]="LEFT_BRACE",e[e.RIGHT_BRACE=2]="RIGHT_BRACE",e[e.LEFT_BRACKET=3]="LEFT_BRACKET",e[e.RIGHT_BRACKET=4]="RIGHT_BRACKET",e[e.COLON=5]="COLON",e[e.COMMA=6]="COMMA",e[e.TRUE=7]="TRUE",e[e.FALSE=8]="FALSE",e[e.NULL=9]="NULL",e[e.STRING=10]="STRING",e[e.NUMBER=11]="NUMBER",e[e.SEPARATOR=12]="SEPARATOR"})(vL||(vL={}));var yL;(function(e){e[e.START=0]="START",e[e.ENDED=1]="ENDED",e[e.ERROR=2]="ERROR",e[e.TRUE1=3]="TRUE1",e[e.TRUE2=4]="TRUE2",e[e.TRUE3=5]="TRUE3",e[e.FALSE1=6]="FALSE1",e[e.FALSE2=7]="FALSE2",e[e.FALSE3=8]="FALSE3",e[e.FALSE4=9]="FALSE4",e[e.NULL1=10]="NULL1",e[e.NULL2=11]="NULL2",e[e.NULL3=12]="NULL3",e[e.STRING_DEFAULT=13]="STRING_DEFAULT",e[e.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",e[e.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",e[e.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",e[e.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",e[e.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",e[e.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",e[e.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",e[e.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",e[e.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",e[e.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",e[e.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",e[e.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",e[e.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",e[e.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",e[e.SEPARATOR=28]="SEPARATOR"})(yL||(yL={}));var _L;(function(e){e[e.VALUE=0]="VALUE",e[e.KEY=1]="KEY",e[e.COLON=2]="COLON",e[e.COMMA=3]="COMMA",e[e.ENDED=4]="ENDED",e[e.ERROR=5]="ERROR",e[e.SEPARATOR=6]="SEPARATOR"})(_L||(_L={}));var bL;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"})(bL||(bL={}));var L_e=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(r,i,o){n.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:o})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,i){if(1&i&&(r=n(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var s in r)n.d(o,s,function(a){return r[a]}.bind(null,s));return o},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=32)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t,n){var r=n(6),i=Object.keys||function(g){var v=[];for(var w in g)v.push(w);return v};e.exports=h;var o=n(5);o.inherits=n(2);var s=n(23),a=n(14);o.inherits(h,s);for(var l=i(a.prototype),c=0;c Shlink — The URL shortener - + diff --git a/feature/tags-stats/service-worker.js b/feature/tags-stats/service-worker.js index 9da9fcce..8ebbf0ef 100644 --- a/feature/tags-stats/service-worker.js +++ b/feature/tags-stats/service-worker.js @@ -1,2 +1,2 @@ try{self["workbox:core:6.5.3"]&&_()}catch{}const z=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},G=z;class h extends Error{constructor(e,t){const n=G(e,t);super(n),this.name=e,this.details=t}}const B=new Set;function Q(s){B.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),J=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{J(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function N(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function X(s,e,t,n){const r=N(e.url,t);if(e.url===r)return s.match(e,n);const a=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,a);for(const c of i){const o=N(c.url,t);if(r===o)return s.match(c,n)}}let m;function Y(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function q(s){s.then(()=>{})}class Z{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function ee(){for(const s of B)await s()}const te=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function se(s){return new Promise(e=>setTimeout(e,s))}function K(s,e){const t=e();return s.waitUntil(t),t}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new h("cross-origin-copy-response",{origin:t});const n=s.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},a=e?e(r):r,i=Y()?n.body:await n.blob();return new Response(i,a)}function re(){self.addEventListener("activate",()=>self.clients.claim())}const ae=(s,e)=>e.some(t=>s instanceof t);let A,O;function ie(){return A||(A=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ce(){return O||(O=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F=new WeakMap,U=new WeakMap,H=new WeakMap,k=new WeakMap,P=new WeakMap;function oe(s){const e=new Promise((t,n)=>{const r=()=>{s.removeEventListener("success",a),s.removeEventListener("error",i)},a=()=>{t(f(s.result)),r()},i=()=>{n(s.error),r()};s.addEventListener("success",a),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&F.set(t,s)}).catch(()=>{}),P.set(e,s),e}function le(s){if(U.has(s))return;const e=new Promise((t,n)=>{const r=()=>{s.removeEventListener("complete",a),s.removeEventListener("error",i),s.removeEventListener("abort",i)},a=()=>{t(),r()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),r()};s.addEventListener("complete",a),s.addEventListener("error",i),s.addEventListener("abort",i)});U.set(s,e)}let T={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return U.get(s);if(e==="objectStoreNames")return s.objectStoreNames||H.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function he(s){T=s(T)}function ue(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(v(this),e,...t);return H.set(n,e.sort?e.sort():[e]),f(n)}:ce().includes(s)?function(...e){return s.apply(v(this),e),f(F.get(this))}:function(...e){return f(s.apply(v(this),e))}}function de(s){return typeof s=="function"?ue(s):(s instanceof IDBTransaction&&le(s),ae(s,ie())?new Proxy(s,T):s)}function f(s){if(s instanceof IDBRequest)return oe(s);if(k.has(s))return k.get(s);const e=de(s);return e!==s&&(k.set(s,e),P.set(e,s)),e}const v=s=>P.get(s);function fe(s,e,{blocked:t,upgrade:n,blocking:r,terminated:a}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{a&&o.addEventListener("close",()=>a()),r&&o.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}function pe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const ge=["get","getKey","getAll","getAllKeys","count"],me=["put","add","delete","clear"],D=new Map;function S(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(D.get(e))return D.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,r=me.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(r||ge.includes(t)))return;const a=async function(i,...c){const o=this.transaction(i,r?"readwrite":"readonly");let l=o.store;return n&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),r&&o.done]))[0]};return D.set(e,a),a}he(s=>({...s,get:(e,t,n)=>S(e,t)||s.get(e,t,n),has:(e,t)=>!!S(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.3"]&&_()}catch{}const ye="workbox-expiration",y="cache-entries",W=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class we{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&pe(this._cacheName)}async setTimestamp(e,t){e=W(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},a=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await a.store.put(n),await a.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let r=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const a=[];let i=0;for(;r;){const o=r.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?a.push(r.value):i++),r=await r.continue()}const c=[];for(const o of a)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+W(e)}async getDb(){return this._db||(this._db=await fe(ye,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class be{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new we(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of t)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,q(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!a)return null;const i=this._isResponseDateFresh(a),c=this._getCacheExpiration(r);q(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?a:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const r=this._getCacheExpiration(t);await r.updateTimestamp(n.url),await r.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&Q(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new h("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new be(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),r=new Date(t).getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:6.5.3"]&&_()}catch{}const Re="__WB_REVISION__";function Ce(s){if(!s)throw new h("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const a=new URL(s,location.href);return{cacheKey:a.href,url:a.href}}const{revision:e,url:t}=s;if(!t)throw new h("add-to-cache-list-unexpected-type",{entry:s});if(!e){const a=new URL(t,location.href);return{cacheKey:a.href,url:a.href}}const n=new URL(t,location.href),r=new URL(t,location.href);return n.searchParams.set(Re,e),{cacheKey:n.href,url:r.href}}class xe{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const r=t.originalRequest.url;n?this.notUpdatedURLs.push(r):this.updatedURLs.push(r)}return n}}}class Ee{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const r=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return r?new Request(r,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:6.5.3"]&&_()}catch{}function R(s){return typeof s=="string"?new Request(s):s}class ke{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Z,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=R(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new h("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const a=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:a,response:i});return i}catch(i){throw r&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:r.clone(),request:a.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=R(e);let n;const{cacheName:r,matchOptions:a}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},a),{cacheName:r});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:r,matchOptions:a,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=R(e);await se(0);const r=await this.getCacheKey(n,"write");if(!t)throw new h("cache-put-with-no-response",{url:te(r.url)});const a=await this._ensureResponseSafeToCache(t);if(!a)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),l=this.hasCallback("cacheDidUpdate"),g=l?await X(o,r.clone(),["__WB_REVISION__"],c):null;try{await o.put(r,l?a.clone():a)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ee(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:a.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(const a of this.iterateCallbacks("cacheKeyWillBeUsed"))r=R(await a({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield a=>{const i=Object.assign(Object.assign({},a),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(t=await r({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,r="params"in e?e.params:void 0,a=new ke(this,{event:t,request:n,params:r}),i=this._getResponse(a,n,t),c=this._awaitComplete(i,a,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let r;try{if(r=await this._handle(t,e),!r||r.type==="error")throw new h("no-response",{url:t.url})}catch(a){if(a instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(r=await i({error:a,event:n,request:t}),r)break}if(!r)throw a}for(const a of e.iterateCallbacks("handlerWillRespond"))r=await a({event:n,request:t,response:r});return r}async _awaitComplete(e,t,n,r){let a,i;try{a=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:r,request:n,response:a}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:n,response:a,error:i}),t.destroy(),i)throw i}}class p extends V{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const r=t.params||{};if(this._fallbackToNetwork){const a=r.integrity,i=e.integrity,c=!i||i===a;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||a:void 0})),a&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new h("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new h("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,r]of this.plugins.entries())r!==p.copyRedirectedCacheableResponsesPlugin&&(r===p.defaultPrecacheCacheabilityPlugin&&(e=n),r.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class ve{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ee({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:r,url:a}=Ce(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==r)throw new h("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:r});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(r)&&this._cacheKeysToIntegrities.get(r)!==n.integrity)throw new h("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(r,n.integrity)}if(this._urlsToCacheKeys.set(a,r),this._urlsToCacheModes.set(a,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return K(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[a,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(a),l=new Request(a,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:l,event:e}))}const{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),r=new Set(this._urlsToCacheKeys.values()),a=[];for(const i of n)r.has(i.url)||(await t.delete(i),a.push(i.url));return{deletedURLs:a}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new h("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const I=()=>(L||(L=new ve),L);try{self["workbox:routing:6.5.3"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class b{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class De extends b{constructor(e,t,n){const r=({url:a})=>{const i=e.exec(a.href);if(i&&!(a.origin!==location.origin&&i.index!==0))return i.slice(1)};super(r,t,n)}}class Le{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(r=>{typeof r=="string"&&(r=[r]);const a=new Request(...r);return this.handleRequest({request:a,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:a,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:n,request:e,event:t,params:a})}catch(u){l=Promise.reject(u)}const g=i&&i.catchHandler;return l instanceof Promise&&(this._catchHandler||g)&&(l=l.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:a})}catch(j){j instanceof Error&&(u=j)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),l}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const a=this._routes.get(n.method)||[];for(const i of a){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:r});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new h("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new h("unregister-route-route-not-registered")}}let w;const Ue=()=>(w||(w=new Le,w.addFetchListener(),w.addCacheListener()),w);function M(s,e,t){let n;if(typeof s=="string"){const a=new URL(s,location.href),i=({url:c})=>c.href===a.href;n=new b(i,e,t)}else if(s instanceof RegExp)n=new De(s,e,t);else if(typeof s=="function")n=new b(s,e,t);else if(s instanceof b)n=s;else throw new h("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Ue().registerRoute(n),n}function Te(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Pe(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const a=new URL(s,location.href);a.hash="",yield a.href;const i=Te(a,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(r){const c=r({url:a});for(const o of c)yield o.href}}class Ie extends b{constructor(e,t){const n=({request:r})=>{const a=e.getURLsToCacheKeys();for(const i of Pe(r.url,t)){const c=a.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Me(s){const e=I(),t=new Ie(e,s);M(t)}function je(s){return I().createHandlerBoundToURL(s)}function Ne(s){I().precache(s)}function Ke(s,e){Ne(s),Me(e)}const Ae={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Oe extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Ae)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let r=await t.cacheMatch(e),a;if(!r)try{r=await n}catch(i){i instanceof Error&&(a=i)}if(!r)throw new h("no-response",{url:e.url,error:a});return r}}const Se="shlink-web-client",We="A React-based progressive web application for shlink",Be="/shlink-web-client/feature/tags-stats",qe="https://github.com/shlinkio/shlink-web-client",Fe="MIT",He={lint:"npm run lint:css && npm run lint:js","lint:css":"stylelint src/*.scss src/**/*.scss","lint:js":"eslint --ext .js,.ts,.tsx src test","lint:fix":"npm run lint:css:fix && npm run lint:js:fix","lint:css:fix":"npm run lint:css -- --fix","lint:js:fix":"npm run lint:js -- --fix",start:"vite serve --host=0.0.0.0",preview:"vite preview --host=0.0.0.0",build:"tsc --noEmit && vite build && node scripts/replace-version.mjs","build:dist":"npm run build && node scripts/create-dist-file.mjs",test:"jest --env=jsdom --colors","test:coverage":"npm run test -- --coverage --coverageReporters=text --coverageReporters=text-summary","test:ci":"npm run test:coverage -- --coverageReporters=clover --ci","test:pretty":"npm run test:coverage -- --coverageReporters=html","test:verbose":"npm run test -- --verbose"},Ve={"@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.0","@fortawesome/fontawesome-free":"^6.3.0","@fortawesome/fontawesome-svg-core":"^6.3.0","@fortawesome/free-brands-svg-icons":"^6.3.0","@fortawesome/free-regular-svg-icons":"^6.3.0","@fortawesome/free-solid-svg-icons":"^6.3.0","@fortawesome/react-fontawesome":"^0.2.0","@json2csv/plainjs":"^6.1.2","@reduxjs/toolkit":"^1.9.1",bootstrap:"^5.2.3",bottlejs:"^2.0.1",bowser:"^2.11.0","chart.js":"^4.1.1",classnames:"^2.3.2","compare-versions":"^5.0.3",csvtojson:"^2.0.10","date-fns":"^2.29.3","event-source-polyfill":"^1.0.31",history:"^5.3.0",leaflet:"^1.9.3",qs:"^6.11.0",ramda:"^0.27.2",react:"^18.2.0","react-chartjs-2":"^5.1.0","react-colorful":"^5.6.1","react-copy-to-clipboard":"^5.1.0","react-datepicker":"^4.8.0","react-dom":"^18.2.0","react-external-link":"^2.0.0","react-leaflet":"^4.2.0","react-redux":"^8.0.5","react-router-dom":"^6.6.1","react-swipeable":"^7.0.0","react-tag-autocomplete":"^6.3.0",reactstrap:"^9.1.5",redux:"^4.2.0","redux-localstorage-simple":"^2.5.1","redux-thunk":"^2.4.2",uuid:"^8.3.2","workbox-core":"^6.5.4","workbox-expiration":"^6.5.4","workbox-precaching":"^6.5.4","workbox-routing":"^6.5.4","workbox-strategies":"^6.5.4"},$e={"@shlinkio/eslint-config-js-coding-standard":"~2.1.0","@shlinkio/stylelint-config-css-coding-standard":"~1.0.1","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^13.4.0","@testing-library/user-event":"^14.4.3","@types/jest":"^29.2.4","@types/json2csv":"^5.0.3","@types/leaflet":"^1.9.0","@types/qs":"^6.9.7","@types/ramda":"^0.28.15","@types/react":"^18.0.26","@types/react-color":"^3.0.6","@types/react-copy-to-clipboard":"^5.0.4","@types/react-datepicker":"^4.8.0","@types/react-dom":"^18.0.10","@types/react-tag-autocomplete":"^6.3.0","@types/uuid":"^8.3.4","@vitejs/plugin-react":"^3.1.0","adm-zip":"^0.5.10","babel-jest":"^29.5.0",chalk:"^5.2.0",eslint:"^8.30.0","identity-obj-proxy":"^3.0.0",jest:"^29.3.1","jest-canvas-mock":"^2.4.0","jest-environment-jsdom":"^29.3.1","resize-observer-polyfill":"^1.5.1",sass:"^1.57.1",stylelint:"^14.16.0","ts-mockery":"^1.2.0",typescript:"^5.0.2",vite:"^4.2.0","vite-plugin-pwa":"^0.14.4"},ze=[">0.2%","not dead","not ie <= 11","not op_mini all"];var Ge={name:Se,description:We,private:!1,homepage:Be,repository:qe,license:Fe,scripts:He,dependencies:Ve,devDependencies:$e,browserslist:ze};re();Ke([{"revision":null,"url":"assets/index-1f7f66ab.css"},{"revision":null,"url":"assets/index-245198b7.js"},{"revision":"3324ab71e72a1d2d30c32403c1e68744","url":"index.html"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"./icons/icon-16x16.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"./icons/icon-24x24.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"./icons/icon-32x32.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"./icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"./icons/icon-48x48.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"./icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"./icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"./icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"./icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"./icons/icon-96x96.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"./icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"./icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"./icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"./icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"./icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"./icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"./icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"./icons/icon-167x167.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"./icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"./icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"./icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"./icons/icon-228x228.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"./icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"./icons/icon-310x310.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"./icons/icon-384x384.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"./icons/icon-512x512.png"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"./icons/icon-1024x1024.png"},{"revision":"88e8afcd290e913307a750afca3a3306","url":"manifest.json"}]);const Qe=new RegExp("/[^/?]+\\.[^/]+$");M(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(Qe)),je(`${Ge.homepage}/index.html`));M(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Oe({cacheName:"images",plugins:[new _e({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return K(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[a,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(a),l=new Request(a,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:l,event:e}))}const{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),r=new Set(this._urlsToCacheKeys.values()),a=[];for(const i of n)r.has(i.url)||(await t.delete(i),a.push(i.url));return{deletedURLs:a}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new h("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const I=()=>(L||(L=new ve),L);try{self["workbox:routing:6.5.3"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class b{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class De extends b{constructor(e,t,n){const r=({url:a})=>{const i=e.exec(a.href);if(i&&!(a.origin!==location.origin&&i.index!==0))return i.slice(1)};super(r,t,n)}}class Le{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(r=>{typeof r=="string"&&(r=[r]);const a=new Request(...r);return this.handleRequest({request:a,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:a,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:n,request:e,event:t,params:a})}catch(u){l=Promise.reject(u)}const g=i&&i.catchHandler;return l instanceof Promise&&(this._catchHandler||g)&&(l=l.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:a})}catch(j){j instanceof Error&&(u=j)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),l}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const a=this._routes.get(n.method)||[];for(const i of a){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:r});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new h("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new h("unregister-route-route-not-registered")}}let w;const Ue=()=>(w||(w=new Le,w.addFetchListener(),w.addCacheListener()),w);function M(s,e,t){let n;if(typeof s=="string"){const a=new URL(s,location.href),i=({url:c})=>c.href===a.href;n=new b(i,e,t)}else if(s instanceof RegExp)n=new De(s,e,t);else if(typeof s=="function")n=new b(s,e,t);else if(s instanceof b)n=s;else throw new h("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Ue().registerRoute(n),n}function Te(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Pe(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:r}={}){const a=new URL(s,location.href);a.hash="",yield a.href;const i=Te(a,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(r){const c=r({url:a});for(const o of c)yield o.href}}class Ie extends b{constructor(e,t){const n=({request:r})=>{const a=e.getURLsToCacheKeys();for(const i of Pe(r.url,t)){const c=a.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Me(s){const e=I(),t=new Ie(e,s);M(t)}function je(s){return I().createHandlerBoundToURL(s)}function Ne(s){I().precache(s)}function Ke(s,e){Ne(s),Me(e)}const Ae={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Oe extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Ae)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let r=await t.cacheMatch(e),a;if(!r)try{r=await n}catch(i){i instanceof Error&&(a=i)}if(!r)throw new h("no-response",{url:e.url,error:a});return r}}const Se="shlink-web-client",We="A React-based progressive web application for shlink",Be="/shlink-web-client/feature/tags-stats",qe="https://github.com/shlinkio/shlink-web-client",Fe="MIT",He={lint:"npm run lint:css && npm run lint:js","lint:css":"stylelint src/*.scss src/**/*.scss","lint:js":"eslint --ext .js,.ts,.tsx src test","lint:fix":"npm run lint:css:fix && npm run lint:js:fix","lint:css:fix":"npm run lint:css -- --fix","lint:js:fix":"npm run lint:js -- --fix",start:"vite serve --host=0.0.0.0",preview:"vite preview --host=0.0.0.0",build:"tsc --noEmit && vite build && node scripts/replace-version.mjs","build:dist":"npm run build && node scripts/create-dist-file.mjs",test:"jest --env=jsdom --colors","test:coverage":"npm run test -- --coverage --coverageReporters=text --coverageReporters=text-summary","test:ci":"npm run test:coverage -- --coverageReporters=clover --ci","test:pretty":"npm run test:coverage -- --coverageReporters=html","test:verbose":"npm run test -- --verbose"},Ve={"@babel/preset-env":"^7.20.2","@babel/preset-react":"^7.18.6","@babel/preset-typescript":"^7.21.0","@fortawesome/fontawesome-free":"^6.3.0","@fortawesome/fontawesome-svg-core":"^6.3.0","@fortawesome/free-brands-svg-icons":"^6.3.0","@fortawesome/free-regular-svg-icons":"^6.3.0","@fortawesome/free-solid-svg-icons":"^6.3.0","@fortawesome/react-fontawesome":"^0.2.0","@json2csv/plainjs":"^6.1.2","@reduxjs/toolkit":"^1.9.1",bootstrap:"^5.2.3",bottlejs:"^2.0.1",bowser:"^2.11.0","chart.js":"^4.1.1",classnames:"^2.3.2","compare-versions":"^5.0.3",csvtojson:"^2.0.10","date-fns":"^2.29.3","event-source-polyfill":"^1.0.31",history:"^5.3.0",leaflet:"^1.9.3",qs:"^6.11.0",ramda:"^0.27.2",react:"^18.2.0","react-chartjs-2":"^5.1.0","react-colorful":"^5.6.1","react-copy-to-clipboard":"^5.1.0","react-datepicker":"^4.8.0","react-dom":"^18.2.0","react-external-link":"^2.0.0","react-leaflet":"^4.2.0","react-redux":"^8.0.5","react-router-dom":"^6.6.1","react-swipeable":"^7.0.0","react-tag-autocomplete":"^6.3.0",reactstrap:"^9.1.5",redux:"^4.2.0","redux-localstorage-simple":"^2.5.1","redux-thunk":"^2.4.2",uuid:"^8.3.2","workbox-core":"^6.5.4","workbox-expiration":"^6.5.4","workbox-precaching":"^6.5.4","workbox-routing":"^6.5.4","workbox-strategies":"^6.5.4"},$e={"@shlinkio/eslint-config-js-coding-standard":"~2.1.0","@shlinkio/stylelint-config-css-coding-standard":"~1.0.1","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^13.4.0","@testing-library/user-event":"^14.4.3","@types/jest":"^29.2.4","@types/json2csv":"^5.0.3","@types/leaflet":"^1.9.0","@types/qs":"^6.9.7","@types/ramda":"^0.28.15","@types/react":"^18.0.26","@types/react-color":"^3.0.6","@types/react-copy-to-clipboard":"^5.0.4","@types/react-datepicker":"^4.8.0","@types/react-dom":"^18.0.10","@types/react-tag-autocomplete":"^6.3.0","@types/uuid":"^8.3.4","@vitejs/plugin-react":"^3.1.0","adm-zip":"^0.5.10","babel-jest":"^29.5.0",chalk:"^5.2.0",eslint:"^8.30.0","identity-obj-proxy":"^3.0.0",jest:"^29.3.1","jest-canvas-mock":"^2.4.0","jest-environment-jsdom":"^29.3.1","resize-observer-polyfill":"^1.5.1",sass:"^1.57.1",stylelint:"^14.16.0","ts-mockery":"^1.2.0",typescript:"^5.0.2",vite:"^4.2.0","vite-plugin-pwa":"^0.14.4"},ze=[">0.2%","not dead","not ie <= 11","not op_mini all"];var Ge={name:Se,description:We,private:!1,homepage:Be,repository:qe,license:Fe,scripts:He,dependencies:Ve,devDependencies:$e,browserslist:ze};re();Ke([{"revision":null,"url":"assets/index-1f7f66ab.css"},{"revision":null,"url":"assets/index-2ae00fee.js"},{"revision":"387b313fdc5a828b9f655b8293d44198","url":"index.html"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"./icons/icon-16x16.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"./icons/icon-24x24.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"./icons/icon-32x32.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"./icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"./icons/icon-48x48.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"./icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"./icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"./icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"./icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"./icons/icon-96x96.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"./icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"./icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"./icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"./icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"./icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"./icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"./icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"./icons/icon-167x167.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"./icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"./icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"./icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"./icons/icon-228x228.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"./icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"./icons/icon-310x310.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"./icons/icon-384x384.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"./icons/icon-512x512.png"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"./icons/icon-1024x1024.png"},{"revision":"88e8afcd290e913307a750afca3a3306","url":"manifest.json"}]);const Qe=new RegExp("/[^/?]+\\.[^/]+$");M(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(Qe)),je(`${Ge.homepage}/index.html`));M(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Oe({cacheName:"images",plugins:[new _e({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()});