@techdocs/cli
Version:
Utility CLI for managing TechDocs sites in Backstage.
11 lines (10 loc) • 11.1 kB
JavaScript
;(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[3720],{25534:(lt,G,I)=>{var c,ot=I(4293),y=I(78920);c={value:!0},G.A=void 0;var p=y(I(14041)),z=ot(I(74044)),a=(0,z.default)(p.createElement("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.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"}),"AddCircleOutline");G.A=a},93296:(lt,G,I)=>{/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var c=I(14041);function ot(h,E){return h===E&&(h!==0||1/h===1/E)||h!==h&&E!==E}var y=typeof Object.is=="function"?Object.is:ot,p=c.useState,z=c.useEffect,a=c.useLayoutEffect,A=c.useDebugValue;function F(h,E){var M=E(),j=p({inst:{value:M,getSnapshot:E}}),L=j[0].inst,$=j[1];return a(function(){L.value=M,L.getSnapshot=E,rt(L)&&$({inst:L})},[h,M,E]),z(function(){return rt(L)&&$({inst:L}),h(function(){rt(L)&&$({inst:L})})},[h]),A(M),M}function rt(h){var E=h.getSnapshot;h=h.value;try{var M=E();return!y(h,M)}catch{return!0}}function K(h,E){return E()}var _t=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?K:F;G.useSyncExternalStore=c.useSyncExternalStore!==void 0?c.useSyncExternalStore:_t},58139:(lt,G,I)=>{lt.exports=I(93296)},68721:(lt,G,I)=>{I.d(G,{Ay:()=>ge});var c=I(14041),ot=I(58139);const y=()=>{},p=y(),z=Object,a=t=>t===p,A=t=>typeof t=="function",F=(t,e)=>({...t,...e}),rt=t=>A(t.then),K=new WeakMap;let _t=0;const h=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let s,o;if(z(t)===t&&!r&&n!=RegExp){if(s=K.get(t),s)return s;if(s=++_t+"~",K.set(t,s),n==Array){for(s="@",o=0;o<t.length;o++)s+=h(t[o])+",";K.set(t,s)}if(n==z){s="#";const u=z.keys(t).sort();for(;!a(o=u.pop());)a(t[o])||(s+=o+":"+h(t[o])+",");K.set(t,s)}}else s=r?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return s},E=new WeakMap,M={},j={},L="undefined",$=typeof window!=L,pt=typeof document!=L,Zt=()=>$&&typeof window.requestAnimationFrame!=L,Vt=(t,e)=>{const n=E.get(t);return[()=>!a(e)&&t.get(e)||M,r=>{if(!a(e)){const s=t.get(e);e in j||(j[e]=s),n[5](e,F(s,r),s||M)}},n[6],()=>!a(e)&&e in j?j[e]:!a(e)&&t.get(e)||M]};let St=!0;const te=()=>St,[mt,gt]=$&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[y,y],ee=()=>{const t=pt&&document.visibilityState;return a(t)||t!=="hidden"},ne=t=>(pt&&document.addEventListener("visibilitychange",t),mt("focus",t),()=>{pt&&document.removeEventListener("visibilitychange",t),gt("focus",t)}),se=t=>{const e=()=>{St=!0,t()},n=()=>{St=!1};return mt("online",e),mt("offline",n),()=>{gt("online",e),gt("offline",n)}},oe={isOnline:te,isVisible:ee},re={initFocus:ne,initReconnect:se},It=!c.useId,it=!$||"Deno"in window,ie=t=>Zt()?window.requestAnimationFrame(t):setTimeout(t,1),ft=it?c.useEffect:c.useLayoutEffect,Tt=typeof navigator<"u"&&navigator.connection,yt=!it&&Tt&&(["slow-2g","2g"].includes(Tt.effectiveType)||Tt.saveData),dt=t=>{if(A(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?h(t):"",[t,e]};let ae=0;const wt=()=>++ae,Lt=0,Nt=1,Ft=2;var at={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:Lt,MUTATE_EVENT:Ft,RECONNECT_EVENT:Nt};async function Mt(...t){const[e,n,r,s]=t,o=F({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let u=o.populateCache;const R=o.rollbackOnError;let l=o.optimisticData;const W=D=>typeof R=="function"?R(D):R!==!1,w=o.throwOnError;if(A(n)){const D=n,S=[],P=e.keys();for(const g of P)!/^\$(inf|sub)\$/.test(g)&&D(e.get(g)._k)&&S.push(g);return Promise.all(S.map(m))}return m(n);async function m(D){const[S]=dt(D);if(!S)return;const[P,g]=Vt(e,S),[Dt,i,Rt,ct]=E.get(e),B=()=>{const x=Dt[S];return(A(o.revalidate)?o.revalidate(P().data,D):o.revalidate!==!1)&&(delete Rt[S],delete ct[S],x&&x[0])?x[0](Ft).then(()=>P().data):P().data};if(t.length<3)return B();let C=r,V;const Y=wt();i[S]=[Y,0];const _=!a(l),X=P(),U=X.data,Q=X._c,J=a(Q)?U:Q;if(_&&(l=A(l)?l(J,U):l,g({data:l,_c:J})),A(C))try{C=C(J)}catch(x){V=x}if(C&&rt(C))if(C=await C.catch(x=>{V=x}),Y!==i[S][0]){if(V)throw V;return C}else V&&_&&W(V)&&(u=!0,g({data:J,_c:p}));if(u&&!V)if(A(u)){const x=u(C,J);g({data:x,error:p,_c:p})}else g({data:C,error:p,_c:p});if(i[S][1]=wt(),Promise.resolve(B()).then(()=>{g({_c:p})}),V){if(w)throw V;return}return C}}const Wt=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},xt=(t,e)=>{if(!E.has(t)){const n=F(re,e),r={},s=Mt.bind(p,t);let o=y;const u={},R=(w,m)=>{const D=u[w]||[];return u[w]=D,D.push(m),()=>D.splice(D.indexOf(m),1)},l=(w,m,D)=>{t.set(w,m);const S=u[w];if(S)for(const P of S)P(m,D)},W=()=>{if(!E.has(t)&&(E.set(t,[r,{},{},{},s,l,R]),!it)){const w=n.initFocus(setTimeout.bind(p,Wt.bind(p,r,Lt))),m=n.initReconnect(setTimeout.bind(p,Wt.bind(p,r,Nt)));o=()=>{w&&w(),m&&m(),E.delete(t)}}};return W(),[t,s,W,o]}return[t,E.get(t)[4]]},ce=(t,e,n,r,s)=>{const o=n.errorRetryCount,u=s.retryCount,R=~~((Math.random()+.5)*(1<<(u<8?u:8)))*n.errorRetryInterval;!a(o)&&u>o||setTimeout(r,R,s)},ue=(t,e)=>h(t)==h(e),[Et,le]=xt(new Map),Pt=F({onLoadingSlow:y,onSuccess:y,onError:y,onErrorRetry:ce,onDiscarded:y,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:yt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:yt?5e3:3e3,compare:ue,isPaused:()=>!1,cache:Et,mutate:le,fallback:{}},oe),Ut=(t,e)=>{const n=F(t,e);if(e){const{use:r,fallback:s}=t,{use:o,fallback:u}=e;r&&o&&(n.use=r.concat(o)),s&&u&&(n.fallback=F(s,u))}return n},Ct=(0,c.createContext)({}),fe=t=>{const{value:e}=t,n=(0,c.useContext)(Ct),r=A(e),s=(0,c.useMemo)(()=>r?e(n):e,[r,n,e]),o=(0,c.useMemo)(()=>r?s:Ut(n,s),[r,n,s]),u=s&&s.provider,R=(0,c.useRef)(p);u&&!R.current&&(R.current=xt(u(o.cache||Et),s));const l=R.current;return l&&(o.cache=l[0],o.mutate=l[1]),ft(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,c.createElement)(Ct.Provider,F(t,{value:o}))},de="$inf$",kt=$&&window.__SWR_DEVTOOLS_USE__,Ee=kt?window.__SWR_DEVTOOLS_USE__:[],Re=()=>{kt&&(window.__SWR_DEVTOOLS_REACT__=c)},Ht=t=>A(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],he=()=>F(Pt,(0,c.useContext)(Ct)),Ae=(t,e)=>{const[n,r]=dt(t),[,,,s]=E.get(Et);if(s[n])return s[n];const o=e(r);return s[n]=o,o},ve=t=>(e,n,r)=>t(e,n&&((...o)=>{const[u]=dt(e),[,,,R]=E.get(Et);if(u.startsWith(de))return n(...o);const l=R[u];return a(l)?n(...o):(delete R[u],l)}),r),_e=Ee.concat(ve),pe=t=>function(...n){const r=he(),[s,o,u]=Ht(n),R=Ut(r,u);let l=t;const{use:W}=R,w=(W||[]).concat(_e);for(let m=w.length;m--;)l=w[m](l);return l(s,o||R.fetcher||null,R)},Se=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const s=r.indexOf(n);s>=0&&(r[s]=r[r.length-1],r.pop())}},Ve=(t,e)=>(...n)=>{const[r,s,o]=Ht(n),u=(o.use||[]).concat(e);return t(r,s,{...o,use:u})};Re();const Ie=t=>serialize(t)[0],qt=c.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)}),Ot={dedupe:!0},me=(t,e,n)=>{const{cache:r,compare:s,suspense:o,fallbackData:u,revalidateOnMount:R,revalidateIfStale:l,refreshInterval:W,refreshWhenHidden:w,refreshWhenOffline:m,keepPreviousData:D}=n,[S,P,g,Dt]=E.get(r),[i,Rt]=dt(t),ct=(0,c.useRef)(!1),B=(0,c.useRef)(!1),C=(0,c.useRef)(i),V=(0,c.useRef)(e),Y=(0,c.useRef)(n),_=()=>Y.current,X=()=>_().isVisible()&&_().isOnline(),[U,Q,J,x]=Vt(r,i),Z=(0,c.useRef)({}).current,Te=a(u)?n.fallback[i]:u,zt=(f,d)=>{for(const O in Z){const v=O;if(v==="data"){if(!s(f[v],d[v])&&(!a(f[v])||!s(vt,d[v])))return!1}else if(d[v]!==f[v])return!1}return!0},jt=(0,c.useMemo)(()=>{const f=!i||!e?!1:a(R)?_().isPaused()||o?!1:a(l)?!0:l:R,d=b=>{const H=F(b);return delete H._k,f?{isValidating:!0,isLoading:!0,...H}:H},O=U(),v=x(),k=d(O),st=O===v?k:d(v);let T=k;return[()=>{const b=d(U());return zt(b,T)?(T.data=b.data,T.isLoading=b.isLoading,T.isValidating=b.isValidating,T.error=b.error,T):(T=b,b)},()=>st]},[r,i]),tt=(0,ot.useSyncExternalStore)((0,c.useCallback)(f=>J(i,(d,O)=>{zt(O,d)||f()}),[r,i]),jt[0],jt[1]),$t=!ct.current,we=S[i]&&S[i].length>0,et=tt.data,nt=a(et)?Te:et,ht=tt.error,Bt=(0,c.useRef)(nt),vt=D?a(et)?Bt.current:et:nt,Gt=we&&!a(ht)?!1:$t&&!a(R)?R:_().isPaused()?!1:o?a(nt)?!1:l:a(nt)||l,Jt=!!(i&&e&&$t&&Gt),Ce=a(tt.isValidating)?Jt:tt.isValidating,Oe=a(tt.isLoading)?Jt:tt.isLoading,ut=(0,c.useCallback)(async f=>{const d=V.current;if(!i||!d||B.current||_().isPaused())return!1;let O,v,k=!0;const st=f||{},T=!g[i]||!st.dedupe,b=()=>It?!B.current&&i===C.current&&ct.current:i===C.current,H={isValidating:!1,isLoading:!1},Yt=()=>{Q(H)},Xt=()=>{const N=g[i];N&&N[1]===v&&delete g[i]},Qt={isValidating:!0};a(U().data)&&(Qt.isLoading=!0);try{if(T&&(Q(Qt),n.loadingTimeout&&a(U().data)&&setTimeout(()=>{k&&b()&&_().onLoadingSlow(i,n)},n.loadingTimeout),g[i]=[d(Rt),wt()]),[O,v]=g[i],O=await O,T&&setTimeout(Xt,n.dedupingInterval),!g[i]||g[i][1]!==v)return T&&b()&&_().onDiscarded(i),!1;H.error=p;const N=P[i];if(!a(N)&&(v<=N[0]||v<=N[1]||N[1]===0))return Yt(),T&&b()&&_().onDiscarded(i),!1;const q=U().data;H.data=s(q,O)?q:O,T&&b()&&_().onSuccess(O,i,n)}catch(N){Xt();const q=_(),{shouldRetryOnError:bt}=q;q.isPaused()||(H.error=N,T&&b()&&(q.onError(N,i,q),(bt===!0||A(bt)&&bt(N))&&(!_().revalidateOnFocus||!_().revalidateOnReconnect||X())&&q.onErrorRetry(N,i,q,De=>{const At=S[i];At&&At[0]&&At[0](at.ERROR_REVALIDATE_EVENT,De)},{retryCount:(st.retryCount||0)+1,dedupe:!0})))}return k=!1,Yt(),!0},[i,r]),Kt=(0,c.useCallback)((...f)=>Mt(r,C.current,...f),[]);if(ft(()=>{V.current=e,Y.current=n,a(et)||(Bt.current=et)}),ft(()=>{if(!i)return;const f=ut.bind(p,Ot);let d=0;const v=Se(i,S,(k,st={})=>{if(k==at.FOCUS_EVENT){const T=Date.now();_().revalidateOnFocus&&T>d&&X()&&(d=T+_().focusThrottleInterval,f())}else if(k==at.RECONNECT_EVENT)_().revalidateOnReconnect&&X()&&f();else{if(k==at.MUTATE_EVENT)return ut();if(k==at.ERROR_REVALIDATE_EVENT)return ut(st)}});return B.current=!1,C.current=i,ct.current=!0,Q({_k:Rt}),Gt&&(a(nt)||it?f():ie(f)),()=>{B.current=!0,v()}},[i]),ft(()=>{let f;function d(){const v=A(W)?W(U().data):W;v&&f!==-1&&(f=setTimeout(O,v))}function O(){!U().error&&(w||_().isVisible())&&(m||_().isOnline())?ut(Ot).then(d):d()}return d(),()=>{f&&(clearTimeout(f),f=-1)}},[W,w,m,i]),(0,c.useDebugValue)(vt),o&&a(nt)&&i){if(!It&&it)throw new Error("Fallback data is required when using suspense in SSR.");V.current=e,Y.current=n,B.current=!1;const f=Dt[i];if(!a(f)){const d=Kt(f);qt(d)}if(a(ht)){const d=ut(Ot);a(vt)||(d.status="fulfilled",d.value=!0),qt(d)}else throw ht}return{mutate:Kt,get data(){return Z.data=!0,vt},get error(){return Z.error=!0,ht},get isValidating(){return Z.isValidating=!0,Ce},get isLoading(){return Z.isLoading=!0,Oe}}},ye=z.defineProperty(fe,"defaultValue",{value:Pt}),ge=pe(me)}}]);})();
//# sourceMappingURL=3720.646b3e89.chunk.js.map