diff --git a/feature/react-tag-autocomplete-7/assets/index-0c175eaa.js b/feature/react-tag-autocomplete-7/assets/index-91594840.js similarity index 98% rename from feature/react-tag-autocomplete-7/assets/index-0c175eaa.js rename to feature/react-tag-autocomplete-7/assets/index-91594840.js index 18328461..239a98a6 100644 --- a/feature/react-tag-autocomplete-7/assets/index-0c175eaa.js +++ b/feature/react-tag-autocomplete-7/assets/index-91594840.js @@ -904,7 +904,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `.charCodeAt(0)){if(Fn!==z){Fn===re&&(Bi=vn+1);var _i=Bn.slice(Cu,Bi-1),bi=Bn.slice(Bi+(Bi"u"?typeof window<"u"?window:typeof self<"u"?self:Zl:globalThis)})(px,px.exports);var Hue=px.exports;const Wue=(e,t,n,r)=>{const{mercureHubUrl:i,token:o,loading:a,error:s}=e;if(a||s||!i)return;const l=({data:d})=>n(JSON.parse(d)),c=({status:d})=>d===401&&r(),f=t.map(d=>{const p=new URL(i);p.searchParams.append("topic",d);const g=new Hue.EventSourcePolyfill(p,{headers:{Authorization:`Bearer ${o}`}});return g.onmessage=l,g.onerror=c,g});return()=>f.forEach(d=>d.close())};function ss(e,t){const n=new Set;return r=>{const{createNewVisits:i,loadMercureInfo:o,mercureInfo:a}=r,{interval:s}=a,l=pl();return B.useEffect(()=>{const c=g=>s?n.add(g):i([g]),f=t(r,l),d=Wue(a,f,c,o);if(!s)return d;const p=setInterval(()=>{i([...n]),n.clear()},s*1e3*60);return Mt(()=>clearInterval(p),()=>d==null?void 0:d())},[a]),m.jsx(e,{...r})}}class di{}me(di,"visits","https://shlink.io/new-visit"),me(di,"orphanVisits","https://shlink.io/new-orphan-visit"),me(di,"shortUrlVisits",t=>`https://shlink.io/new-visit/${t}`);const $O="shlink/shortUrlDeletion",U3={shortCode:"",loading:!1,deleted:!1,error:!1},Yue=e=>Mr(`${$O}/deleteShortUrl`,async({shortCode:t,domain:n})=>(await e().deleteShortUrl(t,n),{shortCode:t,domain:n})),yI=jn(`${$O}/shortUrlDeleted`),que=e=>{const{actions:t,reducer:n}=sr({name:$O,initialState:U3,reducers:{resetDeleteShortUrl:()=>U3},extraReducers:i=>{i.addCase(e.pending,o=>({...o,loading:!0,error:!1,deleted:!1})),i.addCase(e.rejected,(o,{error:a})=>({...o,errorData:Jo(a),loading:!1,error:!0,deleted:!1})),i.addCase(e.fulfilled,(o,{payload:a})=>({...o,shortCode:a.shortCode,loading:!1,error:!1,deleted:!0}))}}),{resetDeleteShortUrl:r}=t;return{reducer:n,resetDeleteShortUrl:r}},_I="shlink/shortUrlsList",bI=5,Gue={loading:!0,error:!1},Kue=e=>Mr(`${_I}/listShortUrls`,t=>e().listShortUrls(t??{})),Zue=(e,t,n)=>sr({name:_I,initialState:Gue,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,Mt((i,{payload:o})=>i.shortUrls?Nl(["shortUrls","data"],[o,...i.shortUrls.data.slice(0,bI-1)],i):i,i=>i.shortUrls?Nl(["shortUrls","pagination","totalItems"],i.shortUrls.pagination.totalItems+1,i):i)),r.addCase(t.fulfilled,(i,{payload:o})=>i.shortUrls?Nl(["shortUrls","data"],i.shortUrls.data.map(a=>{const{shortCode:s,domain:l}=o;return Qf(a,s,l)?o:a}),i):i),r.addCase(yI,Mt((i,{payload:o})=>i.shortUrls?Nl(["shortUrls","data"],fh(a=>Qf(a,o.shortCode,o.domain),i.shortUrls.data),i):i,i=>i.shortUrls?Nl(["shortUrls","pagination","totalItems"],i.shortUrls.pagination.totalItems-1,i):i)),r.addCase(Th,(i,{payload:o})=>{var a,s;return Nl(["shortUrls","data"],(s=(a=i.shortUrls)==null?void 0:a.data)==null?void 0:s.map(l=>{var c;return((c=Bq(o.createdVisits.filter(({shortUrl:f})=>f&&Qf(l,f.shortCode,f.domain))))==null?void 0:c.shortUrl)??l}),i)})}}),z3=10,{ceil:Que}=Math,Xue=new Intl.NumberFormat("en-US"),wn=e=>Xue.format(Number(e)),Jue=e=>Que(e/z3)*z3,efe={field:"dateCreated",dir:"DESC"},wI={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:"light"},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:efe}},xI=B.createContext(wI),tfe=xI.Provider,BO=()=>B.useContext(xI)??wI,bl=e=>BO()[e];var nfe={prefix:"far",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192h80v56H48V192zm0 104h80v64H48V296zm128 0h96v64H176V296zm144 0h80v64H320V296zm80-48H320V192h80v56zm0 160v40c0 8.8-7.2 16-16 16H320V408h80zm-128 0v56H176V408h96zm-144 0v56H64c-8.8 0-16-7.2-16-16V408h80zM272 248H176V192h96v56z"]},rfe=nfe,ife={prefix:"far",iconName:"circle-right",icon:[512,512,[61838,"arrow-alt-circle-right"],"f35a","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 135.1c-4.2-4.5-10.1-7.1-16.3-7.1C266 128 256 138 256 150.3V208H160c-17.7 0-32 14.3-32 32v32c0 17.7 14.3 32 32 32h96v57.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.3-7.1l99.9-107.1c3.5-3.8 5.5-8.7 5.5-13.8s-2-10.1-5.5-13.8L294.6 135.1z"]},ofe=ife,afe={prefix:"far",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},SI={prefix:"far",iconName:"clone",icon:[512,512,[],"f24d","M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z"]};const sfe=e=>({tag:Ft,to:e}),mx=({children:e,title:t,link:n,tooltip:r})=>{const i=gl();return m.jsxs(m.Fragment,{children:[m.jsxs(Yr,{innerRef:i,className:"highlight-card",body:!0,...sfe(n),children:[m.jsx(Ie,{size:"3x",className:"highlight-card__link-icon",icon:ofe}),m.jsx($4,{tag:"h5",className:"highlight-card__title",children:t}),m.jsx(F4,{tag:"h2",children:e})]}),r&&m.jsx(jr,{target:i,placement:"bottom",children:r})]})},V3=({loading:e,excludeBots:t,visitsSummary:n,...r})=>m.jsx(mx,{tooltip:n.bots!==void 0?m.jsxs(m.Fragment,{children:[t?"Plus":"Including"," ",m.jsx("strong",{children:wn(n.bots)})," potential bot visits"]}):void 0,...r,children:e?"Loading...":wn(t&&n.nonBots?n.nonBots:n.total)}),lfe=(e,t)=>ss(({shortUrlsList:n,listShortUrls:r,listTags:i,tagsList:o,loadVisitsOverview:a,visitsOverview:s})=>{const{loading:l,shortUrls:c}=n,{loading:f}=o,{loading:d,nonOrphanVisits:p,orphanVisits:g}=s,v=yl(),y=uo(),x=bl("visits");return B.useEffect(()=>{r({itemsPerPage:bI,orderBy:{field:"dateCreated",dir:"DESC"}}),i(),a()},[]),m.jsxs(m.Fragment,{children:[m.jsxs(mr,{children:[m.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:m.jsx(V3,{title:"Visits",link:`${v}/non-orphan-visits`,excludeBots:(x==null?void 0:x.excludeBots)??!1,loading:d,visitsSummary:p})}),m.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:m.jsx(V3,{title:"Orphan visits",link:`${v}/orphan-visits`,excludeBots:(x==null?void 0:x.excludeBots)??!1,loading:d,visitsSummary:g})}),m.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:m.jsx(mx,{title:"Short URLs",link:`${v}/list-short-urls/1`,children:l?"Loading...":wn((c==null?void 0:c.pagination.totalItems)??0)})}),m.jsx("div",{className:"col-lg-6 col-xl-3 mb-3",children:m.jsx(mx,{title:"Tags",link:`${v}/manage-tags`,children:f?"Loading...":wn(o.tags.length)})})]}),m.jsxs(Yr,{className:"mb-3",children:[m.jsxs(Kc,{children:[m.jsx("span",{className:"d-sm-none",children:"Create a short URL"}),m.jsx("h5",{className:"d-none d-sm-inline",children:"Create a short URL"}),m.jsx(Ft,{className:"float-end",to:`${v}/create-short-url`,children:"Advanced options »"})]}),m.jsx(Gc,{children:m.jsx(t,{basicMode:!0})})]}),m.jsxs(Yr,{children:[m.jsxs(Kc,{children:[m.jsx("span",{className:"d-sm-none",children:"Recently created URLs"}),m.jsx("h5",{className:"d-none d-sm-inline",children:"Recently created URLs"}),m.jsx(Ft,{className:"float-end",to:`${v}/list-short-urls/1`,children:"See all »"})]}),m.jsx(Gc,{children:m.jsx(e,{shortUrlsList:n,className:"mb-0",onTagClick:b=>y(`${v}/list-short-urls/1?tags=${encodeURIComponent(b)}`)})})]})]})},()=>[di.visits,di.orphanVisits]);function cfe(e,t){e.serviceFactory("Overview",lfe,"ShortUrlsTable","CreateShortUrl"),e.decorator("Overview",t(["shortUrlsList","tagsList","mercureInfo","visitsOverview"],["listShortUrls","listTags","createNewVisits","loadMercureInfo","loadVisitsOverview"]))}const ufe=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}),ffe=(e,t)=>({createShortUrl:n,shortUrlCreation:r,resetCreateShortUrl:i,basicMode:o=!1})=>{const a=bl("shortUrlCreation"),s=B.useMemo(()=>ufe(a),[a]);return m.jsxs(m.Fragment,{children:[m.jsx(e,{initialState:s,saving:r.saving,mode:o?"create-basic":"create",onSave:async l=>(i(),n(l))}),m.jsx(t,{creation:r,resetCreateShortUrl:i,canBeClosed:o})]})},dfe="Left",hfe="Right",pfe="Up",mfe="Down",pc={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},gx={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},H3="mousemove",W3="mouseup",gfe="touchend",vfe="touchmove",yfe="touchstart";function _fe(e,t,n,r){return e>t?n>0?hfe:dfe:r>0?mfe:pfe}function Y3(e,t){if(t===0)return e;const n=Math.PI/180*t,r=e[0]*Math.cos(n)+e[1]*Math.sin(n),i=e[1]*Math.cos(n)-e[0]*Math.sin(n);return[r,i]}function bfe(e,t){const n=f=>{const d="touches"in f;d&&f.touches.length>1||e((p,g)=>{g.trackMouse&&!d&&(document.addEventListener(H3,r),document.addEventListener(W3,a));const{clientX:v,clientY:y}=d?f.touches[0]:f,x=Y3([v,y],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:f}),Object.assign(Object.assign(Object.assign({},p),gx),{initial:x.slice(),xy:x,start:f.timeStamp||0})})},r=f=>{e((d,p)=>{const g="touches"in f;if(g&&f.touches.length>1)return d;if(f.timeStamp-d.start>p.swipeDuration)return d.swiping?Object.assign(Object.assign({},d),{swiping:!1}):d;const{clientX:v,clientY:y}=g?f.touches[0]:f,[x,b]=Y3([v,y],p.rotationAngle),w=x-d.xy[0],S=b-d.xy[1],C=Math.abs(w),k=Math.abs(S),P=(f.timeStamp||0)-d.start,j=Math.sqrt(C*C+k*k)/(P||1),N=[w/(P||1),S/(P||1)],H=_fe(C,k,w,S),R=typeof p.delta=="number"?p.delta:p.delta[H.toLowerCase()]||pc.delta;if(C{e((d,p)=>{let g;if(d.swiping&&d.eventData){if(f.timeStamp-d.start{document.removeEventListener(H3,r),document.removeEventListener(W3,a)},a=f=>{o(),i(f)},s=(f,d)=>{let p=()=>{};if(f&&f.addEventListener){const g=Object.assign(Object.assign({},pc.touchEventOptions),d.touchEventOptions),v=[[yfe,n,g],[vfe,r,Object.assign(Object.assign({},g),d.preventScrollOnSwipe?{passive:!1}:{})],[gfe,i,g]];v.forEach(([y,x,b])=>f.addEventListener(y,x,b)),p=()=>v.forEach(([y,x])=>f.removeEventListener(y,x))}return p},c={ref:f=>{f!==null&&e((d,p)=>{if(d.el===f)return d;const g={};return d.el&&d.el!==f&&d.cleanUpTouch&&(d.cleanUpTouch(),g.cleanUpTouch=void 0),p.trackTouch&&f&&(g.cleanUpTouch=s(f,p)),Object.assign(Object.assign(Object.assign({},d),{el:f}),g)})}};return t.trackMouse&&(c.onMouseDown=n),[c,s]}function wfe(e,t,n,r){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==n.preventScrollOnSwipe||t.touchEventOptions.passive!==n.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:r(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:r(e.el,t)})}function xfe(e){const{trackMouse:t}=e,n=B.useRef(Object.assign({},gx)),r=B.useRef(Object.assign({},pc)),i=B.useRef(Object.assign({},r.current));i.current=Object.assign({},r.current),r.current=Object.assign(Object.assign({},pc),e);let o;for(o in pc)r.current[o]===void 0&&(r.current[o]=pc[o]);const[a,s]=B.useMemo(()=>bfe(l=>n.current=l(n.current,r.current),{trackMouse:t}),[t]);return n.current=wfe(n.current,r.current,i.current,s),a}const Sfe=2e3,Ofe=(e,t)=>(n=!1,r=Sfe)=>{const[i,o]=B.useState(n),a=B.useRef(void 0);return[i,()=>{o(!n),a.current&&t(a.current),a.current=e(()=>o(n),r)}]},Cfe=(e,t)=>{const n=r=>i=>{i.event.composedPath().some(({classList:a})=>a==null?void 0:a.contains("visits-table"))||document.querySelector(".modal")||r()};return xfe({delta:40,onSwipedLeft:n(t),onSwipedRight:n(e)})},Efe=(e,t)=>{const[n,r]=B.useState(t);return[n,o=>{const{location:a,history:s}=window,l=vl(a.search);l[e]=o,s.pushState(null,"",`${a.pathname}?${Ch(l)}`),r(o)}]},kfe=(e,t)=>{const n=B.useRef(!0);B.useEffect(()=>{!n.current&&e(),n.current=!1},t)},xu=()=>{const e=uo();return()=>e(-1)},Pfe=e=>({shortUrlDetail:t,getShortUrlDetail:n,shortUrlEdition:r,editShortUrl:i})=>{const{search:o}=gn(),a=pl(),s=xu(),{loading:l,error:c,errorData:f,shortUrl:d}=t,{saving:p,saved:g,error:v,errorData:y}=r,{domain:x}=vl(o),b=bl("shortUrlCreation"),w=B.useMemo(()=>Cse(d,b),[d,b]);return B.useEffect(()=>{a.shortCode&&n({shortCode:$m(a.shortCode),domain:x})},[]),l?m.jsx(Do,{loading:!0}):c?m.jsx(zr,{type:"error",children:m.jsx(zo,{errorData:f,fallbackMessage:"An error occurred while loading short URL detail :("})}):m.jsxs(m.Fragment,{children:[m.jsx("header",{className:"mb-3",children:m.jsx(Yr,{body:!0,children:m.jsxs("h2",{className:"d-sm-flex justify-content-between align-items-center mb-0",children:[m.jsx(yt,{color:"link",size:"lg",className:"p-0 me-3",onClick:s,children:m.jsx(Ie,{icon:OA})}),m.jsx("span",{className:"text-center",children:m.jsxs("small",{children:["Edit ",m.jsx(Ni,{href:(d==null?void 0:d.shortUrl)??""})]})}),m.jsx("span",{})]})})}),m.jsx(e,{initialState:w,saving:p,mode:"edit",onSave:async S=>{d&&i({...d,data:S})}}),g&&v&&m.jsx(zr,{type:"error",className:"mt-3",children:m.jsx(zo,{errorData:y,fallbackMessage:"An error occurred while updating short URL :("})}),g&&!v&&m.jsx(zr,{type:"success",className:"mt-3",children:"Short URL properly edited."})]})};var Fy={},Tfe=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 d=q3[t.format]||q3.default;window.clipboardData.setData(d,e)}else f.clipboardData.clearData(),f.clipboardData.setData(t.format,e);t.onCopy&&(f.preventDefault(),t.onCopy(f.clipboardData))}),document.body.appendChild(s),o.selectNodeContents(s),a.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(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=Dfe("message"in t?t.message:jfe),window.prompt(r,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(o):a.removeAllRanges()),s&&document.body.removeChild(s),i()}return l}var Rfe=Lfe;function vx(e){"@babel/helpers - typeof";return vx=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},vx(e)}Object.defineProperty(Fy,"__esModule",{value:!0});Fy.CopyToClipboard=void 0;var em=OI(B),Nfe=OI(Rfe),Afe=["text","onCopy","options","children"];function OI(e){return e&&e.__esModule?e:{default:e}}function G3(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 K3(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ffe(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 $fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z3(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 xv(e){return xv=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},xv(e)}function UO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EI=function(e){Ufe(n,e);var t=zfe(n);function n(){var r;$fe(this,n);for(var i=arguments.length,o=new Array(i),a=0;a({creation:t,resetCreateShortUrl:n,canBeClosed:r=!1})=>{const[i,o]=e(),{error:a,saved:s}=t;if(B.useEffect(()=>{n()},[]),a)return m.jsxs(zr,{type:"error",className:"mt-3",children:[r&&m.jsx(Ie,{icon:x1,className:"float-end pointer",onClick:n}),m.jsx(zo,{errorData:t.errorData,fallbackMessage:"An error occurred while creating the URL :("})]});if(!s)return null;const{shortUrl:l}=t.result;return m.jsxs(zr,{type:"success",className:"mt-3",children:[r&&m.jsx(Ie,{icon:x1,className:"float-end pointer",onClick:n}),m.jsxs("span",{children:[m.jsx("b",{children:"Great!"})," The short URL is ",m.jsx("b",{children:l})]}),m.jsx(kI,{text:l,onCopy:o,children:m.jsxs("button",{className:"btn btn-light btn-sm create-short-url-result__copy-btn",id:"copyBtn",type:"button",children:[m.jsx(Ie,{icon:SI})," Copy"]})}),m.jsx(bh,{placement:"left",isOpen:i,target:"copyBtn",children:"Copied!"})]})},H_="delete",Gfe=({shortUrl:e,toggle:t,isOpen:n,shortUrlDeletion:r,resetDeleteShortUrl:i,deleteShortUrl:o,shortUrlDeleted:a})=>{const[s,l]=B.useState("");B.useEffect(()=>i,[]);const{loading:c,error:f,deleted:d,errorData:p}=r,g=Mt(i,t),v=Iy(()=>o(e).then(t));return m.jsx(Zo,{isOpen:n,toggle:g,centered:!0,onClosed:()=>d&&a(e),children:m.jsxs("form",{onSubmit:v,children:[m.jsx(Qo,{toggle:g,children:m.jsx("span",{className:"text-danger",children:"Delete short URL"})}),m.jsxs(fo,{children:[m.jsxs("p",{children:[m.jsx("b",{className:"text-danger",children:"Caution!"})," You are about to delete a short URL."]}),m.jsx("p",{children:"This action cannot be undone. Once you have deleted it, all the visits stats will be lost."}),m.jsxs("p",{children:["Write ",m.jsx("b",{children:H_})," to confirm deletion."]}),m.jsx("input",{type:"text",className:"form-control",placeholder:`Insert ${H_}`,value:s,onChange:y=>l(y.target.value)}),f&&m.jsx(zr,{type:hse(p)?"warning":"error",small:!0,className:"mt-2",children:m.jsx(zo,{errorData:p,fallbackMessage:"Something went wrong while deleting the URL :("})})]}),m.jsxs(ml,{children:[m.jsx("button",{type:"button",className:"btn btn-link",onClick:g,children:"Cancel"}),m.jsx("button",{type:"submit",className:"btn btn-danger",disabled:s!==H_||c,children:c?"Deleting...":"Delete"})]})]})})},PI=({amount:e=0,loading:t=!1,...n})=>m.jsxs(yt,{...n,outline:!0,color:"primary",disabled:t,children:[m.jsx(Ie,{icon:TG})," ",t?"Exporting...":m.jsxs(m.Fragment,{children:["Export (",wn(e),")"]})]}),$y=()=>{const e=uo(),{search:t}=gn(),n=yl(),r=B.useMemo(Mt(()=>vl(t),({orderBy:o,tags:a,excludeBots:s,excludeMaxVisitsReached:l,excludePastValidUntil:c,...f})=>{const d=o?sie(o):void 0,p=(a==null?void 0:a.split(","))??[];return{...f,orderBy:d,tags:p,excludeBots:s!==void 0?s==="true":void 0,excludeMaxVisitsReached:l!==void 0?l==="true":void 0,excludePastValidUntil:c!==void 0?c==="true":void 0}}),[t]),i=B.useCallback(o=>{const a={...r,...o},{orderBy:s,tags:l,excludeBots:c,excludeMaxVisitsReached:f,excludePastValidUntil:d,...p}=a,g={...p,orderBy:s&&i6(s),tags:l.length>0?l.join(","):void 0,excludeBots:U_(c),excludeMaxVisitsReached:U_(f),excludePastValidUntil:U_(d)},v=Ch(g),y=Kn(v)?"":`?${v}`;e(`${n}/list-short-urls/1${y}`)},[r,e,n]);return[r,i]},Q3=20,Kfe=(e,{exportShortUrls:t})=>({amount:n=0})=>{const[{tags:r,search:i,startDate:o,endDate:a,orderBy:s,tagsMode:l}]=$y(),[c,,f,d]=mn(),p=B.useCallback(async()=>{const g=n/Q3,v=async(x=1)=>{const{data:b}=await e().listShortUrls({page:`${x}`,tags:r,searchTerm:i,startDate:o,endDate:a,orderBy:s,tagsMode:l,itemsPerPage:Q3});return x>=g?b:b.concat(await v(x+1))};f();const y=await v();t(y.map(x=>{var C;const{hostname:b,pathname:w}=new URL(x.shortUrl),S=w.substring(1);return{createdAt:x.dateCreated,domain:b,shortCode:S,shortUrl:x.shortUrl,longUrl:x.longUrl,title:x.title??"",tags:x.tags.join("|"),visits:((C=x==null?void 0:x.visitsSummary)==null?void 0:C.total)??x.visitsCount}})),d()},[]);return m.jsx(PI,{loading:c,className:"btn-md-block",amount:n,onClick:p})};const TI=({text:e,onCopy:t})=>m.jsx(kI,{text:e,onCopy:t,children:m.jsx(Ie,{icon:SI,className:"ms-2 copy-to-clipboard-icon"})}),Zfe=(e,{margin:t,...n})=>{const r=`${e}/qr-code`,i=Ch({...n,margin:t>0?t:void 0});return`${r}${Kn(i)?"":`?${i}`}`},Qfe=({errorCorrection:e,setErrorCorrection:t})=>m.jsxs(Xo,{text:`Error correction (${e})`,children:[m.jsxs(Ue,{active:e==="L",onClick:()=>t("L"),children:[m.jsx("b",{children:"L"}),"ow"]}),m.jsxs(Ue,{active:e==="M",onClick:()=>t("M"),children:[m.jsx("b",{children:"M"}),"edium"]}),m.jsxs(Ue,{active:e==="Q",onClick:()=>t("Q"),children:[m.jsx("b",{children:"Q"}),"uartile"]}),m.jsxs(Ue,{active:e==="H",onClick:()=>t("H"),children:[m.jsx("b",{children:"H"}),"igh"]})]}),Xfe=({format:e,setFormat:t})=>m.jsxs(Xo,{text:`Format (${e})`,children:[m.jsx(Ue,{active:e==="png",onClick:()=>t("png"),children:"PNG"}),m.jsx(Ue,{active:e==="svg",onClick:()=>t("svg"),children:"SVG"})]});const Jfe=e=>({shortUrl:{shortUrl:t,shortCode:n},toggle:r,isOpen:i})=>{const[o,a]=B.useState(300),[s,l]=B.useState(0),[c,f]=B.useState("png"),[d,p]=B.useState("L"),g=B.useMemo(()=>Zfe(t,{size:o,format:c,margin:s,errorCorrection:d}),[t,o,c,s,d]),v=B.useMemo(()=>o+s,[o,s]),y=B.useMemo(()=>{if(!(v<500))return v<800?"lg":"xl"},[v]);return m.jsxs(Zo,{isOpen:i,toggle:r,centered:!0,size:y,children:[m.jsxs(Qo,{toggle:r,children:["QR code for ",m.jsx(Ni,{href:t,children:t})]}),m.jsxs(fo,{children:[m.jsxs(mr,{children:[m.jsxs(Fr,{className:"d-grid col-md-6",children:[m.jsxs("label",{children:["Size: ",o,"px"]}),m.jsx("input",{type:"range",className:"form-control-range",value:o,step:10,min:50,max:1e3,onChange:x=>a(Number(x.target.value))})]}),m.jsxs(Fr,{className:"d-grid col-md-6",children:[m.jsxs("label",{htmlFor:"marginControl",children:["Margin: ",s,"px"]}),m.jsx("input",{id:"marginControl",type:"range",className:"form-control-range",value:s,step:1,min:0,max:100,onChange:x=>l(Number(x.target.value))})]}),m.jsx(Fr,{className:"d-grid col-md-6",children:m.jsx(Xfe,{format:c,setFormat:f})}),m.jsx(Fr,{className:"col-md-6",children:m.jsx(Qfe,{errorCorrection:d,setErrorCorrection:p})})]}),m.jsxs("div",{className:"text-center",children:[m.jsxs("div",{className:"mb-3",children:[m.jsx(Ni,{href:g}),m.jsx(TI,{text:g})]}),m.jsx("img",{src:g,className:"qr-code-modal__img",alt:"QR code"}),m.jsx("div",{className:"mt-3",children:m.jsxs(yt,{block:!0,color:"primary",onClick:()=>{e.saveImage(g,`${n}-qr-code.${c}`).catch(()=>{})},children:["Download ",m.jsx(Ie,{icon:CA,className:"ms-1"})]})})]})]})]})},Sv=({date:e,format:t=NO,relative:n=!1})=>{const r=AO(e)?e:Vo(e);return m.jsx("time",{dateTime:`${rce(r)}000`,children:n?`${Qle(Qa(),r)} ago`:ou(r,t)})},ede=e=>{const{meta:t,visitsCount:n,visitsSummary:r}=e,{maxVisits:i,validSince:o,validUntil:a}=t,s=(r==null?void 0:r.total)??n;return i&&s>=i?{icon:bK,className:"text-danger",description:m.jsxs(m.Fragment,{children:["This short URL cannot be currently visited because it has reached the maximum amount of ",m.jsx("b",{children:i})," visit",i>1?"s":"","."]})}:a&&li(ji(a),Qa())?{icon:vT,className:"text-danger",description:m.jsxs(m.Fragment,{children:["This short URL cannot be visited since ",m.jsx("b",{className:"indivisible",children:bv(ji(a))}),"."]})}:o&&li(Qa(),ji(o))?{icon:vT,className:"text-warning",description:m.jsxs(m.Fragment,{children:["This short URL will start working on ",m.jsx("b",{className:"indivisible",children:bv(ji(o))}),"."]})}:{icon:Ld,className:"text-primary",description:"This short URL can be visited normally."}},tde=({shortUrl:e})=>{const t=gl(),{icon:n,className:r,description:i}=ede(e);return m.jsxs(m.Fragment,{children:[m.jsx("span",{style:{cursor:i?"help":void 0},ref:t,children:m.jsx(Ie,{icon:n,className:r})}),m.jsx(jr,{target:t,placement:"bottom",children:i})]})},nde=(e,{shortCode:t,domain:n},r)=>{const i=n?`?domain=${n}`:"";return`${e}/short-code/${Ese(t)}/${r}${i}`},bx=({shortUrl:e,suffix:t,asLink:n,children:r,...i})=>{const o=yl();return!n||!e?m.jsx("span",{...i,children:r}):m.jsx(Ft,{to:nde(o,e,t),...i,children:r})};const MI=({visitsCount:e,shortUrl:t,active:n=!1,asLink:r=!1})=>{const{maxVisits:i,validSince:o,validUntil:a}=(t==null?void 0:t.meta)??{},s=!!i||!!o||!!a,l=m.jsx(bx,{shortUrl:t,suffix:"visits",asLink:r,children:m.jsx("strong",{className:Ee("short-url-visits-count__amount",{"short-url-visits-count__amount--big":n}),children:wn(e)})});if(!s)return l;const c=gl();return m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"indivisible",children:[l,m.jsxs("small",{className:"short-urls-visits-count__max-visits-control",ref:c,children:[i&&m.jsxs(m.Fragment,{children:[" / ",wn(i)]}),m.jsx("sup",{className:"ms-1",children:m.jsx(Ie,{icon:kS})})]})]}),m.jsx(jr,{target:c,placement:"bottom",children:m.jsxs("ul",{className:"list-unstyled mb-0",children:[i&&m.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept more than ",m.jsx("b",{children:wn(i)})," visit",i===1?"":"s","."]}),o&&m.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits before ",m.jsx("b",{className:"indivisible",children:bv(ji(o))}),"."]}),a&&m.jsxs("li",{className:"short-url-visits-count__tooltip-list-item",children:["This short URL will not accept visits after ",m.jsx("b",{className:"indivisible",children:bv(ji(a))}),"."]})]})})]})};const zO=({text:e,children:t,clearable:n,className:r="",colorGenerator:i,onClick:o,onClose:a})=>m.jsxs("span",{className:Ee("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&&m.jsx("span",{"aria-label":`Remove ${e}`,className:"close tag__close-selected-tag",onClick:a,children:"×"})]}),rde=({tags:e,onTagClick:t,colorGenerator:n})=>Kn(e)?m.jsx("i",{className:"indivisible",children:m.jsx("small",{children:"No tags"})}):m.jsx(m.Fragment,{children:e.map(r=>m.jsx(zO,{text:r,colorGenerator:n,onClick:()=>t==null?void 0:t(r)},r))});const ide=(e,t,n)=>({shortUrl:r,onTagClick:i})=>{var g,v,y,x;const[o,a]=n(),[s,l]=n(!1,500),c=B.useRef(!0),[{excludeBots:f}]=$y(),d=bl("visits"),p=f??(d==null?void 0:d.excludeBots);return B.useEffect(()=>{!c.current&&l(),c.current=!1},[(g=r.visitsSummary)==null?void 0:g.total,(v=r.visitsSummary)==null?void 0:v.nonBots,r.visitsCount]),m.jsxs("tr",{className:"responsive-table__row",children:[m.jsx("td",{className:"indivisible short-urls-row__cell responsive-table__cell","data-th":"Created at",children:m.jsx(Sv,{date:r.dateCreated})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Short URL",children:m.jsxs("span",{className:"position-relative short-urls-row__cell--indivisible",children:[m.jsx("span",{className:"short-urls-row__short-url-wrapper",children:m.jsx(Ni,{href:r.shortUrl})}),m.jsx(TI,{text:r.shortUrl,onCopy:a}),m.jsx("span",{className:"badge bg-warning text-black short-urls-row__copy-hint",hidden:!o,children:"Copied short URL!"})]})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell short-urls-row__cell--break","data-th":`${r.title?"Title":"Long URL"}`,children:m.jsx(Ni,{href:r.longUrl,children:r.title??r.longUrl})}),r.title&&m.jsx("td",{className:"short-urls-row__cell responsive-table__cell short-urls-row__cell--break d-lg-none","data-th":"Long URL",children:m.jsx(Ni,{href:r.longUrl})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Tags",children:m.jsx(rde,{tags:r.tags,colorGenerator:t,onTagClick:i})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-lg-end","data-th":"Visits",children:m.jsx(MI,{visitsCount:(p?(y=r.visitsSummary)==null?void 0:y.nonBots:(x=r.visitsSummary)==null?void 0:x.total)??r.visitsCount,shortUrl:r,active:s,asLink:!0})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell","data-th":"Status",children:m.jsx(tde,{shortUrl:r})}),m.jsx("td",{className:"responsive-table__cell short-urls-row__cell text-end",children:m.jsx(e,{shortUrl:r})})]})},ode=(e,t)=>({shortUrl:n})=>{const[r,,i,o]=mn(),[a,,s,l]=mn();return m.jsxs(Dy,{minWidth:190,children:[m.jsxs(Ue,{tag:bx,shortUrl:n,suffix:"visits",asLink:!0,children:[m.jsx(Ie,{icon:ES,fixedWidth:!0})," Visit stats"]}),m.jsxs(Ue,{tag:bx,shortUrl:n,suffix:"edit",asLink:!0,children:[m.jsx(Ie,{icon:CS,fixedWidth:!0})," Edit short URL"]}),m.jsxs(Ue,{onClick:i,children:[m.jsx(Ie,{icon:yK,fixedWidth:!0})," QR code"]}),m.jsx(t,{shortUrl:n,isOpen:r,toggle:o}),m.jsx(Ue,{divider:!0}),m.jsxs(Ue,{className:"dropdown-item--danger",onClick:s,children:[m.jsx(Ie,{icon:OS,fixedWidth:!0})," Delete short URL"]}),m.jsx(e,{shortUrl:n,isOpen:a,toggle:l})]})},jI="shlink/shortUrlCreation",X3={saving:!1,saved:!1,error:!1},ade=e=>Mr(`${jI}/createShortUrl`,t=>e().createShortUrl(t)),sde=e=>{const{reducer:t,actions:n}=sr({name:jI,initialState:X3,reducers:{resetCreateShortUrl:()=>X3},extraReducers:i=>{i.addCase(e.pending,()=>({saving:!0,saved:!1,error:!1})),i.addCase(e.rejected,(o,{error:a})=>({saving:!1,saved:!1,error:!0,errorData:Jo(a)})),i.addCase(e.fulfilled,(o,{payload:a})=>({result:a,saving:!1,saved:!0,error:!1}))}}),{resetCreateShortUrl:r}=n;return{reducer:t,resetCreateShortUrl:r}},J3="shlink/shortUrlDetail",ej={loading:!1,error:!1},lde=e=>{const t=Mr(`${J3}/getShortUrlDetail`,async({shortCode:r,domain:i},{getState:o})=>{var l;const{shortUrlsList:a}=o();return((l=a==null?void 0:a.shortUrls)==null?void 0:l.data.find(c=>Qf(c,r,i)))??await e().getShortUrl(r,i)}),{reducer:n}=sr({name:J3,initialState:ej,reducers:{},extraReducers:r=>{r.addCase(t.pending,()=>({loading:!0,error:!1})),r.addCase(t.rejected,(i,{error:o})=>({loading:!1,error:!0,errorData:Jo(o)})),r.addCase(t.fulfilled,(i,{payload:o})=>({...ej,shortUrl:o}))}});return{reducer:n,getShortUrlDetail:t}},DI="shlink/shortUrlEdition",cde={saving:!1,saved:!1,error:!1},ude=e=>Mr(`${DI}/editShortUrl`,({shortCode:t,domain:n,data:r})=>e().updateShortUrl(t,n,r)),fde=e=>sr({name:DI,initialState:cde,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:Jo(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({shortUrl:r,saving:!1,error:!1,saved:!0}))}});var dde={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"]},hde={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 pde=({icon:e,className:t,...n})=>{const r=gl(),i=Ee("icon-input-container__input",t);return m.jsxs("div",{className:"icon-input-container",children:[m.jsx(Zc,{className:i,innerRef:r,...n}),m.jsx(Ie,{icon:e,fixedWidth:!0,className:"icon-input-container__icon",onClick:()=>{var o;return(o=r.current)==null?void 0:o.focus()}})]})};function mde(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wx(e,t)}function wx(e,t){return wx=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},wx(e,t)}function gde(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 tj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vde(e,t,n){return e===t?!0:e.correspondingElement?e.correspondingElement.classList.contains(n):e.classList.contains(n)}function yde(e,t,n){if(e===t)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&vde(e,t,n))return!0;e=e.parentNode||e.host}return e}function _de(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var bde=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 wde(e){return e===void 0&&(e=0),function(){return++e}}var xde=wde(),xx,tm={},W_={},Sde=["touchstart","touchmove"],Ode="ignore-react-onclickoutside";function nj(e,t){var n={},r=Sde.indexOf(t)!==-1;return r&&xx&&(n.passive=!e.props.preventDefault),n}function By(e,t){var n,r,i=e.displayName||e.name||"Component";return r=n=function(o){mde(a,o);function a(l){var c;return c=o.call(this,l)||this,c.__outsideClickHandler=function(f){if(typeof c.__clickOutsideHandlerProp=="function"){c.__clickOutsideHandlerProp(f);return}var d=c.getInstance();if(typeof d.props.handleClickOutside=="function"){d.props.handleClickOutside(f);return}if(typeof d.handleClickOutside=="function"){d.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():fu.findDOMNode(f)},c.enableOnClickOutside=function(){if(!(typeof document>"u"||W_[c._uid])){typeof xx>"u"&&(xx=bde()),W_[c._uid]=!0;var f=c.props.eventTypes;f.forEach||(f=[f]),tm[c._uid]=function(d){if(c.componentNode!==null&&(c.props.preventDefault&&d.preventDefault(),c.props.stopPropagation&&d.stopPropagation(),!(c.props.excludeScrollbar&&_de(d)))){var p=d.composed&&d.composedPath&&d.composedPath().shift()||d.target;yde(p,c.componentNode,c.props.outsideClickIgnoreClass)===document&&c.__outsideClickHandler(d)}},f.forEach(function(d){document.addEventListener(d,tm[c._uid],nj(tj(c),d))})}},c.disableOnClickOutside=function(){delete W_[c._uid];var f=tm[c._uid];if(f&&typeof document<"u"){var d=c.props.eventTypes;d.forEach||(d=[d]),d.forEach(function(p){return document.removeEventListener(p,f,nj(tj(c),p))}),delete tm[c._uid]}},c.getRef=function(f){return c.instanceRef=f},c._uid=xde(),c}var s=a.prototype;return s.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var c=this.instanceRef;return c.getInstance?c.getInstance():c},s.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()}},s.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},s.componentWillUnmount=function(){this.disableOnClickOutside()},s.render=function(){var c=this.props;c.excludeScrollbar;var f=gde(c,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?f.ref=this.getRef:f.wrappedRef=this.getRef,f.disableOnClickOutside=this.disableOnClickOutside,f.enableOnClickOutside=this.enableOnClickOutside,B.createElement(e,f)},a}(B.Component),n.displayName="OnClickOutside("+i+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:Ode,preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r}function rj(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 ij(e){for(var t=1;t"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=Ov(e);if(t){var i=Ov(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return te(o)}(this,n)}}function Cx(e){return function(t){if(Array.isArray(t))return Y_(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 Y_(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 Y_(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 Y_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.excludeDateIntervals,a=t.includeDates,s=t.includeDateIntervals,l=t.filterDate;return zy(e,{minDate:n,maxDate:r})||i&&i.some(function(c){return pr(e,c)})||o&&o.some(function(c){var f=c.start,d=c.end;return au(e,{start:f,end:d})})||a&&!a.some(function(c){return pr(e,c)})||s&&!s.some(function(c){var f=c.start,d=c.end;return au(e,{start:f,end:d})})||l&&!l(Ct(e))||!1}function WO(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,a=i.end;return au(e,{start:o,end:a})}):n&&n.some(function(i){return pr(e,i)})||!1}function NI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,a=t.filterDate;return zy(e,{minDate:q6(n),maxDate:Y6(r)})||i&&i.some(function(s){return ki(e,s)})||o&&!o.some(function(s){return ki(e,s)})||a&&!a(Ct(e))||!1}function q_(e,t,n,r){var i=Je(e),o=nr(e),a=Je(t),s=nr(t),l=Je(r);return i===a&&i===l?o<=n&&n<=s:i=n||li:void 0}function kde(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,a=t.filterDate;return zy(e,{minDate:n,maxDate:r})||i&&i.some(function(s){return Cv(e,s)})||o&&!o.some(function(s){return Cv(e,s)})||a&&!a(Ct(e))||!1}function G_(e,t,n){if(!hv(t)||!hv(n))return!1;var r=Je(t),i=Je(n);return r<=e&&i>=e}function AI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate,i=t.excludeDates,o=t.includeDates,a=t.filterDate,s=new Date(e,0,1);return zy(s,{minDate:G6(n),maxDate:zse(r)})||i&&i.some(function(l){return ka(s,l)})||o&&!o.some(function(l){return ka(s,l)})||a&&!a(Ct(s))||!1}function K_(e,t,n,r){var i=Je(e),o=hc(e),a=Je(t),s=hc(t),l=Je(r);return i===a&&i===l?o<=n&&n<=s:i=n||li:void 0}function zy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.maxDate;return n&&Gd(e,n)<0||r&&Gd(e,r)>0}function fj(e,t){return t.some(function(n){return $r(n)===$r(e)&&Br(n)===Br(e)})}function dj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.excludeTimes,r=t.includeTimes,i=t.filterTime;return n&&fj(e,n)||r&&!fj(e,r)||i&&!i(e)||!1}function hj(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var i,o=Ct(),a=Xf(Jf(o,Br(e)),$r(e)),s=Xf(Jf(o,Br(n)),$r(n)),l=Xf(Jf(o,Br(r)),$r(r));try{i=!au(a,{start:s,end:l})}catch{i=!1}return i}function pj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=su(e,1);return n&&Kd(n,i)>0||r&&r.every(function(o){return Kd(o,i)>0})||!1}function mj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=vi(e,1);return n&&Kd(i,n)>0||r&&r.every(function(o){return Kd(i,o)>0})||!1}function gj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.minDate,r=t.includeDates,i=Zd(e,1);return n&&pv(n,i)>0||r&&r.every(function(o){return pv(o,i)>0})||!1}function vj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.maxDate,r=t.includeDates,i=ru(e,1);return n&&pv(i,n)>0||r&&r.every(function(o){return pv(i,o)>0})||!1}function II(e){var t=e.minDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Gd(i,t)>=0});return x3(r)}return n?x3(n):t}function FI(e){var t=e.maxDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Gd(i,t)<=0});return w3(r)}return n?w3(n):t}function yj(){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]:ed,n=Math.ceil(Je(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function Tde(e,t,n,r){for(var i=[],o=0;o<2*t+1;o++){var a=e+t-o,s=!0;n&&(s=Je(n)<=a),r&&s&&(s=Je(r)>=a),s&&i.push(a)}return i}var Mde=By(function(e){Nn(n,Y.Component);var t=An(n);function n(r){var i;Ln(this,n),Z(te(i=t.call(this,r)),"renderOptions",function(){var l=i.props.year,c=i.state.yearsList.map(function(p){return Y.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(te(i),p),"aria-selected":l===p?"true":void 0},l===p?Y.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",p)}),f=i.props.minDate?Je(i.props.minDate):null,d=i.props.maxDate?Je(i.props.maxDate):null;return d&&i.state.yearsList.find(function(p){return p===d})||c.unshift(Y.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:i.incrementYears},Y.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(Y.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:i.decrementYears},Y.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c}),Z(te(i),"onChange",function(l){i.props.onChange(l)}),Z(te(i),"handleClickOutside",function(){i.props.onCancel()}),Z(te(i),"shiftYears",function(l){var c=i.state.yearsList.map(function(f){return f+l});i.setState({yearsList:c})}),Z(te(i),"incrementYears",function(){return i.shiftYears(1)}),Z(te(i),"decrementYears",function(){return i.shiftYears(-1)});var o=r.yearDropdownItemNumber,a=r.scrollableYearDropdown,s=o||(a?10:5);return i.state={yearsList:Tde(i.props.year,s,i.props.minDate,i.props.maxDate)},i.dropdownRef=B.createRef(),i}return Rn(n,[{key:"componentDidMount",value:function(){var r=this.dropdownRef.current;if(r){var i=r.children?Array.from(r.children):null,o=i?i.find(function(a){return a.ariaSelected}):null;r.scrollTop=o?o.offsetTop+(o.clientHeight-r.clientHeight)/2:(r.scrollHeight-r.clientHeight)/2}}},{key:"render",value:function(){var r=Ee({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return Y.createElement("div",{className:r,ref:this.dropdownRef},this.renderOptions())}}]),n}()),jde=function(e){Nn(n,Y.Component);var t=An(n);function n(){var r;Ln(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&arguments[0]!==void 0?arguments[0]:{},l=!1;r.getTabIndex()===0&&!s.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),r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()&&(l=!1),r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()&&(l=!1)),l&&r.dayEl.current.focus({preventScroll:!0})}),Z(te(r),"renderDayContents",function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(T3(r.props.day),r.props.day):T3(r.props.day)}),Z(te(r),"render",function(){return Y.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.isInRange()},r.renderDayContents())}),r}return Rn(n,[{key:"componentDidMount",value:function(){this.handleFocusDay()}},{key:"componentDidUpdate",value:function(r){this.handleFocusDay(r)}}]),n}(),Fde=function(e){Nn(n,Y.Component);var t=An(n);function n(){var r;Ln(this,n);for(var i=arguments.length,o=new Array(i),a=0;a=6,g=!l&&!r.isWeekInMonth(d);if(p||g){if(!r.props.peekNextMonth)break;f=!0}}return s}),Z(te(r),"onMonthClick",function(s,l){r.handleDayClick(Ba(hr(r.props.day,l)),s)}),Z(te(r),"onMonthMouseEnter",function(s){r.handleDayMouseEnter(Ba(hr(r.props.day,s)))}),Z(te(r),"handleMonthNavigation",function(s,l){r.isDisabled(l)||r.isExcluded(l)||(r.props.setPreSelection(l),r.MONTH_REFS[s].current&&r.MONTH_REFS[s].current.focus())}),Z(te(r),"onMonthKeyDown",function(s,l){var c=r.props,f=c.selected,d=c.preSelection,p=c.disabledKeyboardNavigation,g=c.showTwoColumnMonthYearPicker,v=c.showFourColumnMonthYearPicker,y=c.setPreSelection,x=s.key;if(x!=="Tab"&&s.preventDefault(),!p){var b=bj(v,g),w=Z_[b].verticalNavigationOffset,S=Z_[b].grid;switch(x){case"Enter":r.onMonthClick(s,l),y(f);break;case"ArrowRight":r.handleMonthNavigation(l===11?0:l+1,vi(d,1));break;case"ArrowLeft":r.handleMonthNavigation(l===0?11:l-1,su(d,1));break;case"ArrowUp":r.handleMonthNavigation(S[0].includes(l)?l+12-w:l-w,su(d,w));break;case"ArrowDown":r.handleMonthNavigation(S[S.length-1].includes(l)?l-12+w:l+w,vi(d,w))}}}),Z(te(r),"onQuarterClick",function(s,l){r.handleDayClick(cj(zl(r.props.day,l)),s)}),Z(te(r),"onQuarterMouseEnter",function(s){r.handleDayMouseEnter(cj(zl(r.props.day,s)))}),Z(te(r),"handleQuarterNavigation",function(s,l){r.isDisabled(l)||r.isExcluded(l)||(r.props.setPreSelection(l),r.QUARTER_REFS[s-1].current&&r.QUARTER_REFS[s-1].current.focus())}),Z(te(r),"onQuarterKeyDown",function(s,l){var c=s.key;if(!r.props.disabledKeyboardNavigation)switch(c){case"Enter":r.onQuarterClick(s,l),r.props.setPreSelection(r.props.selected);break;case"ArrowRight":r.handleQuarterNavigation(l===4?1:l+1,H6(r.props.preSelection,1));break;case"ArrowLeft":r.handleQuarterNavigation(l===1?4:l-1,bue(r.props.preSelection,1))}}),Z(te(r),"getMonthClassNames",function(s){var l=r.props,c=l.day,f=l.startDate,d=l.endDate,p=l.selected,g=l.minDate,v=l.maxDate,y=l.preSelection,x=l.monthClassName,b=l.excludeDates,w=l.includeDates,S=x?x(hr(c,s)):void 0,C=hr(c,s);return Ee("react-datepicker__month-text","react-datepicker__month-".concat(s),S,{"react-datepicker__month-text--disabled":(g||v||b||w)&&NI(C,r.props),"react-datepicker__month-text--selected":r.isSelectedMonth(c,s,p),"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&nr(y)===s,"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(s),"react-datepicker__month-text--in-range":q_(f,d,s,c),"react-datepicker__month-text--range-start":r.isRangeStartMonth(s),"react-datepicker__month-text--range-end":r.isRangeEndMonth(s),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(s),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(s),"react-datepicker__month-text--today":r.isCurrentMonth(c,s)})}),Z(te(r),"getTabIndex",function(s){var l=nr(r.props.preSelection);return r.props.disabledKeyboardNavigation||s!==l?"-1":"0"}),Z(te(r),"getQuarterTabIndex",function(s){var l=hc(r.props.preSelection);return r.props.disabledKeyboardNavigation||s!==l?"-1":"0"}),Z(te(r),"getAriaLabel",function(s){var l=r.props,c=l.chooseDayAriaLabelPrefix,f=c===void 0?"Choose":c,d=l.disabledDayAriaLabelPrefix,p=d===void 0?"Not available":d,g=l.day,v=hr(g,s),y=r.isDisabled(v)||r.isExcluded(v)?p:f;return"".concat(y," ").concat(ln(v,"MMMM yyyy"))}),Z(te(r),"getQuarterClassNames",function(s){var l=r.props,c=l.day,f=l.startDate,d=l.endDate,p=l.selected,g=l.minDate,v=l.maxDate,y=l.preSelection;return Ee("react-datepicker__quarter-text","react-datepicker__quarter-".concat(s),{"react-datepicker__quarter-text--disabled":(g||v)&&kde(zl(c,s),r.props),"react-datepicker__quarter-text--selected":r.isSelectedQuarter(c,s,p),"react-datepicker__quarter-text--keyboard-selected":hc(y)===s,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(s),"react-datepicker__quarter-text--in-range":K_(f,d,s,c),"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(s),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(s)})}),Z(te(r),"getMonthContent",function(s){var l=r.props,c=l.showFullMonthYearPicker,f=l.renderMonthContent,d=l.locale,p=RI(s,d),g=HO(s,d);return f?f(s,p,g):c?g:p}),Z(te(r),"getQuarterContent",function(s){var l=r.props,c=l.renderQuarterContent,f=function(d,p){return ln(zl(Ct(),d),"QQQ",p)}(s,l.locale);return c?c(s,f):f}),Z(te(r),"renderMonths",function(){var s=r.props,l=s.showTwoColumnMonthYearPicker,c=s.showFourColumnMonthYearPicker,f=s.day,d=s.selected;return Z_[bj(c,l)].grid.map(function(p,g){return Y.createElement("div",{className:"react-datepicker__month-wrapper",key:g},p.map(function(v,y){return Y.createElement("div",{ref:r.MONTH_REFS[v],key:y,onClick:function(x){r.onMonthClick(x,v)},onKeyDown:function(x){r.onMonthKeyDown(x,v)},onMouseEnter:function(){return r.onMonthMouseEnter(v)},tabIndex:r.getTabIndex(v),className:r.getMonthClassNames(v),role:"option","aria-label":r.getAriaLabel(v),"aria-current":r.isCurrentMonth(f,v)?"date":void 0,"aria-selected":r.isSelectedMonth(f,v,d)},r.getMonthContent(v))}))})}),Z(te(r),"renderQuarters",function(){var s=r.props,l=s.day,c=s.selected;return Y.createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(f,d){return Y.createElement("div",{key:d,ref:r.QUARTER_REFS[d],role:"option",onClick:function(p){r.onQuarterClick(p,f)},onKeyDown:function(p){r.onQuarterKeyDown(p,f)},onMouseEnter:function(){return r.onQuarterMouseEnter(f)},className:r.getQuarterClassNames(f),"aria-selected":r.isSelectedQuarter(l,f,c),tabIndex:r.getQuarterTabIndex(f),"aria-current":r.isCurrentQuarter(l,f)?"date":void 0},r.getQuarterContent(f))}))}),Z(te(r),"getClassNames",function(){var s=r.props,l=s.selectingDate,c=s.selectsStart,f=s.selectsEnd,d=s.showMonthYearPicker,p=s.showQuarterYearPicker;return Ee("react-datepicker__month",{"react-datepicker__month--selecting-range":l&&(c||f)},{"react-datepicker__monthPicker":d},{"react-datepicker__quarterPicker":p})}),r}return Rn(n,[{key:"render",value:function(){var r=this.props,i=r.showMonthYearPicker,o=r.showQuarterYearPicker,a=r.day,s=r.ariaLabelPrefix,l=s===void 0?"month ":s;return Y.createElement("div",{className:this.getClassNames(),onMouseLeave:this.handleMouseLeave,"aria-label":"".concat(l," ").concat(ln(a,"yyyy-MM")),role:"listbox"},i?this.renderMonths():o?this.renderQuarters():this.renderWeeks())}}]),n}(),zI=function(e){Nn(n,Y.Component);var t=An(n);function n(){var r;Ln(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&arguments[0]!==void 0?arguments[0]:{}).className||"").split(/\s+/);return Hde.some(function(s){return a.indexOf(s)>=0})})(o.target)&&i.props.onDropdownFocus()}),Z(te(i),"getDateInView",function(){var o=i.props,a=o.preSelection,s=o.selected,l=o.openToDate,c=II(i.props),f=FI(i.props),d=Ct(),p=l||s||a;return p||(c&&li(d,c)?c:f&&Za(d,f)?f:d)}),Z(te(i),"increaseMonth",function(){i.setState(function(o){var a=o.date;return{date:vi(a,1)}},function(){return i.handleMonthChange(i.state.date)})}),Z(te(i),"decreaseMonth",function(){i.setState(function(o){var a=o.date;return{date:su(a,1)}},function(){return i.handleMonthChange(i.state.date)})}),Z(te(i),"handleDayClick",function(o,a,s){i.props.onSelect(o,a,s),i.props.setPreSelection&&i.props.setPreSelection(o)}),Z(te(i),"handleDayMouseEnter",function(o){i.setState({selectingDate:o}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(o)}),Z(te(i),"handleMonthMouseLeave",function(){i.setState({selectingDate:null}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()}),Z(te(i),"handleYearMouseEnter",function(o,a){i.setState({selectingDate:Co(Ct(),a)}),i.props.onYearMouseEnter&&i.props.onYearMouseEnter(o,a)}),Z(te(i),"handleYearMouseLeave",function(o,a){i.props.onYearMouseLeave&&i.props.onYearMouseLeave(o,a)}),Z(te(i),"handleYearChange",function(o){i.props.onYearChange&&(i.props.onYearChange(o),i.setState({isRenderAriaLiveMessage:!0})),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(o),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(o)}),Z(te(i),"handleMonthChange",function(o){i.handleCustomMonthChange(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)}),Z(te(i),"handleCustomMonthChange",function(o){i.props.onMonthChange&&(i.props.onMonthChange(o),i.setState({isRenderAriaLiveMessage:!0}))}),Z(te(i),"handleMonthYearChange",function(o){i.handleYearChange(o),i.handleMonthChange(o)}),Z(te(i),"changeYear",function(o){i.setState(function(a){var s=a.date;return{date:Co(s,o)}},function(){return i.handleYearChange(i.state.date)})}),Z(te(i),"changeMonth",function(o){i.setState(function(a){var s=a.date;return{date:hr(s,o)}},function(){return i.handleMonthChange(i.state.date)})}),Z(te(i),"changeMonthYear",function(o){i.setState(function(a){var s=a.date;return{date:Co(hr(s,nr(o)),Je(o))}},function(){return i.handleMonthYearChange(i.state.date)})}),Z(te(i),"header",function(){var o=VO(arguments.length>0&&arguments[0]!==void 0?arguments[0]:i.state.date,i.props.locale,i.props.calendarStartDay),a=[];return i.props.showWeekNumbers&&a.push(Y.createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),a.concat([0,1,2,3,4,5,6].map(function(s){var l=_l(o,s),c=i.formatWeekday(l,i.props.locale),f=i.props.weekDayClassName?i.props.weekDayClassName(l):void 0;return Y.createElement("div",{key:s,className:Ee("react-datepicker__day-name",f)},c)}))}),Z(te(i),"formatWeekday",function(o,a){return i.props.formatWeekDay?function(s,l,c){return l(ln(s,"EEEE",c))}(o,i.props.formatWeekDay,a):i.props.useWeekdaysShort?function(s,l){return ln(s,"EEE",l)}(o,a):function(s,l){return ln(s,"EEEEEE",l)}(o,a)}),Z(te(i),"decreaseYear",function(){i.setState(function(o){var a=o.date;return{date:Zd(a,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),Z(te(i),"clearSelectingDate",function(){i.setState({selectingDate:null})}),Z(te(i),"renderPreviousButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=gj(i.state.date,i.props);break;case i.props.showYearPicker:o=function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=w.minDate,C=w.yearItemNumber,k=C===void 0?ed:C,P=mc(Sf(Zd(b,k)),k).endPeriod,j=S&&Je(S);return j&&j>P||!1}(i.state.date,i.props);break;default:o=pj(i.state.date,i.props)}if((i.props.forceShowMonthNavigation||i.props.showDisabledMonthNavigation||!o)&&!i.props.showTimeSelectOnly){var a=["react-datepicker__navigation","react-datepicker__navigation--previous"],s=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(s=i.decreaseYear),o&&i.props.showDisabledMonthNavigation&&(a.push("react-datepicker__navigation--previous--disabled"),s=null);var l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,c=i.props,f=c.previousMonthButtonLabel,d=c.previousYearButtonLabel,p=i.props,g=p.previousMonthAriaLabel,v=g===void 0?typeof f=="string"?f:"Previous Month":g,y=p.previousYearAriaLabel,x=y===void 0?typeof d=="string"?d:"Previous Year":y;return Y.createElement("button",{type:"button",className:a.join(" "),onClick:s,onKeyDown:i.props.handleOnKeyDown,"aria-label":l?x:v},Y.createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},l?i.props.previousYearButtonLabel:i.props.previousMonthButtonLabel))}}}),Z(te(i),"increaseYear",function(){i.setState(function(o){var a=o.date;return{date:ru(a,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),Z(te(i),"renderNextButton",function(){if(!i.props.renderCustomHeader){var o;switch(!0){case i.props.showMonthYearPicker:o=vj(i.state.date,i.props);break;case i.props.showYearPicker:o=function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=w.maxDate,C=w.yearItemNumber,k=C===void 0?ed:C,P=mc(ru(b,k),k).startPeriod,j=S&&Je(S);return j&&j0&&arguments[0]!==void 0?arguments[0]:i.state.date,a=["react-datepicker__current-month"];return i.props.showYearDropdown&&a.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&a.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&a.push("react-datepicker__current-month--hasMonthYearDropdown"),Y.createElement("div",{className:a.join(" ")},ln(o,i.props.dateFormat,i.props.locale))}),Z(te(i),"renderYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showYearDropdown&&!o)return Y.createElement(jde,{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:Je(i.state.date),scrollableYearDropdown:i.props.scrollableYearDropdown,yearDropdownItemNumber:i.props.yearDropdownItemNumber})}),Z(te(i),"renderMonthDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthDropdown&&!o)return Y.createElement(Lde,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,onChange:i.changeMonth,month:nr(i.state.date),useShortMonthInDropdown:i.props.useShortMonthInDropdown})}),Z(te(i),"renderMonthYearDropdown",function(){var o=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthYearDropdown&&!o)return Y.createElement(Ade,{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})}),Z(te(i),"handleTodayButtonClick",function(o){i.props.onSelect(uj(),o),i.props.setPreSelection&&i.props.setPreSelection(uj())}),Z(te(i),"renderTodayButton",function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return Y.createElement("div",{className:"react-datepicker__today-button",onClick:function(o){return i.handleTodayButtonClick(o)}},i.props.todayButton)}),Z(te(i),"renderDefaultHeader",function(o){var a=o.monthDate,s=o.i;return Y.createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(a),Y.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(s!==0),i.renderMonthYearDropdown(s!==0),i.renderYearDropdown(s!==0)),Y.createElement("div",{className:"react-datepicker__day-names"},i.header(a)))}),Z(te(i),"renderCustomHeader",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.monthDate,s=o.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var l=pj(i.state.date,i.props),c=mj(i.state.date,i.props),f=gj(i.state.date,i.props),d=vj(i.state.date,i.props),p=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return Y.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},i.props.renderCustomHeader(ij(ij({},i.state),{},{customHeaderCount:s,monthDate:a,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:d})),p&&Y.createElement("div",{className:"react-datepicker__day-names"},i.header(a)))}),Z(te(i),"renderYearHeader",function(){var o=i.state.date,a=i.props,s=a.showYearPicker,l=mc(o,a.yearItemNumber),c=l.startPeriod,f=l.endPeriod;return Y.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},s?"".concat(c," - ").concat(f):Je(o))}),Z(te(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)}}),Z(te(i),"renderMonths",function(){if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],a=i.props.showPreviousMonths?i.props.monthsShown-1:0,s=su(i.state.date,a),l=0;l0;o.push(Y.createElement("div",{key:d,ref:function(v){i.monthContainer=v},className:"react-datepicker__month-container"},i.renderHeader({monthDate:f,i:l}),Y.createElement(Bde,{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,renderMonthContent:i.props.renderMonthContent,renderQuarterContent:i.props.renderQuarterContent,renderYearContent:i.props.renderYearContent,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:g})))}return o}}),Z(te(i),"renderYears",function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?Y.createElement("div",{className:"react-datepicker__year--container"},i.renderHeader(),Y.createElement(Ude,Qd({onDayClick:i.handleDayClick,selectingDate:i.state.selectingDate,clearSelectingDate:i.clearSelectingDate,date:i.state.date},i.props,{onYearMouseEnter:i.handleYearMouseEnter,onYearMouseLeave:i.handleYearMouseLeave}))):void 0}),Z(te(i),"renderTimeSection",function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return Y.createElement(zI,{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})}),Z(te(i),"renderInputTimeSection",function(){var o=new Date(i.props.selected),a=ha(o)&&i.props.selected?"".concat(_j(o.getHours()),":").concat(_j(o.getMinutes())):"";if(i.props.showTimeInput)return Y.createElement(zde,{date:o,timeString:a,timeInputLabel:i.props.timeInputLabel,onChange:i.props.onTimeChange,customTimeInput:i.props.customTimeInput})}),Z(te(i),"renderAriaLiveRegion",function(){var o,a=mc(i.state.date,i.props.yearItemNumber),s=a.startPeriod,l=a.endPeriod;return o=i.props.showYearPicker?"".concat(s," - ").concat(l):i.props.showMonthYearPicker||i.props.showQuarterYearPicker?Je(i.state.date):"".concat(HO(nr(i.state.date),i.props.locale)," ").concat(Je(i.state.date)),Y.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},i.state.isRenderAriaLiveMessage&&o)}),Z(te(i),"renderChildren",function(){if(i.props.children)return Y.createElement("div",{className:"react-datepicker__children-container"},i.props.children)}),i.containerRef=Y.createRef(),i.state={date:i.getDateInView(),selectingDate:null,monthContainer:null,isRenderAriaLiveMessage:!1},i}return Rn(n,[{key:"componentDidMount",value:function(){var r=this;this.props.showTimeSelect&&(this.assignMonthContainer=void r.setState({monthContainer:r.monthContainer}))}},{key:"componentDidUpdate",value:function(r){var i=this;if(!this.props.preSelection||pr(this.props.preSelection,r.preSelection)&&this.props.monthSelectedIn===r.monthSelectedIn)this.props.openToDate&&!pr(this.props.openToDate,r.openToDate)&&this.setState({date:this.props.openToDate});else{var o=!ki(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return o&&i.handleCustomMonthChange(i.state.date)})}}},{key:"render",value:function(){var r=this.props.container||Vde;return Y.createElement("div",{ref:this.containerRef},Y.createElement(r,{className:Ee("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showPopperArrow:this.props.showPopperArrow,arrowProps:this.props.arrowProps},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren()))}}],[{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:ed}}}]),n}(),VI=function(e){Nn(n,Y.Component);var t=An(n);function n(r){var i;return Ln(this,n),(i=t.call(this,r)).el=document.createElement("div"),i}return Rn(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 zs.createPortal(this.props.children,this.el)}}]),n}(),Yde=function(e){return!e.disabled&&e.tabIndex!==-1},HI=function(e){Nn(n,Y.Component);var t=An(n);function n(r){var i;return Ln(this,n),Z(te(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(Yde)}),Z(te(i),"handleFocusStart",function(){var o=i.getTabChildren();o&&o.length>1&&o[o.length-1].focus()}),Z(te(i),"handleFocusEnd",function(){var o=i.getTabChildren();o&&o.length>1&&o[0].focus()}),i.tabLoopRef=Y.createRef(),i}return Rn(n,[{key:"render",value:function(){return this.props.enableTabLoop?Y.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},Y.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:"0",onFocus:this.handleFocusStart}),this.props.children,Y.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:"0",onFocus:this.handleFocusEnd})):this.props.children}}],[{key:"defaultProps",get:function(){return{enableTabLoop:!0}}}]),n}(),qde=function(e){Nn(n,Y.Component);var t=An(n);function n(){return Ln(this,n),t.apply(this,arguments)}return Rn(n,[{key:"render",value:function(){var r,i=this.props,o=i.className,a=i.wrapperClassName,s=i.hidePopper,l=i.popperComponent,c=i.popperModifiers,f=i.popperPlacement,d=i.popperProps,p=i.targetComponent,g=i.enableTabLoop,v=i.popperOnKeyDown,y=i.portalId,x=i.portalHost;if(!s){var b=Ee("react-datepicker-popper",o);r=Y.createElement(XS,Qd({modifiers:c,placement:f},d),function(S){var C=S.ref,k=S.style,P=S.placement,j=S.arrowProps;return Y.createElement(HI,{enableTabLoop:g},Y.createElement("div",{ref:C,style:k,className:b,"data-placement":P,onKeyDown:v},Y.cloneElement(l,{arrowProps:j})))})}this.props.popperContainer&&(r=Y.createElement(this.props.popperContainer,{},r)),y&&!s&&(r=Y.createElement(VI,{portalId:y,portalHost:x},r));var w=Ee("react-datepicker-wrapper",a);return Y.createElement(Z1,{className:"react-datepicker-manager"},Y.createElement(j4,null,function(S){var C=S.ref;return Y.createElement("div",{ref:C,className:w},p)}),r)}}],[{key:"defaultProps",get:function(){return{hidePopper:!0,popperModifiers:[],popperProps:{},popperPlacement:"bottom-start"}}}]),n}(),wj="react-datepicker-ignore-onclickoutside",Gde=By(Wde),Q_="Date input not valid.",Kde=function(e){Nn(n,Y.Component);var t=An(n);function n(r){var i;return Ln(this,n),Z(te(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:Ct()}),Z(te(i),"calcInitialState",function(){var o,a=i.getPreSelection(),s=II(i.props),l=FI(i.props),c=s&&li(a,Vr(s))?s:l&&Za(a,al(l))?l:a;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:yj(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1}}),Z(te(i),"clearPreventFocusTimeout",function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)}),Z(te(i),"setFocus",function(){i.input&&i.input.focus&&i.input.focus({preventScroll:!0})}),Z(te(i),"setBlur",function(){i.input&&i.input.blur&&i.input.blur(),i.cancelFocusInput()}),Z(te(i),"setOpen",function(o){var a=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:X_},function(){o||i.setState(function(s){return{focused:!!a&&s.focused}},function(){!a&&i.setBlur(),i.setState({inputValue:null})})})}),Z(te(i),"inputOk",function(){return EO(i.state.preSelection)}),Z(te(i),"isCalendarOpen",function(){return i.props.open===void 0?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open}),Z(te(i),"handleFocus",function(o){i.state.preventFocus||(i.props.onFocus(o),i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})}),Z(te(i),"cancelFocusInput",function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=null}),Z(te(i),"deferFocusInput",function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)}),Z(te(i),"handleDropdownFocus",function(){i.cancelFocusInput()}),Z(te(i),"handleBlur",function(o){(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&i.props.onBlur(o),i.setState({focused:!1})}),Z(te(i),"handleCalendarClickOutside",function(o){i.props.inline||i.setOpen(!1),i.props.onClickOutside(o),i.props.withPortal&&o.preventDefault()}),Z(te(i),"handleChange",function(){for(var o=arguments.length,a=new Array(o),s=0;s0&&(v=F_(c,f.slice(0,c.length),new Date)),ha(v)||(v=new Date(c))),ha(v)&&x?v:null));i.props.showTimeSelectOnly&&i.props.selected&&!pr(b,i.props.selected)&&(b=yue(i.props.selected,b==null?{hours:$r(i.props.selected),minutes:Br(i.props.selected),seconds:I_(i.props.selected)}:{hours:$r(b),minutes:Br(b),seconds:I_(b)})),!b&&l.target.value||i.setSelected(b,l,!0)}}),Z(te(i),"handleSelect",function(o,a,s){if(i.setState({preventFocus:!0},function(){return i.preventFocusTimeout=setTimeout(function(){return i.setState({preventFocus:!1})},50),i.preventFocusTimeout}),i.props.onChangeRaw&&i.props.onChangeRaw(a),i.setSelected(o,a,!1,s),i.props.showDateSelect&&i.setState({isRenderAriaLiveMessage:!0}),!i.props.shouldCloseOnSelect||i.props.showTimeSelect)i.setPreSelection(o);else if(!i.props.inline){i.props.selectsRange||i.setOpen(!1);var l=i.props,c=l.startDate,f=l.endDate;!c||f||li(o,c)||i.setOpen(!1)}}),Z(te(i),"setSelected",function(o,a,s,l){var c=o;if(i.props.showYearPicker){if(c!==null&&AI(Je(c),i.props))return}else if(i.props.showMonthYearPicker){if(c!==null&&NI(c,i.props))return}else if(c!==null&&Uy(c,i.props))return;var f=i.props,d=f.onChange,p=f.selectsRange,g=f.startDate,v=f.endDate;if(!Pa(i.props.selected,c)||i.props.allowSameDay||p)if(c!==null&&(!i.props.selected||s&&(i.props.showTimeSelect||i.props.showTimeSelectOnly||i.props.showTimeInput)||(c=lj(c,{hour:$r(i.props.selected),minute:Br(i.props.selected),second:I_(i.props.selected)})),i.props.inline||i.setState({preSelection:c}),i.props.focusSelectedMonth||i.setState({monthSelectedIn:l})),p){var y=g&&!v,x=g&&v;!g&&!v?d([c,null],a):y&&(li(c,g)?d([c,null],a):d([g,c],a)),x&&d([c,null],a)}else d(c,a);s||(i.props.onSelect(c,a),i.setState({inputValue:null}))}),Z(te(i),"setPreSelection",function(o){var a=i.props.minDate!==void 0,s=i.props.maxDate!==void 0,l=!0;if(o){var c=Vr(o);if(a&&s)l=zm(o,i.props.minDate,i.props.maxDate);else if(a){var f=Vr(i.props.minDate);l=Za(o,f)||Pa(c,f)}else if(s){var d=al(i.props.maxDate);l=li(o,d)||Pa(c,d)}}l&&i.setState({preSelection:o})}),Z(te(i),"handleTimeChange",function(o){var a=lj(i.props.selected?i.props.selected:i.getPreSelection(),{hour:$r(o),minute:Br(o)});i.setState({preSelection:a}),i.props.onChange(a),i.props.shouldCloseOnSelect&&i.setOpen(!1),i.props.showTimeInput&&i.setOpen(!0),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),i.setState({inputValue:null})}),Z(te(i),"onInputClick",function(){i.props.disabled||i.props.readOnly||i.setOpen(!0),i.props.onInputClick()}),Z(te(i),"onInputKeyDown",function(o){i.props.onKeyDown(o);var a=o.key;if(i.state.open||i.props.inline||i.props.preventOpenOnFocus){if(i.state.open){if(a==="ArrowDown"||a==="ArrowUp"){o.preventDefault();var s=i.calendar.componentNode&&i.calendar.componentNode.querySelector('.react-datepicker__day[tabindex="0"]');return void(s&&s.focus({preventScroll:!0}))}var l=Ct(i.state.preSelection);a==="Enter"?(o.preventDefault(),i.inputOk()&&i.state.lastPreSelectChange===X_?(i.handleSelect(l,o),!i.props.shouldCloseOnSelect&&i.setPreSelection(l)):i.setOpen(!1)):a==="Escape"?(o.preventDefault(),i.setOpen(!1)):a==="Tab"&&o.shiftKey&&i.setOpen(!1),i.inputOk()||i.props.onInputError({code:1,msg:Q_})}}else a!=="ArrowDown"&&a!=="ArrowUp"&&a!=="Enter"||i.onInputClick()}),Z(te(i),"onPortalKeyDown",function(o){o.key==="Escape"&&(o.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))}),Z(te(i),"onDayKeyDown",function(o){i.props.onKeyDown(o);var a=o.key,s=Ct(i.state.preSelection);if(a==="Enter")o.preventDefault(),i.handleSelect(s,o),!i.props.shouldCloseOnSelect&&i.setPreSelection(s);else if(a==="Escape")o.preventDefault(),i.setOpen(!1),i.inputOk()||i.props.onInputError({code:1,msg:Q_});else if(!i.props.disabledKeyboardNavigation){var l;switch(a){case"ArrowLeft":l=RO(s,1);break;case"ArrowRight":l=_l(s,1);break;case"ArrowUp":l=wue(s,1);break;case"ArrowDown":l=OO(s,1);break;case"PageUp":l=su(s,1);break;case"PageDown":l=vi(s,1);break;case"Home":l=Zd(s,1);break;case"End":l=ru(s,1)}if(!l)return void(i.props.onInputError&&i.props.onInputError({code:1,msg:Q_}));if(o.preventDefault(),i.setState({lastPreSelectChange:X_}),i.props.adjustDateOnChange&&i.setSelected(l),i.setPreSelection(l),i.props.inline){var c=nr(s),f=nr(l),d=Je(s),p=Je(l);c!==f||d!==p?i.setState({shouldFocusDayInline:!0}):i.setState({shouldFocusDayInline:!1})}}}),Z(te(i),"onPopperKeyDown",function(o){o.key==="Escape"&&(o.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))}),Z(te(i),"onClearClick",function(o){o&&o.preventDefault&&o.preventDefault(),i.props.selectsRange?i.props.onChange([null,null],o):i.props.onChange(null,o),i.setState({inputValue:null})}),Z(te(i),"clear",function(){i.onClearClick()}),Z(te(i),"onScroll",function(o){typeof i.props.closeOnScroll=="boolean"&&i.props.closeOnScroll?o.target!==document&&o.target!==document.documentElement&&o.target!==document.body||i.setOpen(!1):typeof i.props.closeOnScroll=="function"&&i.props.closeOnScroll(o)&&i.setOpen(!1)}),Z(te(i),"renderCalendar",function(){return i.props.inline||i.isCalendarOpen()?Y.createElement(Gde,{ref:function(o){i.calendar=o},locale:i.props.locale,calendarStartDay:i.props.calendarStartDay,chooseDayAriaLabelPrefix:i.props.chooseDayAriaLabelPrefix,disabledDayAriaLabelPrefix:i.props.disabledDayAriaLabelPrefix,weekAriaLabelPrefix:i.props.weekAriaLabelPrefix,monthAriaLabelPrefix:i.props.monthAriaLabelPrefix,adjustDateOnChange:i.props.adjustDateOnChange,setOpen:i.setOpen,shouldCloseOnSelect:i.props.shouldCloseOnSelect,dateFormat:i.props.dateFormatCalendar,useWeekdaysShort:i.props.useWeekdaysShort,formatWeekDay:i.props.formatWeekDay,dropdownMode:i.props.dropdownMode,selected:i.props.selected,preSelection:i.state.preSelection,onSelect:i.handleSelect,onWeekSelect:i.props.onWeekSelect,openToDate:i.props.openToDate,minDate:i.props.minDate,maxDate:i.props.maxDate,selectsStart:i.props.selectsStart,selectsEnd:i.props.selectsEnd,selectsRange:i.props.selectsRange,startDate:i.props.startDate,endDate:i.props.endDate,excludeDates:i.props.excludeDates,excludeDateIntervals:i.props.excludeDateIntervals,filterDate:i.props.filterDate,onClickOutside:i.handleCalendarClickOutside,formatWeekNumber:i.props.formatWeekNumber,highlightDates:i.state.highlightDates,includeDates:i.props.includeDates,includeDateIntervals:i.props.includeDateIntervals,includeTimes:i.props.includeTimes,injectTimes:i.props.injectTimes,inline:i.props.inline,shouldFocusDayInline:i.state.shouldFocusDayInline,peekNextMonth:i.props.peekNextMonth,showMonthDropdown:i.props.showMonthDropdown,showPreviousMonths:i.props.showPreviousMonths,useShortMonthInDropdown:i.props.useShortMonthInDropdown,showMonthYearDropdown:i.props.showMonthYearDropdown,showWeekNumbers:i.props.showWeekNumbers,showYearDropdown:i.props.showYearDropdown,withPortal:i.props.withPortal,forceShowMonthNavigation:i.props.forceShowMonthNavigation,showDisabledMonthNavigation:i.props.showDisabledMonthNavigation,scrollableYearDropdown:i.props.scrollableYearDropdown,scrollableMonthYearDropdown:i.props.scrollableMonthYearDropdown,todayButton:i.props.todayButton,weekLabel:i.props.weekLabel,outsideClickIgnoreClass:wj,fixedHeight:i.props.fixedHeight,monthsShown:i.props.monthsShown,monthSelectedIn:i.state.monthSelectedIn,onDropdownFocus:i.handleDropdownFocus,onMonthChange:i.props.onMonthChange,onYearChange:i.props.onYearChange,dayClassName:i.props.dayClassName,weekDayClassName:i.props.weekDayClassName,monthClassName:i.props.monthClassName,timeClassName:i.props.timeClassName,showDateSelect:i.props.showDateSelect,showTimeSelect:i.props.showTimeSelect,showTimeSelectOnly:i.props.showTimeSelectOnly,onTimeChange:i.handleTimeChange,timeFormat:i.props.timeFormat,timeIntervals:i.props.timeIntervals,minTime:i.props.minTime,maxTime:i.props.maxTime,excludeTimes:i.props.excludeTimes,filterTime:i.props.filterTime,timeCaption:i.props.timeCaption,className:i.props.calendarClassName,container:i.props.calendarContainer,yearItemNumber:i.props.yearItemNumber,yearDropdownItemNumber:i.props.yearDropdownItemNumber,previousMonthAriaLabel:i.props.previousMonthAriaLabel,previousMonthButtonLabel:i.props.previousMonthButtonLabel,nextMonthAriaLabel:i.props.nextMonthAriaLabel,nextMonthButtonLabel:i.props.nextMonthButtonLabel,previousYearAriaLabel:i.props.previousYearAriaLabel,previousYearButtonLabel:i.props.previousYearButtonLabel,nextYearAriaLabel:i.props.nextYearAriaLabel,nextYearButtonLabel:i.props.nextYearButtonLabel,timeInputLabel:i.props.timeInputLabel,disabledKeyboardNavigation:i.props.disabledKeyboardNavigation,renderCustomHeader:i.props.renderCustomHeader,popperProps:i.props.popperProps,renderDayContents:i.props.renderDayContents,renderMonthContent:i.props.renderMonthContent,renderQuarterContent:i.props.renderQuarterContent,renderYearContent:i.props.renderYearContent,onDayMouseEnter:i.props.onDayMouseEnter,onMonthMouseLeave:i.props.onMonthMouseLeave,onYearMouseEnter:i.props.onYearMouseEnter,onYearMouseLeave:i.props.onYearMouseLeave,selectsDisabledDaysInRange:i.props.selectsDisabledDaysInRange,showTimeInput:i.props.showTimeInput,showMonthYearPicker:i.props.showMonthYearPicker,showFullMonthYearPicker:i.props.showFullMonthYearPicker,showTwoColumnMonthYearPicker:i.props.showTwoColumnMonthYearPicker,showFourColumnMonthYearPicker:i.props.showFourColumnMonthYearPicker,showYearPicker:i.props.showYearPicker,showQuarterYearPicker:i.props.showQuarterYearPicker,showPopperArrow:i.props.showPopperArrow,excludeScrollbar:i.props.excludeScrollbar,handleOnKeyDown:i.props.onKeyDown,handleOnDayKeyDown:i.onDayKeyDown,isInputFocused:i.state.focused,customTimeInput:i.props.customTimeInput,setPreSelection:i.setPreSelection},i.props.children):null}),Z(te(i),"renderAriaLiveRegion",function(){var o,a=i.props,s=a.dateFormat,l=a.locale,c=i.props.showTimeInput||i.props.showTimeSelect?"PPPPp":"PPPP";return o=i.props.selectsRange?"Selected start date: ".concat(Yi(i.props.startDate,{dateFormat:c,locale:l}),". ").concat(i.props.endDate?"End date: "+Yi(i.props.endDate,{dateFormat:c,locale:l}):""):i.props.showTimeSelectOnly?"Selected time: ".concat(Yi(i.props.selected,{dateFormat:s,locale:l})):i.props.showYearPicker?"Selected year: ".concat(Yi(i.props.selected,{dateFormat:"yyyy",locale:l})):i.props.showMonthYearPicker?"Selected month: ".concat(Yi(i.props.selected,{dateFormat:"MMMM yyyy",locale:l})):i.props.showQuarterYearPicker?"Selected quarter: ".concat(Yi(i.props.selected,{dateFormat:"yyyy, QQQ",locale:l})):"Selected date: ".concat(Yi(i.props.selected,{dateFormat:c,locale:l})),Y.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},o)}),Z(te(i),"renderDateInput",function(){var o,a=Ee(i.props.className,Z({},wj,i.state.open)),s=i.props.customInput||Y.createElement("input",{type:"text"}),l=i.props.customInputRef||"ref",c=typeof i.props.value=="string"?i.props.value:typeof i.state.inputValue=="string"?i.state.inputValue:i.props.selectsRange?function(f,d,p){if(!f)return"";var g=Yi(f,p),v=d?Yi(d,p):"";return"".concat(g," - ").concat(v)}(i.props.startDate,i.props.endDate,i.props):Yi(i.props.selected,i.props);return Y.cloneElement(s,(Z(o={},l,function(f){i.input=f}),Z(o,"value",c),Z(o,"onBlur",i.handleBlur),Z(o,"onChange",i.handleChange),Z(o,"onClick",i.onInputClick),Z(o,"onFocus",i.handleFocus),Z(o,"onKeyDown",i.onInputKeyDown),Z(o,"id",i.props.id),Z(o,"name",i.props.name),Z(o,"form",i.props.form),Z(o,"autoFocus",i.props.autoFocus),Z(o,"placeholder",i.props.placeholderText),Z(o,"disabled",i.props.disabled),Z(o,"autoComplete",i.props.autoComplete),Z(o,"className",Ee(s.props.className,a)),Z(o,"title",i.props.title),Z(o,"readOnly",i.props.readOnly),Z(o,"required",i.props.required),Z(o,"tabIndex",i.props.tabIndex),Z(o,"aria-describedby",i.props.ariaDescribedBy),Z(o,"aria-invalid",i.props.ariaInvalid),Z(o,"aria-labelledby",i.props.ariaLabelledBy),Z(o,"aria-required",i.props.ariaRequired),o))}),Z(te(i),"renderClearButton",function(){var o=i.props,a=o.isClearable,s=o.selected,l=o.startDate,c=o.endDate,f=o.clearButtonTitle,d=o.clearButtonClassName,p=d===void 0?"":d,g=o.ariaLabelClose,v=g===void 0?"Close":g;return!a||s==null&&l==null&&c==null?null:Y.createElement("button",{type:"button",className:"react-datepicker__close-icon ".concat(p).trim(),"aria-label":v,onClick:i.onClearClick,title:f,tabIndex:-1})}),i.state=i.calcInitialState(),i}return Rn(n,[{key:"componentDidMount",value:function(){window.addEventListener("scroll",this.onScroll,!0)}},{key:"componentDidUpdate",value:function(r,i){var o,a;r.inline&&(o=r.selected,a=this.props.selected,o&&a?nr(o)!==nr(a)||Je(o)!==Je(a):o!==a)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&r.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),r.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:yj(this.props.highlightDates)}),i.focused||Pa(r.selected,this.props.selected)||this.setState({inputValue:null}),i.open!==this.state.open&&(i.open===!1&&this.state.open===!0&&this.props.onCalendarOpen(),i.open===!0&&this.state.open===!1&&this.props.onCalendarClose())}},{key:"componentWillUnmount",value:function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0)}},{key:"renderInputContainer",value:function(){var r=this.props.showIcon;return Y.createElement("div",{className:"react-datepicker__input-container".concat(r?" react-datepicker__view-calendar-icon":"")},r&&Y.createElement("svg",{className:"react-datepicker__calendar-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},Y.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"})),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())}},{key:"render",value:function(){var r=this.renderCalendar();if(this.props.inline)return r;if(this.props.withPortal){var i=this.state.open?Y.createElement(HI,{enableTabLoop:this.props.enableTabLoop},Y.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},r)):null;return this.state.open&&this.props.portalId&&(i=Y.createElement(VI,{portalId:this.props.portalId,portalHost:this.props.portalHost},i)),Y.createElement("div",null,this.renderInputContainer(),i)}return Y.createElement(qde,{className:this.props.popperClassName,wrapperClassName:this.props.wrapperClassName,hidePopper:!this.isCalendarOpen(),portalId:this.props.portalId,portalHost:this.props.portalHost,popperModifiers:this.props.popperModifiers,targetComponent:this.renderInputContainer(),popperContainer:this.props.popperContainer,popperComponent:r,popperPlacement:this.props.popperPlacement,popperProps:this.props.popperProps,popperOnKeyDown:this.onPopperKeyDown,enableTabLoop:this.props.enableTabLoop})}}],[{key:"defaultProps",get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",onChange:function(){},disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",onFocus:function(){},onBlur:function(){},onKeyDown:function(){},onInputClick:function(){},onSelect:function(){},onClickOutside:function(){},onMonthChange:function(){},onCalendarOpen:function(){},onCalendarClose:function(){},preventOpenOnFocus:!1,onYearChange:function(){},onInputError:function(){},monthsShown:1,readOnly:!1,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,strictParsing:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:ed,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0}}}]),n}(),Zde="input",X_="navigate";const Ex=e=>{const{className:t,isClearable:n,selected:r,dateFormat:i}=e,o=!n||qo(r),a=B.useRef();return m.jsxs("div",{className:"icon-input-container",children:[m.jsx(Kde,{...e,popperModifiers:[{name:"arrow",options:{padding:24}}],dateFormat:i??lI,className:Ee("icon-input-container__input form-control",t),ref:a}),o&&m.jsx(Ie,{icon:rfe,className:"icon-input-container__icon",onClick:()=>{var s;return(s=a.current)==null?void 0:s.input.focus()}})]})},Qde=e=>m.jsx(Ex,{...e,dateFormat:NO,showTimeSelect:!0,timeIntervals:10}),J_=({children:e,infoTooltip:t,checked:n,onChange:r})=>m.jsxs("p",{children:[m.jsx(t6,{inline:!0,checked:n,className:t?"me-2":"",onChange:r,children:e}),t&&m.jsx(Um,{placement:"right",children:t})]});const Xde=({isOpen:e,toggle:t})=>m.jsxs(Zo,{isOpen:e,toggle:t,centered:!0,size:"lg",children:[m.jsx(Qo,{toggle:t,children:"Info"}),m.jsxs(fo,{children:[m.jsxs("p",{children:["When the ",m.jsx("b",{children:m.jsx("i",{children:'"Use existing URL if found"'})})," checkbox is checked, the server will return an existing short URL if it matches provided params."]}),m.jsx("p",{children:"These are the checks performed by Shlink in order to determine if an existing short URL should be returned:"}),m.jsxs("ul",{children:[m.jsx("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."}),m.jsxs("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.",m.jsx("br",{}),"If the slug is being used by another long URL, an error will be returned."]}),m.jsx("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"})]})]})]}),Jde=()=>{const[e,t]=mn();return m.jsxs(m.Fragment,{children:[m.jsx("span",{title:"What does this mean?",children:m.jsx(Ie,{icon:kS,style:{cursor:"pointer"},onClick:t})}),m.jsx(Xde,{isOpen:e,toggle:t})]})};const ehe=Mt(wG,fG(/ /g,"-")),eb=e=>typeof e=="string"?Vo(e):e,the=e=>"shortCodeLength"in e&&"customSlug"in e&&"domain"in e,nhe=(e,t)=>function({mode:r,saving:i,onSave:o,initialState:a}){const[s,l]=B.useState(a),c=()=>l(a),f=Eh("deviceLongUrls"),d=r==="edit",p=the(s),g=r==="create-basic",v=k=>l({...s,tags:k.map(ehe)}),y=(k,P)=>eo(k)?k:eo(P)?null:void 0,x=Iy(async()=>o({...s,validSince:Xa(s.validSince)??null,validUntil:Xa(s.validUntil)??null,maxVisits:eo(s.maxVisits)?Number(s.maxVisits):null}).then(()=>!d&&c()).catch(()=>{}));B.useEffect(()=>{l(a)},[a]);const b=(k,P,j="text",N={},H={})=>m.jsx(Fr,{...H,children:m.jsx(Zc,{id:k,type:j,placeholder:P,value:s[k]??"",onChange:N.onChange??(R=>l({...s,[k]:R.target.value})),...N})}),w=(k,P,j)=>{var N;return m.jsx(pde,{icon:j,id:k,type:"url",placeholder:P,value:((N=s.deviceLongUrls)==null?void 0:N[k])??"",onChange:H=>{var R;return l({...s,deviceLongUrls:{...s.deviceLongUrls??{},[k]:y(H.target.value,(R=a.deviceLongUrls)==null?void 0:R[k])}})}})},S=(k,P,j={})=>m.jsx(Qde,{selected:s[k]?eb(s[k]):null,placeholderText:P,isClearable:!0,onChange:N=>l({...s,[k]:N}),...j}),C=m.jsxs(m.Fragment,{children:[m.jsx(Fr,{children:m.jsx(Zc,{bsSize:"lg",type:"url",placeholder:"URL to be shortened",required:!0,value:s.longUrl,onChange:k=>l({...s,longUrl:k.target.value})})}),m.jsxs(mr,{children:[g&&b("customSlug","Custom slug","text",{bsSize:"lg"},{className:"col-lg-6"}),m.jsx("div",{className:g?"col-lg-6 mb-3":"col-12",children:m.jsx(e,{selectedTags:s.tags??[],onChange:v})})]})]});return m.jsxs("form",{name:"shortUrlForm",className:"short-url-form",onSubmit:x,children:[g&&C,!g&&m.jsxs(m.Fragment,{children:[m.jsxs(mr,{children:[m.jsx("div",{className:Ee("mb-3",{"col-sm-6":f,"col-12":!f}),children:m.jsx(hn,{title:"Main options",className:"mb-3",children:C})}),f&&m.jsx("div",{className:"col-sm-6 mb-3",children:m.jsxs(hn,{title:"Device-specific long URLs",children:[m.jsx(Fr,{children:w("android","Android-specific redirection",hde)}),m.jsx(Fr,{children:w("ios","iOS-specific redirection",dde)}),w("desktop","Desktop-specific redirection",wK)]})})]}),m.jsxs(mr,{children:[m.jsx("div",{className:"col-sm-6 mb-3",children:m.jsxs(hn,{title:"Customize the short URL",children:[b("title","Title","text",{onChange:({target:k})=>l({...s,title:y(k.value,a.title)})}),!d&&p&&m.jsxs(m.Fragment,{children:[m.jsxs(mr,{children:[m.jsx("div",{className:"col-lg-6",children:b("customSlug","Custom slug","text",{disabled:eo(s.shortCodeLength)})}),m.jsx("div",{className:"col-lg-6",children:b("shortCodeLength","Short code length","number",{min:4,disabled:eo(s.customSlug)})})]}),m.jsx(t,{value:s.domain,onChange:k=>l({...s,domain:k})})]})]})}),m.jsx("div",{className:"col-sm-6 mb-3",children:m.jsxs(hn,{title:"Limit access to the short URL",children:[b("maxVisits","Maximum number of visits allowed","number",{min:1}),m.jsx("div",{className:"mb-3",children:S("validSince","Enabled since...",{maxDate:s.validUntil?eb(s.validUntil):void 0})}),S("validUntil","Enabled until...",{minDate:s.validSince?eb(s.validSince):void 0})]})})]}),m.jsxs(mr,{children:[m.jsx("div",{className:"col-sm-6 mb-3",children:m.jsxs(hn,{title:"Extra checks",children:[m.jsx(J_,{infoTooltip:"If checked, Shlink will try to reach the long URL, failing in case it's not publicly accessible.",checked:s.validateUrl,onChange:k=>l({...s,validateUrl:k}),children:"Validate URL"}),!d&&p&&m.jsxs("p",{children:[m.jsx(t6,{inline:!0,className:"me-2",checked:s.findIfExists,onChange:k=>l({...s,findIfExists:k}),children:"Use existing URL if found"}),m.jsx(Jde,{})]})]})}),m.jsx("div",{className:"col-sm-6 mb-3",children:m.jsxs(hn,{title:"Configure behavior",children:[m.jsx(J_,{infoTooltip:"This short URL will be included in the robots.txt for your Shlink instance, allowing web crawlers (like Google) to index it.",checked:s.crawlable,onChange:k=>l({...s,crawlable:k}),children:"Make it crawlable"}),m.jsx(J_,{infoTooltip:"When this short URL is visited, any query params appended to it will be forwarded to the long URL.",checked:s.forwardQuery,onChange:k=>l({...s,forwardQuery:k}),children:"Forward query params on redirect"})]})})]})]}),m.jsx("div",{className:"text-center",children:m.jsx(yt,{outline:!0,color:"primary",disabled:i||Kn(s.longUrl),className:"btn-xs-block",children:i?"Saving...":"Save"})})]})},rhe=({active:e,allText:t,onChange:n})=>m.jsxs(m.Fragment,{children:[m.jsx(Ue,{active:e==="all",onClick:()=>n("all"),children:t}),m.jsx(Ue,{divider:!0}),xue.map(r=>m.jsx(Ue,{active:e===r,onClick:()=>n(r),children:hI(r)},r))]}),ihe=({startDate:e=null,endDate:t=null,disabled:n=!1,onStartDateChange:r,onEndDateChange:i})=>m.jsxs("div",{className:"row",children:[m.jsx("div",{className:"col-md-6",children:m.jsx(Ex,{selected:e,placeholderText:"Since...",isClearable:!0,maxDate:t??void 0,disabled:n,onChange:r})}),m.jsx("div",{className:"col-md-6",children:m.jsx(Ex,{className:"mt-2 mt-md-0",selected:t,placeholderText:"Until...",isClearable:!0,minDate:e??void 0,disabled:n,onChange:o=>i(o&&al(o))})})]}),WI=({onDatesChange:e,initialDateRange:t,defaultText:n,disabled:r,updatable:i=!1})=>{const o=wv(t),[a,s]=B.useState(o?t:void 0),[l,c]=B.useState(o?void 0:t),f=p=>{s(fI(p)?Ph:void 0),c(p),e(p)},d=p=>{s(p),c(void 0),e(pI(p))};return i&&kfe(()=>{const p=wv(t);p&&d(t),t&&!p&&f(t)},[t]),m.jsxs(Xo,{disabled:r,text:hI(a??l)??n,children:[m.jsx(rhe,{allText:n,active:a,onChange:d}),m.jsx(Ue,{divider:!0}),m.jsx(Ue,{header:!0,children:"Custom:"}),m.jsx(Ue,{text:!0,children:m.jsx(ihe,{...l,onStartDateChange:p=>f({...l,startDate:p}),onEndDateChange:p=>f({...l,endDate:p})})})]})},ohe={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},ahe=({onChange:e,selected:t={},className:n,supportsDisabledFiltering:r})=>{const{excludeBots:i=!1,excludeMaxVisitsReached:o=!1,excludePastValidUntil:a=!1}=t,s=l=>()=>e({...t,[l]:!(t!=null&&t[l])});return m.jsxs(Xo,{text:"Filters",dropdownClassName:n,inline:!0,end:!0,minWidth:250,children:[m.jsx(Ue,{header:!0,children:"Visits:"}),m.jsx(Ue,{active:i,onClick:s("excludeBots"),children:"Ignore visits from bots"}),r&&m.jsxs(m.Fragment,{children:[m.jsx(Ue,{divider:!0}),m.jsx(Ue,{header:!0,children:"Short URLs:"}),m.jsx(Ue,{active:o,onClick:s("excludeMaxVisitsReached"),children:"Exclude with visits reached"}),m.jsx(Ue,{active:a,onClick:s("excludePastValidUntil"),children:"Exclude enabled in the past"})]}),m.jsx(Ue,{divider:!0}),m.jsx(Ue,{disabled:!eo(t),onClick:()=>e({excludeBots:!1,excludeMaxVisitsReached:!1,excludePastValidUntil:!1}),children:m.jsx("i",{children:"Clear filters"})})]})};const she=(e,t)=>({className:n,shortUrlsAmount:r,order:i,handleOrderBy:o})=>{const[a,s]=$y(),{search:l,tags:c,startDate:f,endDate:d,excludeBots:p,excludeMaxVisitsReached:g,excludePastValidUntil:v,tagsMode:y="any"}=a,x=Eh("filterDisabledUrls"),b=bl("visits"),w=Mt(({startDate:P,endDate:j})=>({startDate:Xa(P)??void 0,endDate:Xa(j)??void 0}),s),S=Mt(P=>Kn(P)?void 0:P,P=>s({search:P})),C=P=>s({tags:P}),k=Mt(()=>y==="any"?"all":"any",P=>s({tagsMode:P}));return m.jsxs("div",{className:Ee("short-urls-filtering-bar-container",n),children:[m.jsx(xh,{initialValue:l,onChange:S}),m.jsxs(My,{className:"mt-3",children:[m.jsx(t,{allowNew:!1,placeholder:"With tags...",selectedTags:c,onChange:C}),c.length>1&&m.jsxs(m.Fragment,{children:[m.jsx(yt,{outline:!0,color:"secondary",onClick:k,id:"tagsModeBtn","aria-label":"Change tags mode",children:m.jsx(Ie,{className:"short-urls-filtering-bar__tags-icon",icon:y==="all"?SA:KG})}),m.jsx(jr,{target:"tagsModeBtn",placement:"left",children:y==="all"?"With all the tags.":"With any of the tags."})]})]}),m.jsxs(mr,{className:"flex-lg-row-reverse",children:[m.jsx("div",{className:"col-lg-8 col-xl-6 mt-3",children:m.jsxs("div",{className:"d-md-flex",children:[m.jsx("div",{className:"flex-fill",children:m.jsx(WI,{defaultText:"All short URLs",initialDateRange:dI(f,d),onDatesChange:w})}),m.jsx(ahe,{className:"ms-0 ms-md-2 mt-3 mt-md-0",selected:{excludeBots:p??(b==null?void 0:b.excludeBots),excludeMaxVisitsReached:g,excludePastValidUntil:v},onChange:s,supportsDisabledFiltering:x})]})}),m.jsx("div",{className:"col-6 col-lg-4 col-xl-6 mt-3",children:m.jsx(e,{amount:r})}),m.jsx("div",{className:"col-6 d-lg-none mt-3",children:m.jsx(Sh,{prefixed:!1,items:ohe,order:i,onChange:o})})]})]})};function td({currentOrder:e,field:t,className:n="ms-1"}){return!e.dir||e.field!==t?null:m.jsx(Ie,{icon:e.dir==="ASC"?zG:JG,className:n})}const Hl=2,kx="...",YI=(e,t)=>{const n=SS(iA(Hl,e-Hl),gA(t-1,e+Hl)+1);return e-Hl>Hl&&n.unshift(kx),e+Hle===kx,qI=e=>Xd(e)?e:wn(e),GI=(e,t)=>Xd(e)?`${e}_${t}`:`${e}`,lhe=({paginator:e,currentQueryString:t=""})=>{const{currentPage:n=0,pagesCount:r=0}=e??{},i=yl(),o=s=>`${i}/list-short-urls/${s}${t}`;if(r<=1)return m.jsx("div",{className:"pb-3"});const a=()=>YI(n,r).map((s,l)=>m.jsx(Hs,{disabled:Xd(s),active:n===s,children:m.jsx(Ws,{tag:Ft,to:o(s),children:qI(s)})},GI(s,l)));return m.jsxs(oO,{className:"sticky-card-paginator py-3",listClassName:"flex-wrap justify-content-center mb-0",children:[m.jsx(Hs,{disabled:n===1,children:m.jsx(Ws,{previous:!0,tag:Ft,to:o(n-1)})}),a(),m.jsx(Hs,{disabled:n>=r,children:m.jsx(Ws,{next:!0,tag:Ft,to:o(n+1)})})]})},che={field:"dateCreated",dir:"DESC"},uhe=(e,t)=>ss(({listShortUrls:n,shortUrlsList:r})=>{var W,ee,q;const{page:i}=pl(),o=gn(),[a,s]=$y(),l=BO(),{tags:c,search:f,startDate:d,endDate:p,orderBy:g,tagsMode:v,excludeBots:y,excludePastValidUntil:x,excludeMaxVisitsReached:b}=a,[w,S]=B.useState(g??((W=l.shortUrlsList)==null?void 0:W.defaultOrdering)??che),{pagination:C}=(r==null?void 0:r.shortUrls)??{},k=y??((ee=l.visits)==null?void 0:ee.excludeBots),P=Eh("excludeBotsOnShortUrls"),j=(Q,oe)=>{s({orderBy:{field:Q,dir:oe}}),S({field:Q,dir:oe})},N=Q=>()=>j(Q,Ly(Q,w.field,w.dir)),H=Q=>m.jsx(td,{currentOrder:w,field:Q}),R=Mt(Q=>[...new Set([...c,Q])],Q=>s({tags:Q})),V=({field:Q,dir:oe})=>P&&k&&Q==="visits"?{field:"nonBotVisits",dir:oe}:{field:Q,dir:oe};return B.useEffect(()=>{n({page:i,searchTerm:f,tags:c,startDate:d,endDate:p,orderBy:V(w),tagsMode:v,excludePastValidUntil:x,excludeMaxVisitsReached:b})},[i,f,c,d,p,w.field,w.dir,v,x,b]),m.jsxs(m.Fragment,{children:[m.jsx(t,{shortUrlsAmount:(q=r.shortUrls)==null?void 0:q.pagination.totalItems,order:w,handleOrderBy:j,className:"mb-3"}),m.jsxs(Yr,{body:!0,className:"pb-0",children:[m.jsx(e,{shortUrlsList:r,orderByColumn:N,renderOrderIcon:H,onTagClick:R}),m.jsx(lhe,{paginator:C,currentQueryString:o.search})]})]})},()=>[di.visits]);const fhe=e=>({orderByColumn:t,renderOrderIcon:n,shortUrlsList:r,onTagClick:i,className:o})=>{const{error:a,loading:s,shortUrls:l}=r,c=Ee({"short-urls-table__header-cell--with-action":!!t}),f=Ee("short-urls-table__header-cell",c),d=Ee("table table-hover responsive-table short-urls-table",o),p=()=>a?m.jsx("tr",{children:m.jsx("td",{colSpan:6,className:"text-center table-danger text-dark",children:"Something went wrong while loading short URLs :("})}):s?m.jsx("tr",{children:m.jsx("td",{colSpan:6,className:"text-center",children:"Loading..."})}):!s&&Kn(l==null?void 0:l.data)?m.jsx("tr",{children:m.jsx("td",{colSpan:6,className:"text-center",children:"No results found"})}):l==null?void 0:l.data.map(g=>m.jsx(e,{shortUrl:g,onTagClick:i},g.shortUrl));return m.jsxs("table",{className:d,children:[m.jsx("thead",{className:"responsive-table__header short-urls-table__header",children:m.jsxs("tr",{children:[m.jsxs("th",{className:f,onClick:t==null?void 0:t("dateCreated"),children:["Created at ",n==null?void 0:n("dateCreated")]}),m.jsxs("th",{className:f,onClick:t==null?void 0:t("shortCode"),children:["Short URL ",n==null?void 0:n("shortCode")]}),m.jsxs("th",{className:"short-urls-table__header-cell",children:[m.jsxs("span",{className:c,onClick:t==null?void 0:t("title"),children:["Title ",n==null?void 0:n("title")]}),"  /  ",m.jsxs("span",{className:c,onClick:t==null?void 0:t("longUrl"),children:[m.jsx("span",{className:"indivisible",children:"Long URL"})," ",n==null?void 0:n("longUrl")]})]}),m.jsx("th",{className:"short-urls-table__header-cell",children:"Tags"}),m.jsx("th",{className:f,onClick:t==null?void 0:t("visits"),children:m.jsxs("span",{className:"indivisible",children:["Visits ",n==null?void 0:n("visits")]})}),m.jsx("th",{className:"short-urls-table__header-cell",colSpan:2})]})}),m.jsx("tbody",{children:p()})]})},dhe=(e,t)=>{e.serviceFactory("ShortUrlsList",uhe,"ShortUrlsTable","ShortUrlsFilteringBar"),e.decorator("ShortUrlsList",t(["mercureInfo","shortUrlsList"],["listShortUrls","createNewVisits","loadMercureInfo"])),e.serviceFactory("ShortUrlsTable",fhe,"ShortUrlsRow"),e.serviceFactory("ShortUrlsRow",ide,"ShortUrlsRowMenu","ColorGenerator","useTimeoutToggle"),e.serviceFactory("ShortUrlsRowMenu",ode,"DeleteShortUrlModal","QrCodeModal"),e.serviceFactory("CreateShortUrlResult",qfe,"useTimeoutToggle"),e.serviceFactory("ShortUrlForm",nhe,"TagsSelector","DomainSelector"),e.serviceFactory("CreateShortUrl",ffe,"ShortUrlForm","CreateShortUrlResult"),e.decorator("CreateShortUrl",t(["shortUrlCreation"],["createShortUrl","resetCreateShortUrl"])),e.serviceFactory("EditShortUrl",Pfe,"ShortUrlForm"),e.decorator("EditShortUrl",t(["shortUrlDetail","shortUrlEdition"],["getShortUrlDetail","editShortUrl"])),e.serviceFactory("DeleteShortUrlModal",()=>Gfe),e.decorator("DeleteShortUrlModal",t(["shortUrlDeletion"],["deleteShortUrl","shortUrlDeleted","resetDeleteShortUrl"])),e.serviceFactory("QrCodeModal",Jfe,"ImageDownloader"),e.serviceFactory("ShortUrlsFilteringBar",she,"ExportShortUrlsBtn","TagsSelector"),e.serviceFactory("ExportShortUrlsBtn",Kfe,"apiClientFactory","ReportExporter"),e.serviceFactory("shortUrlsListReducerCreator",Zue,"listShortUrls","editShortUrl","createShortUrl"),e.serviceFactory("shortUrlsListReducer",ct("reducer"),"shortUrlsListReducerCreator"),e.serviceFactory("shortUrlCreationReducerCreator",sde,"createShortUrl"),e.serviceFactory("shortUrlCreationReducer",ct("reducer"),"shortUrlCreationReducerCreator"),e.serviceFactory("shortUrlEditionReducerCreator",fde,"editShortUrl"),e.serviceFactory("shortUrlEditionReducer",ct("reducer"),"shortUrlEditionReducerCreator"),e.serviceFactory("shortUrlDeletionReducerCreator",que,"deleteShortUrl"),e.serviceFactory("shortUrlDeletionReducer",ct("reducer"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDetailReducerCreator",lde,"apiClientFactory"),e.serviceFactory("shortUrlDetailReducer",ct("reducer"),"shortUrlDetailReducerCreator"),e.serviceFactory("listShortUrls",Kue,"apiClientFactory"),e.serviceFactory("createShortUrl",ade,"apiClientFactory"),e.serviceFactory("resetCreateShortUrl",ct("resetCreateShortUrl"),"shortUrlCreationReducerCreator"),e.serviceFactory("deleteShortUrl",Yue,"apiClientFactory"),e.serviceFactory("resetDeleteShortUrl",ct("resetDeleteShortUrl"),"shortUrlDeletionReducerCreator"),e.serviceFactory("shortUrlDeleted",()=>yI),e.serviceFactory("getShortUrlDetail",ct("getShortUrlDetail"),"shortUrlDetailReducerCreator"),e.serviceFactory("editShortUrl",ude,"apiClientFactory")},hhe=({tag:e,toggle:t,isOpen:n,deleteTag:r,tagDelete:i,tagDeleted:o})=>{const{deleting:a,error:s,deleted:l,errorData:c}=i,f=async()=>{await r(e),t()};return m.jsxs(Zo,{toggle:t,isOpen:n,centered:!0,onClosed:()=>l&&o(e),children:[m.jsx(Qo,{toggle:t,className:"text-danger",children:"Delete tag"}),m.jsxs(fo,{children:["Are you sure you want to delete tag ",m.jsx("b",{children:e}),"?",s&&m.jsx(zr,{type:"error",small:!0,className:"mt-2",children:m.jsx(zo,{errorData:c,fallbackMessage:"Something went wrong while deleting the tag :("})})]}),m.jsxs(ml,{children:[m.jsx(yt,{color:"link",onClick:t,children:"Cancel"}),m.jsx(yt,{color:"danger",disabled:a,onClick:f,children:a?"Deleting tag...":"Delete tag"})]})]})};function Vy(){return(Vy=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function Px(e){var t=B.useRef(e),n=B.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Jd=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:x.buttons>0)&&i.current?o(xj(i.current,x,s.current)):y(!1)},v=function(){return y(!1)};function y(x){var b=l.current,w=Tx(i.current),S=x?w.addEventListener:w.removeEventListener;S(b?"touchmove":"mousemove",g),S(b?"touchend":"mouseup",v)}return[function(x){var b=x.nativeEvent,w=i.current;if(w&&(Sj(b),!function(C,k){return k&&!nd(C)}(b,l.current)&&w)){if(nd(b)){l.current=!0;var S=b.changedTouches||[];S.length&&(s.current=S[0].identifier)}w.focus(),o(xj(w,b,s.current)),y(!0)}},function(x){var b=x.which||x.keyCode;b<37||b>40||(x.preventDefault(),a({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},y]},[a,o]),f=c[0],d=c[1],p=c[2];return B.useEffect(function(){return p},[p]),Y.createElement("div",Vy({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),YO=function(e){return e.filter(Boolean).join(" ")},QI=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=YO(["react-colorful__pointer",e.className]);return Y.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},Y.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Yn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},phe=function(e){return _he(Mx(e))},Mx=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?Yn(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?Yn(parseInt(e.substring(6,8),16)/255,2):1}},mhe=function(e){return yhe(vhe(e))},ghe=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Yn(e.h),s:Yn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Yn(i/2),a:Yn(r,2)}},jx=function(e){var t=ghe(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},vhe=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),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:Yn(255*[r,s,a,a,l,r][c]),g:Yn(255*[l,r,r,s,a,a][c]),b:Yn(255*[a,a,l,r,r,s][c]),a:Yn(i,2)}},rm=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yhe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?rm(Yn(255*i)):"";return"#"+rm(t)+rm(n)+rm(r)+o},_he=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Yn(60*(s<0?s+6:s)),s:Yn(o?a/o*100:0),v:Yn(o/255*100),a:i}},bhe=Y.memo(function(e){var t=e.hue,n=e.onChange,r=YO(["react-colorful__hue",e.className]);return Y.createElement("div",{className:r},Y.createElement(ZI,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Jd(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Yn(t),"aria-valuemax":"360","aria-valuemin":"0"},Y.createElement(QI,{className:"react-colorful__hue-pointer",left:t/360,color:jx({h:t,s:100,v:100,a:1})})))}),whe=Y.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:jx({h:t.h,s:100,v:100,a:1})};return Y.createElement("div",{className:"react-colorful__saturation",style:r},Y.createElement(ZI,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Jd(t.s+100*i.left,0,100),v:Jd(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Yn(t.s)+"%, Brightness "+Yn(t.v)+"%"},Y.createElement(QI,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:jx(t)})))}),XI=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xhe=function(e,t){return e.toLowerCase()===t.toLowerCase()||XI(Mx(e),Mx(t))};function She(e,t,n){var r=Px(n),i=B.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=B.useRef({color:t,hsva:o});B.useEffect(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},a(c)}},[t,e]),B.useEffect(function(){var c;XI(o,s.current.hsva)||e.equal(c=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:c},r(c))},[o,e,r]);var l=B.useCallback(function(c){a(function(f){return Object.assign({},f,c)})},[]);return[o,l]}var Ohe=typeof window<"u"?B.useLayoutEffect:B.useEffect,Che=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Oj=new Map,Ehe=function(e){Ohe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Oj.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}`,Oj.set(t,n);var r=Che();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},khe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=KI(e,["className","colorModel","color","onChange"]),s=B.useRef(null);Ehe(s);var l=She(n,i,o),c=l[0],f=l[1],d=YO(["react-colorful",t]);return Y.createElement("div",Vy({},a,{ref:s,className:d}),Y.createElement(whe,{hsva:c,onChange:f}),Y.createElement(bhe,{hue:c.h,onChange:f,className:"react-colorful__last-control"}))},Phe={defaultColor:"000",toHsva:phe,fromHsva:function(e){return mhe({h:e.h,s:e.s,v:e.v,a:1})},equal:xhe},The=function(e){return Y.createElement(khe,Vy({},e,{colorModel:Phe}))};const Mhe=({getColorForKey:e})=>({tag:t,editTag:n,toggle:r,tagEdited:i,isOpen:o,tagEdit:a})=>{const[s,l]=B.useState(t),[c,f]=B.useState(e(t)),[d,p,,g]=mn(),{editing:v,error:y,edited:x,errorData:b}=a,w=Iy(async()=>{await n({oldName:t,newName:s,color:c}),r()}),S=Mt(g,()=>x&&i({oldName:t,newName:s,color:c}));return m.jsx(Zo,{isOpen:o,toggle:r,centered:!0,onClosed:S,children:m.jsxs("form",{name:"editTag",onSubmit:w,children:[m.jsx(Qo,{toggle:r,children:"Edit tag"}),m.jsxs(fo,{children:[m.jsxs(My,{children:[m.jsx("div",{id:"colorPickerBtn",className:"input-group-text edit-tag-modal__color-picker-toggle",style:{backgroundColor:c,borderColor:c},onClick:p,children:m.jsx(Ie,{icon:VG,className:"edit-tag-modal__color-icon"})}),m.jsx(iO,{isOpen:d,toggle:p,target:"colorPickerBtn",placement:"right",hideArrow:!0,popperClassName:"edit-tag-modal__popover",children:m.jsx(The,{color:c,onChange:f})}),m.jsx(Zc,{value:s,placeholder:"Tag",required:!0,onChange:({target:C})=>l(C.value)})]}),y&&m.jsx(zr,{type:"error",small:!0,className:"mt-2",children:m.jsx(zo,{errorData:b,fallbackMessage:"Something went wrong while editing the tag :("})})]}),m.jsxs(ml,{children:[m.jsx(yt,{type:"button",color:"link",onClick:r,children:"Cancel"}),m.jsx(yt,{color:"primary",disabled:v,children:v?"Saving...":"Save"})]})]})})},Ms={Enter:"Enter",Escape:"Escape",Tab:"Tab",Backspace:"Backspace",UpArrow:"ArrowUp",UpArrowCompat:"Up",DownArrow:"ArrowDown",DownArrowCompat:"Down",PageDown:"PageDown",PageUp:"PageUp"},qO=Symbol("Create new tag"),JI=Symbol("No options"),Kl=()=>{},In=Y.createContext(void 0);function Cj(e,t){return e===t?[]:e.filter(n=>!t.includes(n))}function jhe(e){return e.selectionStart===0&&e.selectionEnd===0}function Dhe(e){const t=e.value.length;return e.selectionStart===t&&e.selectionEnd===t}function Hy(e){return`${e}-label`}function Lhe(e){return`${e}-combobox`}function Rhe(e){return`${e}-input`}function e5(e){return`${e}-listbox`}function t5(e,t){return`${e}-option-${Uhe(t)}`}function Nhe(e,t){if((e==null?void 0:e.value)===qO&&e.disabled===!1)return{value:t,label:t}}function Ahe(e){const t=Nhe(e.activeOption,e.value)||e.activeOption||Whe(e.value,e.options);return t&&!t.disabled?t:void 0}function Ihe(e,t,n){const r=t-1;return e>r?n:en===e.value)}const zhe=/[-\\^$*+?.()|[\]{}]/g;function n5(e){return e.replace(zhe,"\\$&")}function r5(e){return new RegExp(n5(e),"i")}function Vhe(e){return new RegExp(`^${n5(e)}$`,"i")}function Hhe(e,t){if(e){const n=r5(e);return t.filter(r=>n.test(r.label))}else return[].concat(t)}function Whe(e,t){const n=Vhe(e);return t.find(r=>n.test(r.label))||null}const Yhe={autoComplete:"off",autoCorrect:"off","data-form-type":"other",spellCheck:!1};function qhe({allowBackspace:e,ariaDescribedBy:t,ariaErrorMessage:n,delimiterKeys:r}){const{id:i,comboBoxRef:o,inputRef:a,isDisabled:s,isInvalid:l,managerRef:c}=B.useContext(In),f=B.useMemo(()=>{const v=R=>{const V=R.currentTarget.value;c.current.updateInputValue(V),document.activeElement===a.current&&c.current.listBoxExpand()},y=()=>{c.current.listBoxExpand()},x=R=>{var V;((V=o.current)==null?void 0:V.contains(R.relatedTarget))===!1&&c.current.listBoxCollapse()},b=()=>{c.current.listBoxExpand()},w=R=>{const{activeIndex:V,isExpanded:W}=c.current.state;W?(R.preventDefault(),c.current.updateActiveIndex(V+1)):(Dhe(R.currentTarget)||R.altKey)&&(R.preventDefault(),c.current.listBoxExpand())},S=R=>{const{activeIndex:V,isExpanded:W}=c.current.state;W?(R.preventDefault(),c.current.updateActiveIndex(V-1)):jhe(R.currentTarget)&&(R.preventDefault(),c.current.listBoxExpand())},C=R=>{const{isExpanded:V,options:W}=c.current.state;V&&(R.preventDefault(),c.current.updateActiveIndex(W.length-1))},k=R=>{c.current.state.isExpanded&&(R.preventDefault(),c.current.updateActiveIndex(0))},P=()=>{c.current.state.isExpanded?c.current.listBoxCollapse():c.current.updateInputValue("")},j=()=>{if(e){const{value:R,selected:V}=c.current.state,W=V[V.length-1];R===""&&W&&c.current.selectTag(W)}},N=R=>{c.current.state.isExpanded&&(R.preventDefault(),c.current.selectTag())};return{onBlur:x,onChange:v,onClick:b,onFocus:y,onKeyDown:R=>{if(R.key===Ms.UpArrow)return S(R);if(R.key===Ms.DownArrow)return w(R);if(R.key===Ms.PageUp)return k(R);if(R.key===Ms.PageDown)return C(R);if(R.key===Ms.Escape)return P();if(R.key===Ms.Backspace)return j();if(r.includes(R.key))return N(R)}}},[e,o,r,a,c]),{activeOption:d,isExpanded:p,value:g}=c.current.state;return{...Yhe,"aria-autocomplete":"list","aria-activedescendant":d?t5(i,d):void 0,"aria-controls":e5(i),"aria-describedby":t||void 0,"aria-disabled":s,"aria-errormessage":l&&n||void 0,"aria-invalid":l,"aria-labelledby":Hy(i),"aria-expanded":p,id:Rhe(i),onBlur:s?Kl:f.onBlur,onChange:s?Kl:f.onChange,onClick:s?Kl:f.onClick,onFocus:s?Kl:f.onFocus,onKeyDown:s?Kl:f.onKeyDown,ref:a,role:"combobox",type:"text",value:g}}const Ghe={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},Khe=["font-family","font-size","font-style","font-weight","letter-spacing","text-transform"];function Zhe({allowResize:e=!0,text:t}){const n=B.useRef(null),{inputRef:r}=B.useContext(In),[i,o]=B.useState(null);return B.useLayoutEffect(()=>{if(e&&r.current&&n.current&&window.getComputedStyle){const a=window.getComputedStyle(r.current);Khe.forEach(s=>{const l=a.getPropertyValue(s);n.current.style.setProperty(s,l)})}},[e,r,n]),B.useLayoutEffect(()=>{var a;if(e){const s=Math.ceil(((a=n.current)==null?void 0:a.scrollWidth)??0)+2;i!==s&&o(s)}},[e,t,i]),{width:i,sizerProps:{ref:n,style:Ghe}}}function Qhe(){const{id:e,inputRef:t,listBoxRef:n,managerRef:r}=B.useContext(In),i=r.current.state.activeIndex===-1,o=B.useCallback(a=>{var s;a.target!==t.current&&((s=t.current)==null||s.focus({preventScroll:!0}))},[t]);return B.useEffect(()=>{var a;i&&((a=n.current)==null||a.scrollTo({top:0}))},[n,i]),{"aria-labelledby":Hy(e),id:e5(e),onFocus:o,ref:n,role:"listbox",tabIndex:-1}}function Xhe({activateFirstOption:e,allowNew:t,collapseOnSelect:n,newOptionText:r,noOptionsText:i,onAdd:o,onDelete:a,onCollapse:s,onExpand:l,onInput:c,onShouldCollapse:f,onShouldExpand:d,onValidate:p,selected:g,suggestions:v,suggestionsTransform:y}){const x=B.useRef(),[b,w]=B.useState(null),[S,C]=B.useState(!1),[k,P]=B.useState(""),j=B.useMemo(()=>{const q=y(k,v);return k&&(t&&q.push({disabled:typeof p=="function"?!p(k):!1,label:r,value:qO}),q.length===0&&q.push({disabled:!0,label:i,value:JI})),q},[t,r,i,p,v,y,k]),N=b?Lx(b,j):-1,H=e?Math.max(N,0):N,R=j[H],V={activeIndex:H,activeOption:R,isExpanded:S,options:j,selected:g,value:k},W={tagsAdded:x.current?Cj(g,x.current.state.selected):[],tagsDeleted:x.current?Cj(x.current.state.selected,g):[]},ee={listBoxCollapse(){S&&((f==null?void 0:f(V.value))??!0)&&(C(!1),w(null),s==null||s())},listBoxExpand(){!S&&((d==null?void 0:d(V.value))??!0)&&(C(!0),w(j[H]),l==null||l())},updateActiveIndex(q){const Q=Ihe(q,j.length,e?0:-1);w(j[Q])},updateInputValue(q){k!==q&&(P(q),c==null||c(q))},selectTag(q){if(q??(q=Ahe(V)),q){const Q=Lx(q,V.selected);Q>-1?a(Q):o(q),n&&this.listBoxCollapse(),this.updateInputValue("")}}};return x.current={...ee,flags:W,state:V},x}function Jhe(e){const{id:t,inputRef:n,managerRef:r}=B.useContext(In),i=B.useRef(null),o=r.current.state.options[e],a=e===r.current.state.activeIndex,s=o.disabled??!1,l=Lx(o,r.current.state.selected)>-1,c=B.useCallback(()=>{var d;r.current.selectTag(),(d=n.current)==null||d.focus()},[n,r]),f=B.useCallback(()=>{e!==r.current.state.activeIndex&&r.current.updateActiveIndex(e)},[e,r]);return B.useEffect(()=>{var d;a&&((d=i.current)==null||d.scrollIntoView({block:"nearest",inline:"start"}))},[a,r.current.state.options]),{option:{...o,active:a,disabled:s,index:e,selected:l},optionProps:{"aria-disabled":s,"aria-posinset":e+1,"aria-selected":s?void 0:l,"aria-setsize":r.current.state.options.length,id:t5(t,o),onClick:c,onMouseDown:f,ref:i,role:"option",tabIndex:-1}}}function epe({inputRef:e,managerRef:t}){return B.useRef({input:{blur(){var r;(r=e.current)==null||r.blur()},focus(){var r;(r=e.current)==null||r.focus()},get value(){return t.current.state.value},set value(r){typeof r!="string"&&(r=String(r)),t.current.updateInputValue(r)}},listBox:{collapse(){t.current.listBoxCollapse()},expand(){t.current.listBoxExpand()},get activeOption(){return t.current.state.activeOption},get isExpanded(){return t.current.state.isExpanded}},select(r){t.current.selectTag(r)}}).current}function tpe({onBlur:e,onFocus:t}){const[n,r]=B.useState(!1),{id:i,inputRef:o}=B.useContext(In),a=B.useRef(null),s=B.useMemo(()=>({"aria-describedby":Hy(i),id:i,onFocus(){r(!0),t==null||t()},onBlur(){var l;(l=a.current)!=null&&l.contains(document.activeElement)||(r(!1),e==null||e())},onClick(){var l;document.activeElement===a.current&&((l=o.current)==null||l.focus())},ref:a,tabIndex:-1}),[o,i,e,t,a]);return{isActive:n,rootProps:s}}function npe(e,t){const{isDisabled:n,managerRef:r}=B.useContext(In),i=r.current.state.selected[e],o=B.useCallback(()=>r.current.selectTag(i),[r,i]);return{tag:i,tagProps:{"aria-disabled":n,title:Ev(t,i.label),onClick:n?Kl:o}}}function rpe(){var e;const{inputRef:t,managerRef:n}=B.useContext(In),r=B.useRef(),i=n.current.flags.tagsDeleted.length,o=(e=r.current)==null?void 0:e.contains(document.activeElement);return B.useLayoutEffect(()=>{var a,s;if(i){const l=(a=r.current)==null?void 0:a.contains(document.activeElement);o&&!l&&((s=t.current)==null||s.focus({preventScroll:!0}))}},[t,o,r,i]),{listRef:r}}const ipe={position:"absolute",width:1,height:1,left:-9999,overflow:"hidden",clip:"rect(0 0 0 0)"};function ope({ariaAddedText:e,ariaDeletedText:t}){const{managerRef:n}=B.useContext(In),r=B.useRef([]);return n.current.flags.tagsAdded.forEach(i=>{r.current.push(Ev(e,i.label))}),n.current.flags.tagsDeleted.forEach(i=>{r.current.push(Ev(t,i.label))}),Y.createElement("div",{"aria-live":"polite","aria-relevant":"additions",role:"status",style:ipe},r.current.join(` -`))}function ape({children:e}){const{classNames:t,comboBoxRef:n,id:r}=B.useContext(In);return Y.createElement("div",{className:t.comboBox,id:Lhe(r),ref:n},e)}const spe=({classNames:e,text:t})=>Y.createElement("mark",{className:e.highlight},t);function lpe({option:e,query:t,render:n=spe}){const{classNames:r}=B.useContext(In);if(e.value===qO||e.value===JI)return Y.createElement(Y.Fragment,null,Ev(e.label,t));if(t){const i=$he(e.label,t);if(i){const o=n({text:i[1],classNames:r});return Y.createElement(Y.Fragment,null,i[0],o,i[2])}}return Y.createElement(Y.Fragment,null,e.label)}const cpe=Y.memo(lpe),upe=({classNames:e,inputWidth:t,...n})=>Y.createElement("input",{className:e.input,style:{width:t},...n});function fpe({allowBackspace:e=!0,allowResize:t=!0,ariaDescribedBy:n,ariaErrorMessage:r,delimiterKeys:i,placeholderText:o,render:a=upe}){const{classNames:s}=B.useContext(In),{value:l,...c}=qhe({allowBackspace:e,ariaDescribedBy:n,ariaErrorMessage:r,delimiterKeys:i}),f=l.lengthY.createElement("div",{className:t.label,id:n},e);function hpe({children:e,render:t=dpe}){const{classNames:n,id:r}=B.useContext(In);return t({children:e,classNames:n,id:Hy(r)})}function ppe({children:e}){const{classNames:t,managerRef:n}=B.useContext(In),r=Qhe();return!n.current.state.isExpanded||Y.Children.count(e)===0?null:Y.createElement("div",{className:t.listBox,...r},e)}const mpe=({children:e,classNames:t,option:n,...r})=>{const i=[t.option];return n.active&&i.push(t.optionIsActive),Y.createElement("div",{className:i.join(" "),...r},e)};function gpe({children:e,index:t,render:n=mpe}){const{classNames:r}=B.useContext(In),{option:i,optionProps:o}=Jhe(t);return n({classNames:r,children:e,option:i,...o})}const vpe=({children:e,classNames:t,isActive:n,isDisabled:r,isInvalid:i,...o})=>{const a=[t.root];return n&&a.push(t.rootIsActive),r&&a.push(t.rootIsDisabled),i&&a.push(t.rootIsInvalid),Y.createElement("div",{className:a.join(" "),...o},e)};function ype({children:e,onBlur:t,onFocus:n,render:r=vpe}){const{classNames:i,isDisabled:o,isInvalid:a}=B.useContext(In),{isActive:s,rootProps:l}=tpe({onBlur:t,onFocus:n});return r({children:e,classNames:i,isActive:s,isDisabled:o,isInvalid:a,...l})}const _pe=({classNames:e,tag:t,...n})=>Y.createElement("button",{type:"button",className:e.tag,...n},Y.createElement("span",{className:e.tagName},t.label));function bpe({render:e=_pe,index:t,title:n}){const{classNames:r}=B.useContext(In),{tag:i,tagProps:o}=npe(t,n);return e({classNames:r,tag:i,...o})}function wpe({children:e,label:t}){const{classNames:n}=B.useContext(In),{listRef:r}=rpe();return Y.createElement("ul",{className:n.tagList,"aria-label":t,ref:r,role:"list"},e.map(i=>Y.createElement("li",{className:n.tagListItem,key:i.key,role:"listitem"},i)))}const xpe={root:"react-tags",rootIsActive:"is-active",rootIsDisabled:"is-disabled",rootIsInvalid:"is-invalid",label:"react-tags__label",tagList:"react-tags__list",tagListItem:"react-tags__list-item",tag:"react-tags__tag",tagName:"react-tags__tag-name",comboBox:"react-tags__combobox",input:"react-tags__combobox-input",listBox:"react-tags__listbox",option:"react-tags__listbox-option",optionIsActive:"is-active",highlight:"react-tags__listbox-option-highlight"},Spe=[Ms.Enter];function Ope({activateFirstOption:e=!1,allowBackspace:t=!0,allowNew:n=!1,allowResize:r=!0,ariaAddedText:i="Added tag %value%",ariaDescribedBy:o,ariaErrorMessage:a,ariaDeletedText:s="Removed tag %value%",classNames:l=xpe,collapseOnSelect:c=!1,deleteButtonText:f="Remove %value% from the list",delimiterKeys:d=Spe,id:p="react-tags",isDisabled:g=!1,isInvalid:v=!1,labelText:y="Select tags",newOptionText:x="Add %value%",noOptionsText:b="No options found for %value%",onAdd:w,onBlur:S,onCollapse:C,onDelete:k,onExpand:P,onFocus:j,onInput:N,onShouldCollapse:H,onShouldExpand:R,onValidate:V,placeholderText:W="Add a tag",renderHighlight:ee,renderInput:q,renderLabel:Q,renderOption:oe,renderRoot:le,renderTag:G,selected:F=[],suggestions:A=[],suggestionsTransform:z=Hhe,tagListLabelText:re="Selected tags"},U){const K=B.useRef(null),ie=B.useRef(null),ae=B.useRef(null),he=Xhe({activateFirstOption:e,allowNew:n,collapseOnSelect:c,newOptionText:x,noOptionsText:b,onAdd:w,onDelete:k,onCollapse:C,onExpand:P,onInput:N,onShouldCollapse:H,onShouldExpand:R,onValidate:V,selected:F,suggestions:A,suggestionsTransform:z}),E=epe({inputRef:ie,managerRef:he});return U&&(typeof U=="function"?U(E):U.current=E),Y.createElement(In.Provider,{value:{classNames:l,comboBoxRef:K,id:p,inputRef:ie,isDisabled:g,isInvalid:v,listBoxRef:ae,managerRef:he}},Y.createElement(ype,{onBlur:S,onFocus:j,render:le},Y.createElement(hpe,{render:Q},y),Y.createElement(wpe,{label:re},he.current.state.selected.map((M,I)=>Y.createElement(bpe,{key:Dx(M),index:I,render:G,title:f}))),Y.createElement(ape,null,Y.createElement(fpe,{allowBackspace:t,allowResize:r,ariaDescribedBy:o,ariaErrorMessage:a,delimiterKeys:d,placeholderText:W,render:q}),Y.createElement(ppe,null,he.current.state.options.map((M,I)=>Y.createElement(gpe,{key:Dx(M),index:I,render:oe},Y.createElement(cpe,{option:M,query:he.current.state.value,render:ee}))))),Y.createElement(ope,{ariaAddedText:i,ariaDeletedText:s})))}const Cpe=Y.forwardRef(Ope);const i5=({tag:e,colorGenerator:t})=>m.jsx("div",{style:{backgroundColor:t.getColorForKey(e)},className:"tag-bullet"}),Ej=e=>({label:e,value:e}),Epe=e=>({selectedTags:t,onChange:n,placeholder:r,listTags:i,tagsList:o,allowNew:a=!0})=>{const s=bl("shortUrlCreation");B.useEffect(()=>{i()},[]);const l=(s==null?void 0:s.tagFilteringMode)??"startsWith",c=({tag:d,onClick:p})=>m.jsx(zO,{colorGenerator:e,text:d.label,clearable:!0,className:"react-tags__tag",onClose:()=>p==null?void 0:p(d.label)}),f=({option:d})=>m.jsxs(m.Fragment,{children:[m.jsx(i5,{tag:`${d.label}`,colorGenerator:e}),d.label]});return m.jsx(Cpe,{selected:t.map(Ej),suggestions:o.tags.filter(d=>!t.includes(d)).map(Ej),renderTag:c,renderOption:f,allowNew:a,placeholderText:r??"Add tags to the URL",onShouldExpand:d=>d.length>1,delimiterKeys:["Enter","Tab",","],suggestionsTransform:l==="includes"?(d,p)=>p.filter(({label:g})=>g.includes(d)):void 0,onDelete:d=>{const p=[...t];p.splice(d,1),n(p)},onAdd:({label:d})=>n([...new Set([...t,...d.toLowerCase().split(",")])])})},Rx="shlink/tagDelete",kpe={deleting:!1,deleted:!1,error:!1},o5=jn(`${Rx}/tagDeleted`),Ppe=e=>{const t=Mr(`${Rx}/deleteTag`,async r=>{await e().deleteTags([r])}),{reducer:n}=sr({name:Rx,initialState:kpe,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:Jo(o)})),r.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:n,deleteTag:t}},GO="shlink/tagEdit",Tpe={editing:!1,edited:!1,error:!1},a5=jn(`${GO}/tagEdited`),Mpe=(e,t)=>Mr(`${GO}/editTag`,async({oldName:n,newName:r,color:i})=>(await e().editTag(n,r),t.setColorForKey(r,i),{oldName:n,newName:r,color:i})),jpe=e=>sr({name:GO,initialState:Tpe,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:Jo(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({...xS(["oldName","newName"],r),editing:!1,edited:!0,error:!1}))}}),KO="shlink/tagsList",tb={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},kj=(e,t)=>n=>n===e?t:n,Pj=(e,t)=>fh(n=>n===t,e),Dpe=(e,t)=>e.reduce((n,[r,i])=>{if(!n[r])return n;const{bots:o,nonBots:a}=i,s=n[r];return{...n,[r]:{...s,visitsSummary:s.visitsSummary&&{total:s.visitsSummary.total+o+a,bots:s.visitsSummary.bots+o,nonBots:s.visitsSummary.nonBots+a},visitsCount:s.visitsCount+o+a}}},{...t}),Lpe=e=>Object.entries(e.reduce((t,{shortUrl:n,visit:r})=>(n==null||n.tags.forEach(i=>{t[i]||(t[i]={bots:0,nonBots:0}),r.potentialBot?t[i].bots+=1:t[i].nonBots+=1}),t),{})),Rpe=(e,t=!0)=>Mr(`${KO}/listTags`,async(n,{getState:r})=>{const{tagsList:i}=r();if(!t&&!Kn(i.tags))return i;const{tags:o,stats:a}=await e().tagsStats(),s=a.reduce((l,{tag:c,...f})=>(l[c]=f,l),{});return{tags:o,stats:s}}),s5=jn(`${KO}/filterTags`),Npe=(e,t)=>sr({name:KO,initialState:tb,reducers:{},extraReducers:n=>{n.addCase(s5,(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})=>({...tb,error:!0,errorData:Jo(i)})),n.addCase(e.fulfilled,(r,{payload:i})=>({...tb,stats:i.stats,tags:i.tags,filteredTags:i.tags})),n.addCase(o5,({tags:r,filteredTags:i,...o},{payload:a})=>({...o,tags:Pj(r,a),filteredTags:Pj(i,a)})),n.addCase(a5,({tags:r,filteredTags:i,stats:o,...a},{payload:s})=>({...a,stats:{...o,[s.newName]:o[s.oldName]},tags:r.map(kj(s.oldName,s.newName)).sort(),filteredTags:i.map(kj(s.oldName,s.newName)).sort()})),n.addCase(Th,(r,{payload:i})=>({...r,stats:Dpe(Lpe(i.createdVisits),r.stats)})),n.addCase(t.fulfilled,({tags:r,...i},{payload:o})=>({...i,tags:r.concat(o.tags.filter(a=>!r.includes(a)))}))}}),Ape={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},Ipe=e=>ss(({filterTags:t,forceListTags:n,tagsList:r})=>{var f;const i=BO(),[o,a]=B.useState(((f=i.tags)==null?void 0:f.defaultOrdering)??{}),s=Mt(()=>r.filteredTags.map(d=>{var v,y,x;const p=r.stats[d],g=((v=i.visits)!=null&&v.excludeBots?(y=p==null?void 0:p.visitsSummary)==null?void 0:y.nonBots:(x=p==null?void 0:p.visitsSummary)==null?void 0:x.total)??(p==null?void 0:p.visitsCount)??0;return{tag:d,visits:g,shortUrls:(p==null?void 0:p.shortUrlsCount)??0}}),d=>r6(d,o));if(B.useEffect(()=>{n()},[]),r.loading)return m.jsx(Do,{loading:!0});if(r.error)return m.jsx(zr,{type:"error",children:m.jsx(zo,{errorData:r.errorData,fallbackMessage:"Error loading tags :("})});const l=d=>()=>{const p=Ly(d,o.field,o.dir);a({field:p?d:void 0,dir:p})},c=()=>{if(r.filteredTags.length<1)return m.jsx(Do,{children:"No tags found"});const d=s();return m.jsx(e,{sortedTags:d,currentOrder:o,orderByColumn:l})};return m.jsxs(m.Fragment,{children:[m.jsx(xh,{className:"mb-3",onChange:t}),m.jsx(mr,{className:"mb-3",children:m.jsx("div",{className:"col-lg-6 offset-lg-6",children:m.jsx(Sh,{items:Ape,order:o,onChange:(d,p)=>a({field:d,dir:p})})})}),c()]})},()=>[di.visits]);const ZO=({pagesCount:e,currentPage:t,setCurrentPage:n,centered:r=!0})=>{if(e<2)return null;const i=o=>()=>!Xd(o)&&n(o);return m.jsxs(oO,{listClassName:Ee("flex-wrap mb-0 simple-paginator",{"justify-content-center":r}),children:[m.jsx(Hs,{disabled:t<=1,children:m.jsx(Ws,{previous:!0,tag:"span",onClick:i(t-1)})}),YI(t,e).map((o,a)=>m.jsx(Hs,{disabled:Xd(o),active:t===o,children:m.jsx(Ws,{role:"link",tag:"span",onClick:i(o),children:qI(o)})},GI(o,a))),m.jsx(Hs,{disabled:t>=e,children:m.jsx(Ws,{next:!0,tag:"span",onClick:i(t+1)})})]})};const Fpe=20,$pe=e=>({sortedTags:t,orderByColumn:n,currentOrder:r})=>{const i=B.useRef(!0),{search:o}=gn(),{page:a=1}=vl(o),[s,l]=Efe("page",Number(a)),c=Dd(Fpe,t),f=c.length>1,d=c[s-1]??[];return B.useEffect(()=>{!i.current&&l(1),i.current=!1},[t]),B.useEffect(()=>{scrollTo(0,0)},[s]),m.jsxs(hn,{bodyClassName:f?"pb-1":"",children:[m.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[m.jsxs("thead",{className:"responsive-table__header",children:[m.jsxs("tr",{children:[m.jsxs("th",{className:"tags-table__header-cell",onClick:n("tag"),children:["Tag ",m.jsx(td,{currentOrder:r,field:"tag"})]}),m.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:n("shortUrls"),children:["Short URLs ",m.jsx(td,{currentOrder:r,field:"shortUrls"})]}),m.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:n("visits"),children:["Visits ",m.jsx(td,{currentOrder:r,field:"visits"})]}),m.jsx("th",{"aria-label":"Options",className:"tags-table__header-cell"})]}),m.jsx("tr",{children:m.jsx("th",{"aria-label":"Separator",colSpan:4,className:"p-0 border-top-0"})})]}),m.jsxs("tbody",{children:[d.length===0&&m.jsx("tr",{children:m.jsx("td",{colSpan:4,className:"text-center",children:"No results found"})}),d.map(p=>m.jsx(e,{tag:p},p.tag))]})]}),f&&m.jsx("div",{className:"sticky-card-paginator",children:m.jsx(ZO,{pagesCount:c.length,currentPage:s,setCurrentPage:l})})]},s)},Bpe=(e,t,n)=>({tag:r})=>{const[i,o]=mn(),[a,s]=mn(),l=yl();return m.jsxs("tr",{className:"responsive-table__row",children:[m.jsxs("th",{className:"responsive-table__cell","data-th":"Tag",children:[m.jsx(i5,{tag:r.tag,colorGenerator:n})," ",r.tag]}),m.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:m.jsx(Ft,{to:`${l}/list-short-urls/1?tags=${encodeURIComponent(r.tag)}`,children:wn(r.shortUrls)})}),m.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:m.jsx(Ft,{to:`${l}/tag/${r.tag}/visits`,children:wn(r.visits)})}),m.jsx("td",{className:"responsive-table__cell text-lg-end",children:m.jsxs(Dy,{children:[m.jsxs(Ue,{onClick:s,children:[m.jsx(Ie,{icon:jG,fixedWidth:!0,className:"me-1"})," Edit"]}),m.jsxs(Ue,{onClick:o,children:[m.jsx(Ie,{icon:YG,fixedWidth:!0,className:"me-1"})," Delete"]})]})}),m.jsx(t,{tag:r.tag,toggle:s,isOpen:a}),m.jsx(e,{tag:r.tag,toggle:o,isOpen:i})]})},Upe=(e,t)=>{e.serviceFactory("TagsSelector",Epe,"ColorGenerator"),e.decorator("TagsSelector",t(["tagsList"],["listTags"])),e.serviceFactory("DeleteTagConfirmModal",()=>hhe),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.serviceFactory("EditTagModal",Mhe,"ColorGenerator"),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.serviceFactory("TagsTableRow",Bpe,"DeleteTagConfirmModal","EditTagModal","ColorGenerator"),e.serviceFactory("TagsTable",$pe,"TagsTableRow"),e.serviceFactory("TagsList",Ipe,"TagsTable"),e.decorator("TagsList",t(["tagsList","mercureInfo"],["forceListTags","filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",jpe,"editTag"),e.serviceFactory("tagEditReducer",ct("reducer"),"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",Ppe,"apiClientFactory"),e.serviceFactory("tagDeleteReducer",ct("reducer"),"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",Npe,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",ct("reducer"),"tagsListReducerCreator");const n=r=>({apiClientFactory:i})=>Rpe(i,r);e.factory("listTags",n(!1)),e.factory("forceListTags",n(!0)),e.serviceFactory("filterTags",()=>s5),e.serviceFactory("deleteTag",ct("deleteTag"),"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>o5),e.serviceFactory("editTag",Mpe,"apiClientFactory","ColorGenerator"),e.serviceFactory("tagEdited",()=>a5)};var zpe="Expected a function",l5="__lodash_hash_undefined__",c5=1/0,Vpe="[object Function]",Hpe="[object GeneratorFunction]",Wpe="[object Symbol]",Ype=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qpe=/^\w*$/,Gpe=/^\./,Kpe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zpe=/[\\^$.*+?()[\]{}|]/g,Qpe=/\\(\\)?/g,Xpe=/^\[object .+?Constructor\]$/,Jpe=typeof Zl=="object"&&Zl&&Zl.Object===Object&&Zl,eme=typeof self=="object"&&self&&self.Object===Object&&self,QO=Jpe||eme||Function("return this")();function tme(e,t){return e==null?void 0:e[t]}function nme(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var rme=Array.prototype,ime=Function.prototype,u5=Object.prototype,nb=QO["__core-js_shared__"],Tj=function(){var e=/[^.]+$/.exec(nb&&nb.keys&&nb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),f5=ime.toString,XO=u5.hasOwnProperty,d5=u5.toString,ome=RegExp("^"+f5.call(XO).replace(Zpe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mj=QO.Symbol,ame=rme.splice,sme=h5(QO,"Map"),eh=h5(Object,"create"),jj=Mj?Mj.prototype:void 0,Dj=jj?jj.toString:void 0;function ll(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function vme(e,t){var n=this.__data__,r=Wy(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Su.prototype.clear=hme;Su.prototype.delete=pme;Su.prototype.get=mme;Su.prototype.has=gme;Su.prototype.set=vme;function wl(e){var t=-1,n=e?e.length:0;for(this.clear();++tr.toFixed(n).replace(".",t):r=>`${r}`.replace(".",t):n?r=>r.toFixed(n):r=>`${r}`}function tC(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 Bme(e={stringFormatter:tC()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function Ume(e={stringFormatter:tC()}){return t=>{if(t===null)return"";let n=JSON.stringify(t);return n===void 0?"":(n[0]==='"'&&(n=n.replace(/^"(.+)"$/,"$1")),e.stringFormatter(n))}}function Rj(e,t,n){const r=e[t];return r===void 0?n:r}function g5(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function Nx(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}var Nj;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(Nj||(Nj={}));class zme{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||tC(),i=Ume({stringFormatter:r}),o={header:r,undefined:rb,boolean:rb,number:$me(),bigint:rb,string:r,symbol:Bme({stringFormatter:r}),function:i,object:i};return n.formatters=Object.assign(Object.assign({},o),n.formatters),n.delimiter=n.delimiter||",",n.eol=n.eol||` +`))}function ape({children:e}){const{classNames:t,comboBoxRef:n,id:r}=B.useContext(In);return Y.createElement("div",{className:t.comboBox,id:Lhe(r),ref:n},e)}const spe=({classNames:e,text:t})=>Y.createElement("mark",{className:e.highlight},t);function lpe({option:e,query:t,render:n=spe}){const{classNames:r}=B.useContext(In);if(e.value===qO||e.value===JI)return Y.createElement(Y.Fragment,null,Ev(e.label,t));if(t){const i=$he(e.label,t);if(i){const o=n({text:i[1],classNames:r});return Y.createElement(Y.Fragment,null,i[0],o,i[2])}}return Y.createElement(Y.Fragment,null,e.label)}const cpe=Y.memo(lpe),upe=({classNames:e,inputWidth:t,...n})=>Y.createElement("input",{className:e.input,style:{width:t},...n});function fpe({allowBackspace:e=!0,allowResize:t=!0,ariaDescribedBy:n,ariaErrorMessage:r,delimiterKeys:i,placeholderText:o,render:a=upe}){const{classNames:s}=B.useContext(In),{value:l,...c}=qhe({allowBackspace:e,ariaDescribedBy:n,ariaErrorMessage:r,delimiterKeys:i}),f=l.lengthY.createElement("div",{className:t.label,id:n},e);function hpe({children:e,render:t=dpe}){const{classNames:n,id:r}=B.useContext(In);return t({children:e,classNames:n,id:Hy(r)})}function ppe({children:e}){const{classNames:t,managerRef:n}=B.useContext(In),r=Qhe();return!n.current.state.isExpanded||Y.Children.count(e)===0?null:Y.createElement("div",{className:t.listBox,...r},e)}const mpe=({children:e,classNames:t,option:n,...r})=>{const i=[t.option];return n.active&&i.push(t.optionIsActive),Y.createElement("div",{className:i.join(" "),...r},e)};function gpe({children:e,index:t,render:n=mpe}){const{classNames:r}=B.useContext(In),{option:i,optionProps:o}=Jhe(t);return n({classNames:r,children:e,option:i,...o})}const vpe=({children:e,classNames:t,isActive:n,isDisabled:r,isInvalid:i,...o})=>{const a=[t.root];return n&&a.push(t.rootIsActive),r&&a.push(t.rootIsDisabled),i&&a.push(t.rootIsInvalid),Y.createElement("div",{className:a.join(" "),...o},e)};function ype({children:e,onBlur:t,onFocus:n,render:r=vpe}){const{classNames:i,isDisabled:o,isInvalid:a}=B.useContext(In),{isActive:s,rootProps:l}=tpe({onBlur:t,onFocus:n});return r({children:e,classNames:i,isActive:s,isDisabled:o,isInvalid:a,...l})}const _pe=({classNames:e,tag:t,...n})=>Y.createElement("button",{type:"button",className:e.tag,...n},Y.createElement("span",{className:e.tagName},t.label));function bpe({render:e=_pe,index:t,title:n}){const{classNames:r}=B.useContext(In),{tag:i,tagProps:o}=npe(t,n);return e({classNames:r,tag:i,...o})}function wpe({children:e,label:t}){const{classNames:n}=B.useContext(In),{listRef:r}=rpe();return Y.createElement("ul",{className:n.tagList,"aria-label":t,ref:r,role:"list"},e.map(i=>Y.createElement("li",{className:n.tagListItem,key:i.key,role:"listitem"},i)))}const xpe={root:"react-tags",rootIsActive:"is-active",rootIsDisabled:"is-disabled",rootIsInvalid:"is-invalid",label:"react-tags__label",tagList:"react-tags__list",tagListItem:"react-tags__list-item",tag:"react-tags__tag",tagName:"react-tags__tag-name",comboBox:"react-tags__combobox",input:"react-tags__combobox-input",listBox:"react-tags__listbox",option:"react-tags__listbox-option",optionIsActive:"is-active",highlight:"react-tags__listbox-option-highlight"},Spe=[Ms.Enter];function Ope({activateFirstOption:e=!1,allowBackspace:t=!0,allowNew:n=!1,allowResize:r=!0,ariaAddedText:i="Added tag %value%",ariaDescribedBy:o,ariaErrorMessage:a,ariaDeletedText:s="Removed tag %value%",classNames:l=xpe,collapseOnSelect:c=!1,deleteButtonText:f="Remove %value% from the list",delimiterKeys:d=Spe,id:p="react-tags",isDisabled:g=!1,isInvalid:v=!1,labelText:y="Select tags",newOptionText:x="Add %value%",noOptionsText:b="No options found for %value%",onAdd:w,onBlur:S,onCollapse:C,onDelete:k,onExpand:P,onFocus:j,onInput:N,onShouldCollapse:H,onShouldExpand:R,onValidate:V,placeholderText:W="Add a tag",renderHighlight:ee,renderInput:q,renderLabel:Q,renderOption:oe,renderRoot:le,renderTag:G,selected:F=[],suggestions:A=[],suggestionsTransform:z=Hhe,tagListLabelText:re="Selected tags"},U){const K=B.useRef(null),ie=B.useRef(null),ae=B.useRef(null),he=Xhe({activateFirstOption:e,allowNew:n,collapseOnSelect:c,newOptionText:x,noOptionsText:b,onAdd:w,onDelete:k,onCollapse:C,onExpand:P,onInput:N,onShouldCollapse:H,onShouldExpand:R,onValidate:V,selected:F,suggestions:A,suggestionsTransform:z}),E=epe({inputRef:ie,managerRef:he});return U&&(typeof U=="function"?U(E):U.current=E),Y.createElement(In.Provider,{value:{classNames:l,comboBoxRef:K,id:p,inputRef:ie,isDisabled:g,isInvalid:v,listBoxRef:ae,managerRef:he}},Y.createElement(ype,{onBlur:S,onFocus:j,render:le},Y.createElement(hpe,{render:Q},y),Y.createElement(wpe,{label:re},he.current.state.selected.map((M,I)=>Y.createElement(bpe,{key:Dx(M),index:I,render:G,title:f}))),Y.createElement(ape,null,Y.createElement(fpe,{allowBackspace:t,allowResize:r,ariaDescribedBy:o,ariaErrorMessage:a,delimiterKeys:d,placeholderText:W,render:q}),Y.createElement(ppe,null,he.current.state.options.map((M,I)=>Y.createElement(gpe,{key:Dx(M),index:I,render:oe},Y.createElement(cpe,{option:M,query:he.current.state.value,render:ee}))))),Y.createElement(ope,{ariaAddedText:i,ariaDeletedText:s})))}const Cpe=Y.forwardRef(Ope);const i5=({tag:e,colorGenerator:t})=>m.jsx("div",{style:{backgroundColor:t.getColorForKey(e)},className:"tag-bullet"}),Ej=e=>({label:e,value:e}),Epe=e=>({selectedTags:t,onChange:n,placeholder:r,listTags:i,tagsList:o,allowNew:a=!0})=>{const s=bl("shortUrlCreation");B.useEffect(()=>{i()},[]);const l=(s==null?void 0:s.tagFilteringMode)??"startsWith",c=({tag:d,onClick:p})=>m.jsx(zO,{colorGenerator:e,text:d.label,clearable:!0,className:"react-tags__tag",onClose:p}),f=({option:d})=>m.jsxs(m.Fragment,{children:[m.jsx(i5,{tag:`${d.label}`,colorGenerator:e}),d.label]});return m.jsx(Cpe,{selected:t.map(Ej),suggestions:o.tags.filter(d=>!t.includes(d)).map(Ej),renderTag:c,renderOption:f,allowNew:a,placeholderText:r??"Add tags to the URL",onShouldExpand:d=>d.length>1,delimiterKeys:["Enter","Tab",","],suggestionsTransform:l==="includes"?(d,p)=>p.filter(({label:g})=>g.includes(d)):void 0,onDelete:d=>{const p=[...t];p.splice(d,1),n(p)},onAdd:({label:d})=>n([...new Set([...t,...d.toLowerCase().split(",")])])})},Rx="shlink/tagDelete",kpe={deleting:!1,deleted:!1,error:!1},o5=jn(`${Rx}/tagDeleted`),Ppe=e=>{const t=Mr(`${Rx}/deleteTag`,async r=>{await e().deleteTags([r])}),{reducer:n}=sr({name:Rx,initialState:kpe,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:Jo(o)})),r.addCase(t.fulfilled,()=>({deleting:!1,deleted:!0,error:!1}))}});return{reducer:n,deleteTag:t}},GO="shlink/tagEdit",Tpe={editing:!1,edited:!1,error:!1},a5=jn(`${GO}/tagEdited`),Mpe=(e,t)=>Mr(`${GO}/editTag`,async({oldName:n,newName:r,color:i})=>(await e().editTag(n,r),t.setColorForKey(r,i),{oldName:n,newName:r,color:i})),jpe=e=>sr({name:GO,initialState:Tpe,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:Jo(r)})),t.addCase(e.fulfilled,(n,{payload:r})=>({...xS(["oldName","newName"],r),editing:!1,edited:!0,error:!1}))}}),KO="shlink/tagsList",tb={tags:[],filteredTags:[],stats:{},loading:!1,error:!1},kj=(e,t)=>n=>n===e?t:n,Pj=(e,t)=>fh(n=>n===t,e),Dpe=(e,t)=>e.reduce((n,[r,i])=>{if(!n[r])return n;const{bots:o,nonBots:a}=i,s=n[r];return{...n,[r]:{...s,visitsSummary:s.visitsSummary&&{total:s.visitsSummary.total+o+a,bots:s.visitsSummary.bots+o,nonBots:s.visitsSummary.nonBots+a},visitsCount:s.visitsCount+o+a}}},{...t}),Lpe=e=>Object.entries(e.reduce((t,{shortUrl:n,visit:r})=>(n==null||n.tags.forEach(i=>{t[i]||(t[i]={bots:0,nonBots:0}),r.potentialBot?t[i].bots+=1:t[i].nonBots+=1}),t),{})),Rpe=(e,t=!0)=>Mr(`${KO}/listTags`,async(n,{getState:r})=>{const{tagsList:i}=r();if(!t&&!Kn(i.tags))return i;const{tags:o,stats:a}=await e().tagsStats(),s=a.reduce((l,{tag:c,...f})=>(l[c]=f,l),{});return{tags:o,stats:s}}),s5=jn(`${KO}/filterTags`),Npe=(e,t)=>sr({name:KO,initialState:tb,reducers:{},extraReducers:n=>{n.addCase(s5,(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})=>({...tb,error:!0,errorData:Jo(i)})),n.addCase(e.fulfilled,(r,{payload:i})=>({...tb,stats:i.stats,tags:i.tags,filteredTags:i.tags})),n.addCase(o5,({tags:r,filteredTags:i,...o},{payload:a})=>({...o,tags:Pj(r,a),filteredTags:Pj(i,a)})),n.addCase(a5,({tags:r,filteredTags:i,stats:o,...a},{payload:s})=>({...a,stats:{...o,[s.newName]:o[s.oldName]},tags:r.map(kj(s.oldName,s.newName)).sort(),filteredTags:i.map(kj(s.oldName,s.newName)).sort()})),n.addCase(Th,(r,{payload:i})=>({...r,stats:Dpe(Lpe(i.createdVisits),r.stats)})),n.addCase(t.fulfilled,({tags:r,...i},{payload:o})=>({...i,tags:r.concat(o.tags.filter(a=>!r.includes(a)))}))}}),Ape={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},Ipe=e=>ss(({filterTags:t,forceListTags:n,tagsList:r})=>{var f;const i=BO(),[o,a]=B.useState(((f=i.tags)==null?void 0:f.defaultOrdering)??{}),s=Mt(()=>r.filteredTags.map(d=>{var v,y,x;const p=r.stats[d],g=((v=i.visits)!=null&&v.excludeBots?(y=p==null?void 0:p.visitsSummary)==null?void 0:y.nonBots:(x=p==null?void 0:p.visitsSummary)==null?void 0:x.total)??(p==null?void 0:p.visitsCount)??0;return{tag:d,visits:g,shortUrls:(p==null?void 0:p.shortUrlsCount)??0}}),d=>r6(d,o));if(B.useEffect(()=>{n()},[]),r.loading)return m.jsx(Do,{loading:!0});if(r.error)return m.jsx(zr,{type:"error",children:m.jsx(zo,{errorData:r.errorData,fallbackMessage:"Error loading tags :("})});const l=d=>()=>{const p=Ly(d,o.field,o.dir);a({field:p?d:void 0,dir:p})},c=()=>{if(r.filteredTags.length<1)return m.jsx(Do,{children:"No tags found"});const d=s();return m.jsx(e,{sortedTags:d,currentOrder:o,orderByColumn:l})};return m.jsxs(m.Fragment,{children:[m.jsx(xh,{className:"mb-3",onChange:t}),m.jsx(mr,{className:"mb-3",children:m.jsx("div",{className:"col-lg-6 offset-lg-6",children:m.jsx(Sh,{items:Ape,order:o,onChange:(d,p)=>a({field:d,dir:p})})})}),c()]})},()=>[di.visits]);const ZO=({pagesCount:e,currentPage:t,setCurrentPage:n,centered:r=!0})=>{if(e<2)return null;const i=o=>()=>!Xd(o)&&n(o);return m.jsxs(oO,{listClassName:Ee("flex-wrap mb-0 simple-paginator",{"justify-content-center":r}),children:[m.jsx(Hs,{disabled:t<=1,children:m.jsx(Ws,{previous:!0,tag:"span",onClick:i(t-1)})}),YI(t,e).map((o,a)=>m.jsx(Hs,{disabled:Xd(o),active:t===o,children:m.jsx(Ws,{role:"link",tag:"span",onClick:i(o),children:qI(o)})},GI(o,a))),m.jsx(Hs,{disabled:t>=e,children:m.jsx(Ws,{next:!0,tag:"span",onClick:i(t+1)})})]})};const Fpe=20,$pe=e=>({sortedTags:t,orderByColumn:n,currentOrder:r})=>{const i=B.useRef(!0),{search:o}=gn(),{page:a=1}=vl(o),[s,l]=Efe("page",Number(a)),c=Dd(Fpe,t),f=c.length>1,d=c[s-1]??[];return B.useEffect(()=>{!i.current&&l(1),i.current=!1},[t]),B.useEffect(()=>{scrollTo(0,0)},[s]),m.jsxs(hn,{bodyClassName:f?"pb-1":"",children:[m.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[m.jsxs("thead",{className:"responsive-table__header",children:[m.jsxs("tr",{children:[m.jsxs("th",{className:"tags-table__header-cell",onClick:n("tag"),children:["Tag ",m.jsx(td,{currentOrder:r,field:"tag"})]}),m.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:n("shortUrls"),children:["Short URLs ",m.jsx(td,{currentOrder:r,field:"shortUrls"})]}),m.jsxs("th",{className:"tags-table__header-cell text-lg-end",onClick:n("visits"),children:["Visits ",m.jsx(td,{currentOrder:r,field:"visits"})]}),m.jsx("th",{"aria-label":"Options",className:"tags-table__header-cell"})]}),m.jsx("tr",{children:m.jsx("th",{"aria-label":"Separator",colSpan:4,className:"p-0 border-top-0"})})]}),m.jsxs("tbody",{children:[d.length===0&&m.jsx("tr",{children:m.jsx("td",{colSpan:4,className:"text-center",children:"No results found"})}),d.map(p=>m.jsx(e,{tag:p},p.tag))]})]}),f&&m.jsx("div",{className:"sticky-card-paginator",children:m.jsx(ZO,{pagesCount:c.length,currentPage:s,setCurrentPage:l})})]},s)},Bpe=(e,t,n)=>({tag:r})=>{const[i,o]=mn(),[a,s]=mn(),l=yl();return m.jsxs("tr",{className:"responsive-table__row",children:[m.jsxs("th",{className:"responsive-table__cell","data-th":"Tag",children:[m.jsx(i5,{tag:r.tag,colorGenerator:n})," ",r.tag]}),m.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Short URLs",children:m.jsx(Ft,{to:`${l}/list-short-urls/1?tags=${encodeURIComponent(r.tag)}`,children:wn(r.shortUrls)})}),m.jsx("td",{className:"responsive-table__cell text-lg-end","data-th":"Visits",children:m.jsx(Ft,{to:`${l}/tag/${r.tag}/visits`,children:wn(r.visits)})}),m.jsx("td",{className:"responsive-table__cell text-lg-end",children:m.jsxs(Dy,{children:[m.jsxs(Ue,{onClick:s,children:[m.jsx(Ie,{icon:jG,fixedWidth:!0,className:"me-1"})," Edit"]}),m.jsxs(Ue,{onClick:o,children:[m.jsx(Ie,{icon:YG,fixedWidth:!0,className:"me-1"})," Delete"]})]})}),m.jsx(t,{tag:r.tag,toggle:s,isOpen:a}),m.jsx(e,{tag:r.tag,toggle:o,isOpen:i})]})},Upe=(e,t)=>{e.serviceFactory("TagsSelector",Epe,"ColorGenerator"),e.decorator("TagsSelector",t(["tagsList"],["listTags"])),e.serviceFactory("DeleteTagConfirmModal",()=>hhe),e.decorator("DeleteTagConfirmModal",t(["tagDelete"],["deleteTag","tagDeleted"])),e.serviceFactory("EditTagModal",Mhe,"ColorGenerator"),e.decorator("EditTagModal",t(["tagEdit"],["editTag","tagEdited"])),e.serviceFactory("TagsTableRow",Bpe,"DeleteTagConfirmModal","EditTagModal","ColorGenerator"),e.serviceFactory("TagsTable",$pe,"TagsTableRow"),e.serviceFactory("TagsList",Ipe,"TagsTable"),e.decorator("TagsList",t(["tagsList","mercureInfo"],["forceListTags","filterTags","createNewVisits","loadMercureInfo"])),e.serviceFactory("tagEditReducerCreator",jpe,"editTag"),e.serviceFactory("tagEditReducer",ct("reducer"),"tagEditReducerCreator"),e.serviceFactory("tagDeleteReducerCreator",Ppe,"apiClientFactory"),e.serviceFactory("tagDeleteReducer",ct("reducer"),"tagDeleteReducerCreator"),e.serviceFactory("tagsListReducerCreator",Npe,"listTags","createShortUrl"),e.serviceFactory("tagsListReducer",ct("reducer"),"tagsListReducerCreator");const n=r=>({apiClientFactory:i})=>Rpe(i,r);e.factory("listTags",n(!1)),e.factory("forceListTags",n(!0)),e.serviceFactory("filterTags",()=>s5),e.serviceFactory("deleteTag",ct("deleteTag"),"tagDeleteReducerCreator"),e.serviceFactory("tagDeleted",()=>o5),e.serviceFactory("editTag",Mpe,"apiClientFactory","ColorGenerator"),e.serviceFactory("tagEdited",()=>a5)};var zpe="Expected a function",l5="__lodash_hash_undefined__",c5=1/0,Vpe="[object Function]",Hpe="[object GeneratorFunction]",Wpe="[object Symbol]",Ype=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qpe=/^\w*$/,Gpe=/^\./,Kpe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zpe=/[\\^$.*+?()[\]{}|]/g,Qpe=/\\(\\)?/g,Xpe=/^\[object .+?Constructor\]$/,Jpe=typeof Zl=="object"&&Zl&&Zl.Object===Object&&Zl,eme=typeof self=="object"&&self&&self.Object===Object&&self,QO=Jpe||eme||Function("return this")();function tme(e,t){return e==null?void 0:e[t]}function nme(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var rme=Array.prototype,ime=Function.prototype,u5=Object.prototype,nb=QO["__core-js_shared__"],Tj=function(){var e=/[^.]+$/.exec(nb&&nb.keys&&nb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),f5=ime.toString,XO=u5.hasOwnProperty,d5=u5.toString,ome=RegExp("^"+f5.call(XO).replace(Zpe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mj=QO.Symbol,ame=rme.splice,sme=h5(QO,"Map"),eh=h5(Object,"create"),jj=Mj?Mj.prototype:void 0,Dj=jj?jj.toString:void 0;function ll(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function vme(e,t){var n=this.__data__,r=Wy(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Su.prototype.clear=hme;Su.prototype.delete=pme;Su.prototype.get=mme;Su.prototype.has=gme;Su.prototype.set=vme;function wl(e){var t=-1,n=e?e.length:0;for(this.clear();++tr.toFixed(n).replace(".",t):r=>`${r}`.replace(".",t):n?r=>r.toFixed(n):r=>`${r}`}function tC(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 Bme(e={stringFormatter:tC()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function Ume(e={stringFormatter:tC()}){return t=>{if(t===null)return"";let n=JSON.stringify(t);return n===void 0?"":(n[0]==='"'&&(n=n.replace(/^"(.+)"$/,"$1")),e.stringFormatter(n))}}function Rj(e,t,n){const r=e[t];return r===void 0?n:r}function g5(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function Nx(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}var Nj;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(Nj||(Nj={}));class zme{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||tC(),i=Ume({stringFormatter:r}),o={header:r,undefined:rb,boolean:rb,number:$me(),bigint:rb,string:r,symbol:Bme({stringFormatter:r}),function:i,object:i};return n.formatters=Object.assign(Object.assign({},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=>Lj(i,r,n):i=>Rj(i,r,n)};if(typeof r=="object"){const i="default"in r?r.default:n;if(typeof r.value=="string"){const o=r.value;return{label:r.label||r.value,value:r.value.includes(".")||r.value.includes("[")?a=>Lj(a,o,i):a=>Rj(a,o,i)}}if(typeof r.value=="function"){const o=r.label||r.value.name||"",a={label:o,default:i},s=r.value;return{label:o,value(l){const c=s(l,a);return c===void 0?i:c}}}}throw new Error("Invalid field info option. "+JSON.stringify(r))})}getHeader(){return Nx(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(g5,[]),[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 Nx(n,this.opts.delimiter)}processCell(t,n){return this.processValue(n.value(t))}processValue(t){const n=this.opts.formatters[typeof t];return n(t)}}class v5 extends zme{constructor(t){super(t)}parse(t){const n=this.preprocessData(t);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(n.reduce((a,s)=>(Object.keys(s).forEach(l=>{a.includes(l)||a.push(l)}),a),[]),this.opts.defaultValue);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){if(t==null||n.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof n[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?n:n.map(r=>this.preprocessRow(r)).reduce(g5,[])}processData(t){return Nx(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 Aj;(function(e){e[e.LEFT_BRACE=0]="LEFT_BRACE",e[e.RIGHT_BRACE=1]="RIGHT_BRACE",e[e.LEFT_BRACKET=2]="LEFT_BRACKET",e[e.RIGHT_BRACKET=3]="RIGHT_BRACKET",e[e.COLON=4]="COLON",e[e.COMMA=5]="COMMA",e[e.TRUE=6]="TRUE",e[e.FALSE=7]="FALSE",e[e.NULL=8]="NULL",e[e.STRING=9]="STRING",e[e.NUMBER=10]="NUMBER",e[e.SEPARATOR=11]="SEPARATOR"})(Aj||(Aj={}));var Ij;(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"})(Ij||(Ij={}));var Fj;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"})(Fj||(Fj={}));var $j;(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"})($j||($j={}));const Vme=new v5,Hme=e=>Vme.parse(e),Wme=6,Bj="0123456789ABCDEF",Yme=128,{floor:qme,random:Gme,sqrt:Kme,round:Zme}=Math,Qme=()=>`#${FO(Wme,()=>Bj[qme(Gme()*Bj.length)]).join("")}`,Uj=e=>e.toLowerCase().trim(),Xme=e=>(e.match(/../g)??[]).map(t=>parseInt(t,16)||0),Jme=(e=0,t=0,n=0)=>Zme(Kme(.299*e**2+.587*t**2+.114*n**2));class ege{constructor(t){me(this,"colors");me(this,"lights");me(this,"getColorForKey",t=>{const n=Uj(t),r=this.colors[n];return r||this.setColorForKey(n,Qme())});me(this,"setColorForKey",(t,n)=>{var i;const r=Uj(t);return this.colors[r]=n,(i=this.storage)==null||i.storeTagColors(this.colors),n});me(this,"isColorLightForKey",t=>{const n=this.getColorForKey(t).substring(1);if(qo(this.lights[n])){const r=Xme(n);this.lights[n]=Jme(...r)>=Yme}return this.lights[n]});var n;this.storage=t,this.colors=((n=this.storage)==null?void 0:n.getTagColors())??{},this.lights={}}}const y5=({document:e},t,n)=>{const r=e.createElement("a");r.setAttribute("href",t),r.setAttribute("download",n),r.style.visibility="hidden",e.body.appendChild(r),r.click(),e.body.removeChild(r)},tge=(e,t,n)=>{const r=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(r);y5(e,i,n)};class nge{constructor(t,n){this.fetch=t,this.window=n}async saveImage(t,n){const r=await this.fetch(t).then(o=>o.blob()),i=URL.createObjectURL(r);y5(this.window,i,n)}}class rge{constructor(t,n){me(this,"exportVisits",(t,n)=>{n.length&&this.exportCsv(t,n)});me(this,"exportShortUrls",t=>{t.length&&this.exportCsv("short_urls.csv",t)});me(this,"exportCsv",(t,n)=>{const r=this.jsonToCsv(n);tge(this.window,r,t)});this.window=t,this.jsonToCsv=n}}function ige(e){e.constant("window",window),e.constant("fetch",window.fetch.bind(window)),e.service("ImageDownloader",nge,"fetch","window"),e.service("ColorGenerator",ege,"TagColorsStorage"),e.constant("jsonToCsv",Hme),e.service("ReportExporter",rge,"window","jsonToCsv"),e.constant("setTimeout",window.setTimeout),e.constant("clearTimeout",window.clearTimeout),e.serviceFactory("useTimeoutToggle",Ofe,"setTimeout","clearTimeout")}const nC=e=>e.visitedUrl!==void 0,oge=e=>e.visitedUrl!==void 0,age=Mt(qq(e=>nC(e.visit)?"orphanVisits":"nonOrphanVisits"),e=>({orphanVisits:[],nonOrphanVisits:[],...e})),im=(e,t)=>hA(ct(t),e),Lh=({page:e,itemsPerPage:t,filter:n,dateRange:r})=>{const i=((r==null?void 0:r.startDate)&&Xa(r==null?void 0:r.startDate))??void 0,o=((r==null?void 0:r.endDate)&&Xa(r==null?void 0:r.endDate))??void 0,a=(n==null?void 0:n.excludeBots)||void 0;return{page:e,itemsPerPage:t,startDate:i,endDate:o,excludeBots:a}},Rh=({visits:e,goBack:t,shortUrl:n,children:r,title:i})=>m.jsx("header",{children:m.jsxs(Yr,{body:!0,children:[m.jsxs("h2",{className:"d-flex justify-content-between align-items-center mb-0",children:[m.jsx(yt,{color:"link",size:"lg",className:"p-0 me-3",onClick:t,children:m.jsx(Ie,{icon:OA})}),m.jsx("span",{className:"text-center d-none d-sm-block",children:m.jsx("small",{children:i})}),m.jsxs("span",{className:"badge badge-main ms-3",children:["Visits:"," ",m.jsx(MI,{visitsCount:e.length,shortUrl:n})]})]}),m.jsx("h3",{className:"text-center d-block d-sm-none mb-0 mt-3",children:m.jsx("small",{children:i})}),r&&m.jsx("div",{className:"mt-md-2",children:r})]})});const _5=({title:e,footer:t,children:n})=>m.jsxs(Yr,{role:"document",children:[m.jsx(Kc,{className:"chart-card__header",children:typeof e=="function"?e():e}),m.jsx(Gc,{children:n}),t&&m.jsx(I4,{className:"chart-card__footer--sticky",children:t})]}),b5="label";function zj(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function sge(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function w5(e,t){e.labels=t}function x5(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b5;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function lge(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b5;const n={labels:[],datasets:[]};return w5(n,e.labels),x5(n,e.datasets,t),n}function S5(e,t){return e.getElementsAtEventForMode(t.nativeEvent,"nearest",{intersect:!0},!1)}function cge(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:f,updateMode:d,...p}=e,g=B.useRef(null),v=B.useRef(),y=()=>{g.current&&(v.current=new Lv(g.current,{type:a,data:lge(s,o),options:l&&{...l},plugins:c}),zj(t,v.current))},x=()=>{zj(t,null),v.current&&(v.current.destroy(),v.current=null)};return B.useEffect(()=>{!i&&v.current&&l&&sge(v.current,l)},[i,l]),B.useEffect(()=>{!i&&v.current&&w5(v.current.config.data,s.labels)},[i,s.labels]),B.useEffect(()=>{!i&&v.current&&s.datasets&&x5(v.current.config.data,s.datasets,o)},[i,s.datasets]),B.useEffect(()=>{v.current&&(i?(x(),setTimeout(y)):v.current.update(d))},[i,l,s.labels,s.datasets,d]),B.useEffect(()=>{v.current&&(x(),setTimeout(y))},[a]),B.useEffect(()=>(y(),()=>x()),[]),Y.createElement("canvas",Object.assign({ref:g,role:"img",height:n,width:r},p),f)}const uge=B.forwardRef(cge);function rC(e,t){return Lv.register(t),B.forwardRef((n,r)=>Y.createElement(uge,Object.assign({},n,{ref:r,type:e})))}const fge=rC("line",Mf),dge=rC("bar",Tf),hge=rC("doughnut",_a),O5=({native:e},[t])=>{if(!(e!=null&&e.target))return;const n=e.target;n.style.cursor=t?"pointer":"default"},C5=({dataset:e,raw:t})=>`${e.label}: ${wn(`${t}`)}`,pge=({label:e,raw:t})=>`${e}: ${wn(`${t}`)}`;const mge=({chart:e})=>{const{config:t}=e,{labels:n=[],datasets:r=[]}=t.data??{},[{backgroundColor:i}]=r,{defaultColor:o}=t.options??{};return m.jsx("ul",{className:"doughnut-chart-legend",children:n.map((a,s)=>m.jsxs("li",{className:"doughnut-chart-legend__item d-flex",children:[m.jsx("div",{className:"doughnut-chart-legend__item-color",style:{backgroundColor:i[s]??o}}),m.jsx("small",{className:"doughnut-chart-legend__item-text flex-fill",children:a})]},a))})},gge=e=>[{data:e,backgroundColor:["#97BBCD","#F7464A","#46BFBD","#FDB45C","#949FB1","#57A773","#414066","#08B2E3","#B6C454","#DCDCDC","#463730"],borderColor:die()?fie:uie,borderWidth:2}],vge=(e,t)=>({labels:e,datasets:gge(t)}),yge=B.memo(({stats:e})=>{const[t,n]=B.useState(),r=lo(e),i=mu(e),o={plugins:{legend:{display:!1},tooltip:{intersect:!0,callbacks:{label:pge}}}},a=vge(r,i);return m.jsxs("div",{className:"row",children:[m.jsx("div",{className:"col-sm-12 col-md-7",children:m.jsx(hge,{height:300,data:a,options:o,ref:s=>{s&&n(s)}})}),m.jsx("div",{className:"col-sm-12 col-md-5",children:t&&m.jsx(mge,{chart:t})})]})}),Vj=({title:e,stats:t})=>m.jsx(_5,{title:e,children:m.jsx(yge,{stats:t})}),_ge={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},E5={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},rn={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},fr={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ca={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class we{static getFirstMatch(t,n){const r=n.match(t);return r&&r.length>0&&r[1]||""}static getSecondMatch(t,n){const r=n.match(t);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(t,n,r){if(t.test(n))return r}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const n=t.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5)){if(n[0]===1&&n[1]<6)return"Cupcake";if(n[0]===1&&n[1]>=6)return"Donut";if(n[0]===2&&n[1]<2)return"Eclair";if(n[0]===2&&n[1]===2)return"Froyo";if(n[0]===2&&n[1]>2)return"Gingerbread";if(n[0]===3)return"Honeycomb";if(n[0]===4&&n[1]<1)return"Ice Cream Sandwich";if(n[0]===4&&n[1]<4)return"Jelly Bean";if(n[0]===4&&n[1]>=4)return"KitKat";if(n[0]===5)return"Lollipop";if(n[0]===6)return"Marshmallow";if(n[0]===7)return"Nougat";if(n[0]===8)return"Oreo";if(n[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,n,r=!1){const i=we.getVersionPrecision(t),o=we.getVersionPrecision(n);let a=Math.max(i,o),s=0;const l=we.map([t,n],c=>{const f=a-we.getVersionPrecision(c),d=c+new Array(f+1).join(".0");return we.map(d.split("."),p=>new Array(20-p.length).join("0")+p).reverse()});for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===s)return 0;a-=1}else if(l[0][a]{r[l]=a[l]})}return t}static getBrowserAlias(t){return _ge[t]}static getBrowserTypeByAlias(t){return E5[t]||""}}const Et=/version\/(\d+(\.?_?\d+)+)/i,bge=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=we.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=we.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=we.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=we.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=we.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=we.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=we.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=we.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=we.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=we.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=we.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=we.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=we.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=we.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=we.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=we.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=we.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=we.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=we.getFirstMatch(Et,e)||we.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=we.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=we.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=we.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=we.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=we.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=we.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=we.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=we.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=we.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=we.getFirstMatch(Et,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,n=/^(.*)\/(.*)[ \t]\((.*)/,i=e.search("\\(")!==-1?n:t;return{name:we.getFirstMatch(i,e),version:we.getSecondMatch(i,e)}}}],wge=[{test:[/Roku\/DVP/],describe(e){const t=we.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:fr.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=we.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:fr.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=we.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=we.getWindowsVersionName(t);return{name:fr.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:fr.iOS},n=we.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=we.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=we.getMacOSVersionName(t),r={name:fr.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=we.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:fr.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=we.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=we.getAndroidVersionName(t),r={name:fr.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=we.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:fr.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=we.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||we.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||we.getFirstMatch(/\bbb(\d+)/i,e);return{name:fr.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=we.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:fr.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=we.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:fr.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:fr.Linux}}},{test:[/CrOS/],describe(){return{name:fr.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=we.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:fr.PlayStation4,version:t}}}],xge=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=we.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:rn.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:rn.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:rn.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:rn.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:rn.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:rn.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:rn.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=we.getFirstMatch(/(ipod|iphone)/i,e);return{type:rn.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:rn.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:rn.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:rn.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:rn.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:rn.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:rn.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:rn.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:rn.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:rn.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:rn.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:rn.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:rn.tv}}}],Sge=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:ca.Blink};const n=we.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ca.EdgeHTML,version:n}}},{test:[/trident/i],describe(e){const t={name:ca.Trident},n=we.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:ca.Presto},n=we.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:ca.Gecko},n=we.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ca.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:ca.WebKit},n=we.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Hj{constructor(t,n=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=we.find(bge,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=we.find(wge,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:n}=this.getOS();return t?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:n}=this.getPlatform();return t?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const t=we.find(xge,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=we.find(Sge,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return we.assign({},this.parsedResult)}satisfies(t){const n={};let r=0;const i={};let o=0;if(Object.keys(t).forEach(s=>{const l=t[s];typeof l=="string"?(i[s]=l,o+=1):typeof l=="object"&&(n[s]=l,r+=1)}),r>0){const s=Object.keys(n),l=we.find(s,f=>this.isOS(f));if(l){const f=this.satisfies(n[l]);if(f!==void 0)return f}const c=we.find(s,f=>this.isPlatform(f));if(c){const f=this.satisfies(n[c]);if(f!==void 0)return f}}if(o>0){const s=Object.keys(i),l=we.find(s,c=>this.isBrowser(c,!0));if(l!==void 0)return this.compareVersion(i[l])}}isBrowser(t,n=!1){const r=this.getBrowserName().toLowerCase();let i=t.toLowerCase();const o=we.getBrowserTypeByAlias(i);return n&&o&&(i=o.toLowerCase()),i===r}compareVersion(t){let n=[0],r=t,i=!1;const o=this.getBrowserVersion();if(typeof o=="string")return t[0]===">"||t[0]==="<"?(r=t.substr(1),t[1]==="="?(i=!0,r=t.substr(2)):n=[],t[0]===">"?n.push(1):n.push(-1)):t[0]==="="?r=t.substr(1):t[0]==="~"&&(i=!0,r=t.substr(1)),n.indexOf(we.compareVersions(o,r,i))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,n=!1){return this.isBrowser(t,n)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(n=>this.is(n))}}/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser diff --git a/feature/react-tag-autocomplete-7/index.html b/feature/react-tag-autocomplete-7/index.html index 839e193e..a6fcd643 100644 --- a/feature/react-tag-autocomplete-7/index.html +++ b/feature/react-tag-autocomplete-7/index.html @@ -79,7 +79,7 @@ Shlink — The URL shortener - + diff --git a/feature/react-tag-autocomplete-7/service-worker.js b/feature/react-tag-autocomplete-7/service-worker.js index 30606155..76be7ecb 100644 --- a/feature/react-tag-autocomplete-7/service-worker.js +++ b/feature/react-tag-autocomplete-7/service-worker.js @@ -1812,7 +1812,7 @@ const Se = "shlink-web-client", We = "A React-based progressive web application browserslist: ze }; re(); -Ae([{"revision":null,"url":"assets/index-0c175eaa.js"},{"revision":null,"url":"assets/index-12d70fdc.css"},{"revision":"4a629cddd11578fee7160ee899302e5b","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":"f826e7d2071e1ac7dc37f8c589eaf704","url":"manifest.json"}]); +Ae([{"revision":null,"url":"assets/index-12d70fdc.css"},{"revision":null,"url":"assets/index-91594840.js"},{"revision":"e4f483038ca30b90f6e84bb445969bdd","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":"f826e7d2071e1ac7dc37f8c589eaf704","url":"manifest.json"}]); const Qe = new RegExp("/[^/?]+\\.[^/]+$"); M( // Return false to exempt requests from being fulfilled by index.html.