1import{f as u,r as d,j as s}from"./react-vendor-CSsSSEML.js";import{z as r,x as p,S as g}from"./index-BVsjb7mB.js";import{c as m}from"./tanstack-vendor-D2LStv3_.js";import{C as b}from"./Card-BaivSs1M.js";import"./sentry-vendor-DQkRq1-W.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"33b2f1a2eb67da61a8a79f4c3c0fca45c630c2e5"};var e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="499b753f-6b08-44c7-ab92-8285dd495480",t._sentryDebugIdIdentifier="sentry-dbid-499b753f-6b08-44c7-ab92-8285dd495480")}catch{}})();const f="/zopnight/app/settings/integrations";function y(t){return typeof t=="string"&&(t.startsWith("/zopnight/app")||t.startsWith("/zopday/app"))?t:f}function w(){const[t]=u(),e=m(),a=t.get("installation_id"),i=t.get("state"),o=t.get("setup_action")||"install",c=d.useRef(!1);return d.useEffect(()=>{if(c.current)return;c.current=!0;const l=()=>{let n=f;try{n=y(sessionStorage.getItem("ghAppReturnTo")),sessionStorage.removeItem("ghAppReturnTo")}catch{}window.location.assign(n)};if(!a||!i){r.error("Missing installation_id or state in callback URL"),l();return}(async()=>{try{await p.get("/integrations/github/callback",{installation_id:a,state:i,setup_action:o}),await e.invalidateQueries({queryKey:["integrations"]}),r.success("GitHub connected")}catch(n){r.error(n?.message||"Failed to finalize GitHub install")}finally{l()}})()},[a,i,o,e]),s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsxs(b,{className:"p-8 flex flex-col items-center gap-3 text-text-secondary",children:[s.jsx(g,{}),s.jsx("p",{className:"text-base font-medium text-text-primary",children:"Finalizing GitHub installâ¦"}),s.jsx("p",{className:"text-sm",children:"Just a moment."})]})})}export{w as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.