import{u as f,_ as b,C as k,O as _}from"./index-DruWBKkm.js";import{m as y,f as h,g as T,h as m,o as u,w as g,a as r,n as M,j as x,k as E,T as d,B as S,u as p}from"./index-CdEV5Lsj.js";import{_ as $,a as A}from"./BasePage-aJlR_RJI.js";import{_ as C}from"./UCard.vue_vue_type_script_setup_true_lang-ChrBK72a.js";import{_ as w}from"./UCheckbox.vue_vue_type_script_setup_true_lang-BeIZw2lc.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CBOjoWJ-.js";import"./ULabel.vue_vue_type_script_setup_true_lang-DmdMPZfT.js";const V={__name:"AnalyticsCheckbox",props:y({label:{type:String,default:""},description:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const e=h(s,"modelValue"),n=T(()=>({"border-gray-300 bg-white":!e.value,"border-brand-600 bg-brand-50":e.value}));return(c,a)=>{const i=w,t=$,l=C;return u(),m(l,{padding:"sm",class:M(n.value)},{default:g(()=>[r(i,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),label:s.label},null,8,["modelValue","label"]),r(t,{size:"sm",class:"mt-2 text-gray-400",html:s.description},null,8,["html"])]),_:1},8,["class"])}}},D={__name:"Page",setup(s){const e=f(),n=x({isMixpanelTrackingEnabled:!1});E(async()=>{var t;Object.keys(e.analytics).length||await e.getAnalytics(),n.isMixpanelTrackingEnabled=(t=e.analytics)==null?void 0:t.isMixpanelTrackingEnabled,d.toggleTracking(n.isMixpanelTrackingEnabled);const i=S.getAuthAdmin();if(i&&!n.isMixpanelTrackingEnabled){const l=window.location.pathname.split("/")[1]||"";let o=`trackingOptInDismissed_${i.id}=true; path=/${l}; SameSite=Lax`;window.location.protocol==="https:"&&(o+="; Secure"),document.cookie=o}});async function c(a){var t;n.isMixpanelTrackingEnabled!==((t=e.analytics)==null?void 0:t.isMixpanelTrackingEnabled)&&(await e.updateAnalytics(n),e.analytics.isMixpanelTrackingEnabled=n.isMixpanelTrackingEnabled,d.toggleTracking(n.isMixpanelTrackingEnabled)),a()}return(a,i)=>{const t=b;return u(),m(A,{group:a.$t("group.analytics"),"group-step":p(_),title:a.$t("title.analytics"),description:a.$t("description.analytics"),next:{name:"GettingStarted/Company/Step1"},onContinue:c},{default:g(()=>[r(V,{modelValue:n.isMixpanelTrackingEnabled,"onUpdate:modelValue":i[0]||(i[0]=l=>n.isMixpanelTrackingEnabled=l),label:a.$t("label.allowTracking"),description:a.$t("description.tracking")},null,8,["modelValue","label","description"]),r(t,{label:a.$t("label.learnMore"),href:p(k).mixpanelLearnMore,underlined:"",target:"_blank"},null,8,["label","href"])]),_:1},8,["group","group-step","title","description"])}}};export{D as default};
