PageSourceSearch

https://app.hightouch.com/assets/settings-CqDjJ-I2.js

js hightouch.com collected 2026-09-24 07:25:08 UTC 3,731 bytes, 2 lines download raw bytes

1import{da as F,db as C,dc as M,dd as S,cg as L,an as I,af as e,aC as u,av as O}from"./vendor-B2oIjyY4.js";import{dZ as E,en as R,B$ as T,C0 as k,aT as q,_ as P,C as B,eM as U,aW as p,dQ as N,e2 as Q,e3 as W,L as j,aY as v,e4 as Y,ag as H,ai as V,bR as Z,ah as $}from"./main-CJK8sxkW.js";import{u as z}from"./outlet-CRFGt_DD.js";import{a as G,g as J,L as K,R as X}from"./label-form-BwQlS3dY.js";import{u as ee}from"./use-audience-edit-lock-BN9FTZ7E.js";import{u as ae}from"./use-audience-overview-dashboard-select-options-BlbZGAzs.js";import{c as re}from"./permissions-DfhkLsaG.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";import"./constants-B2IlNFDy.js";var x,D;function ie(){if(D)return x;D=1;var r=F(),o=C(),h=M(),s=S(),t=h(function(l,b){return s(l)?r(l,o(b,1,s,!0)):[]});return x=t,x}var se=ie();const te=L(se),y=[],xe=()=>{var _;const{audience:r,parentModel:o}=z(),{audienceOverviewEnabled:h}=I(),s=ae({parentModelId:o.id.toString()}),t=E({parentModelId:o.id.toString()}),l=R(),b=T(),w=k(),f=r.audience_primary_metrics.map(({metric_id:a})=>a)??y,i=q({values:{name:r.name,description:r.description??"",labels:J(r.labels),dashboard_id:((_=r.audience_overview)==null?void 0:_.dashboard_id)??s.defaultDashboardId,primary_metric_ids:f},onSubmit:async a=>{await l.mutateAsync({id:r.id,input:{name:a.name,description:a.description,tags:G(a.labels)}}),await b.mutateAsync({audience_id:r.id,dashboard_id:a.dashboard_id===s.defaultDashboardId?null:a.dashboard_id});const m=te(f,a.primary_metric_ids);await w.mutateAsync({add:a.primary_metric_ids.map(n=>({audience_id:r.id.toString(),metric_id:n})),remove:m.map(n=>({audience_id:{_eq:r.id.toString()},metric_id:{_eq:n}}))})}}),{canUpdate:d}=ee(r),{isPermitted:A}=P(re(o.id.toString()));return e.jsxs(B,{children:[e.jsxs(U,{children:[e.jsx(u,{control:i.control,name:"name",render:({field:a})=>e.jsx(p,{label:"Name",children:e.jsx(N,{...a,placeholder:"Enter a name…",isDisabled:!d})})}),e.jsx(u,{control:i.control,name:"description",render:({field:a})=>e.jsx(p,{label:"Description",children:e.jsx(Q,{...a,placeholder:"Enter a description…",isDisabled:!d,width:"100%"})})}),e.jsx(O,{...i,children:e.jsx(K,{heading:"Labels",resourceType:X.Model,isDisabled:!d})}),h&&!r.is_realtime_audience&&e.jsxs(e.Fragment,{children:[e.jsx(u,{control:i.control,name:"dashboard_id",render:({field:a})=>e.jsx(p,{label:"Overview dashboard",description:e.jsxs(e.Fragment,{children:["Choose a dashboard to display on this audience’s overview page. This will update the dashboard for everyone in your workspace."," ",A&&e.jsxs(j,{href:"/dashboards/new",isExternal:!0,children:["Create a new dashboard ",e.jsx(v,{})]})]}),children:e.jsx(W,{...a,...s,isDisabled:!d,width:"100%"})})}),e.jsx(u,{control:i.control,name:"primary_metric_ids",render:({field:a})=>{var m,n,g;return e.jsx(p,{label:"Primary metrics",isOptional:!0,description:e.jsxs(e.Fragment,{children:["Choose saved metrics to feature on this audience’s overview page."," ",e.jsxs(j,{href:"/metrics/new",isExternal:!0,children:["Create a new metric ",e.jsx(v,{})]})]}),children:e.jsx(Y,{isClearable:!0,isDisabled:((m=t.data)==null?void 0:m.goals.length)===0,isLoading:t.isLoading,placeholder:((n=t.data)==null?void 0:n.goals.length)===0?"No saved metrics available to select":"Select metrics…",options:((g=t.data)==null?void 0:g.goals)??y,optionLabel:c=>c.name,optionDescription:c=>c.description??"",optionValue:c=>c.id,...a})})}})]})]}),e.jsxs(H,{isDisabled:!d||!i.formState.isDirty,children:[e.jsx(V,{icon:Z,onClick:()=>i.reset(),children:"Discard changes"}),e.jsx($,{onClick:()=>{i.submit()},children:"Save changes"})]})]})};export{xe as AudienceSettings};
2//# sourceMappingURL=settings-CqDjJ-I2.js.map

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.