1import{f as P,e as x,r as c,j as o}from"./vendor-react-CbEgFW7o.js";import{a1 as j,ce as v,a6 as $,cn as C,cj as w,l as S}from"./main-CNvMvyJ0.js";import{P as U}from"./PreviewBanner-BF237oXS.js";import"./index-DU97bhtr.js";function A(){const{companyId:a}=P(),[r,d]=x(),i=r.get("test")==="1",[t,u]=c.useState(null),[p,g]=c.useState(!0),{domain:f}=j(a);if(c.useEffect(()=>{if(!a)return;(async()=>{const{data:s}=await S.from("companies").select("id, name, description, logo_url, website, city, address, postal_code, slug, brand_color, brand_color_secondary, hero_image_url, hero_video_url, hero_overlay_opacity, about_us, quote, linkedin_url, instagram_url, facebook_url, footer_email, footer_phone").eq("id",a).single();s&&u({...s,slug:s.slug||s.id,hero_overlay_opacity:Number(s.hero_overlay_opacity)||0}),g(!1)})()},[a]),p)return o.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center text-muted-foreground",children:"Laddarâ¦"});if(!t)return o.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center text-muted-foreground",children:"Företaget hittades inte."});const h=!!t.slug&&t.slug!==t.id,m=`/admin/companies/${a}/preview/jobs`,l=r.get("testUser")||null,b=()=>{const e=new URLSearchParams(r);i?(e.delete("test"),e.delete("testUser")):e.set("test","1"),d(e)},n=i?`?test=1${l?`&testUser=${l}`:""}`:"",y=e=>{const s=new URLSearchParams(r);e?(s.set("testUser",e),s.set("test","1")):s.delete("testUser"),d(s)},_={landingCompany:t,isCompanyLanding:!0,loading:!1,getCompanyHomePath:e=>`/admin/companies/${a}/preview${n}`,jobsPath:`${m}${n}`,myApplicationsPath:`${m}${n}`,isPreview:!i,getJobDetailPath:e=>`/admin/companies/${a}/preview/jobs/${e}${n}`,getJobApplyPath:e=>`/admin/companies/${a}/preview/jobs/${e}/apply${n}`,getSpontaneousApplyPath:e=>`/spontaneous-apply/${e}`,basePath:"",getPath:e=>e,domainConfig:null,isDomainFiltered:!1,domainCompanyIds:[],isOnBrandedDomain:!1,testUserId:l};return o.jsxs(v.Provider,{value:_,children:[o.jsx(U,{label:"Lediga tjänster â förhandsgranskning",slugSuffix:"/jobs",slug:t.slug,hasSlug:h,backPath:`/admin/companies/${a}/preview`,backLabel:"Tillbaka till landningssida",testMode:i,onToggleTestMode:b,testUserId:l,onSelectTestUser:y,customDomain:f}),o.jsxs($,{brandColor:t.brand_color,brandColorSecondary:t.brand_color_secondary,children:[o.jsx(C,{}),o.jsx(w,{})]})]})}export{A 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.