unleash-server 4.20.2 → 4.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/middleware/response-time-metrics.js +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{CreateProject-97475ef8.js → CreateProject-f5c561c6.js} +1 -1
- package/frontend/build/static/{Error-47bbc1e3.js → Error-cf50f470.js} +1 -1
- package/frontend/build/static/{ExpandMore-d5c393f9.js → ExpandMore-fa515e9b.js} +1 -1
- package/frontend/build/static/{FeatureArchiveDialog-0efb69f6.js → FeatureArchiveDialog-9726aebb.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-f577e092.js → FeatureMetricsChart-2099cc8f.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-d023143d.js → FeatureViewLazyExport-251c75f0.js} +2 -2
- package/frontend/build/static/{LazyAdminExport-2cab3449.js → LazyAdminExport-110237f4.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-62a8eb83.js → LazyProjectExport-22be702f.js} +1 -1
- package/frontend/build/static/{NetworkOverview-09807f41.js → NetworkOverview-fa11486d.js} +63 -63
- package/frontend/build/static/{NetworkTraffic-c7c90326.js → NetworkTraffic-e401fa21.js} +1 -1
- package/frontend/build/static/{Playground-8cd49115.js → Playground-d443ad89.js} +1 -1
- package/frontend/build/static/{StrategyItemContainer-6aa38dcf.js → StrategyItemContainer-6834f121.js} +1 -1
- package/frontend/build/static/{chartjs-adapter-date-fns.esm-e4be009e.js → chartjs-adapter-date-fns.esm-25ba860d.js} +1 -1
- package/frontend/build/static/{index-923b0cb2.js → index-3efe35ce.js} +1 -1
- package/frontend/build/static/{index-fc944eb5.js → index-a09b079f.js} +9 -9
- package/frontend/build/static/{index-c8689262.js → index-ad851f89.js} +1 -1
- package/frontend/build/static/{unknownify-541cfbe3.js → unknownify-a62439db.js} +1 -1
- package/frontend/build/static/{useProjectRole-ea388364.js → useProjectRole-6f60c011.js} +1 -1
- package/package.json +1 -1
|
@@ -275,7 +275,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
275
275
|
* This source code is licensed under the MIT license found in the
|
|
276
276
|
* LICENSE file in the root directory of this source tree.
|
|
277
277
|
*/var Hc=f;function pee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fee=typeof Object.is=="function"?Object.is:pee,hee=Hc.useState,mee=Hc.useEffect,gee=Hc.useLayoutEffect,vee=Hc.useDebugValue;function yee(e,t){var n=t(),r=hee({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return gee(function(){o.value=n,o.getSnapshot=t,_1(o)&&i({inst:o})},[e,n,t]),mee(function(){return _1(o)&&i({inst:o}),e(function(){_1(o)&&i({inst:o})})},[e]),vee(n),n}function _1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fee(e,n)}catch{return!0}}function bee(e,t){return t()}var wee=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?bee:yee;Y4.useSyncExternalStore=Hc.useSyncExternalStore!==void 0?Hc.useSyncExternalStore:wee;(function(e){e.exports=Y4})(dee);const Sa=new WeakMap,P_={},ns=()=>{},Wo=ns(),Gh=Object,Fn=e=>e===Wo,Oi=e=>typeof e=="function",Ia=(e,t)=>({...e,...t}),Lx="undefined",gv=typeof window!=Lx,Db=typeof document!=Lx,See=()=>gv&&typeof window.requestAnimationFrame!=Lx,K4=(e,t)=>{const n=Sa.get(e);return[()=>e.get(t)||P_,r=>{const o=e.get(t);n[5](t,Ia(o,r),o||P_)},n[6]]},ah=new WeakMap;let xee=0;const yp=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Gh(e)===e&&!r&&n!=RegExp){if(o=ah.get(e),o)return o;if(o=++xee+"~",ah.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=yp(e[i])+",";ah.set(e,o)}if(n==Gh){o="#";const a=Gh.keys(e).sort();for(;!Fn(i=a.pop());)Fn(e[i])||(o+=i+":"+yp(e[i])+",");ah.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o};let Nb=!0;const Cee=()=>Nb,[Mb,Bb]=gv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ns,ns],Eee=()=>{const e=Db&&document.visibilityState;return Fn(e)||e!=="hidden"},kee=e=>(Db&&document.addEventListener("visibilitychange",e),Mb("focus",e),()=>{Db&&document.removeEventListener("visibilitychange",e),Bb("focus",e)}),Tee=e=>{const t=()=>{Nb=!0,e()},n=()=>{Nb=!1};return Mb("online",t),Mb("offline",n),()=>{Bb("online",t),Bb("offline",n)}},_ee={isOnline:Cee,isVisible:Eee},Ree={initFocus:kee,initReconnect:Tee},$_=!jt.useId,bp=!gv||"Deno"in window,Pee=e=>See()?window.requestAnimationFrame(e):setTimeout(e,1),qh=bp?f.useEffect:f.useLayoutEffect,R1=typeof navigator<"u"&&navigator.connection,I_=!bp&&R1&&(["slow-2g","2g"].includes(R1.effectiveType)||R1.saveData),Dx=e=>{if(Oi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?yp(e):"",[e,t]};let $ee=0;const Fb=()=>++$ee,X4=0,J4=1,Q4=2;var P1={__proto__:null,FOCUS_EVENT:X4,RECONNECT_EVENT:J4,MUTATE_EVENT:Q4};async function Z4(...e){const[t,n,r,o]=e,i=Ia({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const l=i.rollbackOnError;let c=i.optimisticData;const u=i.revalidate!==!1,d=m=>typeof l=="function"?l(m):l!==!1,p=i.throwOnError;if(Oi(n)){const m=n,y=[],v=t.keys();for(let b=v.next();!b.done;b=v.next()){const w=b.value;!w.startsWith("$inf$")&&m(t.get(w)._k)&&y.push(w)}return Promise.all(y.map(h))}return h(n);async function h(m){const[y]=Dx(m);if(!y)return;const[v,b]=K4(t,y),[w,g,S]=Sa.get(t),C=w[y],R=()=>u&&(delete S[y],C&&C[0])?C[0](Q4).then(()=>v().data):v().data;if(e.length<3)return R();let k=r,P;const O=Fb();g[y]=[O,0];const L=!Fn(c),I=v(),A=I.data,M=I._c,F=Fn(M)?A:M;if(L&&(c=Oi(c)?c(F):c,b({data:c,_c:F})),Oi(k))try{k=k(F)}catch(q){P=q}if(k&&Oi(k.then))if(k=await k.catch(q=>{P=q}),O!==g[y][0]){if(P)throw P;return k}else P&&L&&d(P)&&(a=!0,k=F,b({data:k,_c:Wo}));a&&(P||(Oi(a)&&(k=a(k,F)),b({data:k,_c:Wo}))),g[y][1]=Fb();const j=await R();if(b({_c:Wo}),P){if(p)throw P;return}return a?j:k}}const A_=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},e3=(e,t)=>{if(!Sa.has(e)){const n=Ia(Ree,t),r={},o=Z4.bind(Wo,e);let i=ns;const a={},l=(d,p)=>{const h=a[d]||[];return a[d]=h,h.push(p),()=>h.splice(h.indexOf(p),1)},c=(d,p,h)=>{e.set(d,p);const m=a[d];if(m)for(let y=m.length;y--;)m[y](h,p)},u=()=>{if(!Sa.has(e)&&(Sa.set(e,[r,{},{},{},o,c,l]),!bp)){const d=n.initFocus(setTimeout.bind(Wo,A_.bind(Wo,r,X4))),p=n.initReconnect(setTimeout.bind(Wo,A_.bind(Wo,r,J4)));i=()=>{d&&d(),p&&p(),Sa.delete(e)}}};return u(),[e,o,u,i]}return[e,Sa.get(e)[4]]},Iee=(e,t,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Fn(i)&&a>i||setTimeout(r,l,o)},Aee=(e,t)=>yp(e)==yp(t),[Nx,Vr]=e3(new Map),t3=Ia({onLoadingSlow:ns,onSuccess:ns,onError:ns,onErrorRetry:Iee,onDiscarded:ns,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:I_?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:I_?5e3:3e3,compare:Aee,isPaused:()=>!1,cache:Nx,mutate:Vr,fallback:{}},_ee),n3=(e,t)=>{const n=Ia(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:a}=t;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ia(o,a))}return n},zb=f.createContext({}),Oee=e=>{const{value:t}=e,n=f.useContext(zb),r=Oi(t),o=f.useMemo(()=>r?t(n):t,[r,n,t]),i=f.useMemo(()=>r?o:n3(n,o),[r,n,o]),a=o&&o.provider,[l]=f.useState(()=>a?e3(a(i.cache||Nx),o):Wo);return l&&(i.cache=l[0],i.mutate=l[1]),qh(()=>{if(l)return l[2]&&l[2](),l[3]},[]),f.createElement(zb.Provider,Ia(e,{value:i}))},r3=gv&&window.__SWR_DEVTOOLS_USE__,Lee=r3?window.__SWR_DEVTOOLS_USE__:[],Dee=()=>{r3&&(window.__SWR_DEVTOOLS_REACT__=jt)},o3=e=>Oi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Nee=()=>Ia(t3,f.useContext(zb)),Mee=e=>(t,n,r)=>e(t,n&&((...i)=>{const a=Dx(t)[0],[,,,l]=Sa.get(Nx),c=l[a];return c?(delete l[a],c):n(...i)}),r),Bee=Lee.concat(Mee),Fee=e=>function(...n){const r=Nee(),[o,i,a]=o3(n),l=n3(r,a);let c=e;const{use:u}=l,d=(u||[]).concat(Bee);for(let p=d.length;p--;)c=d[p](c);return c(o,i||l.fetcher||null,l)},zee=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}},r5e=(e,t)=>(...n)=>{const[r,o,i]=o3(n),a=(i.use||[]).concat(t);return e(r,o,{...i,use:a})};Dee();const $1={dedupe:!0},jee=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:a,revalidateOnMount:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,y]=Sa.get(r),[v,b]=Dx(e),w=f.useRef(!1),g=f.useRef(!1),S=f.useRef(v),C=f.useRef(t),R=f.useRef(n),k=()=>R.current,P=()=>k().isVisible()&&k().isOnline(),[O,L,I]=K4(r,v),A=f.useRef({}).current,M=Fn(a)?n.fallback[v]:a,F=(ue,pe)=>{let Ne=!0;for(const ye in A){const Me=ye;o(pe[Me],ue[Me])||Me==="data"&&Fn(ue[Me])&&o(pe[Me],$)||(Ne=!1)}return Ne},j=f.useMemo(()=>{const ue=(()=>!v||!t?!1:Fn(l)?!(k().isPaused()||i):l)(),pe=()=>{const ye=O(),Me=Ia(ye);return delete Me._k,ue?{isValidating:!0,isLoading:!0,...Me}:Me};let Ne=pe();return()=>{const ye=pe();return F(ye,Ne)?Ne:Ne=ye}},[r,v]),q=Fm.useSyncExternalStore(f.useCallback(ue=>I(v,(pe,Ne)=>{F(pe,Ne)||ue()}),[r,v]),j,j),G=!w.current,Z=q.data,J=Fn(Z)?M:Z,z=q.error,W=f.useRef(J),$=p?Fn(Z)?W.current:Z:J,N=(()=>G&&!Fn(l)?l:k().isPaused()?!1:i?Fn(J)?!1:n.revalidateIfStale:Fn(J)||n.revalidateIfStale)(),te=!!(v&&t&&G&&N),re=Fn(q.isValidating)?te:q.isValidating,we=Fn(q.isLoading)?te:q.isLoading,se=f.useCallback(async ue=>{const pe=C.current;if(!v||!pe||g.current||k().isPaused())return!1;let Ne,ye,Me=!0;const ut=ue||{},ot=!y[v]||!ut.dedupe,Te=()=>$_?!g.current&&v===S.current&&w.current:v===S.current,Et={isValidating:!1,isLoading:!1},Ze=()=>{L(Et)},st=()=>{const Ye=y[v];Ye&&Ye[1]===ye&&delete y[v]},At={isValidating:!0};Fn(O().data)&&(At.isLoading=!0);try{if(ot&&(L(At),n.loadingTimeout&&Fn(O().data)&&setTimeout(()=>{Me&&Te()&&k().onLoadingSlow(v,n)},n.loadingTimeout),y[v]=[pe(b),Fb()]),[Ne,ye]=y[v],Ne=await Ne,ot&&setTimeout(st,n.dedupingInterval),!y[v]||y[v][1]!==ye)return ot&&Te()&&k().onDiscarded(v),!1;Et.error=Wo;const Ye=m[v];if(!Fn(Ye)&&(ye<=Ye[0]||ye<=Ye[1]||Ye[1]===0))return Ze(),ot&&Te()&&k().onDiscarded(v),!1;const qe=O().data;Et.data=o(qe,Ne)?qe:Ne,ot&&Te()&&k().onSuccess(Ne,v,n)}catch(Ye){st();const qe=k(),{shouldRetryOnError:Ot}=qe;qe.isPaused()||(Et.error=Ye,ot&&Te()&&(qe.onError(Ye,v,qe),(Ot===!0||Oi(Ot)&&Ot(Ye))&&P()&&qe.onErrorRetry(Ye,v,qe,se,{retryCount:(ut.retryCount||0)+1,dedupe:!0})))}return Me=!1,Ze(),!0},[v,r]),Ee=f.useCallback((...ue)=>Z4(r,S.current,...ue),[]);if(qh(()=>{C.current=t,R.current=n,Fn(Z)||(W.current=Z)}),qh(()=>{if(!v)return;const ue=se.bind(Wo,$1);let pe=0;const ye=zee(v,h,Me=>{if(Me==P1.FOCUS_EVENT){const ut=Date.now();k().revalidateOnFocus&&ut>pe&&P()&&(pe=ut+k().focusThrottleInterval,ue())}else if(Me==P1.RECONNECT_EVENT)k().revalidateOnReconnect&&P()&&ue();else if(Me==P1.MUTATE_EVENT)return se()});return g.current=!1,S.current=v,w.current=!0,L({_k:b}),N&&(Fn(J)||bp?ue():Pee(ue)),()=>{g.current=!0,ye()}},[v]),qh(()=>{let ue;function pe(){const ye=Oi(c)?c(J):c;ye&&ue!==-1&&(ue=setTimeout(Ne,ye))}function Ne(){!O().error&&(u||k().isVisible())&&(d||k().isOnline())?se($1).then(pe):pe()}return pe(),()=>{ue&&(clearTimeout(ue),ue=-1)}},[c,u,d,v]),f.useDebugValue($),i&&Fn(J)&&v)throw!$_&&bp?new Error("Fallback data is required when using suspense in SSR."):(C.current=t,R.current=n,g.current=!1,Fn(z)?se($1):z);return{mutate:Ee,get data(){return A.data=!0,$},get error(){return A.error=!0,z},get isValidating(){return A.isValidating=!0,re},get isLoading(){return A.isLoading=!0,we}}},Uee=Gh.defineProperty(Oee,"defaultValue",{value:t3});var gn=Fee(jee);const Ft=(e,t=Ba)=>Mx(t,e),Js=(e,t=Ba)=>Mx(t,e),Wee=(e=Hee())=>e==="::baseUriPath::"?"":Mx(e),Mx=(...e)=>["",...e].join("/").replace(/\/+$/g,"").replace(/\/+/g,"/"),Hee=()=>{const e=document.querySelector('meta[name="baseUriPath"]');return(e==null?void 0:e.content)??""},Ba=Wee(),Si=Ke(s("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),Vee=Ke(s("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"}),"AddToPhotos"),Gee=Ke(s("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z"}),"Adjust"),qee=Ke(s("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"}),"Apps"),Yee=Ke(s("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),Kee=Ke(s("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),zm=Ke(s("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),Xee=Ke(s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle"),Jee=Ke(s("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"CircleOutlined"),Qee=Ke(s("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),vv=Ke(s("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),i3=Ke(s("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined"),a3=Ke(s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.5 14H8c-1.66 0-3-1.34-3-3s1.34-3 3-3l.14.01C8.58 8.28 10.13 7 12 7c2.21 0 4 1.79 4 4h.5c1.38 0 2.5 1.12 2.5 2.5S17.88 16 16.5 16z"}),"CloudCircle"),ti=Ke(s("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),Zee=Ke(s("path",{d:"m17 16-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}),"DeviceHub"),s3=Ke(s("path",{d:"M11 5.08V2c-5 .5-9 4.81-9 10s4 9.5 9 10v-3.08c-3-.48-6-3.4-6-6.92s3-6.44 6-6.92zM18.97 11H22c-.47-5-4-8.53-9-9v3.08C16 5.51 18.54 8 18.97 11zM13 18.92V22c5-.47 8.53-4 9-9h-3.03c-.43 3-2.97 5.49-5.97 5.92z"}),"DonutLarge"),ete=Ke(s("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"DragIndicator"),ea=Ke(s("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit"),tte=Ke(s("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1zm-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm1-3h-2v-2h2v2z"}),"ErrorOutlineRounded"),l3=Ke(s("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"}),"Extension"),nte=Ke(s("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),c3=Ke(s("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy"),rte=Ke(s("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),ote=Ke(s("path",{d:"m14.4 6-.24-1.2c-.09-.46-.5-.8-.98-.8H6c-.55 0-1 .45-1 1v15c0 .55.45 1 1 1s1-.45 1-1v-6h5.6l.24 1.2c.09.47.5.8.98.8H19c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1h-4.6z"}),"FlagRounded"),Bx=Ke(s("path",{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"}),"HelpOutline"),ite=Ke(s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info"),zd=Ke(s("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined"),jb=Ke(s("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Ub=Ke(s("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined"),ate=Ke(s("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),ste=Ke(s("path",{d:"M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z"}),"Label"),lte=Ke(s("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"}),"LibraryBooks"),cte=Ke(s("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}),"Link"),ute=Ke(s("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock"),dte=Ke(s("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"Pause"),pte=Ke(s("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),fte=Ke(s("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonChecked"),O_=Ke(s("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z"}),"Report"),Fx=Ke(s("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search"),zx=Ke(s("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),jx=Ke(s("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}),"StarBorder"),hte=Ke(s("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"}),"Timeline"),mte=Ke(s("path",{d:"m19.07 4.93-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z"}),"TrackChanges"),gte=Ke(s("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"Undo"),vte=Ke(s("path",{d:"M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"}),"UnfoldMoreOutlined"),u3=Ke(s("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility"),d3=Ke(s("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),yte=Ke(s("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"}),"VisibilityOffOutlined"),bte=Ke(s("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}),"VisibilityOutlined"),wte=Ke(s("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning"),p3=Ke([s("path",{d:"M12 5.99 19.53 19H4.47L12 5.99M12 2 1 21h22L12 2z"},"0"),s("path",{d:"M13 16h-2v2h2zm0-6h-2v5h2z"},"1")],"WarningAmber"),L_={name:"Unleash",version:"3.x",slogan:"The enterprise ready feature toggle service.",flags:{P:!1,RE:!1,EEA:!1,SE:!1,T:!1,UNLEASH_CLOUD:!1,UG:!1},links:[{value:"Documentation",icon:lte,href:"https://docs.getunleash.io/docs?source=oss",title:"User documentation"},{value:"GitHub",icon:"c_github",href:"https://github.com/Unleash",title:"Source code on GitHub"}]},Ux=400,tf=200,Ste=201,f3=404,h3=403,m3=401;class g3 extends Error{constructor(n=m3){super("Authentication required");ga(this,"statusCode");this.name="AuthenticationError",this.statusCode=n}}class xte extends Error{constructor(n=h3,r={}){var o;super((o=r.details)!=null&&o.length?r.details[0].message:"You cannot perform this action");ga(this,"statusCode");ga(this,"body");this.name="ForbiddenError",this.statusCode=n,this.body=r}}class Wx extends Error{constructor(n=Ux,r={}){var o;super((o=r.details)!=null&&o.length?r.details[0].message:"Bad request");ga(this,"statusCode");ga(this,"body");this.name="BadRequestError",this.statusCode=n,this.body=r}}class Hx extends Error{constructor(n=f3){super("The requested resource could not be found.");ga(this,"statusCode");this.name="NotFoundError",this.statusCode=n}}class v3 extends Error{constructor(n,r,o){super(`An error occurred while trying to get ${n}.`);ga(this,"status");ga(this,"body");this.name="ResponseError",this.status=r,this.body=o}}const Wb={Accept:"application/json","Content-Type":"application/json"},Cn=e=>async t=>{if(!t.ok)throw new v3(e,t.status,await Cte(t));return t},Cte=async e=>{try{return await e.json()}catch{return e.statusText}},Lt=()=>{const e=Ft("api/admin/ui-config"),{data:t,error:n,mutate:r}=gn(e,Ete),o=f.useCallback(()=>{var c,u;return!Boolean((u=(c=t==null?void 0:t.versionInfo)==null?void 0:c.current)==null?void 0:u.enterprise)},[t]),i=f.useCallback(()=>{var c;return((c=t==null?void 0:t.environment)==null?void 0:c.toLowerCase())==="pro"},[t]),a=f.useCallback(()=>{var c,u,d;return((c=t==null?void 0:t.environment)==null?void 0:c.toLowerCase())!=="pro"&&Boolean((d=(u=t==null?void 0:t.versionInfo)==null?void 0:u.current)==null?void 0:d.enterprise)},[t]);return{uiConfig:f.useMemo(()=>({...L_,...t,flags:{...L_.flags,...t==null?void 0:t.flags}}),[t]),loading:!n&&!t,error:n,refetch:r,isOss:o,isPro:i,isEnterprise:a}},Ete=e=>fetch(e).then(Cn("configuration")).then(t=>t.json()),y3=()=>{const{themeMode:e,setThemeMode:t}=f.useContext($s),{uiConfig:n}=Lt(),r=`${n.baseUriPath}:unleash-theme`;return{resolveTheme:()=>e==="light"?Wc:uee,onSetThemeMode:()=>{t(a=>a==="light"?(Uc(r,"dark"),"dark"):(Uc(r,"light"),"light"))},themeMode:e}},kte=NS({key:"mui",prepend:!0}),Tte=({children:e})=>{const{resolveTheme:t}=y3();return s(VS,{value:kte,children:T(nx,{theme:t(),children:[s(fq,{}),e]})})};var _te=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,o){return!Object.is(r,n[o])})},D_={error:null},Rte=function(e){gx(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state=D_,r.resetErrorBoundary=function(){for(var l,c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];r.props.onReset==null||(l=r.props).onReset.apply(l,u),r.reset()},r}t.getDerivedStateFromError=function(o){return{error:o}};var n=t.prototype;return n.reset=function(){this.setState(D_)},n.componentDidCatch=function(o,i){var a,l;(a=(l=this.props).onError)==null||a.call(l,o,i)},n.componentDidUpdate=function(o,i){var a=this.state.error,l=this.props.resetKeys;if(a!==null&&i.error!==null&&_te(o.resetKeys,l)){var c,u;(c=(u=this.props).onResetKeysChange)==null||c.call(u,o.resetKeys,l),this.reset()}},n.render=function(){var o=this.state.error,i=this.props,a=i.fallbackRender,l=i.FallbackComponent,c=i.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(f.isValidElement(c))return c;if(typeof a=="function")return a(u);if(l)return f.createElement(l,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(f.Component);const X=({condition:e,show:t,elseShow:n})=>{const r=i=>{const a=i();return a||(console.warn("Nothing was returned from your render function. Verify that you are returning a valid react component"),null)},o=i=>typeof i=="function";return e?o(t)?r(t):t:!e&&n?o(n)?r(n):n:null},Pte="NAVIGATE_TO_CREATE_FEATURE",o5e="NAVIGATE_TO_CREATE_GROUP",$te="NAVIGATE_TO_CREATE_SEGMENT",i5e="CREATE_API_TOKEN_BUTTON",Ite="CF_NAME_ID",Ate="CF_TYPE_ID",Ote="CF_DESC_ID",Lte="CF_CREATE_BTN_ID",a5e="UG_NAME_ID",s5e="UG_DESC_ID",l5e="UG_USERS_ID",c5e="UG_CREATE_BTN_ID",u5e="UG_SAVE_BTN_ID",d5e="UG_EDIT_BTN_ID",p5e="UG_DELETE_BTN_ID",f5e="UG_EDIT_USERS_BTN_ID",h5e="UG_REMOVE_USER_BTN_ID",m5e="PA_ASSIGN_BUTTON_ID",g5e="PA_USERS_GROUPS_ID",v5e="PA_ROLE_ID",y5e="PA_ASSIGN_CREATE_ID",b5e="PA_USERS_GROUPS_TITLE_ID",w5e="PA_EDIT_BUTTON_ID",S5e="PA_REMOVE_BUTTON_ID",Dte="SEGMENT_NAME_ID",Nte="SEGMENT_DESC_ID",Mte="SEGMENT_NEXT_BTN_ID",Bte="SEGMENT_CREATE_BTN_ID",Fte="SEGMENT_SAVE_BTN_ID",zte="SEGMENT_DELETE_BTN_ID",jte="SEGMENT_DIALOG_NAME_ID",yv="LOGIN_EMAIL_ID",bv="LOGIN_BUTTON",b3="LOGIN_PASSWORD_ID",Ute="SSO_LOGIN_BUTTON",Wte="FORGOTTEN_PASSWORD_FIELD",Hte="INVALID_TOKEN_BUTTON",x5e="FEATURE_ENVIRONMENT_ACCORDION",N_="ADD_NEW_STRATEGY_ID",Vte="ROLLOUT_SLIDER_ID",Gte="DIALOGUE_CONFIRM_ID",qte="FLEXIBLE_STRATEGY_STICKINESS_ID",Yte="FLEXIBLE_STRATEGY_GROUP_ID",w3="SELECT_ITEM_ID",Kte="STRATEGY_INPUT_LIST",Xte="ADD_TO_STRATEGY_INPUT_LIST",Jte="STRATEGY_FORM_SUBMIT_ID",C5e="STRATEGY_FORM_REMOVE_ID",E5e="STRATEGY_FORM_COPY_ID",S3="INPUT_ERROR_TEXT",Qte="HEADER_USER_AVATAR",Zte="SIDEBAR_MODAL_ID",ene="AUTH_PAGE_ID",tne="ANNOUNCER_ELEMENT_TEST_ID",Vx="INSTANCE_STATUS_BAR_ID",nne="TOAST_TEXT",k5e="LARGE_NUMBER_PRETTIFIED",rne=E(Pq)(({theme:e,maxWidth:t})=>({"& .MuiDialog-paper":{borderRadius:e.shape.borderRadiusLarge,maxWidth:t?void 0:e.spacing(85),backgroundColor:"transparent"}})),one=E(Kq)(({theme:e})=>({backgroundColor:e.palette.primary.main,color:e.palette.text.tertiaryContrast,padding:e.spacing(3.5,6),fontWeight:e.fontWeight.medium})),ine=E("div")(({theme:e})=>({padding:e.spacing(6),backgroundColor:e.palette.background.paper})),ane=E(Hq)(({theme:e})=>({padding:0,marginBottom:e.spacing(6)})),sne=E(Dq)(({theme:e})=>({gap:e.spacing(2),padding:0})),cr=({children:e,open:t,onClick:n,onClose:r,title:o,primaryButtonText:i,disabledPrimaryButton:a=!1,secondaryButtonText:l,maxWidth:c,fullWidth:u=!1,formId:d,permissionButton:p})=>{const h=d?m=>{m.preventDefault(),n&&n(m)}:n;return T(rne,{open:t,onClose:r,fullWidth:u,"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description",maxWidth:c,children:[s(one,{children:o}),T(ine,{children:[s(X,{condition:Boolean(e),show:s(ane,{children:e})}),T(sne,{children:[s(X,{condition:Boolean(p),show:p,elseShow:s(X,{condition:Boolean(n),show:s(rt,{form:d,color:"primary",variant:"contained",onClick:h,autoFocus:!d,disabled:a,"data-testid":Gte,type:d?"submit":"button",children:i||"Yes, I'm sure"})})}),s(X,{condition:Boolean(r),show:s(rt,{onClick:r,children:l||"No, take me back"})})]})]})]})},x3=f.createContext(null),Is=()=>{const e=f.useContext(x3);return{trackEvent:f.useCallback((n,r,o)=>{e!=null&&e.trackEvent?e.trackEvent(n,r,o):r!=null&&r.callback&&r.callback()},[e])}},lne=({error:e})=>{const t=ft(),{trackEvent:n}=Is();return f.useEffect(()=>{var i;const{message:r,stack:o="unknown"}=e;n("unknown_ui_error",{props:{location:((i=window==null?void 0:window.location)==null?void 0:i.href)||"unknown",message:r,stack:o}})},[]),s(Je,{sx:{backgroundColor:"neutral.light",height:"100%",p:4},children:T(cr,{open:!0,title:"Something went wrong",primaryButtonText:"Go back",onClick:()=>{var r;t("/"),(r=window==null?void 0:window.location)==null||r.reload()},secondaryButtonText:"Reload this page",onClose:()=>{var r;(r=window==null?void 0:window.location)==null||r.reload()},maxWidth:"xl",children:[s(Je,{component:"pre",sx:{color:"error.main"},children:e.message}),s(X,{condition:Boolean(e.stack),show:s(Je,{component:"pre",sx:{color:"error.main"},children:e.stack})})]})})};var Gx={},fn={},cne={get exports(){return fn},set exports(e){fn=e}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(cne);var I1={};const une=Xc(QU);var M_;function En(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=une}(I1)),I1}const kn=Xc(qN);var dne=fn;Object.defineProperty(Gx,"__esModule",{value:!0});var wv=Gx.default=void 0,pne=dne(En()),fne=kn,hne=(0,pne.default)((0,fne.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");wv=Gx.default=hne;const mne=e=>f.createElement("svg",{width:23,height:23,viewBox:"0 0 23 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{x:.288513,y:.288574,width:7.13461,height:22.4231,fill:"#1A4049"}),f.createElement("rect",{x:15.5769,y:.288574,width:7.13461,height:22.4231,fill:"#1A4049"}),f.createElement("path",{d:"M22.7115 15.5771L22.7115 22.7118L0.28841 22.7118L0.28841 15.5771L22.7115 15.5771Z",fill:"#1A4049"}),f.createElement("rect",{x:15.5769,y:15.5771,width:7.13461,height:7.13461,fill:"#817AFE"})),qx=({mounted:e,enter:t,start:n,leave:r,children:o,onStart:i,onEnd:a})=>{const[l,c]=f.useState(e),[u,d]=f.useState({}),p=f.useRef(null);return f.useEffect(()=>{(p.current!==e||p===null)&&(e?(c(!0),i==null||i(),setTimeout(()=>{d(t)},50)):(r||c(!1),d(r||{})))},[e,t,i,r]),s(X,{condition:l,show:s("div",{onTransitionEnd:()=>{e||(c(!1),a==null||a())},style:{...n,...u},children:o})})};var pl={};const gne=Xc(Nz);var C3={},nf={},Sv={};Object.defineProperty(Sv,"__esModule",{value:!0});Sv.objectFromEntries=void 0;Sv.objectFromEntries=Object.fromEntries?Object.fromEntries:e=>{if(!e||!e[Symbol.iterator])throw new Error("Object.fromEntries() requires a single iterable argument");const t={};return Object.keys(e).forEach(n=>{const[r,o]=e[n];t[r]=o}),t};var rf={};Object.defineProperty(rf,"__esModule",{value:!0});rf.objectKeys=void 0;function vne(e){return Object.keys(e)}rf.objectKeys=vne;var E3={},k3={},of={};Object.defineProperty(of,"__esModule",{value:!0});of.assert=void 0;function yne(e,t){if(!e)throw new Error(t)}of.assert=yne;var af={};Object.defineProperty(af,"__esModule",{value:!0});af.typeGuard=void 0;function bne(e,t){return t}af.typeGuard=bne;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.classnames=void 0;const t=of,n=af,r=o=>{const i=o.length;let a=0,l="";for(;a<i;a++){const c=o[a];if(c==null)continue;let u;switch(typeof c){case"boolean":break;case"object":{if(Array.isArray(c))u=(0,e.classnames)(c);else{(0,t.assert)(!(0,n.typeGuard)(c,!1)),u="";for(const d in c)c[d]&&d&&(u&&(u+=" "),u+=d)}break}default:u=c}u&&(l&&(l+=" "),l+=u)}return l};e.classnames=r})(k3);const wne=Xc(MF),Sne=Xc(IF);var xv={};Object.defineProperty(xv,"__esModule",{value:!0});xv.useGuaranteedMemo=void 0;const xne=f;function Cne(e,t){const n=(0,xne.useRef)();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}xv.useGuaranteedMemo=Cne;var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0});Cv.matchCSSObject=void 0;function Ene(e){return e instanceof Object&&!("styles"in e)&&!("length"in e)&&!("__emotion_styles"in e)}Cv.matchCSSObject=Ene;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createUseCssAndCx=e.createCssAndCx=void 0;const t=k3,n=wne,r=Sne,o=xv,i=Cv;e.createCssAndCx=(()=>{function c(d,p,h){const m=[],y=(0,r.getRegisteredStyles)(d,m,h);return m.length<2?h:y+p(m)}function u(d){const{cache:p}=d,h=(...y)=>{const v=(0,n.serializeStyles)(y,p.registered);(0,r.insertStyles)(p,v,!1);const b=`${p.key}-${v.name}`;e:{const w=y[0];if(!(0,i.matchCSSObject)(w))break e;l.saveClassNameCSSObjectMapping(p,b,w)}return b};return{css:h,cx:(...y)=>{const v=(0,t.classnames)(y),b=l.fixClassName(p,v,h);return c(p.registered,h,b)}}}return{createCssAndCx:u}})().createCssAndCx;function a(c){const{useCache:u}=c;function d(){const p=u(),{css:h,cx:m}=(0,o.useGuaranteedMemo)(()=>(0,e.createCssAndCx)({cache:p}),[p]);return{css:h,cx:m}}return{useCssAndCx:d}}e.createUseCssAndCx=a;const l=(()=>{const c=new WeakMap;return{saveClassNameCSSObjectMapping:(u,d,p)=>{let h=c.get(u);h===void 0&&(h=new Map,c.set(u,h)),h.set(d,p)},fixClassName:(()=>{function u(d){let p=!1;return d.map(([h,m])=>{if(m===void 0)return h;let y;if(p)y={"&&":m};else{y=h;for(const v in m)if(v.startsWith("@media")){p=!0;break}}return y})}return(d,p,h)=>{const m=c.get(d);return(0,t.classnames)(u(p.split(" ").map(y=>[y,m==null?void 0:m.get(y)])).map(y=>typeof y=="string"?y:h(y)))}})()}})()})(E3);var Ev={};Object.defineProperty(Ev,"__esModule",{value:!0});Ev.getDependencyArrayRef=void 0;function kne(e){if(!(e instanceof Object)||typeof e=="function")return e;const t=[];for(const n in e){const r=e[n],o=typeof r;if(!(o==="string"||o==="number"&&!isNaN(r)||o==="boolean"||r===void 0||r===null))return e;t.push(`${n}:${o}_${r}`)}return"xSqLiJdLMd9s"+t.join("|")}Ev.getDependencyArrayRef=kne;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});kv.mergeClasses=void 0;const B_=rf;function Tne(e,t,n){if(!(t instanceof Object))return e;const r={};return(0,B_.objectKeys)(e).forEach(o=>r[o]=n(e[o],t[o])),(0,B_.objectKeys)(t).forEach(o=>{if(o in e)return;const i=t[o];typeof i=="string"&&(r[o]=i)}),r}kv.mergeClasses=Tne;const Yx=Xc(QF);Object.defineProperty(nf,"__esModule",{value:!0});nf.createMakeStyles=void 0;const sh=f,_ne=Sv,F_=rf,Rne=E3,lh=Ev,Pne=af,$ne=of,z_=kv,Ine=Yx;let Ane=0;function One(e){const{useTheme:t,cache:n}=e;function r(){const l=(0,Ine.__unsafe_useEmotionCache)(),c=n??l;if(c===null)throw new Error(["In order to get SSR working with tss-react you need to explicitly provide an Emotion cache.","MUI users be aware: This is not an error strictly related to tss-react, with or without tss-react,","MUI needs an Emotion cache to be provided for SSR to work.","Here is the MUI documentation related to SSR setup: https://mui.com/material-ui/guides/server-rendering/","TSS provides helper that makes the process of setting up SSR easier: https://docs.tss-react.dev/ssr"].join(`
|
|
278
|
-
`));return c}const{useCssAndCx:o}=(0,Rne.createUseCssAndCx)({useCache:r});function i(l){const{name:c,uniqId:u=Ane++}=l??{},d=typeof c!="object"?c:Object.keys(c)[0];return function(p){const h=typeof p=="function"?p:()=>p;return function(y,v){var b,w;const g=t(),{css:S,cx:C}=o(),R=r();let k=(0,sh.useMemo)(()=>{const O={},L=typeof Proxy<"u"&&new Proxy({},{get:(M,F)=>(typeof F=="symbol"&&(0,$ne.assert)(!1),O[F]=`${R.key}-${u}${d!==void 0?`-${d}`:""}-${F}-ref`)}),I=h(g,y,L||{}),A=(0,_ne.objectFromEntries)((0,F_.objectKeys)(I).map(M=>{const F=I[M];return F.label||(F.label=`${d!==void 0?`${d}-`:""}${M}`),[M,`${S(F)}${(0,Pne.typeGuard)(M,M in O)?` ${O[M]}`:""}`]}));return(0,F_.objectKeys)(O).forEach(M=>{M in A||(A[M]=O[M])}),A},[R,S,C,g,(0,lh.getDependencyArrayRef)(y)]);const P=v==null?void 0:v.props.classes;k=(0,sh.useMemo)(()=>(0,z_.mergeClasses)(k,P,C),[k,(0,lh.getDependencyArrayRef)(P),C]);{let O;try{O=d!==void 0?(w=(b=g.components)===null||b===void 0?void 0:b[d])===null||w===void 0?void 0:w.styleOverrides:void 0}catch{}const L=(0,sh.useMemo)(()=>{if(!O)return;const I={};for(const A in O){const M=O[A];M instanceof Object&&(I[A]=S(typeof M=="function"?M(Object.assign({theme:g,ownerState:v==null?void 0:v.ownerState},v==null?void 0:v.props)):M))}return I},[O===void 0?void 0:JSON.stringify(O),(0,lh.getDependencyArrayRef)(v==null?void 0:v.props),(0,lh.getDependencyArrayRef)(v==null?void 0:v.ownerState),S]);k=(0,sh.useMemo)(()=>(0,z_.mergeClasses)(k,L,C),[k,L,C])}return{classes:k,theme:g,css:S,cx:C}}}}function a(){const l=t(),{css:c,cx:u}=o();return{theme:l,css:c,cx:u}}return{makeStyles:i,useStyles:a}}nf.createMakeStyles=One;var Tv={},_v={};Object.defineProperty(_v,"__esModule",{value:!0});_v.capitalize=void 0;function Lne(e){return e.charAt(0).toUpperCase()+e.slice(1)}_v.capitalize=Lne;var Dne=Rn&&Rn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Nne=Rn&&Rn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mne=Rn&&Rn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Dne(t,e,n);return Nne(t,e),t},j_=Rn&&Rn.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(Tv,"__esModule",{value:!0});Tv.createWithStyles=void 0;const A1=Mne(f),Bne=nf,U_=_v;function Fne(e){const{useTheme:t,cache:n}=e,{makeStyles:r}=(0,Bne.createMakeStyles)({useTheme:t,cache:n});function o(i,a,l){const c=typeof i=="string"?(()=>{const m=i,y=function(v){var{children:b}=v,w=j_(v,["children"]);return(0,A1.createElement)(m,w,b)};return Object.defineProperty(y,"name",{value:(0,U_.capitalize)(m)}),y})():i,u=(()=>{{const m=c.displayName;if(m)return m}{const{name:m}=c;if(m)return m}return l==null?void 0:l.name})(),d=r(Object.assign(Object.assign({},l),{name:u}))(typeof a=="function"?(m,y,v)=>W_(a(m,y,v)):W_(a));function p(m){for(const y in m)if(y!=="root")return!0;return!1}const h=(0,A1.forwardRef)(function(m,y){const{className:v,classes:b}=m,w=j_(m,["className","classes"]),{classes:g,cx:S}=d(m,{props:m});return A1.default.createElement(c,Object.assign({ref:y,className:p(g)?v:S(g.root,v)},typeof i=="string"?{}:{classes:g},w))});return u!==void 0&&(h.displayName=`${(0,U_.capitalize)(u)}WithStyles`,Object.defineProperty(h,"name",{value:h.displayName})),h}return{withStyles:o}}Tv.createWithStyles=Fne;function W_(e){const t={},n={};return Object.keys(e).forEach(r=>(r.startsWith("@media")?n:t)[r]=e[r]),Object.keys(n).forEach(r=>{const o=n[r];Object.keys(o).forEach(i=>{var a;return t[i]=Object.assign(Object.assign({},(a=t[i])!==null&&a!==void 0?a:{}),{[r]:o[i]})})}),t}var Rv={},zne=Rn&&Rn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),jne=Rn&&Rn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Une=Rn&&Rn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zne(t,e,n);return jne(t,e),t},Wne=Rn&&Rn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rv,"__esModule",{value:!0});Rv.GlobalStyles=void 0;const Hne=Wne(f),H_=Une(Yx);function Vne(e){const{styles:t}=e;return Hne.default.createElement(H_.Global,{styles:H_.css(t)})}Rv.GlobalStyles=Vne;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMakeAndWithStyles=e.GlobalStyles=e.keyframes=e.createWithStyles=e.createMakeStyles=void 0;const t=nf;Object.defineProperty(e,"createMakeStyles",{enumerable:!0,get:function(){return t.createMakeStyles}});const n=Tv;Object.defineProperty(e,"createWithStyles",{enumerable:!0,get:function(){return n.createWithStyles}});var r=Yx;Object.defineProperty(e,"keyframes",{enumerable:!0,get:function(){return r.keyframes}});var o=Rv;Object.defineProperty(e,"GlobalStyles",{enumerable:!0,get:function(){return o.GlobalStyles}});function i(a){return Object.assign(Object.assign({},(0,t.createMakeStyles)(a)),(0,n.createWithStyles)(a))}e.createMakeAndWithStyles=i})(C3);var ai,Kx,ch;Object.defineProperty(pl,"__esModule",{value:!0});pl.useStyles=Kx=pl.withStyles=ai=pl.makeStyles=void 0;const Gne=gne,qne=C3;ch=(0,qne.createMakeAndWithStyles)({useTheme:Gne.useTheme}),ai=pl.makeStyles=ch.makeStyles,Kx=pl.withStyles=ch.withStyles,pl.useStyles=ch.useStyles;const Pv=e=>({"&:focus-visible":{outline:0,outlineStyle:"solid",outlineWidth:2,outlineOffset:2,outlineColor:e.palette.primary.main}}),sf=e=>({"& > *":{marginTop:`${e.spacing(1)} !important`,marginBottom:`${e.spacing(1)} !important`}}),Yne=e=>({fontSize:e.fontSizes.mainHeader,fontWeight:"bold",marginBottom:e.spacing(1)}),T3={textAlign:"center"},Kne={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},$v={display:"flex",alignItems:"center"},_3={display:"flex",flexDirection:"column"},Xne={alignItems:"center"},Jne={position:"relative"},T5e=e=>({borderRadius:`${e.shape.borderRadius}px`}),R3={opacity:"0",right:"40px",bottom:"40px",transform:"translateY(400px)",zIndex:1400,position:"fixed"},P3={transform:"translateY(0)",opacity:"1",transition:"transform 0.6s ease, opacity 1s ease"},Qne={transform:"translateY(400px)",opacity:"0",transition:"transform 1.25s ease, opacity 1s ease"},Zne=e=>({opacity:"0",position:"fixed",right:"40px",top:"40px",transform:"translateY(-400px)",[e.breakpoints.down("sm")]:{right:20,left:10,top:40}}),ere={transform:"translateY(100px)",opacity:"1",transition:"transform 0.6s ease, opacity 1s ease"},tre={transform:"translateY(-400px)",opacity:"0",transition:"transform 1.25s ease, opacity 1s ease"},lf=ai()(e=>({focusable:{"&:focus-visible":{outline:0,outlineStyle:"solid",outlineWidth:2,outlineOffset:2,outlineColor:e.palette.primary.main}},contentSpacingY:{"& > *":{marginTop:"0.5rem !important",marginBottom:"0.5rem !important"}},divider:{margin:"1rem 0",backgroundColor:e.palette.divider,height:"3px",width:"100%"},largeDivider:{margin:"2rem 0",backgroundColor:e.palette.divider,height:"3px",width:"100%"},bold:{fontWeight:"bold"},flexRow:{display:"flex",alignItems:"center"},flexColumn:{display:"flex",flexDirection:"column"},itemsCenter:{alignItems:"center"},justifyCenter:{justifyContent:"center"},flexWrap:{flexWrap:"wrap"},textCenter:{textAlign:"center"},fullWidth:{width:"100%"},fullHeight:{height:"100%"},title:{fontSize:e.fontSizes.mainHeader,fontWeight:"bold",marginBottom:"0.5rem"},error:{fontSize:e.fontSizes.smallBody,color:e.palette.error.main}}));function jn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Yh(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yh=function(n){return typeof n}:Yh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Yh(e)}function sr(e){jn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Yh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wp(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function V_(e){jn(1,arguments);var t=sr(e);return t.setHours(0,0,0,0),t}var nre=864e5;function rre(e,t){jn(2,arguments);var n=V_(e),r=V_(t),o=n.getTime()-wp(n),i=r.getTime()-wp(r);return Math.round((o-i)/nre)}function G_(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function $3(e,t){jn(2,arguments);var n=sr(e),r=sr(t),o=G_(n,r),i=Math.abs(rre(n,r));n.setDate(n.getDate()-o*i);var a=Number(G_(n,r)===-o),l=o*(i-a);return l===0?0:l}const I3="pnps",ore=e=>{if(!e)return!1;if(e.length===0)return!0;const t=e.find(n=>n.feedbackId===I3);if(!t)return!0;if(t.neverShow)return!1;if(t.given){const r=new Date;return $3(r,new Date(t.given))>182}return!1},cf=()=>{const{data:e,error:t}=gn(Hb,ire,are),n=f.useCallback(()=>{Vr(Hb).catch(console.warn)},[]);return{data:e,refetchAuth:n,loading:!t&&!e,error:t}},ire=()=>fetch(Hb).then(e=>e.json()),are={revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:15e3},Hb=Ft("api/admin/user"),Xx=()=>{const e=cf();return{feedback:e.data&&"feedback"in e.data?e.data.feedback:void 0,refetchFeedback:e.refetchAuth,loading:e.loading,error:e.error}},A3=()=>{const{refetchFeedback:e}=Xx(),t=Ft("api/admin/feedback"),n=f.useCallback(async o=>{await q_("POST",t,o),await e()},[t,e]),r=f.useCallback(async o=>{const i=`${t}/${o.feedbackId}`;await q_("PUT",i,o),await e()},[t,e]);return{createFeedback:n,updateFeedback:r}},q_=async(e,t,n)=>{await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},sre=({openUrl:e})=>{const{showFeedback:t,setShowFeedback:n}=f.useContext($s),{createFeedback:r,updateFeedback:o}=A3(),{feedback:i}=Xx(),[a,l]=f.useState(!1),c=sn(),u=I3,d=f.useMemo(()=>({start:{...Zne(c),zIndex:c.zIndex.tooltip},enter:ere,leave:tre}),[c]),p=async()=>{try{await r({feedbackId:u})}catch(m){console.warn(m),n(!1)}window.open(e,"_blank"),setTimeout(()=>{n(!1)},200)},h=async()=>{try{await o({feedbackId:u,neverShow:!0})}catch(m){console.warn(m),n(!1)}setTimeout(()=>{n(!1)},100)};return ore(i)?s(qx,{mounted:t,start:d.start,enter:d.enter,leave:d.leave,children:s(Je,{sx:{borderRadius:"12.5px",backgroundColor:c.palette.background.paper,zIndex:9999,boxShadow:"2px 2px 4px 4px rgba(143,143,143, 0.25)",padding:c.spacing(3),maxWidth:"400px"},children:T(Je,{sx:{display:"flex",flexDirection:"column",position:"relative",...sf(c)},children:[s(Tt,{title:"Close",arrow:!0,children:s(Qt,{sx:{position:"absolute",right:"-38px",top:"-47px",backgroundColor:c.palette.background.paper,boxShadow:"2px 2px 4px 4px rgba(143,143,143, 0.25)","&:hover":{backgroundColor:"#fff"}},onClick:()=>n(!1),size:"large",children:s(wv,{})})}),s(mne,{style:{width:"25px",height:"25px"}}),s(X,{condition:a,show:s("p",{children:"Alright, apologies for the disruption. Have a nice day!"}),elseShow:T("p",{children:["Hi. Do you have 2 minutes to help us improve Unleash?"," "]})}),s(Je,{children:s(X,{condition:a,show:s(rt,{variant:"outlined",onClick:h,children:"Don't show again"}),elseShow:T(Re,{children:[s(rt,{variant:"contained",color:"primary",onClick:p,children:"Yes, no problem"}),s(rt,{sx:{marginLeft:m=>m.spacing(2)},onClick:()=>l(!0),children:"Not now"})]})})})]})})}):null};var Jx={},lre=fn;Object.defineProperty(Jx,"__esModule",{value:!0});var O3=Jx.default=void 0,cre=lre(En()),ure=kn,dre=(0,cre.default)((0,ure.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");O3=Jx.default=dre;var Qx={},pre=fn;Object.defineProperty(Qx,"__esModule",{value:!0});var L3=Qx.default=void 0,fre=pre(En()),hre=kn,mre=(0,fre.default)((0,hre.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");L3=Qx.default=mre;var Zx={},gre=fn;Object.defineProperty(Zx,"__esModule",{value:!0});var D3=Zx.default=void 0,vre=gre(En()),yre=kn,bre=(0,vre.default)((0,yre.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");D3=Zx.default=bre;var eC={},wre=fn;Object.defineProperty(eC,"__esModule",{value:!0});var N3=eC.default=void 0,Sre=wre(En()),xre=kn,Cre=(0,Sre.default)((0,xre.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");N3=eC.default=Cre;const Ere=E(fv)(({theme:e})=>({width:e.spacing(3.5),height:e.spacing(3.5),margin:"auto",backgroundColor:e.palette.secondary.light,color:e.palette.text.primary,fontSize:e.fontSizes.smallerBody,fontWeight:e.fontWeight.bold})),tC=({user:e,src:t,title:n,onMouseEnter:r,onMouseLeave:o,className:i,sx:a,children:l,...c})=>{!n&&!r&&e&&(n=`${(e==null?void 0:e.name)||(e==null?void 0:e.email)||(e==null?void 0:e.username)} (id: ${e==null?void 0:e.id})`),!t&&e&&(t=e==null?void 0:e.imageUrl);let u;return!l&&e&&(u=(e==null?void 0:e.name)||(e==null?void 0:e.email)||(e==null?void 0:e.username),u&&u.includes(" ")?u=`${u.split(" ")[0][0]}${u.split(" ")[1][0]}`.toUpperCase():u&&(u=u[0].toUpperCase())),s(Ere,{className:i,sx:a,...c,"data-loading":!0,alt:"Gravatar",src:t,title:n,onMouseEnter:r,onMouseLeave:o,children:s(X,{condition:Boolean(u),show:u,elseShow:l})})},kre=E(Tr)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(3),borderRadius:e.shape.borderRadiusMedium,boxShadow:e.boxShadows.popup,position:"absolute",zIndex:5e3,minWidth:e.spacing(37.5),right:0,[e.breakpoints.down("md")]:{width:"100%",padding:"1rem"}})),Tre=E("div")(({theme:e})=>({alignSelf:"flex-start",display:"flex",alignItems:"center",marginBottom:e.spacing(2)})),_re=E(tC)(({theme:e})=>({width:e.spacing(4.75),height:e.spacing(4.75),marginRight:e.spacing(1.5)})),Rre=E(ke)(({theme:e})=>({color:e.palette.text.secondary})),M3=E(po)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:0,color:e.palette.primary.dark,fontWeight:e.fontWeight.medium,"&:hover, &:focus":{textDecoration:"underline"},"& svg":{fontSize:e.spacing(2.25)}})),Pre=E(M3)(({theme:e})=>({alignSelf:"flex-start"})),$re=E(rt)(({theme:e})=>({width:"100%",height:e.spacing(5)})),Y_=E("div")(({theme:e})=>({width:"100%",height:"1px",backgroundColor:e.palette.divider,margin:e.spacing(3,0)})),Ire=({id:e,showProfile:t,setShowProfile:n,profile:r})=>s(X,{condition:t,show:T(kre,{id:e,children:[T(Tre,{children:[s(_re,{user:r}),T("div",{children:[s(ke,{children:r.name||r.username}),s(Rre,{variant:"body2",children:r.email})]})]}),s(M3,{component:on,to:"/profile",underline:"hover",onClick:()=>n(!1),children:"View profile settings"}),s(Y_,{}),T(Pre,{component:"a",href:"https://www.getunleash.io/privacy-policy",underline:"hover",rel:"noopener noreferrer",target:"_blank",children:["Privacy Policy ",s(N3,{})]}),s(Y_,{}),s($re,{variant:"outlined",color:"primary",href:`${Ba}/logout`,children:"Log out"})]})}),Ss=(e="useId")=>f.useMemo(()=>`${e}-${Are++}`,[e]);let Are=0;const Ore=E(tC)(({theme:e})=>({width:e.spacing(4.5),height:e.spacing(4.5)})),Lre=E("div")(({theme:e})=>({position:"relative"})),Dre=E(rt)(({theme:e})=>({...Pv(e),...$v,...Xne,color:"inherit",padding:e.spacing(.5,2),"&:hover":{backgroundColor:"transparent"}})),Nre=E(D3)(({theme:e})=>({color:e.palette.neutral.main})),Mre=({profile:e})=>{const[t,n]=f.useState(!1),r=Ss();return s(Vz,{onClickAway:()=>n(!1),children:T(Lre,{children:[T(Dre,{onClick:()=>n(o=>!o),"aria-controls":t?r:void 0,"aria-expanded":t,color:"secondary",disableRipple:!0,children:[s(Ore,{user:e,"data-testid":Qte}),s(Nre,{})]}),s(Ire,{id:r,showProfile:t,setShowProfile:n,profile:e})]})})},si=()=>{const e=cf();return{user:e.data&&"user"in e.data?e.data.user:void 0,refetchUser:e.refetchAuth,loading:e.loading,error:e.error}},K_=()=>{const{user:e}=si();return e?s(Mre,{profile:e}):null};var nC={},Bre=fn;Object.defineProperty(nC,"__esModule",{value:!0});var rC=nC.default=void 0,Fre=Bre(En()),X_=kn,zre=(0,Fre.default)([(0,X_.jsx)("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1zm0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5v11.5z"},"0"),(0,X_.jsx)("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99zM13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83zm4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24z"},"1")],"MenuBook");rC=nC.default=zre;const jre=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 653.4 251.24",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#1a4049;}.cls-2{fill:#fff;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"})),Ure=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 653.4 251.24",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#fff;}.cls-2{fill:#1a4049;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-1",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-1",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}));var oC={},Wre=fn;Object.defineProperty(oC,"__esModule",{value:!0});var B3=oC.default=void 0;Gre(f);var Hre=Wre(En()),Vre=kn;function F3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F3=function(r){return r?n:t})(e)}function Gre(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F3(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var qre=(0,Hre.default)((0,Vre.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");B3=oC.default=qre;var iC={},Yre=fn;Object.defineProperty(iC,"__esModule",{value:!0});var z3=iC.default=void 0,Kre=Yre(En()),Xre=kn,Jre=(0,Kre.default)((0,Xre.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"}),"LibraryBooks");z3=iC.default=Jre;var aC={},Qre=fn;Object.defineProperty(aC,"__esModule",{value:!0});var j3=aC.default=void 0,Zre=Qre(En()),eoe=kn,toe=(0,Zre.default)((0,eoe.jsx)("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"ExitToApp");j3=aC.default=toe;const U3=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 251.43 251.03",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#1a4049;}.cls-2{fill:#fff;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.71,cy:125.31,r:80}),f.createElement("polygon",{className:"cls-2",points:"137.14 91.03 137.14 113.88 137.14 136.74 160 136.74 160 113.88 160 91.03 137.14 91.03"}),f.createElement("polygon",{className:"cls-2",points:"114.29 113.88 114.29 91.03 91.43 91.03 91.43 113.88 91.43 136.74 91.43 159.6 114.29 159.6 137.14 159.6 137.14 136.74 114.29 136.74 114.29 113.88"}),f.createElement("rect",{className:"cls-3",x:137.14,y:136.74,width:22.86,height:22.86})),noe=E(zi)({minWidth:"150px",height:"100%",width:"100%",margin:"0",padding:"0"}),roe=E(on)(({theme:e})=>({textDecoration:"none",alignItems:"center",display:"flex",color:"inherit",height:"100%",width:"100%","&&":{color:"black",padding:e.spacing(1,2)}})),ooe=E("span")(({theme:e})=>({width:"12.5px",height:"12.5px",display:"block",backgroundColor:e.palette.primary.main,marginRight:"1rem",borderRadius:"2px"})),J_=({path:e,text:t,handleClose:n})=>s(noe,{onClick:()=>{n()},children:T(po,{style:{textDecoration:"none"},component:roe,to:e,underline:"hover",children:[s(ooe,{}),t]})}),ioe="_drawer_cxqms_1",aoe="_drawerTitle_cxqms_6",soe="_drawerContainer_cxqms_13",loe="_drawerTitleLogo_cxqms_17",coe="_drawerTitleText_cxqms_22",uoe="_drawerList_cxqms_27",doe="_iconLinkList_cxqms_28",poe="_iconLink_cxqms_28",foe="_navigationLink_cxqms_42",hoe="_navigationLinkActive_cxqms_50",moe="_navigationIcon_cxqms_56",goe="_iconGitHub_cxqms_61",vo={drawer:ioe,drawerTitle:aoe,drawerContainer:soe,drawerTitleLogo:loe,drawerTitleText:coe,drawerList:uoe,iconLinkList:doe,iconLink:poe,navigationLink:foe,navigationLinkActive:hoe,navigationIcon:moe,iconGitHub:goe},voe=({links:e=[],title:t="Unleash",flags:n={},open:r=!1,toggleDrawer:o,admin:i=!1,routes:a})=>{const l=()=>e.map(c=>{let u=null;return c.value==="GitHub"?u=s(B3,{className:vo.navigationIcon}):c.value==="Documentation"&&(u=s(z3,{className:vo.navigationIcon})),T("a",{href:c.href,rel:"noopener noreferrer",target:"_blank",className:vo.iconLink,children:[u,c.value]},c.value)});return s(vY,{className:vo.drawer,open:r,anchor:"left",onClose:o,children:T("nav",{id:"header-drawer",className:vo.drawerContainer,children:[s("div",{children:T(on,{to:"/",className:vo.drawerTitle,"aria-label":"Home",onClick:()=>o(),children:[s(U3,{className:vo.drawerTitleLogo,"aria-label":"Unleash logo"}),s("span",{className:vo.drawerTitleText,children:t})]})}),s(uo,{}),s(Yi,{className:vo.drawerList,children:a.mobileRoutes.map(c=>s(J_,{handleClose:()=>o(),path:c.path,text:c.title},c.path))}),s(X,{condition:i,show:T(Re,{children:[s(uo,{}),s(Yi,{className:vo.drawerList,children:a.adminRoutes.map(c=>s(J_,{handleClose:()=>o(),path:c.path,text:c.title},c.path))})]})}),s(uo,{}),T("div",{className:vo.iconLinkList,children:[l(),T("a",{className:vo.iconLink,href:`${Ba}/logout`,children:[s(j3,{className:vo.navigationIcon}),"Sign out"]})]})]})})},xi="ADMIN",Sp="CREATE_FEATURE",W3="UPDATE_FEATURE",yoe="DELETE_FEATURE",jm="CREATE_STRATEGY",Iv="UPDATE_STRATEGY",boe="DELETE_STRATEGY",Q_="UPDATE_APPLICATION",Um="CREATE_CONTEXT_FIELD",H3="UPDATE_CONTEXT_FIELD",woe="DELETE_CONTEXT_FIELD",Z_="CREATE_PROJECT",Vb="UPDATE_PROJECT",Soe="DELETE_PROJECT",xoe="DELETE_TAG_TYPE",xp="UPDATE_TAG_TYPE",V3="CREATE_ADDON",Gb="UPDATE_ADDON",Coe="DELETE_ADDON",_5e="CREATE_API_TOKEN",R5e="DELETE_API_TOKEN",P5e="READ_API_TOKEN",Eoe="DELETE_ENVIRONMENT",qb="UPDATE_ENVIRONMENT",G3="CREATE_FEATURE_STRATEGY",sC="UPDATE_FEATURE_STRATEGY",koe="DELETE_FEATURE_STRATEGY",Toe="UPDATE_FEATURE_ENVIRONMENT",$5e="UPDATE_FEATURE_VARIANTS",I5e="UPDATE_FEATURE_ENVIRONMENT_VARIANTS",A5e="MOVE_FEATURE_TOGGLE",Av="CREATE_SEGMENT",lC="UPDATE_SEGMENT",_oe="DELETE_SEGMENT",O5e="APPLY_CHANGE_REQUEST",L5e="APPROVE_CHANGE_REQUEST",Roe=E(on)(({theme:e})=>({textDecoration:"none",alignItems:"center",display:"flex",color:"inherit",height:"100%",width:"100%","&&":{padding:e.spacing(1,2)}})),Poe=E("span")(({theme:e})=>({width:"12.5px",height:"12.5px",display:"block",backgroundColor:e.palette.primary.main,marginRight:e.spacing(2),borderRadius:"2px"})),eR=({options:e,id:t,handleClose:n,anchorEl:r,style:o})=>s($x,{id:t,onClose:n,anchorEl:r,open:Boolean(r),style:o,children:e.map(i=>T(ws,{component:Roe,to:i.path,onClick:n,children:[s(Poe,{}),i.title]},i.path))});var tn={},$oe={get exports(){return tn},set exports(e){tn=e}},Wm={},Ioe={get exports(){return Wm},set exports(e){Wm=e}};(function(e,t){(function(n,r){r(t,f)})(Rn,function(n,r){function o(x,D,B,U,Q,Y,ee){try{var le=x[Y](ee),ce=le.value}catch(he){return void B(he)}le.done?D(ce):Promise.resolve(ce).then(U,Q)}function i(x){return function(){var D=this,B=arguments;return new Promise(function(U,Q){var Y=x.apply(D,B);function ee(ce){o(Y,U,Q,ee,le,"next",ce)}function le(ce){o(Y,U,Q,ee,le,"throw",ce)}ee(void 0)})}}function a(){return(a=Object.assign||function(x){for(var D=1;D<arguments.length;D++){var B=arguments[D];for(var U in B)Object.prototype.hasOwnProperty.call(B,U)&&(x[U]=B[U])}return x}).apply(this,arguments)}function l(x,D){if(x==null)return{};var B,U,Q={},Y=Object.keys(x);for(U=0;U<Y.length;U++)B=Y[U],D.indexOf(B)>=0||(Q[B]=x[B]);return Q}function c(x){var D=function(B,U){if(typeof B!="object"||B===null)return B;var Q=B[Symbol.toPrimitive];if(Q!==void 0){var Y=Q.call(B,U||"default");if(typeof Y!="object")return Y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)(B)}(x,"string");return typeof D=="symbol"?D:String(D)}r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var u={init:"init"},d=function(x){var D=x.value;return D===void 0?"":D},p=function(){return r.createElement(r.Fragment,null," ")},h={Cell:d,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function m(){for(var x=arguments.length,D=new Array(x),B=0;B<x;B++)D[B]=arguments[B];return D.reduce(function(U,Q){var Y=Q.style,ee=Q.className;return U=a({},U,{},l(Q,["style","className"])),Y&&(U.style=U.style?a({},U.style||{},{},Y||{}):Y),ee&&(U.className=U.className?U.className+" "+ee:ee),U.className===""&&delete U.className,U},{})}var y=function(x,D){return D===void 0&&(D={}),function(B){return B===void 0&&(B={}),[].concat(x,[B]).reduce(function(U,Q){return function Y(ee,le,ce){return typeof le=="function"?Y({},le(ee,ce)):Array.isArray(le)?m.apply(void 0,[ee].concat(le)):m(ee,le)}(U,Q,a({},D,{userProps:B}))},{})}},v=function(x,D,B,U){return B===void 0&&(B={}),x.reduce(function(Q,Y){return Y(Q,B)},D)},b=function(x,D,B){return B===void 0&&(B={}),x.forEach(function(U){U(D,B)})};function w(x,D,B,U){x.findIndex(function(Q){return Q.pluginName===B}),D.forEach(function(Q){x.findIndex(function(Y){return Y.pluginName===Q})})}function g(x,D){return typeof x=="function"?x(D):x}function S(x){var D=r.useRef();return D.current=x,r.useCallback(function(){return D.current},[])}var C=typeof document<"u"?r.useLayoutEffect:r.useEffect;function R(x,D){var B=r.useRef(!1);C(function(){B.current&&x(),B.current=!0},D)}function k(x,D,B){return B===void 0&&(B={}),function(U,Q){Q===void 0&&(Q={});var Y=typeof U=="string"?D[U]:U;if(Y===void 0)throw console.info(D),new Error("Renderer Error ☝️");return P(Y,a({},x,{column:D},B,{},Q))}}function P(x,D){return function(U){return typeof U=="function"&&(Q=Object.getPrototypeOf(U)).prototype&&Q.prototype.isReactComponent;var Q}(B=x)||typeof B=="function"||function(U){return typeof U=="object"&&typeof U.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(U.$$typeof.description)}(B)?r.createElement(x,D):x;var B}function O(x,D,B){return B===void 0&&(B=0),x.map(function(U){return I(U=a({},U,{parent:D,depth:B})),U.columns&&(U.columns=O(U.columns,U,B+1)),U})}function L(x){return G(x,"columns")}function I(x){var D=x.id,B=x.accessor,U=x.Header;if(typeof B=="string"){D=D||B;var Q=B.split(".");B=function(Y){return function(ee,le,ce){if(!le)return ee;var he,Le=typeof le=="function"?le:JSON.stringify(le),$e=F.get(Le)||function(){var Ie=function(xe){return function Ae(je,Ve){if(Ve===void 0&&(Ve=[]),Array.isArray(je))for(var lt=0;lt<je.length;lt+=1)Ae(je[lt],Ve);else Ve.push(je);return Ve}(xe).map(function(Ae){return String(Ae).replace(".","_")}).join(".").replace(N,".").replace(te,"").split(".")}(le);return F.set(Le,Ie),Ie}();try{he=$e.reduce(function(Ie,xe){return Ie[xe]},ee)}catch{}return he!==void 0?he:ce}(Y,Q)}}if(!D&&typeof U=="string"&&U&&(D=U),!D&&x.columns)throw console.error(x),new Error('A column ID (or unique "Header" value) is required!');if(!D)throw console.error(x),new Error("A column ID (or string accessor) is required!");return Object.assign(x,{id:D,accessor:B}),x}function A(x,D){if(!D)throw new Error;return Object.assign(x,a({Header:p,Footer:p},h,{},D,{},x)),Object.assign(x,{originalWidth:x.width}),x}function M(x,D,B){B===void 0&&(B=function(){return{}});for(var U=[],Q=x,Y=0,ee=function(){return Y++},le=function(){var ce={headers:[]},he=[],Le=Q.some(function($e){return $e.parent});Q.forEach(function($e){var Ie,xe=[].concat(he).reverse()[0];Le&&($e.parent?Ie=a({},$e.parent,{originalId:$e.parent.id,id:$e.parent.id+"_"+ee(),headers:[$e]},B($e)):Ie=A(a({originalId:$e.id+"_placeholder",id:$e.id+"_placeholder_"+ee(),placeholderOf:$e,headers:[$e]},B($e)),D),xe&&xe.originalId===Ie.originalId?xe.headers.push($e):he.push(Ie)),ce.headers.push($e)}),U.push(ce),Q=he};Q.length;)le();return U.reverse()}var F=new Map;function j(){for(var x=arguments.length,D=new Array(x),B=0;B<x;B++)D[B]=arguments[B];for(var U=0;U<D.length;U+=1)if(D[U]!==void 0)return D[U]}function q(x){if(typeof x=="function")return x}function G(x,D){var B=[];return function U(Q){Q.forEach(function(Y){Y[D]?U(Y[D]):B.push(Y)})}(x),B}function Z(x,D){var B=D.manualExpandedKey,U=D.expanded,Q=D.expandSubRows,Y=Q===void 0||Q,ee=[];return x.forEach(function(le){return function ce(he,Le){Le===void 0&&(Le=!0),he.isExpanded=he.original&&he.original[B]||U[he.id],he.canExpand=he.subRows&&!!he.subRows.length,Le&&ee.push(he),he.subRows&&he.subRows.length&&he.isExpanded&&he.subRows.forEach(function($e){return ce($e,Y)})}(le)}),ee}function J(x,D,B){return q(x)||D[x]||B[x]||B.text}function z(x,D,B){return x?x(D,B):D===void 0}function W(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var $=null,N=/\[/g,te=/\]/g,re=function(x){return a({role:"table"},x)},we=function(x){return a({role:"rowgroup"},x)},se=function(x,D){var B=D.column;return a({key:"header_"+B.id,colSpan:B.totalVisibleHeaderCount,role:"columnheader"},x)},Ee=function(x,D){var B=D.column;return a({key:"footer_"+B.id,colSpan:B.totalVisibleHeaderCount},x)},ue=function(x,D){return a({key:"headerGroup_"+D.index,role:"row"},x)},pe=function(x,D){return a({key:"footerGroup_"+D.index},x)},Ne=function(x,D){return a({key:"row_"+D.row.id,role:"row"},x)},ye=function(x,D){var B=D.cell;return a({key:"cell_"+B.row.id+"_"+B.column.id,role:"cell"},x)};function Me(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[re],getTableBodyProps:[we],getHeaderGroupProps:[ue],getFooterGroupProps:[pe],getHeaderProps:[se],getFooterProps:[Ee],getRowProps:[Ne],getCellProps:[ye],useFinalInstance:[]}}u.resetHiddenColumns="resetHiddenColumns",u.toggleHideColumn="toggleHideColumn",u.setHiddenColumns="setHiddenColumns",u.toggleHideAllColumns="toggleHideAllColumns";var ut=function(x){x.getToggleHiddenProps=[ot],x.getToggleHideAllColumnsProps=[Te],x.stateReducers.push(Et),x.useInstanceBeforeDimensions.push(Ze),x.headerGroupsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.hiddenColumns])}),x.useInstance.push(st)};ut.pluginName="useColumnVisibility";var ot=function(x,D){var B=D.column;return[x,{onChange:function(U){B.toggleHidden(!U.target.checked)},style:{cursor:"pointer"},checked:B.isVisible,title:"Toggle Column Visible"}]},Te=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleHideAllColumns(!U.target.checked)},style:{cursor:"pointer"},checked:!B.allColumnsHidden&&!B.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!B.allColumnsHidden&&B.state.hiddenColumns.length}]};function Et(x,D,B,U){if(D.type===u.init)return a({hiddenColumns:[]},x);if(D.type===u.resetHiddenColumns)return a({},x,{hiddenColumns:U.initialState.hiddenColumns||[]});if(D.type===u.toggleHideColumn){var Q=(D.value!==void 0?D.value:!x.hiddenColumns.includes(D.columnId))?[].concat(x.hiddenColumns,[D.columnId]):x.hiddenColumns.filter(function(Y){return Y!==D.columnId});return a({},x,{hiddenColumns:Q})}return D.type===u.setHiddenColumns?a({},x,{hiddenColumns:g(D.value,x.hiddenColumns)}):D.type===u.toggleHideAllColumns?a({},x,{hiddenColumns:(D.value!==void 0?D.value:!x.hiddenColumns.length)?U.allColumns.map(function(Y){return Y.id}):[]}):void 0}function Ze(x){var D=x.headers,B=x.state.hiddenColumns;r.useRef(!1).current;var U=0;D.forEach(function(Q){return U+=function Y(ee,le){ee.isVisible=le&&!B.includes(ee.id);var ce=0;return ee.headers&&ee.headers.length?ee.headers.forEach(function(he){return ce+=Y(he,ee.isVisible)}):ce=ee.isVisible?1:0,ee.totalVisibleHeaderCount=ce,ce}(Q,!0)})}function st(x){var D=x.columns,B=x.flatHeaders,U=x.dispatch,Q=x.allColumns,Y=x.getHooks,ee=x.state.hiddenColumns,le=x.autoResetHiddenColumns,ce=le===void 0||le,he=S(x),Le=Q.length===ee.length,$e=r.useCallback(function(Ve,lt){return U({type:u.toggleHideColumn,columnId:Ve,value:lt})},[U]),Ie=r.useCallback(function(Ve){return U({type:u.setHiddenColumns,value:Ve})},[U]),xe=r.useCallback(function(Ve){return U({type:u.toggleHideAllColumns,value:Ve})},[U]),Ae=y(Y().getToggleHideAllColumnsProps,{instance:he()});B.forEach(function(Ve){Ve.toggleHidden=function(lt){U({type:u.toggleHideColumn,columnId:Ve.id,value:lt})},Ve.getToggleHiddenProps=y(Y().getToggleHiddenProps,{instance:he(),column:Ve})});var je=S(ce);R(function(){je()&&U({type:u.resetHiddenColumns})},[U,D]),Object.assign(x,{allColumnsHidden:Le,toggleHideColumn:$e,setHiddenColumns:Ie,toggleHideAllColumns:xe,getToggleHideAllColumnsProps:Ae})}var At={},Ye={},qe=function(x,D,B){return x},Ot=function(x,D){return x.subRows||[]},Rt=function(x,D,B){return""+(B?[B.id,D].join("."):D)},me=function(x){return x};function _e(x){var D=x.initialState,B=D===void 0?At:D,U=x.defaultColumn,Q=U===void 0?Ye:U,Y=x.getSubRows,ee=Y===void 0?Ot:Y,le=x.getRowId,ce=le===void 0?Rt:le,he=x.stateReducer,Le=he===void 0?qe:he,$e=x.useControlledState,Ie=$e===void 0?me:$e;return a({},l(x,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:B,defaultColumn:Q,getSubRows:ee,getRowId:ce,stateReducer:Le,useControlledState:Ie})}function Be(x,D){D===void 0&&(D=0);var B=0,U=0,Q=0,Y=0;return x.forEach(function(ee){var le=ee.headers;if(ee.totalLeft=D,le&&le.length){var ce=Be(le,D),he=ce[0],Le=ce[1],$e=ce[2],Ie=ce[3];ee.totalMinWidth=he,ee.totalWidth=Le,ee.totalMaxWidth=$e,ee.totalFlexWidth=Ie}else ee.totalMinWidth=ee.minWidth,ee.totalWidth=Math.min(Math.max(ee.minWidth,ee.width),ee.maxWidth),ee.totalMaxWidth=ee.maxWidth,ee.totalFlexWidth=ee.canResize?ee.totalWidth:0;ee.isVisible&&(D+=ee.totalWidth,B+=ee.totalMinWidth,U+=ee.totalWidth,Q+=ee.totalMaxWidth,Y+=ee.totalFlexWidth)}),[B,U,Q,Y]}function ze(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.column,ee=x.getRowId,le=x.getSubRows,ce=x.accessValueHooks,he=x.getInstance;D.forEach(function(Le,$e){return function Ie(xe,Ae,je,Ve,lt){je===void 0&&(je=0);var $t=xe,at=ee(xe,Ae,Ve),De=Q[at];if(De)De.subRows&&De.originalSubRows.forEach(function(Xe,yt){return Ie(Xe,yt,je+1,De)});else if((De={id:at,original:$t,index:Ae,depth:je,cells:[{}]}).cells.map=W,De.cells.filter=W,De.cells.forEach=W,De.cells[0].getCellProps=W,De.values={},lt.push(De),U.push(De),Q[at]=De,De.originalSubRows=le(xe,Ae),De.originalSubRows){var St=[];De.originalSubRows.forEach(function(Xe,yt){return Ie(Xe,yt,je+1,De,St)}),De.subRows=St}Y.accessor&&(De.values[Y.id]=Y.accessor(xe,Ae,De,lt,D)),De.values[Y.id]=v(ce,De.values[Y.id],{row:De,column:Y,instance:he()})}(Le,$e,0,void 0,B)})}u.resetExpanded="resetExpanded",u.toggleRowExpanded="toggleRowExpanded",u.toggleAllRowsExpanded="toggleAllRowsExpanded";var H=function(x){x.getToggleAllRowsExpandedProps=[K],x.getToggleRowExpandedProps=[oe],x.stateReducers.push(de),x.useInstance.push(Fe),x.prepareRow.push(tt)};H.pluginName="useExpanded";var K=function(x,D){var B=D.instance;return[x,{onClick:function(U){B.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},oe=function(x,D){var B=D.row;return[x,{onClick:function(){B.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function de(x,D,B,U){if(D.type===u.init)return a({expanded:{}},x);if(D.type===u.resetExpanded)return a({},x,{expanded:U.initialState.expanded||{}});if(D.type===u.toggleAllRowsExpanded){var Q=D.value,Y=U.rowsById,ee=Object.keys(Y).length===Object.keys(x.expanded).length;if(Q!==void 0?Q:!ee){var le={};return Object.keys(Y).forEach(function(Ae){le[Ae]=!0}),a({},x,{expanded:le})}return a({},x,{expanded:{}})}if(D.type===u.toggleRowExpanded){var ce,he=D.id,Le=D.value,$e=x.expanded[he],Ie=Le!==void 0?Le:!$e;if(!$e&&Ie)return a({},x,{expanded:a({},x.expanded,(ce={},ce[he]=!0,ce))});if($e&&!Ie){var xe=x.expanded;return xe[he],a({},x,{expanded:l(xe,[he].map(c))})}return x}}function Fe(x){var D=x.data,B=x.rows,U=x.rowsById,Q=x.manualExpandedKey,Y=Q===void 0?"expanded":Q,ee=x.paginateExpandedRows,le=ee===void 0||ee,ce=x.expandSubRows,he=ce===void 0||ce,Le=x.autoResetExpanded,$e=Le===void 0||Le,Ie=x.getHooks,xe=x.plugins,Ae=x.state.expanded,je=x.dispatch;w(xe,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var Ve=S($e),lt=Boolean(Object.keys(U).length&&Object.keys(Ae).length);lt&&Object.keys(U).some(function(Bt){return!Ae[Bt]})&&(lt=!1),R(function(){Ve()&&je({type:u.resetExpanded})},[je,D]);var $t=r.useCallback(function(Bt,mt){je({type:u.toggleRowExpanded,id:Bt,value:mt})},[je]),at=r.useCallback(function(Bt){return je({type:u.toggleAllRowsExpanded,value:Bt})},[je]),De=r.useMemo(function(){return le?Z(B,{manualExpandedKey:Y,expanded:Ae,expandSubRows:he}):B},[le,B,Y,Ae,he]),St=r.useMemo(function(){return function(Bt){var mt=0;return Object.keys(Bt).forEach(function(vt){var Yt=vt.split(".");mt=Math.max(mt,Yt.length)}),mt}(Ae)},[Ae]),Xe=S(x),yt=y(Ie().getToggleAllRowsExpandedProps,{instance:Xe()});Object.assign(x,{preExpandedRows:B,expandedRows:De,rows:De,expandedDepth:St,isAllRowsExpanded:lt,toggleRowExpanded:$t,toggleAllRowsExpanded:at,getToggleAllRowsExpandedProps:yt})}function tt(x,D){var B=D.instance.getHooks,U=D.instance;x.toggleRowExpanded=function(Q){return U.toggleRowExpanded(x.id,Q)},x.getToggleRowExpandedProps=y(B().getToggleRowExpandedProps,{instance:U,row:x})}var nt=function(x,D,B){return x=x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return String(Y).toLowerCase().includes(String(B).toLowerCase())})})};nt.autoRemove=function(x){return!x};var Dt=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y===void 0||String(Y).toLowerCase()===String(B).toLowerCase()})})};Dt.autoRemove=function(x){return!x};var vr=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y===void 0||String(Y)===String(B)})})};vr.autoRemove=function(x){return!x};var Pn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q].includes(B)})})};Pn.autoRemove=function(x){return!x||!x.length};var Pt=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y&&Y.length&&B.every(function(ee){return Y.includes(ee)})})})};Pt.autoRemove=function(x){return!x||!x.length};var Bn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y&&Y.length&&B.some(function(ee){return Y.includes(ee)})})})};Bn.autoRemove=function(x){return!x||!x.length};var wn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return B.includes(Y)})})};wn.autoRemove=function(x){return!x||!x.length};var ln=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q]===B})})};ln.autoRemove=function(x){return x===void 0};var nn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q]==B})})};nn.autoRemove=function(x){return x==null};var er=function(x,D,B){var U=B||[],Q=U[0],Y=U[1];if((Q=typeof Q=="number"?Q:-1/0)>(Y=typeof Y=="number"?Y:1/0)){var ee=Q;Q=Y,Y=ee}return x.filter(function(le){return D.some(function(ce){var he=le.values[ce];return he>=Q&&he<=Y})})};er.autoRemove=function(x){return!x||typeof x[0]!="number"&&typeof x[1]!="number"};var eo=Object.freeze({__proto__:null,text:nt,exactText:Dt,exactTextCase:vr,includes:Pn,includesAll:Pt,includesSome:Bn,includesValue:wn,exact:ln,equals:nn,between:er});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var ui=function(x){x.stateReducers.push(ua),x.useInstance.push(ki)};function ua(x,D,B,U){if(D.type===u.init)return a({filters:[]},x);if(D.type===u.resetFilters)return a({},x,{filters:U.initialState.filters||[]});if(D.type===u.setFilter){var Q=D.columnId,Y=D.filterValue,ee=U.allColumns,le=U.filterTypes,ce=ee.find(function(je){return je.id===Q});if(!ce)throw new Error("React-Table: Could not find a column with id: "+Q);var he=J(ce.filter,le||{},eo),Le=x.filters.find(function(je){return je.id===Q}),$e=g(Y,Le&&Le.value);return z(he.autoRemove,$e,ce)?a({},x,{filters:x.filters.filter(function(je){return je.id!==Q})}):a({},x,Le?{filters:x.filters.map(function(je){return je.id===Q?{id:Q,value:$e}:je})}:{filters:[].concat(x.filters,[{id:Q,value:$e}])})}if(D.type===u.setAllFilters){var Ie=D.filters,xe=U.allColumns,Ae=U.filterTypes;return a({},x,{filters:g(Ie,x.filters).filter(function(je){var Ve=xe.find(function(lt){return lt.id===je.id});return!z(J(Ve.filter,Ae||{},eo).autoRemove,je.value,Ve)})})}}function ki(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.filterTypes,le=x.manualFilters,ce=x.defaultCanFilter,he=ce!==void 0&&ce,Le=x.disableFilters,$e=x.state.filters,Ie=x.dispatch,xe=x.autoResetFilters,Ae=xe===void 0||xe,je=r.useCallback(function(Xe,yt){Ie({type:u.setFilter,columnId:Xe,filterValue:yt})},[Ie]),Ve=r.useCallback(function(Xe){Ie({type:u.setAllFilters,filters:Xe})},[Ie]);Y.forEach(function(Xe){var yt=Xe.id,Bt=Xe.accessor,mt=Xe.defaultCanFilter,vt=Xe.disableFilters;Xe.canFilter=Bt?j(vt!==!0&&void 0,Le!==!0&&void 0,!0):j(mt,he,!1),Xe.setFilter=function(bt){return je(Xe.id,bt)};var Yt=$e.find(function(bt){return bt.id===yt});Xe.filterValue=Yt&&Yt.value});var lt=r.useMemo(function(){if(le||!$e.length)return[B,U,Q];var Xe=[],yt={};return[function Bt(mt,vt){vt===void 0&&(vt=0);var Yt=mt;return(Yt=$e.reduce(function(bt,Gt){var Ut=Gt.id,vn=Gt.value,ct=Y.find(function(Hn){return Hn.id===Ut});if(!ct)return bt;vt===0&&(ct.preFilteredRows=bt);var zt=J(ct.filter,ee||{},eo);return zt?(ct.filteredRows=zt(bt,[Ut],vn),ct.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+ct.id+"."),bt)},mt)).forEach(function(bt){Xe.push(bt),yt[bt.id]=bt,bt.subRows&&(bt.subRows=bt.subRows&&bt.subRows.length>0?Bt(bt.subRows,vt+1):bt.subRows)}),Yt}(B),Xe,yt]},[le,$e,B,U,Q,Y,ee]),$t=lt[0],at=lt[1],De=lt[2];r.useMemo(function(){Y.filter(function(Xe){return!$e.find(function(yt){return yt.id===Xe.id})}).forEach(function(Xe){Xe.preFilteredRows=$t,Xe.filteredRows=$t})},[$t,$e,Y]);var St=S(Ae);R(function(){St()&&Ie({type:u.resetFilters})},[Ie,le?null:D]),Object.assign(x,{preFilteredRows:B,preFilteredFlatRows:U,preFilteredRowsById:Q,filteredRows:$t,filteredFlatRows:at,filteredRowsById:De,rows:$t,flatRows:at,rowsById:De,setFilter:je,setAllFilters:Ve})}ui.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var Oo=function(x){x.stateReducers.push(Lo),x.useInstance.push(Xn)};function Lo(x,D,B,U){if(D.type===u.resetGlobalFilter)return a({},x,{globalFilter:U.initialState.globalFilter||void 0});if(D.type===u.setGlobalFilter){var Q=D.filterValue,Y=U.userFilterTypes,ee=J(U.globalFilter,Y||{},eo),le=g(Q,x.globalFilter);return z(ee.autoRemove,le)?(x.globalFilter,l(x,["globalFilter"])):a({},x,{globalFilter:le})}}function Xn(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.filterTypes,le=x.globalFilter,ce=x.manualGlobalFilter,he=x.state.globalFilter,Le=x.dispatch,$e=x.autoResetGlobalFilter,Ie=$e===void 0||$e,xe=x.disableGlobalFilter,Ae=r.useCallback(function(De){Le({type:u.setGlobalFilter,filterValue:De})},[Le]),je=r.useMemo(function(){if(ce||he===void 0)return[B,U,Q];var De=[],St={},Xe=J(le,ee||{},eo);if(!Xe)return console.warn("Could not find a valid 'globalFilter' option."),B;Y.forEach(function(Bt){var mt=Bt.disableGlobalFilter;Bt.canFilter=j(mt!==!0&&void 0,xe!==!0&&void 0,!0)});var yt=Y.filter(function(Bt){return Bt.canFilter===!0});return[function Bt(mt){return(mt=Xe(mt,yt.map(function(vt){return vt.id}),he)).forEach(function(vt){De.push(vt),St[vt.id]=vt,vt.subRows=vt.subRows&&vt.subRows.length?Bt(vt.subRows):vt.subRows}),mt}(B),De,St]},[ce,he,le,ee,Y,B,U,Q,xe]),Ve=je[0],lt=je[1],$t=je[2],at=S(Ie);R(function(){at()&&Le({type:u.resetGlobalFilter})},[Le,ce?null:D]),Object.assign(x,{preGlobalFilteredRows:B,preGlobalFilteredFlatRows:U,preGlobalFilteredRowsById:Q,globalFilteredRows:Ve,globalFilteredFlatRows:lt,globalFilteredRowsById:$t,rows:Ve,flatRows:lt,rowsById:$t,setGlobalFilter:Ae,disableGlobalFilter:xe})}function to(x,D){return D.reduce(function(B,U){return B+(typeof U=="number"?U:0)},0)}Oo.pluginName="useGlobalFilter";var Do=Object.freeze({__proto__:null,sum:to,min:function(x){var D=x[0]||0;return x.forEach(function(B){typeof B=="number"&&(D=Math.min(D,B))}),D},max:function(x){var D=x[0]||0;return x.forEach(function(B){typeof B=="number"&&(D=Math.max(D,B))}),D},minMax:function(x){var D=x[0]||0,B=x[0]||0;return x.forEach(function(U){typeof U=="number"&&(D=Math.min(D,U),B=Math.max(B,U))}),D+".."+B},average:function(x){return to(0,x)/x.length},median:function(x){if(!x.length)return null;var D=Math.floor(x.length/2),B=[].concat(x).sort(function(U,Q){return U-Q});return x.length%2!=0?B[D]:(B[D-1]+B[D])/2},unique:function(x){return Array.from(new Set(x).values())},uniqueCount:function(x){return new Set(x).size},count:function(x){return x.length}}),Nt=[],Wn={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var $n=function(x){x.getGroupByToggleProps=[Jn],x.stateReducers.push(da),x.visibleColumnsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.groupBy])}),x.visibleColumns.push(No),x.useInstance.push(fe),x.prepareRow.push(it)};$n.pluginName="useGroupBy";var Jn=function(x,D){var B=D.header;return[x,{onClick:B.canGroupBy?function(U){U.persist(),B.toggleGroupBy()}:void 0,style:{cursor:B.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function da(x,D,B,U){if(D.type===u.init)return a({groupBy:[]},x);if(D.type===u.resetGroupBy)return a({},x,{groupBy:U.initialState.groupBy||[]});if(D.type===u.setGroupBy)return a({},x,{groupBy:D.value});if(D.type===u.toggleGroupBy){var Q=D.columnId,Y=D.value,ee=Y!==void 0?Y:!x.groupBy.includes(Q);return a({},x,ee?{groupBy:[].concat(x.groupBy,[Q])}:{groupBy:x.groupBy.filter(function(le){return le!==Q})})}}function No(x,D){var B=D.instance.state.groupBy,U=B.map(function(Y){return x.find(function(ee){return ee.id===Y})}).filter(Boolean),Q=x.filter(function(Y){return!B.includes(Y.id)});return(x=[].concat(U,Q)).forEach(function(Y){Y.isGrouped=B.includes(Y.id),Y.groupedIndex=B.indexOf(Y.id)}),x}var Se={};function fe(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.flatHeaders,le=x.groupByFn,ce=le===void 0?dt:le,he=x.manualGroupBy,Le=x.aggregations,$e=Le===void 0?Se:Le,Ie=x.plugins,xe=x.state.groupBy,Ae=x.dispatch,je=x.autoResetGroupBy,Ve=je===void 0||je,lt=x.disableGroupBy,$t=x.defaultCanGroupBy,at=x.getHooks;w(Ie,["useColumnOrder","useFilters"],"useGroupBy");var De=S(x);Y.forEach(function(ct){var zt=ct.accessor,Hn=ct.defaultGroupBy,qr=ct.disableGroupBy;ct.canGroupBy=zt?j(ct.canGroupBy,qr!==!0&&void 0,lt!==!0&&void 0,!0):j(ct.canGroupBy,Hn,$t,!1),ct.canGroupBy&&(ct.toggleGroupBy=function(){return x.toggleGroupBy(ct.id)}),ct.Aggregated=ct.Aggregated||ct.Cell});var St=r.useCallback(function(ct,zt){Ae({type:u.toggleGroupBy,columnId:ct,value:zt})},[Ae]),Xe=r.useCallback(function(ct){Ae({type:u.setGroupBy,value:ct})},[Ae]);ee.forEach(function(ct){ct.getGroupByToggleProps=y(at().getGroupByToggleProps,{instance:De(),header:ct})});var yt=r.useMemo(function(){if(he||!xe.length)return[B,U,Q,Nt,Wn,U,Q];var ct=xe.filter(function(yr){return Y.find(function(Wa){return Wa.id===yr})}),zt=[],Hn={},qr=[],gt={},Dn=[],nr={},Yr=function yr(Wa,ma,eE){if(ma===void 0&&(ma=0),ma===ct.length)return Wa.map(function(_f){return a({},_f,{depth:ma})});var My=ct[ma],xN=ce(Wa,My);return Object.entries(xN).map(function(_f,CN){var tE=_f[0],Rf=_f[1],Pf=My+":"+tE,nE=yr(Rf,ma+1,Pf=eE?eE+">"+Pf:Pf),rE=ma?G(Rf,"leafRows"):Rf,EN=function(Mo,By,TN){var $f={};return Y.forEach(function(rr){if(ct.includes(rr.id))$f[rr.id]=By[0]?By[0].values[rr.id]:null;else{var oE=typeof rr.aggregate=="function"?rr.aggregate:$e[rr.aggregate]||Do[rr.aggregate];if(oE){var _N=By.map(function(If){return If.values[rr.id]}),RN=Mo.map(function(If){var Fy=If.values[rr.id];if(!TN&&rr.aggregateValue){var iE=typeof rr.aggregateValue=="function"?rr.aggregateValue:$e[rr.aggregateValue]||Do[rr.aggregateValue];if(!iE)throw console.info({column:rr}),new Error("React Table: Invalid column.aggregateValue option for column listed above");Fy=iE(Fy,If,rr)}return Fy});$f[rr.id]=oE(RN,_N)}else{if(rr.aggregate)throw console.info({column:rr}),new Error("React Table: Invalid column.aggregate option for column listed above");$f[rr.id]=null}}}),$f}(rE,Rf,ma),kN={id:Pf,isGrouped:!0,groupByID:My,groupByVal:tE,values:EN,subRows:nE,leafRows:rE,depth:ma,index:CN};return nE.forEach(function(Mo){zt.push(Mo),Hn[Mo.id]=Mo,Mo.isGrouped?(qr.push(Mo),gt[Mo.id]=Mo):(Dn.push(Mo),nr[Mo.id]=Mo)}),kN})}(B);return Yr.forEach(function(yr){zt.push(yr),Hn[yr.id]=yr,yr.isGrouped?(qr.push(yr),gt[yr.id]=yr):(Dn.push(yr),nr[yr.id]=yr)}),[Yr,zt,Hn,qr,gt,Dn,nr]},[he,xe,B,U,Q,Y,$e,ce]),Bt=yt[0],mt=yt[1],vt=yt[2],Yt=yt[3],bt=yt[4],Gt=yt[5],Ut=yt[6],vn=S(Ve);R(function(){vn()&&Ae({type:u.resetGroupBy})},[Ae,he?null:D]),Object.assign(x,{preGroupedRows:B,preGroupedFlatRow:U,preGroupedRowsById:Q,groupedRows:Bt,groupedFlatRows:mt,groupedRowsById:vt,onlyGroupedFlatRows:Yt,onlyGroupedRowsById:bt,nonGroupedFlatRows:Gt,nonGroupedRowsById:Ut,rows:Bt,flatRows:mt,rowsById:vt,toggleGroupBy:St,setGroupBy:Xe})}function it(x){x.allCells.forEach(function(D){var B;D.isGrouped=D.column.isGrouped&&D.column.id===x.groupByID,D.isPlaceholder=!D.isGrouped&&D.column.isGrouped,D.isAggregated=!D.isGrouped&&!D.isPlaceholder&&((B=x.subRows)==null?void 0:B.length)})}function dt(x,D){return x.reduce(function(B,U,Q){var Y=""+U.values[D];return B[Y]=Array.isArray(B[Y])?B[Y]:[],B[Y].push(U),B},{})}var qt=/([0-9]+)/gm;function In(x,D){return x===D?0:x>D?1:-1}function cn(x,D,B){return[x.values[B],D.values[B]]}function Rr(x){return typeof x=="number"?isNaN(x)||x===1/0||x===-1/0?"":String(x):typeof x=="string"?x:""}var Ua=Object.freeze({__proto__:null,alphanumeric:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];for(Q=Rr(Q),Y=Rr(Y),Q=Q.split(qt).filter(Boolean),Y=Y.split(qt).filter(Boolean);Q.length&&Y.length;){var ee=Q.shift(),le=Y.shift(),ce=parseInt(ee,10),he=parseInt(le,10),Le=[ce,he].sort();if(isNaN(Le[0])){if(ee>le)return 1;if(le>ee)return-1}else{if(isNaN(Le[1]))return isNaN(ce)?-1:1;if(ce>he)return 1;if(he>ce)return-1}}return Q.length-Y.length},datetime:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];return In(Q=Q.getTime(),Y=Y.getTime())},basic:function(x,D,B){var U=cn(x,D,B);return In(U[0],U[1])},string:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];for(Q=Q.split("").filter(Boolean),Y=Y.split("").filter(Boolean);Q.length&&Y.length;){var ee=Q.shift(),le=Y.shift(),ce=ee.toLowerCase(),he=le.toLowerCase();if(ce>he)return 1;if(he>ce)return-1;if(ee>le)return 1;if(le>ee)return-1}return Q.length-Y.length},number:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1],ee=/[^0-9.]/gi;return In(Q=Number(String(Q).replace(ee,"")),Y=Number(String(Y).replace(ee,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",h.sortType="alphanumeric",h.sortDescFirst=!1;var xt=function(x){x.getSortByToggleProps=[Pr],x.stateReducers.push(uy),x.useInstance.push(dy)};xt.pluginName="useSortBy";var Pr=function(x,D){var B=D.instance,U=D.column,Q=B.isMultiSortEvent,Y=Q===void 0?function(ee){return ee.shiftKey}:Q;return[x,{onClick:U.canSort?function(ee){ee.persist(),U.toggleSortBy(void 0,!B.disableMultiSort&&Y(ee))}:void 0,style:{cursor:U.canSort?"pointer":void 0},title:U.canSort?"Toggle SortBy":void 0}]};function uy(x,D,B,U){if(D.type===u.init)return a({sortBy:[]},x);if(D.type===u.resetSortBy)return a({},x,{sortBy:U.initialState.sortBy||[]});if(D.type===u.clearSortBy)return a({},x,{sortBy:x.sortBy.filter(function(De){return De.id!==D.columnId})});if(D.type===u.setSortBy)return a({},x,{sortBy:D.sortBy});if(D.type===u.toggleSortBy){var Q,Y=D.columnId,ee=D.desc,le=D.multi,ce=U.allColumns,he=U.disableMultiSort,Le=U.disableSortRemove,$e=U.disableMultiRemove,Ie=U.maxMultiSortColCount,xe=Ie===void 0?Number.MAX_SAFE_INTEGER:Ie,Ae=x.sortBy,je=ce.find(function(De){return De.id===Y}).sortDescFirst,Ve=Ae.find(function(De){return De.id===Y}),lt=Ae.findIndex(function(De){return De.id===Y}),$t=ee!=null,at=[];return(Q=!he&&le?Ve?"toggle":"add":lt!==Ae.length-1||Ae.length!==1?"replace":Ve?"toggle":"replace")!="toggle"||Le||$t||le&&$e||!(Ve&&Ve.desc&&!je||!Ve.desc&&je)||(Q="remove"),Q==="replace"?at=[{id:Y,desc:$t?ee:je}]:Q==="add"?(at=[].concat(Ae,[{id:Y,desc:$t?ee:je}])).splice(0,at.length-xe):Q==="toggle"?at=Ae.map(function(De){return De.id===Y?a({},De,{desc:$t?ee:!Ve.desc}):De}):Q==="remove"&&(at=Ae.filter(function(De){return De.id!==Y})),a({},x,{sortBy:at})}}function dy(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.allColumns,Y=x.orderByFn,ee=Y===void 0?yf:Y,le=x.sortTypes,ce=x.manualSortBy,he=x.defaultCanSort,Le=x.disableSortBy,$e=x.flatHeaders,Ie=x.state.sortBy,xe=x.dispatch,Ae=x.plugins,je=x.getHooks,Ve=x.autoResetSortBy,lt=Ve===void 0||Ve;w(Ae,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var $t=r.useCallback(function(mt){xe({type:u.setSortBy,sortBy:mt})},[xe]),at=r.useCallback(function(mt,vt,Yt){xe({type:u.toggleSortBy,columnId:mt,desc:vt,multi:Yt})},[xe]),De=S(x);$e.forEach(function(mt){var vt=mt.accessor,Yt=mt.canSort,bt=mt.disableSortBy,Gt=mt.id,Ut=vt?j(bt!==!0&&void 0,Le!==!0&&void 0,!0):j(he,Yt,!1);mt.canSort=Ut,mt.canSort&&(mt.toggleSortBy=function(ct,zt){return at(mt.id,ct,zt)},mt.clearSortBy=function(){xe({type:u.clearSortBy,columnId:mt.id})}),mt.getSortByToggleProps=y(je().getSortByToggleProps,{instance:De(),column:mt});var vn=Ie.find(function(ct){return ct.id===Gt});mt.isSorted=!!vn,mt.sortedIndex=Ie.findIndex(function(ct){return ct.id===Gt}),mt.isSortedDesc=mt.isSorted?vn.desc:void 0});var St=r.useMemo(function(){if(ce||!Ie.length)return[B,U];var mt=[],vt=Ie.filter(function(Yt){return Q.find(function(bt){return bt.id===Yt.id})});return[function Yt(bt){var Gt=ee(bt,vt.map(function(Ut){var vn=Q.find(function(Hn){return Hn.id===Ut.id});if(!vn)throw new Error("React-Table: Could not find a column with id: "+Ut.id+" while sorting");var ct=vn.sortType,zt=q(ct)||(le||{})[ct]||Ua[ct];if(!zt)throw new Error("React-Table: Could not find a valid sortType of '"+ct+"' for column '"+Ut.id+"'.");return function(Hn,qr){return zt(Hn,qr,Ut.id,Ut.desc)}}),vt.map(function(Ut){var vn=Q.find(function(ct){return ct.id===Ut.id});return vn&&vn.sortInverted?Ut.desc:!Ut.desc}));return Gt.forEach(function(Ut){mt.push(Ut),Ut.subRows&&Ut.subRows.length!==0&&(Ut.subRows=Yt(Ut.subRows))}),Gt}(B),mt]},[ce,Ie,B,U,Q,ee,le]),Xe=St[0],yt=St[1],Bt=S(lt);R(function(){Bt()&&xe({type:u.resetSortBy})},[ce?null:D]),Object.assign(x,{preSortedRows:B,preSortedFlatRows:U,sortedRows:Xe,sortedFlatRows:yt,rows:Xe,flatRows:yt,setSortBy:$t,toggleSortBy:at})}function yf(x,D,B){return[].concat(x).sort(function(U,Q){for(var Y=0;Y<D.length;Y+=1){var ee=D[Y],le=B[Y]===!1||B[Y]==="desc",ce=ee(U,Q);if(ce!==0)return le?-ce:ce}return B[0]?U.index-Q.index:Q.index-U.index})}u.resetPage="resetPage",u.gotoPage="gotoPage",u.setPageSize="setPageSize";var bf=function(x){x.stateReducers.push(py),x.useInstance.push(wf)};function py(x,D,B,U){if(D.type===u.init)return a({pageSize:10,pageIndex:0},x);if(D.type===u.resetPage)return a({},x,{pageIndex:U.initialState.pageIndex||0});if(D.type===u.gotoPage){var Q=U.pageCount,Y=U.page,ee=g(D.pageIndex,x.pageIndex),le=!1;return ee>x.pageIndex?le=Q===-1?Y.length>=x.pageSize:ee<Q:ee<x.pageIndex&&(le=ee>-1),le?a({},x,{pageIndex:ee}):x}if(D.type===u.setPageSize){var ce=D.pageSize,he=x.pageSize*x.pageIndex;return a({},x,{pageIndex:Math.floor(he/ce),pageSize:ce})}}function wf(x){var D=x.rows,B=x.autoResetPage,U=B===void 0||B,Q=x.manualExpandedKey,Y=Q===void 0?"expanded":Q,ee=x.plugins,le=x.pageCount,ce=x.paginateExpandedRows,he=ce===void 0||ce,Le=x.expandSubRows,$e=Le===void 0||Le,Ie=x.state,xe=Ie.pageSize,Ae=Ie.pageIndex,je=Ie.expanded,Ve=Ie.globalFilter,lt=Ie.filters,$t=Ie.groupBy,at=Ie.sortBy,De=x.dispatch,St=x.data,Xe=x.manualPagination;w(ee,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var yt=S(U);R(function(){yt()&&De({type:u.resetPage})},[De,Xe?null:St,Ve,lt,$t,at]);var Bt=Xe?le:Math.ceil(D.length/xe),mt=r.useMemo(function(){return Bt>0?[].concat(new Array(Bt)).fill(null).map(function(zt,Hn){return Hn}):[]},[Bt]),vt=r.useMemo(function(){var zt;if(Xe)zt=D;else{var Hn=xe*Ae,qr=Hn+xe;zt=D.slice(Hn,qr)}return he?zt:Z(zt,{manualExpandedKey:Y,expanded:je,expandSubRows:$e})},[$e,je,Y,Xe,Ae,xe,he,D]),Yt=Ae>0,bt=Bt===-1?vt.length>=xe:Ae<Bt-1,Gt=r.useCallback(function(zt){De({type:u.gotoPage,pageIndex:zt})},[De]),Ut=r.useCallback(function(){return Gt(function(zt){return zt-1})},[Gt]),vn=r.useCallback(function(){return Gt(function(zt){return zt+1})},[Gt]),ct=r.useCallback(function(zt){De({type:u.setPageSize,pageSize:zt})},[De]);Object.assign(x,{pageOptions:mt,pageCount:Bt,page:vt,canPreviousPage:Yt,canNextPage:bt,gotoPage:Gt,previousPage:Ut,nextPage:vn,setPageSize:ct})}bf.pluginName="usePagination",u.resetPivot="resetPivot",u.togglePivot="togglePivot";var Ds=function(x){x.getPivotToggleProps=[Tu],x.stateReducers.push(fy),x.useInstanceAfterData.push(hy),x.allColumns.push(my),x.accessValue.push(gy),x.materializedColumns.push(vy),x.materializedColumnsDeps.push(yy),x.visibleColumns.push(_u),x.visibleColumnsDeps.push(by),x.useInstance.push(wy),x.prepareRow.push(Sy)};Ds.pluginName="usePivotColumns";var Sf=[],Tu=function(x,D){var B=D.header;return[x,{onClick:B.canPivot?function(U){U.persist(),B.togglePivot()}:void 0,style:{cursor:B.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function fy(x,D,B,U){if(D.type===u.init)return a({pivotColumns:Sf},x);if(D.type===u.resetPivot)return a({},x,{pivotColumns:U.initialState.pivotColumns||Sf});if(D.type===u.togglePivot){var Q=D.columnId,Y=D.value,ee=Y!==void 0?Y:!x.pivotColumns.includes(Q);return a({},x,ee?{pivotColumns:[].concat(x.pivotColumns,[Q])}:{pivotColumns:x.pivotColumns.filter(function(le){return le!==Q})})}}function hy(x){x.allColumns.forEach(function(D){D.isPivotSource=x.state.pivotColumns.includes(D.id)})}function my(x,D){var B=D.instance;return x.forEach(function(U){U.isPivotSource=B.state.pivotColumns.includes(U.id),U.uniqueValues=new Set}),x}function gy(x,D){var B=D.column;return B.uniqueValues&&x!==void 0&&B.uniqueValues.add(x),x}function vy(x,D){var B=D.instance,U=B.allColumns,Q=B.state;if(!Q.pivotColumns.length||!Q.groupBy||!Q.groupBy.length)return x;var Y=Q.pivotColumns.map(function(ce){return U.find(function(he){return he.id===ce})}).filter(Boolean),ee=U.filter(function(ce){return!ce.isPivotSource&&!Q.groupBy.includes(ce.id)&&!Q.pivotColumns.includes(ce.id)}),le=L(function ce(he,Le,$e){he===void 0&&(he=0),$e===void 0&&($e=[]);var Ie=Y[he];return Ie?Array.from(Ie.uniqueValues).sort().map(function(xe){var Ae=a({},Ie,{Header:Ie.PivotHeader||typeof Ie.header=="string"?Ie.Header+": "+xe:xe,isPivotGroup:!0,parent:Le,depth:he,id:Le?Le.id+"."+Ie.id+"."+xe:Ie.id+"."+xe,pivotValue:xe});return Ae.columns=ce(he+1,Ae,[].concat($e,[function(je){return je.values[Ie.id]===xe}])),Ae}):ee.map(function(xe){return a({},xe,{canPivot:!1,isPivoted:!0,parent:Le,depth:he,id:""+(Le?Le.id+"."+xe.id:xe.id),accessor:function(Ae,je,Ve){if($e.every(function(lt){return lt(Ve)}))return Ve.values[xe.id]}})})}());return[].concat(x,le)}function yy(x,D){var B=D.instance.state,U=B.pivotColumns,Q=B.groupBy;return[].concat(x,[U,Q])}function _u(x,D){var B=D.instance.state;return x=x.filter(function(U){return!U.isPivotSource}),B.pivotColumns.length&&B.groupBy&&B.groupBy.length&&(x=x.filter(function(U){return U.isGrouped||U.isPivoted})),x}function by(x,D){var B=D.instance;return[].concat(x,[B.state.pivotColumns,B.state.groupBy])}function wy(x){var D=x.columns,B=x.allColumns,U=x.flatHeaders,Q=x.getHooks,Y=x.plugins,ee=x.dispatch,le=x.autoResetPivot,ce=le===void 0||le,he=x.manaulPivot,Le=x.disablePivot,$e=x.defaultCanPivot;w(Y,["useGroupBy"],"usePivotColumns");var Ie=S(x);B.forEach(function(Ae){var je=Ae.accessor,Ve=Ae.defaultPivot,lt=Ae.disablePivot;Ae.canPivot=je?j(Ae.canPivot,lt!==!0&&void 0,Le!==!0&&void 0,!0):j(Ae.canPivot,Ve,$e,!1),Ae.canPivot&&(Ae.togglePivot=function(){return x.togglePivot(Ae.id)}),Ae.Aggregated=Ae.Aggregated||Ae.Cell}),U.forEach(function(Ae){Ae.getPivotToggleProps=y(Q().getPivotToggleProps,{instance:Ie(),header:Ae})});var xe=S(ce);R(function(){xe()&&ee({type:u.resetPivot})},[ee,he?null:D]),Object.assign(x,{togglePivot:function(Ae,je){ee({type:u.togglePivot,columnId:Ae,value:je})}})}function Sy(x){x.allCells.forEach(function(D){D.isPivoted=D.column.isPivoted})}u.resetSelectedRows="resetSelectedRows",u.toggleAllRowsSelected="toggleAllRowsSelected",u.toggleRowSelected="toggleRowSelected",u.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var xf=function(x){x.getToggleRowSelectedProps=[xy],x.getToggleAllRowsSelectedProps=[Cy],x.getToggleAllPageRowsSelectedProps=[Ey],x.stateReducers.push(Cf),x.useInstance.push(ky),x.prepareRow.push(Ty)};xf.pluginName="useRowSelect";var xy=function(x,D){var B=D.instance,U=D.row,Q=B.manualRowSelectedKey,Y=Q===void 0?"isSelected":Q;return[x,{onChange:function(ee){U.toggleRowSelected(ee.target.checked)},style:{cursor:"pointer"},checked:!(!U.original||!U.original[Y])||U.isSelected,title:"Toggle Row Selected",indeterminate:U.isSomeSelected}]},Cy=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleAllRowsSelected(U.target.checked)},style:{cursor:"pointer"},checked:B.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!B.isAllRowsSelected&&Object.keys(B.state.selectedRowIds).length)}]},Ey=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleAllPageRowsSelected(U.target.checked)},style:{cursor:"pointer"},checked:B.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!B.isAllPageRowsSelected&&B.page.some(function(U){var Q=U.id;return B.state.selectedRowIds[Q]}))}]};function Cf(x,D,B,U){if(D.type===u.init)return a({selectedRowIds:{}},x);if(D.type===u.resetSelectedRows)return a({},x,{selectedRowIds:U.initialState.selectedRowIds||{}});if(D.type===u.toggleAllRowsSelected){var Q=D.value,Y=U.isAllRowsSelected,ee=U.rowsById,le=U.nonGroupedRowsById,ce=le===void 0?ee:le,he=Q!==void 0?Q:!Y,Le=Object.assign({},x.selectedRowIds);return he?Object.keys(ce).forEach(function(Gt){Le[Gt]=!0}):Object.keys(ce).forEach(function(Gt){delete Le[Gt]}),a({},x,{selectedRowIds:Le})}if(D.type===u.toggleRowSelected){var $e=D.id,Ie=D.value,xe=U.rowsById,Ae=U.selectSubRows,je=Ae===void 0||Ae,Ve=U.getSubRows,lt=x.selectedRowIds[$e],$t=Ie!==void 0?Ie:!lt;if(lt===$t)return x;var at=a({},x.selectedRowIds);return function Gt(Ut){var vn=xe[Ut];if(vn&&(vn.isGrouped||($t?at[Ut]=!0:delete at[Ut]),je&&Ve(vn)))return Ve(vn).forEach(function(ct){return Gt(ct.id)})}($e),a({},x,{selectedRowIds:at})}if(D.type===u.toggleAllPageRowsSelected){var De=D.value,St=U.page,Xe=U.rowsById,yt=U.selectSubRows,Bt=yt===void 0||yt,mt=U.isAllPageRowsSelected,vt=U.getSubRows,Yt=De!==void 0?De:!mt,bt=a({},x.selectedRowIds);return St.forEach(function(Gt){return function Ut(vn){var ct=Xe[vn];if(ct.isGrouped||(Yt?bt[vn]=!0:delete bt[vn]),Bt&&vt(ct))return vt(ct).forEach(function(zt){return Ut(zt.id)})}(Gt.id)}),a({},x,{selectedRowIds:bt})}return x}function ky(x){var D=x.data,B=x.rows,U=x.getHooks,Q=x.plugins,Y=x.rowsById,ee=x.nonGroupedRowsById,le=ee===void 0?Y:ee,ce=x.autoResetSelectedRows,he=ce===void 0||ce,Le=x.state.selectedRowIds,$e=x.selectSubRows,Ie=$e===void 0||$e,xe=x.dispatch,Ae=x.page,je=x.getSubRows;w(Q,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var Ve=r.useMemo(function(){var vt=[];return B.forEach(function(Yt){var bt=Ie?function Gt(Ut,vn,ct){if(vn[Ut.id])return!0;var zt=ct(Ut);if(zt&&zt.length){var Hn=!0,qr=!1;return zt.forEach(function(gt){qr&&!Hn||(Gt(gt,vn,ct)?qr=!0:Hn=!1)}),!!Hn||!!qr&&null}return!1}(Yt,Le,je):!!Le[Yt.id];Yt.isSelected=!!bt,Yt.isSomeSelected=bt===null,bt&&vt.push(Yt)}),vt},[B,Ie,Le,je]),lt=Boolean(Object.keys(le).length&&Object.keys(Le).length),$t=lt;lt&&Object.keys(le).some(function(vt){return!Le[vt]})&&(lt=!1),lt||Ae&&Ae.length&&Ae.some(function(vt){var Yt=vt.id;return!Le[Yt]})&&($t=!1);var at=S(he);R(function(){at()&&xe({type:u.resetSelectedRows})},[xe,D]);var De=r.useCallback(function(vt){return xe({type:u.toggleAllRowsSelected,value:vt})},[xe]),St=r.useCallback(function(vt){return xe({type:u.toggleAllPageRowsSelected,value:vt})},[xe]),Xe=r.useCallback(function(vt,Yt){return xe({type:u.toggleRowSelected,id:vt,value:Yt})},[xe]),yt=S(x),Bt=y(U().getToggleAllRowsSelectedProps,{instance:yt()}),mt=y(U().getToggleAllPageRowsSelectedProps,{instance:yt()});Object.assign(x,{selectedFlatRows:Ve,isAllRowsSelected:lt,isAllPageRowsSelected:$t,toggleRowSelected:Xe,toggleAllRowsSelected:De,getToggleAllRowsSelectedProps:Bt,getToggleAllPageRowsSelectedProps:mt,toggleAllPageRowsSelected:St})}function Ty(x,D){var B=D.instance;x.toggleRowSelected=function(U){return B.toggleRowSelected(x.id,U)},x.getToggleRowSelectedProps=y(B.getHooks().getToggleRowSelectedProps,{instance:B,row:x})}var Ns=function(x){return{}},pa=function(x){return{}};u.setRowState="setRowState",u.setCellState="setCellState",u.resetRowState="resetRowState";var Ru=function(x){x.stateReducers.push(fa),x.useInstance.push(_y),x.prepareRow.push(Ry)};function fa(x,D,B,U){var Q=U.initialRowStateAccessor,Y=Q===void 0?Ns:Q,ee=U.initialCellStateAccessor,le=ee===void 0?pa:ee,ce=U.rowsById;if(D.type===u.init)return a({rowState:{}},x);if(D.type===u.resetRowState)return a({},x,{rowState:U.initialState.rowState||{}});if(D.type===u.setRowState){var he,Le=D.rowId,$e=D.value,Ie=x.rowState[Le]!==void 0?x.rowState[Le]:Y(ce[Le]);return a({},x,{rowState:a({},x.rowState,(he={},he[Le]=g($e,Ie),he))})}if(D.type===u.setCellState){var xe,Ae,je,Ve,lt,$t=D.rowId,at=D.columnId,De=D.value,St=x.rowState[$t]!==void 0?x.rowState[$t]:Y(ce[$t]),Xe=(St==null||(xe=St.cellState)==null?void 0:xe[at])!==void 0?St.cellState[at]:le((Ae=ce[$t])==null||(je=Ae.cells)==null?void 0:je.find(function(yt){return yt.column.id===at}));return a({},x,{rowState:a({},x.rowState,(lt={},lt[$t]=a({},St,{cellState:a({},St.cellState||{},(Ve={},Ve[at]=g(De,Xe),Ve))}),lt))})}}function _y(x){var D=x.autoResetRowState,B=D===void 0||D,U=x.data,Q=x.dispatch,Y=r.useCallback(function(ce,he){return Q({type:u.setRowState,rowId:ce,value:he})},[Q]),ee=r.useCallback(function(ce,he,Le){return Q({type:u.setCellState,rowId:ce,columnId:he,value:Le})},[Q]),le=S(B);R(function(){le()&&Q({type:u.resetRowState})},[U]),Object.assign(x,{setRowState:Y,setCellState:ee})}function Ry(x,D){var B=D.instance,U=B.initialRowStateAccessor,Q=U===void 0?Ns:U,Y=B.initialCellStateAccessor,ee=Y===void 0?pa:Y,le=B.state.rowState;x&&(x.state=le[x.id]!==void 0?le[x.id]:Q(x),x.setState=function(ce){return B.setRowState(x.id,ce)},x.cells.forEach(function(ce){x.state.cellState||(x.state.cellState={}),ce.state=x.state.cellState[ce.column.id]!==void 0?x.state.cellState[ce.column.id]:ee(ce),ce.setState=function(he){return B.setCellState(x.id,ce.column.id,he)}}))}Ru.pluginName="useRowState",u.resetColumnOrder="resetColumnOrder",u.setColumnOrder="setColumnOrder";var Ef=function(x){x.stateReducers.push(Py),x.visibleColumnsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.columnOrder])}),x.visibleColumns.push($y),x.useInstance.push(Iy)};function Py(x,D,B,U){return D.type===u.init?a({columnOrder:[]},x):D.type===u.resetColumnOrder?a({},x,{columnOrder:U.initialState.columnOrder||[]}):D.type===u.setColumnOrder?a({},x,{columnOrder:g(D.columnOrder,x.columnOrder)}):void 0}function $y(x,D){var B=D.instance.state.columnOrder;if(!B||!B.length)return x;for(var U=[].concat(B),Q=[].concat(x),Y=[],ee=function(){var le=U.shift(),ce=Q.findIndex(function(he){return he.id===le});ce>-1&&Y.push(Q.splice(ce,1)[0])};Q.length&&U.length;)ee();return[].concat(Y,Q)}function Iy(x){var D=x.dispatch;x.setColumnOrder=r.useCallback(function(B){return D({type:u.setColumnOrder,columnOrder:B})},[D])}Ef.pluginName="useColumnOrder",h.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var Pu=function(x){x.getResizerProps=[ha],x.getHeaderProps.push({style:{position:"relative"}}),x.stateReducers.push(Ay),x.useInstance.push(Oy),x.useInstanceBeforeDimensions.push(kf)},ha=function(x,D){var B=D.instance,U=D.header,Q=B.dispatch,Y=function(ee,le){var ce=!1;if(ee.type==="touchstart"){if(ee.touches&&ee.touches.length>1)return;ce=!0}var he,Le,$e=function(at){var De=[];return function St(Xe){Xe.columns&&Xe.columns.length&&Xe.columns.map(St),De.push(Xe)}(at),De}(le).map(function(at){return[at.id,at.totalWidth]}),Ie=ce?Math.round(ee.touches[0].clientX):ee.clientX,xe=function(){window.cancelAnimationFrame(he),he=null,Q({type:u.columnDoneResizing})},Ae=function(){window.cancelAnimationFrame(he),he=null,Q({type:u.columnResizing,clientX:Le})},je=function(at){Le=at,he||(he=window.requestAnimationFrame(Ae))},Ve={mouse:{moveEvent:"mousemove",moveHandler:function(at){return je(at.clientX)},upEvent:"mouseup",upHandler:function(at){document.removeEventListener("mousemove",Ve.mouse.moveHandler),document.removeEventListener("mouseup",Ve.mouse.upHandler),xe()}},touch:{moveEvent:"touchmove",moveHandler:function(at){return at.cancelable&&(at.preventDefault(),at.stopPropagation()),je(at.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(at){document.removeEventListener(Ve.touch.moveEvent,Ve.touch.moveHandler),document.removeEventListener(Ve.touch.upEvent,Ve.touch.moveHandler),xe()}}},lt=ce?Ve.touch:Ve.mouse,$t=!!function(){if(typeof $=="boolean")return $;var at=!1;try{var De={get passive(){return at=!0,!1}};window.addEventListener("test",null,De),window.removeEventListener("test",null,De)}catch{at=!1}return $=at}()&&{passive:!1};document.addEventListener(lt.moveEvent,lt.moveHandler,$t),document.addEventListener(lt.upEvent,lt.upHandler,$t),Q({type:u.columnStartResizing,columnId:le.id,columnWidth:le.totalWidth,headerIdWidths:$e,clientX:Ie})};return[x,{onMouseDown:function(ee){return ee.persist()||Y(ee,U)},onTouchStart:function(ee){return ee.persist()||Y(ee,U)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Ay(x,D){if(D.type===u.init)return a({columnResizing:{columnWidths:{}}},x);if(D.type===u.resetResize)return a({},x,{columnResizing:{columnWidths:{}}});if(D.type===u.columnStartResizing){var B=D.clientX,U=D.columnId,Q=D.columnWidth,Y=D.headerIdWidths;return a({},x,{columnResizing:a({},x.columnResizing,{startX:B,headerIdWidths:Y,columnWidth:Q,isResizingColumn:U})})}if(D.type===u.columnResizing){var ee=D.clientX,le=x.columnResizing,ce=le.startX,he=le.columnWidth,Le=le.headerIdWidths,$e=(ee-ce)/he,Ie={};return(Le===void 0?[]:Le).forEach(function(xe){var Ae=xe[0],je=xe[1];Ie[Ae]=Math.max(je+je*$e,0)}),a({},x,{columnResizing:a({},x.columnResizing,{columnWidths:a({},x.columnResizing.columnWidths,{},Ie)})})}return D.type===u.columnDoneResizing?a({},x,{columnResizing:a({},x.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Pu.pluginName="useResizeColumns";var kf=function(x){var D=x.flatHeaders,B=x.disableResizing,U=x.getHooks,Q=x.state.columnResizing,Y=S(x);D.forEach(function(ee){var le=j(ee.disableResizing!==!0&&void 0,B!==!0&&void 0,!0);ee.canResize=le,ee.width=Q.columnWidths[ee.id]||ee.originalWidth||ee.width,ee.isResizing=Q.isResizingColumn===ee.id,le&&(ee.getResizerProps=y(U().getResizerProps,{instance:Y(),header:ee}))})};function Oy(x){var D=x.plugins,B=x.dispatch,U=x.autoResetResize,Q=U===void 0||U,Y=x.columns;w(D,["useAbsoluteLayout"],"useResizeColumns");var ee=S(Q);R(function(){ee()&&B({type:u.resetResize})},[Y]);var le=r.useCallback(function(){return B({type:u.resetResize})},[B]);Object.assign(x,{resetResizing:le})}var Ms={position:"absolute",top:0},$u=function(x){x.getTableBodyProps.push(Bl),x.getRowProps.push(Bl),x.getHeaderGroupProps.push(Bl),x.getFooterGroupProps.push(Bl),x.getHeaderProps.push(function(D,B){var U=B.column;return[D,{style:a({},Ms,{left:U.totalLeft+"px",width:U.totalWidth+"px"})}]}),x.getCellProps.push(function(D,B){var U=B.cell;return[D,{style:a({},Ms,{left:U.column.totalLeft+"px",width:U.column.totalWidth+"px"})}]}),x.getFooterProps.push(function(D,B){var U=B.column;return[D,{style:a({},Ms,{left:U.totalLeft+"px",width:U.totalWidth+"px"})}]})};$u.pluginName="useAbsoluteLayout";var Bl=function(x,D){return[x,{style:{position:"relative",width:D.instance.totalColumnsWidth+"px"}}]},Iu={display:"inline-block",boxSizing:"border-box"},Fl=function(x,D){return[x,{style:{display:"flex",width:D.instance.totalColumnsWidth+"px"}}]},Tf=function(x){x.getRowProps.push(Fl),x.getHeaderGroupProps.push(Fl),x.getFooterGroupProps.push(Fl),x.getHeaderProps.push(function(D,B){var U=B.column;return[D,{style:a({},Iu,{width:U.totalWidth+"px"})}]}),x.getCellProps.push(function(D,B){var U=B.cell;return[D,{style:a({},Iu,{width:U.column.totalWidth+"px"})}]}),x.getFooterProps.push(function(D,B){var U=B.column;return[D,{style:a({},Iu,{width:U.totalWidth+"px"})}]})};function Bs(x){x.getTableProps.push(Ly),x.getRowProps.push(Fs),x.getHeaderGroupProps.push(Fs),x.getFooterGroupProps.push(Fs),x.getHeaderProps.push(Dy),x.getCellProps.push(Ny),x.getFooterProps.push(V)}Tf.pluginName="useBlockLayout",Bs.pluginName="useFlexLayout";var Ly=function(x,D){return[x,{style:{minWidth:D.instance.totalColumnsMinWidth+"px"}}]},Fs=function(x,D){return[x,{style:{display:"flex",flex:"1 0 auto",minWidth:D.instance.totalColumnsMinWidth+"px"}}]},Dy=function(x,D){var B=D.column;return[x,{style:{boxSizing:"border-box",flex:B.totalFlexWidth?B.totalFlexWidth+" 0 auto":void 0,minWidth:B.totalMinWidth+"px",width:B.totalWidth+"px"}}]},Ny=function(x,D){var B=D.cell;return[x,{style:{boxSizing:"border-box",flex:B.column.totalFlexWidth+" 0 auto",minWidth:B.column.totalMinWidth+"px",width:B.column.totalWidth+"px"}}]},V=function(x,D){var B=D.column;return[x,{style:{boxSizing:"border-box",flex:B.totalFlexWidth?B.totalFlexWidth+" 0 auto":void 0,minWidth:B.totalMinWidth+"px",width:B.totalWidth+"px"}}]};function ie(x){x.stateReducers.push($r),x.getTableProps.push(be),x.getHeaderProps.push(et),x.getRowProps.push(tr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",ie.pluginName="useGridLayout";var be=function(x,D){var B=D.instance;return[x,{style:{display:"grid",gridTemplateColumns:B.visibleColumns.map(function(U){var Q;return B.state.gridLayout.columnWidths[U.id]?B.state.gridLayout.columnWidths[U.id]+"px":(Q=B.state.columnResizing)!=null&&Q.isResizingColumn?B.state.gridLayout.startWidths[U.id]+"px":typeof U.width=="number"?U.width+"px":U.width}).join(" ")}}]},et=function(x,D){var B=D.column;return[x,{id:"header-cell-"+B.id,style:{position:"sticky",gridColumn:"span "+B.totalVisibleHeaderCount}}]},tr=function(x,D){var B=D.row;return B.isExpanded?[x,{style:{gridColumn:"1 / "+(B.cells.length+1)}}]:[x,{}]};function $r(x,D,B,U){if(D.type===u.init)return a({gridLayout:{columnWidths:{}}},x);if(D.type===u.resetResize)return a({},x,{gridLayout:{columnWidths:{}}});if(D.type===u.columnStartResizing){var Q=D.columnId,Y=D.headerIdWidths,ee=Mr(Q);if(ee!==void 0){var le=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=Mr(St.id),Xe))},{}),ce=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=St.minWidth,Xe))},{}),he=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=St.maxWidth,Xe))},{}),Le=Y.map(function(De){var St=De[0];return[St,Mr(St)]});return a({},x,{gridLayout:a({},x.gridLayout,{startWidths:le,minWidths:ce,maxWidths:he,headerIdGridWidths:Le,columnWidth:ee})})}return x}if(D.type===u.columnResizing){var $e=D.clientX,Ie=x.columnResizing.startX,xe=x.gridLayout,Ae=xe.columnWidth,je=xe.minWidths,Ve=xe.maxWidths,lt=xe.headerIdGridWidths,$t=($e-Ie)/Ae,at={};return(lt===void 0?[]:lt).forEach(function(De){var St=De[0],Xe=De[1];at[St]=Math.min(Math.max(je[St],Xe+Xe*$t),Ve[St])}),a({},x,{gridLayout:a({},x.gridLayout,{columnWidths:a({},x.gridLayout.columnWidths,{},at)})})}return D.type===u.columnDoneResizing?a({},x,{gridLayout:a({},x.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function Mr(x){var D,B=(D=document.getElementById("header-cell-"+x))==null?void 0:D.offsetWidth;if(B!==void 0)return B}n._UNSTABLE_usePivotColumns=Ds,n.actions=u,n.defaultColumn=h,n.defaultGroupByFn=dt,n.defaultOrderByFn=yf,n.defaultRenderer=d,n.emptyRenderer=p,n.ensurePluginOrder=w,n.flexRender=P,n.functionalUpdate=g,n.loopHooks=b,n.makePropGetter=y,n.makeRenderer=k,n.reduceHooks=v,n.safeUseLayoutEffect=C,n.useAbsoluteLayout=$u,n.useAsyncDebounce=function(x,D){D===void 0&&(D=0);var B=r.useRef({}),U=S(x),Q=S(D);return r.useCallback(function(){var Y=i(regeneratorRuntime.mark(function ee(){var le,ce,he,Le=arguments;return regeneratorRuntime.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:for(le=Le.length,ce=new Array(le),he=0;he<le;he++)ce[he]=Le[he];return B.current.promise||(B.current.promise=new Promise(function(Ie,xe){B.current.resolve=Ie,B.current.reject=xe})),B.current.timeout&&clearTimeout(B.current.timeout),B.current.timeout=setTimeout(i(regeneratorRuntime.mark(function Ie(){return regeneratorRuntime.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return delete B.current.timeout,xe.prev=1,xe.t0=B.current,xe.next=5,U().apply(void 0,ce);case 5:xe.t1=xe.sent,xe.t0.resolve.call(xe.t0,xe.t1),xe.next=12;break;case 9:xe.prev=9,xe.t2=xe.catch(1),B.current.reject(xe.t2);case 12:return xe.prev=12,delete B.current.promise,xe.finish(12);case 15:case"end":return xe.stop()}},Ie,null,[[1,9,12,15]])})),Q()),$e.abrupt("return",B.current.promise);case 5:case"end":return $e.stop()}},ee)}));return function(){return Y.apply(this,arguments)}}(),[U,Q])},n.useBlockLayout=Tf,n.useColumnOrder=Ef,n.useExpanded=H,n.useFilters=ui,n.useFlexLayout=Bs,n.useGetLatest=S,n.useGlobalFilter=Oo,n.useGridLayout=ie,n.useGroupBy=$n,n.useMountedLayoutEffect=R,n.usePagination=bf,n.useResizeColumns=Pu,n.useRowSelect=xf,n.useRowState=Ru,n.useSortBy=xt,n.useTable=function(x){for(var D=arguments.length,B=new Array(D>1?D-1:0),U=1;U<D;U++)B[U-1]=arguments[U];x=_e(x),B=[ut].concat(B);var Q=r.useRef({}),Y=S(Q.current);Object.assign(Y(),a({},x,{plugins:B,hooks:Me()})),B.filter(Boolean).forEach(function(gt){gt(Y().hooks)});var ee=S(Y().hooks);Y().getHooks=ee,delete Y().hooks,Object.assign(Y(),v(ee().useOptions,_e(x)));var le=Y(),ce=le.data,he=le.columns,Le=le.initialState,$e=le.defaultColumn,Ie=le.getSubRows,xe=le.getRowId,Ae=le.stateReducer,je=le.useControlledState,Ve=S(Ae),lt=r.useCallback(function(gt,Dn){if(!Dn.type)throw console.info({action:Dn}),new Error("Unknown Action 👆");return[].concat(ee().stateReducers,Array.isArray(Ve())?Ve():[Ve()]).reduce(function(nr,Yr){return Yr(nr,Dn,gt,Y())||nr},gt)},[ee,Ve,Y]),$t=r.useReducer(lt,void 0,function(){return lt(Le,{type:u.init})}),at=$t[0],De=$t[1],St=v([].concat(ee().useControlledState,[je]),at,{instance:Y()});Object.assign(Y(),{state:St,dispatch:De});var Xe=r.useMemo(function(){return O(v(ee().columns,he,{instance:Y()}))},[ee,Y,he].concat(v(ee().columnsDeps,[],{instance:Y()})));Y().columns=Xe;var yt=r.useMemo(function(){return v(ee().allColumns,L(Xe),{instance:Y()}).map(I)},[Xe,ee,Y].concat(v(ee().allColumnsDeps,[],{instance:Y()})));Y().allColumns=yt;var Bt=r.useMemo(function(){for(var gt=[],Dn=[],nr={},Yr=[].concat(yt);Yr.length;){var yr=Yr.shift();ze({data:ce,rows:gt,flatRows:Dn,rowsById:nr,column:yr,getRowId:xe,getSubRows:Ie,accessValueHooks:ee().accessValue,getInstance:Y})}return[gt,Dn,nr]},[yt,ce,xe,Ie,ee,Y]),mt=Bt[0],vt=Bt[1],Yt=Bt[2];Object.assign(Y(),{rows:mt,initialRows:[].concat(mt),flatRows:vt,rowsById:Yt}),b(ee().useInstanceAfterData,Y());var bt=r.useMemo(function(){return v(ee().visibleColumns,yt,{instance:Y()}).map(function(gt){return A(gt,$e)})},[ee,yt,Y,$e].concat(v(ee().visibleColumnsDeps,[],{instance:Y()})));yt=r.useMemo(function(){var gt=[].concat(bt);return yt.forEach(function(Dn){gt.find(function(nr){return nr.id===Dn.id})||gt.push(Dn)}),gt},[yt,bt]),Y().allColumns=yt;var Gt=r.useMemo(function(){return v(ee().headerGroups,M(bt,$e),Y())},[ee,bt,$e,Y].concat(v(ee().headerGroupsDeps,[],{instance:Y()})));Y().headerGroups=Gt;var Ut=r.useMemo(function(){return Gt.length?Gt[0].headers:[]},[Gt]);Y().headers=Ut,Y().flatHeaders=Gt.reduce(function(gt,Dn){return[].concat(gt,Dn.headers)},[]),b(ee().useInstanceBeforeDimensions,Y());var vn=bt.filter(function(gt){return gt.isVisible}).map(function(gt){return gt.id}).sort().join("_");bt=r.useMemo(function(){return bt.filter(function(gt){return gt.isVisible})},[bt,vn]),Y().visibleColumns=bt;var ct=Be(Ut),zt=ct[0],Hn=ct[1],qr=ct[2];return Y().totalColumnsMinWidth=zt,Y().totalColumnsWidth=Hn,Y().totalColumnsMaxWidth=qr,b(ee().useInstance,Y()),[].concat(Y().flatHeaders,Y().allColumns).forEach(function(gt){gt.render=k(Y(),gt),gt.getHeaderProps=y(ee().getHeaderProps,{instance:Y(),column:gt}),gt.getFooterProps=y(ee().getFooterProps,{instance:Y(),column:gt})}),Y().headerGroups=r.useMemo(function(){return Gt.filter(function(gt,Dn){return gt.headers=gt.headers.filter(function(nr){return nr.headers?function Yr(yr){return yr.filter(function(Wa){return Wa.headers?Yr(Wa.headers):Wa.isVisible}).length}(nr.headers):nr.isVisible}),!!gt.headers.length&&(gt.getHeaderGroupProps=y(ee().getHeaderGroupProps,{instance:Y(),headerGroup:gt,index:Dn}),gt.getFooterGroupProps=y(ee().getFooterGroupProps,{instance:Y(),headerGroup:gt,index:Dn}),!0)})},[Gt,Y,ee]),Y().footerGroups=[].concat(Y().headerGroups).reverse(),Y().prepareRow=r.useCallback(function(gt){gt.getRowProps=y(ee().getRowProps,{instance:Y(),row:gt}),gt.allCells=yt.map(function(Dn){var nr=gt.values[Dn.id],Yr={column:Dn,row:gt,value:nr};return Yr.getCellProps=y(ee().getCellProps,{instance:Y(),cell:Yr}),Yr.render=k(Y(),Dn,{row:gt,cell:Yr,value:nr}),Yr}),gt.cells=bt.map(function(Dn){return gt.allCells.find(function(nr){return nr.column.id===Dn.id})}),b(ee().prepareRow,gt,{instance:Y()})},[ee,Y,yt,bt]),Y().getTableProps=y(ee().getTableProps,{instance:Y()}),Y().getTableBodyProps=y(ee().getTableBodyProps,{instance:Y()}),b(ee().useFinalInstance,Y()),Y()},Object.defineProperty(n,"__esModule",{value:!0})})})(Ioe,Wm);(function(e){e.exports=Wm})($oe);const Aoe=()=>{throw new Error("setAnnouncement called outside AnnouncerContext")},cC=jt.createContext({setAnnouncement:Aoe}),Ooe=E(G4,{shouldForwardProp:e=>e!=="isFlex"&&e!=="isSortable"&&e!=="isFlexGrow"})(({theme:e,isFlex:t,isSortable:n,isFlexGrow:r})=>({position:"relative",fontWeight:e.typography.fontWeightRegular,...t&&{justifyContent:"stretch",alignItems:"center",display:"flex",flexShrink:0,"& > *":{flexGrow:1}},...n&&{padding:0,"&:hover, &:focus":{backgroundColor:e.palette.tableHeaderHover,"& svg":{color:"inherit"}}},...r&&{flexGrow:1}})),Loe=E("button",{shouldForwardProp:e=>e!=="isSorted"})(({theme:e,isSorted:t})=>({all:"unset",whiteSpace:"nowrap",width:"100%",position:"relative",zIndex:1,":hover, :focus, &:focus-visible, &:active":{outline:"revert",".hover-only":{display:"inline-block"}},display:"flex",boxSizing:"inherit",cursor:"pointer",...t&&{fontWeight:e.typography.fontWeightBold}})),Doe=E("span")(({theme:e})=>({display:"flex",flexDirection:"column",flexShrink:1,minWidth:0,"::after":{fontWeight:"bold",display:"inline-block",height:0,content:"attr(data-text)",visibility:"hidden",overflow:"hidden"}})),Noe=E("span")(({theme:e})=>({padding:e.spacing(2),visibility:"hidden",display:"flex",alignItems:"center",width:"100%"})),Moe=E("span")(({theme:e})=>({padding:e.spacing(2),position:"absolute",display:"flex",alignItems:"center",width:"100%",height:"100%",".hover-only":{display:"none"},"& > span":{minWidth:0,whiteSpace:"nowrap",textOverflow:"ellipsis",overflowX:"hidden",overflowY:"visible"}}));var Yb={},Boe={get exports(){return Yb},set exports(e){Yb=e}};/*!
|
|
278
|
+
`));return c}const{useCssAndCx:o}=(0,Rne.createUseCssAndCx)({useCache:r});function i(l){const{name:c,uniqId:u=Ane++}=l??{},d=typeof c!="object"?c:Object.keys(c)[0];return function(p){const h=typeof p=="function"?p:()=>p;return function(y,v){var b,w;const g=t(),{css:S,cx:C}=o(),R=r();let k=(0,sh.useMemo)(()=>{const O={},L=typeof Proxy<"u"&&new Proxy({},{get:(M,F)=>(typeof F=="symbol"&&(0,$ne.assert)(!1),O[F]=`${R.key}-${u}${d!==void 0?`-${d}`:""}-${F}-ref`)}),I=h(g,y,L||{}),A=(0,_ne.objectFromEntries)((0,F_.objectKeys)(I).map(M=>{const F=I[M];return F.label||(F.label=`${d!==void 0?`${d}-`:""}${M}`),[M,`${S(F)}${(0,Pne.typeGuard)(M,M in O)?` ${O[M]}`:""}`]}));return(0,F_.objectKeys)(O).forEach(M=>{M in A||(A[M]=O[M])}),A},[R,S,C,g,(0,lh.getDependencyArrayRef)(y)]);const P=v==null?void 0:v.props.classes;k=(0,sh.useMemo)(()=>(0,z_.mergeClasses)(k,P,C),[k,(0,lh.getDependencyArrayRef)(P),C]);{let O;try{O=d!==void 0?(w=(b=g.components)===null||b===void 0?void 0:b[d])===null||w===void 0?void 0:w.styleOverrides:void 0}catch{}const L=(0,sh.useMemo)(()=>{if(!O)return;const I={};for(const A in O){const M=O[A];M instanceof Object&&(I[A]=S(typeof M=="function"?M(Object.assign({theme:g,ownerState:v==null?void 0:v.ownerState},v==null?void 0:v.props)):M))}return I},[O===void 0?void 0:JSON.stringify(O),(0,lh.getDependencyArrayRef)(v==null?void 0:v.props),(0,lh.getDependencyArrayRef)(v==null?void 0:v.ownerState),S]);k=(0,sh.useMemo)(()=>(0,z_.mergeClasses)(k,L,C),[k,L,C])}return{classes:k,theme:g,css:S,cx:C}}}}function a(){const l=t(),{css:c,cx:u}=o();return{theme:l,css:c,cx:u}}return{makeStyles:i,useStyles:a}}nf.createMakeStyles=One;var Tv={},_v={};Object.defineProperty(_v,"__esModule",{value:!0});_v.capitalize=void 0;function Lne(e){return e.charAt(0).toUpperCase()+e.slice(1)}_v.capitalize=Lne;var Dne=Rn&&Rn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Nne=Rn&&Rn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mne=Rn&&Rn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Dne(t,e,n);return Nne(t,e),t},j_=Rn&&Rn.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(Tv,"__esModule",{value:!0});Tv.createWithStyles=void 0;const A1=Mne(f),Bne=nf,U_=_v;function Fne(e){const{useTheme:t,cache:n}=e,{makeStyles:r}=(0,Bne.createMakeStyles)({useTheme:t,cache:n});function o(i,a,l){const c=typeof i=="string"?(()=>{const m=i,y=function(v){var{children:b}=v,w=j_(v,["children"]);return(0,A1.createElement)(m,w,b)};return Object.defineProperty(y,"name",{value:(0,U_.capitalize)(m)}),y})():i,u=(()=>{{const m=c.displayName;if(m)return m}{const{name:m}=c;if(m)return m}return l==null?void 0:l.name})(),d=r(Object.assign(Object.assign({},l),{name:u}))(typeof a=="function"?(m,y,v)=>W_(a(m,y,v)):W_(a));function p(m){for(const y in m)if(y!=="root")return!0;return!1}const h=(0,A1.forwardRef)(function(m,y){const{className:v,classes:b}=m,w=j_(m,["className","classes"]),{classes:g,cx:S}=d(m,{props:m});return A1.default.createElement(c,Object.assign({ref:y,className:p(g)?v:S(g.root,v)},typeof i=="string"?{}:{classes:g},w))});return u!==void 0&&(h.displayName=`${(0,U_.capitalize)(u)}WithStyles`,Object.defineProperty(h,"name",{value:h.displayName})),h}return{withStyles:o}}Tv.createWithStyles=Fne;function W_(e){const t={},n={};return Object.keys(e).forEach(r=>(r.startsWith("@media")?n:t)[r]=e[r]),Object.keys(n).forEach(r=>{const o=n[r];Object.keys(o).forEach(i=>{var a;return t[i]=Object.assign(Object.assign({},(a=t[i])!==null&&a!==void 0?a:{}),{[r]:o[i]})})}),t}var Rv={},zne=Rn&&Rn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),jne=Rn&&Rn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Une=Rn&&Rn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zne(t,e,n);return jne(t,e),t},Wne=Rn&&Rn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rv,"__esModule",{value:!0});Rv.GlobalStyles=void 0;const Hne=Wne(f),H_=Une(Yx);function Vne(e){const{styles:t}=e;return Hne.default.createElement(H_.Global,{styles:H_.css(t)})}Rv.GlobalStyles=Vne;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMakeAndWithStyles=e.GlobalStyles=e.keyframes=e.createWithStyles=e.createMakeStyles=void 0;const t=nf;Object.defineProperty(e,"createMakeStyles",{enumerable:!0,get:function(){return t.createMakeStyles}});const n=Tv;Object.defineProperty(e,"createWithStyles",{enumerable:!0,get:function(){return n.createWithStyles}});var r=Yx;Object.defineProperty(e,"keyframes",{enumerable:!0,get:function(){return r.keyframes}});var o=Rv;Object.defineProperty(e,"GlobalStyles",{enumerable:!0,get:function(){return o.GlobalStyles}});function i(a){return Object.assign(Object.assign({},(0,t.createMakeStyles)(a)),(0,n.createWithStyles)(a))}e.createMakeAndWithStyles=i})(C3);var ai,Kx,ch;Object.defineProperty(pl,"__esModule",{value:!0});pl.useStyles=Kx=pl.withStyles=ai=pl.makeStyles=void 0;const Gne=gne,qne=C3;ch=(0,qne.createMakeAndWithStyles)({useTheme:Gne.useTheme}),ai=pl.makeStyles=ch.makeStyles,Kx=pl.withStyles=ch.withStyles,pl.useStyles=ch.useStyles;const Pv=e=>({"&:focus-visible":{outline:0,outlineStyle:"solid",outlineWidth:2,outlineOffset:2,outlineColor:e.palette.primary.main}}),sf=e=>({"& > *":{marginTop:`${e.spacing(1)} !important`,marginBottom:`${e.spacing(1)} !important`}}),Yne=e=>({fontSize:e.fontSizes.mainHeader,fontWeight:"bold",marginBottom:e.spacing(1)}),T3={textAlign:"center"},Kne={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},$v={display:"flex",alignItems:"center"},_3={display:"flex",flexDirection:"column"},Xne={alignItems:"center"},Jne={position:"relative"},T5e=e=>({borderRadius:`${e.shape.borderRadius}px`}),R3={opacity:"0",right:"40px",bottom:"40px",transform:"translateY(400px)",zIndex:1400,position:"fixed"},P3={transform:"translateY(0)",opacity:"1",transition:"transform 0.6s ease, opacity 1s ease"},Qne={transform:"translateY(400px)",opacity:"0",transition:"transform 1.25s ease, opacity 1s ease"},Zne=e=>({opacity:"0",position:"fixed",right:"40px",top:"40px",transform:"translateY(-400px)",[e.breakpoints.down("sm")]:{right:20,left:10,top:40}}),ere={transform:"translateY(100px)",opacity:"1",transition:"transform 0.6s ease, opacity 1s ease"},tre={transform:"translateY(-400px)",opacity:"0",transition:"transform 1.25s ease, opacity 1s ease"},lf=ai()(e=>({focusable:{"&:focus-visible":{outline:0,outlineStyle:"solid",outlineWidth:2,outlineOffset:2,outlineColor:e.palette.primary.main}},contentSpacingY:{"& > *":{marginTop:"0.5rem !important",marginBottom:"0.5rem !important"}},divider:{margin:"1rem 0",backgroundColor:e.palette.divider,height:"3px",width:"100%"},largeDivider:{margin:"2rem 0",backgroundColor:e.palette.divider,height:"3px",width:"100%"},bold:{fontWeight:"bold"},flexRow:{display:"flex",alignItems:"center"},flexColumn:{display:"flex",flexDirection:"column"},itemsCenter:{alignItems:"center"},justifyCenter:{justifyContent:"center"},flexWrap:{flexWrap:"wrap"},textCenter:{textAlign:"center"},fullWidth:{width:"100%"},fullHeight:{height:"100%"},title:{fontSize:e.fontSizes.mainHeader,fontWeight:"bold",marginBottom:"0.5rem"},error:{fontSize:e.fontSizes.smallBody,color:e.palette.error.main}}));function jn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Yh(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yh=function(n){return typeof n}:Yh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Yh(e)}function sr(e){jn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Yh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wp(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function V_(e){jn(1,arguments);var t=sr(e);return t.setHours(0,0,0,0),t}var nre=864e5;function rre(e,t){jn(2,arguments);var n=V_(e),r=V_(t),o=n.getTime()-wp(n),i=r.getTime()-wp(r);return Math.round((o-i)/nre)}function G_(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function $3(e,t){jn(2,arguments);var n=sr(e),r=sr(t),o=G_(n,r),i=Math.abs(rre(n,r));n.setDate(n.getDate()-o*i);var a=Number(G_(n,r)===-o),l=o*(i-a);return l===0?0:l}const I3="pnps",ore=e=>{if(!e)return!1;if(e.length===0)return!0;const t=e.find(n=>n.feedbackId===I3);if(!t)return!0;if(t.neverShow)return!1;if(t.given){const r=new Date;return $3(r,new Date(t.given))>182}return!1},cf=()=>{const{data:e,error:t}=gn(Hb,ire,are),n=f.useCallback(()=>{Vr(Hb).catch(console.warn)},[]);return{data:e,refetchAuth:n,loading:!t&&!e,error:t}},ire=()=>fetch(Hb).then(e=>e.json()),are={revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:15e3},Hb=Ft("api/admin/user"),Xx=()=>{const e=cf();return{feedback:e.data&&"feedback"in e.data?e.data.feedback:void 0,refetchFeedback:e.refetchAuth,loading:e.loading,error:e.error}},A3=()=>{const{refetchFeedback:e}=Xx(),t=Ft("api/admin/feedback"),n=f.useCallback(async o=>{await q_("POST",t,o),await e()},[t,e]),r=f.useCallback(async o=>{const i=`${t}/${o.feedbackId}`;await q_("PUT",i,o),await e()},[t,e]);return{createFeedback:n,updateFeedback:r}},q_=async(e,t,n)=>{await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},sre=({openUrl:e})=>{const{showFeedback:t,setShowFeedback:n}=f.useContext($s),{createFeedback:r,updateFeedback:o}=A3(),{feedback:i}=Xx(),[a,l]=f.useState(!1),c=sn(),u=I3,d=f.useMemo(()=>({start:{...Zne(c),zIndex:c.zIndex.tooltip},enter:ere,leave:tre}),[c]),p=async()=>{try{await r({feedbackId:u})}catch(m){console.warn(m),n(!1)}window.open(e,"_blank"),setTimeout(()=>{n(!1)},200)},h=async()=>{try{await o({feedbackId:u,neverShow:!0})}catch(m){console.warn(m),n(!1)}setTimeout(()=>{n(!1)},100)};return ore(i)?s(qx,{mounted:t,start:d.start,enter:d.enter,leave:d.leave,children:s(Je,{sx:{borderRadius:"12.5px",backgroundColor:c.palette.background.paper,zIndex:9999,boxShadow:"2px 2px 4px 4px rgba(143,143,143, 0.25)",padding:c.spacing(3),maxWidth:"400px"},children:T(Je,{sx:{display:"flex",flexDirection:"column",position:"relative",...sf(c)},children:[s(Tt,{title:"Close",arrow:!0,children:s(Qt,{sx:{position:"absolute",right:"-38px",top:"-47px",backgroundColor:c.palette.background.paper,boxShadow:"2px 2px 4px 4px rgba(143,143,143, 0.25)","&:hover":{backgroundColor:"#fff"}},onClick:()=>n(!1),size:"large",children:s(wv,{})})}),s(mne,{style:{width:"25px",height:"25px"}}),s(X,{condition:a,show:s("p",{children:"Alright, apologies for the disruption. Have a nice day!"}),elseShow:T("p",{children:["Hi. Do you have 2 minutes to help us improve Unleash?"," "]})}),s(Je,{children:s(X,{condition:a,show:s(rt,{variant:"outlined",onClick:h,children:"Don't show again"}),elseShow:T(Re,{children:[s(rt,{variant:"contained",color:"primary",onClick:p,children:"Yes, no problem"}),s(rt,{sx:{marginLeft:m=>m.spacing(2)},onClick:()=>l(!0),children:"Not now"})]})})})]})})}):null};var Jx={},lre=fn;Object.defineProperty(Jx,"__esModule",{value:!0});var O3=Jx.default=void 0,cre=lre(En()),ure=kn,dre=(0,cre.default)((0,ure.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");O3=Jx.default=dre;var Qx={},pre=fn;Object.defineProperty(Qx,"__esModule",{value:!0});var L3=Qx.default=void 0,fre=pre(En()),hre=kn,mre=(0,fre.default)((0,hre.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");L3=Qx.default=mre;var Zx={},gre=fn;Object.defineProperty(Zx,"__esModule",{value:!0});var D3=Zx.default=void 0,vre=gre(En()),yre=kn,bre=(0,vre.default)((0,yre.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");D3=Zx.default=bre;var eC={},wre=fn;Object.defineProperty(eC,"__esModule",{value:!0});var N3=eC.default=void 0,Sre=wre(En()),xre=kn,Cre=(0,Sre.default)((0,xre.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");N3=eC.default=Cre;const Ere=E(fv)(({theme:e})=>({width:e.spacing(3.5),height:e.spacing(3.5),margin:"auto",backgroundColor:e.palette.secondary.light,color:e.palette.text.primary,fontSize:e.fontSizes.smallerBody,fontWeight:e.fontWeight.bold})),tC=({user:e,src:t,title:n,onMouseEnter:r,onMouseLeave:o,className:i,sx:a,children:l,...c})=>{!n&&!r&&e&&(n=`${(e==null?void 0:e.name)||(e==null?void 0:e.email)||(e==null?void 0:e.username)} (id: ${e==null?void 0:e.id})`),!t&&e&&(t=e==null?void 0:e.imageUrl);let u;return!l&&e&&(u=(e==null?void 0:e.name)||(e==null?void 0:e.email)||(e==null?void 0:e.username),u&&u.includes(" ")?u=`${u.split(" ")[0][0]}${u.split(" ")[1][0]}`.toUpperCase():u&&(u=u[0].toUpperCase())),s(Ere,{className:i,sx:a,...c,"data-loading":!0,alt:"Gravatar",src:t,title:n,onMouseEnter:r,onMouseLeave:o,children:s(X,{condition:Boolean(u),show:u,elseShow:l})})},kre=E(Tr)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(3),borderRadius:e.shape.borderRadiusMedium,boxShadow:e.boxShadows.popup,position:"absolute",zIndex:5e3,minWidth:e.spacing(37.5),right:0,[e.breakpoints.down("md")]:{width:"100%",padding:"1rem"}})),Tre=E("div")(({theme:e})=>({alignSelf:"flex-start",display:"flex",alignItems:"center",marginBottom:e.spacing(2)})),_re=E(tC)(({theme:e})=>({width:e.spacing(4.75),height:e.spacing(4.75),marginRight:e.spacing(1.5)})),Rre=E(ke)(({theme:e})=>({color:e.palette.text.secondary})),M3=E(po)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:0,color:e.palette.primary.dark,fontWeight:e.fontWeight.medium,"&:hover, &:focus":{textDecoration:"underline"},"& svg":{fontSize:e.spacing(2.25)}})),Pre=E(M3)(({theme:e})=>({alignSelf:"flex-start"})),$re=E(rt)(({theme:e})=>({width:"100%",height:e.spacing(5)})),Y_=E("div")(({theme:e})=>({width:"100%",height:"1px",backgroundColor:e.palette.divider,margin:e.spacing(3,0)})),Ire=({id:e,showProfile:t,setShowProfile:n,profile:r})=>s(X,{condition:t,show:T(kre,{id:e,children:[T(Tre,{children:[s(_re,{user:r}),T("div",{children:[s(ke,{children:r.name||r.username}),s(Rre,{variant:"body2",children:r.email})]})]}),s(M3,{component:on,to:"/profile",underline:"hover",onClick:()=>n(!1),children:"View profile settings"}),s(Y_,{}),T(Pre,{component:"a",href:"https://www.getunleash.io/privacy-policy",underline:"hover",rel:"noopener noreferrer",target:"_blank",children:["Privacy Policy ",s(N3,{})]}),s(Y_,{}),s($re,{variant:"outlined",color:"primary",href:`${Ba}/logout`,children:"Log out"})]})}),Ss=(e="useId")=>f.useMemo(()=>`${e}-${Are++}`,[e]);let Are=0;const Ore=E(tC)(({theme:e})=>({width:e.spacing(4.5),height:e.spacing(4.5)})),Lre=E("div")(({theme:e})=>({position:"relative"})),Dre=E(rt)(({theme:e})=>({...Pv(e),...$v,...Xne,color:"inherit",padding:e.spacing(.5,2),"&:hover":{backgroundColor:"transparent"}})),Nre=E(D3)(({theme:e})=>({color:e.palette.neutral.main})),Mre=({profile:e})=>{const[t,n]=f.useState(!1),r=Ss();return s(Vz,{onClickAway:()=>n(!1),children:T(Lre,{children:[T(Dre,{onClick:()=>n(o=>!o),"aria-controls":t?r:void 0,"aria-expanded":t,color:"secondary",disableRipple:!0,children:[s(Ore,{user:e,"data-testid":Qte}),s(Nre,{})]}),s(Ire,{id:r,showProfile:t,setShowProfile:n,profile:e})]})})},si=()=>{const e=cf();return{user:e.data&&"user"in e.data?e.data.user:void 0,refetchUser:e.refetchAuth,loading:e.loading,error:e.error}},K_=()=>{const{user:e}=si();return e?s(Mre,{profile:e}):null};var nC={},Bre=fn;Object.defineProperty(nC,"__esModule",{value:!0});var rC=nC.default=void 0,Fre=Bre(En()),X_=kn,zre=(0,Fre.default)([(0,X_.jsx)("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1zm0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5v11.5z"},"0"),(0,X_.jsx)("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99zM13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83zm4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24z"},"1")],"MenuBook");rC=nC.default=zre;const jre=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 653.4 251.24",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#1a4049;}.cls-2{fill:#fff;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"})),Ure=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 653.4 251.24",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#fff;}.cls-2{fill:#1a4049;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-1",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-1",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}));var oC={},Wre=fn;Object.defineProperty(oC,"__esModule",{value:!0});var B3=oC.default=void 0;Gre(f);var Hre=Wre(En()),Vre=kn;function F3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F3=function(r){return r?n:t})(e)}function Gre(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F3(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var qre=(0,Hre.default)((0,Vre.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");B3=oC.default=qre;var iC={},Yre=fn;Object.defineProperty(iC,"__esModule",{value:!0});var z3=iC.default=void 0,Kre=Yre(En()),Xre=kn,Jre=(0,Kre.default)((0,Xre.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"}),"LibraryBooks");z3=iC.default=Jre;var aC={},Qre=fn;Object.defineProperty(aC,"__esModule",{value:!0});var j3=aC.default=void 0,Zre=Qre(En()),eoe=kn,toe=(0,Zre.default)((0,eoe.jsx)("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"ExitToApp");j3=aC.default=toe;const U3=e=>f.createElement("svg",{id:"bg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 251.43 251.03",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#1a4049;}.cls-2{fill:#fff;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.71,cy:125.31,r:80}),f.createElement("polygon",{className:"cls-2",points:"137.14 91.03 137.14 113.88 137.14 136.74 160 136.74 160 113.88 160 91.03 137.14 91.03"}),f.createElement("polygon",{className:"cls-2",points:"114.29 113.88 114.29 91.03 91.43 91.03 91.43 113.88 91.43 136.74 91.43 159.6 114.29 159.6 137.14 159.6 137.14 136.74 114.29 136.74 114.29 113.88"}),f.createElement("rect",{className:"cls-3",x:137.14,y:136.74,width:22.86,height:22.86})),_5e="/static/logoBg-6e3a3ec3.svg",noe=E(zi)({minWidth:"150px",height:"100%",width:"100%",margin:"0",padding:"0"}),roe=E(on)(({theme:e})=>({textDecoration:"none",alignItems:"center",display:"flex",color:"inherit",height:"100%",width:"100%","&&":{color:"black",padding:e.spacing(1,2)}})),ooe=E("span")(({theme:e})=>({width:"12.5px",height:"12.5px",display:"block",backgroundColor:e.palette.primary.main,marginRight:"1rem",borderRadius:"2px"})),J_=({path:e,text:t,handleClose:n})=>s(noe,{onClick:()=>{n()},children:T(po,{style:{textDecoration:"none"},component:roe,to:e,underline:"hover",children:[s(ooe,{}),t]})}),ioe="_drawer_cxqms_1",aoe="_drawerTitle_cxqms_6",soe="_drawerContainer_cxqms_13",loe="_drawerTitleLogo_cxqms_17",coe="_drawerTitleText_cxqms_22",uoe="_drawerList_cxqms_27",doe="_iconLinkList_cxqms_28",poe="_iconLink_cxqms_28",foe="_navigationLink_cxqms_42",hoe="_navigationLinkActive_cxqms_50",moe="_navigationIcon_cxqms_56",goe="_iconGitHub_cxqms_61",vo={drawer:ioe,drawerTitle:aoe,drawerContainer:soe,drawerTitleLogo:loe,drawerTitleText:coe,drawerList:uoe,iconLinkList:doe,iconLink:poe,navigationLink:foe,navigationLinkActive:hoe,navigationIcon:moe,iconGitHub:goe},voe=({links:e=[],title:t="Unleash",flags:n={},open:r=!1,toggleDrawer:o,admin:i=!1,routes:a})=>{const l=()=>e.map(c=>{let u=null;return c.value==="GitHub"?u=s(B3,{className:vo.navigationIcon}):c.value==="Documentation"&&(u=s(z3,{className:vo.navigationIcon})),T("a",{href:c.href,rel:"noopener noreferrer",target:"_blank",className:vo.iconLink,children:[u,c.value]},c.value)});return s(vY,{className:vo.drawer,open:r,anchor:"left",onClose:o,children:T("nav",{id:"header-drawer",className:vo.drawerContainer,children:[s("div",{children:T(on,{to:"/",className:vo.drawerTitle,"aria-label":"Home",onClick:()=>o(),children:[s(U3,{className:vo.drawerTitleLogo,"aria-label":"Unleash logo"}),s("span",{className:vo.drawerTitleText,children:t})]})}),s(uo,{}),s(Yi,{className:vo.drawerList,children:a.mobileRoutes.map(c=>s(J_,{handleClose:()=>o(),path:c.path,text:c.title},c.path))}),s(X,{condition:i,show:T(Re,{children:[s(uo,{}),s(Yi,{className:vo.drawerList,children:a.adminRoutes.map(c=>s(J_,{handleClose:()=>o(),path:c.path,text:c.title},c.path))})]})}),s(uo,{}),T("div",{className:vo.iconLinkList,children:[l(),T("a",{className:vo.iconLink,href:`${Ba}/logout`,children:[s(j3,{className:vo.navigationIcon}),"Sign out"]})]})]})})},xi="ADMIN",Sp="CREATE_FEATURE",W3="UPDATE_FEATURE",yoe="DELETE_FEATURE",jm="CREATE_STRATEGY",Iv="UPDATE_STRATEGY",boe="DELETE_STRATEGY",Q_="UPDATE_APPLICATION",Um="CREATE_CONTEXT_FIELD",H3="UPDATE_CONTEXT_FIELD",woe="DELETE_CONTEXT_FIELD",Z_="CREATE_PROJECT",Vb="UPDATE_PROJECT",Soe="DELETE_PROJECT",xoe="DELETE_TAG_TYPE",xp="UPDATE_TAG_TYPE",V3="CREATE_ADDON",Gb="UPDATE_ADDON",Coe="DELETE_ADDON",R5e="CREATE_API_TOKEN",P5e="DELETE_API_TOKEN",$5e="READ_API_TOKEN",Eoe="DELETE_ENVIRONMENT",qb="UPDATE_ENVIRONMENT",G3="CREATE_FEATURE_STRATEGY",sC="UPDATE_FEATURE_STRATEGY",koe="DELETE_FEATURE_STRATEGY",Toe="UPDATE_FEATURE_ENVIRONMENT",I5e="UPDATE_FEATURE_VARIANTS",A5e="UPDATE_FEATURE_ENVIRONMENT_VARIANTS",O5e="MOVE_FEATURE_TOGGLE",Av="CREATE_SEGMENT",lC="UPDATE_SEGMENT",_oe="DELETE_SEGMENT",L5e="APPLY_CHANGE_REQUEST",D5e="APPROVE_CHANGE_REQUEST",Roe=E(on)(({theme:e})=>({textDecoration:"none",alignItems:"center",display:"flex",color:"inherit",height:"100%",width:"100%","&&":{padding:e.spacing(1,2)}})),Poe=E("span")(({theme:e})=>({width:"12.5px",height:"12.5px",display:"block",backgroundColor:e.palette.primary.main,marginRight:e.spacing(2),borderRadius:"2px"})),eR=({options:e,id:t,handleClose:n,anchorEl:r,style:o})=>s($x,{id:t,onClose:n,anchorEl:r,open:Boolean(r),style:o,children:e.map(i=>T(ws,{component:Roe,to:i.path,onClick:n,children:[s(Poe,{}),i.title]},i.path))});var tn={},$oe={get exports(){return tn},set exports(e){tn=e}},Wm={},Ioe={get exports(){return Wm},set exports(e){Wm=e}};(function(e,t){(function(n,r){r(t,f)})(Rn,function(n,r){function o(x,D,B,U,Q,Y,ee){try{var le=x[Y](ee),ce=le.value}catch(he){return void B(he)}le.done?D(ce):Promise.resolve(ce).then(U,Q)}function i(x){return function(){var D=this,B=arguments;return new Promise(function(U,Q){var Y=x.apply(D,B);function ee(ce){o(Y,U,Q,ee,le,"next",ce)}function le(ce){o(Y,U,Q,ee,le,"throw",ce)}ee(void 0)})}}function a(){return(a=Object.assign||function(x){for(var D=1;D<arguments.length;D++){var B=arguments[D];for(var U in B)Object.prototype.hasOwnProperty.call(B,U)&&(x[U]=B[U])}return x}).apply(this,arguments)}function l(x,D){if(x==null)return{};var B,U,Q={},Y=Object.keys(x);for(U=0;U<Y.length;U++)B=Y[U],D.indexOf(B)>=0||(Q[B]=x[B]);return Q}function c(x){var D=function(B,U){if(typeof B!="object"||B===null)return B;var Q=B[Symbol.toPrimitive];if(Q!==void 0){var Y=Q.call(B,U||"default");if(typeof Y!="object")return Y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)(B)}(x,"string");return typeof D=="symbol"?D:String(D)}r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var u={init:"init"},d=function(x){var D=x.value;return D===void 0?"":D},p=function(){return r.createElement(r.Fragment,null," ")},h={Cell:d,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function m(){for(var x=arguments.length,D=new Array(x),B=0;B<x;B++)D[B]=arguments[B];return D.reduce(function(U,Q){var Y=Q.style,ee=Q.className;return U=a({},U,{},l(Q,["style","className"])),Y&&(U.style=U.style?a({},U.style||{},{},Y||{}):Y),ee&&(U.className=U.className?U.className+" "+ee:ee),U.className===""&&delete U.className,U},{})}var y=function(x,D){return D===void 0&&(D={}),function(B){return B===void 0&&(B={}),[].concat(x,[B]).reduce(function(U,Q){return function Y(ee,le,ce){return typeof le=="function"?Y({},le(ee,ce)):Array.isArray(le)?m.apply(void 0,[ee].concat(le)):m(ee,le)}(U,Q,a({},D,{userProps:B}))},{})}},v=function(x,D,B,U){return B===void 0&&(B={}),x.reduce(function(Q,Y){return Y(Q,B)},D)},b=function(x,D,B){return B===void 0&&(B={}),x.forEach(function(U){U(D,B)})};function w(x,D,B,U){x.findIndex(function(Q){return Q.pluginName===B}),D.forEach(function(Q){x.findIndex(function(Y){return Y.pluginName===Q})})}function g(x,D){return typeof x=="function"?x(D):x}function S(x){var D=r.useRef();return D.current=x,r.useCallback(function(){return D.current},[])}var C=typeof document<"u"?r.useLayoutEffect:r.useEffect;function R(x,D){var B=r.useRef(!1);C(function(){B.current&&x(),B.current=!0},D)}function k(x,D,B){return B===void 0&&(B={}),function(U,Q){Q===void 0&&(Q={});var Y=typeof U=="string"?D[U]:U;if(Y===void 0)throw console.info(D),new Error("Renderer Error ☝️");return P(Y,a({},x,{column:D},B,{},Q))}}function P(x,D){return function(U){return typeof U=="function"&&(Q=Object.getPrototypeOf(U)).prototype&&Q.prototype.isReactComponent;var Q}(B=x)||typeof B=="function"||function(U){return typeof U=="object"&&typeof U.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(U.$$typeof.description)}(B)?r.createElement(x,D):x;var B}function O(x,D,B){return B===void 0&&(B=0),x.map(function(U){return I(U=a({},U,{parent:D,depth:B})),U.columns&&(U.columns=O(U.columns,U,B+1)),U})}function L(x){return G(x,"columns")}function I(x){var D=x.id,B=x.accessor,U=x.Header;if(typeof B=="string"){D=D||B;var Q=B.split(".");B=function(Y){return function(ee,le,ce){if(!le)return ee;var he,Le=typeof le=="function"?le:JSON.stringify(le),$e=F.get(Le)||function(){var Ie=function(xe){return function Ae(je,Ve){if(Ve===void 0&&(Ve=[]),Array.isArray(je))for(var lt=0;lt<je.length;lt+=1)Ae(je[lt],Ve);else Ve.push(je);return Ve}(xe).map(function(Ae){return String(Ae).replace(".","_")}).join(".").replace(N,".").replace(te,"").split(".")}(le);return F.set(Le,Ie),Ie}();try{he=$e.reduce(function(Ie,xe){return Ie[xe]},ee)}catch{}return he!==void 0?he:ce}(Y,Q)}}if(!D&&typeof U=="string"&&U&&(D=U),!D&&x.columns)throw console.error(x),new Error('A column ID (or unique "Header" value) is required!');if(!D)throw console.error(x),new Error("A column ID (or string accessor) is required!");return Object.assign(x,{id:D,accessor:B}),x}function A(x,D){if(!D)throw new Error;return Object.assign(x,a({Header:p,Footer:p},h,{},D,{},x)),Object.assign(x,{originalWidth:x.width}),x}function M(x,D,B){B===void 0&&(B=function(){return{}});for(var U=[],Q=x,Y=0,ee=function(){return Y++},le=function(){var ce={headers:[]},he=[],Le=Q.some(function($e){return $e.parent});Q.forEach(function($e){var Ie,xe=[].concat(he).reverse()[0];Le&&($e.parent?Ie=a({},$e.parent,{originalId:$e.parent.id,id:$e.parent.id+"_"+ee(),headers:[$e]},B($e)):Ie=A(a({originalId:$e.id+"_placeholder",id:$e.id+"_placeholder_"+ee(),placeholderOf:$e,headers:[$e]},B($e)),D),xe&&xe.originalId===Ie.originalId?xe.headers.push($e):he.push(Ie)),ce.headers.push($e)}),U.push(ce),Q=he};Q.length;)le();return U.reverse()}var F=new Map;function j(){for(var x=arguments.length,D=new Array(x),B=0;B<x;B++)D[B]=arguments[B];for(var U=0;U<D.length;U+=1)if(D[U]!==void 0)return D[U]}function q(x){if(typeof x=="function")return x}function G(x,D){var B=[];return function U(Q){Q.forEach(function(Y){Y[D]?U(Y[D]):B.push(Y)})}(x),B}function Z(x,D){var B=D.manualExpandedKey,U=D.expanded,Q=D.expandSubRows,Y=Q===void 0||Q,ee=[];return x.forEach(function(le){return function ce(he,Le){Le===void 0&&(Le=!0),he.isExpanded=he.original&&he.original[B]||U[he.id],he.canExpand=he.subRows&&!!he.subRows.length,Le&&ee.push(he),he.subRows&&he.subRows.length&&he.isExpanded&&he.subRows.forEach(function($e){return ce($e,Y)})}(le)}),ee}function J(x,D,B){return q(x)||D[x]||B[x]||B.text}function z(x,D,B){return x?x(D,B):D===void 0}function W(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var $=null,N=/\[/g,te=/\]/g,re=function(x){return a({role:"table"},x)},we=function(x){return a({role:"rowgroup"},x)},se=function(x,D){var B=D.column;return a({key:"header_"+B.id,colSpan:B.totalVisibleHeaderCount,role:"columnheader"},x)},Ee=function(x,D){var B=D.column;return a({key:"footer_"+B.id,colSpan:B.totalVisibleHeaderCount},x)},ue=function(x,D){return a({key:"headerGroup_"+D.index,role:"row"},x)},pe=function(x,D){return a({key:"footerGroup_"+D.index},x)},Ne=function(x,D){return a({key:"row_"+D.row.id,role:"row"},x)},ye=function(x,D){var B=D.cell;return a({key:"cell_"+B.row.id+"_"+B.column.id,role:"cell"},x)};function Me(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[re],getTableBodyProps:[we],getHeaderGroupProps:[ue],getFooterGroupProps:[pe],getHeaderProps:[se],getFooterProps:[Ee],getRowProps:[Ne],getCellProps:[ye],useFinalInstance:[]}}u.resetHiddenColumns="resetHiddenColumns",u.toggleHideColumn="toggleHideColumn",u.setHiddenColumns="setHiddenColumns",u.toggleHideAllColumns="toggleHideAllColumns";var ut=function(x){x.getToggleHiddenProps=[ot],x.getToggleHideAllColumnsProps=[Te],x.stateReducers.push(Et),x.useInstanceBeforeDimensions.push(Ze),x.headerGroupsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.hiddenColumns])}),x.useInstance.push(st)};ut.pluginName="useColumnVisibility";var ot=function(x,D){var B=D.column;return[x,{onChange:function(U){B.toggleHidden(!U.target.checked)},style:{cursor:"pointer"},checked:B.isVisible,title:"Toggle Column Visible"}]},Te=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleHideAllColumns(!U.target.checked)},style:{cursor:"pointer"},checked:!B.allColumnsHidden&&!B.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!B.allColumnsHidden&&B.state.hiddenColumns.length}]};function Et(x,D,B,U){if(D.type===u.init)return a({hiddenColumns:[]},x);if(D.type===u.resetHiddenColumns)return a({},x,{hiddenColumns:U.initialState.hiddenColumns||[]});if(D.type===u.toggleHideColumn){var Q=(D.value!==void 0?D.value:!x.hiddenColumns.includes(D.columnId))?[].concat(x.hiddenColumns,[D.columnId]):x.hiddenColumns.filter(function(Y){return Y!==D.columnId});return a({},x,{hiddenColumns:Q})}return D.type===u.setHiddenColumns?a({},x,{hiddenColumns:g(D.value,x.hiddenColumns)}):D.type===u.toggleHideAllColumns?a({},x,{hiddenColumns:(D.value!==void 0?D.value:!x.hiddenColumns.length)?U.allColumns.map(function(Y){return Y.id}):[]}):void 0}function Ze(x){var D=x.headers,B=x.state.hiddenColumns;r.useRef(!1).current;var U=0;D.forEach(function(Q){return U+=function Y(ee,le){ee.isVisible=le&&!B.includes(ee.id);var ce=0;return ee.headers&&ee.headers.length?ee.headers.forEach(function(he){return ce+=Y(he,ee.isVisible)}):ce=ee.isVisible?1:0,ee.totalVisibleHeaderCount=ce,ce}(Q,!0)})}function st(x){var D=x.columns,B=x.flatHeaders,U=x.dispatch,Q=x.allColumns,Y=x.getHooks,ee=x.state.hiddenColumns,le=x.autoResetHiddenColumns,ce=le===void 0||le,he=S(x),Le=Q.length===ee.length,$e=r.useCallback(function(Ve,lt){return U({type:u.toggleHideColumn,columnId:Ve,value:lt})},[U]),Ie=r.useCallback(function(Ve){return U({type:u.setHiddenColumns,value:Ve})},[U]),xe=r.useCallback(function(Ve){return U({type:u.toggleHideAllColumns,value:Ve})},[U]),Ae=y(Y().getToggleHideAllColumnsProps,{instance:he()});B.forEach(function(Ve){Ve.toggleHidden=function(lt){U({type:u.toggleHideColumn,columnId:Ve.id,value:lt})},Ve.getToggleHiddenProps=y(Y().getToggleHiddenProps,{instance:he(),column:Ve})});var je=S(ce);R(function(){je()&&U({type:u.resetHiddenColumns})},[U,D]),Object.assign(x,{allColumnsHidden:Le,toggleHideColumn:$e,setHiddenColumns:Ie,toggleHideAllColumns:xe,getToggleHideAllColumnsProps:Ae})}var At={},Ye={},qe=function(x,D,B){return x},Ot=function(x,D){return x.subRows||[]},Rt=function(x,D,B){return""+(B?[B.id,D].join("."):D)},me=function(x){return x};function _e(x){var D=x.initialState,B=D===void 0?At:D,U=x.defaultColumn,Q=U===void 0?Ye:U,Y=x.getSubRows,ee=Y===void 0?Ot:Y,le=x.getRowId,ce=le===void 0?Rt:le,he=x.stateReducer,Le=he===void 0?qe:he,$e=x.useControlledState,Ie=$e===void 0?me:$e;return a({},l(x,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:B,defaultColumn:Q,getSubRows:ee,getRowId:ce,stateReducer:Le,useControlledState:Ie})}function Be(x,D){D===void 0&&(D=0);var B=0,U=0,Q=0,Y=0;return x.forEach(function(ee){var le=ee.headers;if(ee.totalLeft=D,le&&le.length){var ce=Be(le,D),he=ce[0],Le=ce[1],$e=ce[2],Ie=ce[3];ee.totalMinWidth=he,ee.totalWidth=Le,ee.totalMaxWidth=$e,ee.totalFlexWidth=Ie}else ee.totalMinWidth=ee.minWidth,ee.totalWidth=Math.min(Math.max(ee.minWidth,ee.width),ee.maxWidth),ee.totalMaxWidth=ee.maxWidth,ee.totalFlexWidth=ee.canResize?ee.totalWidth:0;ee.isVisible&&(D+=ee.totalWidth,B+=ee.totalMinWidth,U+=ee.totalWidth,Q+=ee.totalMaxWidth,Y+=ee.totalFlexWidth)}),[B,U,Q,Y]}function ze(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.column,ee=x.getRowId,le=x.getSubRows,ce=x.accessValueHooks,he=x.getInstance;D.forEach(function(Le,$e){return function Ie(xe,Ae,je,Ve,lt){je===void 0&&(je=0);var $t=xe,at=ee(xe,Ae,Ve),De=Q[at];if(De)De.subRows&&De.originalSubRows.forEach(function(Xe,yt){return Ie(Xe,yt,je+1,De)});else if((De={id:at,original:$t,index:Ae,depth:je,cells:[{}]}).cells.map=W,De.cells.filter=W,De.cells.forEach=W,De.cells[0].getCellProps=W,De.values={},lt.push(De),U.push(De),Q[at]=De,De.originalSubRows=le(xe,Ae),De.originalSubRows){var St=[];De.originalSubRows.forEach(function(Xe,yt){return Ie(Xe,yt,je+1,De,St)}),De.subRows=St}Y.accessor&&(De.values[Y.id]=Y.accessor(xe,Ae,De,lt,D)),De.values[Y.id]=v(ce,De.values[Y.id],{row:De,column:Y,instance:he()})}(Le,$e,0,void 0,B)})}u.resetExpanded="resetExpanded",u.toggleRowExpanded="toggleRowExpanded",u.toggleAllRowsExpanded="toggleAllRowsExpanded";var H=function(x){x.getToggleAllRowsExpandedProps=[K],x.getToggleRowExpandedProps=[oe],x.stateReducers.push(de),x.useInstance.push(Fe),x.prepareRow.push(tt)};H.pluginName="useExpanded";var K=function(x,D){var B=D.instance;return[x,{onClick:function(U){B.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},oe=function(x,D){var B=D.row;return[x,{onClick:function(){B.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function de(x,D,B,U){if(D.type===u.init)return a({expanded:{}},x);if(D.type===u.resetExpanded)return a({},x,{expanded:U.initialState.expanded||{}});if(D.type===u.toggleAllRowsExpanded){var Q=D.value,Y=U.rowsById,ee=Object.keys(Y).length===Object.keys(x.expanded).length;if(Q!==void 0?Q:!ee){var le={};return Object.keys(Y).forEach(function(Ae){le[Ae]=!0}),a({},x,{expanded:le})}return a({},x,{expanded:{}})}if(D.type===u.toggleRowExpanded){var ce,he=D.id,Le=D.value,$e=x.expanded[he],Ie=Le!==void 0?Le:!$e;if(!$e&&Ie)return a({},x,{expanded:a({},x.expanded,(ce={},ce[he]=!0,ce))});if($e&&!Ie){var xe=x.expanded;return xe[he],a({},x,{expanded:l(xe,[he].map(c))})}return x}}function Fe(x){var D=x.data,B=x.rows,U=x.rowsById,Q=x.manualExpandedKey,Y=Q===void 0?"expanded":Q,ee=x.paginateExpandedRows,le=ee===void 0||ee,ce=x.expandSubRows,he=ce===void 0||ce,Le=x.autoResetExpanded,$e=Le===void 0||Le,Ie=x.getHooks,xe=x.plugins,Ae=x.state.expanded,je=x.dispatch;w(xe,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var Ve=S($e),lt=Boolean(Object.keys(U).length&&Object.keys(Ae).length);lt&&Object.keys(U).some(function(Bt){return!Ae[Bt]})&&(lt=!1),R(function(){Ve()&&je({type:u.resetExpanded})},[je,D]);var $t=r.useCallback(function(Bt,mt){je({type:u.toggleRowExpanded,id:Bt,value:mt})},[je]),at=r.useCallback(function(Bt){return je({type:u.toggleAllRowsExpanded,value:Bt})},[je]),De=r.useMemo(function(){return le?Z(B,{manualExpandedKey:Y,expanded:Ae,expandSubRows:he}):B},[le,B,Y,Ae,he]),St=r.useMemo(function(){return function(Bt){var mt=0;return Object.keys(Bt).forEach(function(vt){var Yt=vt.split(".");mt=Math.max(mt,Yt.length)}),mt}(Ae)},[Ae]),Xe=S(x),yt=y(Ie().getToggleAllRowsExpandedProps,{instance:Xe()});Object.assign(x,{preExpandedRows:B,expandedRows:De,rows:De,expandedDepth:St,isAllRowsExpanded:lt,toggleRowExpanded:$t,toggleAllRowsExpanded:at,getToggleAllRowsExpandedProps:yt})}function tt(x,D){var B=D.instance.getHooks,U=D.instance;x.toggleRowExpanded=function(Q){return U.toggleRowExpanded(x.id,Q)},x.getToggleRowExpandedProps=y(B().getToggleRowExpandedProps,{instance:U,row:x})}var nt=function(x,D,B){return x=x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return String(Y).toLowerCase().includes(String(B).toLowerCase())})})};nt.autoRemove=function(x){return!x};var Dt=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y===void 0||String(Y).toLowerCase()===String(B).toLowerCase()})})};Dt.autoRemove=function(x){return!x};var vr=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y===void 0||String(Y)===String(B)})})};vr.autoRemove=function(x){return!x};var Pn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q].includes(B)})})};Pn.autoRemove=function(x){return!x||!x.length};var Pt=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y&&Y.length&&B.every(function(ee){return Y.includes(ee)})})})};Pt.autoRemove=function(x){return!x||!x.length};var Bn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return Y&&Y.length&&B.some(function(ee){return Y.includes(ee)})})})};Bn.autoRemove=function(x){return!x||!x.length};var wn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){var Y=U.values[Q];return B.includes(Y)})})};wn.autoRemove=function(x){return!x||!x.length};var ln=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q]===B})})};ln.autoRemove=function(x){return x===void 0};var nn=function(x,D,B){return x.filter(function(U){return D.some(function(Q){return U.values[Q]==B})})};nn.autoRemove=function(x){return x==null};var er=function(x,D,B){var U=B||[],Q=U[0],Y=U[1];if((Q=typeof Q=="number"?Q:-1/0)>(Y=typeof Y=="number"?Y:1/0)){var ee=Q;Q=Y,Y=ee}return x.filter(function(le){return D.some(function(ce){var he=le.values[ce];return he>=Q&&he<=Y})})};er.autoRemove=function(x){return!x||typeof x[0]!="number"&&typeof x[1]!="number"};var eo=Object.freeze({__proto__:null,text:nt,exactText:Dt,exactTextCase:vr,includes:Pn,includesAll:Pt,includesSome:Bn,includesValue:wn,exact:ln,equals:nn,between:er});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var ui=function(x){x.stateReducers.push(ua),x.useInstance.push(ki)};function ua(x,D,B,U){if(D.type===u.init)return a({filters:[]},x);if(D.type===u.resetFilters)return a({},x,{filters:U.initialState.filters||[]});if(D.type===u.setFilter){var Q=D.columnId,Y=D.filterValue,ee=U.allColumns,le=U.filterTypes,ce=ee.find(function(je){return je.id===Q});if(!ce)throw new Error("React-Table: Could not find a column with id: "+Q);var he=J(ce.filter,le||{},eo),Le=x.filters.find(function(je){return je.id===Q}),$e=g(Y,Le&&Le.value);return z(he.autoRemove,$e,ce)?a({},x,{filters:x.filters.filter(function(je){return je.id!==Q})}):a({},x,Le?{filters:x.filters.map(function(je){return je.id===Q?{id:Q,value:$e}:je})}:{filters:[].concat(x.filters,[{id:Q,value:$e}])})}if(D.type===u.setAllFilters){var Ie=D.filters,xe=U.allColumns,Ae=U.filterTypes;return a({},x,{filters:g(Ie,x.filters).filter(function(je){var Ve=xe.find(function(lt){return lt.id===je.id});return!z(J(Ve.filter,Ae||{},eo).autoRemove,je.value,Ve)})})}}function ki(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.filterTypes,le=x.manualFilters,ce=x.defaultCanFilter,he=ce!==void 0&&ce,Le=x.disableFilters,$e=x.state.filters,Ie=x.dispatch,xe=x.autoResetFilters,Ae=xe===void 0||xe,je=r.useCallback(function(Xe,yt){Ie({type:u.setFilter,columnId:Xe,filterValue:yt})},[Ie]),Ve=r.useCallback(function(Xe){Ie({type:u.setAllFilters,filters:Xe})},[Ie]);Y.forEach(function(Xe){var yt=Xe.id,Bt=Xe.accessor,mt=Xe.defaultCanFilter,vt=Xe.disableFilters;Xe.canFilter=Bt?j(vt!==!0&&void 0,Le!==!0&&void 0,!0):j(mt,he,!1),Xe.setFilter=function(bt){return je(Xe.id,bt)};var Yt=$e.find(function(bt){return bt.id===yt});Xe.filterValue=Yt&&Yt.value});var lt=r.useMemo(function(){if(le||!$e.length)return[B,U,Q];var Xe=[],yt={};return[function Bt(mt,vt){vt===void 0&&(vt=0);var Yt=mt;return(Yt=$e.reduce(function(bt,Gt){var Ut=Gt.id,vn=Gt.value,ct=Y.find(function(Hn){return Hn.id===Ut});if(!ct)return bt;vt===0&&(ct.preFilteredRows=bt);var zt=J(ct.filter,ee||{},eo);return zt?(ct.filteredRows=zt(bt,[Ut],vn),ct.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+ct.id+"."),bt)},mt)).forEach(function(bt){Xe.push(bt),yt[bt.id]=bt,bt.subRows&&(bt.subRows=bt.subRows&&bt.subRows.length>0?Bt(bt.subRows,vt+1):bt.subRows)}),Yt}(B),Xe,yt]},[le,$e,B,U,Q,Y,ee]),$t=lt[0],at=lt[1],De=lt[2];r.useMemo(function(){Y.filter(function(Xe){return!$e.find(function(yt){return yt.id===Xe.id})}).forEach(function(Xe){Xe.preFilteredRows=$t,Xe.filteredRows=$t})},[$t,$e,Y]);var St=S(Ae);R(function(){St()&&Ie({type:u.resetFilters})},[Ie,le?null:D]),Object.assign(x,{preFilteredRows:B,preFilteredFlatRows:U,preFilteredRowsById:Q,filteredRows:$t,filteredFlatRows:at,filteredRowsById:De,rows:$t,flatRows:at,rowsById:De,setFilter:je,setAllFilters:Ve})}ui.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var Oo=function(x){x.stateReducers.push(Lo),x.useInstance.push(Xn)};function Lo(x,D,B,U){if(D.type===u.resetGlobalFilter)return a({},x,{globalFilter:U.initialState.globalFilter||void 0});if(D.type===u.setGlobalFilter){var Q=D.filterValue,Y=U.userFilterTypes,ee=J(U.globalFilter,Y||{},eo),le=g(Q,x.globalFilter);return z(ee.autoRemove,le)?(x.globalFilter,l(x,["globalFilter"])):a({},x,{globalFilter:le})}}function Xn(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.filterTypes,le=x.globalFilter,ce=x.manualGlobalFilter,he=x.state.globalFilter,Le=x.dispatch,$e=x.autoResetGlobalFilter,Ie=$e===void 0||$e,xe=x.disableGlobalFilter,Ae=r.useCallback(function(De){Le({type:u.setGlobalFilter,filterValue:De})},[Le]),je=r.useMemo(function(){if(ce||he===void 0)return[B,U,Q];var De=[],St={},Xe=J(le,ee||{},eo);if(!Xe)return console.warn("Could not find a valid 'globalFilter' option."),B;Y.forEach(function(Bt){var mt=Bt.disableGlobalFilter;Bt.canFilter=j(mt!==!0&&void 0,xe!==!0&&void 0,!0)});var yt=Y.filter(function(Bt){return Bt.canFilter===!0});return[function Bt(mt){return(mt=Xe(mt,yt.map(function(vt){return vt.id}),he)).forEach(function(vt){De.push(vt),St[vt.id]=vt,vt.subRows=vt.subRows&&vt.subRows.length?Bt(vt.subRows):vt.subRows}),mt}(B),De,St]},[ce,he,le,ee,Y,B,U,Q,xe]),Ve=je[0],lt=je[1],$t=je[2],at=S(Ie);R(function(){at()&&Le({type:u.resetGlobalFilter})},[Le,ce?null:D]),Object.assign(x,{preGlobalFilteredRows:B,preGlobalFilteredFlatRows:U,preGlobalFilteredRowsById:Q,globalFilteredRows:Ve,globalFilteredFlatRows:lt,globalFilteredRowsById:$t,rows:Ve,flatRows:lt,rowsById:$t,setGlobalFilter:Ae,disableGlobalFilter:xe})}function to(x,D){return D.reduce(function(B,U){return B+(typeof U=="number"?U:0)},0)}Oo.pluginName="useGlobalFilter";var Do=Object.freeze({__proto__:null,sum:to,min:function(x){var D=x[0]||0;return x.forEach(function(B){typeof B=="number"&&(D=Math.min(D,B))}),D},max:function(x){var D=x[0]||0;return x.forEach(function(B){typeof B=="number"&&(D=Math.max(D,B))}),D},minMax:function(x){var D=x[0]||0,B=x[0]||0;return x.forEach(function(U){typeof U=="number"&&(D=Math.min(D,U),B=Math.max(B,U))}),D+".."+B},average:function(x){return to(0,x)/x.length},median:function(x){if(!x.length)return null;var D=Math.floor(x.length/2),B=[].concat(x).sort(function(U,Q){return U-Q});return x.length%2!=0?B[D]:(B[D-1]+B[D])/2},unique:function(x){return Array.from(new Set(x).values())},uniqueCount:function(x){return new Set(x).size},count:function(x){return x.length}}),Nt=[],Wn={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var $n=function(x){x.getGroupByToggleProps=[Jn],x.stateReducers.push(da),x.visibleColumnsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.groupBy])}),x.visibleColumns.push(No),x.useInstance.push(fe),x.prepareRow.push(it)};$n.pluginName="useGroupBy";var Jn=function(x,D){var B=D.header;return[x,{onClick:B.canGroupBy?function(U){U.persist(),B.toggleGroupBy()}:void 0,style:{cursor:B.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function da(x,D,B,U){if(D.type===u.init)return a({groupBy:[]},x);if(D.type===u.resetGroupBy)return a({},x,{groupBy:U.initialState.groupBy||[]});if(D.type===u.setGroupBy)return a({},x,{groupBy:D.value});if(D.type===u.toggleGroupBy){var Q=D.columnId,Y=D.value,ee=Y!==void 0?Y:!x.groupBy.includes(Q);return a({},x,ee?{groupBy:[].concat(x.groupBy,[Q])}:{groupBy:x.groupBy.filter(function(le){return le!==Q})})}}function No(x,D){var B=D.instance.state.groupBy,U=B.map(function(Y){return x.find(function(ee){return ee.id===Y})}).filter(Boolean),Q=x.filter(function(Y){return!B.includes(Y.id)});return(x=[].concat(U,Q)).forEach(function(Y){Y.isGrouped=B.includes(Y.id),Y.groupedIndex=B.indexOf(Y.id)}),x}var Se={};function fe(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.rowsById,Y=x.allColumns,ee=x.flatHeaders,le=x.groupByFn,ce=le===void 0?dt:le,he=x.manualGroupBy,Le=x.aggregations,$e=Le===void 0?Se:Le,Ie=x.plugins,xe=x.state.groupBy,Ae=x.dispatch,je=x.autoResetGroupBy,Ve=je===void 0||je,lt=x.disableGroupBy,$t=x.defaultCanGroupBy,at=x.getHooks;w(Ie,["useColumnOrder","useFilters"],"useGroupBy");var De=S(x);Y.forEach(function(ct){var zt=ct.accessor,Hn=ct.defaultGroupBy,qr=ct.disableGroupBy;ct.canGroupBy=zt?j(ct.canGroupBy,qr!==!0&&void 0,lt!==!0&&void 0,!0):j(ct.canGroupBy,Hn,$t,!1),ct.canGroupBy&&(ct.toggleGroupBy=function(){return x.toggleGroupBy(ct.id)}),ct.Aggregated=ct.Aggregated||ct.Cell});var St=r.useCallback(function(ct,zt){Ae({type:u.toggleGroupBy,columnId:ct,value:zt})},[Ae]),Xe=r.useCallback(function(ct){Ae({type:u.setGroupBy,value:ct})},[Ae]);ee.forEach(function(ct){ct.getGroupByToggleProps=y(at().getGroupByToggleProps,{instance:De(),header:ct})});var yt=r.useMemo(function(){if(he||!xe.length)return[B,U,Q,Nt,Wn,U,Q];var ct=xe.filter(function(yr){return Y.find(function(Wa){return Wa.id===yr})}),zt=[],Hn={},qr=[],gt={},Dn=[],nr={},Yr=function yr(Wa,ma,eE){if(ma===void 0&&(ma=0),ma===ct.length)return Wa.map(function(_f){return a({},_f,{depth:ma})});var My=ct[ma],xN=ce(Wa,My);return Object.entries(xN).map(function(_f,CN){var tE=_f[0],Rf=_f[1],Pf=My+":"+tE,nE=yr(Rf,ma+1,Pf=eE?eE+">"+Pf:Pf),rE=ma?G(Rf,"leafRows"):Rf,EN=function(Mo,By,TN){var $f={};return Y.forEach(function(rr){if(ct.includes(rr.id))$f[rr.id]=By[0]?By[0].values[rr.id]:null;else{var oE=typeof rr.aggregate=="function"?rr.aggregate:$e[rr.aggregate]||Do[rr.aggregate];if(oE){var _N=By.map(function(If){return If.values[rr.id]}),RN=Mo.map(function(If){var Fy=If.values[rr.id];if(!TN&&rr.aggregateValue){var iE=typeof rr.aggregateValue=="function"?rr.aggregateValue:$e[rr.aggregateValue]||Do[rr.aggregateValue];if(!iE)throw console.info({column:rr}),new Error("React Table: Invalid column.aggregateValue option for column listed above");Fy=iE(Fy,If,rr)}return Fy});$f[rr.id]=oE(RN,_N)}else{if(rr.aggregate)throw console.info({column:rr}),new Error("React Table: Invalid column.aggregate option for column listed above");$f[rr.id]=null}}}),$f}(rE,Rf,ma),kN={id:Pf,isGrouped:!0,groupByID:My,groupByVal:tE,values:EN,subRows:nE,leafRows:rE,depth:ma,index:CN};return nE.forEach(function(Mo){zt.push(Mo),Hn[Mo.id]=Mo,Mo.isGrouped?(qr.push(Mo),gt[Mo.id]=Mo):(Dn.push(Mo),nr[Mo.id]=Mo)}),kN})}(B);return Yr.forEach(function(yr){zt.push(yr),Hn[yr.id]=yr,yr.isGrouped?(qr.push(yr),gt[yr.id]=yr):(Dn.push(yr),nr[yr.id]=yr)}),[Yr,zt,Hn,qr,gt,Dn,nr]},[he,xe,B,U,Q,Y,$e,ce]),Bt=yt[0],mt=yt[1],vt=yt[2],Yt=yt[3],bt=yt[4],Gt=yt[5],Ut=yt[6],vn=S(Ve);R(function(){vn()&&Ae({type:u.resetGroupBy})},[Ae,he?null:D]),Object.assign(x,{preGroupedRows:B,preGroupedFlatRow:U,preGroupedRowsById:Q,groupedRows:Bt,groupedFlatRows:mt,groupedRowsById:vt,onlyGroupedFlatRows:Yt,onlyGroupedRowsById:bt,nonGroupedFlatRows:Gt,nonGroupedRowsById:Ut,rows:Bt,flatRows:mt,rowsById:vt,toggleGroupBy:St,setGroupBy:Xe})}function it(x){x.allCells.forEach(function(D){var B;D.isGrouped=D.column.isGrouped&&D.column.id===x.groupByID,D.isPlaceholder=!D.isGrouped&&D.column.isGrouped,D.isAggregated=!D.isGrouped&&!D.isPlaceholder&&((B=x.subRows)==null?void 0:B.length)})}function dt(x,D){return x.reduce(function(B,U,Q){var Y=""+U.values[D];return B[Y]=Array.isArray(B[Y])?B[Y]:[],B[Y].push(U),B},{})}var qt=/([0-9]+)/gm;function In(x,D){return x===D?0:x>D?1:-1}function cn(x,D,B){return[x.values[B],D.values[B]]}function Rr(x){return typeof x=="number"?isNaN(x)||x===1/0||x===-1/0?"":String(x):typeof x=="string"?x:""}var Ua=Object.freeze({__proto__:null,alphanumeric:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];for(Q=Rr(Q),Y=Rr(Y),Q=Q.split(qt).filter(Boolean),Y=Y.split(qt).filter(Boolean);Q.length&&Y.length;){var ee=Q.shift(),le=Y.shift(),ce=parseInt(ee,10),he=parseInt(le,10),Le=[ce,he].sort();if(isNaN(Le[0])){if(ee>le)return 1;if(le>ee)return-1}else{if(isNaN(Le[1]))return isNaN(ce)?-1:1;if(ce>he)return 1;if(he>ce)return-1}}return Q.length-Y.length},datetime:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];return In(Q=Q.getTime(),Y=Y.getTime())},basic:function(x,D,B){var U=cn(x,D,B);return In(U[0],U[1])},string:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1];for(Q=Q.split("").filter(Boolean),Y=Y.split("").filter(Boolean);Q.length&&Y.length;){var ee=Q.shift(),le=Y.shift(),ce=ee.toLowerCase(),he=le.toLowerCase();if(ce>he)return 1;if(he>ce)return-1;if(ee>le)return 1;if(le>ee)return-1}return Q.length-Y.length},number:function(x,D,B){var U=cn(x,D,B),Q=U[0],Y=U[1],ee=/[^0-9.]/gi;return In(Q=Number(String(Q).replace(ee,"")),Y=Number(String(Y).replace(ee,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",h.sortType="alphanumeric",h.sortDescFirst=!1;var xt=function(x){x.getSortByToggleProps=[Pr],x.stateReducers.push(uy),x.useInstance.push(dy)};xt.pluginName="useSortBy";var Pr=function(x,D){var B=D.instance,U=D.column,Q=B.isMultiSortEvent,Y=Q===void 0?function(ee){return ee.shiftKey}:Q;return[x,{onClick:U.canSort?function(ee){ee.persist(),U.toggleSortBy(void 0,!B.disableMultiSort&&Y(ee))}:void 0,style:{cursor:U.canSort?"pointer":void 0},title:U.canSort?"Toggle SortBy":void 0}]};function uy(x,D,B,U){if(D.type===u.init)return a({sortBy:[]},x);if(D.type===u.resetSortBy)return a({},x,{sortBy:U.initialState.sortBy||[]});if(D.type===u.clearSortBy)return a({},x,{sortBy:x.sortBy.filter(function(De){return De.id!==D.columnId})});if(D.type===u.setSortBy)return a({},x,{sortBy:D.sortBy});if(D.type===u.toggleSortBy){var Q,Y=D.columnId,ee=D.desc,le=D.multi,ce=U.allColumns,he=U.disableMultiSort,Le=U.disableSortRemove,$e=U.disableMultiRemove,Ie=U.maxMultiSortColCount,xe=Ie===void 0?Number.MAX_SAFE_INTEGER:Ie,Ae=x.sortBy,je=ce.find(function(De){return De.id===Y}).sortDescFirst,Ve=Ae.find(function(De){return De.id===Y}),lt=Ae.findIndex(function(De){return De.id===Y}),$t=ee!=null,at=[];return(Q=!he&&le?Ve?"toggle":"add":lt!==Ae.length-1||Ae.length!==1?"replace":Ve?"toggle":"replace")!="toggle"||Le||$t||le&&$e||!(Ve&&Ve.desc&&!je||!Ve.desc&&je)||(Q="remove"),Q==="replace"?at=[{id:Y,desc:$t?ee:je}]:Q==="add"?(at=[].concat(Ae,[{id:Y,desc:$t?ee:je}])).splice(0,at.length-xe):Q==="toggle"?at=Ae.map(function(De){return De.id===Y?a({},De,{desc:$t?ee:!Ve.desc}):De}):Q==="remove"&&(at=Ae.filter(function(De){return De.id!==Y})),a({},x,{sortBy:at})}}function dy(x){var D=x.data,B=x.rows,U=x.flatRows,Q=x.allColumns,Y=x.orderByFn,ee=Y===void 0?yf:Y,le=x.sortTypes,ce=x.manualSortBy,he=x.defaultCanSort,Le=x.disableSortBy,$e=x.flatHeaders,Ie=x.state.sortBy,xe=x.dispatch,Ae=x.plugins,je=x.getHooks,Ve=x.autoResetSortBy,lt=Ve===void 0||Ve;w(Ae,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var $t=r.useCallback(function(mt){xe({type:u.setSortBy,sortBy:mt})},[xe]),at=r.useCallback(function(mt,vt,Yt){xe({type:u.toggleSortBy,columnId:mt,desc:vt,multi:Yt})},[xe]),De=S(x);$e.forEach(function(mt){var vt=mt.accessor,Yt=mt.canSort,bt=mt.disableSortBy,Gt=mt.id,Ut=vt?j(bt!==!0&&void 0,Le!==!0&&void 0,!0):j(he,Yt,!1);mt.canSort=Ut,mt.canSort&&(mt.toggleSortBy=function(ct,zt){return at(mt.id,ct,zt)},mt.clearSortBy=function(){xe({type:u.clearSortBy,columnId:mt.id})}),mt.getSortByToggleProps=y(je().getSortByToggleProps,{instance:De(),column:mt});var vn=Ie.find(function(ct){return ct.id===Gt});mt.isSorted=!!vn,mt.sortedIndex=Ie.findIndex(function(ct){return ct.id===Gt}),mt.isSortedDesc=mt.isSorted?vn.desc:void 0});var St=r.useMemo(function(){if(ce||!Ie.length)return[B,U];var mt=[],vt=Ie.filter(function(Yt){return Q.find(function(bt){return bt.id===Yt.id})});return[function Yt(bt){var Gt=ee(bt,vt.map(function(Ut){var vn=Q.find(function(Hn){return Hn.id===Ut.id});if(!vn)throw new Error("React-Table: Could not find a column with id: "+Ut.id+" while sorting");var ct=vn.sortType,zt=q(ct)||(le||{})[ct]||Ua[ct];if(!zt)throw new Error("React-Table: Could not find a valid sortType of '"+ct+"' for column '"+Ut.id+"'.");return function(Hn,qr){return zt(Hn,qr,Ut.id,Ut.desc)}}),vt.map(function(Ut){var vn=Q.find(function(ct){return ct.id===Ut.id});return vn&&vn.sortInverted?Ut.desc:!Ut.desc}));return Gt.forEach(function(Ut){mt.push(Ut),Ut.subRows&&Ut.subRows.length!==0&&(Ut.subRows=Yt(Ut.subRows))}),Gt}(B),mt]},[ce,Ie,B,U,Q,ee,le]),Xe=St[0],yt=St[1],Bt=S(lt);R(function(){Bt()&&xe({type:u.resetSortBy})},[ce?null:D]),Object.assign(x,{preSortedRows:B,preSortedFlatRows:U,sortedRows:Xe,sortedFlatRows:yt,rows:Xe,flatRows:yt,setSortBy:$t,toggleSortBy:at})}function yf(x,D,B){return[].concat(x).sort(function(U,Q){for(var Y=0;Y<D.length;Y+=1){var ee=D[Y],le=B[Y]===!1||B[Y]==="desc",ce=ee(U,Q);if(ce!==0)return le?-ce:ce}return B[0]?U.index-Q.index:Q.index-U.index})}u.resetPage="resetPage",u.gotoPage="gotoPage",u.setPageSize="setPageSize";var bf=function(x){x.stateReducers.push(py),x.useInstance.push(wf)};function py(x,D,B,U){if(D.type===u.init)return a({pageSize:10,pageIndex:0},x);if(D.type===u.resetPage)return a({},x,{pageIndex:U.initialState.pageIndex||0});if(D.type===u.gotoPage){var Q=U.pageCount,Y=U.page,ee=g(D.pageIndex,x.pageIndex),le=!1;return ee>x.pageIndex?le=Q===-1?Y.length>=x.pageSize:ee<Q:ee<x.pageIndex&&(le=ee>-1),le?a({},x,{pageIndex:ee}):x}if(D.type===u.setPageSize){var ce=D.pageSize,he=x.pageSize*x.pageIndex;return a({},x,{pageIndex:Math.floor(he/ce),pageSize:ce})}}function wf(x){var D=x.rows,B=x.autoResetPage,U=B===void 0||B,Q=x.manualExpandedKey,Y=Q===void 0?"expanded":Q,ee=x.plugins,le=x.pageCount,ce=x.paginateExpandedRows,he=ce===void 0||ce,Le=x.expandSubRows,$e=Le===void 0||Le,Ie=x.state,xe=Ie.pageSize,Ae=Ie.pageIndex,je=Ie.expanded,Ve=Ie.globalFilter,lt=Ie.filters,$t=Ie.groupBy,at=Ie.sortBy,De=x.dispatch,St=x.data,Xe=x.manualPagination;w(ee,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var yt=S(U);R(function(){yt()&&De({type:u.resetPage})},[De,Xe?null:St,Ve,lt,$t,at]);var Bt=Xe?le:Math.ceil(D.length/xe),mt=r.useMemo(function(){return Bt>0?[].concat(new Array(Bt)).fill(null).map(function(zt,Hn){return Hn}):[]},[Bt]),vt=r.useMemo(function(){var zt;if(Xe)zt=D;else{var Hn=xe*Ae,qr=Hn+xe;zt=D.slice(Hn,qr)}return he?zt:Z(zt,{manualExpandedKey:Y,expanded:je,expandSubRows:$e})},[$e,je,Y,Xe,Ae,xe,he,D]),Yt=Ae>0,bt=Bt===-1?vt.length>=xe:Ae<Bt-1,Gt=r.useCallback(function(zt){De({type:u.gotoPage,pageIndex:zt})},[De]),Ut=r.useCallback(function(){return Gt(function(zt){return zt-1})},[Gt]),vn=r.useCallback(function(){return Gt(function(zt){return zt+1})},[Gt]),ct=r.useCallback(function(zt){De({type:u.setPageSize,pageSize:zt})},[De]);Object.assign(x,{pageOptions:mt,pageCount:Bt,page:vt,canPreviousPage:Yt,canNextPage:bt,gotoPage:Gt,previousPage:Ut,nextPage:vn,setPageSize:ct})}bf.pluginName="usePagination",u.resetPivot="resetPivot",u.togglePivot="togglePivot";var Ds=function(x){x.getPivotToggleProps=[Tu],x.stateReducers.push(fy),x.useInstanceAfterData.push(hy),x.allColumns.push(my),x.accessValue.push(gy),x.materializedColumns.push(vy),x.materializedColumnsDeps.push(yy),x.visibleColumns.push(_u),x.visibleColumnsDeps.push(by),x.useInstance.push(wy),x.prepareRow.push(Sy)};Ds.pluginName="usePivotColumns";var Sf=[],Tu=function(x,D){var B=D.header;return[x,{onClick:B.canPivot?function(U){U.persist(),B.togglePivot()}:void 0,style:{cursor:B.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function fy(x,D,B,U){if(D.type===u.init)return a({pivotColumns:Sf},x);if(D.type===u.resetPivot)return a({},x,{pivotColumns:U.initialState.pivotColumns||Sf});if(D.type===u.togglePivot){var Q=D.columnId,Y=D.value,ee=Y!==void 0?Y:!x.pivotColumns.includes(Q);return a({},x,ee?{pivotColumns:[].concat(x.pivotColumns,[Q])}:{pivotColumns:x.pivotColumns.filter(function(le){return le!==Q})})}}function hy(x){x.allColumns.forEach(function(D){D.isPivotSource=x.state.pivotColumns.includes(D.id)})}function my(x,D){var B=D.instance;return x.forEach(function(U){U.isPivotSource=B.state.pivotColumns.includes(U.id),U.uniqueValues=new Set}),x}function gy(x,D){var B=D.column;return B.uniqueValues&&x!==void 0&&B.uniqueValues.add(x),x}function vy(x,D){var B=D.instance,U=B.allColumns,Q=B.state;if(!Q.pivotColumns.length||!Q.groupBy||!Q.groupBy.length)return x;var Y=Q.pivotColumns.map(function(ce){return U.find(function(he){return he.id===ce})}).filter(Boolean),ee=U.filter(function(ce){return!ce.isPivotSource&&!Q.groupBy.includes(ce.id)&&!Q.pivotColumns.includes(ce.id)}),le=L(function ce(he,Le,$e){he===void 0&&(he=0),$e===void 0&&($e=[]);var Ie=Y[he];return Ie?Array.from(Ie.uniqueValues).sort().map(function(xe){var Ae=a({},Ie,{Header:Ie.PivotHeader||typeof Ie.header=="string"?Ie.Header+": "+xe:xe,isPivotGroup:!0,parent:Le,depth:he,id:Le?Le.id+"."+Ie.id+"."+xe:Ie.id+"."+xe,pivotValue:xe});return Ae.columns=ce(he+1,Ae,[].concat($e,[function(je){return je.values[Ie.id]===xe}])),Ae}):ee.map(function(xe){return a({},xe,{canPivot:!1,isPivoted:!0,parent:Le,depth:he,id:""+(Le?Le.id+"."+xe.id:xe.id),accessor:function(Ae,je,Ve){if($e.every(function(lt){return lt(Ve)}))return Ve.values[xe.id]}})})}());return[].concat(x,le)}function yy(x,D){var B=D.instance.state,U=B.pivotColumns,Q=B.groupBy;return[].concat(x,[U,Q])}function _u(x,D){var B=D.instance.state;return x=x.filter(function(U){return!U.isPivotSource}),B.pivotColumns.length&&B.groupBy&&B.groupBy.length&&(x=x.filter(function(U){return U.isGrouped||U.isPivoted})),x}function by(x,D){var B=D.instance;return[].concat(x,[B.state.pivotColumns,B.state.groupBy])}function wy(x){var D=x.columns,B=x.allColumns,U=x.flatHeaders,Q=x.getHooks,Y=x.plugins,ee=x.dispatch,le=x.autoResetPivot,ce=le===void 0||le,he=x.manaulPivot,Le=x.disablePivot,$e=x.defaultCanPivot;w(Y,["useGroupBy"],"usePivotColumns");var Ie=S(x);B.forEach(function(Ae){var je=Ae.accessor,Ve=Ae.defaultPivot,lt=Ae.disablePivot;Ae.canPivot=je?j(Ae.canPivot,lt!==!0&&void 0,Le!==!0&&void 0,!0):j(Ae.canPivot,Ve,$e,!1),Ae.canPivot&&(Ae.togglePivot=function(){return x.togglePivot(Ae.id)}),Ae.Aggregated=Ae.Aggregated||Ae.Cell}),U.forEach(function(Ae){Ae.getPivotToggleProps=y(Q().getPivotToggleProps,{instance:Ie(),header:Ae})});var xe=S(ce);R(function(){xe()&&ee({type:u.resetPivot})},[ee,he?null:D]),Object.assign(x,{togglePivot:function(Ae,je){ee({type:u.togglePivot,columnId:Ae,value:je})}})}function Sy(x){x.allCells.forEach(function(D){D.isPivoted=D.column.isPivoted})}u.resetSelectedRows="resetSelectedRows",u.toggleAllRowsSelected="toggleAllRowsSelected",u.toggleRowSelected="toggleRowSelected",u.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var xf=function(x){x.getToggleRowSelectedProps=[xy],x.getToggleAllRowsSelectedProps=[Cy],x.getToggleAllPageRowsSelectedProps=[Ey],x.stateReducers.push(Cf),x.useInstance.push(ky),x.prepareRow.push(Ty)};xf.pluginName="useRowSelect";var xy=function(x,D){var B=D.instance,U=D.row,Q=B.manualRowSelectedKey,Y=Q===void 0?"isSelected":Q;return[x,{onChange:function(ee){U.toggleRowSelected(ee.target.checked)},style:{cursor:"pointer"},checked:!(!U.original||!U.original[Y])||U.isSelected,title:"Toggle Row Selected",indeterminate:U.isSomeSelected}]},Cy=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleAllRowsSelected(U.target.checked)},style:{cursor:"pointer"},checked:B.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!B.isAllRowsSelected&&Object.keys(B.state.selectedRowIds).length)}]},Ey=function(x,D){var B=D.instance;return[x,{onChange:function(U){B.toggleAllPageRowsSelected(U.target.checked)},style:{cursor:"pointer"},checked:B.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!B.isAllPageRowsSelected&&B.page.some(function(U){var Q=U.id;return B.state.selectedRowIds[Q]}))}]};function Cf(x,D,B,U){if(D.type===u.init)return a({selectedRowIds:{}},x);if(D.type===u.resetSelectedRows)return a({},x,{selectedRowIds:U.initialState.selectedRowIds||{}});if(D.type===u.toggleAllRowsSelected){var Q=D.value,Y=U.isAllRowsSelected,ee=U.rowsById,le=U.nonGroupedRowsById,ce=le===void 0?ee:le,he=Q!==void 0?Q:!Y,Le=Object.assign({},x.selectedRowIds);return he?Object.keys(ce).forEach(function(Gt){Le[Gt]=!0}):Object.keys(ce).forEach(function(Gt){delete Le[Gt]}),a({},x,{selectedRowIds:Le})}if(D.type===u.toggleRowSelected){var $e=D.id,Ie=D.value,xe=U.rowsById,Ae=U.selectSubRows,je=Ae===void 0||Ae,Ve=U.getSubRows,lt=x.selectedRowIds[$e],$t=Ie!==void 0?Ie:!lt;if(lt===$t)return x;var at=a({},x.selectedRowIds);return function Gt(Ut){var vn=xe[Ut];if(vn&&(vn.isGrouped||($t?at[Ut]=!0:delete at[Ut]),je&&Ve(vn)))return Ve(vn).forEach(function(ct){return Gt(ct.id)})}($e),a({},x,{selectedRowIds:at})}if(D.type===u.toggleAllPageRowsSelected){var De=D.value,St=U.page,Xe=U.rowsById,yt=U.selectSubRows,Bt=yt===void 0||yt,mt=U.isAllPageRowsSelected,vt=U.getSubRows,Yt=De!==void 0?De:!mt,bt=a({},x.selectedRowIds);return St.forEach(function(Gt){return function Ut(vn){var ct=Xe[vn];if(ct.isGrouped||(Yt?bt[vn]=!0:delete bt[vn]),Bt&&vt(ct))return vt(ct).forEach(function(zt){return Ut(zt.id)})}(Gt.id)}),a({},x,{selectedRowIds:bt})}return x}function ky(x){var D=x.data,B=x.rows,U=x.getHooks,Q=x.plugins,Y=x.rowsById,ee=x.nonGroupedRowsById,le=ee===void 0?Y:ee,ce=x.autoResetSelectedRows,he=ce===void 0||ce,Le=x.state.selectedRowIds,$e=x.selectSubRows,Ie=$e===void 0||$e,xe=x.dispatch,Ae=x.page,je=x.getSubRows;w(Q,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var Ve=r.useMemo(function(){var vt=[];return B.forEach(function(Yt){var bt=Ie?function Gt(Ut,vn,ct){if(vn[Ut.id])return!0;var zt=ct(Ut);if(zt&&zt.length){var Hn=!0,qr=!1;return zt.forEach(function(gt){qr&&!Hn||(Gt(gt,vn,ct)?qr=!0:Hn=!1)}),!!Hn||!!qr&&null}return!1}(Yt,Le,je):!!Le[Yt.id];Yt.isSelected=!!bt,Yt.isSomeSelected=bt===null,bt&&vt.push(Yt)}),vt},[B,Ie,Le,je]),lt=Boolean(Object.keys(le).length&&Object.keys(Le).length),$t=lt;lt&&Object.keys(le).some(function(vt){return!Le[vt]})&&(lt=!1),lt||Ae&&Ae.length&&Ae.some(function(vt){var Yt=vt.id;return!Le[Yt]})&&($t=!1);var at=S(he);R(function(){at()&&xe({type:u.resetSelectedRows})},[xe,D]);var De=r.useCallback(function(vt){return xe({type:u.toggleAllRowsSelected,value:vt})},[xe]),St=r.useCallback(function(vt){return xe({type:u.toggleAllPageRowsSelected,value:vt})},[xe]),Xe=r.useCallback(function(vt,Yt){return xe({type:u.toggleRowSelected,id:vt,value:Yt})},[xe]),yt=S(x),Bt=y(U().getToggleAllRowsSelectedProps,{instance:yt()}),mt=y(U().getToggleAllPageRowsSelectedProps,{instance:yt()});Object.assign(x,{selectedFlatRows:Ve,isAllRowsSelected:lt,isAllPageRowsSelected:$t,toggleRowSelected:Xe,toggleAllRowsSelected:De,getToggleAllRowsSelectedProps:Bt,getToggleAllPageRowsSelectedProps:mt,toggleAllPageRowsSelected:St})}function Ty(x,D){var B=D.instance;x.toggleRowSelected=function(U){return B.toggleRowSelected(x.id,U)},x.getToggleRowSelectedProps=y(B.getHooks().getToggleRowSelectedProps,{instance:B,row:x})}var Ns=function(x){return{}},pa=function(x){return{}};u.setRowState="setRowState",u.setCellState="setCellState",u.resetRowState="resetRowState";var Ru=function(x){x.stateReducers.push(fa),x.useInstance.push(_y),x.prepareRow.push(Ry)};function fa(x,D,B,U){var Q=U.initialRowStateAccessor,Y=Q===void 0?Ns:Q,ee=U.initialCellStateAccessor,le=ee===void 0?pa:ee,ce=U.rowsById;if(D.type===u.init)return a({rowState:{}},x);if(D.type===u.resetRowState)return a({},x,{rowState:U.initialState.rowState||{}});if(D.type===u.setRowState){var he,Le=D.rowId,$e=D.value,Ie=x.rowState[Le]!==void 0?x.rowState[Le]:Y(ce[Le]);return a({},x,{rowState:a({},x.rowState,(he={},he[Le]=g($e,Ie),he))})}if(D.type===u.setCellState){var xe,Ae,je,Ve,lt,$t=D.rowId,at=D.columnId,De=D.value,St=x.rowState[$t]!==void 0?x.rowState[$t]:Y(ce[$t]),Xe=(St==null||(xe=St.cellState)==null?void 0:xe[at])!==void 0?St.cellState[at]:le((Ae=ce[$t])==null||(je=Ae.cells)==null?void 0:je.find(function(yt){return yt.column.id===at}));return a({},x,{rowState:a({},x.rowState,(lt={},lt[$t]=a({},St,{cellState:a({},St.cellState||{},(Ve={},Ve[at]=g(De,Xe),Ve))}),lt))})}}function _y(x){var D=x.autoResetRowState,B=D===void 0||D,U=x.data,Q=x.dispatch,Y=r.useCallback(function(ce,he){return Q({type:u.setRowState,rowId:ce,value:he})},[Q]),ee=r.useCallback(function(ce,he,Le){return Q({type:u.setCellState,rowId:ce,columnId:he,value:Le})},[Q]),le=S(B);R(function(){le()&&Q({type:u.resetRowState})},[U]),Object.assign(x,{setRowState:Y,setCellState:ee})}function Ry(x,D){var B=D.instance,U=B.initialRowStateAccessor,Q=U===void 0?Ns:U,Y=B.initialCellStateAccessor,ee=Y===void 0?pa:Y,le=B.state.rowState;x&&(x.state=le[x.id]!==void 0?le[x.id]:Q(x),x.setState=function(ce){return B.setRowState(x.id,ce)},x.cells.forEach(function(ce){x.state.cellState||(x.state.cellState={}),ce.state=x.state.cellState[ce.column.id]!==void 0?x.state.cellState[ce.column.id]:ee(ce),ce.setState=function(he){return B.setCellState(x.id,ce.column.id,he)}}))}Ru.pluginName="useRowState",u.resetColumnOrder="resetColumnOrder",u.setColumnOrder="setColumnOrder";var Ef=function(x){x.stateReducers.push(Py),x.visibleColumnsDeps.push(function(D,B){var U=B.instance;return[].concat(D,[U.state.columnOrder])}),x.visibleColumns.push($y),x.useInstance.push(Iy)};function Py(x,D,B,U){return D.type===u.init?a({columnOrder:[]},x):D.type===u.resetColumnOrder?a({},x,{columnOrder:U.initialState.columnOrder||[]}):D.type===u.setColumnOrder?a({},x,{columnOrder:g(D.columnOrder,x.columnOrder)}):void 0}function $y(x,D){var B=D.instance.state.columnOrder;if(!B||!B.length)return x;for(var U=[].concat(B),Q=[].concat(x),Y=[],ee=function(){var le=U.shift(),ce=Q.findIndex(function(he){return he.id===le});ce>-1&&Y.push(Q.splice(ce,1)[0])};Q.length&&U.length;)ee();return[].concat(Y,Q)}function Iy(x){var D=x.dispatch;x.setColumnOrder=r.useCallback(function(B){return D({type:u.setColumnOrder,columnOrder:B})},[D])}Ef.pluginName="useColumnOrder",h.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var Pu=function(x){x.getResizerProps=[ha],x.getHeaderProps.push({style:{position:"relative"}}),x.stateReducers.push(Ay),x.useInstance.push(Oy),x.useInstanceBeforeDimensions.push(kf)},ha=function(x,D){var B=D.instance,U=D.header,Q=B.dispatch,Y=function(ee,le){var ce=!1;if(ee.type==="touchstart"){if(ee.touches&&ee.touches.length>1)return;ce=!0}var he,Le,$e=function(at){var De=[];return function St(Xe){Xe.columns&&Xe.columns.length&&Xe.columns.map(St),De.push(Xe)}(at),De}(le).map(function(at){return[at.id,at.totalWidth]}),Ie=ce?Math.round(ee.touches[0].clientX):ee.clientX,xe=function(){window.cancelAnimationFrame(he),he=null,Q({type:u.columnDoneResizing})},Ae=function(){window.cancelAnimationFrame(he),he=null,Q({type:u.columnResizing,clientX:Le})},je=function(at){Le=at,he||(he=window.requestAnimationFrame(Ae))},Ve={mouse:{moveEvent:"mousemove",moveHandler:function(at){return je(at.clientX)},upEvent:"mouseup",upHandler:function(at){document.removeEventListener("mousemove",Ve.mouse.moveHandler),document.removeEventListener("mouseup",Ve.mouse.upHandler),xe()}},touch:{moveEvent:"touchmove",moveHandler:function(at){return at.cancelable&&(at.preventDefault(),at.stopPropagation()),je(at.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(at){document.removeEventListener(Ve.touch.moveEvent,Ve.touch.moveHandler),document.removeEventListener(Ve.touch.upEvent,Ve.touch.moveHandler),xe()}}},lt=ce?Ve.touch:Ve.mouse,$t=!!function(){if(typeof $=="boolean")return $;var at=!1;try{var De={get passive(){return at=!0,!1}};window.addEventListener("test",null,De),window.removeEventListener("test",null,De)}catch{at=!1}return $=at}()&&{passive:!1};document.addEventListener(lt.moveEvent,lt.moveHandler,$t),document.addEventListener(lt.upEvent,lt.upHandler,$t),Q({type:u.columnStartResizing,columnId:le.id,columnWidth:le.totalWidth,headerIdWidths:$e,clientX:Ie})};return[x,{onMouseDown:function(ee){return ee.persist()||Y(ee,U)},onTouchStart:function(ee){return ee.persist()||Y(ee,U)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Ay(x,D){if(D.type===u.init)return a({columnResizing:{columnWidths:{}}},x);if(D.type===u.resetResize)return a({},x,{columnResizing:{columnWidths:{}}});if(D.type===u.columnStartResizing){var B=D.clientX,U=D.columnId,Q=D.columnWidth,Y=D.headerIdWidths;return a({},x,{columnResizing:a({},x.columnResizing,{startX:B,headerIdWidths:Y,columnWidth:Q,isResizingColumn:U})})}if(D.type===u.columnResizing){var ee=D.clientX,le=x.columnResizing,ce=le.startX,he=le.columnWidth,Le=le.headerIdWidths,$e=(ee-ce)/he,Ie={};return(Le===void 0?[]:Le).forEach(function(xe){var Ae=xe[0],je=xe[1];Ie[Ae]=Math.max(je+je*$e,0)}),a({},x,{columnResizing:a({},x.columnResizing,{columnWidths:a({},x.columnResizing.columnWidths,{},Ie)})})}return D.type===u.columnDoneResizing?a({},x,{columnResizing:a({},x.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Pu.pluginName="useResizeColumns";var kf=function(x){var D=x.flatHeaders,B=x.disableResizing,U=x.getHooks,Q=x.state.columnResizing,Y=S(x);D.forEach(function(ee){var le=j(ee.disableResizing!==!0&&void 0,B!==!0&&void 0,!0);ee.canResize=le,ee.width=Q.columnWidths[ee.id]||ee.originalWidth||ee.width,ee.isResizing=Q.isResizingColumn===ee.id,le&&(ee.getResizerProps=y(U().getResizerProps,{instance:Y(),header:ee}))})};function Oy(x){var D=x.plugins,B=x.dispatch,U=x.autoResetResize,Q=U===void 0||U,Y=x.columns;w(D,["useAbsoluteLayout"],"useResizeColumns");var ee=S(Q);R(function(){ee()&&B({type:u.resetResize})},[Y]);var le=r.useCallback(function(){return B({type:u.resetResize})},[B]);Object.assign(x,{resetResizing:le})}var Ms={position:"absolute",top:0},$u=function(x){x.getTableBodyProps.push(Bl),x.getRowProps.push(Bl),x.getHeaderGroupProps.push(Bl),x.getFooterGroupProps.push(Bl),x.getHeaderProps.push(function(D,B){var U=B.column;return[D,{style:a({},Ms,{left:U.totalLeft+"px",width:U.totalWidth+"px"})}]}),x.getCellProps.push(function(D,B){var U=B.cell;return[D,{style:a({},Ms,{left:U.column.totalLeft+"px",width:U.column.totalWidth+"px"})}]}),x.getFooterProps.push(function(D,B){var U=B.column;return[D,{style:a({},Ms,{left:U.totalLeft+"px",width:U.totalWidth+"px"})}]})};$u.pluginName="useAbsoluteLayout";var Bl=function(x,D){return[x,{style:{position:"relative",width:D.instance.totalColumnsWidth+"px"}}]},Iu={display:"inline-block",boxSizing:"border-box"},Fl=function(x,D){return[x,{style:{display:"flex",width:D.instance.totalColumnsWidth+"px"}}]},Tf=function(x){x.getRowProps.push(Fl),x.getHeaderGroupProps.push(Fl),x.getFooterGroupProps.push(Fl),x.getHeaderProps.push(function(D,B){var U=B.column;return[D,{style:a({},Iu,{width:U.totalWidth+"px"})}]}),x.getCellProps.push(function(D,B){var U=B.cell;return[D,{style:a({},Iu,{width:U.column.totalWidth+"px"})}]}),x.getFooterProps.push(function(D,B){var U=B.column;return[D,{style:a({},Iu,{width:U.totalWidth+"px"})}]})};function Bs(x){x.getTableProps.push(Ly),x.getRowProps.push(Fs),x.getHeaderGroupProps.push(Fs),x.getFooterGroupProps.push(Fs),x.getHeaderProps.push(Dy),x.getCellProps.push(Ny),x.getFooterProps.push(V)}Tf.pluginName="useBlockLayout",Bs.pluginName="useFlexLayout";var Ly=function(x,D){return[x,{style:{minWidth:D.instance.totalColumnsMinWidth+"px"}}]},Fs=function(x,D){return[x,{style:{display:"flex",flex:"1 0 auto",minWidth:D.instance.totalColumnsMinWidth+"px"}}]},Dy=function(x,D){var B=D.column;return[x,{style:{boxSizing:"border-box",flex:B.totalFlexWidth?B.totalFlexWidth+" 0 auto":void 0,minWidth:B.totalMinWidth+"px",width:B.totalWidth+"px"}}]},Ny=function(x,D){var B=D.cell;return[x,{style:{boxSizing:"border-box",flex:B.column.totalFlexWidth+" 0 auto",minWidth:B.column.totalMinWidth+"px",width:B.column.totalWidth+"px"}}]},V=function(x,D){var B=D.column;return[x,{style:{boxSizing:"border-box",flex:B.totalFlexWidth?B.totalFlexWidth+" 0 auto":void 0,minWidth:B.totalMinWidth+"px",width:B.totalWidth+"px"}}]};function ie(x){x.stateReducers.push($r),x.getTableProps.push(be),x.getHeaderProps.push(et),x.getRowProps.push(tr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",ie.pluginName="useGridLayout";var be=function(x,D){var B=D.instance;return[x,{style:{display:"grid",gridTemplateColumns:B.visibleColumns.map(function(U){var Q;return B.state.gridLayout.columnWidths[U.id]?B.state.gridLayout.columnWidths[U.id]+"px":(Q=B.state.columnResizing)!=null&&Q.isResizingColumn?B.state.gridLayout.startWidths[U.id]+"px":typeof U.width=="number"?U.width+"px":U.width}).join(" ")}}]},et=function(x,D){var B=D.column;return[x,{id:"header-cell-"+B.id,style:{position:"sticky",gridColumn:"span "+B.totalVisibleHeaderCount}}]},tr=function(x,D){var B=D.row;return B.isExpanded?[x,{style:{gridColumn:"1 / "+(B.cells.length+1)}}]:[x,{}]};function $r(x,D,B,U){if(D.type===u.init)return a({gridLayout:{columnWidths:{}}},x);if(D.type===u.resetResize)return a({},x,{gridLayout:{columnWidths:{}}});if(D.type===u.columnStartResizing){var Q=D.columnId,Y=D.headerIdWidths,ee=Mr(Q);if(ee!==void 0){var le=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=Mr(St.id),Xe))},{}),ce=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=St.minWidth,Xe))},{}),he=U.visibleColumns.reduce(function(De,St){var Xe;return a({},De,((Xe={})[St.id]=St.maxWidth,Xe))},{}),Le=Y.map(function(De){var St=De[0];return[St,Mr(St)]});return a({},x,{gridLayout:a({},x.gridLayout,{startWidths:le,minWidths:ce,maxWidths:he,headerIdGridWidths:Le,columnWidth:ee})})}return x}if(D.type===u.columnResizing){var $e=D.clientX,Ie=x.columnResizing.startX,xe=x.gridLayout,Ae=xe.columnWidth,je=xe.minWidths,Ve=xe.maxWidths,lt=xe.headerIdGridWidths,$t=($e-Ie)/Ae,at={};return(lt===void 0?[]:lt).forEach(function(De){var St=De[0],Xe=De[1];at[St]=Math.min(Math.max(je[St],Xe+Xe*$t),Ve[St])}),a({},x,{gridLayout:a({},x.gridLayout,{columnWidths:a({},x.gridLayout.columnWidths,{},at)})})}return D.type===u.columnDoneResizing?a({},x,{gridLayout:a({},x.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function Mr(x){var D,B=(D=document.getElementById("header-cell-"+x))==null?void 0:D.offsetWidth;if(B!==void 0)return B}n._UNSTABLE_usePivotColumns=Ds,n.actions=u,n.defaultColumn=h,n.defaultGroupByFn=dt,n.defaultOrderByFn=yf,n.defaultRenderer=d,n.emptyRenderer=p,n.ensurePluginOrder=w,n.flexRender=P,n.functionalUpdate=g,n.loopHooks=b,n.makePropGetter=y,n.makeRenderer=k,n.reduceHooks=v,n.safeUseLayoutEffect=C,n.useAbsoluteLayout=$u,n.useAsyncDebounce=function(x,D){D===void 0&&(D=0);var B=r.useRef({}),U=S(x),Q=S(D);return r.useCallback(function(){var Y=i(regeneratorRuntime.mark(function ee(){var le,ce,he,Le=arguments;return regeneratorRuntime.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:for(le=Le.length,ce=new Array(le),he=0;he<le;he++)ce[he]=Le[he];return B.current.promise||(B.current.promise=new Promise(function(Ie,xe){B.current.resolve=Ie,B.current.reject=xe})),B.current.timeout&&clearTimeout(B.current.timeout),B.current.timeout=setTimeout(i(regeneratorRuntime.mark(function Ie(){return regeneratorRuntime.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return delete B.current.timeout,xe.prev=1,xe.t0=B.current,xe.next=5,U().apply(void 0,ce);case 5:xe.t1=xe.sent,xe.t0.resolve.call(xe.t0,xe.t1),xe.next=12;break;case 9:xe.prev=9,xe.t2=xe.catch(1),B.current.reject(xe.t2);case 12:return xe.prev=12,delete B.current.promise,xe.finish(12);case 15:case"end":return xe.stop()}},Ie,null,[[1,9,12,15]])})),Q()),$e.abrupt("return",B.current.promise);case 5:case"end":return $e.stop()}},ee)}));return function(){return Y.apply(this,arguments)}}(),[U,Q])},n.useBlockLayout=Tf,n.useColumnOrder=Ef,n.useExpanded=H,n.useFilters=ui,n.useFlexLayout=Bs,n.useGetLatest=S,n.useGlobalFilter=Oo,n.useGridLayout=ie,n.useGroupBy=$n,n.useMountedLayoutEffect=R,n.usePagination=bf,n.useResizeColumns=Pu,n.useRowSelect=xf,n.useRowState=Ru,n.useSortBy=xt,n.useTable=function(x){for(var D=arguments.length,B=new Array(D>1?D-1:0),U=1;U<D;U++)B[U-1]=arguments[U];x=_e(x),B=[ut].concat(B);var Q=r.useRef({}),Y=S(Q.current);Object.assign(Y(),a({},x,{plugins:B,hooks:Me()})),B.filter(Boolean).forEach(function(gt){gt(Y().hooks)});var ee=S(Y().hooks);Y().getHooks=ee,delete Y().hooks,Object.assign(Y(),v(ee().useOptions,_e(x)));var le=Y(),ce=le.data,he=le.columns,Le=le.initialState,$e=le.defaultColumn,Ie=le.getSubRows,xe=le.getRowId,Ae=le.stateReducer,je=le.useControlledState,Ve=S(Ae),lt=r.useCallback(function(gt,Dn){if(!Dn.type)throw console.info({action:Dn}),new Error("Unknown Action 👆");return[].concat(ee().stateReducers,Array.isArray(Ve())?Ve():[Ve()]).reduce(function(nr,Yr){return Yr(nr,Dn,gt,Y())||nr},gt)},[ee,Ve,Y]),$t=r.useReducer(lt,void 0,function(){return lt(Le,{type:u.init})}),at=$t[0],De=$t[1],St=v([].concat(ee().useControlledState,[je]),at,{instance:Y()});Object.assign(Y(),{state:St,dispatch:De});var Xe=r.useMemo(function(){return O(v(ee().columns,he,{instance:Y()}))},[ee,Y,he].concat(v(ee().columnsDeps,[],{instance:Y()})));Y().columns=Xe;var yt=r.useMemo(function(){return v(ee().allColumns,L(Xe),{instance:Y()}).map(I)},[Xe,ee,Y].concat(v(ee().allColumnsDeps,[],{instance:Y()})));Y().allColumns=yt;var Bt=r.useMemo(function(){for(var gt=[],Dn=[],nr={},Yr=[].concat(yt);Yr.length;){var yr=Yr.shift();ze({data:ce,rows:gt,flatRows:Dn,rowsById:nr,column:yr,getRowId:xe,getSubRows:Ie,accessValueHooks:ee().accessValue,getInstance:Y})}return[gt,Dn,nr]},[yt,ce,xe,Ie,ee,Y]),mt=Bt[0],vt=Bt[1],Yt=Bt[2];Object.assign(Y(),{rows:mt,initialRows:[].concat(mt),flatRows:vt,rowsById:Yt}),b(ee().useInstanceAfterData,Y());var bt=r.useMemo(function(){return v(ee().visibleColumns,yt,{instance:Y()}).map(function(gt){return A(gt,$e)})},[ee,yt,Y,$e].concat(v(ee().visibleColumnsDeps,[],{instance:Y()})));yt=r.useMemo(function(){var gt=[].concat(bt);return yt.forEach(function(Dn){gt.find(function(nr){return nr.id===Dn.id})||gt.push(Dn)}),gt},[yt,bt]),Y().allColumns=yt;var Gt=r.useMemo(function(){return v(ee().headerGroups,M(bt,$e),Y())},[ee,bt,$e,Y].concat(v(ee().headerGroupsDeps,[],{instance:Y()})));Y().headerGroups=Gt;var Ut=r.useMemo(function(){return Gt.length?Gt[0].headers:[]},[Gt]);Y().headers=Ut,Y().flatHeaders=Gt.reduce(function(gt,Dn){return[].concat(gt,Dn.headers)},[]),b(ee().useInstanceBeforeDimensions,Y());var vn=bt.filter(function(gt){return gt.isVisible}).map(function(gt){return gt.id}).sort().join("_");bt=r.useMemo(function(){return bt.filter(function(gt){return gt.isVisible})},[bt,vn]),Y().visibleColumns=bt;var ct=Be(Ut),zt=ct[0],Hn=ct[1],qr=ct[2];return Y().totalColumnsMinWidth=zt,Y().totalColumnsWidth=Hn,Y().totalColumnsMaxWidth=qr,b(ee().useInstance,Y()),[].concat(Y().flatHeaders,Y().allColumns).forEach(function(gt){gt.render=k(Y(),gt),gt.getHeaderProps=y(ee().getHeaderProps,{instance:Y(),column:gt}),gt.getFooterProps=y(ee().getFooterProps,{instance:Y(),column:gt})}),Y().headerGroups=r.useMemo(function(){return Gt.filter(function(gt,Dn){return gt.headers=gt.headers.filter(function(nr){return nr.headers?function Yr(yr){return yr.filter(function(Wa){return Wa.headers?Yr(Wa.headers):Wa.isVisible}).length}(nr.headers):nr.isVisible}),!!gt.headers.length&&(gt.getHeaderGroupProps=y(ee().getHeaderGroupProps,{instance:Y(),headerGroup:gt,index:Dn}),gt.getFooterGroupProps=y(ee().getFooterGroupProps,{instance:Y(),headerGroup:gt,index:Dn}),!0)})},[Gt,Y,ee]),Y().footerGroups=[].concat(Y().headerGroups).reverse(),Y().prepareRow=r.useCallback(function(gt){gt.getRowProps=y(ee().getRowProps,{instance:Y(),row:gt}),gt.allCells=yt.map(function(Dn){var nr=gt.values[Dn.id],Yr={column:Dn,row:gt,value:nr};return Yr.getCellProps=y(ee().getCellProps,{instance:Y(),cell:Yr}),Yr.render=k(Y(),Dn,{row:gt,cell:Yr,value:nr}),Yr}),gt.cells=bt.map(function(Dn){return gt.allCells.find(function(nr){return nr.column.id===Dn.id})}),b(ee().prepareRow,gt,{instance:Y()})},[ee,Y,yt,bt]),Y().getTableProps=y(ee().getTableProps,{instance:Y()}),Y().getTableBodyProps=y(ee().getTableBodyProps,{instance:Y()}),b(ee().useFinalInstance,Y()),Y()},Object.defineProperty(n,"__esModule",{value:!0})})})(Ioe,Wm);(function(e){e.exports=Wm})($oe);const Aoe=()=>{throw new Error("setAnnouncement called outside AnnouncerContext")},cC=jt.createContext({setAnnouncement:Aoe}),Ooe=E(G4,{shouldForwardProp:e=>e!=="isFlex"&&e!=="isSortable"&&e!=="isFlexGrow"})(({theme:e,isFlex:t,isSortable:n,isFlexGrow:r})=>({position:"relative",fontWeight:e.typography.fontWeightRegular,...t&&{justifyContent:"stretch",alignItems:"center",display:"flex",flexShrink:0,"& > *":{flexGrow:1}},...n&&{padding:0,"&:hover, &:focus":{backgroundColor:e.palette.tableHeaderHover,"& svg":{color:"inherit"}}},...r&&{flexGrow:1}})),Loe=E("button",{shouldForwardProp:e=>e!=="isSorted"})(({theme:e,isSorted:t})=>({all:"unset",whiteSpace:"nowrap",width:"100%",position:"relative",zIndex:1,":hover, :focus, &:focus-visible, &:active":{outline:"revert",".hover-only":{display:"inline-block"}},display:"flex",boxSizing:"inherit",cursor:"pointer",...t&&{fontWeight:e.typography.fontWeightBold}})),Doe=E("span")(({theme:e})=>({display:"flex",flexDirection:"column",flexShrink:1,minWidth:0,"::after":{fontWeight:"bold",display:"inline-block",height:0,content:"attr(data-text)",visibility:"hidden",overflow:"hidden"}})),Noe=E("span")(({theme:e})=>({padding:e.spacing(2),visibility:"hidden",display:"flex",alignItems:"center",width:"100%"})),Moe=E("span")(({theme:e})=>({padding:e.spacing(2),position:"absolute",display:"flex",alignItems:"center",width:"100%",height:"100%",".hover-only":{display:"none"},"& > span":{minWidth:0,whiteSpace:"nowrap",textOverflow:"ellipsis",overflowX:"hidden",overflowY:"visible"}}));var Yb={},Boe={get exports(){return Yb},set exports(e){Yb=e}};/*!
|
|
279
279
|
Copyright (c) 2018 Jed Watson.
|
|
280
280
|
Licensed under the MIT License (MIT), see
|
|
281
281
|
http://jedwatson.github.io/classnames
|
|
@@ -287,8 +287,8 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
287
287
|
*
|
|
288
288
|
* This source code is licensed under the MIT license found in the
|
|
289
289
|
* LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/var Ov=f,Goe=Fm;function qoe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yoe=typeof Object.is=="function"?Object.is:qoe,Koe=Goe.useSyncExternalStore,Xoe=Ov.useRef,Joe=Ov.useEffect,Qoe=Ov.useMemo,Zoe=Ov.useDebugValue;Y3.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Xoe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Qoe(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),o!==void 0&&a.hasValue){var y=a.value;if(o(y,m))return p=y}return p=m}if(y=p,Yoe(d,m))return y;var v=r(m);return o!==void 0&&o(y,v)?y:(d=m,p=v)}var u=!1,d,p,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,o]);var l=Koe(e,i[0],i[1]);return Joe(function(){a.hasValue=!0,a.value=l},[l]),Zoe(l),l};(function(e){e.exports=Y3})(Voe);const eie=ag(Kb),{useSyncExternalStoreWithSelector:tie}=eie;function nie(e,t=e.getState,n){const r=tie(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return f.useDebugValue(r),r}const rR=e=>{const t=typeof e=="function"?Hoe(e):e,n=(r,o)=>nie(t,r,o);return Object.assign(n,t),n},rie=e=>e?rR(e):rR;var oie=rie;const iie=e=>{const t=oie(()=>e),n=(r,o)=>{t.setState(i=>{return{[r]:(a=i[r],l=o,typeof l=="function"?l(a):l)};var a,l})};return{useGlobalState:r=>{const o=f.useCallback(i=>i[r],[r]);return[t(o),f.useCallback(i=>n(r,i),[r])]},getGlobalState:r=>t.getState()[r],setGlobalState:n,subscribe:(r,o)=>{t.subscribe((i,a)=>{i[r]!==a[r]&&o(i[r])})}}},pC=(e,t)=>{const n=iie({[e]:vp(e)??t}),r=o=>{const i=n.getGlobalState(e),a=o instanceof Function?o(i):o;n.setGlobalState(e,a),Uc(e,a)};return()=>[n.useGlobalState(e)[0],r]},la=()=>{const[e,t]=sie();return{locationSettings:e,setLocationSettings:t}},aie=()=>({locale:navigator.language}),sie=pC(`${Ba}:useLocationSettings:v1`,aie()),fC=(e,t)=>new Date(e).toLocaleString(t,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),Vc=(e,t)=>new Date(e).toLocaleString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),D5e=(e,t)=>new Date(e).toLocaleString(t,{hour:"2-digit",minute:"2-digit"});function xs(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function lie(e,t){jn(2,arguments);var n=sr(e).getTime(),r=xs(t);return new Date(n+r)}var cie={};function df(){return cie}function uie(e,t){jn(2,arguments);var n=sr(e),r=sr(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}var K3=6e4,X3=36e5,N5e=1e3;function Kh(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kh=function(n){return typeof n}:Kh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kh(e)}function die(e){return jn(1,arguments),e instanceof Date||Kh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hC(e){if(jn(1,arguments),!die(e)&&typeof e!="number")return!1;var t=sr(e);return!isNaN(Number(t))}function pie(e,t){jn(2,arguments);var n=xs(t);return lie(e,-n)}var fie=864e5;function hie(e){jn(1,arguments);var t=sr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/fie)+1}function Hm(e){jn(1,arguments);var t=1,n=sr(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function J3(e){jn(1,arguments);var t=sr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Hm(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=Hm(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function mie(e){jn(1,arguments);var t=J3(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Hm(n);return r}var gie=6048e5;function vie(e){jn(1,arguments);var t=sr(e),n=Hm(t).getTime()-mie(t).getTime();return Math.round(n/gie)+1}function Vm(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=df(),p=xs((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=sr(e),m=h.getUTCDay(),y=(m<p?7:0)+m-p;return h.setUTCDate(h.getUTCDate()-y),h.setUTCHours(0,0,0,0),h}function Q3(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=sr(e),p=d.getUTCFullYear(),h=df(),m=xs((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(p+1,0,m),y.setUTCHours(0,0,0,0);var v=Vm(y,t),b=new Date(0);b.setUTCFullYear(p,0,m),b.setUTCHours(0,0,0,0);var w=Vm(b,t);return d.getTime()>=v.getTime()?p+1:d.getTime()>=w.getTime()?p:p-1}function yie(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=df(),p=xs((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),h=Q3(e,t),m=new Date(0);m.setUTCFullYear(h,0,p),m.setUTCHours(0,0,0,0);var y=Vm(m,t);return y}var bie=6048e5;function wie(e,t){jn(1,arguments);var n=sr(e),r=Vm(n,t).getTime()-yie(n,t).getTime();return Math.round(r/bie)+1}function dn(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Sie={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return dn(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):dn(r+1,2)},d:function(t,n){return dn(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return dn(t.getUTCHours()%12||12,n.length)},H:function(t,n){return dn(t.getUTCHours(),n.length)},m:function(t,n){return dn(t.getUTCMinutes(),n.length)},s:function(t,n){return dn(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return dn(i,n.length)}};const Va=Sie;var Yl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xie={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Va.y(t,n)},Y:function(t,n,r,o){var i=Q3(t,o),a=i>0?i:1-i;if(n==="YY"){var l=a%100;return dn(l,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):dn(a,n.length)},R:function(t,n){var r=J3(t);return dn(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return dn(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return dn(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return dn(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Va.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return dn(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=wie(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):dn(i,n.length)},I:function(t,n,r){var o=vie(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):dn(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Va.d(t,n)},D:function(t,n,r){var o=hie(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):dn(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return dn(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return dn(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return dn(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Yl.noon:o===0?i=Yl.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Yl.evening:o>=12?i=Yl.afternoon:o>=4?i=Yl.morning:i=Yl.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Va.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Va.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):dn(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):dn(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Va.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Va.s(t,n)},S:function(t,n){return Va.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return iR(a);case"XXXX":case"XX":return Gs(a);case"XXXXX":case"XXX":default:return Gs(a,":")}},x:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"x":return iR(a);case"xxxx":case"xx":return Gs(a);case"xxxxx":case"xxx":default:return Gs(a,":")}},O:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+oR(a,":");case"OOOO":default:return"GMT"+Gs(a,":")}},z:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+oR(a,":");case"zzzz":default:return"GMT"+Gs(a,":")}},t:function(t,n,r,o){var i=o._originalDate||t,a=Math.floor(i.getTime()/1e3);return dn(a,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,a=i.getTime();return dn(a,n.length)}};function oR(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var a=t||"";return n+String(o)+a+dn(i,2)}function iR(e,t){if(e%60===0){var n=e>0?"-":"+";return n+dn(Math.abs(e)/60,2)}return Gs(e,t)}function Gs(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=dn(Math.floor(o/60),2),a=dn(o%60,2);return r+i+n+a}const Cie=xie;var aR=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Z3=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Eie=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return aR(t,n);var a;switch(o){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",aR(o,n)).replace("{{time}}",Z3(i,n))},kie={p:Z3,P:Eie};const Tie=kie;var _ie=["D","DD"],Rie=["YY","YYYY"];function Pie(e){return _ie.indexOf(e)!==-1}function $ie(e){return Rie.indexOf(e)!==-1}function sR(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Iie={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Aie=function(t,n,r){var o,i=Iie[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Oie=Aie;function L1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Lie={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Die={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mie={date:L1({formats:Lie,defaultWidth:"full"}),time:L1({formats:Die,defaultWidth:"full"}),dateTime:L1({formats:Nie,defaultWidth:"full"})};const Bie=Mie;var Fie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zie=function(t,n,r,o){return Fie[t]};const jie=zie;function Qu(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}var Uie={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wie={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hie={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Vie={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gie={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qie={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yie=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Kie={ordinalNumber:Yie,era:Qu({values:Uie,defaultWidth:"wide"}),quarter:Qu({values:Wie,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Qu({values:Hie,defaultWidth:"wide"}),day:Qu({values:Vie,defaultWidth:"wide"}),dayPeriod:Qu({values:Gie,defaultWidth:"wide",formattingValues:qie,defaultFormattingWidth:"wide"})};const Xie=Kie;function Zu(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Qie(l,function(p){return p.test(a)}):Jie(l,function(p){return p.test(a)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(a.length);return{value:u,rest:d}}}function Jie(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Qie(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function Zie(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;var l=t.slice(o.length);return{value:a,rest:l}}}var eae=/^(\d+)(th|st|nd|rd)?/i,tae=/\d+/i,nae={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},rae={any:[/^b/i,/^(a|c)/i]},oae={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iae={any:[/1/i,/2/i,/3/i,/4/i]},aae={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sae={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lae={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cae={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uae={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dae={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pae={ordinalNumber:Zie({matchPattern:eae,parsePattern:tae,valueCallback:function(t){return parseInt(t,10)}}),era:Zu({matchPatterns:nae,defaultMatchWidth:"wide",parsePatterns:rae,defaultParseWidth:"any"}),quarter:Zu({matchPatterns:oae,defaultMatchWidth:"wide",parsePatterns:iae,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Zu({matchPatterns:aae,defaultMatchWidth:"wide",parsePatterns:sae,defaultParseWidth:"any"}),day:Zu({matchPatterns:lae,defaultMatchWidth:"wide",parsePatterns:cae,defaultParseWidth:"any"}),dayPeriod:Zu({matchPatterns:uae,defaultMatchWidth:"any",parsePatterns:dae,defaultParseWidth:"any"})};const fae=pae;var hae={code:"en-US",formatDistance:Oie,formatLong:Bie,formatRelative:jie,localize:Xie,match:fae,options:{weekStartsOn:0,firstWeekContainsDate:1}};const eO=hae;var mae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vae=/^'([^]*?)'?$/,yae=/''/g,bae=/[a-zA-Z]/;function Cp(e,t,n){var r,o,i,a,l,c,u,d,p,h,m,y,v,b,w,g,S,C;jn(2,arguments);var R=String(t),k=df(),P=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:k.locale)!==null&&r!==void 0?r:eO,O=xs((i=(a=(l=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(u=n.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:k.firstWeekContainsDate)!==null&&a!==void 0?a:(p=k.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=xs((m=(y=(v=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(w=n.locale)===null||w===void 0||(g=w.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&v!==void 0?v:k.weekStartsOn)!==null&&y!==void 0?y:(S=k.locale)===null||S===void 0||(C=S.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&m!==void 0?m:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var I=sr(e);if(!hC(I))throw new RangeError("Invalid time value");var A=wp(I),M=pie(I,A),F={firstWeekContainsDate:O,weekStartsOn:L,locale:P,_originalDate:I},j=R.match(gae).map(function(q){var G=q[0];if(G==="p"||G==="P"){var Z=Tie[G];return Z(q,P.formatLong)}return q}).join("").match(mae).map(function(q){if(q==="''")return"'";var G=q[0];if(G==="'")return wae(q);var Z=Cie[G];if(Z)return!(n!=null&&n.useAdditionalWeekYearTokens)&&$ie(q)&&sR(q,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Pie(q)&&sR(q,t,String(e)),Z(M,q,P.localize,F);if(G.match(bae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+G+"`");return q}).join("");return j}function wae(e){var t=e.match(vae);return t?t[1].replace(yae,"'"):e}function tO(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Sae(e){return tO({},e)}var lR=1e3*60,Gm=60*24,cR=Gm*30,uR=Gm*365;function xae(e,t,n){var r,o,i;jn(2,arguments);var a=df(),l=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:a.locale)!==null&&r!==void 0?r:eO;if(!l.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var c=uie(e,t);if(isNaN(c))throw new RangeError("Invalid time value");var u=tO(Sae(n),{addSuffix:Boolean(n==null?void 0:n.addSuffix),comparison:c}),d,p;c>0?(d=sr(t),p=sr(e)):(d=sr(e),p=sr(t));var h=String((i=n==null?void 0:n.roundingMethod)!==null&&i!==void 0?i:"round"),m;if(h==="floor")m=Math.floor;else if(h==="ceil")m=Math.ceil;else if(h==="round")m=Math.round;else throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");var y=p.getTime()-d.getTime(),v=y/lR,b=wp(p)-wp(d),w=(y-b)/lR,g=n==null?void 0:n.unit,S;if(g?S=String(g):v<1?S="second":v<60?S="minute":v<Gm?S="hour":w<cR?S="day":w<uR?S="month":S="year",S==="second"){var C=m(y/1e3);return l.formatDistance("xSeconds",C,u)}else if(S==="minute"){var R=m(v);return l.formatDistance("xMinutes",R,u)}else if(S==="hour"){var k=m(v/60);return l.formatDistance("xHours",k,u)}else if(S==="day"){var P=m(w/Gm);return l.formatDistance("xDays",P,u)}else if(S==="month"){var O=m(w/cR);return O===12&&g!=="month"?l.formatDistance("xYears",1,u):l.formatDistance("xMonths",O,u)}else if(S==="year"){var L=m(w/uR);return l.formatDistance("xYears",L,u)}throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'")}function Cae(e,t){return jn(1,arguments),xae(e,Date.now(),t)}function Eae(e){return jn(1,arguments),sr(e).getTime()<Date.now()}function pf(e,t){var n;jn(1,arguments);var r=xs((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=Rae(e),i;if(o.date){var a=Pae(o.date,r);i=$ae(a.restDateString,a.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var l=i.getTime(),c=0,u;if(o.time&&(c=Iae(o.time),isNaN(c)))return new Date(NaN);if(o.timezone){if(u=Aae(o.timezone),isNaN(u))return new Date(NaN)}else{var d=new Date(l+c),p=new Date(0);return p.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),p.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),p}return new Date(l+c+u)}var uh={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},kae=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_ae=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Rae(e){var t={},n=e.split(uh.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],uh.timeZoneDelimiter.test(t.date)&&(t.date=e.split(uh.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var o=uh.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function Pae(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function $ae(e,t){if(t===null)return new Date(NaN);var n=e.match(kae);if(!n)return new Date(NaN);var r=!!n[4],o=ed(n[1]),i=ed(n[2])-1,a=ed(n[3]),l=ed(n[4]),c=ed(n[5])-1;if(r)return Mae(t,l,c)?Oae(t,l,c):new Date(NaN);var u=new Date(0);return!Dae(t,i,a)||!Nae(t,o)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(o,a)),u)}function ed(e){return e?parseInt(e):1}function Iae(e){var t=e.match(Tae);if(!t)return NaN;var n=D1(t[1]),r=D1(t[2]),o=D1(t[3]);return Bae(n,r,o)?n*X3+r*K3+o*1e3:NaN}function D1(e){return e&&parseFloat(e.replace(",","."))||0}function Aae(e){if(e==="Z")return 0;var t=e.match(_ae);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return Fae(r,o)?n*(r*X3+o*K3):NaN}function Oae(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var Lae=[31,null,31,30,31,30,31,31,30,31,30,31];function nO(e){return e%400===0||e%4===0&&e%100!==0}function Dae(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Lae[t]||(nO(e)?29:28))}function Nae(e,t){return t>=1&&t<=(nO(e)?366:365)}function Mae(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Bae(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Fae(e,t){return t>=0&&t<=59}const zae=E(Je,{shouldForwardProp:e=>e!=="lineClamp"})(({theme:e,lineClamp:t})=>({padding:e.spacing(1,2),display:"-webkit-box",overflow:t?"hidden":"auto",WebkitLineClamp:t||"none",WebkitBoxOrient:"vertical",wordBreak:"break-all",[e.breakpoints.down("sm")]:{wordBreak:"normal"}})),fo=({value:e,children:t,lineClamp:n,sx:r,"data-testid":o})=>s(zae,{lineClamp:n,sx:r,children:s("span",{"data-loading":"true","data-testid":o,children:t??e})}),Ep=({value:e})=>{const{locationSettings:t}=la(),n=e?e instanceof Date?Vc(e,t.locale):Vc(pf(e),t.locale):void 0;return s(fo,{lineClamp:1,children:n})};function mC(e,t){return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t)}const jae=E("span")(({theme:e})=>({"&>mark":{backgroundColor:e.palette.highlight}})),Gc=({search:e,children:t,caseSensitive:n})=>{if(!t)return null;if(!e)return s(Re,{children:t});const r=mC(e,n?"g":"gi");return s(jae,{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.replaceAll(r,"<mark>$&</mark>"))||""}})},rO=e=>({paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"flex",alignItems:"center",minHeight:"62px"}),Uae=E("div")(({theme:e})=>rO(e)),dR=E(po)(({theme:e})=>({...rO(e),"&:hover, &:focus":{textDecoration:"none","& > div > span:first-of-type":{textDecoration:"underline"}}})),Wae=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",wordBreak:"break-all"})),Hae=E("span")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical"})),Vae=E("span")(({theme:e})=>({color:e.palette.text.secondary,textDecoration:"none",fontSize:"inherit",WebkitLineClamp:1,lineClamp:1,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical"})),Os=({title:e,to:t,onClick:n,subtitle:r,children:o})=>{const{searchQuery:i}=uf(),a=T(Wae,{children:[T(Hae,{"data-loading":!0,style:{WebkitLineClamp:Boolean(r)?1:2,lineClamp:Boolean(r)?1:2},children:[s(Gc,{search:i,children:e}),o]}),s(X,{condition:Boolean(r),show:s(Re,{children:s(Vae,{"data-loading":!0,children:s(Gc,{search:i,children:r})})})})]});return t?s(dR,{component:on,to:t,underline:"hover",children:a}):n?s(dR,{onClick:n,underline:"hover",children:a}):s(Uae,{children:a})};function dh(e){const t=new Date(e);if(!Number.isNaN(t.valueOf()))return t;const n=String(e).match(/\d+/g);if(n==null||n.length<=2)return t;{const[r,o,...i]=n.map(c=>parseInt(c)),a=[r,o-1,...i];return new Date(Date.UTC(...a))}}function pR(e,t,n){const r=e!==1?t+"s":t;return e+" "+r+" "+n}function Xb(){return Xb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xb.apply(this,arguments)}const yd=60,bd=yd*60,kc=bd*24,ph=kc*7,fR=kc*30,hR=kc*365;function gC({date:e,formatter:t=pR,component:n="time",live:r=!0,minPeriod:o=0,maxPeriod:i=ph,title:a,now:l=()=>Date.now(),...c}){const[u,d]=f.useState(l());f.useEffect(()=>{if(!r)return;const R=(()=>{const k=dh(e).valueOf();if(!k)return console.warn("[react-timeago] Invalid Date provided"),0;const P=Math.round(Math.abs(u-k)/1e3),O=P<yd?1e3:P<bd?1e3*yd:P<kc?1e3*bd:1e3*ph,L=Math.min(Math.max(O,o*1e3),i*1e3);return L?setTimeout(()=>{d(l())},L):0})();return()=>{R&&clearTimeout(R)}},[e,r,i,o,l,u]);const p=n,h=dh(e).valueOf();if(!h)return null;const m=Math.round(Math.abs(u-h)/1e3),y=h<u?"ago":"from now",[v,b]=m<yd?[Math.round(m),"second"]:m<bd?[Math.round(m/yd),"minute"]:m<kc?[Math.round(m/bd),"hour"]:m<ph?[Math.round(m/kc),"day"]:m<fR?[Math.round(m/ph),"week"]:m<hR?[Math.round(m/fR),"month"]:[Math.round(m/hR),"year"],w=typeof a>"u"?typeof e=="string"?e:dh(e).toISOString().substr(0,16).replace("T"," "):a,g=p==="time"?{...c,dateTime:dh(e).toISOString()}:c,S=pR.bind(null,v,b,y);return f.createElement(p,Xb({},g,{title:w}),t(v,b,y,h,S,l))}function Gae(e){switch(e){case"second":return"s";case"minute":return"m";case"hour":return"h";case"day":return"D";case"week":return"W";case"month":return"M";case"year":return"Y";default:return""}}const qae=()=>{const e=sn();return t=>{switch(t){case"second":return e.palette.activityIndicators.recent;case"minute":return e.palette.activityIndicators.recent;case"hour":return e.palette.activityIndicators.recent;case"day":return e.palette.activityIndicators.recent;case"week":return e.palette.activityIndicators.inactive;case"month":return e.palette.activityIndicators.abandoned;case"year":return e.palette.activityIndicators.abandoned;default:return e.palette.activityIndicators.unknown}}},Yae=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1.5)})),Kae=E("div")(({theme:e})=>({width:"38px",height:"38px",background:e.palette.background.paper,borderRadius:`${e.shape.borderRadius}px`,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",fontSize:e.typography.body2.fontSize,margin:"0 auto"})),mR=({unit:e,tooltip:t,children:n})=>{const r=qae();return s(Yae,{children:s(Tt,{title:t,arrow:!0,describeChild:!0,children:s(Kae,{style:{background:r(e)},"data-loading":!0,children:n})})})},oO=({value:e})=>s(X,{condition:Boolean(e),show:s(gC,{date:e,title:"",live:!1,formatter:(t,n,r)=>T(mR,{tooltip:`Last usage reported ${t} ${n}${t!==1?"s":""} ${r}`,unit:n,children:[t,Gae(n)]})}),elseShow:s(mR,{tooltip:"No usage reported from connected applications",children:"–"})}),Xae="experiment",Jae="release",Qae="operational",Zae="kill-switch",ese="permission";var vC={},tse=fn;Object.defineProperty(vC,"__esModule",{value:!0});var Jb=vC.default=void 0,nse=tse(En()),rse=kn,ose=(0,nse.default)((0,rse.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Loop");Jb=vC.default=ose;var yC={},ise=fn;Object.defineProperty(yC,"__esModule",{value:!0});var iO=yC.default=void 0,ase=ise(En()),sse=kn,lse=(0,ase.default)((0,sse.jsx)("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"}),"Timeline");iO=yC.default=lse;var bC={},cse=fn;Object.defineProperty(bC,"__esModule",{value:!0});var wC=bC.default=void 0,use=cse(En()),dse=kn,pse=(0,use.default)((0,dse.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNew");wC=bC.default=pse;var SC={},fse=fn;Object.defineProperty(SC,"__esModule",{value:!0});var aO=SC.default=void 0,hse=fse(En()),mse=kn,gse=(0,hse.default)((0,mse.jsx)("path",{d:"M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"}),"PanTool");aO=SC.default=gse;var xC={},vse=fn;Object.defineProperty(xC,"__esModule",{value:!0});var sO=xC.default=void 0,yse=vse(En()),bse=kn,wse=(0,yse.default)((0,bse.jsx)("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"}),"Build");sO=xC.default=wse;const Sse=e=>{switch(e){case Jae:return Jb;case Xae:return iO;case Zae:return wC;case Qae:return sO;case ese:return aO;default:return Jb}},CC=(e={})=>{const t=async()=>{const c=Ft("api/admin/feature-types");return(await fetch(c,{method:"GET"}).then(Cn("Feature types"))).json()},n="api/admin/feature-types",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{featureTypes:(r==null?void 0:r.types)||[],error:o,loading:i,refetch:l}},xse=E("div")(({theme:e})=>({padding:e.spacing(1.5),display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),lO=({value:e})=>{const{featureTypes:t}=CC(),n=Sse(e),o=`This is a "${t.filter(i=>i.id===e).map(i=>i.name)||e}" toggle`;return s(xse,{children:s(Tt,{arrow:!0,title:o,describeChild:!0,children:s(n,{"data-loading":!0})})})},Cse=({row:e})=>s(Os,{title:e.original.name,subtitle:e.original.description,to:`/projects/${e.original.project}/features/${e.original.name}`}),cO=e=>{const{setAnnouncement:t}=f.useContext(cC);f.useEffect(()=>{if(e)return document.title=e,()=>{document.title=gR}},[e]),f.useEffect(()=>{e&&e!==gR&&t(`Navigated to ${e}`)},[t,e])},gR="Unleash",Ese=E(uo)(({theme:e})=>({height:"100%",borderColor:e.palette.dividerAlternative,width:"1px",display:"inline-block",marginLeft:e.spacing(2),marginRight:e.spacing(2),padding:e.spacing(.5,0),verticalAlign:"middle"})),kse=E("div")(()=>({display:"flex",flexDirection:"column"})),Tse=E("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative"})),_se=E("div")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:e.spacing(2)})),Rse=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,fontWeight:"normal"})),Pse=E("div")(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-end",alignItems:"center",gap:e.spacing(1)})),uO=({title:e,titleElement:t,actions:n,subtitle:r,variant:o,loading:i,className:a="",secondary:l,children:c})=>{const u=yi({skeleton:i});return cO(l?"":e),T(kse,{children:[T(Tse,{children:[T(_se,{className:yi(u),"data-loading":!0,children:[s(Rse,{variant:o||l?"h2":"h1",className:yi(a),children:t||e}),r&&s("small",{children:r})]}),s(X,{condition:Boolean(n),show:s(Pse,{children:n})})]}),c]})},$se=({sx:e})=>s(Ese,{orientation:"vertical",variant:"middle",sx:e});uO.Divider=$se;const xn=uO,Ise=ai()(e=>({headerPadding:{padding:e.spacing(2,4)},bodyContainer:{padding:e.spacing(4),[e.breakpoints.down("md")]:{padding:e.spacing(2)},overflowX:"auto"},paddingDisabled:{padding:"0"},borderDisabled:{border:"none"}})),Lv=e=>{const t=f.createRef();return f.useLayoutEffect(()=>{t.current&&t.current.querySelectorAll("[data-loading]").forEach(r=>{e?r.classList.add("skeleton"):r.classList.remove("skeleton")})},[e,t]),t},Ase=E("div")(({theme:e})=>({borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:e.palette.divider,[e.breakpoints.down("md")]:{padding:e.spacing(3,2)}})),Ose=E(Tr)(({theme:e})=>({borderRadius:e.shape.borderRadiusLarge,boxShadow:"none"})),Lse=({children:e,isLoading:t})=>{const n=Lv(t);return s("div",{ref:n,"aria-busy":t,"aria-live":"polite",children:e})},gr=({children:e,header:t,disablePadding:n=!1,disableBorder:r=!1,bodyClass:o="",headerClass:i="",isLoading:a=!1,disableLoading:l=!1,className:c,...u})=>{const{classes:d}=Ise(),p=yi("header",i||d.headerPadding,{[d.paddingDisabled]:n,[d.borderDisabled]:r}),h=yi("body",o||d.bodyContainer,{[d.paddingDisabled]:n,[d.borderDisabled]:r}),y=T(Ose,{...u,...r?{elevation:0}:{},className:yi(c),children:[s(X,{condition:Boolean(t),show:s(Ase,{className:p,children:s(X,{condition:typeof t=="string",show:s(xn,{title:t}),elseShow:t})})}),s("div",{className:h,children:e})]});return l?y:s(Lse,{isLoading:a,children:y})},Dv=(e,t)=>{const n=`${Ba}:${e}:localStorage:v2`;return{value:(()=>{const i=vp(n);return i===void 0?t:i})(),setValue:i=>{if(i instanceof Function){const a=vp(n),l=i(a??t);return Uc(n,l),l}return Uc(n,i),i}}},ja=(e={})=>{const t=()=>{const c=Ft("api/admin/projects");return fetch(c,{method:"GET"}).then(Cn("Projects")).then(u=>u.json())},n="api/admin/projects",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{projects:(r==null?void 0:r.projects)||[],error:o,loading:i,refetch:l}},Xh="default",Dse=()=>{var n;const{projects:e=[]}=ja(),t=e.find(r=>r.id===Xh);return(t==null?void 0:t.id)||((n=e[0])==null?void 0:n.id)},qm=(e,t)=>`/projects/${e}/features/${t}`,Nse=(e,t)=>{const n=`/projects/${e}/create-toggle`;let r;return t&&(r=Object.keys(t).reduce((o,i)=>(o+=`${i}=${t[i]}`,o),"")),r?`${n}?${r}`:n},Mse=e=>`/projects/${e}/edit`,Bse=e=>{const t=Dse(),n=e.project==="*"||!e.project?t:e.project;if(n)return{path:Nse(n),projectId:n}},Fse=E("div")(({theme:e})=>({overflow:"auto",padding:e.spacing(1,1.5)})),zse=E(({className:e,maxWidth:t,maxHeight:n,fontSize:r,...o})=>s(Tt,{...o,title:s(Fse,{children:o.title}),classes:{popper:e}}),{shouldForwardProp:e=>e!=="maxWidth"&&e!=="maxHeight"&&e!=="fontSize"})(({theme:e,maxWidth:t=e.spacing(37.5),maxHeight:n=e.spacing(37.5),fontSize:r=e.fontSizes.smallerBody})=>({maxWidth:t,[`& .${ji.tooltip}`]:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:0,borderRadius:e.shape.borderRadiusMedium,boxShadow:e.shadows[2],color:e.palette.text.primary,fontWeight:e.fontWeight.medium,maxWidth:"inherit",border:`1px solid ${e.palette.lightBorder}`,maxHeight:n,fontSize:r},[`& .${ji.arrow}`]:{"&:before":{border:`1px solid ${e.palette.lightBorder}`},color:e.palette.background.paper}})),EC=e=>s(zse,{...e,children:e.children}),du=({title:e,children:t,variant:n="default",titleComponent:r,...o})=>!e&&!r?t:n==="custom"?s(EC,{...o,title:e||r,arrow:!0,children:t}):s(Tt,{...o,title:e||r,arrow:!0,children:t}),Qb="Access denied",Nv=(e,t)=>e?t:t?`${t} (${Qb})`:Qb,jse=()=>{throw new Error("hasAccess called outside AccessContext")},Qr=jt.createContext({isAdmin:!1,hasAccess:jse}),kC=(e,t,n,r,o={})=>{const i=gn(e?n:null,r,o);return{...i,error:e?i.error:void 0,data:e?i.data:t}},Use=e=>{const{isEnterprise:t}=Lt(),{data:n,error:r,mutate:o}=kC(Boolean(e)&&t(),[],Ft(`api/admin/projects/${e}/change-requests/config`),Wse);return{data:n||[],loading:!r&&!n,refetchChangeRequestConfig:o,error:r}},Wse=e=>fetch(e).then(Cn("Request changes")).then(t=>t.json()),ff=e=>{const{data:t}=Use(e),n=jt.useCallback(o=>t.some(i=>i.environment===o&&i.changeRequestEnabled),[JSON.stringify(t)]),r=jt.useCallback(()=>t.some(o=>o.changeRequestEnabled),[JSON.stringify(t)]);return{isChangeRequestConfigured:n,isChangeRequestConfiguredInAnyEnv:r}},TC=e=>{const{hasAccess:t}=f.useContext(Qr),n=(o,i,a)=>i&&a?t(o,i,a):i?t(o,i):t(o),r=(o,i,a)=>Array.isArray(o)?o.some(l=>n(l,i,a)):n(o,i,a);return(o,i)=>r(o,e,i)},M5e=e=>{const{isChangeRequestConfigured:t}=ff(e),n=TC(e);return(r,o)=>t(o)||n(r,o)},Hse=[G3,sC,koe,Toe],Vse=(e,t)=>e.filter(n=>t.includes(n)).length>0,qc=(e,t,n)=>{const{isChangeRequestConfigured:r}=ff(t),o=TC(t);return r(n)&&Vse(Hse,[].concat(e))||o(e,n)},_C=(e,t,n)=>TC(t)(e,n),Gse=jt.forwardRef((e,t)=>{const n=qc(e.permission,e.projectId,e.environmentId);return s(dO,{...e,access:n,ref:t})}),qse=jt.forwardRef((e,t)=>{const n=_C(e.permission,e.projectId,e.environmentId);return s(dO,{...e,access:n,ref:t})}),dO=jt.forwardRef(({permission:e,access:t,variant:n="contained",color:r="primary",onClick:o,children:i,disabled:a,projectId:l,environmentId:c,tooltipProps:u,...d},p)=>{const h=Ss();return s(du,{...u,title:Nv(t,u==null?void 0:u.title),arrow:!0,children:s("span",{id:h,children:s(rt,{ref:p,onClick:o,disabled:a||!t,"aria-labelledby":h,variant:n,color:r,...d,endIcon:s(Re,{children:s(X,{condition:!t,show:s(ute,{titleAccess:"Locked"}),elseShow:Boolean(d.endIcon)&&d.endIcon})}),children:i})})})}),Io=jt.forwardRef((e,t)=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Gse,{...e,environmentId:e.environmentId,projectId:e.projectId,ref:t}):s(qse,{...e,ref:t})),Yse=e=>{const t=_C(e.permission,e.projectId,e.environmentId);return s(pO,{...e,access:t})},Kse=e=>{const t=qc(e.permission,e.projectId,e.environmentId);return s(pO,{...e,access:t})},pO=({access:e,permission:t,projectId:n,children:r,environmentId:o,tooltipProps:i,disabled:a,...l})=>{const c=Ss();return s(du,{...i,title:Nv(e,i==null?void 0:i.title),arrow:!0,onClick:u=>u.preventDefault(),children:s("div",{id:c,children:s(Qt,{...l,disabled:!e||a,"aria-labelledby":c,size:"large",children:r})})})},mr=e=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Kse,{...e,projectId:e.projectId,environmentId:e.environmentId}):s(Yse,{...e}),Xse=({loading:e,filter:t})=>{const n=Er("(max-width:800px)"),r=Bse(t),o=ft();return r?s(X,{condition:n,show:s(mr,{permission:Sp,projectId:r.projectId,component:on,to:r.path,size:"large",tooltipProps:{title:"Create feature toggle"},children:s(Si,{})}),elseShow:s(Io,{onClick:()=>{o(r.path)},permission:Sp,projectId:r.projectId,color:"primary",variant:"contained","data-testid":Pte,className:yi({skeleton:e}),children:"New feature toggle"})}):null},Jse=e=>({color:e.palette.error.dark,fontSize:"inherit"}),Qse=e=>({color:e.palette.success.dark,fontSize:"inherit"}),Zse=E(Je)(({theme:e})=>({padding:e.spacing(1.5,2)})),fO=({value:e})=>s(Zse,{children:s(X,{condition:Boolean(e),show:s(ke,{component:"span",sx:Jse,"data-loading":!0,children:"Stale"}),elseShow:s(ke,{component:"span",sx:Qse,"data-loading":!0,children:"Active"})})}),RC=(e,t,n)=>{const r=hO(e),o=()=>({data:n,searchValue:t,columns:e});return t?{data:(()=>{const a=ele(e,t,n);return tle(e,r(t),a)})(),getSearchText:r,getSearchContext:o}:{data:n,getSearchText:r,getSearchContext:o}},ele=(e,t,n)=>{let r=n;return gO(e).filter(o=>mO(t,o.filterName)).forEach(o=>{const i=vO(o.filterName,t);r=r.filter(a=>o.filterBy?o.filterBy(a,i):nle(Ym(o,a),i))}),r},tle=(e,t,n)=>{const r=e.filter(o=>o.searchable&&o.accessor);return n.filter(o=>r.some(i=>i.searchBy?i.searchBy(o,t):rle(Ym(i,o),t)))},nle=(e,t)=>t.some(n=>(e==null?void 0:e.toLowerCase())===(n==null?void 0:n.toLowerCase())),rle=(e,t)=>e==null?void 0:e.toLowerCase().includes(t==null?void 0:t.toLowerCase()),hO=e=>{const t=e.filter(r=>r.filterName).map(r=>r.filterName),n=r=>t.some(o=>mO(r,o));return r=>r.split(" ").filter(o=>!n(o)).join(" ")},mO=(e,t)=>new RegExp(`${t}:\\w+`).test(e),gO=e=>e.filter(t=>t.filterName&&t.accessor),Ym=(e,t)=>{const n=typeof e.accessor=="function"?e.accessor(t):e.accessor.includes(".")?e.accessor.split(".").reduce((r,o)=>r==null?void 0:r[o],t):t[e.accessor];return e.filterParsing?e.filterParsing(n):n},vO=(e,t)=>{var n,r;return((r=(n=t==null?void 0:t.split(`${e}:`)[1])==null?void 0:n.split(" ")[0])==null?void 0:r.split(",").filter(o=>o))??[]},vR=E("span")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.primary})),yR=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),ole=({filters:e,getSearchContext:t,searchableColumnsString:n})=>{const r=t(),i=hO(r.columns)(r.searchValue),a=e.filter(l=>l.values.length>0);return T(Re,{children:[s(X,{condition:Boolean(i),show:T(Re,{children:[s(vR,{children:"Searching for:"}),T("p",{children:[s(yR,{children:i})," ",n?` in ${n}`:""]})]})}),s(X,{condition:a.length>0,show:T(Re,{children:[s(vR,{children:"Filtering by:"}),a.map(l=>T("p",{children:[s(yR,{children:l.values.join(",")})," ","in ",l.header,". Options:"," ",l.options.join(", ")]},l.name))]})})]})},ile=E("span")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.primary})),bR=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),ale=({filters:e,getSearchContext:t,searchableColumnsString:n})=>T(Re,{children:[s(ile,{children:e.length>0?"Filter your search with operators like:":`Start typing to search${n?` in ${n}`:"..."}`}),e.map(r=>T("p",{children:["Filter by ",r.header,":"," ",T(bR,{children:[r.name,":",r.options[0]]}),s(X,{condition:r.options.length>1,show:T(Re,{children:[" or ",T(bR,{children:[r.name,":",r.options.slice(0,2).join(",")]})]})})]},r.name))]}),sle=e=>Math.floor(Math.random()*e.length),lle=E(Tr)(({theme:e})=>({position:"absolute",width:"100%",left:0,top:"20px",zIndex:2,padding:e.spacing(4,1.5,1.5),borderBottomLeftRadius:e.spacing(1),borderBottomRightRadius:e.spacing(1),boxShadow:"0px 8px 20px rgba(33, 33, 33, 0.15)",fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary,wordBreak:"break-word"})),cle=E(Je)(({theme:e})=>({display:"flex",gap:e.spacing(2)})),ule=E(rte)(({theme:e})=>({color:e.palette.text.secondary})),dle=E(uo)(({theme:e})=>({border:`1px dashed ${e.palette.dividerAlternative}`,margin:e.spacing(1.5,0)})),ple=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),fle=({getSearchContext:e})=>{const t=e(),n=f.useMemo(()=>sle(t.data),[t.data]),r=gO(t.columns).map(l=>{const c=t.data.map(u=>Ym(l,u));return{name:l.filterName,header:l.Header??l.filterName,options:[...new Set(c)].sort((u,d)=>u.localeCompare(d)),suggestedOption:c[n]??`example-${l.filterName}`,values:vO(l.filterName,t.searchValue)}}).sort((l,c)=>l.name.localeCompare(c.name)),o=t.columns.filter(l=>l.searchable&&l.accessor),i=o.map(l=>l.Header??l.accessor).join(", "),a=t.data.length&&o.length?Ym(o[0],t.data[n]):"example-search-text";return T(lle,{children:[T(cle,{children:[s(ule,{}),s(Je,{children:s(X,{condition:Boolean(t.searchValue),show:s(ole,{filters:r,getSearchContext:e,searchableColumnsString:i}),elseShow:s(ale,{filters:r,getSearchContext:e,searchableColumnsString:i})})})]}),s(dle,{}),s(X,{condition:r.length>0,show:"Combine filters and search."}),T("p",{children:["Example:"," ",T(ple,{children:[r.map(l=>T("span",{children:[l.name,":",l.suggestedOption," "]},l.name)),s("span",{children:a})]})]})]})},hle=()=>{const[e,t]=f.useState();return f.useEffect(()=>{var r;const n=((r=navigator==null?void 0:navigator.userAgentData)==null?void 0:r.platform)||(navigator==null?void 0:navigator.platform)||"unknown";t(n.toLowerCase().includes("mac")||n==="iPhone"||n==="iPad")},[]),e},wR=({key:e,modifiers:t=[],preventDefault:n=!1},r)=>{const o=hle();f.useEffect(()=>{const l=c=>{if(e===c.key){if(t.includes("ctrl")){if(o){if(!c.metaKey)return}else if(!c.ctrlKey)return}t.includes("alt")&&!c.altKey||t.includes("shift")&&!c.shiftKey||(n&&c.preventDefault(),r())}};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[o,e,t,n,r]);const i=f.useMemo(()=>t.map(l=>({ctrl:o?"⌘":"Ctrl",alt:"Alt",shift:"Shift"})[l]),[o,t]);return f.useMemo(()=>[...i,`${e[0].toUpperCase()}${e.slice(1)}`].join("+"),[i,e])},mle=E("div")(({theme:e})=>({display:"flex",flexGrow:1,alignItems:"center",position:"relative",backgroundColor:e.palette.background.paper,maxWidth:"400px",[e.breakpoints.down("md")]:{marginTop:e.spacing(1),maxWidth:"100%"}})),gle=E("div")(({theme:e})=>({display:"flex",alignItems:"center",backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.neutral.border}`,borderRadius:e.shape.borderRadiusExtraLarge,padding:"3px 5px 3px 12px",width:"100%",zIndex:3,"&:focus-within":{borderColor:e.palette.primary.light,boxShadow:e.boxShadows.main}})),vle=E(dv)(({theme:e})=>({width:"100%"})),yle=E(vv)(({theme:e})=>({color:e.palette.neutral.main,fontSize:e.typography.body1.fontSize})),go=({initialValue:e="",onChange:t,className:n,placeholder:r,hasFilters:o,disabled:i,getSearchContext:a,containerStyles:l,debounceTime:c=200})=>{const u=f.useRef(),[d,p]=f.useState(!1),[h,m]=f.useState(e),y=tn.useAsyncDebounce(t,c),v=g=>{y(g),m(g)},b=wR({modifiers:["ctrl"],key:"k",preventDefault:!0},()=>{var g,S;document.activeElement===u.current?(g=u.current)==null||g.blur():(S=u.current)==null||S.focus()});wR({key:"Escape"},()=>{var g;document.activeElement===u.current&&((g=u.current)==null||g.blur())});const w=`${r??"Search"} (${b})`;return T(mle,{style:l,children:[T(gle,{className:n,children:[s(Fx,{sx:{mr:1,color:g=>g.palette.inactiveIcon}}),s(vle,{inputRef:u,placeholder:w,inputProps:{"aria-label":w},value:h,onChange:g=>v(g.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:i}),s(Je,{sx:{width:g=>g.spacing(4)},children:s(X,{condition:Boolean(h),show:s(Tt,{title:"Clear search query",arrow:!0,children:s(Qt,{size:"small",onClick:()=>{var g;v(""),(g=u.current)==null||g.focus()},sx:{padding:g=>g.spacing(1)},children:s(yle,{})})})})})]}),s(X,{condition:Boolean(o)&&d,show:s(fle,{getSearchContext:a})})]})},ble=E(po,{shouldForwardProp:e=>e!=="highlighted"})(({theme:e,highlighted:t})=>({backgroundColor:t?e.palette.highlight:"transparent",color:e.palette.text.primary,textDecorationColor:e.palette.text.disabled,textDecorationStyle:"dashed",textUnderlineOffset:e.spacing(.5)})),wle=({tooltip:e,highlighted:t,tooltipProps:n,children:r,...o})=>s(EC,{title:e,...n,arrow:!0,children:s(ble,{highlighted:t,...o,children:r})}),Sle=E(ke)(({theme:e})=>({fontSize:e.fontSizes.smallerBody})),xle=({row:e,value:t})=>{var r,o,i;const{searchQuery:n}=uf();return!e.original.tags||e.original.tags.length===0?s(fo,{}):s(fo,{children:s(wle,{highlighted:n.length>0&&t.toLowerCase().includes(n.toLowerCase()),tooltip:s(Re,{children:(r=e.original.tags)==null?void 0:r.map(a=>s(Sle,{children:s(Gc,{search:n,children:`${a.type}:${a.value}`})},a.type+a.value))}),children:((o=e.original.tags)==null?void 0:o.length)===1?"1 tag":`${(i=e.original.tags)==null?void 0:i.length} tags`})})},ca={date:(e,t,n,r)=>{var a,l;const o=new Date(((a=e==null?void 0:e.values)==null?void 0:a[n])||0),i=new Date(((l=t==null?void 0:t.values)==null?void 0:l[n])||0);return(i==null?void 0:i.getTime())-(o==null?void 0:o.getTime())},boolean:(e,t,n,r)=>{var a,l;const o=(a=e==null?void 0:e.values)==null?void 0:a[n],i=(l=t==null?void 0:t.values)==null?void 0:l[n];return o===i?0:o?1:-1},alphanumeric:(e,t,n,r)=>{var a,l;const o=`${((a=e==null?void 0:e.values)==null?void 0:a[n])||""}`.toLowerCase(),i=`${((l=t==null?void 0:t.values)==null?void 0:l[n])||""}`.toLowerCase();return o==null?void 0:o.localeCompare(i)},playgroundResultState:(e,t,n,r)=>{var a,l;const o=(a=e==null?void 0:e.values)==null?void 0:a[n],i=(l=t==null?void 0:t.values)==null?void 0:l[n];return o===i?0:o==="true"?1:i==="true"||o==="false"?-1:i==="false"?1:0}},Cle=Object.assign({},...Object.entries(ca).map(([e,t])=>({[e]:(n,r,o,i)=>{var a,l,c,u;return(a=n==null?void 0:n.original)!=null&&a.favorite&&!((l=r==null?void 0:r.original)!=null&&l.favorite)?i?1:-1:!((c=n==null?void 0:n.original)!=null&&c.favorite)&&((u=r==null?void 0:r.original)!=null&&u.favorite)?i?-1:1:t(n,r,o,i)}}))),Ele=(e=!1)=>{const[t,n]=f.useState(e),{trackEvent:r}=Is(),o=a=>{r("favorite",{props:{eventType:`features ${a?"":"un"}pinned `}}),n(a)},i=f.useMemo(()=>t?Cle:ca,[t]);return{isFavoritesPinned:t,onChangeIsFavoritePinned:o,sortTypes:i}},It=()=>{const{setToast:e}=f.useContext($s),t=()=>e(o=>({...o,show:!1})),n=f.useCallback((o,i)=>{e({title:"Something went wrong",text:o,type:"error",show:!0,autoHideDuration:12e3,...i})},[e]);return{setToastData:f.useCallback(o=>{o.persist?e({...o,show:!0}):e({...o,show:!0,autoHideDuration:6e3})},[e]),setToastApiError:n,hideToast:t}},ht=e=>e instanceof Error?e.message||e.toString():typeof e=="string"?e:"Unknown error",Un=({handleBadRequest:e,handleNotFound:t,handleForbidden:n,handleUnauthorized:r,propagateErrors:o=!1})=>{const[i,a]=f.useState({}),[l,c]=f.useState(!1),u=f.useCallback(async(h,m)=>{var y;if(h.status===Ux){if(e)return e(a,h,m);if(a(v=>({...v,badRequest:"Bad request format"})),o){const v=await h.json();throw new Wx(h.status,v)}}if(h.status===f3){if(t)return t(a,h,m);if(a(v=>({...v,notFound:"Could not find the requested resource"})),o)throw new Hx(h.status)}if(h.status===m3){if(r)return r(a,h,m);if(a(v=>({...v,unauthorized:Qb})),o)throw new g3(h.status)}if(h.status===h3){if(n)return n(a,h,m);if(a(v=>({...v,forbidden:"This operation is forbidden"})),o){const v=await h.json();throw new xte(h.status,v)}}if(h.status>399){const v=await h.json();if(((y=v==null?void 0:v.details)==null?void 0:y.length)>0&&o){const b=v.details[0];if(o)throw new Error(b.message||b.msg);return b}if((v==null?void 0:v.length)>0&&o){const b=v[0];throw new Error(b.message||b.msg)}if(o)throw new Error("Action could not be performed")}},[e,n,t,r,o]),d=f.useCallback(async(h,m,y=!0)=>{y&&c(!0);try{const v=await h();return c(!1),v.status>299&&await u(v,m),v.status===tf&&a({}),v}catch(v){throw c(!1),v}},[u]),p=f.useCallback((h,m,y="")=>{const v={headers:Wb,credentials:"include"};return{caller:()=>fetch(Ft(h),{...v,...m}),id:y}},[]);return{loading:l,makeRequest:d,createRequest:p,errors:i}},kle=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),{setToastData:o,setToastApiError:i}=It(),{trackEvent:a}=Is(),l=f.useCallback(async(u,d)=>{const p=`api/admin/projects/${u}/features/${d}/favorites`,h=t(p,{method:"POST"},"addFavoriteFeature");try{await e(h.caller,h.id),o({title:"Toggle added to favorites",type:"success"}),a("favorite",{props:{eventType:"feature favorited"}})}catch(m){i(ht(m))}},[t,e]),c=f.useCallback(async(u,d)=>{const p=`api/admin/projects/${u}/features/${d}/favorites`,h=t(p,{method:"DELETE"},"removeFavoriteFeature");try{await e(h.caller,h.id),o({title:"Toggle removed from favorites",type:"success"}),a("favorite",{props:{eventType:"feature unfavorited"}})}catch(m){i(ht(m))}},[t,e]);return{favorite:l,unfavorite:c,errors:n,loading:r}},Tle=E(Je)(({theme:e})=>({paddingLeft:e.spacing(1.25)})),yO=E(Qt)(({theme:e})=>({color:e.palette.primary.main,padding:e.spacing(1.25)})),_le=E(yO)({opacity:0}),Rle=({value:e,onClick:t})=>s(Tle,{children:s(X,{condition:Boolean(e),show:s(yO,{onClick:t,size:"small",children:s(zx,{fontSize:"small"})}),elseShow:s(_le,{className:"show-row-hover",onClick:t,size:"small",children:s(jx,{fontSize:"small"})})})}),Ple=({isActive:e=!1,onClick:t})=>{const[n,r]=f.useState(e);return s(du,{title:n?"Unpin favorite features from the top":"Pin favorite features to the top",children:s(Qt,{sx:{mx:-.75,display:"flex",alignItems:"center",justifyContent:"center",padding:1.25},onClick:()=>{r(!n),t(!n)},size:"small",children:s(X,{condition:n,show:s(zx,{fontSize:"small"}),elseShow:s(jx,{fontSize:"small"})})})})},$le=()=>{const{value:e,setValue:t}=Dv("global:v1",{});return{value:e,setValue:t}},Mv=(e,t,n)=>{f.useEffect(()=>{const r=e.filter(({condition:i})=>i).flatMap(({columns:i})=>i),o=e.flatMap(({columns:i})=>i).filter(i=>!r.includes(i));t(i=>[...new Set([...i,...r].filter(a=>!o.includes(a)))])},[...e.map(({condition:r})=>r),t,n])};var PC={},Ile=fn;Object.defineProperty(PC,"__esModule",{value:!0});var bO=PC.default=void 0,Ale=Ile(En()),Ole=kn,Lle=(0,Ale.default)((0,Ole.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),"FileDownload");bO=PC.default=Lle;const pu=()=>{const{data:e,error:t,mutate:n}=gn(Ft("api/admin/environments"),Dle),r=f.useMemo(()=>e||[],[e]),o=f.useCallback(async()=>{await n()},[n]),i=f.useCallback(async a=>{await n(a,!1)},[n]);return{environments:r,refetchEnvironments:o,mutateEnvironments:i,loading:!t&&!e,error:t}},Dle=async e=>(await fetch(e).then(Cn("Environments")).then(n=>n.json())).environments.sort((n,r)=>n.sortOrder-r.sortOrder),fu=({name:e,value:t="",label:n="",options:r,onChange:o,id:i,disabled:a=!1,className:l,classes:c,fullWidth:u,...d})=>T(Da,{variant:"outlined",size:"small",classes:c,fullWidth:u,children:[s(Zp,{htmlFor:i,children:n}),s(ef,{name:e,disabled:a,onChange:h=>{h.preventDefault(),o(String(h.target.value))},className:l,label:n,id:i,value:t,IconComponent:Ub,...d,children:r.map(h=>s(ws,{sx:h.sx,value:h.key,title:h.title||"","data-testid":`${w3}-${h.label}`,disabled:h.disabled,children:h.label},h.key))})]}),Nle=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{loading:r,errors:n,createExport:async i=>{const l=t("api/admin/features-batch/export",{method:"POST",body:JSON.stringify(i)});try{return await e(l.caller,l.id)}catch(c){throw c}}}},Mle=E(fu)(({theme:e})=>({minWidth:"250px",marginTop:e.spacing(2)})),Ble=({showExportDialog:e,data:t,onClose:n,environments:r})=>{const[o,i]=f.useState(r[0].name),{createExport:a}=Nle(),l=f.createRef(),{setToastApiError:c}=It(),u=()=>r.map(m=>({key:m.name,label:m.name})),d=()=>({features:t.map(m=>m.name),environment:o}),p=m=>{var g,S;const y=document.createElement("a");(g=l.current)==null||g.appendChild(y),y.style.display="display: none";const v=new Blob([JSON.stringify(m)],{type:"application/json"}),b=window.URL.createObjectURL(v);y.href=b;const w=new Date;y.download=`${w.toISOString()}-export.json`,y.click(),window.URL.revokeObjectURL(b),(S=l.current)==null||S.removeChild(y)};return s(cr,{open:e,title:"Export feature toggle configuration",onClose:n,onClick:async()=>{try{const m=d(),v=await(await a(m)).json();p(v),n()}catch(m){c(ht(m))}},primaryButtonText:"Export selection",secondaryButtonText:"Cancel",children:T(Je,{ref:l,children:["The current search filter will be used to export feature toggles. Currently ",t.length," feature toggles will be exported.",s("br",{}),s("br",{}),s(ke,{children:"Select which environment to export feature toggle configuration from:"}),s(Mle,{options:u(),value:o,onChange:m=>i(m)})]})})},wO=Array(15).fill({name:"Name of the feature",description:"Short description of the feature",type:"-",createdAt:new Date(2022,1,1),project:"projectID"}),Fle={id:"createdAt"},{value:SR,setValue:zle}=Dv("FeatureToggleListTable:v1",Fle),jle=()=>{var Z,J;const e=sn(),{environments:t}=pu(),n=Er(e.breakpoints.down("md")),r=Er(e.breakpoints.down("lg")),[o,i]=f.useState(!1),{features:a=[],loading:l,refetchFeatures:c}=dC(),[u,d]=jp(),{uiConfig:p}=Lt(),[h]=f.useState(()=>({sortBy:[{id:u.get("sort")||SR.id,desc:u.has("order")?u.get("order")==="desc":SR.desc}],hiddenColumns:["description"],globalFilter:u.get("search")||""})),{value:m,setValue:y}=$le(),{isFavoritesPinned:v,sortTypes:b,onChangeIsFavoritePinned:w}=Ele(u.has("favorites")?u.get("favorites")==="true":m.favorites),[g,S]=f.useState(h.globalFilter),{favorite:C,unfavorite:R}=kle(),k=f.useCallback(async z=>{z!=null&&z.favorite?await R(z.project,z.name):await C(z.project,z.name),c()},[C,c,R]),P=f.useMemo(()=>[{Header:s(Ple,{isActive:v,onClick:w}),accessor:"favorite",Cell:({row:{original:z}})=>s(Rle,{value:z==null?void 0:z.favorite,onClick:()=>k(z)}),maxWidth:50,disableSortBy:!0},{Header:"Seen",accessor:"lastSeenAt",Cell:oO,sortType:"date",align:"center",maxWidth:85},{Header:"Type",accessor:"type",Cell:lO,align:"center",maxWidth:85},{Header:"Name",accessor:"name",minWidth:150,Cell:Cse,sortType:"alphanumeric",searchable:!0},{id:"tags",Header:"Tags",accessor:z=>{var W;return((W=z.tags)==null?void 0:W.map(({type:$,value:N})=>`${$}:${N}`).join(`
|
|
291
|
-
`))||""},Cell:xle,width:80,searchable:!0},{Header:"Created",accessor:"createdAt",Cell:Ep,sortType:"date",maxWidth:150},{Header:"Project ID",accessor:"project",Cell:({value:z})=>s(Os,{title:z,to:`/projects/${z}`}),sortType:"alphanumeric",maxWidth:150,filterName:"project",searchable:!0},{Header:"State",accessor:"stale",Cell:fO,sortType:"boolean",maxWidth:120,filterName:"state",filterParsing:z=>z?"stale":"active"},{accessor:"description",Header:"Description",searchable:!0}],[v]),{data:O,getSearchText:L,getSearchContext:I}=RC(P,g,a),A=f.useMemo(()=>(O==null?void 0:O.length)===0&&l?wO:O,[O,l]),{headerGroups:M,rows:F,prepareRow:j,state:{sortBy:q},setHiddenColumns:G}=tn.useTable({columns:P,data:A,initialState:h,sortTypes:b,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},tn.useSortBy,tn.useFlexLayout);return Mv([{condition:!a.some(({tags:z})=>z==null?void 0:z.length),columns:["tags"]},{condition:n,columns:["type","createdAt","tags"]},{condition:r,columns:["lastSeenAt","stale"]}],G,P),f.useEffect(()=>{const z={};z.sort=q[0].id,q[0].desc&&(z.order="desc"),g&&(z.search=g),v&&(z.favorites="true"),d(z,{replace:!0}),zle({id:q[0].id,desc:q[0].desc||!1}),y(W=>({...W,favorites:Boolean(v)}))},[q,g,d,v]),t.length>0?T(gr,{isLoading:l,header:s(xn,{title:`Feature toggles (${F.length<A.length?`${F.length} of ${A.length}`:A.length})`,actions:T(Re,{children:[s(X,{condition:!n,show:T(Re,{children:[s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:I}),s(xn.Divider,{})]})}),s(po,{component:on,to:"/archive",underline:"always",sx:{marginRight:2},children:"View archive"}),s(X,{condition:Boolean((Z=p==null?void 0:p.flags)==null?void 0:Z.featuresExportImport),show:s(Tt,{title:"Export current selection",arrow:!0,children:s(Qt,{onClick:()=>i(!0),sx:z=>({marginRight:z.spacing(2)}),children:s(bO,{})})})}),s(Xse,{loading:!1,filter:{query:"",project:"default"}})]}),children:s(X,{condition:n,show:s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:I})})}),children:[s(As,{value:L(g),children:s(uC,{rows:F,headerGroups:M,prepareRow:j})}),s(X,{condition:F.length===0,show:s(X,{condition:(g==null?void 0:g.length)>0,show:T(Zn,{children:["No feature toggles found matching “",g,"”"]}),elseShow:s(Zn,{children:"No feature toggles available. Get started by adding a new feature toggle."})})}),s(X,{condition:Boolean((J=p==null?void 0:p.flags)==null?void 0:J.featuresExportImport),show:s(Ble,{showExportDialog:o,data:A,onClose:()=>i(!1),environments:t})})]}):null},hu=()=>{const{data:e,error:t}=gn(Zb,Ule),n=f.useCallback(()=>{Vr(Zb).catch(console.warn)},[]);return{strategies:(e==null?void 0:e.strategies)||Hle,refetchStrategies:n,loading:!t&&!e,error:t}},Ule=()=>fetch(Zb).then(Cn("Strategy types")).then(e=>e.json()),Wle={deprecated:!1,name:"flexibleRollout",displayName:"Gradual rollout",editable:!1,description:"Roll out to a percentage of your userbase, and ensure that the experience is the same for the user on each visit.",parameters:[{name:"rollout",type:"percentage",description:"",required:!1},{name:"stickiness",type:"string",description:"Used to defined stickiness",required:!0},{name:"groupId",type:"string",description:"",required:!0}]},Hle=[Wle],Zb=Ft("api/admin/strategies"),Vle=Ft("api/admin/metrics/applications"),SO=(e={})=>{const t=async()=>fetch(Vle,{method:"GET"}).then(Cn("Applications data")).then(c=>c.json()),n="api/admin/metrics/applications",{data:r,error:o}=gn(n,t,{...e}),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{applications:(r==null?void 0:r.applications)||[],error:o,loading:i,refetchApplications:l,APPLICATIONS_CACHE_KEY:n}},Gle="_truncate_h6uff_2",qle="_fullwidth_h6uff_8",Yle="_sectionPadding_h6uff_12",Kle="_horisontalScroll_h6uff_16",Xle="_listLink_h6uff_25",Jle="_hideLt920_h6uff_37",Qle="_hideLt600_h6uff_42",Zle="_dataTableHeader_h6uff_46",ece="_titleText_h6uff_51",tce="_actions_h6uff_56",nce="_switchWithLabel_h6uff_60",rce="_label_h6uff_63",oce="_emptyState_h6uff_72",ice="_toggleName_h6uff_80",ace="_toolbar_h6uff_85",sce="_toolbarButton_h6uff_91",lce="_error_h6uff_98",cce="_headerTitle_h6uff_102",uce="_listItem_h6uff_107",dce="_section_h6uff_12",pce="_contentPadding_h6uff_115",fce="_contentSpacing_h6uff_119",hce="_searchField_h6uff_123",Tc={truncate:Gle,fullwidth:qle,sectionPadding:Yle,horisontalScroll:Kle,listLink:Xle,hideLt920:Jle,hideLt600:Qle,dataTableHeader:Zle,titleText:ece,actions:tce,switchWithLabel:nce,label:rce,switch:"_switch_h6uff_60",emptyState:oce,toggleName:ice,toolbar:ace,toolbarButton:sce,error:lce,headerTitle:cce,listItem:uce,section:dce,contentPadding:pce,contentSpacing:fce,searchField:hce},$C=({apps:e})=>s(Yi,{children:s(X,{condition:e.length>0,show:e.map(({appName:t,description:n,icon:r})=>T(zi,{className:Tc.listItem,children:[s(es,{children:s(fv,{children:s(X,{condition:r,show:s(_x,{children:r}),elseShow:s(qee,{})},`avatar_conditional_${t}`)})}),s(un,{primary:s(on,{to:`/applications/${encodeURIComponent(t)}`,className:[Tc.listLink,Tc.truncate].join(" "),children:t}),secondary:n||"No description"})]},t))})});$C.propTypes={apps:pt.array.isRequired};pt.string,pt.any;pt.string,pt.func.isRequired,pt.string;pt.string,pt.object;const mce=jt.forwardRef(({icon:e,label:t,disabled:n,...r},o)=>T(ws,{disabled:n,style:{display:"flex",alignItems:"center"},...r,children:[s(e,{}),t]}));mce.propTypes={icon:pt.object,label:pt.string,disabled:pt.bool};const gce="_deprecated_nqviu_10",vce="_formButtons_nqviu_14",yce="_header_nqviu_18",bce="_formContainer_nqviu_32",wce="_inset_nqviu_38",Sce="_parameter_menu_nqviu_42",xce="_listcontainer_nqviu_52",Cce="_listItem_nqviu_56",Ece={"non-style-button":"_non-style-button_nqviu_1",deprecated:gce,formButtons:vce,header:yce,formContainer:bce,inset:wce,parameter_menu:Sce,listcontainer:xce,listItem:Cce},kce=({toggles:e})=>s(Yi,{style:{textAlign:"left"},className:Tc.truncate,children:s(X,{condition:e.length>0,show:e.map(({name:t,description:n="-",enabled:r})=>T(zi,{children:[s(es,{children:s(X,{condition:Boolean(r),show:s(Tt,{title:"Enabled",arrow:!0,children:s(pte,{"aria-hidden":!1})}),elseShow:s(Tt,{title:"Disabled",arrow:!0,children:s(dte,{"aria-hidden":!1})})})}),s(un,{primary:s(on,{to:`/features/view/${t}`,children:t},t),secondary:n})]},t))})}),Tce=({strategy:e,applications:t,toggles:n})=>{const r=sn(),{parameters:o=[]}=e,i=a=>a.length>0?a.map(({name:l,type:c,description:u,required:d},p)=>T(zi,{children:[s(X,{condition:d,show:s(es,{children:s(Tt,{title:"Required parameter",arrow:!0,children:s(Si,{"aria-hidden":!1})})}),elseShow:s(es,{children:s(Tt,{title:"Optional parameter",arrow:!0,children:s(fte,{"aria-hidden":!1})})})}),s(un,{primary:T("div",{children:[l," ",T("small",{children:["(",c,")"]})]}),secondary:u})]},`${l}-${p}`)):s(zi,{children:"No params"});return s("div",{className:Ece.listcontainer,children:T(_n,{container:!0,children:[s(X,{condition:e.deprecated,show:s(_n,{item:!0,children:s("h5",{style:{color:r.palette.error.main},children:"Deprecated"})})}),T(_n,{item:!0,sm:12,md:12,children:[s("h6",{children:"Parameters"}),s("hr",{}),s(Yi,{children:i(o)})]}),T(_n,{item:!0,sm:12,md:6,children:[s("h6",{children:"Applications using this strategy"}),s("hr",{}),s($C,{apps:t})]}),T(_n,{item:!0,sm:12,md:6,children:[s("h6",{children:"Toggles using this strategy"}),s("hr",{}),s(kce,{toggles:n})]})]})})},xO=e=>zM()[e],ur=e=>{const t=xO(e);if(!t)throw new Error(`Missing required path param: ${e}`);return t},_ce=()=>{const e=ur("name"),{strategies:t}=hu(),{features:n=[]}=dC(),{applications:r}=SO(),o=ft(),i=n.filter(c=>{var u;return(u=c==null?void 0:c.environments)==null?void 0:u.flatMap(d=>d.strategies).some(d=>d&&d.name===e)}),a=t.find(c=>c.name===e),l=()=>{o(`/strategies/${e}/edit`)};return a?s(gr,{header:s(xn,{title:a==null?void 0:a.name,subtitle:a==null?void 0:a.description,actions:s(X,{condition:a.editable,show:s(mr,{permission:Iv,"data-loading":!0,onClick:l,tooltipProps:{title:"Edit strategy"},children:s(ea,{})})})}),children:s(_n,{container:!0,children:s(_n,{item:!0,xs:12,sm:12,children:s(Tce,{strategy:a,toggles:i,applications:r})})})}):null},Rce=E(Je)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",padding:e.spacing(0,1.5)})),Pce=E(uo)(({theme:e})=>({borderColor:e.palette.dividerAlternative,height:e.spacing(3),margin:e.spacing(0,2)})),$ce=()=>s(Pce,{orientation:"vertical",variant:"middle"}),CO=({children:e})=>s(Rce,{children:e});CO.Divider=$ce;const na=CO;var IC={},Ice=fn;Object.defineProperty(IC,"__esModule",{value:!0});var EO=IC.default=void 0,Ace=Ice(En()),Oce=kn,Lce=(0,Ace.default)((0,Oce.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),"LocationOn");EO=IC.default=Lce;var AC={},Dce=fn;Object.defineProperty(AC,"__esModule",{value:!0});var kO=AC.default=void 0,Nce=Dce(En()),Mce=kn,Bce=(0,Nce.default)((0,Mce.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"People");kO=AC.default=Bce;var OC={},Fce=fn;Object.defineProperty(OC,"__esModule",{value:!0});var TO=OC.default=void 0,zce=Fce(En()),jce=kn,Uce=(0,zce.default)((0,jce.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language");TO=OC.default=Uce;var LC={},Wce=fn;Object.defineProperty(LC,"__esModule",{value:!0});var _O=LC.default=void 0,Hce=Wce(En()),Vce=kn,Gce=(0,Hce.default)((0,Vce.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");_O=LC.default=Gce;const qce=e=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.584 10H22a2 2 0 1 1 0 4h-5.416a5.001 5.001 0 0 1-9.168 0H2a2 2 0 1 1 0-4h5.416a5.001 5.001 0 0 1 9.168 0Z"})),kp=e=>Jce[e]??e,Yce=e=>s(Rb,{...e,component:t=>s(qce,{...t}),inheritViewBox:!0}),Kce=e=>{switch(e){case"default":return wC;case"remoteAddress":return TO;case"flexibleRollout":return Yce;case"userWithId":return kO;case"applicationHostname":return EO;default:return _O}},Xce=({strategyName:e})=>{const t=sn(),n=Kce(e);return s(n,{style:{color:t.palette.neutral.main}})},Jce={applicationHostname:"Hosts",default:"Standard",flexibleRollout:"Gradual rollout",gradualRolloutRandom:"Randomized",gradualRolloutSessionId:"Sessions",gradualRolloutUserId:"Users",remoteAddress:"IPs",userWithId:"UserIDs"},td="api/admin/strategies",DC=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o=f.useCallback(async u=>{const d=t(td,{method:"POST",body:JSON.stringify(u)});return e(d.caller,d.id)},[t,e]),i=f.useCallback(async u=>{const d=`${td}/${u.name}`,p=t(d,{method:"PUT",body:JSON.stringify(u)});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),a=f.useCallback(async u=>{const d=`${td}/${u.name}`,p=t(d,{method:"DELETE"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),l=f.useCallback(async u=>{const d=`${td}/${u.name}/deprecate`,p=t(d,{method:"POST"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),c=f.useCallback(async u=>{const d=`${td}/${u.name}/reactivate`,p=t(d,{method:"POST"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]);return{createStrategy:o,updateStrategy:i,removeStrategy:a,deprecateStrategy:l,reactivateStrategy:c,errors:n,loading:r}},Qce=()=>{const e=Er("(max-width:700px)"),t=ft();return s(X,{condition:e,show:s(mr,{"data-testid":N_,onClick:()=>t("/strategies/create"),permission:jm,size:"large",tooltipProps:{title:"New strategy type"},children:s(Si,{})}),elseShow:s(Io,{onClick:()=>t("/strategies/create"),color:"primary",permission:jm,"data-testid":N_,children:"New strategy type"})})},Zce=jt.forwardRef((e,t)=>{const n=qc(e.permission,e.projectId,e.environmentId);return s(RO,{...e,access:n,ref:t})}),eue=jt.forwardRef((e,t)=>{const n=_C(e.permission,e.projectId,e.environmentId);return s(RO,{...e,access:n,ref:t})}),RO=jt.forwardRef((e,t)=>{const{access:n,permission:r,tooltip:o,disabled:i,projectId:a,environmentId:l,checked:c,onChange:u,...d}=e;return s(du,{title:Nv(n,o),arrow:!0,children:s("span",{"data-loading":!0,children:s(Na,{"data-testid":"toggle-switch",onChange:u,disabled:i||!n,checked:c,ref:t,...d})})})}),PO=jt.forwardRef((e,t)=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Zce,{...e,projectId:e.projectId,environmentId:e.environmentId,ref:t}):s(eue,{...e,ref:t})),tue=({deprecated:e,disabled:t,onToggle:n})=>{const r=()=>{n(e)},o=Ss();return s(Tt,{title:t?"You cannot disable default strategy":e?"Excluded from strategy list":"Included in strategy list",describeChild:!0,arrow:!0,children:s("div",{id:o,children:s(PO,{checked:!e,permission:Iv,onClick:r,disabled:t,inputProps:{"aria-labelledby":o}})})})},nue=({strategy:e,onClick:t})=>{const n=Ss();return s(X,{condition:e==null?void 0:e.editable,show:s(mr,{onClick:t,permission:Iv,tooltipProps:{title:"Edit strategy"},children:s(ea,{})}),elseShow:s(Tt,{title:"You cannot edit a built-in strategy",arrow:!0,children:s("div",{id:n,children:s(Qt,{disabled:!0,size:"large",children:s(ea,{"aria-labelledby":n})})})})})},rue=({strategy:e,onClick:t})=>{const n=Ss();return s(X,{condition:e==null?void 0:e.editable,show:s(mr,{onClick:t,permission:boe,tooltipProps:{title:"Delete strategy"},children:s(ti,{})}),elseShow:s(Tt,{title:"You cannot delete a built-in strategy",arrow:!0,children:s("div",{id:n,children:s(Qt,{disabled:!0,size:"large",children:s(ti,{"aria-labelledby":n})})})})})},oue=E("div")(({theme:e,color:t="neutral",icon:n})=>({display:"inline-flex",alignItems:"center",padding:e.spacing(n?.375:.625,1),borderRadius:e.shape.borderRadius,fontSize:e.fontSizes.smallerBody,fontWeight:e.fontWeight.bold,lineHeight:1,backgroundColor:e.palette[t].light,color:e.palette[t].dark,border:`1px solid ${e.palette[t].border}`})),iue=E("div")(({theme:e,color:t="neutral",iconRight:n=!1})=>({display:"flex",color:e.palette[t].main,margin:n?e.spacing(0,0,0,.5):e.spacing(0,.5,0,0)})),xR=(e,t,n=!1)=>s(iue,{color:e,iconRight:n,children:s(X,{condition:Boolean(t==null?void 0:t.props.sx),show:t,elseShow:()=>f.cloneElement(t,{sx:{fontSize:"16px"}})})}),bi=f.forwardRef(({color:e="neutral",icon:t,iconRight:n,className:r,sx:o,children:i,...a},l)=>T(oue,{color:e,icon:t,className:r,sx:o,...a,ref:l,children:[s(X,{condition:Boolean(t)&&!Boolean(n),show:xR(e,t)}),i,s(X,{condition:Boolean(t)&&Boolean(n),show:xR(e,t,!0)})]})),aue=E(bi)(({theme:e})=>({marginLeft:e.spacing(1),display:"inline-block"})),sue=()=>{const e=ft(),[t,n]=f.useState({show:!1,title:"",onConfirm:()=>{}}),{strategies:r,refetchStrategies:o,loading:i}=hu(),{removeStrategy:a,deprecateStrategy:l,reactivateStrategy:c}=DC(),{setToastData:u,setToastApiError:d}=It(),p=f.useMemo(()=>i?Array(5).fill({name:"Context name",description:"Context description when loading"}):r.map(({name:I,description:A,editable:M,deprecated:F})=>({name:I,description:A,editable:M,deprecated:F})),[r,i]),h=f.useCallback(I=>A=>{n(A?{show:!0,title:"Really reactivate strategy?",onConfirm:async()=>{try{await c(I),o(),u({type:"success",title:"Success",text:"Strategy reactivated successfully"})}catch(M){d(ht(M))}}}:{show:!0,title:"Really deprecate strategy?",onConfirm:async()=>{try{await l(I),o(),u({type:"success",title:"Success",text:"Strategy deprecated successfully"})}catch(M){d(ht(M))}}})},[l,c,o,d,u]),m=f.useCallback(I=>{n({show:!0,title:"Really delete strategy?",onConfirm:async()=>{try{await a(I),o(),u({type:"success",title:"Success",text:"Strategy deleted successfully"})}catch(A){d(ht(A))}}})},[a,o,d,u]),y=f.useCallback(I=>{e(`/strategies/${I.name}/edit`)},[e]),v=f.useMemo(()=>[{id:"Icon",Cell:()=>s(Je,{"data-loading":!0,sx:{pl:3,pr:1,display:"flex",alignItems:"center"},children:s(l3,{color:"disabled"})}),disableGlobalFilter:!0},{id:"Name",Header:"Name",accessor:I=>kp(I.name),width:"90%",Cell:({row:{original:{name:I,description:A,deprecated:M,editable:F}}})=>{const j=M?`${A} (deprecated)`:A;return s(Os,{"data-loading":!0,title:kp(I),subtitle:j,to:`/strategies/${I}`,children:s(X,{condition:!F,show:()=>s(aue,{color:"success",children:"Predefined"})})})},sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:I}})=>T(na,{children:[s(tue,{deprecated:I.deprecated,onToggle:h(I),disabled:I.name==="default"}),s(na.Divider,{}),s(nue,{strategy:I,onClick:()=>y(I)}),s(rue,{strategy:I,onClick:()=>m(I)})]}),width:150,disableGlobalFilter:!0,disableSortBy:!0},{accessor:"description",disableSortBy:!0},{accessor:"sortOrder",disableGlobalFilter:!0,sortType:"number"}],[h,y,m]),b=f.useMemo(()=>({sortBy:[{id:"Name",desc:!1}],hiddenColumns:["description","sortOrder"]}),[]),{getTableProps:w,getTableBodyProps:g,headerGroups:S,rows:C,prepareRow:R,state:{globalFilter:k},setGlobalFilter:P}=tn.useTable({columns:v,data:p,initialState:b,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useGlobalFilter,tn.useSortBy),O=()=>{t==null||t.onConfirm(),n(I=>({...I,show:!1}))};let L=C.length;return T(gr,{isLoading:i,header:s(xn,{title:`Strategy types (${L})`,actions:T(Re,{children:[s(go,{initialValue:k,onChange:P}),s(xn.Divider,{}),s(Qce,{})]})}),children:[s(As,{value:k,children:T(za,{...w(),children:[s(Fa,{headerGroups:S}),s(Ma,{...g(),children:C.map(I=>(R(I),s(sa,{hover:!0,...I.getRowProps(),children:I.cells.map(A=>s(ta,{...A.getCellProps(),children:A.render("Cell")}))})))})]})}),s(X,{condition:C.length===0,show:s(X,{condition:(k==null?void 0:k.length)>0,show:T(Zn,{children:["No strategies found matching “",k,"”"]}),elseShow:s(Zn,{children:"No strategies available. Get started by adding one."})})}),s(cr,{open:t.show,onClick:O,title:t==null?void 0:t.title,onClose:()=>n(I=>({...I,show:!1}))})]})},Bv=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createTag:async c=>{const d=t("api/admin/tag-types",{method:"POST",body:JSON.stringify(c)});try{return await e(d.caller,d.id)}catch(p){throw p}},validateTagName:async c=>{const d=t("api/admin/tag-types/validate",{method:"POST",body:JSON.stringify({name:c})});try{return await e(d.caller,d.id)}catch(p){throw p}},updateTagType:async(c,u)=>{const d=`api/admin/tag-types/${c}`,p=t(d,{method:"PUT",body:JSON.stringify(u)});try{return await e(p.caller,p.id)}catch(h){throw h}},deleteTagType:async c=>{const u=`api/admin/tag-types/${c}`,d=t(u,{method:"DELETE"});try{return await e(d.caller,d.id)}catch(p){throw p}},errors:n,loading:r}},lue=(e={})=>{const t=async()=>{const c=Ft("api/admin/tag-types");return(await fetch(c,{method:"GET"}).then(Cn("Tag types"))).json()},n="api/admin/tag-types",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{tagTypes:(r==null?void 0:r.tagTypes)||[],error:o,loading:i,refetch:l}},cue=()=>{const e=ft(),t=Er("(max-width:700px)");return s(X,{condition:t,show:s(mr,{onClick:()=>e("/tag-types/create"),size:"large",permission:xp,children:s(Si,{})}),elseShow:s(Io,{permission:xp,onClick:()=>e("/tag-types/create"),children:"New tag type"})})},uue=()=>{const[e,t]=f.useState({open:!1}),n=ft(),{deleteTagType:r}=Bv(),{tagTypes:o,refetch:i,loading:a}=lue(),{setToastData:l,setToastApiError:c}=It(),u=f.useMemo(()=>a?Array(5).fill({name:"Tag type name",description:"Tag type description when loading"}):o.map(({name:C,description:R})=>({name:C,description:R})),[o,a]),d=f.useMemo(()=>[{id:"Icon",Cell:()=>s(Je,{"data-loading":!0,sx:{pl:2,pr:1,display:"flex",alignItems:"center"},children:s(ste,{color:"disabled"})}),disableGlobalFilter:!0},{Header:"Name",accessor:"name",width:"90%",Cell:({row:{original:{name:C,description:R}}})=>s(Os,{"data-loading":!0,title:C,subtitle:R}),sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:C}})=>T(Je,{sx:{display:"flex",justifyContent:"flex-end"},"data-loading":!0,children:[s(mr,{onClick:()=>n(`/tag-types/edit/${C.name}`),permission:xp,tooltipProps:{title:"Edit tag type"},children:s(ea,{})}),s(mr,{permission:xoe,tooltipProps:{title:"Delete tag type"},onClick:()=>t({open:!0,name:C.name}),children:s(ti,{})})]}),width:150,disableGlobalFilter:!0,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[n]),p=f.useMemo(()=>({sortBy:[{id:"name",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:h,getTableBodyProps:m,headerGroups:y,rows:v,prepareRow:b,state:{globalFilter:w},setGlobalFilter:g}=tn.useTable({columns:d,data:u,initialState:p,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useGlobalFilter,tn.useSortBy),S=async()=>{try{e.name&&(await r(e.name),i(),t({open:!1}),l({type:"success",show:!0,title:"Successfully deleted tag type."}))}catch(C){c(ht(C))}};return T(gr,{isLoading:a,header:s(xn,{title:`Tag types (${v.length})`,actions:T(Re,{children:[s(go,{initialValue:w,onChange:g}),s(xn.Divider,{}),s(cue,{})]})}),children:[s(As,{value:w,children:T(za,{...h(),children:[s(Fa,{headerGroups:y}),s(Ma,{...m(),children:v.map(C=>(b(C),s(sa,{hover:!0,...C.getRowProps(),children:C.cells.map(R=>s(ta,{...R.getCellProps(),children:R.render("Cell")}))})))})]})}),s(X,{condition:v.length===0,show:s(X,{condition:(w==null?void 0:w.length)>0,show:T(Zn,{children:["No tags found matching “",w,"”"]}),elseShow:s(Zn,{children:"No tags available. Get started by adding one."})})}),s(cr,{title:"Really delete Tag type?",open:e.open,onClick:S,onClose:()=>{t({open:!1})}})]})},Fv=(e={})=>{const t=async()=>{const c=Ft("api/admin/addons");return(await fetch(c,{method:"GET"}).then(Cn("Addons"))).json()},n="api/admin/addons",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=f.useCallback(()=>{Vr(n)},[n]);return f.useEffect(()=>{a(!o&&!r)},[r,o]),{addons:(r==null?void 0:r.addons)||[],providers:(r==null?void 0:r.providers)||[],error:o,loading:i,refetchAddons:l}},$O=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o="api/admin/addons",i=async c=>{const d=t(o,{method:"POST",body:JSON.stringify(c)});return e(d.caller,d.id)},a=async c=>{const u=`${o}/${c}`,d=t(u,{method:"DELETE"});return await e(d.caller,d.id)},l=f.useCallback(async c=>{const u=`${o}/${c.id}`,d=t(u,{method:"PUT",body:JSON.stringify(c)});return e(d.caller,d.id)},[t,e]);return{createAddon:i,updateAddon:l,removeAddon:a,errors:n,loading:r}},zv=({icon:e})=>s(Je,{sx:{pl:2,pr:1,display:"flex",alignItems:"center"},children:e}),due="/static/slack-c0af31c6.svg",pue="/static/jira-d9eb9af9.svg",fue="/static/webhooks-ffa904ac.svg",hue="/static/teams-62e72076.svg",mue="/static/datadog-591b6a73.svg",nd={width:"32.5px",height:"32.5px",marginRight:"16px"},IO=({name:e})=>{switch(e){case"slack":return s("img",{style:nd,alt:"Slack logo",src:Js(due)});case"jira-comment":return s("img",{style:nd,alt:"JIRA logo",src:Js(pue)});case"webhook":return s("img",{style:nd,alt:"Generic Webhook logo",src:Js(fue)});case"teams":return s("img",{style:nd,alt:"Microsoft Teams logo",src:Js(hue)});case"datadog":return s("img",{style:nd,alt:"Datadog logo",src:Js(mue)});default:return s(fv,{children:s(Zee,{})})}},gue=e=>{const[t,n]=f.useState(e),r=f.useCallback(()=>n(e),[e]);return f.useEffect(()=>{n(e)},[e]),[t,n,r]},vue=({toggleAddon:e,setShowDelete:t,setDeletedAddon:n,original:r})=>{const o=ft(),[i,a,l]=gue(r.enabled),c=()=>{a(!i),e(r).catch(l)};return T(na,{children:[s(Tt,{title:i?`Disable addon ${r.provider}`:`Enable addon ${r.provider}`,arrow:!0,describeChild:!0,children:s(PO,{permission:Gb,checked:i,onClick:c})}),s(na.Divider,{}),s(mr,{permission:Gb,tooltipProps:{title:"Edit Addon"},onClick:()=>o(`/addons/edit/${r.id}`),children:s(ea,{})}),s(mr,{permission:Coe,tooltipProps:{title:"Remove Addon"},onClick:()=>{n(r),t(!0)},children:s(ti,{})})]})},yue=()=>{const{refetchAddons:e,addons:t,loading:n}=Fv(),{updateAddon:r,removeAddon:o}=$O(),{setToastData:i,setToastApiError:a}=It(),[l,c]=f.useState(!1),[u,d]=f.useState({id:0,provider:"",description:"",enabled:!1,events:[],parameters:{}}),p=f.useMemo(()=>n?Array(5).fill({name:"Addon name",description:"Addon description when loading"}):t.map(k=>({...k})),[t,n]),h=f.useCallback(async k=>{try{await r({...k,enabled:!k.enabled}),e(),i({type:"success",title:"Success",text:k.enabled?"Addon is now disabled":"Addon is now enabled"})}catch(P){throw a(ht(P)),P}},[a,e,i,r]),m=f.useMemo(()=>[{id:"Icon",Cell:({row:{original:{provider:k}}})=>s(zv,{icon:s(IO,{name:k})})},{Header:"Name",accessor:"provider",width:"90%",Cell:({row:{original:{provider:k,description:P}}})=>s(Os,{"data-loading":!0,title:k,subtitle:P}),sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:k}})=>s(vue,{setShowDelete:c,toggleAddon:h,setDeletedAddon:d,original:k}),width:150,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[h]),y=f.useMemo(()=>({sortBy:[{id:"provider",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:v,getTableBodyProps:b,headerGroups:w,rows:g,prepareRow:S,state:{globalFilter:C}}=tn.useTable({columns:m,data:p,initialState:y,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useSortBy),R=async k=>{try{await o(k.id),e(),i({type:"success",title:"Success",text:"Deleted addon successfully"})}catch(P){a(ht(P))}};return T(gr,{isLoading:n,header:s(xn,{title:`Configured addons (${g.length})`}),sx:k=>({marginBottom:k.spacing(2)}),children:[T(za,{...v(),children:[s(Fa,{headerGroups:w}),s(Ma,{...b(),children:g.map(k=>(S(k),s(sa,{hover:!0,...k.getRowProps(),children:k.cells.map(P=>s(ta,{...P.getCellProps(),padding:"none",children:P.render("Cell")}))})))})]}),s(X,{condition:g.length===0,show:s(X,{condition:(C==null?void 0:C.length)>0,show:T(Zn,{children:["No addons found matching “",C,"”"]}),elseShow:s(Zn,{children:"No addons configured"})})}),s(cr,{open:l,onClick:()=>{R(u),c(!1)},onClose:()=>{c(!1)},title:"Confirm deletion",children:s("div",{children:"Are you sure you want to delete this Addon?"})})]})},bue=({name:e})=>{const t=ft();return s(Io,{permission:V3,variant:"outlined",onClick:()=>t(`/addons/create/${e}`),children:"Configure"})},wue=({providers:e,loading:t})=>{const n=f.useMemo(()=>t?Array(5).fill({name:"Provider name",description:"Provider description when loading"}):e.map(({name:p,displayName:h,description:m})=>({name:p,displayName:h,description:m})),[e,t]),r=f.useMemo(()=>[{id:"Icon",Cell:({row:{original:{name:p}}})=>s(zv,{icon:s(IO,{name:p})})},{Header:"Name",accessor:"name",width:"90%",Cell:({row:{original:{name:p,description:h}}})=>s(Os,{"data-loading":!0,title:p,subtitle:h}),sortType:"alphanumeric"},{id:"Actions",align:"center",Cell:({row:{original:p}})=>s(na,{children:s(bue,{name:p.name})}),width:150,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[]),o=f.useMemo(()=>({sortBy:[{id:"name",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d}}=tn.useTable({columns:r,data:n,initialState:o,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useSortBy);return T(gr,{isLoading:t,header:s(xn,{title:`Available addons (${c.length})`}),children:[T(za,{...i(),children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(p=>(u(p),s(sa,{hover:!0,...p.getRowProps(),children:p.cells.map(h=>s(ta,{...h.getCellProps(),children:h.render("Cell")}))})))})]}),s(X,{condition:c.length===0,show:s(X,{condition:(d==null?void 0:d.length)>0,show:T(Zn,{children:["No providers found matching “",d,"”"]}),elseShow:s(Zn,{children:"No providers available."})})})]})},Sue=()=>{const{providers:e,addons:t,loading:n}=Fv();return T(Re,{children:[s(X,{condition:t.length>0,show:s(yue,{})}),s(wue,{loading:n,providers:e})]})},Al=()=>new URLSearchParams(ri().search),xue=({children:e,from:t,to:n,style:r,...o})=>s("div",{style:{background:`linear-gradient(${t}, ${n})`,height:"100%",width:"100%",position:"relative",...r},...o,children:e}),Cue=e=>f.createElement("svg",{width:334,height:334,viewBox:"0 0 334 334",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{cx:167,cy:167,r:167,fill:"white"}),f.createElement("rect",{x:96.3462,y:96.3457,width:44.9615,height:141.308,fill:"#1A4049"}),f.createElement("rect",{x:192.692,y:96.3457,width:44.9615,height:141.308,fill:"#1A4049"}),f.createElement("path",{d:"M237.654 192.693L237.654 237.655L96.3461 237.655L96.3461 192.693L237.654 192.693Z",fill:"#1A4049"}),f.createElement("rect",{x:192.692,y:192.693,width:44.9615,height:44.9615,fill:"#817AFE"})),Eue=e=>f.createElement("svg",{id:"bg",width:"100%",height:"100%",viewBox:"0 0 622 318",fill:"none",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#fff;}.cls-2{fill:#1a4049;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-1",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-1",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"})),kue=E(xue)(({theme:e})=>({display:"flex",justifyContent:"center",[e.breakpoints.up("sm")]:{borderBottomLeftRadius:"3px",borderTopLeftRadius:"3px"}})),Tue=E("div")(({theme:e})=>({padding:e.spacing(12,8),color:"#fff",position:"relative",borderTopLeftRadius:"3px",borderBottomLeftRadius:"3px",textAlign:"right",[e.breakpoints.down("md")]:{padding:e.spacing(6,4)},[e.breakpoints.down("sm")]:{padding:e.spacing(6,2)}})),_ue=E(ke)(({theme:e})=>({color:"#fff",marginBottom:e.spacing(2),fontSize:e.spacing(4),marginTop:e.spacing(10),[e.breakpoints.down("md")]:{display:"none"}})),Rue=E(ke)(({theme:e})=>({[e.breakpoints.down("md")]:{display:"none"},[e.breakpoints.down("sm")]:{display:"none"},fontSize:e.spacing(4),fontWeight:"normal"})),Pue=E("div")(({theme:e})=>({position:"absolute",[e.breakpoints.up("md")]:{bottom:"-50px",left:"-50px",display:"flex",flexDirection:"column"}})),AO=e=>({width:"200px",[e.breakpoints.up("md")]:{width:"240px",height:"200px"}}),$ue=E(Eue)(({theme:e})=>({...AO(e)})),Iue=E(Cue)(({theme:e})=>({...AO(e)})),OO=({title:e})=>{const t=sn(),n=Er(t.breakpoints.down("md"));return T(kue,{from:t.palette.standaloneBannerGradient.from,to:t.palette.standaloneBannerGradient.to,children:[T(Tue,{children:[s(_ue,{variant:"h1",children:e}),s(Rue,{children:"Committed to creating new ways of developing software"})]}),s(Pue,{children:s(X,{condition:n,show:s($ue,{"aria-label":"Unleash logo"}),elseShow:s(Iue,{"aria-label":"Unleash logo"})})})]})},Aue=E("div")(({theme:e})=>({padding:e.spacing(11),background:e.palette.standaloneBackground,display:"flex",[e.breakpoints.down("md")]:{flexDirection:"column"},[e.breakpoints.down("sm")]:{padding:"0"},minHeight:"100vh"})),Oue=E("header")(({theme:e})=>({width:"40%",borderRadius:e.shape.borderRadius,[e.breakpoints.down("md")]:{borderRadius:"0",width:"100%",minHeight:"auto"}})),Lue=E("main")(({theme:e})=>({width:"60%",flex:"1",borderTopRightRadius:"3px",borderBottomRightRadius:"3px",backgroundColor:e.palette.background.paper,position:"relative",[e.breakpoints.down("md")]:{borderRadius:"0",width:"100%",position:"static",minHeight:"auto"}})),Due=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",height:"100%",padding:e.spacing(12,6),[e.breakpoints.down("md")]:{padding:e.spacing(4,4)},[e.breakpoints.down("sm")]:{padding:e.spacing(4,2)}})),jv=({children:e,BannerComponent:t})=>{let n=s(OO,{title:"Unleash"});return t&&(n=t),T(Aue,{children:[s(Oue,{children:n}),s(Lue,{children:s(Due,{children:e})})]})},Nue="unsecure",LO="demo",Mue="password",Bue="enterprise-hosted",Fue="_container_wn392_1",zue="_button_wn392_10",CR={container:Fue,button:zue},Uv=()=>{const{makeRequest:e,errors:t,loading:n}=Un({propagateErrors:!0});return{passwordAuth:(i,a,l)=>{const c={caller:()=>fetch(i,{headers:Wb,method:"POST",body:JSON.stringify({username:a,password:l})}),id:"passwordAuth"};return e(c.caller,c.id)},emailAuth:(i,a)=>{const l={caller:()=>fetch(i,{headers:Wb,method:"POST",body:JSON.stringify({email:a})}),id:"emailAuth"};return e(l.caller,l.id)},errors:t,loading:n}},jue=({authDetails:e,redirect:t})=>{const[n,r]=f.useState(""),{refetchUser:o}=si(),{emailAuth:i}=Uv(),a=ft(),{setToastApiError:l}=It(),c=async d=>{d.preventDefault();try{await i(e.path,n),o(),a(t,{replace:!0})}catch(p){l(ht(p))}},u=d=>{const p=d.target.value;r(p)};return s("form",{onSubmit:c,children:T("div",{className:CR.container,children:[s("p",{children:e.message}),T("p",{children:["This instance of Unleash is not set up with a secure authentication provider. You can read more about"," ",s("a",{href:"https://github.com/Unleash/unleash/blob/master/docs/securing-unleash.md",target:"_blank",rel:"noreferrer",children:"securing Unleash on GitHub"})]}),s(pn,{value:n,onChange:u,inputProps:{"data-testid":"email-input-field"},size:"small",variant:"outlined",label:"Email",name:"email",id:"email",required:!0,type:"email","data-testid":yv,autoFocus:!0}),s("br",{}),s("div",{children:s(rt,{type:"submit",variant:"contained",color:"primary",className:CR.button,"data-testid":bv,children:"Sign in"})})]})})},Uue=({authDetails:e})=>T("div",{children:[s("p",{children:e.message}),s(OG,{style:{textAlign:"center"},children:s("a",{href:e.path,style:{width:"100%"},children:s(rt,{variant:"contained",color:"primary",style:{width:"150px",margin:"0 auto"},children:"Sign In"})})})]}),Wue=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46px",height:"46px",viewBox:"0 0 46 46",...e},f.createElement("defs",null,f.createElement("filter",{x:"-50%",y:"-50%",width:"200%",height:"200%",filterUnits:"objectBoundingBox",id:"filter-1"},f.createElement("feOffset",{dx:0,dy:1,in:"SourceAlpha",result:"shadowOffsetOuter1"}),f.createElement("feGaussianBlur",{stdDeviation:.5,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),f.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.168 0",in:"shadowBlurOuter1",type:"matrix",result:"shadowMatrixOuter1"}),f.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter2"}),f.createElement("feGaussianBlur",{stdDeviation:.5,in:"shadowOffsetOuter2",result:"shadowBlurOuter2"}),f.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.084 0",in:"shadowBlurOuter2",type:"matrix",result:"shadowMatrixOuter2"}),f.createElement("feMerge",null,f.createElement("feMergeNode",{in:"shadowMatrixOuter1"}),f.createElement("feMergeNode",{in:"shadowMatrixOuter2"}),f.createElement("feMergeNode",{in:"SourceGraphic"}))),f.createElement("rect",{id:"path-2",x:0,y:0,width:40,height:40,rx:2})),f.createElement("g",{id:"Google-Button",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},f.createElement("g",{id:"9-PATCH",transform:"translate(-608.000000, -160.000000)"}),f.createElement("g",{id:"btn_google_light_normal",transform:"translate(-1.000000, -1.000000)"},f.createElement("g",{id:"button",transform:"translate(4.000000, 4.000000)",filter:"url(#filter-1)"},f.createElement("g",{id:"button-bg"},f.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd"}),f.createElement("use",{fill:"none"}),f.createElement("use",{fill:"none"}),f.createElement("use",{fill:"none"}))),f.createElement("g",{id:"logo_googleg_48dp",transform:"translate(15.000000, 15.000000)"},f.createElement("path",{d:"M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M0,0 L18,0 L18,18 L0,18 L0,0 Z",id:"Shape"})),f.createElement("g",{id:"handles_square"}))));var NC={},Hue=fn;Object.defineProperty(NC,"__esModule",{value:!0});var DO=NC.default=void 0,Vue=Hue(En()),Gue=kn,que=(0,Vue.default)((0,Gue.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z"}),"LockRounded");DO=NC.default=que;const MC=({options:e})=>{const{classes:t}=lf();return s(Re,{children:e==null?void 0:e.map(n=>s("div",{className:yi(t.flexColumn,t.contentSpacingY),children:s(rt,{color:"primary","data-loading":!0,variant:"outlined",href:n.path,size:"small","data-testid":`${Ute}-${n.type}`,style:{height:"40px",color:"#000"},startIcon:s(X,{condition:n.type==="google",show:s(Wue,{style:{height:"35px",width:"35px"}}),elseShow:s(DO,{style:{height:"25px",width:"25px"}})}),children:n.message})},n.type))})},Yue=E("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:e.spacing(2,"auto")})),ER=E("span")(({theme:e})=>({width:"80px",height:"3px",backgroundColor:e.palette.divider,borderRadius:e.shape.borderRadius})),Kue=E(ke)(({theme:e})=>({textAlign:"center",display:"block",margin:e.spacing(0,2)})),Wv=({text:e,...t})=>T(Yue,{...t,children:[s(ER,{}),s(Kue,{variant:"body2",children:e}),s(ER,{})]}),Yc=({...e})=>{const[t,n]=f.useState(!1);return s(pn,{variant:"outlined",size:"small",type:t?"text":"password",InputProps:{style:{paddingRight:"0px"},endAdornment:s(O4,{position:"end",children:s(Qt,{onClick:()=>{n(!t)},onMouseDown:l=>{l.preventDefault()},size:"large",children:s(t?u3:d3,{titleAccess:"Toggle password visibility"})})})},...e})},Xue=E(Xt)(({theme:e})=>({color:e.palette.error.main,marginBottom:e.spacing(1)})),Jue=E("div")(({theme:e})=>({...sf(e),display:"flex",flexDirection:"column"})),Que=({authDetails:e,redirect:t})=>{const n=ft(),{refetchUser:r}=si(),o=Al(),[i,a]=f.useState(o.get("email")||""),[l,c]=f.useState(""),{passwordAuth:u}=Uv(),[d,p]=f.useState({}),h=async v=>{if(v.preventDefault(),i||p(b=>({...b,usernameError:"This is a required field"})),l||p(b=>({...b,passwordError:"This is a required field"})),!(!l||!i))try{await u(e.path,i,l),r(),n(t,{replace:!0})}catch(b){b instanceof Hx||b instanceof Wx?(p(w=>({...w,apiError:"Invalid login details"})),c(""),a("")):b instanceof g3?p({apiError:"Invalid password and username combination."}):p({apiError:"Unknown error while trying to authenticate."})}},m=()=>{const{usernameError:v,passwordError:b,apiError:w}=d;return s(X,{condition:!e.defaultHidden,show:T("form",{onSubmit:h,children:[s(X,{condition:Boolean(w),show:s(Xue,{severity:"error",children:w})}),T(Jue,{children:[s(pn,{label:"Username or email",name:"username",id:"username",type:"text",onChange:g=>a(g.target.value),value:i,error:Boolean(v),helperText:v,autoComplete:"username","data-testid":yv,variant:"outlined",size:"small",autoFocus:!0}),s(Yc,{label:"Password",onChange:g=>c(g.target.value),name:"password",id:"password",value:l,error:Boolean(b),helperText:b,autoComplete:"current-password","data-testid":b3}),s(rt,{variant:"contained",color:"primary",type:"submit",style:{width:"150px",margin:"1rem auto"},"data-testid":bv,children:"Sign in"})]})]})})},{options:y=[]}=e;return s(Re,{children:s(X,{condition:y.length>0,show:T(Re,{children:[s(MC,{options:y}),s(X,{condition:!e.defaultHidden,show:s(Wv,{text:"Or sign in with username"})}),m()]}),elseShow:m()})})},Zue=E(ke)(({theme:e})=>({color:e.palette.error.main})),ede=E("div")(({theme:e})=>({...sf(e),display:"flex",flexDirection:"column"})),tde=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto",0,"auto"),display:"block",textAlign:"center"})),nde=({authDetails:e,redirect:t})=>{const{refetchUser:n}=si(),r=ft(),o=Al(),{passwordAuth:i}=Uv(),[a,l]=f.useState(o.get("email")||""),[c,u]=f.useState(""),[d,p]=f.useState({}),h=async w=>{if(w.preventDefault(),a||p(g=>({...g,usernameError:"This is a required field"})),c||p(g=>({...g,passwordError:"This is a required field"})),!(!c||!a))try{await i(e.path,a,c),n(),r(t,{replace:!0})}catch(g){g instanceof Hx||g instanceof Wx?(p(S=>({...S,apiError:"Invalid login details"})),u(""),l("")):p({apiError:"Unknown error while trying to authenticate."})}},{usernameError:m,passwordError:y,apiError:v}=d,{options:b=[]}=e;return T(Re,{children:[s(X,{condition:b.length>0,show:T(Re,{children:[s(MC,{options:b}),s(Wv,{text:"or signin with username"})]})}),s(X,{condition:!e.defaultHidden,show:T("form",{onSubmit:h,children:[s(Zue,{variant:"subtitle2",children:v}),T(ede,{children:[s(pn,{label:"Username or email",name:"username",id:"username",type:"text",onChange:w=>l(w.target.value),value:a,error:Boolean(m),helperText:m,variant:"outlined",size:"small","data-testid":yv}),s(Yc,{label:"Password",onChange:w=>u(w.target.value),name:"password",id:"password",value:c,error:Boolean(y),helperText:y,autoComplete:"current-password","data-testid":b3}),s(_n,{container:!0,children:s(tde,{variant:"contained",color:"primary",type:"submit","data-testid":bv,children:"Sign in"})})]})]})})]})},rde="_container_abcn7_1",ode="_emailField_abcn7_9",ide="_form_abcn7_13",ade="_logo_abcn7_17",sde="_button_abcn7_24",rd={container:rde,emailField:ode,form:ide,logo:ade,button:sde},lde=e=>f.createElement("svg",{width:52,height:52,viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{cx:26,cy:26,r:26,fill:"white"}),f.createElement("rect",{x:15,y:15,width:7,height:22,fill:"#1A4049"}),f.createElement("rect",{x:30,y:15,width:7,height:22,fill:"#1A4049"}),f.createElement("path",{d:"M37 30L37 37L15 37L15 30L37 30Z",fill:"#1A4049"}),f.createElement("rect",{x:30,y:30,width:7,height:7,fill:"#817AFE"})),cde=({authDetails:e,redirect:t})=>{const[n,r]=f.useState(""),o=ft(),{refetchUser:i}=si(),{emailAuth:a}=Uv(),{setToastApiError:l}=It(),c=async d=>{d.preventDefault();try{await a(e.path,n),i(),o(t,{replace:!0})}catch(p){l(ht(p))}},u=d=>{const p=d.target.value;r(p)};return T("form",{onSubmit:c,children:[s(lde,{className:rd.logo,"aria-label":"Unleash logo"}),T("div",{className:rd.container,children:[s("h2",{children:"Access the Unleash demo instance"}),s("p",{children:"No further data or Credit Card required"}),T("div",{className:rd.form,children:[s(pn,{value:n,className:rd.emailField,onChange:u,inputProps:{"data-testid":"email-input-field"},size:"small",variant:"outlined",label:"Email",name:"email",id:"email","data-testid":yv,required:!0,type:"email"}),s(rt,{type:"submit",variant:"contained",color:"primary",className:rd.button,"data-testid":bv,children:"Sign in"})]}),T("p",{children:["By accessing our demo instance, you agree to the Unleash ",s("a",{href:"https://www.unleash-hosted.com/tos/",target:"_blank",rel:"noreferrer",children:"Customer Terms of Service"})," ","and ",s("a",{href:"https://www.unleash-hosted.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})]})]})]})},ude=E("div")(({theme:e})=>({margin:"auto auto 0 auto",width:"230px",[e.breakpoints.down("md")]:{marginTop:e.spacing(2)}})),dde=E(on)(({theme:e})=>({fontWeight:"bold",textAlign:"center"})),pde=E(ke)(({theme:e})=>({fontWeight:"bold",marginBottom:e.spacing(1)})),fde=E("a")(({theme:e})=>({fontWeight:"bold",textAlign:"center"})),kR=()=>T(ude,{children:[s(dde,{to:"/forgotten-password",children:s(pde,{variant:"body2",children:"Forgot password?"})}),T(ke,{variant:"body2",children:["Don't have an account?"," ",s(fde,{href:"https://www.getunleash.io/plans",target:"_blank",rel:"noopener noreferrer",children:"Sign up"})]})]}),mu=()=>{const e=cf();return{authDetails:e.data&&"type"in e.data?e.data:void 0,refetchAuthDetails:e.refetchAuth,loading:e.loading,error:e.error}},hde=({redirect:e,invited:t=!1})=>{const{authDetails:n}=mu(),o=Al().get("errorMsg"),{trackEvent:i}=Is();if(f.useEffect(()=>{t&&i("invite",{props:{eventType:"user created"}})},[t,i]),!n)return null;let a;return n.type===Mue?a=T(Re,{children:[s(Que,{authDetails:n,redirect:e}),s(X,{condition:!n.defaultHidden,show:s(kR,{})})]}):n.type===Nue?a=s(jue,{authDetails:n,redirect:e}):n.type===LO?a=s(cde,{authDetails:n,redirect:e}):n.type===Bue?a=T(Re,{children:[s(nde,{authDetails:n,redirect:e}),s(X,{condition:!n.defaultHidden,show:s(kR,{})})]}):a=s(Uue,{authDetails:n}),T(Re,{children:[s("div",{style:{maxWidth:"350px"},"data-testid":ene,children:s(X,{condition:Boolean(o),show:s(Xt,{severity:"error",children:o})})}),a]})},mde=e=>{const t=new URL(decodeURIComponent(e),window.location.protocol+"//"+window.location.host);return{pathname:t.pathname,search:t.search}},gde=E("div")(({theme:e})=>({display:"flex",flexDirection:"column"})),vde=E("h2")(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(2),textAlign:"center"})),yde=()=>{const{authDetails:e}=mu(),{user:t}=si(),n=Al(),r=n.get("reset")==="true",o=n.get("invited")==="true",i=n.get("redirect")||"/";return t?s(Il,{to:mde(i),replace:!0}):s(jv,{children:T(gde,{children:[s(X,{condition:r,show:T(Xt,{severity:"success",sx:{mb:4},children:[s(Mm,{children:"Success"}),"You successfully reset your password."]})}),s(X,{condition:o,show:T(Xt,{severity:"success",sx:{mb:4},children:[s(Mm,{children:"Success"}),"Your account has been created."]})}),s(X,{condition:(e==null?void 0:e.type)!==LO,show:s(vde,{children:"Log in to continue the great work"})}),s(hde,{redirect:i,invited:o})]})})},bde="P",wde="EEA",Sde="RE",N1="SE",xde="UG",Cde=e=>()=>{if(!e)return Promise.resolve({name:NO});const t=Ft(`auth/reset/validate?token=${e}`);return fetch(t,{method:"GET"}).then(n=>n.json())},NO="InvalidTokenError",Ede="UsedTokenError",MO=(e={})=>{const t=Al(),n=t.get("token")||"",[r,o]=f.useState(n),i=Cde(r),a=`auth/reset/validate?token=${r}`,{data:l,error:c}=gn(a,i,e),[u,d]=f.useState(!c&&!l),p=()=>{const m=t.get("token")||"";o(m)};f.useEffect(()=>{d(!c&&!l)},[l,c]);const h=!(!u&&(l==null?void 0:l.name)===NO||(l==null?void 0:l.name)===Ede);return{token:r,data:l,error:c,loading:u,isValidToken:h,setLoading:d,retry:p}},kde=(e,t)=>()=>{if(!e)return Promise.resolve(!1);const n=Ft(t);return fetch(n,{method:"GET"}).then(r=>r.status===tf)},BO=(e={})=>{const n=Al().get("invite")||"",r=`/invite/${n}/validate`,{data:o,error:i}=gn(r,kde(n,r),e),[a,l]=f.useState(!i&&!o);return f.useEffect(()=>{l(!i&&o===void 0)},[o,i]),{secret:n,isValid:o,error:i,loading:a}},TR="api/admin/invite-link/tokens",Tde=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o=f.useCallback(async l=>{const c=t(TR,{method:"POST",body:JSON.stringify(l)});return await e(c.caller,c.id)},[t,e]),i=f.useCallback(async(l,c)=>{const u=t(`${TR}/${l}`,{method:"PUT",body:JSON.stringify({...c.expiresAt?{expiresAt:c.expiresAt}:{},...c.enabled!==void 0?{enabled:c.enabled}:{}})});return await e(u.caller,u.id)},[t,e]),a=f.useCallback(async(l,c)=>{const u=t(`/invite/${l}/signup`,{method:"POST",body:JSON.stringify(c)});return await e(u.caller,u.id)},[t,e]);return{createToken:o,updateToken:i,addUser:a,errors:n,loading:r}},FO=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{resetPassword:f.useCallback(i=>{const a=t("auth/reset/password",{method:"POST",body:JSON.stringify(i)});return e(a.caller,a.id)},[t,e]),errors:n,loading:r}},_de=E("span")(({theme:e})=>({display:"inline-grid",alignItems:"center",outline:0,cursor:"pointer","&:is(:focus-visible, :active) > *, &:hover > *":{outlineStyle:"solid",outlineWidth:2,outlineOffset:0,outlineColor:e.palette.primary.main,borderRadius:"100%",color:e.palette.primary.main},"& svg":{fontSize:e.fontSizes.mainHeader,color:e.palette.neutral.main,marginLeft:e.spacing(.5)}})),Km=({tooltip:e,placement:t,children:n})=>s(Tt,{title:e,placement:t,arrow:!0,children:s(_de,{tabIndex:0,"aria-label":"Help",children:n??s(Bx,{})})}),Rde="The password must be at least 10 characters long.",Pde="The password must contain at least one number.",$de="The password must contain at least one special character.",Ide="The password must contain at least one uppercase letter.",Ade="The password must contain at least one lowercase letter.",Ode="The password may not contain sequences of three or more repeated characters.",zO="The password must be at least 10 characters long and must include an uppercase letter, a lowercase letter, a number, and a symbol.",Lde=E(ke)(({theme:e})=>({marginBottom:"0",display:"flex",alignItems:"center",gap:"1ch"})),Dde=E("div")(({theme:e})=>({border:"1px solid #f1f1f1",borderRadius:e.shape.borderRadius,position:"relative",maxWidth:"350px",color:"#44606e"})),Nde=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Ga=E("div")(({theme:e})=>({width:"95px",margin:e.spacing(0,.5),display:"flex",justifyContent:"center"})),Mde=E("div")(({theme:e})=>({backgroundColor:e.palette.neutral.light,height:"1px",width:"100%"})),Bde=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Fde=E(Xt)(({theme:e})=>({marginTop:e.spacing(1),bottom:"0",position:"absolute"})),fh=E("div",{shouldForwardProp:e=>e!=="error"})(({theme:e,error:t})=>({width:"50px",borderRadius:e.shape.borderRadius,height:"6px",backgroundColor:t?"red":e.palette.primary.main})),jO=({password:e,callback:t,style:n={}})=>{const[r,o]=f.useState(!0),[i,a]=f.useState(!0),[l,c]=f.useState(!0),[u,d]=f.useState(!0),[p,h]=f.useState(!1),m=f.useCallback(()=>{const g=Ft("auth/reset/validate-password");return fetch(g,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({password:e})})},[e]),y=f.useCallback(()=>{b(!1)},[]),v=f.useCallback(async()=>{if(!e){b(!0);return}if(e.length<3){d(!0);return}try{const g=await m();if(g.status===Ux){const S=await g.json();w(S),t(!1)}g.status===tf&&(y(),h(!1),t(!0))}catch{console.log("An exception was caught and handled")}},[m,t,e,y]);f.useEffect(()=>{v()},[e,v]);const b=g=>{o(g),a(g),c(g),d(g)},w=g=>{const S=g.details[0].validationErrors;S.includes(Pde)?a(!0):a(!1),S.includes($de)?c(!0):c(!1),S.includes(Rde)?d(!0):d(!1),S.includes(Ade)||S.includes(Ide)?o(!0):o(!1),S.includes(Ode)?h(!0):h(!1)};return T(Re,{children:[T(Lde,{variant:"body2","data-loading":!0,children:["Please set a strong password",s(Km,{tooltip:zO})]}),T(Dde,{style:{...n},children:[T(Nde,{children:[s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Length"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Casing"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Number"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Symbol"})})]}),s(Mde,{}),T(Bde,{children:[s(Ga,{children:s(fh,{error:u,"data-loading":!0})}),s(Ga,{children:s(fh,{error:r,"data-loading":!0})})," ",s(Ga,{children:s(fh,{error:i,"data-loading":!0})}),s(Ga,{children:s(fh,{error:l,"data-loading":!0})})]}),s(X,{condition:p,show:s(Fde,{severity:"error",children:"You may not repeat three characters in a row."})})]})]})};var BC={},zde=fn;Object.defineProperty(BC,"__esModule",{value:!0});var UO=BC.default=void 0,jde=zde(En()),Ude=kn,Wde=(0,jde.default)((0,Ude.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");UO=BC.default=Wde;const Hde=E("div")(({theme:e})=>({position:"relative",paddingTop:e.spacing(.5)})),Vde=E(ke,{shouldForwardProp:e=>e!=="matchingPasswords"})(({theme:e,matchingPasswords:t})=>({position:"absolute",bottom:"-8px",display:"flex",alignItems:"center",color:t?e.palette.primary.main:e.palette.error.main})),Gde=E(UO)(({theme:e})=>({marginRight:"5px"})),WO=({started:e,matchingPasswords:t})=>s(Hde,{children:s(X,{condition:e,show:T(Vde,{variant:"body2","data-loading":!0,matchingPasswords:t,children:[s(Gde,{})," ",s(X,{condition:t,show:s(ke,{children:" Passwords match"}),elseShow:s(ke,{children:" Passwords do not match"})})]})})}),qde=E("form")(({theme:e})=>({display:"flex",flexDirection:"column",position:"relative","& > *":{marginTop:`${e.spacing(1)} !important`,marginBottom:`${e.spacing(1)} !important`}})),Yde=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto"),display:"block"})),HO=({onSubmit:e})=>{const[t,n]=f.useState(""),[r,o]=f.useState(!1),[i,a]=f.useState(""),[l,c]=f.useState(!1),[u,d]=f.useState(!1),p=l&&u,h=f.useCallback(d,[d]);f.useEffect(()=>{t||d(!1),c(t===i)},[t,i]);const m=v=>{v.preventDefault(),p&&e(t)},y=Boolean(t&&i);return T(qde,{onSubmit:m,children:[s(Yc,{placeholder:"Password",value:t||"",onChange:v=>n(v.target.value),onFocus:()=>o(!0),autoComplete:"new-password","data-loading":!0}),s(Yc,{value:i||"",placeholder:"Confirm password",onChange:v=>a(v.target.value),autoComplete:"new-password","data-loading":!0}),s(X,{condition:r,show:s(jO,{password:t,callback:h,style:{marginBottom:"1rem"}})}),s(WO,{started:y,matchingPasswords:l}),s(Yde,{variant:"contained",color:"primary",type:"submit","data-loading":!0,disabled:!p,children:"Submit"})]})},VO=()=>{const{authDetails:e}=mu(),{classes:t}=lf(),n=(e==null?void 0:e.defaultHidden)===!0,{secret:r}=BO();return T("div",{className:yi(t.contentSpacingY,t.flexColumn,t.itemsCenter),children:[s(ke,{variant:"h2",className:t.title,children:"Invalid token"}),s(X,{condition:n,show:T(Re,{children:[s(ke,{variant:"subtitle1",children:"Your instance does not support password authentication. Use correct work email to access your account."}),s(rt,{variant:"contained",color:"primary",component:on,to:"/login",children:"Login"})]}),elseShow:s(X,{condition:Boolean(r),show:s(ke,{variant:"subtitle1",children:"Provided invite link is invalid or expired. Please request a new URL in order to create your account."}),elseShow:T(Re,{children:[s(ke,{variant:"subtitle1",children:"Your token has either been used to reset your password, or it has expired. Please request a new reset password URL in order to reset your password."}),s(rt,{variant:"contained",color:"primary",component:on,to:"/forgotten-password","data-testid":Hte,children:"Reset password"})]})})})]})},_R=({children:e,loading:t,title:n})=>{const r=Lv(t||!1);return s("div",{ref:r,children:s(jv,{showMenu:!1,BannerComponent:s(OO,{title:"Unleash"}),children:T(Je,{sx:{width:["100%","350px"]},children:[s(X,{condition:Boolean(n),show:s(ke,{component:"h2",sx:{fontSize:o=>o.fontSizes.mainHeader,marginBottom:2,textAlign:"center",fontWeight:o=>o.fontWeight.bold},children:n})}),e]})})})},GO=()=>T(Xt,{severity:"error","data-loading":!0,children:[s(Mm,{children:"Unable to reset password"}),"Something went wrong when attempting to update your password. This could be due to unstable internet connectivity. If retrying the request does not work, please try again later."]}),Kde=()=>{var O,L;const{authDetails:e}=mu(),{setToastApiError:t}=It(),n=ft(),[r,o]=f.useState(!1),[i,a]=f.useState(""),[l,c]=f.useState(""),{token:u,data:d,loading:p,isValidToken:h}=MO(),{secret:m,loading:y,isValid:v}=BO(),{addUser:b,loading:w}=Tde(),{resetPassword:g,loading:S}=FO(),C=(e==null?void 0:e.defaultHidden)===!0,R=async I=>{try{(await b(m,{name:l,email:i,password:I})).status===Ste?n("/login?invited=true"):t("Couldn't create user. Check if your invite link is valid.")}catch(A){t(ht(A))}},k=async I=>{try{(await g({token:u,password:I})).status===tf?n("/login?reset=true"):o(!0)}catch{o(!0)}},P=I=>{v?R(I):k(I)};return h===!1&&v==!1?s(_R,{loading:p||y,children:s(VO,{})}):T(_R,{loading:p||y||w||S,title:C?"Connect your account and start your journey":"Enter your personal details and start your journey",children:[s(X,{condition:d==null?void 0:d.createdBy,show:T(ke,{variant:"body1","data-loading":!0,sx:{textAlign:"center",mb:2},children:[d==null?void 0:d.createdBy,s("br",{})," has invited you to join Unleash."]})}),T(ke,{color:"text.secondary",children:["We suggest using"," ",s(ke,{component:"strong",fontWeight:"bold",children:"the email you use for work"}),"."]}),s(X,{condition:Boolean((O=e==null?void 0:e.options)==null?void 0:O.length),show:s(Je,{sx:{mt:2},children:s(MC,{options:e==null?void 0:e.options})})}),s(X,{condition:Boolean((L=e==null?void 0:e.options)==null?void 0:L.length)&&!C,show:s(Wv,{text:"or sign-up with an email address","data-loading":!0})}),s(X,{condition:!C,show:T(Re,{children:[s(X,{condition:d==null?void 0:d.email,show:()=>s(ke,{"data-loading":!0,variant:"body1",sx:{my:1},children:"Your username is"})}),s(pn,{"data-loading":!0,type:"email",value:h?(d==null?void 0:d.email)||"":i,id:"email",label:"Email",variant:"outlined",size:"small",sx:{my:1},disabled:h,fullWidth:!0,required:!0,onChange:I=>{h||a(I.target.value)}}),s(X,{condition:Boolean(v),show:()=>s(pn,{"data-loading":!0,value:l,id:"username",label:"Full name",variant:"outlined",size:"small",sx:{my:1},fullWidth:!0,required:!0,onChange:I=>{c(I.target.value)}})}),s(ke,{variant:"body1","data-loading":!0,sx:{mt:2},children:"Set a password for your account."}),s(X,{condition:r&&h,show:s(GO,{})}),s(HO,{onSubmit:P})]})})]})},Xde=E("div")(({theme:e})=>({width:"350px",maxWidth:"350px",[e.breakpoints.down("sm")]:{width:"100%"}})),Jde=E(ke)(({theme:e})=>({fontWeight:"bold",fontSize:e.spacing(2.5),marginBottom:e.spacing(2)})),Qde=()=>{const{token:e,loading:t,isValidToken:n}=MO(),{resetPassword:r,loading:o}=FO(),{authDetails:i}=mu(),a=Lv(t||o),l=ft(),[c,u]=f.useState(!1),d=(i==null?void 0:i.defaultHidden)===!0;return s("div",{ref:a,children:s(jv,{children:s(Xde,{children:s(X,{condition:!n||d,show:s(VO,{}),elseShow:T(Re,{children:[s(Jde,{variant:"h2","data-loading":!0,children:"Reset password"}),s(X,{condition:c,show:s(GO,{})}),s(HO,{onSubmit:async h=>{try{(await r({token:e,password:h})).status===tf?(l("/login?reset=true"),u(!1)):u(!0)}catch{u(!0)}}})]})})})})})},Zde=E("div")(({theme:e})=>({...sf,..._3,width:"350px",[e.breakpoints.down("sm")]:{width:"100%"}})),epe=E("strong")(({theme:e})=>({display:"block",margin:e.spacing(1,0)})),tpe=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto")})),npe=E("h2")(({theme:e})=>({...Yne(e),...T3})),rpe=E("form")(({theme:e})=>({...sf(e),..._3})),ope=E(ke)(({theme:e})=>({...T3})),ipe=()=>{const[e,t]=f.useState(""),[n,r]=f.useState(!1),[o,i]=f.useState(!1),[a,l]=f.useState(""),c=Lv(o);return s(jv,{children:T(Zde,{ref:c,children:[s(npe,{"data-loading":!0,children:"Forgotten password"}),s(X,{condition:n,show:T(Xt,{severity:"success","data-loading":!0,children:[s(Mm,{children:"Attempted to send email"}),"We've attempted to send a reset password email to:",s(epe,{children:a}),"If you did not receive an email, please verify that you typed in the correct email, and contact your administrator to make sure that you are in the system."]})}),T(rpe,{onSubmit:async d=>{d.preventDefault(),i(!0),l(e);const p=Ft("auth/reset/password-email");await fetch(p,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({email:e})}),r(!0),i(!1)},children:[s(ope,{variant:"body1","data-loading":!0,children:"Please provide your email address. If it exists in the system we'll send a new reset link."}),s(pn,{variant:"outlined",size:"small",placeholder:"email",type:"email","data-loading":!0,"data-testid":Wte,value:e,onChange:d=>{t(d.target.value)}}),s(tpe,{variant:"contained",type:"submit","data-loading":!0,color:"primary",disabled:o,children:s(X,{condition:!n,show:s("span",{children:"Submit"}),elseShow:s("span",{children:"Try again"})})}),s(Wv,{text:"Or log in"}),s(rt,{type:"submit","data-loading":!0,variant:"outlined",disabled:o,component:on,to:"/login",sx:d=>({width:"150px",margin:d.spacing(2,"auto")}),children:"Log in"})]})]})})},qO=e=>{const t=()=>{const r=Ft(`api/admin/projects/${e}`);return fetch(r,{method:"GET"}).then(Cn("Project overview")).then(o=>o.json())},n=`api/admin/projects/${e}`;return{fetcher:t,KEY:n}};var FC={},ape=fn;Object.defineProperty(FC,"__esModule",{value:!0});var zC=FC.default=void 0,spe=ape(En()),lpe=kn,cpe=(0,spe.default)((0,lpe.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");zC=FC.default=cpe;const upe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),{setToastData:o,setToastApiError:i}=It(),{trackEvent:a}=Is(),l=f.useCallback(async u=>{const d=`api/admin/projects/${u}/favorites`,p=t(d,{method:"POST"},"addFavoriteProject");try{await e(p.caller,p.id),o({title:"Project added to favorites",type:"success"}),a("favorite",{props:{eventType:"project favorited"}})}catch(h){i(ht(h))}},[t,e]),c=f.useCallback(async u=>{const d=`api/admin/projects/${u}/favorites`,p=t(d,{method:"DELETE"},"removeFavoriteProject");try{await e(p.caller,p.id),o({title:"Project removed from favorites",type:"success"}),a("favorite",{props:{eventType:"project unfavorited"}})}catch(h){i(ht(h))}},[t,e]);return{favorite:l,unfavorite:c,errors:n,loading:r}},dpe=({isFavorite:e,size:t="large",...n})=>s(du,{title:e?"Remove from favorites":"Add to favorites",children:s(Qt,{size:t,"data-loading":!0,...n,children:s(X,{condition:e,show:s(zx,{color:"primary",sx:{fontSize:r=>t==="medium"?r.spacing(2):r.spacing(3)}}),elseShow:s(jx,{sx:{fontSize:r=>t==="medium"?r.spacing(2):r.spacing(3)}})})})}),jC=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createProject:async b=>{const g=t("api/admin/projects",{method:"POST",body:JSON.stringify(b)});try{return await e(g.caller,g.id)}catch(S){throw S}},validateId:async b=>{const g=t("api/admin/projects/validate",{method:"POST",body:JSON.stringify(b)});try{return await e(g.caller,g.id)}catch(S){throw S}},editProject:async(b,w)=>{const g=`api/admin/projects/${b}`,S=t(g,{method:"PUT",body:JSON.stringify(w)});try{return await e(S.caller,S.id)}catch(C){throw C}},deleteProject:async b=>{const w=`api/admin/projects/${b}`,g=t(w,{method:"DELETE"});try{return await e(g.caller,g.id)}catch(S){throw S}},addEnvironmentToProject:async(b,w)=>{const g=`api/admin/projects/${b}/environments`,S=t(g,{method:"POST",body:JSON.stringify({environment:w})});try{return await e(S.caller,S.id)}catch(C){throw C}},removeEnvironmentFromProject:async(b,w)=>{const g=`api/admin/projects/${b}/environments/${w}`,S=t(g,{method:"DELETE"});try{return await e(S.caller,S.id)}catch(C){throw C}},addAccessToProject:async(b,w,g)=>{const S=`api/admin/projects/${b}/role/${w}/access`,C=t(S,{method:"POST",body:JSON.stringify(g)});try{return await e(C.caller,C.id)}catch(R){throw R}},removeUserFromRole:async(b,w,g)=>{const S=`api/admin/projects/${b}/users/${g}/roles/${w}`,C=t(S,{method:"DELETE"});try{return await e(C.caller,C.id)}catch(R){throw R}},removeGroupFromRole:async(b,w,g)=>{const S=`api/admin/projects/${b}/groups/${g}/roles/${w}`,C=t(S,{method:"DELETE"});try{return await e(C.caller,C.id)}catch(R){throw R}},changeUserRole:(b,w,g)=>{const S=`api/admin/projects/${b}/users/${g}/roles/${w}`,C=t(S,{method:"PUT"});return e(C.caller,C.id)},changeGroupRole:(b,w,g)=>{const S=`api/admin/projects/${b}/groups/${g}/roles/${w}`,C=t(S,{method:"PUT"});return e(C.caller,C.id)},errors:n,loading:r,searchProjectUser:async b=>{const w=`api/admin/user-admin/search?q=${b}`,g=t(w,{method:"GET"});try{return await e(g.caller,g.id)}catch(S){throw S}}}},ppe=({open:e,onClose:t,project:n,onSuccess:r})=>{const{deleteProject:o}=jC(),{refetch:i}=ja(),{setToastData:a,setToastApiError:l}=It();return s(cr,{open:e,onClick:async u=>{u.preventDefault();try{await o(n),i(),a({title:"Deleted project",type:"success",text:"Successfully deleted project"}),r==null||r()}catch(d){l(ht(d))}t==null||t()},onClose:t,title:"Really delete project"})},fpe=e=>f.createElement("svg",{width:88,height:40,viewBox:"0 0 88 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{width:9,height:39,fill:"#635DC5"}),f.createElement("rect",{x:13,width:10,height:39,fill:"#635DC5"}),f.createElement("rect",{x:27,y:6,width:9,height:33,fill:"#635DC5"}),f.createElement("rect",{x:40,y:12,width:9,height:27,fill:"#635DC5"}),f.createElement("rect",{x:52,y:15,width:9,height:24,fill:"#635DC5"}),f.createElement("rect",{x:65.0752,y:15.2578,width:9.2957,height:23.9101,fill:"#635DC5"}),f.createElement("rect",{x:78.355,y:19.0352,width:9.2957,height:20.1348,fill:"#635DC5"})),hpe=E(S4)(({theme:e})=>({padding:e.spacing(1,2,2,2),width:"220px",height:"204px",display:"flex",flexDirection:"column",justifyContent:"space-between",margin:e.spacing(1),boxShadow:"none",border:`1px solid ${e.palette.tertiary.contrast}`,[e.breakpoints.down("sm")]:{justifyContent:"center"},"&:hover":{transition:"background-color 0.2s ease-in-out",backgroundColor:e.palette.projectCard.hover}})),mpe=E("div")(()=>({...$v,width:"100%"})),gpe=E("h2")(({theme:e})=>({fontWeight:"normal",fontSize:e.fontSizes.bodySize,lineClamp:2,display:"-webkit-box",boxOrient:"vertical",textOverflow:"ellipsis",overflow:"hidden",alignItems:"flex-start"})),vpe=E(Je)(()=>({...$v,marginRight:"auto"})),ype=E(ea)(({theme:e})=>({color:e.palette.neutral.main,marginRight:e.spacing(1)})),bpe=E(ti)(({theme:e})=>({color:e.palette.neutral.main,marginRight:e.spacing(1)})),wpe=E(fpe)(({theme:e})=>({margin:e.spacing(2,"auto"),width:"80px",display:"block"})),Spe=E("div")(({theme:e})=>({display:"flex",justifyContent:"space-between",fontSize:e.fontSizes.smallerBody})),M1=E("div")(()=>({textAlign:"center"})),B1=E("p")(({theme:e})=>({color:e.palette.projectCard.textColor,fontWeight:"bold"})),RR=({name:e,featureCount:t,health:n,memberCount:r,onHover:o,id:i,isFavorite:a=!1})=>{const{hasAccess:l}=f.useContext(Qr),{isOss:c}=Lt(),[u,d]=f.useState(null),[p,h]=f.useState(!1),m=ft(),{favorite:y,unfavorite:v}=upe(),{refetch:b}=ja(),w=C=>{C.preventDefault(),d(C.currentTarget)},g=l(Soe,i)&&i!==Xh;return T(hpe,{onMouseEnter:o,children:[T(mpe,{"data-loading":!0,children:[T(vpe,{children:[s(dpe,{onClick:async C=>{C.preventDefault(),a?await v(i):await y(i),b()},isFavorite:a,size:"medium",sx:{ml:-1}}),s(gpe,{children:e})]}),s(mr,{style:{transform:"translateX(7px)"},permission:Vb,hidden:c(),projectId:i,"data-loading":!0,onClick:w,tooltipProps:{title:"Options"},children:s(zC,{})}),T($x,{id:"project-card-menu",open:Boolean(u),anchorEl:u,style:{top:0,left:-100},onClick:C=>{C.preventDefault()},onClose:C=>{C.preventDefault(),d(null)},children:[T(ws,{onClick:C=>{C.preventDefault(),m(Mse(i))},children:[s(ype,{}),"Edit project"]}),T(ws,{onClick:C=>{C.preventDefault(),h(!0)},disabled:!g,children:[s(bpe,{}),i===Xh&&!g?"You can't delete the default project":"Delete project"]})]})]}),s("div",{"data-loading":!0,children:s(wpe,{})}),T(Spe,{children:[T(M1,{children:[s(B1,{"data-loading":!0,children:t}),s("p",{"data-loading":!0,children:"toggles"})]}),T(M1,{children:[T(B1,{"data-loading":!0,children:[n,"%"]}),s("p",{"data-loading":!0,children:"health"})]}),s(X,{condition:i!==Xh,show:T(M1,{children:[s(B1,{"data-loading":!0,children:r}),s("p",{"data-loading":!0,children:"members"})]})})]}),s(ppe,{project:i,open:p,onClose:()=>{d(null),h(!1)}})]})},xpe=[{id:"loading1",name:"loading1",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading2",name:"loading2",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading3",name:"loading3",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading4",name:"loading4",memberCount:1,health:95,featureCount:4,createdAt:"",description:""}],YO=({Icon:e,onClick:t,maxWidth:n,disabled:r=!1,children:o,permission:i,environmentId:a,projectId:l,...c})=>{const u=Er(`(max-width:${n})`);return s(X,{condition:u,show:s(mr,{disabled:r,onClick:t,permission:i,projectId:l,environmentId:a,"data-loading":!0,...c,children:s(e,{})}),elseShow:s(Io,{onClick:t,permission:i,projectId:l,color:"primary",variant:"contained",disabled:r,environmentId:a,"data-loading":!0,...c,children:o})})},Cpe=({className:e,onClick:t,text:n,...r})=>s(Xt,{className:e||"",action:s(rt,{color:"inherit",size:"small",onClick:t,children:"TRY AGAIN"}),severity:"error",...r,children:n}),KO=e=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M11.2608 0.811331C11.6574 0.375976 12.3426 0.375977 12.7392 0.811332L14.0529 2.25322C14.316 2.54202 14.7233 2.65114 15.0955 2.53259L16.9542 1.94073C17.5154 1.76203 18.1087 2.10458 18.2345 2.67993L18.6513 4.58549C18.7347 4.96716 19.0328 5.26527 19.4145 5.34875L21.3201 5.7655C21.8954 5.89133 22.238 6.48465 22.0593 7.04583L21.4674 8.90447C21.3489 9.27675 21.458 9.68397 21.7468 9.9471L23.1887 11.2608C23.624 11.6574 23.624 12.3426 23.1887 12.7392L21.7468 14.0529C21.458 14.316 21.3489 14.7233 21.4674 15.0955L22.0593 16.9542C22.238 17.5154 21.8954 18.1087 21.3201 18.2345L19.4145 18.6513C19.0328 18.7347 18.7347 19.0328 18.6513 19.4145L18.2345 21.3201C18.1087 21.8954 17.5154 22.238 16.9542 22.0593L15.0955 21.4674C14.7233 21.3489 14.316 21.458 14.0529 21.7468L12.7392 23.1887C12.3426 23.624 11.6574 23.624 11.2608 23.1887L9.9471 21.7468C9.68397 21.458 9.27675 21.3489 8.90447 21.4674L7.04583 22.0593C6.48465 22.238 5.89133 21.8954 5.7655 21.3201L5.34875 19.4145C5.26527 19.0328 4.96716 18.7347 4.58549 18.6513L2.67993 18.2345C2.10458 18.1087 1.76203 17.5154 1.94073 16.9542L2.53259 15.0955C2.65114 14.7233 2.54202 14.316 2.25322 14.0529L0.811331 12.7392C0.375976 12.3426 0.375977 11.6574 0.811332 11.2608L2.25322 9.9471C2.54202 9.68397 2.65114 9.27675 2.53259 8.90447L1.94073 7.04583C1.76203 6.48465 2.10458 5.89133 2.67993 5.7655L4.58549 5.34875C4.96716 5.26527 5.26527 4.96716 5.34875 4.58549L5.7655 2.67993C5.89133 2.10458 6.48465 1.76203 7.04583 1.94073L8.90447 2.53259C9.27675 2.65114 9.68397 2.54202 9.9471 2.25322L11.2608 0.811331Z",fill:"#1A4049"}),f.createElement("path",{d:"M10.4351 7.3042H7.30469V16.6955H16.696V7.3042H13.5656V13.5651H10.4351V7.3042Z",fill:"white"}),f.createElement("path",{d:"M13.5664 13.5649H16.6968V16.6954H13.5664V13.5649Z",fill:"#817AFE"})),Epe=E(Je,{shouldForwardProp:e=>e!=="tooltip"})(({theme:e,tooltip:t})=>({display:"flex",flexDirection:"column",alignItems:t?"start":"center",textAlign:t?"left":"center",backgroundColor:t?"transparent":e.palette.secondaryContainer,borderRadius:t?0:e.shape.borderRadiusLarge,padding:t?e.spacing(1,.5):e.spacing(7.5,1)})),kpe=E(ke)(({theme:e})=>({display:"inline-flex",alignItems:"center",fontWeight:e.fontWeight.bold,gap:e.spacing(1)})),PR=E("div",{shouldForwardProp:e=>e!=="tooltip"})(({theme:e,tooltip:t})=>({margin:t?e.spacing(1,0):e.spacing(3,0,5,0)})),F1=E(ke)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),$R=E("div")(()=>({display:"flex"})),IR=E(po)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),Tpe={"adding-new-projects":{plan:"Pro & Enterprise",url:"",label:"Adding new projects"},access:{plan:"Pro & Enterprise",url:"https://docs.getunleash.io/reference/rbac",label:"Access"},"change-requests":{plan:"Enterprise",url:"https://docs.getunleash.io/reference/change-requests",label:"Change Requests"}},_pe="https://www.getunleash.io/plans",Rpe=({feature:e,tooltip:t})=>{const{url:n,plan:r,label:o}=Tpe[e],i=Is(),a=()=>{i.trackEvent("upgrade_plan_clicked",{props:{feature:o}})},l=Boolean(n)?s(IR,{href:n,target:"_blank",children:o}):o,c=T(Re,{children:[l," is a feature available for the"," ",s("strong",{children:r})," ",r==="Pro & Enterprise"?"plans":"plan"]}),u=`${_pe}?feature=${e}`;return T(Epe,{tooltip:t,children:[T(kpe,{children:[s(KO,{}),`${r} feature`]}),s(X,{condition:Boolean(t),show:T(Re,{children:[s(PR,{tooltip:!0,children:T(F1,{children:[c,". You need to upgrade your plan if you want to use it"]})}),s($R,{children:s(IR,{href:u,target:"_blank",onClick:a,children:"Upgrade now"})})]}),elseShow:T(Re,{children:[T(PR,{children:[s(F1,{children:c}),s(F1,{children:"You need to upgrade your plan if you want to use it"})]}),s($R,{children:s(rt,{variant:"outlined",href:u,target:"_blank",onClick:a,children:"Upgrade now"})})]})})]})},Ppe=E("div")(({theme:e})=>({display:"flex",flexWrap:"wrap",[e.breakpoints.down("sm")]:{justifyContent:"center"}})),$pe=E(Cpe)(({theme:e})=>({maxWidth:"400px",marginBottom:e.spacing(2)})),Ipe=E(on)(({theme:e})=>({color:"inherit",textDecoration:"none",border:"none",padding:"0",background:"transparent",fontFamily:e.typography.fontFamily,pointer:"cursor"}));function Ape(e,t){return e?{disabled:!0,tooltip:{titleComponent:s(Rpe,{feature:"adding-new-projects",tooltip:!0}),sx:{maxWidth:"320px"},variant:"custom"},endIcon:s(KO,{})}:t?{tooltip:{title:"Click to create a new project"},disabled:!1}:{tooltip:{title:"You do not have permission to create new projects"},disabled:!0}}const Ope=()=>{const{hasAccess:e}=f.useContext(Qr),t=ft(),{projects:n,loading:r,error:o,refetch:i}=ja(),[a,l]=f.useState({}),{isOss:c}=Lt(),u=Er(Wc.breakpoints.down("md")),[d,p]=jp(),[h,m]=f.useState(d.get("search")||"");f.useEffect(()=>{const S={};h&&(S.search=h),p(S,{replace:!0})},[h,p]);const y=f.useMemo(()=>{const S=mC(h,"i");return(h?n.filter(C=>S.test(C.name)):n).sort((C,R)=>C!=null&&C.favorite&&!(R!=null&&R.favorite)?-1:!(C!=null&&C.favorite)&&(R!=null&&R.favorite)?1:0)},[n,h]),v=S=>{if(a[S])return;const{KEY:C,fetcher:R}=qO(S);Vr(C,R),l(k=>({...k,[S]:!0}))},b=Ape(c(),e(Z_)),w=()=>s($pe,{onClick:i,text:"Error fetching projects"});let g=y.length<n.length?`${y.length} of ${n.length}`:n.length;return T(gr,{isLoading:r,header:s(xn,{title:`Projects (${g})`,actions:T(Re,{children:[s(X,{condition:!u,show:T(Re,{children:[s(go,{initialValue:h,onChange:m}),s(xn.Divider,{})]})}),s(YO,{Icon:Si,endIcon:b.endIcon,onClick:()=>t("/projects/create"),maxWidth:"700px",permission:Z_,disabled:b.disabled,tooltipProps:b.tooltip,children:"New project"})]}),children:s(X,{condition:u,show:s(go,{initialValue:h,onChange:m})})}),children:[s(X,{condition:o,show:w()}),s(Ppe,{children:s(X,{condition:y.length<1&&!r,show:s(X,{condition:(h==null?void 0:h.length)>0,show:T(Zn,{children:["No projects found matching “",h,"”"]}),elseShow:s(Zn,{children:"No projects available."})}),elseShow:s(X,{condition:r,show:()=>xpe.map(S=>s(RR,{"data-loading":!0,onHover:()=>{},name:S.name,id:S.id,memberCount:2,health:95,featureCount:4},S.id)),elseShow:()=>y.map(S=>s(Ipe,{to:`/projects/${S.id}`,children:s(RR,{onHover:()=>v(S.id),name:S.name,memberCount:S.memberCount??0,health:S.health,id:S.id,featureCount:S.featureCount,isFavorite:S.favorite})},S.id))})})})]})},Lpe=()=>s(Il,{to:"/archive",replace:!0}),gu=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{validateEnvName:async h=>{const y=t("api/admin/environments/validate",{method:"POST",body:JSON.stringify({name:h})},"validateEnvName");try{return await e(y.caller,y.id,!1)}catch(v){throw v}},createEnvironment:async h=>{const y=t("api/admin/environments",{method:"POST",body:JSON.stringify(h)},"createEnvironment");try{return await e(y.caller,y.id)}catch(v){throw v}},errors:n,loading:r,deleteEnvironment:async h=>{const m=`api/admin/environments/${h}`,y=t(m,{method:"DELETE"},"deleteEnvironment");try{return await e(y.caller,y.id)}catch(v){throw v}},updateEnvironment:async(h,m)=>{const y=`api/admin/environments/update/${h}`,v=t(y,{method:"PUT",body:JSON.stringify(m)},"updateEnvironment");try{return await e(v.caller,v.id)}catch(b){throw b}},cloneEnvironment:async(h,m)=>{const y=`api/admin/environments/${h}/clone`,v=t(y,{method:"POST",body:JSON.stringify(m)},"cloneEnvironment");return await e(v.caller,v.id)},changeSortOrder:async h=>{const y=t("api/admin/environments/sort-order",{method:"PUT",body:JSON.stringify(h)},"changeSortOrder");try{return await e(y.caller,y.id)}catch(v){throw v}},toggleEnvironmentOff:async h=>{const m=`api/admin/environments/${h}/off`,y=t(m,{method:"POST"},"toggleEnvironmentOff");try{return await e(y.caller,y.id)}catch(v){throw v}},toggleEnvironmentOn:async h=>{const m=`api/admin/environments/${h}/on`,y=t(m,{method:"POST"},"toggleEnvironmentOn");try{return await e(y.caller,y.id)}catch(v){throw v}}}},Dpe=e=>e.reduce((t,n,r)=>(t[n.name]=r+1,t),{}),XO=(e="",t="development")=>{const[n,r]=f.useState(e),[o,i]=f.useState(t),[a,l]=f.useState({});f.useEffect(()=>{r(e)},[e]),f.useEffect(()=>{i(t)},[t]);const{validateEnvName:c}=gu();return{name:n,setName:r,type:o,setType:i,getEnvPayload:()=>({name:n,type:o}),validateEnvironmentName:async()=>{if(n.length===0)return l(h=>({...h,name:"Environment name can not be empty"})),!1;try{return await c(n),!0}catch(h){return l(m=>({...m,name:ht(h)})),!1}},clearErrors:()=>{l({})},errors:a}},Npe=ai()(e=>({helperText:{position:"absolute",bottom:"-1rem"}})),Mpe=E("div")(({theme:e})=>({width:"100%",position:"relative"})),_r=({label:e,placeholder:t,error:n,errorText:r,style:o,className:i,value:a,onChange:l,...c})=>{const{classes:u}=Npe();return s(Mpe,{"data-loading":!0,children:s(pn,{size:"small",variant:"outlined",label:e,placeholder:t,error:n,helperText:r,style:o,className:i||"",value:a,onChange:l,FormHelperTextProps:{["data-testid"]:S3,classes:{root:u.helperText}},...c})})},Bpe=E(Ax)({flexDirection:"row"}),AR=E("div")({display:"flex",flexDirection:"column"}),JO=({onChange:e,value:t})=>s(Da,{component:"fieldset",children:T(Bpe,{"data-loading":!0,value:t,onChange:e,children:[T(AR,{children:[s(xr,{value:"development",label:"Development",control:s(ll,{})}),s(xr,{value:"test",label:"Test",control:s(ll,{})})]}),T(AR,{children:[s(xr,{value:"preproduction",label:"Pre production",control:s(ll,{})}),s(xr,{value:"production",label:"Production",control:s(ll,{})})]})]})}),OR={FIX:"fix",VARIABLE:"variable"},z1=e=>t=>{if(t.flag){const n=e.flags;return Boolean(n[t.flag])}return t.configFlag?Boolean(e[t.configFlag]):!0},Fpe=()=>{window.scrollTo(0,0)},Cs=e=>e&&e.trim?e.trim():e,zpe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")+"T"+Cp(t,"HH:mm")},QO=e=>{const t=new Date(e);if(hC(t))return t},B5e=e=>e/10;function F5e(e,t){if(e.length===0)return[];const n=e.reduce(({remainingPercentage:a,variableVariantCount:l},c)=>(c.weight&&c.weightType===OR.FIX?a-=Number(c.weight):l+=1,{remainingPercentage:a,variableVariantCount:l}),{remainingPercentage:t,variableVariantCount:0}),{remainingPercentage:r,variableVariantCount:o}=n;if(r<0)throw new Error("The traffic distribution total must equal 100%");if(!o)throw new Error("There must be at least one variable variant");const i=parseInt(String(r/o));return e.map(a=>(a.weightType!==OR.FIX&&(a.weight=i),a))}const z5e={overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.25)",zIndex:5},content:{width:"500px",maxWidth:"90%",margin:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",transform:"translate(-50%, -50%)"}},jpe=E("form")({display:"flex",flexDirection:"column",height:"100%"}),Upe=E("h3")({fontWeight:"normal",marginTop:"0"}),Wpe=E("div")({maxWidth:"440px"}),LR=E("p")(({theme:e})=>({marginBottom:e.spacing(1)})),Hpe=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),Vpe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),Gpe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),ZO=({children:e,handleSubmit:t,handleCancel:n,name:r,type:o,setName:i,setType:a,validateEnvironmentName:l,errors:c,mode:u,clearErrors:d})=>T(jpe,{onSubmit:t,children:[s(Upe,{children:"Environment information"}),T(Wpe,{children:[s(LR,{children:"What is your environment name? (Can't be changed later)"}),s(Hpe,{label:"Environment name",value:r,onChange:p=>i(Cs(p.target.value)),error:Boolean(c.name),errorText:c.name,onFocus:()=>d(),onBlur:l,disabled:u==="Edit",autoFocus:!0}),s(LR,{children:"What type of environment do you want to create?"}),s(JO,{onChange:p=>a(p.currentTarget.value),value:o})]}),T(Vpe,{children:[e,s(Gpe,{onClick:n,children:"Cancel"})]})]}),qpe=E("div")(({theme:e})=>({backgroundColor:e.palette.codebox,padding:e.spacing(2),borderRadius:e.shape.borderRadiusMedium,position:"relative",maxHeight:"500px",overflow:"auto"})),Ype=E("pre")(({theme:e})=>({margin:0,wordBreak:"break-all",whiteSpace:"pre-wrap",color:e.palette.formSidebarTextColor,fontSize:e.fontSizes.smallBody})),Kpe=({text:e})=>s(qpe,{children:s(Ype,{children:e})}),Xpe="/static/unleashLogoIconDarkAlpha-de056a82.gif",Jpe=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:e.palette.background.paper})),Qpe=E("img")(({theme:e})=>({width:"100px",height:"100px"})),Xm=()=>s(Jpe,{role:"alert","aria-label":"Loading",children:s(Qpe,{src:Js(Xpe),alt:""})});var Zpe=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},efe=Zpe,DR={"text/plain":"Text","text/html":"Url",default:"Text"},tfe="Copy to clipboard: #{key}, Enter";function nfe(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function rfe(e,t){var n,r,o,i,a,l,c=!1;t||(t={}),n=t.debug||!1;try{o=efe(),i=document.createRange(),a=document.getSelection(),l=document.createElement("span"),l.textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(d){if(d.stopPropagation(),t.format)if(d.preventDefault(),typeof d.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var p=DR[t.format]||DR.default;window.clipboardData.setData(p,e)}else d.clipboardData.clearData(),d.clipboardData.setData(t.format,e);t.onCopy&&(d.preventDefault(),t.onCopy(d.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");c=!0}catch(d){n&&console.error("unable to copy using execCommand: ",d),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(p){n&&console.error("unable to copy using clipboardData: ",p),n&&console.error("falling back to prompt"),r=nfe("message"in t?t.message:tfe),window.prompt(r,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),o()}return c}var eL=rfe;const ofe=e=>f.createElement("svg",{width:48,height:50,viewBox:"0 0 48 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M0.5 0.000193412C11 2.00019 17 9 18 18C19 27 23.5 31.5 30.5 34C37.5 36.5 47.34 41.4 48 49.5L48 12.0012C48 5.37332 42.6309 0.000381623 36.003 0.000366343C24.1359 0.000338986 8.66406 -0.000263908 0.5 0.000193412Z",fill:"#6C65E5"})),tL="27.5rem",ife=E("section",{shouldForwardProp:e=>e!=="modal"})(({theme:e,modal:t})=>({minHeight:t?"100vh":"80vh",borderRadius:t?0:e.spacing(2),width:"100%",display:"flex",margin:"0 auto",overflow:"hidden",[e.breakpoints.down(1100)]:{flexDirection:"column",minHeight:0}})),afe=E("div")(({theme:e})=>Jne),sfe=E("div")(({theme:e})=>({backgroundColor:e.palette.formBackground,display:"flex",flexDirection:"column",padding:e.spacing(6),flexGrow:1,[e.breakpoints.down("lg")]:{padding:e.spacing(4)},[e.breakpoints.down(1100)]:{width:"100%"},[e.breakpoints.down(500)]:{padding:e.spacing(4,2)}})),lfe=E("h1")(({theme:e})=>({marginBottom:e.fontSizes.mainHeader,fontWeight:"normal"})),cfe=E(uo)(({theme:e})=>({opacity:.3,marginBottom:e.spacing(.5)})),ufe=E("h2")(({theme:e})=>({color:e.palette.formSidebarTextColor,marginBottom:e.spacing(2),display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:e.fontWeight.bold,fontSize:e.fontSizes.bodySize})),dfe=E(c3)(({theme:e})=>({fill:e.palette.text.tertiaryContrast})),pfe=E("div")(()=>({zIndex:1,position:"absolute",right:-3,top:-3})),ffe=E(ofe)(()=>({width:"75px",height:"75px"})),hfe=E(Qt)(()=>({position:"absolute",zIndex:400,right:0})),mfe=E(ite)(({theme:e})=>({fill:e.palette.text.tertiaryContrast})),gfe=E("aside")(({theme:e})=>({backgroundColor:e.palette.formSidebar,padding:e.spacing(4),flexGrow:0,flexShrink:0,width:tL,[e.breakpoints.down(1100)]:{width:"100%",color:"red"},[e.breakpoints.down(500)]:{padding:e.spacing(4,2)}})),vfe=E("p")(({theme:e})=>({color:e.palette.formSidebarTextColor,zIndex:1,position:"relative"})),yfe=E("div")(({theme:e})=>({margin:e.spacing(3,0),display:"flex",alignItems:"center"})),bfe=E(rC)(({theme:e})=>({marginRight:e.spacing(1),color:e.palette.text.tertiaryContrast})),wfe=E("a")(({theme:e})=>({color:e.palette.text.tertiaryContrast,display:"block","&:hover":{textDecoration:"none"}})),Nr=({title:e,description:t,children:n,documentationLink:r,documentationLinkLabel:o,loading:i,modal:a,formatApiCode:l})=>{const{setToastData:c}=It(),u=Er(`(max-width:${1099}px)`);return T(ife,{modal:a,children:[s(X,{condition:u,show:s(afe,{children:s(Sfe,{description:t,documentationLink:r,documentationLinkLabel:o})})}),T(sfe,{children:[s(X,{condition:i||!1,show:s(Xm,{}),elseShow:T(Re,{children:[s(lfe,{children:e}),n]})})," "]}),s(X,{condition:!u,show:T(nL,{description:t,documentationLink:r,documentationLinkLabel:o,children:[s(cfe,{}),T(ufe,{children:["API Command"," ",s(Tt,{title:"Copy command",arrow:!0,children:s(Qt,{onClick:()=>{eL(l())?c({title:"Successfully copied the command",text:"The command should now be automatically copied to your clipboard",autoHideDuration:6e3,type:"success",show:!0}):c({title:"Could not copy the command",text:"Sorry, but we could not copy the command.",autoHideDuration:6e3,type:"error",show:!0})},size:"large",children:s(dfe,{})})})]}),s(Kpe,{text:l()})]})})]})},Sfe=({description:e,documentationLink:t,documentationLinkLabel:n})=>{const[r,o]=f.useState(!1);return T(Re,{children:[s(pfe,{children:s(ffe,{})}),s(Tt,{title:"Toggle help",arrow:!0,children:s(hfe,{onClick:()=>o(i=>!i),size:"large",children:s(mfe,{})})}),s(m4,{in:r,timeout:500,children:s(nL,{description:e,documentationLink:t,documentationLinkLabel:n})})]})},nL=({description:e,children:t,documentationLink:n,documentationLinkLabel:r="Learn more"})=>T(gfe,{children:[s(vfe,{children:e}),T(yfe,{children:[s(bfe,{}),s(wfe,{href:n,rel:"noopener noreferrer",target:"_blank",children:r})]}),t]}),vu=({name:e,...t})=>T(Io,{type:"submit",...t,children:["Create ",e]}),UC=(e={})=>{const t=()=>{const c=Ft("api/admin/permissions");return fetch(c,{method:"GET"}).then(Cn("Project permissions")).then(u=>u.json())},n="api/admin/permissions",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{permissions:(r==null?void 0:r.permissions)||{project:[],environments:[]},error:o,loading:i,refetch:l}},Ao=-1,Jm=50,xfe=()=>{const{setToastApiError:e,setToastData:t}=It(),{uiConfig:n}=Lt(),r=ft(),{environments:o}=pu(),i=o.length<Jm,{createEnvironment:a,loading:l}=gu(),{refetch:c}=UC(),{name:u,setName:d,type:p,setType:h,getEnvPayload:m,validateEnvironmentName:y,clearErrors:v,errors:b}=XO(),w=async C=>{if(C.preventDefault(),v(),await y()){const k=m();try{await a(k),c(),t({title:"Environment created",type:"success",confetti:!0}),r("/environments")}catch(P){e(ht(P))}}},g=()=>`curl --location --request POST '${n.unleashUrl}/api/admin/environments' \\
|
|
290
|
+
*/var Ov=f,Goe=Fm;function qoe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yoe=typeof Object.is=="function"?Object.is:qoe,Koe=Goe.useSyncExternalStore,Xoe=Ov.useRef,Joe=Ov.useEffect,Qoe=Ov.useMemo,Zoe=Ov.useDebugValue;Y3.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Xoe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Qoe(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),o!==void 0&&a.hasValue){var y=a.value;if(o(y,m))return p=y}return p=m}if(y=p,Yoe(d,m))return y;var v=r(m);return o!==void 0&&o(y,v)?y:(d=m,p=v)}var u=!1,d,p,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,o]);var l=Koe(e,i[0],i[1]);return Joe(function(){a.hasValue=!0,a.value=l},[l]),Zoe(l),l};(function(e){e.exports=Y3})(Voe);const eie=ag(Kb),{useSyncExternalStoreWithSelector:tie}=eie;function nie(e,t=e.getState,n){const r=tie(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return f.useDebugValue(r),r}const rR=e=>{const t=typeof e=="function"?Hoe(e):e,n=(r,o)=>nie(t,r,o);return Object.assign(n,t),n},rie=e=>e?rR(e):rR;var oie=rie;const iie=e=>{const t=oie(()=>e),n=(r,o)=>{t.setState(i=>{return{[r]:(a=i[r],l=o,typeof l=="function"?l(a):l)};var a,l})};return{useGlobalState:r=>{const o=f.useCallback(i=>i[r],[r]);return[t(o),f.useCallback(i=>n(r,i),[r])]},getGlobalState:r=>t.getState()[r],setGlobalState:n,subscribe:(r,o)=>{t.subscribe((i,a)=>{i[r]!==a[r]&&o(i[r])})}}},pC=(e,t)=>{const n=iie({[e]:vp(e)??t}),r=o=>{const i=n.getGlobalState(e),a=o instanceof Function?o(i):o;n.setGlobalState(e,a),Uc(e,a)};return()=>[n.useGlobalState(e)[0],r]},la=()=>{const[e,t]=sie();return{locationSettings:e,setLocationSettings:t}},aie=()=>({locale:navigator.language}),sie=pC(`${Ba}:useLocationSettings:v1`,aie()),fC=(e,t)=>new Date(e).toLocaleString(t,{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),Vc=(e,t)=>new Date(e).toLocaleString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),N5e=(e,t)=>new Date(e).toLocaleString(t,{hour:"2-digit",minute:"2-digit"});function xs(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function lie(e,t){jn(2,arguments);var n=sr(e).getTime(),r=xs(t);return new Date(n+r)}var cie={};function df(){return cie}function uie(e,t){jn(2,arguments);var n=sr(e),r=sr(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}var K3=6e4,X3=36e5,M5e=1e3;function Kh(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Kh=function(n){return typeof n}:Kh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Kh(e)}function die(e){return jn(1,arguments),e instanceof Date||Kh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hC(e){if(jn(1,arguments),!die(e)&&typeof e!="number")return!1;var t=sr(e);return!isNaN(Number(t))}function pie(e,t){jn(2,arguments);var n=xs(t);return lie(e,-n)}var fie=864e5;function hie(e){jn(1,arguments);var t=sr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/fie)+1}function Hm(e){jn(1,arguments);var t=1,n=sr(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function J3(e){jn(1,arguments);var t=sr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Hm(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=Hm(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function mie(e){jn(1,arguments);var t=J3(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Hm(n);return r}var gie=6048e5;function vie(e){jn(1,arguments);var t=sr(e),n=Hm(t).getTime()-mie(t).getTime();return Math.round(n/gie)+1}function Vm(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=df(),p=xs((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=sr(e),m=h.getUTCDay(),y=(m<p?7:0)+m-p;return h.setUTCDate(h.getUTCDate()-y),h.setUTCHours(0,0,0,0),h}function Q3(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=sr(e),p=d.getUTCFullYear(),h=df(),m=xs((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(p+1,0,m),y.setUTCHours(0,0,0,0);var v=Vm(y,t),b=new Date(0);b.setUTCFullYear(p,0,m),b.setUTCHours(0,0,0,0);var w=Vm(b,t);return d.getTime()>=v.getTime()?p+1:d.getTime()>=w.getTime()?p:p-1}function yie(e,t){var n,r,o,i,a,l,c,u;jn(1,arguments);var d=df(),p=xs((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),h=Q3(e,t),m=new Date(0);m.setUTCFullYear(h,0,p),m.setUTCHours(0,0,0,0);var y=Vm(m,t);return y}var bie=6048e5;function wie(e,t){jn(1,arguments);var n=sr(e),r=Vm(n,t).getTime()-yie(n,t).getTime();return Math.round(r/bie)+1}function dn(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Sie={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return dn(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):dn(r+1,2)},d:function(t,n){return dn(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return dn(t.getUTCHours()%12||12,n.length)},H:function(t,n){return dn(t.getUTCHours(),n.length)},m:function(t,n){return dn(t.getUTCMinutes(),n.length)},s:function(t,n){return dn(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return dn(i,n.length)}};const Va=Sie;var Yl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xie={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Va.y(t,n)},Y:function(t,n,r,o){var i=Q3(t,o),a=i>0?i:1-i;if(n==="YY"){var l=a%100;return dn(l,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):dn(a,n.length)},R:function(t,n){var r=J3(t);return dn(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return dn(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return dn(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return dn(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Va.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return dn(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=wie(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):dn(i,n.length)},I:function(t,n,r){var o=vie(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):dn(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Va.d(t,n)},D:function(t,n,r){var o=hie(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):dn(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return dn(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return dn(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return dn(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Yl.noon:o===0?i=Yl.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Yl.evening:o>=12?i=Yl.afternoon:o>=4?i=Yl.morning:i=Yl.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Va.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Va.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):dn(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):dn(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Va.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Va.s(t,n)},S:function(t,n){return Va.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return iR(a);case"XXXX":case"XX":return Gs(a);case"XXXXX":case"XXX":default:return Gs(a,":")}},x:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"x":return iR(a);case"xxxx":case"xx":return Gs(a);case"xxxxx":case"xxx":default:return Gs(a,":")}},O:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+oR(a,":");case"OOOO":default:return"GMT"+Gs(a,":")}},z:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+oR(a,":");case"zzzz":default:return"GMT"+Gs(a,":")}},t:function(t,n,r,o){var i=o._originalDate||t,a=Math.floor(i.getTime()/1e3);return dn(a,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,a=i.getTime();return dn(a,n.length)}};function oR(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var a=t||"";return n+String(o)+a+dn(i,2)}function iR(e,t){if(e%60===0){var n=e>0?"-":"+";return n+dn(Math.abs(e)/60,2)}return Gs(e,t)}function Gs(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=dn(Math.floor(o/60),2),a=dn(o%60,2);return r+i+n+a}const Cie=xie;var aR=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Z3=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Eie=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return aR(t,n);var a;switch(o){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",aR(o,n)).replace("{{time}}",Z3(i,n))},kie={p:Z3,P:Eie};const Tie=kie;var _ie=["D","DD"],Rie=["YY","YYYY"];function Pie(e){return _ie.indexOf(e)!==-1}function $ie(e){return Rie.indexOf(e)!==-1}function sR(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Iie={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Aie=function(t,n,r){var o,i=Iie[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Oie=Aie;function L1(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Lie={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Die={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mie={date:L1({formats:Lie,defaultWidth:"full"}),time:L1({formats:Die,defaultWidth:"full"}),dateTime:L1({formats:Nie,defaultWidth:"full"})};const Bie=Mie;var Fie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zie=function(t,n,r,o){return Fie[t]};const jie=zie;function Qu(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[l]}var u=e.argumentCallback?e.argumentCallback(t):t;return o[u]}}var Uie={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wie={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hie={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Vie={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gie={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qie={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yie=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Kie={ordinalNumber:Yie,era:Qu({values:Uie,defaultWidth:"wide"}),quarter:Qu({values:Wie,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Qu({values:Hie,defaultWidth:"wide"}),day:Qu({values:Vie,defaultWidth:"wide"}),dayPeriod:Qu({values:Gie,defaultWidth:"wide",formattingValues:qie,defaultFormattingWidth:"wide"})};const Xie=Kie;function Zu(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Qie(l,function(p){return p.test(a)}):Jie(l,function(p){return p.test(a)}),u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;var d=t.slice(a.length);return{value:u,rest:d}}}function Jie(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Qie(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function Zie(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;var l=t.slice(o.length);return{value:a,rest:l}}}var eae=/^(\d+)(th|st|nd|rd)?/i,tae=/\d+/i,nae={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},rae={any:[/^b/i,/^(a|c)/i]},oae={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iae={any:[/1/i,/2/i,/3/i,/4/i]},aae={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sae={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lae={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cae={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uae={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dae={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},pae={ordinalNumber:Zie({matchPattern:eae,parsePattern:tae,valueCallback:function(t){return parseInt(t,10)}}),era:Zu({matchPatterns:nae,defaultMatchWidth:"wide",parsePatterns:rae,defaultParseWidth:"any"}),quarter:Zu({matchPatterns:oae,defaultMatchWidth:"wide",parsePatterns:iae,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Zu({matchPatterns:aae,defaultMatchWidth:"wide",parsePatterns:sae,defaultParseWidth:"any"}),day:Zu({matchPatterns:lae,defaultMatchWidth:"wide",parsePatterns:cae,defaultParseWidth:"any"}),dayPeriod:Zu({matchPatterns:uae,defaultMatchWidth:"any",parsePatterns:dae,defaultParseWidth:"any"})};const fae=pae;var hae={code:"en-US",formatDistance:Oie,formatLong:Bie,formatRelative:jie,localize:Xie,match:fae,options:{weekStartsOn:0,firstWeekContainsDate:1}};const eO=hae;var mae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vae=/^'([^]*?)'?$/,yae=/''/g,bae=/[a-zA-Z]/;function Cp(e,t,n){var r,o,i,a,l,c,u,d,p,h,m,y,v,b,w,g,S,C;jn(2,arguments);var R=String(t),k=df(),P=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:k.locale)!==null&&r!==void 0?r:eO,O=xs((i=(a=(l=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(u=n.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:k.firstWeekContainsDate)!==null&&a!==void 0?a:(p=k.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=xs((m=(y=(v=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(w=n.locale)===null||w===void 0||(g=w.options)===null||g===void 0?void 0:g.weekStartsOn)!==null&&v!==void 0?v:k.weekStartsOn)!==null&&y!==void 0?y:(S=k.locale)===null||S===void 0||(C=S.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&m!==void 0?m:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var I=sr(e);if(!hC(I))throw new RangeError("Invalid time value");var A=wp(I),M=pie(I,A),F={firstWeekContainsDate:O,weekStartsOn:L,locale:P,_originalDate:I},j=R.match(gae).map(function(q){var G=q[0];if(G==="p"||G==="P"){var Z=Tie[G];return Z(q,P.formatLong)}return q}).join("").match(mae).map(function(q){if(q==="''")return"'";var G=q[0];if(G==="'")return wae(q);var Z=Cie[G];if(Z)return!(n!=null&&n.useAdditionalWeekYearTokens)&&$ie(q)&&sR(q,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Pie(q)&&sR(q,t,String(e)),Z(M,q,P.localize,F);if(G.match(bae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+G+"`");return q}).join("");return j}function wae(e){var t=e.match(vae);return t?t[1].replace(yae,"'"):e}function tO(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Sae(e){return tO({},e)}var lR=1e3*60,Gm=60*24,cR=Gm*30,uR=Gm*365;function xae(e,t,n){var r,o,i;jn(2,arguments);var a=df(),l=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:a.locale)!==null&&r!==void 0?r:eO;if(!l.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var c=uie(e,t);if(isNaN(c))throw new RangeError("Invalid time value");var u=tO(Sae(n),{addSuffix:Boolean(n==null?void 0:n.addSuffix),comparison:c}),d,p;c>0?(d=sr(t),p=sr(e)):(d=sr(e),p=sr(t));var h=String((i=n==null?void 0:n.roundingMethod)!==null&&i!==void 0?i:"round"),m;if(h==="floor")m=Math.floor;else if(h==="ceil")m=Math.ceil;else if(h==="round")m=Math.round;else throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");var y=p.getTime()-d.getTime(),v=y/lR,b=wp(p)-wp(d),w=(y-b)/lR,g=n==null?void 0:n.unit,S;if(g?S=String(g):v<1?S="second":v<60?S="minute":v<Gm?S="hour":w<cR?S="day":w<uR?S="month":S="year",S==="second"){var C=m(y/1e3);return l.formatDistance("xSeconds",C,u)}else if(S==="minute"){var R=m(v);return l.formatDistance("xMinutes",R,u)}else if(S==="hour"){var k=m(v/60);return l.formatDistance("xHours",k,u)}else if(S==="day"){var P=m(w/Gm);return l.formatDistance("xDays",P,u)}else if(S==="month"){var O=m(w/cR);return O===12&&g!=="month"?l.formatDistance("xYears",1,u):l.formatDistance("xMonths",O,u)}else if(S==="year"){var L=m(w/uR);return l.formatDistance("xYears",L,u)}throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'")}function Cae(e,t){return jn(1,arguments),xae(e,Date.now(),t)}function Eae(e){return jn(1,arguments),sr(e).getTime()<Date.now()}function pf(e,t){var n;jn(1,arguments);var r=xs((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=Rae(e),i;if(o.date){var a=Pae(o.date,r);i=$ae(a.restDateString,a.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var l=i.getTime(),c=0,u;if(o.time&&(c=Iae(o.time),isNaN(c)))return new Date(NaN);if(o.timezone){if(u=Aae(o.timezone),isNaN(u))return new Date(NaN)}else{var d=new Date(l+c),p=new Date(0);return p.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),p.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),p}return new Date(l+c+u)}var uh={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},kae=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tae=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_ae=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Rae(e){var t={},n=e.split(uh.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],uh.timeZoneDelimiter.test(t.date)&&(t.date=e.split(uh.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var o=uh.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function Pae(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function $ae(e,t){if(t===null)return new Date(NaN);var n=e.match(kae);if(!n)return new Date(NaN);var r=!!n[4],o=ed(n[1]),i=ed(n[2])-1,a=ed(n[3]),l=ed(n[4]),c=ed(n[5])-1;if(r)return Mae(t,l,c)?Oae(t,l,c):new Date(NaN);var u=new Date(0);return!Dae(t,i,a)||!Nae(t,o)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(o,a)),u)}function ed(e){return e?parseInt(e):1}function Iae(e){var t=e.match(Tae);if(!t)return NaN;var n=D1(t[1]),r=D1(t[2]),o=D1(t[3]);return Bae(n,r,o)?n*X3+r*K3+o*1e3:NaN}function D1(e){return e&&parseFloat(e.replace(",","."))||0}function Aae(e){if(e==="Z")return 0;var t=e.match(_ae);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return Fae(r,o)?n*(r*X3+o*K3):NaN}function Oae(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var Lae=[31,null,31,30,31,30,31,31,30,31,30,31];function nO(e){return e%400===0||e%4===0&&e%100!==0}function Dae(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Lae[t]||(nO(e)?29:28))}function Nae(e,t){return t>=1&&t<=(nO(e)?366:365)}function Mae(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Bae(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Fae(e,t){return t>=0&&t<=59}const zae=E(Je,{shouldForwardProp:e=>e!=="lineClamp"})(({theme:e,lineClamp:t})=>({padding:e.spacing(1,2),display:"-webkit-box",overflow:t?"hidden":"auto",WebkitLineClamp:t||"none",WebkitBoxOrient:"vertical",wordBreak:"break-all",[e.breakpoints.down("sm")]:{wordBreak:"normal"}})),fo=({value:e,children:t,lineClamp:n,sx:r,"data-testid":o})=>s(zae,{lineClamp:n,sx:r,children:s("span",{"data-loading":"true","data-testid":o,children:t??e})}),Ep=({value:e})=>{const{locationSettings:t}=la(),n=e?e instanceof Date?Vc(e,t.locale):Vc(pf(e),t.locale):void 0;return s(fo,{lineClamp:1,children:n})};function mC(e,t){return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t)}const jae=E("span")(({theme:e})=>({"&>mark":{backgroundColor:e.palette.highlight}})),Gc=({search:e,children:t,caseSensitive:n})=>{if(!t)return null;if(!e)return s(Re,{children:t});const r=mC(e,n?"g":"gi");return s(jae,{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.replaceAll(r,"<mark>$&</mark>"))||""}})},rO=e=>({paddingTop:e.spacing(1.5),paddingBottom:e.spacing(1.5),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"flex",alignItems:"center",minHeight:"62px"}),Uae=E("div")(({theme:e})=>rO(e)),dR=E(po)(({theme:e})=>({...rO(e),"&:hover, &:focus":{textDecoration:"none","& > div > span:first-of-type":{textDecoration:"underline"}}})),Wae=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",wordBreak:"break-all"})),Hae=E("span")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical"})),Vae=E("span")(({theme:e})=>({color:e.palette.text.secondary,textDecoration:"none",fontSize:"inherit",WebkitLineClamp:1,lineClamp:1,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical"})),Os=({title:e,to:t,onClick:n,subtitle:r,children:o})=>{const{searchQuery:i}=uf(),a=T(Wae,{children:[T(Hae,{"data-loading":!0,style:{WebkitLineClamp:Boolean(r)?1:2,lineClamp:Boolean(r)?1:2},children:[s(Gc,{search:i,children:e}),o]}),s(X,{condition:Boolean(r),show:s(Re,{children:s(Vae,{"data-loading":!0,children:s(Gc,{search:i,children:r})})})})]});return t?s(dR,{component:on,to:t,underline:"hover",children:a}):n?s(dR,{onClick:n,underline:"hover",children:a}):s(Uae,{children:a})};function dh(e){const t=new Date(e);if(!Number.isNaN(t.valueOf()))return t;const n=String(e).match(/\d+/g);if(n==null||n.length<=2)return t;{const[r,o,...i]=n.map(c=>parseInt(c)),a=[r,o-1,...i];return new Date(Date.UTC(...a))}}function pR(e,t,n){const r=e!==1?t+"s":t;return e+" "+r+" "+n}function Xb(){return Xb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xb.apply(this,arguments)}const yd=60,bd=yd*60,kc=bd*24,ph=kc*7,fR=kc*30,hR=kc*365;function gC({date:e,formatter:t=pR,component:n="time",live:r=!0,minPeriod:o=0,maxPeriod:i=ph,title:a,now:l=()=>Date.now(),...c}){const[u,d]=f.useState(l());f.useEffect(()=>{if(!r)return;const R=(()=>{const k=dh(e).valueOf();if(!k)return console.warn("[react-timeago] Invalid Date provided"),0;const P=Math.round(Math.abs(u-k)/1e3),O=P<yd?1e3:P<bd?1e3*yd:P<kc?1e3*bd:1e3*ph,L=Math.min(Math.max(O,o*1e3),i*1e3);return L?setTimeout(()=>{d(l())},L):0})();return()=>{R&&clearTimeout(R)}},[e,r,i,o,l,u]);const p=n,h=dh(e).valueOf();if(!h)return null;const m=Math.round(Math.abs(u-h)/1e3),y=h<u?"ago":"from now",[v,b]=m<yd?[Math.round(m),"second"]:m<bd?[Math.round(m/yd),"minute"]:m<kc?[Math.round(m/bd),"hour"]:m<ph?[Math.round(m/kc),"day"]:m<fR?[Math.round(m/ph),"week"]:m<hR?[Math.round(m/fR),"month"]:[Math.round(m/hR),"year"],w=typeof a>"u"?typeof e=="string"?e:dh(e).toISOString().substr(0,16).replace("T"," "):a,g=p==="time"?{...c,dateTime:dh(e).toISOString()}:c,S=pR.bind(null,v,b,y);return f.createElement(p,Xb({},g,{title:w}),t(v,b,y,h,S,l))}function Gae(e){switch(e){case"second":return"s";case"minute":return"m";case"hour":return"h";case"day":return"D";case"week":return"W";case"month":return"M";case"year":return"Y";default:return""}}const qae=()=>{const e=sn();return t=>{switch(t){case"second":return e.palette.activityIndicators.recent;case"minute":return e.palette.activityIndicators.recent;case"hour":return e.palette.activityIndicators.recent;case"day":return e.palette.activityIndicators.recent;case"week":return e.palette.activityIndicators.inactive;case"month":return e.palette.activityIndicators.abandoned;case"year":return e.palette.activityIndicators.abandoned;default:return e.palette.activityIndicators.unknown}}},Yae=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1.5)})),Kae=E("div")(({theme:e})=>({width:"38px",height:"38px",background:e.palette.background.paper,borderRadius:`${e.shape.borderRadius}px`,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",fontSize:e.typography.body2.fontSize,margin:"0 auto"})),mR=({unit:e,tooltip:t,children:n})=>{const r=qae();return s(Yae,{children:s(Tt,{title:t,arrow:!0,describeChild:!0,children:s(Kae,{style:{background:r(e)},"data-loading":!0,children:n})})})},oO=({value:e})=>s(X,{condition:Boolean(e),show:s(gC,{date:e,title:"",live:!1,formatter:(t,n,r)=>T(mR,{tooltip:`Last usage reported ${t} ${n}${t!==1?"s":""} ${r}`,unit:n,children:[t,Gae(n)]})}),elseShow:s(mR,{tooltip:"No usage reported from connected applications",children:"–"})}),Xae="experiment",Jae="release",Qae="operational",Zae="kill-switch",ese="permission";var vC={},tse=fn;Object.defineProperty(vC,"__esModule",{value:!0});var Jb=vC.default=void 0,nse=tse(En()),rse=kn,ose=(0,nse.default)((0,rse.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Loop");Jb=vC.default=ose;var yC={},ise=fn;Object.defineProperty(yC,"__esModule",{value:!0});var iO=yC.default=void 0,ase=ise(En()),sse=kn,lse=(0,ase.default)((0,sse.jsx)("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"}),"Timeline");iO=yC.default=lse;var bC={},cse=fn;Object.defineProperty(bC,"__esModule",{value:!0});var wC=bC.default=void 0,use=cse(En()),dse=kn,pse=(0,use.default)((0,dse.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNew");wC=bC.default=pse;var SC={},fse=fn;Object.defineProperty(SC,"__esModule",{value:!0});var aO=SC.default=void 0,hse=fse(En()),mse=kn,gse=(0,hse.default)((0,mse.jsx)("path",{d:"M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"}),"PanTool");aO=SC.default=gse;var xC={},vse=fn;Object.defineProperty(xC,"__esModule",{value:!0});var sO=xC.default=void 0,yse=vse(En()),bse=kn,wse=(0,yse.default)((0,bse.jsx)("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"}),"Build");sO=xC.default=wse;const Sse=e=>{switch(e){case Jae:return Jb;case Xae:return iO;case Zae:return wC;case Qae:return sO;case ese:return aO;default:return Jb}},CC=(e={})=>{const t=async()=>{const c=Ft("api/admin/feature-types");return(await fetch(c,{method:"GET"}).then(Cn("Feature types"))).json()},n="api/admin/feature-types",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{featureTypes:(r==null?void 0:r.types)||[],error:o,loading:i,refetch:l}},xse=E("div")(({theme:e})=>({padding:e.spacing(1.5),display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),lO=({value:e})=>{const{featureTypes:t}=CC(),n=Sse(e),o=`This is a "${t.filter(i=>i.id===e).map(i=>i.name)||e}" toggle`;return s(xse,{children:s(Tt,{arrow:!0,title:o,describeChild:!0,children:s(n,{"data-loading":!0})})})},Cse=({row:e})=>s(Os,{title:e.original.name,subtitle:e.original.description,to:`/projects/${e.original.project}/features/${e.original.name}`}),cO=e=>{const{setAnnouncement:t}=f.useContext(cC);f.useEffect(()=>{if(e)return document.title=e,()=>{document.title=gR}},[e]),f.useEffect(()=>{e&&e!==gR&&t(`Navigated to ${e}`)},[t,e])},gR="Unleash",Ese=E(uo)(({theme:e})=>({height:"100%",borderColor:e.palette.dividerAlternative,width:"1px",display:"inline-block",marginLeft:e.spacing(2),marginRight:e.spacing(2),padding:e.spacing(.5,0),verticalAlign:"middle"})),kse=E("div")(()=>({display:"flex",flexDirection:"column"})),Tse=E("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative"})),_se=E("div")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:e.spacing(2)})),Rse=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,fontWeight:"normal"})),Pse=E("div")(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-end",alignItems:"center",gap:e.spacing(1)})),uO=({title:e,titleElement:t,actions:n,subtitle:r,variant:o,loading:i,className:a="",secondary:l,children:c})=>{const u=yi({skeleton:i});return cO(l?"":e),T(kse,{children:[T(Tse,{children:[T(_se,{className:yi(u),"data-loading":!0,children:[s(Rse,{variant:o||l?"h2":"h1",className:yi(a),children:t||e}),r&&s("small",{children:r})]}),s(X,{condition:Boolean(n),show:s(Pse,{children:n})})]}),c]})},$se=({sx:e})=>s(Ese,{orientation:"vertical",variant:"middle",sx:e});uO.Divider=$se;const xn=uO,Ise=ai()(e=>({headerPadding:{padding:e.spacing(2,4)},bodyContainer:{padding:e.spacing(4),[e.breakpoints.down("md")]:{padding:e.spacing(2)},overflowX:"auto"},paddingDisabled:{padding:"0"},borderDisabled:{border:"none"}})),Lv=e=>{const t=f.createRef();return f.useLayoutEffect(()=>{t.current&&t.current.querySelectorAll("[data-loading]").forEach(r=>{e?r.classList.add("skeleton"):r.classList.remove("skeleton")})},[e,t]),t},Ase=E("div")(({theme:e})=>({borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:e.palette.divider,[e.breakpoints.down("md")]:{padding:e.spacing(3,2)}})),Ose=E(Tr)(({theme:e})=>({borderRadius:e.shape.borderRadiusLarge,boxShadow:"none"})),Lse=({children:e,isLoading:t})=>{const n=Lv(t);return s("div",{ref:n,"aria-busy":t,"aria-live":"polite",children:e})},gr=({children:e,header:t,disablePadding:n=!1,disableBorder:r=!1,bodyClass:o="",headerClass:i="",isLoading:a=!1,disableLoading:l=!1,className:c,...u})=>{const{classes:d}=Ise(),p=yi("header",i||d.headerPadding,{[d.paddingDisabled]:n,[d.borderDisabled]:r}),h=yi("body",o||d.bodyContainer,{[d.paddingDisabled]:n,[d.borderDisabled]:r}),y=T(Ose,{...u,...r?{elevation:0}:{},className:yi(c),children:[s(X,{condition:Boolean(t),show:s(Ase,{className:p,children:s(X,{condition:typeof t=="string",show:s(xn,{title:t}),elseShow:t})})}),s("div",{className:h,children:e})]});return l?y:s(Lse,{isLoading:a,children:y})},Dv=(e,t)=>{const n=`${Ba}:${e}:localStorage:v2`;return{value:(()=>{const i=vp(n);return i===void 0?t:i})(),setValue:i=>{if(i instanceof Function){const a=vp(n),l=i(a??t);return Uc(n,l),l}return Uc(n,i),i}}},ja=(e={})=>{const t=()=>{const c=Ft("api/admin/projects");return fetch(c,{method:"GET"}).then(Cn("Projects")).then(u=>u.json())},n="api/admin/projects",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{projects:(r==null?void 0:r.projects)||[],error:o,loading:i,refetch:l}},Xh="default",Dse=()=>{var n;const{projects:e=[]}=ja(),t=e.find(r=>r.id===Xh);return(t==null?void 0:t.id)||((n=e[0])==null?void 0:n.id)},qm=(e,t)=>`/projects/${e}/features/${t}`,Nse=(e,t)=>{const n=`/projects/${e}/create-toggle`;let r;return t&&(r=Object.keys(t).reduce((o,i)=>(o+=`${i}=${t[i]}`,o),"")),r?`${n}?${r}`:n},Mse=e=>`/projects/${e}/edit`,Bse=e=>{const t=Dse(),n=e.project==="*"||!e.project?t:e.project;if(n)return{path:Nse(n),projectId:n}},Fse=E("div")(({theme:e})=>({overflow:"auto",padding:e.spacing(1,1.5)})),zse=E(({className:e,maxWidth:t,maxHeight:n,fontSize:r,...o})=>s(Tt,{...o,title:s(Fse,{children:o.title}),classes:{popper:e}}),{shouldForwardProp:e=>e!=="maxWidth"&&e!=="maxHeight"&&e!=="fontSize"})(({theme:e,maxWidth:t=e.spacing(37.5),maxHeight:n=e.spacing(37.5),fontSize:r=e.fontSizes.smallerBody})=>({maxWidth:t,[`& .${ji.tooltip}`]:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:0,borderRadius:e.shape.borderRadiusMedium,boxShadow:e.shadows[2],color:e.palette.text.primary,fontWeight:e.fontWeight.medium,maxWidth:"inherit",border:`1px solid ${e.palette.lightBorder}`,maxHeight:n,fontSize:r},[`& .${ji.arrow}`]:{"&:before":{border:`1px solid ${e.palette.lightBorder}`},color:e.palette.background.paper}})),EC=e=>s(zse,{...e,children:e.children}),du=({title:e,children:t,variant:n="default",titleComponent:r,...o})=>!e&&!r?t:n==="custom"?s(EC,{...o,title:e||r,arrow:!0,children:t}):s(Tt,{...o,title:e||r,arrow:!0,children:t}),Qb="Access denied",Nv=(e,t)=>e?t:t?`${t} (${Qb})`:Qb,jse=()=>{throw new Error("hasAccess called outside AccessContext")},Qr=jt.createContext({isAdmin:!1,hasAccess:jse}),kC=(e,t,n,r,o={})=>{const i=gn(e?n:null,r,o);return{...i,error:e?i.error:void 0,data:e?i.data:t}},Use=e=>{const{isEnterprise:t}=Lt(),{data:n,error:r,mutate:o}=kC(Boolean(e)&&t(),[],Ft(`api/admin/projects/${e}/change-requests/config`),Wse);return{data:n||[],loading:!r&&!n,refetchChangeRequestConfig:o,error:r}},Wse=e=>fetch(e).then(Cn("Request changes")).then(t=>t.json()),ff=e=>{const{data:t}=Use(e),n=jt.useCallback(o=>t.some(i=>i.environment===o&&i.changeRequestEnabled),[JSON.stringify(t)]),r=jt.useCallback(()=>t.some(o=>o.changeRequestEnabled),[JSON.stringify(t)]);return{isChangeRequestConfigured:n,isChangeRequestConfiguredInAnyEnv:r}},TC=e=>{const{hasAccess:t}=f.useContext(Qr),n=(o,i,a)=>i&&a?t(o,i,a):i?t(o,i):t(o),r=(o,i,a)=>Array.isArray(o)?o.some(l=>n(l,i,a)):n(o,i,a);return(o,i)=>r(o,e,i)},B5e=e=>{const{isChangeRequestConfigured:t}=ff(e),n=TC(e);return(r,o)=>t(o)||n(r,o)},Hse=[G3,sC,koe,Toe],Vse=(e,t)=>e.filter(n=>t.includes(n)).length>0,qc=(e,t,n)=>{const{isChangeRequestConfigured:r}=ff(t),o=TC(t);return r(n)&&Vse(Hse,[].concat(e))||o(e,n)},_C=(e,t,n)=>TC(t)(e,n),Gse=jt.forwardRef((e,t)=>{const n=qc(e.permission,e.projectId,e.environmentId);return s(dO,{...e,access:n,ref:t})}),qse=jt.forwardRef((e,t)=>{const n=_C(e.permission,e.projectId,e.environmentId);return s(dO,{...e,access:n,ref:t})}),dO=jt.forwardRef(({permission:e,access:t,variant:n="contained",color:r="primary",onClick:o,children:i,disabled:a,projectId:l,environmentId:c,tooltipProps:u,...d},p)=>{const h=Ss();return s(du,{...u,title:Nv(t,u==null?void 0:u.title),arrow:!0,children:s("span",{id:h,children:s(rt,{ref:p,onClick:o,disabled:a||!t,"aria-labelledby":h,variant:n,color:r,...d,endIcon:s(Re,{children:s(X,{condition:!t,show:s(ute,{titleAccess:"Locked"}),elseShow:Boolean(d.endIcon)&&d.endIcon})}),children:i})})})}),Io=jt.forwardRef((e,t)=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Gse,{...e,environmentId:e.environmentId,projectId:e.projectId,ref:t}):s(qse,{...e,ref:t})),Yse=e=>{const t=_C(e.permission,e.projectId,e.environmentId);return s(pO,{...e,access:t})},Kse=e=>{const t=qc(e.permission,e.projectId,e.environmentId);return s(pO,{...e,access:t})},pO=({access:e,permission:t,projectId:n,children:r,environmentId:o,tooltipProps:i,disabled:a,...l})=>{const c=Ss();return s(du,{...i,title:Nv(e,i==null?void 0:i.title),arrow:!0,onClick:u=>u.preventDefault(),children:s("div",{id:c,children:s(Qt,{...l,disabled:!e||a,"aria-labelledby":c,size:"large",children:r})})})},mr=e=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Kse,{...e,projectId:e.projectId,environmentId:e.environmentId}):s(Yse,{...e}),Xse=({loading:e,filter:t})=>{const n=Er("(max-width:800px)"),r=Bse(t),o=ft();return r?s(X,{condition:n,show:s(mr,{permission:Sp,projectId:r.projectId,component:on,to:r.path,size:"large",tooltipProps:{title:"Create feature toggle"},children:s(Si,{})}),elseShow:s(Io,{onClick:()=>{o(r.path)},permission:Sp,projectId:r.projectId,color:"primary",variant:"contained","data-testid":Pte,className:yi({skeleton:e}),children:"New feature toggle"})}):null},Jse=e=>({color:e.palette.error.dark,fontSize:"inherit"}),Qse=e=>({color:e.palette.success.dark,fontSize:"inherit"}),Zse=E(Je)(({theme:e})=>({padding:e.spacing(1.5,2)})),fO=({value:e})=>s(Zse,{children:s(X,{condition:Boolean(e),show:s(ke,{component:"span",sx:Jse,"data-loading":!0,children:"Stale"}),elseShow:s(ke,{component:"span",sx:Qse,"data-loading":!0,children:"Active"})})}),RC=(e,t,n)=>{const r=hO(e),o=()=>({data:n,searchValue:t,columns:e});return t?{data:(()=>{const a=ele(e,t,n);return tle(e,r(t),a)})(),getSearchText:r,getSearchContext:o}:{data:n,getSearchText:r,getSearchContext:o}},ele=(e,t,n)=>{let r=n;return gO(e).filter(o=>mO(t,o.filterName)).forEach(o=>{const i=vO(o.filterName,t);r=r.filter(a=>o.filterBy?o.filterBy(a,i):nle(Ym(o,a),i))}),r},tle=(e,t,n)=>{const r=e.filter(o=>o.searchable&&o.accessor);return n.filter(o=>r.some(i=>i.searchBy?i.searchBy(o,t):rle(Ym(i,o),t)))},nle=(e,t)=>t.some(n=>(e==null?void 0:e.toLowerCase())===(n==null?void 0:n.toLowerCase())),rle=(e,t)=>e==null?void 0:e.toLowerCase().includes(t==null?void 0:t.toLowerCase()),hO=e=>{const t=e.filter(r=>r.filterName).map(r=>r.filterName),n=r=>t.some(o=>mO(r,o));return r=>r.split(" ").filter(o=>!n(o)).join(" ")},mO=(e,t)=>new RegExp(`${t}:\\w+`).test(e),gO=e=>e.filter(t=>t.filterName&&t.accessor),Ym=(e,t)=>{const n=typeof e.accessor=="function"?e.accessor(t):e.accessor.includes(".")?e.accessor.split(".").reduce((r,o)=>r==null?void 0:r[o],t):t[e.accessor];return e.filterParsing?e.filterParsing(n):n},vO=(e,t)=>{var n,r;return((r=(n=t==null?void 0:t.split(`${e}:`)[1])==null?void 0:n.split(" ")[0])==null?void 0:r.split(",").filter(o=>o))??[]},vR=E("span")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.primary})),yR=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),ole=({filters:e,getSearchContext:t,searchableColumnsString:n})=>{const r=t(),i=hO(r.columns)(r.searchValue),a=e.filter(l=>l.values.length>0);return T(Re,{children:[s(X,{condition:Boolean(i),show:T(Re,{children:[s(vR,{children:"Searching for:"}),T("p",{children:[s(yR,{children:i})," ",n?` in ${n}`:""]})]})}),s(X,{condition:a.length>0,show:T(Re,{children:[s(vR,{children:"Filtering by:"}),a.map(l=>T("p",{children:[s(yR,{children:l.values.join(",")})," ","in ",l.header,". Options:"," ",l.options.join(", ")]},l.name))]})})]})},ile=E("span")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.primary})),bR=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),ale=({filters:e,getSearchContext:t,searchableColumnsString:n})=>T(Re,{children:[s(ile,{children:e.length>0?"Filter your search with operators like:":`Start typing to search${n?` in ${n}`:"..."}`}),e.map(r=>T("p",{children:["Filter by ",r.header,":"," ",T(bR,{children:[r.name,":",r.options[0]]}),s(X,{condition:r.options.length>1,show:T(Re,{children:[" or ",T(bR,{children:[r.name,":",r.options.slice(0,2).join(",")]})]})})]},r.name))]}),sle=e=>Math.floor(Math.random()*e.length),lle=E(Tr)(({theme:e})=>({position:"absolute",width:"100%",left:0,top:"20px",zIndex:2,padding:e.spacing(4,1.5,1.5),borderBottomLeftRadius:e.spacing(1),borderBottomRightRadius:e.spacing(1),boxShadow:"0px 8px 20px rgba(33, 33, 33, 0.15)",fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary,wordBreak:"break-word"})),cle=E(Je)(({theme:e})=>({display:"flex",gap:e.spacing(2)})),ule=E(rte)(({theme:e})=>({color:e.palette.text.secondary})),dle=E(uo)(({theme:e})=>({border:`1px dashed ${e.palette.dividerAlternative}`,margin:e.spacing(1.5,0)})),ple=E("span")(({theme:e})=>({backgroundColor:e.palette.secondaryContainer,color:e.palette.text.primary,padding:e.spacing(0,.5),borderRadius:e.spacing(.5)})),fle=({getSearchContext:e})=>{const t=e(),n=f.useMemo(()=>sle(t.data),[t.data]),r=gO(t.columns).map(l=>{const c=t.data.map(u=>Ym(l,u));return{name:l.filterName,header:l.Header??l.filterName,options:[...new Set(c)].sort((u,d)=>u.localeCompare(d)),suggestedOption:c[n]??`example-${l.filterName}`,values:vO(l.filterName,t.searchValue)}}).sort((l,c)=>l.name.localeCompare(c.name)),o=t.columns.filter(l=>l.searchable&&l.accessor),i=o.map(l=>l.Header??l.accessor).join(", "),a=t.data.length&&o.length?Ym(o[0],t.data[n]):"example-search-text";return T(lle,{children:[T(cle,{children:[s(ule,{}),s(Je,{children:s(X,{condition:Boolean(t.searchValue),show:s(ole,{filters:r,getSearchContext:e,searchableColumnsString:i}),elseShow:s(ale,{filters:r,getSearchContext:e,searchableColumnsString:i})})})]}),s(dle,{}),s(X,{condition:r.length>0,show:"Combine filters and search."}),T("p",{children:["Example:"," ",T(ple,{children:[r.map(l=>T("span",{children:[l.name,":",l.suggestedOption," "]},l.name)),s("span",{children:a})]})]})]})},hle=()=>{const[e,t]=f.useState();return f.useEffect(()=>{var r;const n=((r=navigator==null?void 0:navigator.userAgentData)==null?void 0:r.platform)||(navigator==null?void 0:navigator.platform)||"unknown";t(n.toLowerCase().includes("mac")||n==="iPhone"||n==="iPad")},[]),e},wR=({key:e,modifiers:t=[],preventDefault:n=!1},r)=>{const o=hle();f.useEffect(()=>{const l=c=>{if(e===c.key){if(t.includes("ctrl")){if(o){if(!c.metaKey)return}else if(!c.ctrlKey)return}t.includes("alt")&&!c.altKey||t.includes("shift")&&!c.shiftKey||(n&&c.preventDefault(),r())}};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[o,e,t,n,r]);const i=f.useMemo(()=>t.map(l=>({ctrl:o?"⌘":"Ctrl",alt:"Alt",shift:"Shift"})[l]),[o,t]);return f.useMemo(()=>[...i,`${e[0].toUpperCase()}${e.slice(1)}`].join("+"),[i,e])},mle=E("div")(({theme:e})=>({display:"flex",flexGrow:1,alignItems:"center",position:"relative",backgroundColor:e.palette.background.paper,maxWidth:"400px",[e.breakpoints.down("md")]:{marginTop:e.spacing(1),maxWidth:"100%"}})),gle=E("div")(({theme:e})=>({display:"flex",alignItems:"center",backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.neutral.border}`,borderRadius:e.shape.borderRadiusExtraLarge,padding:"3px 5px 3px 12px",width:"100%",zIndex:3,"&:focus-within":{borderColor:e.palette.primary.light,boxShadow:e.boxShadows.main}})),vle=E(dv)(({theme:e})=>({width:"100%"})),yle=E(vv)(({theme:e})=>({color:e.palette.neutral.main,fontSize:e.typography.body1.fontSize})),go=({initialValue:e="",onChange:t,className:n,placeholder:r,hasFilters:o,disabled:i,getSearchContext:a,containerStyles:l,debounceTime:c=200})=>{const u=f.useRef(),[d,p]=f.useState(!1),[h,m]=f.useState(e),y=tn.useAsyncDebounce(t,c),v=g=>{y(g),m(g)},b=wR({modifiers:["ctrl"],key:"k",preventDefault:!0},()=>{var g,S;document.activeElement===u.current?(g=u.current)==null||g.blur():(S=u.current)==null||S.focus()});wR({key:"Escape"},()=>{var g;document.activeElement===u.current&&((g=u.current)==null||g.blur())});const w=`${r??"Search"} (${b})`;return T(mle,{style:l,children:[T(gle,{className:n,children:[s(Fx,{sx:{mr:1,color:g=>g.palette.inactiveIcon}}),s(vle,{inputRef:u,placeholder:w,inputProps:{"aria-label":w},value:h,onChange:g=>v(g.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:i}),s(Je,{sx:{width:g=>g.spacing(4)},children:s(X,{condition:Boolean(h),show:s(Tt,{title:"Clear search query",arrow:!0,children:s(Qt,{size:"small",onClick:()=>{var g;v(""),(g=u.current)==null||g.focus()},sx:{padding:g=>g.spacing(1)},children:s(yle,{})})})})})]}),s(X,{condition:Boolean(o)&&d,show:s(fle,{getSearchContext:a})})]})},ble=E(po,{shouldForwardProp:e=>e!=="highlighted"})(({theme:e,highlighted:t})=>({backgroundColor:t?e.palette.highlight:"transparent",color:e.palette.text.primary,textDecorationColor:e.palette.text.disabled,textDecorationStyle:"dashed",textUnderlineOffset:e.spacing(.5)})),wle=({tooltip:e,highlighted:t,tooltipProps:n,children:r,...o})=>s(EC,{title:e,...n,arrow:!0,children:s(ble,{highlighted:t,...o,children:r})}),Sle=E(ke)(({theme:e})=>({fontSize:e.fontSizes.smallerBody})),xle=({row:e,value:t})=>{var r,o,i;const{searchQuery:n}=uf();return!e.original.tags||e.original.tags.length===0?s(fo,{}):s(fo,{children:s(wle,{highlighted:n.length>0&&t.toLowerCase().includes(n.toLowerCase()),tooltip:s(Re,{children:(r=e.original.tags)==null?void 0:r.map(a=>s(Sle,{children:s(Gc,{search:n,children:`${a.type}:${a.value}`})},a.type+a.value))}),children:((o=e.original.tags)==null?void 0:o.length)===1?"1 tag":`${(i=e.original.tags)==null?void 0:i.length} tags`})})},ca={date:(e,t,n,r)=>{var a,l;const o=new Date(((a=e==null?void 0:e.values)==null?void 0:a[n])||0),i=new Date(((l=t==null?void 0:t.values)==null?void 0:l[n])||0);return(i==null?void 0:i.getTime())-(o==null?void 0:o.getTime())},boolean:(e,t,n,r)=>{var a,l;const o=(a=e==null?void 0:e.values)==null?void 0:a[n],i=(l=t==null?void 0:t.values)==null?void 0:l[n];return o===i?0:o?1:-1},alphanumeric:(e,t,n,r)=>{var a,l;const o=`${((a=e==null?void 0:e.values)==null?void 0:a[n])||""}`.toLowerCase(),i=`${((l=t==null?void 0:t.values)==null?void 0:l[n])||""}`.toLowerCase();return o==null?void 0:o.localeCompare(i)},playgroundResultState:(e,t,n,r)=>{var a,l;const o=(a=e==null?void 0:e.values)==null?void 0:a[n],i=(l=t==null?void 0:t.values)==null?void 0:l[n];return o===i?0:o==="true"?1:i==="true"||o==="false"?-1:i==="false"?1:0}},Cle=Object.assign({},...Object.entries(ca).map(([e,t])=>({[e]:(n,r,o,i)=>{var a,l,c,u;return(a=n==null?void 0:n.original)!=null&&a.favorite&&!((l=r==null?void 0:r.original)!=null&&l.favorite)?i?1:-1:!((c=n==null?void 0:n.original)!=null&&c.favorite)&&((u=r==null?void 0:r.original)!=null&&u.favorite)?i?-1:1:t(n,r,o,i)}}))),Ele=(e=!1)=>{const[t,n]=f.useState(e),{trackEvent:r}=Is(),o=a=>{r("favorite",{props:{eventType:`features ${a?"":"un"}pinned `}}),n(a)},i=f.useMemo(()=>t?Cle:ca,[t]);return{isFavoritesPinned:t,onChangeIsFavoritePinned:o,sortTypes:i}},It=()=>{const{setToast:e}=f.useContext($s),t=()=>e(o=>({...o,show:!1})),n=f.useCallback((o,i)=>{e({title:"Something went wrong",text:o,type:"error",show:!0,autoHideDuration:12e3,...i})},[e]);return{setToastData:f.useCallback(o=>{o.persist?e({...o,show:!0}):e({...o,show:!0,autoHideDuration:6e3})},[e]),setToastApiError:n,hideToast:t}},ht=e=>e instanceof Error?e.message||e.toString():typeof e=="string"?e:"Unknown error",Un=({handleBadRequest:e,handleNotFound:t,handleForbidden:n,handleUnauthorized:r,propagateErrors:o=!1})=>{const[i,a]=f.useState({}),[l,c]=f.useState(!1),u=f.useCallback(async(h,m)=>{var y;if(h.status===Ux){if(e)return e(a,h,m);if(a(v=>({...v,badRequest:"Bad request format"})),o){const v=await h.json();throw new Wx(h.status,v)}}if(h.status===f3){if(t)return t(a,h,m);if(a(v=>({...v,notFound:"Could not find the requested resource"})),o)throw new Hx(h.status)}if(h.status===m3){if(r)return r(a,h,m);if(a(v=>({...v,unauthorized:Qb})),o)throw new g3(h.status)}if(h.status===h3){if(n)return n(a,h,m);if(a(v=>({...v,forbidden:"This operation is forbidden"})),o){const v=await h.json();throw new xte(h.status,v)}}if(h.status>399){const v=await h.json();if(((y=v==null?void 0:v.details)==null?void 0:y.length)>0&&o){const b=v.details[0];if(o)throw new Error(b.message||b.msg);return b}if((v==null?void 0:v.length)>0&&o){const b=v[0];throw new Error(b.message||b.msg)}if(o)throw new Error("Action could not be performed")}},[e,n,t,r,o]),d=f.useCallback(async(h,m,y=!0)=>{y&&c(!0);try{const v=await h();return c(!1),v.status>299&&await u(v,m),v.status===tf&&a({}),v}catch(v){throw c(!1),v}},[u]),p=f.useCallback((h,m,y="")=>{const v={headers:Wb,credentials:"include"};return{caller:()=>fetch(Ft(h),{...v,...m}),id:y}},[]);return{loading:l,makeRequest:d,createRequest:p,errors:i}},kle=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),{setToastData:o,setToastApiError:i}=It(),{trackEvent:a}=Is(),l=f.useCallback(async(u,d)=>{const p=`api/admin/projects/${u}/features/${d}/favorites`,h=t(p,{method:"POST"},"addFavoriteFeature");try{await e(h.caller,h.id),o({title:"Toggle added to favorites",type:"success"}),a("favorite",{props:{eventType:"feature favorited"}})}catch(m){i(ht(m))}},[t,e]),c=f.useCallback(async(u,d)=>{const p=`api/admin/projects/${u}/features/${d}/favorites`,h=t(p,{method:"DELETE"},"removeFavoriteFeature");try{await e(h.caller,h.id),o({title:"Toggle removed from favorites",type:"success"}),a("favorite",{props:{eventType:"feature unfavorited"}})}catch(m){i(ht(m))}},[t,e]);return{favorite:l,unfavorite:c,errors:n,loading:r}},Tle=E(Je)(({theme:e})=>({paddingLeft:e.spacing(1.25)})),yO=E(Qt)(({theme:e})=>({color:e.palette.primary.main,padding:e.spacing(1.25)})),_le=E(yO)({opacity:0}),Rle=({value:e,onClick:t})=>s(Tle,{children:s(X,{condition:Boolean(e),show:s(yO,{onClick:t,size:"small",children:s(zx,{fontSize:"small"})}),elseShow:s(_le,{className:"show-row-hover",onClick:t,size:"small",children:s(jx,{fontSize:"small"})})})}),Ple=({isActive:e=!1,onClick:t})=>{const[n,r]=f.useState(e);return s(du,{title:n?"Unpin favorite features from the top":"Pin favorite features to the top",children:s(Qt,{sx:{mx:-.75,display:"flex",alignItems:"center",justifyContent:"center",padding:1.25},onClick:()=>{r(!n),t(!n)},size:"small",children:s(X,{condition:n,show:s(zx,{fontSize:"small"}),elseShow:s(jx,{fontSize:"small"})})})})},$le=()=>{const{value:e,setValue:t}=Dv("global:v1",{});return{value:e,setValue:t}},Mv=(e,t,n)=>{f.useEffect(()=>{const r=e.filter(({condition:i})=>i).flatMap(({columns:i})=>i),o=e.flatMap(({columns:i})=>i).filter(i=>!r.includes(i));t(i=>[...new Set([...i,...r].filter(a=>!o.includes(a)))])},[...e.map(({condition:r})=>r),t,n])};var PC={},Ile=fn;Object.defineProperty(PC,"__esModule",{value:!0});var bO=PC.default=void 0,Ale=Ile(En()),Ole=kn,Lle=(0,Ale.default)((0,Ole.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),"FileDownload");bO=PC.default=Lle;const pu=()=>{const{data:e,error:t,mutate:n}=gn(Ft("api/admin/environments"),Dle),r=f.useMemo(()=>e||[],[e]),o=f.useCallback(async()=>{await n()},[n]),i=f.useCallback(async a=>{await n(a,!1)},[n]);return{environments:r,refetchEnvironments:o,mutateEnvironments:i,loading:!t&&!e,error:t}},Dle=async e=>(await fetch(e).then(Cn("Environments")).then(n=>n.json())).environments.sort((n,r)=>n.sortOrder-r.sortOrder),fu=({name:e,value:t="",label:n="",options:r,onChange:o,id:i,disabled:a=!1,className:l,classes:c,fullWidth:u,...d})=>T(Da,{variant:"outlined",size:"small",classes:c,fullWidth:u,children:[s(Zp,{htmlFor:i,children:n}),s(ef,{name:e,disabled:a,onChange:h=>{h.preventDefault(),o(String(h.target.value))},className:l,label:n,id:i,value:t,IconComponent:Ub,...d,children:r.map(h=>s(ws,{sx:h.sx,value:h.key,title:h.title||"","data-testid":`${w3}-${h.label}`,disabled:h.disabled,children:h.label},h.key))})]}),Nle=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{loading:r,errors:n,createExport:async i=>{const l=t("api/admin/features-batch/export",{method:"POST",body:JSON.stringify(i)});try{return await e(l.caller,l.id)}catch(c){throw c}}}},Mle=E(fu)(({theme:e})=>({minWidth:"250px",marginTop:e.spacing(2)})),Ble=({showExportDialog:e,data:t,onClose:n,environments:r})=>{const[o,i]=f.useState(r[0].name),{createExport:a}=Nle(),l=f.createRef(),{setToastApiError:c}=It(),u=()=>r.map(m=>({key:m.name,label:m.name})),d=()=>({features:t.map(m=>m.name),environment:o}),p=m=>{var g,S;const y=document.createElement("a");(g=l.current)==null||g.appendChild(y),y.style.display="display: none";const v=new Blob([JSON.stringify(m)],{type:"application/json"}),b=window.URL.createObjectURL(v);y.href=b;const w=new Date;y.download=`${w.toISOString()}-export.json`,y.click(),window.URL.revokeObjectURL(b),(S=l.current)==null||S.removeChild(y)};return s(cr,{open:e,title:"Export feature toggle configuration",onClose:n,onClick:async()=>{try{const m=d(),v=await(await a(m)).json();p(v),n()}catch(m){c(ht(m))}},primaryButtonText:"Export selection",secondaryButtonText:"Cancel",children:T(Je,{ref:l,children:["The current search filter will be used to export feature toggles. Currently ",t.length," feature toggles will be exported.",s("br",{}),s("br",{}),s(ke,{children:"Select which environment to export feature toggle configuration from:"}),s(Mle,{options:u(),value:o,onChange:m=>i(m)})]})})},wO=Array(15).fill({name:"Name of the feature",description:"Short description of the feature",type:"-",createdAt:new Date(2022,1,1),project:"projectID"}),Fle={id:"createdAt"},{value:SR,setValue:zle}=Dv("FeatureToggleListTable:v1",Fle),jle=()=>{var Z,J;const e=sn(),{environments:t}=pu(),n=Er(e.breakpoints.down("md")),r=Er(e.breakpoints.down("lg")),[o,i]=f.useState(!1),{features:a=[],loading:l,refetchFeatures:c}=dC(),[u,d]=jp(),{uiConfig:p}=Lt(),[h]=f.useState(()=>({sortBy:[{id:u.get("sort")||SR.id,desc:u.has("order")?u.get("order")==="desc":SR.desc}],hiddenColumns:["description"],globalFilter:u.get("search")||""})),{value:m,setValue:y}=$le(),{isFavoritesPinned:v,sortTypes:b,onChangeIsFavoritePinned:w}=Ele(u.has("favorites")?u.get("favorites")==="true":m.favorites),[g,S]=f.useState(h.globalFilter),{favorite:C,unfavorite:R}=kle(),k=f.useCallback(async z=>{z!=null&&z.favorite?await R(z.project,z.name):await C(z.project,z.name),c()},[C,c,R]),P=f.useMemo(()=>[{Header:s(Ple,{isActive:v,onClick:w}),accessor:"favorite",Cell:({row:{original:z}})=>s(Rle,{value:z==null?void 0:z.favorite,onClick:()=>k(z)}),maxWidth:50,disableSortBy:!0},{Header:"Seen",accessor:"lastSeenAt",Cell:oO,sortType:"date",align:"center",maxWidth:85},{Header:"Type",accessor:"type",Cell:lO,align:"center",maxWidth:85},{Header:"Name",accessor:"name",minWidth:150,Cell:Cse,sortType:"alphanumeric",searchable:!0},{id:"tags",Header:"Tags",accessor:z=>{var W;return((W=z.tags)==null?void 0:W.map(({type:$,value:N})=>`${$}:${N}`).join(`
|
|
291
|
+
`))||""},Cell:xle,width:80,searchable:!0},{Header:"Created",accessor:"createdAt",Cell:Ep,sortType:"date",maxWidth:150},{Header:"Project ID",accessor:"project",Cell:({value:z})=>s(Os,{title:z,to:`/projects/${z}`}),sortType:"alphanumeric",maxWidth:150,filterName:"project",searchable:!0},{Header:"State",accessor:"stale",Cell:fO,sortType:"boolean",maxWidth:120,filterName:"state",filterParsing:z=>z?"stale":"active"},{accessor:"description",Header:"Description",searchable:!0}],[v]),{data:O,getSearchText:L,getSearchContext:I}=RC(P,g,a),A=f.useMemo(()=>(O==null?void 0:O.length)===0&&l?wO:O,[O,l]),{headerGroups:M,rows:F,prepareRow:j,state:{sortBy:q},setHiddenColumns:G}=tn.useTable({columns:P,data:A,initialState:h,sortTypes:b,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},tn.useSortBy,tn.useFlexLayout);return Mv([{condition:!a.some(({tags:z})=>z==null?void 0:z.length),columns:["tags"]},{condition:n,columns:["type","createdAt","tags"]},{condition:r,columns:["lastSeenAt","stale"]}],G,P),f.useEffect(()=>{const z={};z.sort=q[0].id,q[0].desc&&(z.order="desc"),g&&(z.search=g),v&&(z.favorites="true"),d(z,{replace:!0}),zle({id:q[0].id,desc:q[0].desc||!1}),y(W=>({...W,favorites:Boolean(v)}))},[q,g,d,v]),t.length>0?T(gr,{isLoading:l,header:s(xn,{title:`Feature toggles (${F.length<A.length?`${F.length} of ${A.length}`:A.length})`,actions:T(Re,{children:[s(X,{condition:!n,show:T(Re,{children:[s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:I}),s(xn.Divider,{})]})}),s(po,{component:on,to:"/archive",underline:"always",sx:{marginRight:2},children:"View archive"}),s(X,{condition:Boolean((Z=p==null?void 0:p.flags)==null?void 0:Z.featuresExportImport),show:s(Tt,{title:"Export current selection",arrow:!0,children:s(Qt,{onClick:()=>i(!0),sx:z=>({marginRight:z.spacing(2)}),children:s(bO,{})})})}),s(Xse,{loading:!1,filter:{query:"",project:"default"}})]}),children:s(X,{condition:n,show:s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:I})})}),children:[s(As,{value:L(g),children:s(uC,{rows:F,headerGroups:M,prepareRow:j})}),s(X,{condition:F.length===0,show:s(X,{condition:(g==null?void 0:g.length)>0,show:T(Zn,{children:["No feature toggles found matching “",g,"”"]}),elseShow:s(Zn,{children:"No feature toggles available. Get started by adding a new feature toggle."})})}),s(X,{condition:Boolean((J=p==null?void 0:p.flags)==null?void 0:J.featuresExportImport),show:s(Ble,{showExportDialog:o,data:A,onClose:()=>i(!1),environments:t})})]}):null},hu=()=>{const{data:e,error:t}=gn(Zb,Ule),n=f.useCallback(()=>{Vr(Zb).catch(console.warn)},[]);return{strategies:(e==null?void 0:e.strategies)||Hle,refetchStrategies:n,loading:!t&&!e,error:t}},Ule=()=>fetch(Zb).then(Cn("Strategy types")).then(e=>e.json()),Wle={deprecated:!1,name:"flexibleRollout",displayName:"Gradual rollout",editable:!1,description:"Roll out to a percentage of your userbase, and ensure that the experience is the same for the user on each visit.",parameters:[{name:"rollout",type:"percentage",description:"",required:!1},{name:"stickiness",type:"string",description:"Used to defined stickiness",required:!0},{name:"groupId",type:"string",description:"",required:!0}]},Hle=[Wle],Zb=Ft("api/admin/strategies"),Vle=Ft("api/admin/metrics/applications"),SO=(e={})=>{const t=async()=>fetch(Vle,{method:"GET"}).then(Cn("Applications data")).then(c=>c.json()),n="api/admin/metrics/applications",{data:r,error:o}=gn(n,t,{...e}),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{applications:(r==null?void 0:r.applications)||[],error:o,loading:i,refetchApplications:l,APPLICATIONS_CACHE_KEY:n}},Gle="_truncate_h6uff_2",qle="_fullwidth_h6uff_8",Yle="_sectionPadding_h6uff_12",Kle="_horisontalScroll_h6uff_16",Xle="_listLink_h6uff_25",Jle="_hideLt920_h6uff_37",Qle="_hideLt600_h6uff_42",Zle="_dataTableHeader_h6uff_46",ece="_titleText_h6uff_51",tce="_actions_h6uff_56",nce="_switchWithLabel_h6uff_60",rce="_label_h6uff_63",oce="_emptyState_h6uff_72",ice="_toggleName_h6uff_80",ace="_toolbar_h6uff_85",sce="_toolbarButton_h6uff_91",lce="_error_h6uff_98",cce="_headerTitle_h6uff_102",uce="_listItem_h6uff_107",dce="_section_h6uff_12",pce="_contentPadding_h6uff_115",fce="_contentSpacing_h6uff_119",hce="_searchField_h6uff_123",Tc={truncate:Gle,fullwidth:qle,sectionPadding:Yle,horisontalScroll:Kle,listLink:Xle,hideLt920:Jle,hideLt600:Qle,dataTableHeader:Zle,titleText:ece,actions:tce,switchWithLabel:nce,label:rce,switch:"_switch_h6uff_60",emptyState:oce,toggleName:ice,toolbar:ace,toolbarButton:sce,error:lce,headerTitle:cce,listItem:uce,section:dce,contentPadding:pce,contentSpacing:fce,searchField:hce},$C=({apps:e})=>s(Yi,{children:s(X,{condition:e.length>0,show:e.map(({appName:t,description:n,icon:r})=>T(zi,{className:Tc.listItem,children:[s(es,{children:s(fv,{children:s(X,{condition:r,show:s(_x,{children:r}),elseShow:s(qee,{})},`avatar_conditional_${t}`)})}),s(un,{primary:s(on,{to:`/applications/${encodeURIComponent(t)}`,className:[Tc.listLink,Tc.truncate].join(" "),children:t}),secondary:n||"No description"})]},t))})});$C.propTypes={apps:pt.array.isRequired};pt.string,pt.any;pt.string,pt.func.isRequired,pt.string;pt.string,pt.object;const mce=jt.forwardRef(({icon:e,label:t,disabled:n,...r},o)=>T(ws,{disabled:n,style:{display:"flex",alignItems:"center"},...r,children:[s(e,{}),t]}));mce.propTypes={icon:pt.object,label:pt.string,disabled:pt.bool};const gce="_deprecated_nqviu_10",vce="_formButtons_nqviu_14",yce="_header_nqviu_18",bce="_formContainer_nqviu_32",wce="_inset_nqviu_38",Sce="_parameter_menu_nqviu_42",xce="_listcontainer_nqviu_52",Cce="_listItem_nqviu_56",Ece={"non-style-button":"_non-style-button_nqviu_1",deprecated:gce,formButtons:vce,header:yce,formContainer:bce,inset:wce,parameter_menu:Sce,listcontainer:xce,listItem:Cce},kce=({toggles:e})=>s(Yi,{style:{textAlign:"left"},className:Tc.truncate,children:s(X,{condition:e.length>0,show:e.map(({name:t,description:n="-",enabled:r})=>T(zi,{children:[s(es,{children:s(X,{condition:Boolean(r),show:s(Tt,{title:"Enabled",arrow:!0,children:s(pte,{"aria-hidden":!1})}),elseShow:s(Tt,{title:"Disabled",arrow:!0,children:s(dte,{"aria-hidden":!1})})})}),s(un,{primary:s(on,{to:`/features/view/${t}`,children:t},t),secondary:n})]},t))})}),Tce=({strategy:e,applications:t,toggles:n})=>{const r=sn(),{parameters:o=[]}=e,i=a=>a.length>0?a.map(({name:l,type:c,description:u,required:d},p)=>T(zi,{children:[s(X,{condition:d,show:s(es,{children:s(Tt,{title:"Required parameter",arrow:!0,children:s(Si,{"aria-hidden":!1})})}),elseShow:s(es,{children:s(Tt,{title:"Optional parameter",arrow:!0,children:s(fte,{"aria-hidden":!1})})})}),s(un,{primary:T("div",{children:[l," ",T("small",{children:["(",c,")"]})]}),secondary:u})]},`${l}-${p}`)):s(zi,{children:"No params"});return s("div",{className:Ece.listcontainer,children:T(_n,{container:!0,children:[s(X,{condition:e.deprecated,show:s(_n,{item:!0,children:s("h5",{style:{color:r.palette.error.main},children:"Deprecated"})})}),T(_n,{item:!0,sm:12,md:12,children:[s("h6",{children:"Parameters"}),s("hr",{}),s(Yi,{children:i(o)})]}),T(_n,{item:!0,sm:12,md:6,children:[s("h6",{children:"Applications using this strategy"}),s("hr",{}),s($C,{apps:t})]}),T(_n,{item:!0,sm:12,md:6,children:[s("h6",{children:"Toggles using this strategy"}),s("hr",{}),s(kce,{toggles:n})]})]})})},xO=e=>zM()[e],ur=e=>{const t=xO(e);if(!t)throw new Error(`Missing required path param: ${e}`);return t},_ce=()=>{const e=ur("name"),{strategies:t}=hu(),{features:n=[]}=dC(),{applications:r}=SO(),o=ft(),i=n.filter(c=>{var u;return(u=c==null?void 0:c.environments)==null?void 0:u.flatMap(d=>d.strategies).some(d=>d&&d.name===e)}),a=t.find(c=>c.name===e),l=()=>{o(`/strategies/${e}/edit`)};return a?s(gr,{header:s(xn,{title:a==null?void 0:a.name,subtitle:a==null?void 0:a.description,actions:s(X,{condition:a.editable,show:s(mr,{permission:Iv,"data-loading":!0,onClick:l,tooltipProps:{title:"Edit strategy"},children:s(ea,{})})})}),children:s(_n,{container:!0,children:s(_n,{item:!0,xs:12,sm:12,children:s(Tce,{strategy:a,toggles:i,applications:r})})})}):null},Rce=E(Je)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",padding:e.spacing(0,1.5)})),Pce=E(uo)(({theme:e})=>({borderColor:e.palette.dividerAlternative,height:e.spacing(3),margin:e.spacing(0,2)})),$ce=()=>s(Pce,{orientation:"vertical",variant:"middle"}),CO=({children:e})=>s(Rce,{children:e});CO.Divider=$ce;const na=CO;var IC={},Ice=fn;Object.defineProperty(IC,"__esModule",{value:!0});var EO=IC.default=void 0,Ace=Ice(En()),Oce=kn,Lce=(0,Ace.default)((0,Oce.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),"LocationOn");EO=IC.default=Lce;var AC={},Dce=fn;Object.defineProperty(AC,"__esModule",{value:!0});var kO=AC.default=void 0,Nce=Dce(En()),Mce=kn,Bce=(0,Nce.default)((0,Mce.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"People");kO=AC.default=Bce;var OC={},Fce=fn;Object.defineProperty(OC,"__esModule",{value:!0});var TO=OC.default=void 0,zce=Fce(En()),jce=kn,Uce=(0,zce.default)((0,jce.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language");TO=OC.default=Uce;var LC={},Wce=fn;Object.defineProperty(LC,"__esModule",{value:!0});var _O=LC.default=void 0,Hce=Wce(En()),Vce=kn,Gce=(0,Hce.default)((0,Vce.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");_O=LC.default=Gce;const qce=e=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.584 10H22a2 2 0 1 1 0 4h-5.416a5.001 5.001 0 0 1-9.168 0H2a2 2 0 1 1 0-4h5.416a5.001 5.001 0 0 1 9.168 0Z"})),kp=e=>Jce[e]??e,Yce=e=>s(Rb,{...e,component:t=>s(qce,{...t}),inheritViewBox:!0}),Kce=e=>{switch(e){case"default":return wC;case"remoteAddress":return TO;case"flexibleRollout":return Yce;case"userWithId":return kO;case"applicationHostname":return EO;default:return _O}},Xce=({strategyName:e})=>{const t=sn(),n=Kce(e);return s(n,{style:{color:t.palette.neutral.main}})},Jce={applicationHostname:"Hosts",default:"Standard",flexibleRollout:"Gradual rollout",gradualRolloutRandom:"Randomized",gradualRolloutSessionId:"Sessions",gradualRolloutUserId:"Users",remoteAddress:"IPs",userWithId:"UserIDs"},td="api/admin/strategies",DC=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o=f.useCallback(async u=>{const d=t(td,{method:"POST",body:JSON.stringify(u)});return e(d.caller,d.id)},[t,e]),i=f.useCallback(async u=>{const d=`${td}/${u.name}`,p=t(d,{method:"PUT",body:JSON.stringify(u)});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),a=f.useCallback(async u=>{const d=`${td}/${u.name}`,p=t(d,{method:"DELETE"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),l=f.useCallback(async u=>{const d=`${td}/${u.name}/deprecate`,p=t(d,{method:"POST"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]),c=f.useCallback(async u=>{const d=`${td}/${u.name}/reactivate`,p=t(d,{method:"POST"});try{return await e(p.caller,p.id)}catch(h){throw h}},[t,e]);return{createStrategy:o,updateStrategy:i,removeStrategy:a,deprecateStrategy:l,reactivateStrategy:c,errors:n,loading:r}},Qce=()=>{const e=Er("(max-width:700px)"),t=ft();return s(X,{condition:e,show:s(mr,{"data-testid":N_,onClick:()=>t("/strategies/create"),permission:jm,size:"large",tooltipProps:{title:"New strategy type"},children:s(Si,{})}),elseShow:s(Io,{onClick:()=>t("/strategies/create"),color:"primary",permission:jm,"data-testid":N_,children:"New strategy type"})})},Zce=jt.forwardRef((e,t)=>{const n=qc(e.permission,e.projectId,e.environmentId);return s(RO,{...e,access:n,ref:t})}),eue=jt.forwardRef((e,t)=>{const n=_C(e.permission,e.projectId,e.environmentId);return s(RO,{...e,access:n,ref:t})}),RO=jt.forwardRef((e,t)=>{const{access:n,permission:r,tooltip:o,disabled:i,projectId:a,environmentId:l,checked:c,onChange:u,...d}=e;return s(du,{title:Nv(n,o),arrow:!0,children:s("span",{"data-loading":!0,children:s(Na,{"data-testid":"toggle-switch",onChange:u,disabled:i||!n,checked:c,ref:t,...d})})})}),PO=jt.forwardRef((e,t)=>typeof e.projectId<"u"&&typeof e.environmentId<"u"?s(Zce,{...e,projectId:e.projectId,environmentId:e.environmentId,ref:t}):s(eue,{...e,ref:t})),tue=({deprecated:e,disabled:t,onToggle:n})=>{const r=()=>{n(e)},o=Ss();return s(Tt,{title:t?"You cannot disable default strategy":e?"Excluded from strategy list":"Included in strategy list",describeChild:!0,arrow:!0,children:s("div",{id:o,children:s(PO,{checked:!e,permission:Iv,onClick:r,disabled:t,inputProps:{"aria-labelledby":o}})})})},nue=({strategy:e,onClick:t})=>{const n=Ss();return s(X,{condition:e==null?void 0:e.editable,show:s(mr,{onClick:t,permission:Iv,tooltipProps:{title:"Edit strategy"},children:s(ea,{})}),elseShow:s(Tt,{title:"You cannot edit a built-in strategy",arrow:!0,children:s("div",{id:n,children:s(Qt,{disabled:!0,size:"large",children:s(ea,{"aria-labelledby":n})})})})})},rue=({strategy:e,onClick:t})=>{const n=Ss();return s(X,{condition:e==null?void 0:e.editable,show:s(mr,{onClick:t,permission:boe,tooltipProps:{title:"Delete strategy"},children:s(ti,{})}),elseShow:s(Tt,{title:"You cannot delete a built-in strategy",arrow:!0,children:s("div",{id:n,children:s(Qt,{disabled:!0,size:"large",children:s(ti,{"aria-labelledby":n})})})})})},oue=E("div")(({theme:e,color:t="neutral",icon:n})=>({display:"inline-flex",alignItems:"center",padding:e.spacing(n?.375:.625,1),borderRadius:e.shape.borderRadius,fontSize:e.fontSizes.smallerBody,fontWeight:e.fontWeight.bold,lineHeight:1,backgroundColor:e.palette[t].light,color:e.palette[t].dark,border:`1px solid ${e.palette[t].border}`})),iue=E("div")(({theme:e,color:t="neutral",iconRight:n=!1})=>({display:"flex",color:e.palette[t].main,margin:n?e.spacing(0,0,0,.5):e.spacing(0,.5,0,0)})),xR=(e,t,n=!1)=>s(iue,{color:e,iconRight:n,children:s(X,{condition:Boolean(t==null?void 0:t.props.sx),show:t,elseShow:()=>f.cloneElement(t,{sx:{fontSize:"16px"}})})}),bi=f.forwardRef(({color:e="neutral",icon:t,iconRight:n,className:r,sx:o,children:i,...a},l)=>T(oue,{color:e,icon:t,className:r,sx:o,...a,ref:l,children:[s(X,{condition:Boolean(t)&&!Boolean(n),show:xR(e,t)}),i,s(X,{condition:Boolean(t)&&Boolean(n),show:xR(e,t,!0)})]})),aue=E(bi)(({theme:e})=>({marginLeft:e.spacing(1),display:"inline-block"})),sue=()=>{const e=ft(),[t,n]=f.useState({show:!1,title:"",onConfirm:()=>{}}),{strategies:r,refetchStrategies:o,loading:i}=hu(),{removeStrategy:a,deprecateStrategy:l,reactivateStrategy:c}=DC(),{setToastData:u,setToastApiError:d}=It(),p=f.useMemo(()=>i?Array(5).fill({name:"Context name",description:"Context description when loading"}):r.map(({name:I,description:A,editable:M,deprecated:F})=>({name:I,description:A,editable:M,deprecated:F})),[r,i]),h=f.useCallback(I=>A=>{n(A?{show:!0,title:"Really reactivate strategy?",onConfirm:async()=>{try{await c(I),o(),u({type:"success",title:"Success",text:"Strategy reactivated successfully"})}catch(M){d(ht(M))}}}:{show:!0,title:"Really deprecate strategy?",onConfirm:async()=>{try{await l(I),o(),u({type:"success",title:"Success",text:"Strategy deprecated successfully"})}catch(M){d(ht(M))}}})},[l,c,o,d,u]),m=f.useCallback(I=>{n({show:!0,title:"Really delete strategy?",onConfirm:async()=>{try{await a(I),o(),u({type:"success",title:"Success",text:"Strategy deleted successfully"})}catch(A){d(ht(A))}}})},[a,o,d,u]),y=f.useCallback(I=>{e(`/strategies/${I.name}/edit`)},[e]),v=f.useMemo(()=>[{id:"Icon",Cell:()=>s(Je,{"data-loading":!0,sx:{pl:3,pr:1,display:"flex",alignItems:"center"},children:s(l3,{color:"disabled"})}),disableGlobalFilter:!0},{id:"Name",Header:"Name",accessor:I=>kp(I.name),width:"90%",Cell:({row:{original:{name:I,description:A,deprecated:M,editable:F}}})=>{const j=M?`${A} (deprecated)`:A;return s(Os,{"data-loading":!0,title:kp(I),subtitle:j,to:`/strategies/${I}`,children:s(X,{condition:!F,show:()=>s(aue,{color:"success",children:"Predefined"})})})},sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:I}})=>T(na,{children:[s(tue,{deprecated:I.deprecated,onToggle:h(I),disabled:I.name==="default"}),s(na.Divider,{}),s(nue,{strategy:I,onClick:()=>y(I)}),s(rue,{strategy:I,onClick:()=>m(I)})]}),width:150,disableGlobalFilter:!0,disableSortBy:!0},{accessor:"description",disableSortBy:!0},{accessor:"sortOrder",disableGlobalFilter:!0,sortType:"number"}],[h,y,m]),b=f.useMemo(()=>({sortBy:[{id:"Name",desc:!1}],hiddenColumns:["description","sortOrder"]}),[]),{getTableProps:w,getTableBodyProps:g,headerGroups:S,rows:C,prepareRow:R,state:{globalFilter:k},setGlobalFilter:P}=tn.useTable({columns:v,data:p,initialState:b,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useGlobalFilter,tn.useSortBy),O=()=>{t==null||t.onConfirm(),n(I=>({...I,show:!1}))};let L=C.length;return T(gr,{isLoading:i,header:s(xn,{title:`Strategy types (${L})`,actions:T(Re,{children:[s(go,{initialValue:k,onChange:P}),s(xn.Divider,{}),s(Qce,{})]})}),children:[s(As,{value:k,children:T(za,{...w(),children:[s(Fa,{headerGroups:S}),s(Ma,{...g(),children:C.map(I=>(R(I),s(sa,{hover:!0,...I.getRowProps(),children:I.cells.map(A=>s(ta,{...A.getCellProps(),children:A.render("Cell")}))})))})]})}),s(X,{condition:C.length===0,show:s(X,{condition:(k==null?void 0:k.length)>0,show:T(Zn,{children:["No strategies found matching “",k,"”"]}),elseShow:s(Zn,{children:"No strategies available. Get started by adding one."})})}),s(cr,{open:t.show,onClick:O,title:t==null?void 0:t.title,onClose:()=>n(I=>({...I,show:!1}))})]})},Bv=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createTag:async c=>{const d=t("api/admin/tag-types",{method:"POST",body:JSON.stringify(c)});try{return await e(d.caller,d.id)}catch(p){throw p}},validateTagName:async c=>{const d=t("api/admin/tag-types/validate",{method:"POST",body:JSON.stringify({name:c})});try{return await e(d.caller,d.id)}catch(p){throw p}},updateTagType:async(c,u)=>{const d=`api/admin/tag-types/${c}`,p=t(d,{method:"PUT",body:JSON.stringify(u)});try{return await e(p.caller,p.id)}catch(h){throw h}},deleteTagType:async c=>{const u=`api/admin/tag-types/${c}`,d=t(u,{method:"DELETE"});try{return await e(d.caller,d.id)}catch(p){throw p}},errors:n,loading:r}},lue=(e={})=>{const t=async()=>{const c=Ft("api/admin/tag-types");return(await fetch(c,{method:"GET"}).then(Cn("Tag types"))).json()},n="api/admin/tag-types",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{tagTypes:(r==null?void 0:r.tagTypes)||[],error:o,loading:i,refetch:l}},cue=()=>{const e=ft(),t=Er("(max-width:700px)");return s(X,{condition:t,show:s(mr,{onClick:()=>e("/tag-types/create"),size:"large",permission:xp,children:s(Si,{})}),elseShow:s(Io,{permission:xp,onClick:()=>e("/tag-types/create"),children:"New tag type"})})},uue=()=>{const[e,t]=f.useState({open:!1}),n=ft(),{deleteTagType:r}=Bv(),{tagTypes:o,refetch:i,loading:a}=lue(),{setToastData:l,setToastApiError:c}=It(),u=f.useMemo(()=>a?Array(5).fill({name:"Tag type name",description:"Tag type description when loading"}):o.map(({name:C,description:R})=>({name:C,description:R})),[o,a]),d=f.useMemo(()=>[{id:"Icon",Cell:()=>s(Je,{"data-loading":!0,sx:{pl:2,pr:1,display:"flex",alignItems:"center"},children:s(ste,{color:"disabled"})}),disableGlobalFilter:!0},{Header:"Name",accessor:"name",width:"90%",Cell:({row:{original:{name:C,description:R}}})=>s(Os,{"data-loading":!0,title:C,subtitle:R}),sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:C}})=>T(Je,{sx:{display:"flex",justifyContent:"flex-end"},"data-loading":!0,children:[s(mr,{onClick:()=>n(`/tag-types/edit/${C.name}`),permission:xp,tooltipProps:{title:"Edit tag type"},children:s(ea,{})}),s(mr,{permission:xoe,tooltipProps:{title:"Delete tag type"},onClick:()=>t({open:!0,name:C.name}),children:s(ti,{})})]}),width:150,disableGlobalFilter:!0,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[n]),p=f.useMemo(()=>({sortBy:[{id:"name",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:h,getTableBodyProps:m,headerGroups:y,rows:v,prepareRow:b,state:{globalFilter:w},setGlobalFilter:g}=tn.useTable({columns:d,data:u,initialState:p,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useGlobalFilter,tn.useSortBy),S=async()=>{try{e.name&&(await r(e.name),i(),t({open:!1}),l({type:"success",show:!0,title:"Successfully deleted tag type."}))}catch(C){c(ht(C))}};return T(gr,{isLoading:a,header:s(xn,{title:`Tag types (${v.length})`,actions:T(Re,{children:[s(go,{initialValue:w,onChange:g}),s(xn.Divider,{}),s(cue,{})]})}),children:[s(As,{value:w,children:T(za,{...h(),children:[s(Fa,{headerGroups:y}),s(Ma,{...m(),children:v.map(C=>(b(C),s(sa,{hover:!0,...C.getRowProps(),children:C.cells.map(R=>s(ta,{...R.getCellProps(),children:R.render("Cell")}))})))})]})}),s(X,{condition:v.length===0,show:s(X,{condition:(w==null?void 0:w.length)>0,show:T(Zn,{children:["No tags found matching “",w,"”"]}),elseShow:s(Zn,{children:"No tags available. Get started by adding one."})})}),s(cr,{title:"Really delete Tag type?",open:e.open,onClick:S,onClose:()=>{t({open:!1})}})]})},Fv=(e={})=>{const t=async()=>{const c=Ft("api/admin/addons");return(await fetch(c,{method:"GET"}).then(Cn("Addons"))).json()},n="api/admin/addons",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=f.useCallback(()=>{Vr(n)},[n]);return f.useEffect(()=>{a(!o&&!r)},[r,o]),{addons:(r==null?void 0:r.addons)||[],providers:(r==null?void 0:r.providers)||[],error:o,loading:i,refetchAddons:l}},$O=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o="api/admin/addons",i=async c=>{const d=t(o,{method:"POST",body:JSON.stringify(c)});return e(d.caller,d.id)},a=async c=>{const u=`${o}/${c}`,d=t(u,{method:"DELETE"});return await e(d.caller,d.id)},l=f.useCallback(async c=>{const u=`${o}/${c.id}`,d=t(u,{method:"PUT",body:JSON.stringify(c)});return e(d.caller,d.id)},[t,e]);return{createAddon:i,updateAddon:l,removeAddon:a,errors:n,loading:r}},zv=({icon:e})=>s(Je,{sx:{pl:2,pr:1,display:"flex",alignItems:"center"},children:e}),due="/static/slack-c0af31c6.svg",pue="/static/jira-d9eb9af9.svg",fue="/static/webhooks-ffa904ac.svg",hue="/static/teams-62e72076.svg",mue="/static/datadog-591b6a73.svg",nd={width:"32.5px",height:"32.5px",marginRight:"16px"},IO=({name:e})=>{switch(e){case"slack":return s("img",{style:nd,alt:"Slack logo",src:Js(due)});case"jira-comment":return s("img",{style:nd,alt:"JIRA logo",src:Js(pue)});case"webhook":return s("img",{style:nd,alt:"Generic Webhook logo",src:Js(fue)});case"teams":return s("img",{style:nd,alt:"Microsoft Teams logo",src:Js(hue)});case"datadog":return s("img",{style:nd,alt:"Datadog logo",src:Js(mue)});default:return s(fv,{children:s(Zee,{})})}},gue=e=>{const[t,n]=f.useState(e),r=f.useCallback(()=>n(e),[e]);return f.useEffect(()=>{n(e)},[e]),[t,n,r]},vue=({toggleAddon:e,setShowDelete:t,setDeletedAddon:n,original:r})=>{const o=ft(),[i,a,l]=gue(r.enabled),c=()=>{a(!i),e(r).catch(l)};return T(na,{children:[s(Tt,{title:i?`Disable addon ${r.provider}`:`Enable addon ${r.provider}`,arrow:!0,describeChild:!0,children:s(PO,{permission:Gb,checked:i,onClick:c})}),s(na.Divider,{}),s(mr,{permission:Gb,tooltipProps:{title:"Edit Addon"},onClick:()=>o(`/addons/edit/${r.id}`),children:s(ea,{})}),s(mr,{permission:Coe,tooltipProps:{title:"Remove Addon"},onClick:()=>{n(r),t(!0)},children:s(ti,{})})]})},yue=()=>{const{refetchAddons:e,addons:t,loading:n}=Fv(),{updateAddon:r,removeAddon:o}=$O(),{setToastData:i,setToastApiError:a}=It(),[l,c]=f.useState(!1),[u,d]=f.useState({id:0,provider:"",description:"",enabled:!1,events:[],parameters:{}}),p=f.useMemo(()=>n?Array(5).fill({name:"Addon name",description:"Addon description when loading"}):t.map(k=>({...k})),[t,n]),h=f.useCallback(async k=>{try{await r({...k,enabled:!k.enabled}),e(),i({type:"success",title:"Success",text:k.enabled?"Addon is now disabled":"Addon is now enabled"})}catch(P){throw a(ht(P)),P}},[a,e,i,r]),m=f.useMemo(()=>[{id:"Icon",Cell:({row:{original:{provider:k}}})=>s(zv,{icon:s(IO,{name:k})})},{Header:"Name",accessor:"provider",width:"90%",Cell:({row:{original:{provider:k,description:P}}})=>s(Os,{"data-loading":!0,title:k,subtitle:P}),sortType:"alphanumeric"},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:k}})=>s(vue,{setShowDelete:c,toggleAddon:h,setDeletedAddon:d,original:k}),width:150,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[h]),y=f.useMemo(()=>({sortBy:[{id:"provider",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:v,getTableBodyProps:b,headerGroups:w,rows:g,prepareRow:S,state:{globalFilter:C}}=tn.useTable({columns:m,data:p,initialState:y,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useSortBy),R=async k=>{try{await o(k.id),e(),i({type:"success",title:"Success",text:"Deleted addon successfully"})}catch(P){a(ht(P))}};return T(gr,{isLoading:n,header:s(xn,{title:`Configured addons (${g.length})`}),sx:k=>({marginBottom:k.spacing(2)}),children:[T(za,{...v(),children:[s(Fa,{headerGroups:w}),s(Ma,{...b(),children:g.map(k=>(S(k),s(sa,{hover:!0,...k.getRowProps(),children:k.cells.map(P=>s(ta,{...P.getCellProps(),padding:"none",children:P.render("Cell")}))})))})]}),s(X,{condition:g.length===0,show:s(X,{condition:(C==null?void 0:C.length)>0,show:T(Zn,{children:["No addons found matching “",C,"”"]}),elseShow:s(Zn,{children:"No addons configured"})})}),s(cr,{open:l,onClick:()=>{R(u),c(!1)},onClose:()=>{c(!1)},title:"Confirm deletion",children:s("div",{children:"Are you sure you want to delete this Addon?"})})]})},bue=({name:e})=>{const t=ft();return s(Io,{permission:V3,variant:"outlined",onClick:()=>t(`/addons/create/${e}`),children:"Configure"})},wue=({providers:e,loading:t})=>{const n=f.useMemo(()=>t?Array(5).fill({name:"Provider name",description:"Provider description when loading"}):e.map(({name:p,displayName:h,description:m})=>({name:p,displayName:h,description:m})),[e,t]),r=f.useMemo(()=>[{id:"Icon",Cell:({row:{original:{name:p}}})=>s(zv,{icon:s(IO,{name:p})})},{Header:"Name",accessor:"name",width:"90%",Cell:({row:{original:{name:p,description:h}}})=>s(Os,{"data-loading":!0,title:p,subtitle:h}),sortType:"alphanumeric"},{id:"Actions",align:"center",Cell:({row:{original:p}})=>s(na,{children:s(bue,{name:p.name})}),width:150,disableSortBy:!0},{accessor:"description",disableSortBy:!0}],[]),o=f.useMemo(()=>({sortBy:[{id:"name",desc:!1}],hiddenColumns:["description"]}),[]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d}}=tn.useTable({columns:r,data:n,initialState:o,sortTypes:ca,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},tn.useSortBy);return T(gr,{isLoading:t,header:s(xn,{title:`Available addons (${c.length})`}),children:[T(za,{...i(),children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(p=>(u(p),s(sa,{hover:!0,...p.getRowProps(),children:p.cells.map(h=>s(ta,{...h.getCellProps(),children:h.render("Cell")}))})))})]}),s(X,{condition:c.length===0,show:s(X,{condition:(d==null?void 0:d.length)>0,show:T(Zn,{children:["No providers found matching “",d,"”"]}),elseShow:s(Zn,{children:"No providers available."})})})]})},Sue=()=>{const{providers:e,addons:t,loading:n}=Fv();return T(Re,{children:[s(X,{condition:t.length>0,show:s(yue,{})}),s(wue,{loading:n,providers:e})]})},Al=()=>new URLSearchParams(ri().search),xue=({children:e,from:t,to:n,style:r,...o})=>s("div",{style:{background:`linear-gradient(${t}, ${n})`,height:"100%",width:"100%",position:"relative",...r},...o,children:e}),Cue=e=>f.createElement("svg",{width:334,height:334,viewBox:"0 0 334 334",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{cx:167,cy:167,r:167,fill:"white"}),f.createElement("rect",{x:96.3462,y:96.3457,width:44.9615,height:141.308,fill:"#1A4049"}),f.createElement("rect",{x:192.692,y:96.3457,width:44.9615,height:141.308,fill:"#1A4049"}),f.createElement("path",{d:"M237.654 192.693L237.654 237.655L96.3461 237.655L96.3461 192.693L237.654 192.693Z",fill:"#1A4049"}),f.createElement("rect",{x:192.692,y:192.693,width:44.9615,height:44.9615,fill:"#817AFE"})),Eue=e=>f.createElement("svg",{id:"bg",width:"100%",height:"100%",viewBox:"0 0 622 318",fill:"none",...e},f.createElement("defs",null,f.createElement("style",null,".cls-1{fill:#fff;}.cls-2{fill:#1a4049;}.cls-3{fill:#817afe;}")),f.createElement("circle",{className:"cls-1",cx:125.62,cy:125.62,r:80}),f.createElement("polygon",{className:"cls-1",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-1",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("polygon",{className:"cls-2",points:"137.05 91.33 137.05 114.19 137.05 137.05 159.9 137.05 159.9 114.19 159.9 91.33 137.05 91.33"}),f.createElement("polygon",{className:"cls-2",points:"114.19 114.19 114.19 91.33 91.33 91.33 91.33 114.19 91.33 137.05 91.33 159.9 114.19 159.9 137.05 159.9 137.05 137.05 114.19 137.05 114.19 114.19"}),f.createElement("rect",{className:"cls-3",x:137.05,y:137.05,width:22.86,height:22.86}),f.createElement("path",{className:"cls-1",d:"M251.58,139.13V112.77h11.93v25.06c0,7.36,3.91,12.2,11.27,12.2s11.27-4.84,11.27-12.2V112.77h12v26.36c0,12.67-8.48,21.8-23.1,21.8C260.06,160.93,251.58,151.8,251.58,139.13Z"}),f.createElement("path",{className:"cls-1",d:"M321.91,159.9H310.08V112.77h11.83v7.92a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"}),f.createElement("path",{className:"cls-1",d:"M369.42,91.34h11.92V159.9H369.42Z"}),f.createElement("path",{className:"cls-1",d:"M441.24,137v1.3H403.79c.47,7.36,5.87,13,13.69,13,7.55,0,10.62-3.82,11.46-5.12h11.74c-.75,4.84-7.17,15-23.2,15-15.27,0-25.61-10.61-25.61-24.77,0-14.63,10.24-24.78,24.68-24.78S441.24,121.62,441.24,137Zm-37.08-6.9h24.6c-1.77-6-6.15-9.31-12.21-9.31C410.12,120.78,405.65,124.23,404.16,130.09Z"}),f.createElement("path",{className:"cls-1",d:"M467.78,130.37h15.47c0-5.68-4.29-9.31-11.27-9.31-6.62,0-9,3.54-9.78,4.75h-12c1-4.94,6.89-14.25,21.8-14.25,14.62,0,22.73,7.64,22.73,18.81V146.3c0,2.89,1,4,3.72,4.29v9.59h-3.72c-6.06-.09-9.69-2.33-11-6.52-2.23,3.45-7.26,7.27-15.27,7.27-11.09,0-19.47-6.24-19.47-15.93S456.14,130.37,467.78,130.37Zm15.47,12.11v-4H469.74c-5.59,0-9,2-9,6.33,0,4.57,4.29,7.27,10.25,7.27C477.66,152.08,483.25,148.82,483.25,142.48Z"}),f.createElement("path",{className:"cls-1",d:"M523.12,140.62c-10.34-.74-17.33-5.59-17.33-14.72,0-8.85,8.1-14.44,20.77-14.44,17,0,21.8,8.76,23.1,13.32H537.09c-.84-1-3.54-4.28-10.62-4.28-5.68,0-8.66,1.86-8.66,4.75,0,2.61,2,4.29,6.7,4.94l8,.84c12.77,1.11,18,6,18,15.27,0,8.85-7.36,14.91-21.8,14.91-17.51,0-23.19-10.16-24.12-14.53h12.76c.47,1.11,3.35,5.31,11.36,5.31,6.62,0,9.69-2.24,9.69-5.22s-1.67-4.66-7-5.31C528.05,141.18,526.38,141,523.12,140.62Z"}),f.createElement("path",{className:"cls-1",d:"M571.55,159.9H559.72V91.34h11.83v29.35a17.93,17.93,0,0,1,15.65-9c11.83,0,19.66,8.67,19.66,20.68V159.9h-12V134.75c0-7.45-4.38-12.39-11.46-12.39s-11.83,5-11.83,12.39Z"})),kue=E(xue)(({theme:e})=>({display:"flex",justifyContent:"center",[e.breakpoints.up("sm")]:{borderBottomLeftRadius:"3px",borderTopLeftRadius:"3px"}})),Tue=E("div")(({theme:e})=>({padding:e.spacing(12,8),color:"#fff",position:"relative",borderTopLeftRadius:"3px",borderBottomLeftRadius:"3px",textAlign:"right",[e.breakpoints.down("md")]:{padding:e.spacing(6,4)},[e.breakpoints.down("sm")]:{padding:e.spacing(6,2)}})),_ue=E(ke)(({theme:e})=>({color:"#fff",marginBottom:e.spacing(2),fontSize:e.spacing(4),marginTop:e.spacing(10),[e.breakpoints.down("md")]:{display:"none"}})),Rue=E(ke)(({theme:e})=>({[e.breakpoints.down("md")]:{display:"none"},[e.breakpoints.down("sm")]:{display:"none"},fontSize:e.spacing(4),fontWeight:"normal"})),Pue=E("div")(({theme:e})=>({position:"absolute",[e.breakpoints.up("md")]:{bottom:"-50px",left:"-50px",display:"flex",flexDirection:"column"}})),AO=e=>({width:"200px",[e.breakpoints.up("md")]:{width:"240px",height:"200px"}}),$ue=E(Eue)(({theme:e})=>({...AO(e)})),Iue=E(Cue)(({theme:e})=>({...AO(e)})),OO=({title:e})=>{const t=sn(),n=Er(t.breakpoints.down("md"));return T(kue,{from:t.palette.standaloneBannerGradient.from,to:t.palette.standaloneBannerGradient.to,children:[T(Tue,{children:[s(_ue,{variant:"h1",children:e}),s(Rue,{children:"Committed to creating new ways of developing software"})]}),s(Pue,{children:s(X,{condition:n,show:s($ue,{"aria-label":"Unleash logo"}),elseShow:s(Iue,{"aria-label":"Unleash logo"})})})]})},Aue=E("div")(({theme:e})=>({padding:e.spacing(11),background:e.palette.standaloneBackground,display:"flex",[e.breakpoints.down("md")]:{flexDirection:"column"},[e.breakpoints.down("sm")]:{padding:"0"},minHeight:"100vh"})),Oue=E("header")(({theme:e})=>({width:"40%",borderRadius:e.shape.borderRadius,[e.breakpoints.down("md")]:{borderRadius:"0",width:"100%",minHeight:"auto"}})),Lue=E("main")(({theme:e})=>({width:"60%",flex:"1",borderTopRightRadius:"3px",borderBottomRightRadius:"3px",backgroundColor:e.palette.background.paper,position:"relative",[e.breakpoints.down("md")]:{borderRadius:"0",width:"100%",position:"static",minHeight:"auto"}})),Due=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",height:"100%",padding:e.spacing(12,6),[e.breakpoints.down("md")]:{padding:e.spacing(4,4)},[e.breakpoints.down("sm")]:{padding:e.spacing(4,2)}})),jv=({children:e,BannerComponent:t})=>{let n=s(OO,{title:"Unleash"});return t&&(n=t),T(Aue,{children:[s(Oue,{children:n}),s(Lue,{children:s(Due,{children:e})})]})},Nue="unsecure",LO="demo",Mue="password",Bue="enterprise-hosted",Fue="_container_wn392_1",zue="_button_wn392_10",CR={container:Fue,button:zue},Uv=()=>{const{makeRequest:e,errors:t,loading:n}=Un({propagateErrors:!0});return{passwordAuth:(i,a,l)=>{const c={caller:()=>fetch(i,{headers:Wb,method:"POST",body:JSON.stringify({username:a,password:l})}),id:"passwordAuth"};return e(c.caller,c.id)},emailAuth:(i,a)=>{const l={caller:()=>fetch(i,{headers:Wb,method:"POST",body:JSON.stringify({email:a})}),id:"emailAuth"};return e(l.caller,l.id)},errors:t,loading:n}},jue=({authDetails:e,redirect:t})=>{const[n,r]=f.useState(""),{refetchUser:o}=si(),{emailAuth:i}=Uv(),a=ft(),{setToastApiError:l}=It(),c=async d=>{d.preventDefault();try{await i(e.path,n),o(),a(t,{replace:!0})}catch(p){l(ht(p))}},u=d=>{const p=d.target.value;r(p)};return s("form",{onSubmit:c,children:T("div",{className:CR.container,children:[s("p",{children:e.message}),T("p",{children:["This instance of Unleash is not set up with a secure authentication provider. You can read more about"," ",s("a",{href:"https://github.com/Unleash/unleash/blob/master/docs/securing-unleash.md",target:"_blank",rel:"noreferrer",children:"securing Unleash on GitHub"})]}),s(pn,{value:n,onChange:u,inputProps:{"data-testid":"email-input-field"},size:"small",variant:"outlined",label:"Email",name:"email",id:"email",required:!0,type:"email","data-testid":yv,autoFocus:!0}),s("br",{}),s("div",{children:s(rt,{type:"submit",variant:"contained",color:"primary",className:CR.button,"data-testid":bv,children:"Sign in"})})]})})},Uue=({authDetails:e})=>T("div",{children:[s("p",{children:e.message}),s(OG,{style:{textAlign:"center"},children:s("a",{href:e.path,style:{width:"100%"},children:s(rt,{variant:"contained",color:"primary",style:{width:"150px",margin:"0 auto"},children:"Sign In"})})})]}),Wue=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46px",height:"46px",viewBox:"0 0 46 46",...e},f.createElement("defs",null,f.createElement("filter",{x:"-50%",y:"-50%",width:"200%",height:"200%",filterUnits:"objectBoundingBox",id:"filter-1"},f.createElement("feOffset",{dx:0,dy:1,in:"SourceAlpha",result:"shadowOffsetOuter1"}),f.createElement("feGaussianBlur",{stdDeviation:.5,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),f.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.168 0",in:"shadowBlurOuter1",type:"matrix",result:"shadowMatrixOuter1"}),f.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter2"}),f.createElement("feGaussianBlur",{stdDeviation:.5,in:"shadowOffsetOuter2",result:"shadowBlurOuter2"}),f.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.084 0",in:"shadowBlurOuter2",type:"matrix",result:"shadowMatrixOuter2"}),f.createElement("feMerge",null,f.createElement("feMergeNode",{in:"shadowMatrixOuter1"}),f.createElement("feMergeNode",{in:"shadowMatrixOuter2"}),f.createElement("feMergeNode",{in:"SourceGraphic"}))),f.createElement("rect",{id:"path-2",x:0,y:0,width:40,height:40,rx:2})),f.createElement("g",{id:"Google-Button",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},f.createElement("g",{id:"9-PATCH",transform:"translate(-608.000000, -160.000000)"}),f.createElement("g",{id:"btn_google_light_normal",transform:"translate(-1.000000, -1.000000)"},f.createElement("g",{id:"button",transform:"translate(4.000000, 4.000000)",filter:"url(#filter-1)"},f.createElement("g",{id:"button-bg"},f.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd"}),f.createElement("use",{fill:"none"}),f.createElement("use",{fill:"none"}),f.createElement("use",{fill:"none"}))),f.createElement("g",{id:"logo_googleg_48dp",transform:"translate(15.000000, 15.000000)"},f.createElement("path",{d:"M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z",id:"Shape",fill:"#000"}),f.createElement("path",{d:"M0,0 L18,0 L18,18 L0,18 L0,0 Z",id:"Shape"})),f.createElement("g",{id:"handles_square"}))));var NC={},Hue=fn;Object.defineProperty(NC,"__esModule",{value:!0});var DO=NC.default=void 0,Vue=Hue(En()),Gue=kn,que=(0,Vue.default)((0,Gue.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z"}),"LockRounded");DO=NC.default=que;const MC=({options:e})=>{const{classes:t}=lf();return s(Re,{children:e==null?void 0:e.map(n=>s("div",{className:yi(t.flexColumn,t.contentSpacingY),children:s(rt,{color:"primary","data-loading":!0,variant:"outlined",href:n.path,size:"small","data-testid":`${Ute}-${n.type}`,style:{height:"40px",color:"#000"},startIcon:s(X,{condition:n.type==="google",show:s(Wue,{style:{height:"35px",width:"35px"}}),elseShow:s(DO,{style:{height:"25px",width:"25px"}})}),children:n.message})},n.type))})},Yue=E("div")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:e.spacing(2,"auto")})),ER=E("span")(({theme:e})=>({width:"80px",height:"3px",backgroundColor:e.palette.divider,borderRadius:e.shape.borderRadius})),Kue=E(ke)(({theme:e})=>({textAlign:"center",display:"block",margin:e.spacing(0,2)})),Wv=({text:e,...t})=>T(Yue,{...t,children:[s(ER,{}),s(Kue,{variant:"body2",children:e}),s(ER,{})]}),Yc=({...e})=>{const[t,n]=f.useState(!1);return s(pn,{variant:"outlined",size:"small",type:t?"text":"password",InputProps:{style:{paddingRight:"0px"},endAdornment:s(O4,{position:"end",children:s(Qt,{onClick:()=>{n(!t)},onMouseDown:l=>{l.preventDefault()},size:"large",children:s(t?u3:d3,{titleAccess:"Toggle password visibility"})})})},...e})},Xue=E(Xt)(({theme:e})=>({color:e.palette.error.main,marginBottom:e.spacing(1)})),Jue=E("div")(({theme:e})=>({...sf(e),display:"flex",flexDirection:"column"})),Que=({authDetails:e,redirect:t})=>{const n=ft(),{refetchUser:r}=si(),o=Al(),[i,a]=f.useState(o.get("email")||""),[l,c]=f.useState(""),{passwordAuth:u}=Uv(),[d,p]=f.useState({}),h=async v=>{if(v.preventDefault(),i||p(b=>({...b,usernameError:"This is a required field"})),l||p(b=>({...b,passwordError:"This is a required field"})),!(!l||!i))try{await u(e.path,i,l),r(),n(t,{replace:!0})}catch(b){b instanceof Hx||b instanceof Wx?(p(w=>({...w,apiError:"Invalid login details"})),c(""),a("")):b instanceof g3?p({apiError:"Invalid password and username combination."}):p({apiError:"Unknown error while trying to authenticate."})}},m=()=>{const{usernameError:v,passwordError:b,apiError:w}=d;return s(X,{condition:!e.defaultHidden,show:T("form",{onSubmit:h,children:[s(X,{condition:Boolean(w),show:s(Xue,{severity:"error",children:w})}),T(Jue,{children:[s(pn,{label:"Username or email",name:"username",id:"username",type:"text",onChange:g=>a(g.target.value),value:i,error:Boolean(v),helperText:v,autoComplete:"username","data-testid":yv,variant:"outlined",size:"small",autoFocus:!0}),s(Yc,{label:"Password",onChange:g=>c(g.target.value),name:"password",id:"password",value:l,error:Boolean(b),helperText:b,autoComplete:"current-password","data-testid":b3}),s(rt,{variant:"contained",color:"primary",type:"submit",style:{width:"150px",margin:"1rem auto"},"data-testid":bv,children:"Sign in"})]})]})})},{options:y=[]}=e;return s(Re,{children:s(X,{condition:y.length>0,show:T(Re,{children:[s(MC,{options:y}),s(X,{condition:!e.defaultHidden,show:s(Wv,{text:"Or sign in with username"})}),m()]}),elseShow:m()})})},Zue=E(ke)(({theme:e})=>({color:e.palette.error.main})),ede=E("div")(({theme:e})=>({...sf(e),display:"flex",flexDirection:"column"})),tde=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto",0,"auto"),display:"block",textAlign:"center"})),nde=({authDetails:e,redirect:t})=>{const{refetchUser:n}=si(),r=ft(),o=Al(),{passwordAuth:i}=Uv(),[a,l]=f.useState(o.get("email")||""),[c,u]=f.useState(""),[d,p]=f.useState({}),h=async w=>{if(w.preventDefault(),a||p(g=>({...g,usernameError:"This is a required field"})),c||p(g=>({...g,passwordError:"This is a required field"})),!(!c||!a))try{await i(e.path,a,c),n(),r(t,{replace:!0})}catch(g){g instanceof Hx||g instanceof Wx?(p(S=>({...S,apiError:"Invalid login details"})),u(""),l("")):p({apiError:"Unknown error while trying to authenticate."})}},{usernameError:m,passwordError:y,apiError:v}=d,{options:b=[]}=e;return T(Re,{children:[s(X,{condition:b.length>0,show:T(Re,{children:[s(MC,{options:b}),s(Wv,{text:"or signin with username"})]})}),s(X,{condition:!e.defaultHidden,show:T("form",{onSubmit:h,children:[s(Zue,{variant:"subtitle2",children:v}),T(ede,{children:[s(pn,{label:"Username or email",name:"username",id:"username",type:"text",onChange:w=>l(w.target.value),value:a,error:Boolean(m),helperText:m,variant:"outlined",size:"small","data-testid":yv}),s(Yc,{label:"Password",onChange:w=>u(w.target.value),name:"password",id:"password",value:c,error:Boolean(y),helperText:y,autoComplete:"current-password","data-testid":b3}),s(_n,{container:!0,children:s(tde,{variant:"contained",color:"primary",type:"submit","data-testid":bv,children:"Sign in"})})]})]})})]})},rde="_container_abcn7_1",ode="_emailField_abcn7_9",ide="_form_abcn7_13",ade="_logo_abcn7_17",sde="_button_abcn7_24",rd={container:rde,emailField:ode,form:ide,logo:ade,button:sde},lde=e=>f.createElement("svg",{width:52,height:52,viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{cx:26,cy:26,r:26,fill:"white"}),f.createElement("rect",{x:15,y:15,width:7,height:22,fill:"#1A4049"}),f.createElement("rect",{x:30,y:15,width:7,height:22,fill:"#1A4049"}),f.createElement("path",{d:"M37 30L37 37L15 37L15 30L37 30Z",fill:"#1A4049"}),f.createElement("rect",{x:30,y:30,width:7,height:7,fill:"#817AFE"})),cde=({authDetails:e,redirect:t})=>{const[n,r]=f.useState(""),o=ft(),{refetchUser:i}=si(),{emailAuth:a}=Uv(),{setToastApiError:l}=It(),c=async d=>{d.preventDefault();try{await a(e.path,n),i(),o(t,{replace:!0})}catch(p){l(ht(p))}},u=d=>{const p=d.target.value;r(p)};return T("form",{onSubmit:c,children:[s(lde,{className:rd.logo,"aria-label":"Unleash logo"}),T("div",{className:rd.container,children:[s("h2",{children:"Access the Unleash demo instance"}),s("p",{children:"No further data or Credit Card required"}),T("div",{className:rd.form,children:[s(pn,{value:n,className:rd.emailField,onChange:u,inputProps:{"data-testid":"email-input-field"},size:"small",variant:"outlined",label:"Email",name:"email",id:"email","data-testid":yv,required:!0,type:"email"}),s(rt,{type:"submit",variant:"contained",color:"primary",className:rd.button,"data-testid":bv,children:"Sign in"})]}),T("p",{children:["By accessing our demo instance, you agree to the Unleash ",s("a",{href:"https://www.unleash-hosted.com/tos/",target:"_blank",rel:"noreferrer",children:"Customer Terms of Service"})," ","and ",s("a",{href:"https://www.unleash-hosted.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:"Privacy Policy"})]})]})]})},ude=E("div")(({theme:e})=>({margin:"auto auto 0 auto",width:"230px",[e.breakpoints.down("md")]:{marginTop:e.spacing(2)}})),dde=E(on)(({theme:e})=>({fontWeight:"bold",textAlign:"center"})),pde=E(ke)(({theme:e})=>({fontWeight:"bold",marginBottom:e.spacing(1)})),fde=E("a")(({theme:e})=>({fontWeight:"bold",textAlign:"center"})),kR=()=>T(ude,{children:[s(dde,{to:"/forgotten-password",children:s(pde,{variant:"body2",children:"Forgot password?"})}),T(ke,{variant:"body2",children:["Don't have an account?"," ",s(fde,{href:"https://www.getunleash.io/plans",target:"_blank",rel:"noopener noreferrer",children:"Sign up"})]})]}),mu=()=>{const e=cf();return{authDetails:e.data&&"type"in e.data?e.data:void 0,refetchAuthDetails:e.refetchAuth,loading:e.loading,error:e.error}},hde=({redirect:e,invited:t=!1})=>{const{authDetails:n}=mu(),o=Al().get("errorMsg"),{trackEvent:i}=Is();if(f.useEffect(()=>{t&&i("invite",{props:{eventType:"user created"}})},[t,i]),!n)return null;let a;return n.type===Mue?a=T(Re,{children:[s(Que,{authDetails:n,redirect:e}),s(X,{condition:!n.defaultHidden,show:s(kR,{})})]}):n.type===Nue?a=s(jue,{authDetails:n,redirect:e}):n.type===LO?a=s(cde,{authDetails:n,redirect:e}):n.type===Bue?a=T(Re,{children:[s(nde,{authDetails:n,redirect:e}),s(X,{condition:!n.defaultHidden,show:s(kR,{})})]}):a=s(Uue,{authDetails:n}),T(Re,{children:[s("div",{style:{maxWidth:"350px"},"data-testid":ene,children:s(X,{condition:Boolean(o),show:s(Xt,{severity:"error",children:o})})}),a]})},mde=e=>{const t=new URL(decodeURIComponent(e),window.location.protocol+"//"+window.location.host);return{pathname:t.pathname,search:t.search}},gde=E("div")(({theme:e})=>({display:"flex",flexDirection:"column"})),vde=E("h2")(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(2),textAlign:"center"})),yde=()=>{const{authDetails:e}=mu(),{user:t}=si(),n=Al(),r=n.get("reset")==="true",o=n.get("invited")==="true",i=n.get("redirect")||"/";return t?s(Il,{to:mde(i),replace:!0}):s(jv,{children:T(gde,{children:[s(X,{condition:r,show:T(Xt,{severity:"success",sx:{mb:4},children:[s(Mm,{children:"Success"}),"You successfully reset your password."]})}),s(X,{condition:o,show:T(Xt,{severity:"success",sx:{mb:4},children:[s(Mm,{children:"Success"}),"Your account has been created."]})}),s(X,{condition:(e==null?void 0:e.type)!==LO,show:s(vde,{children:"Log in to continue the great work"})}),s(hde,{redirect:i,invited:o})]})})},bde="P",wde="EEA",Sde="RE",N1="SE",xde="UG",Cde=e=>()=>{if(!e)return Promise.resolve({name:NO});const t=Ft(`auth/reset/validate?token=${e}`);return fetch(t,{method:"GET"}).then(n=>n.json())},NO="InvalidTokenError",Ede="UsedTokenError",MO=(e={})=>{const t=Al(),n=t.get("token")||"",[r,o]=f.useState(n),i=Cde(r),a=`auth/reset/validate?token=${r}`,{data:l,error:c}=gn(a,i,e),[u,d]=f.useState(!c&&!l),p=()=>{const m=t.get("token")||"";o(m)};f.useEffect(()=>{d(!c&&!l)},[l,c]);const h=!(!u&&(l==null?void 0:l.name)===NO||(l==null?void 0:l.name)===Ede);return{token:r,data:l,error:c,loading:u,isValidToken:h,setLoading:d,retry:p}},kde=(e,t)=>()=>{if(!e)return Promise.resolve(!1);const n=Ft(t);return fetch(n,{method:"GET"}).then(r=>r.status===tf)},BO=(e={})=>{const n=Al().get("invite")||"",r=`/invite/${n}/validate`,{data:o,error:i}=gn(r,kde(n,r),e),[a,l]=f.useState(!i&&!o);return f.useEffect(()=>{l(!i&&o===void 0)},[o,i]),{secret:n,isValid:o,error:i,loading:a}},TR="api/admin/invite-link/tokens",Tde=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o=f.useCallback(async l=>{const c=t(TR,{method:"POST",body:JSON.stringify(l)});return await e(c.caller,c.id)},[t,e]),i=f.useCallback(async(l,c)=>{const u=t(`${TR}/${l}`,{method:"PUT",body:JSON.stringify({...c.expiresAt?{expiresAt:c.expiresAt}:{},...c.enabled!==void 0?{enabled:c.enabled}:{}})});return await e(u.caller,u.id)},[t,e]),a=f.useCallback(async(l,c)=>{const u=t(`/invite/${l}/signup`,{method:"POST",body:JSON.stringify(c)});return await e(u.caller,u.id)},[t,e]);return{createToken:o,updateToken:i,addUser:a,errors:n,loading:r}},FO=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{resetPassword:f.useCallback(i=>{const a=t("auth/reset/password",{method:"POST",body:JSON.stringify(i)});return e(a.caller,a.id)},[t,e]),errors:n,loading:r}},_de=E("span")(({theme:e})=>({display:"inline-grid",alignItems:"center",outline:0,cursor:"pointer","&:is(:focus-visible, :active) > *, &:hover > *":{outlineStyle:"solid",outlineWidth:2,outlineOffset:0,outlineColor:e.palette.primary.main,borderRadius:"100%",color:e.palette.primary.main},"& svg":{fontSize:e.fontSizes.mainHeader,color:e.palette.neutral.main,marginLeft:e.spacing(.5)}})),Km=({tooltip:e,placement:t,children:n})=>s(Tt,{title:e,placement:t,arrow:!0,children:s(_de,{tabIndex:0,"aria-label":"Help",children:n??s(Bx,{})})}),Rde="The password must be at least 10 characters long.",Pde="The password must contain at least one number.",$de="The password must contain at least one special character.",Ide="The password must contain at least one uppercase letter.",Ade="The password must contain at least one lowercase letter.",Ode="The password may not contain sequences of three or more repeated characters.",zO="The password must be at least 10 characters long and must include an uppercase letter, a lowercase letter, a number, and a symbol.",Lde=E(ke)(({theme:e})=>({marginBottom:"0",display:"flex",alignItems:"center",gap:"1ch"})),Dde=E("div")(({theme:e})=>({border:"1px solid #f1f1f1",borderRadius:e.shape.borderRadius,position:"relative",maxWidth:"350px",color:"#44606e"})),Nde=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Ga=E("div")(({theme:e})=>({width:"95px",margin:e.spacing(0,.5),display:"flex",justifyContent:"center"})),Mde=E("div")(({theme:e})=>({backgroundColor:e.palette.neutral.light,height:"1px",width:"100%"})),Bde=E("div")(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Fde=E(Xt)(({theme:e})=>({marginTop:e.spacing(1),bottom:"0",position:"absolute"})),fh=E("div",{shouldForwardProp:e=>e!=="error"})(({theme:e,error:t})=>({width:"50px",borderRadius:e.shape.borderRadius,height:"6px",backgroundColor:t?"red":e.palette.primary.main})),jO=({password:e,callback:t,style:n={}})=>{const[r,o]=f.useState(!0),[i,a]=f.useState(!0),[l,c]=f.useState(!0),[u,d]=f.useState(!0),[p,h]=f.useState(!1),m=f.useCallback(()=>{const g=Ft("auth/reset/validate-password");return fetch(g,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({password:e})})},[e]),y=f.useCallback(()=>{b(!1)},[]),v=f.useCallback(async()=>{if(!e){b(!0);return}if(e.length<3){d(!0);return}try{const g=await m();if(g.status===Ux){const S=await g.json();w(S),t(!1)}g.status===tf&&(y(),h(!1),t(!0))}catch{console.log("An exception was caught and handled")}},[m,t,e,y]);f.useEffect(()=>{v()},[e,v]);const b=g=>{o(g),a(g),c(g),d(g)},w=g=>{const S=g.details[0].validationErrors;S.includes(Pde)?a(!0):a(!1),S.includes($de)?c(!0):c(!1),S.includes(Rde)?d(!0):d(!1),S.includes(Ade)||S.includes(Ide)?o(!0):o(!1),S.includes(Ode)?h(!0):h(!1)};return T(Re,{children:[T(Lde,{variant:"body2","data-loading":!0,children:["Please set a strong password",s(Km,{tooltip:zO})]}),T(Dde,{style:{...n},children:[T(Nde,{children:[s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Length"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Casing"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Number"})}),s(Ga,{children:s(ke,{variant:"body2","data-loading":!0,children:"Symbol"})})]}),s(Mde,{}),T(Bde,{children:[s(Ga,{children:s(fh,{error:u,"data-loading":!0})}),s(Ga,{children:s(fh,{error:r,"data-loading":!0})})," ",s(Ga,{children:s(fh,{error:i,"data-loading":!0})}),s(Ga,{children:s(fh,{error:l,"data-loading":!0})})]}),s(X,{condition:p,show:s(Fde,{severity:"error",children:"You may not repeat three characters in a row."})})]})]})};var BC={},zde=fn;Object.defineProperty(BC,"__esModule",{value:!0});var UO=BC.default=void 0,jde=zde(En()),Ude=kn,Wde=(0,jde.default)((0,Ude.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");UO=BC.default=Wde;const Hde=E("div")(({theme:e})=>({position:"relative",paddingTop:e.spacing(.5)})),Vde=E(ke,{shouldForwardProp:e=>e!=="matchingPasswords"})(({theme:e,matchingPasswords:t})=>({position:"absolute",bottom:"-8px",display:"flex",alignItems:"center",color:t?e.palette.primary.main:e.palette.error.main})),Gde=E(UO)(({theme:e})=>({marginRight:"5px"})),WO=({started:e,matchingPasswords:t})=>s(Hde,{children:s(X,{condition:e,show:T(Vde,{variant:"body2","data-loading":!0,matchingPasswords:t,children:[s(Gde,{})," ",s(X,{condition:t,show:s(ke,{children:" Passwords match"}),elseShow:s(ke,{children:" Passwords do not match"})})]})})}),qde=E("form")(({theme:e})=>({display:"flex",flexDirection:"column",position:"relative","& > *":{marginTop:`${e.spacing(1)} !important`,marginBottom:`${e.spacing(1)} !important`}})),Yde=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto"),display:"block"})),HO=({onSubmit:e})=>{const[t,n]=f.useState(""),[r,o]=f.useState(!1),[i,a]=f.useState(""),[l,c]=f.useState(!1),[u,d]=f.useState(!1),p=l&&u,h=f.useCallback(d,[d]);f.useEffect(()=>{t||d(!1),c(t===i)},[t,i]);const m=v=>{v.preventDefault(),p&&e(t)},y=Boolean(t&&i);return T(qde,{onSubmit:m,children:[s(Yc,{placeholder:"Password",value:t||"",onChange:v=>n(v.target.value),onFocus:()=>o(!0),autoComplete:"new-password","data-loading":!0}),s(Yc,{value:i||"",placeholder:"Confirm password",onChange:v=>a(v.target.value),autoComplete:"new-password","data-loading":!0}),s(X,{condition:r,show:s(jO,{password:t,callback:h,style:{marginBottom:"1rem"}})}),s(WO,{started:y,matchingPasswords:l}),s(Yde,{variant:"contained",color:"primary",type:"submit","data-loading":!0,disabled:!p,children:"Submit"})]})},VO=()=>{const{authDetails:e}=mu(),{classes:t}=lf(),n=(e==null?void 0:e.defaultHidden)===!0,{secret:r}=BO();return T("div",{className:yi(t.contentSpacingY,t.flexColumn,t.itemsCenter),children:[s(ke,{variant:"h2",className:t.title,children:"Invalid token"}),s(X,{condition:n,show:T(Re,{children:[s(ke,{variant:"subtitle1",children:"Your instance does not support password authentication. Use correct work email to access your account."}),s(rt,{variant:"contained",color:"primary",component:on,to:"/login",children:"Login"})]}),elseShow:s(X,{condition:Boolean(r),show:s(ke,{variant:"subtitle1",children:"Provided invite link is invalid or expired. Please request a new URL in order to create your account."}),elseShow:T(Re,{children:[s(ke,{variant:"subtitle1",children:"Your token has either been used to reset your password, or it has expired. Please request a new reset password URL in order to reset your password."}),s(rt,{variant:"contained",color:"primary",component:on,to:"/forgotten-password","data-testid":Hte,children:"Reset password"})]})})})]})},_R=({children:e,loading:t,title:n})=>{const r=Lv(t||!1);return s("div",{ref:r,children:s(jv,{showMenu:!1,BannerComponent:s(OO,{title:"Unleash"}),children:T(Je,{sx:{width:["100%","350px"]},children:[s(X,{condition:Boolean(n),show:s(ke,{component:"h2",sx:{fontSize:o=>o.fontSizes.mainHeader,marginBottom:2,textAlign:"center",fontWeight:o=>o.fontWeight.bold},children:n})}),e]})})})},GO=()=>T(Xt,{severity:"error","data-loading":!0,children:[s(Mm,{children:"Unable to reset password"}),"Something went wrong when attempting to update your password. This could be due to unstable internet connectivity. If retrying the request does not work, please try again later."]}),Kde=()=>{var O,L;const{authDetails:e}=mu(),{setToastApiError:t}=It(),n=ft(),[r,o]=f.useState(!1),[i,a]=f.useState(""),[l,c]=f.useState(""),{token:u,data:d,loading:p,isValidToken:h}=MO(),{secret:m,loading:y,isValid:v}=BO(),{addUser:b,loading:w}=Tde(),{resetPassword:g,loading:S}=FO(),C=(e==null?void 0:e.defaultHidden)===!0,R=async I=>{try{(await b(m,{name:l,email:i,password:I})).status===Ste?n("/login?invited=true"):t("Couldn't create user. Check if your invite link is valid.")}catch(A){t(ht(A))}},k=async I=>{try{(await g({token:u,password:I})).status===tf?n("/login?reset=true"):o(!0)}catch{o(!0)}},P=I=>{v?R(I):k(I)};return h===!1&&v==!1?s(_R,{loading:p||y,children:s(VO,{})}):T(_R,{loading:p||y||w||S,title:C?"Connect your account and start your journey":"Enter your personal details and start your journey",children:[s(X,{condition:d==null?void 0:d.createdBy,show:T(ke,{variant:"body1","data-loading":!0,sx:{textAlign:"center",mb:2},children:[d==null?void 0:d.createdBy,s("br",{})," has invited you to join Unleash."]})}),T(ke,{color:"text.secondary",children:["We suggest using"," ",s(ke,{component:"strong",fontWeight:"bold",children:"the email you use for work"}),"."]}),s(X,{condition:Boolean((O=e==null?void 0:e.options)==null?void 0:O.length),show:s(Je,{sx:{mt:2},children:s(MC,{options:e==null?void 0:e.options})})}),s(X,{condition:Boolean((L=e==null?void 0:e.options)==null?void 0:L.length)&&!C,show:s(Wv,{text:"or sign-up with an email address","data-loading":!0})}),s(X,{condition:!C,show:T(Re,{children:[s(X,{condition:d==null?void 0:d.email,show:()=>s(ke,{"data-loading":!0,variant:"body1",sx:{my:1},children:"Your username is"})}),s(pn,{"data-loading":!0,type:"email",value:h?(d==null?void 0:d.email)||"":i,id:"email",label:"Email",variant:"outlined",size:"small",sx:{my:1},disabled:h,fullWidth:!0,required:!0,onChange:I=>{h||a(I.target.value)}}),s(X,{condition:Boolean(v),show:()=>s(pn,{"data-loading":!0,value:l,id:"username",label:"Full name",variant:"outlined",size:"small",sx:{my:1},fullWidth:!0,required:!0,onChange:I=>{c(I.target.value)}})}),s(ke,{variant:"body1","data-loading":!0,sx:{mt:2},children:"Set a password for your account."}),s(X,{condition:r&&h,show:s(GO,{})}),s(HO,{onSubmit:P})]})})]})},Xde=E("div")(({theme:e})=>({width:"350px",maxWidth:"350px",[e.breakpoints.down("sm")]:{width:"100%"}})),Jde=E(ke)(({theme:e})=>({fontWeight:"bold",fontSize:e.spacing(2.5),marginBottom:e.spacing(2)})),Qde=()=>{const{token:e,loading:t,isValidToken:n}=MO(),{resetPassword:r,loading:o}=FO(),{authDetails:i}=mu(),a=Lv(t||o),l=ft(),[c,u]=f.useState(!1),d=(i==null?void 0:i.defaultHidden)===!0;return s("div",{ref:a,children:s(jv,{children:s(Xde,{children:s(X,{condition:!n||d,show:s(VO,{}),elseShow:T(Re,{children:[s(Jde,{variant:"h2","data-loading":!0,children:"Reset password"}),s(X,{condition:c,show:s(GO,{})}),s(HO,{onSubmit:async h=>{try{(await r({token:e,password:h})).status===tf?(l("/login?reset=true"),u(!1)):u(!0)}catch{u(!0)}}})]})})})})})},Zde=E("div")(({theme:e})=>({...sf,..._3,width:"350px",[e.breakpoints.down("sm")]:{width:"100%"}})),epe=E("strong")(({theme:e})=>({display:"block",margin:e.spacing(1,0)})),tpe=E(rt)(({theme:e})=>({width:"150px",margin:e.spacing(2,"auto")})),npe=E("h2")(({theme:e})=>({...Yne(e),...T3})),rpe=E("form")(({theme:e})=>({...sf(e),..._3})),ope=E(ke)(({theme:e})=>({...T3})),ipe=()=>{const[e,t]=f.useState(""),[n,r]=f.useState(!1),[o,i]=f.useState(!1),[a,l]=f.useState(""),c=Lv(o);return s(jv,{children:T(Zde,{ref:c,children:[s(npe,{"data-loading":!0,children:"Forgotten password"}),s(X,{condition:n,show:T(Xt,{severity:"success","data-loading":!0,children:[s(Mm,{children:"Attempted to send email"}),"We've attempted to send a reset password email to:",s(epe,{children:a}),"If you did not receive an email, please verify that you typed in the correct email, and contact your administrator to make sure that you are in the system."]})}),T(rpe,{onSubmit:async d=>{d.preventDefault(),i(!0),l(e);const p=Ft("auth/reset/password-email");await fetch(p,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({email:e})}),r(!0),i(!1)},children:[s(ope,{variant:"body1","data-loading":!0,children:"Please provide your email address. If it exists in the system we'll send a new reset link."}),s(pn,{variant:"outlined",size:"small",placeholder:"email",type:"email","data-loading":!0,"data-testid":Wte,value:e,onChange:d=>{t(d.target.value)}}),s(tpe,{variant:"contained",type:"submit","data-loading":!0,color:"primary",disabled:o,children:s(X,{condition:!n,show:s("span",{children:"Submit"}),elseShow:s("span",{children:"Try again"})})}),s(Wv,{text:"Or log in"}),s(rt,{type:"submit","data-loading":!0,variant:"outlined",disabled:o,component:on,to:"/login",sx:d=>({width:"150px",margin:d.spacing(2,"auto")}),children:"Log in"})]})]})})},qO=e=>{const t=()=>{const r=Ft(`api/admin/projects/${e}`);return fetch(r,{method:"GET"}).then(Cn("Project overview")).then(o=>o.json())},n=`api/admin/projects/${e}`;return{fetcher:t,KEY:n}};var FC={},ape=fn;Object.defineProperty(FC,"__esModule",{value:!0});var zC=FC.default=void 0,spe=ape(En()),lpe=kn,cpe=(0,spe.default)((0,lpe.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");zC=FC.default=cpe;const upe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),{setToastData:o,setToastApiError:i}=It(),{trackEvent:a}=Is(),l=f.useCallback(async u=>{const d=`api/admin/projects/${u}/favorites`,p=t(d,{method:"POST"},"addFavoriteProject");try{await e(p.caller,p.id),o({title:"Project added to favorites",type:"success"}),a("favorite",{props:{eventType:"project favorited"}})}catch(h){i(ht(h))}},[t,e]),c=f.useCallback(async u=>{const d=`api/admin/projects/${u}/favorites`,p=t(d,{method:"DELETE"},"removeFavoriteProject");try{await e(p.caller,p.id),o({title:"Project removed from favorites",type:"success"}),a("favorite",{props:{eventType:"project unfavorited"}})}catch(h){i(ht(h))}},[t,e]);return{favorite:l,unfavorite:c,errors:n,loading:r}},dpe=({isFavorite:e,size:t="large",...n})=>s(du,{title:e?"Remove from favorites":"Add to favorites",children:s(Qt,{size:t,"data-loading":!0,...n,children:s(X,{condition:e,show:s(zx,{color:"primary",sx:{fontSize:r=>t==="medium"?r.spacing(2):r.spacing(3)}}),elseShow:s(jx,{sx:{fontSize:r=>t==="medium"?r.spacing(2):r.spacing(3)}})})})}),jC=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createProject:async b=>{const g=t("api/admin/projects",{method:"POST",body:JSON.stringify(b)});try{return await e(g.caller,g.id)}catch(S){throw S}},validateId:async b=>{const g=t("api/admin/projects/validate",{method:"POST",body:JSON.stringify(b)});try{return await e(g.caller,g.id)}catch(S){throw S}},editProject:async(b,w)=>{const g=`api/admin/projects/${b}`,S=t(g,{method:"PUT",body:JSON.stringify(w)});try{return await e(S.caller,S.id)}catch(C){throw C}},deleteProject:async b=>{const w=`api/admin/projects/${b}`,g=t(w,{method:"DELETE"});try{return await e(g.caller,g.id)}catch(S){throw S}},addEnvironmentToProject:async(b,w)=>{const g=`api/admin/projects/${b}/environments`,S=t(g,{method:"POST",body:JSON.stringify({environment:w})});try{return await e(S.caller,S.id)}catch(C){throw C}},removeEnvironmentFromProject:async(b,w)=>{const g=`api/admin/projects/${b}/environments/${w}`,S=t(g,{method:"DELETE"});try{return await e(S.caller,S.id)}catch(C){throw C}},addAccessToProject:async(b,w,g)=>{const S=`api/admin/projects/${b}/role/${w}/access`,C=t(S,{method:"POST",body:JSON.stringify(g)});try{return await e(C.caller,C.id)}catch(R){throw R}},removeUserFromRole:async(b,w,g)=>{const S=`api/admin/projects/${b}/users/${g}/roles/${w}`,C=t(S,{method:"DELETE"});try{return await e(C.caller,C.id)}catch(R){throw R}},removeGroupFromRole:async(b,w,g)=>{const S=`api/admin/projects/${b}/groups/${g}/roles/${w}`,C=t(S,{method:"DELETE"});try{return await e(C.caller,C.id)}catch(R){throw R}},changeUserRole:(b,w,g)=>{const S=`api/admin/projects/${b}/users/${g}/roles/${w}`,C=t(S,{method:"PUT"});return e(C.caller,C.id)},changeGroupRole:(b,w,g)=>{const S=`api/admin/projects/${b}/groups/${g}/roles/${w}`,C=t(S,{method:"PUT"});return e(C.caller,C.id)},errors:n,loading:r,searchProjectUser:async b=>{const w=`api/admin/user-admin/search?q=${b}`,g=t(w,{method:"GET"});try{return await e(g.caller,g.id)}catch(S){throw S}}}},ppe=({open:e,onClose:t,project:n,onSuccess:r})=>{const{deleteProject:o}=jC(),{refetch:i}=ja(),{setToastData:a,setToastApiError:l}=It();return s(cr,{open:e,onClick:async u=>{u.preventDefault();try{await o(n),i(),a({title:"Deleted project",type:"success",text:"Successfully deleted project"}),r==null||r()}catch(d){l(ht(d))}t==null||t()},onClose:t,title:"Really delete project"})},fpe=e=>f.createElement("svg",{width:88,height:40,viewBox:"0 0 88 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{width:9,height:39,fill:"#635DC5"}),f.createElement("rect",{x:13,width:10,height:39,fill:"#635DC5"}),f.createElement("rect",{x:27,y:6,width:9,height:33,fill:"#635DC5"}),f.createElement("rect",{x:40,y:12,width:9,height:27,fill:"#635DC5"}),f.createElement("rect",{x:52,y:15,width:9,height:24,fill:"#635DC5"}),f.createElement("rect",{x:65.0752,y:15.2578,width:9.2957,height:23.9101,fill:"#635DC5"}),f.createElement("rect",{x:78.355,y:19.0352,width:9.2957,height:20.1348,fill:"#635DC5"})),hpe=E(S4)(({theme:e})=>({padding:e.spacing(1,2,2,2),width:"220px",height:"204px",display:"flex",flexDirection:"column",justifyContent:"space-between",margin:e.spacing(1),boxShadow:"none",border:`1px solid ${e.palette.tertiary.contrast}`,[e.breakpoints.down("sm")]:{justifyContent:"center"},"&:hover":{transition:"background-color 0.2s ease-in-out",backgroundColor:e.palette.projectCard.hover}})),mpe=E("div")(()=>({...$v,width:"100%"})),gpe=E("h2")(({theme:e})=>({fontWeight:"normal",fontSize:e.fontSizes.bodySize,lineClamp:2,display:"-webkit-box",boxOrient:"vertical",textOverflow:"ellipsis",overflow:"hidden",alignItems:"flex-start"})),vpe=E(Je)(()=>({...$v,marginRight:"auto"})),ype=E(ea)(({theme:e})=>({color:e.palette.neutral.main,marginRight:e.spacing(1)})),bpe=E(ti)(({theme:e})=>({color:e.palette.neutral.main,marginRight:e.spacing(1)})),wpe=E(fpe)(({theme:e})=>({margin:e.spacing(2,"auto"),width:"80px",display:"block"})),Spe=E("div")(({theme:e})=>({display:"flex",justifyContent:"space-between",fontSize:e.fontSizes.smallerBody})),M1=E("div")(()=>({textAlign:"center"})),B1=E("p")(({theme:e})=>({color:e.palette.projectCard.textColor,fontWeight:"bold"})),RR=({name:e,featureCount:t,health:n,memberCount:r,onHover:o,id:i,isFavorite:a=!1})=>{const{hasAccess:l}=f.useContext(Qr),{isOss:c}=Lt(),[u,d]=f.useState(null),[p,h]=f.useState(!1),m=ft(),{favorite:y,unfavorite:v}=upe(),{refetch:b}=ja(),w=C=>{C.preventDefault(),d(C.currentTarget)},g=l(Soe,i)&&i!==Xh;return T(hpe,{onMouseEnter:o,children:[T(mpe,{"data-loading":!0,children:[T(vpe,{children:[s(dpe,{onClick:async C=>{C.preventDefault(),a?await v(i):await y(i),b()},isFavorite:a,size:"medium",sx:{ml:-1}}),s(gpe,{children:e})]}),s(mr,{style:{transform:"translateX(7px)"},permission:Vb,hidden:c(),projectId:i,"data-loading":!0,onClick:w,tooltipProps:{title:"Options"},children:s(zC,{})}),T($x,{id:"project-card-menu",open:Boolean(u),anchorEl:u,style:{top:0,left:-100},onClick:C=>{C.preventDefault()},onClose:C=>{C.preventDefault(),d(null)},children:[T(ws,{onClick:C=>{C.preventDefault(),m(Mse(i))},children:[s(ype,{}),"Edit project"]}),T(ws,{onClick:C=>{C.preventDefault(),h(!0)},disabled:!g,children:[s(bpe,{}),i===Xh&&!g?"You can't delete the default project":"Delete project"]})]})]}),s("div",{"data-loading":!0,children:s(wpe,{})}),T(Spe,{children:[T(M1,{children:[s(B1,{"data-loading":!0,children:t}),s("p",{"data-loading":!0,children:"toggles"})]}),T(M1,{children:[T(B1,{"data-loading":!0,children:[n,"%"]}),s("p",{"data-loading":!0,children:"health"})]}),s(X,{condition:i!==Xh,show:T(M1,{children:[s(B1,{"data-loading":!0,children:r}),s("p",{"data-loading":!0,children:"members"})]})})]}),s(ppe,{project:i,open:p,onClose:()=>{d(null),h(!1)}})]})},xpe=[{id:"loading1",name:"loading1",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading2",name:"loading2",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading3",name:"loading3",memberCount:1,health:95,featureCount:4,createdAt:"",description:""},{id:"loading4",name:"loading4",memberCount:1,health:95,featureCount:4,createdAt:"",description:""}],YO=({Icon:e,onClick:t,maxWidth:n,disabled:r=!1,children:o,permission:i,environmentId:a,projectId:l,...c})=>{const u=Er(`(max-width:${n})`);return s(X,{condition:u,show:s(mr,{disabled:r,onClick:t,permission:i,projectId:l,environmentId:a,"data-loading":!0,...c,children:s(e,{})}),elseShow:s(Io,{onClick:t,permission:i,projectId:l,color:"primary",variant:"contained",disabled:r,environmentId:a,"data-loading":!0,...c,children:o})})},Cpe=({className:e,onClick:t,text:n,...r})=>s(Xt,{className:e||"",action:s(rt,{color:"inherit",size:"small",onClick:t,children:"TRY AGAIN"}),severity:"error",...r,children:n}),KO=e=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M11.2608 0.811331C11.6574 0.375976 12.3426 0.375977 12.7392 0.811332L14.0529 2.25322C14.316 2.54202 14.7233 2.65114 15.0955 2.53259L16.9542 1.94073C17.5154 1.76203 18.1087 2.10458 18.2345 2.67993L18.6513 4.58549C18.7347 4.96716 19.0328 5.26527 19.4145 5.34875L21.3201 5.7655C21.8954 5.89133 22.238 6.48465 22.0593 7.04583L21.4674 8.90447C21.3489 9.27675 21.458 9.68397 21.7468 9.9471L23.1887 11.2608C23.624 11.6574 23.624 12.3426 23.1887 12.7392L21.7468 14.0529C21.458 14.316 21.3489 14.7233 21.4674 15.0955L22.0593 16.9542C22.238 17.5154 21.8954 18.1087 21.3201 18.2345L19.4145 18.6513C19.0328 18.7347 18.7347 19.0328 18.6513 19.4145L18.2345 21.3201C18.1087 21.8954 17.5154 22.238 16.9542 22.0593L15.0955 21.4674C14.7233 21.3489 14.316 21.458 14.0529 21.7468L12.7392 23.1887C12.3426 23.624 11.6574 23.624 11.2608 23.1887L9.9471 21.7468C9.68397 21.458 9.27675 21.3489 8.90447 21.4674L7.04583 22.0593C6.48465 22.238 5.89133 21.8954 5.7655 21.3201L5.34875 19.4145C5.26527 19.0328 4.96716 18.7347 4.58549 18.6513L2.67993 18.2345C2.10458 18.1087 1.76203 17.5154 1.94073 16.9542L2.53259 15.0955C2.65114 14.7233 2.54202 14.316 2.25322 14.0529L0.811331 12.7392C0.375976 12.3426 0.375977 11.6574 0.811332 11.2608L2.25322 9.9471C2.54202 9.68397 2.65114 9.27675 2.53259 8.90447L1.94073 7.04583C1.76203 6.48465 2.10458 5.89133 2.67993 5.7655L4.58549 5.34875C4.96716 5.26527 5.26527 4.96716 5.34875 4.58549L5.7655 2.67993C5.89133 2.10458 6.48465 1.76203 7.04583 1.94073L8.90447 2.53259C9.27675 2.65114 9.68397 2.54202 9.9471 2.25322L11.2608 0.811331Z",fill:"#1A4049"}),f.createElement("path",{d:"M10.4351 7.3042H7.30469V16.6955H16.696V7.3042H13.5656V13.5651H10.4351V7.3042Z",fill:"white"}),f.createElement("path",{d:"M13.5664 13.5649H16.6968V16.6954H13.5664V13.5649Z",fill:"#817AFE"})),Epe=E(Je,{shouldForwardProp:e=>e!=="tooltip"})(({theme:e,tooltip:t})=>({display:"flex",flexDirection:"column",alignItems:t?"start":"center",textAlign:t?"left":"center",backgroundColor:t?"transparent":e.palette.secondaryContainer,borderRadius:t?0:e.shape.borderRadiusLarge,padding:t?e.spacing(1,.5):e.spacing(7.5,1)})),kpe=E(ke)(({theme:e})=>({display:"inline-flex",alignItems:"center",fontWeight:e.fontWeight.bold,gap:e.spacing(1)})),PR=E("div",{shouldForwardProp:e=>e!=="tooltip"})(({theme:e,tooltip:t})=>({margin:t?e.spacing(1,0):e.spacing(3,0,5,0)})),F1=E(ke)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),$R=E("div")(()=>({display:"flex"})),IR=E(po)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),Tpe={"adding-new-projects":{plan:"Pro & Enterprise",url:"",label:"Adding new projects"},access:{plan:"Pro & Enterprise",url:"https://docs.getunleash.io/reference/rbac",label:"Access"},"change-requests":{plan:"Enterprise",url:"https://docs.getunleash.io/reference/change-requests",label:"Change Requests"}},_pe="https://www.getunleash.io/plans",Rpe=({feature:e,tooltip:t})=>{const{url:n,plan:r,label:o}=Tpe[e],i=Is(),a=()=>{i.trackEvent("upgrade_plan_clicked",{props:{feature:o}})},l=Boolean(n)?s(IR,{href:n,target:"_blank",children:o}):o,c=T(Re,{children:[l," is a feature available for the"," ",s("strong",{children:r})," ",r==="Pro & Enterprise"?"plans":"plan"]}),u=`${_pe}?feature=${e}`;return T(Epe,{tooltip:t,children:[T(kpe,{children:[s(KO,{}),`${r} feature`]}),s(X,{condition:Boolean(t),show:T(Re,{children:[s(PR,{tooltip:!0,children:T(F1,{children:[c,". You need to upgrade your plan if you want to use it"]})}),s($R,{children:s(IR,{href:u,target:"_blank",onClick:a,children:"Upgrade now"})})]}),elseShow:T(Re,{children:[T(PR,{children:[s(F1,{children:c}),s(F1,{children:"You need to upgrade your plan if you want to use it"})]}),s($R,{children:s(rt,{variant:"outlined",href:u,target:"_blank",onClick:a,children:"Upgrade now"})})]})})]})},Ppe=E("div")(({theme:e})=>({display:"flex",flexWrap:"wrap",[e.breakpoints.down("sm")]:{justifyContent:"center"}})),$pe=E(Cpe)(({theme:e})=>({maxWidth:"400px",marginBottom:e.spacing(2)})),Ipe=E(on)(({theme:e})=>({color:"inherit",textDecoration:"none",border:"none",padding:"0",background:"transparent",fontFamily:e.typography.fontFamily,pointer:"cursor"}));function Ape(e,t){return e?{disabled:!0,tooltip:{titleComponent:s(Rpe,{feature:"adding-new-projects",tooltip:!0}),sx:{maxWidth:"320px"},variant:"custom"},endIcon:s(KO,{})}:t?{tooltip:{title:"Click to create a new project"},disabled:!1}:{tooltip:{title:"You do not have permission to create new projects"},disabled:!0}}const Ope=()=>{const{hasAccess:e}=f.useContext(Qr),t=ft(),{projects:n,loading:r,error:o,refetch:i}=ja(),[a,l]=f.useState({}),{isOss:c}=Lt(),u=Er(Wc.breakpoints.down("md")),[d,p]=jp(),[h,m]=f.useState(d.get("search")||"");f.useEffect(()=>{const S={};h&&(S.search=h),p(S,{replace:!0})},[h,p]);const y=f.useMemo(()=>{const S=mC(h,"i");return(h?n.filter(C=>S.test(C.name)):n).sort((C,R)=>C!=null&&C.favorite&&!(R!=null&&R.favorite)?-1:!(C!=null&&C.favorite)&&(R!=null&&R.favorite)?1:0)},[n,h]),v=S=>{if(a[S])return;const{KEY:C,fetcher:R}=qO(S);Vr(C,R),l(k=>({...k,[S]:!0}))},b=Ape(c(),e(Z_)),w=()=>s($pe,{onClick:i,text:"Error fetching projects"});let g=y.length<n.length?`${y.length} of ${n.length}`:n.length;return T(gr,{isLoading:r,header:s(xn,{title:`Projects (${g})`,actions:T(Re,{children:[s(X,{condition:!u,show:T(Re,{children:[s(go,{initialValue:h,onChange:m}),s(xn.Divider,{})]})}),s(YO,{Icon:Si,endIcon:b.endIcon,onClick:()=>t("/projects/create"),maxWidth:"700px",permission:Z_,disabled:b.disabled,tooltipProps:b.tooltip,children:"New project"})]}),children:s(X,{condition:u,show:s(go,{initialValue:h,onChange:m})})}),children:[s(X,{condition:o,show:w()}),s(Ppe,{children:s(X,{condition:y.length<1&&!r,show:s(X,{condition:(h==null?void 0:h.length)>0,show:T(Zn,{children:["No projects found matching “",h,"”"]}),elseShow:s(Zn,{children:"No projects available."})}),elseShow:s(X,{condition:r,show:()=>xpe.map(S=>s(RR,{"data-loading":!0,onHover:()=>{},name:S.name,id:S.id,memberCount:2,health:95,featureCount:4},S.id)),elseShow:()=>y.map(S=>s(Ipe,{to:`/projects/${S.id}`,children:s(RR,{onHover:()=>v(S.id),name:S.name,memberCount:S.memberCount??0,health:S.health,id:S.id,featureCount:S.featureCount,isFavorite:S.favorite})},S.id))})})})]})},Lpe=()=>s(Il,{to:"/archive",replace:!0}),gu=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{validateEnvName:async h=>{const y=t("api/admin/environments/validate",{method:"POST",body:JSON.stringify({name:h})},"validateEnvName");try{return await e(y.caller,y.id,!1)}catch(v){throw v}},createEnvironment:async h=>{const y=t("api/admin/environments",{method:"POST",body:JSON.stringify(h)},"createEnvironment");try{return await e(y.caller,y.id)}catch(v){throw v}},errors:n,loading:r,deleteEnvironment:async h=>{const m=`api/admin/environments/${h}`,y=t(m,{method:"DELETE"},"deleteEnvironment");try{return await e(y.caller,y.id)}catch(v){throw v}},updateEnvironment:async(h,m)=>{const y=`api/admin/environments/update/${h}`,v=t(y,{method:"PUT",body:JSON.stringify(m)},"updateEnvironment");try{return await e(v.caller,v.id)}catch(b){throw b}},cloneEnvironment:async(h,m)=>{const y=`api/admin/environments/${h}/clone`,v=t(y,{method:"POST",body:JSON.stringify(m)},"cloneEnvironment");return await e(v.caller,v.id)},changeSortOrder:async h=>{const y=t("api/admin/environments/sort-order",{method:"PUT",body:JSON.stringify(h)},"changeSortOrder");try{return await e(y.caller,y.id)}catch(v){throw v}},toggleEnvironmentOff:async h=>{const m=`api/admin/environments/${h}/off`,y=t(m,{method:"POST"},"toggleEnvironmentOff");try{return await e(y.caller,y.id)}catch(v){throw v}},toggleEnvironmentOn:async h=>{const m=`api/admin/environments/${h}/on`,y=t(m,{method:"POST"},"toggleEnvironmentOn");try{return await e(y.caller,y.id)}catch(v){throw v}}}},Dpe=e=>e.reduce((t,n,r)=>(t[n.name]=r+1,t),{}),XO=(e="",t="development")=>{const[n,r]=f.useState(e),[o,i]=f.useState(t),[a,l]=f.useState({});f.useEffect(()=>{r(e)},[e]),f.useEffect(()=>{i(t)},[t]);const{validateEnvName:c}=gu();return{name:n,setName:r,type:o,setType:i,getEnvPayload:()=>({name:n,type:o}),validateEnvironmentName:async()=>{if(n.length===0)return l(h=>({...h,name:"Environment name can not be empty"})),!1;try{return await c(n),!0}catch(h){return l(m=>({...m,name:ht(h)})),!1}},clearErrors:()=>{l({})},errors:a}},Npe=ai()(e=>({helperText:{position:"absolute",bottom:"-1rem"}})),Mpe=E("div")(({theme:e})=>({width:"100%",position:"relative"})),_r=({label:e,placeholder:t,error:n,errorText:r,style:o,className:i,value:a,onChange:l,...c})=>{const{classes:u}=Npe();return s(Mpe,{"data-loading":!0,children:s(pn,{size:"small",variant:"outlined",label:e,placeholder:t,error:n,helperText:r,style:o,className:i||"",value:a,onChange:l,FormHelperTextProps:{["data-testid"]:S3,classes:{root:u.helperText}},...c})})},Bpe=E(Ax)({flexDirection:"row"}),AR=E("div")({display:"flex",flexDirection:"column"}),JO=({onChange:e,value:t})=>s(Da,{component:"fieldset",children:T(Bpe,{"data-loading":!0,value:t,onChange:e,children:[T(AR,{children:[s(xr,{value:"development",label:"Development",control:s(ll,{})}),s(xr,{value:"test",label:"Test",control:s(ll,{})})]}),T(AR,{children:[s(xr,{value:"preproduction",label:"Pre production",control:s(ll,{})}),s(xr,{value:"production",label:"Production",control:s(ll,{})})]})]})}),OR={FIX:"fix",VARIABLE:"variable"},z1=e=>t=>{if(t.flag){const n=e.flags;return Boolean(n[t.flag])}return t.configFlag?Boolean(e[t.configFlag]):!0},Fpe=()=>{window.scrollTo(0,0)},Cs=e=>e&&e.trim?e.trim():e,zpe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")+"T"+Cp(t,"HH:mm")},QO=e=>{const t=new Date(e);if(hC(t))return t},F5e=e=>e/10;function z5e(e,t){if(e.length===0)return[];const n=e.reduce(({remainingPercentage:a,variableVariantCount:l},c)=>(c.weight&&c.weightType===OR.FIX?a-=Number(c.weight):l+=1,{remainingPercentage:a,variableVariantCount:l}),{remainingPercentage:t,variableVariantCount:0}),{remainingPercentage:r,variableVariantCount:o}=n;if(r<0)throw new Error("The traffic distribution total must equal 100%");if(!o)throw new Error("There must be at least one variable variant");const i=parseInt(String(r/o));return e.map(a=>(a.weightType!==OR.FIX&&(a.weight=i),a))}const j5e={overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.25)",zIndex:5},content:{width:"500px",maxWidth:"90%",margin:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",transform:"translate(-50%, -50%)"}},jpe=E("form")({display:"flex",flexDirection:"column",height:"100%"}),Upe=E("h3")({fontWeight:"normal",marginTop:"0"}),Wpe=E("div")({maxWidth:"440px"}),LR=E("p")(({theme:e})=>({marginBottom:e.spacing(1)})),Hpe=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),Vpe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),Gpe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),ZO=({children:e,handleSubmit:t,handleCancel:n,name:r,type:o,setName:i,setType:a,validateEnvironmentName:l,errors:c,mode:u,clearErrors:d})=>T(jpe,{onSubmit:t,children:[s(Upe,{children:"Environment information"}),T(Wpe,{children:[s(LR,{children:"What is your environment name? (Can't be changed later)"}),s(Hpe,{label:"Environment name",value:r,onChange:p=>i(Cs(p.target.value)),error:Boolean(c.name),errorText:c.name,onFocus:()=>d(),onBlur:l,disabled:u==="Edit",autoFocus:!0}),s(LR,{children:"What type of environment do you want to create?"}),s(JO,{onChange:p=>a(p.currentTarget.value),value:o})]}),T(Vpe,{children:[e,s(Gpe,{onClick:n,children:"Cancel"})]})]}),qpe=E("div")(({theme:e})=>({backgroundColor:e.palette.codebox,padding:e.spacing(2),borderRadius:e.shape.borderRadiusMedium,position:"relative",maxHeight:"500px",overflow:"auto"})),Ype=E("pre")(({theme:e})=>({margin:0,wordBreak:"break-all",whiteSpace:"pre-wrap",color:e.palette.formSidebarTextColor,fontSize:e.fontSizes.smallBody})),Kpe=({text:e})=>s(qpe,{children:s(Ype,{children:e})}),Xpe="/static/unleashLogoIconDarkAlpha-de056a82.gif",Jpe=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:e.palette.background.paper})),Qpe=E("img")(({theme:e})=>({width:"100px",height:"100px"})),Xm=()=>s(Jpe,{role:"alert","aria-label":"Loading",children:s(Qpe,{src:Js(Xpe),alt:""})});var Zpe=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},efe=Zpe,DR={"text/plain":"Text","text/html":"Url",default:"Text"},tfe="Copy to clipboard: #{key}, Enter";function nfe(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function rfe(e,t){var n,r,o,i,a,l,c=!1;t||(t={}),n=t.debug||!1;try{o=efe(),i=document.createRange(),a=document.getSelection(),l=document.createElement("span"),l.textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(d){if(d.stopPropagation(),t.format)if(d.preventDefault(),typeof d.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var p=DR[t.format]||DR.default;window.clipboardData.setData(p,e)}else d.clipboardData.clearData(),d.clipboardData.setData(t.format,e);t.onCopy&&(d.preventDefault(),t.onCopy(d.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");c=!0}catch(d){n&&console.error("unable to copy using execCommand: ",d),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(p){n&&console.error("unable to copy using clipboardData: ",p),n&&console.error("falling back to prompt"),r=nfe("message"in t?t.message:tfe),window.prompt(r,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),o()}return c}var eL=rfe;const ofe=e=>f.createElement("svg",{width:48,height:50,viewBox:"0 0 48 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M0.5 0.000193412C11 2.00019 17 9 18 18C19 27 23.5 31.5 30.5 34C37.5 36.5 47.34 41.4 48 49.5L48 12.0012C48 5.37332 42.6309 0.000381623 36.003 0.000366343C24.1359 0.000338986 8.66406 -0.000263908 0.5 0.000193412Z",fill:"#6C65E5"})),tL="27.5rem",ife=E("section",{shouldForwardProp:e=>e!=="modal"})(({theme:e,modal:t})=>({minHeight:t?"100vh":"80vh",borderRadius:t?0:e.spacing(2),width:"100%",display:"flex",margin:"0 auto",overflow:"hidden",[e.breakpoints.down(1100)]:{flexDirection:"column",minHeight:0}})),afe=E("div")(({theme:e})=>Jne),sfe=E("div")(({theme:e})=>({backgroundColor:e.palette.formBackground,display:"flex",flexDirection:"column",padding:e.spacing(6),flexGrow:1,[e.breakpoints.down("lg")]:{padding:e.spacing(4)},[e.breakpoints.down(1100)]:{width:"100%"},[e.breakpoints.down(500)]:{padding:e.spacing(4,2)}})),lfe=E("h1")(({theme:e})=>({marginBottom:e.fontSizes.mainHeader,fontWeight:"normal"})),cfe=E(uo)(({theme:e})=>({opacity:.3,marginBottom:e.spacing(.5)})),ufe=E("h2")(({theme:e})=>({color:e.palette.formSidebarTextColor,marginBottom:e.spacing(2),display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:e.fontWeight.bold,fontSize:e.fontSizes.bodySize})),dfe=E(c3)(({theme:e})=>({fill:e.palette.text.tertiaryContrast})),pfe=E("div")(()=>({zIndex:1,position:"absolute",right:-3,top:-3})),ffe=E(ofe)(()=>({width:"75px",height:"75px"})),hfe=E(Qt)(()=>({position:"absolute",zIndex:400,right:0})),mfe=E(ite)(({theme:e})=>({fill:e.palette.text.tertiaryContrast})),gfe=E("aside")(({theme:e})=>({backgroundColor:e.palette.formSidebar,padding:e.spacing(4),flexGrow:0,flexShrink:0,width:tL,[e.breakpoints.down(1100)]:{width:"100%",color:"red"},[e.breakpoints.down(500)]:{padding:e.spacing(4,2)}})),vfe=E("p")(({theme:e})=>({color:e.palette.formSidebarTextColor,zIndex:1,position:"relative"})),yfe=E("div")(({theme:e})=>({margin:e.spacing(3,0),display:"flex",alignItems:"center"})),bfe=E(rC)(({theme:e})=>({marginRight:e.spacing(1),color:e.palette.text.tertiaryContrast})),wfe=E("a")(({theme:e})=>({color:e.palette.text.tertiaryContrast,display:"block","&:hover":{textDecoration:"none"}})),Nr=({title:e,description:t,children:n,documentationLink:r,documentationLinkLabel:o,loading:i,modal:a,formatApiCode:l})=>{const{setToastData:c}=It(),u=Er(`(max-width:${1099}px)`);return T(ife,{modal:a,children:[s(X,{condition:u,show:s(afe,{children:s(Sfe,{description:t,documentationLink:r,documentationLinkLabel:o})})}),T(sfe,{children:[s(X,{condition:i||!1,show:s(Xm,{}),elseShow:T(Re,{children:[s(lfe,{children:e}),n]})})," "]}),s(X,{condition:!u,show:T(nL,{description:t,documentationLink:r,documentationLinkLabel:o,children:[s(cfe,{}),T(ufe,{children:["API Command"," ",s(Tt,{title:"Copy command",arrow:!0,children:s(Qt,{onClick:()=>{eL(l())?c({title:"Successfully copied the command",text:"The command should now be automatically copied to your clipboard",autoHideDuration:6e3,type:"success",show:!0}):c({title:"Could not copy the command",text:"Sorry, but we could not copy the command.",autoHideDuration:6e3,type:"error",show:!0})},size:"large",children:s(dfe,{})})})]}),s(Kpe,{text:l()})]})})]})},Sfe=({description:e,documentationLink:t,documentationLinkLabel:n})=>{const[r,o]=f.useState(!1);return T(Re,{children:[s(pfe,{children:s(ffe,{})}),s(Tt,{title:"Toggle help",arrow:!0,children:s(hfe,{onClick:()=>o(i=>!i),size:"large",children:s(mfe,{})})}),s(m4,{in:r,timeout:500,children:s(nL,{description:e,documentationLink:t,documentationLinkLabel:n})})]})},nL=({description:e,children:t,documentationLink:n,documentationLinkLabel:r="Learn more"})=>T(gfe,{children:[s(vfe,{children:e}),T(yfe,{children:[s(bfe,{}),s(wfe,{href:n,rel:"noopener noreferrer",target:"_blank",children:r})]}),t]}),vu=({name:e,...t})=>T(Io,{type:"submit",...t,children:["Create ",e]}),UC=(e={})=>{const t=()=>{const c=Ft("api/admin/permissions");return fetch(c,{method:"GET"}).then(Cn("Project permissions")).then(u=>u.json())},n="api/admin/permissions",{data:r,error:o}=gn(n,t,e),[i,a]=f.useState(!o&&!r),l=()=>{Vr(n)};return f.useEffect(()=>{a(!o&&!r)},[r,o]),{permissions:(r==null?void 0:r.permissions)||{project:[],environments:[]},error:o,loading:i,refetch:l}},Ao=-1,Jm=50,xfe=()=>{const{setToastApiError:e,setToastData:t}=It(),{uiConfig:n}=Lt(),r=ft(),{environments:o}=pu(),i=o.length<Jm,{createEnvironment:a,loading:l}=gu(),{refetch:c}=UC(),{name:u,setName:d,type:p,setType:h,getEnvPayload:m,validateEnvironmentName:y,clearErrors:v,errors:b}=XO(),w=async C=>{if(C.preventDefault(),v(),await y()){const k=m();try{await a(k),c(),t({title:"Environment created",type:"success",confetti:!0}),r("/environments")}catch(P){e(ht(P))}}},g=()=>`curl --location --request POST '${n.unleashUrl}/api/admin/environments' \\
|
|
292
292
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
293
293
|
--header 'Content-Type: application/json' \\
|
|
294
294
|
--data-raw '${JSON.stringify(m(),void 0,2)}'`,S=()=>{r(Ao)};return s(X,{condition:i,show:s(Nr,{loading:l,title:"Create environment",description:`Environments allow you to manage your
|
|
@@ -316,13 +316,13 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
316
316
|
They can be used together with strategy constraints as part of the activation strategy evaluation.`,documentationLink:"https://docs.getunleash.io/reference/unleash-context#custom-context-fields",documentationLinkLabel:"Context fields documentation",formatApiCode:()=>`curl --location --request PUT '${e.unleashUrl}/api/admin/context/${r}' \\
|
|
317
317
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
318
318
|
--header 'Content-Type: application/json' \\
|
|
319
|
-
--data-raw '${JSON.stringify(w(),void 0,2)}'`,children:s(rL,{errors:C,handleSubmit:async O=>{O.preventDefault();const L=w();try{await a(L),i(),c("/context"),t({title:"Context information updated",type:"success"})}catch(I){n(ht(I))}},onCancel:()=>{c(Ao)},contextName:u,setContextName:m,contextDesc:d,setContextDesc:y,legalValues:p,setLegalValues:v,stickiness:h,setStickiness:b,mode:"Edit",setErrors:S,clearErrors:g,children:s(Ol,{permission:H3})})})},iL=(e="",t="")=>{const[n,r]=f.useState(e),[o,i]=f.useState(t),[a,l]=f.useState({}),{validateTagName:c}=Bv();return f.useEffect(()=>{r(e)},[e]),f.useEffect(()=>{i(t)},[t]),{tagName:n,tagDesc:o,setTagName:r,setTagDesc:i,getTagPayload:()=>({name:n,description:o}),clearErrors:()=>{l({})},validateNameUniqueness:async()=>{if(n.length===0)return l(h=>({...h,name:"Name can not be empty."})),!1;if(n.length<2)return l(h=>({...h,name:"Tag name length must be at least 2 characters long"})),!1;try{return await c(n),!0}catch(h){return l(m=>({...m,name:ht(h)})),!1}},errors:a}},Wfe="Edit",
|
|
319
|
+
--data-raw '${JSON.stringify(w(),void 0,2)}'`,children:s(rL,{errors:C,handleSubmit:async O=>{O.preventDefault();const L=w();try{await a(L),i(),c("/context"),t({title:"Context information updated",type:"success"})}catch(I){n(ht(I))}},onCancel:()=>{c(Ao)},contextName:u,setContextName:m,contextDesc:d,setContextDesc:y,legalValues:p,setLegalValues:v,stickiness:h,setStickiness:b,mode:"Edit",setErrors:S,clearErrors:g,children:s(Ol,{permission:H3})})})},iL=(e="",t="")=>{const[n,r]=f.useState(e),[o,i]=f.useState(t),[a,l]=f.useState({}),{validateTagName:c}=Bv();return f.useEffect(()=>{r(e)},[e]),f.useEffect(()=>{i(t)},[t]),{tagName:n,tagDesc:o,setTagName:r,setTagDesc:i,getTagPayload:()=>({name:n,description:o}),clearErrors:()=>{l({})},validateNameUniqueness:async()=>{if(n.length===0)return l(h=>({...h,name:"Name can not be empty."})),!1;if(n.length<2)return l(h=>({...h,name:"Tag name length must be at least 2 characters long"})),!1;try{return await c(n),!0}catch(h){return l(m=>({...m,name:ht(h)})),!1}},errors:a}},Wfe="Edit",U5e="Create",Hfe=E("form")(({theme:e})=>({display:"flex",flexDirection:"column",height:"100%"})),Vfe=E("div")(({theme:e})=>({maxWidth:"400px"})),MR=E("p")(({theme:e})=>({marginBottom:e.spacing(1)})),Gfe=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),qfe=E(pn)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),Yfe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),Kfe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),aL=({children:e,handleSubmit:t,handleCancel:n,tagName:r,tagDesc:o,setTagName:i,setTagDesc:a,errors:l,mode:c,validateNameUniqueness:u,clearErrors:d})=>T(Hfe,{onSubmit:t,children:[T(Vfe,{children:[s(MR,{children:"What is your tag name?"}),s(Gfe,{label:"Tag name",value:r,onChange:p=>i(Cs(p.target.value)),error:Boolean(l.name),errorText:l.name,onFocus:()=>d(),disabled:c===Wfe,onBlur:u,autoFocus:!0}),s(MR,{children:"What is this tag for?"}),s(qfe,{label:"Tag description",variant:"outlined",multiline:!0,maxRows:4,value:o,onChange:p=>a(p.target.value)})]}),T(Yfe,{children:[e,s(Kfe,{onClick:n,children:"Cancel"})]})]}),Xfe=(e,t={})=>{const n=async()=>{const u=Ft(`api/admin/tag-types/${e}`);return fetch(u,{method:"GET"}).then(Cn("Tag data")).then(d=>d.json())},r=`api/admin/tag-types/${e}`,{data:o,error:i}=gn(r,n,{...t}),[a,l]=f.useState(!i&&!o),c=()=>{Vr(r)};return f.useEffect(()=>{l(!i&&!o)},[o,i]),{tagType:(o==null?void 0:o.tagType)||{name:"",description:""},error:i,loading:a,refetch:c,FEATURE_CACHE_KEY:r}},Jfe=()=>{const{setToastData:e,setToastApiError:t}=It(),{uiConfig:n}=Lt(),r=ft(),o=ur("name"),{tagType:i}=Xfe(o),{tagName:a,tagDesc:l,setTagName:c,setTagDesc:u,getTagPayload:d,errors:p,clearErrors:h}=iL(i==null?void 0:i.name,i==null?void 0:i.description),{updateTagType:m,loading:y}=Bv();return s(Nr,{loading:y,title:"Edit tag type",description:"Tag types allow you to group tags together in the management UI",documentationLink:"https://docs.getunleash.io/",documentationLinkLabel:"Tags documentation",formatApiCode:()=>`curl --location --request PUT '${n.unleashUrl}/api/admin/tag-types/${o}' \\
|
|
320
320
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
321
321
|
--header 'Content-Type: application/json' \\
|
|
322
322
|
--data-raw '${JSON.stringify(d(),void 0,2)}'`,children:s(aL,{errors:p,handleSubmit:async g=>{g.preventDefault(),h();const S=d();try{await m(a,S),r("/tag-types"),e({title:"Tag type updated",type:"success"})}catch(C){t(ht(C))}},handleCancel:()=>{r(Ao)},tagName:a,setTagName:c,tagDesc:l,setTagDesc:u,mode:"Edit",clearErrors:h,children:s(Ol,{permission:xp})})})},Qfe=()=>{const{setToastData:e,setToastApiError:t}=It(),{uiConfig:n}=Lt(),r=ft(),{tagName:o,tagDesc:i,setTagName:a,setTagDesc:l,getTagPayload:c,validateNameUniqueness:u,errors:d,clearErrors:p}=iL(),{createTag:h,loading:m}=Bv();return s(Nr,{loading:m,title:"Create tag type",description:"Tag types allow you to group tags together in the management UI",documentationLink:"https://docs.getunleash.io/reference/tags",documentationLinkLabel:"Tags documentation",formatApiCode:()=>`curl --location --request POST '${n.unleashUrl}/api/admin/tag-types' \\
|
|
323
323
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
324
324
|
--header 'Content-Type: application/json' \\
|
|
325
|
-
--data-raw '${JSON.stringify(c(),void 0,2)}'`,children:s(aL,{errors:d,handleSubmit:async w=>{if(w.preventDefault(),p(),await u()){const S=c();try{await h(S),r("/tag-types"),e({title:"Tag type created",confetti:!0,type:"success"})}catch(C){t(ht(C))}}},handleCancel:()=>{r(Ao)},tagName:o,setTagName:a,tagDesc:i,setTagDesc:l,mode:"Create",clearErrors:p,validateNameUniqueness:u,children:s(vu,{name:"type",permission:xp})})})},Zfe=E("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),ehe=E("div")(()=>({maxWidth:"400px"})),U1=E("p")(({theme:e})=>({marginBottom:e.spacing(1)})),BR=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),the=E(pn)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),nhe=E("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),rhe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),ohe=({children:e,handleSubmit:t,handleCancel:n,projectId:r,projectName:o,projectDesc:i,setProjectId:a,setProjectName:l,setProjectDesc:c,errors:u,mode:d,validateProjectId:p,clearErrors:h})=>T(Zfe,{onSubmit:t,children:[T(ehe,{children:[s(U1,{children:"What is your project Id?"}),s(BR,{label:"Project Id",value:r,onChange:m=>a(Cs(m.target.value)),error:Boolean(u.id),errorText:u.id,onFocus:()=>h(),onBlur:p,disabled:d==="Edit",autoFocus:!0,required:!0}),s(U1,{children:"What is your project name?"}),s(BR,{label:"Project name",value:o,onChange:m=>l(m.target.value),error:Boolean(u.name),errorText:u.name,onFocus:()=>h(),required:!0}),s(U1,{children:"What is your project description?"}),s(the,{label:"Project description",variant:"outlined",multiline:!0,maxRows:4,value:i,onChange:m=>c(m.target.value)})]}),T(nhe,{children:[e,s(rhe,{onClick:n,children:"Cancel"})]})]}),ihe=(e="",t="",n="")=>{const[r,o]=f.useState(e),[i,a]=f.useState(t),[l,c]=f.useState(n),[u,d]=f.useState({}),{validateId:p}=jC();f.useEffect(()=>{o(e)},[e]),f.useEffect(()=>{a(t)},[t]),f.useEffect(()=>{c(n)},[n]);const h=()=>({id:r,name:i,description:l});return{projectId:r,projectName:i,projectDesc:l,setProjectId:o,setProjectName:a,setProjectDesc:c,getProjectPayload:h,validateName:()=>i.length===0?(d(b=>({...b,name:"Name can not be empty."})),!1):!0,validateProjectId:async()=>{if(r.length===0)return d(b=>({...b,id:"Id can not be empty."})),!1;try{return await p(h()),!0}catch(b){return d(w=>({...w,id:ht(b)})),!1}},clearErrors:()=>{d({})},errors:u}},ahe={features:[],environments:[],name:"",health:0,members:0,version:"1",description:"Default",favorite:!1},ew=(e,t={})=>{const{KEY:n,fetcher:r}=qO(e),{data:o,error:i,mutate:a}=gn(n,r,t),l=f.useCallback(()=>{a()},[a]);return{project:o||ahe,loading:!i&&!o,error:i,refetch:l}},
|
|
325
|
+
--data-raw '${JSON.stringify(c(),void 0,2)}'`,children:s(aL,{errors:d,handleSubmit:async w=>{if(w.preventDefault(),p(),await u()){const S=c();try{await h(S),r("/tag-types"),e({title:"Tag type created",confetti:!0,type:"success"})}catch(C){t(ht(C))}}},handleCancel:()=>{r(Ao)},tagName:o,setTagName:a,tagDesc:i,setTagDesc:l,mode:"Create",clearErrors:p,validateNameUniqueness:u,children:s(vu,{name:"type",permission:xp})})})},Zfe=E("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),ehe=E("div")(()=>({maxWidth:"400px"})),U1=E("p")(({theme:e})=>({marginBottom:e.spacing(1)})),BR=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),the=E(pn)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),nhe=E("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),rhe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),ohe=({children:e,handleSubmit:t,handleCancel:n,projectId:r,projectName:o,projectDesc:i,setProjectId:a,setProjectName:l,setProjectDesc:c,errors:u,mode:d,validateProjectId:p,clearErrors:h})=>T(Zfe,{onSubmit:t,children:[T(ehe,{children:[s(U1,{children:"What is your project Id?"}),s(BR,{label:"Project Id",value:r,onChange:m=>a(Cs(m.target.value)),error:Boolean(u.id),errorText:u.id,onFocus:()=>h(),onBlur:p,disabled:d==="Edit",autoFocus:!0,required:!0}),s(U1,{children:"What is your project name?"}),s(BR,{label:"Project name",value:o,onChange:m=>l(m.target.value),error:Boolean(u.name),errorText:u.name,onFocus:()=>h(),required:!0}),s(U1,{children:"What is your project description?"}),s(the,{label:"Project description",variant:"outlined",multiline:!0,maxRows:4,value:i,onChange:m=>c(m.target.value)})]}),T(nhe,{children:[e,s(rhe,{onClick:n,children:"Cancel"})]})]}),ihe=(e="",t="",n="")=>{const[r,o]=f.useState(e),[i,a]=f.useState(t),[l,c]=f.useState(n),[u,d]=f.useState({}),{validateId:p}=jC();f.useEffect(()=>{o(e)},[e]),f.useEffect(()=>{a(t)},[t]),f.useEffect(()=>{c(n)},[n]);const h=()=>({id:r,name:i,description:l});return{projectId:r,projectName:i,projectDesc:l,setProjectId:o,setProjectName:a,setProjectDesc:c,getProjectPayload:h,validateName:()=>i.length===0?(d(b=>({...b,name:"Name can not be empty."})),!1):!0,validateProjectId:async()=>{if(r.length===0)return d(b=>({...b,id:"Id can not be empty."})),!1;try{return await p(h()),!0}catch(b){return d(w=>({...w,id:ht(b)})),!1}},clearErrors:()=>{d({})},errors:u}},ahe={features:[],environments:[],name:"",health:0,members:0,version:"1",description:"Default",favorite:!1},ew=(e,t={})=>{const{KEY:n,fetcher:r}=qO(e),{data:o,error:i,mutate:a}=gn(n,r,t),l=f.useCallback(()=>{a()},[a]);return{project:o||ahe,loading:!i&&!o,error:i,refetch:l}},W5e=e=>ew(e).project.name||e,she=()=>{const{uiConfig:e}=Lt(),{setToastData:t,setToastApiError:n}=It(),{hasAccess:r}=f.useContext(Qr),o=ur("projectId"),{project:i}=ew(o),a=ft(),{projectId:l,projectName:c,projectDesc:u,setProjectId:d,setProjectName:p,setProjectDesc:h,getProjectPayload:m,clearErrors:y,validateProjectId:v,validateName:b,errors:w}=ihe(o,i.name,i.description),g=()=>`curl --location --request PUT '${e.unleashUrl}/api/admin/projects/${o}' \\
|
|
326
326
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
327
327
|
--header 'Content-Type: application/json' \\
|
|
328
328
|
--data-raw '${JSON.stringify(m(),void 0,2)}'`,{refetch:S}=ew(o),{editProject:C,loading:R}=jC(),k=async L=>{L.preventDefault();const I=m();if(b())try{await C(o,I),S(),a(`/projects/${o}`),t({title:"Project information updated",type:"success"})}catch(M){n(ht(M))}},P=()=>{a(Ao)},O=!r(Vb,l)&&s(Xt,{severity:"error",sx:{mb:4},children:"You do not have the required permissions to edit this project."});return T(Nr,{loading:R,title:"Edit project",description:"Projects allows you to group feature toggles together in the management UI.",documentationLink:"https://docs.getunleash.io/reference/projects",documentationLinkLabel:"Projects documentation",formatApiCode:g,children:[O,s(ohe,{errors:w,handleSubmit:k,handleCancel:P,projectId:l,setProjectId:d,projectName:c,setProjectName:p,projectDesc:u,setProjectDesc:h,mode:"Edit",clearErrors:y,validateProjectId:v,children:s(Ol,{permission:Vb,projectId:l})})]})},lhe=({editable:e,value:t,id:n,label:r,onChange:o,...i})=>{const{featureTypes:a}=CC(),l=a.map(c=>({key:c.id,label:c.name,title:c.description}));return l.some(c=>c.key===t)||l.push({key:t,label:t}),s(Re,{children:s(fu,{disabled:!e,options:l,value:t,onChange:o,label:r,id:n,...i})})},che=(e=[],t)=>{let n=!1;const r=e.reduce((o,i)=>(i.permission===xi&&(n=!0),i.project&&i.permission===t&&(o[i.project]=t),o),{});return o=>n||Boolean(r[o])},uhe=({enabled:e,value:t,onChange:n,filter:r,...o})=>{const{projects:i}=ja();if(!e)return null;const a=c=>({key:c.id,label:c.name,title:c.description});let l;return r?l=i.filter(c=>r(c.id)).map(a):l=i.map(a),t&&!l.find(c=>c.key===t)&&l.push({key:t,label:t}),s(fu,{label:"Project",options:l,value:t,onChange:n,...o})},dhe=(e,t)=>{var r,o;let n=e.data&&"permissions"in e.data?e.data.permissions:void 0;return n&&((r=t==null?void 0:t.flags)!=null&&r.maintenance)&&((o=t==null?void 0:t.flags)!=null&&o.maintenanceMode)&&(n=n.filter(i=>i.permission==="ADMIN")),n},WC=()=>{const e=cf(),{uiConfig:t}=Lt();return{permissions:dhe(e,t),refetchPermissions:e.refetchAuth,loading:e.loading,error:e.error}},phe=E("form")({display:"flex",flexDirection:"column",height:"100%"}),fhe=E("div")({maxWidth:"400px"}),hh=E("p")(({theme:e})=>({marginBottom:e.spacing(1),color:e.palette.text.secondary})),FR=E(_r)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),hhe=E(Da)(({theme:e})=>({width:"100%",marginBottom:e.spacing(2)})),zR=e=>({marginBottom:e.spacing(2),minWidth:"400px",[e.breakpoints.down("sm")]:{minWidth:"379px"}}),mhe=E("p")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary,top:"-13px",position:"relative"})),ghe=E("div")({marginTop:"auto",display:"flex",justifyContent:"flex-end"}),vhe=E("div")(({theme:e})=>({display:"flex",alignItems:"center",marginTop:e.spacing(1)})),yhe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),bhe=e=>({margin:e.spacing(1,0)}),sL=({children:e,type:t,name:n,description:r,project:o,setType:i,setName:a,setDescription:l,setProject:c,validateToggleName:u,setImpressionData:d,impressionData:p,handleSubmit:h,handleCancel:m,errors:y,mode:v,clearErrors:b})=>{const{featureTypes:w}=CC(),g=ft(),{permissions:S}=WC(),C=v!=="Edit",R=()=>{var k;return(k=w.find(P=>P.id===t))==null?void 0:k.description};return T(phe,{onSubmit:h,children:[T(fhe,{children:[s(hh,{children:"What would you like to call your toggle?"}),s(FR,{autoFocus:!0,disabled:v==="Edit",label:"Name",id:"feature-toggle-name",error:Boolean(y.name),errorText:y.name,onFocus:()=>b(),value:n,onChange:k=>a(Cs(k.target.value)),"data-testid":Ite,onBlur:u}),s(hh,{children:"What kind of feature toggle do you want?"}),s(lhe,{sx:zR,value:t,onChange:i,label:"Toggle type",id:"feature-type-select",editable:!0,"data-testid":Ate,IconComponent:Ub}),s(mhe,{children:R()}),s(X,{condition:C,show:s(hh,{children:"In which project do you want to save the toggle?"})}),s(uhe,{value:o,onChange:k=>{c(k),g(`/projects/${k}/create-toggle`,{replace:!0})},enabled:C,filter:che(S,Sp),IconComponent:Ub,sx:zR}),s(hh,{children:"How would you describe your feature toggle?"}),s(FR,{multiline:!0,rows:4,label:"Description",placeholder:"A short description of the feature toggle",value:r,"data-testid":Ote,onChange:k=>l(k.target.value)}),T(hhe,{children:[s(ke,{variant:"subtitle1",sx:bhe,"data-loading":!0,component:"h2",children:"Impression Data"}),T("p",{children:["When you enable impression data for a feature toggle, your client SDKs will emit events you can listen for every time this toggle gets triggered. Learn more in"," ",s("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.getunleash.io/advanced/impression_data",children:"the impression data documentation"})]}),s(vhe,{children:s(xr,{labelPlacement:"start",style:{marginLeft:0},control:s(Na,{name:"impressionData",onChange:()=>d(!p),checked:p}),label:"Enable impression data"})})]})]}),T(ghe,{children:[e,s(yhe,{onClick:m,children:"Cancel"})]})]})},yu=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0}),o=async g=>{const C=t("api/admin/features/validate",{method:"POST",body:JSON.stringify({name:g})});try{return await e(C.caller,C.id)}catch(R){throw R}},i=async g=>{const C=t("api/admin/constraints/validate",{method:"POST",body:JSON.stringify(g)});await e(C.caller,C.id)},a=async(g,S)=>{const C=`/api/admin/projects/${g}/features`,R=t(C,{method:"POST",body:JSON.stringify(S)});await e(R.caller,R.id)},l=f.useCallback(async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}/environments/${C}/on`,k=t(R,{method:"POST"},"toggleFeatureEnvironmentOn");try{return await e(k.caller,k.id)}catch(P){throw P}},[t,e]),c=f.useCallback(async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}/environments/${C}/off`,k=t(R,{method:"POST"},"toggleFeatureEnvironmentOff");try{return await e(k.caller,k.id)}catch(P){throw P}},[t,e]);return{validateFeatureToggleName:o,validateConstraint:i,createFeatureToggle:a,changeFeatureProject:async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}/changeProject`,k=t(R,{method:"POST",body:JSON.stringify({newProjectId:C})});try{return await e(k.caller,k.id)}catch(P){throw P}},errors:n,toggleFeatureEnvironmentOn:l,toggleFeatureEnvironmentOff:c,addTagToFeature:async(g,S)=>{const C=`api/admin/features/${g}/tags`,R=t(C,{method:"POST",body:JSON.stringify({...S})});try{return await e(R.caller,R.id)}catch(k){throw k}},deleteTagFromFeature:async(g,S,C)=>{const R=`api/admin/features/${g}/tags/${S}/${C}`,k=t(R,{method:"DELETE"});try{return await e(k.caller,k.id)}catch(P){throw P}},archiveFeatureToggle:async(g,S)=>{const C=`api/admin/projects/${g}/features/${S}`,R=t(C,{method:"DELETE"});try{return await e(R.caller,R.id)}catch(k){throw k}},patchFeatureToggle:async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}`,k=t(R,{method:"PATCH",body:JSON.stringify(C)});try{return await e(k.caller,k.id)}catch(P){throw P}},patchFeatureVariants:async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}/variants`,k=t(R,{method:"PATCH",body:JSON.stringify(C)});try{return await e(k.caller,k.id)}catch(P){throw P}},patchFeatureEnvironmentVariants:async(g,S,C,R)=>{const k=`api/admin/projects/${g}/features/${S}/environments/${C}/variants`,P=t(k,{method:"PATCH",body:JSON.stringify(R)});try{return await e(P.caller,P.id)}catch(O){throw O}},overrideVariantsInEnvironments:async(g,S,C,R)=>{const k=`api/admin/projects/${g}/features/${S}/variants-batch`,P=t(k,{method:"PUT",body:JSON.stringify({variants:C,environments:R})});try{return await e(P.caller,P.id)}catch(O){throw O}},cloneFeatureToggle:async(g,S,C)=>{const R=`api/admin/projects/${g}/features/${S}/clone`,k=t(R,{method:"POST",body:JSON.stringify(C)});try{return await e(k.caller,k.id)}catch(P){throw P}},loading:r}},lL=(e="",t="release",n="default",r="",o=!1)=>{const i=ur("projectId"),a=Al(),{validateFeatureToggleName:l}=yu(),c=a.get("name"),[u,d]=f.useState(t),[p,h]=f.useState(c||e),[m,y]=f.useState(i||n),[v,b]=f.useState(r),[w,g]=f.useState(o),[S,C]=f.useState({});return f.useEffect(()=>{d(t)},[t]),f.useEffect(()=>{p||h(c||e)},[p,e,c]),f.useEffect(()=>{y(i||n)},[n,i]),f.useEffect(()=>{b(r)},[r]),f.useEffect(()=>{g(o)},[o]),{type:u,setType:d,name:p,setName:h,project:m,setProject:y,description:v,setDescription:b,impressionData:w,setImpressionData:g,getTogglePayload:()=>({type:u,name:p,description:v,impressionData:w}),validateToggleName:async()=>{if(p.length===0)return C(O=>({...O,name:"Name can not be empty."})),!1;try{return await l(p),!0}catch(O){return C(L=>({...L,name:ht(O)})),!1}},clearErrors:()=>{C({})},errors:S}},whe=()=>{const{setToastData:e,setToastApiError:t}=It(),{setShowFeedback:n}=f.useContext($s),{uiConfig:r}=Lt(),o=ft(),{type:i,setType:a,name:l,setName:c,project:u,setProject:d,description:p,setDescription:h,validateToggleName:m,impressionData:y,setImpressionData:v,getTogglePayload:b,clearErrors:w,errors:g}=lL(),{createFeatureToggle:S,loading:C}=yu();return s(Nr,{loading:C,title:"Create feature toggle",description:`Feature toggles support different use cases, each with their own specific needs such as simple static routing or more complex routing.
|
|
@@ -370,18 +370,18 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
370
370
|
--data-raw '${JSON.stringify(v(),void 0,2)}'`,children:s(sD,{handleSubmit:async O=>{if(t){O.preventDefault(),w();try{await a(t.id,v()),await c(),i("/segments/"),r({title:"Segment updated",type:"success"})}catch(L){o(ht(L))}}},name:u,setName:d,description:p,setDescription:h,constraints:m,setConstraints:y,errors:b,clearErrors:w,mode:"edit",children:s(Ol,{permission:lC,disabled:!g||R,"data-testid":Fte})})})},awe=()=>{const{uiConfig:e}=Lt(),t=ft();return s(YO,{onClick:()=>t("/environments/create"),maxWidth:"700px",Icon:Si,permission:xi,disabled:!Boolean(e.flags.EEA),children:"New environment"})},swe=(e,t,n)=>{const r=f.useRef(null);return f.useEffect(()=>{if(r.current)return r.current.dataset.index=String(e),lwe(r.current,t,(n==null?void 0:n.current)??void 0)},[e,t]),r},lwe=(e,t,n)=>{const r=p=>{Sh&&t(Number(Sh.dataset.index),Number(e.dataset.index),p)},o=n??e,i=p=>{p.target===o&&(e.draggable=!0)},a=()=>{e.draggable=!1},l=()=>{e.draggable=!0,Sh=e},c=()=>{r(!1)},u=p=>{p.preventDefault()},d=()=>{r(!0),Sh=null};return o.addEventListener("mouseenter",i),o.addEventListener("mouseleave",a),n&&e.addEventListener("mouseenter",a),e.addEventListener("dragstart",l),e.addEventListener("dragenter",c),e.addEventListener("dragover",u),e.addEventListener("drop",d),()=>{o.removeEventListener("mouseenter",i),o.removeEventListener("mouseleave",a),n&&e.removeEventListener("mouseenter",a),e.removeEventListener("dragstart",l),e.removeEventListener("dragenter",c),e.removeEventListener("dragover",u),e.removeEventListener("drop",d)}};let Sh;const cwe=E(sa)(()=>({"&:hover":{".drag-handle .drag-icon":{display:"inherit",cursor:"grab"}}})),uwe=({row:e,moveListItem:t})=>{const{hasAccess:n}=f.useContext(Qr),r=f.useRef(null),{searchQuery:o}=uf(),i=!o&&n(qb),a=swe(e.index,t,r),l=(c,u)=>i&&c.column.isDragHandle?s(ta,{...c.getCellProps(),ref:u,className:"drag-handle",children:c.render("Cell")}):s(ta,{...c.getCellProps(),children:c.render("Cell")});return s(cwe,{hover:!0,ref:i?a:void 0,children:e.cells.map(c=>l(c,r))})},dwe=E(ke)(({theme:e})=>({fontWeight:"bold",fontSize:e.fontSizes.smallerBody})),pwe=E(ke)(({theme:e})=>({fontSize:e.fontSizes.smallerBody})),qP=E(bi)(({theme:e})=>({marginLeft:e.spacing(1)})),fwe=({environment:e})=>{const{searchQuery:t}=uf();return T(fo,{sx:n=>({[n.breakpoints.up("sm")]:{minWidth:"350px"}}),children:[s(Gc,{search:t,children:e.name}),s(X,{condition:e.protected,show:s(qP,{color:"success",children:"Predefined"})}),s(X,{condition:!e.enabled,show:s(EC,{maxWidth:"270px",title:T(Re,{children:[s(dwe,{children:"Deprecated environment"}),s(pwe,{children:"This environment is not auto-enabled for new projects. The project owner will need to manually enable it in the project."})]}),describeChild:!0,arrow:!0,children:s(qP,{color:"neutral",children:"Deprecated"})})})]})},xh=({permission:e,projectId:t,children:n,environmentId:r,tooltip:o,tooltipProps:i})=>{const{hasAccess:a}=f.useContext(Qr);let l;return t&&r?l=a(e,t,r):t?l=a(e,t):l=a(e),s(du,{...i,title:Nv(l,o),children:n({hasAccess:l})})},hwe=E(M4)(({theme:e})=>({padding:e.spacing(1)})),Qh=E(ws)(({theme:e})=>({borderRadius:e.shape.borderRadius})),mwe=E(Qh)(({theme:e})=>({color:e.palette.error.main})),gwe=E(Vh)(({theme:e})=>({color:e.palette.error.main})),vwe=({environment:e,onEdit:t,onDeprecateToggle:n,onClone:r,onDelete:o})=>{Lt();const[i,a]=f.useState(null),l=Boolean(i),c=h=>{a(h.currentTarget)},u=()=>{a(null)},d=`environment-${e.name}-actions`,p=`${d}-menu`;return T(Re,{children:[s(Tt,{title:"Environment actions",arrow:!0,describeChild:!0,children:s(Qt,{id:d,"aria-controls":l?p:void 0,"aria-haspopup":"true","aria-expanded":l?"true":void 0,onClick:c,type:"button",children:s(zC,{})})}),s(Px,{id:p,anchorEl:i,open:l,onClose:u,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},disableScrollLock:!0,children:T(hwe,{"aria-labelledby":d,children:[s(xh,{permission:qb,children:({hasAccess:h})=>T(Qh,{onClick:()=>{t(),u()},disabled:!h||e.protected,children:[s(Vh,{children:s(ea,{})}),s(un,{children:s(ke,{variant:"body2",children:"Edit"})})]})}),s(xh,{permission:xi,children:({hasAccess:h})=>T(Qh,{onClick:()=>{r(),u()},disabled:!h,children:[s(Vh,{children:s(Vee,{})}),s(un,{children:s(ke,{variant:"body2",children:"Clone"})})]})}),s(xh,{permission:qb,children:({hasAccess:h})=>T(Qh,{onClick:()=>{n(),u()},disabled:!h||e.protected,children:[s(Vh,{children:s(X,{condition:e.enabled,show:s(yte,{}),elseShow:s(bte,{})})}),s(un,{children:s(ke,{variant:"body2",children:e.enabled?"Deprecate":"Undeprecate"})})]})}),s(xh,{permission:Eoe,children:({hasAccess:h})=>T(mwe,{onClick:()=>{o(),u()},disabled:!h||e.protected,children:[s(gwe,{children:s(ti,{})}),s(un,{children:s(ke,{variant:"body2",children:"Delete"})})]})})]})})]})},YP=(e,t)=>{var n;return Boolean((n=t==null?void 0:t.toLowerCase())==null?void 0:n.includes(e.toLowerCase()))},ywe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",color:e.palette.text.secondary,"& > span:first-of-type":{color:e.palette.text.primary}})),bwe=E("div")(({theme:e})=>({paddingLeft:e.spacing(1)})),wwe=E("div")(({theme:e})=>({display:"flex",marginBottom:e.spacing(3),"& > div:first-of-type":{width:"100%",maxWidth:e.spacing(50),marginRight:e.spacing(1)}})),Swe=(e,t,n)=>T("li",{...e,children:[s(Ps,{icon:s(Vv,{fontSize:"small"}),checkedIcon:s(Gv,{fontSize:"small"}),style:{marginRight:8},checked:n}),T(ywe,{children:[s("span",{children:t.name}),s("span",{children:t.description})]})]}),xwe=e=>s(bwe,{children:e.length>1?`${e.length} projects selected`:e[0].name}),Cwe=({projects:e,setProjects:t})=>{const{projects:n}=ja(),r=n.sort((c,u)=>c.name.localeCompare(u.name)).map(({id:c,name:u,description:d})=>({id:c,name:u,description:d})),o=r.filter(({id:c})=>e.includes(c)),i=e.length>0&&e.length===r.length,a=()=>{const c=i?[]:r.map(({id:u})=>u);t(c)};return s(wwe,{children:s(pv,{size:"small",multiple:!0,limitTags:1,openOnFocus:!0,disableCloseOnSelect:!0,value:o,onChange:(c,u,d)=>{c.type==="keydown"&&c.key==="Backspace"&&d==="removeOption"||t(u.map(({id:p})=>p))},options:r,renderOption:(c,u,{selected:d})=>Swe(c,u,d),filterOptions:(c,{inputValue:u})=>c.filter(({name:d,description:p})=>YP(u,d)||YP(u,p)),isOptionEqualToValue:(c,u)=>c.id===u.id,getOptionLabel:c=>c.name||c.description||"",renderInput:c=>s(pn,{...c,label:"Projects"}),renderTags:c=>xwe(c),groupBy:()=>"Select/Deselect all",renderGroup:({key:c,children:u})=>T(f.Fragment,{children:[s(X,{condition:r.length>2,show:s(o2,{isAllSelected:i,onClick:a})}),u]},c)})})},ad="*",Ewe=({...e})=>s(Tr,{elevation:8,...e}),kwe=E(Ps)(({theme:e})=>({marginRight:e.spacing(.4)})),Twe=({options:e,defaultValue:t=[ad],onChange:n,disabled:r,error:o,onFocus:i})=>{const[a,l]=f.useState(typeof t=="string"?[t]:t),[c,u]=f.useState(typeof t=="string"||t.includes(ad)),d=a.length>0&&a.length===e.length&&a[0]!==ad,p=(b,w)=>{w?(u(!0),n([ad])):(u(!1),n(a.includes(ad)?[]:a))},h=()=>{const b=d?[]:e.map(({value:w})=>w);l(b),n(b)};return T(Je,{sx:{mt:-1,mb:3},children:[s(Je,{sx:{mt:1,mb:.25,ml:1.5},children:s(xr,{disabled:r,"data-testid":"select-all-projects",control:s(Ps,{checked:r||c,onChange:p}),label:"ALL current and future projects"})}),s(pv,{disabled:r||c,multiple:!0,limitTags:2,options:e,disableCloseOnSelect:!0,getOptionLabel:({label:b})=>b,groupBy:()=>"Select/Deselect all",renderGroup:({key:b,children:w})=>T(f.Fragment,{children:[s(X,{condition:e.length>2,show:s(o2,{isAllSelected:d,onClick:h})}),w]},b),fullWidth:!0,PaperComponent:Ewe,renderOption:(b,w,{selected:g})=>T("li",{...b,children:[s(kwe,{icon:s(Vv,{fontSize:"small"}),checkedIcon:s(Gv,{fontSize:"small"}),checked:g}),w.label]}),renderInput:b=>s(pn,{...b,error:Boolean(o),helperText:o,variant:"outlined",label:"Projects",placeholder:"Select one or more projects",onFocus:i,"data-testid":"select-input"}),value:c||r?e:e.filter(b=>a.includes(b.value)),onChange:(b,w)=>{const g=w.map(({value:S})=>S);l(g),n(g)}})]})},_we=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{deleteToken:async a=>{const l=`api/admin/api-tokens/${a}`,c=t(l,{method:"DELETE"});try{return await e(c.caller,c.id)}catch(u){throw u}},createToken:async a=>{const c=t("api/admin/api-tokens",{method:"POST",body:JSON.stringify(a)});try{return await e(c.caller,c.id)}catch(u){throw u}},errors:n,loading:r}},Rwe=E("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),Ql=E("p")(({theme:e})=>({display:"flex",color:e.palette.text.primary,marginBottom:e.spacing(1),"&:not(:first-of-type)":{marginTop:e.spacing(4)}})),a0=E("p")(({theme:e})=>({color:e.palette.text.secondary,marginBottom:e.spacing(1)})),Pwe=E(_r)(({theme:e})=>({width:"100%",maxWidth:e.spacing(50)})),$we=E("div")(({theme:e})=>({padding:e.spacing(3),backgroundColor:e.palette.secondaryContainer,borderRadius:e.shape.borderRadiusMedium,marginTop:e.spacing(4)})),Iwe=E("div")(({theme:e})=>({padding:e.spacing(0,4),"& > p:not(:first-of-type)":{marginTop:e.spacing(2)}})),Awe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",[e.breakpoints.down("sm")]:{marginTop:e.spacing(4)}})),Owe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),Lwe=({environment:e,open:t,setOpen:n,newToken:r})=>{const{environments:o,refetchEnvironments:i}=pu(),{cloneEnvironment:a,loading:l}=gu(),{createToken:c}=_we(),{projects:u}=ja(),{setToastData:d,setToastApiError:p}=It(),{uiConfig:h}=Lt(),[m,y]=f.useState(`${e.name}_clone`),[v,b]=f.useState("development"),[w,g]=f.useState([]),[S,C]=f.useState(["*"]),[R,k]=f.useState(!0),[P,O]=f.useState("later"),[L,I]=f.useState({}),A=te=>{I(re=>({...re,[te]:void 0}))},M=(te,re)=>{I(we=>({...we,[te]:re}))};f.useEffect(()=>{y(F(e.name)),b("development"),g([]),C(["*"]),k(!0),O("later"),I({})},[e]);const F=te=>{let re=`${te}_clone`,we=2;for(;!z(re);)re=`${e.name}_clone_${we}`,we++;return re},j=()=>({name:m,type:v,projects:w,clonePermissions:R}),q=()=>({username:`${m}_token`,type:"CLIENT",environment:m,projects:S}),G=async te=>{te.preventDefault();try{if(await a(e.name,j()),P==="now"){const we=await(await c(q())).json();r(we)}d({title:"Environment successfully cloned!",type:"success"}),i(),n(!1)}catch(re){p(ht(re))}},Z=()=>`curl --location --request POST '${h.unleashUrl}/api/admin/environments/${e.name}/clone' \\
|
|
371
371
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
372
372
|
--header 'Content-Type: application/json' \\
|
|
373
|
-
--data-raw '${JSON.stringify(j(),void 0,2)}'`,J=te=>te.length,z=te=>!(o!=null&&o.some(re=>re.name===te)),W=J(m)&&z(m)&&S.length,$=te=>{A("name"),z(te)||M("name","An environment with that name already exists."),y(te)},N=u.map(te=>({value:te.id,label:te.name}));return s(c2,{open:t,onClose:()=>{n(!1)},label:`Clone ${e.name} environment`,children:s(Nr,{loading:l,modal:!0,title:`Clone ${e.name} environment`,description:"Cloning an environment will clone all feature toggles and their configuration (activation strategies, segments, status, etc) into a new environment.",documentationLink:"https://docs.getunleash.io/reference/environments#cloning-environments",documentationLinkLabel:"Cloning environments documentation",formatApiCode:Z,children:T(Rwe,{onSubmit:G,children:[T("div",{children:[s(Ql,{children:"What is your new environment name? (Can't be changed later)"}),s(Pwe,{autoFocus:!0,label:"Environment name",error:Boolean(L.name),errorText:L.name,value:m,onChange:te=>$(te.target.value),required:!0}),s(Ql,{children:"What type of environment do you want to create?"}),s(JO,{onChange:te=>b(te.currentTarget.value),value:v}),T(Ql,{children:["Select which projects you want to clone the environment configuration in?",s(Km,{tooltip:"The cloned environment will keep the feature toggle state for the selected projects, where it will be enabled by default."})]}),s(Cwe,{projects:w,setProjects:g}),s(Ql,{children:"Keep the users permission for this environment?"}),s(a0,{children:"If you turn it off, the permission for this environment across all projects and feature toggles will remain only for admin and editor roles."}),s(xr,{label:R?"Yes":"No",control:s(Na,{onChange:te=>k(te.target.checked),checked:R})}),T($we,{children:[s(Ql,{children:"API Token"}),T(a0,{children:["In order to connect your SDKs to your newly cloned environment, you will also need an API token."," ",s(po,{href:"https://docs.getunleash.io/reference/api-tokens-and-client-keys",target:"_blank",children:"Read more about API tokens"}),"."]}),s(Da,{children:T(Ax,{value:P,onChange:te=>O(te.target.value),name:"api-token-generation",children:[s(xr,{value:"later",control:s(ll,{}),label:"I want to generate an API token later"}),s(xr,{value:"now",control:s(ll,{}),label:"Generate an API token now"})]})}),T(Iwe,{children:[s(a0,{children:"A new Server-side SDK (CLIENT) API token will be generated for the cloned environment, so you can get started right away."}),s(X,{condition:P==="now",show:T(Re,{children:[s(Ql,{children:"Which projects do you want this token to give access to?"}),s(Twe,{options:N,defaultValue:S,onChange:C,error:L.projects,onFocus:()=>A("projects")})]})})]})]})]}),T(Awe,{children:[s(rt,{type:"submit",variant:"contained",color:"primary",disabled:!W,children:"Clone environment"}),s(Owe,{onClick:()=>{n(!1)},children:"Cancel"})]})]})})})};var L2={},Dwe=fn;Object.defineProperty(L2,"__esModule",{value:!0});var cD=L2.default=void 0,Nwe=Dwe(En()),Mwe=kn,Bwe=(0,Nwe.default)((0,Mwe.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");cD=L2.default=Bwe;const uD=({token:e})=>{const{setToastData:t}=It();return T("div",{style:{backgroundColor:"#efefef",padding:"2rem",borderRadius:"3px",margin:"0",marginTop:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",wordBreak:"break-all"},children:[e,s(Tt,{title:"Copy token",arrow:!0,children:s(Qt,{onClick:()=>{eL(e)?t({type:"success",title:"Token copied to clipboard"}):t({type:"error",title:"Could not copy token"})},size:"large",children:s(cD,{})})})]})},Fwe=({open:e,setOpen:t,token:n})=>T(cr,{open:e,secondaryButtonText:"Close",onClose:(r,o)=>{o||t(!1)},title:"New API token created",children:[s(ke,{variant:"body1",children:"Your new token has been created successfully."}),T(ke,{variant:"body1",children:['You can also find it as "',s("strong",{children:n==null?void 0:n.username}),'" in the'," ",s(on,{to:"/admin/api",children:"API access page"}),"."]}),s(uD,{token:(n==null?void 0:n.secret)||""})]}),zwe=E(Je)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",paddingLeft:e.spacing(.5),minWidth:e.spacing(6.5)})),jwe=E(Qt)(({theme:e})=>({padding:e.spacing(1.5,0),cursor:"inherit",transition:"color 0.2s ease-in-out",display:"none",color:e.palette.neutral.main})),Uwe=E(a3,{shouldForwardProp:e=>e!=="deprecated"})(({theme:e,deprecated:t})=>({color:t?e.palette.neutral.border:e.palette.primary.main})),dD=({environment:e})=>T(zwe,{children:[s(jwe,{size:"large",disableRipple:!0,className:"drag-icon",children:s(ete,{titleAccess:"Drag to reorder"})}),s(Uwe,{deprecated:!e.enabled})]}),Wwe=E(za)(({theme:e})=>({marginTop:e.spacing(3)})),Hwe=E("p",{shouldForwardProp:e=>e!=="warning"})(({theme:e,warning:t})=>({color:t?e.palette.error.dark:e.palette.text.primary})),pD=({environment:e,warnEnabledToggles:t})=>{const n=f.useMemo(()=>[{id:"Icon",width:"1%",Cell:({row:{original:c}})=>s(dD,{environment:c})},{Header:"Name",accessor:"name",Cell:fo},{Header:"Type",accessor:"type",Cell:fo},{Header:"Visible in",accessor:c=>c.projectCount===1?"1 project":`${c.projectCount} projects`,Cell:({row:{original:c},value:u})=>T(fo,{children:[u,s(X,{condition:Boolean(t),show:s(Hwe,{warning:Boolean(c.enabledToggleCount&&c.enabledToggleCount>0),children:c.enabledToggleCount===1?"1 toggle enabled":`${c.enabledToggleCount} toggles enabled`})})]})}],[t]),{getTableProps:r,getTableBodyProps:o,headerGroups:i,rows:a,prepareRow:l}=tn.useTable({columns:n,data:[e],disableSortBy:!0});return T(Wwe,{...r(),rowHeight:"compact",children:[s(Fa,{headerGroups:i}),s(Ma,{...o(),children:a.map(c=>(l(c),s(sa,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>s(ta,{...u.getCellProps(),children:u.render("Cell")}))})))})]})},Vwe=({environment:e,open:t,setOpen:n,onConfirm:r})=>{const{enabled:o}=e,i=o?"Deprecate":"Undeprecate";return T(cr,{title:`${i} environment?`,open:t,primaryButtonText:i,secondaryButtonText:"Close",onClick:r,onClose:()=>{n(!1)},children:[s(X,{condition:o,show:s(Xt,{severity:"info",children:"Deprecating an environment will mark it as deprecated. Deprecated environments are set as not visible by default for new projects. Project owners are still able to override this setting in the project. This environment will still be visible in any current projects."}),elseShow:s(Xt,{severity:"info",children:"Undeprecating an environment will no longer mark it as deprecated. An undeprecated environment will be set as visible by default for new projects."})}),s(pD,{environment:e})]})},Gwe=E("p")(({theme:e})=>({marginTop:e.spacing(3),marginBottom:e.spacing(1.5)})),qwe=E(_r)(()=>({width:"100%"})),Ywe=({environment:e,open:t,setOpen:n,onConfirm:r})=>{const[o,i]=f.useState("");return f.useEffect(()=>{i("")},[t]),T(cr,{title:"Delete environment?",open:t,primaryButtonText:"Delete environment",disabledPrimaryButton:e.name!==o,secondaryButtonText:"Close",onClick:r,onClose:()=>{n(!1)},children:[T(Xt,{severity:"error",children:[s("strong",{children:"Danger! This action is not reversible. Please proceed with caution."})," ","Deleting this environment will result in removing all strategies that are active in this environment across all feature toggles."]}),s(pD,{environment:e,warnEnabledToggles:!0}),T(Gwe,{children:["In order to delete this environment, please enter the id of the environment in the textfield below:"," ",s("strong",{children:e.name})]}),s(qwe,{label:"Environment name",value:o,onChange:a=>i(a.target.value)})]})},Kwe=({environment:e})=>{const t=ft(),{setToastApiError:n,setToastData:r}=It(),{environments:o,refetchEnvironments:i}=pu(),{refetch:a}=UC(),{deleteEnvironment:l,toggleEnvironmentOn:c,toggleEnvironmentOff:u}=gu(),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[y,v]=f.useState(!1),[b,w]=f.useState(!1),[g,S]=f.useState();return T(na,{children:[s(vwe,{environment:e,onEdit:()=>t(`/environments/${e.name}`),onDeprecateToggle:()=>m(!0),onClone:()=>{o.length<Jm?v(!0):r({type:"error",title:"Environment limit reached",text:`You have reached the maximum number of environments (${Jm}). Please reach out if you need more.`})},onDelete:()=>p(!0)}),s(Ywe,{environment:e,open:d,setOpen:p,onConfirm:async()=>{try{await l(e.name),a(),r({type:"success",title:"Environment deleted",text:`You have successfully deleted the ${e.name} environment.`})}catch(k){n(ht(k))}finally{p(!1),await i()}}}),s(Vwe,{environment:e,open:h,setOpen:m,onConfirm:async()=>{try{e.enabled?(await u(e.name),r({type:"success",title:"Environment deprecated successfully"})):(await c(e.name),r({type:"success",title:"Environment undeprecated successfully"}))}catch(k){n(ht(k))}finally{m(!1),await i()}}}),s(Lwe,{environment:e,open:y,setOpen:v,newToken:k=>{S(k),w(!0)}}),s(Fwe,{open:b,setOpen:w,token:g})]})},Xwe=E(Je)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",wordBreak:"break-word",padding:e.spacing(1,2)})),Jwe=E("span")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"1",lineClamp:"1"})),Qwe=E("span")(({theme:e})=>({color:e.palette.text.secondary,overflow:"hidden",textOverflow:"ellipsis",fontSize:"inherit",WebkitLineClamp:"1",lineClamp:"1",display:"-webkit-box",WebkitBoxOrient:"vertical"})),mf=({value:e,subtitle:t})=>{const{searchQuery:n}=uf();return T(Xwe,{children:[s(Jwe,{style:{WebkitLineClamp:Boolean(t)?1:2,lineClamp:Boolean(t)?1:2},"data-loading":!0,children:s(Gc,{search:n,children:e})}),s(X,{condition:Boolean(t),show:()=>s(Qwe,{"data-loading":!0,children:s(Gc,{search:n,children:t})})})]})},Zwe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(4)})),eSe=()=>{const{changeSortOrder:e}=gu(),{setToastApiError:t}=It(),{environments:n,mutateEnvironments:r}=pu(),o=f.useCallback(async(b,w,g=!1)=>{const S=[...n],C=S[b];if(S.splice(b,1),S.splice(w,0,C),await r(S),g)try{await e(Dpe(S))}catch(R){t(ht(R))}},[e,n,r,t]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d},setGlobalFilter:p}=tn.useTable({columns:tSe,data:n,disableSortBy:!0},tn.useGlobalFilter),m=T(Re,{children:[s(go,{initialValue:d,onChange:p}),s(xn.Divider,{}),s(awe,{})]});let y=c.length;const v=s(xn,{title:`Environments (${y})`,actions:m});return T(gr,{header:v,children:[s(Zwe,{severity:"info",children:"This is the order of environments that you have today in each feature toggle. Rearranging them here will change also the order inside each feature toggle."}),s(As,{value:d,children:T(za,{...i(),rowHeight:"compact",children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(b=>(u(b),s(uwe,{row:b,moveListItem:o},b.original.name)))})]})}),s(X,{condition:c.length===0,show:s(X,{condition:(d==null?void 0:d.length)>0,show:T(Zn,{children:["No environments found matching “",d,"”"]}),elseShow:s(Zn,{children:"No environments available. Get started by adding one."})})})]})},tSe=[{id:"Icon",width:"1%",Cell:({row:{original:e}})=>s(dD,{environment:e}),disableGlobalFilter:!0,isDragHandle:!0},{Header:"Name",accessor:"name",Cell:({row:{original:e}})=>s(fwe,{environment:e}),minWidth:350},{Header:"Type",accessor:"type",Cell:mf},{Header:"Visible in",accessor:e=>e.projectCount===1?"1 project":`${e.projectCount} projects`,Cell:fo},{Header:"API Tokens",accessor:e=>e.apiTokenCount===1?"1 token":`${e.apiTokenCount} tokens`,Cell:fo},{Header:"Actions",id:"Actions",align:"center",width:"1%",Cell:({row:{original:e}})=>s(Kwe,{environment:e}),disableGlobalFilter:!0}],nSe=()=>{const e=ft();return s(Io,{onClick:()=>e("/segments/create"),permission:Av,"data-testid":$te,children:"New segment"})},rSe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:e.spacing(6),marginLeft:"auto",marginRight:"auto"})),oSe=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(2.5)})),iSe=E("p")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary,maxWidth:515,marginBottom:e.spacing(2.5),textAlign:"center"})),aSe=E(on)(({theme:e})=>({textDecoration:"none",color:e.palette.primary.main,fontWeight:e.fontWeight.bold})),sSe=()=>{const{hasAccess:e}=f.useContext(Qr);return T(rSe,{children:[s(oSe,{children:"No segments yet!"}),s(iSe,{children:"Segment makes it easy for you to define who should be exposed to your feature. The segment is often a collection of constraints and can be reused."}),s(X,{condition:e(Av),show:s(aSe,{to:"/segments/create",children:"Create your first segment"})})]})},lSe=e=>{const t=Ft(`api/admin/segments/${e}/strategies`),{data:n,error:r}=gn(t,()=>cSe(t)),o=f.useCallback(()=>{Vr(t).catch(console.warn)},[t]);return{strategies:n==null?void 0:n.strategies,refetchUsedSegments:o,loading:!r&&!n,error:r}},cSe=e=>fetch(e,{method:"GET"}).then(Cn("Strategies by segment")).then(t=>t.json()),uSe=E(_r)(({theme:e})=>({marginTop:e.spacing(2)})),dSe=({segment:e,open:t,onClose:n,onRemove:r})=>{const[o,i]=f.useState(""),a=u=>i(u.currentTarget.value),l=()=>{n(),i("")},c="delete-segment-confirmation-form";return T(cr,{title:"Are you sure you want to delete this segment?",open:t,primaryButtonText:"Delete segment",secondaryButtonText:"Cancel",onClick:()=>{r(),i("")},disabledPrimaryButton:(e==null?void 0:e.name)!==o,onClose:l,formId:c,children:[T("p",{children:["In order to delete this segment, please enter the name of the segment in the field below: ",s("strong",{children:e==null?void 0:e.name})]}),s("form",{id:c,children:s(uSe,{autoFocus:!0,onChange:a,value:o,label:"Segment name","data-testid":jte})})]})},pSe=({strategyDefinition:e})=>s("p",{children:e==null?void 0:e.description}),fSe=Kx(xQ,e=>({root:{height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor"},active:{},valueLabel:{},track:{height:8,borderRadius:e.shape.borderRadius},rail:{height:8,borderRadius:e.shape.borderRadius}})),hSe=ai()(e=>({slider:{width:"100%",maxWidth:"100%"},margin:{height:e.spacing(3)}})),mSe=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}],fD=({name:e,value:t,onChange:n,disabled:r=!1})=>{const{classes:o}=hSe(),i=a=>`${a}%`;return T("div",{className:o.slider,children:[s(ke,{id:"discrete-slider-always",variant:"h3",gutterBottom:!0,component:"h3",children:e}),s(fSe,{min:0,max:100,value:t,getAriaValueText:i,"aria-labelledby":"discrete-slider-always",step:1,"data-testid":Vte,marks:mSe,onChange:n,valueLabelDisplay:"on",disabled:r})]})},hD=({name:e,value:t="",label:n="",options:r,onChange:o,id:i,disabled:a=!1,className:l,classes:c,...u})=>T(Da,{variant:"outlined",size:"small",classes:c,children:[s(Zp,{htmlFor:i,children:n}),s(ef,{name:e,disabled:a,onChange:o,className:l,label:n,id:i,value:t,...u,children:(()=>r.map(p=>s(ws,{value:p.key,title:p.title||"","data-testid":`${w3}-${p.label}`,children:p.label},p.key)))()})]}),KP=[{key:"default",label:"default"},{key:"userId",label:"userId"},{key:"sessionId",label:"sessionId"},{key:"random",label:"random"}],gSe=({updateParameter:e,parameters:t,context:n,editable:r=!0})=>{const o=u=>d=>{e(u,d)},i=(u,d)=>{e("rollout",d.toString())},l=(()=>KP.concat(n.filter(u=>u.stickiness).filter(u=>!KP.find(d=>d.key===u.name)).map(u=>({key:u.name,label:u.name}))))(),c=t.rollout!==void 0?Ud(t.rollout):100;return T("div",{children:[s(fD,{name:"Rollout",value:c,disabled:!r,onChange:i}),s("br",{}),T("div",{children:[T(ke,{variant:"subtitle2",style:{marginBottom:"1rem",display:"flex",gap:"1ch"},component:"h2",children:["Stickiness",s(Km,{tooltip:"Stickiness defines what parameter should be used to ensure that your users get consistency in features. By default unleash will use the first value present in the context in the order of userId, sessionId and random."})]}),s(hD,{id:"stickiness-select",name:"stickiness",label:"Stickiness",options:l,value:fs(t.stickiness),disabled:!r,"data-testid":qte,onChange:u=>o("stickiness")(u.target.value)})," ",s("br",{}),s("br",{}),T(ke,{variant:"subtitle2",style:{marginBottom:"1rem",display:"flex",gap:"1ch"},component:"h2",children:["GroupId",s(Km,{tooltip:"GroupId is used to ensure that different toggles will hash differently for the same user. The groupId defaults to feature toggle name, but you can override it to correlate rollout of multiple feature toggles."})]}),s(_r,{label:"groupId",id:"groupId-input",value:fs(t.groupId),disabled:!r,onChange:u=>o("groupId")(u.target.value),"data-testid":Yte})]})]})},vSe=E("div")(({theme:e})=>({display:"grid",gap:e.spacing(1)})),ySe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(1),flexWrap:"wrap"})),bSe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(1),alignItems:"start"})),mD=({name:e,list:t,setConfig:n,disabled:r,errors:o})=>{const[i,a]=f.useState(""),l="Enter",c=m=>{d(m)},u=m=>{(m==null?void 0:m.key)===l&&(d(m),m.preventDefault(),m.stopPropagation())},d=m=>{m.preventDefault();const y=m.target.value;if(y){const v=y.split(/,\s*/).filter(b=>!t.includes(b));if(v.length>0){const b=t.concat(v).filter(w=>w);n(e,b.join(","))}a("")}},p=m=>{t[m]=null,n(e,t.length===1?"":t.filter(Boolean).join(","))},h=m=>{a(m.currentTarget.value)};return T(vSe,{children:[T(ke,{variant:"subtitle2",component:"h2",children:["List of ",e]}),s(X,{condition:t.length>0,show:s(ySe,{children:t.map((m,y)=>s(wo,{label:s(Li,{maxWidth:"300",text:m,maxLength:50}),onDelete:r?void 0:()=>p(y),title:"Remove value"},y+m))})}),s(X,{condition:!r,show:T(bSe,{children:[s(pn,{error:Boolean(o.getFormError(e)),helperText:o.getFormError(e),name:"input_field",variant:"outlined",label:"Add items",id:"input-add-items",value:i,size:"small",placeholder:"",onBlur:c,onChange:h,onKeyDown:u,"data-testid":Kte}),s(rt,{onClick:d,"data-testid":Xte,variant:"outlined",color:"secondary",startIcon:s(Si,{}),children:"Add"})]})})]})},wSe=({editable:e,parameters:t,updateParameter:n,errors:r})=>s("div",{children:s(mD,{name:"userIds",list:rs(t.userIds),disabled:!e,setConfig:n,errors:r})}),sd=({text:e})=>e?s(Je,{sx:t=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallerBody,marginTop:t.spacing(1)}),children:e}):null,SSe=({definition:e,parameters:t,updateParameter:n,editable:r,errors:o})=>{const{type:i,name:a,description:l,required:c}=e,u=t[a],d=o.getFormError(a),p=c?`${a} * `:a,h=w=>{n(a,w.target.value)},m=w=>{n(a,fs(w.target.value))},y=(w,g)=>{n(a,g.toString())},v=(w,g)=>{n(a,String(g))},b=(w,g)=>{n(w,rs(g).join(","))};if(i==="percentage")return T("div",{children:[s(fD,{name:a,onChange:y,disabled:!r,value:Ud(t[a]),minLabel:"off",maxLabel:"on"}),s(sd,{text:l})]});if(i==="list")return T("div",{children:[s(mD,{name:a,list:rs(t[a]),disabled:!r,setConfig:b,errors:o}),s(sd,{text:l})]});if(i==="number")return T("div",{children:[s(pn,{error:Boolean(d),helperText:d,variant:"outlined",size:"small","aria-required":c,style:{width:"100%"},disabled:!r,label:p,onChange:h,value:u}),s(sd,{text:l})]});if(i==="boolean"){const g=fs(t[a])==="true";return T("div",{children:[s(xr,{label:a,control:s(Na,{name:a,onChange:v,checked:g})}),s(sd,{text:l})]})}return T("div",{children:[s(pn,{rows:1,placeholder:"",variant:"outlined",size:"small",style:{width:"100%"},"aria-required":c,disabled:!r,error:Boolean(d),helperText:d,name:a,label:p,onChange:m,value:fs(t[a])}),s(sd,{text:l})]})},xSe=Dr("div")(({theme:e})=>({display:"grid",gap:e.spacing(4)})),CSe=({parameters:e,strategyDefinition:t,updateParameter:n,editable:r,errors:o})=>!t||t.parameters.length===0?null:s(xSe,{children:t.parameters.map((i,a)=>s("div",{children:s(SSe,{definition:i,parameters:e,updateParameter:n,editable:r,errors:o})},a))}),ESe=({hasAccess:e,strategy:t,strategyDefinition:n,setStrategy:r,validateParameter:o,errors:i})=>{const{context:a}=Ll(),l=(c,u)=>{r(Ho(d=>{d.parameters=d.parameters??{},d.parameters[c]=u})),o(c,u)};switch(t.name){case"default":return s(pSe,{strategyDefinition:n});case"flexibleRollout":return s(gSe,{context:a,parameters:t.parameters??{},updateParameter:l,editable:e});case"userWithId":return s(wSe,{parameters:t.parameters??{},updateParameter:l,editable:e,errors:i});default:return s(CSe,{strategyDefinition:n,parameters:t.parameters??{},updateParameter:l,editable:e,errors:i})}},kSe=({projectId:e,featureId:t,environmentId:n,children:r})=>{const o=N2(e,t),{feature:i}=xl(e,t),a=s(on,{to:o,style:{color:"inherit"},children:"feature toggle page"});return s(X,{condition:TSe(i,n),show:r,elseShow:T(Xt,{severity:"warning",children:["This feature toggle is currently disabled in the"," ",s("strong",{children:n})," environment. Any changes made here will not take effect until the toggle has been enabled on the ",a,"."]})})},TSe=(e,t)=>{const n=e.environments.find(r=>r.name===t);return n?n.enabled:!1},_Se=({projectId:e,environmentId:t,strategy:n,setStrategy:r})=>{const o=f.useMemo(()=>n.constraints??[],[n]),i=c=>{r(u=>({...u,constraints:c instanceof Function?c(o):c}))},a=qc(G3,e,t),l=qc(sC,e,t);return s(ny,{constraints:o,setConstraints:l?i:void 0,showCreateButton:a})},RSe=E("span")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(.5),paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingBlockStart:e.spacing(.5),paddingBlockEnd:e.spacing(.5),borderRadius:"100rem",background:e.palette.featureStrategySegmentChipBackground,color:e.palette.text.tertiaryContrast})),XP=E("button")(({theme:e})=>({all:"unset",height:e.spacing(2),cursor:"pointer"})),PSe=E(on)(({theme:e})=>({marginRight:e.spacing(1),color:"inherit",textDecoration:"none"})),s0=e=>({fontSize:e.fontSizes.bodySize}),$Se=({segment:e,setSegments:t,preview:n,setPreview:r})=>{const o=()=>{t(c=>c.filter(u=>u.id!==e.id)),r(c=>c===e?void 0:c)},i=()=>{r(c=>c===e?void 0:e)},a=s(X,{condition:e===n,show:s(d3,{titleAccess:"Hide",sx:s0}),elseShow:s(u3,{titleAccess:"Show",sx:s0})}),l=e===n?"Hide segment constraints":"Preview segment constraints";return T(RSe,{children:[s(PSe,{to:`/segments/edit/${e.id}`,target:"_blank",children:e.name}),s(Tt,{title:l,arrow:!0,children:s(XP,{type:"button",onClick:i,"aria-expanded":e===n,"aria-controls":rD,children:a})}),s(Tt,{title:"Remove segment",arrow:!0,children:s(XP,{type:"button",onClick:o,children:s(Qee,{titleAccess:"Remove",sx:s0})})})]})},ISe=E(wx)(({theme:e})=>({border:`1px solid ${e.palette.dividerAlternative}`,borderRadius:e.shape.borderRadiusMedium,backgroundColor:e.palette.background.paper,boxShadow:"none",margin:0,transition:"all 0.1s ease","&:before":{opacity:"0 !important"},"&.Mui-expanded":{backgroundColor:e.palette.neutral.light}})),ASe=E(xx)(({theme:e})=>({margin:e.spacing(0,.5),fontSize:e.typography.body2.fontSize,".MuiAccordionSummary-content":{display:"flex",alignItems:"center"}})),OSe=E(on)(({theme:e})=>({textDecoration:"none",marginLeft:e.spacing(1),"&:hover":{textDecoration:"underline"}})),gD=({segment:e,isExpanded:t,headerContent:n,constraintList:r})=>{var a;const[o,i]=f.useState(t||!1);return T(ISe,{expanded:o,children:[T(ASe,{id:`segment-accordion-${e.id}`,children:[s(s3,{color:"secondary",sx:{mr:1}}),s("span",{children:"Segment:"}),s(OSe,{to:`/segments/edit/${e.id}`,children:e.name}),s(X,{condition:Boolean(n),show:n}),s(X,{condition:!t,show:s(rt,{size:"small",variant:"outlined",onClick:()=>i(l=>!l),sx:{my:0,ml:"auto",fontSize:l=>l.typography.body2.fontSize},children:o?"Close preview":"Preview"})})]}),s(Sx,{sx:{pt:0},children:s(X,{condition:Boolean(r),show:r,elseShow:s(X,{condition:(((a=e==null?void 0:e.constraints)==null?void 0:a.length)||0)>0,show:s(ny,{constraints:e.constraints,showLabel:!1}),elseShow:s(ke,{children:"This segment has no constraints."})})})})]})},LSe=E("div")(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing(1)})),DSe=E("p")(({theme:e})=>({color:e.palette.text.secondary})),NSe=E("p")(({theme:e})=>({fontSize:e.fontSizes.smallerBody,padding:e.spacing(.75,1),display:"block",marginTop:"auto",marginBottom:"auto",alignItems:"center",borderRadius:e.shape.borderRadius,lineHeight:1,color:e.palette.text.primary,backgroundColor:e.palette.secondaryContainer})),MSe=({segments:e,setSegments:t})=>{const[n,r]=f.useState(),o=e.length-1;return e.length===0?null:T(Re,{children:[s(X,{condition:e&&e.length>0,show:s(DSe,{children:"Selected Segments"})}),s(LSe,{children:e.map((i,a)=>T(f.Fragment,{children:[s($Se,{segment:i,setSegments:t,preview:n,setPreview:r}),s(X,{condition:a<o,show:s(NSe,{children:"AND"})})]},i.id))}),s(X,{condition:Boolean(n),show:()=>s(gD,{segment:n,isExpanded:!0})})]})},BSe=E(uo)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),FSe=({segments:e,setSegments:t})=>{const{segments:n}=Dl(),{strategySegmentsLimit:r}=Nl(),o=Boolean(r&&e.length>=r);if(!n||n.length===0)return null;const a=n.filter(c=>!e.find(u=>u.id===c.id)).map(c=>({value:String(c.id),label:c.name}));return T(Re,{children:[s(ke,{component:"h3",sx:{m:0},variant:"h3",children:"Segmentation"}),o&&s(Nbe,{}),s("p",{children:"Add a predefined segment to constrain this feature toggle:"}),s(oD,{label:"Select segments",options:a,onChange:([c])=>{const u=n.find(d=>String(d.id)===c.value);u&&t(d=>[...d,u])},disabled:o}),s(MSe,{segments:e,setSegments:t}),s(BSe,{})]})},zSe=(e,t)=>{const{type:n,required:r}=e;if(!(n!=="string"&&n!=="list"&&n!=="number")){if(r&&(typeof t>"u"||t===""))return"Field is required";if(n==="number"&&!jSe(t))return"Not a valid number."}},jSe=e=>typeof e>"u"||e===""||/^\d+$/.test(String(e)),USe=({environment:e})=>T(Xt,{severity:"info",children:[s("strong",{children:"Change requests"})," are enabled",e?` for ${e}`:"",". Your changes needs to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]}),WSe="production",HSe=({open:e,onClose:t,onClick:n,label:r,loading:o})=>{const[i,a]=vD(),l=()=>{a(c=>({hide:!c.hide}))};return T(cr,{title:"Changing production environment!",primaryButtonText:r,disabledPrimaryButton:o,secondaryButtonText:"Cancel",onClick:n,onClose:t,open:e,children:[s(Xt,{severity:"error",children:"WARNING. You are about to make changes to a production environment. These changes will affect your customers."}),s("p",{style:{marginTop:"1rem"},children:"Are you sure you want to proceed?"}),s(xr,{label:"Don't show again",control:s(Ps,{checked:i.hide,onChange:l})})]})},VSe=(e,t)=>{const[n]=vD(),r=e.environments.find(o=>o.name===t);return n.hide?!1:(r==null?void 0:r.type)===WSe},GSe="useFeatureStrategyProdGuardSettings:v2",vD=pC(GSe,{hide:!1}),qSe=e=>({changeRequestInReviewOrApproved:n=>e?e.some(r=>r.environment===n&&yn(["In review","Approved"],r.state)):!1,alert:s(Xt,{sx:{margin:"1rem 0"},severity:"warning",children:"You currently have a change request in review for this environment. Adding a new change will add the change to the existing change request, and all existing approvals will be reset. Are you sure you want to continue?"})}),YSe=(e,t,n,r={})=>{const{isEnterprise:o}=Lt();return kC(o(),e,t,n,r)},KSe=e=>fetch(e).then(Cn("ChangeRequest")).then(t=>t.json()),ry=e=>{const{data:t,error:n,mutate:r}=YSe([],Ft(`api/admin/projects/${e}/change-requests/pending`),KSe);return{data:t,loading:!n&&!t,refetch:r,error:n}},XSe=E("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),l0=E("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.tertiary.light})),JSe=E("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),QSe=({projectId:e,feature:t,environmentId:n,permission:r,onSubmit:o,loading:i,strategy:a,setStrategy:l,segments:c,setSegments:u,errors:d,isChangeRequest:p})=>{const[h,m]=f.useState(!1),y=l2(a.constraints),v=VSe(t,n),b=qc(r,e,n),{strategyDefinition:w}=i2(a==null?void 0:a.name),{data:g}=ry(t.project),{changeRequestInReviewOrApproved:S,alert:C}=qSe(g),R=S(n||""),k=R?"Add to existing change request":"Add change to draft",P=ft(),{uiConfig:O,error:L,loading:I}=Lt();if(L)throw L;if(I||!w)return null;const A=G=>w.parameters.find(Z=>Z.name===G),M=(G,Z)=>{const J=zSe(A(G),Z);return J?(d.setFormError(G,J),!1):(d.removeFormError(G),!0)},F=()=>w.parameters.map(G=>G.name).map(G=>{var Z;return M(G,(Z=a.parameters)==null?void 0:Z[G])}).every(Boolean),j=()=>{P(N2(t.project,t.name))};return T(XSe,{onSubmit:async G=>{G.preventDefault(),F()&&(v&&!p?m(!0):o())},children:[s(X,{condition:R,show:C,elseShow:s(X,{condition:Boolean(p),show:s(USe,{environment:n})})}),s(kSe,{projectId:t.project,featureId:t.name,environmentId:n,children:s(X,{condition:Boolean(p),show:T(Xt,{severity:"success",children:["This feature toggle is currently enabled in the"," ",s("strong",{children:n})," environment. Any changes made here will be available to users as soon as these changes are approved and applied."]}),elseShow:T(Xt,{severity:"success",children:["This feature toggle is currently enabled in the"," ",s("strong",{children:n})," environment. Any changes made here will be available to users as soon as you hit ",s("strong",{children:"save"}),"."]})})}),s(l0,{}),s(X,{condition:Boolean(O.flags.SE),show:s(FSe,{segments:c,setSegments:u})}),s(_Se,{projectId:t.project,environmentId:n,strategy:a,setStrategy:l}),s(l0,{}),s(ESe,{strategy:a,strategyDefinition:w,setStrategy:l,validateParameter:M,errors:d,hasAccess:b}),s(l0,{}),T(JSe,{children:[s(Io,{permission:r,projectId:t.project,environmentId:n,variant:"contained",color:"primary",type:"submit",disabled:i||!y||d.hasFormErrors(),"data-testid":Jte,children:p?k:"Save strategy"}),s(rt,{type:"button",color:"secondary",onClick:j,disabled:i,children:"Cancel"}),s(HSe,{open:h,onClose:()=>m(!1),onClick:o,loading:i,label:"Save strategy"})]})]})},JP=e=>{const t=new URLSearchParams(window.location.search).get(e);if(!t)throw new Error(`Missing required query param: ${e}`);return t},ZSe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{addStrategyToFeature:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies`,m=t(h,{method:"POST",body:JSON.stringify(p)},"addStrategyToFeature");return(await e(m.caller,m.id)).json()},updateStrategyOnFeature:async(c,u,d,p,h)=>{const m=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/${p}`,y=t(m,{method:"PUT",body:JSON.stringify(h)},"updateStrategyOnFeature");await e(y.caller,y.id)},deleteStrategyFromFeature:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/${p}`,m=t(h,{method:"DELETE"},"deleteStrategyFromFeature");await e(m.caller,m.id)},setStrategiesSortOrder:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/set-sort-order`,m=t(h,{method:"POST",body:JSON.stringify(p)},"setStrategiesSortOrderOnFeature");await e(m.caller,m.id)},loading:r,errors:n}},exe=()=>{const[e,t]=f.useState({}),n=f.useCallback(a=>e[a],[e]),r=f.useCallback((a,l)=>{t(Ho(c=>{c[a]=l}))},[t]),o=f.useCallback(a=>{t(Ho(l=>{delete l[a]}))},[t]),i=f.useCallback(()=>Object.values(e).some(Boolean),[e]);return{getFormError:n,setFormError:r,removeFormError:o,hasFormErrors:i}},txe=(e,t)=>{const n=t.parameters.map(r=>r.name);return Object.fromEntries(Object.entries(e).sort((r,o)=>n.indexOf(r[0])-n.indexOf(o[0])))};var QP=Object.prototype.hasOwnProperty;function ZP(e,t,n){for(n of e.keys())if(Wd(n,t))return n}function Wd(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Wd(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(o=r,o&&typeof o=="object"&&(o=ZP(t,o),!o)||!t.has(o))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(o=r[0],o&&typeof o=="object"&&(o=ZP(t,o),!o)||!Wd(r[1],t.get(o)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(QP.call(e,n)&&++r&&!QP.call(t,n)||!(n in t)||!Wd(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const nxe=({refresh:e,show:t,afterSubmitAction:n,data:r,cache:o})=>{const i=sn(),a=Er(i.breakpoints.down("sm")),l=f.useMemo(()=>{const c={...R3,padding:`${i.spacing(3)} ${i.spacing(4)}`,boxShadow:i.boxShadows.elevated,borderRadius:i.shape.borderRadiusLarge,backgroundColor:i.palette.background.paper,maxWidth:i.spacing(75),zIndex:i.zIndex.mobileStepper};return a?{...c,right:0,left:0,bottom:0,borderRadius:0}:c},[i,a]);return T(qx,{mounted:t,start:l,enter:P3,children:[s(ke,{variant:"h5",sx:{my:2,mb:2},children:"Your data is stale"}),s(ke,{variant:"body1",sx:{my:2,mb:3},children:"The data you have been working on is stale, would you like to refresh your data? This may happen if someone has been making changes to the data while you were working."}),s(qv,{entry:{preData:o,data:r}}),s(rt,{sx:{mb:2},variant:"contained",color:"primary",onClick:()=>{e(),n()},children:"Refresh data"})]})},rxe=({unleashGetter:e,dataKey:t="",refetchFunctionKey:n="",options:r={},params:o=[""]})=>{const i=e(...o,{refreshInterval:5,...r});return{data:i[t],refetch:i[n]}},oxe=(e,t,n,r)=>{const{data:o,refetch:i}=rxe(e),[a,l]=f.useState(t||null),[c,u]=f.useState(!1),d=h=>{u(!1),l(h)},p=h=>h&&(r&&typeof r=="function"?r(h):h);return f.useEffect(()=>{a===null&&l(t)},[t]),f.useEffect(()=>{if(!a||!o)return;Wd(p(a),p(o))||u(!0)},[o]),{data:a,refetch:i,staleDataNotification:s(nxe,{cache:p(a),data:p(o),refresh:()=>d(o),show:c,afterSubmitAction:n.afterSubmitAction}),forceRefreshCache:d}},ixe=e=>{const t={...e};return delete t.lastSeenAt,t},D2=()=>{const{trackEvent:e}=Is(),{makeRequest:t,createRequest:n,errors:r,loading:o}=Un({propagateErrors:!0});return{addChange:async(p,h,m)=>{e("change_request",{props:{eventType:"change added"}});const y=`api/admin/projects/${p}/environments/${h}/change-requests`,v=n(y,{method:"POST",body:JSON.stringify(m)});try{return(await t(v.caller,v.id)).json()}catch(b){throw b}},changeState:async(p,h,m)=>{e("change_request",{props:{eventType:m.state}});const y=`api/admin/projects/${p}/change-requests/${h}/state`,v=n(y,{method:"PUT",body:JSON.stringify(m)});try{return(await t(v.caller,v.id)).json()}catch(b){throw b}},discardChange:async(p,h,m)=>{const y=`api/admin/projects/${p}/change-requests/${h}/changes/${m}`,v=n(y,{method:"DELETE"});try{return await t(v.caller,v.id)}catch(b){throw b}},updateChangeRequestEnvironmentConfig:async({project:p,enabled:h,environment:m,requiredApprovals:y})=>{const v=`api/admin/projects/${p}/environments/${m}/change-requests/config`,b=n(v,{method:"PUT",body:JSON.stringify({changeRequestsEnabled:h,requiredApprovals:y})});try{return await t(b.caller,b.id)}catch(w){throw w}},discardDraft:async(p,h)=>{const m=`api/admin/projects/${p}/change-requests/${h}`,y=n(m,{method:"DELETE"});try{return await t(y.caller,y.id)}catch(v){throw v}},addComment:async(p,h,m)=>{e("change_request",{props:{eventType:"comment added"}});const y=`/api/admin/projects/${p}/change-requests/${h}/comments`,v=n(y,{method:"POST",body:JSON.stringify({text:m})});try{return await t(v.caller,v.id)}catch(b){throw b}},errors:r,loading:o}},H5e=()=>{const e=ur("projectId"),t=ur("featureId"),n=JP("environmentId"),r=JP("strategyId"),[o,i]=f.useState({}),[a,l]=f.useState([]),{updateStrategyOnFeature:c,loading:u}=ZSe(),{strategyDefinition:d}=i2(o.name),{setToastData:p,setToastApiError:h}=It(),m=exe(),{uiConfig:y}=Lt(),{unleashUrl:v}=y,b=ft(),{addChange:w}=D2(),{isChangeRequestConfigured:g}=ff(e),{refetch:S}=ry(e),{feature:C,refetchFeature:R}=xl(e,t),k=f.useRef(C),{data:P,staleDataNotification:O,forceRefreshCache:L}=oxe({unleashGetter:xl,params:[e,t],dataKey:"feature",refetchFunctionKey:"refetchFeature",options:{}},C,{afterSubmitAction:R},ixe);f.useEffect(()=>{k.current.name===""&&C.name&&(L(C),k.current=C)},[C]);const{segments:I,refetchSegments:A}=Dl(r);f.useEffect(()=>{const q=P==null?void 0:P.environments.flatMap(G=>G.strategies).find(G=>G.id===r);i(G=>({...G,...q}))},[r,P]),f.useEffect(()=>{I&&l(I)},[JSON.stringify(I)]);const M=async q=>{await c(e,t,n,r,q),await A(),p({title:"Strategy updated",type:"success",confetti:!0})},F=async q=>{await w(e,n,{action:"updateStrategy",feature:t,payload:{...q,id:r}}),p({title:"Change added to draft",type:"success",confetti:!0}),S()},j=async()=>{const q=y!=null&&y.flags.SE?a:[],G=axe(o,q);try{g(n)?await F(G):await M(G),R(),b(N2(e,t))}catch(Z){h(ht(Z))}};return!o.id||!d||!P?null:T(Nr,{modal:!0,title:kp(o.name??""),description:cxe,documentationLink:uxe,documentationLinkLabel:dxe,formatApiCode:()=>lxe(e,t,n,o,d,v),children:[s(QSe,{projectId:e,feature:P,strategy:o,setStrategy:i,segments:a,setSegments:l,environmentId:n,onSubmit:j,loading:u,permission:sC,errors:m,isChangeRequest:g(n)}),O]})},axe=(e,t)=>({name:e.name,constraints:e.constraints??[],parameters:e.parameters??{},segments:t.map(n=>n.id)}),N2=(e,t)=>`/projects/${e}/features/${t}`,sxe=(e,t,n,r)=>{const o=new URLSearchParams({environmentId:n,strategyId:r});return`/projects/${e}/features/${t}/strategies/edit?${o}`},lxe=(e,t,n,r,o,i)=>{if(!i)return"";const a={...r,parameters:txe(r.parameters??{},o)},l=`${i}/api/admin/projects/${e}/features/${t}/environments/${n}/strategies/${r.id}`,c=JSON.stringify(a,void 0,2);return`curl --location --request PUT '${l}' \\
|
|
373
|
+
--data-raw '${JSON.stringify(j(),void 0,2)}'`,J=te=>te.length,z=te=>!(o!=null&&o.some(re=>re.name===te)),W=J(m)&&z(m)&&S.length,$=te=>{A("name"),z(te)||M("name","An environment with that name already exists."),y(te)},N=u.map(te=>({value:te.id,label:te.name}));return s(c2,{open:t,onClose:()=>{n(!1)},label:`Clone ${e.name} environment`,children:s(Nr,{loading:l,modal:!0,title:`Clone ${e.name} environment`,description:"Cloning an environment will clone all feature toggles and their configuration (activation strategies, segments, status, etc) into a new environment.",documentationLink:"https://docs.getunleash.io/reference/environments#cloning-environments",documentationLinkLabel:"Cloning environments documentation",formatApiCode:Z,children:T(Rwe,{onSubmit:G,children:[T("div",{children:[s(Ql,{children:"What is your new environment name? (Can't be changed later)"}),s(Pwe,{autoFocus:!0,label:"Environment name",error:Boolean(L.name),errorText:L.name,value:m,onChange:te=>$(te.target.value),required:!0}),s(Ql,{children:"What type of environment do you want to create?"}),s(JO,{onChange:te=>b(te.currentTarget.value),value:v}),T(Ql,{children:["Select which projects you want to clone the environment configuration in?",s(Km,{tooltip:"The cloned environment will keep the feature toggle state for the selected projects, where it will be enabled by default."})]}),s(Cwe,{projects:w,setProjects:g}),s(Ql,{children:"Keep the users permission for this environment?"}),s(a0,{children:"If you turn it off, the permission for this environment across all projects and feature toggles will remain only for admin and editor roles."}),s(xr,{label:R?"Yes":"No",control:s(Na,{onChange:te=>k(te.target.checked),checked:R})}),T($we,{children:[s(Ql,{children:"API Token"}),T(a0,{children:["In order to connect your SDKs to your newly cloned environment, you will also need an API token."," ",s(po,{href:"https://docs.getunleash.io/reference/api-tokens-and-client-keys",target:"_blank",children:"Read more about API tokens"}),"."]}),s(Da,{children:T(Ax,{value:P,onChange:te=>O(te.target.value),name:"api-token-generation",children:[s(xr,{value:"later",control:s(ll,{}),label:"I want to generate an API token later"}),s(xr,{value:"now",control:s(ll,{}),label:"Generate an API token now"})]})}),T(Iwe,{children:[s(a0,{children:"A new Server-side SDK (CLIENT) API token will be generated for the cloned environment, so you can get started right away."}),s(X,{condition:P==="now",show:T(Re,{children:[s(Ql,{children:"Which projects do you want this token to give access to?"}),s(Twe,{options:N,defaultValue:S,onChange:C,error:L.projects,onFocus:()=>A("projects")})]})})]})]})]}),T(Awe,{children:[s(rt,{type:"submit",variant:"contained",color:"primary",disabled:!W,children:"Clone environment"}),s(Owe,{onClick:()=>{n(!1)},children:"Cancel"})]})]})})})};var L2={},Dwe=fn;Object.defineProperty(L2,"__esModule",{value:!0});var cD=L2.default=void 0,Nwe=Dwe(En()),Mwe=kn,Bwe=(0,Nwe.default)((0,Mwe.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");cD=L2.default=Bwe;const uD=({token:e})=>{const{setToastData:t}=It();return T("div",{style:{backgroundColor:"#efefef",padding:"2rem",borderRadius:"3px",margin:"0",marginTop:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",wordBreak:"break-all"},children:[e,s(Tt,{title:"Copy token",arrow:!0,children:s(Qt,{onClick:()=>{eL(e)?t({type:"success",title:"Token copied to clipboard"}):t({type:"error",title:"Could not copy token"})},size:"large",children:s(cD,{})})})]})},Fwe=({open:e,setOpen:t,token:n})=>T(cr,{open:e,secondaryButtonText:"Close",onClose:(r,o)=>{o||t(!1)},title:"New API token created",children:[s(ke,{variant:"body1",children:"Your new token has been created successfully."}),T(ke,{variant:"body1",children:['You can also find it as "',s("strong",{children:n==null?void 0:n.username}),'" in the'," ",s(on,{to:"/admin/api",children:"API access page"}),"."]}),s(uD,{token:(n==null?void 0:n.secret)||""})]}),zwe=E(Je)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",paddingLeft:e.spacing(.5),minWidth:e.spacing(6.5)})),jwe=E(Qt)(({theme:e})=>({padding:e.spacing(1.5,0),cursor:"inherit",transition:"color 0.2s ease-in-out",display:"none",color:e.palette.neutral.main})),Uwe=E(a3,{shouldForwardProp:e=>e!=="deprecated"})(({theme:e,deprecated:t})=>({color:t?e.palette.neutral.border:e.palette.primary.main})),dD=({environment:e})=>T(zwe,{children:[s(jwe,{size:"large",disableRipple:!0,className:"drag-icon",children:s(ete,{titleAccess:"Drag to reorder"})}),s(Uwe,{deprecated:!e.enabled})]}),Wwe=E(za)(({theme:e})=>({marginTop:e.spacing(3)})),Hwe=E("p",{shouldForwardProp:e=>e!=="warning"})(({theme:e,warning:t})=>({color:t?e.palette.error.dark:e.palette.text.primary})),pD=({environment:e,warnEnabledToggles:t})=>{const n=f.useMemo(()=>[{id:"Icon",width:"1%",Cell:({row:{original:c}})=>s(dD,{environment:c})},{Header:"Name",accessor:"name",Cell:fo},{Header:"Type",accessor:"type",Cell:fo},{Header:"Visible in",accessor:c=>c.projectCount===1?"1 project":`${c.projectCount} projects`,Cell:({row:{original:c},value:u})=>T(fo,{children:[u,s(X,{condition:Boolean(t),show:s(Hwe,{warning:Boolean(c.enabledToggleCount&&c.enabledToggleCount>0),children:c.enabledToggleCount===1?"1 toggle enabled":`${c.enabledToggleCount} toggles enabled`})})]})}],[t]),{getTableProps:r,getTableBodyProps:o,headerGroups:i,rows:a,prepareRow:l}=tn.useTable({columns:n,data:[e],disableSortBy:!0});return T(Wwe,{...r(),rowHeight:"compact",children:[s(Fa,{headerGroups:i}),s(Ma,{...o(),children:a.map(c=>(l(c),s(sa,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>s(ta,{...u.getCellProps(),children:u.render("Cell")}))})))})]})},Vwe=({environment:e,open:t,setOpen:n,onConfirm:r})=>{const{enabled:o}=e,i=o?"Deprecate":"Undeprecate";return T(cr,{title:`${i} environment?`,open:t,primaryButtonText:i,secondaryButtonText:"Close",onClick:r,onClose:()=>{n(!1)},children:[s(X,{condition:o,show:s(Xt,{severity:"info",children:"Deprecating an environment will mark it as deprecated. Deprecated environments are set as not visible by default for new projects. Project owners are still able to override this setting in the project. This environment will still be visible in any current projects."}),elseShow:s(Xt,{severity:"info",children:"Undeprecating an environment will no longer mark it as deprecated. An undeprecated environment will be set as visible by default for new projects."})}),s(pD,{environment:e})]})},Gwe=E("p")(({theme:e})=>({marginTop:e.spacing(3),marginBottom:e.spacing(1.5)})),qwe=E(_r)(()=>({width:"100%"})),Ywe=({environment:e,open:t,setOpen:n,onConfirm:r})=>{const[o,i]=f.useState("");return f.useEffect(()=>{i("")},[t]),T(cr,{title:"Delete environment?",open:t,primaryButtonText:"Delete environment",disabledPrimaryButton:e.name!==o,secondaryButtonText:"Close",onClick:r,onClose:()=>{n(!1)},children:[T(Xt,{severity:"error",children:[s("strong",{children:"Danger! This action is not reversible. Please proceed with caution."})," ","Deleting this environment will result in removing all strategies that are active in this environment across all feature toggles."]}),s(pD,{environment:e,warnEnabledToggles:!0}),T(Gwe,{children:["In order to delete this environment, please enter the id of the environment in the textfield below:"," ",s("strong",{children:e.name})]}),s(qwe,{label:"Environment name",value:o,onChange:a=>i(a.target.value)})]})},Kwe=({environment:e})=>{const t=ft(),{setToastApiError:n,setToastData:r}=It(),{environments:o,refetchEnvironments:i}=pu(),{refetch:a}=UC(),{deleteEnvironment:l,toggleEnvironmentOn:c,toggleEnvironmentOff:u}=gu(),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[y,v]=f.useState(!1),[b,w]=f.useState(!1),[g,S]=f.useState();return T(na,{children:[s(vwe,{environment:e,onEdit:()=>t(`/environments/${e.name}`),onDeprecateToggle:()=>m(!0),onClone:()=>{o.length<Jm?v(!0):r({type:"error",title:"Environment limit reached",text:`You have reached the maximum number of environments (${Jm}). Please reach out if you need more.`})},onDelete:()=>p(!0)}),s(Ywe,{environment:e,open:d,setOpen:p,onConfirm:async()=>{try{await l(e.name),a(),r({type:"success",title:"Environment deleted",text:`You have successfully deleted the ${e.name} environment.`})}catch(k){n(ht(k))}finally{p(!1),await i()}}}),s(Vwe,{environment:e,open:h,setOpen:m,onConfirm:async()=>{try{e.enabled?(await u(e.name),r({type:"success",title:"Environment deprecated successfully"})):(await c(e.name),r({type:"success",title:"Environment undeprecated successfully"}))}catch(k){n(ht(k))}finally{m(!1),await i()}}}),s(Lwe,{environment:e,open:y,setOpen:v,newToken:k=>{S(k),w(!0)}}),s(Fwe,{open:b,setOpen:w,token:g})]})},Xwe=E(Je)(({theme:e})=>({display:"flex",flexDirection:"column",justifyContent:"center",wordBreak:"break-word",padding:e.spacing(1,2)})),Jwe=E("span")(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"1",lineClamp:"1"})),Qwe=E("span")(({theme:e})=>({color:e.palette.text.secondary,overflow:"hidden",textOverflow:"ellipsis",fontSize:"inherit",WebkitLineClamp:"1",lineClamp:"1",display:"-webkit-box",WebkitBoxOrient:"vertical"})),mf=({value:e,subtitle:t})=>{const{searchQuery:n}=uf();return T(Xwe,{children:[s(Jwe,{style:{WebkitLineClamp:Boolean(t)?1:2,lineClamp:Boolean(t)?1:2},"data-loading":!0,children:s(Gc,{search:n,children:e})}),s(X,{condition:Boolean(t),show:()=>s(Qwe,{"data-loading":!0,children:s(Gc,{search:n,children:t})})})]})},Zwe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(4)})),eSe=()=>{const{changeSortOrder:e}=gu(),{setToastApiError:t}=It(),{environments:n,mutateEnvironments:r}=pu(),o=f.useCallback(async(b,w,g=!1)=>{const S=[...n],C=S[b];if(S.splice(b,1),S.splice(w,0,C),await r(S),g)try{await e(Dpe(S))}catch(R){t(ht(R))}},[e,n,r,t]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d},setGlobalFilter:p}=tn.useTable({columns:tSe,data:n,disableSortBy:!0},tn.useGlobalFilter),m=T(Re,{children:[s(go,{initialValue:d,onChange:p}),s(xn.Divider,{}),s(awe,{})]});let y=c.length;const v=s(xn,{title:`Environments (${y})`,actions:m});return T(gr,{header:v,children:[s(Zwe,{severity:"info",children:"This is the order of environments that you have today in each feature toggle. Rearranging them here will change also the order inside each feature toggle."}),s(As,{value:d,children:T(za,{...i(),rowHeight:"compact",children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(b=>(u(b),s(uwe,{row:b,moveListItem:o},b.original.name)))})]})}),s(X,{condition:c.length===0,show:s(X,{condition:(d==null?void 0:d.length)>0,show:T(Zn,{children:["No environments found matching “",d,"”"]}),elseShow:s(Zn,{children:"No environments available. Get started by adding one."})})})]})},tSe=[{id:"Icon",width:"1%",Cell:({row:{original:e}})=>s(dD,{environment:e}),disableGlobalFilter:!0,isDragHandle:!0},{Header:"Name",accessor:"name",Cell:({row:{original:e}})=>s(fwe,{environment:e}),minWidth:350},{Header:"Type",accessor:"type",Cell:mf},{Header:"Visible in",accessor:e=>e.projectCount===1?"1 project":`${e.projectCount} projects`,Cell:fo},{Header:"API Tokens",accessor:e=>e.apiTokenCount===1?"1 token":`${e.apiTokenCount} tokens`,Cell:fo},{Header:"Actions",id:"Actions",align:"center",width:"1%",Cell:({row:{original:e}})=>s(Kwe,{environment:e}),disableGlobalFilter:!0}],nSe=()=>{const e=ft();return s(Io,{onClick:()=>e("/segments/create"),permission:Av,"data-testid":$te,children:"New segment"})},rSe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:e.spacing(6),marginLeft:"auto",marginRight:"auto"})),oSe=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(2.5)})),iSe=E("p")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary,maxWidth:515,marginBottom:e.spacing(2.5),textAlign:"center"})),aSe=E(on)(({theme:e})=>({textDecoration:"none",color:e.palette.primary.main,fontWeight:e.fontWeight.bold})),sSe=()=>{const{hasAccess:e}=f.useContext(Qr);return T(rSe,{children:[s(oSe,{children:"No segments yet!"}),s(iSe,{children:"Segment makes it easy for you to define who should be exposed to your feature. The segment is often a collection of constraints and can be reused."}),s(X,{condition:e(Av),show:s(aSe,{to:"/segments/create",children:"Create your first segment"})})]})},lSe=e=>{const t=Ft(`api/admin/segments/${e}/strategies`),{data:n,error:r}=gn(t,()=>cSe(t)),o=f.useCallback(()=>{Vr(t).catch(console.warn)},[t]);return{strategies:n==null?void 0:n.strategies,refetchUsedSegments:o,loading:!r&&!n,error:r}},cSe=e=>fetch(e,{method:"GET"}).then(Cn("Strategies by segment")).then(t=>t.json()),uSe=E(_r)(({theme:e})=>({marginTop:e.spacing(2)})),dSe=({segment:e,open:t,onClose:n,onRemove:r})=>{const[o,i]=f.useState(""),a=u=>i(u.currentTarget.value),l=()=>{n(),i("")},c="delete-segment-confirmation-form";return T(cr,{title:"Are you sure you want to delete this segment?",open:t,primaryButtonText:"Delete segment",secondaryButtonText:"Cancel",onClick:()=>{r(),i("")},disabledPrimaryButton:(e==null?void 0:e.name)!==o,onClose:l,formId:c,children:[T("p",{children:["In order to delete this segment, please enter the name of the segment in the field below: ",s("strong",{children:e==null?void 0:e.name})]}),s("form",{id:c,children:s(uSe,{autoFocus:!0,onChange:a,value:o,label:"Segment name","data-testid":jte})})]})},pSe=({strategyDefinition:e})=>s("p",{children:e==null?void 0:e.description}),fSe=Kx(xQ,e=>({root:{height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor"},active:{},valueLabel:{},track:{height:8,borderRadius:e.shape.borderRadius},rail:{height:8,borderRadius:e.shape.borderRadius}})),hSe=ai()(e=>({slider:{width:"100%",maxWidth:"100%"},margin:{height:e.spacing(3)}})),mSe=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}],fD=({name:e,value:t,onChange:n,disabled:r=!1})=>{const{classes:o}=hSe(),i=a=>`${a}%`;return T("div",{className:o.slider,children:[s(ke,{id:"discrete-slider-always",variant:"h3",gutterBottom:!0,component:"h3",children:e}),s(fSe,{min:0,max:100,value:t,getAriaValueText:i,"aria-labelledby":"discrete-slider-always",step:1,"data-testid":Vte,marks:mSe,onChange:n,valueLabelDisplay:"on",disabled:r})]})},hD=({name:e,value:t="",label:n="",options:r,onChange:o,id:i,disabled:a=!1,className:l,classes:c,...u})=>T(Da,{variant:"outlined",size:"small",classes:c,children:[s(Zp,{htmlFor:i,children:n}),s(ef,{name:e,disabled:a,onChange:o,className:l,label:n,id:i,value:t,...u,children:(()=>r.map(p=>s(ws,{value:p.key,title:p.title||"","data-testid":`${w3}-${p.label}`,children:p.label},p.key)))()})]}),KP=[{key:"default",label:"default"},{key:"userId",label:"userId"},{key:"sessionId",label:"sessionId"},{key:"random",label:"random"}],gSe=({updateParameter:e,parameters:t,context:n,editable:r=!0})=>{const o=u=>d=>{e(u,d)},i=(u,d)=>{e("rollout",d.toString())},l=(()=>KP.concat(n.filter(u=>u.stickiness).filter(u=>!KP.find(d=>d.key===u.name)).map(u=>({key:u.name,label:u.name}))))(),c=t.rollout!==void 0?Ud(t.rollout):100;return T("div",{children:[s(fD,{name:"Rollout",value:c,disabled:!r,onChange:i}),s("br",{}),T("div",{children:[T(ke,{variant:"subtitle2",style:{marginBottom:"1rem",display:"flex",gap:"1ch"},component:"h2",children:["Stickiness",s(Km,{tooltip:"Stickiness defines what parameter should be used to ensure that your users get consistency in features. By default unleash will use the first value present in the context in the order of userId, sessionId and random."})]}),s(hD,{id:"stickiness-select",name:"stickiness",label:"Stickiness",options:l,value:fs(t.stickiness),disabled:!r,"data-testid":qte,onChange:u=>o("stickiness")(u.target.value)})," ",s("br",{}),s("br",{}),T(ke,{variant:"subtitle2",style:{marginBottom:"1rem",display:"flex",gap:"1ch"},component:"h2",children:["GroupId",s(Km,{tooltip:"GroupId is used to ensure that different toggles will hash differently for the same user. The groupId defaults to feature toggle name, but you can override it to correlate rollout of multiple feature toggles."})]}),s(_r,{label:"groupId",id:"groupId-input",value:fs(t.groupId),disabled:!r,onChange:u=>o("groupId")(u.target.value),"data-testid":Yte})]})]})},vSe=E("div")(({theme:e})=>({display:"grid",gap:e.spacing(1)})),ySe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(1),flexWrap:"wrap"})),bSe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(1),alignItems:"start"})),mD=({name:e,list:t,setConfig:n,disabled:r,errors:o})=>{const[i,a]=f.useState(""),l="Enter",c=m=>{d(m)},u=m=>{(m==null?void 0:m.key)===l&&(d(m),m.preventDefault(),m.stopPropagation())},d=m=>{m.preventDefault();const y=m.target.value;if(y){const v=y.split(/,\s*/).filter(b=>!t.includes(b));if(v.length>0){const b=t.concat(v).filter(w=>w);n(e,b.join(","))}a("")}},p=m=>{t[m]=null,n(e,t.length===1?"":t.filter(Boolean).join(","))},h=m=>{a(m.currentTarget.value)};return T(vSe,{children:[T(ke,{variant:"subtitle2",component:"h2",children:["List of ",e]}),s(X,{condition:t.length>0,show:s(ySe,{children:t.map((m,y)=>s(wo,{label:s(Li,{maxWidth:"300",text:m,maxLength:50}),onDelete:r?void 0:()=>p(y),title:"Remove value"},y+m))})}),s(X,{condition:!r,show:T(bSe,{children:[s(pn,{error:Boolean(o.getFormError(e)),helperText:o.getFormError(e),name:"input_field",variant:"outlined",label:"Add items",id:"input-add-items",value:i,size:"small",placeholder:"",onBlur:c,onChange:h,onKeyDown:u,"data-testid":Kte}),s(rt,{onClick:d,"data-testid":Xte,variant:"outlined",color:"secondary",startIcon:s(Si,{}),children:"Add"})]})})]})},wSe=({editable:e,parameters:t,updateParameter:n,errors:r})=>s("div",{children:s(mD,{name:"userIds",list:rs(t.userIds),disabled:!e,setConfig:n,errors:r})}),sd=({text:e})=>e?s(Je,{sx:t=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallerBody,marginTop:t.spacing(1)}),children:e}):null,SSe=({definition:e,parameters:t,updateParameter:n,editable:r,errors:o})=>{const{type:i,name:a,description:l,required:c}=e,u=t[a],d=o.getFormError(a),p=c?`${a} * `:a,h=w=>{n(a,w.target.value)},m=w=>{n(a,fs(w.target.value))},y=(w,g)=>{n(a,g.toString())},v=(w,g)=>{n(a,String(g))},b=(w,g)=>{n(w,rs(g).join(","))};if(i==="percentage")return T("div",{children:[s(fD,{name:a,onChange:y,disabled:!r,value:Ud(t[a]),minLabel:"off",maxLabel:"on"}),s(sd,{text:l})]});if(i==="list")return T("div",{children:[s(mD,{name:a,list:rs(t[a]),disabled:!r,setConfig:b,errors:o}),s(sd,{text:l})]});if(i==="number")return T("div",{children:[s(pn,{error:Boolean(d),helperText:d,variant:"outlined",size:"small","aria-required":c,style:{width:"100%"},disabled:!r,label:p,onChange:h,value:u}),s(sd,{text:l})]});if(i==="boolean"){const g=fs(t[a])==="true";return T("div",{children:[s(xr,{label:a,control:s(Na,{name:a,onChange:v,checked:g})}),s(sd,{text:l})]})}return T("div",{children:[s(pn,{rows:1,placeholder:"",variant:"outlined",size:"small",style:{width:"100%"},"aria-required":c,disabled:!r,error:Boolean(d),helperText:d,name:a,label:p,onChange:m,value:fs(t[a])}),s(sd,{text:l})]})},xSe=Dr("div")(({theme:e})=>({display:"grid",gap:e.spacing(4)})),CSe=({parameters:e,strategyDefinition:t,updateParameter:n,editable:r,errors:o})=>!t||t.parameters.length===0?null:s(xSe,{children:t.parameters.map((i,a)=>s("div",{children:s(SSe,{definition:i,parameters:e,updateParameter:n,editable:r,errors:o})},a))}),ESe=({hasAccess:e,strategy:t,strategyDefinition:n,setStrategy:r,validateParameter:o,errors:i})=>{const{context:a}=Ll(),l=(c,u)=>{r(Ho(d=>{d.parameters=d.parameters??{},d.parameters[c]=u})),o(c,u)};switch(t.name){case"default":return s(pSe,{strategyDefinition:n});case"flexibleRollout":return s(gSe,{context:a,parameters:t.parameters??{},updateParameter:l,editable:e});case"userWithId":return s(wSe,{parameters:t.parameters??{},updateParameter:l,editable:e,errors:i});default:return s(CSe,{strategyDefinition:n,parameters:t.parameters??{},updateParameter:l,editable:e,errors:i})}},kSe=({projectId:e,featureId:t,environmentId:n,children:r})=>{const o=N2(e,t),{feature:i}=xl(e,t),a=s(on,{to:o,style:{color:"inherit"},children:"feature toggle page"});return s(X,{condition:TSe(i,n),show:r,elseShow:T(Xt,{severity:"warning",children:["This feature toggle is currently disabled in the"," ",s("strong",{children:n})," environment. Any changes made here will not take effect until the toggle has been enabled on the ",a,"."]})})},TSe=(e,t)=>{const n=e.environments.find(r=>r.name===t);return n?n.enabled:!1},_Se=({projectId:e,environmentId:t,strategy:n,setStrategy:r})=>{const o=f.useMemo(()=>n.constraints??[],[n]),i=c=>{r(u=>({...u,constraints:c instanceof Function?c(o):c}))},a=qc(G3,e,t),l=qc(sC,e,t);return s(ny,{constraints:o,setConstraints:l?i:void 0,showCreateButton:a})},RSe=E("span")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(.5),paddingInlineStart:e.spacing(2),paddingInlineEnd:e.spacing(1),paddingBlockStart:e.spacing(.5),paddingBlockEnd:e.spacing(.5),borderRadius:"100rem",background:e.palette.featureStrategySegmentChipBackground,color:e.palette.text.tertiaryContrast})),XP=E("button")(({theme:e})=>({all:"unset",height:e.spacing(2),cursor:"pointer"})),PSe=E(on)(({theme:e})=>({marginRight:e.spacing(1),color:"inherit",textDecoration:"none"})),s0=e=>({fontSize:e.fontSizes.bodySize}),$Se=({segment:e,setSegments:t,preview:n,setPreview:r})=>{const o=()=>{t(c=>c.filter(u=>u.id!==e.id)),r(c=>c===e?void 0:c)},i=()=>{r(c=>c===e?void 0:e)},a=s(X,{condition:e===n,show:s(d3,{titleAccess:"Hide",sx:s0}),elseShow:s(u3,{titleAccess:"Show",sx:s0})}),l=e===n?"Hide segment constraints":"Preview segment constraints";return T(RSe,{children:[s(PSe,{to:`/segments/edit/${e.id}`,target:"_blank",children:e.name}),s(Tt,{title:l,arrow:!0,children:s(XP,{type:"button",onClick:i,"aria-expanded":e===n,"aria-controls":rD,children:a})}),s(Tt,{title:"Remove segment",arrow:!0,children:s(XP,{type:"button",onClick:o,children:s(Qee,{titleAccess:"Remove",sx:s0})})})]})},ISe=E(wx)(({theme:e})=>({border:`1px solid ${e.palette.dividerAlternative}`,borderRadius:e.shape.borderRadiusMedium,backgroundColor:e.palette.background.paper,boxShadow:"none",margin:0,transition:"all 0.1s ease","&:before":{opacity:"0 !important"},"&.Mui-expanded":{backgroundColor:e.palette.neutral.light}})),ASe=E(xx)(({theme:e})=>({margin:e.spacing(0,.5),fontSize:e.typography.body2.fontSize,".MuiAccordionSummary-content":{display:"flex",alignItems:"center"}})),OSe=E(on)(({theme:e})=>({textDecoration:"none",marginLeft:e.spacing(1),"&:hover":{textDecoration:"underline"}})),gD=({segment:e,isExpanded:t,headerContent:n,constraintList:r})=>{var a;const[o,i]=f.useState(t||!1);return T(ISe,{expanded:o,children:[T(ASe,{id:`segment-accordion-${e.id}`,children:[s(s3,{color:"secondary",sx:{mr:1}}),s("span",{children:"Segment:"}),s(OSe,{to:`/segments/edit/${e.id}`,children:e.name}),s(X,{condition:Boolean(n),show:n}),s(X,{condition:!t,show:s(rt,{size:"small",variant:"outlined",onClick:()=>i(l=>!l),sx:{my:0,ml:"auto",fontSize:l=>l.typography.body2.fontSize},children:o?"Close preview":"Preview"})})]}),s(Sx,{sx:{pt:0},children:s(X,{condition:Boolean(r),show:r,elseShow:s(X,{condition:(((a=e==null?void 0:e.constraints)==null?void 0:a.length)||0)>0,show:s(ny,{constraints:e.constraints,showLabel:!1}),elseShow:s(ke,{children:"This segment has no constraints."})})})})]})},LSe=E("div")(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing(1)})),DSe=E("p")(({theme:e})=>({color:e.palette.text.secondary})),NSe=E("p")(({theme:e})=>({fontSize:e.fontSizes.smallerBody,padding:e.spacing(.75,1),display:"block",marginTop:"auto",marginBottom:"auto",alignItems:"center",borderRadius:e.shape.borderRadius,lineHeight:1,color:e.palette.text.primary,backgroundColor:e.palette.secondaryContainer})),MSe=({segments:e,setSegments:t})=>{const[n,r]=f.useState(),o=e.length-1;return e.length===0?null:T(Re,{children:[s(X,{condition:e&&e.length>0,show:s(DSe,{children:"Selected Segments"})}),s(LSe,{children:e.map((i,a)=>T(f.Fragment,{children:[s($Se,{segment:i,setSegments:t,preview:n,setPreview:r}),s(X,{condition:a<o,show:s(NSe,{children:"AND"})})]},i.id))}),s(X,{condition:Boolean(n),show:()=>s(gD,{segment:n,isExpanded:!0})})]})},BSe=E(uo)(({theme:e})=>({fontSize:e.fontSizes.smallBody})),FSe=({segments:e,setSegments:t})=>{const{segments:n}=Dl(),{strategySegmentsLimit:r}=Nl(),o=Boolean(r&&e.length>=r);if(!n||n.length===0)return null;const a=n.filter(c=>!e.find(u=>u.id===c.id)).map(c=>({value:String(c.id),label:c.name}));return T(Re,{children:[s(ke,{component:"h3",sx:{m:0},variant:"h3",children:"Segmentation"}),o&&s(Nbe,{}),s("p",{children:"Add a predefined segment to constrain this feature toggle:"}),s(oD,{label:"Select segments",options:a,onChange:([c])=>{const u=n.find(d=>String(d.id)===c.value);u&&t(d=>[...d,u])},disabled:o}),s(MSe,{segments:e,setSegments:t}),s(BSe,{})]})},zSe=(e,t)=>{const{type:n,required:r}=e;if(!(n!=="string"&&n!=="list"&&n!=="number")){if(r&&(typeof t>"u"||t===""))return"Field is required";if(n==="number"&&!jSe(t))return"Not a valid number."}},jSe=e=>typeof e>"u"||e===""||/^\d+$/.test(String(e)),USe=({environment:e})=>T(Xt,{severity:"info",children:[s("strong",{children:"Change requests"})," are enabled",e?` for ${e}`:"",". Your changes needs to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]}),WSe="production",HSe=({open:e,onClose:t,onClick:n,label:r,loading:o})=>{const[i,a]=vD(),l=()=>{a(c=>({hide:!c.hide}))};return T(cr,{title:"Changing production environment!",primaryButtonText:r,disabledPrimaryButton:o,secondaryButtonText:"Cancel",onClick:n,onClose:t,open:e,children:[s(Xt,{severity:"error",children:"WARNING. You are about to make changes to a production environment. These changes will affect your customers."}),s("p",{style:{marginTop:"1rem"},children:"Are you sure you want to proceed?"}),s(xr,{label:"Don't show again",control:s(Ps,{checked:i.hide,onChange:l})})]})},VSe=(e,t)=>{const[n]=vD(),r=e.environments.find(o=>o.name===t);return n.hide?!1:(r==null?void 0:r.type)===WSe},GSe="useFeatureStrategyProdGuardSettings:v2",vD=pC(GSe,{hide:!1}),qSe=e=>({changeRequestInReviewOrApproved:n=>e?e.some(r=>r.environment===n&&yn(["In review","Approved"],r.state)):!1,alert:s(Xt,{sx:{margin:"1rem 0"},severity:"warning",children:"You currently have a change request in review for this environment. Adding a new change will add the change to the existing change request, and all existing approvals will be reset. Are you sure you want to continue?"})}),YSe=(e,t,n,r={})=>{const{isEnterprise:o}=Lt();return kC(o(),e,t,n,r)},KSe=e=>fetch(e).then(Cn("ChangeRequest")).then(t=>t.json()),ry=e=>{const{data:t,error:n,mutate:r}=YSe([],Ft(`api/admin/projects/${e}/change-requests/pending`),KSe);return{data:t,loading:!n&&!t,refetch:r,error:n}},XSe=E("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),l0=E("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.tertiary.light})),JSe=E("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),QSe=({projectId:e,feature:t,environmentId:n,permission:r,onSubmit:o,loading:i,strategy:a,setStrategy:l,segments:c,setSegments:u,errors:d,isChangeRequest:p})=>{const[h,m]=f.useState(!1),y=l2(a.constraints),v=VSe(t,n),b=qc(r,e,n),{strategyDefinition:w}=i2(a==null?void 0:a.name),{data:g}=ry(t.project),{changeRequestInReviewOrApproved:S,alert:C}=qSe(g),R=S(n||""),k=R?"Add to existing change request":"Add change to draft",P=ft(),{uiConfig:O,error:L,loading:I}=Lt();if(L)throw L;if(I||!w)return null;const A=G=>w.parameters.find(Z=>Z.name===G),M=(G,Z)=>{const J=zSe(A(G),Z);return J?(d.setFormError(G,J),!1):(d.removeFormError(G),!0)},F=()=>w.parameters.map(G=>G.name).map(G=>{var Z;return M(G,(Z=a.parameters)==null?void 0:Z[G])}).every(Boolean),j=()=>{P(N2(t.project,t.name))};return T(XSe,{onSubmit:async G=>{G.preventDefault(),F()&&(v&&!p?m(!0):o())},children:[s(X,{condition:R,show:C,elseShow:s(X,{condition:Boolean(p),show:s(USe,{environment:n})})}),s(kSe,{projectId:t.project,featureId:t.name,environmentId:n,children:s(X,{condition:Boolean(p),show:T(Xt,{severity:"success",children:["This feature toggle is currently enabled in the"," ",s("strong",{children:n})," environment. Any changes made here will be available to users as soon as these changes are approved and applied."]}),elseShow:T(Xt,{severity:"success",children:["This feature toggle is currently enabled in the"," ",s("strong",{children:n})," environment. Any changes made here will be available to users as soon as you hit ",s("strong",{children:"save"}),"."]})})}),s(l0,{}),s(X,{condition:Boolean(O.flags.SE),show:s(FSe,{segments:c,setSegments:u})}),s(_Se,{projectId:t.project,environmentId:n,strategy:a,setStrategy:l}),s(l0,{}),s(ESe,{strategy:a,strategyDefinition:w,setStrategy:l,validateParameter:M,errors:d,hasAccess:b}),s(l0,{}),T(JSe,{children:[s(Io,{permission:r,projectId:t.project,environmentId:n,variant:"contained",color:"primary",type:"submit",disabled:i||!y||d.hasFormErrors(),"data-testid":Jte,children:p?k:"Save strategy"}),s(rt,{type:"button",color:"secondary",onClick:j,disabled:i,children:"Cancel"}),s(HSe,{open:h,onClose:()=>m(!1),onClick:o,loading:i,label:"Save strategy"})]})]})},JP=e=>{const t=new URLSearchParams(window.location.search).get(e);if(!t)throw new Error(`Missing required query param: ${e}`);return t},ZSe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{addStrategyToFeature:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies`,m=t(h,{method:"POST",body:JSON.stringify(p)},"addStrategyToFeature");return(await e(m.caller,m.id)).json()},updateStrategyOnFeature:async(c,u,d,p,h)=>{const m=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/${p}`,y=t(m,{method:"PUT",body:JSON.stringify(h)},"updateStrategyOnFeature");await e(y.caller,y.id)},deleteStrategyFromFeature:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/${p}`,m=t(h,{method:"DELETE"},"deleteStrategyFromFeature");await e(m.caller,m.id)},setStrategiesSortOrder:async(c,u,d,p)=>{const h=`api/admin/projects/${c}/features/${u}/environments/${d}/strategies/set-sort-order`,m=t(h,{method:"POST",body:JSON.stringify(p)},"setStrategiesSortOrderOnFeature");await e(m.caller,m.id)},loading:r,errors:n}},exe=()=>{const[e,t]=f.useState({}),n=f.useCallback(a=>e[a],[e]),r=f.useCallback((a,l)=>{t(Ho(c=>{c[a]=l}))},[t]),o=f.useCallback(a=>{t(Ho(l=>{delete l[a]}))},[t]),i=f.useCallback(()=>Object.values(e).some(Boolean),[e]);return{getFormError:n,setFormError:r,removeFormError:o,hasFormErrors:i}},txe=(e,t)=>{const n=t.parameters.map(r=>r.name);return Object.fromEntries(Object.entries(e).sort((r,o)=>n.indexOf(r[0])-n.indexOf(o[0])))};var QP=Object.prototype.hasOwnProperty;function ZP(e,t,n){for(n of e.keys())if(Wd(n,t))return n}function Wd(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Wd(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(o=r,o&&typeof o=="object"&&(o=ZP(t,o),!o)||!t.has(o))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(o=r[0],o&&typeof o=="object"&&(o=ZP(t,o),!o)||!Wd(r[1],t.get(o)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(QP.call(e,n)&&++r&&!QP.call(t,n)||!(n in t)||!Wd(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const nxe=({refresh:e,show:t,afterSubmitAction:n,data:r,cache:o})=>{const i=sn(),a=Er(i.breakpoints.down("sm")),l=f.useMemo(()=>{const c={...R3,padding:`${i.spacing(3)} ${i.spacing(4)}`,boxShadow:i.boxShadows.elevated,borderRadius:i.shape.borderRadiusLarge,backgroundColor:i.palette.background.paper,maxWidth:i.spacing(75),zIndex:i.zIndex.mobileStepper};return a?{...c,right:0,left:0,bottom:0,borderRadius:0}:c},[i,a]);return T(qx,{mounted:t,start:l,enter:P3,children:[s(ke,{variant:"h5",sx:{my:2,mb:2},children:"Your data is stale"}),s(ke,{variant:"body1",sx:{my:2,mb:3},children:"The data you have been working on is stale, would you like to refresh your data? This may happen if someone has been making changes to the data while you were working."}),s(qv,{entry:{preData:o,data:r}}),s(rt,{sx:{mb:2},variant:"contained",color:"primary",onClick:()=>{e(),n()},children:"Refresh data"})]})},rxe=({unleashGetter:e,dataKey:t="",refetchFunctionKey:n="",options:r={},params:o=[""]})=>{const i=e(...o,{refreshInterval:5,...r});return{data:i[t],refetch:i[n]}},oxe=(e,t,n,r)=>{const{data:o,refetch:i}=rxe(e),[a,l]=f.useState(t||null),[c,u]=f.useState(!1),d=h=>{u(!1),l(h)},p=h=>h&&(r&&typeof r=="function"?r(h):h);return f.useEffect(()=>{a===null&&l(t)},[t]),f.useEffect(()=>{if(!a||!o)return;Wd(p(a),p(o))||u(!0)},[o]),{data:a,refetch:i,staleDataNotification:s(nxe,{cache:p(a),data:p(o),refresh:()=>d(o),show:c,afterSubmitAction:n.afterSubmitAction}),forceRefreshCache:d}},ixe=e=>{const t={...e};return delete t.lastSeenAt,t},D2=()=>{const{trackEvent:e}=Is(),{makeRequest:t,createRequest:n,errors:r,loading:o}=Un({propagateErrors:!0});return{addChange:async(p,h,m)=>{e("change_request",{props:{eventType:"change added"}});const y=`api/admin/projects/${p}/environments/${h}/change-requests`,v=n(y,{method:"POST",body:JSON.stringify(m)});try{return(await t(v.caller,v.id)).json()}catch(b){throw b}},changeState:async(p,h,m)=>{e("change_request",{props:{eventType:m.state}});const y=`api/admin/projects/${p}/change-requests/${h}/state`,v=n(y,{method:"PUT",body:JSON.stringify(m)});try{return(await t(v.caller,v.id)).json()}catch(b){throw b}},discardChange:async(p,h,m)=>{const y=`api/admin/projects/${p}/change-requests/${h}/changes/${m}`,v=n(y,{method:"DELETE"});try{return await t(v.caller,v.id)}catch(b){throw b}},updateChangeRequestEnvironmentConfig:async({project:p,enabled:h,environment:m,requiredApprovals:y})=>{const v=`api/admin/projects/${p}/environments/${m}/change-requests/config`,b=n(v,{method:"PUT",body:JSON.stringify({changeRequestsEnabled:h,requiredApprovals:y})});try{return await t(b.caller,b.id)}catch(w){throw w}},discardDraft:async(p,h)=>{const m=`api/admin/projects/${p}/change-requests/${h}`,y=n(m,{method:"DELETE"});try{return await t(y.caller,y.id)}catch(v){throw v}},addComment:async(p,h,m)=>{e("change_request",{props:{eventType:"comment added"}});const y=`/api/admin/projects/${p}/change-requests/${h}/comments`,v=n(y,{method:"POST",body:JSON.stringify({text:m})});try{return await t(v.caller,v.id)}catch(b){throw b}},errors:r,loading:o}},V5e=()=>{const e=ur("projectId"),t=ur("featureId"),n=JP("environmentId"),r=JP("strategyId"),[o,i]=f.useState({}),[a,l]=f.useState([]),{updateStrategyOnFeature:c,loading:u}=ZSe(),{strategyDefinition:d}=i2(o.name),{setToastData:p,setToastApiError:h}=It(),m=exe(),{uiConfig:y}=Lt(),{unleashUrl:v}=y,b=ft(),{addChange:w}=D2(),{isChangeRequestConfigured:g}=ff(e),{refetch:S}=ry(e),{feature:C,refetchFeature:R}=xl(e,t),k=f.useRef(C),{data:P,staleDataNotification:O,forceRefreshCache:L}=oxe({unleashGetter:xl,params:[e,t],dataKey:"feature",refetchFunctionKey:"refetchFeature",options:{}},C,{afterSubmitAction:R},ixe);f.useEffect(()=>{k.current.name===""&&C.name&&(L(C),k.current=C)},[C]);const{segments:I,refetchSegments:A}=Dl(r);f.useEffect(()=>{const q=P==null?void 0:P.environments.flatMap(G=>G.strategies).find(G=>G.id===r);i(G=>({...G,...q}))},[r,P]),f.useEffect(()=>{I&&l(I)},[JSON.stringify(I)]);const M=async q=>{await c(e,t,n,r,q),await A(),p({title:"Strategy updated",type:"success",confetti:!0})},F=async q=>{await w(e,n,{action:"updateStrategy",feature:t,payload:{...q,id:r}}),p({title:"Change added to draft",type:"success",confetti:!0}),S()},j=async()=>{const q=y!=null&&y.flags.SE?a:[],G=axe(o,q);try{g(n)?await F(G):await M(G),R(),b(N2(e,t))}catch(Z){h(ht(Z))}};return!o.id||!d||!P?null:T(Nr,{modal:!0,title:kp(o.name??""),description:cxe,documentationLink:uxe,documentationLinkLabel:dxe,formatApiCode:()=>lxe(e,t,n,o,d,v),children:[s(QSe,{projectId:e,feature:P,strategy:o,setStrategy:i,segments:a,setSegments:l,environmentId:n,onSubmit:j,loading:u,permission:sC,errors:m,isChangeRequest:g(n)}),O]})},axe=(e,t)=>({name:e.name,constraints:e.constraints??[],parameters:e.parameters??{},segments:t.map(n=>n.id)}),N2=(e,t)=>`/projects/${e}/features/${t}`,sxe=(e,t,n,r)=>{const o=new URLSearchParams({environmentId:n,strategyId:r});return`/projects/${e}/features/${t}/strategies/edit?${o}`},lxe=(e,t,n,r,o,i)=>{if(!i)return"";const a={...r,parameters:txe(r.parameters??{},o)},l=`${i}/api/admin/projects/${e}/features/${t}/environments/${n}/strategies/${r.id}`,c=JSON.stringify(a,void 0,2);return`curl --location --request PUT '${l}' \\
|
|
374
374
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
375
375
|
--header 'Content-Type: application/json' \\
|
|
376
376
|
--data-raw '${c}'`},cxe=`
|
|
377
377
|
An activation strategy will only run when a feature toggle is enabled and provides a way to control who will get access to the feature.
|
|
378
378
|
If any of a feature toggle's activation strategies returns true, the user will get access.
|
|
379
|
-
`,uxe="https://docs.getunleash.io/reference/activation-strategies",dxe="Strategies documentation",pxe=E("ul")({marginBottom:0}),fxe=E(on)(({theme:e})=>({textDecoration:"none",color:e.palette.primary.main,fontWeight:e.fontWeight.bold})),hxe=({segment:e,open:t,onClose:n,strategies:r})=>T(cr,{title:"You can't delete a segment that's currently in use",open:t,primaryButtonText:"OK",onClick:n,children:[T("p",{children:["The following feature toggles are using the"," ",s("strong",{children:e.name})," segment for their strategies:"]}),s(pxe,{children:r==null?void 0:r.map(o=>s("li",{children:T(fxe,{to:sxe(o.projectId,o.featureName,o.environment,o.id),target:"_blank",rel:"noopener noreferrer",children:[o.featureName," ",mxe(o)]})},o.id))})]}),mxe=e=>e.strategyName?`(${kp(e.strategyName)})`:"",gxe=({segment:e,open:t,onClose:n,onRemove:r})=>{const{strategies:o,loading:i}=lSe(e.id),a=(o==null?void 0:o.length)===0;return i?null:s(X,{condition:a,show:s(dSe,{segment:e,open:t,onClose:n,onRemove:r}),elseShow:s(hxe,{segment:e,open:t,onClose:n,strategies:o})})},vxe=({segment:e})=>{const{refetchSegments:t}=Dl(),{deleteSegment:n}=a2(),{setToastData:r,setToastApiError:o}=It(),[i,a]=f.useState(!1),l=async()=>{try{await n(e.id),await t(),r({type:"success",title:"Successfully deleted segment"})}catch(c){o(ht(c))}finally{a(!1)}};return T(Re,{children:[s(mr,{onClick:()=>a(!0),permission:_oe,tooltipProps:{title:"Remove segment"},"data-testid":`${zte}_${e.name}`,children:s(ti,{"data-loading":!0})}),s(X,{condition:i,show:()=>s(gxe,{segment:e,open:i,onClose:()=>a(!1),onRemove:l})})]})},yxe=({segment:e})=>{const t=ft();return s(mr,{onClick:()=>t(`/segments/edit/${e.id}`),permission:lC,tooltipProps:{title:"Edit segment"},children:s(ea,{"data-loading":!0})})},bxe=({segment:e})=>T(na,{children:[s(yxe,{segment:e}),s(vxe,{segment:e})]}),wxe=()=>{const{segments:e,loading:t}=Dl(),n=Er(Wc.breakpoints.down("md")),[r]=f.useState({sortBy:[{id:"createdAt"}],hiddenColumns:["description"]}),o=f.useMemo(()=>e??Array(5).fill({name:"Segment name",description:"Segment descripton",createdAt:new Date().toISOString(),createdBy:"user"}),[e]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d},setGlobalFilter:p,setHiddenColumns:h}=tn.useTable({initialState:r,columns:e$,data:o,sortTypes:ca,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,defaultColumn:{Cell:mf}},tn.useGlobalFilter,tn.useSortBy);return Mv([{condition:n,columns:["createdAt","createdBy"]}],h,e$),s(gr,{header:s(xn,{title:`Segments (${c.length})`,actions:T(Re,{children:[s(go,{initialValue:d,onChange:p}),s(xn.Divider,{}),s(nSe,{})]})}),isLoading:t,children:s(X,{condition:!t&&o.length===0,show:s(Zn,{children:s(sSe,{})}),elseShow:()=>T(Re,{children:[s(As,{value:d,children:T(za,{...i(),rowHeight:"standard",children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(m=>(u(m),s(sa,{hover:!0,...m.getRowProps(),children:m.cells.map(y=>s(ta,{...y.getCellProps(),children:y.render("Cell")}))})))})]})}),s(X,{condition:c.length===0&&(d==null?void 0:d.length)>0,show:T(Zn,{children:["No segments found matching “",d,"”"]})})]})})})},e$=[{id:"Icon",width:"1%",disableGlobalFilter:!0,disableSortBy:!0,Cell:()=>s(zv,{icon:s(s3,{color:"disabled"})})},{Header:"Name",accessor:"name",width:"60%",Cell:({value:e,row:{original:t}})=>s(mf,{value:e,subtitle:t.description})},{Header:"Created at",accessor:"createdAt",minWidth:150,Cell:Ep,disableGlobalFilter:!0},{Header:"Created by",accessor:"createdBy",width:"25%"},{Header:"Actions",id:"Actions",align:"center",width:"1%",disableSortBy:!0,disableGlobalFilter:!0,Cell:({row:{original:e}})=>s(bxe,{segment:e})},{accessor:"description"}],Sxe=e=>fetch(e).then(Cn("Feature toggle archive")).then(t=>t.json()),xxe=e=>{const{data:t,error:n,mutate:r,isLoading:o}=gn(Ft(e?`/api/admin/archive/features/${e}`:"api/admin/features"),Sxe,{refreshInterval:15e3});return{archivedFeatures:t==null?void 0:t.features,refetchArchived:r,loading:o,error:n}},Cxe=({onRevive:e,onDelete:t,project:n})=>T(na,{children:[s(mr,{onClick:e,projectId:n,permission:W3,tooltipProps:{title:"Revive feature toggle"},children:s(gte,{})}),s(mr,{permission:yoe,projectId:n,tooltipProps:{title:"Delete feature toggle"},onClick:t,children:s(ti,{})})]}),yD=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{reviveFeature:async a=>{const l=`api/admin/archive/revive/${a}`,c=t(l,{method:"POST"});return e(c.caller,c.id)},deleteFeature:async a=>{const l=`api/admin/archive/${a}`,c=t(l,{method:"DELETE"});return e(c.caller,c.id)},errors:n,loading:r}},Exe=({value:e})=>{const{locationSettings:t}=la(),n=sn();return e?s(fo,{children:s(Tt,{title:`Archived on: ${Vc(e,t.locale)}`,arrow:!0,children:s(ke,{noWrap:!0,variant:"body2","data-loading":!0,children:s(gC,{date:new Date(e),title:"",live:!1})})})}):s(fo,{children:s(ke,{variant:"body2",color:n.palette.text.secondary,children:"not available"})})},kxe=E("p")(({theme:e})=>({marginTop:e.spacing(3)})),Txe=E(_r)(({theme:e})=>({marginTop:e.spacing(2),width:"100%"})),_xe=({deletedFeature:e,open:t,setOpen:n,refetch:r})=>{const[o,i]=f.useState(""),{setToastData:a,setToastApiError:l}=It(),{deleteFeature:c}=yD(),u=async()=>{try{if(!e)return;await c(e.name),await r(),a({type:"success",title:"Feature toggle deleted",text:`You have successfully deleted the ${e.name} feature toggle.`})}catch(h){l(ht(h))}finally{d()}},d=()=>{n(!1),i("")},p="delete-feature-toggle-confirmation-form";return T(cr,{title:"Delete feature toggle?",open:t,primaryButtonText:"Delete feature toggle",secondaryButtonText:"Cancel",onClick:u,onClose:d,disabledPrimaryButton:(e==null?void 0:e.name)!==o,formId:p,children:[T(Xt,{severity:"warning",children:[s("b",{children:"Warning!"})," Before you delete a feature toggle, make sure all in-code references to that feature toggle have been removed. Otherwise, a new feature toggle with the same name could activate the old code paths."]}),T(kxe,{children:["In order to delete this feature toggle, please enter its name in the text field below: ",s("strong",{children:e==null?void 0:e.name})]}),s("form",{id:p,children:s(Txe,{autoFocus:!0,onChange:h=>{i(h.currentTarget.value)},value:o,placeholder:"<feature toggle name>",label:"Feature toggle name"})})]})},Rxe=({archivedFeatures:e=[],loading:t,refetch:n,storedParams:r,setStoredParams:o,title:i,projectId:a})=>{const l=Er(Wc.breakpoints.down("md")),c=Er(Wc.breakpoints.down("lg")),{setToastData:u,setToastApiError:d}=It(),[p,h]=f.useState(!1),[m,y]=f.useState(),[v,b]=jp(),{reviveFeature:w}=yD(),[g,S]=f.useState(v.get("search")||""),C=f.useCallback(async G=>{try{await w(G),await n(),u({type:"success",title:"And we're back!",text:"The feature toggle has been revived."})}catch(Z){d(ht(Z))}},[n,w,d,u]),R=f.useMemo(()=>[{Header:"Seen",width:85,canSort:!0,Cell:oO,accessor:"lastSeenAt",align:"center"},{Header:"Type",accessor:"type",width:85,canSort:!0,Cell:lO,align:"center"},{Header:"Name",accessor:"name",searchable:!0,minWidth:100,Cell:({value:G,row:{original:Z}})=>s(mf,{value:G,subtitle:Z.description}),sortType:"alphanumeric"},{Header:"Created",accessor:"createdAt",width:150,Cell:Ep,sortType:"date"},{Header:"Archived",accessor:"archivedAt",width:150,Cell:Exe,sortType:"date"},...a?[]:[{Header:"Project ID",accessor:"project",sortType:"alphanumeric",filterName:"project",searchable:!0,maxWidth:170,Cell:({value:G})=>s(Os,{title:G,to:`/projects/${G}`})}],{Header:"State",accessor:"stale",Cell:fO,sortType:"boolean",maxWidth:120,filterName:"state",filterParsing:G=>G?"stale":"active"},{Header:"Actions",id:"Actions",align:"center",maxWidth:120,canSort:!1,Cell:({row:{original:G}})=>s(Cxe,{project:G.project,onRevive:()=>C(G.name),onDelete:()=>{y(G),h(!0)}})},{accessor:"description",header:"Description",searchable:!0}],[a]),{data:k,getSearchText:P,getSearchContext:O}=RC(R,g,e),L=f.useMemo(()=>t?wO:k,[k,t]),[I]=f.useState(()=>({sortBy:[{id:v.get("sort")||r.id,desc:v.has("order")?v.get("order")==="desc":r.desc}],hiddenColumns:["description"]})),{headerGroups:A,rows:M,state:{sortBy:F},prepareRow:j,setHiddenColumns:q}=tn.useTable({columns:R,data:L,initialState:I,sortTypes:ca,autoResetHiddenColumns:!1,disableSortRemove:!0,autoResetSortBy:!1},tn.useFlexLayout,tn.useSortBy);return Mv([{condition:l,columns:["type","createdAt"]},{condition:c,columns:["lastSeenAt","stale"]}],q,R),f.useEffect(()=>{if(t)return;const G={};G.sort=F[0].id,F[0].desc&&(G.order="desc"),g&&(G.search=g),b(G,{replace:!0}),o({id:F[0].id,desc:F[0].desc||!1})},[t,F,g]),T(gr,{isLoading:t,header:s(xn,{titleElement:`${i} (${M.length<L.length?`${M.length} of ${L.length}`:L.length})`,actions:s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:O})}),children:[s(As,{value:P(g),children:s(uC,{rows:M,headerGroups:A,prepareRow:j})}),s(X,{condition:M.length===0,show:()=>s(X,{condition:(g==null?void 0:g.length)>0,show:T(Zn,{children:["No feature toggles found matching “",g,"”"]}),elseShow:s(Zn,{children:"None of the feature toggles were archived yet."})})}),s(_xe,{deletedFeature:m,open:p,setOpen:h,refetch:n})]})},Pxe={id:"createdAt"},{value:$xe,setValue:Ixe}=Dv("FeaturesArchiveTable:v1",Pxe),Axe=()=>{cO("Archive");const{archivedFeatures:e=[],loading:t,refetchArchived:n}=xxe();return s(Rxe,{title:"Archive",archivedFeatures:e,loading:t,storedParams:$xe,setStoredParams:Ixe,refetch:n})},Oxe=f.lazy(()=>import("./Playground-8cd49115.js")),Lxe=E(rt)(({theme:e,selected:t})=>({"&.MuiButton-root":{cursor:"pointer",height:e.spacing(6.5),border:0,backgroundColor:t?e.palette.background.paper:"transparent",borderLeft:`${e.spacing(1)} solid ${t?e.palette.primary.main:"transparent"}`,borderRadius:e.shape.borderRadiusMedium,justifyContent:"start",transition:"background-color 0.2s ease",color:e.palette.text.primary,textAlign:"left",padding:e.spacing(2,4),fontSize:e.fontSizes.bodySize,fontWeight:t?e.fontWeight.bold:e.fontWeight.medium,lineHeight:1.2},"&:hover":{backgroundColor:e.palette.neutral.light},"&.Mui-disabled":{pointerEvents:"auto"},justifyContent:"space-between"})),Dxe=({label:e,selected:t,onClick:n})=>s(Lxe,{selected:Boolean(t),onClick:n,disableRipple:!0,disableElevation:!0,disableFocusRipple:!0,disableTouchRipple:!0,fullWidth:!0,children:e}),Nxe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(3),[e.breakpoints.down("md")]:{flexDirection:"column"}})),Mxe=E("div")(()=>({flexGrow:1,display:"flex",flexDirection:"column"})),Bxe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1),width:e.spacing(30),flexShrink:0,[e.breakpoints.down("md")]:{width:"100%"}})),Fxe=({tabs:e,value:t,onChange:n,children:r})=>T(Nxe,{children:[s(Bxe,{children:e.filter(o=>!o.hidden).map(o=>s(Dxe,{label:o.label,selected:o.id===t,onClick:()=>n(o)},o.id))}),s(Mxe,{children:r})]}),zxe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{changePassword:async i=>{const a=t("api/admin/user/change-password",{method:"POST",body:JSON.stringify(i)});try{await e(a.caller,a.id)}catch(l){throw l}},errors:n,loading:r}},jxe=E("form")(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(2),maxWidth:e.spacing(44)})),Uxe=()=>{const[e,t]=f.useState(!1),{setToastData:n,setToastApiError:r}=It(),[o,i]=f.useState(!1),[a,l]=f.useState(),[c,u]=f.useState(""),[d,p]=f.useState(""),{changePassword:h}=zxe(),m=async y=>{if(y.preventDefault(),c===d){if(!o)l(zO);else{t(!0),l(void 0);try{await h({password:c,confirmPassword:d}),n({title:"Password changed successfully",text:"Now you can sign in using your new password.",type:"success"})}catch(v){const b=ht(v);l(b),r(b)}}t(!1)}};return s(gr,{isLoading:e,header:"Change password",children:T(jxe,{children:[s(jO,{password:c,callback:i,"data-loading":!0}),s(Yc,{"data-loading":!0,label:"Password",name:"password",value:c,error:Boolean(a),helperText:a,autoComplete:"new-password",onChange:y=>u(y.target.value)}),s(Yc,{"data-loading":!0,label:"Confirm password",name:"confirmPassword",value:d,autoComplete:"new-password",onChange:y=>p(y.target.value)}),s(WO,{"data-loading":!0,started:Boolean(c&&d),matchingPasswords:c===d}),s(rt,{"data-loading":!0,variant:"contained",color:"primary",type:"submit",onClick:m,children:"Save"})]})})},Wxe=10,M2=e=>{const{data:t,error:n,mutate:r}=gn(Ft(e?`api/admin/user-admin/${e}/pat`:"api/admin/user/tokens"),Hxe);return{tokens:t?t.pats:void 0,loading:!n&&!t,refetchTokens:()=>r(),error:n}},Hxe=e=>fetch(e).then(Cn("Personal API Tokens")).then(t=>t.json()),bD=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createPersonalAPIToken:async c=>{const u=t("api/admin/user/tokens",{method:"POST",body:JSON.stringify(c)});try{return await(await e(u.caller,u.id)).json()}catch(d){throw d}},deletePersonalAPIToken:async c=>{const u=t(`api/admin/user/tokens/${c}`,{method:"DELETE"});try{await e(u.caller,u.id)}catch(d){throw d}},createUserPersonalAPIToken:async(c,u)=>{const d=t(`api/admin/user-admin/${c}/pat`,{method:"POST",body:JSON.stringify(u)});try{return await(await e(d.caller,d.id)).json()}catch(p){throw p}},deleteUserPersonalAPIToken:async(c,u)=>{const d=t(`api/admin/user-admin/${c}/pat/${u}`,{method:"DELETE"});try{await e(d.caller,d.id)}catch(p){throw p}},errors:n,loading:r}},Vxe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")},Gxe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")+"T"+Cp(t,"HH:mm")},qxe=({label:e,type:t="datetime",error:n,errorText:r,min:o,max:i,value:a,onChange:l,...c})=>{const u=t==="datetime"?Gxe:Vxe;return s(pn,{type:t==="datetime"?"datetime-local":"date",size:"small",variant:"outlined",label:e,error:n,helperText:r,value:u(a.toISOString()),onChange:p=>{const h=QO(p.target.value);l(h??a)},FormHelperTextProps:{["data-testid"]:S3},inputProps:{min:o&&u(o.toISOString()),max:i&&u(i.toISOString())},...c})},t$=E("p")(({theme:e})=>({color:e.palette.text.secondary,marginBottom:e.spacing(1)})),Yxe=E(_r)(({theme:e})=>({width:"100%",maxWidth:e.spacing(50),marginBottom:e.spacing(2)})),Kxe=E("div")(({theme:e,custom:t})=>({display:"flex",alignItems:t?"start":"center",gap:e.spacing(1.5),marginBottom:e.spacing(2),[e.breakpoints.down("sm")]:{flexDirection:"column",alignItems:"flex-start"}})),Xxe=E(hD)(({theme:e})=>({minWidth:e.spacing(20),marginRight:e.spacing(.5),[e.breakpoints.down("sm")]:{width:e.spacing(50)}})),Jxe=E(qxe)(({theme:e})=>({width:e.spacing(28),[e.breakpoints.down("sm")]:{width:e.spacing(50)}})),Qxe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(2),maxWidth:e.spacing(50)}));var wD=(e=>(e["7DAYS"]="7d",e["30DAYS"]="30d",e["60DAYS"]="60d",e.NEVER="never",e.CUSTOM="custom",e))(wD||{});const SD=[{key:"7d",days:7,label:"7 days"},{key:"30d",days:30,label:"30 days"},{key:"60d",days:60,label:"60 days"},{key:"never",label:"Never"},{key:"custom",label:"Custom"}],vw=e=>{const t=new Date,n=SD.find(({key:r})=>r===e);return e==="never"?t.setFullYear(t.getFullYear()+1e3):e==="custom"?t.setMinutes(t.getMinutes()+30):n!=null&&n.days&&t.setDate(t.getDate()+n.days),t},Zxe=({description:e,setDescription:t,isDescriptionUnique:n,expiration:r,setExpiration:o,expiresAt:i,setExpiresAt:a,errors:l,setErrors:c})=>{const{locationSettings:u}=la(),d=v=>{c(b=>({...b,[v]:void 0}))},p=(v,b)=>{c(w=>({...w,[v]:b}))};f.useEffect(()=>{d("expiresAt"),a(vw(r))},[r]);const h=v=>{d("description"),n&&!n(v)&&p("description","A token with that description already exists."),t(v)},m=r==="custom",y=i.getFullYear()>new Date().getFullYear()+100;return T(Re,{children:[s(t$,{children:"Describe what this token will be used for"}),s(Yxe,{autoFocus:!0,label:"Description",error:Boolean(l.description),errorText:l.description,value:e,onChange:v=>h(v.target.value),required:!0}),s(t$,{children:"Token expiration date"}),T(Kxe,{custom:m,children:[s(Xxe,{name:"expiration",id:"expiration",label:"Token will expire in",value:r,onChange:v=>o(v.target.value),options:SD}),s(X,{condition:m,show:()=>s(Jxe,{label:"Date",value:i,onChange:v=>{d("expiresAt"),v<new Date&&p("expiresAt","Invalid date, must be in the future"),a(v)},min:new Date,error:Boolean(l.expiresAt),errorText:l.expiresAt,required:!0}),elseShow:s(X,{condition:y,show:T(ke,{variant:"body2",children:["The token will ",s("strong",{children:"never"})," ","expire!"]}),elseShow:()=>T(ke,{variant:"body2",children:["Token will expire on"," ",s("strong",{children:Vc(i,u.locale)})]})})})]}),s(X,{condition:y,show:s(Qxe,{severity:"warning",children:"We strongly recommend that you set an expiration date for your token to help keep your information secure."})})]})},eCe=E("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),tCe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",[e.breakpoints.down("sm")]:{marginTop:e.spacing(4)}})),nCe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),Ch=wD["30DAYS"],rCe=({open:e,setOpen:t,newToken:n})=>{const{tokens:r,refetchTokens:o}=M2(),{createPersonalAPIToken:i,loading:a}=bD(),{setToastApiError:l}=It(),{uiConfig:c}=Lt(),[u,d]=f.useState(""),[p,h]=f.useState(Ch),[m,y]=f.useState(vw(Ch)),[v,b]=f.useState({});f.useEffect(()=>{d(""),h(Ch),y(vw(Ch)),b({})},[e]);const w=()=>({description:u,expiresAt:m}),g=async P=>{P.preventDefault();try{const O=await i(w());n(O),o(),t(!1)}catch(O){l(ht(O))}},S=()=>`curl --location --request POST '${c.unleashUrl}/api/admin/user/tokens' \\
|
|
379
|
+
`,uxe="https://docs.getunleash.io/reference/activation-strategies",dxe="Strategies documentation",pxe=E("ul")({marginBottom:0}),fxe=E(on)(({theme:e})=>({textDecoration:"none",color:e.palette.primary.main,fontWeight:e.fontWeight.bold})),hxe=({segment:e,open:t,onClose:n,strategies:r})=>T(cr,{title:"You can't delete a segment that's currently in use",open:t,primaryButtonText:"OK",onClick:n,children:[T("p",{children:["The following feature toggles are using the"," ",s("strong",{children:e.name})," segment for their strategies:"]}),s(pxe,{children:r==null?void 0:r.map(o=>s("li",{children:T(fxe,{to:sxe(o.projectId,o.featureName,o.environment,o.id),target:"_blank",rel:"noopener noreferrer",children:[o.featureName," ",mxe(o)]})},o.id))})]}),mxe=e=>e.strategyName?`(${kp(e.strategyName)})`:"",gxe=({segment:e,open:t,onClose:n,onRemove:r})=>{const{strategies:o,loading:i}=lSe(e.id),a=(o==null?void 0:o.length)===0;return i?null:s(X,{condition:a,show:s(dSe,{segment:e,open:t,onClose:n,onRemove:r}),elseShow:s(hxe,{segment:e,open:t,onClose:n,strategies:o})})},vxe=({segment:e})=>{const{refetchSegments:t}=Dl(),{deleteSegment:n}=a2(),{setToastData:r,setToastApiError:o}=It(),[i,a]=f.useState(!1),l=async()=>{try{await n(e.id),await t(),r({type:"success",title:"Successfully deleted segment"})}catch(c){o(ht(c))}finally{a(!1)}};return T(Re,{children:[s(mr,{onClick:()=>a(!0),permission:_oe,tooltipProps:{title:"Remove segment"},"data-testid":`${zte}_${e.name}`,children:s(ti,{"data-loading":!0})}),s(X,{condition:i,show:()=>s(gxe,{segment:e,open:i,onClose:()=>a(!1),onRemove:l})})]})},yxe=({segment:e})=>{const t=ft();return s(mr,{onClick:()=>t(`/segments/edit/${e.id}`),permission:lC,tooltipProps:{title:"Edit segment"},children:s(ea,{"data-loading":!0})})},bxe=({segment:e})=>T(na,{children:[s(yxe,{segment:e}),s(vxe,{segment:e})]}),wxe=()=>{const{segments:e,loading:t}=Dl(),n=Er(Wc.breakpoints.down("md")),[r]=f.useState({sortBy:[{id:"createdAt"}],hiddenColumns:["description"]}),o=f.useMemo(()=>e??Array(5).fill({name:"Segment name",description:"Segment descripton",createdAt:new Date().toISOString(),createdBy:"user"}),[e]),{getTableProps:i,getTableBodyProps:a,headerGroups:l,rows:c,prepareRow:u,state:{globalFilter:d},setGlobalFilter:p,setHiddenColumns:h}=tn.useTable({initialState:r,columns:e$,data:o,sortTypes:ca,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,defaultColumn:{Cell:mf}},tn.useGlobalFilter,tn.useSortBy);return Mv([{condition:n,columns:["createdAt","createdBy"]}],h,e$),s(gr,{header:s(xn,{title:`Segments (${c.length})`,actions:T(Re,{children:[s(go,{initialValue:d,onChange:p}),s(xn.Divider,{}),s(nSe,{})]})}),isLoading:t,children:s(X,{condition:!t&&o.length===0,show:s(Zn,{children:s(sSe,{})}),elseShow:()=>T(Re,{children:[s(As,{value:d,children:T(za,{...i(),rowHeight:"standard",children:[s(Fa,{headerGroups:l}),s(Ma,{...a(),children:c.map(m=>(u(m),s(sa,{hover:!0,...m.getRowProps(),children:m.cells.map(y=>s(ta,{...y.getCellProps(),children:y.render("Cell")}))})))})]})}),s(X,{condition:c.length===0&&(d==null?void 0:d.length)>0,show:T(Zn,{children:["No segments found matching “",d,"”"]})})]})})})},e$=[{id:"Icon",width:"1%",disableGlobalFilter:!0,disableSortBy:!0,Cell:()=>s(zv,{icon:s(s3,{color:"disabled"})})},{Header:"Name",accessor:"name",width:"60%",Cell:({value:e,row:{original:t}})=>s(mf,{value:e,subtitle:t.description})},{Header:"Created at",accessor:"createdAt",minWidth:150,Cell:Ep,disableGlobalFilter:!0},{Header:"Created by",accessor:"createdBy",width:"25%"},{Header:"Actions",id:"Actions",align:"center",width:"1%",disableSortBy:!0,disableGlobalFilter:!0,Cell:({row:{original:e}})=>s(bxe,{segment:e})},{accessor:"description"}],Sxe=e=>fetch(e).then(Cn("Feature toggle archive")).then(t=>t.json()),xxe=e=>{const{data:t,error:n,mutate:r,isLoading:o}=gn(Ft(e?`/api/admin/archive/features/${e}`:"api/admin/features"),Sxe,{refreshInterval:15e3});return{archivedFeatures:t==null?void 0:t.features,refetchArchived:r,loading:o,error:n}},Cxe=({onRevive:e,onDelete:t,project:n})=>T(na,{children:[s(mr,{onClick:e,projectId:n,permission:W3,tooltipProps:{title:"Revive feature toggle"},children:s(gte,{})}),s(mr,{permission:yoe,projectId:n,tooltipProps:{title:"Delete feature toggle"},onClick:t,children:s(ti,{})})]}),yD=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{reviveFeature:async a=>{const l=`api/admin/archive/revive/${a}`,c=t(l,{method:"POST"});return e(c.caller,c.id)},deleteFeature:async a=>{const l=`api/admin/archive/${a}`,c=t(l,{method:"DELETE"});return e(c.caller,c.id)},errors:n,loading:r}},Exe=({value:e})=>{const{locationSettings:t}=la(),n=sn();return e?s(fo,{children:s(Tt,{title:`Archived on: ${Vc(e,t.locale)}`,arrow:!0,children:s(ke,{noWrap:!0,variant:"body2","data-loading":!0,children:s(gC,{date:new Date(e),title:"",live:!1})})})}):s(fo,{children:s(ke,{variant:"body2",color:n.palette.text.secondary,children:"not available"})})},kxe=E("p")(({theme:e})=>({marginTop:e.spacing(3)})),Txe=E(_r)(({theme:e})=>({marginTop:e.spacing(2),width:"100%"})),_xe=({deletedFeature:e,open:t,setOpen:n,refetch:r})=>{const[o,i]=f.useState(""),{setToastData:a,setToastApiError:l}=It(),{deleteFeature:c}=yD(),u=async()=>{try{if(!e)return;await c(e.name),await r(),a({type:"success",title:"Feature toggle deleted",text:`You have successfully deleted the ${e.name} feature toggle.`})}catch(h){l(ht(h))}finally{d()}},d=()=>{n(!1),i("")},p="delete-feature-toggle-confirmation-form";return T(cr,{title:"Delete feature toggle?",open:t,primaryButtonText:"Delete feature toggle",secondaryButtonText:"Cancel",onClick:u,onClose:d,disabledPrimaryButton:(e==null?void 0:e.name)!==o,formId:p,children:[T(Xt,{severity:"warning",children:[s("b",{children:"Warning!"})," Before you delete a feature toggle, make sure all in-code references to that feature toggle have been removed. Otherwise, a new feature toggle with the same name could activate the old code paths."]}),T(kxe,{children:["In order to delete this feature toggle, please enter its name in the text field below: ",s("strong",{children:e==null?void 0:e.name})]}),s("form",{id:p,children:s(Txe,{autoFocus:!0,onChange:h=>{i(h.currentTarget.value)},value:o,placeholder:"<feature toggle name>",label:"Feature toggle name"})})]})},Rxe=({archivedFeatures:e=[],loading:t,refetch:n,storedParams:r,setStoredParams:o,title:i,projectId:a})=>{const l=Er(Wc.breakpoints.down("md")),c=Er(Wc.breakpoints.down("lg")),{setToastData:u,setToastApiError:d}=It(),[p,h]=f.useState(!1),[m,y]=f.useState(),[v,b]=jp(),{reviveFeature:w}=yD(),[g,S]=f.useState(v.get("search")||""),C=f.useCallback(async G=>{try{await w(G),await n(),u({type:"success",title:"And we're back!",text:"The feature toggle has been revived."})}catch(Z){d(ht(Z))}},[n,w,d,u]),R=f.useMemo(()=>[{Header:"Seen",width:85,canSort:!0,Cell:oO,accessor:"lastSeenAt",align:"center"},{Header:"Type",accessor:"type",width:85,canSort:!0,Cell:lO,align:"center"},{Header:"Name",accessor:"name",searchable:!0,minWidth:100,Cell:({value:G,row:{original:Z}})=>s(mf,{value:G,subtitle:Z.description}),sortType:"alphanumeric"},{Header:"Created",accessor:"createdAt",width:150,Cell:Ep,sortType:"date"},{Header:"Archived",accessor:"archivedAt",width:150,Cell:Exe,sortType:"date"},...a?[]:[{Header:"Project ID",accessor:"project",sortType:"alphanumeric",filterName:"project",searchable:!0,maxWidth:170,Cell:({value:G})=>s(Os,{title:G,to:`/projects/${G}`})}],{Header:"State",accessor:"stale",Cell:fO,sortType:"boolean",maxWidth:120,filterName:"state",filterParsing:G=>G?"stale":"active"},{Header:"Actions",id:"Actions",align:"center",maxWidth:120,canSort:!1,Cell:({row:{original:G}})=>s(Cxe,{project:G.project,onRevive:()=>C(G.name),onDelete:()=>{y(G),h(!0)}})},{accessor:"description",header:"Description",searchable:!0}],[a]),{data:k,getSearchText:P,getSearchContext:O}=RC(R,g,e),L=f.useMemo(()=>t?wO:k,[k,t]),[I]=f.useState(()=>({sortBy:[{id:v.get("sort")||r.id,desc:v.has("order")?v.get("order")==="desc":r.desc}],hiddenColumns:["description"]})),{headerGroups:A,rows:M,state:{sortBy:F},prepareRow:j,setHiddenColumns:q}=tn.useTable({columns:R,data:L,initialState:I,sortTypes:ca,autoResetHiddenColumns:!1,disableSortRemove:!0,autoResetSortBy:!1},tn.useFlexLayout,tn.useSortBy);return Mv([{condition:l,columns:["type","createdAt"]},{condition:c,columns:["lastSeenAt","stale"]}],q,R),f.useEffect(()=>{if(t)return;const G={};G.sort=F[0].id,F[0].desc&&(G.order="desc"),g&&(G.search=g),b(G,{replace:!0}),o({id:F[0].id,desc:F[0].desc||!1})},[t,F,g]),T(gr,{isLoading:t,header:s(xn,{titleElement:`${i} (${M.length<L.length?`${M.length} of ${L.length}`:L.length})`,actions:s(go,{initialValue:g,onChange:S,hasFilters:!0,getSearchContext:O})}),children:[s(As,{value:P(g),children:s(uC,{rows:M,headerGroups:A,prepareRow:j})}),s(X,{condition:M.length===0,show:()=>s(X,{condition:(g==null?void 0:g.length)>0,show:T(Zn,{children:["No feature toggles found matching “",g,"”"]}),elseShow:s(Zn,{children:"None of the feature toggles were archived yet."})})}),s(_xe,{deletedFeature:m,open:p,setOpen:h,refetch:n})]})},Pxe={id:"createdAt"},{value:$xe,setValue:Ixe}=Dv("FeaturesArchiveTable:v1",Pxe),Axe=()=>{cO("Archive");const{archivedFeatures:e=[],loading:t,refetchArchived:n}=xxe();return s(Rxe,{title:"Archive",archivedFeatures:e,loading:t,storedParams:$xe,setStoredParams:Ixe,refetch:n})},Oxe=f.lazy(()=>import("./Playground-d443ad89.js")),Lxe=E(rt)(({theme:e,selected:t})=>({"&.MuiButton-root":{cursor:"pointer",height:e.spacing(6.5),border:0,backgroundColor:t?e.palette.background.paper:"transparent",borderLeft:`${e.spacing(1)} solid ${t?e.palette.primary.main:"transparent"}`,borderRadius:e.shape.borderRadiusMedium,justifyContent:"start",transition:"background-color 0.2s ease",color:e.palette.text.primary,textAlign:"left",padding:e.spacing(2,4),fontSize:e.fontSizes.bodySize,fontWeight:t?e.fontWeight.bold:e.fontWeight.medium,lineHeight:1.2},"&:hover":{backgroundColor:e.palette.neutral.light},"&.Mui-disabled":{pointerEvents:"auto"},justifyContent:"space-between"})),Dxe=({label:e,selected:t,onClick:n})=>s(Lxe,{selected:Boolean(t),onClick:n,disableRipple:!0,disableElevation:!0,disableFocusRipple:!0,disableTouchRipple:!0,fullWidth:!0,children:e}),Nxe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(3),[e.breakpoints.down("md")]:{flexDirection:"column"}})),Mxe=E("div")(()=>({flexGrow:1,display:"flex",flexDirection:"column"})),Bxe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1),width:e.spacing(30),flexShrink:0,[e.breakpoints.down("md")]:{width:"100%"}})),Fxe=({tabs:e,value:t,onChange:n,children:r})=>T(Nxe,{children:[s(Bxe,{children:e.filter(o=>!o.hidden).map(o=>s(Dxe,{label:o.label,selected:o.id===t,onClick:()=>n(o)},o.id))}),s(Mxe,{children:r})]}),zxe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{changePassword:async i=>{const a=t("api/admin/user/change-password",{method:"POST",body:JSON.stringify(i)});try{await e(a.caller,a.id)}catch(l){throw l}},errors:n,loading:r}},jxe=E("form")(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(2),maxWidth:e.spacing(44)})),Uxe=()=>{const[e,t]=f.useState(!1),{setToastData:n,setToastApiError:r}=It(),[o,i]=f.useState(!1),[a,l]=f.useState(),[c,u]=f.useState(""),[d,p]=f.useState(""),{changePassword:h}=zxe(),m=async y=>{if(y.preventDefault(),c===d){if(!o)l(zO);else{t(!0),l(void 0);try{await h({password:c,confirmPassword:d}),n({title:"Password changed successfully",text:"Now you can sign in using your new password.",type:"success"})}catch(v){const b=ht(v);l(b),r(b)}}t(!1)}};return s(gr,{isLoading:e,header:"Change password",children:T(jxe,{children:[s(jO,{password:c,callback:i,"data-loading":!0}),s(Yc,{"data-loading":!0,label:"Password",name:"password",value:c,error:Boolean(a),helperText:a,autoComplete:"new-password",onChange:y=>u(y.target.value)}),s(Yc,{"data-loading":!0,label:"Confirm password",name:"confirmPassword",value:d,autoComplete:"new-password",onChange:y=>p(y.target.value)}),s(WO,{"data-loading":!0,started:Boolean(c&&d),matchingPasswords:c===d}),s(rt,{"data-loading":!0,variant:"contained",color:"primary",type:"submit",onClick:m,children:"Save"})]})})},Wxe=10,M2=e=>{const{data:t,error:n,mutate:r}=gn(Ft(e?`api/admin/user-admin/${e}/pat`:"api/admin/user/tokens"),Hxe);return{tokens:t?t.pats:void 0,loading:!n&&!t,refetchTokens:()=>r(),error:n}},Hxe=e=>fetch(e).then(Cn("Personal API Tokens")).then(t=>t.json()),bD=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{createPersonalAPIToken:async c=>{const u=t("api/admin/user/tokens",{method:"POST",body:JSON.stringify(c)});try{return await(await e(u.caller,u.id)).json()}catch(d){throw d}},deletePersonalAPIToken:async c=>{const u=t(`api/admin/user/tokens/${c}`,{method:"DELETE"});try{await e(u.caller,u.id)}catch(d){throw d}},createUserPersonalAPIToken:async(c,u)=>{const d=t(`api/admin/user-admin/${c}/pat`,{method:"POST",body:JSON.stringify(u)});try{return await(await e(d.caller,d.id)).json()}catch(p){throw p}},deleteUserPersonalAPIToken:async(c,u)=>{const d=t(`api/admin/user-admin/${c}/pat/${u}`,{method:"DELETE"});try{await e(d.caller,d.id)}catch(p){throw p}},errors:n,loading:r}},Vxe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")},Gxe=e=>{const t=new Date(e);return Cp(t,"yyyy-MM-dd")+"T"+Cp(t,"HH:mm")},qxe=({label:e,type:t="datetime",error:n,errorText:r,min:o,max:i,value:a,onChange:l,...c})=>{const u=t==="datetime"?Gxe:Vxe;return s(pn,{type:t==="datetime"?"datetime-local":"date",size:"small",variant:"outlined",label:e,error:n,helperText:r,value:u(a.toISOString()),onChange:p=>{const h=QO(p.target.value);l(h??a)},FormHelperTextProps:{["data-testid"]:S3},inputProps:{min:o&&u(o.toISOString()),max:i&&u(i.toISOString())},...c})},t$=E("p")(({theme:e})=>({color:e.palette.text.secondary,marginBottom:e.spacing(1)})),Yxe=E(_r)(({theme:e})=>({width:"100%",maxWidth:e.spacing(50),marginBottom:e.spacing(2)})),Kxe=E("div")(({theme:e,custom:t})=>({display:"flex",alignItems:t?"start":"center",gap:e.spacing(1.5),marginBottom:e.spacing(2),[e.breakpoints.down("sm")]:{flexDirection:"column",alignItems:"flex-start"}})),Xxe=E(hD)(({theme:e})=>({minWidth:e.spacing(20),marginRight:e.spacing(.5),[e.breakpoints.down("sm")]:{width:e.spacing(50)}})),Jxe=E(qxe)(({theme:e})=>({width:e.spacing(28),[e.breakpoints.down("sm")]:{width:e.spacing(50)}})),Qxe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(2),maxWidth:e.spacing(50)}));var wD=(e=>(e["7DAYS"]="7d",e["30DAYS"]="30d",e["60DAYS"]="60d",e.NEVER="never",e.CUSTOM="custom",e))(wD||{});const SD=[{key:"7d",days:7,label:"7 days"},{key:"30d",days:30,label:"30 days"},{key:"60d",days:60,label:"60 days"},{key:"never",label:"Never"},{key:"custom",label:"Custom"}],vw=e=>{const t=new Date,n=SD.find(({key:r})=>r===e);return e==="never"?t.setFullYear(t.getFullYear()+1e3):e==="custom"?t.setMinutes(t.getMinutes()+30):n!=null&&n.days&&t.setDate(t.getDate()+n.days),t},Zxe=({description:e,setDescription:t,isDescriptionUnique:n,expiration:r,setExpiration:o,expiresAt:i,setExpiresAt:a,errors:l,setErrors:c})=>{const{locationSettings:u}=la(),d=v=>{c(b=>({...b,[v]:void 0}))},p=(v,b)=>{c(w=>({...w,[v]:b}))};f.useEffect(()=>{d("expiresAt"),a(vw(r))},[r]);const h=v=>{d("description"),n&&!n(v)&&p("description","A token with that description already exists."),t(v)},m=r==="custom",y=i.getFullYear()>new Date().getFullYear()+100;return T(Re,{children:[s(t$,{children:"Describe what this token will be used for"}),s(Yxe,{autoFocus:!0,label:"Description",error:Boolean(l.description),errorText:l.description,value:e,onChange:v=>h(v.target.value),required:!0}),s(t$,{children:"Token expiration date"}),T(Kxe,{custom:m,children:[s(Xxe,{name:"expiration",id:"expiration",label:"Token will expire in",value:r,onChange:v=>o(v.target.value),options:SD}),s(X,{condition:m,show:()=>s(Jxe,{label:"Date",value:i,onChange:v=>{d("expiresAt"),v<new Date&&p("expiresAt","Invalid date, must be in the future"),a(v)},min:new Date,error:Boolean(l.expiresAt),errorText:l.expiresAt,required:!0}),elseShow:s(X,{condition:y,show:T(ke,{variant:"body2",children:["The token will ",s("strong",{children:"never"})," ","expire!"]}),elseShow:()=>T(ke,{variant:"body2",children:["Token will expire on"," ",s("strong",{children:Vc(i,u.locale)})]})})})]}),s(X,{condition:y,show:s(Qxe,{severity:"warning",children:"We strongly recommend that you set an expiration date for your token to help keep your information secure."})})]})},eCe=E("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),tCe=E("div")(({theme:e})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",[e.breakpoints.down("sm")]:{marginTop:e.spacing(4)}})),nCe=E(rt)(({theme:e})=>({marginLeft:e.spacing(3)})),Ch=wD["30DAYS"],rCe=({open:e,setOpen:t,newToken:n})=>{const{tokens:r,refetchTokens:o}=M2(),{createPersonalAPIToken:i,loading:a}=bD(),{setToastApiError:l}=It(),{uiConfig:c}=Lt(),[u,d]=f.useState(""),[p,h]=f.useState(Ch),[m,y]=f.useState(vw(Ch)),[v,b]=f.useState({});f.useEffect(()=>{d(""),h(Ch),y(vw(Ch)),b({})},[e]);const w=()=>({description:u,expiresAt:m}),g=async P=>{P.preventDefault();try{const O=await i(w());n(O),o(),t(!1)}catch(O){l(ht(O))}},S=()=>`curl --location --request POST '${c.unleashUrl}/api/admin/user/tokens' \\
|
|
380
380
|
--header 'Authorization: INSERT_API_KEY' \\
|
|
381
381
|
--header 'Content-Type: application/json' \\
|
|
382
382
|
--data-raw '${JSON.stringify(w(),void 0,2)}'`,C=P=>P.length,R=P=>!(r!=null&&r.some(O=>O.description===P)),k=C(u)&&R(u)&&m>new Date;return s(c2,{open:e,onClose:()=>{t(!1)},label:"Create personal API token",children:s(Nr,{loading:a,modal:!0,title:"Create personal API token",description:`Use personal API tokens to authenticate to the Unleash API as
|
|
383
383
|
yourself. A personal API token has the same access privileges as
|
|
384
|
-
your user.`,documentationLink:"https://docs.getunleash.io/reference/api-tokens-and-client-keys",documentationLinkLabel:"Tokens documentation",formatApiCode:S,children:T(eCe,{onSubmit:g,children:[s("div",{children:s(Zxe,{description:u,setDescription:d,isDescriptionUnique:R,expiration:p,setExpiration:h,expiresAt:m,setExpiresAt:y,errors:v,setErrors:b})}),T(tCe,{children:[s(rt,{type:"submit",variant:"contained",color:"primary",disabled:!k,children:"Create token"}),s(nCe,{onClick:()=>{t(!1)},children:"Cancel"})]})]})})})},oCe=({open:e,setOpen:t,token:n})=>{const{refetchTokens:r}=M2(),{deletePersonalAPIToken:o}=bD(),{setToastData:i,setToastApiError:a}=It();return s(cr,{open:e,primaryButtonText:"Delete token",secondaryButtonText:"Cancel",onClick:async()=>{if(n)try{await o(n==null?void 0:n.id),r(),t(!1),i({title:"Token deleted successfully",type:"success"})}catch(c){a(ht(c))}},onClose:()=>{t(!1)},title:"Delete token?",children:T(ke,{children:['Any applications or scripts using this token "',s("strong",{children:n==null?void 0:n.description}),'" will no longer be able to access the Unleash API. You cannot undo this action.']})})},iCe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(3)})),aCe=({open:e,setOpen:t,token:n})=>T(cr,{open:e,secondaryButtonText:"Close",onClose:(r,o)=>{o||t(!1)},title:"Personal API token created",children:[s(iCe,{severity:"info",children:"Make sure to copy your personal API token now. You won't be able to see it again!"}),s(ke,{variant:"body1",children:"Your token:"}),s(uD,{token:(n==null?void 0:n.secret)||""})]}),sCe=({value:e,live:t=!1,emptyText:n,title:r})=>{const{locationSettings:o}=la();if(!e)return s(fo,{children:n});const i=Vc(e,o.locale);return s(fo,{children:s(Tt,{title:(r==null?void 0:r(i))??i,arrow:!0,children:s(ke,{noWrap:!0,component:"span",variant:"body2","data-loading":!0,children:s(gC,{date:new Date(e),live:t,title:""})})})})},lCe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(3)})),cCe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(10,2)})),uCe=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(1.5)})),dCe=E(ke)(({theme:e})=>({color:e.palette.text.secondary,marginBottom:e.spacing(4.5)})),pCe=Array(15).fill({description:"Short description of the feature",type:"-",createdAt:new Date(2022,1,1),project:"projectID"}),fCe={id:"createdAt"},{value:n$,setValue:hCe}=Dv("PersonalAPITokensTable:v1",fCe),mCe=()=>{const e=sn(),t=Er(e.breakpoints.down("md")),n=Er(e.breakpoints.down("sm")),{tokens:r=[],loading:o}=M2(),[i,a]=jp(),[l]=f.useState(()=>({sortBy:[{id:i.get("sort")||n$.id,desc:i.has("order")?i.get("order")==="desc":n$.desc}],globalFilter:i.get("search")||""})),[c,u]=f.useState(l.globalFilter),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[y,v]=f.useState(!1),[b,w]=f.useState(),[g,S]=f.useState(),C=f.useMemo(()=>[{Header:"Description",accessor:"description",Cell:mf,minWidth:100,searchable:!0},{Header:"Expires",accessor:"expiresAt",Cell:({value:j})=>new Date(j).getFullYear()>new Date().getFullYear()+100?s(fo,{children:"Never"}):s(Ep,{value:j}),sortType:"date",maxWidth:150},{Header:"Created",accessor:"createdAt",Cell:Ep,sortType:"date",maxWidth:150},{Header:"Last seen",accessor:"seenAt",Cell:sCe,sortType:"date",maxWidth:150},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:j}})=>s(na,{children:s(Tt,{title:"Delete token",arrow:!0,describeChild:!0,children:s("span",{children:s(Qt,{onClick:()=>{S(j),v(!0)},children:s(ti,{})})})})}),maxWidth:100,disableSortBy:!0}],[S,v]),{data:R,getSearchText:k,getSearchContext:P}=RC(C,c,r),O=f.useMemo(()=>(R==null?void 0:R.length)===0&&o?pCe:R,[R,o]),{headerGroups:L,rows:I,prepareRow:A,state:{sortBy:M},setHiddenColumns:F}=tn.useTable({columns:C,data:O,initialState:l,sortTypes:ca,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},tn.useSortBy,tn.useFlexLayout);return Mv([{condition:n,columns:["expiresAt"]},{condition:t,columns:["createdAt"]}],F,C),f.useEffect(()=>{const j={};j.sort=M[0].id,M[0].desc&&(j.order="desc"),c&&(j.search=c),a(j,{replace:!0}),hCe({id:M[0].id,desc:M[0].desc||!1})},[M,c,a]),T(gr,{isLoading:o,header:s(xn,{title:`Personal API tokens (${I.length<O.length?`${I.length} of ${O.length}`:O.length})`,actions:T(Re,{children:[s(X,{condition:!t,show:T(Re,{children:[s(go,{initialValue:c,onChange:u,getSearchContext:P}),s(xn.Divider,{})]})}),s(rt,{variant:"contained",color:"primary",disabled:r.length>=Wxe,onClick:()=>p(!0),children:"New token"})]}),children:s(X,{condition:t,show:s(go,{initialValue:c,onChange:u,hasFilters:!0,getSearchContext:P})})}),children:[s(lCe,{severity:"info",children:"Use personal API tokens to authenticate to the Unleash API as yourself. A personal API token has the same access privileges as your user."}),s(As,{value:k(c),children:s(uC,{rows:I,headerGroups:L,prepareRow:A})}),s(X,{condition:I.length===0,show:s(X,{condition:(c==null?void 0:c.length)>0,show:T(Zn,{children:["No tokens found matching “",c,"”"]}),elseShow:T(cCe,{children:[s(uCe,{children:"You have no personal API tokens yet."}),s(dCe,{variant:"body2",children:"Need an API token for scripts or testing? Create a personal API token for quick access to the Unleash API."}),s(rt,{variant:"outlined",onClick:()=>p(!0),children:"Create your first token"})]})})}),s(rCe,{open:d,setOpen:p,newToken:j=>{w(j),m(!0)}}),s(aCe,{open:h,setOpen:m,token:b}),s(oCe,{open:y,setOpen:v,token:g})]})},gCe=()=>{const{data:e,error:t,mutate:n}=gn(Ft("api/admin/user/profile"),vCe);return{profile:e,loading:!t&&!e,refetchProfile:()=>n(),error:t}},vCe=e=>fetch(e).then(Cn("Profile")).then(t=>t.json());var B2={},yCe=fn;Object.defineProperty(B2,"__esModule",{value:!0});var xD=B2.default=void 0,bCe=yCe(En()),wCe=kn,SCe=(0,bCe.default)((0,wCe.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");xD=B2.default=SCe;var F2={},xCe=fn;Object.defineProperty(F2,"__esModule",{value:!0});var CD=F2.default=void 0,CCe=xCe(En()),ECe=kn,kCe=(0,CCe.default)((0,ECe.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16.77c.68 0 1.23-.56 1.23-1.23V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-2-6H6v-2h12v2zm-4 4H6v-2h8v2z"}),"TopicOutlined");CD=F2.default=kCe;const TCe=E("div")(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",padding:e.spacing(6),borderRadius:e.shape.borderRadiusLarge,backgroundColor:e.palette.primary.main,color:e.palette.text.tertiaryContrast,marginBottom:e.spacing(3),boxShadow:e.boxShadows.primaryHeader})),_Ce=E("div")(()=>({flexGrow:1})),RCe=E(ke)(({theme:e})=>({fontSize:e.spacing(3.75)})),PCe=E(tC)(({theme:e})=>({width:e.spacing(9.5),height:e.spacing(9.5),marginRight:e.spacing(3)})),r$=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(3)})),$Ce=E("div")(({theme:e})=>({display:"flex",flexDirection:"row","& > div > p":{marginBottom:e.spacing(1.5)}})),ICe=E(bi)(({theme:e})=>({cursor:"pointer",marginRight:e.spacing(1)})),ACe=E("div")(({theme:e})=>({width:"100%",height:"1px",backgroundColor:e.palette.divider,margin:e.spacing(3,0)})),OCe=E(Da)(({theme:e})=>({marginTop:e.spacing(1.5),width:e.spacing(30)})),LCe=E(Zp)(({theme:e})=>({backgroundColor:e.palette.inputLabelBackground})),DCe=({user:e})=>{const{profile:t}=gCe(),n=ft(),{locationSettings:r,setLocationSettings:o}=la(),[i,a]=f.useState(),[l,c]=f.useState(["en-US","en-GB","nb-NO","sv-SE","da-DK","en-IN","de","cs","pt-BR","fr-FR"]);f.useEffect(()=>{const d=l.find(p=>p.toLowerCase().includes(r.locale.toLowerCase()));a(d),d||c(p=>[...p,r.locale])},[r]);const u=d=>{const p=d.target.value;a(p),o({locale:p})};return T(Re,{children:[T(TCe,{children:[s(PCe,{user:e}),T(_Ce,{children:[s(RCe,{children:e.name||e.username}),s(ke,{variant:"body1",children:e.email})]})]}),T(gr,{children:[s(r$,{children:"Access"}),T($Ce,{children:[T(Je,{sx:{width:"50%"},children:[s(ke,{variant:"body2",children:"Your root role"}),s(Tt,{title:(t==null?void 0:t.rootRole.description)||"",arrow:!0,placement:"bottom-end",describeChild:!0,children:s(bi,{color:"success",icon:s(xD,{}),iconRight:!0,children:t==null?void 0:t.rootRole.name})})]}),T(Je,{children:[s(ke,{variant:"body2",children:"Projects"}),s(X,{condition:Boolean(t==null?void 0:t.projects.length),show:t==null?void 0:t.projects.map(d=>s(Tt,{title:"View project",arrow:!0,placement:"bottom-end",describeChild:!0,children:s(ICe,{onClick:p=>{p.preventDefault(),n(`/projects/${d}`)},color:"secondary",icon:s(CD,{}),children:d})},d)),elseShow:s(Tt,{title:"You are not assigned to any projects",arrow:!0,describeChild:!0,children:s(bi,{children:"No projects"})})})]})]}),s(ACe,{}),s(r$,{children:"Settings"}),s(ke,{variant:"body2",children:"This is the format used across the system for time and date"}),T(OCe,{variant:"outlined",size:"small",children:[s(LCe,{htmlFor:"locale-select",children:"Date/Time formatting"}),s(ef,{id:"locale-select",value:i||"",native:!0,onChange:u,MenuProps:{style:{zIndex:9999}},children:l.map(d=>s("option",{value:d,children:d},d))})]})]})]})},NCe=()=>{const{user:e}=si(),t=ri(),n=ft(),r=[{id:"profile",label:"Profile"},{id:"password",label:"Change password",path:"change-password"},{id:"pat",label:"Personal API tokens",path:"personal-api-tokens"}],o=c=>{n(c.path?`/profile/${c.path}`:"/profile",{replace:!0}),l(c.id)},i=()=>{const c=t.pathname;return(r.find(({path:d})=>d&&c.includes(d))||r[0]).id},[a,l]=f.useState(i());return f.useEffect(()=>{l(i())},[t]),T(Fxe,{tabs:r,value:a,onChange:o,children:[s(X,{condition:a==="profile",show:s(DCe,{user:e})}),s(X,{condition:a==="password",show:s(Uxe,{})}),s(X,{condition:a==="pat",show:s(mCe,{})})]})},MCe=f.lazy(()=>import("./CreateProject-97475ef8.js")),BCe=f.lazy(()=>import("./FeatureViewLazyExport-d023143d.js")),FCe=f.lazy(()=>import("./LazyAdminExport-2cab3449.js")),zCe=f.lazy(()=>import("./LazyProjectExport-62a8eb83.js")),jCe=()=>s(Il,{to:"/admin/users",replace:!0}),$p=[{path:"/splash/:splashId",title:"Unleash",component:Age,type:"protected",menu:{},isStandalone:!0},{path:"/projects/create",parent:"/projects",title:"Create",component:MCe,type:"protected",enterprise:!0,menu:{}},{path:"/projects/:projectId/edit",parent:"/projects",title:":projectId",component:she,type:"protected",enterprise:!0,menu:{}},{path:"/projects/:projectId/archived",title:":projectId",parent:"/archive",component:Lpe,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/:activeTab/copy",parent:"/projects/:projectId/features/:featureId/:activeTab",title:"Copy",component:Lme,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/edit",parent:"/projects",title:"Edit feature",component:Bhe,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/*",parent:"/projects",title:"FeatureView",component:BCe,type:"protected",menu:{}},{path:"/projects/:projectId/create-toggle",parent:"/projects/:projectId/features",title:"Create feature toggle",component:whe,type:"protected",menu:{}},{path:"/projects/:projectId/features2/:featureId",parent:"/features",title:":featureId",component:UR,type:"protected",menu:{}},{path:"/projects/:projectId/*",parent:"/projects",title:":projectId",component:zCe,flag:bde,type:"protected",menu:{}},{path:"/projects",title:"Projects",component:Ope,type:"protected",menu:{mobile:!0}},{path:"/features/:activeTab/:featureId",parent:"/features",title:":featureId",component:UR,type:"protected",menu:{}},{path:"/features",title:"Feature toggles",component:jle,type:"protected",menu:{mobile:!0}},{path:"/playground",title:"Playground",component:Oxe,hidden:!1,type:"protected",menu:{mobile:!0}},{path:"/applications/:name",title:":name",parent:"/applications",component:Hhe,type:"protected",menu:{}},{path:"/applications",title:"Applications",component:Vhe,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/context/create",parent:"/context",title:"Create",component:Dge,type:"protected",menu:{}},{path:"/context/edit/:name",parent:"/context",title:":name",component:Ufe,type:"protected",menu:{}},{path:"/context",title:"Context fields",component:Yhe,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/strategies/create",title:"Create",parent:"/strategies",component:hge,type:"protected",menu:{}},{path:"/strategies/:name/edit",title:":name",parent:"/strategies",component:gge,type:"protected",menu:{}},{path:"/strategies/:name",title:":name",parent:"/strategies",component:_ce,type:"protected",menu:{}},{path:"/strategies",title:"Strategy types",component:sue,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/environments/create",title:"Environments",component:xfe,parent:"/environments",type:"protected",menu:{}},{path:"/environments/:id",title:"Edit",component:kfe,type:"protected",menu:{}},{path:"/environments",title:"Environments",component:eSe,type:"protected",flag:wde,menu:{mobile:!0,advanced:!0}},{path:"/tag-types/create",parent:"/tag-types",title:"Create",component:Qfe,type:"protected",menu:{}},{path:"/tag-types/edit/:name",parent:"/tag-types",title:":name",component:Jfe,type:"protected",menu:{}},{path:"/tag-types",title:"Tag types",component:uue,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/addons/create/:providerId",parent:"/addons",title:"Create",component:Pme,type:"protected",menu:{}},{path:"/addons/edit/:addonId",parent:"/addons",title:"Edit",component:$me,type:"protected",menu:{}},{path:"/addons",title:"Addons",component:Sue,hidden:!1,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/segments/create",title:"Segments",component:nwe,hidden:!1,type:"protected",layout:"main",menu:{},flag:N1},{path:"/segments/edit/:segmentId",title:"Segments",component:iwe,hidden:!1,type:"protected",layout:"main",menu:{},flag:N1},{path:"/segments",title:"Segments",component:wxe,hidden:!1,type:"protected",menu:{mobile:!0,advanced:!0},flag:N1},{path:"/history",title:"Event log",component:Jme,type:"protected",menu:{adminSettings:!0}},{path:"/archive",title:"Archived toggles",component:Axe,type:"protected",menu:{}},{path:"/admin",title:"Admin",component:jCe,hidden:!1,type:"protected",menu:{}},{path:"/admin/*",title:"Admin",component:FCe,hidden:!1,type:"protected",menu:{}},{path:"/profile/*",title:"Profile",component:NCe,type:"protected",menu:{}},{path:"/login",title:"Log in",component:yde,type:"unprotected",hidden:!0,menu:{},isStandalone:!0},{path:"/new-user",title:"New user",hidden:!0,component:Kde,type:"unprotected",menu:{},isStandalone:!0},{path:"/reset-password",title:"Reset password",hidden:!0,component:Qde,type:"unprotected",menu:{},isStandalone:!0},{path:"/forgotten-password",title:"Forgotten password",hidden:!0,component:ipe,type:"unprotected",menu:{},isStandalone:!0}],UCe=[{path:"/history",title:"Event log",menu:{adminSettings:!0}},{path:"/admin/users",title:"Users",menu:{adminSettings:!0}},{path:"/admin/groups",title:"Groups",menu:{adminSettings:!0},flag:xde},{path:"/admin/roles",title:"Project roles",flag:Sde,menu:{adminSettings:!0}},{path:"/admin/auth",title:"Single sign-on",menu:{adminSettings:!0}},{path:"/admin/instance",title:"Instance stats",menu:{adminSettings:!0}},{path:"/admin/service-accounts",title:"Service accounts",menu:{adminSettings:!0},flag:"serviceAccounts"},{path:"/admin/network/*",title:"Network",menu:{adminSettings:!0},flag:"networkView"},{path:"/admin/maintenance",title:"Maintenance",menu:{adminSettings:!0},flag:"maintenance"},{path:"/admin/cors",title:"CORS origins",flag:"embedProxyFrontend",menu:{adminSettings:!0}},{path:"/admin/admin-invoices",title:"Billing & invoices",menu:{adminSettings:!0,isEnterprise:!0}}],WCe=$p.filter(e=>!e.hidden),HCe=()=>{const e=WCe.filter(o=>o.menu.advanced),t=$p.filter(o=>o.menu.adminSettings),n=$p.filter(o=>o.menu.mobile),r={mainNavRoutes:e,adminRoutes:t,mobileRoutes:n};return()=>r},o$=e=>e.map(t=>({path:t.path,flag:t.flag,title:t.title,menu:t.menu,configFlag:t.configFlag})),VCe=HCe(),i$=E(BH)(({theme:e})=>({backgroundColor:e.palette.headerBackground,padding:e.spacing(1),boxShadow:"none",position:"relative",zIndex:300})),a$=E(cq)(({theme:e})=>({display:"flex",alignItems:"center",maxWidth:1280,[e.breakpoints.down("md")]:{padding:"0"}})),s$=E("div")({marginLeft:"auto",display:"flex",alignItems:"center"}),GCe=E("nav")({display:"flex",alignItems:"center",flexGrow:1}),qCe=E(Ure)({width:"150px"}),YCe=E(jre)({width:"150px"}),KCe=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",marginLeft:e.spacing(3),"& a":{textDecoration:"none",color:"inherit",marginRight:e.spacing(3),display:"flex",alignItems:"center"}})),XCe=E("button")(({theme:e})=>({border:"none",background:"transparent",height:"100%",display:"flex",fontSize:e.fontSizes.bodySize,fontFamily:e.typography.fontFamily,alignItems:"center",color:"inherit",cursor:"pointer"})),l$=e=>({color:e.palette.neutral.main}),Eh=E(on)(({theme:e})=>Pv(e)),JCe=E(Qt)(({theme:e})=>({...Pv(e),borderRadius:100})),QCe=()=>{const{onSetThemeMode:e,themeMode:t}=y3(),n=sn(),r=Ss(),o=Ss(),[i,a]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!1),{permissions:p}=WC(),{uiConfig:h,isOss:m}=Lt(),y=Er(n.breakpoints.down("md")),[v,b]=f.useState(!1),w=()=>b(P=>!P),g=()=>a(null),S=()=>c(null);f.useEffect(()=>{(p==null?void 0:p.find(O=>O.permission===xi))&&d(!0)},[p]);const C=VCe(),R=P=>!P.menu.isEnterprise||!m(),k={mainNavRoutes:o$(C.mainNavRoutes).concat([{path:"/admin/api",title:"API access",menu:{}}]).filter(z1(h)),mobileRoutes:o$(C.mobileRoutes).filter(z1(h)),adminRoutes:UCe.filter(z1(h)).filter(R).map(P=>({...P,path:P.path.replace("/*","")}))};return y?s(i$,{position:"static",children:T(a$,{children:[s(Tt,{title:"Menu",arrow:!0,children:s(Qt,{sx:{color:P=>P.palette.text.primary},onClick:w,"aria-controls":"header-drawer","aria-expanded":v,size:"large",children:s(O3,{})})}),s(voe,{title:h.name,flags:h.flags,links:h.links,open:v,toggleDrawer:w,admin:u,routes:k}),s(s$,{children:s(K_,{})})]})}):s(i$,{position:"static",children:T(a$,{children:[s(Eh,{to:"/",sx:$v,"aria-label":"Home",children:s(mw,{darkmode:s(qCe,{"aria-label":"Unleash logo"}),lightmode:s(YCe,{"aria-label":"Unleash logo"})})}),T(GCe,{children:[T(KCe,{children:[s(Eh,{to:"/projects",children:"Projects"}),s(Eh,{to:"/features",children:"Feature toggles"}),s(Eh,{to:"/playground",children:"Playground"}),T(XCe,{onClick:P=>c(P.currentTarget),"aria-controls":l?o:void 0,"aria-expanded":Boolean(l),children:["Configure",s(jb,{sx:l$})]}),s(eR,{id:o,options:k.mainNavRoutes,anchorEl:l,handleClose:S,style:{top:10}})]}),T(s$,{children:[s(X,{condition:Boolean(h.flags.ENABLE_DARK_MODE_SUPPORT),show:s(xr,{control:s(Na,{onChange:e,checked:t==="dark"}),label:"darkmode"})}),s(Tt,{title:"Documentation",arrow:!0,children:s(Qt,{href:"https://docs.getunleash.io/",target:"_blank",rel:"noopener noreferrer",size:"large",disableRipple:!0,sx:Pv,children:s(rC,{})})}),s(X,{condition:u,show:s(Tt,{title:"Settings",arrow:!0,children:T(JCe,{onClick:P=>a(P.currentTarget),"aria-controls":i?r:void 0,"aria-expanded":Boolean(i),size:"large",disableRipple:!0,children:[s(L3,{}),s(jb,{sx:l$})]})})}),s(eR,{id:r,options:k.adminRoutes,anchorEl:i,handleClose:g,style:{top:5,left:-100}})," ",s(K_,{})]})]})]})})},ZCe=e=>{var n;const t=(n=e.versionInfo)==null?void 0:n.current;return t!=null&&t.enterprise?`${e.name} ${t.enterprise}`:t!=null&&t.oss?`${e.name} ${t.oss}`:`${e.name} ${e.version}`},e2e=e=>{var r,o;const t=(r=e.versionInfo)==null?void 0:r.latest,n=(o=e.versionInfo)==null?void 0:o.isLatest;if(t!=null&&t.enterprise&&!n)return`Upgrade available - Latest Enterprise release: ${t.enterprise}`;if(t!=null&&t.oss&&!n)return`Upgrade available - Latest OSS release: ${t.oss}`},Zh=E("h2")(({theme:e})=>({all:"unset",display:"block",margin:e.spacing(2,0),fontSize:e.fontSizes.bodySize,fontWeight:e.fontWeight.bold})),t2e=e=>{var i;const t=(i=e.uiConfig.versionInfo)==null?void 0:i.instanceId,n=ZCe(e.uiConfig),r=e.uiConfig.environment,o=e2e(e.uiConfig);return T("section",{title:"API details",children:[T(Zh,{children:[n," ",s(X,{condition:Boolean(r),show:T("small",{children:["(",r,")"]})})]}),s(X,{condition:Boolean(o),show:T("small",{children:[o,s("br",{})]})}),s("br",{}),s("small",{children:e.uiConfig.slogan}),s("br",{}),s(X,{condition:Boolean(t),show:s("small",{children:`${t}`})})]})},n2e=E("footer")(({theme:e})=>({padding:e.spacing(4,8),width:"100%",flexGrow:1,zIndex:100,backgroundColor:e.palette.footerBackground})),c0=E(Yi)({padding:0,margin:0}),wr=E(zi)(({theme:e})=>({padding:0,margin:0,"& a":{textDecoration:"none",color:e.palette.text.primary}})),r2e=()=>{const{uiConfig:e}=Lt();return s(n2e,{children:T(_n,{container:!0,justifyContent:"center",spacing:10,style:{marginBottom:0},children:[s(_n,{item:!0,md:4,xs:12,children:s(t2e,{uiConfig:e})}),s(_n,{item:!0,xs:12,md:"auto",children:T(_n,{container:!0,spacing:7,direction:"row",children:[s(_n,{item:!0,children:T("section",{title:"Unleash SDK",children:[s(Zh,{children:"Server SDKs"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/node",target:"_blank",children:"Node.js"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/java",target:"_blank",children:"Java"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/go",target:"_blank",children:"Go"})})})," ",s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/ruby",target:"_blank",children:"Ruby"})})})," ",s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/python",target:"_blank",children:"Python"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/dotnet",target:"_blank",children:".NET"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/php",target:"_blank",children:"PHP"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks",target:"_blank",children:"All SDKs"})})})]})]})}),s(_n,{item:!0,children:T("section",{title:"Unleash SDK",children:[s(Zh,{children:"Frontend SDKs"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/unleash-proxy",target:"_blank",children:"Unleash Proxy"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/javascript-browser",target:"_blank",children:"JavaScript SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/react",target:"_blank",children:"React SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/ios-proxy",target:"_blank",children:"iOS SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/android-proxy",target:"_blank",children:"Android SDK"})})})]})]})}),s(_n,{item:!0,children:T("section",{children:[s(Zh,{children:"About"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://www.getunleash.io/",target:"_blank",children:"getunleash.io"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://twitter.com/getunleash",target:"_blank",children:"Twitter"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://www.linkedin.com/company/getunleash",target:"_blank",children:"LinkedIn"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://github.com/Unleash/unleash",target:"_blank",children:"GitHub"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://slack.unleash.run",target:"_blank",children:"Slack Community"})})})]})]})})]})})]})})},o2e=E(Xt)(({theme:e})=>({marginBottom:e.spacing(2)})),i2e=E(ke)(({theme:e})=>({maxWidth:"800px"})),a2e=E("a")(({theme:e})=>({display:"block",marginTop:e.spacing(1),width:"100px"})),s2e=e=>!(!e||localStorage&&localStorage.getItem(e)),l2e=({toast:e})=>{const[t,n]=f.useState(!1);f.useEffect(()=>{n(s2e((e==null?void 0:e.id)||""))},[e==null?void 0:e.id]);const r=()=>{localStorage&&localStorage.setItem((e==null?void 0:e.id)||"","seen"),n(!1)};return e?s(X,{condition:t,show:T(o2e,{severity:e.severity,onClose:r,children:[s(i2e,{variant:"body2",children:e.message}),s(a2e,{href:e.link,target:"_blank",rel:"noopener noreferrer",children:"View more"})]})}):null},c2e=E("div")(({theme:e})=>({height:e.spacing(2.5),margin:e.spacing(2,0)})),u2e=E(pG)({"& > ol":{flexWrap:"nowrap","& > li:last-child":{minWidth:0}}}),c$=E("p")(Kne),d2e=E(on)(({theme:e})=>({"& > *":{maxWidth:e.spacing(25)}})),p2e=()=>{const{isAdmin:e}=f.useContext(Qr),t=ri(),n=t.pathname.split("/").filter(r=>r).filter(r=>r!=="create"&&r!=="edit"&&r!=="view"&&r!=="variants"&&r!=="logs"&&r!=="metrics"&&r!=="copy"&&r!=="features"&&r!=="features2"&&r!=="create-toggle"&&r!=="settings"&&r!=="profile");return s(c2e,{children:s(X,{condition:t.pathname.includes("admin")&&e||!t.pathname.includes("admin"),show:s(X,{condition:n.length>1,show:s(u2e,{"aria-label":"Breadcrumbs",children:n.map((r,o)=>{if(o===n.length-1)return s(c$,{children:r},r);let a="/";return n.forEach((l,c)=>{c!==o&&c<o?a+=l+"/":c===o&&(a+=l)}),s(d2e,{to:a,children:s(c$,{children:r})},r)})})})})})},f2e="/static/texture-c29e66c0.png",ED="skip-nav-target-id",h2e=()=>s("div",{id:ED}),m2e=E("a")(({theme:e})=>({position:"fixed",overflow:"hidden",zIndex:1e3,top:e.spacing(2.25),left:e.spacing(2.25),padding:e.spacing(1,2),whiteSpace:"nowrap",textDecoration:"none",background:e.palette.primary.dark,color:e.palette.primary.contrastText,borderRadius:e.shape.borderRadius,fontSize:e.fontSizes.smallBody,[e.breakpoints.down(960)]:{top:"0.8rem",left:"0.8rem"},"&:not(:focus):not(:active)":{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",zIndex:-1,width:1,height:1,margin:-1,padding:0}})),g2e=()=>T(m2e,{href:`#${ED}`,children:["Skip to content ",s("span",{"aria-hidden":!0,children:"↓"})]}),v2e=({featureName:e,projectId:t,conflict:n,onNavigate:r,children:o})=>T(S4,{elevation:0,sx:i=>({marginTop:i.spacing(2),overflow:"hidden"}),children:[T(Je,{sx:i=>({backgroundColor:(Boolean(n),i.palette.neutral.light),borderRadius:a=>`${a.shape.borderRadiusLarge}px ${a.shape.borderRadiusLarge}px 0 0`,border:"1px solid",borderColor:a=>n?a.palette.warning.border:a.palette.tertiary.main,borderBottom:"none",overflow:"hidden"}),children:[s(X,{condition:Boolean(n),show:T(Xt,{severity:"warning",sx:{px:3,mb:2,"&.MuiAlert-standardWarning":{borderStyle:"none"}},children:[s("strong",{children:"Conflict!"})," ",n,"."]})}),T(Je,{sx:{display:"flex",pt:n?0:2,pb:2,px:3},children:[s(ke,{children:"Feature toggle name: "}),s(po,{component:on,to:`/projects/${t}/features/${e}`,color:"primary",underline:"hover",sx:{marginLeft:1,"& :hover":{textDecoration:"underline"}},onClick:r,children:s("strong",{children:e})})]})]}),s(Je,{children:o})]}),y2e=e=>typeof e=="object"&&e!==null&&"name"in e;var b2e=200,z2="__lodash_hash_undefined__",w2e=1/0,kD=9007199254740991,S2e="[object Arguments]",x2e="[object Function]",C2e="[object GeneratorFunction]",E2e="[object Symbol]",k2e=/[\\^$.*+?()[\]{}|]/g,T2e=/^\[object .+?Constructor\]$/,_2e=/^(?:0|[1-9]\d*)$/,R2e=typeof Rn=="object"&&Rn&&Rn.Object===Object&&Rn,P2e=typeof self=="object"&&self&&self.Object===Object&&self,j2=R2e||P2e||Function("return this")();function $2e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function I2e(e,t){var n=e?e.length:0;return!!n&&L2e(e,t,0)>-1}function A2e(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)if(n(t,e[r]))return!0;return!1}function TD(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function U2(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function O2e(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function L2e(e,t,n){if(t!==t)return O2e(e,D2e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}function D2e(e){return e!==e}function N2e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function M2e(e){return function(t){return e(t)}}function B2e(e,t){return e.has(t)}function F2e(e,t){return e==null?void 0:e[t]}function z2e(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function _D(e,t){return function(n){return e(t(n))}}var j2e=Array.prototype,U2e=Function.prototype,oy=Object.prototype,u0=j2["__core-js_shared__"],u$=function(){var e=/[^.]+$/.exec(u0&&u0.keys&&u0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),RD=U2e.toString,Su=oy.hasOwnProperty,W2=oy.toString,W2e=RegExp("^"+RD.call(Su).replace(k2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),d$=j2.Symbol,H2e=_D(Object.getPrototypeOf,Object),V2e=oy.propertyIsEnumerable,G2e=j2e.splice,p$=d$?d$.isConcatSpreadable:void 0,yw=Object.getOwnPropertySymbols,f$=Math.max,q2e=$D(j2,"Map"),Ip=$D(Object,"create");function kl(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y2e(){this.__data__=Ip?Ip(null):{}}function K2e(e){return this.has(e)&&delete this.__data__[e]}function X2e(e){var t=this.__data__;if(Ip){var n=t[e];return n===z2?void 0:n}return Su.call(t,e)?t[e]:void 0}function J2e(e){var t=this.__data__;return Ip?t[e]!==void 0:Su.call(t,e)}function Q2e(e,t){var n=this.__data__;return n[e]=Ip&&t===void 0?z2:t,this}kl.prototype.clear=Y2e;kl.prototype.delete=K2e;kl.prototype.get=X2e;kl.prototype.has=J2e;kl.prototype.set=Q2e;function xu(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z2e(){this.__data__=[]}function eEe(e){var t=this.__data__,n=iy(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():G2e.call(t,n,1),!0}function tEe(e){var t=this.__data__,n=iy(t,e);return n<0?void 0:t[n][1]}function nEe(e){return iy(this.__data__,e)>-1}function rEe(e,t){var n=this.__data__,r=iy(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}xu.prototype.clear=Z2e;xu.prototype.delete=eEe;xu.prototype.get=tEe;xu.prototype.has=nEe;xu.prototype.set=rEe;function Cu(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oEe(){this.__data__={hash:new kl,map:new(q2e||xu),string:new kl}}function iEe(e){return ay(this,e).delete(e)}function aEe(e){return ay(this,e).get(e)}function sEe(e){return ay(this,e).has(e)}function lEe(e,t){return ay(this,e).set(e,t),this}Cu.prototype.clear=oEe;Cu.prototype.delete=iEe;Cu.prototype.get=aEe;Cu.prototype.has=sEe;Cu.prototype.set=lEe;function ig(e){var t=-1,n=e?e.length:0;for(this.__data__=new Cu;++t<n;)this.add(e[t])}function cEe(e){return this.__data__.set(e,z2),this}function uEe(e){return this.__data__.has(e)}ig.prototype.add=ig.prototype.push=cEe;ig.prototype.has=uEe;function dEe(e,t){var n=H2(e)||ID(e)?N2e(e.length,String):[],r=n.length,o=!!r;for(var i in e)(t||Su.call(e,i))&&!(o&&(i=="length"||CEe(i,r)))&&n.push(i);return n}function iy(e,t){for(var n=e.length;n--;)if($Ee(e[n][0],t))return n;return-1}function pEe(e,t,n,r){var o=-1,i=I2e,a=!0,l=e.length,c=[],u=t.length;if(!l)return c;n&&(t=TD(t,M2e(n))),r?(i=A2e,a=!1):t.length>=b2e&&(i=B2e,a=!1,t=new ig(t));e:for(;++o<l;){var d=e[o],p=n?n(d):d;if(d=r||d!==0?d:0,a&&p===p){for(var h=u;h--;)if(t[h]===p)continue e;c.push(d)}else i(t,p,r)||c.push(d)}return c}function PD(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=xEe),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?PD(l,t-1,n,r,o):U2(o,l):r||(o[o.length]=l)}return o}function fEe(e,t,n){var r=t(e);return H2(e)?r:U2(r,n(e))}function hEe(e){if(!V2(e)||kEe(e))return!1;var t=OD(e)||z2e(e)?W2e:T2e;return t.test(PEe(e))}function mEe(e){if(!V2(e))return _Ee(e);var t=TEe(e),n=[];for(var r in e)r=="constructor"&&(t||!Su.call(e,r))||n.push(r);return n}function gEe(e,t){return e=Object(e),vEe(e,t,function(n,r){return r in e})}function vEe(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=e[a];n(l,a)&&(i[a]=l)}return i}function yEe(e,t){return t=f$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=f$(n.length-t,0),i=Array(o);++r<o;)i[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i,$2e(e,this,a)}}function bEe(e){return fEe(e,LEe,SEe)}function ay(e,t){var n=e.__data__;return EEe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $D(e,t){var n=F2e(e,t);return hEe(n)?n:void 0}var wEe=yw?_D(yw,Object):DD,SEe=yw?function(e){for(var t=[];e;)U2(t,wEe(e)),e=H2e(e);return t}:DD;function xEe(e){return H2(e)||ID(e)||!!(p$&&e&&e[p$])}function CEe(e,t){return t=t??kD,!!t&&(typeof e=="number"||_2e.test(e))&&e>-1&&e%1==0&&e<t}function EEe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function kEe(e){return!!u$&&u$ in e}function TEe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oy;return e===n}function _Ee(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function REe(e){if(typeof e=="string"||OEe(e))return e;var t=e+"";return t=="0"&&1/e==-w2e?"-0":t}function PEe(e){if(e!=null){try{return RD.call(e)}catch{}try{return e+""}catch{}}return""}function $Ee(e,t){return e===t||e!==e&&t!==t}function ID(e){return IEe(e)&&Su.call(e,"callee")&&(!V2e.call(e,"callee")||W2.call(e)==S2e)}var H2=Array.isArray;function AD(e){return e!=null&&AEe(e.length)&&!OD(e)}function IEe(e){return LD(e)&&AD(e)}function OD(e){var t=V2(e)?W2.call(e):"";return t==x2e||t==C2e}function AEe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kD}function V2(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function LD(e){return!!e&&typeof e=="object"}function OEe(e){return typeof e=="symbol"||LD(e)&&W2.call(e)==E2e}function LEe(e){return AD(e)?dEe(e,!0):mEe(e)}var DEe=yEe(function(e,t){return e==null?{}:(t=TD(PD(t,1),REe),gEe(e,pEe(bEe(e),t)))});function DD(){return[]}var NEe=DEe;const MEe=(e,t,n,r)=>{var a,l;return(l=(a=xl(t,n).feature)==null?void 0:a.environments.find(c=>c.name===r))==null?void 0:l.strategies.find(c=>"id"in e.payload&&c.id===e.payload.id)},d0=({change:e,project:t,feature:n,environmentName:r})=>{const o=MEe(e,t,n,r),i=e.action==="deleteStrategy"?void 0:e.payload;return s(bL,{children:s(qv,{entry:{preData:NEe(o,"sortOrder"),data:i}})})},p0=({change:e,children:t})=>{const[n,r]=jt.useState(null),o=l=>{r(l.currentTarget)},i=()=>{r(null)},a=Boolean(n);return T(Re,{children:[s(Xce,{strategyName:e.payload.name}),s(ke,{onMouseEnter:o,onMouseLeave:i,children:kp(e.payload.name)}),s(Px,{id:String(e.id),sx:{pointerEvents:"none"},open:a,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:i,disableRestoreFocus:!0,children:t})]})},h$=({percentage:e,size:t="4rem"})=>{const n=sn(),r={display:"block",borderRadius:"100%",transform:"rotate(-90deg)",height:t,width:t,background:n.palette.grey[200]},o=100/(2*Math.PI),i=2*o;return s("svg",{viewBox:`0 0 ${i} ${i}`,style:r,"aria-hidden":!0,children:s("circle",{r:o,cx:o,cy:o,fill:"none",stroke:n.palette.primary.light,strokeWidth:i,strokeDasharray:`${e} 100`})})},BEe=E("div")(({theme:e})=>({width:"100%",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`})),FEe=E("p")(({theme:e})=>({display:"inline",margin:e.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),zEe=E(wo)(({theme:e})=>({margin:e.spacing(.5)})),f0=({value:e,text:t})=>s(BEe,{children:s(X,{condition:e.length===0,show:T("p",{children:["No ",t,"s added yet."]}),elseShow:T("div",{children:[T(FEe,{children:[e.length," ",e.length>1?`${t}s`:t," will get access."]}),e.map(n=>s(zEe,{label:s(Li,{maxWidth:"300",text:n,maxLength:50})},n))]})})}),jEe=({segments:e})=>!e||e.length===0?null:s(Re,{children:e.map((t,n)=>T(f.Fragment,{children:[s(X,{condition:n>0,show:s(I2,{text:"AND"})}),s(gD,{segment:t})]},t.id))}),m$=()=>s(Je,{sx:{px:3,color:"text.disabled"},children:"This strategy does not have constraints or parameters."}),Us=E(Je)(({theme:e})=>({padding:e.spacing(2,3),border:`1px solid ${e.palette.dividerAlternative}`,borderRadius:e.shape.borderRadiusMedium})),h0=E("span")(({theme:e})=>({color:e.palette.neutral.main})),g$=({strategy:e})=>{const{parameters:t,constraints:n=[]}=e,{strategies:r}=hu(),{uiConfig:o}=Lt(),{segments:i}=Dl(),a=i==null?void 0:i.filter(p=>{var h;return(h=e.segments)==null?void 0:h.includes(p.id)}),l=r.find(p=>p.name===e.name),c=f.useMemo(()=>!t||l!=null&&l.editable?null:Object.keys(t).map(p=>{switch(p){case"rollout":case"Rollout":const h=Ud(t[p]);return T(Us,{sx:{display:"flex",alignItems:"center"},children:[s(Je,{sx:{mr:2},children:s(h$,{percentage:h,size:"2rem"})}),T("div",{children:[s(wo,{color:"success",variant:"outlined",size:"small",label:`${h}%`})," ","of your base"," ",n.length>0?"who match constraints":""," ","is included."]})]});case"userIds":case"UserIds":const m=rs(t[p]);return s(f0,{value:m,text:"user"},p);case"hostNames":case"HostNames":const y=rs(t[p]);return s(f0,{value:y,text:"host"},p);case"IPs":const v=rs(t[p]);return s(f0,{value:v,text:"IP"},p);case"stickiness":case"groupId":return null;default:return null}}),[t,l,n]),u=f.useMemo(()=>{if(!t||!(l!=null&&l.editable))return null;const p=s(h0,{children:" is set to "});return l==null?void 0:l.parameters.map(h=>{const{type:m,name:y}={...h};if(!m||!y||t[y]===void 0)return null;const v=s(Li,{maxLength:15,maxWidth:"150",text:y});switch(h==null?void 0:h.type){case"list":const b=rs(t[y]);return b.length>0?T(Us,{children:[v," ",T(h0,{children:["has ",b.length," ",b.length>1?"items":"item",":"," ",b.map(C=>s(wo,{label:s(Li,{maxWidth:"300",text:C,maxLength:50}),sx:{mr:.5}},C))]})]}):null;case"percentage":const w=Ud(t[y]);return t[y]!==""?T(Us,{sx:{display:"flex",alignItems:"center"},children:[s(Je,{sx:{mr:2},children:s(h$,{percentage:w,size:"2rem"})}),T("div",{children:[v,p,s(wo,{color:"success",variant:"outlined",size:"small",label:`${w}%`})]})]}):null;case"boolean":return t[y]==="true"||t[y]==="false"?T(Us,{children:[s(Li,{maxLength:15,maxWidth:"150",text:y}),p,s(wo,{color:t[y]==="true"?"success":"error",variant:"outlined",size:"small",label:t[y]})]}):null;case"string":const g=fs(t[y]);return typeof t[y]<"u"?T(Us,{children:[v,s(X,{condition:g==="",show:s(h0,{children:" is an empty string"}),elseShow:T(Re,{children:[p,s(Li,{maxWidth:"300",text:g,maxLength:50})]})})]}):null;case"number":const S=Ud(t[y]);return t[y]!==""&&S!==void 0?T(Us,{children:[v,p,s(Li,{maxWidth:"300",text:String(S),maxLength:50})]}):null;case"default":return null}return null})},[t,l]);if(!t)return s(m$,{});const d=[Boolean(o.flags.SE)&&a&&a.length>0&&s(jEe,{segments:a}),n.length>0&&s(ny,{constraints:n,showLabel:!1}),e.name==="default"&&s(Re,{children:T(Us,{sx:{width:"100%"},children:["The standard strategy is"," ",s(wo,{variant:"outlined",size:"small",color:"success",label:"ON"})," ","for all users."]})}),...c??[],...u??[]].filter(Boolean);return s(X,{condition:d.length>0,show:s(Re,{children:d.map((p,h)=>T(f.Fragment,{children:[s(X,{condition:h>0,show:s(I2,{text:"AND"})}),p]},h))}),elseShow:s(m$,{})})},ND=E(Je)({display:"flex",justifyContent:"space-between",alignItems:"center"}),MD=E(Je)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(2)})),G2=E(Je)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)})),UEe=({children:e,discard:t})=>T(MD,{children:[T(G2,{children:[s(ke,{sx:n=>({color:n.palette.success.dark}),children:"+ Adding strategy:"}),e]}),t]}),WEe=({children:e,discard:t})=>T(MD,{children:[T(G2,{children:[s(ke,{children:"Editing strategy:"}),e]}),t]}),HEe=({discard:e,children:t})=>T(ND,{children:[T(G2,{children:[s(ke,{sx:n=>({color:n.palette.error.main}),children:"- Deleting strategy"}),t]}),e]}),VEe=({enabled:e,discard:t})=>T(ND,{children:[T(Je,{sx:{display:"flex",alignItems:"center"},children:["New status:"," ",s(bi,{sx:n=>({marginLeft:n.spacing(1)}),color:e?"success":"error",children:e?" Enabled":"Disabled"})]}),t]}),GEe=E("div")(({theme:e})=>({overflowX:"auto","& code":{wordWrap:"break-word",whiteSpace:"pre-wrap",fontFamily:"monospace",lineHeight:1.5,fontSize:e.fontSizes.smallBody}})),qEe=({preData:e,data:t})=>s(GEe,{children:s(qv,{entry:{preData:e,data:t}})}),YEe=E(Je)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(2)})),KEe=E(Je)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1)})),XEe=({feature:e,project:t,environment:n,change:r,discard:o})=>{var l;const{feature:i}=xl(t,e),a=(l=i.environments.find(({name:c})=>n===c))==null?void 0:l.variants;return T(YEe,{children:[T(KEe,{children:[s(ke,{children:"Updating variants:"}),s(qEe,{preData:a,data:r.payload.variants})]}),o]})},JEe=E(Je,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$hasConflict:t,$isInConflictFeature:n,$isAfterWarning:r,$isLast:o})=>({borderLeft:"1px solid",borderRight:"1px solid",borderTop:"1px solid",borderBottom:o?"1px solid":"none",borderRadius:o?`0 0
|
|
384
|
+
your user.`,documentationLink:"https://docs.getunleash.io/reference/api-tokens-and-client-keys",documentationLinkLabel:"Tokens documentation",formatApiCode:S,children:T(eCe,{onSubmit:g,children:[s("div",{children:s(Zxe,{description:u,setDescription:d,isDescriptionUnique:R,expiration:p,setExpiration:h,expiresAt:m,setExpiresAt:y,errors:v,setErrors:b})}),T(tCe,{children:[s(rt,{type:"submit",variant:"contained",color:"primary",disabled:!k,children:"Create token"}),s(nCe,{onClick:()=>{t(!1)},children:"Cancel"})]})]})})})},oCe=({open:e,setOpen:t,token:n})=>{const{refetchTokens:r}=M2(),{deletePersonalAPIToken:o}=bD(),{setToastData:i,setToastApiError:a}=It();return s(cr,{open:e,primaryButtonText:"Delete token",secondaryButtonText:"Cancel",onClick:async()=>{if(n)try{await o(n==null?void 0:n.id),r(),t(!1),i({title:"Token deleted successfully",type:"success"})}catch(c){a(ht(c))}},onClose:()=>{t(!1)},title:"Delete token?",children:T(ke,{children:['Any applications or scripts using this token "',s("strong",{children:n==null?void 0:n.description}),'" will no longer be able to access the Unleash API. You cannot undo this action.']})})},iCe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(3)})),aCe=({open:e,setOpen:t,token:n})=>T(cr,{open:e,secondaryButtonText:"Close",onClose:(r,o)=>{o||t(!1)},title:"Personal API token created",children:[s(iCe,{severity:"info",children:"Make sure to copy your personal API token now. You won't be able to see it again!"}),s(ke,{variant:"body1",children:"Your token:"}),s(uD,{token:(n==null?void 0:n.secret)||""})]}),sCe=({value:e,live:t=!1,emptyText:n,title:r})=>{const{locationSettings:o}=la();if(!e)return s(fo,{children:n});const i=Vc(e,o.locale);return s(fo,{children:s(Tt,{title:(r==null?void 0:r(i))??i,arrow:!0,children:s(ke,{noWrap:!0,component:"span",variant:"body2","data-loading":!0,children:s(gC,{date:new Date(e),live:t,title:""})})})})},lCe=E(Xt)(({theme:e})=>({marginBottom:e.spacing(3)})),cCe=E("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(10,2)})),uCe=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(1.5)})),dCe=E(ke)(({theme:e})=>({color:e.palette.text.secondary,marginBottom:e.spacing(4.5)})),pCe=Array(15).fill({description:"Short description of the feature",type:"-",createdAt:new Date(2022,1,1),project:"projectID"}),fCe={id:"createdAt"},{value:n$,setValue:hCe}=Dv("PersonalAPITokensTable:v1",fCe),mCe=()=>{const e=sn(),t=Er(e.breakpoints.down("md")),n=Er(e.breakpoints.down("sm")),{tokens:r=[],loading:o}=M2(),[i,a]=jp(),[l]=f.useState(()=>({sortBy:[{id:i.get("sort")||n$.id,desc:i.has("order")?i.get("order")==="desc":n$.desc}],globalFilter:i.get("search")||""})),[c,u]=f.useState(l.globalFilter),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[y,v]=f.useState(!1),[b,w]=f.useState(),[g,S]=f.useState(),C=f.useMemo(()=>[{Header:"Description",accessor:"description",Cell:mf,minWidth:100,searchable:!0},{Header:"Expires",accessor:"expiresAt",Cell:({value:j})=>new Date(j).getFullYear()>new Date().getFullYear()+100?s(fo,{children:"Never"}):s(Ep,{value:j}),sortType:"date",maxWidth:150},{Header:"Created",accessor:"createdAt",Cell:Ep,sortType:"date",maxWidth:150},{Header:"Last seen",accessor:"seenAt",Cell:sCe,sortType:"date",maxWidth:150},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:j}})=>s(na,{children:s(Tt,{title:"Delete token",arrow:!0,describeChild:!0,children:s("span",{children:s(Qt,{onClick:()=>{S(j),v(!0)},children:s(ti,{})})})})}),maxWidth:100,disableSortBy:!0}],[S,v]),{data:R,getSearchText:k,getSearchContext:P}=RC(C,c,r),O=f.useMemo(()=>(R==null?void 0:R.length)===0&&o?pCe:R,[R,o]),{headerGroups:L,rows:I,prepareRow:A,state:{sortBy:M},setHiddenColumns:F}=tn.useTable({columns:C,data:O,initialState:l,sortTypes:ca,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},tn.useSortBy,tn.useFlexLayout);return Mv([{condition:n,columns:["expiresAt"]},{condition:t,columns:["createdAt"]}],F,C),f.useEffect(()=>{const j={};j.sort=M[0].id,M[0].desc&&(j.order="desc"),c&&(j.search=c),a(j,{replace:!0}),hCe({id:M[0].id,desc:M[0].desc||!1})},[M,c,a]),T(gr,{isLoading:o,header:s(xn,{title:`Personal API tokens (${I.length<O.length?`${I.length} of ${O.length}`:O.length})`,actions:T(Re,{children:[s(X,{condition:!t,show:T(Re,{children:[s(go,{initialValue:c,onChange:u,getSearchContext:P}),s(xn.Divider,{})]})}),s(rt,{variant:"contained",color:"primary",disabled:r.length>=Wxe,onClick:()=>p(!0),children:"New token"})]}),children:s(X,{condition:t,show:s(go,{initialValue:c,onChange:u,hasFilters:!0,getSearchContext:P})})}),children:[s(lCe,{severity:"info",children:"Use personal API tokens to authenticate to the Unleash API as yourself. A personal API token has the same access privileges as your user."}),s(As,{value:k(c),children:s(uC,{rows:I,headerGroups:L,prepareRow:A})}),s(X,{condition:I.length===0,show:s(X,{condition:(c==null?void 0:c.length)>0,show:T(Zn,{children:["No tokens found matching “",c,"”"]}),elseShow:T(cCe,{children:[s(uCe,{children:"You have no personal API tokens yet."}),s(dCe,{variant:"body2",children:"Need an API token for scripts or testing? Create a personal API token for quick access to the Unleash API."}),s(rt,{variant:"outlined",onClick:()=>p(!0),children:"Create your first token"})]})})}),s(rCe,{open:d,setOpen:p,newToken:j=>{w(j),m(!0)}}),s(aCe,{open:h,setOpen:m,token:b}),s(oCe,{open:y,setOpen:v,token:g})]})},gCe=()=>{const{data:e,error:t,mutate:n}=gn(Ft("api/admin/user/profile"),vCe);return{profile:e,loading:!t&&!e,refetchProfile:()=>n(),error:t}},vCe=e=>fetch(e).then(Cn("Profile")).then(t=>t.json());var B2={},yCe=fn;Object.defineProperty(B2,"__esModule",{value:!0});var xD=B2.default=void 0,bCe=yCe(En()),wCe=kn,SCe=(0,bCe.default)((0,wCe.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");xD=B2.default=SCe;var F2={},xCe=fn;Object.defineProperty(F2,"__esModule",{value:!0});var CD=F2.default=void 0,CCe=xCe(En()),ECe=kn,kCe=(0,CCe.default)((0,ECe.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16.77c.68 0 1.23-.56 1.23-1.23V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-2-6H6v-2h12v2zm-4 4H6v-2h8v2z"}),"TopicOutlined");CD=F2.default=kCe;const TCe=E("div")(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",padding:e.spacing(6),borderRadius:e.shape.borderRadiusLarge,backgroundColor:e.palette.primary.main,color:e.palette.text.tertiaryContrast,marginBottom:e.spacing(3),boxShadow:e.boxShadows.primaryHeader})),_Ce=E("div")(()=>({flexGrow:1})),RCe=E(ke)(({theme:e})=>({fontSize:e.spacing(3.75)})),PCe=E(tC)(({theme:e})=>({width:e.spacing(9.5),height:e.spacing(9.5),marginRight:e.spacing(3)})),r$=E(ke)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginBottom:e.spacing(3)})),$Ce=E("div")(({theme:e})=>({display:"flex",flexDirection:"row","& > div > p":{marginBottom:e.spacing(1.5)}})),ICe=E(bi)(({theme:e})=>({cursor:"pointer",marginRight:e.spacing(1)})),ACe=E("div")(({theme:e})=>({width:"100%",height:"1px",backgroundColor:e.palette.divider,margin:e.spacing(3,0)})),OCe=E(Da)(({theme:e})=>({marginTop:e.spacing(1.5),width:e.spacing(30)})),LCe=E(Zp)(({theme:e})=>({backgroundColor:e.palette.inputLabelBackground})),DCe=({user:e})=>{const{profile:t}=gCe(),n=ft(),{locationSettings:r,setLocationSettings:o}=la(),[i,a]=f.useState(),[l,c]=f.useState(["en-US","en-GB","nb-NO","sv-SE","da-DK","en-IN","de","cs","pt-BR","fr-FR"]);f.useEffect(()=>{const d=l.find(p=>p.toLowerCase().includes(r.locale.toLowerCase()));a(d),d||c(p=>[...p,r.locale])},[r]);const u=d=>{const p=d.target.value;a(p),o({locale:p})};return T(Re,{children:[T(TCe,{children:[s(PCe,{user:e}),T(_Ce,{children:[s(RCe,{children:e.name||e.username}),s(ke,{variant:"body1",children:e.email})]})]}),T(gr,{children:[s(r$,{children:"Access"}),T($Ce,{children:[T(Je,{sx:{width:"50%"},children:[s(ke,{variant:"body2",children:"Your root role"}),s(Tt,{title:(t==null?void 0:t.rootRole.description)||"",arrow:!0,placement:"bottom-end",describeChild:!0,children:s(bi,{color:"success",icon:s(xD,{}),iconRight:!0,children:t==null?void 0:t.rootRole.name})})]}),T(Je,{children:[s(ke,{variant:"body2",children:"Projects"}),s(X,{condition:Boolean(t==null?void 0:t.projects.length),show:t==null?void 0:t.projects.map(d=>s(Tt,{title:"View project",arrow:!0,placement:"bottom-end",describeChild:!0,children:s(ICe,{onClick:p=>{p.preventDefault(),n(`/projects/${d}`)},color:"secondary",icon:s(CD,{}),children:d})},d)),elseShow:s(Tt,{title:"You are not assigned to any projects",arrow:!0,describeChild:!0,children:s(bi,{children:"No projects"})})})]})]}),s(ACe,{}),s(r$,{children:"Settings"}),s(ke,{variant:"body2",children:"This is the format used across the system for time and date"}),T(OCe,{variant:"outlined",size:"small",children:[s(LCe,{htmlFor:"locale-select",children:"Date/Time formatting"}),s(ef,{id:"locale-select",value:i||"",native:!0,onChange:u,MenuProps:{style:{zIndex:9999}},children:l.map(d=>s("option",{value:d,children:d},d))})]})]})]})},NCe=()=>{const{user:e}=si(),t=ri(),n=ft(),r=[{id:"profile",label:"Profile"},{id:"password",label:"Change password",path:"change-password"},{id:"pat",label:"Personal API tokens",path:"personal-api-tokens"}],o=c=>{n(c.path?`/profile/${c.path}`:"/profile",{replace:!0}),l(c.id)},i=()=>{const c=t.pathname;return(r.find(({path:d})=>d&&c.includes(d))||r[0]).id},[a,l]=f.useState(i());return f.useEffect(()=>{l(i())},[t]),T(Fxe,{tabs:r,value:a,onChange:o,children:[s(X,{condition:a==="profile",show:s(DCe,{user:e})}),s(X,{condition:a==="password",show:s(Uxe,{})}),s(X,{condition:a==="pat",show:s(mCe,{})})]})},MCe=f.lazy(()=>import("./CreateProject-f5c561c6.js")),BCe=f.lazy(()=>import("./FeatureViewLazyExport-251c75f0.js")),FCe=f.lazy(()=>import("./LazyAdminExport-110237f4.js")),zCe=f.lazy(()=>import("./LazyProjectExport-22be702f.js")),jCe=()=>s(Il,{to:"/admin/users",replace:!0}),$p=[{path:"/splash/:splashId",title:"Unleash",component:Age,type:"protected",menu:{},isStandalone:!0},{path:"/projects/create",parent:"/projects",title:"Create",component:MCe,type:"protected",enterprise:!0,menu:{}},{path:"/projects/:projectId/edit",parent:"/projects",title:":projectId",component:she,type:"protected",enterprise:!0,menu:{}},{path:"/projects/:projectId/archived",title:":projectId",parent:"/archive",component:Lpe,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/:activeTab/copy",parent:"/projects/:projectId/features/:featureId/:activeTab",title:"Copy",component:Lme,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/edit",parent:"/projects",title:"Edit feature",component:Bhe,type:"protected",menu:{}},{path:"/projects/:projectId/features/:featureId/*",parent:"/projects",title:"FeatureView",component:BCe,type:"protected",menu:{}},{path:"/projects/:projectId/create-toggle",parent:"/projects/:projectId/features",title:"Create feature toggle",component:whe,type:"protected",menu:{}},{path:"/projects/:projectId/features2/:featureId",parent:"/features",title:":featureId",component:UR,type:"protected",menu:{}},{path:"/projects/:projectId/*",parent:"/projects",title:":projectId",component:zCe,flag:bde,type:"protected",menu:{}},{path:"/projects",title:"Projects",component:Ope,type:"protected",menu:{mobile:!0}},{path:"/features/:activeTab/:featureId",parent:"/features",title:":featureId",component:UR,type:"protected",menu:{}},{path:"/features",title:"Feature toggles",component:jle,type:"protected",menu:{mobile:!0}},{path:"/playground",title:"Playground",component:Oxe,hidden:!1,type:"protected",menu:{mobile:!0}},{path:"/applications/:name",title:":name",parent:"/applications",component:Hhe,type:"protected",menu:{}},{path:"/applications",title:"Applications",component:Vhe,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/context/create",parent:"/context",title:"Create",component:Dge,type:"protected",menu:{}},{path:"/context/edit/:name",parent:"/context",title:":name",component:Ufe,type:"protected",menu:{}},{path:"/context",title:"Context fields",component:Yhe,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/strategies/create",title:"Create",parent:"/strategies",component:hge,type:"protected",menu:{}},{path:"/strategies/:name/edit",title:":name",parent:"/strategies",component:gge,type:"protected",menu:{}},{path:"/strategies/:name",title:":name",parent:"/strategies",component:_ce,type:"protected",menu:{}},{path:"/strategies",title:"Strategy types",component:sue,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/environments/create",title:"Environments",component:xfe,parent:"/environments",type:"protected",menu:{}},{path:"/environments/:id",title:"Edit",component:kfe,type:"protected",menu:{}},{path:"/environments",title:"Environments",component:eSe,type:"protected",flag:wde,menu:{mobile:!0,advanced:!0}},{path:"/tag-types/create",parent:"/tag-types",title:"Create",component:Qfe,type:"protected",menu:{}},{path:"/tag-types/edit/:name",parent:"/tag-types",title:":name",component:Jfe,type:"protected",menu:{}},{path:"/tag-types",title:"Tag types",component:uue,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/addons/create/:providerId",parent:"/addons",title:"Create",component:Pme,type:"protected",menu:{}},{path:"/addons/edit/:addonId",parent:"/addons",title:"Edit",component:$me,type:"protected",menu:{}},{path:"/addons",title:"Addons",component:Sue,hidden:!1,type:"protected",menu:{mobile:!0,advanced:!0}},{path:"/segments/create",title:"Segments",component:nwe,hidden:!1,type:"protected",layout:"main",menu:{},flag:N1},{path:"/segments/edit/:segmentId",title:"Segments",component:iwe,hidden:!1,type:"protected",layout:"main",menu:{},flag:N1},{path:"/segments",title:"Segments",component:wxe,hidden:!1,type:"protected",menu:{mobile:!0,advanced:!0},flag:N1},{path:"/history",title:"Event log",component:Jme,type:"protected",menu:{adminSettings:!0}},{path:"/archive",title:"Archived toggles",component:Axe,type:"protected",menu:{}},{path:"/admin",title:"Admin",component:jCe,hidden:!1,type:"protected",menu:{}},{path:"/admin/*",title:"Admin",component:FCe,hidden:!1,type:"protected",menu:{}},{path:"/profile/*",title:"Profile",component:NCe,type:"protected",menu:{}},{path:"/login",title:"Log in",component:yde,type:"unprotected",hidden:!0,menu:{},isStandalone:!0},{path:"/new-user",title:"New user",hidden:!0,component:Kde,type:"unprotected",menu:{},isStandalone:!0},{path:"/reset-password",title:"Reset password",hidden:!0,component:Qde,type:"unprotected",menu:{},isStandalone:!0},{path:"/forgotten-password",title:"Forgotten password",hidden:!0,component:ipe,type:"unprotected",menu:{},isStandalone:!0}],UCe=[{path:"/history",title:"Event log",menu:{adminSettings:!0}},{path:"/admin/users",title:"Users",menu:{adminSettings:!0}},{path:"/admin/groups",title:"Groups",menu:{adminSettings:!0},flag:xde},{path:"/admin/roles",title:"Project roles",flag:Sde,menu:{adminSettings:!0}},{path:"/admin/auth",title:"Single sign-on",menu:{adminSettings:!0}},{path:"/admin/instance",title:"Instance stats",menu:{adminSettings:!0}},{path:"/admin/service-accounts",title:"Service accounts",menu:{adminSettings:!0},flag:"serviceAccounts"},{path:"/admin/network/*",title:"Network",menu:{adminSettings:!0},flag:"networkView"},{path:"/admin/maintenance",title:"Maintenance",menu:{adminSettings:!0},flag:"maintenance"},{path:"/admin/cors",title:"CORS origins",flag:"embedProxyFrontend",menu:{adminSettings:!0}},{path:"/admin/admin-invoices",title:"Billing & invoices",menu:{adminSettings:!0,isEnterprise:!0}}],WCe=$p.filter(e=>!e.hidden),HCe=()=>{const e=WCe.filter(o=>o.menu.advanced),t=$p.filter(o=>o.menu.adminSettings),n=$p.filter(o=>o.menu.mobile),r={mainNavRoutes:e,adminRoutes:t,mobileRoutes:n};return()=>r},o$=e=>e.map(t=>({path:t.path,flag:t.flag,title:t.title,menu:t.menu,configFlag:t.configFlag})),VCe=HCe(),i$=E(BH)(({theme:e})=>({backgroundColor:e.palette.headerBackground,padding:e.spacing(1),boxShadow:"none",position:"relative",zIndex:300})),a$=E(cq)(({theme:e})=>({display:"flex",alignItems:"center",maxWidth:1280,[e.breakpoints.down("md")]:{padding:"0"}})),s$=E("div")({marginLeft:"auto",display:"flex",alignItems:"center"}),GCe=E("nav")({display:"flex",alignItems:"center",flexGrow:1}),qCe=E(Ure)({width:"150px"}),YCe=E(jre)({width:"150px"}),KCe=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",marginLeft:e.spacing(3),"& a":{textDecoration:"none",color:"inherit",marginRight:e.spacing(3),display:"flex",alignItems:"center"}})),XCe=E("button")(({theme:e})=>({border:"none",background:"transparent",height:"100%",display:"flex",fontSize:e.fontSizes.bodySize,fontFamily:e.typography.fontFamily,alignItems:"center",color:"inherit",cursor:"pointer"})),l$=e=>({color:e.palette.neutral.main}),Eh=E(on)(({theme:e})=>Pv(e)),JCe=E(Qt)(({theme:e})=>({...Pv(e),borderRadius:100})),QCe=()=>{const{onSetThemeMode:e,themeMode:t}=y3(),n=sn(),r=Ss(),o=Ss(),[i,a]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!1),{permissions:p}=WC(),{uiConfig:h,isOss:m}=Lt(),y=Er(n.breakpoints.down("md")),[v,b]=f.useState(!1),w=()=>b(P=>!P),g=()=>a(null),S=()=>c(null);f.useEffect(()=>{(p==null?void 0:p.find(O=>O.permission===xi))&&d(!0)},[p]);const C=VCe(),R=P=>!P.menu.isEnterprise||!m(),k={mainNavRoutes:o$(C.mainNavRoutes).concat([{path:"/admin/api",title:"API access",menu:{}}]).filter(z1(h)),mobileRoutes:o$(C.mobileRoutes).filter(z1(h)),adminRoutes:UCe.filter(z1(h)).filter(R).map(P=>({...P,path:P.path.replace("/*","")}))};return y?s(i$,{position:"static",children:T(a$,{children:[s(Tt,{title:"Menu",arrow:!0,children:s(Qt,{sx:{color:P=>P.palette.text.primary},onClick:w,"aria-controls":"header-drawer","aria-expanded":v,size:"large",children:s(O3,{})})}),s(voe,{title:h.name,flags:h.flags,links:h.links,open:v,toggleDrawer:w,admin:u,routes:k}),s(s$,{children:s(K_,{})})]})}):s(i$,{position:"static",children:T(a$,{children:[s(Eh,{to:"/",sx:$v,"aria-label":"Home",children:s(mw,{darkmode:s(qCe,{"aria-label":"Unleash logo"}),lightmode:s(YCe,{"aria-label":"Unleash logo"})})}),T(GCe,{children:[T(KCe,{children:[s(Eh,{to:"/projects",children:"Projects"}),s(Eh,{to:"/features",children:"Feature toggles"}),s(Eh,{to:"/playground",children:"Playground"}),T(XCe,{onClick:P=>c(P.currentTarget),"aria-controls":l?o:void 0,"aria-expanded":Boolean(l),children:["Configure",s(jb,{sx:l$})]}),s(eR,{id:o,options:k.mainNavRoutes,anchorEl:l,handleClose:S,style:{top:10}})]}),T(s$,{children:[s(X,{condition:Boolean(h.flags.ENABLE_DARK_MODE_SUPPORT),show:s(xr,{control:s(Na,{onChange:e,checked:t==="dark"}),label:"darkmode"})}),s(Tt,{title:"Documentation",arrow:!0,children:s(Qt,{href:"https://docs.getunleash.io/",target:"_blank",rel:"noopener noreferrer",size:"large",disableRipple:!0,sx:Pv,children:s(rC,{})})}),s(X,{condition:u,show:s(Tt,{title:"Settings",arrow:!0,children:T(JCe,{onClick:P=>a(P.currentTarget),"aria-controls":i?r:void 0,"aria-expanded":Boolean(i),size:"large",disableRipple:!0,children:[s(L3,{}),s(jb,{sx:l$})]})})}),s(eR,{id:r,options:k.adminRoutes,anchorEl:i,handleClose:g,style:{top:5,left:-100}})," ",s(K_,{})]})]})]})})},ZCe=e=>{var n;const t=(n=e.versionInfo)==null?void 0:n.current;return t!=null&&t.enterprise?`${e.name} ${t.enterprise}`:t!=null&&t.oss?`${e.name} ${t.oss}`:`${e.name} ${e.version}`},e2e=e=>{var r,o;const t=(r=e.versionInfo)==null?void 0:r.latest,n=(o=e.versionInfo)==null?void 0:o.isLatest;if(t!=null&&t.enterprise&&!n)return`Upgrade available - Latest Enterprise release: ${t.enterprise}`;if(t!=null&&t.oss&&!n)return`Upgrade available - Latest OSS release: ${t.oss}`},Zh=E("h2")(({theme:e})=>({all:"unset",display:"block",margin:e.spacing(2,0),fontSize:e.fontSizes.bodySize,fontWeight:e.fontWeight.bold})),t2e=e=>{var i;const t=(i=e.uiConfig.versionInfo)==null?void 0:i.instanceId,n=ZCe(e.uiConfig),r=e.uiConfig.environment,o=e2e(e.uiConfig);return T("section",{title:"API details",children:[T(Zh,{children:[n," ",s(X,{condition:Boolean(r),show:T("small",{children:["(",r,")"]})})]}),s(X,{condition:Boolean(o),show:T("small",{children:[o,s("br",{})]})}),s("br",{}),s("small",{children:e.uiConfig.slogan}),s("br",{}),s(X,{condition:Boolean(t),show:s("small",{children:`${t}`})})]})},n2e=E("footer")(({theme:e})=>({padding:e.spacing(4,8),width:"100%",flexGrow:1,zIndex:100,backgroundColor:e.palette.footerBackground})),c0=E(Yi)({padding:0,margin:0}),wr=E(zi)(({theme:e})=>({padding:0,margin:0,"& a":{textDecoration:"none",color:e.palette.text.primary}})),r2e=()=>{const{uiConfig:e}=Lt();return s(n2e,{children:T(_n,{container:!0,justifyContent:"center",spacing:10,style:{marginBottom:0},children:[s(_n,{item:!0,md:4,xs:12,children:s(t2e,{uiConfig:e})}),s(_n,{item:!0,xs:12,md:"auto",children:T(_n,{container:!0,spacing:7,direction:"row",children:[s(_n,{item:!0,children:T("section",{title:"Unleash SDK",children:[s(Zh,{children:"Server SDKs"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/node",target:"_blank",children:"Node.js"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/java",target:"_blank",children:"Java"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/go",target:"_blank",children:"Go"})})})," ",s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/ruby",target:"_blank",children:"Ruby"})})})," ",s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/python",target:"_blank",children:"Python"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/dotnet",target:"_blank",children:".NET"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/php",target:"_blank",children:"PHP"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks",target:"_blank",children:"All SDKs"})})})]})]})}),s(_n,{item:!0,children:T("section",{title:"Unleash SDK",children:[s(Zh,{children:"Frontend SDKs"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/unleash-proxy",target:"_blank",children:"Unleash Proxy"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/javascript-browser",target:"_blank",children:"JavaScript SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/react",target:"_blank",children:"React SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/ios-proxy",target:"_blank",children:"iOS SDK"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://docs.getunleash.io/reference/sdks/android-proxy",target:"_blank",children:"Android SDK"})})})]})]})}),s(_n,{item:!0,children:T("section",{children:[s(Zh,{children:"About"}),T(c0,{dense:!0,children:[s(wr,{children:s(un,{primary:s("a",{href:"https://www.getunleash.io/",target:"_blank",children:"getunleash.io"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://twitter.com/getunleash",target:"_blank",children:"Twitter"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://www.linkedin.com/company/getunleash",target:"_blank",children:"LinkedIn"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://github.com/Unleash/unleash",target:"_blank",children:"GitHub"})})}),s(wr,{children:s(un,{primary:s("a",{href:"https://slack.unleash.run",target:"_blank",children:"Slack Community"})})})]})]})})]})})]})})},o2e=E(Xt)(({theme:e})=>({marginBottom:e.spacing(2)})),i2e=E(ke)(({theme:e})=>({maxWidth:"800px"})),a2e=E("a")(({theme:e})=>({display:"block",marginTop:e.spacing(1),width:"100px"})),s2e=e=>!(!e||localStorage&&localStorage.getItem(e)),l2e=({toast:e})=>{const[t,n]=f.useState(!1);f.useEffect(()=>{n(s2e((e==null?void 0:e.id)||""))},[e==null?void 0:e.id]);const r=()=>{localStorage&&localStorage.setItem((e==null?void 0:e.id)||"","seen"),n(!1)};return e?s(X,{condition:t,show:T(o2e,{severity:e.severity,onClose:r,children:[s(i2e,{variant:"body2",children:e.message}),s(a2e,{href:e.link,target:"_blank",rel:"noopener noreferrer",children:"View more"})]})}):null},c2e=E("div")(({theme:e})=>({height:e.spacing(2.5),margin:e.spacing(2,0)})),u2e=E(pG)({"& > ol":{flexWrap:"nowrap","& > li:last-child":{minWidth:0}}}),c$=E("p")(Kne),d2e=E(on)(({theme:e})=>({"& > *":{maxWidth:e.spacing(25)}})),p2e=()=>{const{isAdmin:e}=f.useContext(Qr),t=ri(),n=t.pathname.split("/").filter(r=>r).filter(r=>r!=="create"&&r!=="edit"&&r!=="view"&&r!=="variants"&&r!=="logs"&&r!=="metrics"&&r!=="copy"&&r!=="features"&&r!=="features2"&&r!=="create-toggle"&&r!=="settings"&&r!=="profile");return s(c2e,{children:s(X,{condition:t.pathname.includes("admin")&&e||!t.pathname.includes("admin"),show:s(X,{condition:n.length>1,show:s(u2e,{"aria-label":"Breadcrumbs",children:n.map((r,o)=>{if(o===n.length-1)return s(c$,{children:r},r);let a="/";return n.forEach((l,c)=>{c!==o&&c<o?a+=l+"/":c===o&&(a+=l)}),s(d2e,{to:a,children:s(c$,{children:r})},r)})})})})})},f2e="/static/texture-c29e66c0.png",ED="skip-nav-target-id",h2e=()=>s("div",{id:ED}),m2e=E("a")(({theme:e})=>({position:"fixed",overflow:"hidden",zIndex:1e3,top:e.spacing(2.25),left:e.spacing(2.25),padding:e.spacing(1,2),whiteSpace:"nowrap",textDecoration:"none",background:e.palette.primary.dark,color:e.palette.primary.contrastText,borderRadius:e.shape.borderRadius,fontSize:e.fontSizes.smallBody,[e.breakpoints.down(960)]:{top:"0.8rem",left:"0.8rem"},"&:not(:focus):not(:active)":{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",zIndex:-1,width:1,height:1,margin:-1,padding:0}})),g2e=()=>T(m2e,{href:`#${ED}`,children:["Skip to content ",s("span",{"aria-hidden":!0,children:"↓"})]}),v2e=({featureName:e,projectId:t,conflict:n,onNavigate:r,children:o})=>T(S4,{elevation:0,sx:i=>({marginTop:i.spacing(2),overflow:"hidden"}),children:[T(Je,{sx:i=>({backgroundColor:(Boolean(n),i.palette.neutral.light),borderRadius:a=>`${a.shape.borderRadiusLarge}px ${a.shape.borderRadiusLarge}px 0 0`,border:"1px solid",borderColor:a=>n?a.palette.warning.border:a.palette.tertiary.main,borderBottom:"none",overflow:"hidden"}),children:[s(X,{condition:Boolean(n),show:T(Xt,{severity:"warning",sx:{px:3,mb:2,"&.MuiAlert-standardWarning":{borderStyle:"none"}},children:[s("strong",{children:"Conflict!"})," ",n,"."]})}),T(Je,{sx:{display:"flex",pt:n?0:2,pb:2,px:3},children:[s(ke,{children:"Feature toggle name: "}),s(po,{component:on,to:`/projects/${t}/features/${e}`,color:"primary",underline:"hover",sx:{marginLeft:1,"& :hover":{textDecoration:"underline"}},onClick:r,children:s("strong",{children:e})})]})]}),s(Je,{children:o})]}),y2e=e=>typeof e=="object"&&e!==null&&"name"in e;var b2e=200,z2="__lodash_hash_undefined__",w2e=1/0,kD=9007199254740991,S2e="[object Arguments]",x2e="[object Function]",C2e="[object GeneratorFunction]",E2e="[object Symbol]",k2e=/[\\^$.*+?()[\]{}|]/g,T2e=/^\[object .+?Constructor\]$/,_2e=/^(?:0|[1-9]\d*)$/,R2e=typeof Rn=="object"&&Rn&&Rn.Object===Object&&Rn,P2e=typeof self=="object"&&self&&self.Object===Object&&self,j2=R2e||P2e||Function("return this")();function $2e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function I2e(e,t){var n=e?e.length:0;return!!n&&L2e(e,t,0)>-1}function A2e(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)if(n(t,e[r]))return!0;return!1}function TD(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function U2(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function O2e(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function L2e(e,t,n){if(t!==t)return O2e(e,D2e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}function D2e(e){return e!==e}function N2e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function M2e(e){return function(t){return e(t)}}function B2e(e,t){return e.has(t)}function F2e(e,t){return e==null?void 0:e[t]}function z2e(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function _D(e,t){return function(n){return e(t(n))}}var j2e=Array.prototype,U2e=Function.prototype,oy=Object.prototype,u0=j2["__core-js_shared__"],u$=function(){var e=/[^.]+$/.exec(u0&&u0.keys&&u0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),RD=U2e.toString,Su=oy.hasOwnProperty,W2=oy.toString,W2e=RegExp("^"+RD.call(Su).replace(k2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),d$=j2.Symbol,H2e=_D(Object.getPrototypeOf,Object),V2e=oy.propertyIsEnumerable,G2e=j2e.splice,p$=d$?d$.isConcatSpreadable:void 0,yw=Object.getOwnPropertySymbols,f$=Math.max,q2e=$D(j2,"Map"),Ip=$D(Object,"create");function kl(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y2e(){this.__data__=Ip?Ip(null):{}}function K2e(e){return this.has(e)&&delete this.__data__[e]}function X2e(e){var t=this.__data__;if(Ip){var n=t[e];return n===z2?void 0:n}return Su.call(t,e)?t[e]:void 0}function J2e(e){var t=this.__data__;return Ip?t[e]!==void 0:Su.call(t,e)}function Q2e(e,t){var n=this.__data__;return n[e]=Ip&&t===void 0?z2:t,this}kl.prototype.clear=Y2e;kl.prototype.delete=K2e;kl.prototype.get=X2e;kl.prototype.has=J2e;kl.prototype.set=Q2e;function xu(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z2e(){this.__data__=[]}function eEe(e){var t=this.__data__,n=iy(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():G2e.call(t,n,1),!0}function tEe(e){var t=this.__data__,n=iy(t,e);return n<0?void 0:t[n][1]}function nEe(e){return iy(this.__data__,e)>-1}function rEe(e,t){var n=this.__data__,r=iy(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}xu.prototype.clear=Z2e;xu.prototype.delete=eEe;xu.prototype.get=tEe;xu.prototype.has=nEe;xu.prototype.set=rEe;function Cu(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oEe(){this.__data__={hash:new kl,map:new(q2e||xu),string:new kl}}function iEe(e){return ay(this,e).delete(e)}function aEe(e){return ay(this,e).get(e)}function sEe(e){return ay(this,e).has(e)}function lEe(e,t){return ay(this,e).set(e,t),this}Cu.prototype.clear=oEe;Cu.prototype.delete=iEe;Cu.prototype.get=aEe;Cu.prototype.has=sEe;Cu.prototype.set=lEe;function ig(e){var t=-1,n=e?e.length:0;for(this.__data__=new Cu;++t<n;)this.add(e[t])}function cEe(e){return this.__data__.set(e,z2),this}function uEe(e){return this.__data__.has(e)}ig.prototype.add=ig.prototype.push=cEe;ig.prototype.has=uEe;function dEe(e,t){var n=H2(e)||ID(e)?N2e(e.length,String):[],r=n.length,o=!!r;for(var i in e)(t||Su.call(e,i))&&!(o&&(i=="length"||CEe(i,r)))&&n.push(i);return n}function iy(e,t){for(var n=e.length;n--;)if($Ee(e[n][0],t))return n;return-1}function pEe(e,t,n,r){var o=-1,i=I2e,a=!0,l=e.length,c=[],u=t.length;if(!l)return c;n&&(t=TD(t,M2e(n))),r?(i=A2e,a=!1):t.length>=b2e&&(i=B2e,a=!1,t=new ig(t));e:for(;++o<l;){var d=e[o],p=n?n(d):d;if(d=r||d!==0?d:0,a&&p===p){for(var h=u;h--;)if(t[h]===p)continue e;c.push(d)}else i(t,p,r)||c.push(d)}return c}function PD(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=xEe),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?PD(l,t-1,n,r,o):U2(o,l):r||(o[o.length]=l)}return o}function fEe(e,t,n){var r=t(e);return H2(e)?r:U2(r,n(e))}function hEe(e){if(!V2(e)||kEe(e))return!1;var t=OD(e)||z2e(e)?W2e:T2e;return t.test(PEe(e))}function mEe(e){if(!V2(e))return _Ee(e);var t=TEe(e),n=[];for(var r in e)r=="constructor"&&(t||!Su.call(e,r))||n.push(r);return n}function gEe(e,t){return e=Object(e),vEe(e,t,function(n,r){return r in e})}function vEe(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=e[a];n(l,a)&&(i[a]=l)}return i}function yEe(e,t){return t=f$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=f$(n.length-t,0),i=Array(o);++r<o;)i[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i,$2e(e,this,a)}}function bEe(e){return fEe(e,LEe,SEe)}function ay(e,t){var n=e.__data__;return EEe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $D(e,t){var n=F2e(e,t);return hEe(n)?n:void 0}var wEe=yw?_D(yw,Object):DD,SEe=yw?function(e){for(var t=[];e;)U2(t,wEe(e)),e=H2e(e);return t}:DD;function xEe(e){return H2(e)||ID(e)||!!(p$&&e&&e[p$])}function CEe(e,t){return t=t??kD,!!t&&(typeof e=="number"||_2e.test(e))&&e>-1&&e%1==0&&e<t}function EEe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function kEe(e){return!!u$&&u$ in e}function TEe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oy;return e===n}function _Ee(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function REe(e){if(typeof e=="string"||OEe(e))return e;var t=e+"";return t=="0"&&1/e==-w2e?"-0":t}function PEe(e){if(e!=null){try{return RD.call(e)}catch{}try{return e+""}catch{}}return""}function $Ee(e,t){return e===t||e!==e&&t!==t}function ID(e){return IEe(e)&&Su.call(e,"callee")&&(!V2e.call(e,"callee")||W2.call(e)==S2e)}var H2=Array.isArray;function AD(e){return e!=null&&AEe(e.length)&&!OD(e)}function IEe(e){return LD(e)&&AD(e)}function OD(e){var t=V2(e)?W2.call(e):"";return t==x2e||t==C2e}function AEe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kD}function V2(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function LD(e){return!!e&&typeof e=="object"}function OEe(e){return typeof e=="symbol"||LD(e)&&W2.call(e)==E2e}function LEe(e){return AD(e)?dEe(e,!0):mEe(e)}var DEe=yEe(function(e,t){return e==null?{}:(t=TD(PD(t,1),REe),gEe(e,pEe(bEe(e),t)))});function DD(){return[]}var NEe=DEe;const MEe=(e,t,n,r)=>{var a,l;return(l=(a=xl(t,n).feature)==null?void 0:a.environments.find(c=>c.name===r))==null?void 0:l.strategies.find(c=>"id"in e.payload&&c.id===e.payload.id)},d0=({change:e,project:t,feature:n,environmentName:r})=>{const o=MEe(e,t,n,r),i=e.action==="deleteStrategy"?void 0:e.payload;return s(bL,{children:s(qv,{entry:{preData:NEe(o,"sortOrder"),data:i}})})},p0=({change:e,children:t})=>{const[n,r]=jt.useState(null),o=l=>{r(l.currentTarget)},i=()=>{r(null)},a=Boolean(n);return T(Re,{children:[s(Xce,{strategyName:e.payload.name}),s(ke,{onMouseEnter:o,onMouseLeave:i,children:kp(e.payload.name)}),s(Px,{id:String(e.id),sx:{pointerEvents:"none"},open:a,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:i,disableRestoreFocus:!0,children:t})]})},h$=({percentage:e,size:t="4rem"})=>{const n=sn(),r={display:"block",borderRadius:"100%",transform:"rotate(-90deg)",height:t,width:t,background:n.palette.grey[200]},o=100/(2*Math.PI),i=2*o;return s("svg",{viewBox:`0 0 ${i} ${i}`,style:r,"aria-hidden":!0,children:s("circle",{r:o,cx:o,cy:o,fill:"none",stroke:n.palette.primary.light,strokeWidth:i,strokeDasharray:`${e} 100`})})},BEe=E("div")(({theme:e})=>({width:"100%",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`})),FEe=E("p")(({theme:e})=>({display:"inline",margin:e.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),zEe=E(wo)(({theme:e})=>({margin:e.spacing(.5)})),f0=({value:e,text:t})=>s(BEe,{children:s(X,{condition:e.length===0,show:T("p",{children:["No ",t,"s added yet."]}),elseShow:T("div",{children:[T(FEe,{children:[e.length," ",e.length>1?`${t}s`:t," will get access."]}),e.map(n=>s(zEe,{label:s(Li,{maxWidth:"300",text:n,maxLength:50})},n))]})})}),jEe=({segments:e})=>!e||e.length===0?null:s(Re,{children:e.map((t,n)=>T(f.Fragment,{children:[s(X,{condition:n>0,show:s(I2,{text:"AND"})}),s(gD,{segment:t})]},t.id))}),m$=()=>s(Je,{sx:{px:3,color:"text.disabled"},children:"This strategy does not have constraints or parameters."}),Us=E(Je)(({theme:e})=>({padding:e.spacing(2,3),border:`1px solid ${e.palette.dividerAlternative}`,borderRadius:e.shape.borderRadiusMedium})),h0=E("span")(({theme:e})=>({color:e.palette.neutral.main})),g$=({strategy:e})=>{const{parameters:t,constraints:n=[]}=e,{strategies:r}=hu(),{uiConfig:o}=Lt(),{segments:i}=Dl(),a=i==null?void 0:i.filter(p=>{var h;return(h=e.segments)==null?void 0:h.includes(p.id)}),l=r.find(p=>p.name===e.name),c=f.useMemo(()=>!t||l!=null&&l.editable?null:Object.keys(t).map(p=>{switch(p){case"rollout":case"Rollout":const h=Ud(t[p]);return T(Us,{sx:{display:"flex",alignItems:"center"},children:[s(Je,{sx:{mr:2},children:s(h$,{percentage:h,size:"2rem"})}),T("div",{children:[s(wo,{color:"success",variant:"outlined",size:"small",label:`${h}%`})," ","of your base"," ",n.length>0?"who match constraints":""," ","is included."]})]});case"userIds":case"UserIds":const m=rs(t[p]);return s(f0,{value:m,text:"user"},p);case"hostNames":case"HostNames":const y=rs(t[p]);return s(f0,{value:y,text:"host"},p);case"IPs":const v=rs(t[p]);return s(f0,{value:v,text:"IP"},p);case"stickiness":case"groupId":return null;default:return null}}),[t,l,n]),u=f.useMemo(()=>{if(!t||!(l!=null&&l.editable))return null;const p=s(h0,{children:" is set to "});return l==null?void 0:l.parameters.map(h=>{const{type:m,name:y}={...h};if(!m||!y||t[y]===void 0)return null;const v=s(Li,{maxLength:15,maxWidth:"150",text:y});switch(h==null?void 0:h.type){case"list":const b=rs(t[y]);return b.length>0?T(Us,{children:[v," ",T(h0,{children:["has ",b.length," ",b.length>1?"items":"item",":"," ",b.map(C=>s(wo,{label:s(Li,{maxWidth:"300",text:C,maxLength:50}),sx:{mr:.5}},C))]})]}):null;case"percentage":const w=Ud(t[y]);return t[y]!==""?T(Us,{sx:{display:"flex",alignItems:"center"},children:[s(Je,{sx:{mr:2},children:s(h$,{percentage:w,size:"2rem"})}),T("div",{children:[v,p,s(wo,{color:"success",variant:"outlined",size:"small",label:`${w}%`})]})]}):null;case"boolean":return t[y]==="true"||t[y]==="false"?T(Us,{children:[s(Li,{maxLength:15,maxWidth:"150",text:y}),p,s(wo,{color:t[y]==="true"?"success":"error",variant:"outlined",size:"small",label:t[y]})]}):null;case"string":const g=fs(t[y]);return typeof t[y]<"u"?T(Us,{children:[v,s(X,{condition:g==="",show:s(h0,{children:" is an empty string"}),elseShow:T(Re,{children:[p,s(Li,{maxWidth:"300",text:g,maxLength:50})]})})]}):null;case"number":const S=Ud(t[y]);return t[y]!==""&&S!==void 0?T(Us,{children:[v,p,s(Li,{maxWidth:"300",text:String(S),maxLength:50})]}):null;case"default":return null}return null})},[t,l]);if(!t)return s(m$,{});const d=[Boolean(o.flags.SE)&&a&&a.length>0&&s(jEe,{segments:a}),n.length>0&&s(ny,{constraints:n,showLabel:!1}),e.name==="default"&&s(Re,{children:T(Us,{sx:{width:"100%"},children:["The standard strategy is"," ",s(wo,{variant:"outlined",size:"small",color:"success",label:"ON"})," ","for all users."]})}),...c??[],...u??[]].filter(Boolean);return s(X,{condition:d.length>0,show:s(Re,{children:d.map((p,h)=>T(f.Fragment,{children:[s(X,{condition:h>0,show:s(I2,{text:"AND"})}),p]},h))}),elseShow:s(m$,{})})},ND=E(Je)({display:"flex",justifyContent:"space-between",alignItems:"center"}),MD=E(Je)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(2)})),G2=E(Je)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1)})),UEe=({children:e,discard:t})=>T(MD,{children:[T(G2,{children:[s(ke,{sx:n=>({color:n.palette.success.dark}),children:"+ Adding strategy:"}),e]}),t]}),WEe=({children:e,discard:t})=>T(MD,{children:[T(G2,{children:[s(ke,{children:"Editing strategy:"}),e]}),t]}),HEe=({discard:e,children:t})=>T(ND,{children:[T(G2,{children:[s(ke,{sx:n=>({color:n.palette.error.main}),children:"- Deleting strategy"}),t]}),e]}),VEe=({enabled:e,discard:t})=>T(ND,{children:[T(Je,{sx:{display:"flex",alignItems:"center"},children:["New status:"," ",s(bi,{sx:n=>({marginLeft:n.spacing(1)}),color:e?"success":"error",children:e?" Enabled":"Disabled"})]}),t]}),GEe=E("div")(({theme:e})=>({overflowX:"auto","& code":{wordWrap:"break-word",whiteSpace:"pre-wrap",fontFamily:"monospace",lineHeight:1.5,fontSize:e.fontSizes.smallBody}})),qEe=({preData:e,data:t})=>s(GEe,{children:s(qv,{entry:{preData:e,data:t}})}),YEe=E(Je)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(2)})),KEe=E(Je)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(1)})),XEe=({feature:e,project:t,environment:n,change:r,discard:o})=>{var l;const{feature:i}=xl(t,e),a=(l=i.environments.find(({name:c})=>n===c))==null?void 0:l.variants;return T(YEe,{children:[T(KEe,{children:[s(ke,{children:"Updating variants:"}),s(qEe,{preData:a,data:r.payload.variants})]}),o]})},JEe=E(Je,{shouldForwardProp:e=>!e.startsWith("$")})(({theme:e,$hasConflict:t,$isInConflictFeature:n,$isAfterWarning:r,$isLast:o})=>({borderLeft:"1px solid",borderRight:"1px solid",borderTop:"1px solid",borderBottom:o?"1px solid":"none",borderRadius:o?`0 0
|
|
385
385
|
${e.shape.borderRadiusLarge}px ${e.shape.borderRadiusLarge}px`:0,borderColor:t||n?e.palette.warning.border:e.palette.dividerAlternative,borderTopColor:(t||r)&&!n?e.palette.warning.border:e.palette.dividerAlternative})),QEe=E(Xt)(({theme:e})=>({borderRadius:0,padding:e.spacing(0,2),"&.MuiAlert-standardWarning":{borderStyle:"none none solid none"}})),ZEe=({index:e,change:t,feature:n,changeRequest:r,discard:o})=>{var i;return T(JEe,{$hasConflict:Boolean(t.conflict),$isInConflictFeature:Boolean(n.conflict),$isAfterWarning:Boolean((i=n.changes[e-1])==null?void 0:i.conflict),$isLast:e+1===n.changes.length,children:[s(X,{condition:Boolean(t.conflict)&&!n.conflict,show:T(QEe,{severity:"warning",children:[s("strong",{children:"Conflict!"})," This change can’t be applied."," ",t.conflict,"."]})}),T(Je,{sx:a=>({padding:a.spacing(3)}),children:[t.action==="updateEnabled"&&s(VEe,{enabled:t.payload.enabled,discard:o}),t.action==="addStrategy"&&T(Re,{children:[s(UEe,{discard:o,children:s(p0,{change:t,children:s(d0,{change:t,feature:n.name,environmentName:r.environment,project:r.project})})}),s(g$,{strategy:t.payload})]}),t.action==="deleteStrategy"&&s(HEe,{discard:o,children:y2e(t.payload)&&s(p0,{change:t,children:s(d0,{change:t,feature:n.name,environmentName:r.environment,project:r.project})})}),t.action==="updateStrategy"&&T(Re,{children:[s(WEe,{discard:o,children:s(p0,{change:t,children:s(d0,{change:t,feature:n.name,environmentName:r.environment,project:r.project})})}),s(g$,{strategy:t.payload})]}),t.action==="patchVariant"&&s(XEe,{feature:n.name,project:r.project,environment:r.environment,change:t,discard:o})]})]},tD(t))},q2=e=>e.features.flatMap(t=>t.changes).length,eke=e=>{const{isChangeRequestConfigured:t}=ff(e.project),n=t(e.environment),r=!["Cancelled","Applied"].includes(e.state),{user:o}=si(),i=(o==null?void 0:o.id)===e.createdBy.id;return n&&r&&i&&q2(e)>1},tke=E(po)(()=>({textDecoration:"none","&:hover, &:focus":{textDecoration:"underline"}})),nke=({onDiscard:e})=>s(Je,{children:s(tke,{onClick:e,children:"Discard"})}),rke=({changeRequest:e,changeId:t,onPostDiscard:n})=>{const r=eke(e),{discardChange:o}=D2(),{setToastData:i,setToastApiError:a}=It();return s(X,{condition:r,show:s(nke,{onDiscard:(c=>async()=>{try{await o(e.project,e.id,c),i({title:"Change discarded from change request draft.",type:"success"}),n==null||n()}catch(u){a(ht(u))}})(t)})})},oke=({changeRequest:e,onRefetch:t,onNavigate:n})=>{var r;return s(Je,{children:(r=e.features)==null?void 0:r.map(o=>s(v2e,{featureName:o.name,projectId:e.project,onNavigate:n,conflict:o.conflict,children:o.changes.map((i,a)=>s(ZEe,{discard:s(rke,{changeRequest:e,changeId:i.id,onPostDiscard:t}),index:a,changeRequest:e,change:i,feature:o},a))},o.name))})},v$=()=>s(bi,{color:"secondary",icon:s(Jee,{fontSize:"small"}),children:"Review required"}),ike=()=>s(bi,{color:"warning",children:"Draft"}),ake=({state:e})=>{switch(e){case"Draft":return s(ike,{});case"In review":return s(v$,{});case"Approved":return s(bi,{color:"success",icon:s(zm,{fontSize:"small"}),children:"Approved"});case"Applied":return s(bi,{color:"success",icon:s(zm,{fontSize:"small"}),children:"Applied"});case"Cancelled":return s(bi,{color:"error",icon:s(vv,{fontSize:"small"}),children:"Cancelled"});default:return s(v$,{})}},ske=({onClick:e,count:t})=>T(rt,{sx:{ml:"auto"},variant:"contained",onClick:e,children:["Submit change request (",t,")"]}),lke=({environmentChangeRequest:e,onClose:t,onReview:n,onDiscard:r,children:o})=>{const i=sn(),a=ft();return T(Je,{sx:{padding:3,border:"2px solid",mb:5,borderColor:l=>l.palette.secondaryContainer,borderRadius:l=>`${l.shape.borderRadiusLarge}px`},children:[T(Je,{sx:{display:"flex",alignItems:"end"},children:[T(Je,{sx:{display:"flex",alignItems:"center"},children:[s(a3,{sx:l=>({color:l.palette.primary.light,mr:.5})}),s(ke,{component:"span",variant:"h2",children:e.environment}),s(mke,{}),s(gke,{count:e.features.length})]}),s(Je,{sx:{ml:"auto"},children:s(ake,{state:e.state})})]}),s(uo,{sx:{my:3}}),s(ke,{variant:"body2",color:"text.secondary",children:"You request changes for these feature toggles:"}),o,T(Je,{sx:{display:"flex",mt:3},children:[s(X,{condition:(e==null?void 0:e.state)==="Draft",show:T(Re,{children:[s(ske,{onClick:()=>n(e.id),count:q2(e)}),s(rt,{sx:{ml:2},variant:"outlined",onClick:()=>r(e.id),children:"Discard changes"})]})}),s(X,{condition:e.state==="In review"||e.state==="Approved",show:s(Re,{children:T(hke,{children:[s(fke,{}),s(ke,{color:i.palette.success.dark,children:"Draft successfully sent to review"}),s(rt,{sx:{marginLeft:2},variant:"outlined",onClick:()=>{t(),a(`/projects/${e.project}/change-requests/${e.id}`)},children:"View change request page"})]})})})]})]},e.id)},cke=E(Bx)(({theme:e})=>({fontSize:e.fontSizes.mainHeader,marginLeft:"0.3rem",color:e.palette.grey[700]})),uke=E("div")(({theme:e})=>({color:e.palette.text.secondary,fontSize:e.fontSizes.smallBody})),dke=()=>s(xn,{actions:"",titleElement:T(Re,{children:[T(Je,{sx:{display:"flex",alignItems:"center"},children:["Review your changes",s(Tt,{title:"Here you can see all the changes that you are suggesting and you can send them for review. You can still discard the changes after you sent them for review or even cancel the entire review if you need it",arrow:!0,children:s(cke,{})})]}),s(uke,{children:"Make sure you are sending the right changes to be reviewed"})]})}),y$=E(gr)(({theme:e})=>({height:"100vh",overflow:"auto",minWidth:"50vw",padding:e.spacing(6),[e.breakpoints.down("md")]:{padding:e.spacing(4,2)},"& .header":{padding:e.spacing(0,0,2,0)},"& .body":{padding:e.spacing(3,0,0,0)},borderRadius:`${e.spacing(1.5,0,0,1.5)} !important`})),pke=E(rt)(({theme:e})=>({marginTop:e.spacing(2),marginLeft:"auto"})),fke=E(Xee)(({theme:e})=>({color:e.palette.success.main,height:"32px",width:"32px",marginRight:e.spacing(1)})),hke=E(Je)(()=>({marginLeft:"auto",display:"flex",alignItems:"center"})),mke=()=>s(ke,{component:"span",sx:{marginLeft:1.5,marginRight:1.5,color:"dividerAlternative"},children:"|"}),gke=({count:e})=>T(Je,{children:[T(ke,{component:"span",variant:"body1",color:"text.secondary",children:["Updates:"," "]}),T(ke,{component:"span",sx:{fontWeight:"bold"},children:[e," ",e===1?"feature toggle":"feature toggles"]})]}),vke=({open:e,project:t,onClose:n})=>{const{data:r,loading:o,refetch:i}=ry(t),{changeState:a,discardDraft:l}=D2(),{setToastApiError:c}=It(),u=async p=>{try{await a(t,p,{state:"In review"}),i()}catch(h){c(ht(h))}},d=async p=>{try{await l(t,p),i()}catch(h){c(ht(h))}};return!o&&!r?s(iP,{open:e,onClose:n,label:"Review changes",children:T(y$,{disableBorder:!0,header:s(xn,{titleElement:"Review your changes"}),children:["There are no changes to review.",s(pke,{onClick:n,children:"Close"})]})}):s(iP,{open:e,onClose:n,label:"Review changes",children:s(y$,{disableBorder:!0,header:s(dke,{}),children:r==null?void 0:r.map(p=>s(lke,{environmentChangeRequest:p,onClose:n,onReview:u,onDiscard:d,children:s(oke,{changeRequest:p,onNavigate:n,onRefetch:i})},p.id))})})},yke=E(Je)(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing(1,0),[e.breakpoints.down("lg")]:{padding:e.spacing(1,2)},color:e.palette.warning.main})),bke=E(Je)(({theme:e})=>({width:"1250px",marginLeft:"auto",marginRight:"auto",[e.breakpoints.down("lg")]:{width:"1024px"},[e.breakpoints.down(1024)]:{width:"100%",marginLeft:0,marginRight:0},[e.breakpoints.down("sm")]:{minWidth:"100%"}})),wke=({changeRequest:e,onClick:t})=>s(bke,{children:T(yke,{children:[T(ke,{variant:"body2",sx:{mr:4},children:[s("strong",{children:"Change request mode"})," – You have changes"," ",s(X,{condition:Boolean(e.environment),show:T(Re,{children:["in ",T("strong",{children:[e.environment," "]})]})}),s(X,{condition:e.state==="Draft",show:"that need to be reviewed"}),s(X,{condition:e.state==="In review",show:"that are in review"}),s(X,{condition:e.state==="Approved",show:"that are approved. Adding more changes will clear the approvals and require a new review"})]}),T(rt,{variant:"contained",onClick:t,sx:{ml:"auto"},children:["View changes (",q2(e),")"]})]})}),Ske=E(Je)(({theme:e})=>({position:"sticky",top:-1,zIndex:250,borderTop:`1px solid ${e.palette.warning.border}`,borderBottom:`1px solid ${e.palette.warning.border}`,backgroundColor:e.palette.warning.light})),xke=({project:e})=>{const[t,n]=f.useState(!1),{data:r,loading:o}=ry(e);return!o&&!r||(r==null?void 0:r.length)===0?null:T(Ske,{children:[r!=null&&r.length?r.filter(i=>["Draft","In review","Approved"].includes(i.state)).map(i=>s(wke,{changeRequest:i,onClick:()=>{n(!0)}},i.id)):null,s(vke,{project:e,open:t,onClose:()=>{n(!1)}})]})},Cke=E(_n)(()=>({height:"100%",justifyContent:"space-between"})),Eke=E("main")(({theme:e})=>({margin:e.spacing(0,"auto"),overflow:"auto",flex:1,width:"100%",backgroundColor:e.palette.contentWrapper,position:"relative"})),kke=E(_n)(({theme:e})=>({width:"1250px",margin:"0 auto",[e.breakpoints.down("lg")]:{width:"1024px"},[e.breakpoints.down(1024)]:{width:"100%",marginLeft:0,marginRight:0},[e.breakpoints.down("sm")]:{minWidth:"100%"}})),Tke=E("img")(()=>({display:"block",position:"fixed",zIndex:0,bottom:0,right:0,width:400,pointerEvents:"none",userSelect:"none"})),_ke=E("div")(({theme:e})=>({height:"100%",padding:e.spacing(0,0,6.5,0),position:"relative",[e.breakpoints.down("md")]:{padding:e.spacing(0,1.5,6.5,1.5)},zIndex:200})),Rke=f.forwardRef(({children:e},t)=>{const{uiConfig:n}=Lt(),r=xO("projectId"),{isChangeRequestConfiguredInAnyEnv:o}=ff(r||"");return T(Re,{children:[s(g2e,{}),s(QCe,{}),s(h2e,{}),T(Cke,{children:[T(Eke,{children:[s(X,{condition:Boolean(r&&o()),show:s(xke,{project:r||""})}),s(kke,{item:!0,xs:12,sm:12,my:2,children:T(_ke,{ref:t,children:[s(p2e,{}),s(l2e,{toast:n.toast}),e]})}),s(Tke,{src:Js(f2e),alt:""})]}),s(r2e,{})]})]})}),Pke=({isStandalone:e,children:t})=>s(X,{condition:e===!0,show:t,elseShow:s(Rke,{children:t})}),$ke=E("div")(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",padding:e.spacing(4),position:"fixed",inset:0,backgroundColor:e.palette.text.tertiaryContrast,width:"100%"})),Ike=E(U3)(({theme:e})=>({height:"80px"})),Ake=E("div")(({theme:e})=>({display:"flex",position:"relative"})),Oke=E("div")(({theme:e})=>({marginTop:e.spacing(4)})),Lke=E(rt)(({theme:e})=>({height:"150px",width:"150px",position:"absolute",right:100,top:45})),Dke=()=>{const e=ft();return s($ke,{children:T("div",{children:[s(Ike,{}),s(Ake,{children:s(ke,{variant:"h1",style:{fontSize:"2rem"},children:"Ooops. That's a page we haven't toggled on yet."})}),T(Oke,{children:[s(rt,{variant:"contained",color:"primary",onClick:()=>{e(Ao)},children:"Go back"}),s(Lke,{onClick:()=>{e("/")},children:"Go home"})]})]})})},Nke=()=>{const{pathname:e,search:t}=ri(),r=`/login?redirect=${encodeURIComponent(e+t)}`;return s(Il,{to:r,replace:!0})},Mke=({route:e})=>{const{user:t}=si();return!Boolean(t==null?void 0:t.id)&&e.type==="protected"?s(Nke,{}):s(e.component,{})},Bke=({children:e})=>{const{refetchUser:t}=si();return s(Uee,{value:{onError:r=>{r instanceof v3&&r.status===401&&t()}},children:e})};function Fke(e,t,n){const r=/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*:)*?:?0*1$/.test(location.hostname)||location.protocol==="file:";if(!t.trackLocalhost&&r)return console.warn("[Plausible] Ignoring event because website is running locally");try{if(window.localStorage.plausible_ignore==="true")return console.warn('[Plausible] Ignoring event because "plausible_ignore" is set to "true" in localStorage')}catch{}const o={n:e,u:t.url,d:t.domain,r:t.referrer,w:t.deviceWidth,h:t.hashMode?1:0,p:n&&n.props?JSON.stringify(n.props):void 0},i=new XMLHttpRequest;i.open("POST",`${t.apiHost}/api/event`,!0),i.setRequestHeader("Content-Type","text/plain"),i.send(JSON.stringify(o)),i.onreadystatechange=()=>{i.readyState===4&&n&&n.callback&&n.callback()}}function zke(e){const t=()=>({hashMode:!1,trackLocalhost:!1,url:location.href,domain:location.hostname,referrer:document.referrer||null,deviceWidth:window.innerWidth,apiHost:"https://plausible.io",...e}),n=(a,l,c)=>{Fke(a,{...t(),...c},l)},r=(a,l)=>{n("pageview",l,a)};return{trackEvent:n,trackPageview:r,enableAutoPageviews:()=>{const a=()=>r(),l=history.pushState;return l&&(history.pushState=function(c,u,d){l.apply(this,[c,u,d]),a()},addEventListener("popstate",a)),e&&e.hashMode&&addEventListener("hashchange",a),r(),function(){l&&(history.pushState=l,removeEventListener("popstate",a)),e&&e.hashMode&&removeEventListener("hashchange",a)}},enableAutoOutboundTracking:(a=document,l={subtree:!0,childList:!0,attributes:!0,attributeFilter:["href"]})=>{function c(m){n("Outbound Link: Click",{props:{url:this.href}}),typeof process<"u"&&process,setTimeout(()=>{location.href=this.href},150),m.preventDefault()}const u=new Set;function d(m){m instanceof HTMLAnchorElement?m.host!==location.host&&(m.addEventListener("click",c),u.add(m)):"querySelectorAll"in m&&m.querySelectorAll("a").forEach(d)}function p(m){m instanceof HTMLAnchorElement?(m.removeEventListener("click",c),u.delete(m)):"querySelectorAll"in m&&m.querySelectorAll("a").forEach(p)}const h=new MutationObserver(m=>{m.forEach(y=>{y.type==="attributes"?(p(y.target),d(y.target)):y.type==="childList"&&(y.addedNodes.forEach(d),y.removedNodes.forEach(p))})});return a.querySelectorAll("a").forEach(d),h.observe(a,l),function(){u.forEach(y=>{y.removeEventListener("click",c)}),u.clear(),h.disconnect()}}}}const jke="https://plausible.getunleash.io",Uke="app.unleash-hosted.com",m0=!1,Wke=({children:e})=>{var l;const[t,n]=f.useState(null),o=(()=>{var c;try{const u=((c=document.querySelector('meta[name="uiFlags"]'))==null?void 0:c.content)||"{}";return JSON.parse(u)}catch{return{}}})(),{uiConfig:i}=Lt(),a=Boolean(((l=i==null?void 0:i.flags)==null?void 0:l.T)||o.T||m0);return f.useEffect(()=>{if(a)try{const c=zke({domain:m0?void 0:Uke,apiHost:m0?"http://localhost:8000":jke,trackLocalhost:!0});return n(()=>c),c.enableAutoPageviews()}catch(c){console.warn(c)}},[a]),s(x3.Provider,{value:t,children:e})},Hke=ai()(e=>({container:{maxWidth:"450px",background:e.palette.background.paper,boxShadow:"2px 2px 4px rgba(0,0,0,0.4)",zIndex:500,margin:"0 0.8rem",borderRadius:"12.5px",padding:"2rem"},innerContainer:{position:"relative"},starting:{opacity:0},headerContainer:{display:"flex",alignItems:"center"},confettiContainer:{position:"relative",maxWidth:"600px",margin:"0 auto",display:"flex"},textContainer:{marginLeft:"1rem",wordBreak:"break-word"},headerStyles:{fontWeight:"normal",margin:0,marginBottom:"0.5rem"},createdContainer:{display:"flex",alignItems:"center",flexDirection:"column"},anim:{animation:"$drop 10s 3s"},checkMark:{width:"65px",height:"65px"},buttonStyle:{position:"absolute",top:"-33px",right:"-33px"},"@keyframes drop":{"0%":{opacity:"0%",top:"0%"},"10%":{opacity:"100%"},"100%":{top:"100%"}}})),Vke=E("div")(({theme:e})=>({backgroundColor:e.palette.checkmarkBadge,width:"75px",height:"75px",borderRadius:"50px",display:"flex",justifyContent:"center",alignItems:"center",[e.breakpoints.down("sm")]:{width:"50px",height:"50px"}})),Gke=E(vv)(({theme:e})=>({color:e.palette.tertiary.background,width:"35px",height:"35px"})),qke=E(zm)(({theme:e})=>({color:e.palette.tertiary.background,width:"35px",height:"35px"})),Yke=({type:e,className:t})=>s(Vke,{className:t,children:e==="error"?s(Gke,{titleAccess:"Error"}):s(qke,{})}),Kke=({title:e,text:t,type:n,confetti:r})=>{const{setToast:o}=f.useContext($s),{classes:i}=Hke(),a=["#d13447","#ffbf00","#263672"],l=200,c=p=>Math.floor(Math.random()*p)+1,u=()=>new Array(l).fill(1).map((m,y)=>{const v=c(8),b=c(100),w={position:"absolute",width:`${v}px`,height:`${v*.4}px`,backgroundColor:a[c(2)],left:`${b}%`,transform:`rotate(${c(101)}deg)`,animationDelay:`${c(5)}s`,animationDuration:`${c(3)}s`,animationEase:`${c(2)}s`};return s("div",{style:w,className:yi(i.starting,i.anim)},y)}),d=()=>{o(p=>({...p,show:!1}))};return s("div",{className:i.container,children:s("div",{className:i.innerContainer,children:T("div",{className:i.confettiContainer,children:[r&&u(),T("div",{className:i.createdContainer,children:[T("div",{className:i.headerContainer,children:[s("div",{children:s(Yke,{type:n,className:i.checkMark})}),T("div",{className:i.textContainer,children:[s("h3",{className:i.headerStyles,children:e}),s(X,{condition:Boolean(t),show:s("p",{"data-testid":nne,children:t})})]})]}),s(Tt,{title:"Close",arrow:!0,children:s(Qt,{onClick:d,className:i.buttonStyle,size:"large",children:s(wv,{})})})]})]})})})},Xke=()=>{const{toastData:e,setToast:t}=f.useContext($s),n=()=>{t(o=>({...o,show:!1}))};f.useEffect(()=>{if(!e.autoHideDuration)return;let o=setTimeout(()=>{n()},e.autoHideDuration);return()=>{clearTimeout(o)}},[e==null?void 0:e.show]);const r=f.useMemo(()=>({start:{...R3,right:0,left:0,margin:"0 auto",maxWidth:"450px"},enter:P3,leave:Qne}),[]);return s(mx,{children:s(qx,{mounted:Boolean(e==null?void 0:e.show),start:r.start,enter:r.enter,leave:r.leave,children:s(Kke,{...e})})})},Jke=()=>{const{pathname:e}=ri(),{user:t}=si(),{splash:n}=CL(),{uiConfig:r,loading:o}=Lt();if(!t||!n||!r||o||iA("/splash/:splashId",e)||t.isAPI)return null;const i=Ige.find(a=>!Qke(a,n));return i?s(Il,{to:`/splash/${i}`,replace:!0}):null},Qke=(e,t)=>Boolean(t[e]),Zke=E(tte)(({theme:e})=>({height:"20px",width:"20px",marginRight:e.spacing(1)})),eTe=E("div")(({theme:e})=>({display:"flex",fontSize:e.fontSizes.smallBody,justifyContent:"center",alignItems:"center",color:e.palette.error.main,backgroundColor:e.palette.error.light,height:"65px",borderBottom:`1px solid ${e.palette.error.border}`,whiteSpace:"pre-wrap"})),tTe=()=>T(eTe,{children:[s(Zke,{}),s("b",{children:"Maintenance Mode! "}),s("p",{children:"During maintenance mode, any changes made will not be saved and you may receive an error. We apologize for any inconvenience this may cause."})]}),nTe=()=>{const e=`${Ba}:unleash-lastViewedProject`,[t,n]=f.useState(()=>vp(e));return f.useEffect(()=>{t&&Uc(e,t)},[t,e]),{lastViewed:t,setLastViewed:n}},rTe=()=>{const{lastViewed:e}=nTe(),{projects:t,loading:n}=ja(),r=ft(),o=f.useCallback(()=>t&&e?`/projects/${e}`:t&&!e&&t.length===1?`/projects/${t[0].id}`:"/projects",[e,t]),i=()=>{r(o(),{replace:!0})};return f.useEffect(()=>{i()},[o]),n?s(Xm,{}):null},oTe=E("div")(()=>({"& ul":{margin:0}})),iTe=()=>{var a;const{authDetails:e}=mu(),{user:t}=si(),n=Boolean(e||t),{isOss:r,uiConfig:o}=Lt(),i=r()?$p.filter(l=>!l.enterprise):$p;return s(Rte,{FallbackComponent:lne,children:s(Bke,{children:s(f.Suspense,{fallback:s(Xm,{}),children:s(Wke,{children:s(X,{condition:!n,show:s(Xm,{}),elseShow:T(Re,{children:[s(X,{condition:Boolean((a=o==null?void 0:o.flags)==null?void 0:a.maintenance)&&Boolean(o==null?void 0:o.maintenanceMode),show:s(tTe,{})}),T(oTe,{children:[s(Xke,{}),T(JM,{children:[i.map(l=>s(Bh,{path:l.path,element:s(Pke,{isStandalone:l.isStandalone===!0,children:s(Mke,{route:l})})},l.path)),s(Bh,{path:"/",element:s(rTe,{})}),s(Bh,{path:"*",element:s(Dke,{})})]}),s(sre,{openUrl:"http://feedback.unleash.run"}),s(Jke,{})]})]})})})})})})},aTe=()=>{const{pathname:e}=ri();return f.useEffect(()=>{sTe.some(t=>e.includes(t))||window.scrollTo(0,0)},[e]),null},sTe=["/admin/api","/admin/users","/admin/auth","/admin/roles"],lTe=({children:e})=>{const{permissions:t}=WC(),n=f.useMemo(()=>({isAdmin:cTe(t),hasAccess:uTe.bind(null,t)}),[t]);return s(Qr.Provider,{value:n,children:e})},cTe=e=>e?e.some(t=>t.permission===xi):!1,uTe=(e,t,n,r)=>e?e.some(o=>dTe(o,t,n,r)):!1,dTe=(e,t,n,r)=>t?e.permission===xi||e.permission===t&&(e.project===n||e.project==="*")&&(e.environment===r||e.environment==="*")||e.permission===t&&(e.project===n||e.project==="*")&&e.environment===null?!0:e.permission===t&&e.project===void 0&&e.environment===null:(console.warn(`Missing permission for AccessProvider: ${t}`),!1),pTe=E("div")(({theme:e})=>({display:"flex",gap:e.spacing(2),alignItems:"center",margin:"0 auto"})),b$=E("span")(({theme:e})=>({width:"6.25rem",whiteSpace:"nowrap",color:e.palette.text.secondary,"&:first-of-type":{textAlign:"right"},[e.breakpoints.down("sm")]:{display:"none"}})),fTe=E("label")(({theme:e})=>({"& input":{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:1,height:1},"& span":{display:"grid",justifyContent:"center",alignItems:"center",background:e.palette.grey[300],width:"3rem",height:"3rem",borderRadius:"10rem",fontSize:"1.25rem",paddingBottom:2,userSelect:"none",cursor:"pointer"},"& input:checked + span":{fontWeight:e.fontWeight.bold,background:e.palette.primary.main,color:e.palette.text.tertiaryContrast},"& input:focus-visible + span":{outline:"2px solid",outlineOffset:2,outlineColor:e.palette.primary.main}})),hTe=({form:e,setForm:t})=>{const n=r=>{t(Ho(o=>{o.score=Number(r.target.value)}))};return T(pTe,{children:[s(b$,{children:"Very difficult"}),[1,2,3,4,5,6,7].map(r=>T(fTe,{children:[s("input",{type:"radio",name:"score",value:r,checked:e.score===r,onChange:n}),s("span",{children:r})]},r)),s(b$,{children:"Very easy"})]})},mTe=async e=>{if(!e.score)return;const t={source:"app:segments",data:{score:e.score,comment:e.comment,currentPage:e.path,openedManually:!1,customerType:"paying"}};await fetch("https://europe-west3-metrics-304612.cloudfunctions.net/docs-app-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},gTe=E("div")(({theme:e})=>({fontWeight:e.fontWeight.thin})),vTe=E("h1")(({theme:e})=>({all:"unset",display:"block",textAlign:"center",color:e.palette.text.secondary})),yTe=E("form")(({theme:e})=>({display:"grid",gap:e.spacing(6),gridTemplateColumns:"minmax(auto, 40rem)",justifyContent:"center"})),bTe=E("p")(({theme:e})=>({all:"unset",display:"block",marginTop:e.spacing(5),fontSize:e.spacing(3),textAlign:"center"})),wTe=E("label")(({theme:e})=>({display:"block",marginBottom:e.spacing(1)})),STe=({state:e,onClose:t})=>{const[n,r]=f.useState(!1),{setToastData:o}=It(),[i,a]=f.useState({path:e.path}),l=u=>{a(Ho(d=>{d.comment=u.target.value}))};return T(gTe,{children:[s(vTe,{children:"Please help us improve"}),T(yTe,{onSubmit:async u=>{if(u.preventDefault(),!n)try{r(!0),await mTe(i),o({type:"success",title:"Feedback sent. Thank you!",confetti:!0}),t()}finally{r(!1)}},"aria-live":"polite",children:[s(bTe,{children:e.title}),s(hTe,{form:i,setForm:a}),T("div",{hidden:!i.score,children:[s(wTe,{htmlFor:"comment",children:e.text}),s(pn,{value:i.comment??"",onChange:l,multiline:!0,rows:3,variant:"outlined",fullWidth:!0})]}),s(Je,{hidden:!i.score,sx:{textAlign:"center"},children:s(rt,{type:"submit",color:"primary",variant:"contained",sx:{minWidth:"15rem"},disabled:!i.score||n,children:"Send feedback"})})]})]})},xTe=E("div")(({theme:e})=>({pointerEvents:"none",display:"grid",padding:e.spacing(2),overflowY:"auto",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw"})),CTe=E("div")(({theme:e})=>({pointerEvents:"auto",position:"relative",padding:e.spacing(8),background:e.palette.background.paper,boxShadow:"0 0 1rem rgba(0, 0, 0, 0.25)",borderRadius:e.spacing(2),[e.breakpoints.down("md")]:{padding:e.spacing(4)}})),ETe=E("div")({all:"unset",position:"absolute",top:0,right:0}),kTe=E(i3)(({theme:e})=>({fontSize:"1.5rem",color:e.palette.inactiveIcon})),TTe=({state:e})=>{const{hideFeedbackCES:t}=f.useContext(O2),n=e&&s(STe,{state:e,onClose:t});return s(Qp,{open:Boolean(e),onClose:t,"aria-label":e==null?void 0:e.title,children:s(xTe,{children:T(CTe,{children:[s(ETe,{children:s(Qt,{onClick:t,size:"large",children:s(kTe,{titleAccess:"Close"})})}),n]})})})},_Te=()=>{const{createFeedback:e}=A3(),{feedback:t}=Xx(),n=f.useCallback(o=>!!t&&t.some(i=>i.feedbackId===w$(o)),[t]),r=f.useCallback(o=>e({feedbackId:w$(o)}),[e]);return{isSeen:n,setSeen:r}},w$=e=>`ces${e.path}`,RTe=(e=window.location.hostname)=>e==="localhost",PTe=(e=window.location.hostname)=>e.endsWith(".getunleash.io")||e.endsWith(".unleash-hosted.com"),$Te=(e=window.location.hostname)=>e.endsWith(".vercel.app"),ITe=()=>PTe()||$Te()||RTe(),ATe=({children:e})=>{const[t,n]=f.useState(),{isSeen:r,setSeen:o}=_Te(),i=ITe();f.useEffect(()=>{t&&o(t)},[t,o]);const a=f.useCallback(u=>{n(d=>{const p=u instanceof Function?u(d):u;return!i||!p||r(p)?void 0:p})},[i,r]),l=f.useCallback(()=>{n(void 0)},[n]),c=f.useMemo(()=>({showFeedbackCES:a,hideFeedbackCES:l}),[a,l]);return T(O2.Provider,{value:c,children:[e,s(TTe,{state:t})]})},OTe=E("div")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",zIndex:-1,width:1,height:1,margin:-1,padding:0,overflow:"hidden"}),LTe=({announcement:e})=>s(OTe,{role:"status","aria-live":"polite","aria-atomic":!0,"data-testid":tne,children:e}),DTe=({children:e})=>{const[t,n]=f.useState(),r=f.useMemo(()=>({setAnnouncement:n}),[n]);return T(cC.Provider,{value:r,children:[e,s(LTe,{announcement:t})]})};var _a=(e=>(e.UNASSIGNED="UNASSIGNED",e.TRIAL="TRIAL",e.ACTIVE="ACTIVE",e.EXPIRED="EXPIRED",e.CHURNED="CHURNED",e))(_a||{}),dc=(e=>(e.PRO="Pro",e.COMPANY="Company",e.TEAM="Team",e.UNKNOWN="Unknown",e))(dc||{});const NTe=(e,t,n)=>{const{data:r,error:o,mutate:i}=gn(e,t,n),a=f.useCallback(()=>{i().catch(console.warn)},[i]);return{data:r,error:o,refetch:a,loading:!o&&!r}},MTe=()=>{const{uiConfig:e}=Lt(),{flags:{UNLEASH_CLOUD:t}}=e,{data:n,refetch:r,loading:o,error:i}=NTe(["useInstanceStatus",t],()=>BTe(t)),a=[dc.PRO,dc.COMPANY,dc.TEAM];return{instanceStatus:n,refetchInstanceStatus:r,refresh:async()=>{await fetch(Ft("api/instance/refresh"))},isBilling:a.includes((n==null?void 0:n.plan)??dc.UNKNOWN),loading:o,error:i}},BTe=async e=>{if(!e)return S$;const t=await fetch(Ft("api/instance/status"));return t.ok?t.json():S$},S$={plan:dc.UNKNOWN},FTe=10,zTe=e=>(e==null?void 0:e.state)===_a.TRIAL||(e==null?void 0:e.state)===_a.EXPIRED||(e==null?void 0:e.state)===_a.CHURNED,BD=e=>(e==null?void 0:e.state)===_a.EXPIRED||(e==null?void 0:e.state)===_a.CHURNED?!0:(e==null?void 0:e.state)===_a.TRIAL&&(e!=null&&e.trialExpiry)?Eae(pf(e.trialExpiry)):!1,jTe=e=>!e||e.state!==_a.TRIAL||!e.trialExpiry?!1:$3(pf(e.trialExpiry),new Date)<=FTe,x$=e=>Boolean(e&&e.state===_a.EXPIRED&&!e.trialExtended),UTe=E("aside")(({theme:e})=>({position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(1),gap:e.spacing(1),borderBottom:"1px solid",borderColor:e.palette.warning.border,background:e.palette.warning.light,color:e.palette.warning.dark})),FD=E("aside")(({theme:e})=>({position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(1),gap:e.spacing(1),borderBottom:"1px solid",borderColor:e.palette.info.border,background:e.palette.info.light,color:e.palette.info.dark})),WTe=E(rt)(({theme:e})=>({whiteSpace:"nowrap",minWidth:"8rem",marginLeft:e.spacing(2)})),HTe=E(p3)(({theme:e})=>({color:e.palette.warning.main})),zD=E(zd)(({theme:e})=>({color:e.palette.info.main})),VTe=({instanceStatus:e})=>BD(e)?s(GTe,{instanceStatus:e}):jTe(e)?s(qTe,{instanceStatus:e}):zTe(e)?s(YTe,{instanceStatus:e}):null,GTe=({instanceStatus:e})=>T(UTe,{"data-testid":Vx,children:[s(HTe,{}),T(ke,{sx:t=>({fontSize:t.fontSizes.smallBody}),children:[s("strong",{children:"Warning!"})," Your free ",e.plan," trial has expired. ",s("strong",{children:"Upgrade trial"})," otherwise your"," ",s("strong",{children:"account will be deleted."})]}),s(Y2,{})]}),qTe=({instanceStatus:e})=>{const t=Cae(pf(e.trialExpiry),{roundingMethod:"floor"});return T(FD,{"data-testid":Vx,children:[s(zD,{}),T(ke,{sx:n=>({fontSize:n.fontSizes.smallBody}),children:[s("strong",{children:"Heads up!"})," You have"," ",s("strong",{children:t})," left of your free"," ",e.plan," trial."]}),s(Y2,{})]})},YTe=({instanceStatus:e})=>T(FD,{"data-testid":Vx,children:[s(zD,{}),T(ke,{sx:t=>({fontSize:t.fontSizes.smallBody}),children:[s("strong",{children:"Heads up!"})," You're currently on a free"," ",e.plan," trial account."]}),s(Y2,{})]}),Y2=()=>{const{hasAccess:e}=f.useContext(Qr),t=ft();return e(xi)?s(WTe,{onClick:()=>t("/admin/billing"),variant:"outlined",children:"Upgrade trial"}):null},KTe=()=>{const{makeRequest:e,createRequest:t,errors:n,loading:r}=Un({propagateErrors:!0});return{extendTrial:async()=>{const a=t("api/instance/extend",{method:"POST"},"extendTrial");await e(a.caller,a.id)},loading:r,errors:n}},XTe=({instanceStatus:e,onExtendTrial:t})=>{const{hasAccess:n}=f.useContext(Qr),r=ft(),o=BD(e),[i,a]=f.useState(o),l=(c,u)=>{u||(a(!1),x$(e)&&t().catch(console.error))};return f.useEffect(()=>{a(o);const c=setInterval(()=>{a(o)},6e4);return()=>clearInterval(c)},[o]),n(xi)?s(cr,{open:i,primaryButtonText:"Upgrade trial",secondaryButtonText:x$(e)?"Extend trial (5 days)":"Remind me later",onClick:()=>{r("/admin/billing"),a(!1)},onClose:l,title:`Your free ${e.plan} trial has expired!`,children:T(ke,{children:[s("strong",{children:"Upgrade trial"})," otherwise your"," ",s("strong",{children:"account will be deleted."})]})}):s(cr,{open:i,secondaryButtonText:"Remind me later",onClose:()=>{a(!1)},title:`Your free ${e.plan} trial has expired!`,children:T(ke,{children:["Please inform your admin to ",s("strong",{children:"Upgrade trial"})," or your ",s("strong",{children:"account will be deleted."})]})})},JTe=({children:e})=>{const{instanceStatus:t,refetchInstanceStatus:n,isBilling:r}=MTe(),{extendTrial:o}=KTe(),{setToastApiError:i}=It(),a=sn(),l=async()=>{try{await o(),await n()}catch(c){i(ht(c))}};return T("div",{style:{height:"100%",backgroundColor:a.palette.background.paper},children:[s(X,{condition:r&&Boolean(t),show:()=>T(Re,{children:[s(QTe,{instanceStatus:t}),s(XTe,{instanceStatus:t,onExtendTrial:l})]})}),e]})},QTe=jt.memo(VTe),ZTe=e=>{const t=vp("unleash-theme");if(t)return t;let n;return e&&(n=window.matchMedia("(prefers-color-scheme: dark)").matches),n?"dark":"light"},e_e=({children:e,darkmode:t=!1})=>{const[n,r]=f.useState(q4()),[o,i]=f.useState(!1),[a,l]=f.useState(ZTe(t)),c=jt.useMemo(()=>({setToast:r,toastData:n,showFeedback:o,setShowFeedback:i,themeMode:a,setThemeMode:l}),[n,o,a]);return s($s.Provider,{value:c,children:e})},t_e=({children:e})=>{const{uiConfig:t}=Lt();return t.flags?s(e_e,{darkmode:t.flags.ENABLE_DARK_MODE_SUPPORT||!1,children:e}):null},C$=["http","https","mailto","tel"];function n_e(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let o=-1;for(;++o<C$.length;){const i=C$[o];if(r===i.length&&t.slice(0,i.length).toLowerCase()===i)return t}return o=t.indexOf("?"),o!==-1&&r>o||(o=t.indexOf("#"),o!==-1&&r>o)?t:"javascript:void(0)"}/*!
|
|
386
386
|
* Determine if an object is a Buffer
|
|
387
387
|
*
|
|
@@ -412,4 +412,4 @@ Check out what changed in the newest major release:
|
|
|
412
412
|
- And the best is...
|
|
413
413
|
- **Unleash v5 is finally here!**
|
|
414
414
|
|
|
415
|
-
You can read more about it on our newest [blog post](https://www.getunleash.io/blog).`},X$e=()=>{const{uiConfig:e}=Lt(),[t,n]=f.useState(!1),{enabled:r,message:o,variant:i="neutral",icon:a,link:l,linkText:c="More info",plausibleEvent:u,dialogTitle:d,dialog:p}={...K$e,enabled:e.flags.messageBanner};return r?T(q$e,{variant:i,children:[s(Y$e,{variant:i,children:s(Q$e,{icon:a,variant:i})}),s(cy,{children:o}),s(Z$e,{link:l,plausibleEvent:u,openDialog:()=>n(!0),children:c}),s(G$e,{open:t,setOpen:n,title:d||c,children:p})]}):null},J$e={warning:s(p3,{}),info:s(zd,{}),error:s(vv,{}),success:s(zm,{}),neutral:s(zd,{}),secondary:s(zd,{})},Q$e=({icon:e,variant:t})=>e==="none"?null:e?s(_x,{children:e}):J$e[t]??s(zd,{}),Z$e=({link:e,plausibleEvent:t,openDialog:n,children:r})=>{const o=ft(),i=Is();if(!e)return null;const a=e==="dialog",l=!e.startsWith("http"),c=()=>{t&&i.trackEvent("message_banner",{props:{event:t}})};return a?s(po,{onClick:()=>{c(),n()},children:r}):l?s(po,{onClick:()=>{c(),o(e)},children:r}):s(po,{href:e,target:"_blank",onClick:c,children:r})};hd.render(s(t_e,{children:s(lTe,{children:s(rB,{basename:Ba,children:s(Tte,{children:s(DTe,{children:s(ATe,{children:T(JTe,{children:[s(X$e,{}),s(aTe,{}),s(iTe,{})]})})})})})})}),document.getElementById("app"));export{_ as $,Xt as A,bi as B,X as C,h$ as D,hu as E,Re as F,fs as G,Lt as H,zv as I,Jce as J,Dv as K,jp as L,Lv as M,Er as N,Os as O,Px as P,RC as Q,mf as R,Fa as S,ke as T,Mv as U,go as V,Zn as W,As as X,uC as Y,Un as Z,Ce as _,Je as a,ff as a$,$s as a0,UO as a1,It as a2,Ll as a3,ht as a4,Da as a5,Zp as a6,ef as a7,ws as a8,rt as a9,Ue as aA,He as aB,ve as aC,Ge as aD,ur as aE,xl as aF,Xme as aG,kC as aH,Vr as aI,Ft as aJ,Cn as aK,lue as aL,yu as aM,Qr as aN,W3 as aO,cr as aP,ste as aQ,Js as aR,fue as aS,pue as aT,due as aU,ae as aV,mr as aW,on as aX,ea as aY,Sse as aZ,gn as a_,QO as aa,zpe as ab,pn as ac,pv as ad,ja as ae,uo as af,iv as ag,Tr as ah,vv as ai,pu as aj,gr as ak,xn as al,Xm as am,Kce as an,ete as ao,kp as ap,si as aq,ft as ar,ihe as as,jC as at,Nr as au,ohe as av,vu as aw,Z_ as ax,Ao as ay,We as az,
|
|
415
|
+
You can read more about it on our newest [blog post](https://www.getunleash.io/blog).`},X$e=()=>{const{uiConfig:e}=Lt(),[t,n]=f.useState(!1),{enabled:r,message:o,variant:i="neutral",icon:a,link:l,linkText:c="More info",plausibleEvent:u,dialogTitle:d,dialog:p}={...K$e,enabled:e.flags.messageBanner};return r?T(q$e,{variant:i,children:[s(Y$e,{variant:i,children:s(Q$e,{icon:a,variant:i})}),s(cy,{children:o}),s(Z$e,{link:l,plausibleEvent:u,openDialog:()=>n(!0),children:c}),s(G$e,{open:t,setOpen:n,title:d||c,children:p})]}):null},J$e={warning:s(p3,{}),info:s(zd,{}),error:s(vv,{}),success:s(zm,{}),neutral:s(zd,{}),secondary:s(zd,{})},Q$e=({icon:e,variant:t})=>e==="none"?null:e?s(_x,{children:e}):J$e[t]??s(zd,{}),Z$e=({link:e,plausibleEvent:t,openDialog:n,children:r})=>{const o=ft(),i=Is();if(!e)return null;const a=e==="dialog",l=!e.startsWith("http"),c=()=>{t&&i.trackEvent("message_banner",{props:{event:t}})};return a?s(po,{onClick:()=>{c(),n()},children:r}):l?s(po,{onClick:()=>{c(),o(e)},children:r}):s(po,{href:e,target:"_blank",onClick:c,children:r})};hd.render(s(t_e,{children:s(lTe,{children:s(rB,{basename:Ba,children:s(Tte,{children:s(DTe,{children:s(ATe,{children:T(JTe,{children:[s(X$e,{}),s(aTe,{}),s(iTe,{})]})})})})})})}),document.getElementById("app"));export{_ as $,Xt as A,bi as B,X as C,h$ as D,hu as E,Re as F,fs as G,Lt as H,zv as I,Jce as J,Dv as K,jp as L,Lv as M,Er as N,Os as O,Px as P,RC as Q,mf as R,Fa as S,ke as T,Mv as U,go as V,Zn as W,As as X,uC as Y,Un as Z,Ce as _,Je as a,ff as a$,$s as a0,UO as a1,It as a2,Ll as a3,ht as a4,Da as a5,Zp as a6,ef as a7,ws as a8,rt as a9,Ue as aA,He as aB,ve as aC,Ge as aD,ur as aE,xl as aF,Xme as aG,kC as aH,Vr as aI,Ft as aJ,Cn as aK,lue as aL,yu as aM,Qr as aN,W3 as aO,cr as aP,ste as aQ,Js as aR,fue as aS,pue as aT,due as aU,ae as aV,mr as aW,on as aX,ea as aY,Sse as aZ,gn as a_,QO as aa,zpe as ab,pn as ac,pv as ad,ja as ae,uo as af,iv as ag,Tr as ah,vv as ai,pu as aj,gr as ak,xn as al,Xm as am,Kce as an,ete as ao,kp as ap,si as aq,ft as ar,ihe as as,jC as at,Nr as au,ohe as av,vu as aw,Z_ as ax,Ao as ay,We as az,F5e as b,t2 as b$,koe as b0,C5e as b1,ti as b2,Io as b3,ZSe as b4,D2 as b5,ry as b6,N2 as b7,r5e as b8,Mhe as b9,d3 as bA,u3 as bB,PO as bC,Toe as bD,Km as bE,la as bF,Vc as bG,pf as bH,po as bI,fu as bJ,_r as bK,Cs as bL,Kee as bM,Si as bN,Is as bO,cO as bP,JM as bQ,Bh as bR,c2 as bS,V5e as bT,lf as bU,yi as bV,OR as bW,j5e as bX,xr as bY,I5e as bZ,O4 as b_,Nhe as ba,Dhe as bb,B5e as bc,G3 as bd,Tt as be,E5e as bf,Vee as bg,$x as bh,Vh as bi,ute as bj,un as bk,sxe as bl,sC as bm,g$ as bn,S4 as bo,Yi as bp,zi as bq,k5e as br,_n as bs,nte as bt,cu as bu,wx as bv,xx as bw,Sx as bx,$le as by,x5e as bz,Ke as c,Ax as c$,Wc as c0,eZ as c1,G4 as c2,z5e as c3,pL as c4,hD as c5,a3 as c6,qSe as c7,uf as c8,Gc as c9,cxe as cA,uxe as cB,dxe as cC,QSe as cD,axe as cE,ixe as cF,p3 as cG,EC as cH,QS as cI,Qo as cJ,Yg as cK,DA as cL,Wr as cM,n5e as cN,Yp as cO,jn as cP,xs as cQ,sr as cR,YO as cS,i5e as cT,R5e as cU,eL as cV,_we as cW,P5e as cX,sCe as cY,$5e as cZ,Dme as c_,wle as ca,na as cb,A5e as cc,Ps as cd,Ep as ce,jt as cf,Ss as cg,Pv as ch,ew as ci,YSe as cj,O5e as ck,uhe as cl,xxe as cm,Nse as cn,qQ as co,kle as cp,ri as cq,dpe as cr,Sp as cs,c3 as ct,yoe as cu,ZZ as cv,JP as cw,i2 as cx,exe as cy,oxe as cz,tn as d,$v as d$,ll as d0,Twe as d1,Ub as d2,uD as d3,xi as d4,Fpe as d5,Na as d6,Whe as d7,_a as d8,BD as d9,CD as dA,o5e as dB,t5e as dC,UC as dD,wD as dE,vw as dF,Zxe as dG,M2 as dH,bD as dI,Wxe as dJ,Hx as dK,g3 as dL,xte as dM,cD as dN,Nee as dO,Tde as dP,jO as dQ,WO as dR,zO as dS,Cae as dT,c8 as dU,dD as dV,Cpe as dW,W5e as dX,fwe as dY,Vb as dZ,Rxe as d_,dc as da,zTe as db,bO as dc,MTe as dd,N3 as de,SZ as df,Il as dg,Ol as dh,l5e as di,YP as dj,Vv as dk,Gv as dl,tC as dm,a5e as dn,s5e as dp,Al as dq,U5e as dr,c5e as ds,Wfe as dt,u5e as du,h5e as dv,d5e as dw,p5e as dx,f5e as dy,M4 as dz,ca as e,Vm as e$,gue as e0,En as e1,fn as e2,kn as e3,zC as e4,xh as e5,T5e as e6,wv as e7,ai as e8,Ele as e9,oke as eA,L5e as eB,wO as eC,Rpe as eD,b5e as eE,g5e as eF,v5e as eG,y5e as eH,w5e as eI,S5e as eJ,m5e as eK,Bx as eL,Use as eM,Fxe as eN,pt as eO,wt as eP,upe as eQ,Soe as eR,ppe as eS,N5e as eT,lie as eU,df as eV,X3 as eW,K3 as eX,uie as eY,M5e as eZ,Q3 as e_,Ple as ea,Rle as eb,oO as ec,lO as ed,xle as ee,Xh as ef,nTe as eg,gC as eh,zm as ei,$3 as ej,Xae as ek,Jae as el,Qae as em,Zae as en,ese as eo,Cse as ep,fO as eq,fv as er,ake as es,mke as et,Od as eu,Xee as ev,D5e as ew,Ob as ex,Vz as ey,q2 as ez,T as f,Hm as f0,wie as f1,vie as f2,eO as f3,Tie as f4,$ie as f5,sR as f6,Pie as f7,pie as f8,wp as f9,tO as fa,hC as fb,Cp as fc,V_ as fd,Rn as fe,xc as ff,oF as fg,nF as fh,_5e as fi,za as g,Ma as h,sa as i,s as j,ta as k,fo as l,Qt as m,zd as n,i3 as o,I2 as p,wbe as q,f as r,E as s,tD as t,sn as u,gD as v,wo as w,Li as x,rs as y,Ud as z};
|